/* public/ops-shell.css — the new Chawkidar shell (top bar + side menu + phone bottom bar + theme), 7 Oct 2026.
   Loaded AFTER style.css and sf-theme.css (ops-ds.css comes after this file). EVERY rule that can
   reach the page is scoped to html.ops-ui, which ops-shell.js sets only while the new look is on;
   the unscoped .ops-* rules below style elements that exist only while it is on. With the switch
   off (or this file removed) the app renders exactly as before.
   Layout = the design canvas: canvas/chawkidar.css .topbar/.rail (desktop), canvas/Mobile.dc.html
   (≤1023 px: compact bar + bottom bar). Colours come from the app tokens (--surface, --text1…) and
   the ds tokens of ops-ds.css (--violet, --amber…), so the dark theme follows. */

/* ---------- tokens (light) — beats sf-theme's :root:not([data-theme="dark"]) on specificity ---------- */
html.ops-ui:not([data-theme="dark"]) {
  --primary: #0d7a62; --primary-dark: #0a5446; --primary-light: #e9f6f2;
  --success: #12937a; --success-light: #e9f6f2;
  --warning: #b6400b; --warning-light: #fff3ea;
  --danger: #b42318;  --danger-light: #fdecea;
  --bg: #f3f6f6; --surface: #ffffff; --surface2: #f8fafa;
  --border: #e2e8f0; --border2: #cbd5e1;
  --text1: #0f172a; --text2: #475569; --text3: #5f6e83;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05); --shadow: 0 2px 6px rgba(15,23,42,.07); --shadow-lg: 0 18px 40px rgba(15,23,42,.16);
  --ops-field: #f1f5f9;
}
html.ops-ui[data-theme="dark"] { --primary: #22a585; --primary-dark: #12937a; --primary-light: rgba(34,165,133,.16); --ops-field: #263245; }
html.ops-ui {
  --font: Montserrat, system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius-sm: 8px; --radius: 12px; --radius-lg: 16px; --radius-xl: 20px;
  --ops-top: 64px; --ops-rail: 72px; --ops-rail-open: 252px;
  --header-h: 64px;
}
html.ops-ui body { font-family: var(--font); background: var(--bg); -webkit-font-smoothing: antialiased; }
html.ops-ui .card { border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: none; }
html.ops-ui .btn { border-radius: 10px; font-weight: 600; }

/* ---------- chrome swap: the new bar + menus replace the old header and both old nav bars ---------- */
.ops-topbar, .ops-rail, .ops-scrim, .ops-tabbar { display: none; }
html.ops-ui .app-header { display: none !important; }
/* the OLD bottom nav and its module strip (.bottom-nav > a: #nav-customers / #nav-gpsmaster /
   #nav-transactions) are hidden, NOT removed: modules append to it and the side menu clicks them */
html.ops-ui .bottom-nav { display: none !important; }
html.ops-ui .more-menu.more-menu, html.ops-ui .more-menu[hidden] { display: none !important; }
html.ops-ui .ops-topbar {
  display: flex; align-items: center; gap: 12px;
  position: fixed; top: 0; left: 0; right: 0; height: var(--ops-top); z-index: 110;
  padding: 0 20px 0 10px; background: var(--surface);
  box-shadow: 0 2px 6px rgba(15,23,42,.06); border-bottom: 1px solid var(--border);
}
.ops-ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ops-iconbtn { width: 44px; height: 44px; border: 0; background: transparent; border-radius: 10px; color: var(--text1); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.ops-iconbtn:hover { background: var(--surface2); }
.ops-brand { display: flex; align-items: center; gap: 8px; color: var(--text1); text-decoration: none; cursor: pointer; background: none; border: 0; padding: 0 4px; font-family: inherit; flex: none; }
.ops-brand svg { width: 30px; height: 30px; }
.ops-brand b { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.ops-brand i { font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--primary); background: var(--primary-light); border-radius: 6px; padding: 3px 6px; }

/* organisation (canvas .org-pill) — a label: one organisation, nothing to switch */
.ops-org { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 6px; border-radius: 999px; background: var(--ops-field); font-size: 13px; font-weight: 600; color: var(--text1); white-space: nowrap; flex: none; }
.ops-org-av { width: 28px; height: 28px; border-radius: 50%; background: #0a5446; color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

/* search */
.ops-search { position: relative; flex: 1 1 280px; max-width: 460px; min-width: 0; margin-left: 4px; }
.ops-search label { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border-radius: 10px; background: var(--ops-field); border: 1px solid transparent; color: var(--text3); }
.ops-search label > .ops-ic { width: 18px; height: 18px; }
.ops-search label:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); background: var(--surface); }
.ops-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; font-size: 13.5px; color: var(--text1); }
.ops-search input::placeholder { color: #6b7a8f; }
html.ops-ui[data-theme="dark"] .ops-search input::placeholder { color: var(--text2); }
.ops-search kbd { font: 500 11px/1.4 var(--mono, ui-monospace, Menlo, monospace); color: var(--text2); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; }
.ops-panel { position: absolute; top: 52px; left: 0; right: 0; max-height: min(70vh, 640px); overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 8px; z-index: 120; }
.ops-panel[hidden] { display: none; }
.ops-res { border-radius: 12px; padding: 12px; }
.ops-res + .ops-res { border-top: 1px solid var(--border); border-radius: 0; }
.ops-res-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ops-res-t { font-weight: 700; font-size: 15px; color: var(--text1); }
.ops-mono { font-family: ui-monospace, "IBM Plex Mono", Menlo, monospace; letter-spacing: .02em; }
.ops-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 14px; margin-top: 10px; font-size: 13px; }
.ops-kv span { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text3); }
.ops-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ops-act { min-height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text1); font: 600 13px var(--font); cursor: pointer; }
.ops-act.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.ops-act:hover { border-color: var(--border2); }
.ops-pill { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600; border-radius: 6px; padding: 3px 8px; background: var(--surface2); color: var(--text2); }
.ops-pill.g { background: var(--primary-light); color: var(--primary); }
.ops-pill.a { background: var(--warning-light); color: var(--warning); }
.ops-pill.v { background: #f2edfe; color: #6326c9; }
html.ops-ui[data-theme="dark"] .ops-pill.v { background: rgba(139,92,246,.2); color: #c4b5fd; }
.ops-sec { margin-top: 10px; }
.ops-sec h4 { margin: 0 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text3); }
.ops-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-top: 1px solid var(--border); font-size: 13px; }
.ops-row:first-of-type { border-top: 0; }
.ops-row div { flex: 1; min-width: 0; }
.ops-row small { display: block; color: var(--text3); font-size: 12px; }
.ops-empty { padding: 16px 12px; font-size: 13.5px; color: var(--text2); }
.ops-empty b { display: block; color: var(--text1); font-size: 15px; margin-bottom: 4px; }
.ops-meta { font-size: 11.5px; color: var(--text3); padding: 6px 12px 2px; }

/* right side: Scan · To collect · account */
.ops-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.ops-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text1); font: 600 14px var(--font); cursor: pointer; white-space: nowrap; }
.ops-btn:hover { background: var(--surface2); border-color: var(--border2); }
.ops-btn .ops-ic { width: 18px; height: 18px; stroke-width: 1.9; }
/* To collect (canvas .collect-pill) */
.ops-collect { display: flex; align-items: center; height: 42px; padding: 0; border: 1.5px solid var(--primary); border-radius: 10px; overflow: hidden; background: var(--surface); color: var(--text1); cursor: pointer; font-family: var(--font); white-space: nowrap; }
.ops-collect[hidden] { display: none; }
.ops-collect[data-state="wait"] { visibility: hidden; }  /* holds its place until the first answer */
.ops-collect .cp-l { font-size: 11px; font-weight: 700; color: var(--violet, #6326c9); text-transform: uppercase; letter-spacing: .05em; padding: 0 8px 0 12px; }
.ops-collect .cp-a { font-size: 15px; font-weight: 700; padding-right: 12px; font-variant-numeric: tabular-nums; min-width: calc(4.2em + 12px); text-align: right; }
.ops-collect .cp-go { align-self: stretch; width: 40px; display: flex; align-items: center; justify-content: center; background: var(--primary); color: #fff; }
.ops-collect .cp-go .ops-ic { width: 18px; height: 18px; }
.ops-collect:hover .cp-go { background: var(--primary-dark); }
.ops-avatar { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--g900, #0b3d35); color: #fff; font: 700 13px var(--font); cursor: pointer; flex: none; }
.ops-menu { position: absolute; right: 16px; top: 58px; width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 120; }
.ops-menu[hidden] { display: none; }
.ops-menu button { display: flex; width: 100%; align-items: center; gap: 10px; min-height: 42px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; color: var(--text1); font: 500 14px var(--font); cursor: pointer; text-align: left; }
.ops-menu button:hover { background: var(--surface2); }
.ops-menu .who { padding: 10px; font-size: 13px; color: var(--text3); border-bottom: 1px solid var(--border); margin-bottom: 4px; }

/* ---------- side menu (canvas .rail) ---------- */
html.ops-ui .ops-rail { display: block; position: fixed; top: var(--ops-top); left: 0; bottom: 0; width: var(--ops-rail); z-index: 105; }
.ops-rail-in { height: 100%; width: var(--ops-rail); display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; background: var(--surface); border-right: 1px solid var(--border); overflow-x: hidden; overflow-y: auto; transition: width .18s ease, box-shadow .18s ease; }
.ops-rail:hover .ops-rail-in, .ops-rail.open .ops-rail-in { width: var(--ops-rail-open); box-shadow: 12px 0 32px rgba(15,23,42,.12); }
.ops-item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 13px; border: 0; border-radius: 10px; background: transparent; color: #334155; font: 500 14px var(--font); cursor: pointer; white-space: nowrap; width: 100%; text-align: left; flex: none; }
html.ops-ui[data-theme="dark"] .ops-item { color: var(--text2); }
.ops-item:hover { background: #f1f5f4; }
html.ops-ui[data-theme="dark"] .ops-item:hover { background: var(--surface2); }
.ops-item.on { background: linear-gradient(135deg, #22a585, #0d7a62); color: #fff; font-weight: 600; box-shadow: 0 3px 10px rgba(13,122,98,.25); }
html.ops-ui[data-theme="dark"] .ops-item.on { color: #fff; background: linear-gradient(135deg, #22a585, #0d7a62); }   /* beats the dark :hover above */
.ops-lab { opacity: 0; transition: opacity .12s; }
.ops-count { margin-left: auto; font-size: 11px; font-weight: 700; background: var(--amber50, #fff3ea); color: var(--amber, #b6400b); border-radius: 999px; padding: 2px 8px; opacity: 0; transition: opacity .12s; font-variant-numeric: tabular-nums; }
.ops-count[hidden] { display: none; }
.ops-item.on .ops-count { background: rgba(255,255,255,.22); color: #fff; }
.ops-rail:hover .ops-lab, .ops-rail.open .ops-lab, .ops-rail:hover .ops-count, .ops-rail.open .ops-count { opacity: 1; }
.ops-sub { display: none; padding: 2px 0 6px 47px; }
.ops-rail:hover .ops-sub, .ops-rail.open .ops-sub { display: block; }
.ops-sub button { display: block; width: 100%; text-align: left; border: 0; background: transparent; font: 500 12.5px var(--font); color: var(--text2); padding: 6px 8px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.ops-sub button:hover { background: #f1f5f4; color: var(--text1); }
html.ops-ui[data-theme="dark"] .ops-sub button:hover { background: var(--surface2); }
.ops-sub button.on, html.ops-ui[data-theme="dark"] .ops-sub button.on { color: var(--primary); font-weight: 700; background: var(--primary-light); }
.ops-sep { height: 1px; background: var(--border); margin: 8px 6px; flex: none; }

/* ---------- phone bottom bar (canvas/Mobile.dc.html) — shown ≤1023 px only ---------- */
.ops-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 48px; border: 0; border-radius: 10px; background: transparent; color: var(--text2); font: 600 11px var(--font); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ops-tab.on { color: var(--primary); font-weight: 700; }
.ops-tab-mid { display: flex; justify-content: center; }
.ops-tab-scan { width: 62px; height: 62px; margin-top: -26px; border-radius: 50%; border: 4px solid var(--surface); background: linear-gradient(135deg, #22a585, #0d7a62); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 18px rgba(13,122,98,.35); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ops-tab-scan .ops-ic { width: 26px; height: 26px; }
.ops-tab-scan:active { transform: scale(.96); }

/* ---------- desktop: rail beside the page ---------- */
@media (min-width: 1024px) {
  html.ops-ui .page-content { padding-top: calc(var(--ops-top) + 16px); padding-left: var(--ops-rail); padding-bottom: 32px; max-width: none; margin: 0; }
  html.ops-ui .page-inner { max-width: 1280px; }
  html.ops-ui .ops-mobile-only { display: none !important; }
}
@media (min-width: 1024px) and (max-width: 1199.98px) {
  html.ops-ui .ops-org { display: none; }                 /* keep the search usable on small laptops */
}

/* ---------- phone / tablet: compact bar, search overlay, menu as a drawer, new bottom bar ---------- */
@media (max-width: 1023.98px) {
  html.ops-ui {
    --ops-tab-h: calc(74px + max(10px, env(safe-area-inset-bottom, 0px)));
    --nav-h: var(--ops-tab-h);                              /* anything the app sizes off the old nav clears the new one */
  }
  html.ops-ui .ops-topbar { flex-wrap: nowrap; gap: 4px; padding: 0 10px 0 6px; }
  html.ops-ui .ops-desktop-only { display: none !important; }
  html.ops-ui .ops-brand { padding: 0 2px; }
  html.ops-ui .ops-brand svg { width: 26px; height: 26px; }
  html.ops-ui .ops-brand b { font-size: 18px; }
  html.ops-ui .ops-brand i { display: none; }
  html.ops-ui .ops-right { gap: 4px; }
  html.ops-ui .ops-avatar { width: 36px; height: 36px; font-size: 12px; }
  /* search: an icon in the bar; tapped, the same box opens full width over the bar */
  html.ops-ui .ops-search { display: none; position: static; margin-left: 0; max-width: none; }
  html.ops-ui .ops-search.open { display: flex; align-items: center; gap: 4px; position: fixed; top: 0; left: 0; right: 0; height: var(--ops-top); padding: 0 10px 0 6px; background: var(--surface); z-index: 2; box-shadow: 0 2px 6px rgba(15,23,42,.06); }
  html.ops-ui .ops-search.open label { flex: 1 1 auto; order: 2; }
  html.ops-ui .ops-search.open #ops-search-close { order: 1; }
  html.ops-ui .ops-search kbd { display: none; }
  html.ops-ui .ops-panel { position: fixed; top: calc(var(--ops-top) + 6px); left: 8px; right: 8px; max-height: calc(100dvh - var(--ops-top) - var(--ops-tab-h) - 20px); }
  html.ops-ui .ops-rail { display: none; top: 0; z-index: 130; }
  html.ops-ui .ops-rail.open { display: block; }
  html.ops-ui .ops-rail.open .ops-rail-in { width: min(300px, 86vw); padding-top: 16px; }
  html.ops-ui .ops-scrim.open { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 125; }
  html.ops-ui .ops-tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; height: var(--ops-tab-h);
    padding: 0 6px max(10px, env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--border);
  }
  /* content clears the bar; replaces style.css / sf-theme.css old-nav + module-strip padding */
  html.ops-ui .page-content { padding-top: calc(var(--ops-top) + 8px); padding-bottom: calc(var(--ops-tab-h) + 16px); }
  html.ops-ui body .ds-toast { bottom: calc(var(--ops-tab-h) + 12px); }
}

/* ---------- classic-look invitation (switch is off) ---------- */
.ops-try { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; margin-right: 6px; border-radius: 999px; border: 1px solid #0d7a62; background: #e9f6f2; color: #0a5446; font-weight: 700; font-size: 12px; cursor: pointer; }

/* ---------- details used by ops-shell.js ---------- */
.ops-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ops-sun { display: none; }
html.ops-ui[data-theme="dark"] .ops-sun { display: block; }
html.ops-ui[data-theme="dark"] .ops-moon { display: none; }
.ops-panel[aria-busy] { opacity: .6; transition: opacity .1s; }
.ops-pad { padding: 0 12px 6px; }
.ops-row .ops-act { min-height: 32px; flex: none; }
.ops-menu .who b { color: var(--text1); }
.ops-item:focus-visible, .ops-sub button:focus-visible, .ops-act:focus-visible, .ops-btn:focus-visible, .ops-menu button:focus-visible,
.ops-iconbtn:focus-visible, .ops-avatar:focus-visible, .ops-brand:focus-visible, .ops-collect:focus-visible,
.ops-tab:focus-visible, .ops-tab-scan:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* keyboard users get the labels too (not :focus-within — a mouse click would leave it stuck open) */
.ops-rail:has(:focus-visible) .ops-rail-in { width: var(--ops-rail-open); box-shadow: 12px 0 32px rgba(15,23,42,.12); }
.ops-rail:has(:focus-visible) .ops-lab, .ops-rail:has(:focus-visible) .ops-count { opacity: 1; }
.ops-rail:has(:focus-visible) .ops-sub { display: block; }
/* pinned (desktop, ☰ button): menu stays open and the page makes room for it */
@media (min-width: 1024px) {
  html.ops-ui.ops-pinned .ops-rail { width: var(--ops-rail-open); }
  html.ops-ui.ops-pinned .ops-rail-in { width: var(--ops-rail-open); box-shadow: none; }
  html.ops-ui.ops-pinned .ops-lab, html.ops-ui.ops-pinned .ops-count { opacity: 1; }
  html.ops-ui.ops-pinned .ops-sub { display: block; }
  html.ops-ui.ops-pinned .page-content { padding-left: var(--ops-rail-open); }
}
@media (prefers-reduced-motion: reduce) { .ops-rail-in, .ops-lab, .ops-count { transition: none; } }
