/* Radhunighor Order — web app design system.
   Brand color carried over from the Android app (res/values/colors.xml). */
:root {
    --brand: #E91E8C;
    --brand-600: #C8167A;
    --brand-700: #A0105F;
    --brand-50: #FFF1F8;
    --brand-100: #FCE4F0;
    --brand-200: #F5C2DD;
    --brand-rgb: 233, 30, 140;
    --bg-rgb: 246, 244, 249;
    --brand-grad: linear-gradient(135deg, #F0359B 0%, #D81B7E 45%, #8E1458 100%);

    --bg: #F6F4F9;
    --surface: #FFFFFF;
    --surface-2: #FAF8FC;
    --line: #EEE9F2;
    --line-2: #E2DBE8;

    --ink: #17172B;
    --ink-2: #4B4B66;
    --muted: #8C8CA5;

    --green: #12A866;   --green-bg: #E7F7EF;
    --orange: #EF7C0A;  --orange-bg: #FEF2E4;
    --red: #E5383B;     --red-bg: #FDECEC;
    --blue: #2D7FF0;    --blue-bg: #E9F2FE;
    --violet: #7357F0;  --violet-bg: #F0ECFE;
    --whatsapp: #25D366;

    --r-sm: 10px;
    --r: 14px;
    --r-lg: 20px;
    --r-xl: 24px;
    --sh-sm: 0 1px 2px rgba(23, 23, 43, .04), 0 1px 3px rgba(23, 23, 43, .05);
    --sh: 0 4px 14px rgba(23, 23, 43, .06), 0 1px 3px rgba(23, 23, 43, .04);
    --sh-lg: 0 14px 40px rgba(23, 23, 43, .12), 0 2px 6px rgba(23, 23, 43, .05);

    --topbar-h: 64px;
    --tabbar-h: 66px;
    --sidebar-w: 264px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --font: "Plus Jakarta Sans", "Noto Sans Bengali", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.45;
    color: var(--ink);
    background: var(--bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
svg { flex: none; }
.ico { width: 20px; height: 20px; fill: currentColor; }

/* =========================================================================
   Shell: sidebar (desktop) · topbar · page · floating tab bar (mobile)
   ========================================================================= */

.sidebar { display: none; }

.main { min-height: 100vh; display: flex; flex-direction: column; min-width: 0; overflow-x: clip; }
img { max-width: 100%; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px 0 16px;
    background: rgba(var(--bg-rgb), .86);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s, box-shadow .2s;
}
.topbar.is-scrolled { border-bottom-color: var(--line); }
/* Header in the role's colour (admin pink, kitchen manager blue, vendor teal, rider
   indigo) with white text and icons — the same gradient as the dashboard hero. */
.topbar { background: var(--brand-grad); color: #fff; box-shadow: 0 4px 14px rgba(var(--brand-rgb), .22); }
.topbar.is-scrolled { border-bottom-color: transparent; }
.topbar .topbar__sub { color: rgba(255, 255, 255, .8); }
.topbar .icon-btn { color: #fff !important; } /* !important: beats the logout button's inline red */
.topbar .icon-btn:hover { background: rgba(255, 255, 255, .18); color: #fff; box-shadow: none; }
.topbar .icon-btn.is-surface { background: #fff; color: var(--brand) !important; }
.topbar__brand { display: flex; align-items: center; gap: 10px; }
.topbar__logo { width: 34px; height: 34px; border-radius: 10px; box-shadow: var(--sh-sm); }
.topbar__titles { flex: 1; min-width: 0; }
.topbar__title { font-size: 18px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__sub { font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.icon-btn {
    position: relative;
    width: 42px;
    height: 42px;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: var(--ink-2);
    transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface); color: var(--brand); box-shadow: var(--sh-sm); }
.icon-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.icon-btn svg { width: 22px; height: 22px; fill: currentColor; }
.icon-btn.is-surface { background: var(--surface); box-shadow: var(--sh-sm); }
.icon-btn.is-spinning svg { animation: spin .8s linear infinite; }

.page {
    flex: 1;
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 8px 16px calc(var(--tabbar-h) + var(--safe-b) + 32px);
}
.page.no-tabbar { padding-bottom: calc(var(--safe-b) + 110px); }

/* Mobile floating tab bar */
.tabbar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(10px + var(--safe-b));
    z-index: 40;
    height: var(--tabbar-h);
    display: flex;
    padding: 6px;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--sh-lg);
    max-width: 560px;
    margin: 0 auto;
}
.tabbar a {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border-radius: 16px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    transition: color .15s, background .15s;
}
.tabbar a svg { width: 22px; height: 22px; fill: currentColor; }
.tabbar a.is-active { color: var(--brand); background: var(--brand-50); }
.tabbar a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

@media (min-width: 1024px) {
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 35;
        width: var(--sidebar-w);
        display: flex;
        flex-direction: column;
        padding: 20px 16px;
        background: var(--surface);
        border-right: 1px solid var(--line);
    }
    .main { margin-left: var(--sidebar-w); }
    .tabbar { display: none; }
    .topbar { padding: 0 24px 0 32px; height: 72px; }
    .topbar .topbar__brand { display: none; }
    .topbar__title { font-size: 22px; }
    .page { padding: 12px 32px 48px; }
    .page.no-tabbar { padding-bottom: 48px; }
    .only-mobile { display: none !important; }
}
@media (max-width: 1023.98px) {
    .only-desktop { display: none !important; }
}

.side-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.side-brand img { width: 42px; height: 42px; border-radius: 12px; box-shadow: var(--sh); }
.side-brand b { display: block; font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.side-brand small { color: var(--muted); font-size: 12px; font-weight: 500; }
.side-label { padding: 0 12px 8px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 12px;
    color: var(--ink-2);
    font-weight: 600;
    transition: background .15s, color .15s;
}
.side-nav a svg { width: 22px; height: 22px; fill: currentColor; opacity: .8; }
.side-nav a:hover { background: var(--surface-2); color: var(--ink); }
.side-nav a.is-active { background: var(--brand-50); color: var(--brand); }
.side-nav a.is-active svg { opacity: 1; }
.side-user { margin-top: auto; padding: 12px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); }
.side-user__info { flex: 1; min-width: 0; }
.side-user__name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user__mail { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* =========================================================================
   Primitives
   ========================================================================= */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-sm);
}
.card-pad { padding: 18px; }
.card__head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card__title { flex: 1; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card__title svg { width: 20px; height: 20px; fill: var(--brand); }
.card__body { padding: 16px 18px; }

.section { margin-top: 24px; }
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.section-head h2 { flex: 1; font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.link { color: var(--brand); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.link svg { width: 16px; height: 16px; fill: currentColor; }
.link:hover { color: var(--brand-700); }

.muted { color: var(--muted); }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.avatar {
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    color: var(--brand-700);
    background: var(--brand-100);
}
.avatar.is-sm { width: 34px; height: 34px; font-size: 12px; }
.avatar.is-lg { width: 52px; height: 52px; font-size: 22px; border-radius: 16px; }
.avatar.is-emoji { background: linear-gradient(135deg, var(--brand-100), var(--brand-50)); }

/* Status chips */
.chip-s {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    color: var(--ink-2);
    background: var(--surface-2);
}
.chip-s::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-s.no-dot::before { display: none; }
.chip-s.is-green { color: var(--green); background: var(--green-bg); }
.chip-s.is-orange { color: var(--orange); background: var(--orange-bg); }
.chip-s.is-red { color: var(--red); background: var(--red-bg); }
.chip-s.is-blue { color: var(--blue); background: var(--blue-bg); }
.chip-s.is-violet { color: var(--violet); background: var(--violet-bg); }
.chip-s.is-brand { color: var(--brand); background: var(--brand-50); }

.badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    background: var(--brand);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 18px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    background: var(--brand);
    box-shadow: 0 4px 12px rgba(var(--brand-rgb), .22);
    transition: transform .1s, filter .15s, opacity .15s, box-shadow .15s;
    white-space: nowrap;
}
.btn svg { width: 20px; height: 20px; fill: currentColor; }
.btn:hover { filter: brightness(.96); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; filter: none; transform: none; box-shadow: none; }
.btn.is-block { width: 100%; }
.btn.is-lg { height: 54px; font-size: 16px; border-radius: 16px; }
.btn.is-sm { height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.is-green { background: var(--green); box-shadow: 0 4px 12px rgba(18, 168, 102, .25); }
.btn.is-orange { background: var(--orange); box-shadow: 0 4px 12px rgba(239, 124, 10, .25); }
.btn.is-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); box-shadow: none; }
.btn.is-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn.is-soft { background: var(--brand-50); color: var(--brand); box-shadow: none; }
.btn.is-danger-ghost { background: var(--surface); color: var(--red); border: 1px solid #F6C9CA; box-shadow: none; }
.btn.is-danger-ghost:hover { background: var(--red-bg); }
.btn.is-white { background: #fff; color: var(--brand-700); box-shadow: 0 6px 16px rgba(0, 0, 0, .12); }
.btn.is-glass { background: rgba(255, 255, 255, .16); color: #fff; box-shadow: none; border: 1px solid rgba(255, 255, 255, .28); }
.btn.is-glass:hover { background: rgba(255, 255, 255, .24); }

/* Form fields */
.label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--line-2);
    border-radius: 12px;
    background: var(--surface);
    color: var(--ink);
    font-size: 14px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: #A9A9BD; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .12); }
textarea.input { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }
select.input {
    appearance: none;
    padding-right: 40px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%238C8CA5' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 22px;
}
select.input:disabled { background-color: var(--surface-2); color: var(--muted); cursor: default; }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; fill: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 44px; }
.field-error { margin-top: 6px; color: var(--red); font-size: 12px; font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-2 > * { min-width: 0; }
@media (max-width: 479.98px) { .grid-2.stack-sm { grid-template-columns: minmax(0, 1fr); } }

/* Segmented / pill tabs */
.seg {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow-x: auto;
    scrollbar-width: none;
    box-shadow: var(--sh-sm);
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.seg button:hover { background: var(--surface-2); color: var(--ink); }
.seg button.is-active { background: var(--brand); color: #fff; box-shadow: 0 4px 10px rgba(var(--brand-rgb), .25); }
.seg button .badge { background: var(--brand-50); color: var(--brand); }
.seg button.is-active .badge { background: rgba(255, 255, 255, .25); color: #fff; }
/* Kitchen / Riders order tabs: every tab visible, always three to a row (6 tabs → 3 + 3)
   however big the counts get — compact enough that "Order List 674" still fits. */
.seg.is-fill { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; }
.seg.is-fill button { min-width: 0; justify-content: center; gap: 4px; padding: 8px 4px; font-size: 12.5px; overflow: hidden; }
.seg.is-fill button .badge { padding: 0 5px; }
/* Orders page: 7 tabs → two rows of four. A quarter row has no room for a count beside
   the name, so it sits as a small bubble on the end of the name, raised. */
.seg.is-fill.is-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.seg.is-fill.is-4 button { overflow: visible; }
.seg.is-fill.is-4 .seg__label { position: relative; }
.seg.is-fill.is-4 button .badge {
    position: absolute; top: -13px; left: 100%; margin-left: 1px; height: 17px; min-width: 17px; padding: 0 5px;
    font-size: 10px; background: var(--brand); color: #fff; box-shadow: 0 0 0 2px var(--surface);
}
.seg.is-fill.is-4 button.is-active .badge { background: #fff; color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.sticky-bar {
    position: sticky;
    top: var(--topbar-h);
    z-index: 20;
    margin: 0 -16px;
    padding: 6px 16px 10px;
    background: linear-gradient(var(--bg) 75%, rgba(var(--bg-rgb), 0));
}
@media (min-width: 1024px) { .sticky-bar { top: 72px; margin: 0 -32px; padding: 6px 32px 12px; } }

/* =========================================================================
   Dashboard
   ========================================================================= */

.hero {
    position: relative;
    overflow: hidden;
    padding: 22px;
    border-radius: var(--r-xl);
    background: var(--brand-grad);
    color: #fff;
    box-shadow: 0 10px 24px rgba(var(--brand-rgb), .28);
}
.hero::before, .hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    pointer-events: none;
}
.hero::before { width: 260px; height: 260px; right: -80px; top: -120px; }
.hero::after { width: 160px; height: 160px; right: 60px; bottom: -90px; background: rgba(255, 255, 255, .07); }
.hero > * { position: relative; }
.hero__top { display: flex; align-items: flex-start; gap: 14px; }
.hero__avatar { width: 52px; height: 52px; border-radius: 16px; background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .3); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; flex: none; }
.hero__greet { font-size: 13px; opacity: .85; font-weight: 500; }
.hero__name { font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.hero__pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .18); font-size: 12px; font-weight: 600; }
/* Dashboard: role + date pills stay on one line — the date keeps its size, the role
   ("Kitchen Manager") shortens with … first on narrow phones. */
.hero__top .hero__meta { flex-wrap: nowrap; min-width: 0; }
.hero__top .hero__pill { flex: none; white-space: nowrap; }
.hero__top .hero__pill:first-child { flex: 0 1 auto; min-width: 0; }
@media (max-width: 389px) { .hero__top .hero__pill svg { display: none; } }
.hero__pill svg { width: 14px; height: 14px; fill: currentColor; }
/* Order hero: one solid colour per pill (time, payment, vendor, rider, delivery). */
.hero__pill[class*="is-"] { font-weight: 700; box-shadow: 0 2px 6px rgba(0, 0, 0, .12); }
.hero__pill.is-blue { background: var(--blue-bg); color: var(--blue); }
.hero__pill.is-green { background: var(--green-bg); color: var(--green); }
.hero__pill.is-orange { background: var(--orange-bg); color: var(--orange); }
.hero__pill.is-red { background: var(--red-bg); color: var(--red); }
.hero__pill.is-violet { background: var(--violet-bg); color: var(--violet); }
.hero__pill.is-yellow { background: #FEF7D7; color: #A16207; }
.hero__pill.is-pink { background: #FDECF5; color: #C8167A; }
.hero__stats { display: flex; gap: 10px; margin-top: 18px; }
.hero__stats + .hero__stats { margin-top: 10px; }
.hero__stat { flex: 1; min-width: 0; padding: 12px 8px 12px 10px; border-radius: 16px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .18); }
.hero__stat b { display: block; font-size: 22px; font-weight: 800; line-height: 1.1; }
.hero__stat span { display: block; font-size: 12px; opacity: .85; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Keeps the longest label ("Not Delivered") on one line on narrow phones. */
@media (max-width: 389px) { .hero__stat span { font-size: 11px; } }
.hero__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); } }

.kpi { padding: 16px; display: flex; flex-direction: column; gap: 12px; transition: transform .15s, box-shadow .15s; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--sh); }
.kpi__icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.kpi__icon svg { width: 22px; height: 22px; fill: currentColor; }
.kpi__value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.kpi__label { font-size: 13px; color: var(--muted); font-weight: 600; }
.tone-brand { color: var(--brand); background: var(--brand-50); }
.tone-green { color: var(--green); background: var(--green-bg); }
.tone-orange { color: var(--orange); background: var(--orange-bg); }
.tone-red { color: var(--red); background: var(--red-bg); }
.tone-blue { color: var(--blue); background: var(--blue-bg); }
.tone-violet { color: var(--violet); background: var(--violet-bg); }
.kpi.is-accent { background: linear-gradient(135deg, #1F1F3A, #34345C); border-color: transparent; color: #fff; }
.kpi.is-accent .kpi__label { color: rgba(255, 255, 255, .7); }
.kpi.is-accent .kpi__icon { background: rgba(255, 255, 255, .12); color: #FFD27A; }
.kpi.is-wide { grid-column: span 2; }

.dash-grid { display: grid; gap: 16px; margin-top: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .dash-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; } }

.meter-row + .meter-row { margin-top: 16px; }
.meter-row__head { display: flex; align-items: baseline; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.meter-row__head b { margin-left: auto; font-size: 15px; color: var(--ink); }
.meter { height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 99px; width: 0; transition: width .6s cubic-bezier(.2, .8, .2, 1); }

.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick a { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 13px; transition: border-color .15s, transform .15s; }
.quick a:hover { border-color: var(--brand); transform: translateY(-1px); }
.quick a .kpi__icon { width: 36px; height: 36px; border-radius: 10px; }

.queue { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.queue a { padding: 14px 12px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); text-align: center; transition: border-color .15s; }
.queue a:hover { border-color: var(--brand); }
.queue b { display: block; font-size: 24px; font-weight: 800; }
.queue span { font-size: 12px; font-weight: 600; color: var(--muted); }

.rowlist a, .rowlist .rowitem { display: flex; align-items: center; gap: 12px; padding: 12px 18px; transition: background .15s; }
.rowlist a + a { border-top: 1px solid var(--line); }
.rowlist a:hover { background: var(--surface-2); }
.rowlist__name { font-weight: 700; font-size: 14px; }
.rowlist__sub { font-size: 12px; color: var(--muted); }

/* =========================================================================
   Orders
   ========================================================================= */

.ogrid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .ogrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1400px) { .ogrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ogrid.is-single { grid-template-columns: minmax(0, 1fr); }

.ocard {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 16px 14px 20px;
    overflow: hidden;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.ocard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--rail, var(--blue)); }
.ocard:hover { transform: translateY(-2px); box-shadow: var(--sh); border-color: var(--line-2); }
.ocard.is-done { --rail: var(--green); }
.ocard.is-cancel { --rail: var(--red); }
.ocard__top { display: flex; align-items: center; gap: 8px; }
.ocard__id { font-size: 15px; font-weight: 800; color: var(--brand); }
.ocard__time { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 600; }
.ocard__time svg { width: 14px; height: 14px; fill: currentColor; }
.ocard__top .chip-s { margin-left: auto; }
.ocard__cust { display: flex; align-items: center; gap: 10px; }
.ocard__name { font-weight: 700; font-size: 15px; }
.ocard__phone { font-size: 12px; color: var(--muted); font-weight: 500; }
.ocard__items { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); color: var(--ink-2); font-size: 13px; }
.ocard__addr { display: flex; gap: 6px; color: var(--muted); font-size: 13px; }
.ocard__addr svg { width: 16px; height: 16px; fill: currentColor; margin-top: 1px; }
.ocard__foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-top: 2px; }
.ocard__amount { margin-left: auto; font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.ocard__go { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-50); display: flex; align-items: center; justify-content: center; }
.ocard__go svg { width: 18px; height: 18px; fill: var(--brand); }

.toolbar-row { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.toolbar-row .input-icon { flex: 1; }
.count-note { font-size: 12px; color: var(--muted); font-weight: 600; margin: 0 2px 10px; }
/* Vendor / rider group cards */
.ggrid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .ggrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .ggrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.gcard { display: flex; align-items: center; gap: 14px; padding: 16px; transition: transform .15s, box-shadow .15s, border-color .15s; }
.gcard:hover { transform: translateY(-2px); box-shadow: var(--sh); border-color: var(--brand-200); }
.gcard__name { font-size: 16px; font-weight: 800; }
.gcard__sub { margin-top: 2px; font-size: 13px; color: var(--muted); font-weight: 500; }
.gcard__chev { width: 22px; height: 22px; fill: var(--muted); }
.pill-new { padding: 5px 10px; border-radius: 999px; background: var(--green); color: #fff; font-size: 12px; font-weight: 800; white-space: nowrap; box-shadow: 0 4px 10px rgba(18, 168, 102, .25); }

/* Empty / loading */
.empty { padding: 48px 24px; text-align: center; }
.empty__icon { width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 24px; display: flex; align-items: center; justify-content: center; font-size: 32px; background: var(--brand-50); }
.empty__title { font-size: 16px; font-weight: 800; }
.empty__sub { margin-top: 4px; color: var(--muted); font-size: 13px; }
.ogrid > .empty, .ggrid > .empty { grid-column: 1 / -1; }

.skeleton { position: relative; overflow: hidden; background: var(--surface); }
.skeleton i { display: block; height: 12px; border-radius: 6px; background: #EFEBF3; margin-top: 10px; }
.skeleton i:first-child { margin-top: 0; }
.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent);
    animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

.spinner { width: 28px; height: 28px; margin: 18px auto; border-radius: 50%; border: 3px solid var(--brand-100); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ogrid > .spinner { grid-column: 1 / -1; }

.ptr {
    position: fixed;
    left: 50%;
    top: calc(var(--topbar-h) + 8px);
    z-index: 25;
    width: 40px;
    height: 40px;
    margin-left: -20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--sh);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(-60px);
    pointer-events: none;
}
.ptr .spinner { width: 22px; height: 22px; margin: 0; border-width: 2.5px; animation-play-state: paused; }
.ptr.is-loading .spinner { animation-play-state: running; }

/* =========================================================================
   POS + checkout
   ========================================================================= */

/* minmax(0, 1fr) everywhere: a wide child (big product photo, long chip row)
   must never stretch a column past the screen. */
.pos-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .pos-layout { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 4px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
    flex: none;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    transition: all .15s;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

.pgrid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 12px; }
@media (min-width: 640px) { .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .pgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.product { display: flex; flex-direction: column; overflow: hidden; text-align: left; transition: transform .15s, box-shadow .15s; }
.product:hover { transform: translateY(-2px); box-shadow: var(--sh); }
.product:active { transform: scale(.98); }
.product__media { position: relative; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface-2); }
.product__img, .product__ph { position: absolute; inset: 0; width: 100%; height: 100%; max-width: 100%; object-fit: cover; display: flex; align-items: center; justify-content: center; }
.product__ph svg { width: 44px; height: 44px; fill: var(--brand-200); }
.product__off { position: absolute; left: 8px; top: 8px; padding: 3px 8px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; }
.product__qty { position: absolute; right: 8px; top: 8px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.product__body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product__name { font-size: 14px; font-weight: 700; min-height: 2.9em; }
.product__foot { display: flex; align-items: center; margin-top: auto; }
.product__price { font-size: 15px; font-weight: 800; }
.product__was { margin-left: 6px; color: var(--muted); font-size: 12px; font-weight: 600; text-decoration: line-through; }
.product__add { margin-left: auto; width: 32px; height: 32px; border-radius: 10px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(var(--brand-rgb), .3); }
.product__add svg { width: 20px; height: 20px; fill: currentColor; }

.cart-panel { display: none; }
@media (min-width: 1024px) {
    .cart-panel { display: block; position: sticky; top: 88px; }
    .cart-float { display: none !important; }
}
.cart-panel__lines { max-height: calc(100vh - 360px); overflow-y: auto; padding: 0 18px; }
.cart-panel__empty { padding: 32px 18px; text-align: center; color: var(--muted); }
.cart-panel__foot { padding: 16px 18px; border-top: 1px solid var(--line); }

.cart-float {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(var(--tabbar-h) + var(--safe-b) + 18px);
    z-index: 38;
    max-width: 560px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px 10px 16px;
    border-radius: 18px;
    background: var(--ink);
    color: #fff;
    box-shadow: var(--sh-lg);
    animation: rise .25s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.cart-float__count { font-size: 12px; opacity: .7; font-weight: 600; }
.cart-float__total { font-size: 18px; font-weight: 800; }
.cart-float .btn { height: 44px; border-radius: 12px; }
.page.has-cart { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 110px); }
@media (min-width: 1024px) { .page.has-cart { padding-bottom: 48px; } }

.line { display: flex; align-items: center; gap: 10px; padding: 12px 0; }
.line + .line { border-top: 1px dashed var(--line-2); }
.line__name { font-size: 14px; font-weight: 700; }
.line__price { margin-top: 2px; font-size: 12px; color: var(--muted); font-weight: 600; }
.stepper { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.stepper button { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; color: var(--ink-2); }
.stepper button:hover { background: var(--surface); color: var(--brand); box-shadow: var(--sh-sm); }
.stepper button svg { width: 18px; height: 18px; fill: currentColor; }
.stepper span { min-width: 24px; text-align: center; font-weight: 800; }

.sum-row { display: flex; align-items: baseline; padding: 4px 0; color: var(--ink-2); font-weight: 600; }
.sum-row b { margin-left: auto; color: var(--ink); }
.sum-row.is-total { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--ink); font-size: 16px; font-weight: 800; }
.sum-row.is-total b { font-size: 22px; color: var(--brand); }

.checkout-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) {
    .checkout-layout { grid-template-columns: minmax(0, 1fr) 400px; align-items: start; }
    .checkout-layout .summary { position: sticky; top: 88px; grid-row: 1 / span 3; grid-column: 2; }
}
.paybar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 38;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px calc(12px + var(--safe-b));
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(23, 23, 43, .06);
}
.paybar__total { font-size: 20px; font-weight: 800; color: var(--brand); }
.paybar .btn { flex: 1; max-width: 260px; margin-left: auto; }
@media (min-width: 1024px) { .paybar { display: none; } }

/* =========================================================================
   Order detail
   ========================================================================= */

.detail-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .detail-layout { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; } .detail-layout .side { position: sticky; top: 88px; } }
.order-hero { padding: 22px; }
.order-hero__id { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.order-hero__status { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #fff; font-size: 13px; font-weight: 800; }
.order-hero__total { margin-top: 18px; display: flex; align-items: flex-end; }
.order-hero__total span { font-size: 13px; opacity: .85; font-weight: 600; }
.order-hero__total b { margin-left: auto; font-size: 32px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }

.kv { display: flex; gap: 12px; padding: 10px 0; }
.kv + .kv { border-top: 1px dashed var(--line-2); }
.kv__k { width: 84px; flex: none; color: var(--muted); font-size: 13px; font-weight: 600; }
.kv__v { flex: 1; min-width: 0; font-weight: 700; word-break: break-word; }
.contact-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.contact-actions a, .contact-actions button { display: flex; align-items: center; justify-content: center; gap: 6px; height: 42px; border-radius: 12px; border: 1px solid var(--line-2); font-weight: 700; font-size: 13px; background: var(--surface); transition: border-color .15s, background .15s; }
.contact-actions a:hover, .contact-actions button:hover { border-color: var(--brand); background: var(--brand-50); }
.contact-actions svg { width: 18px; height: 18px; }
.contact-actions .is-off { opacity: .4; pointer-events: none; }

.item-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.item-row + .item-row { border-top: 1px dashed var(--line-2); }
.item-row__qty { min-width: 36px; height: 28px; padding: 0 8px; border-radius: 8px; background: var(--brand-50); color: var(--brand); font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.item-row__name { flex: 1; min-width: 0; font-weight: 600; }

.manage-block:not([hidden]) ~ .manage-block { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.manage-label { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.toggle-pay { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.toggle-pay button { height: 40px; border-radius: 10px; font-weight: 800; font-size: 13px; color: var(--muted); }
.toggle-pay button.is-on.is-paid { background: var(--green); color: #fff; box-shadow: 0 4px 10px rgba(18, 168, 102, .25); }
.toggle-pay button.is-on.is-unpaid { background: var(--orange); color: #fff; box-shadow: 0 4px 10px rgba(239, 124, 10, .25); }
.toggle-pay button.is-on.is-bkash { background: #E2136E; box-shadow: 0 4px 10px rgba(226, 19, 110, .25); }
/* Locked payment (rider, after the one-minute undo): faded like a disabled button. */
.toggle-pay button:disabled { cursor: default; opacity: .45; box-shadow: none; }

/* =========================================================================
   Login
   ========================================================================= */

.auth { min-height: 100vh; display: grid; background: var(--surface); }
.auth__brand {
    position: relative;
    overflow: hidden;
    padding: 44px 28px 92px;
    background: var(--brand-grad);
    color: #fff;
}
.auth__brand::before, .auth__brand::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .1); }
.auth__brand::before { width: 380px; height: 380px; right: -140px; top: -160px; }
.auth__brand::after { width: 240px; height: 240px; left: -90px; bottom: -120px; background: rgba(255, 255, 255, .07); }
.auth__brand > * { position: relative; }
.auth__logo { width: 64px; height: 64px; border-radius: 18px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.auth__title { margin-top: 18px; font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.auth__tag { margin-top: 8px; opacity: .88; font-size: 15px; max-width: 380px; }
.auth__features { display: none; margin-top: 36px; gap: 14px; flex-direction: column; }
.auth__feature { display: flex; gap: 12px; align-items: flex-start; }
.auth__feature i { width: 40px; height: 40px; flex: none; border-radius: 12px; background: rgba(255, 255, 255, .16); display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 18px; }
.auth__feature b { display: block; font-size: 14px; }
.auth__feature span { font-size: 13px; opacity: .8; }
.auth__panel { display: flex; justify-content: center; padding: 0 20px 40px; margin-top: -60px; position: relative; }
.auth__card { width: 100%; max-width: 420px; padding: 26px 22px; border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--sh-lg); border: 1px solid var(--line); align-self: flex-start; }
.auth__card h1 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.auth__card > p { margin: 4px 0 22px; color: var(--muted); }
.auth__card .stack { gap: 14px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 50px; }
.pw-toggle { position: absolute; right: 4px; top: 4px; width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.pw-toggle:hover { color: var(--brand); }
.pw-toggle svg { width: 22px; height: 22px; fill: currentColor; }
.form-error { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--red-bg); color: var(--red); font-size: 13px; font-weight: 600; }
.auth__note { margin-top: 16px; text-align: center; color: var(--muted); font-size: 12px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.auth__note svg { width: 16px; height: 16px; fill: var(--green); }

@media (min-width: 960px) {
    .auth { grid-template-columns: 1.05fr 1fr; }
    .auth__brand { padding: 64px 56px; display: flex; flex-direction: column; justify-content: center; }
    .auth__title { font-size: 40px; }
    .auth__features { display: flex; }
    .auth__panel { margin: 0; align-items: center; padding: 40px; background: var(--bg); }
    .auth__card { align-self: center; padding: 36px 32px; }
}

/* =========================================================================
   Modal · toast
   ========================================================================= */

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(23, 23, 43, .45);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: fade .15s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.modal__box {
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: var(--surface);
    border-radius: 24px 24px 0 0;
    padding: 22px 20px calc(20px + var(--safe-b));
    box-shadow: var(--sh-lg);
    animation: sheet .22s cubic-bezier(.2, .8, .2, 1);
}
@keyframes sheet { from { transform: translateY(40px); opacity: .5; } }
@media (min-width: 640px) {
    .modal { align-items: center; padding: 24px; }
    .modal__box { border-radius: 24px; padding: 24px; }
}
.modal__title { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.modal__msg { color: var(--ink-2); margin-bottom: 16px; }
.modal__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.option-list { margin: 10px -8px 0; display: flex; flex-direction: column; gap: 4px; }
.option-list button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px 12px; border-radius: 12px; text-align: left; font-weight: 600; border: 1px solid var(--line); }
.option-list button:hover { border-color: var(--brand); background: var(--brand-50); }
.option-list button b { margin-left: auto; color: var(--brand); }

.set-row { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); }
.set-row + .set-row { margin-top: 10px; }
.set-row__text { flex: 1; min-width: 0; }
.set-row__title { font-weight: 700; }
.set-row__sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: #DCD6E2; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(20px); }

.toast-wrap {
    position: fixed;
    left: 50%;
    bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px);
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: max-content;
    max-width: calc(100vw - 32px);
    pointer-events: none;
}
body.no-tabbar-body .toast-wrap { bottom: 96px; }
body:has(.cart-float:not([hidden])) .toast-wrap { bottom: calc(var(--tabbar-h) + var(--safe-b) + 96px); }
@media (min-width: 1024px) { .toast-wrap, body.no-tabbar-body .toast-wrap { bottom: 28px; left: calc(50% + var(--sidebar-w) / 2); } }
.toast { padding: 11px 18px; border-radius: 14px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; text-align: center; box-shadow: var(--sh-lg); animation: rise .2s ease-out; }
.toast.is-out { opacity: 0; transition: opacity .3s; }

/* =========================================================================
   Role themes — admin keeps the pink brand; vendor = teal, rider = indigo
   ========================================================================= */

body.theme-vendor {
    --brand: #0D9488;
    --brand-600: #0B7F75;
    --brand-700: #08665E;
    --brand-50: #EAF8F6;
    --brand-100: #CCEFEA;
    --brand-200: #9EDDD4;
    --brand-rgb: 13, 148, 136;
    --brand-grad: linear-gradient(135deg, #14B8A6 0%, #0D9488 45%, #065F5B 100%);
    --bg: #F2F7F6;
    --bg-rgb: 242, 247, 246;
    --surface-2: #F7FBFA;
    --line: #E3EEEC;
    --line-2: #D3E3E0;
}

body.theme-rider {
    --brand: #4F46E5;
    --brand-600: #4338CA;
    --brand-700: #3730A3;
    --brand-50: #EEF0FF;
    --brand-100: #E0E3FF;
    --brand-200: #C3C8FB;
    --brand-rgb: 79, 70, 229;
    --brand-grad: linear-gradient(135deg, #6366F1 0%, #4F46E5 45%, #2E2A8F 100%);
    --bg: #F4F5FB;
    --bg-rgb: 244, 245, 251;
    --surface-2: #F8F9FE;
    --line: #E7E9F5;
    --line-2: #D9DCEE;
}

/* =========================================================================
   Fancy dropdowns (RG.enhanceSelect)
   ========================================================================= */

.xselect { position: relative; min-width: 0; }
.xselect > select { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.xselect__btn { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; padding: 0 8px; text-align: left; cursor: pointer; }
.xselect__btn:hover { border-color: var(--brand-200); }
.xselect__btn:disabled { cursor: default; background: var(--surface-2); color: var(--muted); }
.xselect__btn:disabled:hover { border-color: var(--line-2); }
.xselect.is-open .xselect__btn { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .12); }
.xselect__value { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xselect__value.is-placeholder { color: var(--muted); font-weight: 500; }
.xselect__chev { width: 20px; height: 20px; fill: var(--muted); transform: rotate(90deg); transition: transform .2s; }
.xselect.is-open .xselect__chev { transform: rotate(-90deg); fill: var(--brand); }

.xopt__ava {
    width: 30px;
    height: 30px;
    flex: none;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: var(--brand-700);
    background: var(--brand-100);
}
.xopt__ava.is-empty { color: var(--muted); background: var(--surface-2); border: 1px dashed var(--line-2); }

.xselect__menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 60;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--sh-lg);
    animation: pop .14s ease-out;
    transform-origin: top center;
}
.xselect.is-up .xselect__menu { top: auto; bottom: calc(100% + 6px); transform-origin: bottom center; }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(-4px); } }
.xselect__search .input { height: 40px; border-radius: 10px; }
.xselect__list { max-height: 264px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; outline: none; }
.xselect__sheet .xselect__list { max-height: 60vh; margin-top: 10px; }
.xselect__sheet .xselect__search { margin-top: 12px; }
.xselect__none { padding: 16px; text-align: center; color: var(--muted); font-size: 13px; }

.xopt {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    text-align: left;
    font-weight: 600;
    color: var(--ink);
    transition: background .12s;
}
.xopt:hover, .xopt.is-active { background: var(--surface-2); }
.xopt.is-selected { background: var(--brand-50); color: var(--brand-700); }
.xopt.is-selected .xopt__ava { background: var(--brand); color: #fff; }
.xopt:disabled { opacity: .45; cursor: default; }
.xopt__label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xopt__check { width: 20px; height: 20px; fill: var(--brand); }
.xselect__sheet .xopt { padding: 12px 10px; }

/* Cart line remove + mobile cart sheet */
.line__remove {
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--red);
    background: var(--red-bg);
    transition: background .15s, color .15s;
}
.line__remove:hover { background: var(--red); color: #fff; }
.line__remove svg { width: 18px; height: 18px; fill: currentColor; }
.cart-float__view { display: flex; flex-direction: column; align-items: flex-start; text-align: left; color: #fff; }
.cart-float__view u { text-underline-offset: 2px; opacity: .9; }
.cart-sheet__lines { margin-top: 10px; max-height: 50vh; overflow-y: auto; }
/* While a dialog/sheet is open, toasts move to the top so they never cover it. */
body:has(.modal) .toast-wrap { top: calc(16px + env(safe-area-inset-top, 0px)); bottom: auto !important; }

/* =========================================================================
   Installable app: "Get the app" banner, install steps, standalone mode
   ========================================================================= */

.app-banner {
    position: relative;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin: 4px 0 16px;
    padding: 14px 40px 14px 14px;
    border-color: var(--brand-100);
    background: linear-gradient(135deg, var(--brand-50), var(--surface) 70%);
}
.app-banner__icon { width: 44px; height: 44px; flex: none; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 22px; background: var(--surface); box-shadow: var(--sh-sm); }
.app-banner__title { font-weight: 800; font-size: 15px; }
.app-banner__sub { margin-top: 2px; color: var(--ink-2); font-size: 13px; }
.app-banner__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.app-banner__close { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 8px; color: var(--muted); font-size: 14px; }
.app-banner__close:hover { background: var(--surface-2); color: var(--ink); }

.install-steps { margin: 0 0 14px; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--ink-2); }
.kbd { display: inline-block; padding: 0 6px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 12px; }
.set-row__sub.set-row__wrap { white-space: normal; }

/* Installed app: keep the top bar clear of the phone's status bar / notch. */
@media (display-mode: standalone) {
    .topbar { height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px)); padding-top: env(safe-area-inset-top, 0px); }
}

/* =========================================================================
   Kitchen Manager theme (ocean blue) — admin pink, vendor teal, rider indigo
   ========================================================================= */

body.theme-manager {
    --brand: #0284C7;
    --brand-600: #0369A1;
    --brand-700: #075985;
    --brand-50: #EAF6FD;
    --brand-100: #CDEAFB;
    --brand-200: #9CD3F5;
    --brand-rgb: 2, 132, 199;
    --brand-grad: linear-gradient(135deg, #0EA5E9 0%, #0284C7 45%, #0B4A75 100%);
    --bg: #F2F6FA;
    --bg-rgb: 242, 246, 250;
    --surface-2: #F7FAFD;
    --line: #E3EBF2;
    --line-2: #D3DFEA;
}

/* =========================================================================
   Filters: search + date range
   ========================================================================= */

.filter-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; margin-top: 10px; }
.filter-row > .grow { min-width: 200px; }
.range { width: 176px; flex: none; }
.range .xselect__btn { background: var(--surface); }
.range__custom { margin-top: 10px; }
.range:has(.range__custom:not([hidden])) { width: 100%; }
@media (max-width: 479.98px) {
    .range { width: 100%; }
}

/* Rider stats (Riders screen + dashboard) */
.gcard.is-stats { flex-wrap: wrap; row-gap: 12px; }
/* Delivered / paid / unpaid on one line; a rider's cash / bKash money wraps under them. */
.rstats { display: flex; flex-wrap: wrap; gap: 6px; flex-basis: 100%; min-width: 0; }
.rstat { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.rstat.is-green { color: var(--green); background: var(--green-bg); }
.rstat.is-blue { color: var(--blue); background: var(--blue-bg); }
.rstat.is-orange { color: var(--orange); background: var(--orange-bg); }
.rstat.is-teal { color: #0F766E; background: #E6F6F4; }
.rstat.is-pink { color: #E2136E; background: #FDE7F1; }

/* Order money details */
.ocard__amount small { display: block; font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; text-align: right; }
.item-row__name small { display: block; margin-top: 1px; color: var(--muted); font-size: 12px; font-weight: 600; }
.item-row__total { font-weight: 800; white-space: nowrap; }
.item-row__total.is-purchase { color: var(--brand); font-size: 16px; }
.ocard__lines { padding: 2px 12px; }
.ocard__lines .item-row { gap: 10px; padding: 7px 0; }
.ocard__lines .item-row__qty { min-width: 32px; height: 24px; font-size: 12px; }
.ocard__lines .item-row.is-sum { border-top: 1px solid var(--line-2); }
.ocard__lines .item-row.is-sum .item-row__name { font-weight: 800; }
.pre-line { white-space: pre-line; }
.money-input { position: relative; }
.money-input > span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 800; }
.money-input .input { padding-left: 32px; }

.notice .card__body { font-size: 13px; font-weight: 600; }
.notice.is-red { border-color: #F6C9CA; background: var(--red-bg); color: #9B1C1E; }
.notice.is-orange { border-color: #F8D9B0; background: var(--orange-bg); color: #8A4A05; margin-bottom: 16px; }

/* =========================================================================
   Delivery report (rider PDF export)
   ========================================================================= */

.report-controls { margin-bottom: 16px; }
.report-controls__title { font-size: 16px; font-weight: 800; }
.report-controls__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.report-paper-wrap { overflow-x: auto; border-radius: var(--r-lg); box-shadow: var(--sh); }
.report-paper {
    min-width: 760px;
    padding: 28px;
    background: #fff;
    color: #17172B;
    font-size: 12px;
    line-height: 1.45;
}
.rp-head { display: flex; align-items: center; gap: 14px; padding-bottom: 16px; border-bottom: 2px solid #17172B; }
.rp-head img { width: 46px; height: 46px; border-radius: 12px; }
.rp-head h1 { margin: 0 0 2px; font-size: 20px; font-weight: 800; }
.rp-meta { text-align: right; color: #4B4B66; font-size: 11px; }
.rp-summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 16px 0; }
.rp-summary > div { padding: 10px 12px; border: 1px solid #E2DBE8; border-radius: 10px; }
.rp-summary span { display: block; color: #4B4B66; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.rp-summary b { display: block; font-size: 20px; font-weight: 800; }
.rp-summary small { display: block; font-weight: 700; color: #4B4B66; }
.rp-summary .is-green b { color: #12A866; }
.rp-summary .is-orange b { color: #EF7C0A; }
.rp-summary .is-red b { color: #E5383B; }
.rp-summary .is-blue b { color: #2D7FF0; }
.rp-summary .is-violet b { color: #7357F0; }
.rp-summary .is-pink b { color: #E2136E; }
.rp-table { width: 100%; border-collapse: collapse; }
.rp-table th { padding: 8px; background: #F3F1F6; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #4B4B66; }
.rp-table td { padding: 8px; border-bottom: 1px solid #ECE7F1; vertical-align: top; }
.rp-table .num { text-align: right; white-space: nowrap; }
.rp-table tr.is-cancelled td { color: #8C8CA5; }
.rp-table tfoot td { padding-top: 10px; border-bottom: 0; font-weight: 800; }
.rp-table .muted { color: #8C8CA5; }
.rp-tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.rp-tag.is-completed, .rp-tag.is-paid { color: #12A866; background: #E7F7EF; }
.rp-tag.is-pending { color: #EF7C0A; background: #FEF2E4; }
.rp-tag.is-cancelled { color: #E5383B; background: #FDECEC; }
.rp-tag.is-unpaid { color: #7357F0; background: #F0ECFE; }
.rp-tag.is-cash { color: #12A866; background: #E7F7EF; }
.rp-tag.is-bkash { color: #E2136E; background: #FDE7F1; }
.rp-empty { padding: 40px; text-align: center; color: #8C8CA5; }
.rp-note { margin: 10px 0 0; color: #8C8CA5; font-size: 11px; }

@media print {
    @page { size: A4 landscape; margin: 10mm; }
    body { background: #fff; }
    body * { visibility: hidden; }
    #reportDoc, #reportDoc * { visibility: visible; }
    #reportDoc { position: absolute; left: 0; top: 0; width: 100%; min-width: 0; padding: 0; box-shadow: none; }
    .report-paper-wrap { box-shadow: none; overflow: visible; }
    .rp-table tr { page-break-inside: avoid; }
}
.xopt__ava.is-icon { background: var(--brand-50); color: var(--brand); }
.xopt__ava.is-icon svg { width: 17px; height: 17px; fill: currentColor; }

/* Report on phones: the on-screen document as stacked cards. The PDF copy lives
   outside .report-paper-wrap (and print is page-wide), so both keep the full table. */
@media (max-width: 759.98px) {
    .report-paper-wrap .report-paper { min-width: 0; padding: 16px; }
    .report-paper-wrap .report-paper .rp-head { flex-wrap: wrap; }
    .report-paper-wrap .report-paper .rp-head h1 { font-size: 17px; }
    .report-paper-wrap .report-paper .rp-meta { width: 100%; text-align: left; }
    .report-paper-wrap .report-paper .rp-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-paper-wrap .report-paper .rp-table thead { display: none; }
    .report-paper-wrap .report-paper .rp-table,
    .report-paper-wrap .report-paper .rp-table tbody,
    .report-paper-wrap .report-paper .rp-table tr,
    .report-paper-wrap .report-paper .rp-table td { display: block; width: 100%; }
    .report-paper-wrap .report-paper .rp-table tr { margin-bottom: 10px; padding: 10px 12px; border: 1px solid #ECE7F1; border-radius: 12px; }
    .report-paper-wrap .report-paper .rp-table td { display: flex; gap: 10px; padding: 4px 0; border: 0; text-align: left; }
    .report-paper-wrap .report-paper .rp-table td::before { content: attr(data-label); flex: none; width: 76px; color: #8C8CA5; font-size: 11px; font-weight: 700; text-transform: uppercase; }
    .report-paper-wrap .report-paper .rp-table td.num { white-space: normal; }
    .report-paper-wrap .report-paper .rp-table td[data-label="#"] { display: none; }
    .report-paper-wrap .report-paper .rp-table tfoot tr { border: 0; padding: 0; }
    .report-paper-wrap .report-paper .rp-table tfoot td[colspan="2"] { display: none; }
}
@media (max-width: 759.98px) {
    .report-paper-wrap .report-paper .rp-table tfoot td::before { display: none; }
    .report-paper-wrap .report-paper .rp-table tfoot td { justify-content: space-between; }
}
