/* Foodics Store Console: Google Play Console look and feel, Foodics colors.
   Brand: Foodics Cashier design system (Primary400 #440099). Light by default, dark follows the OS. */
:root {
  --brand: #440099; --brand-hover: #3a0085; --brand-soft: #f1eafb; --brand-line: #e1d6ff; --on-brand: #ffffff;
  --bg: #ffffff; --surface: #ffffff; --surface-2: #f1f3f4; --surface-3: #e8eaed; --hover: #f6f6f8;
  --text: #1f1f1f; --muted: #5f6368; --faint: #80868b; --border: #dadce0; --line: #f1f3f4;
  --ok: #188038; --ok-soft: #e6f4ea; --warn: #b06000; --warn-soft: #fef7e0; --bad: #c5221f; --bad-soft: #fce8e6;
  --shadow: 0 1px 3px rgba(60,64,67,.3), 0 4px 8px 3px rgba(60,64,67,.15);
  --font: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Roboto Mono", ui-monospace, monospace;
  --top: 64px; --nav: 272px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #c4b2ff; --brand-hover: #d6c9ff; --brand-soft: #2b2140; --brand-line: #45366b; --on-brand: #1d0b45;
    --bg: #131314; --surface: #1e1f20; --surface-2: #28292a; --surface-3: #333537; --hover: #232326;
    --text: #e3e3e3; --muted: #a8abaf; --faint: #8e918f; --border: #3c4043; --line: #2a2b2d;
    --ok: #6dd58c; --ok-soft: #0f2e1a; --warn: #fdd663; --warn-soft: #3a2e0c; --bad: #f2b8b5; --bad-soft: #3c1513;
    --shadow: 0 4px 12px rgba(0,0,0,.6);
  }
}
:root[data-theme="dark"] {
  --brand: #c4b2ff; --brand-hover: #d6c9ff; --brand-soft: #2b2140; --brand-line: #45366b; --on-brand: #1d0b45;
  --bg: #131314; --surface: #1e1f20; --surface-2: #28292a; --surface-3: #333537; --hover: #232326;
  --text: #e3e3e3; --muted: #a8abaf; --faint: #8e918f; --border: #3c4043; --line: #2a2b2d;
  --ok: #6dd58c; --ok-soft: #0f2e1a; --warn: #fdd663; --warn-soft: #3a2e0c; --bad: #f2b8b5; --bad-soft: #3c1513;
  --shadow: 0 4px 12px rgba(0,0,0,.6);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.45 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
svg { fill: currentColor; }
h1, h2, h3 { margin: 0; font-weight: 400; }
code, .mono { font-family: var(--mono); font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
pre { margin: 0; padding: 12px 14px; background: var(--surface-2); border-radius: 8px; font: 12.5px/1.5 var(--mono); overflow: auto; white-space: pre-wrap; word-break: break-all; }
details summary { cursor: pointer; color: var(--brand); font-weight: 500; }
input, textarea, select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 9px 12px; outline: none; min-width: 0; }
input:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
textarea { min-height: 84px; resize: vertical; }
input[type=checkbox] { accent-color: var(--brand); width: 16px; height: 16px; }
input[type=file] { padding: 7px; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; }
.error { color: var(--bad); } .link { color: var(--brand); font-weight: 500; }
.row { display: flex; align-items: center; gap: 12px; } .between { justify-content: space-between; } .wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; } .stack { display: flex; flex-direction: column; gap: 16px; }
.section { margin-top: 24px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 16px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
a.brand { display: flex; align-items: center; gap: 10px; min-width: calc(var(--nav) - 32px); font-size: 20px; color: var(--muted); white-space: nowrap; }
a.brand b { color: var(--text); font-weight: 500; }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; background: #440099; display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 20px; fill: #fff; }
.brand-mark.big { width: 56px; height: 56px; border-radius: 14px; } .brand-mark.big svg { width: 32px; }
.gsearch { flex: 1; max-width: 720px; height: 46px; display: flex; align-items: center; gap: 12px; padding: 0 16px; border-radius: 8px; background: var(--surface-2); color: var(--muted); }
.gsearch:focus-within { background: var(--surface); box-shadow: var(--shadow); }
.gsearch svg { width: 20px; flex: none; }
.gsearch input { border: 0; background: none; box-shadow: none; padding: 0; flex: 1; height: 100%; }
.top-right { margin-inline-start: auto; display: flex; align-items: center; gap: 12px; }
.live { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); }
.live.on { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.avatar { width: 32px; height: 32px; border-radius: 50%; border: 0; background: #440099; color: #fff; font: 500 14px var(--font); display: grid; place-items: center; cursor: pointer; }
.avatar.big { width: 40px; height: 40px; font-size: 16px; }
.icon-btn.nav-toggle { display: none; }

/* ---------- layout + left nav ---------- */
.layout { display: flex; min-height: calc(100vh - var(--top)); }
.sidenav { width: var(--nav); flex: none; border-inline-end: 1px solid var(--border); padding-block: 12px 32px; padding-inline: 0 12px; position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; background: var(--surface); }
.view { flex: 1; min-width: 0; padding: 24px 40px 64px; max-width: 1320px; }
.nav-back { display: flex; align-items: center; gap: 8px; padding: 8px 24px; color: var(--muted); font-size: 13px; }
.nav-back:hover { color: var(--brand); }
.nav-back svg { width: 18px; }
.appsel { position: relative; margin: 4px 0 12px 12px; }
.appsel > button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.appsel > button:hover { background: var(--hover); }
.appsel .n { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appsel .s { font: 12px var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appsel .caret { margin-inline-start: auto; width: 20px; color: var(--muted); flex: none; }
.appsel .menu-list { inset-inline: 0; top: calc(100% + 4px); }
.nav-group { font-size: 12px; font-weight: 500; color: var(--muted); padding: 18px 24px 6px; }
.nav-item { display: flex; align-items: center; gap: 16px; height: 40px; padding: 0 16px 0 24px; border-radius: 0 20px 20px 0; color: var(--text); cursor: pointer; }
.nav-item svg { width: 20px; color: var(--muted); flex: none; }
.nav-item:hover { background: var(--hover); }
.nav-item.on { background: var(--brand-soft); color: var(--brand); font-weight: 500; }
.nav-item.on svg { color: var(--brand); }
.nav-item.sub { padding-inline-start: 60px; height: 36px; font-size: 13.5px; }
.nav-item.off { color: var(--faint); cursor: default; } .nav-item.off:hover { background: none; }
.nav-item.head { cursor: default; } .nav-item.head:hover { background: none; }
.nav-item .count { margin-inline-start: auto; font-size: 12px; color: var(--muted); }
.soon { margin-inline-start: auto; font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 10px; padding: 0 7px; line-height: 18px; font-weight: 400; }
.scrim { display: none; }

/* ---------- page head ---------- */
.crumbs { display: flex; gap: 8px; color: var(--muted); font-size: 13px; margin-bottom: 8px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--brand); }
.crumbs > * + *::before { content: "›"; margin-inline-end: 8px; color: var(--faint); }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head > div:first-child { flex: 1 1 320px; min-width: 0; }
.page-head > .row { flex: none; }
.page-head h1 { font-size: 28px; line-height: 36px; }
.page-head .sub { color: var(--muted); margin-top: 2px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 20px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); color: var(--brand); font: 500 14px var(--font); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--brand-soft); }
.btn svg { width: 18px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-hover); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.btn.ghost { border-color: transparent; background: none; }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.danger { color: var(--bad); } .btn.danger:hover { background: var(--bad-soft); }
.btn.sm { height: 32px; padding: 0 14px; font-size: 13px; }
.btn.big { height: 40px; padding: 0 24px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; box-shadow: none; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; color: var(--muted); display: inline-grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--hover); }
.icon-btn svg { width: 22px; }

/* ---------- chips, status ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--muted); white-space: nowrap; vertical-align: middle; }
.chip.ok { background: var(--ok-soft); color: var(--ok); } .chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); } .chip.brand { background: var(--brand-soft); color: var(--brand); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.status.on::before, .status.ok::before { background: var(--ok); } .status.on { color: var(--ok); }
.status.warn::before { background: var(--warn); } .status.bad::before { background: var(--bad); }
.status.warn, .status.bad { color: var(--text); }

/* ---------- cards, KPIs, tracks ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--border); }
.card-head h2 { font-size: 16px; font-weight: 500; }
.card-body { padding: 16px 24px; }
.card .empty { padding: 32px 24px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.grid-eq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 24px; background: var(--surface); }
.kpi { padding: 16px 24px; border-inline-end: 1px solid var(--border); min-width: 0; }
.kpi:last-child { border-inline-end: 0; }
.kpi .k { color: var(--muted); font-size: 13px; }
.kpi .v { font-size: 24px; margin-top: 4px; }
.kpi .v small { font-size: 14px; color: var(--muted); }
.kpi .d { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi .d.ok { color: var(--ok); } .kpi .d.warn { color: var(--warn); }
a.kpi:hover { background: var(--hover); }
.tracks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.track { padding: 16px 24px; }
.track .t { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.track .v { font-size: 22px; margin: 6px 0 2px; }
.track .m { color: var(--muted); font-size: 13px; }
.track.soon-card { border-style: dashed; background: none; }
.track.soon-card .v { color: var(--faint); }
.banner { display: flex; align-items: center; gap: 16px; padding: 14px 24px; border-radius: 8px; background: var(--brand-soft); margin-bottom: 24px; flex-wrap: wrap; }
.banner.ok { background: var(--ok-soft); }
.banner b { color: var(--brand); font-weight: 500; } .banner.ok b { color: var(--ok); }
.banner .grow > div:last-child { font-size: 13px; color: var(--muted); }
.bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin: 10px 0 6px; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 3px; }
.bar.warn i { background: var(--warn); } .bar.bad i { background: var(--bad); }
.note { padding: 12px 16px; border-radius: 8px; background: var(--brand-soft); font-size: 13.5px; }
.note.warn { background: var(--warn-soft); }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.empty h3 { font-size: 16px; font-weight: 500; color: var(--text); margin-bottom: 6px; }

/* ---------- tables, lists ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { font-size: 12px; font-weight: 500; color: var(--muted); text-align: start; padding: 10px 24px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 24px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--hover); }
td.num, th.num { text-align: end; }
.actions-cell { text-align: end; white-space: nowrap; }
.cell-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-main .t, td .t { font-weight: 500; }
.cell-main .s, td .s { font-size: 12.5px; color: var(--muted); }
.list-item { display: flex; align-items: center; gap: 16px; padding: 14px 24px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { background: var(--hover); }
.list-item .t { font-weight: 500; } .list-item .s { font-size: 12.5px; color: var(--muted); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 24px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.search-box { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 18px; color: var(--muted); min-width: 240px; }
.search-box svg { width: 18px; }
.search-box input { border: 0; padding: 0; box-shadow: none; background: none; flex: 1; }
.filters { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.filters button { height: 32px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 500 13px var(--font); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.filters button.on { background: var(--brand-soft); border-color: var(--brand-soft); color: var(--brand); }
.filters .n { color: var(--muted); font-weight: 400; }
.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 10px 16px; }
.kv > div:nth-child(odd) { color: var(--muted); }

/* ---------- icons ---------- */
.app-icon { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; display: grid; place-items: center; color: #fff; font-weight: 500; font-size: 18px; flex: none; background: var(--surface-3); }
.app-icon svg { width: 60%; }
.app-icon.xs { width: 28px; height: 28px; border-radius: 7px; font-size: 13px; }
.app-icon.sm { width: 36px; height: 36px; border-radius: 9px; }
.app-icon.md { width: 48px; height: 48px; border-radius: 12px; }
.app-icon.lg { width: 64px; height: 64px; border-radius: 16px; font-size: 26px; }
.app-icon.xl { width: 96px; height: 96px; border-radius: 22px; font-size: 40px; }
.dev-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.dev-icon svg { width: 20px; }
.dev-icon.lg { width: 56px; height: 56px; border-radius: 14px; } .dev-icon.lg svg { width: 30px; }
.dev-hero { display: flex; align-items: center; gap: 16px; }
.dev-hero .meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 4px; align-items: center; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; overflow-x: auto; }
.tabs button { height: 48px; padding: 0 16px; border: 0; background: none; font: 500 14px var(--font); color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }

/* ---------- device page blocks ---------- */
.health { display: grid; grid-template-columns: repeat(4, 1fr); }
.health > div { padding: 16px 24px; border-inline-end: 1px solid var(--border); min-width: 0; }
.health > div:last-child { border-inline-end: 0; }
.health .k { color: var(--muted); font-size: 13px; } .health .v { font-size: 20px; margin-top: 4px; } .health .v small { font-size: 13px; color: var(--muted); }
.verdict { display: flex; gap: 14px; align-items: center; padding: 16px 24px; border-bottom: 1px solid var(--border); }
.verdict h2 { font-size: 16px; font-weight: 500; }
.verdict .ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.verdict .ico svg { width: 24px; }
.verdict .ico.ok { background: var(--ok-soft); color: var(--ok); } .verdict .ico.warn { background: var(--warn-soft); color: var(--warn); } .verdict .ico.bad { background: var(--bad-soft); color: var(--bad); }
.checks { padding: 8px 24px 16px; }
.check { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.check:last-child { border-bottom: 0; } .check .k { color: var(--muted); }
.side { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.group-title { font-size: 12px; font-weight: 500; color: var(--muted); padding: 16px 24px 4px; text-transform: uppercase; letter-spacing: .5px; }
.setting, .action-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 24px; border-bottom: 1px solid var(--line); }
.setting:last-child, .action-row:last-child { border-bottom: 0; }
.setting .t, .action-row .t { font-weight: 500; } .setting .s, .action-row .s { font-size: 12.5px; color: var(--muted); }
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 10px; background: var(--surface-3); border: 2px solid var(--faint); cursor: pointer; transition: .15s; }
.switch span::after { content: ""; position: absolute; inset-inline-start: 2px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--faint); transition: .15s; }
.switch input:checked + span { background: var(--brand); border-color: var(--brand); }
.switch input:checked + span::after { inset-inline-start: 18px; background: var(--on-brand); }
.switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- menus ---------- */
.menu { position: relative; display: inline-block; }
.menu-list { display: none; position: absolute; inset-inline-end: 0; top: calc(100% + 4px); z-index: 40; min-width: 220px; padding: 6px 0; background: var(--surface); border-radius: 8px; box-shadow: var(--shadow); text-align: start; }
.menu.open > .menu-list { display: block; }
.menu-list button, .menu-list a { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 16px; border: 0; background: none; color: var(--text); font: 14px var(--font); text-align: start; cursor: pointer; }
.menu-list button:hover, .menu-list a:hover { background: var(--hover); }
.menu-list button svg { width: 18px; color: var(--muted); }
.menu-list .danger { color: var(--bad); }
.menu-head { display: flex; gap: 12px; align-items: center; padding: 10px 16px; }

/* ---------- forms, modals, toast, login ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.field input, .field textarea, .field select { font-weight: 400; font-size: 14px; }
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(32,33,36,.6); display: grid; place-items: center; padding: 16px; }
.modal-card { width: min(560px, 100%); max-height: 90vh; overflow: auto; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); }
.m-head { padding: 24px 24px 8px; } .m-head h2 { font-size: 22px; }
.m-head.row { align-items: center; }
.m-body { padding: 16px 24px; }
.m-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 24px 20px; }
.pick { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.pick:hover { background: var(--hover); }
.toast { position: fixed; inset-inline-start: 24px; bottom: 24px; z-index: 60; background: #313033; color: #f4eff4; padding: 14px 20px; border-radius: 4px; box-shadow: var(--shadow); max-width: 480px; }
.login { position: fixed; inset: 0; z-index: 70; background: var(--surface-2); display: grid; place-items: center; padding: 16px; }
.login-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 40px 36px; display: flex; flex-direction: column; gap: 20px; }
.login-card h1 { font-size: 24px; margin-bottom: 6px; }

/* ---------- enroll ---------- */
.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.qr { display: inline-block; padding: 12px; background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.qr img, .qr canvas { display: block; }

/* ---------- report charts (plan P2-07b) ----------
   Categorical colors in a fixed order (checked for colour-blind separation on these surfaces, light and dark);
   "Other" is gray. Text never wears a series color. */
:root { --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948; --s-other: #9aa0a6; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #0ca30c; --s7: #9085e9; --s8: #e66767; --s-other: #80868b; }
}
:root[data-theme="dark"] { --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #0ca30c; --s7: #9085e9; --s8: #e66767; --s-other: #80868b; }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .base { stroke: var(--border); stroke-width: 1; }
.chart text { fill: var(--muted); font: 11px var(--font); }
.chart .hit { fill: transparent; }
.chart .cross { stroke: var(--faint); stroke-width: 1; visibility: hidden; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12.5px; color: var(--text); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend b { color: var(--muted); font-weight: 400; }
.chart-tip { position: fixed; z-index: 60; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--shadow); padding: 8px 12px; font-size: 12.5px; line-height: 1.5; max-width: 260px; }
.chart-tip .row { gap: 6px; }
.chart-tip i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* ---------- app listing pieces ---------- */
.listing-head { display: flex; gap: 20px; align-items: center; }
.notes { white-space: pre-wrap; }
.copy-row { display: flex; gap: 12px; align-items: flex-start; }
.copy-row .mono { word-break: break-all; flex: 1; font-size: 12.5px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid-2, .grid-eq { grid-template-columns: 1fr; }
  .kpis, .health { grid-template-columns: repeat(2, 1fr); }
  .kpi:nth-child(2), .health > div:nth-child(2) { border-inline-end: 0; }
  .kpi:nth-child(-n+2), .health > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .tracks { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .icon-btn.nav-toggle { display: inline-grid; }
  a.brand { min-width: 0; flex: none; } .brand-text { display: none; }
  .gsearch { padding: 0 12px; } .top-right { gap: 8px; }
  .sidenav { position: fixed; inset-inline-start: 0; top: var(--top); z-index: 25; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  body.nav-open .sidenav { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: var(--top) 0 0 0; z-index: 20; background: rgba(32,33,36,.4); }
  .view { padding: 20px 16px 48px; }
  .hide-sm { display: none; }
  th, td { padding: 10px 12px; }
  .card-head, .card-body, .toolbar, .list-item, .setting, .action-row { padding-inline: 16px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv > div:nth-child(even) { margin-bottom: 10px; }
}
.appsel.menu { display: block; }
.banner .grow { flex: 1 1 240px; }

/* Plan P1-05a: controls the user's role can't use, and the password re-check dialog. */
.no-perm, .no-perm:hover, .no-cap, .no-cap:hover { opacity: .45; cursor: not-allowed; }
.cap-warn { outline: 1px dashed #b26a00; outline-offset: 1px; }
dialog.reauth { border: 0; padding: 0; width: min(420px, calc(100vw - 32px)); }
dialog.reauth::backdrop { background: rgba(0, 0, 0, .4); }

/* Plan P2-05b: a button that looks like inline text (saved-view chips). */
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }

/* Plan P2-09: right-to-left (Arabic). Layout above uses start/end, so it mirrors by itself; these are the exceptions. */
[dir="rtl"] .crumbs > * + *::before { content: "‹"; }
[dir="rtl"] .nav-back svg { transform: scaleX(-1); }
.chart, .chart-tip { direction: ltr; }               /* dates run left to right in charts in both languages */
.mono, code, pre, input[type="email"], .ltr { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .mono { text-align: start; }
[dir="rtl"] body { font-family: var(--font-ar, "Noto Sans Arabic", "Segoe UI", Tahoma, var(--font)); }
@media (max-width: 900px) {
  [dir="rtl"] .sidenav { transform: translateX(100%); }
  [dir="rtl"] body.nav-open .sidenav { transform: none; }
}
/* Data cells take their direction from their own text, so "0.7.0-fake" or "T3 PRO" read correctly inside Arabic pages. */
[dir="rtl"] td, [dir="rtl"] .kv > div, [dir="rtl"] .cell-main .t, [dir="rtl"] .cell-main .s, [dir="rtl"] .kpi .v, [dir="rtl"] .chip { unicode-bidi: plaintext; text-align: right; }
[dir="rtl"] td.num, [dir="rtl"] .actions-cell { text-align: left; }

@media (max-width: 900px) { .tabs button { padding: 0 12px; } }

/* Plan P6-03: live screen viewer */
.screen-viewer { position: fixed; inset: 0; z-index: 1000; background: rgba(15, 18, 25, .92); display: flex; flex-direction: column; }
.screen-bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--surface, #fff); color: var(--text, #111); }
.screen-stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 16px; min-height: 0; }
.screen-stage canvas { max-width: 100%; max-height: 100%; background: #000; border-radius: 8px; touch-action: none; }
.screen-note { padding: 8px 16px; background: #fff8e1; color: #5d4300; font-size: 13px; }
