/* ==========================================================================
   quangvan — Điều Hành Đông Hà
   Shared stylesheet for every mockup screen (docs/quangvan/mockups/S*.html).
   Identity (PRODUCT.md): xanh lá đậm môi trường đô thị + cam an toàn lao động;
   10 status colours from sheet 01 column F; official-register feel; outdoor
   phone use (390x844, ≥16px body, 48px targets) and office desktop (1440x900).
   No remote assets: system fonts, inline SVG icons.
   ========================================================================== */

:root {
  /* ---- Brand: deep environmental green ---- */
  --qv-g950: oklch(0.235 0.045 160);   /* #062417 deepest chrome */
  --qv-g900: oklch(0.28 0.056 158);    /* #0a311e sidebar, app bar */
  --qv-g800: oklch(0.335 0.068 157);   /* #104128 chrome hover */
  --qv-g700: oklch(0.41 0.088 155);    /* #175835 primary action, links */
  --qv-g600: oklch(0.47 0.098 154);    /* #236a41 primary hover, progress */
  --qv-g300: oklch(0.76 0.08 155);
  --qv-g200: oklch(0.86 0.055 155);    /* #b5dcc1 text on chrome */
  --qv-g100: oklch(0.935 0.03 155);    /* #dbf0e1 selection tint */
  --qv-g50:  oklch(0.968 0.014 155);   /* #eef7f0 hover tint */

  /* ---- Accent: safety orange (vest) — primary field action, focus, counts ---- */
  --qv-o600: oklch(0.6 0.18 44);       /* #d35100 borders, focus ring */
  --qv-o500: oklch(0.71 0.185 50);     /* #f9770c fill, dark text on it */
  --qv-o400: oklch(0.77 0.16 56);      /* hover */
  --qv-o100: oklch(0.95 0.04 62);      /* #ffe9d4 */
  --qv-oInk: oklch(0.46 0.13 45);      /* #903a03 text on o100 */

  /* ---- Neutrals, tinted toward the brand hue (not warm) ---- */
  --qv-bg: oklch(0.972 0.005 160);      /* #f3f7f5 page */
  --qv-surface: #ffffff;
  --qv-surface2: oklch(0.958 0.007 160);/* #edf3ef table head, toolbars */
  --qv-sunk: oklch(0.935 0.009 160);    /* #e5ebe7 read-only, computed */
  --qv-line: oklch(0.885 0.01 160);     /* hairlines */
  --qv-lineStrong: oklch(0.78 0.012 160);
  --qv-field: oklch(0.56 0.014 160);    /* #6e7772 control borders, 4.6:1 */
  --qv-ink: oklch(0.22 0.02 165);       /* #121e18 15.9:1 */
  --qv-ink2: oklch(0.37 0.018 165);     /* #37433d 9.5:1 */
  --qv-ink3: oklch(0.48 0.016 165);     /* #56615b 6.0:1 */
  --qv-inkInv: #ffffff;

  /* ---- Semantic ---- */
  --qv-danger: oklch(0.49 0.19 28);     /* #b31415 */
  --qv-dangerBg: #fce4d6;               /* file CF "Quá hạn" fill */
  --qv-dangerInk: #c00000;              /* file CF "Quá hạn" text */
  --qv-warnBg: #fff2cc;                 /* file CF "Có nguy cơ" fill */
  --qv-warnInk: #8a5800;                /* file 9C6500 one step darker (4.4 → 5.4:1) */
  --qv-okBg: #e2f0d9;                   /* file CF "Đã hoàn thành" fill */
  --qv-okInk: #3b6125;                  /* file 548235 one step darker (3.8 → 6.1:1) */
  --qv-okSolid: oklch(0.45 0.1 140);    /* #34622a solid "xanh lục đậm" */
  --qv-infoBg: oklch(0.935 0.035 252);
  --qv-infoInk: oklch(0.42 0.14 256);

  /* ---- 10 trạng thái TT-01..TT-10 (sheet 01 cột F) ---- */
  --tt01-bg: oklch(0.935 0.006 250); --tt01-ink: oklch(0.39 0.012 250); --tt01-bd: oklch(0.85 0.008 250); /* Mới giao — xám nhạt */
  --tt02-bg: oklch(0.47 0.012 250);  --tt02-ink: #fff;                  --tt02-bd: oklch(0.47 0.012 250); /* Đã tiếp nhận — xám đậm */
  --tt03-bg: oklch(0.92 0.045 250);  --tt03-ink: oklch(0.4 0.15 258);   --tt03-bd: oklch(0.8 0.08 252);   /* Đang thực hiện — xanh lam */
  --tt04-bg: oklch(0.955 0.075 98);  --tt04-ink: oklch(0.43 0.09 80);   --tt04-bd: oklch(0.85 0.1 92);    /* Chờ phối hợp — vàng nhạt */
  --tt05-bg: var(--qv-warnBg);       --tt05-ink: var(--qv-warnInk);     --tt05-bd: #f0d78a;              /* Có nguy cơ quá hạn — cam vàng */
  --tt06-bg: var(--qv-dangerBg);     --tt06-ink: var(--qv-dangerInk);   --tt06-bd: #f2b8a0;              /* Quá hạn — đỏ nhạt */
  --tt07-bg: oklch(0.93 0.045 305);  --tt07-ink: oklch(0.42 0.15 305);  --tt07-bd: oklch(0.82 0.08 305);  /* Chờ phê duyệt — tím nhạt */
  --tt08-bg: var(--qv-okBg);         --tt08-ink: var(--qv-okInk);       --tt08-bd: #b9d7a6;              /* Hoàn thành chờ xác nhận — xanh lục nhạt */
  --tt09-bg: var(--qv-okSolid);      --tt09-ink: #fff;                  --tt09-bd: var(--qv-okSolid);     /* Đã hoàn thành — xanh lục đậm */
  --tt10-bg: oklch(0.2 0.01 250);    --tt10-ink: #fff;                  --tt10-bd: oklch(0.2 0.01 250);   /* Tạm dừng/Hủy — đen, gạch ngang */

  /* ---- Type ---- */
  --qv-font: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --qv-mono: ui-monospace, "Cascadia Mono", Consolas, "Roboto Mono", "SFMono-Regular", Menlo, monospace;
  --qv-serif: "Times New Roman", Times, "Noto Serif", "Liberation Serif", serif; /* văn bản hành chính, bản in */
  --fs-xs: 13px;
  --fs-sm: 14px;
  --fs-md: 15px;
  --fs-lg: 17px;
  --fs-xl: 20px;
  --fs-2xl: 24px;
  --fs-3xl: 30px;
  --lh: 1.5;

  /* ---- Space (4px base) ---- */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-7: 32px; --sp-8: 40px; --sp-9: 48px;

  /* ---- Shape & depth ---- */
  --r-xs: 3px; --r-sm: 4px; --r-md: 6px; --r-lg: 10px; --r-xl: 16px; --r-pill: 999px;
  --sh-1: 0 1px 2px oklch(0.22 0.02 165 / 0.07);
  --sh-2: 0 4px 14px oklch(0.22 0.02 165 / 0.10), 0 1px 3px oklch(0.22 0.02 165 / 0.08);
  --sh-3: 0 18px 48px oklch(0.22 0.02 165 / 0.22), 0 3px 10px oklch(0.22 0.02 165 / 0.10);
  --focus: 0 0 0 2px #fff, 0 0 0 4px var(--qv-o600);

  /* ---- Controls ---- */
  --ctl-h: 40px;        /* desktop */
  --tap: 48px;          /* phone minimum target */
  --side-w: 244px;
  --top-h: 60px;

  /* ---- Layers ---- */
  --z-sticky: 10; --z-nav: 20; --z-dropdown: 30; --z-backdrop: 40; --z-dialog: 50; --z-toast: 60;

  /* ---- Motion ---- */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 180ms;
}

/* Phone screens: larger type and targets for outdoor use */
body.ph {
  --fs-xs: 14px; --fs-sm: 15px; --fs-md: 17px; --fs-lg: 19px; --fs-xl: 22px; --fs-2xl: 26px; --fs-3xl: 32px;
  --ctl-h: 52px;
}

/* ===================== Base ===================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--qv-font); font-size: var(--fs-md); line-height: var(--lh);
  color: var(--qv-ink); background: var(--qv-bg);
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }
p { margin: 0; text-wrap: pretty; }
a { color: var(--qv-g700); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--qv-g600); }
ul, ol { margin: 0; padding: 0; }
img, svg { display: block; }
button { font: inherit; color: inherit; }
hr { border: 0; border-top: 1px solid var(--qv-line); margin: var(--sp-4) 0; }
small { font-size: var(--fs-xs); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
[hidden] { display: none !important; }
::selection { background: var(--qv-g100); }
mark { background: var(--qv-o100); color: inherit; padding: 0 2px; border-radius: 2px; box-shadow: inset 0 -2px 0 var(--qv-o500); }
blockquote { margin: 0; }

.skip { position: absolute; left: 8px; top: -60px; z-index: var(--z-toast); background: var(--qv-o500); color: var(--qv-g950); font-weight: 700; padding: 10px 14px; border-radius: var(--r-md); text-decoration: none; }
.skip:focus { top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ===================== Icons ===================== */
.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; display: inline-block; vertical-align: -3px; }
.i-sm { width: 16px; height: 16px; }
.i-lg { width: 22px; height: 22px; }
.i-xl { width: 28px; height: 28px; }
.i-2xl { width: 40px; height: 40px; stroke-width: 1.6; }
body.ph .i { width: 20px; height: 20px; }
body.ph .i-sm { width: 18px; height: 18px; }
body.ph .i-lg { width: 24px; height: 24px; }
body.ph .i-xl { width: 30px; height: 30px; }

/* ===================== Utilities ===================== */
.row { display: flex; align-items: center; gap: var(--sp-2); }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.row-top { align-items: flex-start; }
.between { justify-content: space-between; }
.end { justify-content: flex-end; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack > * + * { margin-top: var(--sp-3); }
.stack-sm > * + * { margin-top: var(--sp-2); }
.stack-lg > * + * { margin-top: var(--sp-5); }
.grid { display: grid; gap: var(--sp-4); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { display: grid; grid-template-columns: minmax(0, 1fr) 380px; align-items: start; gap: var(--sp-5); }
.g-main-wide { display: grid; grid-template-columns: minmax(0, 1fr) 440px; align-items: start; gap: var(--sp-5); }
.mt-0 { margin-top: 0 !important; } .mt-2 { margin-top: var(--sp-2); } .mt-3 { margin-top: var(--sp-3); } .mt-4 { margin-top: var(--sp-4); } .mt-5 { margin-top: var(--sp-5); } .mt-6 { margin-top: var(--sp-6); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.c { text-align: center; }
.mono { font-family: var(--qv-mono); font-size: 0.93em; letter-spacing: 0; }
.muted { color: var(--qv-ink3); }
.ink2 { color: var(--qv-ink2); }
.strong { font-weight: 650; }
.nowrap { white-space: nowrap; }
.neg { color: var(--qv-danger); font-weight: 650; }
.pos { color: var(--qv-okInk); font-weight: 650; }
.orange { color: var(--qv-oInk); font-weight: 650; }
.strike { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dash { color: var(--qv-ink3); }

/* ===================== Desktop shell ===================== */
.qv-app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.qv-side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--qv-g900); color: var(--qv-g200); z-index: var(--z-nav);
}
.qv-brand { display: flex; align-items: center; gap: 12px; padding: 16px 18px 14px; color: #fff; text-decoration: none; border-bottom: 1px solid oklch(1 0 0 / 0.09); }
.qv-brand:hover { color: #fff; }
.qv-brand strong { display: block; font-size: 16px; line-height: 1.2; letter-spacing: -0.005em; }
.qv-brand small { display: block; font-size: 12.5px; color: var(--qv-g200); line-height: 1.3; margin-top: 2px; }
.logo { width: 36px; height: 36px; flex: none; }
.qv-nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; scrollbar-width: thin; scrollbar-color: oklch(1 0 0 / 0.2) transparent; }
.qv-nav-group + .qv-nav-group { margin-top: 12px; }
.qv-nav-label { padding: 6px 10px 4px; font-size: 13px; font-weight: 650; color: var(--qv-g300); }
.qv-nav a {
  display: flex; align-items: center; gap: 11px; min-height: 36px; padding: 6px 10px; margin-top: 1px;
  color: oklch(0.93 0.025 155); text-decoration: none; font-size: 14.5px; font-weight: 500; border-radius: var(--r-md);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.qv-nav a .i { color: var(--qv-g300); }
.qv-nav a:hover { background: var(--qv-g800); color: #fff; }
.qv-nav a:hover .i { color: #fff; }
.qv-nav a.is-active { background: var(--qv-g50); color: var(--qv-g900); font-weight: 700; }
.qv-nav a.is-active .i { color: var(--qv-g700); }
.qv-nav a .count { margin-left: auto; }
.qv-nav a:focus-visible { box-shadow: 0 0 0 2px var(--qv-o500); }
.qv-me { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid oklch(1 0 0 / 0.09); color: #fff; }
.qv-me .who { flex: 1; min-width: 0; line-height: 1.3; }
.qv-me .who strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qv-me .who small { display: block; font-size: 12.5px; color: var(--qv-g200); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qv-me a { color: var(--qv-g200); display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: var(--r-md); }
.qv-me a:hover { background: var(--qv-g800); color: #fff; }
.initials { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none; border: 1.5px solid currentColor; border-radius: var(--r-sm); font-size: 13px; font-weight: 700; letter-spacing: 0.02em; }
.qv-me .initials { color: var(--qv-g200); }

.qv-main { min-width: 0; display: flex; flex-direction: column; }
.qv-top {
  position: sticky; top: 0; z-index: var(--z-sticky); height: var(--top-h); display: flex; align-items: center; gap: var(--sp-4);
  padding: 0 32px; background: var(--qv-surface); border-bottom: 1px solid var(--qv-line);
}
.crumbs { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--qv-ink3); min-width: 0; white-space: nowrap; }
.crumbs a { color: var(--qv-ink2); text-decoration: none; }
.crumbs a:hover { color: var(--qv-g700); text-decoration: underline; }
.crumbs .i { width: 14px; height: 14px; color: var(--qv-lineStrong); }
.crumbs [aria-current] { color: var(--qv-ink); font-weight: 650; }
.qv-top .search { margin-left: auto; width: 380px; }
.qv-top-actions { display: flex; align-items: center; gap: 4px; }
.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border: 0; background: none; border-radius: var(--r-md); color: var(--qv-ink2); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--qv-surface2); color: var(--qv-ink); }
.icon-btn .count { position: absolute; top: 3px; right: 1px; }
.today { font-size: var(--fs-sm); color: var(--qv-ink2); padding: 0 8px; white-space: nowrap; }

.qv-page { padding: 24px 32px 56px; flex: 1; }
.qv-page.narrow { max-width: 1180px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-5); margin-bottom: var(--sp-5); }
.page-head .title { min-width: 0; }
.page-head h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head .sub { margin-top: 6px; color: var(--qv-ink2); font-size: var(--fs-md); max-width: 78ch; }
.page-actions { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; justify-content: flex-end; }
/* Register tag: the Excel sheet number users already know ("Sổ 03") */
.so-tag {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px;
  font: 600 13px/1 var(--qv-mono); color: var(--qv-ink2); background: var(--qv-surface);
  border: 1px solid var(--qv-ink3); border-radius: var(--r-xs); letter-spacing: 0.02em; vertical-align: middle;
}
.record-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 8px; color: var(--qv-ink2); font-size: var(--fs-sm); }
.record-line > span { display: inline-flex; align-items: center; gap: 6px; }
.record-line .i { color: var(--qv-ink3); width: 16px; height: 16px; }

/* ===================== Phone shell ===================== */
body.ph { background: var(--qv-bg); }
.ph-bar {
  position: sticky; top: 0; z-index: var(--z-sticky); display: flex; align-items: center; gap: 4px;
  height: 60px; padding: 0 6px 0 4px; background: var(--qv-g900); color: #fff;
}
.ph-bar h1 { flex: 1; min-width: 0; font-size: 19px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 6px; }
.ph-bar h1 small { display: block; font-size: 13.5px; font-weight: 500; color: var(--qv-g200); }
.ph-bar .icon-btn { width: var(--tap); height: var(--tap); color: #fff; }
.ph-bar .icon-btn:hover { background: var(--qv-g800); color: #fff; }
.ph-bar .icon-btn .count { top: 5px; right: 4px; box-shadow: 0 0 0 2px var(--qv-g900); }
.ph-bar .logo { width: 34px; height: 34px; margin-left: 8px; }
.ph-main { padding: 16px 16px 104px; }
.ph-main.has-actbar { padding-bottom: 176px; }
.ph-main.no-tabs { padding-bottom: 32px; }
.ph-main.no-tabs.has-actbar { padding-bottom: 120px; }
.ph-tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-nav); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  height: 68px; padding-bottom: env(safe-area-inset-bottom); background: var(--qv-surface); border-top: 1px solid var(--qv-lineStrong);
  max-width: 480px; margin: 0 auto;
}
.ph-tabs a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--qv-ink2); text-decoration: none; font-size: 13.5px; font-weight: 600; min-width: 0;
}
.ph-tabs a .i { width: 24px; height: 24px; }
.ph-tabs a.is-active { color: var(--qv-g700); font-weight: 750; }
.ph-tabs a.is-active::before { content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; border-radius: 0 0 3px 3px; background: var(--qv-g700); }
.ph-tabs a .count { position: absolute; top: 6px; left: calc(50% + 6px); }
.ph-actbar {
  position: fixed; left: 0; right: 0; bottom: 68px; z-index: var(--z-sticky); display: flex; gap: var(--sp-2);
  padding: 12px 16px; background: var(--qv-surface); border-top: 1px solid var(--qv-line); box-shadow: 0 -6px 18px oklch(0.22 0.02 165 / 0.06);
  max-width: 480px; margin: 0 auto;
}
.ph-actbar.at-bottom { bottom: 0; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.ph-actbar .btn { flex: 1; }
.ph-actbar .actbar-note { position: absolute; left: 16px; right: 16px; bottom: 100%; margin-bottom: 8px; }
@media (min-width: 520px) {
  body.ph { background: var(--qv-sunk); }
  body.ph .ph-shell { max-width: 430px; margin: 0 auto; min-height: 100vh; background: var(--qv-bg); box-shadow: var(--sh-2); }
}
.ph-section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 22px 2px 10px; }
.ph-section-title h2 { font-size: 19px; }
.ph-section-title a { font-size: 15px; font-weight: 650; }
.ph-greet { margin: 2px 2px 14px; }
.ph-greet strong { display: block; font-size: 22px; line-height: 1.25; }
.ph-greet span { color: var(--qv-ink2); font-size: 15.5px; }

/* PWA install prompt (Android) and iOS hint */
.install {
  position: fixed; left: 12px; right: 12px; bottom: 80px; z-index: var(--z-toast); display: flex; align-items: center; gap: 12px;
  padding: 12px 12px 12px 14px; background: var(--qv-g950); color: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-3); max-width: 456px; margin: 0 auto;
}
.install .logo { width: 40px; height: 40px; }
.install p { flex: 1; font-size: 15px; line-height: 1.35; }
.install p small { display: block; color: var(--qv-g200); font-size: 13.5px; }

/* ===================== Buttons ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--ctl-h); padding: 0 16px;
  font: inherit; font-size: var(--fs-md); font-weight: 650; line-height: 1.2; color: var(--qv-ink); background: var(--qv-surface);
  border: 1px solid var(--qv-field); border-radius: var(--r-md); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), transform 80ms;
}
.btn:hover { background: var(--qv-surface2); color: var(--qv-ink); border-color: var(--qv-ink3); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: 0.45; cursor: not-allowed; transform: none; pointer-events: none; }
.btn-primary { background: var(--qv-g700); border-color: var(--qv-g700); color: #fff; }
.btn-primary:hover { background: var(--qv-g600); border-color: var(--qv-g600); color: #fff; }
.btn-accent { background: var(--qv-o500); border-color: var(--qv-o600); color: var(--qv-g950); }
.btn-accent:hover { background: var(--qv-o400); border-color: var(--qv-o600); color: var(--qv-g950); }
.btn-inv { background: #fff; border-color: #fff; color: var(--qv-g900); }
.btn-inv:hover { background: var(--qv-g50); color: var(--qv-g900); border-color: var(--qv-g50); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--qv-ink2); }
.btn-ghost:hover { background: var(--qv-surface2); border-color: transparent; }
.btn-danger { color: var(--qv-danger); border-color: oklch(0.8 0.08 28); }
.btn-danger:hover { background: var(--qv-dangerBg); color: var(--qv-danger); border-color: var(--qv-danger); }
.btn-danger-solid { background: var(--qv-danger); border-color: var(--qv-danger); color: #fff; }
.btn-danger-solid:hover { background: oklch(0.43 0.18 28); color: #fff; border-color: oklch(0.43 0.18 28); }
.btn-ok { background: var(--qv-okSolid); border-color: var(--qv-okSolid); color: #fff; }
.btn-ok:hover { background: oklch(0.4 0.095 140); color: #fff; }
.btn-link { min-height: 0; padding: 0; border: 0; background: none; color: var(--qv-g700); text-decoration: underline; text-underline-offset: 3px; font-weight: 650; }
.btn-link:hover { background: none; color: var(--qv-g600); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: var(--fs-sm); }
.btn-lg { min-height: 48px; padding: 0 22px; font-size: var(--fs-lg); }
.btn-xl { min-height: 60px; padding: 0 22px; font-size: 19px; font-weight: 750; border-radius: var(--r-lg); }
.btn-block { width: 100%; }
.btn-icon { width: var(--ctl-h); padding: 0; }
.btn-icon.btn-sm { width: 34px; }
.btn.is-loading { color: transparent !important; position: relative; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2.5px solid currentColor; border-color: #fff #fff transparent transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--r-md) 0 0 var(--r-md); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--r-md) var(--r-md) 0; }
body.ph .btn { border-width: 1.5px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================== Forms ===================== */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label, .field > label, .field > .label { font-size: var(--fs-sm); font-weight: 650; color: var(--qv-ink2); }
body.ph .label, body.ph .field > label { font-size: 15.5px; color: var(--qv-ink); }
.req::after { content: " *"; color: var(--qv-danger); }
.opt { font-weight: 500; color: var(--qv-ink3); }
.input, .select, .textarea {
  width: 100%; min-height: var(--ctl-h); padding: 8px 12px; font: inherit; font-size: var(--fs-md); color: var(--qv-ink);
  background: var(--qv-surface); border: 1px solid var(--qv-field); border-radius: var(--r-md);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
body.ph .input, body.ph .select, body.ph .textarea { border-width: 1.5px; font-size: 17px; padding: 10px 14px; }
body.ph .input-wrap > .input, body.ph .search .input { padding-left: 38px; }
body.ph .date .input { padding-right: 40px; }
body.ph .pw .input { padding-right: 52px; }
.input::placeholder, .textarea::placeholder { color: var(--qv-ink3); opacity: 1; }
.textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2337433d' stroke-width='2.4' 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 12px center; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--qv-ink2); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--qv-g700); box-shadow: 0 0 0 3px oklch(0.71 0.185 50 / 0.45); }
.input[readonly], .input:disabled, .select:disabled, .textarea[readonly] { background: var(--qv-sunk); color: var(--qv-ink2); border-color: var(--qv-lineStrong); cursor: default; }
.input.num { text-align: right; }
.is-invalid .input, .is-invalid .select, .is-invalid .textarea, .input.is-invalid, .select.is-invalid { border-color: var(--qv-danger); border-width: 2px; background: #fffafa; }
.is-warn .input, .input.is-warn { border-color: var(--qv-warnInk); background: #fffdf3; }
.hint { font-size: var(--fs-xs); color: var(--qv-ink3); line-height: 1.4; }
body.ph .hint { font-size: 14.5px; color: var(--qv-ink2); }
.err { display: flex; align-items: flex-start; gap: 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--qv-danger); line-height: 1.35; }
.err .i { width: 16px; height: 16px; margin-top: 1px; }
.warn-text { display: flex; align-items: flex-start; gap: 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--qv-warnInk); line-height: 1.35; }
.warn-text .i { width: 16px; height: 16px; margin-top: 1px; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px 18px; }
.c-12 { grid-column: span 12; } .c-8 { grid-column: span 8; } .c-6 { grid-column: span 6; } .c-4 { grid-column: span 4; } .c-3 { grid-column: span 3; } .c-9 { grid-column: span 9; } .c-5 { grid-column: span 5; } .c-7 { grid-column: span 7; } .c-2 { grid-column: span 2; }
.input-wrap { position: relative; }
.input-wrap > .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--qv-ink3); pointer-events: none; }
.input-wrap > .input { padding-left: 38px; }
.input-wrap .suffix { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--qv-ink3); font-size: var(--fs-sm); pointer-events: none; }
.input-group { display: flex; }
.input-group .input { border-radius: var(--r-md) 0 0 var(--r-md); }
.input-group .addon { display: inline-flex; align-items: center; padding: 0 12px; background: var(--qv-surface2); border: 1px solid var(--qv-field); border-left: 0; border-radius: 0 var(--r-md) var(--r-md) 0; font-size: var(--fs-sm); color: var(--qv-ink2); white-space: nowrap; }
.search { position: relative; }
.search > .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--qv-ink3); pointer-events: none; }
.search .input { padding-left: 38px; background: var(--qv-surface2); border-color: var(--qv-lineStrong); }
.search .input:focus { background: var(--qv-surface); }
.date { position: relative; }
.date .input { padding-right: 40px; }
.date > .i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--qv-ink2); pointer-events: none; }
/* computed / auto-generated value (Principle 3: hệ thống tính) */
.auto { display: flex; align-items: center; gap: 8px; min-height: var(--ctl-h); padding: 8px 12px; background: var(--qv-sunk); border: 1px dashed var(--qv-lineStrong); border-radius: var(--r-md); color: var(--qv-ink); font-weight: 650; }
.auto .i { color: var(--qv-ink3); width: 15px; height: 15px; }
.auto .auto-tag { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--qv-ink3); white-space: nowrap; }
.check, .radio { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: var(--fs-md); line-height: 1.35; }
.check input, .radio input { width: 20px; height: 20px; margin: 0; accent-color: var(--qv-g700); flex: none; }
body.ph .check input, body.ph .radio input { width: 26px; height: 26px; }
.choice-list { display: grid; gap: 8px; }
.choice { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--qv-field); border-radius: var(--r-md); background: var(--qv-surface); cursor: pointer; }
.choice input { margin-top: 2px; }
.choice:hover { border-color: var(--qv-ink2); }
.choice.is-on { border-color: var(--qv-g700); background: var(--qv-g50); box-shadow: inset 0 0 0 1px var(--qv-g700); }
.choice strong { display: block; }
.choice small { display: block; color: var(--qv-ink2); font-size: var(--fs-sm); }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--qv-sunk); border-radius: var(--r-md); }
.seg button, .seg a { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border: 0; background: none; border-radius: var(--r-sm); font-size: var(--fs-sm); font-weight: 650; color: var(--qv-ink2); cursor: pointer; text-decoration: none; white-space: nowrap; }
.seg button:hover, .seg a:hover { color: var(--qv-ink); background: oklch(1 0 0 / 0.6); }
.seg .is-active { background: var(--qv-surface); color: var(--qv-g900); box-shadow: var(--sh-1); }
body.ph .seg button, body.ph .seg a { min-height: 44px; font-size: 15.5px; padding: 0 14px; flex: 1; justify-content: center; }
body.ph .seg { display: flex; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { appearance: none; width: 42px; height: 24px; border-radius: 12px; background: var(--qv-lineStrong); position: relative; margin: 0; cursor: pointer; transition: background var(--dur); }
.switch input::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--sh-1); transition: transform var(--dur) var(--ease); }
.switch input:checked { background: var(--qv-g700); }
.switch input:checked::after { transform: translateX(18px); }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }

/* Drop zone + uploaded files */
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 22px; text-align: center;
  border: 2px dashed var(--qv-field); border-radius: var(--r-lg); background: var(--qv-surface2); color: var(--qv-ink2);
}
.drop strong { color: var(--qv-ink); font-size: var(--fs-md); }
.drop.is-over { border-color: var(--qv-g700); background: var(--qv-g50); }
.files { display: grid; gap: 8px; }
.file {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--qv-line); border-radius: var(--r-md); background: var(--qv-surface);
}
.file .ft { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 48px; border-radius: var(--r-xs); font: 700 11px/1 var(--qv-mono); color: #fff; letter-spacing: 0.03em; }
.ft-pdf { background: oklch(0.5 0.17 27); } .ft-img { background: oklch(0.5 0.1 230); } .ft-xls { background: oklch(0.45 0.1 150); } .ft-doc { background: oklch(0.45 0.13 260); }
.file .fn { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .fm { font-size: var(--fs-xs); color: var(--qv-ink3); }
.file .bar { height: 5px; background: var(--qv-sunk); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.file .bar i { display: block; height: 100%; background: var(--qv-g600); }
.file.is-error { border-color: var(--qv-danger); background: #fffafa; }
.file-acts { display: flex; gap: 4px; }

/* ===================== Status vocabulary ===================== */
.tt {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; font-size: 13.5px; font-weight: 650; line-height: 1;
  border-radius: var(--r-sm); border: 1px solid transparent; white-space: nowrap;
}
body.ph .tt { height: 30px; font-size: 15px; padding: 0 10px; }
.tt-01 { background: var(--tt01-bg); color: var(--tt01-ink); border-color: var(--tt01-bd); }
.tt-02 { background: var(--tt02-bg); color: var(--tt02-ink); border-color: var(--tt02-bd); }
.tt-03 { background: var(--tt03-bg); color: var(--tt03-ink); border-color: var(--tt03-bd); }
.tt-04 { background: var(--tt04-bg); color: var(--tt04-ink); border-color: var(--tt04-bd); }
.tt-05 { background: var(--tt05-bg); color: var(--tt05-ink); border-color: var(--tt05-bd); }
.tt-06 { background: var(--tt06-bg); color: var(--tt06-ink); border-color: var(--tt06-bd); }
.tt-07 { background: var(--tt07-bg); color: var(--tt07-ink); border-color: var(--tt07-bd); }
.tt-08 { background: var(--tt08-bg); color: var(--tt08-ink); border-color: var(--tt08-bd); }
.tt-09 { background: var(--tt09-bg); color: var(--tt09-ink); border-color: var(--tt09-bd); }
.tt-10 { background: var(--tt10-bg); color: var(--tt10-ink); border-color: var(--tt10-bd); }
.tt-10 > span { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.is-dung td.t-nd, .is-dung .t-nd, .is-dung .vc-title { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--qv-ink2); }
/* Cờ hạn — computed flag that sits on top of the work status (REQ-032/034) */
.han { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px; font-size: 13px; font-weight: 750; border-radius: var(--r-sm); white-space: nowrap; letter-spacing: 0.01em; }
body.ph .han { height: 30px; font-size: 14.5px; }
.han .i { width: 14px; height: 14px; stroke-width: 2.2; }
.han-qua { background: var(--qv-dangerBg); color: var(--qv-dangerInk); border: 1px solid #f2b8a0; text-transform: uppercase; }
.han-sap { background: var(--qv-warnBg); color: var(--qv-warnInk); border: 1px solid #f0d78a; text-transform: uppercase; }
.han-trong { color: var(--qv-ink2); font-weight: 600; padding: 0 2px; height: auto; }
.han-xong { background: var(--qv-okBg); color: var(--qv-okInk); border: 1px solid #b9d7a6; }
.han-tre { background: var(--qv-okBg); color: var(--qv-dangerInk); border: 1px solid #b9d7a6; }
.han-dung { color: var(--qv-ink3); font-weight: 600; padding: 0 2px; height: auto; }
.st { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.st .sep { color: var(--qv-ink3); font-weight: 700; }
/* Priority P1..P4 (sheet 01 II) */
.p { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 24px; min-width: 32px; padding: 0 7px; font: 750 13px/1 var(--qv-mono); border-radius: var(--r-xs); white-space: nowrap; border: 1px solid transparent; }
.p .pl { font-family: var(--qv-font); font-weight: 650; }
body.ph .p { height: 28px; min-width: 36px; font-size: 14.5px; }
.p1 { background: var(--qv-danger); color: #fff; }
.p2 { background: var(--qv-o100); color: var(--qv-oInk); border-color: oklch(0.85 0.09 55); }
.p3 { background: var(--qv-infoBg); color: var(--qv-infoInk); border-color: oklch(0.85 0.06 252); }
.p4 { background: var(--qv-surface); color: var(--qv-ink2); border-color: var(--qv-lineStrong); }
/* Đơn vị code */
.dv { display: inline-flex; align-items: center; height: 22px; padding: 0 6px; font: 700 12.5px/1 var(--qv-mono); color: var(--qv-ink2); background: var(--qv-surface); border: 1px solid var(--qv-lineStrong); border-radius: var(--r-xs); white-space: nowrap; letter-spacing: 0.02em; }
body.ph .dv { height: 26px; font-size: 14px; padding: 0 7px; }
/* Record code: VBD-2026-047, NV-2026-112, SC-2026-031, HD-2026-009 */
.ma { font: 650 14px/1.2 var(--qv-mono); color: var(--qv-ink); white-space: nowrap; letter-spacing: 0; }
a.ma { color: var(--qv-g700); text-decoration: none; }
a.ma:hover { text-decoration: underline; }
body.ph .ma { font-size: 15px; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--qv-o500); color: var(--qv-g950); font-size: 12.5px; font-weight: 800; line-height: 1; }
.count-muted { background: var(--qv-sunk); color: var(--qv-ink2); }
.count-red { background: var(--qv-danger); color: #fff; }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: var(--r-sm); font-size: 13px; font-weight: 650; background: var(--qv-sunk); color: var(--qv-ink2); white-space: nowrap; }
.tag .i { width: 14px; height: 14px; }
.tag-orange { background: var(--qv-o100); color: var(--qv-oInk); }
.tag-green { background: var(--qv-g100); color: var(--qv-g900); }
.tag-red { background: var(--qv-dangerBg); color: var(--qv-dangerInk); }
.tag-warn { background: var(--qv-warnBg); color: var(--qv-warnInk); }
.tag-info { background: var(--qv-infoBg); color: var(--qv-infoInk); }
.tag-line { background: var(--qv-surface); border: 1px solid var(--qv-lineStrong); }
body.ph .tag { height: 28px; font-size: 14px; }
/* Grade Mức A–D */
.muc { display: inline-flex; align-items: center; justify-content: center; height: 26px; padding: 0 9px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 750; white-space: nowrap; }
.muc-a { background: var(--qv-okSolid); color: #fff; } .muc-b { background: var(--qv-okBg); color: var(--qv-okInk); } .muc-c { background: var(--qv-warnBg); color: var(--qv-warnInk); } .muc-d { background: var(--qv-dangerBg); color: var(--qv-dangerInk); }
/* Progress (Tiến độ, never typed) */
.td { display: grid; grid-template-columns: minmax(60px, 1fr) auto; align-items: center; gap: 8px; min-width: 120px; }
.td-bar { height: 8px; background: var(--qv-sunk); border-radius: 4px; overflow: hidden; box-shadow: inset 0 0 0 1px oklch(0.22 0.02 165 / 0.06); }
.td-bar > i { display: block; height: 100%; background: var(--qv-g600); border-radius: 4px; }
.td-bar.is-full > i { background: var(--qv-okSolid); }
.td b { font-size: 13.5px; font-weight: 700; min-width: 38px; text-align: right; }
.td-lg .td-bar { height: 14px; border-radius: 7px; }
.td-lg .td-bar > i { border-radius: 7px; }
/* Ratio (ca, hợp đồng): <90% orange, ≥100% green (ASM-023) */
.tl-low { color: var(--qv-oInk); font-weight: 750; background: var(--qv-o100); padding: 2px 6px; border-radius: var(--r-xs); }
.tl-full { color: var(--qv-okInk); font-weight: 750; background: var(--qv-okBg); padding: 2px 6px; border-radius: var(--r-xs); }

/* ===================== Panels, meta, tabs ===================== */
.panel { background: var(--qv-surface); border: 1px solid var(--qv-line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--qv-line); min-height: 56px; }
.panel-head h2 { font-size: var(--fs-lg); display: flex; align-items: center; gap: 10px; }
.panel-head .sub { color: var(--qv-ink3); font-size: var(--fs-sm); font-weight: 500; }
.panel-body { padding: 18px; }
.panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--qv-line); background: var(--qv-surface2); border-radius: 0 0 var(--r-lg) var(--r-lg); font-size: var(--fs-sm); color: var(--qv-ink2); }
.panel-flush > .panel-body { padding: 0; }
body.ph .panel { border-radius: var(--r-lg); border-color: var(--qv-lineStrong); }
body.ph .panel-head { padding: 12px 16px; min-height: 52px; }
body.ph .panel-body { padding: 16px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }
.section-title h2 { font-size: var(--fs-lg); }
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px 24px; margin: 0; }
.meta > div { min-width: 0; }
.meta dt { font-size: var(--fs-xs); font-weight: 600; color: var(--qv-ink3); margin-bottom: 3px; }
.meta dd { margin: 0; font-weight: 600; color: var(--qv-ink); overflow-wrap: anywhere; }
.meta .wide { grid-column: 1 / -1; }
.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 0; margin: 0; }
.kv dt, .kv dd { padding: 10px 0; border-bottom: 1px solid var(--qv-line); margin: 0; }
.kv dt { color: var(--qv-ink2); font-size: var(--fs-sm); font-weight: 600; padding-right: 12px; }
.kv dd { font-weight: 550; overflow-wrap: anywhere; }
body.ph .kv { grid-template-columns: 116px minmax(0, 1fr); }
.kv > :nth-last-child(-n + 2) { border-bottom: 0; }
body.ph .kv { grid-template-columns: 128px minmax(0, 1fr); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--qv-lineStrong); overflow-x: auto; scrollbar-width: none; }
.tabs button, .tabs a {
  position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 14px; border: 0; background: none;
  font-size: var(--fs-md); font-weight: 650; color: var(--qv-ink2); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.tabs button:hover, .tabs a:hover { color: var(--qv-ink); background: var(--qv-surface2); }
.tabs .is-active, .tabs [aria-selected="true"] { color: var(--qv-g900); }
.tabs .is-active::after, .tabs [aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; background: var(--qv-g700); border-radius: 3px 3px 0 0; }
body.ph .tabs button, body.ph .tabs a { min-height: 50px; font-size: 16px; padding: 0 12px; }
.tab-panel { padding-top: var(--sp-5); }

/* Tally strip: labelled, clickable counts in one ruled block (never decorative) */
.tally { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--qv-surface); border: 1px solid var(--qv-line); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; }
.tally > a, .tally > div { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px 14px; color: var(--qv-ink); text-decoration: none; border-right: 1px solid var(--qv-line); border-bottom: 1px solid var(--qv-line); min-width: 0; transition: background var(--dur) var(--ease); }
.tally > :nth-child(4n) { border-right: 0; }
.tally > :nth-last-child(-n + 4) { border-bottom: 0; }
.tally > a:hover { background: var(--qv-g50); }
.tally .t-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--fs-sm); font-weight: 650; color: var(--qv-ink2); }
.tally .t-label .i { color: var(--qv-lineStrong); width: 16px; height: 16px; }
.tally > a:hover .t-label .i { color: var(--qv-g700); }
.tally .t-num { font-size: var(--fs-3xl); font-weight: 750; letter-spacing: -0.02em; line-height: 1.1; }
.tally .t-sub { font-size: var(--fs-xs); color: var(--qv-ink3); }
.tally .is-red .t-num { color: var(--qv-danger); }
.tally .is-orange .t-num { color: var(--qv-oInk); }
.tally .is-green .t-num { color: var(--qv-okInk); }
.tally-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tally-3 > :nth-child(4n) { border-right: 1px solid var(--qv-line); }
.tally-3 > :nth-child(3n) { border-right: 0; }
.tally-3 > :nth-last-child(-n + 4) { border-bottom: 1px solid var(--qv-line); }
.tally-3 > :nth-last-child(-n + 3) { border-bottom: 0; }
.tally-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tally-5 > :nth-child(4n) { border-right: 1px solid var(--qv-line); }
.tally-5 > :nth-child(5n), .tally-5 > :last-child { border-right: 0; }
.tally-5 > * { border-bottom: 0 !important; }
body.ph .tally { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.ph .tally > * { padding: 14px; border-right: 1px solid var(--qv-line); border-bottom: 1px solid var(--qv-line); }
body.ph .tally > :nth-child(2n) { border-right: 0; }
body.ph .tally > :nth-last-child(-n + 2) { border-bottom: 0; }
body.ph .tally .t-num { font-size: 30px; }
body.ph .tally .t-label { font-size: 15px; }

/* ===================== Filters ===================== */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 14px 16px; background: var(--qv-surface); border: 1px solid var(--qv-line); border-radius: var(--r-lg) var(--r-lg) 0 0; border-bottom: 0; }
.filters.solo { border-radius: var(--r-lg); border-bottom: 1px solid var(--qv-line); }
.filters .field { width: 158px; }
.filters .field.w-s { width: 112px; } .filters .field.w-l { width: 220px; } .filters .field.w-xl { flex: 1 1 240px; width: auto; max-width: 380px; }
.filters .field .input, .filters .field .select { min-height: 38px; padding-top: 6px; padding-bottom: 6px; }
.filters .spacer { flex: 1; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; background: var(--qv-surface2); border: 1px solid var(--qv-line); border-top: 1px solid var(--qv-line); border-bottom: 0; font-size: var(--fs-sm); color: var(--qv-ink2); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 11px; border-radius: var(--r-pill); background: var(--qv-surface); border: 1px solid var(--qv-lineStrong); font-size: var(--fs-sm); font-weight: 600; color: var(--qv-ink); }
.chip button { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: none; color: var(--qv-ink3); cursor: pointer; }
.chip button:hover { background: var(--qv-sunk); color: var(--qv-ink); }
.chip button .i { width: 14px; height: 14px; }
body.ph .filter-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin: 0 -16px 12px; padding: 0 16px 4px; scrollbar-width: none; }
body.ph .fchip { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 44px; padding: 0 14px; border-radius: var(--r-pill); border: 1.5px solid var(--qv-field); background: var(--qv-surface); font-size: 15.5px; font-weight: 650; color: var(--qv-ink); }
body.ph .fchip.is-on { background: var(--qv-g900); border-color: var(--qv-g900); color: #fff; }

/* ===================== Tables ===================== */
.table-wrap { overflow: auto; background: var(--qv-surface); border: 1px solid var(--qv-line); border-radius: 0 0 var(--r-lg) var(--r-lg); position: relative; }
.table-wrap.solo { border-radius: var(--r-lg); }
.table-wrap.tall { max-height: 560px; }
.table-wrap.in-panel { border: 0; border-radius: 0; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14.5px; }
.tbl th, .tbl td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--qv-line); }
.tbl thead th {
  position: sticky; top: 0; z-index: 2; background: var(--qv-surface2); color: var(--qv-ink2); font-size: 13.5px; font-weight: 700; line-height: 1.3;
  border-bottom: 1px solid var(--qv-lineStrong); vertical-align: bottom; white-space: nowrap;
}
.tbl thead th .col { display: block; font: 600 11.5px/1 var(--qv-mono); color: var(--qv-ink3); margin-bottom: 4px; letter-spacing: 0.04em; }
.tbl thead th.sortable { cursor: pointer; }
.tbl thead th .sort { display: inline-flex; vertical-align: -2px; color: var(--qv-ink3); }
.tbl thead th.is-sorted { color: var(--qv-g900); }
.tbl thead th.is-sorted .sort { color: var(--qv-g700); }
.tbl tbody tr { transition: background var(--dur) var(--ease); }
.tbl tbody tr:hover td { background: var(--qv-g50); }
.tbl tbody tr.is-link { cursor: pointer; }
.tbl tbody tr.is-selected td { background: var(--qv-g100); }
.tbl td.num, .tbl th.num { text-align: right; }
.tbl td.c, .tbl th.c { text-align: center; }
.tbl .t-nd { min-width: 260px; max-width: 420px; }
.tbl .t-nd b { font-weight: 650; display: block; }
.tbl .t-nd small { display: block; color: var(--qv-ink3); font-size: 13px; margin-top: 2px; }
.tbl .t-calc { background: oklch(0.975 0.004 160); }
.tbl thead th.t-calc { background: var(--qv-sunk); }
.tbl tfoot td { position: sticky; bottom: 0; background: var(--qv-surface); font-weight: 750; border-top: 3px double var(--qv-ink2); border-bottom: 0; }
.tbl tfoot td small { display: block; font-weight: 500; color: var(--qv-ink3); }
.tbl .sticky-col { position: sticky; left: 0; z-index: 1; background: var(--qv-surface); }
.tbl thead .sticky-col { z-index: 3; background: var(--qv-surface2); }
.tbl tbody tr:hover .sticky-col { background: var(--qv-g50); }
.tbl .stt { width: 44px; color: var(--qv-ink3); text-align: right; }
.tbl-compact { font-size: 14px; }
.tbl-compact th, .tbl-compact td { padding: 9px 9px; }
.tbl-compact .t-nd { min-width: 240px; }
.tbl td .tag, .tbl td .tt { white-space: normal; height: auto; min-height: 26px; padding-top: 3px; padding-bottom: 3px; line-height: 1.25; }
.tbl .group-row td { background: var(--qv-surface2); font-weight: 750; color: var(--qv-ink); padding-top: 9px; padding-bottom: 9px; }
.tbl .is-muted td { color: var(--qv-ink3); }
.tbl td .cell-input { width: 100%; min-height: 34px; padding: 5px 8px; font-size: 14.5px; }
.tbl td .cell-input.num { width: 76px; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; font-size: var(--fs-sm); color: var(--qv-ink2); background: var(--qv-surface); border: 1px solid var(--qv-line); border-top: 0; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.pager .pages { display: flex; gap: 4px; }
.pager .pages a, .pager .pages span { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 8px; border-radius: var(--r-md); color: var(--qv-ink2); text-decoration: none; font-weight: 650; border: 1px solid var(--qv-line); background: var(--qv-surface); }
.pager .pages a:hover { border-color: var(--qv-ink3); color: var(--qv-ink); }
.pager .pages .is-active { background: var(--qv-g900); border-color: var(--qv-g900); color: #fff; }
.table-wrap + .pager { margin-top: -1px; }
.has-pager { border-radius: 0; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: var(--fs-xs); color: var(--qv-ink2); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }

/* ===================== Notes, empty, toast, skeleton ===================== */
.note { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--qv-line); background: var(--qv-surface); font-size: var(--fs-md); line-height: 1.45; }
.note > .i { margin-top: 2px; }
.note .grow > * + * { margin-top: 4px; }
.note strong { font-weight: 700; }
.note .note-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.note-info { background: var(--qv-infoBg); border-color: oklch(0.85 0.06 252); color: oklch(0.3 0.08 256); }
.note-info > .i { color: var(--qv-infoInk); }
.note-warn { background: var(--qv-warnBg); border-color: #f0d78a; color: oklch(0.32 0.06 75); }
.note-warn > .i { color: var(--qv-warnInk); }
.note-danger { background: var(--qv-dangerBg); border-color: #f2b8a0; color: oklch(0.3 0.1 28); }
.note-danger > .i { color: var(--qv-dangerInk); }
.note-ok { background: var(--qv-okBg); border-color: #b9d7a6; color: oklch(0.3 0.07 140); }
.note-ok > .i { color: var(--qv-okInk); }
.note-green { background: var(--qv-g900); border-color: var(--qv-g900); color: #fff; }
.note-green > .i { color: var(--qv-o500); }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 48px 24px; color: var(--qv-ink2); }
.empty .empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 72px; height: 72px; border-radius: 50%; background: var(--qv-g50); color: var(--qv-g700); border: 1px solid var(--qv-g100); }
.empty h2, .empty h3 { color: var(--qv-ink); font-size: var(--fs-lg); }
.empty p { max-width: 46ch; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: var(--z-toast); display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 12px 10px 16px; background: var(--qv-g950); color: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-3); font-weight: 600; max-width: calc(100vw - 32px); animation: toast-in 260ms var(--ease); }
.toast .i { color: var(--qv-o500); }
.toast .btn { min-height: 36px; }
body.ph .toast { bottom: 84px; width: calc(100% - 24px); font-size: 16px; }
body.ph .toast.over-actbar { bottom: 160px; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }
.skel { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--qv-sunk) 0 40%, var(--qv-surface2) 50%, var(--qv-sunk) 60% 100%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ===================== Dialog, sheet, popover ===================== */
dialog.dlg { padding: 0; border: 0; border-radius: var(--r-lg); box-shadow: var(--sh-3); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); color: var(--qv-ink); background: var(--qv-surface); }
dialog.dlg::backdrop { background: oklch(0.2 0.03 160 / 0.55); }
dialog.dlg[open] { animation: dlg-in 220ms var(--ease); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(10px) scale(0.985); } }
.dlg-static { position: fixed; inset: 0; z-index: var(--z-backdrop); display: flex; align-items: center; justify-content: center; padding: 24px; background: oklch(0.2 0.03 160 / 0.55); }
.dlg-static > .dlg-box { width: min(560px, 100%); max-height: calc(100vh - 48px); overflow: auto; background: var(--qv-surface); border-radius: var(--r-lg); box-shadow: var(--sh-3); z-index: var(--z-dialog); }
.dlg-static.wide > .dlg-box, dialog.dlg.wide { width: min(720px, calc(100vw - 32px)); }
.dlg-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--qv-line); }
.dlg-head h2 { font-size: var(--fs-xl); flex: 1; }
.dlg-head p { color: var(--qv-ink2); font-size: var(--fs-sm); margin-top: 4px; }
.dlg-body { padding: 18px 20px; }
.dlg-body > * + * { margin-top: 14px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--qv-line); background: var(--qv-surface2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
body.ph .dlg-static { align-items: flex-end; padding: 0; }
body.ph .dlg-static > .dlg-box { border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 88vh; }
body.ph .dlg-foot { flex-direction: column-reverse; }
body.ph .dlg-foot .btn { width: 100%; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-dialog); max-height: calc(100vh - 56px); overflow-y: auto; background: var(--qv-surface); border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--sh-3); max-width: 480px; margin: 0 auto; }
.sheet::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--qv-lineStrong); margin: 10px auto 2px; }
.sheet-backdrop { position: fixed; inset: 0; z-index: var(--z-backdrop); background: oklch(0.2 0.03 160 / 0.5); }
.sum-list { display: grid; gap: 0; border: 1px solid var(--qv-line); border-radius: var(--r-md); }
.sum-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--qv-line); }
.sum-list > div:last-child { border-bottom: 0; }
.sum-list .ok { color: var(--qv-okInk); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.sum-list .bad { color: var(--qv-danger); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }

/* ===================== 6 Rõ form ===================== */
.ro-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: start; }
.ro-rail { position: sticky; top: calc(var(--top-h) + 20px); display: grid; gap: 2px; }
.ro-rail a { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-md); text-decoration: none; color: var(--qv-ink2); font-weight: 600; }
.ro-rail a:hover { background: var(--qv-surface); color: var(--qv-ink); }
.ro-rail a.is-current { background: var(--qv-surface); color: var(--qv-ink); box-shadow: var(--sh-1); }
.ro-rail .n { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--qv-field); font: 750 14px/1 var(--qv-mono); color: var(--qv-ink2); background: var(--qv-surface); }
.ro-rail a.is-done .n { background: var(--qv-g700); border-color: var(--qv-g700); color: #fff; }
.ro-rail a.is-bad .n { background: var(--qv-danger); border-color: var(--qv-danger); color: #fff; }
.ro-rail .ro-st { font-size: 12.5px; font-weight: 650; }
.ro-rail a.is-done .ro-st { color: var(--qv-okInk); }
.ro-rail a.is-bad .ro-st { color: var(--qv-danger); }
.ro-rail .rail-foot { margin-top: 14px; padding: 12px; border-top: 1px solid var(--qv-line); font-size: var(--fs-sm); color: var(--qv-ink2); }
.ro { background: var(--qv-surface); border: 1px solid var(--qv-line); border-radius: var(--r-lg); box-shadow: var(--sh-1); scroll-margin-top: 80px; }
.ro + .ro { margin-top: 16px; }
.ro-head { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--qv-line); }
.ro-head .n { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--qv-g900); color: #fff; font: 750 15px/1 var(--qv-mono); }
.ro-head h2 { font-size: var(--fs-lg); }
.ro-head p { font-size: var(--fs-sm); color: var(--qv-ink2); }
.ro-head .ro-state { margin-left: auto; }
.ro-body { padding: 18px; }
.ro.is-bad { border-color: var(--qv-danger); box-shadow: 0 0 0 1px var(--qv-danger); }
.ro.is-bad .ro-head { background: #fff6f4; border-bottom-color: #f2b8a0; }
.ro.is-bad .ro-head .n { background: var(--qv-danger); }
.vd { display: grid; gap: 4px; margin-top: 6px; padding: 8px 10px; background: var(--qv-surface2); border-radius: var(--r-sm); font-size: 13.5px; line-height: 1.4; }
.vd > span { display: grid; grid-template-columns: 16px auto minmax(0, 1fr); gap: 6px; align-items: start; }
.vd .i { width: 15px; height: 15px; margin-top: 2px; stroke-width: 2.2; }
.vd .x { color: var(--qv-danger); }
.vd .v { color: var(--qv-okInk); }
.vd b { font-weight: 700; color: var(--qv-ink2); }
.form-foot { position: sticky; bottom: 0; z-index: var(--z-sticky); display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding: 14px 18px; background: var(--qv-surface); border: 1px solid var(--qv-line); border-radius: var(--r-lg); box-shadow: 0 -4px 18px oklch(0.22 0.02 165 / 0.08); }
.sub-list { display: grid; gap: 8px; }
.sub-item { display: grid; grid-template-columns: 28px 30px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.sub-item .grip { color: var(--qv-ink3); cursor: grab; display: inline-flex; justify-content: center; }
.sub-item .k { font: 700 13px/1 var(--qv-mono); color: var(--qv-ink3); text-align: right; }

/* ===================== PDF viewer & official document ===================== */
.viewer { display: flex; flex-direction: column; background: oklch(0.36 0.012 165); border-radius: var(--r-lg); overflow: hidden; min-height: 640px; }
.viewer-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; background: oklch(0.26 0.012 165); color: #fff; font-size: var(--fs-sm); }
.viewer-bar .fn { flex: 1; min-width: 0; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-bar .icon-btn { color: #fff; width: 36px; height: 36px; }
.viewer-bar .icon-btn:hover { background: oklch(1 0 0 / 0.1); color: #fff; }
.viewer-stage { flex: 1; display: flex; justify-content: center; padding: 20px; overflow: auto; }
.viewer-files { display: flex; gap: 6px; padding: 8px 10px; background: oklch(0.3 0.012 165); overflow-x: auto; }
.viewer-files a { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: var(--r-sm); color: oklch(0.9 0.01 165); font-size: 13px; text-decoration: none; white-space: nowrap; }
.viewer-files a.is-active { background: oklch(1 0 0 / 0.14); color: #fff; font-weight: 650; }
.doc-page { width: 100%; max-width: 560px; background: #fff; color: #111; font-family: var(--qv-serif); font-size: 13.5px; line-height: 1.5; padding: 40px 44px 52px; box-shadow: 0 2px 10px oklch(0 0 0 / 0.35); }
.doc-page .dh { display: grid; grid-template-columns: 1fr 1.35fr; gap: 12px; text-align: center; font-size: 12.5px; line-height: 1.35; }
.doc-page .dh b { display: block; }
.doc-page .dh u { text-decoration: none; display: inline-block; border-bottom: 1px solid #111; padding-bottom: 1px; }
.doc-page .dh .so { margin-top: 6px; }
.doc-page .dh i { display: block; margin-top: 8px; }
.doc-page .vv { margin-top: 14px; text-align: left; font-size: 12.5px; width: 45%; text-align: center; }
.doc-page .kg { margin-top: 16px; text-align: center; font-weight: 700; }
.doc-page p { text-indent: 28px; text-align: justify; margin-top: 8px; }
.doc-page .sign { display: grid; grid-template-columns: 1fr 1fr; margin-top: 22px; font-size: 12.5px; }
.doc-page .sign .r { text-align: center; font-weight: 700; }
.doc-page .sign .r span { display: block; margin-top: 46px; }
.doc-page .stamp-in { position: relative; display: inline-block; margin-top: 10px; padding: 6px 10px; border: 2px solid oklch(0.45 0.15 260); color: oklch(0.45 0.15 260); font-family: var(--qv-font); font-size: 11px; font-weight: 700; transform: rotate(-3deg); line-height: 1.3; }
.pdf-thumb { display: block; width: 64px; height: 84px; background: #fff; border: 1px solid var(--qv-lineStrong); border-radius: 2px; padding: 8px 7px; box-shadow: var(--sh-1); }
.pdf-thumb i { display: block; height: 3px; background: oklch(0.82 0.005 165); margin-bottom: 4px; border-radius: 1px; }
.pdf-thumb i:nth-child(1) { width: 60%; margin: 0 auto 6px; background: oklch(0.6 0.005 165); }
.pdf-thumb i:nth-child(3n) { width: 72%; }

/* ===================== Photos (Trước / Sau) ===================== */
.photo { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: var(--r-md); overflow: hidden; background: #8c9892; }
.scene { position: absolute; inset: 0; background:
  linear-gradient(180deg, oklch(0.82 0.03 225) 0 34%, oklch(0.62 0.04 150) 34% 41%, oklch(0.55 0.008 165) 41% 100%); }
.scene::after { content: ""; position: absolute; left: 0; right: 0; top: 62%; height: 3px; background: repeating-linear-gradient(90deg, oklch(0.92 0 0) 0 26px, transparent 26px 48px); opacity: 0.8; }
.scene.truoc { background:
  radial-gradient(ellipse 22% 14% at 36% 74%, oklch(0.42 0.05 70) 0 70%, transparent 72%),
  radial-gradient(ellipse 15% 10% at 58% 79%, oklch(0.5 0.07 60) 0 70%, transparent 72%),
  radial-gradient(ellipse 10% 7% at 26% 83%, oklch(0.62 0.06 95) 0 70%, transparent 72%),
  linear-gradient(180deg, oklch(0.82 0.03 225) 0 34%, oklch(0.62 0.04 150) 34% 41%, oklch(0.55 0.008 165) 41% 100%); }
.scene.tree { background:
  radial-gradient(ellipse 30% 22% at 60% 60%, oklch(0.42 0.09 145) 0 70%, transparent 72%),
  linear-gradient(170deg, transparent 0 58%, oklch(0.38 0.05 60) 58% 62%, transparent 62%),
  linear-gradient(180deg, oklch(0.8 0.03 225) 0 34%, oklch(0.6 0.04 150) 34% 41%, oklch(0.55 0.008 165) 41% 100%); }
.scene.truck { background:
  linear-gradient(90deg, transparent 0 22%, oklch(0.45 0.09 155) 22% 62%, oklch(0.9 0.01 160) 62% 76%, transparent 76%) 0 42% / 100% 32% no-repeat,
  linear-gradient(180deg, oklch(0.78 0.02 225) 0 40%, oklch(0.5 0.01 165) 40% 100%); }
.photo .stamp { position: absolute; left: 6px; right: 6px; bottom: 6px; padding: 3px 6px; background: oklch(0 0 0 / 0.62); color: #fff; font: 600 11px/1.3 var(--qv-mono); border-radius: 2px; }
.photo .ptag { position: absolute; left: 6px; top: 6px; padding: 2px 7px; border-radius: 3px; background: var(--qv-g950); color: #fff; font-size: 12px; font-weight: 700; }
.photo .ptag.sau { background: var(--qv-okSolid); }
.photo .ptag.lib { background: oklch(0.42 0.01 250); }
.photo.photo-xs { width: 64px; border-radius: var(--r-sm); }
.photo.photo-xs .ptag, .photo.photo-xs .stamp { display: none; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shot {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; aspect-ratio: 4 / 3;
  border: 2px dashed var(--qv-field); border-radius: var(--r-lg); background: var(--qv-surface); color: var(--qv-ink); font-weight: 750; font-size: 17px; cursor: pointer;
}
.shot .i { width: 32px; height: 32px; color: var(--qv-g700); }
.shot small { font-weight: 500; color: var(--qv-ink2); font-size: 14px; }
.shot:hover { border-color: var(--qv-g700); background: var(--qv-g50); }
.shot-filled { position: relative; }
.shot-filled .redo { position: absolute; right: 6px; top: 6px; display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 10px; border: 0; border-radius: var(--r-pill); background: oklch(1 0 0 / 0.92); color: var(--qv-ink); font-size: 13.5px; font-weight: 700; }
.tray { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border: 1px solid var(--qv-danger); border-radius: var(--r-md); background: #fff6f4; }

/* ===================== Stepper (+1/+5) ===================== */
.qty { display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px 64px; gap: 8px; align-items: stretch; }
.qty button { min-height: 64px; border: 1.5px solid var(--qv-field); border-radius: var(--r-lg); background: var(--qv-surface); font-size: 22px; font-weight: 800; color: var(--qv-ink); cursor: pointer; }
.qty button:hover { background: var(--qv-g50); border-color: var(--qv-g700); }
.qty button:active { background: var(--qv-g100); }
.qty .q-in { position: relative; }
.qty .q-in input { width: 100%; height: 100%; min-height: 64px; padding: 0 56px 0 12px; border: 2px solid var(--qv-g700); border-radius: var(--r-lg); font: 800 32px/1 var(--qv-font); text-align: center; color: var(--qv-ink); background: #fff; }
.qty .q-in span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 16px; font-weight: 700; color: var(--qv-ink2); }
.big-num { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }
.big-num small { font-size: 18px; font-weight: 700; color: var(--qv-ink2); letter-spacing: 0; }

/* ===================== Status path (máy trạng thái nhiệm vụ) ===================== */
.flow { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); list-style: none; margin: 4px 0 20px; background: var(--qv-surface); border: 1px solid var(--qv-line); border-radius: var(--r-lg); padding: 14px 8px 12px; }
.flow li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 0 6px; font-size: 13px; color: var(--qv-ink3); font-weight: 600; line-height: 1.25; }
.flow li::before { content: ""; position: absolute; top: 11px; left: calc(-50% + 14px); right: calc(50% + 14px); height: 2px; background: var(--qv-line); }
.flow li:first-child::before { display: none; }
.flow .fd { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--qv-surface); border: 2px solid var(--qv-lineStrong); font: 700 11.5px/1 var(--qv-mono); color: var(--qv-ink3); }
.flow .fd .i { width: 14px; height: 14px; stroke-width: 2.6; }
.flow small { display: block; font-weight: 500; font-size: 12px; color: var(--qv-ink3); }
.flow li.is-done { color: var(--qv-ink2); }
.flow li.is-done .fd { background: var(--qv-g700); border-color: var(--qv-g700); color: #fff; }
.flow li.is-done::before, .flow li.is-now::before { background: var(--qv-g700); }
.flow li.is-now { color: var(--qv-ink); font-weight: 750; }
.flow li.is-now .fd { border-color: var(--qv-o600); background: var(--qv-o500); color: var(--qv-g950); box-shadow: 0 0 0 4px var(--qv-o100); }
.flow .side { color: var(--qv-ink3); }

/* ===================== Timeline (Lịch sử) ===================== */
.tl { list-style: none; position: relative; }
.tl > li { position: relative; display: grid; grid-template-columns: 112px 20px minmax(0, 1fr); gap: 10px; padding-bottom: 18px; }
.tl > li::before { content: ""; position: absolute; left: 131px; top: 18px; bottom: 0; width: 2px; background: var(--qv-line); }
.tl > li:last-child::before { display: none; }
.tl time { font-size: var(--fs-sm); color: var(--qv-ink2); text-align: right; line-height: 1.3; font-variant-numeric: tabular-nums; }
.tl time small { display: block; color: var(--qv-ink3); }
.tl .dot { width: 12px; height: 12px; margin: 4px auto 0; border-radius: 50%; background: var(--qv-surface); border: 2.5px solid var(--qv-g700); position: relative; z-index: 1; }
.tl .dot.o { border-color: var(--qv-o600); } .tl .dot.r { border-color: var(--qv-danger); } .tl .dot.k { border-color: var(--qv-ink3); } .tl .dot.ok { background: var(--qv-okSolid); border-color: var(--qv-okSolid); }
.tl .what { line-height: 1.45; }
.tl .what b { font-weight: 700; }
.tl .what .chg { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: var(--fs-sm); padding: 3px 8px; background: var(--qv-surface2); border-radius: var(--r-sm); }
.tl .what .chg del { color: var(--qv-ink3); }
.tl .what .chg ins { text-decoration: none; font-weight: 700; }
.tl .what .why { display: block; font-size: var(--fs-sm); color: var(--qv-ink2); margin-top: 3px; }
body.ph .tl > li { grid-template-columns: 20px minmax(0, 1fr); }
body.ph .tl > li::before { left: 9px; }
body.ph .tl time { text-align: left; grid-column: 2; order: -1; }
body.ph .tl .dot { grid-row: 1 / span 2; }

/* ===================== Phone cards ===================== */
.vc { display: block; background: var(--qv-surface); border: 1.5px solid var(--qv-lineStrong); border-radius: var(--r-lg); padding: 14px 16px 16px; color: var(--qv-ink); text-decoration: none; }
.vc + .vc { margin-top: 12px; }
.vc.is-p1 { border: 2px solid var(--qv-danger); }
.vc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vc-top .ma { margin-right: auto; }
.vc-title { display: block; margin-top: 8px; font-size: 18px; font-weight: 700; line-height: 1.35; }
.vc-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; color: var(--qv-ink2); font-size: 15.5px; }
.vc-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.vc-meta .i { color: var(--qv-ink3); }
.vc .td { margin-top: 12px; }
.vc .td-bar { height: 12px; border-radius: 6px; }
.vc .td-bar > i { border-radius: 6px; }
.vc .td b { font-size: 16px; }
.vc .vc-acts { display: flex; gap: 8px; margin-top: 14px; }
.vc .vc-acts .btn { flex: 1; min-height: 52px; font-size: 17px; }
.vc .st { margin-top: 10px; }
a.vc:hover { border-color: var(--qv-g700); }
.list-card { background: var(--qv-surface); border: 1.5px solid var(--qv-lineStrong); border-radius: var(--r-lg); overflow: hidden; }
.list-card > a, .list-card > div.li { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 14px 12px 16px; border-bottom: 1px solid var(--qv-line); color: var(--qv-ink); text-decoration: none; }
.list-card > :last-child { border-bottom: 0; }
.list-card > a:hover { background: var(--qv-g50); }
.list-card .li-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none; border-radius: var(--r-md); background: var(--qv-g50); color: var(--qv-g700); border: 1px solid var(--qv-g100); }
.list-card .li-icon.red { background: var(--qv-dangerBg); color: var(--qv-dangerInk); border-color: #f2b8a0; }
.list-card .li-icon.orange { background: var(--qv-o100); color: var(--qv-oInk); border-color: oklch(0.88 0.07 58); }
.list-card .li-icon.purple { background: var(--tt07-bg); color: var(--tt07-ink); border-color: var(--tt07-bd); }
.list-card .li-icon.blue { background: var(--qv-infoBg); color: var(--qv-infoInk); border-color: oklch(0.85 0.06 252); }
.list-card .li-main { flex: 1; min-width: 0; }
.list-card .li-main strong { display: block; font-size: 17px; line-height: 1.3; }
.list-card .li-main > span { display: block; color: var(--qv-ink2); font-size: 15px; line-height: 1.35; margin-top: 2px; }
.list-card .li-num { font-size: 26px; font-weight: 800; min-width: 36px; text-align: right; }
.list-card .chev { color: var(--qv-ink3); }
/* Ca hôm nay — the one drenched surface on the field home */
.ca-card { background: var(--qv-g900); color: #fff; border-radius: var(--r-lg); padding: 16px; box-shadow: var(--sh-2); }
.ca-card .ca-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ca-card .ca-top .tag { background: oklch(1 0 0 / 0.14); color: #fff; }
.ca-card h2 { font-size: 22px; margin-top: 8px; }
.ca-card .ca-route { color: var(--qv-g200); font-size: 16px; margin-top: 2px; }
.ca-card .ca-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 14px 0; border: 1px solid oklch(1 0 0 / 0.16); border-radius: var(--r-md); }
.ca-card .ca-facts > div { padding: 10px; border-right: 1px solid oklch(1 0 0 / 0.16); }
.ca-card .ca-facts > div:last-child { border-right: 0; }
.ca-card .ca-facts dt { font-size: 13.5px; color: var(--qv-g200); }
.ca-card .ca-facts dd { margin: 2px 0 0; font-size: 21px; font-weight: 800; }
.ca-card .ca-facts dd small { font-size: 14px; font-weight: 600; color: var(--qv-g200); }
.ca-card .btn { min-height: 56px; font-size: 18px; }
.sos { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 72px; padding: 0 18px; margin-top: 12px; border: 2px solid var(--qv-o600); border-radius: var(--r-lg); background: var(--qv-o500); color: var(--qv-g950); font-size: 20px; font-weight: 800; text-decoration: none; }
.sos .i { width: 30px; height: 30px; stroke-width: 2.1; }
.sos small { display: block; font-size: 14.5px; font-weight: 600; }
.sos:hover { background: var(--qv-o400); color: var(--qv-g950); }
.wait-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.wait { display: flex; flex-direction: column; gap: 4px; padding: 14px; min-height: 104px; background: var(--qv-surface); border: 1.5px solid var(--qv-lineStrong); border-radius: var(--r-lg); color: var(--qv-ink); text-decoration: none; }
.wait b { font-size: 32px; line-height: 1; font-weight: 800; }
.wait span { font-size: 15.5px; font-weight: 650; line-height: 1.3; }
.wait:hover { border-color: var(--qv-g700); background: var(--qv-g50); }
.wait.is-hot { border-color: var(--qv-o600); background: var(--qv-o100); }

/* Desktop home blocks */
.home-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.inbox { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--qv-line); border-radius: var(--r-lg); background: var(--qv-surface); box-shadow: var(--sh-1); overflow: hidden; }
.inbox > a { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; color: var(--qv-ink); text-decoration: none; border-right: 1px solid var(--qv-line); transition: background var(--dur) var(--ease); }
.inbox > a:last-child { border-right: 0; }
.inbox > a:hover { background: var(--qv-g50); }
.inbox .ib-top { display: flex; align-items: center; justify-content: space-between; color: var(--qv-ink3); }
.inbox b { font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.inbox span { font-weight: 650; color: var(--qv-ink2); font-size: var(--fs-sm); line-height: 1.35; }
.inbox > a.is-hot { background: var(--qv-o100); }
.inbox > a.is-hot b { color: var(--qv-oInk); }
.rows { list-style: none; }
.rows > li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 18px; border-bottom: 1px solid var(--qv-line); }
.rows > li:last-child { border-bottom: 0; }
.rows > li:hover { background: var(--qv-g50); }
.rows .r-main { min-width: 0; }
.rows .r-main a { color: var(--qv-ink); text-decoration: none; font-weight: 650; }
.rows .r-main a:hover { color: var(--qv-g700); text-decoration: underline; }
.rows .r-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 4px; color: var(--qv-ink2); font-size: var(--fs-sm); }
.rows .r-end { text-align: right; display: grid; justify-items: end; gap: 4px; }
.reasons { display: flex; flex-wrap: wrap; gap: 6px; }

/* ===================== Charts (HTML/CSS bars, every bar is a link) ===================== */
.bars { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 0 10px; }
.bars .axis { position: relative; height: 260px; font-size: 12.5px; color: var(--qv-ink3); }
.bars .axis span { position: absolute; right: 0; transform: translateY(50%); }
.bars .plot { position: relative; height: 260px; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: end; gap: 10px; border-bottom: 1.5px solid var(--qv-ink3);
  background: repeating-linear-gradient(0deg, transparent 0 51px, var(--qv-line) 51px 52px); }
.bars .grp { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 4px; text-decoration: none; color: var(--qv-ink); border-radius: var(--r-sm) var(--r-sm) 0 0; }
.bars .grp:hover { background: oklch(0.71 0.185 50 / 0.1); }
.bars .bar { position: relative; width: 38%; max-width: 26px; height: calc(var(--v) / var(--max) * 100%); border-radius: 3px 3px 0 0; }
.bars .bar.b1 { background: var(--qv-g200); box-shadow: inset 0 0 0 1px var(--qv-g300); }
.bars .bar.b2 { background: var(--qv-g700); }
.bars .bar em { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 3px; font-style: normal; font-size: 12px; font-weight: 750; color: var(--qv-ink2); }
.bars .labels { grid-column: 2; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; padding-top: 8px; }
.bars .labels a { text-align: center; font: 700 12.5px/1.2 var(--qv-mono); color: var(--qv-ink2); text-decoration: none; }
.bars .labels a:hover { color: var(--qv-g700); text-decoration: underline; }
.key { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--qv-ink2); }
.key i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.key .k1 { background: var(--qv-g200); box-shadow: inset 0 0 0 1px var(--qv-g300); } .key .k2 { background: var(--qv-g700); }
.stack-bar { display: flex; height: 14px; border-radius: 3px; overflow: hidden; background: var(--qv-sunk); }
.stack-bar i { display: block; height: 100%; }

/* ===================== Camera (S6) ===================== */
body.cam { background: #0b0f0d; color: #fff; }
.cam-top { display: flex; align-items: center; gap: 6px; height: 60px; padding: 0 6px; }
.cam-top h1 { flex: 1; font-size: 18px; }
.cam-top .icon-btn { color: #fff; width: 48px; height: 48px; }
.cam-top .icon-btn:hover { background: oklch(1 0 0 / 0.1); color: #fff; }
.cam-view { position: relative; margin: 0 12px; aspect-ratio: 3 / 4; max-height: 50vh; border-radius: var(--r-lg); overflow: hidden; background: radial-gradient(ellipse at 50% 40%, oklch(0.42 0.01 165), oklch(0.18 0.01 165)); }
.cam-paper { position: absolute; left: 13%; right: 13%; top: 9%; bottom: 9%; background: oklch(0.95 0.005 95); transform: rotate(-2deg); box-shadow: 0 6px 20px oklch(0 0 0 / 0.5); padding: 18px 16px; }
.cam-paper i { display: block; height: 4px; background: oklch(0.7 0.005 165); margin-bottom: 8px; border-radius: 2px; }
.cam-paper i:nth-child(1) { width: 40%; } .cam-paper i:nth-child(2) { width: 50%; margin-left: auto; } .cam-paper i:nth-child(4) { width: 70%; margin: 14px auto; background: oklch(0.45 0.005 165); }
.cam-frame { position: absolute; left: 9%; right: 9%; top: 6%; bottom: 6%; border: 2px solid var(--qv-o500); border-radius: 6px; }
.cam-hint { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; font-size: 14.5px; font-weight: 650; }
.cam-hint span { background: oklch(0 0 0 / 0.6); padding: 4px 10px; border-radius: var(--r-pill); }
.pages-strip { display: flex; gap: 10px; padding: 14px 12px 4px; overflow-x: auto; }
.pg { position: relative; flex: none; width: 84px; }
.pg .pg-img { width: 84px; height: 110px; border-radius: var(--r-sm); background: oklch(0.95 0.005 95); border: 2px solid transparent; padding: 10px 8px; }
.pg .pg-img i { display: block; height: 3px; margin-bottom: 5px; background: oklch(0.7 0.005 165); border-radius: 1px; }
.pg.is-sel .pg-img { border-color: var(--qv-o500); }
.pg .pg-no { position: absolute; top: -6px; left: -6px; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--qv-o500); color: var(--qv-g950); font-weight: 800; font-size: 14px; }
.pg .pg-rot .pg-img { transform: rotate(90deg); }
.pg-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 10px 12px; }
.pg-tools button { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 60px; border: 1px solid oklch(1 0 0 / 0.18); border-radius: var(--r-md); background: oklch(1 0 0 / 0.06); color: #fff; font-size: 13.5px; font-weight: 650; cursor: pointer; }
.pg-tools button:hover { background: oklch(1 0 0 / 0.12); }
.cam-bottom { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 10px 16px 18px; }
.shutter { width: 76px; height: 76px; border-radius: 50%; border: 4px solid #fff; background: oklch(1 0 0 / 0.15); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.shutter::after { content: ""; width: 58px; height: 58px; border-radius: 50%; background: #fff; }
.cam-bottom .btn-accent { min-height: 56px; font-size: 17px; }
.cam-bottom .lib { justify-self: start; display: inline-flex; flex-direction: column; align-items: center; gap: 2px; color: #fff; font-size: 13px; font-weight: 650; text-decoration: none; }

/* ===================== Login, offline, forbidden ===================== */
.auth { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }
.auth-side { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 48px 56px; background: var(--qv-g900); color: #fff; overflow: hidden; }
.auth-side::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 10px; background: repeating-linear-gradient(-45deg, var(--qv-o500) 0 18px, var(--qv-g900) 18px 36px); opacity: 0.9; }
.auth-org { display: flex; align-items: center; gap: 14px; }
.auth-org .logo { width: 52px; height: 52px; }
.auth-org strong { display: block; font-size: 22px; letter-spacing: -0.01em; }
.auth-org small { display: block; color: var(--qv-g200); font-size: 14px; }
.auth-side h2 { font-size: 32px; line-height: 1.2; max-width: 18ch; margin-top: 64px; }
.auth-side .lead { color: var(--qv-g200); font-size: 17px; max-width: 46ch; margin-top: 14px; }
.ro-list { list-style: none; margin-top: 34px; border-top: 1px solid oklch(1 0 0 / 0.14); max-width: 520px; }
.ro-list li { display: grid; grid-template-columns: 34px 140px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 11px 0; border-bottom: 1px solid oklch(1 0 0 / 0.14); }
.ro-list .n { font: 700 14px/1 var(--qv-mono); color: var(--qv-o500); }
.ro-list b { font-size: 16px; }
.ro-list span { color: var(--qv-g200); font-size: 14.5px; }
.auth-foot { color: var(--qv-g200); font-size: 13.5px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px; }
.auth-form { width: 100%; max-width: 400px; }
.auth-form h1 { font-size: 28px; }
.auth-form .sub { color: var(--qv-ink2); margin-top: 6px; }
.auth-form .input { min-height: 48px; font-size: 16px; }
.auth-form .btn { min-height: 50px; font-size: 17px; }
.pw { position: relative; }
.pw .input { padding-right: 52px; }
.pw button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 0; background: none; color: var(--qv-ink2); border-radius: var(--r-md); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.pw button:hover { background: var(--qv-surface2); }
.auth-help { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--qv-line); color: var(--qv-ink2); font-size: var(--fs-sm); }
.ph-auth-top { background: var(--qv-g900); color: #fff; padding: 36px 20px 64px; position: relative; }
.ph-auth-top::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: repeating-linear-gradient(-45deg, var(--qv-o500) 0 14px, var(--qv-g900) 14px 28px); }
.ph-auth-top .auth-org .logo { width: 48px; height: 48px; }
.ph-auth-card { margin: -36px 16px 24px; position: relative; background: var(--qv-surface); border-radius: var(--r-lg); box-shadow: var(--sh-2); padding: 22px 18px; }
.center-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px 24px; gap: 14px; }
.center-page .big-icon { display: inline-flex; align-items: center; justify-content: center; width: 96px; height: 96px; border-radius: 50%; background: var(--qv-sunk); color: var(--qv-ink2); }
.center-page .big-icon .i { width: 46px; height: 46px; stroke-width: 1.7; }
.center-page h1 { font-size: 26px; }
.center-page p { max-width: 34ch; color: var(--qv-ink2); font-size: 17px; }
.center-page .btn { min-width: 220px; }

/* ===================== Print (S41) ===================== */
body.print-view { background: oklch(0.5 0.01 165); padding: 28px 0 48px; }
.print-bar { position: sticky; top: 0; z-index: var(--z-sticky); display: flex; align-items: center; gap: 10px; max-width: 297mm; margin: -28px auto 20px; padding: 10px 0; color: #fff; }
.print-bar .grow { font-weight: 650; }
.a4 { background: #fff; color: #000; font-family: var(--qv-serif); margin: 0 auto 24px; box-shadow: 0 6px 24px oklch(0 0 0 / 0.35); position: relative; }
.a4-land { width: 297mm; min-height: 210mm; padding: 12mm 12mm 14mm; }
.a4-port { width: 210mm; min-height: 297mm; padding: 16mm 18mm 18mm 22mm; }
.a4 .pr-head { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; text-align: center; font-size: 12.5pt; line-height: 1.35; }
.a4 .pr-head b { display: block; }
.a4 .pr-head u { text-decoration: none; display: inline-block; border-bottom: 1px solid #000; padding-bottom: 2px; }
.a4 .pr-title { margin-top: 14px; text-align: center; }
.a4 .pr-title h1 { font-size: 16pt; font-weight: 700; letter-spacing: 0.01em; text-transform: uppercase; }
.a4 .pr-title p { font-size: 12pt; margin-top: 4px; font-style: italic; }
.a4 table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 10.5pt; line-height: 1.3; }
.a4 th, .a4 td { border: 0.75pt solid #000; padding: 4px 5px; vertical-align: top; text-align: left; }
.a4 thead { display: table-header-group; }
.a4 thead th { background: #e8ece9; font-weight: 700; text-align: center; vertical-align: middle; }
.a4 td.num { text-align: right; }
.a4 td.c { text-align: center; }
.a4 tfoot td { font-weight: 700; }
.a4 .pr-mono { font-family: var(--qv-mono); font-size: 9pt; }
.a4 td.pr-mono { white-space: nowrap; font-size: 8pt; }
.a4 .pr-sign { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 18px; text-align: center; font-size: 12pt; }
.a4 .pr-sign b { display: block; }
.a4 .pr-sign i { display: block; font-size: 10.5pt; }
.a4 .pr-sign .name { margin-top: 64px; font-weight: 700; }
.a4 .pr-date { text-align: right; font-style: italic; font-size: 12pt; margin-top: 12px; padding-right: 8%; }
.a4 .pr-foot { position: absolute; left: 12mm; right: 12mm; bottom: 6mm; display: flex; justify-content: space-between; font-family: var(--qv-font); font-size: 8pt; color: #444; }
.a4 .form-tbl td:first-child { width: 34%; font-weight: 700; background: #f4f6f5; }
.a4 .pr-sec { margin-top: 14px; font-size: 12.5pt; font-weight: 700; }
.a4 .pr-p { font-size: 12.5pt; line-height: 1.5; margin-top: 6px; text-align: justify; }
.a4 .box { border: 0.75pt solid #000; padding: 8px 10px; margin-top: 6px; min-height: 22mm; font-size: 12pt; }
.a4 .tt-print { font-family: var(--qv-font); font-size: 8.5pt; font-weight: 700; padding: 1px 4px; border: 0.75pt solid #000; white-space: nowrap; }
@page { size: A4 landscape; margin: 0; }
@page doc { size: A4 portrait; margin: 0; }
.a4-port { page: doc; }
@media print {
  body.print-view { background: #fff; padding: 0; }
  .print-bar { display: none; }
  .a4 { box-shadow: none; margin: 0; page-break-after: always; }
  .a4 thead th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ===================== Responsive & motion ===================== */
@media (max-width: 1180px) {
  :root { --side-w: 224px; }
  .qv-top .search { width: 280px; }
  .g-main, .g-main-wide { grid-template-columns: minmax(0, 1fr); }
  .home-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .qv-app { grid-template-columns: minmax(0, 1fr); }
  .qv-side { position: fixed; inset: 0 auto 0 0; width: 280px; transform: translateX(-100%); transition: transform var(--dur) var(--ease); }
  .qv-side.is-open { transform: none; box-shadow: var(--sh-3); }
  .menu-btn { display: inline-flex !important; }
  .qv-top { padding: 0 16px; }
  .qv-page { padding: 18px 16px 48px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .tally, .inbox { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ro-layout { grid-template-columns: minmax(0, 1fr); }
  .ro-rail { display: none; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { display: none; }
  .form-grid > [class*="c-"] { grid-column: span 12; }
}
.menu-btn { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
/* qv-demo:start */
.qvd-handle { position: fixed; right: 0; top: 42%; z-index: 2147483000; width: 20px; height: 84px; padding: 0; margin: 0; border: 1px solid #f9770c; border-right: 0; border-radius: 8px 0 0 8px; background: #101a14; color: #f9770c; cursor: pointer; opacity: .92; display: flex; align-items: center; justify-content: center; }
.qvd-handle:hover, .qvd-handle[aria-expanded="true"] { opacity: 1; background: #1a2a20; }
.qvd-handle:focus-visible { outline: 2px solid #f9770c; outline-offset: 2px; box-shadow: none; }
.qvd-handle span { writing-mode: vertical-rl; font: 700 11px/1 system-ui, "Segoe UI", Arial, sans-serif; letter-spacing: .09em; text-transform: uppercase; }
.qvd-panel { position: fixed; right: 26px; top: 8px; z-index: 2147483000; width: min(360px, calc(100% - 34px)); max-height: calc(100vh - 16px); overflow: auto; overscroll-behavior: contain; box-sizing: border-box; padding: 12px 12px 10px; border: 1px solid #f9770c; border-radius: 12px; background: #101a14; color: #e8efe9; box-shadow: 0 10px 34px rgba(0,0,0,.45); font: 400 14px/1.35 system-ui, "Segoe UI", Arial, sans-serif; text-align: left; }
.qvd-panel * { box-sizing: border-box; }
.qvd-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding-bottom: 8px; border-bottom: 1px solid #2c3d33; }
.qvd-head strong { color: #f9770c; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; }
.qvd-head span { flex: 1; min-width: 140px; color: #9fb2a6; font-size: 12px; }
.qvd-head a { color: #ffd2a6; font-size: 13px; font-weight: 600; }
.qvd-sec { margin-top: 10px; }
.qvd-sec h2 { margin: 0 0 5px; font: 700 11.5px/1.2 system-ui, "Segoe UI", Arial, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #9fb2a6; }
.qvd-panel a, .qvd-cur, .qvd-off { display: block; padding: 7px 9px; border-radius: 8px; color: #e8efe9; text-decoration: none; font-size: 14px; }
.qvd-panel a:hover { background: #22352a; color: #fff; }
.qvd-panel a:focus-visible { outline: 2px solid #f9770c; outline-offset: -2px; box-shadow: none; }
.qvd-head a { display: inline; padding: 0; }
.qvd-head a:hover { background: transparent; text-decoration: underline; }
.qvd-cur { background: #f9770c; color: #1a0e02; font-weight: 700; }
.qvd-cur small { color: #3d2200; }
.qvd-off { color: #6c7d72; }
.qvd-seg { display: flex; gap: 6px; }
.qvd-seg > * { flex: 1; text-align: center; border: 1px solid #2c3d33; }
.qvd-seg > .qvd-cur { border-color: #f9770c; }
.qvd-list, .qvd-steps { margin: 0; padding: 0; list-style: none; }
.qvd-list li + li, .qvd-steps li + li { margin-top: 2px; }
.qvd-list small { display: block; font-size: 11.5px; font-weight: 400; color: #9fb2a6; }
.qvd-list .qvd-cur small { color: #3d2200; }
.qvd-steps { counter-reset: qvd; }
.qvd-steps li { counter-increment: qvd; }
.qvd-steps li > * { position: relative; padding-left: 32px; font-size: 13px; }
.qvd-steps li > *::before { content: counter(qvd); position: absolute; left: 8px; top: 7px; width: 18px; height: 18px; border-radius: 50%; background: #2c3d33; color: #e8efe9; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.qvd-steps li > .qvd-cur::before { background: #1a0e02; color: #f9770c; }
.qvd-steps b { color: #ffd2a6; font-weight: 700; }
.qvd-steps .qvd-cur b { color: #1a0e02; }
@media print { .qvd { display: none !important; } }
/* qv-demo:end */
