/* Kusumi Care – hệ thống giao diện theo chuẩn Nextling (cấu trúc token Lavender Sky v2 chuyển sang hue xanh ngọc Kusumi #0b6e64; mơ/xanh lá/đỏ giữ phương pháp fill–strong, lib/theme/tokens.dart + docs/design/2026-10-16-ui-audit.md mục 3).
   Quy tắc: mỗi hue có vai trò fill (nền, trang trí) và strong/ink (chữ, nét, icon, nền nút có chữ); chữ chỉ đặt lên cặp đã đo ≥ 4,5:1.
   Bo góc theo thang 8/12/16/20/28/full, khoảng cách 4/8/12/16/20/24/32, chữ hệ thống, vùng chạm 48, chuyển động 150/250 ms easeOutCubic. */

:root {
  --bg: #f4f8f7; --surface: #ffffff; --surface2: #e8efed; --fg: #13232b; --muted: #5b6b70; --outline: #7e8d93; --line: #dce3e1;
  --primary: #0b6e64; --on-primary: #ffffff; --brand: #1f8f84; --primary-soft: #e1f1ee; --primary-ink: #084f48; --primary-line: #a9d6ce;
  --now: #ffb158; --on-now: #13232b; --now-strong: #b97205; --now-ink: #8d5304; --now-soft: #fff1dc; --now-line: #ffe0b3;
  --ok: #5fb56a; --ok-strong: #2e7d32; --ok-ink: #1f5e1d; --ok-soft: #e5f4e4; --ok-line: #b7dfb5;
  --pro: #a885d6; --pro-strong: #7a4fb3; --pro-ink: #5e3a92; --pro-soft: #efeaf7; --pro-line: #d6c8ec;
  --danger: #a8323a; --danger-ink: #8a1c1c; --danger-soft: #fbebeb; --danger-line: #f0c4c4;
  --busy: #e3e9e7;
  --shadow-card: 0 1px 2px rgba(19, 35, 43, .04), 0 8px 24px rgba(19, 35, 43, .06);
  --shadow-float: 0 18px 44px rgba(19, 35, 43, .16);
  --r8: 8px; --r12: 12px; --r16: 16px; --r20: 20px; --r28: 28px; --rfull: 999px;
  --s4: 4px; --s8: 8px; --s12: 12px; --s16: 16px; --s20: 20px; --s24: 24px; --s32: 32px;
  --tap: 48px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --ease: cubic-bezier(.33, 1, .68, 1); --t-short: 150ms; --t-med: 250ms;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15191b; --surface: #1e2426; --surface2: #273031; --fg: #eef3f2; --muted: #aab8b6; --outline: #6f7d7c; --line: #2f3a3b;
    --primary: #4fc1b2; --on-primary: #0f1a19; --brand: #4fc1b2; --primary-soft: #16342f; --primary-ink: #9fe3d9; --primary-line: #1f5a52;
    --now: #f5b36b; --on-now: #15191b; --now-strong: #f5b36b; --now-ink: #f8d2a5; --now-soft: #3a2c1b; --now-line: #4a3a24;
    --ok: #6fc49a; --ok-strong: #6fc49a; --ok-ink: #6fc49a; --ok-soft: #1f4234; --ok-line: #2d5c45;
    --pro: #c5a3ea; --pro-strong: #c5a3ea; --pro-ink: #c5a3ea; --pro-soft: #2f2640; --pro-line: #4a3a60;
    --danger: #e08b82; --danger-ink: #e08b82; --danger-soft: #4c2a38; --danger-line: #6a3a46;
    --busy: #2d3536;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, .3); --shadow-float: 0 18px 44px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
--bg: #15191b; --surface: #1e2426; --surface2: #273031; --fg: #eef3f2; --muted: #aab8b6; --outline: #6f7d7c; --line: #2f3a3b;
  --primary: #4fc1b2; --on-primary: #0f1a19; --brand: #4fc1b2; --primary-soft: #16342f; --primary-ink: #9fe3d9; --primary-line: #1f5a52;
  --now: #f5b36b; --on-now: #15191b; --now-strong: #f5b36b; --now-ink: #f8d2a5; --now-soft: #3a2c1b; --now-line: #4a3a24;
  --ok: #6fc49a; --ok-strong: #6fc49a; --ok-ink: #6fc49a; --ok-soft: #1f4234; --ok-line: #2d5c45;
  --pro: #c5a3ea; --pro-strong: #c5a3ea; --pro-ink: #c5a3ea; --pro-soft: #2f2640; --pro-line: #4a3a60;
  --danger: #e08b82; --danger-ink: #e08b82; --danger-soft: #4c2a38; --danger-line: #6a3a46;
  --busy: #2d3536;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .3); --shadow-float: 0 18px 44px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ---------- nền tảng ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); }
h1, h2, h3, h4, p, ul, ol, dl, figure { margin: 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0ms !important; animation: none !important; } }

/* ---------- chữ ---------- */
.t-display { font-size: 32px; line-height: 38px; font-weight: 700; letter-spacing: -.01em; }
.t-headline { font-size: 24px; line-height: 30px; font-weight: 700; letter-spacing: -.01em; }
.t-title { font-size: 20px; line-height: 26px; font-weight: 600; }
.t-body { font-size: 16px; line-height: 24px; }
.t-callout { font-size: 15px; line-height: 20px; }
.t-label { font-size: 13px; line-height: 18px; font-weight: 600; }
.t-caption { font-size: 12px; line-height: 16px; font-weight: 500; }
.eyebrow { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.strong { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.pre { white-space: pre-line; }
.center { text-align: center; }

/* ---------- bố cục ---------- */
.stack { display: flex; flex-direction: column; gap: var(--s12); }
.stack.g4 { gap: var(--s4); } .stack.g8 { gap: var(--s8); } .stack.g16 { gap: var(--s16); } .stack.g24 { gap: var(--s24); } .stack.g0 { gap: 0; }
.row { display: flex; align-items: center; gap: var(--s8); }
.row.g4 { gap: var(--s4); } .row.g12 { gap: var(--s12); } .row.g16 { gap: var(--s16); }
.row.start { align-items: flex-start; } .row.end { align-items: flex-end; } .row.base { align-items: baseline; }
.between { justify-content: space-between; } .right { justify-content: flex-end; }
.fw { flex-wrap: wrap; } .grow { flex: 1 1 auto; min-width: 0; } .none { flex: 0 0 auto; }
.grid { display: grid; gap: var(--s12); }
.grid.kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fill, minmax(max(min(320px, 100%), calc((100% - var(--s16)) / 2)), 1fr)); gap: var(--s16); align-items: stretch; }
.grid.cols { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s8); }
.grid.fields { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.self-start { align-self: flex-start; }
.mt-auto { margin-top: auto; }

/* ---------- thẻ ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r20); padding: var(--s16); display: flex; flex-direction: column; gap: var(--s12); min-width: 0; }
.card.hero { border-radius: var(--r28); padding: var(--s20); }
.card.tonal { background: var(--primary-soft); border-color: transparent; }
.card.now { background: linear-gradient(160deg, var(--now-soft), var(--now-line) 150%); border-color: transparent; }
.card.ok { background: var(--ok-soft); border-color: transparent; }
.card.pro { background: var(--pro-soft); border-color: transparent; }
.card.dashed { border-style: dashed; border-color: var(--outline); }
.card.flush { padding: 0; overflow: hidden; }
.card.top-accent { border-top: 4px solid var(--primary); }
.inset { background: var(--surface2); border-radius: var(--r12); padding: var(--s12); }
.divided > * + * { border-top: 1px solid var(--line); }

/* ---------- nút ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s8); min-height: var(--tap); padding: 0 var(--s20); border-radius: var(--rfull); border: 1px solid transparent; background: var(--primary); color: var(--on-primary); font-weight: 600; font-size: 16px; line-height: 1.2; text-decoration: none; text-align: center; white-space: nowrap; transition: background var(--t-short) var(--ease), color var(--t-short) var(--ease), transform var(--t-short) var(--ease), border-color var(--t-short) var(--ease); }
.btn:hover { background: var(--primary-ink); }
.btn:active { transform: scale(.98); }
.btn.tonal { background: var(--primary-soft); color: var(--primary-ink); }
.btn.tonal:hover { background: var(--primary-line); }
.btn.ghost { background: var(--surface); color: var(--fg); border-color: var(--outline); }
.btn.ghost:hover { background: var(--surface2); }
.btn.ghost.accent { color: var(--primary); border-color: var(--primary); }
.btn.ghost.accent:hover { background: var(--primary-soft); }
.btn.text { background: transparent; color: var(--primary); padding-inline: var(--s12); }
.btn.text:hover { background: var(--primary-soft); }
.btn.danger { background: var(--surface); color: var(--danger-ink); border-color: var(--danger-line); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.danger.filled { background: var(--danger); color: #ffffff; border-color: transparent; }
.btn.danger.filled:hover { background: var(--danger-ink); }
.btn.now { background: var(--now); color: var(--on-now); }
.btn.now:hover { background: var(--now-line); }
.btn.sm { min-height: 40px; padding: 0 var(--s16); font-size: 14px; }
.btn.xs { min-height: 36px; padding: 0 var(--s12); font-size: 13px; }
.btn.block { width: 100%; }
.btn.tall { min-height: 64px; flex-direction: column; gap: 2px; }
.btn.tall small { font-size: 13px; font-weight: 400; opacity: .85; }
.btn.icon { width: var(--tap); padding: 0; }
.btn.icon.sm { width: 40px; }
.btn.left { justify-content: flex-start; text-align: left; white-space: normal; }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------- chip, nhãn ---------- */
.chip { display: inline-flex; align-items: center; gap: var(--s4); min-height: 24px; padding: 2px 10px; border-radius: var(--rfull); font-size: 12px; line-height: 16px; font-weight: 600; background: var(--surface2); color: var(--muted); white-space: nowrap; border: 1px solid transparent; }
.chip.lg { min-height: 28px; padding: 4px 12px; font-size: 13px; }
.chip.primary { background: var(--primary-soft); color: var(--primary-ink); }
.chip.ok { background: var(--ok-soft); color: var(--ok-ink); }
.chip.now { background: var(--now-soft); color: var(--now-ink); }
.chip.danger { background: var(--danger-soft); color: var(--danger-ink); }
.chip.pro { background: var(--pro-soft); color: var(--pro-ink); }
.chip.outline { background: var(--surface); border-color: var(--line); color: var(--fg); }
.tag { display: inline-flex; align-items: center; align-self: flex-start; gap: var(--s4); padding: 3px 8px; border-radius: var(--r8); font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: var(--primary-soft); color: var(--primary-ink); }
.tag.now { background: var(--now-soft); color: var(--now-ink); }
.tag.pro { background: var(--pro-soft); color: var(--pro-ink); }
.tag.ok { background: var(--ok-soft); color: var(--ok-ink); }
.opt { min-height: 36px; padding: 0 var(--s12); border-radius: var(--rfull); border: 1px solid var(--line); background: var(--surface); color: var(--fg); font-size: 13px; font-weight: 600; }
.opt[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.status-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }

/* ---------- ô nhập ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--fg); }
.input, .select { min-height: var(--tap); padding: 0 var(--s12); border-radius: var(--r12); border: 1px solid var(--outline); background: var(--surface); color: var(--fg); font-weight: 400; font-size: 16px; width: 100%; min-width: 0; }
.input.sm, .select.sm { min-height: 40px; font-size: 14px; }
.input::placeholder { color: var(--muted); }
.input:hover, .select:hover { border-color: var(--fg); }
.select { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6b70' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 10px center; background-size: 20px; }
.help { font-size: 13px; line-height: 18px; color: var(--muted); font-weight: 400; }
.error { color: var(--danger-ink); font-size: 13px; font-weight: 600; }

/* ---------- tab gạch chân ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: var(--s4); border-bottom: 1px solid var(--line); }
.tab { min-height: var(--tap); padding: 0 var(--s16); border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; background: transparent; color: var(--muted); font-weight: 600; display: inline-flex; align-items: center; gap: var(--s8); border-radius: var(--r8) var(--r8) 0 0; transition: color var(--t-short) var(--ease), background var(--t-short) var(--ease); }
.tab:hover { background: var(--surface2); color: var(--fg); }
.tab[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--primary); }
.tab .note { font-size: 12px; font-weight: 500; color: var(--muted); }

/* ---------- bảng ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r20); overflow-x: auto; }
table.kc { width: 100%; border-collapse: collapse; font-size: 14px; }
table.kc th { text-align: left; padding: 12px 16px; font-size: 12px; line-height: 16px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.kc td { padding: 10px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
table.kc tbody tr:first-child td { border-top: 0; }
table.kc.plain { font-size: 14px; }
table.kc.plain th { padding-inline: 8px; } table.kc.plain td { padding-inline: 8px; }
table.kc.plain th:first-child, table.kc.plain td:first-child { padding-left: 0; }
table.kc.plain th:last-child, table.kc.plain td:last-child { padding-right: 0; }
.cell-btn { border: 0; background: none; padding: 0; min-height: 44px; text-align: left; display: flex; flex-direction: column; justify-content: center; color: var(--fg); }
.cell-btn .name { font-weight: 600; color: var(--primary-ink); }
.cell-btn:hover .name { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 900px) {
  .table-wrap.cards { background: transparent; border: 0; overflow: visible; }
  table.kc.cards { min-width: 0 !important; }
  table.kc.cards thead { display: none; }
  table.kc.cards tbody { display: flex; flex-direction: column; gap: var(--s12); }
  table.kc.cards tr { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r16); padding: var(--s12) var(--s16); }
  table.kc.cards td { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 0 !important; border: 0 !important; min-width: 0 !important; white-space: normal !important; text-align: left !important; }
  table.kc.cards td[data-label]::before { content: attr(data-label); font-size: 12px; line-height: 16px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
  table.kc.cards td.full { grid-column: 1 / -1; }
  table.kc.cards td:empty { display: none; }
}

/* ---------- KPI, thông báo, dòng thuộc tính ---------- */
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r16); padding: var(--s16); display: flex; flex-direction: column; gap: 2px; }
.kpi .v { font-size: 28px; line-height: 34px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.banner { border-radius: var(--r16); padding: var(--s12) var(--s16); display: flex; flex-wrap: wrap; gap: var(--s12); align-items: center; justify-content: space-between; border: 1px solid transparent; font-weight: 600; }
.kv { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.kv dt { flex: 0 0 170px; color: var(--muted); font-size: 14px; line-height: 20px; }
.kv dd { margin: 0; flex: 1 1 160px; min-width: 0; font-size: 15px; line-height: 20px; }
.log-row { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; padding: 6px 0; }
.log-row + .log-row { border-top: 1px solid var(--line); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: var(--s8); }
.step { border-radius: var(--r16); padding: var(--s8) var(--s12); display: flex; flex-direction: column; gap: 2px; border: 1px solid transparent; }
.step .n { font-size: 12px; font-weight: 600; } .step .nm { font-size: 13px; font-weight: 600; }
.prog { height: 6px; border-radius: 6px; background: var(--surface2); overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--primary); border-radius: 6px; }
.numdot { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-ink); font-weight: 700; display: grid; place-items: center; flex: none; font-size: 14px; }
.numdot.ok { background: var(--ok-soft); color: var(--ok-ink); } .numdot.now { background: var(--now-soft); color: var(--now-ink); } .numdot.muted { background: var(--surface2); color: var(--muted); }
.bullet { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); flex: none; margin-top: 7px; }
.quote { border-left: 3px solid var(--now-strong); padding-left: var(--s12); font-size: 15px; line-height: 20px; }
.empty-note { color: var(--muted); font-size: 14px; }

/* ---------- icon (mask SVG, theo nét Lucide 24 px) ---------- */
.ic { display: inline-block; width: 24px; height: 24px; flex: none; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.ic.sm { width: 20px; height: 20px; } .ic.xs { width: 16px; height: 16px; }
.ic-home { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 10.5 12 3l9 7.5V20a1 1 0 0 1-1 1h-5v-6h-6v6H4a1 1 0 0 1-1-1z'/></svg>"); }
.ic-records { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='8' y='2' width='8' height='4' rx='1'/><path d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/><path d='M12 11h4M12 16h4M8 11h.01M8 16h.01'/></svg>"); }
.ic-phone { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.127.96.361 1.903.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0 1 22 16.92z'/></svg>"); }
.ic-users { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/><circle cx='9' cy='7' r='4'/><path d='M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75'/></svg>"); }
.ic-grid { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='3' width='7' height='7' rx='1.5'/><rect x='14' y='3' width='7' height='7' rx='1.5'/><rect x='14' y='14' width='7' height='7' rx='1.5'/><rect x='3' y='14' width='7' height='7' rx='1.5'/></svg>"); }
.ic-route { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='6' cy='19' r='3'/><path d='M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15'/><circle cx='18' cy='5' r='3'/></svg>"); }
.ic-sync { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8'/><path d='M21 3v5h-5'/><path d='M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16'/><path d='M8 16H3v5'/></svg>"); }
.ic-menu { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M4 6h16M4 12h16M4 18h16'/></svg>"); }
.ic-close { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M18 6 6 18M6 6l12 12'/></svg>"); }
.ic-left { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m15 18-6-6 6-6'/></svg>"); }
.ic-right { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m9 18 6-6-6-6'/></svg>"); }
.ic-back { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m12 19-7-7 7-7M19 12H5'/></svg>"); }
.ic-arrow { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12h14m-7-7 7 7-7 7'/></svg>"); }
.ic-logout { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/><path d='m16 17 5-5-5-5M21 12H9'/></svg>"); }
.ic-check { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6 9 17l-5-5'/></svg>"); }
.ic-plus { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12h14M12 5v14'/></svg>"); }
.ic-doc { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z'/><path d='M14 2v5h5M16 13H8M16 17H8M10 9H8'/></svg>"); }
.ic-alert { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M12 8v4M12 16h.01'/></svg>"); }
.ic-heart { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z'/><path d='M3.22 12H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27'/></svg>"); }
.ic-monitor { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='2' y='3' width='20' height='14' rx='2'/><path d='M8 21h8M12 17v4'/></svg>"); }
.ic-mobile { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='5' y='2' width='14' height='20' rx='2'/><path d='M12 18h.01'/></svg>"); }
.ic-calendar { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M8 2v4M16 2v4'/><rect x='3' y='4' width='18' height='18' rx='2'/><path d='M3 10h18'/></svg>"); }
.ic-download { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3'/></svg>"); }
.ic-siren { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M7 18v-6a5 5 0 1 1 10 0v6'/><path d='M5 21a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-1a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2z'/><path d='M21 12h1M2 12h1M12 2v1M4.93 4.93l.7.7M18.37 5.63l.7-.7'/></svg>"); }
.ic-send { --i: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m22 2-7 20-4-9-9-4Z'/><path d='M22 2 11 13'/></svg>"); }
.ic-box { width: 44px; height: 44px; border-radius: var(--r12); background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: none; }
.ic-box.now { background: var(--now-soft); color: var(--now-strong); } .ic-box.ok { background: var(--ok-soft); color: var(--ok-strong); } .ic-box.pro { background: var(--pro-soft); color: var(--pro-strong); } .ic-box.danger { background: var(--danger-soft); color: var(--danger); }

/* ---------- khung dashboard ---------- */
.shell { min-height: 100vh; display: flex; }
.side { flex: 0 0 auto; width: 272px; background: var(--surface); border-right: 1px solid var(--line); padding: var(--s20) var(--s16); display: flex; flex-direction: column; gap: var(--s24); position: sticky; top: 0; height: 100vh; overflow: auto; transition: width var(--t-short) var(--ease), padding var(--t-short) var(--ease); }
.side.closed { width: 76px; padding-inline: var(--s12); }
.brand { display: flex; align-items: center; justify-content: space-between; gap: var(--s8); min-height: var(--tap); }
.brand .who { display: flex; align-items: center; gap: var(--s12); min-width: 0; }
.logo { width: 40px; height: 40px; border-radius: var(--r12); background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font-weight: 800; font-size: 18px; flex: none; letter-spacing: -.02em; }
.brand .ttl { display: flex; flex-direction: column; min-width: 0; }
.brand .ttl b { font-size: 16px; line-height: 20px; white-space: nowrap; }
.brand .ttl span { font-size: 12px; line-height: 16px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; flex-direction: column; gap: var(--s4); }
.nav-item { position: relative; display: flex; align-items: center; gap: var(--s12); min-height: var(--tap); padding: 0 var(--s12); border-radius: var(--r16); border: 0; background: transparent; color: var(--fg); font-weight: 500; text-align: left; width: 100%; transition: background var(--t-short) var(--ease), color var(--t-short) var(--ease); }
.nav-item:hover { background: var(--surface2); }
.nav-item[aria-current="page"] { background: var(--primary-soft); color: var(--primary-ink); font-weight: 600; }
.nav-item .ic { color: var(--muted); }
.nav-item[aria-current="page"] .ic { color: var(--primary); }
.nav-item .lbl { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-dot { position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--now-strong); }
.side.closed .nav-item { justify-content: center; padding: 0; }
.sub-nav { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 var(--s8) var(--s24); padding-left: var(--s12); border-left: 1px solid var(--line); }
.sub-item { min-height: 40px; padding: 0 var(--s12); border-radius: var(--r12); border: 0; background: transparent; text-align: left; font-size: 14px; color: var(--muted); }
.sub-item:hover { background: var(--surface2); color: var(--fg); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: var(--s12); }
.side-user { display: flex; flex-direction: column; font-size: 13px; line-height: 18px; padding: 0 var(--s4); }
.side-user b { font-weight: 600; } .side-user span { color: var(--muted); }
.main { flex: 1 1 0; min-width: 0; padding: var(--s24) var(--s32) var(--s32); display: flex; flex-direction: column; gap: var(--s24); }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: var(--s12); }
.page-head .t-headline { margin-top: 2px; }
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--s24); background: radial-gradient(900px 500px at 20% -10%, var(--primary-soft), transparent 60%), radial-gradient(700px 420px at 100% 100%, var(--now-soft), transparent 60%), var(--bg); }
.login .card { width: 460px; max-width: 100%; box-shadow: var(--shadow-float); }
.acct { display: flex; align-items: center; gap: var(--s12); min-height: 64px; padding: var(--s8) var(--s12); border-radius: var(--r16); border: 1px solid var(--line); background: var(--surface); text-align: left; width: 100%; color: var(--fg); transition: border-color var(--t-short) var(--ease), background var(--t-short) var(--ease); }
.acct:hover { background: var(--primary-soft); border-color: var(--primary-line); }
.acct .av { width: 40px; height: 40px; border-radius: 50%; background: var(--surface2); color: var(--primary-ink); font-weight: 700; display: grid; place-items: center; flex: none; font-size: 14px; }
.acct b { display: block; font-size: 15px; line-height: 20px; }
.acct span { display: block; font-size: 13px; line-height: 18px; color: var(--muted); }
.acct .ic { margin-left: auto; color: var(--outline); }
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .side { position: sticky; height: auto; width: 100% !important; border-right: 0; border-bottom: 1px solid var(--line); padding: var(--s8) var(--s16); gap: var(--s8); z-index: 20; overflow: visible; }
  .side.closed { flex-direction: row; align-items: center; }
  .side.closed .brand { display: none; }
  .side.closed .nav { flex-direction: row; flex: 1 1 auto; justify-content: space-around; }
  .side.closed .nav-item { min-height: 44px; width: auto; padding: 0 var(--s8); }
  .side.closed .side-foot { margin-top: 0; }
  .main { padding: var(--s16); gap: var(--s16); }
  .page-head .t-headline { font-size: 22px; line-height: 28px; }
  .kv dt { flex-basis: 100%; }
}

/* ---------- khung điện thoại (app demo) ---------- */
.phone-page { min-height: 100vh; display: flex; justify-content: center; align-items: flex-start; padding: 72px 0 var(--s32); background: var(--surface2); }
.phone { width: 390px; height: 844px; border-radius: 44px; background: var(--bg); box-shadow: var(--shadow-float); overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--line); position: relative; }
.back-link { position: fixed; left: 16px; top: 16px; z-index: 10; }
@media (max-width: 500px) { .phone-page { padding: 0; background: var(--bg); } .phone { width: 100%; height: 100vh; height: 100dvh; border-radius: 0; box-shadow: none; border: 0; } .back-link { left: auto; right: 12px; top: 12px; width: 40px; padding: 0; } .back-link .lbl { display: none; } .app-head { padding-right: 64px; } }
.app-head { padding: var(--s24) var(--s20) var(--s8); display: flex; flex-direction: column; gap: var(--s4); }
.app-head .t-display { font-size: 28px; line-height: 34px; }
.app-main { flex: 1 1 auto; overflow-y: auto; padding: var(--s8) var(--s20) var(--s24); display: flex; flex-direction: column; gap: var(--s12); }
.tabbar { display: flex; background: var(--surface); border-top: 1px solid var(--line); padding: var(--s8) var(--s8) var(--s16); }
.tabbar button { flex: 1 1 0; min-height: 56px; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--muted); border-radius: var(--r16); }
.tabbar .pill { width: 56px; height: 30px; border-radius: var(--rfull); display: grid; place-items: center; transition: background var(--t-short) var(--ease); }
.tabbar button[aria-current="page"] { color: var(--primary-ink); }
.tabbar button[aria-current="page"] .pill { background: var(--primary-soft); color: var(--primary); }
.seg { display: flex; gap: var(--s4); background: var(--surface2); padding: var(--s4); border-radius: var(--r16); }
.seg button { flex: 1 1 0; min-height: var(--tap); border: 0; border-radius: var(--r12); background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; transition: background var(--t-short) var(--ease), color var(--t-short) var(--ease); }
.seg button b { font-weight: 600; font-size: 15px; } .seg button span { font-size: 12px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-card); }
.list-btn { display: flex; align-items: center; gap: var(--s12); text-align: left; border: 0; background: transparent; padding: var(--s12) 0; width: 100%; color: var(--fg); }
.list-btn .date { flex: none; min-width: 60px; text-align: center; border-radius: var(--r8); padding: 6px; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.list-btn .ic { margin-left: auto; color: var(--outline); }
.kvm { display: flex; flex-direction: column; gap: 2px; }
.kvm span:first-child { font-size: 13px; line-height: 18px; color: var(--muted); }
.kvm span:last-child { font-weight: 600; font-size: 15px; line-height: 20px; }
.metric { flex: 1 1 0; background: var(--surface2); border-radius: var(--r12); padding: var(--s12); display: flex; flex-direction: column; }
.metric span { font-size: 13px; color: var(--muted); } .metric b { font-size: 22px; line-height: 28px; font-weight: 800; letter-spacing: -.02em; }
.consent { display: flex; justify-content: space-between; align-items: center; gap: var(--s12); min-height: 56px; padding: var(--s8) var(--s12); border-radius: var(--r12); border: 1px solid var(--line); background: var(--surface2); text-align: left; width: 100%; color: var(--fg); font-size: 15px; line-height: 20px; }
.vax { display: flex; gap: var(--s12); align-items: center; padding: var(--s12) 0; }
.vax .mark { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; flex: none; font-size: 14px; }
.toast { background: var(--ok-soft); color: var(--ok-ink); border-radius: var(--r12); padding: var(--s12); font-weight: 600; font-size: 15px; line-height: 20px; }
