/* JTAT demo — shared design system (internal app, driver app, print pages).
   Tokens first; components below. Keep module CSS in the module's own <style> block
   or a separate file; do not restyle these primitives per module. */
:root {
  --brand-900: #1b5e20; --brand-800: #2e7d32; --brand-700: #388e3c; --brand-500: #4caf50;
  --brand-300: #81c784; --brand-100: #e8f5e9; --brand-50: #f3faf3;

  --ink: #17201a; --ink-2: #3d4a41; --muted: #6b7a70; --faint: #9aa79e;
  --line: #e3e8e4; --line-2: #d3dad5; --surface: #ffffff; --ground: #f5f7f5; --hover: #f0f4f1;

  /* status (reserved: never reuse as series colours) */
  --good: #1f8a4c; --good-bg: #e6f4ec;
  --warn: #9a6400; --warn-bg: #fff4dc;
  --serious: #c2410c; --serious-bg: #ffeddf;
  --critical: #b42318; --critical-bg: #fde8e7;
  --info: #1e5fae; --info-bg: #e7f0fb;

  /* data viz — validated categorical order (blue, orange, green) and an ordinal ramp
     for "how late" (light -> dark orange). Use in this order; never cycle. */
  --cat-1: #2a78d6; --cat-2: #eb6834; --cat-3: #1baf7a; --cat-4: #8b5cf6;
  --seq-1: #fde9d9; --seq-2: #f9c49b; --seq-3: #f0905a; --seq-4: #d6602a; --seq-5: #9c3d14;
  --grid: #e9edea; --axis: #b8c2bb;

  --r-sm: 6px; --r: 10px; --r-lg: 14px;
  --shadow-1: 0 1px 2px rgba(16, 32, 20, .06), 0 1px 1px rgba(16, 32, 20, .04);
  --shadow-2: 0 6px 24px rgba(16, 32, 20, .10), 0 2px 6px rgba(16, 32, 20, .06);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-ar: "IBM Plex Sans Arabic", "Geeza Pro", "Noto Naskh Arabic", Tahoma, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sidebar-w: 232px;
}

* { box-sizing: border-box; }
/* The hidden attribute always wins: .btn, label.field and other display rules must not show a hidden element. */
[hidden] { display: none !important; }
/* Visually hidden, still read by screen readers (labels for icon-only controls). */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
html, body { height: 100%; }
body { margin: 0; font: 14px/1.45 var(--font); color: var(--ink); background: var(--ground); -webkit-font-smoothing: antialiased; }
[lang="ar"], .ar, [dir="rtl"] { font-family: var(--font-ar); }
a { color: var(--brand-800); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; color: var(--ink); }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 14.5px; font-weight: 650; }
p { margin: 0 0 8px; }
small, .small { font-size: 12.5px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
[dir="rtl"] .num { text-align: left; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

/* ---------- layout: app shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { background: #0f2f17; color: #d7e8da; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand img { height: 34px; background: #fff; border-radius: 8px; padding: 3px 6px; }
.sidebar .brand .t1 { font-weight: 700; color: #fff; font-size: 14px; letter-spacing: .2px; }
.sidebar .brand .t2 { font-size: 11.5px; color: #9fc4a6; }
.nav { padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow: auto; }
.nav .sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .9px; color: #7fa588; padding: 12px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: #d7e8da; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.nav a.active { background: #2e7d32; color: #fff; }
.nav a .ico { width: 18px; text-align: center; opacity: .9; }
.nav a .count { margin-left: auto; background: rgba(255,255,255,.14); border-radius: 10px; padding: 0 7px; font-size: 11.5px; }
.nav a.active .count { background: rgba(255,255,255,.25); }
.sidebar .foot { padding: 12px 16px; font-size: 11px; color: #7fa588; border-top: 1px solid rgba(255,255,255,.08); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .titles { min-width: 0; }
.topbar .titles .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.topbar .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.demo-ribbon { background: #fff8e1; color: #7a5a00; font-size: 12px; padding: 5px 24px; border-bottom: 1px solid #f3e3b0; }
.demo-ribbon .rb-short { display: none; }
@media (max-width: 600px) { .demo-ribbon { padding: 4px 16px; } .demo-ribbon .rb-long { display: none; } .demo-ribbon .rb-short { display: inline; } }
.page { padding: 20px 24px 48px; max-width: 1480px; width: 100%; }
@media (max-width: 600px) {
  .topbar { position: static; padding: 12px 16px; flex-wrap: wrap; }
  .topbar .actions { margin-left: 0; width: 100%; }
  .topbar .actions .btn { height: 30px; padding: 0 10px; font-size: 12.5px; }
  h1 { font-size: 19px; }
}
.nav-toggle { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  /* phones and tablets: a compact brand bar that stays on top, with the menu behind a Menu button */
  .sidebar { position: sticky; top: 0; height: auto; z-index: 30; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
  .sidebar.open { max-height: 100vh; max-height: 100dvh; overflow: auto; }
  .sidebar .brand { padding: 9px 12px 9px 16px; border-bottom: 0; }
  .sidebar .brand img { height: 30px; }
  .sidebar .brand .t2 { display: none; }
  .nav-toggle { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; height: 36px; padding: 0 12px; border-radius: 9px;
    border: 1px solid rgba(255,255,255,.24); background: transparent; color: #fff; font: 600 13.5px var(--font); cursor: pointer; position: relative; }
  .nav-toggle:hover, .sidebar.open .nav-toggle { background: rgba(255,255,255,.1); }
  .nav-toggle:focus-visible { outline: 2px solid var(--brand-300); outline-offset: 1px; }
  .nav-toggle .bars { width: 16px; height: 12px; display: inline-block; background:
    linear-gradient(currentColor, currentColor) 0 0 / 100% 2px no-repeat, linear-gradient(currentColor, currentColor) 0 5px / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) 0 10px / 100% 2px no-repeat; }
  .sidebar.open .nav-toggle .bars { background: none; position: relative; }
  .sidebar.open .nav-toggle .bars::before, .sidebar.open .nav-toggle .bars::after { content: ""; position: absolute; left: 0; top: 5px; width: 100%; height: 2px;
    background: currentColor; transform: rotate(45deg); }
  .sidebar.open .nav-toggle .bars::after { transform: rotate(-45deg); }
  .sidebar:not(.open) .nav, .sidebar:not(.open) .foot { display: none; }
  .nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); flex: none; overflow: visible; padding: 4px 8px 10px; border-top: 1px solid rgba(255,255,255,.08); }
  .nav .sec { grid-column: 1 / -1; padding: 10px 10px 2px; }
  .nav a { padding: 10px; min-width: 0; }
  .topbar { position: relative; }
  .page { padding: 16px; }
}

/* ---------- grid helpers ---------- */
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.tight { gap: 6px; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-side { grid-template-columns: minmax(0, 1fr) 360px; }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g-side { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.spacer { flex: 1; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }

/* ---------- card / tile ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card > .hd { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.card > .hd .sub { color: var(--muted); font-size: 12.5px; }
.card > .bd { padding: 16px; }
.card > .bd.flush { padding: 0; }
.card > .ft { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--shadow-1); }
.tile .lbl { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.tile .val { font-size: 24px; font-weight: 680; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.tile .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.tile.accent { border-color: var(--brand-300); background: linear-gradient(180deg, #fff, var(--brand-50)); }
a.tile { transition: border-color .12s, box-shadow .12s; }
a.tile:hover { border-color: var(--brand-300); box-shadow: var(--shadow-2); text-decoration: none; }
@media (max-width: 700px) {
  .grid.g4.tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid.tiles > .tile { padding: 12px; }
  .grid.tiles > .tile .val { font-size: 20px; }
  .grid.tiles > .tile .lbl, .grid.tiles > .tile .sub { font-size: 12px; }
}

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 500 13.5px var(--font); cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand-800); border-color: var(--brand-800); color: #fff; }
.btn.primary:hover { background: var(--brand-900); }
.btn.danger { color: var(--critical); border-color: #f2c4c0; }
.btn.danger:hover { background: var(--critical-bg); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn.lg { height: 42px; padding: 0 18px; font-size: 15px; }
.btn.block { width: 100%; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 8px 8px 0; }
.btn-group .btn.on { background: var(--brand-100); border-color: var(--brand-300); color: var(--brand-900); z-index: 1; }
input[type=text], input[type=search], input[type=number], input[type=email], input[type=tel], input[type=date], input[type=password], select, textarea {
  height: 34px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; color: var(--ink); font: 13.5px var(--font); min-width: 0; }
textarea { height: auto; padding: 8px 10px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--brand-300); outline-offset: 1px; border-color: var(--brand-500); }
a:focus-visible, .chip:focus-visible, .tabs a:focus-visible, .tabs button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--brand-300); outline-offset: 2px; border-radius: 6px; }
.nav a:focus-visible { outline-color: var(--brand-300); outline-offset: -2px; }
input[type=checkbox]:focus, input[type=radio]:focus { outline-offset: 2px; }
input.sm, select.sm { height: 28px; font-size: 12.5px; padding: 0 8px; }
input.num-in { text-align: right; font-variant-numeric: tabular-nums; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
label.check { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; cursor: pointer; }
.search { position: relative; }
.search input { padding-left: 30px; width: 100%; }
.search::before { content: "⌕"; position: absolute; left: 10px; top: 50%; transform: translateY(-52%); color: var(--faint); font-size: 16px; }

/* ---------- table ---------- */
.table-wrap { overflow: auto; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.t th { position: sticky; top: 0; background: #f8faf8; color: var(--ink-2); font-weight: 600; text-align: left; font-size: 12px;
  padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1; }
table.t td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover td { background: #fafcfa; }
table.t tr.click { cursor: pointer; }
table.t tr.sel td { background: var(--brand-50); }
table.t tfoot td { font-weight: 650; background: #f8faf8; border-top: 1px solid var(--line-2); }
table.t.compact td, table.t.compact th { padding: 6px 10px; }
[dir="rtl"] table.t th { text-align: right; }
/* numeric columns: the header sits over its right-aligned figures (table.t th above is more specific than th.num) */
table.t th.num { text-align: right; }
[dir="rtl"] table.t th.num { text-align: left; }

/* ---------- badges / chips / misc ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 8px; border-radius: 11px; font-size: 11.5px; font-weight: 600;
  background: #eef1ef; color: var(--ink-2); white-space: nowrap; }
.badge.good { background: var(--good-bg); color: var(--good); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.serious { background: var(--serious-bg); color: var(--serious); }
.badge.critical { background: var(--critical-bg); color: var(--critical); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.brand { background: var(--brand-100); color: var(--brand-900); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 14px; border: 1px solid var(--line-2);
  background: #fff; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--brand-800); color: #fff; border-color: var(--brand-800); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--faint); }
.dot.good { background: var(--good); } .dot.warn { background: #e0a100; } .dot.critical { background: var(--critical); } .dot.info { background: var(--info); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.bar { height: 8px; background: #edf1ee; border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand-700); border-radius: 4px; }
.bar.warn > i { background: #e0a100; } .bar.critical > i { background: var(--critical); }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty .big { font-size: 30px; margin-bottom: 6px; }
.thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: #f1f4f2; border: 1px solid var(--line); flex: none; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a, .tabs button { padding: 9px 14px; border: 0; background: none; font: 500 13.5px var(--font); color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs .on { color: var(--brand-900); border-bottom-color: var(--brand-700); }
.callout { border-radius: var(--r); padding: 12px 14px; background: var(--info-bg); color: #18406f; font-size: 13px; }
.callout.good { background: var(--good-bg); color: #165c34; }
.callout.warn { background: var(--warn-bg); color: #6b4700; }
.callout.critical { background: var(--critical-bg); color: #7d1a12; }
.kbd { font-family: var(--mono); font-size: 11.5px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: #fff; }
.dropzone { border: 2px dashed var(--line-2); border-radius: var(--r-lg); padding: 28px; text-align: center; background: #fbfdfb; color: var(--muted); cursor: pointer; }
.dropzone.over { border-color: var(--brand-500); background: var(--brand-50); color: var(--brand-900); }
.spinner { width: 18px; height: 18px; border: 2px solid var(--brand-100); border-top-color: var(--brand-700); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- overlays ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(15, 30, 20, .42); display: flex; align-items: flex-start; justify-content: center; z-index: 160; padding: 6vh 16px; overflow: auto; overscroll-behavior: contain; }
html.overlay-open, html.overlay-open body { overflow: hidden; }
.modal { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-2); width: min(560px, 100%); }
.modal.wide { width: min(920px, 100%); }
.modal .hd { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal .bd { padding: 16px 18px; max-height: 70vh; overflow: auto; }
.modal .ft { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.drawer-back { position: fixed; inset: 0; background: rgba(15, 30, 20, .3); z-index: 90; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: #fff; z-index: 91; box-shadow: var(--shadow-2); display: flex; flex-direction: column; }
.drawer .hd { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.drawer .bd { padding: 16px 18px; overflow: auto; flex: 1; overscroll-behavior: contain; }
.modal .hd h2, .drawer .hd h2 { min-width: 0; overflow-wrap: anywhere; }
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: #17201a; color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow-2); font-size: 13px; max-width: 380px; }
.toast.good { background: #165c34; } .toast.critical { background: #8f1d14; } .toast.warn { background: #7a5200; }
.toast { animation: toast-in .18s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }
@media (max-width: 600px) {
  .modal-back { padding: 12px 10px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .modal .hd, .modal .bd, .modal .ft { padding-left: 14px; padding-right: 14px; }
  .modal .bd { max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); }
  .drawer .hd, .drawer .bd { padding-left: 14px; padding-right: 14px; }
  .toasts { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .toast { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { .toast, a.tile { animation: none; transition: none; } }

/* ---------- charts (SVG) ---------- */
.chart text { font: 11px var(--font); fill: var(--muted); }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--axis); stroke-width: 1; }
.chart .lbl-strong { fill: var(--ink); font-weight: 600; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tooltip { position: fixed; pointer-events: none; background: #17201a; color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 7px; z-index: 300; box-shadow: var(--shadow-2); }

/* ---------- print ---------- */
@media print {
  .no-print, .sidebar, .topbar, .demo-ribbon, .toasts { display: none !important; }
  body { background: #fff; }
  .page { padding: 0; }
  .card { box-shadow: none; }
}

/* ---------- office sign-in: user menu, role note, no-access page (app shell) ---------- */
.sidebar [hidden], .role-note[hidden] { display: none !important; }
.nav[data-auth="pending"] a, .nav[data-auth="pending"] .sec { visibility: hidden; }
.sidebar .foot { display: flex; flex-direction: column; gap: 10px; }
.sidebar .foot .proto { font-size: 11px; color: #7fa588; }
.user-menu { display: flex; flex-direction: column; gap: 8px; }
.user-menu .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-menu .min0 { min-width: 0; }
.user-menu .nm { color: #fff; font-size: 13px; font-weight: 600; }
.user-menu .rl { color: #9fc4a6; font-size: 11.5px; line-height: 1.35; }
.user-menu .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-800); color: #fff; display: inline-flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.btn.side { background: transparent; color: #d7e8da; border-color: rgba(255,255,255,.22); }
.btn.side:hover { background: rgba(255,255,255,.08); }
.role-note { margin: 16px 24px 0; padding: 9px 14px; border-radius: var(--r); background: var(--info-bg); color: #18406f; font-size: 13px; max-width: 1432px; }
.no-access { max-width: 560px; margin: 6vh auto 0; text-align: center; }
.no-access .big { font-size: 30px; margin-bottom: 6px; }
@media (max-width: 900px) {
  .role-note { margin: 12px 16px 0; }
  .user-menu { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
}

/* ---------- sign-in page (/login) ---------- */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 16px;
  background: radial-gradient(900px 520px at 0% 0%, var(--brand-100) 0%, rgba(232,245,233,0) 70%), var(--ground); }
.login-shell { width: min(1000px, 100%); display: grid; grid-template-columns: 340px minmax(0, 1fr); background: var(--surface);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-2); overflow: hidden; }
.login-side { background: #0f2f17; color: #d7e8da; padding: 28px 26px; display: flex; flex-direction: column; gap: 20px; }
.login-logo { background: #fff; border-radius: 14px; padding: 12px 16px; }
.login-logo img { display: block; width: 100%; max-width: 250px; margin: 0 auto; }
.login-side h1 { color: #fff; font-size: 22px; }
.login-side .ar-title { font-size: 18px; color: #cfe6d3; margin-top: 2px; text-align: left; }
.login-side ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; font-size: 13px; }
.login-side li { display: flex; gap: 9px; }
.login-side li::before { content: "✓"; color: var(--brand-300); font-weight: 700; }
.login-side .note { margin-top: auto; font-size: 11.5px; color: #9fc4a6; }
.login-main { padding: 28px 30px 22px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.login-main h2 { font-size: 20px; }
.login-main h2 .ar { font-weight: 500; color: var(--muted); font-size: 17px; }
.acct-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.acct { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; text-align: left;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font: inherit; color: inherit; }
.acct:hover { border-color: var(--brand-300); background: var(--brand-50); }
.acct:focus-visible { outline: 2px solid var(--brand-300); outline-offset: 1px; }
.acct .avatar { width: 40px; height: 40px; font-size: 16px; }
.acct .nm { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
.acct .nm b { font-weight: 650; }
.acct .nm .ar { font-size: 13px; color: var(--muted); }
.acct .what { display: block; font-size: 12px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.acct .pin { font: 700 14px var(--mono); color: var(--brand-900); background: var(--brand-100); border-radius: 8px; padding: 4px 8px; letter-spacing: 1.5px; direction: ltr; }
.acct .pin.hidden-pin { color: var(--muted); background: #eef1ef; letter-spacing: 0; font: 600 11.5px var(--font); }
.acct.busy { opacity: .6; pointer-events: none; }
.login-or { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; }
.login-or::before, .login-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.login-form { display: grid; grid-template-columns: minmax(0, 1fr) 140px auto; gap: 10px; align-items: end; }
.login-form select, .login-form input { width: 100%; }
.login-err { min-height: 18px; color: var(--critical); font-size: 13px; margin-top: -6px; }
.login-foot { font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
@media (max-width: 860px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-side { padding: 18px 20px; gap: 12px; flex-direction: row; align-items: center; }
  .login-logo { padding: 6px 10px; flex: none; width: 132px; }
  .login-side ul, .login-side .note { display: none; }
  .login-side h1 { font-size: 18px; }
  .login-side .ar-title { font-size: 15px; }
}
@media (max-width: 560px) {
  .login-body { padding: 0; align-items: stretch; }
  .login-shell { border-radius: 0; border: 0; box-shadow: none; }
  .login-main { padding: 20px 16px; }
  .acct-grid, .login-form { grid-template-columns: 1fr; }
  .login-form .btn { height: 40px; }
}
