/* ==========================================================================
   Store Pro — App UI (dashboards for all roles)
   Visual language: BOLD RETAIL / NEO-BRUTALIST
     white + cream surfaces · 2px ink borders · hard offset shadows · chunky Rubik type
     block palette: orange #ff5a1f · lemon #ffd23f · mint #3ddc97 · sky #4cc9f0 · pink #ff7ab6 · ink #111
   Builds on ../../../shared/css/base.css (tokens are overridden here)
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;700;800;900&display=swap");

:root {
  /* ---- block palette ---- */
  --ink: #111111;
  --ink-2: #2a2a2a;
  --orange: #ff5a1f;
  --lemon: #ffd23f;
  --mint: #3ddc97;
  --sky-b: #4cc9f0;
  --pink: #ff7ab6;
  --coral: #ff6b6b;
  --cream: #fff8ee;
  --cream-2: #fff1dc;
  --cream-3: #f6e8d2;
  --line: #efe2cc;           /* soft divider inside blocks */
  --hard: 4px 4px 0 var(--ink);
  --hard-sm: 2px 2px 0 var(--ink);
  --hard-md: 3px 3px 0 var(--ink);
  --hard-lg: 6px 6px 0 var(--ink);

  /* ---- semantic tokens (names kept for pages & shared components) ---- */
  --brand: #ff5a1f;
  --brand-600: #e14a12;
  --brand-700: #a8360a;
  --brand-soft: #ffe6d9;
  --gold: #ff5a1f;
  --gold-light: #ffd23f;
  --navy: #111111;
  --navy-2: #2a2a2a;
  --navy-3: #3d3a35;
  --teal: #0b8a5c;
  --teal-soft: #d2f7e6;
  --sky: #0b7fa8;
  --sky-soft: #d6f3fc;
  --accent: #ffd23f;
  --accent-soft: #fff3c4;
  --sidebar: #fff8ee;
  --sidebar-2: #fff1dc;
  --sidebar-text: #111111;
  --bg: #fff8ee;
  --surface: #ffffff;
  --surface-2: #fff8ee;
  --border: #111111;
  --text: #111111;
  --text-2: #3d3a35;
  --muted: #7a7368;
  --success: #0b8a5c; --success-soft: #d2f7e6;
  --warning: #a15c00; --warning-soft: #fff3c4;
  --danger: #d62828;  --danger-soft: #ffdcdc;
  --info: #0b7fa8;    --info-soft: #d6f3fc;
  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 3px 3px 0 #111111;
  --shadow: 4px 4px 0 #111111;
  --shadow-lg: 6px 6px 0 #111111;
  --sidebar-w: 276px;
  --header-h: 74px;
  --gradient-brand: linear-gradient(135deg, #ff5a1f 0%, #ff5a1f 100%);
  --gradient-navy: linear-gradient(135deg, #111111 0%, #111111 100%);
  --gradient: linear-gradient(135deg, #ff5a1f 0%, #ffd23f 100%);
  --font: "Rubik", "Cairo", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
}

body { font-family: var(--font); }
body.app { background: var(--bg); overflow-x: hidden; color: var(--ink); }
body.app h1, body.app h2, body.app h3, body.app h4 { font-weight: 800; letter-spacing: -.2px; }
a { color: var(--ink); }
.content p a:not([class]), .content td a:not([class]), .content small a:not([class]), .card-head a:not([class]), .card-foot a:not([class]) { color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.content p a:not([class]):hover, .content td a:not([class]):hover, .card-head a:not([class]):hover, .card-foot a:not([class]):hover { background: var(--lemon); }
.hidden { display: none !important; }
svg.lucide { width: 18px; height: 18px; stroke-width: 2.2; flex-shrink: 0; }
::selection { background: var(--lemon); color: var(--ink); }

/* ---------- Layout ---------- */
.sidebar {
  position: fixed; inset-block: 0; right: 0; width: var(--sidebar-w); z-index: 40;
  background: var(--cream); color: var(--ink); border-left: 2px solid var(--ink);
  display: flex; flex-direction: column;
  background-image: radial-gradient(rgba(17,17,17,.07) 1px, transparent 1.2px); background-size: 14px 14px;
}
.main { margin-right: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.content { padding: 28px 32px 44px; flex: 1; width: 100%; max-width: 1600px; margin-inline: auto; }

/* ---------- Sidebar: chunky block nav ---------- */
.brand { display: flex; align-items: center; gap: 12px; padding: 18px 18px 14px; color: var(--ink); }
.brand-mark { width: 44px; height: 44px; border-radius: 10px; background: var(--orange); border: 2px solid var(--ink); box-shadow: var(--hard-md); display: grid; place-items: center; flex-shrink: 0; transform: rotate(-4deg); }
.brand-mark svg { width: 22px; height: 22px; color: var(--ink); stroke-width: 2.6; }
.brand-name { font-weight: 900; font-size: 22px; letter-spacing: -.3px; line-height: 1.05; color: var(--ink); }
.brand-name small { display: block; font-size: 11px; font-weight: 500; color: var(--text-2); letter-spacing: 0; margin-top: 4px; }
.role-chip { margin: 0 16px 10px; padding: 9px 12px; border-radius: 10px; background: var(--lemon); border: 2px solid var(--ink); box-shadow: var(--hard-md); display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink); flex-wrap: wrap; row-gap: 4px; }
.role-chip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--orange); border: 2px solid var(--ink); animation: blink 1.6s ease-in-out infinite; }
.role-chip b { color: var(--ink); font-weight: 800; }
.role-chip .rc-branch { margin-right: auto; font-size: 11px; font-weight: 700; color: #fff; background: var(--ink); padding: 1px 9px; border-radius: 999px; }
.nav-scroll { flex: 1; overflow-y: auto; padding: 4px 16px 18px 18px; scrollbar-width: thin; scrollbar-color: var(--ink) transparent; }
.nav-section { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; color: var(--ink); padding: 14px 2px 8px; letter-spacing: .4px; }
.nav-section::after { content: ""; flex: 1; height: 0; border-top: 2px dashed rgba(17,17,17,.35); }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 8px; border-radius: 10px;
  background: #fff; border: 2px solid var(--ink); color: var(--ink); font-weight: 600; font-size: 14px; position: relative;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.nav-link > svg:first-child { width: 28px; height: 28px; padding: 5px; border-radius: 7px; background: var(--cream-2); border: 1.5px solid var(--ink); stroke-width: 2.3; }
.nav-link:hover { background: #fff3c4; transform: translate(-2px, -2px); box-shadow: var(--hard-md); color: var(--ink); }
.nav-link.active { background: var(--orange); font-weight: 800; transform: translate(-2px, -2px); box-shadow: var(--hard); color: var(--ink); }
.nav-link.active > svg:first-child { background: #fff; }
.nav-link .count { margin-right: auto; background: var(--ink); color: #fff; font-size: 11px; font-weight: 800; padding: 0 8px; border-radius: 999px; line-height: 20px; min-width: 22px; text-align: center; }
.nav-link .count.soft { background: var(--lemon); color: var(--ink); border: 1.5px solid var(--ink); line-height: 17px; }
.nav-link.active .count.soft { background: #fff; }
.sidebar-foot { padding: 12px 16px 16px; border-top: 2px solid var(--ink); background: var(--cream-2); font-size: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-foot a { color: var(--ink); font-weight: 800; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 2px solid var(--ink); border-radius: 8px; background: #fff; box-shadow: var(--hard-sm); }
.sidebar-foot a:hover { background: var(--lemon); color: var(--ink); }
.sidebar-foot a svg { width: 15px; height: 15px; }
.by-almgrat { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 600; }
.by-almgrat img { width: 18px; height: 18px; }

/* ---------- Top bar ---------- */
.topbar-app {
  position: sticky; top: 0; z-index: 30; height: var(--header-h);
  background: #fff; border-bottom: 2px solid var(--ink);
  display: flex; align-items: center; gap: 14px; padding: 0 28px;
}
.menu-toggle { display: none; }
.tb-brand { display: none; align-items: center; gap: 8px; color: var(--ink); font-weight: 900; font-size: 18px; flex-shrink: 0; }
.tb-brand .brand-mark { width: 38px; height: 38px; box-shadow: var(--hard-sm); }
.tb-brand .brand-mark svg { width: 19px; height: 19px; }
.icon-btn { width: 42px; height: 42px; border-radius: 10px; border: 2px solid var(--ink); background: #fff; display: grid; place-items: center; color: var(--ink); cursor: pointer; position: relative; box-shadow: var(--hard-sm); transition: transform .12s, box-shadow .12s, background .12s; flex-shrink: 0; }
.icon-btn:hover { background: var(--lemon); color: var(--ink); transform: translate(-1px, -1px); box-shadow: var(--hard-md); }
.icon-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.icon-btn .dot-count { position: absolute; top: -9px; left: -9px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 999px; background: var(--orange); color: var(--ink); font-size: 11px; font-weight: 900; display: grid; place-items: center; border: 2px solid var(--ink); }

/* Branch switcher block */
.branch-switch { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 10px 0 12px; border: 2px solid var(--ink); border-radius: 10px; background: var(--lemon); box-shadow: var(--hard); cursor: pointer; font: inherit; color: var(--ink); text-align: right; transition: transform .12s, box-shadow .12s; max-width: 260px; }
.branch-switch:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.branch-drop.open .branch-switch { transform: translate(2px, 2px); box-shadow: var(--hard-sm); }
.branch-switch .bs-ic { width: 32px; height: 32px; border-radius: 8px; background: #fff; border: 2px solid var(--ink); display: grid; place-items: center; flex-shrink: 0; }
.branch-switch .bs-ic svg { width: 17px; height: 17px; }
.branch-switch .bs-meta { min-width: 0; line-height: 1.15; }
.branch-switch .bs-meta small { display: block; font-size: 10.5px; font-weight: 700; color: rgba(17,17,17,.7); }
.branch-switch .bs-meta b { display: block; font-size: 15px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.branch-switch .bs-chev { width: 16px; height: 16px; }
.branch-menu { right: 0; left: auto; width: 320px; padding: 0; }
.bs-list { padding: 6px; max-height: 340px; overflow-y: auto; }
.branch-menu > .bs-item { margin: 6px 6px 0; width: calc(100% - 12px); }
.dropdown-menu a.bs-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; border: 2px solid transparent; }
.dropdown-menu a.bs-item:hover { background: var(--cream); border-color: var(--ink); }
.bs-sw { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--c); border: 2px solid var(--ink); color: #fff; flex-shrink: 0; }
.dropdown-menu .bs-sw svg { color: #fff; width: 16px; height: 16px; }
.bs-txt { min-width: 0; flex: 1; }
.bs-txt b { display: block; font-size: 14px; font-weight: 800; }
.bs-txt small { display: block; font-size: 11.5px; color: var(--text-2); font-weight: 500; }
.dropdown-menu .bs-check { color: var(--ink); width: 18px; height: 18px; }
.bs-item.is-locked { opacity: .55; }
.bs-note { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-top: 2px solid var(--ink); font-size: 12px; font-weight: 700; background: var(--cream); }
.bs-note svg { width: 14px; height: 14px; }

/* Global search */
.global-search { position: relative; flex: 1; max-width: 520px; min-width: 0; }
.global-search input { width: 100%; height: 46px; border: 2px solid var(--ink); background: var(--cream); border-radius: 10px; padding: 0 44px 0 70px; font: inherit; font-size: 14px; font-weight: 500; color: var(--ink); transition: .12s; }
.global-search input::placeholder { color: #8a8274; }
.global-search input:focus { outline: none; background: #fff; box-shadow: var(--hard); transform: translate(-1px, -1px); }
.global-search > svg { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ink); z-index: 1; }
.global-search kbd { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font: 800 11px var(--font); color: var(--ink); border: 2px solid var(--ink); border-radius: 6px; padding: 0 7px; background: var(--lemon); box-shadow: 1px 1px 0 var(--ink); }
.search-results { position: absolute; top: calc(100% + 10px); inset-inline: 0; z-index: 60; }

.header-actions { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.user-btn { display: flex; align-items: center; gap: 10px; padding: 3px 6px 3px 10px; height: 48px; border-radius: 10px; border: 2px solid var(--ink); background: #fff; cursor: pointer; font: inherit; text-align: right; box-shadow: var(--hard-sm); transition: .12s; color: var(--ink); }
.user-btn:hover { background: var(--cream); transform: translate(-1px, -1px); box-shadow: var(--hard-md); }
.user-btn .avatar { width: 36px; height: 36px; }
.user-btn .meta b { display: block; font-size: 14px; font-weight: 800; color: var(--ink); line-height: 1.2; }
.user-btn .meta small { font-size: 11.5px; color: var(--text-2); }
.user-btn > svg { color: var(--ink); width: 16px; }

/* ---------- Dropdowns ---------- */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 12px); left: 0; min-width: 240px; z-index: 50;
  background: #fff; border: 2px solid var(--ink); border-radius: 10px; box-shadow: var(--hard-lg);
  padding: 6px; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .14s ease;
}
.dropdown.open > .dropdown-menu, .dropdown-menu.show { opacity: 1; visibility: visible; transform: none; }
.dropdown-menu a, .dropdown-menu button.item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 8px; color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; background: none; border: 0; cursor: pointer; text-align: right; }
.dropdown-menu a:hover, .dropdown-menu button.item:hover { background: var(--lemon); }
.dropdown-menu a svg, .dropdown-menu button.item svg { color: var(--ink); }
.dropdown-menu .danger, .dropdown-menu .danger svg { color: var(--danger); }
.dropdown-menu .danger:hover { background: var(--danger-soft); }
.dropdown-menu hr { border: 0; border-top: 2px dashed rgba(17,17,17,.25); margin: 6px 0; }
.dropdown-head { padding: 12px 14px 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dropdown-head b { font-size: 15px; font-weight: 800; }
.notif-menu { width: 380px; padding: 0; overflow: hidden; }
.notif-menu .dropdown-head { background: var(--lemon); border-bottom: 2px solid var(--ink); }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { display: flex; gap: 12px; padding: 12px 14px; border-top: 2px solid var(--line); position: relative; }
.notif-list .notif-item:first-child { border-top: 0; }
.notif-item .f-icon { border: 2px solid var(--ink); }
.notif-item.unread { background: var(--cream); }
.notif-item.unread::after { content: ""; position: absolute; left: 14px; top: 18px; width: 10px; height: 10px; border-radius: 50%; background: var(--orange); border: 2px solid var(--ink); }
.notif-item p { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.notif-item b { font-size: 14px; display: block; font-weight: 800; }
.notif-item small { font-size: 12px; color: var(--muted); }
.dropdown-menu a.notif-foot, .notif-foot { display: block; text-align: center; padding: 12px; border-top: 2px solid var(--ink); font-weight: 800; font-size: 14px; color: var(--ink); background: #fff; border-radius: 0; }
.dropdown-menu a.notif-foot:hover { background: var(--orange); }

.search-panel { background: #fff; border: 2px solid var(--ink); border-radius: 10px; box-shadow: var(--hard-lg); padding: 8px; max-height: 420px; overflow-y: auto; }
.search-group { font-size: 11px; font-weight: 900; color: var(--ink); padding: 8px 10px 4px; letter-spacing: .4px; }
.search-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; color: var(--ink); border: 2px solid transparent; }
.search-item:hover, .search-item.focus { background: var(--cream); border-color: var(--ink); }
.search-item .sub { font-size: 12px; color: var(--text-2); }
.search-item .tail { margin-right: auto; }
.search-empty { padding: 24px; text-align: center; color: var(--text-2); font-size: 14px; font-weight: 600; }

/* ---------- Page header ---------- */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); margin-bottom: 8px; flex-wrap: wrap; font-weight: 600; }
.breadcrumb a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--orange); }
.breadcrumb a:hover { background: var(--lemon); }
.breadcrumb svg { width: 14px; height: 14px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; font-weight: 900; margin: 0; letter-spacing: -.5px; line-height: 1.15; }
.page-head p { margin: 6px 0 0; color: var(--text-2); font-size: 14px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; max-width: 100%; }

/* ---------- Buttons ---------- */
.btn { border-radius: 10px; padding: 9px 16px; font-size: 14px; font-weight: 700; border: 2px solid var(--ink); box-shadow: var(--hard-md); color: var(--ink); background: #fff; transition: transform .12s ease, box-shadow .12s ease, background .12s ease; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: var(--hard); }
.btn:active { transform: translate(3px, 3px); box-shadow: none; }
.btn-sm { padding: 5px 11px; font-size: 13px; border-radius: 8px; box-shadow: var(--hard-sm); }
.btn-sm:hover { box-shadow: var(--hard-md); }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { padding: 13px 22px; font-size: 16px; border-radius: 12px; }
.btn-primary { background: var(--orange); color: var(--ink); }
.btn-primary:hover { background: #ff6d38; color: var(--ink); }
.btn-soft { background: var(--brand-soft); color: var(--ink); }
.btn-soft:hover { background: #ffd4bd; color: var(--ink); }
.btn-dark { background: var(--ink); color: #fff; box-shadow: 3px 3px 0 var(--orange); }
.btn-dark:hover { background: var(--ink); color: #fff; box-shadow: 4px 4px 0 var(--orange); }
.btn-danger { background: var(--coral); color: var(--ink); }
.btn-danger:hover { background: #ff5252; color: var(--ink); }
.btn-accent { background: var(--lemon); color: var(--ink); font-weight: 800; }
.btn-accent:hover { background: #ffdb5c; color: var(--ink); }
.btn-teal { background: var(--mint); color: var(--ink); }
.btn-teal:hover { background: #55e3a5; color: var(--ink); }
.btn-sky { background: var(--sky-b); color: var(--ink); }
.btn-sky:hover { background: #63d1f3; color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); border: 2px solid transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--cream-2); border-color: var(--ink); color: var(--ink); box-shadow: none; transform: none; }
.btn-outline { background: #fff; color: var(--ink); border: 2px solid var(--ink); }
.btn-outline:hover { background: var(--lemon); border-color: var(--ink); color: var(--ink); }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: 8px; border: 2px solid var(--ink); background: #fff; color: var(--ink); display: inline-grid; place-items: center; cursor: pointer; box-shadow: var(--hard-sm); transition: .12s; }
.btn-icon:hover { background: var(--lemon); color: var(--ink); transform: translate(-1px, -1px); box-shadow: var(--hard-md); }
.btn-icon svg { width: 16px; height: 16px; }
.btn-block { width: 100%; }
button:disabled, .btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ---------- Grid ---------- */
.grid { display: grid; gap: 22px; }
.grid > *, .stack > *, .row-between > *, .card { min-width: 0; } /* let wide tables scroll inside .table-wrap instead of stretching the page */
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 22px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 26px; }
.text-muted { color: var(--muted); } .text-2 { color: var(--text-2); }
.text-success { color: var(--teal); } .text-gold { color: var(--brand-600); } .text-navy { color: var(--ink); } .text-danger { color: var(--danger); } .text-warning { color: var(--warning); } .text-brand { color: var(--brand-600); }
.fw-7 { font-weight: 700; } .fw-8 { font-weight: 800; }
.fs-12 { font-size: 12px; } .fs-13 { font-size: 13px; } .fs-14 { font-size: 14px; }
.nowrap { white-space: nowrap; }
.ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }

/* ---------- Cards ---------- */
.card { background: #fff; border: 2px solid var(--ink); border-radius: 10px; box-shadow: var(--hard); }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 2px solid var(--ink); flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 17px; font-weight: 800; }
.card-head p { margin: 2px 0 0; font-size: 13px; color: var(--text-2); }
.card-body { padding: 20px 22px; }
.card-foot { padding: 13px 22px; border-top: 2px solid var(--ink); background: var(--cream); border-radius: 0 0 8px 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }

/* KPI — solid colour blocks with big black numbers */
.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; }
.card.kpi { background: var(--blk, #fff); }
a.card.kpi { transition: transform .12s, box-shadow .12s; }
a.card.kpi:hover { transform: translate(-2px, -2px); box-shadow: var(--hard-lg); }
.kpi::after { content: ""; position: absolute; left: -26px; bottom: -26px; width: 86px; height: 86px; border-radius: 50%; border: 2px solid rgba(17,17,17,.14); pointer-events: none; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-icon { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: #fff; color: var(--ink); border: 2px solid var(--ink); box-shadow: var(--hard-sm); flex-shrink: 0; }
.kpi-icon[class*="c-"] { background: var(--blk); }
.kpi-icon.c-navy { color: #fff; }
.kpi-icon svg { width: 22px; height: 22px; stroke-width: 2.4; }
.kpi-label { font-size: 13px; color: var(--ink); font-weight: 700; }
.kpi-value { font-size: 32px; font-weight: 900; line-height: 1; letter-spacing: -.8px; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 14px; font-weight: 700; color: rgba(17,17,17,.7); margin-right: 4px; letter-spacing: 0; }
.kpi-foot { font-size: 12px; color: rgba(17,17,17,.78); font-weight: 500; }
.trend { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 800; padding: 1px 8px; border-radius: 999px; border: 2px solid var(--ink); background: #fff; color: var(--ink); white-space: nowrap; }
.trend svg { width: 13px; height: 13px; }
.trend.up { background: #fff; color: var(--ink); }
.trend.up svg { color: var(--teal); }
.trend.down { background: var(--ink); color: #fff; }
.trend.flat { background: rgba(255,255,255,.75); color: var(--ink); }
.kpi.c-navy .kpi-label, .kpi.c-navy .kpi-value, .kpi.c-navy .kpi-foot, .kpi.c-navy .kpi-value small { color: #fff; }
.kpi.c-navy::after { border-color: rgba(255,255,255,.18); }
.kpi.c-navy .trend.down { background: var(--coral); color: var(--ink); }
/* colour keys: --c = readable accent, --c-soft = tint, --blk = solid block fill */
.c-gold   { --c: #c2410c; --c-soft: #ffe3d3; --blk: #ff5a1f; }
.c-orange { --c: #c2410c; --c-soft: #ffe3d3; --blk: #ff5a1f; }
.c-brand  { --c: #c2410c; --c-soft: #ffe3d3; --blk: #ff5a1f; }
.c-navy   { --c: #111111; --c-soft: #ece4d6; --blk: #111111; }
.c-green  { --c: #0b8a5c; --c-soft: #d2f7e6; --blk: #3ddc97; }
.c-teal   { --c: #0b8a5c; --c-soft: #d2f7e6; --blk: #3ddc97; }
.c-blue   { --c: #0b7fa8; --c-soft: #d6f3fc; --blk: #4cc9f0; }
.c-sky    { --c: #0b7fa8; --c-soft: #d6f3fc; --blk: #4cc9f0; }
.c-amber  { --c: #9a5b00; --c-soft: #fff3c4; --blk: #ffd23f; }
.c-red    { --c: #c62828; --c-soft: #ffdcdc; --blk: #ff6b6b; }
.c-violet { --c: #b0246d; --c-soft: #ffe0ef; --blk: #ff7ab6; }
.c-pink   { --c: #b0246d; --c-soft: #ffe0ef; --blk: #ff7ab6; }
.c-purple { --c: #b0246d; --c-soft: #ffe0ef; --blk: #ff7ab6; }
.c-slate  { --c: #3d3a35; --c-soft: #efe8dc; --blk: #efe6d6; }

/* Hero / welcome banner — ink block, hard orange shadow, cream dots */
.welcome {
  border-radius: 12px; padding: 26px 30px; color: #fff; position: relative; overflow: hidden;
  background: var(--ink); border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--orange);
}
.welcome::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,248,238,.16) 1.3px, transparent 1.5px); background-size: 16px 16px; mask-image: linear-gradient(90deg, transparent 10%, #000 75%); pointer-events: none; }
.welcome::after { content: ""; position: absolute; left: -34px; top: -34px; width: 88px; height: 88px; border-radius: 18px; background: var(--lemon); border: 2px solid #fff; transform: rotate(18deg); pointer-events: none; }
.welcome > * { position: relative; z-index: 1; }
.welcome h2 { font-size: 28px; font-weight: 900; margin-bottom: 6px; color: #fff; letter-spacing: -.4px; }
.welcome p { margin: 0; color: rgba(255,255,255,.88); }
.welcome .gold { color: var(--ink); background: var(--lemon); padding: 0 6px; border-radius: 4px; font-weight: 800; }
.welcome .btn { box-shadow: 3px 3px 0 var(--lemon); }
.welcome .btn:hover { box-shadow: 4px 4px 0 var(--lemon); }
.welcome .btn-outline { background: #fff; border-color: #fff; color: var(--ink); }
.welcome .btn-outline:hover { background: var(--lemon); color: var(--ink); }
.welcome .btn-accent { background: var(--orange); border-color: #fff; color: var(--ink); }
.welcome .live-dot { color: var(--mint); }

/* ---------- Badges (bordered stickers) ---------- */
.badge { font-size: 12px; padding: 2px 9px; gap: 6px; white-space: nowrap; border-radius: 6px; border: 1.5px solid var(--ink); font-weight: 700; color: var(--ink); background: #fff; line-height: 1.5; }
.badge-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dotc, currentColor); border: 1.5px solid var(--ink); }
.badge-slate { background: #efe8dc; color: var(--ink); --dotc: #b3a996; }
.badge-violet { background: #ffe0ef; color: var(--ink); --dotc: var(--pink); }
.badge-accent { background: var(--accent-soft); color: var(--ink); --dotc: var(--lemon); }
.badge-gold { background: #ffe3d3; color: var(--ink); --dotc: var(--orange); }
.badge-navy { background: #ece4d6; color: var(--ink); --dotc: var(--ink); }
.badge-success { background: #d2f7e6; color: var(--ink); --dotc: var(--mint); }
.badge-lg { font-size: 13px; padding: 4px 12px; }
.badge-brand { background: #ffe3d3; color: var(--ink); --dotc: var(--orange); }
.badge-sky { background: var(--sky-soft); color: var(--ink); --dotc: var(--sky-b); }
.badge-danger { background: var(--danger-soft); color: #9b1c1c; --dotc: var(--coral); }
.badge-warning { background: var(--warning-soft); color: var(--ink); --dotc: var(--lemon); }
.badge-info { background: var(--info-soft); color: var(--ink); --dotc: var(--sky-b); }
.badge-ink { background: var(--ink); color: #fff; --dotc: #fff; }
.badge-teal { background: var(--teal-soft); color: var(--ink); --dotc: var(--mint); }

/* ---------- Avatars ---------- */
.avatar { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; flex-shrink: 0; background: var(--av, var(--brand)); border: 2px solid var(--ink); }
.avatar-sm { width: 30px; height: 30px; font-size: 12px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.avatar-xl { width: 96px; height: 96px; font-size: 34px; border: 3px solid var(--ink); box-shadow: var(--hard); }
.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person b { display: block; font-size: 14px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person small { display: block; font-size: 12px; color: var(--text-2); }
a.person:hover b { background: var(--lemon); }

/* ---------- Tables (black header, zebra cream) ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-bottom: 2px solid var(--ink); flex-wrap: wrap; background: #fff; }
.toolbar .search-input { position: relative; flex: 1; min-width: 220px; max-width: 340px; }
.toolbar .search-input input { padding-right: 40px; }
.toolbar .search-input svg { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--ink); width: 17px; }
.toolbar .spacer { flex: 1; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-color: var(--ink) var(--cream); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: right; font-weight: 800; font-size: 12px; color: #fff; background: var(--ink); padding: 12px 16px; border-bottom: 2px solid var(--ink); white-space: nowrap; letter-spacing: .2px; }
.table td { padding: 12px 16px; border-bottom: 1.5px solid var(--line); vertical-align: middle; white-space: nowrap; }
.table tbody tr { transition: background .1s; }
.table tbody tr:nth-child(even) { background: var(--cream); }
.table tbody tr:hover { background: #fff3c4; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.table .num { font-weight: 800; font-variant-numeric: tabular-nums; }
.table .code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-weight: 600; color: var(--ink); direction: ltr; display: inline-block; }
.card > .table-wrap:first-child .table thead th:first-child, .card > .table-wrap:first-child .table thead th:last-child { border-radius: 0; }
.pagination { display: flex; align-items: center; gap: 6px; }
.pagination button { min-width: 34px; height: 34px; border-radius: 8px; border: 2px solid var(--ink); background: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--ink); box-shadow: var(--hard-sm); }
.pagination button:hover { background: var(--lemon); }
.pagination button.active { background: var(--orange); border-color: var(--ink); color: var(--ink); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 13px; font-weight: 700; color: var(--ink); }
.input, .select, .textarea {
  width: 100%; height: 44px; border: 2px solid var(--ink); border-radius: 8px; padding: 0 12px;
  font: inherit; font-size: 14px; background: #fff; color: var(--ink); transition: .12s;
}
.input::placeholder, .textarea::placeholder { color: #8a8274; }
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23111111' stroke-width='2.6' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 12px center; padding-left: 34px; font-weight: 600; cursor: pointer; }
.toolbar .select { width: auto; min-width: 140px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink); box-shadow: var(--hard-md); background: #fffdf8; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: 12px; color: var(--text-2); }
.switch { position: relative; width: 48px; height: 26px; flex-shrink: 0; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #e8dfd0; border: 2px solid var(--ink); border-radius: 999px; cursor: pointer; transition: .18s; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; right: 3px; top: 3px; background: #fff; border: 2px solid var(--ink); border-radius: 50%; transition: .18s; box-sizing: border-box; }
.switch input:checked + span { background: var(--mint); }
.switch input:checked + span::before { transform: translateX(-22px); }
.check { width: 18px; height: 18px; accent-color: var(--ink); cursor: pointer; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.choice { border: 2px solid var(--ink); border-radius: 10px; padding: 16px; cursor: pointer; transition: .12s; background: #fff; position: relative; text-align: center; box-shadow: var(--hard-sm); }
.choice:hover { background: var(--cream); transform: translate(-1px, -1px); box-shadow: var(--hard-md); }
.choice.selected { background: var(--lemon); box-shadow: var(--hard); }
.choice.selected::after { content: "✓"; position: absolute; top: 8px; left: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; font-weight: 900; display: grid; place-items: center; }
.choice .emoji { font-size: 30px; line-height: 1; margin-bottom: 8px; display: block; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 2px solid var(--ink); overflow-x: auto; scrollbar-width: none; padding: 0 2px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 10px 16px; font: inherit; font-size: 14px; font-weight: 700; color: var(--ink); background: none; border: 2px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; margin-bottom: -2px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.tab:hover { background: var(--cream-2); }
.tab.active { color: var(--ink); background: var(--lemon); border-color: var(--ink); border-bottom: 2px solid var(--lemon); font-weight: 800; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade .2s ease; }
.seg { display: inline-flex; padding: 3px; background: #fff; border: 2px solid var(--ink); border-radius: 10px; gap: 3px; box-shadow: var(--hard-sm); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 700; color: var(--ink); padding: 5px 13px; border-radius: 7px; cursor: pointer; flex-shrink: 0; }
.seg button:hover { background: var(--cream-2); }
.seg button.active { background: var(--ink); color: #fff; box-shadow: none; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(17,17,17,.5); display: grid; place-items: center; padding: 16px; opacity: 0; transition: opacity .16s; }
.modal-backdrop.show { opacity: 1; }
.modal { background: #fff; border: 2px solid var(--ink); border-radius: 12px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 8px 8px 0 var(--ink); transform: translateY(12px) rotate(-.4deg); transition: transform .18s ease; }
.modal-backdrop.show .modal { transform: none; }
.modal.lg { max-width: 820px; }
.modal.sm { max-width: 420px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 2px solid var(--ink); background: var(--lemon); border-radius: 10px 10px 0 0; }
.modal-head h3 { margin: 0; font-size: 18px; font-weight: 900; }
.modal-body { padding: 22px 24px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 2px solid var(--ink); background: var(--cream); border-radius: 0 0 10px 10px; display: flex; gap: 10px; justify-content: flex-start; flex-wrap: wrap; }
.success-mark { width: 78px; height: 78px; border-radius: 16px; background: var(--mint); color: var(--ink); border: 2px solid var(--ink); box-shadow: var(--hard); display: grid; place-items: center; margin: 4px auto 18px; animation: pop .35s ease; transform: rotate(-4deg); }
.success-mark svg { width: 40px; height: 40px; stroke-width: 3; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; bottom: 24px; left: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { min-width: 280px; max-width: 380px; background: var(--ink); color: #fff; border: 2px solid var(--ink); border-radius: 10px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; box-shadow: 4px 4px 0 var(--orange); font-size: 14px; font-weight: 600; animation: toastIn .22s ease; }
.toast .t-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--mint); color: var(--ink); border: 2px solid #fff; flex-shrink: 0; }
.toast .t-icon svg { stroke-width: 3; }
.toast.error { box-shadow: 4px 4px 0 var(--coral); }
.toast.error .t-icon { background: var(--coral); color: var(--ink); }
.toast.info { box-shadow: 4px 4px 0 var(--sky-b); }
.toast.info .t-icon { background: var(--sky-b); color: var(--ink); }
.toast.warning { box-shadow: 4px 4px 0 var(--lemon); }
.toast.warning .t-icon { background: var(--lemon); color: var(--ink); }
.toast.hide { animation: toastOut .22s ease forwards; }

/* ---------- Lists / Feed ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 2px dashed var(--line); }
.feed li:last-child { border-bottom: 0; }
.feed .f-icon { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; border: 2px solid var(--ink); }
.feed p { margin: 0; font-size: 14px; }
.feed small { color: var(--text-2); font-size: 12px; }
.t-info { background: var(--sky-b); color: var(--ink); }
.t-success { background: var(--mint); color: var(--ink); }
.t-warning { background: var(--lemon); color: var(--ink); }
.t-danger { background: var(--coral); color: var(--ink); }
.t-brand { background: var(--orange); color: var(--ink); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 2px solid var(--line); }
.list-row:last-child { border-bottom: 0; }

/* Progress */
.progress { height: 12px; background: #fff; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 0; background: var(--c, var(--brand)); border-left: 2px solid var(--ink); transition: width .6s ease; }
.ring { --p: 75; --c: var(--brand); width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), #f1e7d6 0); position: relative; border: 2px solid var(--ink); box-shadow: var(--hard); }
.ring::before { content: ""; position: absolute; inset: 14px; background: #fff; border-radius: 50%; border: 2px solid var(--ink); }
.ring > * { position: relative; text-align: center; }
.ring b { font-size: 26px; font-weight: 900; display: block; line-height: 1; }
.ring small { font-size: 12px; color: var(--text-2); }

/* Chart containers */
.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 220px; }
.chart-box.lg { height: 340px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--ink); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; border: 2px solid var(--ink); }

/* Empty state */
.empty-state { padding: 48px 24px; color: var(--text-2); }
.empty-state .empty-icon { background: var(--lemon); color: var(--ink); border: 2px solid var(--ink); border-radius: 14px; box-shadow: var(--hard); transform: rotate(-4deg); }
.empty-state h3 { font-weight: 800; }

/* Info list */
.info-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
.info-list div small { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 2px; font-weight: 600; }
.info-list div b { font-size: 14px; font-weight: 700; }

/* Emoji/icon tile */
.sport-tile { width: 48px; height: 48px; border-radius: 10px; display: grid; place-items: center; font-size: 26px; background: color-mix(in srgb, var(--c, var(--brand)) 22%, #fff); border: 2px solid var(--ink); flex-shrink: 0; }

/* QR (pseudo) */
.qr { width: 132px; height: 132px; background: #fff; padding: 8px; border-radius: 8px; border: 2px solid var(--ink); display: grid; grid-template-columns: repeat(21, 1fr); gap: 0; }
.qr i { display: block; aspect-ratio: 1; }
.qr i.on { background: var(--ink); }


/* ==========================================================================
   Shared components (Store Pro)
   ========================================================================== */
/* Small category/icon chip */
.cat-ic { width: 26px; height: 26px; border-radius: 7px; display: inline-grid; place-items: center; background: var(--lemon); color: var(--ink); border: 1.5px solid var(--ink); flex-shrink: 0; }
.cat-ic svg { width: 14px; height: 14px; }
.cat-ic.lg { width: 34px; height: 34px; border-radius: 8px; border-width: 2px; }
.cat-ic.lg svg { width: 17px; height: 17px; }

/* Mini kanban (status counts) */
.kanban-mini { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kanban-mini .col { border-radius: 10px; padding: 14px; background: #fff; border: 2px solid var(--ink); border-top: 8px solid var(--c, var(--brand)); color: inherit; transition: .12s; box-shadow: var(--hard-sm); }
.kanban-mini .col:hover { transform: translate(-1px, -1px); box-shadow: var(--hard); }
.kanban-mini .col small { display: block; font-size: 12px; color: var(--ink); font-weight: 700; }
.kanban-mini .col b { display: block; font-size: 28px; font-weight: 900; line-height: 1.2; margin-top: 4px; }
.kanban-mini .col .chip { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.kanban-mini .col .chip span { font-size: 11px; background: var(--cream); border: 1.5px solid var(--ink); border-radius: 6px; padding: 3px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }

/* Occupancy bar list */
.occ-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 44px; gap: 12px; align-items: center; padding: 8px 0; font-size: 13px; }
.occ-row b { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Stat strip */
.stat-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat-strip > div { background: var(--cream); border: 2px solid var(--ink); border-radius: 10px; padding: 12px; }
.stat-strip small { display: block; font-size: 12px; color: var(--text-2); font-weight: 600; }
.stat-strip b { font-size: 19px; font-weight: 900; }

/* Divider + money */
.gold-line { height: 6px; width: 54px; border-radius: 2px; background: var(--orange); border: 2px solid var(--ink); }
.money { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.money small { font-size: 11px; font-weight: 600; color: var(--text-2); margin-right: 2px; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 30px 18px 0; }
.timeline li::before { content: ""; position: absolute; right: 7px; top: 8px; bottom: -6px; width: 2px; background: var(--ink); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; right: 0; top: 3px; width: 16px; height: 16px; border-radius: 4px; background: #fff; border: 2px solid var(--ink); }
.timeline li.done::after { background: var(--mint); }
.timeline b { display: block; font-size: 14px; font-weight: 800; }
.timeline small { color: var(--text-2); font-size: 12px; }

/* Animations */
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(12px); } }
.fade-in { animation: fade .3s ease both; }

/* Mobile overlay (legacy drawer — the block strip replaces it on small screens) */
.sidebar-overlay { position: fixed; inset: 0; background: rgba(17,17,17,.5); z-index: 35; opacity: 0; visibility: hidden; transition: .2s; }


/* ==========================================================================
   Extra components
   ========================================================================== */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dow { text-align: center; font-size: 12px; font-weight: 800; color: var(--ink); padding: 4px 0; }
.cal .day { aspect-ratio: 1; border-radius: 8px; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: #fff; border: 1.5px solid var(--ink); color: var(--ink); position: relative; }
.cal .day.p { background: var(--mint); }
.cal .day.a { background: var(--coral); }
.cal .day.today { outline: 3px solid var(--orange); outline-offset: 1px; }
.cal .day.future { background: transparent; color: #b8ad9a; border-style: dashed; }
.cal .day.empty { background: transparent; border: 0; }
.session { display: flex; gap: 14px; padding: 14px; border-radius: 10px; border: 2px solid var(--ink); background: #fff; align-items: center; border-right: 8px solid var(--c, var(--brand)); box-shadow: var(--hard-sm); }
.session .time { text-align: center; min-width: 64px; }
.session .time b { display: block; font-size: 16px; font-weight: 900; }
.session .time small { font-size: 12px; color: var(--text-2); }
.session h4 { margin: 0 0 2px; font-size: 15px; }
.text-sky { color: var(--sky); }
.demo-clock { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 12px; border-radius: 10px; background: var(--ink); color: #fff; border: 2px solid var(--ink); font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; box-shadow: 2px 2px 0 var(--orange); }
.demo-clock svg { width: 15px; height: 15px; color: var(--lemon); }
.chip-ch { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 6px; border: 1.5px solid var(--ink); color: var(--ink); background: #fff; white-space: nowrap; }
.chip-ch svg { width: 13px; height: 13px; color: var(--c); }
.drv-int { background: var(--sky-soft); color: var(--ink); }
.drv-ext { background: #ffe0ef; color: var(--ink); }
.drv-int svg, .drv-ext svg { width: 13px; height: 13px; }
.br-tag { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; white-space: nowrap; }
.br-tag i { width: 11px; height: 11px; border-radius: 3px; background: var(--c); display: inline-block; border: 1.5px solid var(--ink); }
.br-ic { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--c); color: #fff; border: 2px solid var(--ink); box-shadow: var(--hard-sm); flex-shrink: 0; }
.p-tile { width: 44px; height: 44px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 24px; line-height: 1; background: color-mix(in srgb, var(--c) 20%, #fff); border: 2px solid var(--ink); flex-shrink: 0; }
.stars { color: #e0a800; letter-spacing: 1px; font-size: 14px; }
.alert-soft { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 10px; background: #fff3c4; color: var(--ink); border: 2px solid var(--ink); font-size: 13px; line-height: 1.7; font-weight: 500; }
.alert-soft svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 2px; }
.alert-soft.success { background: var(--teal-soft); color: var(--ink); }
.jr-time { display: block; font-size: 12px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; margin-top: 2px; }
.jr-time em { font-style: normal; font-weight: 600; color: var(--text-2); font-size: 11px; }
.jr-time.muted { color: #b8ad9a; font-weight: 500; }
.jr-actor { display: inline-block; margin-top: 4px; font-size: 11px; color: var(--ink); background: var(--cream); border: 1.5px solid var(--ink); border-radius: 5px; padding: 0 7px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes jrPulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--st) 45%, transparent), 4px 4px 0 #111; } 70% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--st) 0%, transparent), 4px 4px 0 #111; } 100% { box-shadow: 0 0 0 0 transparent, 4px 4px 0 #111; } }
@keyframes jrDash { to { background-position: -28px 0; } }
@keyframes miniPulse { 50% { opacity: .55; } }
.ov { display: flex; flex-direction: column; gap: 22px; }
.ov-head-main { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.ov-ic { width: 56px; height: 56px; border-radius: 12px; display: grid; place-items: center; background: var(--st); color: #fff; border: 2px solid var(--ink); box-shadow: var(--hard); flex-shrink: 0; }
.ov-ic svg { width: 26px; height: 26px; }
.ov-sub { margin: 8px 0 0; color: var(--text-2); font-size: 13px; }
.ov-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.next-bar { display: flex; align-items: center; gap: 12px; padding: 14px 22px; border-top: 2px solid var(--ink); background: var(--cream); border-radius: 0 0 8px 8px; flex-wrap: wrap; }
.next-bar > div:not(.nb-btns) { flex: 1; min-width: 180px; }
.next-bar b { display: block; font-size: 14px; font-weight: 800; }
.next-bar small { color: var(--text-2); font-size: 12px; }
.nb-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: #fff; color: var(--ink); border: 2px solid var(--ink); flex-shrink: 0; }
.next-bar.can { background: #fff3c4; }
.next-bar.can .nb-ic { background: var(--orange); color: var(--ink); animation: jrPulseO 1.8s ease-out infinite; }
.nb-btns { display: flex; gap: 8px; flex-wrap: wrap; }
@keyframes jrPulseO { 0% { box-shadow: 0 0 0 0 rgba(255,90,31,.5); } 70% { box-shadow: 0 0 0 10px rgba(255,90,31,0); } 100% { box-shadow: 0 0 0 0 rgba(255,90,31,0); } }
.ov-totals { padding: 16px 22px 20px; border-top: 2px solid var(--ink); display: grid; gap: 8px; font-size: 14px; }
.ov-totals > div { display: flex; justify-content: space-between; gap: 12px; }
.ov-totals span { color: var(--text-2); }
.ov-totals b { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 800; }
.ov-totals .muted span, .ov-totals .muted b { color: var(--muted); font-size: 13px; font-weight: 600; }
.addr { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 10px; background: var(--cream); border: 2px solid var(--ink); }
.addr > svg { color: var(--brand-600); margin-top: 2px; }
.addr b { display: block; font-size: 14px; font-weight: 800; }
.addr small { color: var(--text-2); font-size: 12px; }
.drv-times { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.drv-times div { border-radius: 8px; padding: 8px; background: var(--cream); border: 2px solid var(--ink); text-align: center; }
.drv-times small { display: block; font-size: 11px; color: var(--text-2); font-weight: 600; }
.drv-times b { font-size: 13px; color: #b8ad9a; font-variant-numeric: tabular-nums; }
.eta-box { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--sky-b); color: var(--ink); border: 2px solid var(--ink); box-shadow: var(--hard-sm); font-size: 13px; font-weight: 700; }
.eta-box b { margin-right: auto; font-size: 16px; font-weight: 900; }
.eta-box svg { width: 16px; height: 16px; }
.empty-mini { display: flex; gap: 12px; align-items: flex-start; }
.pay-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; position: relative; }
.pay-steps div { text-align: center; position: relative; }
.pay-steps div:not(:last-child)::after { content: ""; position: absolute; top: 18px; right: calc(50% + 22px); left: calc(-50% + 22px); height: 3px; background: var(--ink); border-radius: 0; }
.pay-steps span { width: 40px; height: 40px; border-radius: 10px; margin: 0 auto 6px; display: grid; place-items: center; background: #fff; color: var(--ink); border: 2px solid var(--ink); position: relative; z-index: 1; }
.pay-steps span svg { width: 17px; height: 17px; }
.pay-steps small { font-size: 11px; font-weight: 700; color: var(--ink); }
.ev-log { list-style: none; margin: 0; padding: 0; }
.ev-log li { display: flex; gap: 12px; position: relative; padding-bottom: 16px; }
.ev-log li:not(:last-child)::before { content: ""; position: absolute; right: 16px; top: 36px; bottom: 0; width: 2px; background: var(--ink); }
.ev-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--st) 22%, #fff); color: var(--ink); border: 2px solid var(--ink); flex-shrink: 0; }
.ev-ic svg { width: 16px; height: 16px; }
.ev-log p { margin: 0; font-size: 14px; }
.ev-log small { color: var(--text-2); font-size: 12px; }
.mp-road { stroke: #fff; stroke-width: 9; fill: none; }
.mp-route { stroke: var(--ink); stroke-width: 3.5; fill: none; stroke-dasharray: 7 6; stroke-linecap: round; animation: routeDash 1.2s linear infinite; }
.mp-pin { position: absolute; width: 32px; height: 32px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg) translate(50%, -50%); display: grid; place-items: center; color: #fff; border: 2px solid var(--ink); box-shadow: var(--hard-sm); }
.mp-pin svg { width: 15px; height: 15px; transform: rotate(45deg); }
.mp-branch { background: var(--orange); color: var(--ink); }
.mp-home { background: var(--ink); }
.mp-driver { background: var(--sky-b); color: var(--ink); border-radius: 50%; transform: none; width: 30px; height: 30px; border: 2px solid var(--ink); right: 50%; top: 38%; animation: drvMove 6s ease-in-out infinite alternate; }
.mp-driver svg { transform: none; width: 14px; height: 14px; }
.mp-label { position: absolute; font-size: 11px; font-weight: 800; background: #fff; border: 1.5px solid var(--ink); border-radius: 5px; padding: 0 7px; color: var(--ink); }
.mp-km { position: absolute; left: 10px; bottom: 8px; font-size: 11px; font-weight: 800; background: var(--ink); color: #fff; border-radius: 5px; padding: 1px 8px; }
@keyframes routeDash { to { stroke-dashoffset: -26; } }
@keyframes drvMove { 0% { right: 30%; top: 52%; } 100% { right: 62%; top: 24%; } }
.assign-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.assign-sum div { background: var(--cream); border: 2px solid var(--ink); border-radius: 10px; padding: 10px 12px; }
.assign-sum small { display: block; font-size: 11px; color: var(--text-2); font-weight: 600; }
.assign-sum b { font-size: 14px; font-weight: 800; }
.drv-group { margin-top: 18px; }
.drv-group h4 { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); margin-bottom: 8px; font-weight: 800; }
.drv-group h4 svg { width: 16px; height: 16px; color: var(--brand-600); }
.drv-opt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 2px solid var(--ink); border-radius: 10px; cursor: pointer; margin-bottom: 10px; transition: .12s; background: #fff; box-shadow: var(--hard-sm); }
.drv-opt:hover { background: var(--cream); }
.drv-opt input { accent-color: var(--ink); width: 18px; height: 18px; flex-shrink: 0; }
.drv-opt:has(input:checked) { background: var(--lemon); box-shadow: var(--hard); transform: translate(-1px, -1px); }
.drv-opt.rec { border-style: dashed; }
.do-main { flex: 1; min-width: 0; }
.do-main b { display: flex; align-items: center; gap: 6px; font-size: 14px; flex-wrap: wrap; font-weight: 800; }
.do-main small { display: block; font-size: 12px; color: var(--text-2); }
.do-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: left; flex-shrink: 0; }
.do-side small { font-size: 11px; color: var(--text-2); }
.otp-in { width: 56px; height: 62px; border-radius: 10px; border: 2px solid var(--ink); text-align: center; font: 900 26px var(--font); color: var(--ink); box-shadow: var(--hard-sm); }
.otp-in:focus { outline: none; background: var(--lemon); box-shadow: var(--hard); }
.otp-in.err { border-color: var(--danger); background: var(--danger-soft); }
.otp-hint { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--ink); background: var(--cream); border: 2px dashed var(--ink); border-radius: 10px; padding: 6px 6px 6px 10px; }
.otp-hint span { padding-right: 6px; }
.collect-amt { text-align: center; padding: 16px; border-radius: 12px; background: var(--lemon); border: 2px solid var(--ink); box-shadow: var(--hard); }
.collect-amt small { display: block; color: var(--ink); font-weight: 700; }
.collect-amt b { font-size: 34px; font-weight: 900; color: var(--ink); letter-spacing: -.5px; }
.inv-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.inv-meta small { display: block; font-size: 11px; color: var(--text-2); }
.inv-table td, .inv-table th { padding: 9px 10px; }
.inv-tot { border-top: 0; padding-inline: 0; max-width: 360px; margin-right: auto; }
@keyframes flash { 30% { background: color-mix(in srgb, var(--st) 22%, #fff); } }
.pipe-ex { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.pipe-ex a { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; padding: 4px 12px; border-radius: 8px; color: var(--ink); background: color-mix(in srgb, var(--st) 20%, #fff); border: 2px solid var(--ink); box-shadow: var(--hard-sm); }
.pipe-ex a:hover { transform: translate(-1px, -1px); box-shadow: var(--hard-md); }
.pipe-ex a svg { width: 14px; height: 14px; }
.br-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.br-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 10px; background: #fff; border: 2px solid var(--ink); border-top: 10px solid var(--c); box-shadow: var(--hard); color: inherit; position: relative; overflow: hidden; transition: .12s; }
.br-card:hover { transform: translate(-2px, -2px); box-shadow: var(--hard-lg); }
.br-card .bc-top { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.br-card h4 { margin: 0; font-size: 15px; font-weight: 900; }
.br-card .bc-top small { display: block; font-size: 11px; color: var(--text-2); }
.br-card .bc-sales { font-size: 24px; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.br-card .bc-sales small { font-size: 12px; color: var(--text-2); font-weight: 600; }
.br-card .bc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.br-card .bc-grid div { background: var(--cream); border: 1.5px solid var(--ink); border-radius: 8px; padding: 6px 8px; }
.br-card .bc-grid small { display: block; font-size: 10px; color: var(--text-2); }
.br-card .bc-grid b { font-size: 14px; font-weight: 800; }
.br-card .bc-alert { font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; gap: 5px; color: var(--ink); background: var(--lemon); border: 1.5px solid var(--ink); border-radius: 6px; padding: 1px 8px; align-self: flex-start; }
.br-card .bc-alert svg { width: 14px; height: 14px; }
.share-bar { display: flex; height: 16px; border-radius: 6px; overflow: hidden; background: #fff; border: 2px solid var(--ink); }
.share-bar span { display: block; height: 100%; border-left: 2px solid var(--ink); }
.share-bar span:last-child { border-left: 0; }
@keyframes live { 70% { box-shadow: 0 0 0 8px rgba(61,220,151,0); } 100% { box-shadow: 0 0 0 0 rgba(61,220,151,0); } }
.feature-order { border-radius: 10px; padding: 16px 18px; background: var(--lemon); border: 2px solid var(--ink); box-shadow: var(--hard); display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.feature-order .fo-txt { flex: 1; min-width: 220px; }
.feature-order .fo-txt b { font-size: 15px; font-weight: 900; }
.feature-order .fo-txt small { display: block; font-size: 12px; color: var(--ink); }
.app-tabbar { display: none; }
.m-hero { border-radius: 12px; padding: 20px; color: #fff; background: var(--ink); border: 2px solid var(--ink); box-shadow: 5px 5px 0 var(--orange); position: relative; overflow: hidden; }
.m-hero small { opacity: .85; }
.m-tile { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 10px; background: #fff; border: 2px solid var(--ink); box-shadow: var(--hard-sm); color: inherit; min-height: 64px; }


/* ==========================================================================
   Store Pro components — orders, journey, drivers, branches
   (class names emitted by app.js / order-view.js — keep in sync)
   ========================================================================== */
/* Status badge (lifecycle colours via --st) */
.st-badge { background: color-mix(in srgb, var(--st) 20%, #fff); color: var(--ink); border: 1.5px solid var(--ink); }
.st-badge svg { width: 13px; height: 13px; color: color-mix(in srgb, var(--st) 80%, #000); stroke-width: 2.6; }

/* Channel / payment / type tags */
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--ink); white-space: nowrap; background: #fff; border: 1.5px solid var(--ink); border-radius: 6px; padding: 0 8px 0 7px; line-height: 1.7; }
.tag svg { width: 13px; height: 13px; color: var(--c, var(--ink)); stroke-width: 2.6; }
.type-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 900; padding: 0 8px; border-radius: 5px; white-space: nowrap; border: 1.5px solid var(--ink); line-height: 1.7; }
.type-tag.retail { background: #ffe3d3; color: var(--ink); }
.type-tag.wholesale { background: var(--ink); color: var(--lemon); }
.prio { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 900; padding: 0 8px; border-radius: 5px; border: 1.5px solid var(--ink); line-height: 1.7; }
.prio.high { background: var(--lemon); color: var(--ink); }
.prio.urgent { background: var(--coral); color: var(--ink); animation: blink 1.6s ease-in-out infinite; }
.prio svg { width: 12px; height: 12px; }
@keyframes blink { 50% { opacity: .55; } }

/* Driver & vehicle chips */
.drv-chip { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.drv-chip b { font-size: 13px; font-weight: 800; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drv-chip small { font-size: 11px; color: var(--text-2); display: flex; align-items: center; gap: 4px; }
.drv-type { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; padding: 0 8px; border-radius: 5px; white-space: nowrap; border: 1.5px solid var(--ink); line-height: 1.7; color: var(--ink); }
.drv-type.internal { background: var(--mint); }
.drv-type.external { background: var(--pink); }
.drv-type.pickup { background: var(--lemon); }
.drv-type svg { width: 12px; height: 12px; }
.veh-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--ink); background: var(--cream); border: 1.5px solid var(--ink); border-radius: 6px; padding: 0 8px; white-space: nowrap; line-height: 1.7; }
.veh-chip svg { width: 14px; height: 14px; }
.plate { font-family: ui-monospace, Menlo, monospace; font-size: 11px; font-weight: 700; border: 2px solid var(--ink); border-radius: 5px; padding: 0 6px; background: #fff; color: var(--ink); white-space: nowrap; }
.dot-status { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex-shrink: 0; background: #c9bfae; border: 2px solid var(--ink); }
.dot-status.available { background: var(--mint); box-shadow: none; }
.dot-status.busy { background: var(--sky-b); box-shadow: none; }
.dot-status.off, .dot-status.offline { background: #c9bfae; }

/* Product tile */
.prod-tile { width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center; font-size: 22px; flex-shrink: 0; background: color-mix(in srgb, var(--c, #ff5a1f) 20%, #fff); border: 2px solid var(--ink); }
.prod-tile.sm { width: 32px; height: 32px; font-size: 17px; border-radius: 7px; }
.prod-tile.lg { width: 56px; height: 56px; font-size: 30px; border-radius: 12px; box-shadow: var(--hard-sm); }

/* ---------- Order journey — bold numbered blocks (horizontal; vertical ≤720px) ---------- */
.journey { overflow-x: auto; padding: 12px 6px 8px; scrollbar-width: thin; scrollbar-color: var(--ink) transparent; }
.journey .jr-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-template-columns: repeat(var(--jr-n, 10), minmax(88px, 1fr)); min-width: calc(var(--jr-n, 10) * 88px); counter-reset: jr; }
.journey .jr-step { position: relative; text-align: center; padding: 0 4px; --st: #c9bfae; display: block; counter-increment: jr; }
.journey .jr-step::after { content: ""; position: absolute; top: 23px; right: calc(50% + 28px); left: calc(-50% + 28px); height: 4px; border-radius: 0; background: repeating-linear-gradient(270deg, #c9bfae 0 6px, transparent 6px 11px); opacity: 1; animation: none; }
.journey .jr-step:last-child::after { display: none; }
.journey .jr-step.done::after { background: var(--ink); }
.journey .jr-step.current::after { background: repeating-linear-gradient(270deg, var(--orange) 0 8px, var(--ink) 8px 16px); background-size: 32px 4px; animation: jrflow 1s linear infinite; }
@keyframes jrflow { to { background-position: -32px 0; } }
.journey .jr-dot { width: 50px; height: 50px; border-radius: 12px; margin: 0 auto 10px; display: grid; place-items: center; background: #fff; border: 2px dashed #b8ad9a; color: #a59a87; position: relative; z-index: 1; transition: .2s; animation: none; }
.journey .jr-dot svg { width: 22px; height: 22px; stroke-width: 2.3; }
.journey .jr-dot::after { content: counter(jr); position: absolute; top: -10px; left: -10px; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 6px; background: #fff; color: #a59a87; border: 2px solid #b8ad9a; font: 900 11px/18px var(--font); text-align: center; box-sizing: border-box; }
.journey .jr-step.done .jr-dot { background: var(--mint); border: 2px solid var(--ink); color: var(--ink); box-shadow: var(--hard-sm); }
.journey .jr-step.done .jr-dot::after { content: "✓"; background: var(--ink); color: #fff; border-color: var(--ink); }
.journey .jr-step.current .jr-dot { background: var(--st); border: 2px solid var(--ink); color: #fff; box-shadow: var(--hard); transform: translate(-2px, -2px) rotate(-3deg); }
.journey .jr-step.current .jr-dot svg { filter: drop-shadow(0 1px 0 rgba(0,0,0,.35)); }
.journey .jr-step.current .jr-dot::after { background: var(--lemon); color: var(--ink); border-color: var(--ink); }
.journey .jr-step.current .jr-dot::before { content: ""; position: absolute; inset: -8px; border-radius: 14px; border: 2px dashed var(--ink); animation: jrpulse 1.8s ease-out infinite; }
@keyframes jrpulse { 0% { transform: scale(.92); opacity: .9; } 100% { transform: scale(1.3); opacity: 0; } }
.journey .jr-step.exception .jr-dot { background: var(--st); border: 2px solid var(--ink); color: #fff; box-shadow: var(--hard); }
.journey .jr-step.exception .jr-dot::before { display: none; }
.journey .jr-step.exception .jr-dot::after { content: "!"; background: var(--coral); color: var(--ink); border-color: var(--ink); }
.journey .jr-txt b { display: block; font-size: 13px; font-weight: 800; line-height: 1.35; color: var(--ink); }
.journey .jr-step.upcoming .jr-txt b { color: #8a8274; font-weight: 700; }
.journey .jr-step.current .jr-txt b { display: inline-block; color: var(--ink); background: var(--lemon); border: 2px solid var(--ink); border-radius: 6px; padding: 0 6px; }
.journey .jr-txt small { display: block; font-size: 12px; font-weight: 800; color: var(--ink); margin-top: 3px; font-variant-numeric: tabular-nums; }
.journey .jr-txt em { display: block; font-style: normal; font-size: 11px; color: var(--text-2); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.journey .jr-step.upcoming .jr-txt small { color: #a59a87; font-weight: 600; }
.journey.compact { padding-top: 10px; }
.journey.compact .jr-dot { width: 38px; height: 38px; border-radius: 9px; }
.journey.compact .jr-dot svg { width: 17px; height: 17px; }
.journey.compact .jr-dot::after { min-width: 18px; height: 18px; top: -8px; left: -8px; font-size: 10px; line-height: 14px; border-radius: 5px; }
.journey.compact .jr-step::after { top: 17px; right: calc(50% + 22px); left: calc(-50% + 22px); height: 3px; }
.journey.compact .jr-steps { grid-template-columns: repeat(var(--jr-n, 10), minmax(72px, 1fr)); min-width: calc(var(--jr-n, 10) * 72px); }
.journey.compact .jr-txt b { font-size: 11px; }
.journey.compact .jr-txt small, .journey.compact .jr-txt em { font-size: 10px; }
/* dark variant (ops wall / dark panels) */
.journey.dark .jr-txt b { color: #fff; }
.journey.dark .jr-step.upcoming .jr-txt b { color: rgba(255,255,255,.45); }
.journey.dark .jr-txt small { color: rgba(255,255,255,.85); }
.journey.dark .jr-txt em { color: rgba(255,255,255,.55); }
.journey.dark .jr-step.current .jr-txt b { color: var(--ink); }
.journey.dark .jr-dot { background: transparent; border-color: rgba(255,255,255,.3); color: rgba(255,255,255,.45); }
.journey.dark .jr-dot::after { background: #1b1b1b; color: rgba(255,255,255,.5); border-color: rgba(255,255,255,.3); }
.journey.dark .jr-step.done .jr-dot, .journey.dark .jr-step.current .jr-dot, .journey.dark .jr-step.exception .jr-dot { border-color: #fff; box-shadow: 3px 3px 0 rgba(255,255,255,.85); }
.journey.dark .jr-step.done .jr-dot::after { background: #fff; color: var(--ink); border-color: #fff; }
.journey.dark .jr-step.current .jr-dot::before { border-color: #fff; }
.journey.dark .jr-step::after { background: repeating-linear-gradient(270deg, rgba(255,255,255,.28) 0 6px, transparent 6px 11px); }
.journey.dark .jr-step.done::after { background: #fff; }
.journey.dark .jr-step.current::after { background: repeating-linear-gradient(270deg, var(--orange) 0 8px, #fff 8px 16px); background-size: 32px 4px; }

/* Journey summary strip */
.jr-summary { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; padding: 12px 16px; border-radius: 10px; background: var(--cream); border: 2px solid var(--ink); margin-top: 18px; font-size: 13px; color: var(--text-2); }
.jr-summary b { color: var(--ink); font-weight: 800; }
.jr-summary span { display: inline-flex; align-items: center; gap: 6px; }
.jr-summary svg { width: 15px; height: 15px; color: var(--ink); }

/* Mini journey (table rows) */
.jr-mini { display: inline-flex; align-items: center; gap: 3px; vertical-align: middle; }
.jr-mini i { width: 10px; height: 10px; border-radius: 2px; background: #fff; border: 1.5px solid #b8ad9a; display: block; flex-shrink: 0; }
.jr-mini i.done { background: var(--ink); border-color: var(--ink); }
.jr-mini i.cur { width: 14px; background: var(--st, var(--orange)); border-color: var(--ink); box-shadow: none; animation: blink 1.6s ease-in-out infinite; }
.jr-mini i.exc { background: var(--coral); border-color: var(--ink); }
.jr-mini-wrap { display: flex; flex-direction: column; gap: 4px; }
.jr-mini-wrap small { font-size: 11px; color: var(--text-2); white-space: nowrap; font-weight: 600; }

/* Pipeline (orders by lifecycle status) */
.pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 12px; }
.pipe { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 10px; background: #fff; border: 2px solid var(--ink); border-top: 8px solid var(--st); box-shadow: var(--hard-sm); color: inherit; transition: .12s; }
.pipe:hover { box-shadow: var(--hard); transform: translate(-2px, -2px); background: var(--cream); }
.pipe .p-ic { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--st) 25%, #fff); color: var(--ink); border: 2px solid var(--ink); }
.pipe .p-ic svg { width: 17px; height: 17px; }
.pipe small { font-size: 12px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.pipe b { font-size: 28px; font-weight: 900; line-height: 1; letter-spacing: -.5px; }
.pipe.hot::after { content: ""; position: absolute; top: 12px; left: 12px; width: 11px; height: 11px; border-radius: 50%; background: var(--st); border: 2px solid var(--ink); animation: blink 1.4s infinite; }

/* Branch cards */
.branch-card { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 10px; border: 2px solid var(--ink); background: #fff; color: inherit; position: relative; overflow: hidden; transition: .12s; box-shadow: var(--hard); }
.branch-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 10px; background: var(--c, var(--brand)); border-bottom: 2px solid var(--ink); }
.branch-card:hover { transform: translate(-2px, -2px); box-shadow: var(--hard-lg); }
.branch-card .bc-head { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.branch-card .bc-ic { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--c); color: #fff; border: 2px solid var(--ink); flex-shrink: 0; }
.branch-card h4 { margin: 0; font-size: 16px; font-weight: 900; }
.branch-card .bc-sub { font-size: 12px; color: var(--text-2); }
.bc-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bc-stats div { background: var(--cream); border: 1.5px solid var(--ink); border-radius: 8px; padding: 8px 10px; }
.bc-stats small { display: block; font-size: 11px; color: var(--text-2); }
.bc-stats b { font-size: 16px; font-weight: 900; }
.bc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }

/* Split bar */
.split-bar { display: flex; height: 16px; border-radius: 6px; overflow: hidden; background: #fff; border: 2px solid var(--ink); }
.split-bar span { display: block; height: 100%; border-left: 2px solid var(--ink); }
.split-bar span:last-child { border-left: 0; }
.mini-stat { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 2px dashed var(--line); font-size: 13px; }
.mini-stat:last-child { border-bottom: 0; }
.mini-stat b { font-size: 16px; font-weight: 900; }

/* Map placeholder */
.map-ph { position: relative; height: 170px; border-radius: 10px; overflow: hidden; background:
  linear-gradient(90deg, rgba(255,255,255,.85) 2px, transparent 2px) 0 0/46px 46px,
  linear-gradient(rgba(255,255,255,.85) 2px, transparent 2px) 0 0/46px 46px,
  linear-gradient(35deg, transparent 47%, var(--lemon) 47% 53%, transparent 53%),
  linear-gradient(120deg, transparent 60%, #e6dccb 60% 63%, transparent 63%),
  #f3ecdf; border: 2px solid var(--ink); }
.map-ph .route { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-ph .pin { position: absolute; transform: translate(50%, -100%); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50% 50% 50% 0; rotate: -45deg; color: #fff; border: 2px solid var(--ink); box-shadow: var(--hard-sm); }
.map-ph .pin svg { rotate: 45deg; width: 16px; height: 16px; }
.map-ph .pin.store { background: var(--orange); color: var(--ink); }
.map-ph .pin.home { background: var(--ink); }
.map-ph .pin.car { background: var(--sky-b); color: var(--ink); border-radius: 50%; rotate: 0deg; width: 30px; height: 30px; transform: translate(50%, -50%); animation: carmove 6s ease-in-out infinite alternate; }
.map-ph .pin.car svg { rotate: 0deg; }
.map-ph .map-tag { position: absolute; bottom: 10px; right: 10px; background: #fff; border: 2px solid var(--ink); border-radius: 8px; padding: 4px 10px; font-size: 12px; font-weight: 800; box-shadow: var(--hard-sm); display: flex; align-items: center; gap: 6px; max-width: calc(100% - 20px); }
.map-ph .map-tag svg { width: 14px; height: 14px; color: var(--brand-600); }
@keyframes carmove { to { margin-right: -24px; margin-top: 14px; } }

/* ---------- Order view ---------- */
.ov-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.ov-head > div:first-child { min-width: 0; flex: 1 1 420px; }
.ov-head h1 { font-size: 28px; font-weight: 900; margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; letter-spacing: -.4px; }
.ov-head h1 .code { direction: ltr; unicode-bidi: embed; }
.ov-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.ov-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ov-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.action-panel { border-radius: 12px; padding: 18px 20px; background: var(--ink); color: #fff; border: 2px solid var(--ink); box-shadow: 5px 5px 0 var(--orange); display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; position: relative; overflow: hidden; }
.action-panel::after { content: ""; position: absolute; width: 90px; height: 90px; left: -24px; top: -40px; border-radius: 18px; background: var(--lemon); transform: rotate(20deg); opacity: .9; pointer-events: none; }
.action-panel > * { position: relative; z-index: 1; }
.action-panel small { color: var(--lemon); font-weight: 800; font-size: 12px; display: block; }
.action-panel b { font-size: 17px; font-weight: 900; }
.action-panel p { margin: 2px 0 0; font-size: 13px; color: rgba(255,255,255,.78); }
.action-panel .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.action-panel .btn { box-shadow: 3px 3px 0 var(--lemon); }
.action-panel .btn-outline { background: #fff; color: var(--ink); border-color: #fff; }
.action-panel .btn-outline:hover { background: var(--lemon); color: var(--ink); }
.action-panel .btn-ghost { color: #fff; box-shadow: none; }
.action-panel .btn-ghost:hover { color: var(--ink); }
.action-panel.idle { background: var(--cream); color: var(--ink); border: 2px dashed var(--ink); box-shadow: none; }
.action-panel.idle::after { display: none; }
.action-panel.idle p { color: var(--text-2); }
.action-panel.idle small { color: var(--text-2); }
.action-panel.idle .btn { box-shadow: var(--hard-md); }
.totals { display: grid; gap: 8px; font-size: 14px; }
.totals > div { display: flex; justify-content: space-between; gap: 10px; color: var(--text-2); }
.totals > div b { color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.totals .grand { border-top: 2px solid var(--ink); padding-top: 10px; margin-top: 4px; font-size: 17px; font-weight: 900; color: var(--ink); }
.totals .grand b { font-size: 22px; color: var(--ink); background: var(--lemon); border: 2px solid var(--ink); border-radius: 6px; padding: 0 8px; }
.totals .cod { background: #ffe3d3; border: 2px solid var(--ink); border-radius: 8px; padding: 8px 12px; color: var(--ink); font-weight: 800; }
.note-box { background: #fff3c4; border: 2px solid var(--ink); border-radius: 10px; padding: 10px 12px; font-size: 13px; color: var(--ink); display: flex; gap: 8px; }
.note-box svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 3px; }
.note-box.blue { background: var(--sky-soft); color: var(--ink); }
.events { list-style: none; margin: 0; padding: 0; }
.events li { display: flex; gap: 12px; padding: 0 0 16px; position: relative; }
.events li::before { content: ""; position: absolute; right: 15px; top: 34px; bottom: 0; width: 2px; background: var(--ink); }
.events li:last-child::before { display: none; }
.events .e-ic { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; background: color-mix(in srgb, var(--st, #8a8274) 22%, #fff); color: var(--ink); border: 2px solid var(--ink); }
.events .e-ic svg { width: 15px; height: 15px; }
.events p { margin: 0; font-size: 13px; }
.events small { font-size: 12px; color: var(--text-2); }
.events li.live .e-ic { background: var(--lemon); box-shadow: var(--hard-sm); }

/* Modal option cards (assign driver) */
.opt-list { display: grid; gap: 10px; }
.opt-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; border: 2px solid var(--ink); background: #fff; cursor: pointer; font: inherit; text-align: right; width: 100%; transition: .12s; color: inherit; box-shadow: var(--hard-sm); }
.opt-card:hover { background: var(--cream); transform: translate(-1px, -1px); box-shadow: var(--hard-md); }
.opt-card.selected { background: var(--lemon); box-shadow: var(--hard); transform: translate(-1px, -1px); }
.opt-card.disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.opt-card .oc-main { flex: 1; min-width: 0; }
.opt-card .oc-main b { display: block; font-size: 14px; font-weight: 800; }
.opt-card .oc-main small { font-size: 12px; color: var(--text-2); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.opt-card .oc-side { text-align: left; flex-shrink: 0; font-size: 12px; color: var(--text-2); }
.opt-card .oc-side b { display: block; font-size: 15px; color: var(--ink); font-weight: 900; }
.opt-group { font-size: 12px; font-weight: 900; color: var(--ink); margin: 16px 0 8px; display: flex; align-items: center; gap: 8px; }
.opt-group:first-child { margin-top: 0; }
.otp-inputs { display: flex; gap: 10px; justify-content: center; direction: ltr; }
.otp-inputs input { width: 56px; height: 64px; text-align: center; font: 900 26px var(--font); border: 2px solid var(--ink); border-radius: 10px; box-shadow: var(--hard-sm); color: var(--ink); }
.otp-inputs input:focus { outline: none; background: var(--lemon); box-shadow: var(--hard); }
.proof-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.proof { border: 2px dashed var(--ink); border-radius: 10px; padding: 14px; text-align: center; cursor: pointer; font: inherit; background: #fff; color: var(--ink); font-size: 13px; font-weight: 800; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.proof:hover { background: var(--cream); }
.proof svg { width: 22px; height: 22px; }
.proof.done { border-style: solid; background: var(--mint); color: var(--ink); box-shadow: var(--hard-sm); }

/* Invoice (simplified tax invoice) */
.invoice { font-size: 13px; }
.invoice .inv-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; border-bottom: 3px solid var(--ink); padding-bottom: 12px; margin-bottom: 12px; }
.invoice h3 { margin: 0; font-size: 18px; font-weight: 900; }
.invoice table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.invoice th, .invoice td { padding: 6px 8px; border-bottom: 1.5px solid var(--line); text-align: right; }
.invoice th { background: var(--ink); color: #fff; font-size: 12px; }
.invoice .qr { width: 110px; height: 110px; }

/* Live dot */
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--teal); }
.live-dot::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--mint); border: 2px solid var(--ink); animation: blink 1.4s infinite; }

/* ---------- Mobile-app shell (driver / courier) ---------- */
.tabbar-app { display: none; }
body[data-role="driver"] .content, body[data-role="courier"] .content { max-width: 1100px; }
.big-btn { min-height: 54px; font-size: 16px; font-weight: 900; border-radius: 12px; width: 100%; }


/* ==========================================================================
   Page-local components — brutalist treatment
   (pages define these in their own <style>; body.app raises specificity so
    the shared visual language wins without editing every page)
   ========================================================================== */
/* driver / courier mobile-app pages */
body.app .card-a { background: #fff; border: 2px solid var(--ink); border-radius: 12px; box-shadow: var(--hard); }
body.app .hero-a { background: var(--ink); border: 2px solid var(--ink); border-radius: 14px; box-shadow: 5px 5px 0 var(--orange); }
body.app .hero-a::after { width: 120px; height: 120px; left: -30px; bottom: -50px; border-radius: 22px; border: 0; background: var(--lemon); transform: rotate(18deg); opacity: .9; }
body.app .hero-a .avatar { border-color: #fff; }
body.app .toggle2 { background: #fff; border: 2px solid #fff; border-radius: 12px; }
body.app .toggle2 button { color: var(--ink); border-radius: 8px; }
body.app .toggle2 button.on { background: var(--mint); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
body.app .toggle2 button.on.warn { background: var(--lemon); box-shadow: inset 0 0 0 2px var(--ink); }
body.app .toggle2 button.on.off { background: #c9bfae; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
body.app .tile { background: var(--c-soft, #fff); border: 2px solid var(--ink); border-radius: 12px; box-shadow: var(--hard-sm); }
body.app a.tile:hover { transform: translate(-1px, -1px); box-shadow: var(--hard); }
body.app .tile .t-ic { background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 8px; }
body.app .tile small { color: var(--ink); }
body.app .tile b { font-weight: 900; }
body.app .btn-xl { border-radius: 12px; box-shadow: var(--hard); font-weight: 900; }
body.app .act-b { border: 2px solid var(--ink); border-radius: 10px; box-shadow: var(--hard-sm); color: var(--ink); }
body.app .act-b:hover { background: var(--lemon); }
body.app .act-b svg { color: var(--ink); }
body.app .icon-b { border: 2px solid var(--ink); border-radius: 10px; box-shadow: var(--hard-sm); color: var(--ink); }
body.app .swipe { border: 2px solid var(--ink); box-shadow: var(--hard); border-radius: 14px; }
body.app .swipe .sw-knob { top: 4px; right: 4px; border: 2px solid var(--ink); border-radius: 10px; box-shadow: var(--hard-sm); }
body.app .swipe .sw-label { text-shadow: 0 1px 0 rgba(0,0,0,.25); }
body.app .swipe .sw-fill { background: rgba(255,255,255,.35); }
body.app .o-card { border: 2px solid var(--ink); border-radius: 12px; box-shadow: var(--hard-sm); }
body.app .o-card:hover { transform: translate(-1px, -1px); box-shadow: var(--hard); background: var(--cream); }
body.app .o-card .oc-go { color: var(--ink); text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 3px; }
body.app .cod-pill, body.app .cod-chip { background: var(--lemon); color: var(--ink); border: 1.5px solid var(--ink); border-radius: 6px; }
body.app .cod-pill.paid, body.app .cod-chip.paid { background: var(--mint); color: var(--ink); border-color: var(--ink); }
body.app .banner { border: 2px solid var(--ink); border-radius: 12px; background: #ffe3d3; color: var(--ink); box-shadow: var(--hard-sm); }
body.app .banner .b-ic { background: #fff; border: 2px solid var(--ink); border-radius: 8px; color: var(--ink); }
body.app .banner .b-txt b { color: var(--ink); }
body.app .banner.teal { background: var(--teal-soft); color: var(--ink); }
body.app .banner.amber { background: #fff3c4; color: var(--ink); }
body.app .banner.slate { background: #efe8dc; color: var(--ink); }
body.app .seg-a { background: #fff; border: 2px solid var(--ink); border-radius: 12px; box-shadow: var(--hard-sm); }
body.app .seg-a button { border-radius: 8px; color: var(--ink); }
body.app .seg-a button.active { background: var(--ink); color: #fff; box-shadow: none; }
body.app .seg-a button em { background: var(--lemon); color: var(--ink); border: 1.5px solid var(--ink); }
body.app .seg-a button.active em { border-color: #fff; }
body.app .empty-a .e-ic { background: var(--lemon); color: var(--ink); border: 2px solid var(--ink); border-radius: 14px; box-shadow: var(--hard); transform: rotate(-4deg); }
body.app .opt-r { border: 2px solid var(--ink); border-radius: 10px; }
body.app .opt-r:has(input:checked) { background: var(--lemon); border-color: var(--ink); box-shadow: var(--hard-sm); }
body.app .modal.sheet { border-radius: 16px 16px 0 0; border-bottom: 0; box-shadow: 0 -6px 0 var(--ink); }
body.app .modal.sheet .modal-head { border-radius: 14px 14px 0 0; }
body.app .cur { border: 2px solid var(--ink); border-top: 10px solid var(--sw, var(--sky-b)); border-radius: 12px; box-shadow: var(--hard); }
body.app .cur .c-facts div { background: var(--cream); border: 1.5px solid var(--ink); border-radius: 8px; }
body.app .break-note { background: #fff3c4; border: 2px solid var(--ink); color: var(--ink); border-radius: 10px; }
body.app .rows .r-ic { border: 2px solid var(--ink); border-radius: 8px; }
/* dispatch / gm shared bits */
body.app .rmap { border: 2px solid var(--ink); border-radius: 10px; }
body.app .sg-card { background: #fff3c4; border: 2px solid var(--ink); border-radius: 10px; box-shadow: var(--hard-sm); }
body.app .sg-stats div { background: #fff; border: 1.5px solid var(--ink); border-radius: 8px; }
body.app .spot { background: var(--ink); border: 2px solid var(--ink); border-radius: 12px; box-shadow: 5px 5px 0 var(--orange); }
body.app .spot::after { width: 80px; height: 80px; left: -20px; top: -36px; border-radius: 16px; background: var(--lemon); transform: rotate(20deg); opacity: .9; }
body.app .tower { background: var(--ink); border: 2px solid var(--ink); border-radius: 12px; box-shadow: 5px 5px 0 var(--orange); }
body.app .tw { border: 2px solid rgba(255,255,255,.22); border-radius: 10px; }
body.app .tw:hover { border-color: var(--lemon); }
body.app .lane, body.app .bh { border: 2px solid var(--ink); border-radius: 10px; box-shadow: var(--hard-sm); }
body.app .lane { border-top: 8px solid var(--st); }
body.app .bh { border-top: 8px solid var(--lc); }
body.app .lane:hover, body.app .bh:hover { transform: translate(-2px, -2px); box-shadow: var(--hard); }
body.app .lane .l-ic { border: 2px solid var(--ink); color: var(--ink); background: color-mix(in srgb, var(--st) 25%, #fff); }
body.app .lane .l-bar, body.app .brt .meter { border: 1.5px solid var(--ink); background: #fff; height: 9px; }
body.app .bh .score { border: 2px solid var(--ink); }
body.app .bh .score::before { border: 2px solid var(--ink); }
body.app .bh-stats div { background: var(--cream); border: 1.5px solid var(--ink); border-radius: 8px; }
body.app .qa button { border: 2px solid var(--ink); border-radius: 10px; box-shadow: var(--hard-sm); }
body.app .qa button:hover { background: var(--lemon); border-color: var(--ink); transform: translate(-1px, -1px); box-shadow: var(--hard); }
body.app .qa .q-ic { border: 2px solid var(--ink); border-radius: 8px; }
body.app .gm-head-live { border: 2px solid var(--ink); border-radius: 8px; box-shadow: var(--hard-sm); font-weight: 600; color: var(--ink); }
body.app .gm-lv, body.app .km-chip, body.app .boost-chip, body.app .age { border: 1.5px solid var(--ink); border-radius: 6px; color: var(--ink); }
body.app .gm-mv-row { border: 2px solid var(--ink); border-radius: 10px; }
body.app .gm-mv-row:has(input:checked) { background: var(--lemon); border-color: var(--ink); }
body.app .gm-mv-cmp > div { background: var(--cream); border: 2px solid var(--ink); border-radius: 10px; }
body.app .chk-row label { border: 2px solid var(--ink); border-radius: 8px; }
body.app .chk-row label:has(input:checked) { background: var(--lemon); border-color: var(--ink); color: var(--ink); }
body.app .ext-item { border: 2px solid var(--ink); border-radius: 8px; }
body.app .alert-ic, body.app .alert-row .a-ic, body.app .ann .ann-ic, body.app .empty-q .em { border: 2px solid var(--ink); border-radius: 10px; }
body.app .dq-row.first { background: #fff3c4; }
body.app .act-row.sel { background: var(--lemon); border: 2px solid var(--ink); }
body.app .heat td { border: 1.5px solid var(--ink); border-radius: 6px; }
body.app .heat td:first-child { border: 0; }
body.app .stat-card { border: 2px solid var(--ink); border-radius: 10px; box-shadow: var(--hard-sm); }


/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1400px) {
  .br-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1280px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .branch-switch .bs-meta small { display: none; }
  .branch-switch { max-width: 200px; }
}
@media (max-width: 1100px) {
  .grid-main { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-grid { grid-template-columns: minmax(0, 1fr); }
}
/* Tablets & phones: the block sidebar becomes a horizontal strip of blocks under the top bar */
@media (max-width: 1024px) {
  .sidebar {
    position: static; inset: auto; width: auto; z-index: 1; transform: none;
    border-left: 0; border-bottom: 2px solid var(--ink); display: block; background-color: var(--cream);
  }
  .sidebar .brand, .sidebar .role-chip, .sidebar .sidebar-foot, .sidebar .nav-section { display: none; }
  .nav-scroll { display: flex; gap: 10px; overflow-x: auto; overflow-y: hidden; padding: 12px 16px 14px; scrollbar-width: none; scroll-snap-type: x proximity; }
  .nav-scroll::-webkit-scrollbar { display: none; }
  .nav-link { flex-shrink: 0; margin: 0; white-space: nowrap; padding: 6px 10px 6px 12px; box-shadow: var(--hard-sm); scroll-snap-align: start; }
  .nav-link:hover { transform: none; box-shadow: var(--hard-sm); }
  .nav-link.active { transform: none; box-shadow: var(--hard-md); }
  .nav-link > svg:first-child { width: 26px; height: 26px; }
  body.nav-open .sidebar-overlay { opacity: 0; visibility: hidden; }
  .main { margin-right: 0; }
  .menu-toggle { display: none !important; }
  .tb-brand { display: inline-flex; }
  .topbar-app { padding: 0 20px; gap: 10px; }
  .content { padding: 24px 20px 36px; }
  .user-btn .meta { display: none; }
  .user-btn { height: 46px; padding: 3px 4px 3px 6px; gap: 4px; }

  /* driver / courier: mobile-app shell — bottom tab bar replaces the strip */
  body[data-role="driver"] .sidebar, body[data-role="courier"] .sidebar { display: none; }
  body[data-role="driver"] .tabbar-app, body[data-role="courier"] .tabbar-app {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; position: fixed; bottom: 0; inset-inline: 0; z-index: 45;
    background: var(--cream); border-top: 2px solid var(--ink); padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  }
  .tabbar-app a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; font-size: 11px; font-weight: 800; color: var(--ink); border-radius: 10px; border: 2px solid transparent; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tabbar-app a svg { width: 22px; height: 22px; }
  .tabbar-app a.active { color: var(--ink); background: var(--orange); border-color: var(--ink); box-shadow: var(--hard-sm); }
  body[data-role="driver"] .content, body[data-role="courier"] .content { padding-bottom: 100px; }
  body[data-role="driver"] .toast-wrap, body[data-role="courier"] .toast-wrap { bottom: 92px; }
  body[data-role="driver"] .btn, body[data-role="courier"] .btn { min-height: 44px; }
  body[data-role="driver"] .global-search, body[data-role="courier"] .global-search { display: none; }
  body[data-role="driver"] .header-actions, body[data-role="courier"] .header-actions { margin-right: auto; }

  body.mobile-app .app-tabbar { display: flex; position: fixed; bottom: 0; inset-inline: 0; z-index: 45; background: var(--cream); border-top: 2px solid var(--ink); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  body.mobile-app .app-tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 10px; color: var(--ink); font-size: 11px; font-weight: 800; min-height: 54px; justify-content: center; }
  body.mobile-app .app-tabbar .tb-ic { position: relative; width: 44px; height: 30px; border-radius: 8px; display: grid; place-items: center; transition: .12s; }
  body.mobile-app .app-tabbar .tb-ic svg { width: 22px; height: 22px; }
  body.mobile-app .app-tabbar .tb-ic em { position: absolute; top: -4px; left: 2px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--ink); color: #fff; font-style: normal; font-size: 10px; display: grid; place-items: center; border: 2px solid var(--cream); }
}
@media (max-width: 720px) {
  .kanban-mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-strip { grid-template-columns: minmax(0, 1fr); }
  .occ-row { grid-template-columns: minmax(0, 1fr) 80px 40px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .info-list { grid-template-columns: 1fr; }
  .topbar-app { gap: 8px; padding: 0 14px; height: 66px; }
  .tb-brand b { display: none; }
  .branch-switch { padding: 0 6px; height: 44px; gap: 6px; box-shadow: var(--hard-sm); }
  .branch-switch .bs-meta, .branch-switch .bs-chev { display: none; }
  .branch-menu { right: auto; left: 50%; transform: translate(-50%, -6px); width: min(320px, calc(100vw - 24px)); position: fixed; top: 72px; }
  .branch-drop.open > .branch-menu { transform: translate(-50%, 0); }
  .global-search kbd { display: none; }
  .global-search input { padding-left: 12px; padding-right: 38px; height: 44px; }
  .global-search > svg { right: 11px; }
  .icon-btn { width: 40px; height: 40px; }
  .content { padding: 20px 16px 32px; }
  .page-head h1 { font-size: 24px; }
  .card-pad, .card-body { padding: 18px 16px; }
  .card-head, .toolbar, .card-foot { padding-inline: 16px; }
  .notif-menu { position: fixed; top: 72px; left: 12px; right: 12px; width: auto; }
  .search-results { position: fixed; top: 72px; inset-inline: 12px; }
  #userDrop .dropdown-menu { position: fixed; top: 72px; left: 12px; right: auto; }
  .toast-wrap { left: 16px; right: 16px; bottom: 16px; }
  .toast { max-width: none; min-width: 0; }
  .welcome { padding: 22px 20px; }
  .welcome h2 { font-size: 23px; }
  .header-actions .hide-sm { display: none; }
  .hide-sm { display: none !important; }
  .br-cards { grid-template-columns: minmax(0, 1fr); }
  .assign-sum, .inv-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drv-times { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-head-actions { width: 100%; }
  .next-bar { padding: 14px 16px; }
  .nb-btns { width: 100%; }
  .ov-totals { padding-inline: 16px; }
  .jr-time { margin: 0; }
  .jr-actor { margin: 0; }

  /* Journey collapses into a vertical stack of numbered blocks (phones only) */
  .journey:not(.keep-h) { overflow: visible; padding: 8px 8px 4px 4px; }
  .journey:not(.keep-h) .jr-steps { display: flex; flex-direction: column; min-width: 0; gap: 0; }
  .journey:not(.keep-h) .jr-step { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 14px; text-align: right; padding: 0 0 16px; align-items: start; }
  .journey:not(.keep-h) .jr-step::after { top: 46px; bottom: 0; right: 21px; left: auto; width: 4px; height: auto; background: repeating-linear-gradient(180deg, #c9bfae 0 6px, transparent 6px 11px); }
  .journey:not(.keep-h) .jr-step.current::after { background: repeating-linear-gradient(180deg, var(--orange) 0 8px, var(--ink) 8px 16px); background-size: 4px 32px; animation: none; }
  .journey:not(.keep-h) .jr-step.done::after { background: var(--ink); }
  .journey.dark:not(.keep-h) .jr-step.done::after { background: #fff; }
  .journey:not(.keep-h) .jr-dot { width: 44px; height: 44px; margin: 0; }
  .journey:not(.keep-h) .jr-step.current .jr-dot { transform: rotate(-3deg); }
  .journey:not(.keep-h) .jr-dot svg { width: 19px; height: 19px; }
  .journey:not(.keep-h) .jr-txt { padding-top: 4px; }
  .journey:not(.keep-h) .jr-txt b { font-size: 14px; }
  .journey:not(.keep-h) .jr-txt small, .journey:not(.keep-h) .jr-txt em { display: inline; margin-left: 8px; font-size: 12px; }
  .ov-head h1 { font-size: 22px; }
  .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .otp-inputs input { width: 50px; height: 58px; }
  .action-panel .btns { width: 100%; }
  .action-panel .btns .btn { flex: 1; }
}
@media (max-width: 480px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .kpi { padding: 14px; gap: 10px; }
  .kpi-value { font-size: 23px; letter-spacing: -.4px; }
  .kpi-icon { width: 36px; height: 36px; }
  .kpi-icon svg { width: 18px; height: 18px; }
  .trend { font-size: 11px; padding: 0 6px; }
  .otp-in { width: 50px; height: 56px; }
  .topbar-app { gap: 6px; padding: 0 12px; }
  .tb-brand .brand-mark { width: 34px; height: 34px; }
  .user-btn > svg { display: none; }
  .user-btn { padding: 3px; }
}
@media print {
  .sidebar, .topbar-app, .page-actions, .toolbar, .toast-wrap, .tabbar-app { display: none !important; }
  .main { margin: 0; }
  .card, .btn { box-shadow: none !important; }
  body.printing-invoice > *:not(.modal-backdrop) { display: none !important; }
  body.printing-invoice .modal-backdrop { position: static; background: none; padding: 0; }
  body.printing-invoice .modal { box-shadow: none; max-height: none; transform: none; }
  body.printing-invoice .modal-head, body.printing-invoice .modal-foot { display: none; }
}

/* Product logo (Store Pro) */
.brand-logo { display: block; width: 44px; height: 44px; object-fit: contain; flex-shrink: 0; }
.tb-brand .brand-logo { width: 38px; height: 38px; }
.logo-cp .brand-logo { width: 52px; height: 52px; }
@media (max-width: 480px) { .tb-brand .brand-logo { width: 34px; height: 34px; } }
