/* =====================================================================
   Anirban's Biryani - ordering app (shop, admin, rider)
   Mobile first. One stylesheet, three layouts.
   ===================================================================== */
:root {
  --burgundy-900: #260306;
  --burgundy-800: #4A0710;
  --burgundy-700: #650B16;
  --burgundy-600: #7A101B;
  --gold: #C9A45C;
  --gold-light: #E6C98A;
  --gold-dark: #9A7730;
  --cream: #F7F1E7;
  --cream-2: #FAF6F0;
  --white: #FFFFFF;
  --ink: #1F191A;
  --muted: #6B6162;
  --line: #E8DFD2;
  --green: #1E8E4E;
  --green-bg: #E5F5EC;
  --red: #D32F2F;
  --red-bg: #FDECEC;
  --amber: #B7791F;
  --amber-bg: #FFF4DB;
  --blue: #2563EB;
  --blue-bg: #E8F0FE;
  --indigo: #4F46E5;
  --indigo-bg: #EEEDFD;
  --orange: #D9570B;
  --orange-bg: #FFEBDD;
  --teal: #0F8B8D;
  --teal-bg: #DDF4F4;
  --purple: #7C3AED;
  --purple-bg: #F0E8FD;
  --gray-bg: #EEEAE4;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 3px rgba(38, 3, 6, .08);
  --shadow: 0 6px 20px rgba(38, 3, 6, .10);
  --shadow-lg: 0 16px 40px rgba(38, 3, 6, .18);
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --bottom-nav: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font-sans); font-size: 15px; line-height: 1.5;
  color: var(--ink); background: var(--cream-2); -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.1rem; } h4 { font-size: 1rem; }
.serif { font-family: var(--font-serif); }
p { margin: 0 0 .8em; }
a { color: var(--burgundy-700); text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
.i { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.i-sm { width: 16px; height: 16px; }
.i-lg { width: 26px; height: 26px; }

/* ---------- utilities ---------- */
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.flex { display: flex; } .between { justify-content: space-between; } .center { align-items: center; }
.wrap { flex-wrap: wrap; } .col { flex-direction: column; } .grow { flex: 1; min-width: 0; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .xs { font-size: .75rem; }
.bold { font-weight: 600; } .right { text-align: right; } .centered { text-align: center; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.green { color: var(--green); } .red { color: var(--red); } .amber { color: var(--amber); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 720px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-2.stack-sm { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .grid-2.stack-xs { grid-template-columns: 1fr; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 600; font-size: .95rem; cursor: pointer; transition: transform .1s, box-shadow .2s, background .2s;
  background: var(--burgundy-800); color: #fff; text-align: center; line-height: 1.1;
}
.btn:hover { background: var(--burgundy-700); }
.btn:active { transform: scale(.98); }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn-gold { background: var(--gold); color: var(--burgundy-900); }
.btn-gold:hover { background: var(--gold-light); }
.btn-outline { background: transparent; color: var(--burgundy-800); border-color: var(--burgundy-800); }
.btn-outline:hover { background: var(--burgundy-800); color: #fff; }
.btn-ghost { background: transparent; color: var(--burgundy-800); }
.btn-ghost:hover { background: var(--gray-bg); }
.btn-green { background: var(--green); } .btn-green:hover { background: #17753f; }
.btn-red { background: var(--red); } .btn-red:hover { background: #b32424; }
.btn-light { background: var(--gray-bg); color: var(--ink); } .btn-light:hover { background: #e2dcd2; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .85rem; }
.btn-lg { min-height: 52px; font-size: 1.05rem; }
.btn-block { display: flex; width: 100%; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: inherit;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; position: relative;
}
.icon-btn:hover { background: rgba(0,0,0,.06); }

/* ---------- forms ---------- */
label.lbl { display: block; font-weight: 600; font-size: .85rem; margin: 0 0 4px; color: var(--ink); }
.field { margin-bottom: 14px; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=time], input[type=datetime-local], input[type=search], input[type=url], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; font: inherit; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold-dark); box-shadow: 0 0 0 3px rgba(201,164,92,.25); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--burgundy-800); flex: none; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 36px; cursor: pointer; }
.input-group { display: flex; gap: 8px; }
.input-group .btn { flex: none; }
.switch { position: relative; width: 48px; height: 28px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #cfc6b8; border-radius: 999px; transition: .2s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }

/* ---------- cards / badges / alerts ---------- */
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--line); padding: 16px; }
.card + .card { margin-top: 12px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; font-weight: 700; }
.card.flush { padding: 0; overflow: hidden; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px;
  font-size: .75rem; font-weight: 600; white-space: nowrap; background: var(--gray-bg); color: var(--muted);
}
.badge-green { background: var(--green-bg); color: var(--green); } .badge-red { background: var(--red-bg); color: var(--red); }
.badge-amber { background: var(--amber-bg); color: var(--amber); } .badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-indigo { background: var(--indigo-bg); color: var(--indigo); } .badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-teal { background: var(--teal-bg); color: var(--teal); } .badge-purple { background: var(--purple-bg); color: var(--purple); }
.badge-gray { background: var(--gray-bg); color: var(--muted); }
.alert { padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 12px; font-size: .92rem; display: flex; gap: 10px; align-items: flex-start; }
.alert-success { background: var(--green-bg); color: #14663a; }
.alert-error { background: var(--red-bg); color: #9b1c1c; }
.alert-warn { background: var(--amber-bg); color: #8a5a10; }
.alert-info { background: var(--blue-bg); color: #1d4ed8; }
.divider { height: 1px; background: var(--line); margin: 12px 0; border: 0; }
.veg-mark { display: inline-block; width: 15px; height: 15px; border: 1.5px solid; border-radius: 3px; position: relative; flex: none; background: #fff; }
.veg-mark::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: currentColor; }
.veg-mark.veg { color: #1E8E4E; } .veg-mark.nonveg { color: #B3261E; }
.price-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: .93rem; }
.price-row.total { font-weight: 700; font-size: 1.05rem; border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 10px; }
.price-row .disc { color: var(--green); }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .i { width: 44px; height: 44px; color: var(--gold); margin-bottom: 8px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 12px; background: #faf6ef; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid #f0e9dc; vertical-align: middle; }
.table tr:hover td { background: #fffaf2; }
.table td.num, .table th.num { text-align: right; white-space: nowrap; }

/* ---------- toast / modal / sheet ---------- */
.toast-stack { position: fixed; left: 0; right: 0; bottom: calc(var(--bottom-nav) + 76px); z-index: 300; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { background: #2a1d1e; color: #fff; padding: 10px 16px; border-radius: 999px; font-size: .9rem; box-shadow: var(--shadow-lg); animation: toastIn .25s ease; max-width: 100%; }
.toast.err { background: var(--red); } .toast.ok { background: var(--green); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.overlay { position: fixed; inset: 0; background: rgba(20, 8, 8, .55); z-index: 200; display: none; align-items: flex-end; justify-content: center; }
.overlay.open { display: flex; }
.sheet { background: #fff; width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; border-radius: 22px 22px 0 0; padding: 20px 16px 24px; animation: sheetUp .25s ease; }
@keyframes sheetUp { from { transform: translateY(40px); opacity: .5; } to { transform: none; opacity: 1; } }
.sheet-handle { width: 40px; height: 4px; background: var(--line); border-radius: 4px; margin: -8px auto 14px; }
@media (min-width: 720px) { .overlay { align-items: center; } .sheet { border-radius: 20px; } }

/* =====================================================================
   SHOP (customer)
   ===================================================================== */
body.shop { padding-bottom: calc(var(--bottom-nav) + env(safe-area-inset-bottom)); }
.shop-header {
  position: sticky; top: 0; z-index: 100; background: linear-gradient(135deg, var(--burgundy-900), var(--burgundy-800));
  color: #fff; box-shadow: 0 2px 12px rgba(38, 3, 6, .3);
}
.shop-header .row { display: flex; align-items: center; gap: 10px; min-height: 60px; }
.shop-logo img { height: 40px; width: auto; background: #fff; border-radius: 8px; padding: 3px 6px; }
.loc-chip { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; color: #fff; padding: 6px 10px; border-radius: 12px; background: rgba(255,255,255,.1); }
.loc-chip:hover { background: rgba(255,255,255,.18); color: #fff; }
.loc-chip .i { color: var(--gold-light); }
.loc-chip small { display: block; font-size: .7rem; opacity: .75; line-height: 1.1; }
.loc-chip strong { display: block; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.25; }
.shop-header .icon-btn { color: #fff; }
.badge-count { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; border-radius: 9px; background: var(--gold); color: var(--burgundy-900); font-size: .7rem; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.desktop-links { display: none; gap: 4px; }
.desktop-links a { color: #fff; padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: .92rem; }
.desktop-links a:hover { background: rgba(255,255,255,.12); }
@media (min-width: 900px) { .desktop-links { display: flex; } }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 150; height: calc(var(--bottom-nav) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--line);
  display: flex; box-shadow: 0 -4px 16px rgba(38, 3, 6, .08);
}
.bottom-nav a, .bottom-nav button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); font-size: .7rem; font-weight: 600; background: none; border: 0; cursor: pointer; position: relative; min-width: 0;
}
.bottom-nav a.active, .bottom-nav button.active { color: var(--burgundy-800); }
.bottom-nav a.active::before { content: ''; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 4px 4px; background: var(--gold); }
.bottom-nav .badge-count { top: 6px; right: calc(50% - 22px); }
@media (min-width: 900px) { body.shop .bottom-nav.shop-only { display: none; } body.shop { padding-bottom: 0; } }

/* top/bottom only: the side padding comes from .container */
.page { padding-top: 16px; padding-bottom: 28px; }
.page-title { font-family: var(--font-serif); font-size: 1.9rem; font-weight: 700; color: var(--burgundy-800); margin-bottom: 12px; }

.shop-banner { padding: 12px 14px; border-radius: var(--radius-sm); margin: 12px 0; font-size: .9rem; display: flex; gap: 10px; align-items: flex-start; }
.shop-banner.closed { background: var(--red-bg); color: #9b1c1c; }
.shop-banner.far { background: var(--amber-bg); color: #8a5a10; }
.shop-banner.ok { background: var(--green-bg); color: #14663a; }

.hero-strip { background: linear-gradient(135deg, var(--burgundy-800), var(--burgundy-600)); color: #fff; border-radius: var(--radius); padding: 18px; margin: 12px 0; position: relative; overflow: hidden; }
.hero-strip h1 { font-family: var(--font-serif); font-size: 1.7rem; margin: 0 0 4px; color: var(--gold-light); }
.hero-strip p { margin: 0; opacity: .9; font-size: .9rem; }
.hero-strip .eta { display: inline-flex; gap: 6px; align-items: center; margin-top: 10px; background: rgba(255,255,255,.14); padding: 5px 12px; border-radius: 999px; font-size: .82rem; }

.offers { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x mandatory; -ms-overflow-style: none; scrollbar-width: none; }
.offers::-webkit-scrollbar { display: none; }
.offer { scroll-snap-align: start; flex: none; width: 220px; background: #fff; border: 1.5px dashed var(--gold-dark); border-radius: var(--radius-sm); padding: 10px 12px; cursor: pointer; }
.offer strong { display: block; color: var(--burgundy-800); letter-spacing: .04em; }
.offer span { font-size: .8rem; color: var(--muted); display: block; line-height: 1.3; }
.offer .tap { font-size: .72rem; color: var(--gold-dark); font-weight: 700; margin-top: 4px; }

.filters { position: sticky; top: 60px; z-index: 90; background: var(--cream-2); padding: 10px 0 6px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; border-bottom: 1px solid transparent; }
.filters.stuck { border-bottom-color: var(--line); box-shadow: 0 4px 10px rgba(38,3,6,.05); }
.search-box { position: relative; }
.search-box .i { position: absolute; left: 14px; top: 13px; color: var(--muted); }
.search-box input { padding-left: 42px; border-radius: 999px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1.5px solid var(--line); background: #fff; font-weight: 600; font-size: .85rem; color: var(--ink); cursor: pointer;
}
.chip.active { background: var(--burgundy-800); border-color: var(--burgundy-800); color: #fff; }
.chip.veg.active { background: var(--green); border-color: var(--green); }
.filter-row { display: flex; gap: 8px; align-items: center; }
.filter-row select { min-height: 36px; padding: 4px 28px 4px 12px; border-radius: 999px; font-size: .85rem; width: auto; font-weight: 600; }

.menu-section h2 { font-family: var(--font-serif); font-size: 1.6rem; color: var(--burgundy-800); margin: 22px 0 10px; display: flex; align-items: baseline; gap: 8px; }
.menu-section h2 small { font-family: var(--font-sans); font-size: .8rem; color: var(--muted); font-weight: 500; }
.products { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 720px) { .products { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .products { grid-template-columns: repeat(3, 1fr); } }
.product {
  display: flex; gap: 12px; background: #fff; border-radius: var(--radius); border: 1px solid var(--line);
  padding: 10px; box-shadow: var(--shadow-sm); position: relative; transition: box-shadow .2s;
}
.product:hover { box-shadow: var(--shadow); }
.product.sold-out { opacity: .6; }
.product .pic { width: 110px; height: 110px; border-radius: 12px; overflow: hidden; flex: none; background: linear-gradient(135deg, var(--burgundy-800), var(--burgundy-600)); position: relative; }
.product .pic img { width: 100%; height: 100%; object-fit: cover; }
.product .pic .ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--gold-light); font-family: var(--font-serif); font-size: 2.4rem; }
.product .pic .tag { position: absolute; left: 0; top: 8px; background: var(--gold); color: var(--burgundy-900); font-size: .62rem; font-weight: 700; padding: 2px 8px 2px 6px; border-radius: 0 6px 6px 0; text-transform: uppercase; letter-spacing: .03em; }
.product .info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.product .name { font-weight: 700; font-size: .98rem; line-height: 1.25; display: flex; gap: 6px; align-items: flex-start; }
.product .name .veg-mark { margin-top: 3px; }
.product .desc { font-size: .8rem; color: var(--muted); margin: 3px 0 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product .bottom { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.price { font-weight: 700; font-size: 1.05rem; }
.price s { font-weight: 400; color: var(--muted); font-size: .8rem; margin-left: 4px; }
.add-btn { min-width: 84px; min-height: 36px; border-radius: 10px; border: 1.5px solid var(--green); color: var(--green); background: #fff; font-weight: 700; font-size: .88rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.add-btn:hover { background: var(--green-bg); }
.add-btn[disabled] { border-color: var(--line); color: var(--muted); cursor: not-allowed; background: var(--gray-bg); }
.qty { display: inline-flex; align-items: center; border-radius: 10px; background: var(--green); color: #fff; overflow: hidden; }
.qty button { width: 34px; height: 36px; border: 0; background: transparent; color: #fff; font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.qty button:hover { background: rgba(0,0,0,.12); }
.qty span { min-width: 22px; text-align: center; font-weight: 700; font-size: .92rem; }
.qty.light { background: var(--gray-bg); color: var(--ink); } .qty.light button { color: var(--ink); }

.cart-bar {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--bottom-nav) + 10px + env(safe-area-inset-bottom)); z-index: 140;
  background: var(--green); color: #fff; border-radius: 14px; padding: 12px 16px; display: none; align-items: center; justify-content: space-between;
  box-shadow: 0 8px 24px rgba(30, 142, 78, .4); font-weight: 600;
}
.cart-bar.show { display: flex; }
.cart-bar:hover { color: #fff; }
@media (min-width: 900px) { .cart-bar { max-width: 520px; left: 50%; transform: translateX(-50%); bottom: 20px; } }

.cart-line { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f0e9dc; align-items: center; }
.cart-line:last-child { border-bottom: 0; }
.cart-line .thumb { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: var(--burgundy-800); flex: none; }
.cart-line .thumb img { width: 100%; height: 100%; object-fit: cover; }
.coupon-box { display: flex; gap: 8px; }
.coupon-box input { text-transform: uppercase; letter-spacing: .05em; }
.coupon-applied { display: flex; justify-content: space-between; align-items: center; background: var(--green-bg); color: #14663a; padding: 10px 12px; border-radius: var(--radius-sm); font-size: .9rem; }
.sticky-checkout { position: fixed; left: 0; right: 0; bottom: var(--bottom-nav); z-index: 130; background: #fff; border-top: 1px solid var(--line); padding: 10px 16px; display: flex; align-items: center; gap: 12px; box-shadow: 0 -4px 16px rgba(38,3,6,.08); }
.sticky-checkout .amt { font-weight: 700; font-size: 1.1rem; line-height: 1.1; }
.sticky-checkout .amt small { display: block; font-weight: 500; color: var(--muted); font-size: .72rem; }
body.has-sticky { padding-bottom: calc(var(--bottom-nav) + 76px); }
@media (min-width: 900px) { .sticky-checkout { bottom: 0; } body.has-sticky { padding-bottom: 80px; } }

.pay-option { display: flex; gap: 12px; align-items: center; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 8px; cursor: pointer; background: #fff; }
.pay-option.selected { border-color: var(--burgundy-800); background: #fff8f8; box-shadow: 0 0 0 3px rgba(122, 16, 27, .08); }
.pay-option.disabled { opacity: .5; pointer-events: none; }
.pay-option .ico { width: 40px; height: 40px; border-radius: 10px; background: var(--gray-bg); display: flex; align-items: center; justify-content: center; color: var(--burgundy-800); flex: none; }

/* order list + tracking */
.order-card { display: block; color: inherit; }
.order-card:hover { box-shadow: var(--shadow); }
.track-hero { background: linear-gradient(135deg, var(--burgundy-900), var(--burgundy-700)); color: #fff; border-radius: var(--radius); padding: 18px; }
.track-hero h1 { font-family: var(--font-serif); color: var(--gold-light); font-size: 1.8rem; margin-bottom: 2px; }
.track-hero p { margin: 0; opacity: .9; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { position: relative; padding: 0 0 18px 34px; color: var(--muted); }
.steps li::before { content: ''; position: absolute; left: 10px; top: 22px; bottom: -2px; width: 2px; background: var(--line); }
.steps li:last-child::before { display: none; }
.steps li .dot { position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; }
.steps li.done { color: var(--ink); } .steps li.done::before { background: var(--green); }
.steps li.done .dot { background: var(--green); border-color: var(--green); color: #fff; }
.steps li.done .dot .i { width: 12px; height: 12px; stroke-width: 3; }
.steps li.current .dot { border-color: var(--burgundy-700); box-shadow: 0 0 0 4px rgba(122, 16, 27, .15); animation: pulse 1.6s infinite; }
.steps li.current { color: var(--ink); font-weight: 600; }
.steps li small { display: block; font-weight: 400; color: var(--muted); }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(122, 16, 27, 0); } }
.otp-card { background: var(--amber-bg); border: 2px dashed var(--gold-dark); border-radius: var(--radius); padding: 14px; text-align: center; }
.otp-card .code { font-family: ui-monospace, monospace; font-size: 2.2rem; letter-spacing: .4em; font-weight: 700; color: var(--burgundy-800); padding-left: .4em; }
#trackMap, #pickMap, .map { height: 260px; border-radius: var(--radius); border: 1px solid var(--line); z-index: 1; }
.map.tall { height: 52vh; min-height: 320px; }
.stars { display: inline-flex; gap: 2px; direction: rtl; }
.stars input { display: none; }
.stars label { cursor: pointer; color: #d8cfc0; font-size: 1.8rem; line-height: 1; }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: #f5b301; }
.star-static { color: #f5b301; letter-spacing: 1px; }

/* auth */
.auth-wrap { max-width: 440px; margin: 0 auto; }
.otp-inputs { display: flex; gap: 8px; justify-content: center; }
.otp-inputs input { width: 46px; height: 54px; text-align: center; font-size: 1.4rem; font-weight: 700; padding: 0; }
.demo-note { background: var(--blue-bg); color: #1d4ed8; border-radius: var(--radius-sm); padding: 10px 12px; font-size: .85rem; margin-top: 10px; }

/* location page */
.loc-panel { position: relative; }
.loc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.loc-result { padding: 10px 14px; border-radius: var(--radius-sm); font-size: .9rem; margin: 10px 0; }
.loc-result.ok { background: var(--green-bg); color: #14663a; } .loc-result.bad { background: var(--red-bg); color: #9b1c1c; } .loc-result.info { background: var(--blue-bg); color: #1d4ed8; }
.saved-addr { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; margin-bottom: 8px; color: inherit; }
.saved-addr:hover { border-color: var(--gold-dark); }

.shop-footer-links { text-align: center; padding: 20px 0 10px; color: var(--muted); font-size: .8rem; }

/* PhonePe demo page */
body.phonepe { background: #f3eefb; padding: 0; }
.pp-top { background: #5f259f; color: #fff; padding: 16px; display: flex; align-items: center; gap: 12px; }
.pp-top .logo { width: 38px; height: 38px; border-radius: 50%; background: #fff; color: #5f259f; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.pp-card { max-width: 440px; margin: -10px auto 0; padding: 0 16px 30px; }
.pp-amount { background: #fff; border-radius: 16px; padding: 22px; text-align: center; box-shadow: var(--shadow); }
.pp-amount .rs { font-size: 2.4rem; font-weight: 800; color: #1c1c1c; }
.pp-ribbon { background: #fff3cd; color: #7a5b00; font-size: .78rem; padding: 6px 12px; text-align: center; font-weight: 600; }
.btn-pp { background: #5f259f; color: #fff; } .btn-pp:hover { background: #4b1c80; }

/* =====================================================================
   PANELS (admin + rider)
   ===================================================================== */
body.panel { background: #f5f1ea; }
.panel-top {
  position: sticky; top: 0; z-index: 100; height: 56px; background: var(--burgundy-900); color: #fff;
  display: flex; align-items: center; gap: 10px; padding: 0 12px;
}
.panel-top .brand { font-family: var(--font-serif); font-weight: 700; font-size: 1.2rem; color: var(--gold-light); white-space: nowrap; }
.panel-top .icon-btn { color: #fff; }
.panel-top .who { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: .85rem; }
.panel-top .who small { opacity: .7; display: block; line-height: 1; }
.shop-toggle { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.1); padding: 4px 10px 4px 12px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.panel-shell { display: block; }
.sidebar {
  position: fixed; top: 56px; bottom: 0; left: 0; width: 250px; background: #fff; border-right: 1px solid var(--line);
  overflow-y: auto; z-index: 120; transform: translateX(-100%); transition: transform .25s; padding: 10px 8px 90px;
}
.sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
.sidebar .group { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 14px 12px 4px; font-weight: 700; }
.sidebar a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink); font-weight: 500; font-size: .92rem; }
.sidebar a:hover { background: var(--cream); }
.sidebar a.active { background: var(--burgundy-800); color: #fff; }
.sidebar a .count { margin-left: auto; background: var(--red); color: #fff; font-size: .7rem; padding: 1px 7px; border-radius: 999px; font-weight: 700; }
.scrim { position: fixed; inset: 56px 0 0; background: rgba(0,0,0,.4); z-index: 110; display: none; }
.scrim.open { display: block; }
.panel-main { padding: 14px 12px calc(var(--bottom-nav) + 24px); max-width: 1400px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head h1 { margin: 0; font-size: 1.35rem; color: var(--burgundy-800); }
@media (min-width: 1000px) {
  .sidebar { transform: none; box-shadow: none; padding-bottom: 20px; }
  .panel-main { margin-left: 250px; padding: 22px 26px 40px; }
  .menu-toggle, .bottom-nav.panel-only { display: none !important; }
  .scrim { display: none !important; }
}
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
@media (min-width: 700px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1200px) { .stat-grid.six { grid-template-columns: repeat(6, 1fr); } }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; position: relative; overflow: hidden; }
.stat .label { font-size: .75rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 1.55rem; font-weight: 800; color: var(--burgundy-800); line-height: 1.2; margin-top: 2px; }
.stat .sub { font-size: .75rem; color: var(--muted); }
.stat .i { position: absolute; right: 10px; top: 10px; color: var(--gold); opacity: .55; width: 26px; height: 26px; }
.stat.alert-stat { border-color: #f3b4b4; background: #fff7f7; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input, .toolbar select { width: auto; min-height: 40px; flex: 1 1 140px; max-width: 220px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 2px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; padding: 7px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink); font-size: .85rem; font-weight: 600; }
.tabs a.active { background: var(--burgundy-800); border-color: var(--burgundy-800); color: #fff; }
.tabs a .count { background: var(--red); color: #fff; border-radius: 999px; font-size: .68rem; padding: 0 6px; margin-left: 4px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: .9rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; font-size: .88rem; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.timeline li.sys::before { background: #b8afa0; } .timeline li.cust::before { background: var(--blue); } .timeline li.rider::before { background: var(--purple); }
.timeline li .who { font-weight: 600; } .timeline li .when { color: var(--muted); font-size: .75rem; }
.perm-grid { display: grid; grid-template-columns: 1fr; gap: 2px 16px; }
@media (min-width: 700px) { .perm-grid { grid-template-columns: repeat(2, 1fr); } }
.chart-box { position: relative; height: 240px; }
.new-order-banner { background: var(--red); color: #fff; padding: 10px 14px; border-radius: var(--radius-sm); display: none; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; font-weight: 600; animation: blink 1.4s infinite; }
.new-order-banner.show { display: flex; }
@keyframes blink { 50% { opacity: .8; } }
.thumb-sm { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--burgundy-800); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* mobile card-tables */
@media (max-width: 700px) {
  table.table.stack thead { display: none; }
  table.table.stack, table.table.stack tbody, table.table.stack tr, table.table.stack td { display: block; width: 100%; }
  table.table.stack tr { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px; padding: 8px 12px; }
  table.table.stack td { border: 0; padding: 4px 0; text-align: left !important; display: flex; justify-content: space-between; gap: 12px; }
  table.table.stack td::before { content: attr(data-label); color: var(--muted); font-size: .75rem; font-weight: 600; text-transform: uppercase; flex: none; padding-top: 2px; }
  table.table.stack td.no-label::before { display: none; }
  table.table.stack tr:hover td { background: transparent; }
}

/* ---------- rider app ---------- */
body.rider { background: #f3efe8; padding-bottom: calc(var(--bottom-nav) + env(safe-area-inset-bottom) + 10px); }
.rider-top { background: linear-gradient(135deg, var(--burgundy-900), var(--burgundy-800)); color: #fff; padding: 14px 16px 18px; border-radius: 0 0 22px 22px; }
.rider-top .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: .85rem; background: rgba(255,255,255,.14); }
.status-pill .dot { width: 10px; height: 10px; border-radius: 50%; background: #9ca3af; }
.status-pill.on .dot { background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, .3); }
.rider-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.rider-stats div { background: rgba(255,255,255,.1); border-radius: 12px; padding: 10px 6px; text-align: center; }
.rider-stats strong { display: block; font-size: 1.15rem; color: var(--gold-light); }
.rider-stats span { font-size: .68rem; opacity: .8; text-transform: uppercase; letter-spacing: .04em; }
.job { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--line); margin-bottom: 12px; overflow: hidden; }
.job-head { padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; border-bottom: 1px solid #f0e9dc; }
.job-body { padding: 12px 14px; }
.job-stop { display: flex; gap: 10px; margin-bottom: 10px; }
.job-stop .pin { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; font-size: .75rem; font-weight: 700; color: #fff; }
.job-stop .pin.a { background: var(--orange); } .job-stop .pin.b { background: var(--green); }
.job-stop h4 { margin: 0; font-size: .9rem; } .job-stop p { margin: 0; font-size: .85rem; color: var(--muted); }
.job-actions { padding: 12px 14px; background: #fcfaf6; border-top: 1px solid #f0e9dc; display: flex; gap: 8px; flex-wrap: wrap; }
.job-actions .btn { flex: 1 1 140px; }
.cash-chip { background: var(--amber-bg); color: var(--amber); padding: 8px 12px; border-radius: 10px; font-weight: 700; font-size: .95rem; display: flex; justify-content: space-between; }
.cash-chip.paid { background: var(--green-bg); color: var(--green); }
.otp-entry { display: flex; gap: 8px; }
.otp-entry input { text-align: center; font-size: 1.4rem; letter-spacing: .5em; font-weight: 700; padding-left: .5em; }
.rider-login { min-height: 100vh; background: linear-gradient(160deg, var(--burgundy-900), var(--burgundy-700)); display: flex; flex-direction: column; justify-content: center; padding: 24px; }
.rider-login .card { max-width: 420px; width: 100%; margin: 0 auto; }
.login-logo { text-align: center; margin-bottom: 18px; }
.login-logo img { height: 64px; margin: 0 auto 8px; background: #fff; border-radius: 12px; padding: 6px 12px; }

a.stat { display: block; }
@media (max-width: 700px) { .hide-sm { display: none; } .panel-top .brand { font-size: 1.05rem; } .shop-toggle span#shopLabel { display: none; } }

@media print {
  .no-print, .panel-top, .sidebar, .bottom-nav { display: none !important; }
  .panel-main { margin: 0 !important; padding: 0 !important; }
  body { background: #fff; }
}

/* =====================================================================
   Responsive hardening (customer pages + admin console)
   ===================================================================== */
.grid > *, .flex > .grow, .card, .panel-main > * { min-width: 0; }
img, video, canvas, svg { max-width: 100%; }
.shop .container { padding-left: 16px; padding-right: 16px; }
@media (max-width: 380px) { .shop .container { padding-left: 14px; padding-right: 14px; } }

/* tablet */
@media (min-width: 700px) and (max-width: 999px) {
  .panel-main { padding: 18px 22px calc(var(--bottom-nav) + 28px); }
  .stat-grid.six { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1000px) and (max-width: 1279px) {
  .stat-grid.six { grid-template-columns: repeat(3, 1fr); }
  .panel-main { padding-left: 20px; padding-right: 20px; }
}
@media (min-width: 1700px) { .panel-main { max-width: 1560px; } }

/* phones */
@media (max-width: 700px) {
  .panel-main { padding: 12px 12px calc(var(--bottom-nav) + 28px); }
  .panel-head h1 { font-size: 1.2rem; }
  .card { padding: 14px; }
  .card.flush { padding: 0; }

  /* filter bars become tidy two-column forms */
  .toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: stretch; }
  .toolbar > input, .toolbar > select { width: 100%; max-width: none; flex: none; min-width: 0; }
  .toolbar > input[type=search], .toolbar > input[type=text] { grid-column: 1 / -1; }
  .toolbar > .btn, .toolbar > a.btn { width: 100%; }
  .toolbar > label, .toolbar > span { align-self: center; }

  .kv { grid-template-columns: 104px 1fr; gap: 6px 10px; }
  .row-actions .btn { flex: 1 1 auto; }
  .panel-top { padding: 0 8px; gap: 6px; }
  .panel-top .who { gap: 2px; }
  .stat .value { font-size: 1.3rem; }
  .perm-grid { grid-template-columns: 1fr; }
  .input-group { flex-wrap: wrap; }
  .input-group > input, .input-group > select { flex: 1 1 160px; min-width: 0; }
  .tabs { margin-left: -12px; margin-right: -12px; padding: 0 12px 4px; }
  .table-wrap { margin: 0; }
  table.table:not(.stack) th, table.table:not(.stack) td { padding: 9px 10px; }
}
@media (max-width: 420px) {
  .stat-grid { gap: 8px; }
  .stat { padding: 12px; }
  .grid-2.stack-xs { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dt { margin-top: 8px; font-size: .78rem; }
}
.grid.keep3 { grid-template-columns: repeat(3, 1fr) !important; }

/* =====================================================================
   Focus pages (login, location, cart, checkout): no bottom tab bar,
   so forms and the sticky pay bar are never covered.
   ===================================================================== */
body.shop.focus { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
body.shop.focus .bottom-nav { display: none; }
body.shop.focus.has-sticky { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
body.shop.focus .sticky-checkout {
  bottom: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}
body.shop.focus .toast-stack { bottom: calc(100px + env(safe-area-inset-bottom)); }
body.shop.focus .shop-header .container .loc-chip { pointer-events: auto; }
@media (min-width: 900px) {
  body.shop.focus.has-sticky { padding-bottom: 96px; }
  .sticky-checkout { justify-content: center; }
  .sticky-checkout > * { max-width: 560px; }
  .sticky-checkout .btn { flex: 1; }
}

/* ---------- PhonePe demo checkout (mobile-first) ---------- */
body.pp-page { padding: 0 0 calc(150px + env(safe-area-inset-bottom)); background: #f3eefb; min-height: 100vh; }
.pp-page .pp-top { position: sticky; top: 0; z-index: 20; padding: 12px 16px; gap: 12px; }
.pp-page .pp-back { color: #fff; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 50%; flex: none; margin-left: -6px; }
.pp-page .pp-back:hover { background: rgba(255, 255, 255, .15); }
.pp-page .pp-sub { opacity: .8; }
.pp-page .pp-lock { color: #fff; opacity: .85; }
.pp-wrap { max-width: 460px; margin: 0 auto; padding: 14px 16px 0; }
.pp-wrap .pp-amount { margin: 0 0 12px; padding: 22px 16px; }
.pp-timer { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 4px 12px; border-radius: 999px; background: #f3eefb; color: #5f259f; font-size: .78rem; }
.pp-box { background: #fff; border-radius: 16px; padding: 16px; box-shadow: var(--shadow-sm); margin-bottom: 12px; }
.pp-summary summary { list-style: none; display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-weight: 700; }
.pp-summary summary::-webkit-details-marker { display: none; }
.pp-summary[open] summary { margin-bottom: 10px; }
.pp-secure { margin: 6px 0 0; word-break: break-all; }
.pp-actions {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: #fff; border-top: 1px solid #e6dff3; box-shadow: 0 -6px 20px rgba(95, 37, 159, .12);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}
.pp-actions > * { max-width: 460px; margin-left: auto; margin-right: auto; }
.pp-secondary { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }
.pp-secondary .btn { flex: 1; }
