:root {
  --bg: #07111f;
  --card: #111827;
  --card2: #172033;
  --text: #f8fafc;
  --muted: #94a3b8;
  --line: rgba(255,255,255,.1);
  --blue: #0A84FF;
  --green: #16a34a;
  --red: #ef4444;
  --amber: #f59e0b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, Arial, sans-serif;
  background: radial-gradient(circle at top, #13203a 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(7,17,31,.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 42px; height: 42px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--blue), #70d4ff);
  font-weight: 950;
}
.brand strong { display: block; font-size: 18px; }
.brand small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.shell { width: min(1120px, calc(100% - 24px)); margin: 18px auto 80px; }
.card {
  background: rgba(17,24,39,.9);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 18px 50px rgba(0,0,0,.18);
}
.auth-card { max-width: 560px; margin: 70px auto 0; }
h1, h2 { margin: 0 0 8px; letter-spacing: -.5px; }
p { color: var(--muted); margin: 4px 0 12px; }
.grid { display: grid; gap: 14px; }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 12px; }
.form-grid.single { grid-template-columns: 1fr; }
.full { grid-column: 1 / -1; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); background: rgba(255,255,255,.06);
  color: var(--text); border-radius: 14px; padding: 13px; outline: 0; font-weight: 800;
}
select option { color: #111827; }
button, .link-btn {
  border: 0; border-radius: 14px; padding: 12px 14px;
  font-weight: 950; cursor: pointer; text-decoration: none; text-align: center;
  color: var(--text); display: inline-flex; justify-content: center; align-items: center;
}
.primary { background: var(--blue); color: white; }
.success { background: var(--green); color: white; }
.danger { background: rgba(239,68,68,.16); color: #fecaca; border: 1px solid rgba(239,68,68,.35); }
.ghost { background: rgba(255,255,255,.07); color: var(--text); border: 1px solid var(--line); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0 6px; }
.tab { background: rgba(255,255,255,.06); color: var(--muted); border: 1px solid var(--line); }
.tab.active { background: rgba(10,132,255,.18); color: white; border-color: rgba(10,132,255,.4); }
.hidden { display: none !important; }
.message { margin-top: 12px; padding: 12px; border-radius: 14px; background: rgba(239,68,68,.14); border: 1px solid rgba(239,68,68,.35); color: #fecaca; font-weight: 900; }
.message.ok { background: rgba(22,163,74,.14); border-color: rgba(22,163,74,.35); color: #bbf7d0; }
.pill { display: inline-flex; border-radius: 999px; padding: 8px 12px; font-weight: 950; font-size: 13px; }
.pill.off { background: rgba(239,68,68,.16); color: #fecaca; }
.pill.on { background: rgba(22,163,74,.16); color: #bbf7d0; }
.money { font-size: 34px; font-weight: 950; color: #86efac; margin: 10px 0; }
.order-card { margin-top: 14px; }
.order-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.countdown { width: 72px; height: 72px; border-radius: 24px; display: grid; place-items: center; font-size: 30px; font-weight: 950; background: rgba(245,158,11,.18); color: #fde68a; border: 1px solid rgba(245,158,11,.4); }
.details { display: grid; gap: 8px; margin: 12px 0; }
.row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.row strong { color: var(--text); text-align: right; }
.item { background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.actions { display: grid; gap: 10px; margin-top: 12px; }
.actions.two { grid-template-columns: 1fr 1fr; }
.grid-actions { grid-template-columns: repeat(3, minmax(0,1fr)); }
#map { height: 320px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); margin-top: 12px; background: #0f172a; }
.list { display: grid; gap: 8px; }
.muted { color: var(--muted); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 22px; z-index: 99; background: #0A84FF; color: white; font-weight: 950; padding: 12px 16px; border-radius: 999px; box-shadow: 0 16px 36px rgba(0,0,0,.28); }
@media (max-width: 860px) {
  .three, .form-grid, .grid-actions { grid-template-columns: 1fr; }
  .auth-card { margin-top: 22px; }
  .shell { width: min(100% - 16px, 1120px); }
  .topbar { padding: 12px; }
  #map { height: 260px; }
}


.admin-only-note {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(10,132,255,0.09);
  border: 1px solid rgba(10,132,255,0.18);
  color: #dbeafe;
  font-size: 13px;
  font-weight: 800;
}


.address-box {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255,255,255,.05);
}
.address-box.pickup { border-color: rgba(10,132,255,.35); background: rgba(10,132,255,.10); }
.address-box.delivery { border-color: rgba(22,163,74,.35); background: rgba(22,163,74,.10); }
.address-title { color: var(--muted); font-size: 12px; font-weight: 950; text-transform: uppercase; letter-spacing: .4px; }
.address-main { margin-top: 5px; font-size: 17px; font-weight: 950; color: var(--text); }
.address-text { margin-top: 5px; color: #dbeafe; font-weight: 850; line-height: 1.35; }
.address-phone { margin-top: 6px; color: #fde68a; font-weight: 900; }
.mini-map-link { display: inline-flex; margin-top: 9px; color: white; background: rgba(255,255,255,.10); border: 1px solid var(--line); border-radius: 999px; padding: 8px 11px; text-decoration: none; font-size: 13px; font-weight: 950; }


/* v8: Top priority order request alert - no scrolling needed */
#pendingCard {
  position: fixed;
  top: calc(76px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, calc(100vw - 20px));
  max-height: calc(100vh - 96px - env(safe-area-inset-bottom, 0px));
  overflow: hidden;
  z-index: 9999;
  border: 2px solid rgba(245,158,11,.85);
  background: linear-gradient(180deg, rgba(30,41,59,.98), rgba(15,23,42,.98));
  box-shadow: 0 24px 90px rgba(0,0,0,.72), 0 0 0 9999px rgba(0,0,0,.42);
  animation: hgOrderPulse 1.15s ease-in-out infinite;
}
#pendingCard.hidden { display: none !important; }
#pendingCard .order-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(30,41,59,1), rgba(15,23,42,.98));
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}
#pendingCard h2::before {
  content: "🔔 ";
}
#pendingDetails {
  max-height: calc(100vh - 300px);
  overflow-y: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
}
#pendingCard .actions.two {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin: 12px -16px -16px;
  padding: 12px 16px 16px;
  background: linear-gradient(0deg, rgba(15,23,42,1), rgba(15,23,42,.92));
  border-top: 1px solid rgba(255,255,255,.10);
}
#pendingCard #acceptBtn,
#pendingCard #rejectBtn {
  min-height: 56px;
  font-size: 17px;
  border-radius: 18px;
}
#pendingCard #acceptBtn {
  box-shadow: 0 10px 26px rgba(10,132,255,.32);
}
#pendingCard #rejectBtn {
  background: rgba(239,68,68,.24);
}
.toast {
  top: calc(14px + env(safe-area-inset-top, 0px));
  bottom: auto;
  z-index: 10050;
}
@keyframes hgOrderPulse {
  0%, 100% { border-color: rgba(245,158,11,.68); }
  50% { border-color: rgba(250,204,21,1); }
}
@media (max-width: 700px) {
  #pendingCard {
    top: calc(66px + env(safe-area-inset-top, 0px));
    width: calc(100vw - 12px);
    max-height: calc(100vh - 78px - env(safe-area-inset-bottom, 0px));
    border-radius: 20px;
    padding: 14px;
  }
  #pendingDetails {
    max-height: calc(100vh - 282px);
  }
  #pendingCard .actions.two {
    grid-template-columns: 1fr;
    margin-left: -14px;
    margin-right: -14px;
    margin-bottom: -14px;
    padding-left: 14px;
    padding-right: 14px;
  }
}
