/* La Tahati Design System – derived strictly from the Navy (#061322) + Electric Lime (#A3E635) identity */
:root {
  --navy: #061322;
  --navy-2: #0D2137;
  --lime: #A3E635;
  --lime-ink: #3F6212;
  --lime-soft: #ECFCCB;
  --bg: #F4F6F8;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --ink: #0B1522;
  --muted: #64748B;
  --line: #E2E8F0;
  --brand: #061322;
  --wa: #16A34A;
  --urgent: #E11D48;
  --urgent-soft: #FFF1F2;
  --amber: #D97706;
  --amber-soft: #FEF3C7;
  --radius: 14px;
}

:root[data-theme="dark"] {
  --bg: #07111D;
  --surface: #0D1B2A;
  --surface-2: #122336;
  --ink: #F1F5F9;
  --muted: #8FA3B8;
  --line: #1C3147;
  --brand: #A3E635;
  --lime-ink: #BEF264;
  --lime-soft: rgba(163, 230, 53, .13);
  --urgent: #FB7185;
  --urgent-soft: rgba(225, 29, 72, .16);
  --amber: #FBBF24;
  --amber-soft: rgba(217, 119, 6, .16);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overscroll-behavior-y: none; }
body {
  font-family: "Plus Jakarta Sans", "Cairo", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
html[dir="rtl"] body { font-family: "Cairo", "Plus Jakarta Sans", system-ui, sans-serif; }
a { color: var(--ink); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.lime { color: var(--lime); }

/* Crisp inline SVG icons */
.ic {
  width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; flex: none;
}
.ic.sm { width: 15px; height: 15px; }
.ic.lg { width: 26px; height: 26px; }

/* ---------- Buttons & Controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 15px; border-radius: 10px; border: 1px solid transparent;
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 700;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .14s, border-color .14s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn.lg { padding: 12px 18px; font-size: 15px; }
.btn.block { width: 100%; flex: 1; }
.btn.primary { background: var(--navy); color: #fff; }
:root[data-theme="dark"] .btn.primary { background: var(--lime); color: var(--navy); }
.btn.primary:hover { opacity: .92; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger-ghost { background: transparent; border-color: rgba(225, 29, 72, .35); color: var(--urgent); }
.btn.danger { background: var(--urgent); color: #fff; }
.btn.wa { background: var(--wa); color: #fff; font-size: 14.5px; padding: 10px 14px; }
.btn.wa:hover { filter: brightness(1.06); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 9px; border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .07);
  color: #fff; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.icon-btn:hover { background: rgba(255, 255, 255, .15); }
.icon-btn.dark { border-color: var(--line); background: var(--surface-2); color: var(--ink); }
.small-x { min-width: 26px; height: 26px; padding: 0; font-size: 12px; }

.pill-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 11px; border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .08);
  color: #fff; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; text-decoration: none;
}
.pill-btn:hover { background: rgba(255, 255, 255, .16); }
.pill-btn.on { background: var(--lime); color: var(--navy); border-color: var(--lime); }
.group-pill { border-color: rgba(163, 230, 53, .35); color: var(--lime); }
.mini-badge {
  background: var(--lime); color: var(--navy); border-radius: 999px;
  padding: 1px 6px; font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums;
}

input, textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; background: var(--surface); color: var(--ink); margin-top: 5px;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(163, 230, 53, .25);
}
:root[data-theme="dark"] input:focus, :root[data-theme="dark"] select:focus { border-color: var(--lime); }
input[type=checkbox] { width: 17px; height: 17px; margin: 0; accent-color: var(--navy); flex: none; }
:root[data-theme="dark"] input[type=checkbox] { accent-color: var(--lime); }
label { display: block; margin: 11px 0; font-weight: 600; font-size: 13.5px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 0; cursor: pointer; }
.input-wrap { display: flex; align-items: center; margin-top: 5px; }
.input-wrap .prefix {
  padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line);
  border-inline-end: 0; border-start-start-radius: 10px; border-end-start-radius: 10px;
  color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums;
}
.input-wrap input { margin-top: 0; border-start-start-radius: 0; border-end-start-radius: 0; }

.card { background: var(--surface); border-radius: var(--radius); padding: 18px; border: 1px solid var(--line); }
.row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.row.end { justify-content: flex-end; }
.center-row { justify-content: center; }
.renew-stack { display: grid; gap: 8px; margin: 14px 0 6px; }

/* ---------- Auth & Pending ---------- */
.auth-shell {
  min-height: 100vh; display: grid; place-items: center; padding: 18px;
  background: var(--navy);
}
.auth-card { width: 100%; max-width: 410px; padding: 22px; border-color: rgba(255, 255, 255, .1); }
.auth-banner-wrap {
  position: relative; margin: -22px -22px 16px; border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden; background: var(--navy);
}
.auth-logo-banner { display: block; width: 100%; height: auto; }
.auth-lang-float {
  position: absolute; top: 10px; inset-inline-end: 10px;
  background: rgba(6, 19, 34, .8) !important; color: #fff !important; border-color: rgba(255, 255, 255, .22) !important;
}
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 10px; margin: 12px 0; border: 1px solid var(--line); }
.tab { flex: 1; padding: 8px; border: 0; border-radius: 7px; background: transparent; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; }
.tab.active { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.error-box { margin: 12px 0 0; padding: 10px 12px; border-radius: 9px; background: var(--urgent-soft); color: var(--urgent); font-weight: 600; font-size: 13.5px; }
.center-stack { text-align: center; }
.pulse-ring {
  width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center;
  background: var(--lime-soft); color: var(--lime-ink);
}

/* Daily Registration Limit Orbital Ring Counter */
.quota-box {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: 12px; margin-bottom: 14px;
  background: var(--navy); color: #fff; border: 1px solid rgba(163, 230, 53, .28);
}
.quota-box.low { border-color: rgba(225, 29, 72, .55); }
.quota-box.full { border-color: rgba(225, 29, 72, .65); background: #1A0B14; }

.quota-ring-wrap { position: relative; width: 72px; height: 72px; flex: none; }
.quota-ring { width: 72px; height: 72px; display: block; overflow: visible; }
.quota-track { fill: none; stroke: rgba(163, 230, 53, .16); stroke-width: 4; }
.quota-arc {
  fill: none; stroke: var(--lime); stroke-width: 4; stroke-linecap: round;
  stroke-dasharray: 64 150;
  transform-origin: 40px 40px;
  animation: quotaOrbit 2.4s linear infinite;
  filter: drop-shadow(0 0 5px rgba(163, 230, 53, .55));
}
.quota-box.low .quota-track { stroke: rgba(225, 29, 72, .22); }
.quota-box.low .quota-arc {
  stroke: #FB7185;
  animation-duration: 1.3s;
  filter: drop-shadow(0 0 6px rgba(251, 113, 133, .65));
}
.quota-box.full .quota-track { stroke: rgba(225, 29, 72, .25); }
.quota-box.full .quota-arc { stroke: #FB7185; stroke-dasharray: 214 0; animation: none; filter: none; }
@keyframes quotaOrbit { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.quota-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; line-height: 1;
}
.quota-num {
  font-size: 27px; font-weight: 800; color: var(--lime);
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.quota-box.low .quota-num, .quota-box.full .quota-num { color: #FB7185; }
.quota-unit { font-size: 10.5px; font-weight: 700; color: rgba(255, 255, 255, .7); margin-top: 2px; }

.quota-info { flex: 1; min-width: 0; display: grid; gap: 5px; }
.quota-title { font-weight: 800; font-size: 14px; color: #fff; line-height: 1.3; }
.quota-box.full .quota-title { color: #FDA4AF; }
.quota-timer-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.quota-timer-row .muted { color: rgba(255, 255, 255, .65); font-size: 12px; }
.quota-clock { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 13px; color: var(--lime); direction: ltr; }
.quota-box.low .quota-clock, .quota-box.full .quota-clock { color: #FDA4AF; }
.quota-cap {
  padding-top: 5px; border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: 11.5px; font-weight: 600; color: rgba(255, 255, 255, .55);
}

.group-cta {
  margin-top: 12px; background: transparent; color: var(--wa);
  border: 1.5px solid rgba(22, 163, 74, .45); font-weight: 700;
}
.group-cta:hover { background: rgba(22, 163, 74, .08); }

/* ---------- Topbar & Compact Notice Strip ---------- */
.app-shell { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
.topbar {
  flex: none; z-index: 1000; display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top));
  background: var(--navy); color: #fff; border-bottom: 1px solid rgba(163, 230, 53, .16);
}
.brand { display: flex; align-items: center; gap: 7px; min-width: 0; }
.brand-name { font-weight: 800; font-size: 15.5px; letter-spacing: .01em; white-space: nowrap; }
.logo-img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; flex: none; border: 1px solid rgba(163, 230, 53, .3); }
.brand-text { display: flex; align-items: center; gap: 6px; min-width: 0; }
.top-actions { display: flex; align-items: center; gap: 5px; flex: none; }
.live-pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; background: rgba(255, 255, 255, .1); white-space: nowrap;
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #FB7185; }
.live-pill.on .live-dot { background: var(--lime); }

.notice-strip {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 14px; background: var(--surface); border-bottom: 1px solid var(--line);
  font-size: 12.5px; font-weight: 600;
}
.notice-strip.lime-strip { background: var(--lime-soft); color: var(--lime-ink); }
.notice-strip.danger { background: var(--urgent-soft); color: var(--urgent); }
.strip-actions { display: flex; align-items: center; gap: 6px; flex: none; }

.mobile-switch {
  flex: none; display: flex; gap: 4px; padding: 6px 12px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.ms-btn {
  flex: 1; padding: 6px; border-radius: 8px; border: 1px solid transparent; background: transparent;
  color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.ms-btn.active { background: var(--navy); color: #fff; }
:root[data-theme="dark"] .ms-btn.active { background: var(--lime); color: var(--navy); }

/* ---------- Workspace Layout ---------- */
.workspace { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.map-pane { position: relative; flex: 0 0 26%; min-height: 145px; }
#map { width: 100%; height: 100%; z-index: 1; }
.feed-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--bg); overflow: hidden; }

.workspace[data-mode="map"] .map-pane { flex: 1; }
.workspace[data-mode="map"] .feed-pane { display: none; }
.workspace[data-mode="list"] .map-pane { display: none; }
.workspace[data-mode="list"] .feed-pane { flex: 1; }

@media (min-width: 920px) {
  .mobile-switch { display: none; }
  .workspace, .workspace[data-mode] { flex-direction: row; }
  .workspace[data-mode] .map-pane { display: block; flex: 1.35; height: 100%; }
  .workspace[data-mode] .feed-pane { display: flex; flex: 0 0 460px; max-width: 480px; border-inline-start: 1px solid var(--line); }
}

/* Map floating controls */
.map-controls { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 500; display: flex; flex-direction: column; gap: 6px; }
.map-fab {
  width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); cursor: pointer;
  display: grid; place-items: center;
}
.map-legend {
  position: absolute; bottom: 12px; inset-inline-start: 12px; z-index: 500;
  display: flex; gap: 12px; padding: 5px 11px; border-radius: 999px;
  background: rgba(6, 19, 34, .85); color: #fff; font-size: 11.5px; font-weight: 600;
}
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.leg-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.leg-dot.p { background: #16A34A; } .leg-dot.d { background: #E11D48; } .leg-dot.m { background: var(--lime); }

.lt-pin {
  width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 11.5px;
  border: 2px solid #fff;
}
.lt-pin span { transform: rotate(45deg); }
.lt-pin.p { background: #16A34A; }
.lt-pin.d { background: #E11D48; }
.lt-pin.mine { box-shadow: 0 0 0 4px rgba(163, 230, 53, .55); }

/* ---------- Feed KPIs & Filters (compact on mobile so cards have breathing room) ---------- */
.kpi-bar {
  flex: none; display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.kpi {
  padding: 5px 6px; text-align: center; border-inline-end: 1px solid var(--line);
  display: flex; align-items: baseline; justify-content: center; gap: 5px; flex-wrap: wrap;
}
.kpi:last-child { border-inline-end: 0; }
.kpi b { font-size: 14.5px; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 11px; color: var(--muted); font-weight: 600; }
.kpi.accent b { color: var(--lime-ink); }

.feed-tools { flex: none; padding: 7px 10px; background: var(--surface); border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.search-row { display: flex; gap: 6px; align-items: center; }
.search-box { position: relative; flex: 1; }
.search-ico { position: absolute; inset-inline-start: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box input { margin: 0; padding-inline-start: 32px; padding-block: 6px; font-size: 13.5px; background: var(--surface-2); }
.sort-select { width: auto; margin: 0; padding: 6px 8px; font-size: 12px; font-weight: 700; background: var(--surface-2); }
.filter-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.fchip {
  flex: none; padding: 4px 9px; border-radius: 7px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); font: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer;
}
.fchip.active { background: var(--navy); color: #fff; border-color: var(--navy); }
:root[data-theme="dark"] .fchip.active { background: var(--lime); color: var(--navy); border-color: var(--lime); }

/* ---------- Order Cards (Disciplined Dispatch Hierarchy) ---------- */
.order-list {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain;
  padding: 10px 12px max(28px, calc(env(safe-area-inset-bottom) + 16px));
  display: flex; flex-direction: column; gap: 9px;
}
.order {
  flex: none;
  background: var(--surface); border-radius: var(--radius); padding: 12px 13px;
  border: 1px solid var(--line); cursor: pointer;
  transition: border-color .14s;
}
.order.selected { border-color: var(--navy); }
:root[data-theme="dark"] .order.selected { border-color: var(--lime); }
.order.mine { border-inline-start: 4px solid var(--lime); }
.order.contacted { opacity: .68; }
.order.flash { animation: cardReveal .9s ease-out; }
@keyframes cardReveal { 0% { border-color: var(--lime); background: var(--lime-soft); } 100% { border-color: var(--line); } }

/* Row 1: Hero Urgency Timer + Hero Price */
.order-top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line);
}
.urgency-timer {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px; border-radius: 8px; font-weight: 800;
}
.urgency-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.urgency-text { font-size: 12px; }
.urgency-clock { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; direction: ltr; }

.urgency-timer.hot {
  background: var(--urgent-soft); color: var(--urgent); border: 1px solid rgba(225, 29, 72, .35);
}
.urgency-timer.hot .urgency-dot { background: var(--urgent); animation: urgentBlink .8s step-start infinite; }
.urgency-timer.warm {
  background: var(--amber-soft); color: var(--amber); border: 1px solid rgba(217, 119, 6, .3);
}
.urgency-timer.warm .urgency-dot { background: var(--amber); }
.urgency-timer.cool { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.urgency-timer.cool .urgency-dot { background: var(--muted); }
.urgency-timer.cool .urgency-clock { font-size: 14.5px; }
@keyframes urgentBlink { 50% { opacity: .15; } }

.fare-wrap { text-align: end; }
.price-hero {
  font-size: 18px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1;
}
.price-hero.ask { font-size: 13px; color: var(--muted); font-weight: 700; }

/* Row 2: Clean Route Timeline */
.timeline { display: grid; gap: 7px; margin-bottom: 10px; position: relative; padding-inline-start: 18px; }
.timeline::before {
  content: ""; position: absolute; inset-inline-start: 5px; top: 9px; bottom: 9px;
  width: 2px; border-inline-start: 1.5px dashed var(--line);
}
.tl-row { position: relative; font-size: 15.5px; font-weight: 700; line-height: 1.3; }
.tl-dot {
  position: absolute; inset-inline-start: -17px; top: 5px; width: 10px; height: 10px;
  border-radius: 50%; border: 2px solid var(--surface);
}
.tl-dot.p { background: #16A34A; }
.tl-dot.d { background: #E11D48; }
.tl-sub { display: inline; font-size: 11.5px; font-weight: 600; color: var(--muted); margin-inline-end: 6px; }

/* Row 3: Quiet Single Info Line (road km + ETA + contact status + time/item) */
.info-line {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
}
.info-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink);
}
.info-tag.route-hit { background: var(--lime-soft); border-color: rgba(163, 230, 53, .45); color: var(--lime-ink); }
.info-tag.zero-clicks { color: #15803D; border-color: rgba(22, 163, 74, .3); background: rgba(22, 163, 74, .08); }
:root[data-theme="dark"] .info-tag.zero-clicks { color: #4ADE80; }

.orig-wrap { margin-bottom: 10px; }
.orig-wrap summary { font-size: 12px; color: var(--muted); cursor: pointer; font-weight: 600; }
.orig { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line); padding: 8px 10px; border-radius: 8px; margin: 6px 0 0; font-size: 13.5px; line-height: 1.5; }

/* Row 4: Actions – stacked cleanly so buttons NEVER overflow on any phone width */
.order-actions { display: grid; gap: 6px; width: 100%; }
.order-actions .btn.wa {
  width: 100%; height: 40px; padding: 0 12px; gap: 7px; font-size: 14.5px;
}
.order-sub-actions { display: flex; gap: 6px; width: 100%; }
.act-icon {
  height: 36px; flex: 1 1 0; min-width: 0; padding: 0; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
.act-icon:hover { background: var(--line); }
.act-icon.done { background: var(--lime-soft); border-color: var(--lime); color: var(--lime-ink); }

.empty-state {
  text-align: center; padding: 36px 18px; background: var(--surface); border-radius: var(--radius);
  border: 1px dashed var(--line); margin-top: 6px;
}

/* ---------- Modals ---------- */
.dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(640px, 94vw); max-height: 90vh; background: var(--surface); color: var(--ink); }
.dialog::backdrop { background: rgba(6, 19, 34, .65); }
.dialog-inner { display: flex; flex-direction: column; max-height: 90vh; padding: 18px; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.dialog h3 { margin: 0 0 3px; font-size: 17px; }
.dialog h4 { margin: 14px 0 6px; font-size: 13.5px; color: var(--ink); }
.route-quick { display: flex; gap: 8px; align-items: center; margin: 10px 0; }
.route-quick input { margin: 0; flex: 1; padding: 8px 11px; }
.routes-scroll { flex: 1; overflow-y: auto; padding-inline-end: 4px; }
.chips { border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: var(--surface-2); }
.chip-group { margin-bottom: 8px; }
.chip-group-title { font-size: 11.5px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.chip { display: inline-flex; margin: 3px; font-weight: 600; }
.chip input { display: none; }
.chip span {
  padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 12.5px; cursor: pointer;
}
.chip input:checked + span { background: var(--navy); color: #fff; border-color: var(--navy); }
:root[data-theme="dark"] .chip input:checked + span { background: var(--lime); color: var(--navy); border-color: var(--lime); }
.dialog-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }

.ios-steps { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 8px; }
.ios-steps li {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; font-size: 14px;
}
.ios-step-ico {
  width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: var(--lime);
  display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none;
}

/* ---------- Admin compatibility styles (used by /admin) ---------- */
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--navy); }
.admin { max-width: 780px; margin: 0 auto; padding: 14px 14px 40px; display: grid; gap: 14px; }
.admin h2 { margin: 0 0 12px; font-size: 17px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin h3 { margin: 14px 0 6px; font-size: 14.5px; color: var(--ink); }
.step { display: inline-grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: var(--navy); color: var(--lime); font-size: 13px; font-weight: 800; }
.badge { background: var(--lime-soft); color: var(--lime-ink); border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 700; }
.wa-status { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.dot { width: 11px; height: 11px; border-radius: 50%; background: #CBD5E1; }
.dot.on { background: #16A34A; } .dot.wait { background: var(--amber); } .dot.off { background: var(--urgent); }
.pair-code { font: 800 32px/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 4px; text-align: center; padding: 14px; background: var(--surface-2); border-radius: 10px; margin: 10px 0; }
.steps { padding-inline-start: 20px; line-height: 1.7; }
.qr { display: block; width: 100%; max-width: 280px; margin: 0 auto; image-rendering: pixelated; }
.group-list { list-style: none; padding: 0; margin: 10px 0 0; max-height: 400px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.group-list li { padding: 9px 12px; border-bottom: 1px solid var(--line); }
.group-list li:last-child { border-bottom: 0; }
.group-list .gname { flex: 1; font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); text-align: center; gap: 8px; }
.stats b { display: block; font-size: 22px; color: var(--ink); font-variant-numeric: tabular-nums; }
.stats span { font-size: 12px; color: var(--muted); }
.trow { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tcontrols { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.tcontrols label { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.log { max-height: 440px; overflow: auto; }
.logrow { padding: 8px 0; border-bottom: 1px solid var(--line); }
.logrow .tag { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; margin-inline-end: 6px; background: var(--surface-2); color: var(--ink); }
.logrow.order .tag { background: var(--lime-soft); color: var(--lime-ink); }
.logrow.error .tag { background: var(--urgent-soft); color: var(--urgent); }
.logrow.duplicate .tag, .logrow.pending-phone .tag { background: var(--amber-soft); color: var(--amber); }
.ltext { margin-top: 4px; white-space: pre-wrap; unicode-bidi: plaintext; }
.pre { background: var(--navy); color: #E2E8F0; padding: 12px; border-radius: 10px; overflow: auto; font-size: 12px; }
.ok-text { color: #15803D; font-weight: 600; }
.error { color: var(--urgent); font-weight: 600; }
.center { text-align: center; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; inset-inline-start: 50%; bottom: max(18px, calc(env(safe-area-inset-bottom) + 12px));
  transform: translateX(-50%); z-index: 3000; background: var(--navy); color: #fff;
  padding: 10px 16px; border-radius: 10px; font-weight: 600; max-width: 92vw;
  border: 1px solid rgba(163, 230, 53, .3);
}
html[dir="rtl"] .toast { transform: translateX(50%); }
.toast.bad { background: var(--urgent); border-color: transparent; }

@media (max-width: 768px) {
  input, textarea, select, .search-box input { font-size: 16px; }
}
@media (max-width: 600px) {
  .topbar .brand-name { display: none; }
  .pill-btn span:not(.mini-badge) { display: none; }
  .pill-btn { padding: 0 8px; height: 32px; gap: 4px; }
  .icon-btn { min-width: 32px; height: 32px; padding: 0 7px; font-size: 12px; }
  .top-actions { gap: 4px; }
  .map-legend { font-size: 10.5px; padding: 4px 9px; gap: 8px; bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
