/* SMART-WORK · giao diện Enterprise SaaS: sidebar trên máy tính, bottom-nav + bottom sheet trên điện thoại (PWA).
   Màu nhận diện theo logo SMART Software: đỏ #ED1C24 (SMART), cam #F47920 (SOFTWARE), xám than (dòng chữ phụ).
   - Đỏ gốc/cam gốc chỉ dùng cho mảng thương hiệu (logo, dải màu, trang đăng nhập) — chữ trắng trên đỏ gốc chỉ đạt 4.4:1.
     Nút/menu đang chọn dùng --primary, link/viền focus dùng --accent (đỏ đậm hơn, đạt WCAG AA).
   - Cam (--brand-*) cho điểm nhấn phụ: avatar, thanh tiến độ, biểu đồ, mốc timeline.
   - Trạng thái dùng ok/warn/info/review/bad — không dùng accent cho trạng thái (sẽ lẫn với đỏ "Quá hạn"). */
:root {
  color-scheme: light;
  --brand-red: #ED1C24; --brand-orange: #F47920;
  --brand-grad: linear-gradient(90deg, var(--brand-red) 0%, var(--brand-orange) 100%);
  --bg: #F6F6F7; --surface: #FFFFFF; --ink: #1C1C21; --muted: #5E6068; --line: #E2E2E7;
  --side: #1C1D21; --side-ink: #ECECEF; --side-muted: #A3A5AD; --side-hover: #2B2C32;
  --primary: #D3121A; --primary-ink: #FFFFFF; --primary-hover: #B30F16;
  --field-border: #8E9099; --field-hover: #5E6068; --ring: color-mix(in srgb, var(--accent) 24%, transparent);
  --toast-bg: #1C1D21; --bad-solid: #A8201A;
  --accent: #C8111A; --accent-soft: #FDE9E9;
  --brand-soft: #FEEBDD; --brand-ink: #A84A0A;
  --review: #6A3DB8; --review-soft: #EEE7FA;
  --ok: #1D7439; --ok-soft: #DDF1E3; --warn: #8A5200; --warn-soft: #FAEACB;
  --bad: #B3261E; --bad-soft: #FADFDC; --info: #2A569F; --info-soft: #DDE7F7;
  --series-1: #E0640B; --bar-track: #EFEFF2;
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --r: 12px; --sidebar: 248px;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #121214; --surface: #1C1C20; --ink: #EDEDF0; --muted: #A2A3AB; --line: #2F3036;
    --side: #0D0D0F; --side-hover: #232328; --side-muted: #9C9EA6;
    --primary: #D7191F; --primary-hover: #B8141A; --accent: #FF7B80; --accent-soft: #3D1B1D;
    --field-border: #6A6C75; --field-hover: #8A8C95; --toast-bg: #2B2C32;
    --brand-soft: #3A2516; --brand-ink: #FFB27A;
    --review: #C5A8F7; --review-soft: #2D2442;
    --ok: #6FD08C; --ok-soft: #173623; --warn: #F0BC62; --warn-soft: #3D2E10;
    --bad: #FF8A80; --bad-soft: #44201D; --info: #8FB4F2; --info-soft: #1B2C49;
    --series-1: #F5893A; --bar-track: #2A2B31;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121214; --surface: #1C1C20; --ink: #EDEDF0; --muted: #A2A3AB; --line: #2F3036;
  --side: #0D0D0F; --side-hover: #232328; --side-muted: #9C9EA6;
  --primary: #D7191F; --primary-hover: #B8141A; --accent: #FF7B80; --accent-soft: #3D1B1D;
    --field-border: #6A6C75; --field-hover: #8A8C95; --toast-bg: #2B2C32;
  --brand-soft: #3A2516; --brand-ink: #FFB27A;
  --review: #C5A8F7; --review-soft: #2D2442;
  --ok: #6FD08C; --ok-soft: #173623; --warn: #F0BC62; --warn-soft: #3D2E10;
  --bad: #FF8A80; --bad-soft: #44201D; --info: #8FB4F2; --info-soft: #1B2C49;
  --series-1: #F5893A; --bar-track: #2A2B31;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
h1 { font-size: 21px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 15.5px; font-weight: 700; margin: 0; }
h3 { font-size: 15px; margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.boot, .empty { padding: 24px 14px; text-align: center; color: var(--muted); font-size: 14px; }
.boot::before { content: ""; display: block; width: 26px; height: 26px; margin: 0 auto 10px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .boot::before { animation-duration: 2.4s; } }
::selection { background: color-mix(in srgb, var(--brand-orange) 30%, transparent); }
.empty { border: 1px dashed var(--line); border-radius: var(--r); background: var(--surface); }

/* ---------------- Shell ---------------- */
.shell { min-height: 100%; display: flex; }
/* Dải màu thương hiệu đỏ → cam trên cùng màn hình (nằm dưới hộp thoại: .overlay z-index 40). */
.shell::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: 3px; background: var(--brand-grad); z-index: 35; pointer-events: none; }
.sidebar { width: var(--sidebar); flex: none; background: var(--side); color: var(--side-ink); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.brand img { width: 36px; height: 36px; padding: 5px; background: #fff; border-radius: 10px; box-sizing: border-box; flex-shrink: 0; }
.brand b { display: block; font-size: 17px; letter-spacing: .01em; }
.brand small { display: block; font-size: 10.5px; color: var(--side-muted); letter-spacing: .06em; text-transform: uppercase; }
.nav-group { padding: 6px 10px; }
.nav-group .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--side-muted); padding: 10px 10px 4px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--side-ink); font-size: 14px; font-weight: 500; }
.nav-link:hover { background: var(--side-hover); text-decoration: none; }
.nav-link.active { background: var(--primary); color: var(--primary-ink); box-shadow: inset 3px 0 0 var(--brand-orange); }
.nav-link svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav-link .badge { margin-left: auto; }
.nav-link.active .badge { background: #fff; color: var(--primary); }
.sidebar-foot { margin-top: auto; padding: 14px 18px; font-size: 12px; color: var(--side-muted); border-top: 1px solid rgba(255,255,255,.08); }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 10px 20px; min-height: 58px; }
.topbar .mobile-brand { display: none; align-items: center; gap: 8px; font-weight: 700; }
.topbar .mobile-brand img { width: 28px; height: 28px; }
.topbar .spacer { flex: 1; }
.tenant-select { min-height: 38px; padding: 0 32px 0 10px; border-radius: 9px; border: 1px solid var(--line); background-color: var(--surface); max-width: 240px; font-size: 14px; font-weight: 500; }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink);
  transition: background-color .15s, border-color .15s; }
.icon-btn:hover { border-color: var(--field-border); background: color-mix(in srgb, var(--ink) 4%, var(--surface)); text-decoration: none; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .badge { position: absolute; top: -6px; right: -6px; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.user-chip b { color: var(--ink); font-weight: 600; display: block; font-size: 13.5px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
main.content { padding: 18px 20px 90px; display: flex; flex-direction: column; gap: 16px; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.bottom-nav { display: none; }

/* ---------------- Building blocks ---------------- */
.sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sec-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.count { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.tile .n { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; overflow-wrap: anywhere; }
.tile .n.sm { font-size: clamp(16px, 1.45vw, 19px); line-height: 1.5; white-space: nowrap; }
.tile .l { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.tile.bad .n { color: var(--bad); } .tile.warn .n { color: var(--warn); } .tile.ok .n { color: var(--ok); }
/* Ô bấm được là thẻ <a>: giữ số màu chữ thường (không ăn màu link đỏ — dễ nhầm với "Quá hạn"). */
.tile.link { cursor: pointer; color: var(--ink); text-decoration: none; }
.tile.link:hover { border-color: var(--accent); } .tile.link:hover .l { color: var(--accent); }
.bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.bar > .grow { flex: 1; min-width: 160px; }
.hint { font-size: 13px; color: var(--muted); }
.meta { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.meta b { color: var(--ink); font-weight: 600; }
.note { font-size: 13.5px; background: var(--bg); border-radius: 8px; padding: 8px 10px; overflow-wrap: anywhere; white-space: pre-wrap; }
.note .lbl { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.err { color: var(--bad); font-size: 13.5px; }
.sheet > .err { background: var(--bad-soft); border-left: 4px solid var(--bad); border-radius: 8px; padding: 10px 12px; font-weight: 500; }
.stale { color: var(--bad); font-weight: 600; }
.num, table.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Pills, chips, badges */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.info { background: var(--info-soft); color: var(--info); }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.accent { background: var(--accent-soft); color: var(--accent); } .pill.review { background: var(--review-soft); color: var(--review); }
.pill.plain { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.badge { background: var(--primary); color: var(--primary-ink); border-radius: 999px; font-size: 11px; min-width: 19px; height: 19px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 4px 6px 4px 10px; font-size: 13px; font-weight: 600; }
.chip.plain { padding: 4px 10px; background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
.chip button { border: 0; background: none; color: inherit; font-size: 16px; line-height: 1; min-width: 24px; min-height: 24px; cursor: pointer; }
.stats { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------------- Nút bấm ----------------
   primary = hành động chính (đỏ thương hiệu, mỗi vùng 1 nút) · mặc định = nút phụ · danger = thao tác phá hủy (viền đỏ;
   nút xác nhận "primary danger" → nền đỏ đậm chữ trắng) · add = thêm dòng (viền đứt) · ghost = nút chữ. */
.btn { min-height: 42px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover:not(:disabled) { border-color: var(--field-border); background: color-mix(in srgb, var(--ink) 4%, var(--surface)); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); box-shadow: 0 1px 2px color-mix(in srgb, var(--primary) 30%, transparent); }
.btn.primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 28%, transparent); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, var(--line)); }
.btn.danger:hover:not(:disabled) { background: var(--bad-soft); border-color: var(--bad); }
.btn.primary.danger { background: var(--bad-solid); border-color: var(--bad-solid); color: #fff; box-shadow: none; }
.btn.primary.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--bad-solid) 85%, #000); border-color: color-mix(in srgb, var(--bad-solid) 85%, #000); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 6%, transparent); border-color: transparent; color: var(--ink); }
.btn.add { border-style: dashed; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--accent); background: transparent; }
.btn.add:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--accent); }
.btn.small { min-height: 36px; font-size: 13.5px; padding: 0 12px; border-radius: 9px; }
.btn.block { width: 100%; }
/* Icon trong nút: mỗi nút chức năng có icon đứng trước chữ (Icon.razor, stroke = màu chữ). */
.btn.small svg { width: 16px; height: 16px; }
.link-btn.danger svg, .link-btn.with-ic svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.seg button svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 5px; }
.spinner { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--accent); font-weight: 600; cursor: pointer; text-align: left; border-radius: 4px; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.link-btn.muted { color: var(--muted); font-weight: 500; text-decoration: underline; font-size: 13px; }
.link-btn.danger { color: var(--bad); font-weight: 500; font-size: 13px; text-decoration: underline; }

/* ---------------- Form ----------------
   Viền ô nhập --field-border đạt 3:1 (WCAG 1.4.11); focus = viền đỏ + vầng sáng --ring. Bộ chọn có độ ưu tiên thấp
   (input:where(...)) để lớp riêng như .auth-input, .tenant-select ghi đè được. */
.fld { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink); font-weight: 600; min-width: 0; }
.fld-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
input:where(:not([type=checkbox], [type=radio], [type=range], [type=hidden], [type=file], [type=color], [type=submit], [type=button], [type=reset])), select, textarea {
  width: 100%; font-size: 15px; font-weight: 400; padding: 9px 11px; border: 1px solid var(--field-border); border-radius: 9px; background-color: var(--surface); color: var(--ink); min-height: 42px;
  transition: border-color .15s, box-shadow .15s; }
input:where(:not([type=checkbox], [type=radio], [type=range], [type=hidden], [type=file], [type=color], [type=submit], [type=button], [type=reset])):hover, select:hover, textarea:hover { border-color: var(--field-hover); }
input:where(:not([type=checkbox], [type=radio], [type=range], [type=hidden], [type=file], [type=color], [type=submit], [type=button], [type=reset])):focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
::placeholder { color: var(--muted); opacity: .8; }
input:disabled, select:disabled, textarea:disabled, input[readonly] { background-color: var(--bg); color: var(--muted); cursor: not-allowed; }
[aria-invalid=true] { border-color: var(--bad) !important; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238E9099' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
input[type=date]::-webkit-calendar-picker-indicator, input[type=month]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .6; }
input[type=date]:hover::-webkit-calendar-picker-indicator, input[type=month]:hover::-webkit-calendar-picker-indicator { opacity: 1; }
textarea { resize: vertical; min-height: 64px; line-height: 1.45; }
input[type=checkbox], input[type=radio], input[type=range] { accent-color: var(--primary); }
input[type=range] { width: 100%; }
.chk { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink); min-height: 32px; cursor: pointer; }
.chk input { width: 18px; height: 18px; flex: none; cursor: pointer; }
/* ---------------- DateField: ô ngày (+ giờ) có lịch tiếng Việt ----------------
   Ô nhập gõ được (dd/mm/yyyy hh:mm) + nút lịch; popup position: fixed (JS smartwork.placePop), mobile thành bảng dưới đáy. */
.df-wrap { display: inline-block; min-width: 0; }
.df { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.df-box { position: relative; display: block; }
.df-box .df-input { padding-right: 76px; font-variant-numeric: tabular-nums; }
.df-month .df-input { min-width: 150px; }
.df-wrap .df-input { min-width: 170px; }
.df-btn, .df-clear { position: absolute; top: 50%; translate: 0 -50%; width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background-color .15s, color .15s; }
.df-btn { right: 4px; } .df-clear { right: 38px; width: 30px; }
.df-btn svg { width: 19px; height: 19px; } .df-clear svg { width: 15px; height: 15px; }
.df-btn:hover:not(:disabled), .df-btn[aria-expanded=true] { background: var(--accent-soft); color: var(--accent); }
.df-clear:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }
.df-btn:disabled { opacity: .4; cursor: not-allowed; }
.df-err { color: var(--bad); font-size: 12.5px; font-weight: 500; }
.df-backdrop { position: fixed; inset: 0; z-index: 70; background: transparent; }
.df-pop { position: fixed; top: -9999px; left: 0; z-index: 71; width: 328px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 18px 48px rgba(0,0,0,.22); padding: 12px; display: flex; flex-direction: column; gap: 8px; font-weight: 400; font-size: 14px; }
.df-head { display: flex; align-items: center; gap: 4px; }
.df-nav { width: 36px; height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.df-nav svg { width: 18px; height: 18px; }
.df-nav:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.df-title { flex: 1; height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); font-weight: 700; font-size: 15px; cursor: pointer; text-align: center; display: inline-flex; align-items: center; justify-content: center; }
.df-title:not(.static):hover { background: var(--accent-soft); color: var(--accent); }
.df-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.df-week span { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.df-week span:last-child { color: var(--accent); }
.df-day { height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); font-size: 14px; cursor: pointer; font-variant-numeric: tabular-nums; }
.df-day:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.df-day.df-sun { color: var(--accent); }
.df-day.df-out { color: var(--muted); opacity: .55; }
.df-day.df-today, .df-mon.df-today { box-shadow: inset 0 0 0 1.5px var(--brand-orange); font-weight: 700; }
.df-day[aria-selected=true], .df-mon[aria-selected=true],
.df-day[aria-selected=true]:hover:not(:disabled), .df-mon[aria-selected=true]:hover:not(:disabled) { background: var(--primary); color: var(--primary-ink); font-weight: 700; opacity: 1; }
.df-day:disabled, .df-mon:disabled { opacity: .3; cursor: not-allowed; }
.df-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.df-mon { height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 14px; cursor: pointer; }
.df-mon:hover:not(:disabled) { border-color: var(--field-border); background: color-mix(in srgb, var(--ink) 4%, var(--surface)); }
.df-time-row { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.df-time-row select { width: 76px; min-height: 38px; padding: 6px 28px 6px 10px; font-variant-numeric: tabular-nums; background-position: right 7px center; }
.df-lbl { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; margin-right: auto; }
.df-lbl svg { width: 17px; height: 17px; color: var(--muted); }
.df-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.df-chips button { min-height: 32px; padding: 0 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 13px; cursor: pointer; font-variant-numeric: tabular-nums; }
.df-chips button:hover:not(:disabled) { border-color: var(--field-border); }
.df-chips button[aria-pressed=true] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.df-chips button:disabled { opacity: .45; cursor: not-allowed; }
.df-hint { font-size: 12.5px; color: var(--muted); }
.df-foot { display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--line); padding-top: 10px; }
.df-spacer { flex: 1; }
.df-link { border: 0; background: transparent; color: var(--accent); font-weight: 600; font-size: 14px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.df-link:hover:not(:disabled) { background: var(--accent-soft); }
.df-link:disabled { color: var(--muted); cursor: not-allowed; }
@media (max-width: 599px) {
  .df-backdrop { background: rgba(18, 18, 22, .45); }
  .df-pop { top: auto !important; left: 0 !important; right: 0; bottom: 0; width: auto; border-radius: 16px 16px 0 0; padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); }
  .df-day { height: 44px; }
  .df-wrap { display: block; } .df-wrap .df-input { min-width: 0; }
}
@media (prefers-reduced-motion: no-preference) { .df-pop { animation: df-in .14s ease-out; } @keyframes df-in { from { opacity: 0; } to { opacity: 1; } } }
.row-box { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions .btn { flex: 1; min-width: 110px; }

/* Segmented & filter chips */
.seg { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; overflow-x: auto; }
.seg button { flex: 1; min-height: 38px; border: 0; background: none; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; padding: 0 10px; }
/* Đỏ đặc chỉ dành cho nút hành động chính + menu đang chọn; tab đang chọn dùng nền đỏ nhạt để màn hình không bị nặng. */
.seg button[aria-pressed=true] { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent); }
.fchips { display: flex; gap: 8px; flex-wrap: wrap; }
.fchips button { min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.fchips button[aria-pressed=true] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.card.s-Assigned { border-left-color: var(--warn); } .card.s-InProgress { border-left-color: var(--info); }
.card.s-PendingReview { border-left-color: var(--review); } .card.s-Completed { border-left-color: var(--ok); }
.card.s-Rejected, .card.late { border-left-color: var(--bad); }
.card-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.card h3 a { color: var(--ink); }
.card.click { cursor: pointer; } .card.click:hover { border-color: var(--accent); }
details.card summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 8px; }
details.card summary::-webkit-details-marker { display: none; }

/* Tables */
.tblwrap { overflow-x: auto; }
table.tbl { border-collapse: collapse; width: 100%; font-size: 14px; min-width: 560px; }
table.tbl th, table.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.tbl thead th { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
table.tbl tfoot th, table.tbl tfoot td { font-weight: 700; border-bottom: 0; }
table.tbl tr.grp th, table.tbl tr.grp td { background: var(--bg); font-weight: 700; font-size: 13px; }
table.tbl tbody tr:hover { background: color-mix(in srgb, var(--line) 35%, transparent); }
/* Tên khách hàng/dự án (link) trong bảng: màu chữ thường + gạch chân mảnh, rê chuột mới đỏ — tránh lẫn với ngày/số quá hạn màu đỏ. */
table.tbl a, table.tbl .link-btn:not(.muted):not(.danger) { color: var(--ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--ink) 28%, transparent); text-underline-offset: 3px; }
table.tbl a:hover, table.tbl .link-btn:not(.muted):not(.danger):hover { color: var(--accent); text-decoration-color: currentColor; }
.numbtn { min-width: 38px; min-height: 32px; border-radius: 8px; border: 1px solid transparent; font-weight: 700; cursor: pointer; text-decoration: underline; }
.numbtn.ok { background: var(--ok-soft); color: var(--ok); } .numbtn.bad { background: var(--bad-soft); color: var(--bad); } .numbtn.warn { background: var(--warn-soft); color: var(--warn); }
.zero { color: var(--muted); }

/* Progress + horizontal bars (1 chuỗi, nhãn trực tiếp) */
.prog { position: relative; height: 18px; border-radius: 999px; background: var(--bar-track); overflow: hidden; min-width: 90px; }
.prog-bar { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--brand-orange) 30%, var(--surface)); border-radius: 999px; }
.prog span { position: relative; display: block; text-align: center; font-size: 11.5px; font-weight: 600; line-height: 18px; font-variant-numeric: tabular-nums; }
.hbars { display: flex; flex-direction: column; gap: 6px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 160px) 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; }
.hbar .track { height: 12px; border-radius: 0 4px 4px 0; background: var(--bar-track); position: relative; }
.hbar .fill { position: absolute; inset: 0 auto 0 0; background: var(--series-1); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar .v { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 48px; text-align: right; }

/* Lists & timeline */
.list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.list li { overflow-wrap: anywhere; }
.rep-h { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.timeline li { display: grid; grid-template-columns: 12px 1fr; gap: 10px; font-size: 13.5px; }
.timeline li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--brand-orange); margin-top: 5px; }
.comment { display: flex; gap: 10px; }
.comment .body { background: var(--bg); border-radius: 10px; padding: 8px 12px; flex: 1; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }

/* Thông báo: icon theo loại; chưa đọc = nền nhạt + vạch đỏ trái + nhãn "Mới"; tiêu đề màu chữ thường (không đỏ cả dòng). */
.sec.flush { padding: 0; gap: 0; overflow: hidden; }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.notif:last-child { border-bottom: 0; }
.notif.unread { background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); box-shadow: inset 3px 0 0 var(--primary); }
.notif-ic { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--bg); color: var(--muted); }
.notif-ic svg { width: 19px; height: 19px; }
.notif-ic.t-task { background: var(--brand-soft); color: var(--brand-ink); } .notif-ic.t-receivable { background: var(--ok-soft); color: var(--ok); }
.notif-ic.t-report { background: var(--info-soft); color: var(--info); }
.notif-title { display: block; color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.notif.unread .notif-title { font-weight: 700; }
a.notif-title:hover { color: var(--accent); }
.notif-time { font-size: 12px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }

/* Picker */
.picker { display: flex; flex-direction: column; gap: 6px; position: relative; }
.plist { border: 1px solid var(--line); border-radius: 9px; background: var(--surface); max-height: 230px; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.pitem { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 10px 12px; font-size: 14.5px; cursor: pointer; }
.pitem:hover { background: var(--accent-soft); } .pitem:focus-visible { outline-offset: -2px; }
.pitem small { color: var(--muted); margin-left: 6px; }
.pempty { padding: 10px 12px; font-size: 13px; color: var(--muted); }

/* Sheet (bottom sheet trên mobile, hộp thoại giữa màn hình trên máy tính) */
.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(18, 18, 22, .5); display: flex; align-items: center; justify-content: center; padding: 16px; }
.sheet { background: var(--brand-grad) top / 100% 4px no-repeat, var(--surface); width: 100%; max-width: 620px; max-height: 92vh; overflow-y: auto; border-radius: 16px; padding: 22px 18px 18px;
  display: flex; flex-direction: column; gap: 12px; box-shadow: 0 24px 60px rgba(0,0,0,.28); }
.sheet.wide { max-width: 900px; }
.sheet h2 { font-size: 18px; }
/* Tiêu đề + nút X đóng (popup chỉ đóng bằng nút X / Hủy / Lưu — bấm ra ngoài không đóng). */
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sheet-head h2 { flex: 1; min-width: 0; padding-top: 5px; overflow-wrap: anywhere; }
.sheet-x { flex: none; width: 38px; height: 38px; margin: -2px -8px 0 0; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background-color .15s, color .15s; }
.sheet-x:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }
.sheet-x:disabled { opacity: .4; cursor: not-allowed; }
.sheet-x svg { width: 20px; height: 20px; }
/* Bấm ra vùng tối: hộp nảy nhẹ + viền sáng để báo vẫn đang mở. Dùng thuộc tính `scale` (không phải transform) để không chạy lại hiệu ứng mở. */
.sheet { transition: scale .15s ease-out, box-shadow .15s ease-out; }
.sheet.nudge { box-shadow: 0 0 0 3px var(--ring), 0 24px 60px rgba(0,0,0,.28); }
@media (prefers-reduced-motion: no-preference) { .sheet { animation: up .18s ease-out; } .sheet.nudge { scale: 1.02; } @keyframes up { from { transform: translateY(18px); opacity: .6; } to { transform: none; opacity: 1; } } }

/* Toast */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(92%, 520px); pointer-events: none; }
/* Nền xám than (màu chữ phụ của logo) cho cả 2 chế độ; vạch trái + icon theo loại: Info cam, Success xanh, Error đỏ. */
.toast { display: flex; align-items: flex-start; gap: 10px; max-width: 100%; background: var(--toast-bg); color: #fff; padding: 12px 16px 12px 12px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08); border-left: 4px solid var(--brand-orange); font-size: 14px; font-weight: 500; line-height: 1.4; text-align: left; box-shadow: 0 12px 32px rgba(0,0,0,.28); }
.toast-ic { display: inline-flex; flex: none; color: #FFB27A; } .toast-ic svg { width: 20px; height: 20px; }
.toast-msg { flex: 1; min-width: 0; padding-top: 1px; overflow-wrap: anywhere; }
.toast { pointer-events: auto; padding-right: 6px; }
.toast-x { flex: none; width: 28px; height: 28px; margin: -4px 0 -4px 4px; border: 0; border-radius: 8px; background: transparent; color: rgba(255,255,255,.7); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.toast-x:hover { background: rgba(255,255,255,.12); color: #fff; }
.toast-x svg { width: 16px; height: 16px; }
@media (prefers-reduced-motion: no-preference) { .toast { animation: toast-in .2s ease-out; } @keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } } }
.toast.Success { border-left-color: #2FA65A; } .toast.Success .toast-ic { color: #6FD08C; }
.toast.Error { border-left-color: var(--brand-red); } .toast.Error .toast-ic { color: #FF8A80; }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 12px; overflow-x: auto; align-items: start; }
.kcol { background: color-mix(in srgb, var(--line) 35%, var(--bg)); border-radius: var(--r); padding: 10px; display: flex; flex-direction: column; gap: 10px; min-height: 120px; }
.kcol-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 2px 4px; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, #A50F16 0%, #D3121A 30%, #EE5A1E 55%, var(--bg) 55.1%); }
.login-card { width: 100%; max-width: 560px; background: var(--surface); border-radius: 18px; padding: 26px; box-shadow: 0 20px 60px rgba(20, 20, 25, .25); display: flex; flex-direction: column; gap: 14px; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand img { width: 48px; height: 48px; }
.login-brand b { font-size: 22px; display: block; }
.login-brand small { color: var(--muted); letter-spacing: .06em; font-size: 11px; text-transform: uppercase; }
.tagline { font-size: 17px; font-weight: 600; }
.user-list { display: grid; gap: 8px; }
.user-opt { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.user-opt:hover { border-color: var(--accent); background: var(--accent-soft); }
.user-opt small { display: block; color: var(--muted); font-size: 12.5px; }

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100; background: var(--toast-bg); color: #fff; border-top: 3px solid var(--brand-red);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); font-size: 14px; }
#blazor-error-ui .reload { font-weight: 700; margin-left: 8px; color: #FFB27A; text-decoration: underline; }

/* ---------------- Đăng nhập (2 cột: thương hiệu + form) ---------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--bg); }
/* Nền đỏ → cam theo logo; chữ trắng nằm ở vùng đỏ (≥ 4.5:1), đầu cam chỉ có hình chìm chữ S. */
.auth-brand { position: relative; overflow: hidden; color: #fff; padding: 40px 48px; display: flex; flex-direction: column; gap: 28px;
  background: linear-gradient(145deg, #A50F16 0%, #D3121A 45%, #EE5A1E 100%); }
.auth-brand > * { position: relative; z-index: 1; }
.auth-brand::after { content: ""; position: absolute; right: -70px; bottom: -70px; width: 340px; height: 340px; background: url("icons/icon.svg") center / contain no-repeat;
  filter: brightness(0) invert(1); opacity: .12; pointer-events: none; }
.auth-brand-logo { display: inline-flex; align-items: center; gap: 12px; background: #fff; color: #1C1C21; border-radius: 16px; padding: 12px 18px; align-self: flex-start; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.auth-brand-logo img { width: 42px; height: 42px; }
.auth-brand-logo b { display: block; font-size: 20px; letter-spacing: .01em; }
.auth-brand-logo small { display: block; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #5E6068; }
.auth-brand-body { margin-top: auto; margin-bottom: auto; max-width: 480px; }
.auth-brand-body .auth-title { font-size: 34px; line-height: 1.2; font-weight: 700; color: #fff; margin: 0; }
.auth-brand-body p { font-size: 16px; opacity: .9; margin: 12px 0 24px; }
.auth-features { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; font-size: 15px; }
.auth-features li { display: flex; align-items: center; gap: 12px; }
.auth-features li > span { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.14); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.auth-features svg { width: 19px; height: 19px; }
.auth-brand-foot { font-size: 12.5px; opacity: .8; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 16px; }
.auth-card-logo { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 4px; }
.auth-card-logo img { width: 40px; height: 40px; }
.auth-card-logo b { display: block; font-size: 19px; color: var(--accent); }
.auth-card-logo small { display: block; font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.auth-card h1 { font-size: 26px; outline: none; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink); }
.auth-input { display: flex; align-items: center; gap: 8px; border: 1px solid var(--field-border); background: var(--surface); transition: border-color .15s, box-shadow .15s; border-radius: 12px; padding: 0 12px; min-height: 50px; }
.auth-input:hover { border-color: var(--field-hover); }
.auth-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.auth-input > svg { width: 19px; height: 19px; color: var(--muted); flex: none; }
.auth-input select, .auth-input input { border: 0 !important; background-color: transparent !important; box-shadow: none !important; padding: 10px 2px !important; min-height: 46px; font-size: 15.5px; flex: 1; min-width: 0; outline: none; }
/* Sau quy tắc trên (cùng !important): chừa chỗ cho mũi tên, chữ dài không che mũi tên. */
.auth-input select { padding-right: 26px !important; background-position: right 0 center; text-overflow: ellipsis; }
.auth-eye { border: 0; background: none; color: var(--muted); cursor: pointer; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; }
.auth-eye:hover { color: var(--accent); background: var(--accent-soft); }
.auth-eye svg { width: 19px; height: 19px; }
.auth-forgot { align-self: flex-end; font-size: 14px; text-align: right; }
.auth-forgot summary { cursor: pointer; color: var(--accent); font-weight: 600; list-style: none; }
.auth-forgot summary::-webkit-details-marker { display: none; }
.auth-forgot p { font-size: 13px; color: var(--muted); text-align: left; background: var(--bg); border-radius: 10px; padding: 10px 12px; margin: 8px 0 0; }
.auth-submit { min-height: 52px; font-size: 16px; border-radius: 12px; }
.auth-submit svg { width: 18px; height: 18px; }
.auth-alert { background: var(--bad-soft); color: var(--bad); border-left: 4px solid var(--bad); border-radius: 10px; padding: 10px 12px; font-size: 14px; font-weight: 500; }
.auth-alert.warn { background: var(--warn-soft); color: var(--warn); border-left-color: var(--warn); }
.auth-dev { font-size: 12px; color: var(--muted); background: var(--bg); border: 1px dashed var(--line); border-radius: 10px; padding: 8px 10px; }
.auth-dev code { font-size: 11.5px; }
.auth-powered { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.auth-powered img { height: 24px; width: auto; display: block; }
@media (max-width: 899px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 22px 20px; gap: 14px; }
  .auth-brand::after { width: 130px; height: 130px; right: -24px; top: -22px; bottom: auto; }
  .auth-brand-body .auth-title { font-size: 24px; }
  .auth-brand-body p { margin-bottom: 0; }
  .auth-features, .auth-brand-foot, .auth-card-logo { display: none; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 1100px) { .grid.three { grid-template-columns: 1fr 1fr; } }
@media (max-width: 379px) { .topbar .mobile-brand span { display: none; } }
@media (max-width: 899px) {
  .sidebar { display: none; }
  .topbar { padding: 8px 12px; gap: 6px; }
  .topbar .mobile-brand { display: flex; gap: 6px; font-size: 15px; white-space: nowrap; flex-shrink: 0; }
  .topbar .mobile-brand img { width: 26px; height: 26px; }
  .tenant-select { padding: 0 20px 0 2px; background-position: right 3px center; background-size: 14px; min-width: 0; }
  .topbar .icon-btn { width: 38px; height: 38px; }
  .user-chip .who, .tenant-select.desktop { display: none; }
  main.content { padding: 14px 14px 92px; }
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: repeat(4, 82vw); }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .bottom-nav a, .bottom-nav button { flex: 1; min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11.5px; font-weight: 600; color: var(--muted); border: 0; background: none; border-top: 3px solid transparent; position: relative; }
  .bottom-nav a.active { color: var(--accent); border-top-color: var(--accent); text-decoration: none; }
  .bottom-nav svg { width: 22px; height: 22px; }
  .bottom-nav .badge { position: absolute; top: 4px; left: calc(50% + 6px); }
  .overlay { align-items: flex-end; padding: 0; }
  .sheet { border-radius: 16px 16px 0 0; max-height: 94vh; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .toasts { bottom: calc(72px + env(safe-area-inset-bottom)); }
  .hbar { grid-template-columns: minmax(90px, 120px) 1fr auto; }
}
@media print { .sidebar, .topbar, .bottom-nav { display: none !important; } main.content { padding: 0; } }
