/* ============================================================
   3 PANDA — Modern Design System
   ============================================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Anek+Bangla:wght@100..800&family=Poppins:wght@300;400;500;600;700;800;900&display=swap');

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Design Tokens */
:root {
    /* Colors */
    --red:          #C62828;
    --red-dark:     #8E0000;
    --red-light:    #FF5F52;
    --red-glow:     rgba(198, 40, 40, 0.15);
    --red-subtle:   #FFF0F0;

    --bg:           #FAFAFA;
    --bg-warm:      #FFF8F6;
    --surface:      #FFFFFF;
    --surface-hover:#FEFEFE;
    --surface-soft: #FCFCFD;

    --charcoal:     #1A1A2E;
    --charcoal-mid: #2D2D44;
    --charcoal-light:#3E3E5A;

    --text:         #1A1A2E;
    --text-secondary:#6B7280;
    --text-light:   #9CA3AF;
    --text-inverse: rgba(255,255,255,.85);

    --border:       #E5E7EB;
    --border-light: #F3F4F6;
    --focus-ring:   rgba(198, 40, 40, 0.22);

    /* Shadows */
    --shadow-xs:    0 1px 2px rgba(0,0,0,.04);
    --shadow-sm:    0 2px 8px rgba(0,0,0,.06);
    --shadow-md:    0 4px 16px rgba(0,0,0,.08);
    --shadow-lg:    0 8px 32px rgba(0,0,0,.10);
    --shadow-xl:    0 16px 48px rgba(0,0,0,.12);
    --shadow-red:   0 4px 20px rgba(198,40,40,.25);

    /* Layout */
    --radius-sm:    8px;
    --radius:       12px;
    --radius-lg:    16px;
    --radius-xl:    24px;
    --radius-full:  9999px;

    /* Motion */
    --ease:           cubic-bezier(.4, 0, .2, 1);
    --ease-bounce:    cubic-bezier(.34, 1.56, .64, 1);
    --duration:       .3s;
    --duration-slow:  .5s;

    /* Premium Motion System */
    --motion-smooth:  cubic-bezier(0.16, 1, 0.3, 1);   /* expo-out: snappy arrival */
    --motion-spring:  cubic-bezier(0.34, 1.56, 0.64, 1); /* overshoot for micro */
    --motion-soft:    cubic-bezier(0.45, 0, 0.15, 1);    /* gentle ease */
    --motion-duration:0.8s;
    --motion-stagger: 0.06s;

    /* Typography */
    --font-heading: 'Poppins', 'Anek Bangla', system-ui, sans-serif;
    --font-body:    'Poppins', 'Anek Bangla', system-ui, sans-serif;
}

/* Base */
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    width: 100%;
}

/* Lenis smooth scroll compatibility */
html.lenis, html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    padding-top: 4.25rem;
    overflow-x: hidden;
    width: 100%;
    position: relative;
    background-image:
        radial-gradient(circle at 14% -5%, rgba(198, 40, 40, 0.055), transparent 34%),
        radial-gradient(circle at 90% 18%, rgba(15, 23, 42, 0.035), transparent 30%);
}

/* Prefer Anek Bangla for Bengali content where language metadata is present */
:lang(bn),
[lang="bn"],
[lang^="bn-"] {
    font-family: 'Anek Bangla', var(--font-body);
}

a {
    color: var(--red);
    text-decoration: none;
    transition: color var(--duration) var(--ease);
}

a:hover { color: var(--red-dark); }

img { display: block; max-width: 100%; }

/* Focus styles */
:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 2px;
}

/* ============================================================
   PREMIUM MOTION SYSTEM — Scroll Reveals & Page Load
   GPU-only: transform + opacity + filter (no layout triggers)
   ============================================================ */

/* Base hidden state for all reveal elements */
[data-reveal] {
    opacity: 0;
    will-change: transform, opacity;
    transition:
        opacity var(--motion-duration) var(--motion-smooth),
        transform var(--motion-duration) var(--motion-smooth),
        filter var(--motion-duration) var(--motion-smooth);
    transition-delay: calc(var(--reveal-index, 0) * var(--motion-stagger));
}

/* Reveal types — initial transform states */
[data-reveal],
[data-reveal="up"] {
    transform: translateY(40px);
}

[data-reveal="down"] {
    transform: translateY(-40px);
}

[data-reveal="left"] {
    transform: translateX(-50px);
}

[data-reveal="right"] {
    transform: translateX(50px);
}

[data-reveal="scale"] {
    transform: scale(0.88);
}

[data-reveal="blur"] {
    transform: translateY(20px);
    filter: blur(8px);
}

[data-reveal="flip"] {
    transform: perspective(800px) rotateX(8deg) translateY(30px);
    transform-origin: bottom center;
}

[data-reveal="fade"] {
    transform: none;
}

/* Revealed state — applies to all types */
[data-reveal].is-revealed {
    opacity: 1;
    transform: none;
    filter: blur(0);
}

/* Dynamic stagger for children inside a stagger group */
[data-stagger] > * {
    opacity: 0;
    transform: translateY(24px);
    will-change: transform, opacity;
    transition:
        opacity 0.6s var(--motion-smooth),
        transform 0.6s var(--motion-smooth);
    transition-delay: calc(var(--child-index, 0) * var(--motion-stagger));
}

[data-stagger].is-revealed > * {
    opacity: 1;
    transform: translateY(0);
}

/* Page load entrance choreography */
.page-loading [data-reveal],
.page-loading [data-stagger] > * {
    transition-duration: 0s !important;
}

/* Backward compatibility: map old data-animate to new system via JS */
[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity .7s var(--motion-smooth), transform .7s var(--motion-smooth);
}

[data-animate="slide-left"] { transform: translateX(-40px); }
[data-animate="slide-right"] { transform: translateX(40px); }
[data-animate="scale"] { transform: scale(.92); }
[data-animate="fade"] { transform: none; }

[data-animate].animate-in,
[data-animate].is-revealed {
    opacity: 1;
    transform: none;
}

[data-stagger].animate-in > * {
    opacity: 1;
    transform: translateY(0);
}

/* Parallax utility */
[data-parallax] {
    will-change: transform;
    transition: transform 0.1s linear;
}

/* ============================================================
   NAVBAR
   ============================================================ */

.navbar {
    background: var(--surface);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .72rem 2rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
    border-bottom: 1px solid var(--border-light);
    transition: background .35s var(--motion-smooth),
                box-shadow .35s var(--motion-smooth),
                backdrop-filter .35s var(--motion-smooth),
                transform .4s var(--motion-smooth);
}

/* Smart auto-hide navbar on scroll down */
.navbar.nav-hidden {
    transform: translateY(-100%);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, .85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 1px 12px rgba(0,0,0,.06);
    border-bottom-color: transparent;
}

.navbar .brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -.02em;
}

.navbar .brand:hover {
    color: var(--red);
}

.navbar .brand img {
    height: 42px;
    width: auto;
    object-fit: contain;
}

.navbar .brand svg { display: none; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: .92rem;
    transition: color var(--duration) var(--ease);
    position: relative;
    letter-spacing: .01em;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--red);
    transition: width var(--duration) var(--ease);
    border-radius: 1px;
}

.nav-links a:hover {
    color: var(--text);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links .btn-nav {
    background: var(--red);
    color: #fff !important;
    padding: .5rem 1.4rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: .88rem;
    letter-spacing: .03em;
    transition: background var(--duration) var(--ease),
                transform var(--duration) var(--ease),
                box-shadow var(--duration) var(--ease);
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.nav-links .btn-nav::after { display: none; }

.nav-links .btn-nav:hover {
    background: var(--red-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-red);
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 4px;
    border: none;
    background: none;
    z-index: 101;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all var(--duration) var(--ease);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

#dynamic-nav { display: contents; }

/* ============================================================
   CONTAINERS
   ============================================================ */

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 2.25rem 1.8rem;
}

.container-sm {
    max-width: 520px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

/* Give admin dashboard more usable desktop width */
.admin-page .container {
    max-width: 1400px;
}

/* ============================================================
   HERO SECTION
   ============================================================ */

.hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
    grid-template-areas:
        'copy art'
        'actions art';
    column-gap: 2rem;
    row-gap: 1rem;
    align-items: end;
    text-align: left;
    padding: 4rem 2rem 3rem;
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
}

.hero-copy {
    grid-area: copy;
    max-width: 560px;
}

.hero-actions {
    grid-area: actions;
}

.hero-art-wrap {
    grid-area: art;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
}

.hero-art {
    width: min(100%, 500px);
    max-height: 520px;
    height: auto;
    object-fit: contain;
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    color: var(--text);
    line-height: 1.1;
    margin-bottom: .75rem;
    letter-spacing: -.03em;
}

.hero h1 em {
    font-style: italic;
    color: var(--red);
    display: block;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 500px;
    line-height: 1.7;
}

/* Search bar in hero */
.hero-search {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-top: 1.75rem;
    max-width: 540px;
}

.hero-search input {
    flex: 1;
    padding: .85rem 1.2rem .85rem 2.8rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    font-size: .95rem;
    font-family: var(--font-body);
    background: var(--surface);
    transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: .9rem center;
}

.hero-search input:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 4px var(--red-glow);
}

.hero-search .btn {
    white-space: nowrap;
}

/* Promo banner */
.promo-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1rem 1.5rem;
    background: var(--charcoal);
    border-radius: var(--radius-lg);
    color: #fff;
    max-width: 540px;
}

.promo-banner .promo-text {
    flex: 1;
}

.promo-banner .promo-text strong {
    display: block;
    font-family: var(--font-heading);
    font-size: .95rem;
    margin-bottom: .15rem;
}

.promo-banner .promo-text span {
    font-size: .82rem;
    color: rgba(255,255,255,.7);
}

.promo-badge {
    background: var(--red);
    color: #fff;
    padding: .5rem 1rem;
    border-radius: var(--radius);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    white-space: nowrap;
}

/* ============================================================
   SECTION TITLES
   ============================================================ */

.section-label {
    font-family: var(--font-heading);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--red);
    margin-bottom: .25rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: .6rem;
    letter-spacing: -.02em;
}

.section-title svg {
    color: var(--red);
    flex-shrink: 0;
}

.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.section-header .view-all {
    font-size: .88rem;
    font-weight: 600;
    color: var(--red);
    letter-spacing: .02em;
    padding: .32rem .62rem;
    border-radius: var(--radius-full);
    transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}

.section-header .view-all:hover {
    color: var(--red-dark);
    background: var(--red-subtle);
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    transform-style: preserve-3d;
    min-width: 0;
    /* overflow removed — JS owns 3D transform; use clip on img instead */
}

@supports (content-visibility: auto) {
    /* Skip rendering work for off-screen cards on low-end/mobile devices.
       Exclude delivery-order-card — it contains dropdowns that must overflow. */
    .card:not(.delivery-order-card),
    .rest-carousel .carousel-card,
    .vendor-rest-card {
        content-visibility: auto;
        contain-intrinsic-size: auto 360px;
    }
}

/* Delivery order cards need visible overflow so the custom dropdown menu
   can render outside the card boundary (like the admin dashboard). */
.delivery-order-card {
    overflow: visible;
}

/* Elevate card z-index when a dropdown inside it is open so it overlaps sibling cards */
.card:has(.custom-dropdown.is-open) {
    z-index: 50;
    position: relative;
}


.card-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: linear-gradient(135deg, #f5f5f5, #ebebeb);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card-body {
    padding: 1.05rem 1.2rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-body h3 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: .3rem;
    letter-spacing: -.01em;
}

.restaurant-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

.restaurant-info-btn {
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-size: .86rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--duration) var(--ease), color var(--duration) var(--ease), border-color var(--duration) var(--ease);
    flex-shrink: 0;
}

.restaurant-info-btn:hover {
    background: var(--red-subtle);
    color: var(--red-dark);
    border-color: #FECACA;
}

.card-body p {
    color: var(--text-secondary);
    font-size: .88rem;
    line-height: 1.5;
}

.card-body .card-desc {
    font-size: .82rem;
    color: var(--text-light);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: .15rem;
}

.card-body .price {
    color: var(--red);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    margin-top: auto;
    padding-top: .4rem;
    text-align: right;
}

.card-body .card-meta {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-top: .5rem;
    font-size: .8rem;
    color: var(--text-light);
}

.card-body .card-meta span {
    display: flex;
    align-items: center;
    gap: .25rem;
}

/* ============================================================
   GRID
   ============================================================ */

.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .65rem 1.5rem;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: .92rem;
    font-weight: 600;
    min-height: 2.55rem;
    transition: all var(--duration) var(--ease);
    letter-spacing: .01em;
}

.btn-primary {
    background: var(--red);
    color: #fff;
}

.btn-primary:hover {
    background: var(--red-dark);
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-red), 0 0 20px rgba(198,40,40,.15);
}

.btn-primary:active {
    transform: translateY(0) scale(0.97);
    box-shadow: none;
    transition-duration: 0.1s;
}

.btn-secondary {
    background: var(--surface-soft);
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: #F3F5F8;
}

.btn-sm {
    padding: .4rem 1rem;
    font-size: .84rem;
    min-height: 2.1rem;
}

.btn-danger {
    background: #DC2626;
    color: #fff;
}
.btn-danger:hover {
    background: #B91C1C;
    box-shadow: 0 4px 12px rgba(220,38,38,.3);
}

.btn-success {
    background: #059669;
    color: #fff;
}
.btn-success:hover {
    background: #047857;
    box-shadow: 0 4px 12px rgba(5,150,105,.3);
}

.btn-outline {
    background: transparent;
    color: var(--red);
    border: 1.5px solid var(--red);
}
.btn-outline:hover {
    background: var(--red);
    color: #fff;
}

/* ============================================================
   FORMS
   ============================================================ */

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: .4rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: .72rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: .75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .95rem;
    font-family: var(--font-body);
    line-height: 1.4;
    height: 2.9rem;
    background: var(--surface-soft);
    transition: border-color var(--duration) var(--ease),
                box-shadow var(--duration) var(--ease),
                background var(--duration) var(--ease);
    color: var(--text);
}

.form-control::placeholder {
    color: var(--text-light);
}

.form-control:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 4px var(--focus-ring);
    background: var(--surface);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .85rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

textarea.form-control { resize: vertical; min-height: 80px; }

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group { flex: 1; }

/* ============================================================
   FLOATING LABEL
   ============================================================ */

/* Wrapper: makes the label position relative to the input area */
.floating-group {
    position: relative;
    margin-bottom: 1.25rem;
}

/* Override the base .form-group label for floating variant */
.floating-group label {
    display: block;
    position: absolute;
    top: 50%;
    left: 1rem;
    margin-bottom: 0;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: .95rem;      /* full-size while acting as placeholder */
    letter-spacing: .01em;
    text-transform: none;
    color: var(--text-light);
    pointer-events: none;
    transform: translateY(-50%);
    transform-origin: left center;
    transition:
        top var(--duration) var(--ease),
        font-size var(--duration) var(--ease),
        color var(--duration) var(--ease),
        letter-spacing var(--duration) var(--ease),
        transform var(--duration) var(--ease),
        background-color var(--duration) var(--ease),
        padding var(--duration) var(--ease);
    background-color: transparent;
    padding: 0;
}

/* Floated state — triggered on focus OR when the placeholder is hidden
   (i.e., the input has a non-empty value). Using :placeholder-shown
   requires placeholder=" " (a space) on each input. */
.floating-group .form-control:focus ~ label,
.floating-group .form-control:not(:placeholder-shown) ~ label {
    top: 0;
    font-size: .68rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-secondary);
    background-color: var(--surface);
    padding: 0 0.4rem;
    transform: translateY(-50%);
}

/* Accent colour when the input is actively focused */
.floating-group .form-control:focus ~ label {
    color: var(--red);
}

/* Give inputs inside floating groups standard padding */
.floating-group .form-control {
    padding: .75rem 1rem;
}

/* Hide the blank placeholder visually — it's only there for :placeholder-shown */
.floating-group .form-control::placeholder {
    color: transparent;
}

.has-password-toggle .form-control {
    padding-right: 3.15rem;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: .5rem;
    width: 2.2rem;
    height: 2.2rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #ffffff, #f6f8fb);
    color: #8b94a5;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset;
    cursor: pointer;
    transform: translateY(-50%);
    transition: color var(--duration) var(--ease),
                background var(--duration) var(--ease),
                border-color var(--duration) var(--ease),
                box-shadow var(--duration) var(--ease),
                transform var(--duration) var(--ease);
    z-index: 2;
}

.password-toggle:hover {
    color: var(--red);
    border-color: rgba(198, 40, 40, .35);
    background: linear-gradient(180deg, #fff6f6, #ffecec);
    box-shadow: 0 4px 12px rgba(198, 40, 40, .15);
}

.password-toggle:active {
    transform: translateY(-50%) scale(.96);
}

.password-toggle:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 2px;
}

.password-toggle-icon {
    position: absolute;
    width: 1.08rem;
    height: 1.08rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity .24s var(--ease),
                transform .28s var(--ease-bounce);
}

.password-toggle-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.password-toggle .icon-show {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.password-toggle .icon-hide {
    opacity: 0;
    transform: scale(.75) rotate(-10deg);
}

.password-toggle.is-revealed .icon-show {
    opacity: 0;
    transform: scale(.75) rotate(10deg);
}

.password-toggle.is-revealed .icon-hide {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* Dedicated custom upload UI (replaces browser default file input look) */
.has-file-upload {
    min-height: 3rem;
}

.has-file-upload .file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 3rem;
    opacity: 0;
    cursor: pointer;
    z-index: 3;
    padding: 0;
}

.has-file-upload label {
    top: 0;
    font-size: .68rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-secondary);
    background-color: var(--surface);
    padding: 0 .4rem;
    transform: translateY(-50%);
    z-index: 4;
}

.file-upload-ui {
    width: 100%;
    height: 3rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .6rem .9rem;
    transition: border-color var(--duration) var(--ease),
                box-shadow var(--duration) var(--ease),
                background var(--duration) var(--ease);
}

.file-upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 1.65rem;
    padding: 0 .7rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: .78rem;
    font-weight: 600;
    font-family: var(--font-body);
    white-space: nowrap;
}

.file-upload-text {
    min-width: 0;
    flex: 1;
    color: var(--text-secondary);
    font-size: .9rem;
    font-family: var(--font-body);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.has-file-upload .file-input:focus ~ .file-upload-ui,
.has-file-upload.is-focused .file-upload-ui {
    border-color: var(--red);
    box-shadow: 0 0 0 4px var(--red-glow);
    background: var(--surface);
}

/* Select elements always have a value, so their label is always floated */
.floating-group--select label {
    top: 0;
    font-size: .68rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* Custom animated dropdown */
.custom-dropdown-group {
    margin-bottom: 1.25rem;
}

.custom-dropdown-group:not(.floating-group) > label {
    display: block;
    margin-bottom: .4rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: .72rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text);
}

.custom-dropdown {
    position: relative;
    width: 100%;
    z-index: auto;
}

.custom-dropdown.is-open {
    z-index: 1200;
}

.custom-dropdown--inline {
    width: auto;
    display: inline-block;
    vertical-align: middle;
}

.custom-dropdown-native {
    display: none !important;
}

.custom-dropdown-trigger {
    width: 100%;
    min-height: 2.9rem;
    padding: .75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-soft);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    font-family: var(--font-body);
    font-size: .95rem;
    cursor: pointer;
    transition: border-color .15s ease-out, background .15s ease-out, color .15s ease-out;
}

.custom-dropdown--inline .custom-dropdown-trigger {
    width: auto;
    min-width: 11rem;
}

.custom-dropdown--inline .custom-dropdown-option {
    font-size: .84rem;
    padding: .65rem .85rem;
}

.custom-dropdown-trigger:hover,
.custom-dropdown-trigger:focus-visible,
.custom-dropdown.is-open .custom-dropdown-trigger {
    border-color: var(--red);
    box-shadow: 0 0 0 4px var(--focus-ring);
    background: var(--surface);
}

.custom-dropdown-value {
    min-width: 0;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-dropdown-icon {
    width: .7rem;
    height: .7rem;
    border-right: 2px solid var(--charcoal);
    border-bottom: 2px solid var(--charcoal);
    transform: rotate(45deg) translateY(-2px);
    transition: transform .15s ease-out, border-color .15s ease-out;
    flex: 0 0 auto;
}

.custom-dropdown.is-open .custom-dropdown-icon {
    transform: rotate(-135deg) translateY(2px);
    border-color: var(--red);
}

.custom-dropdown-menu {
    position: absolute;
    top: calc(100% + .35rem);
    left: 0;
    right: 0;
    z-index: 1300;
    background: var(--surface);
    border: 1.5px solid var(--charcoal);
    border-radius: var(--radius);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px) scaleY(.94);
    transform-origin: top;
    pointer-events: none;
    transition: transform .15s ease-out, opacity .15s ease-out;
}

.custom-dropdown.is-open .custom-dropdown-menu {
    opacity: 1;
    transform: translateY(0) scaleY(1);
    pointer-events: auto;
}

.custom-dropdown-option {
    width: 100%;
    border: 0;
    background: var(--surface);
    color: var(--text);
    padding: .8rem 1rem;
    text-align: left;
    font-family: var(--font-body);
    font-size: .92rem;
    cursor: pointer;
    transition: background .12s ease-out, color .12s ease-out;
}

.custom-dropdown-option:hover,
.custom-dropdown-option:focus-visible {
    background: var(--red-subtle);
    color: var(--charcoal);
    outline: none;
}

.custom-dropdown-option.is-selected {
    background: #F5F5F5;
    color: var(--charcoal);
    font-weight: 600;
}

.custom-dropdown-option + .custom-dropdown-option {
    border-top: 1px solid var(--border-light);
}

.floating-group.custom-dropdown-group > label,
.floating-group.custom-dropdown-group.is-open > label {
    top: 0;
    font-size: .68rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-secondary);
    background-color: var(--surface);
    padding: 0 0.4rem;
    transform: translateY(-50%);
    z-index: 4;
}

.floating-group.custom-dropdown-group.is-filled > label {
    color: var(--text-secondary);
}

.floating-group.custom-dropdown-group.is-open > label {
    color: var(--red);
}

/* ============================================================
   AUTH CARD (Identity Portal)
   ============================================================ */

.auth-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    margin-top: 2rem;
    border: 1px solid var(--border-light);
    position: relative;
    overflow: visible;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--red), var(--red-light));
}

.auth-card h2 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: .25rem;
    letter-spacing: -.02em;
    text-align: left;
}

.auth-card .auth-subtitle {
    font-family: var(--font-heading);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--red);
    margin-bottom: .5rem;
}

/* Login/Signup Toggle Tabs */
.auth-tabs {
    display: flex;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 1.5rem 0;
}

.auth-tab {
    flex: 1;
    padding: .7rem;
    border: none;
    background: none;
    font-family: var(--font-heading);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.auth-tab.active {
    background: var(--bg);
    color: var(--text);
}

.auth-toggle {
    text-align: center;
    margin-top: 1.25rem;
    font-size: .88rem;
    color: var(--text-secondary);
}

.auth-toggle a {
    font-weight: 600;
}

/* ============================================================
   PROFILE
   ============================================================ */

.profile-pic {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--red);
    background: var(--border-light);
    transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.profile-pic:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(198, 40, 40, 0.15);
}

.profile-pic-lg {
    width: 120px;
    height: 120px;
}

/* Profile Picture Container with Edit Icon */
.profile-picture-container {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.profile-edit-icon {
    position: absolute;
    bottom: -6px;
    right: -6px;
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--red) 0%, #a01f1f 100%);
    border: 3px solid var(--bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: all var(--duration) var(--ease);
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(198, 40, 40, 0.3);
}

.profile-edit-icon:hover {
    transform: scale(1.2);
    box-shadow: 0 6px 24px rgba(198, 40, 40, 0.4);
    bottom: -2px;
    right: -2px;
}

.profile-edit-icon svg {
    width: 18px;
    height: 18px;
    stroke: white;
    stroke-width: 2.5;
    fill: none;
}



/* ============================================================
   TABLES
   ============================================================ */

.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    background: var(--surface);
    font-size: .875rem;
}

thead {
    background: var(--charcoal);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 2;
}

th {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: .04em;
    font-size: .78rem;
    text-transform: uppercase;
}

th, td {
    padding: .75rem 1.1rem;
    text-align: left;
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: background var(--duration) var(--ease);
}

tbody tr:hover {
    background: var(--bg-warm);
}

tbody tr:nth-child(even) {
    background: #FCFCFD;
}

tbody tr:last-child {
    border-bottom: none;
}

/* ============================================================
   BADGES
   ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .25rem .75rem;
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.badge-pending   { background: #FEF3C7; color: #92400E; }
.badge-confirmed { background: #D1FAE5; color: #065F46; }
.badge-preparing { background: #DBEAFE; color: #1E40AF; }
.badge-on_the_way { background: #EDE9FE; color: #5B21B6; }
.badge-out_for_delivery { background: #EDE9FE; color: #5B21B6; }
.badge-delivered { background: #D1FAE5; color: #065F46; }
.badge-cancelled { background: #FEE2E2; color: #991B1B; }
.badge-admin     { background: var(--red); color: #fff; }
.badge-customer  { background: #DBEAFE; color: #1E40AF; }
.badge-delivery  { background: #FEF3C7; color: #92400E; }

/* ============================================================
   TABS
   ============================================================ */

.tabs {
    display: flex;
    gap: .3rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: .25rem;
    background: var(--surface);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    padding: .58rem 1.2rem;
    border: 1px solid transparent;
    background: none;
    font-family: var(--font-heading);
    font-size: .88rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    border-radius: var(--radius-full);
    transition: color var(--duration) var(--ease), background var(--duration) var(--ease), border-color var(--duration) var(--ease);
    white-space: nowrap;
    flex: 0 0 auto;
}

.tab-btn.active {
    color: var(--red);
    background: var(--red-subtle);
    border-color: #FECACA;
}

.tab-btn:hover { color: var(--text); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Ensure dropdown menus in Orders tab can render above nearby sections */
#tab-orders {
    position: relative;
    z-index: 20;
}

#tab-orders .table-wrap {
    overflow: visible;
}

#tab-orders .custom-dropdown {
    z-index: auto;
}

#tab-orders .custom-dropdown.is-open {
    z-index: 2500;
}

#tab-orders .custom-dropdown-menu {
    z-index: 2600;
}

/* ============================================================
   CART PANEL
   ============================================================ */

.cart-panel {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem;
}

.cart-panel h2 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    margin-bottom: 1rem;
    color: var(--text);
}

#cart-items .cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .6rem 0;
    border-bottom: 1px solid var(--border-light);
    font-size: .9rem;
}

#cart-items .cart-item:last-child { border-bottom: none; }

.cart-total {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    margin-top: .75rem;
    padding-top: .75rem;
    border-top: 2px solid var(--red);
}

/* ============================================================
   MAP
   ============================================================ */

#map, .map-box {
    width: 100%;
    height: 300px;
    position: relative;
    z-index: 1;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--border-light);
    margin-top: .5rem;
}

.map-search-row {
    display: flex;
    gap: .5rem;
    margin-bottom: .55rem;
}

.map-search-row .form-control {
    margin: 0;
    border-radius: 2rem;
}

.map-search-results {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    margin-bottom: .65rem;
    box-shadow: var(--shadow-sm);
}

.map-search-result {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--border-light);
    background: transparent;
    text-align: left;
    padding: .65rem .75rem;
    color: var(--text);
    cursor: pointer;
    font-size: .88rem;
}

.map-search-result:last-child {
    border-bottom: 0;
}

.map-search-result:hover {
    background: var(--bg-warm);
}

/* Custom profile-photo map pins (customer + rider maps) */
.profile-pin-icon {
    background: transparent;
    border: 0;
}

.profile-pin-wrap {
    position: relative;
    width: 74px;
    height: 102px;
}

.profile-pin-avatar {
    width: 74px;
    height: 74px;
    border-radius: 50%;
    border: 5px solid #FF1010;
    overflow: hidden;
    background: #E5E7EB;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
    position: relative;
    z-index: 2;
}

.profile-pin-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-pin-avatar-fallback {
    font-family: var(--font-heading);
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #1A1A2E;
}

.profile-pin-tail {
    position: absolute;
    left: 50%;
    top: 57px;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 24px solid transparent;
    border-right: 24px solid transparent;
    border-top: 40px solid #FF1010;
    z-index: 1;
}

.route-builder-controls {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    align-items: end;
    justify-content: space-between;
    margin-bottom: .75rem;
}

.route-summary {
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .55rem .75rem;
    font-size: .86rem;
    color: var(--text-secondary);
    margin-bottom: .65rem;
}

.route-summary strong {
    color: var(--text);
}

.route-orders-list {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    margin-bottom: .7rem;
}

.route-order-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .5rem .7rem;
    border-bottom: 1px solid var(--border-light);
}

.route-order-row:last-child {
    border-bottom: 0;
}

.route-order-row .route-order-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.route-order-row .route-order-meta strong {
    font-family: var(--font-heading);
    font-size: .86rem;
}

.route-order-row .route-order-meta span {
    color: var(--text-light);
    font-size: .78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
}

.route-order-actions {
    display: flex;
    align-items: center;
    gap: .3rem;
}

.route-order-actions .btn {
    padding: .2rem .52rem;
}

.route-steps {
    margin: .75rem 0 0;
    padding: .7rem .95rem .7rem 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    max-height: 260px;
    overflow-y: auto;
}

.route-steps li {
    margin-bottom: .4rem;
    font-size: .86rem;
    color: var(--text-secondary);
}

/* ============================================================
   DELIVERY HUB SPLIT LAYOUT
   ============================================================ */

.page-delivery #pending-tab .delivery-split-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, .95fr);
    gap: 1.1rem;
    align-items: start;
}

.page-delivery #pending-tab .delivery-orders-column {
    min-width: 0;
}

.page-delivery #pending-tab .delivery-map-column {
    position: sticky;
    top: 5.25rem;
    align-self: start;
}

.page-delivery #pending-tab #selected-order-map-wrap {
    margin-top: 0;
}

.page-delivery #pending-tab #selected-route-steps {
    max-height: 220px;
    overflow-y: auto;
}

.route-steps li strong {
    color: var(--text);
}

.restaurant-reviews {
    border-top: 1px solid var(--border-light);
    padding-top: .9rem;
}

.review-avg-badge {
    font-size: .8rem;
    font-weight: 600;
    background: var(--red-subtle);
    color: var(--red-dark);
    border: 1px solid #FECACA;
    border-radius: var(--radius-full);
    padding: .2rem .6rem;
}

.review-form-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .65rem;
    background: var(--bg);
}

.review-stars {
    display: flex;
    align-items: center;
    gap: .2rem;
    margin-bottom: .45rem;
}

.review-star {
    border: 0;
    background: transparent;
    color: #D1D5DB;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    transition: transform .14s ease, color .14s ease, filter .14s ease;
}

.review-star.is-active {
    color: #F59E0B;
}

.review-star:hover {
    transform: translateY(-1px) scale(1.04);
    filter: drop-shadow(0 2px 4px rgba(245, 158, 11, .18));
}

.review-star .rating-star-icon {
    width: 1.45rem;
    height: 1.45rem;
}

.rating-stars {
    display: inline-flex;
    align-items: center;
    gap: .08rem;
    line-height: 0;
    vertical-align: middle;
}

.rating-star-slot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rating-star-icon {
    width: 1rem;
    height: 1rem;
    display: block;
}

.rating-star-slot--filled,
.rating-star-slot--half {
    color: #F59E0B;
}

.rating-star-slot--empty {
    color: #D1D5DB;
}

.review-stars-label .rating-star-icon,
.restaurant-rating-stars .rating-star-icon {
    width: 1.06rem;
    height: 1.06rem;
}

.review-stars-label {
    color: inherit;
    font-size: 0;
    letter-spacing: 0;
}

.restaurant-rating-summary.no-reviews .restaurant-rating-stars {
    color: #D1D5DB;
}

.edit-modal-stars {
    gap: .18rem;
}

.edit-star-btn {
    border: 0;
    background: transparent;
    padding: 0;
    color: #D1D5DB;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    cursor: pointer;
    transition: transform .14s ease, color .14s ease, filter .14s ease;
}

.edit-star-btn.is-active {
    color: #F59E0B;
}

.edit-star-btn:hover {
    transform: translateY(-1px) scale(1.04);
    filter: drop-shadow(0 2px 4px rgba(245, 158, 11, .18));
}

.edit-modal-stars .rating-star-icon {
    width: 1.8rem;
    height: 1.8rem;
}

.review-list {
    display: flex;
    flex-direction: column;
    gap: .55rem;
}

.review-item {
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--surface);
    padding: .6rem .7rem;
}

.review-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
}

.review-author-info {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-width: 0;
}

.review-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: #E5E7EB;
    border: 2px solid var(--red-light, #F87171);
    display: flex;
    align-items: center;
    justify-content: center;
}

.review-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.review-avatar-initials {
    font-size: .78rem;
    font-weight: 700;
    color: var(--red-dark, #B91C1C);
    line-height: 1;
    letter-spacing: .02em;
}

.review-stars-label {
    color: #F59E0B;
    font-size: .9rem;
    letter-spacing: .05em;
}

.review-item-text {
    margin-top: .3rem;
    color: var(--text-secondary);
    font-size: .88rem;
}

.review-vendor-reply {
    margin-top: .45rem;
    padding: .45rem .55rem;
    border-radius: var(--radius-sm);
    background: var(--bg-warm);
    border-left: 3px solid var(--red-light);
}

.review-vendor-reply p {
    margin: .2rem 0 0;
    color: var(--text-secondary);
    font-size: .86rem;
}

.review-vendor-reply strong {
    display: inline-flex;
    align-items: center;
    gap: .28rem;
    line-height: 1.05;
}

.review-vendor-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0;
    padding: .03rem .3rem;
    border-radius: 999px;
    border: 1px solid var(--red-light);
    color: var(--red-dark);
    background: rgba(248, 113, 113, 0.12);
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: .015em;
    text-transform: uppercase;
    line-height: 1;
}

.review-reply-editor {
    margin-top: .45rem;
    padding-top: .45rem;
    border-top: 1px dashed var(--border);
}

.restaurant-rating-summary {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.86rem;
}

.restaurant-rating-stars {
    color: #F59E0B;
}

.restaurant-rating-text {
    color: var(--text-secondary);
    font-weight: 600;
}

.restaurant-rating-summary.no-reviews .restaurant-rating-text {
    color: var(--text-light);
    font-weight: 400;
    font-size: 0.8rem;
}

/* ============================================================
   FAB (Floating Cart Button)
   ============================================================ */

.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-red);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: transform 0.4s var(--motion-spring),
                box-shadow 0.4s var(--motion-smooth);
}

/* Pulse ring around FAB */
.fab::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--red);
    opacity: 0;
    animation: fabPulseRing 2.5s var(--motion-soft) infinite;
}

@keyframes fabPulseRing {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.5); opacity: 0; }
}

.fab:hover {
    transform: scale(1.15) translateY(-4px) rotate(8deg);
    box-shadow: 0 12px 36px rgba(198,40,40,.4);
}

.fab:active {
    transform: scale(0.92) rotate(0deg);
    transition-duration: 0.15s;
}

.fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--charcoal);
    color: #fff;
    font-family: var(--font-heading);
    font-size: .7rem;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--surface);
    animation: badgePop .3s var(--ease-bounce);
}

@keyframes badgePop {
    from { transform: scale(0); }
    to   { transform: scale(1); }
}

/* ============================================================
   POPUP PANEL (Cart + Map)
   ============================================================ */

.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.3);
    backdrop-filter: blur(4px);
    z-index: 1001;
    transition: opacity .3s var(--ease);
    will-change: opacity, backdrop-filter;
    transform: translateZ(0);
}

.popup-panel {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 440px;
    max-width: 100vw;
    max-height: 88vh;
    background: var(--surface);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: -4px 0 32px rgba(0,0,0,.12);
    z-index: 1002;
    display: flex;
    flex-direction: column;
    will-change: transform, opacity;
    transform: translateZ(0);
    animation: popupSlideIn .5s var(--motion-smooth);
}

@keyframes popupSlideIn {
    from { transform: translateY(100%) scale(0.98); opacity: 0.5; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--charcoal);
    color: #fff;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.popup-header h2 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.01em;
}

.popup-close {
    background: none;
    border: none;
    color: rgba(255,255,255,.7);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 .2rem;
    transition: color var(--duration) var(--ease), transform var(--duration) var(--ease);
}

.popup-close:hover {
    color: #fff;
    transform: rotate(90deg);
}

.popup-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.popup-body .cart-panel {
    box-shadow: none;
    padding: 0;
}

.popup-body #map {
    height: 220px;
}

.restaurant-owner-popup {
    top: 50%;
    bottom: auto;
    width: min(92vw, 480px);
    max-height: 85vh;
    border-radius: var(--radius-xl);
    right: auto;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: popupScaleIn .35s var(--ease);
}

.profile-pic-popup {
    top: 50%;
    bottom: auto;
    width: min(92vw, 520px);
    max-height: 85vh;
    border-radius: var(--radius-xl);
    right: auto;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: popupScaleIn .35s var(--ease);
}

.profile-view-popup {
    top: 50%;
    bottom: auto;
    width: min(92vw, 860px);
    max-height: 88vh;
    border-radius: var(--radius-xl);
    right: auto;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: popupScaleIn .35s var(--ease);
}

.profile-view-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-view-hint {
    margin: 0;
    text-align: center;
    font-size: .82rem;
    color: var(--text-secondary);
}

.profile-view-frame {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--surface-soft);
    overflow: hidden;
    height: min(62vh, 520px);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    touch-action: none;
    user-select: none;
    overscroll-behavior: contain;
    cursor: grab;
}

.profile-view-frame.is-dragging {
    cursor: grabbing;
}

.profile-view-frame img {
    max-width: 100%;
    max-height: 100%;
    transform-origin: center;
    will-change: transform;
    user-select: none;
    pointer-events: none;
    -webkit-user-drag: none;
    display: block;
}

body.profile-view-open {
    overflow: hidden;
}

.profile-view-controls {
    display: flex;
    align-items: center;
    gap: .75rem;
    justify-content: flex-end;
}

.profile-view-controls input[type="range"] {
    flex: 1;
    accent-color: var(--red);
}

.profile-crop-popup {
    top: 50%;
    bottom: auto;
    width: min(92vw, 720px);
    max-height: 90vh;
    border-radius: var(--radius-xl);
    right: auto;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: popupScaleIn .35s var(--ease);
}

.profile-crop-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-crop-hint {
    margin: 0;
    text-align: center;
    font-size: .82rem;
    color: var(--text-secondary);
}

.profile-crop-frame {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--surface-soft);
    overflow: hidden;
    height: min(60vh, 480px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-crop-frame img {
    max-width: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.profile-crop-actions {
    display: flex;
    justify-content: flex-end;
    gap: .6rem;
}

.item-details-popup {
    top: 50%;
    bottom: auto;
    width: min(94vw, 650px);
    max-height: 88vh;
    border-radius: var(--radius-xl);
    right: auto;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: popupScaleIn .35s var(--ease);
}

.item-details-popup .popup-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.item-details-media-wrap {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface-soft);
    aspect-ratio: 16 / 9;
}

.item-details-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-details-content {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.item-details-name {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.35rem;
    color: var(--charcoal);
    line-height: 1.2;
}

.item-details-meta {
    display: flex;
    align-items: center;
    gap: .55rem;
    flex-wrap: wrap;
}

.item-details-price {
    color: var(--red-dark);
    font-family: var(--font-heading);
    font-size: 1.04rem;
}

.item-details-chip {
    display: inline-flex;
    align-items: center;
    padding: .18rem .52rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--charcoal);
    font-size: .73rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.item-details-grid {
    display: grid;
    gap: .5rem;
}

.item-details-row {
    display: grid;
    grid-template-columns: 95px 1fr;
    gap: .5rem;
    align-items: start;
}

.item-details-label {
    color: var(--text-light);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.item-details-value {
    color: var(--text);
    font-size: .92rem;
}

.item-details-description {
    margin: 0;
    color: var(--text-secondary);
    font-size: .9rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

.item-details-actions {
    margin-top: .15rem;
}

.item-card-actions {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: wrap;
}

.menu-item-card {
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(18, 23, 51, 0.07);
    transition: transform .24s var(--ease), box-shadow .3s var(--ease), border-color .24s var(--ease);
}

.menu-item-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 28px rgba(18, 23, 51, 0.14);
    border-color: rgba(220, 38, 38, 0.22);
}

.owner-info-grid {
    display: grid;
    gap: .65rem;
}

.owner-info-row {
    display: grid;
    grid-template-columns: 130px 1fr;
    align-items: start;
    gap: .6rem;
    padding: .5rem .65rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
}

.owner-info-label {
    font-family: var(--font-heading);
    font-size: .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-light);
}

.owner-info-value {
    color: var(--text);
    font-size: .9rem;
    overflow-wrap: anywhere;
}

.table-banner-thumb {
    width: 72px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 6px;
    background: linear-gradient(135deg, #f5f5f5, #ebebeb);
}

@media (max-width: 480px) {
    .owner-info-row {
        grid-template-columns: 1fr;
        gap: .25rem;
    }

    .restaurant-owner-popup {
        width: 94vw;
        max-height: 88vh;
    }

    .profile-pic-popup {
        width: 94vw;
        max-height: 88vh;
    }

    .profile-view-popup {
        width: 94vw;
        max-height: 88vh;
    }

    .profile-view-frame {
        height: min(52vh, 360px);
    }

    .profile-crop-popup {
        width: 94vw;
        max-height: 88vh;
    }

    .profile-crop-frame {
        height: min(52vh, 360px);
    }

    .item-details-popup {
        width: 94vw;
        max-height: 88vh;
    }

    .item-details-popup .popup-body {
        grid-template-columns: 1fr;
    }

    .item-details-media-wrap,
    .item-details-image {
        min-height: 0;
    }

    .item-details-row {
        grid-template-columns: 1fr;
        gap: .2rem;
    }
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
    background: var(--charcoal);
    color: var(--text-inverse);
    margin-top: 4rem;
    padding: 0;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3.5rem 2rem 1.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 3rem;
}

.footer-brand-section {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
}

.footer-brand img {
    height: 36px;
    width: auto;
}

.footer-brand span {
    color: var(--red);
}

.footer-brand-section p {
    font-size: .85rem;
    color: rgba(255,255,255,.5);
    line-height: 1.6;
    max-width: 260px;
}

.footer-col h4 {
    font-family: var(--font-heading);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: rgba(255,255,255,.9);
    margin-bottom: 1.25rem;
}

.footer-col a {
    display: block;
    color: rgba(255,255,255,.5);
    font-size: .88rem;
    margin-bottom: .6rem;
    transition: color var(--duration) var(--ease), transform var(--duration) var(--ease);
}

.footer-col a:hover {
    color: #fff;
    transform: translateX(3px);
}

/* Social icons */
.footer-social {
    display: flex;
    gap: .6rem;
    margin-top: .25rem;
}

.footer-social a {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,.6);
    font-size: .85rem;
    margin-bottom: 0;
    transition: all var(--duration) var(--ease);
}

.footer-social a:hover {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
    transform: translateY(-2px);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,.08);
}

.footer-copy {
    font-size: .78rem;
    color: rgba(255,255,255,.35);
}

.footer-status {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-family: var(--font-heading);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #34D399;
}

.footer-status::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34D399;
    animation: statusPulse 2s ease infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .4; }
}

/* ============================================================
   TOASTS
   ============================================================ */

#toast-container {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: .6rem;
    pointer-events: none;
    max-width: 380px;
}

.toast {
    pointer-events: auto;
    padding: .85rem 1.25rem;
    border-radius: var(--radius);
    font-size: .88rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastIn .5s var(--motion-spring), toastOut .4s var(--motion-smooth) 3.6s forwards;
    display: flex;
    align-items: center;
    gap: .6rem;
    min-width: 260px;
    backdrop-filter: blur(8px);
}

.toast.error {
    background: rgba(254, 226, 226, .95);
    color: #991B1B;
    border-left: 4px solid #DC2626;
}

.toast.success {
    background: rgba(209, 250, 229, .95);
    color: #065F46;
    border-left: 4px solid #059669;
}

@keyframes toastIn {
    0%   { opacity: 0; transform: translateX(-40px) scale(.92); }
    60%  { opacity: 1; transform: translateX(6px) scale(1.02); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to   { opacity: 0; transform: translateX(-30px) scale(.96); }
}

/* ============================================================
   SIDEBAR LAYOUT (My Orders, etc.)
   ============================================================ */

.page-with-sidebar {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
}

.sidebar {
    position: sticky;
    top: 80px;
    align-self: start;
}

.sidebar-label {
    font-family: var(--font-heading);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 1rem;
    padding-left: .75rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .65rem .9rem;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: .9rem;
    font-weight: 500;
    transition: all var(--duration) var(--ease);
    text-decoration: none;
}

.sidebar-nav a svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.sidebar-nav a:hover {
    background: var(--border-light);
    color: var(--text);
}

.sidebar-nav a.active {
    background: var(--red-subtle);
    color: var(--red);
    font-weight: 600;
    border-left: 3px solid var(--red);
}

/* ============================================================
   ADMIN STATS CARDS
   ============================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--border-light);
    transition: all var(--duration) var(--ease);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card .stat-label {
    font-family: var(--font-heading);
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: .35rem;
}

.stat-card .stat-value {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -.02em;
}

.stat-card .stat-change {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    font-size: .78rem;
    font-weight: 600;
    color: #059669;
    margin-top: .25rem;
}

/* ============================================================
   SYSTEM STATUS BAR
   ============================================================ */

.system-status-bar {
    background: var(--charcoal);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    color: #fff;
    margin-top: 2rem;
}

.system-status-bar .status-indicator {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-family: var(--font-heading);
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: .75rem;
}

.system-status-bar .status-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34D399;
    animation: statusPulse 2s ease infinite;
}

.system-status-bar p {
    font-size: .85rem;
    color: rgba(255,255,255,.65);
    line-height: 1.6;
}

/* ============================================================
   ACTIVITY LOG — Admin Audit Trail
   ============================================================ */

/* stats row */
.actlog-stats-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.actlog-stat {
    flex: 1;
    min-width: 140px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.actlog-stat-value {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--text-primary);
}

.actlog-stat-label {
    font-size: .78rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* filter bar */
.actlog-filters {
    display: flex;
    gap: .75rem;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    position: relative;
    z-index: 10;
}

.actlog-filters .form-group label {
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-secondary);
    margin-bottom: .3rem;
}

/* live toggle switch */
.actlog-live-toggle {
    display: flex;
    align-items: center;
    gap: .4rem;
    cursor: pointer;
    user-select: none;
}

.actlog-live-toggle input { display: none; }

.actlog-live-slider {
    position: relative;
    width: 36px;
    height: 20px;
    background: var(--border-subtle);
    border-radius: 20px;
    transition: background .3s ease;
}

.actlog-live-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.actlog-live-toggle input:checked + .actlog-live-slider {
    background: #22c55e;
}

.actlog-live-toggle input:checked + .actlog-live-slider::before {
    transform: translateX(16px);
}

.actlog-live-label {
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-secondary);
}

.actlog-live-toggle input:checked ~ .actlog-live-label {
    color: #22c55e;
}

/* log table */
.actlog-table {
    width: 100%;
    font-size: .83rem;
}

.actlog-table thead th {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-secondary);
    font-weight: 600;
    padding: .6rem .75rem;
    white-space: nowrap;
}

.actlog-row td {
    padding: .55rem .75rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-subtle);
}

.actlog-row:hover {
    background: rgba(255,255,255,.03);
}

.actlog-time {
    white-space: nowrap;
    color: var(--text-secondary);
    font-size: .78rem;
    font-variant-numeric: tabular-nums;
}

.actlog-actor {
    font-weight: 600;
    color: var(--text-primary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.actlog-target {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
}

.actlog-ip {
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: .72rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.actlog-details {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* action badge */
.actlog-badge {
    display: inline-flex;
    align-items: center;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .02em;
    white-space: nowrap;
    background: color-mix(in srgb, var(--badge-color) 15%, transparent);
    color: var(--badge-color);
    border: 1px solid color-mix(in srgb, var(--badge-color) 25%, transparent);
}

/* detail chips */
.actlog-detail-chip {
    display: inline-block;
    padding: .1rem .4rem;
    border-radius: 4px;
    font-size: .72rem;
    background: var(--glass-bg);
    border: 1px solid var(--border-subtle);
    margin: .1rem .15rem .1rem 0;
    color: var(--text-secondary);
}

.actlog-detail-chip strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* pagination */
.actlog-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem 0;
}

.actlog-page-info {
    font-size: .82rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

/* responsive */
@media (max-width: 768px) {
    .actlog-filters {
        flex-direction: column;
        align-items: stretch;
    }
    .actlog-stats-row {
        flex-direction: column;
    }
    .actlog-table thead th:nth-child(5),
    .actlog-table .actlog-ip {
        display: none;
    }
    .actlog-details {
        max-width: 140px;
    }
}

/* ============================================================
   MISC UTILITIES
   ============================================================ */

.text-center { text-align: center; }
.text-muted  { color: var(--text-secondary); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.gap-row {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.hidden { display: none !important; }

.empty-state {
    text-align: center;
    padding: 2.6rem 1.2rem;
    color: var(--text-light);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface-soft);
}

.empty-state svg {
    margin: 0 auto 1rem;
    opacity: .3;
}

.empty-state p {
    font-size: .95rem;
}

.status-msg {
    display: none !important;
}

/* Divider */
.divider {
    height: 1px;
    background: var(--border-light);
    margin: 2rem 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .page-with-sidebar {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        gap: .5rem;
        padding-bottom: .5rem;
    }

    .sidebar-nav a {
        white-space: nowrap;
    }

    .page-delivery #pending-tab .delivery-split-layout {
        grid-template-columns: 1fr;
        gap: .9rem;
    }

    .page-delivery #pending-tab .delivery-map-column {
        position: static;
    }
}

@media (max-width: 768px) {
    body.menu-open {
        overflow: hidden;
    }

    body.menu-open::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(17, 24, 39, 0.35);
        backdrop-filter: blur(1.5px);
        z-index: 95;
    }

    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        padding: .65rem 1.25rem;
        z-index: 110;
    }

    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 4.25rem;
        right: 1rem;
        transform: translateY(-8px) scale(.98);
        opacity: 0;
        pointer-events: none;
        width: min(82vw, 300px);
        max-height: calc(100dvh - 5.5rem);
        height: auto;
        overflow-y: auto;
        background: var(--surface);
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem 1.25rem 1.25rem;
        gap: 0;
        border: 1px solid var(--border-light);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-lg);
        transition: transform .25s var(--ease), opacity .25s var(--ease);
        z-index: 115;
    }

    .nav-links.open {
        transform: translateY(0) scale(1);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: .85rem 0;
        font-size: 1rem;
        border-bottom: 1px solid var(--border-light);
    }

    .nav-links a::after { display: none; }

    .nav-links .btn-nav {
        margin-top: .9rem;
        text-align: center;
        display: block;
        padding: .75rem 1.5rem;
        width: 100%;
    }

    .hero {
        grid-template-columns: 1fr;
        grid-template-areas:
            'copy'
            'art'
            'actions';
        row-gap: 1.1rem;
        padding: 2.5rem 1.25rem 2rem;
    }

    .hero-copy,
    .hero-actions {
        max-width: 100%;
    }

    .hero-art-wrap {
        justify-content: center;
        max-width: 440px;
        margin: 0 auto;
    }

    .hero-art {
        width: min(100%, 420px);
        max-height: 360px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .container {
        padding: 1.5rem 1.25rem;
    }

    .admin-page .container {
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .container-sm {
        padding: 1.5rem 1.25rem;
    }

    .form-row { flex-direction: column; gap: 0; }
    .auth-card { padding: 1.75rem 1.5rem; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .popup-panel { width: 100vw; }
    .restaurant-owner-popup {
        width: min(92vw, 480px);
        left: 50%;
        right: auto;
        bottom: auto;
        top: 50%;
        transform: translate(-50%, -50%);
    }
    #toast-container { left: 1rem; right: 1rem; max-width: none; }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
        margin-bottom: 2rem;
    }

    .footer-brand-section {
        grid-column: 1 / -1;
        flex-direction: row;
        align-items: flex-start;
        flex-wrap: wrap;
        gap: .6rem 1.25rem;
    }

    .footer-brand-section p {
        flex-basis: 100%;
        font-size: .82rem;
    }

    .footer-bottom {
        flex-direction: column;
        gap: .6rem;
        text-align: center;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .hero-search {
        flex-direction: column;
        width: 100%;
    }

    .hero-search input {
        width: 100%;
    }

    .hero-search .btn {
        width: 100%;
    }

    .promo-banner {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .map-search-row {
        flex-direction: column;
    }

    .map-search-row .btn {
        width: 100%;
    }

    .route-builder-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .route-order-row .route-order-meta span {
        max-width: 180px;
    }

    .page-delivery #pending-tab #selected-order-map {
        height: 300px !important;
    }

    .tabs {
        gap: .1rem;
        padding-bottom: .25rem;
    }

    .table-wrap {
        border-radius: var(--radius);
    }

    table {
        min-width: 680px;
    }

    /* My Orders mobile-specific scaling */
    .page-my-orders .page-with-sidebar {
        padding: 1.25rem 1rem;
        gap: 1rem;
    }

    .page-my-orders .sidebar-label {
        margin-bottom: .75rem;
        padding-left: .2rem;
    }

    .page-my-orders .sidebar-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .45rem;
        overflow: visible;
        padding-bottom: 0;
    }

    .page-my-orders .sidebar-nav a {
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: .6rem .65rem;
        font-size: .86rem;
    }

    .page-my-orders .table-wrap {
        overflow-x: hidden;
    }

    .page-my-orders table {
        min-width: 0;
        width: 100%;
        table-layout: fixed;
        font-size: .82rem;
    }

    .page-my-orders th,
    .page-my-orders td {
        white-space: normal;
        word-break: break-word;
        padding: .62rem .5rem;
    }

    .page-my-orders th:nth-child(2),
    .page-my-orders td:nth-child(2) {
        width: 52px;
        text-align: center;
        white-space: nowrap;
    }

    .page-my-orders th:nth-child(3),
    .page-my-orders td:nth-child(3) {
        width: 96px;
        text-align: right;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.65rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .auth-card {
        padding: 1.5rem 1.25rem;
        border-radius: var(--radius-lg);
    }

    .page-my-orders .sidebar-nav {
        grid-template-columns: 1fr;
    }
}




/* ============================================================
   FLOATING LABELS
   ============================================================ */
.floating-group {
    position: relative;
}

.floating-group label {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    transition: top 0.25s var(--ease), transform 0.25s var(--ease), font-size 0.2s var(--ease), color 0.2s var(--ease);
    margin: 0;
    color: var(--text-light);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: .95rem;
    letter-spacing: normal;
    text-transform: none;
    z-index: 1;
}

/* Floating label active states for text inputs */
.floating-group input:focus ~ label,
.floating-group input:not(:placeholder-shown) ~ label {
    top: 0;
    left: 0.8rem;
    transform: translateY(-50%);
    padding: 0 0.25rem;
    background-color: var(--surface);
    color: var(--text);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: .72rem;
    letter-spacing: .12em;
    text-transform: uppercase;
}

/* Floating label active states for select and file inputs */
.floating-group select:focus ~ label,
.floating-group select:not([value=""]) ~ label,
.floating-group input[type="file"]:not([value=""]) ~ label {
    top: 0;
    left: 0.8rem;
    transform: translateY(-50%);
    padding: 0 0.25rem;
    background-color: var(--surface);
    color: var(--text);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: .72rem;
    letter-spacing: .12em;
    text-transform: uppercase;
}

/* Hide placeholder text by default */
.floating-group input::placeholder {
    color: transparent;
}

/* Show placeholder on focus */
.floating-group input:focus::placeholder {
    color: var(--text-light);
}

/* ============================================================
   RESTAURANT MENU POPUP & CAROUSEL
   ============================================================ */

.rest-popup {
    top: 50%;
    left: 50%;
    bottom: auto;
    right: auto;
    transform: translate(-50%, -50%);
    width: 95vw;
    height: 90vh; /* Taller on mobile */
    max-height: 90vh;
    border-radius: var(--radius-xl);
    animation: popupScaleIn .35s var(--ease);
}

@keyframes popupScaleIn {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
    70%  { opacity: 1; transform: translate(-50%, -50%) scale(1.015); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.rest-carousel-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0;
}

.rest-carousel {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: .5rem 0;
    scrollbar-width: none;
}

.rest-carousel::-webkit-scrollbar {
    display: none;
}

.rest-carousel .carousel-card {
    flex: 0 0 min(280px, 75vw);
    scroll-snap-align: center;
    background: var(--bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(18, 23, 51, 0.08);
    transition: transform .26s var(--ease),
                box-shadow .3s var(--ease),
                border-color .26s var(--ease);
}

.rest-carousel .carousel-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 34px rgba(18, 23, 51, 0.16);
    border-color: rgba(220, 38, 38, 0.24);
}

.rest-carousel .carousel-card img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: linear-gradient(135deg, #f5f5f5, #ebebeb);
}

.rest-carousel .carousel-card-body {
    padding: .85rem 1rem;
}

.rest-carousel .carousel-card-body h4 {
    font-family: var(--font-heading);
    font-size: .95rem;
    font-weight: 600;
    margin-bottom: .2rem;
    letter-spacing: -.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rest-carousel .carousel-card-body .card-desc {
    font-size: .78rem;
    color: var(--text-light);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: .4rem;
}

.rest-carousel .carousel-card-body .carousel-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: .5rem;
}

.rest-carousel .carousel-card-body .price {
    color: var(--red);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
}

/* Carousel arrows - desktop only */
.carousel-arrow {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--duration) var(--ease);
}

.carousel-arrow:hover {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
    box-shadow: var(--shadow-red);
}

.carousel-prev { left: 8px; }
.carousel-next { right: 8px; }

@media (min-width: 769px) {
    .carousel-arrow {
        display: flex;
    }
    .rest-popup {
        max-width: 880px; /* Much wider on desktop */
        width: 85vw;
        height: auto; /* Revert to auto height on desktop */
        max-height: 85vh;
    }
    .rest-carousel .carousel-card {
        flex: 0 0 260px;
    }
}

/* Carousel dots */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: .4rem;
    padding: .65rem 0 .25rem;
}

.carousel-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    border: none;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    padding: 0;
}

.carousel-dots .dot.active {
    background: var(--red);
    transform: scale(1.3);
}



.rest-carousel { cursor: grab; }
.rest-carousel.is-dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }

/* ============================================================
   VENDOR DASHBOARD & APPROVAL SYSTEM
   ============================================================ */

/* Vendor page container */
.vendor-page .container {
    max-width: 1200px;
}

/* Vendor & approval restaurant card grid */
.vendor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.vendor-rest-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border-light);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform var(--duration) var(--ease),
                box-shadow var(--duration) var(--ease);
}

.vendor-rest-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.vendor-rest-card.is-pending {
    border-color: #F59E0B;
    border-width: 1.5px;
}

.vendor-rest-card.is-rejected {
    border-color: #DC2626;
    border-width: 1.5px;
    opacity: 0.75;
}

.vendor-rest-card .card-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: linear-gradient(135deg, #f5f5f5, #ebebeb);
}

.vendor-rest-card .card-body {
    padding: 1.15rem 1.35rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.vendor-rest-card .card-body h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: .25rem;
    letter-spacing: -.01em;
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.vendor-rest-card .card-body p {
    color: var(--text-secondary);
    font-size: .85rem;
    line-height: 1.5;
    margin-bottom: .5rem;
}

.vendor-rest-card .card-actions {
    display: flex;
    gap: .5rem;
    margin-top: auto;
    padding-top: .5rem;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .7rem;
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.status-badge--pending {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #F59E0B;
}

.status-badge--pending::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #F59E0B;
    animation: statusPulse 2s ease infinite;
}

.status-badge--approved {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #059669;
}

.status-badge--approved::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #059669;
}

.status-badge--rejected {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #DC2626;
}

.status-badge--rejected::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #DC2626;
}

/* Pending verification overlay on vendor card */
.vendor-pending-overlay {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .75rem 1rem;
    background: linear-gradient(135deg, #FFFBEB, #FEF3C7);
    border-top: 1px solid #FDE68A;
    font-size: .82rem;
    color: #92400E;
    font-weight: 500;
}

.vendor-pending-overlay svg {
    flex-shrink: 0;
    color: #F59E0B;
}

/* Approval count dot on tab */
.approvals-count-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: #DC2626;
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    margin-left: .35rem;
    padding: 0 4px;
    line-height: 1;
    vertical-align: middle;
    animation: approvalPulse 2s ease infinite;
}

@keyframes approvalPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,.4); }
    50% { box-shadow: 0 0 0 6px rgba(220,38,38,0); }
}

/* Approval card extra styles */
.approval-card-owner {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .82rem;
    color: var(--text-secondary);
    margin-bottom: .5rem;
}

.approval-card-owner svg {
    flex-shrink: 0;
    color: var(--text-light);
}

/* Vendor manage button */
.btn-manage {
    background: var(--charcoal);
    color: #fff;
}

.btn-manage:hover {
    background: var(--charcoal-mid);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Approve/reject button group */
.btn-approve {
    background: #059669;
    color: #fff;
}
.btn-approve:hover {
    background: #047857;
    box-shadow: 0 4px 12px rgba(5,150,105,.3);
    transform: translateY(-1px);
}

.btn-reject {
    background: transparent;
    color: #DC2626;
    border: 1.5px solid #DC2626;
}
.btn-reject:hover {
    background: #DC2626;
    color: #fff;
}

@media (max-width: 768px) {
    .vendor-grid {
        grid-template-columns: 1fr;
    }
}

/* Review Actions */
.review-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.review-edit-btn,
.review-delete-btn {
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.review-edit-btn:hover {
    background: #e3f2fd;
    border-color: #2196F3;
}

.review-delete-btn:hover {
    background: #ffebee;
    border-color: #f44336;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    padding: 1rem;
}

/* Inline edit cards shown on admin/vendor pages should open as modal popups */
#edit-user-card,
#edit-restaurant-card,
#edit-item-card,
#vendor-edit-item-card {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(960px, 92vw);
    max-height: 88vh;
    overflow-y: auto;
    scrollbar-width: none;
    z-index: 21000;
    margin: 0 !important;
    box-shadow: 0 22px 56px rgba(17, 24, 39, .22), 0 0 0 100vmax rgba(17, 24, 39, .45);
    border: 1px solid rgba(255, 255, 255, .6);
    animation: popupScaleIn .35s var(--motion-smooth);
}

#edit-user-card::-webkit-scrollbar,
#edit-restaurant-card::-webkit-scrollbar,
#edit-item-card::-webkit-scrollbar,
#vendor-edit-item-card::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* Let custom dropdown menus escape the edit card scroll box when open. */
#edit-user-card:has(.custom-dropdown.is-open),
#edit-restaurant-card:has(.custom-dropdown.is-open),
#edit-item-card:has(.custom-dropdown.is-open),
#vendor-edit-item-card:has(.custom-dropdown.is-open) {
    overflow: visible;
}

body.edit-popup-open {
    overflow: hidden;
}

/* ============================================================
   UNIFIED POPUP EXIT ANIMATION
   Applied via JS when closing any popup-panel or overlay.
   ============================================================ */

@keyframes popupFadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

@keyframes popupScaleOut {
    from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    to   { opacity: 0; transform: translate(-50%, -50%) scale(0.92); }
}

@keyframes popupSlideOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to   { opacity: 0; transform: translateY(40px) scale(0.98); }
}

.popup-overlay.is-exiting {
    animation: popupFadeOut .25s var(--ease) forwards;
    pointer-events: none;
}

/* Centered popups (rest-popup, item-details, owner-info, edit cards) */
.popup-panel.is-exiting {
    animation: popupScaleOut .25s var(--ease) forwards;
    pointer-events: none;
}

/* Bottom-slide popups (cart panel) */
.popup-panel:not(.rest-popup):not(.restaurant-owner-popup):not(.item-details-popup):not(.profile-pic-popup):not(.profile-crop-popup):not(.profile-view-popup).is-exiting {
    animation: popupSlideOut .25s var(--ease) forwards;
}

/* Edit cards exiting */
#edit-user-card.is-exiting,
#edit-restaurant-card.is-exiting,
#edit-item-card.is-exiting,
#vendor-edit-item-card.is-exiting {
    animation: popupScaleOut .25s var(--ease) forwards;
    pointer-events: none;
}

@media (max-width: 768px) {
    #edit-user-card,
    #edit-restaurant-card,
    #edit-item-card,
    #vendor-edit-item-card {
        width: 96vw;
        max-height: 92vh;
        border-radius: var(--radius-lg);
    }
}

.modal-content {
    position: relative;
    z-index: 20001;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h5 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a2e;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
}



/* ============================================================
   MOBILE DEEP-DIVE OVERRIDES (GLOBAL)
   ============================================================ */

@media (max-width: 768px) {
    html,
    body {
        overflow-x: hidden;
    }

    .container,
    .container-sm,
    .page-with-sidebar {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: .45rem;
    }

    .section-title {
        font-size: 1.35rem;
        line-height: 1.2;
        margin-bottom: .95rem;
    }

    .card {
        border-radius: var(--radius);
    }

    .card-body {
        padding: .9rem .9rem .95rem;
    }

    .card-body h3 {
        font-size: .98rem;
    }

    .card-body p,
    .text-muted {
        font-size: .84rem;
    }

    .btn {
        min-height: 2.6rem;
    }

    .gap-row {
        width: 100%;
    }

    .gap-row .btn,
    .gap-row .form-control,
    .gap-row .custom-dropdown {
        width: 100%;
    }

    .tabs {
        border-radius: var(--radius);
        padding: .2rem;
        gap: .2rem;
    }

    .tab-btn {
        font-size: .82rem;
        padding: .52rem .85rem;
    }

    .table-wrap {
        margin-left: -0.1rem;
        margin-right: -0.1rem;
    }

    table {
        min-width: 620px;
    }

    th,
    td {
        padding: .62rem .75rem;
    }

    .auth-card {
        border-radius: var(--radius-lg);
        margin-top: 1rem;
    }

    .auth-tabs {
        margin: 1rem 0 1.2rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: .8rem;
    }

    .vendor-rest-card .card-actions {
        flex-direction: column;
    }

    .vendor-rest-card .card-actions .btn {
        width: 100%;
    }

    .delivery-order-card .gap-row {
        flex-direction: column;
        align-items: stretch;
    }

    .delivery-order-card .order-status-select,
    .delivery-order-card .update-status-btn {
        width: 100% !important;
    }

    .page-delivery #selected-order-map,
    .page-delivery #delivery-map,
    .map-box {
        height: 280px !important;
    }

    .route-steps {
        max-height: 200px;
    }

    .footer-inner {
        padding: 2rem 1.1rem 1rem;
    }

    .footer-brand-section p {
        max-width: 100%;
        font-size: .82rem;
    }

    .footer-col h4 {
        margin-bottom: .8rem;
    }

    .footer-col a {
        font-size: .84rem;
        margin-bottom: .45rem;
    }

    .modal-content {
        width: 96vw !important;
        max-width: 96vw !important;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding-left: .8rem;
        padding-right: .8rem;
    }

    .navbar .brand {
        font-size: 1.15rem;
        gap: .45rem;
    }

    .navbar .brand img {
        height: 34px;
    }

    .hero {
        padding: 2rem .7rem 1.4rem;
    }

    .hero h1 {
        font-size: 1.55rem;
    }

    .hero p {
        font-size: .95rem;
    }

    .form-control,
    .custom-dropdown-trigger {
        height: 2.75rem;
        min-height: 2.75rem;
    }

    .table-wrap {
        border-radius: var(--radius-sm);
    }

    table {
        min-width: 560px;
        font-size: .82rem;
    }

    .page-delivery #selected-order-map,
    .page-delivery #delivery-map,
    .map-box {
        height: 250px !important;
    }
}


/* ── Delivery OTP styles ─────────────────────────────────── */
.otp-box {
    margin: .75rem 0;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #fef9c3 0%, #fef3c7 100%);
    border: 1.5px solid #f59e0b;
    overflow: hidden;
}

.otp-box-inner {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .85rem 1rem;
    color: #92400e;
}

.otp-label {
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .02em;
}

.otp-digits {
    margin-left: auto;
    font-family: var(--font-heading, monospace);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: .25em;
    color: #b45309;
    background: #fff8e1;
    border: 1.5px solid #f59e0b;
    border-radius: calc(var(--radius) - 2px);
    padding: .2rem .75rem;
    min-width: 5.5rem;
    text-align: center;
    user-select: all;
}

.otp-input-row {
    display: flex;
    justify-content: center;
}

.otp-entry:focus {
    outline: none;
    border-color: var(--red, #e11d48);
    box-shadow: 0 0 0 3px rgba(225,29,72,.15);
}

/* ============================================================
   PREFERS REDUCED MOTION — Accessibility
   Disable ALL animations for users who prefer reduced motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    [data-reveal],
    [data-animate],
    [data-stagger] > * {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
        transition: none !important;
    }

    [data-parallax] {
        transform: none !important;
    }

    .fab::before {
        animation: none !important;
    }
}
