/* Phông chữ */
@font-face { font-family: "Be Vietnam Pro"; font-weight: 400; font-display: swap; src: url(be-vietnam-pro-vietnamese-400-normal.woff2) format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 400; font-display: swap; src: url(be-vietnam-pro-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 500; font-display: swap; src: url(be-vietnam-pro-vietnamese-500-normal.woff2) format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 500; font-display: swap; src: url(be-vietnam-pro-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 600; font-display: swap; src: url(be-vietnam-pro-vietnamese-600-normal.woff2) format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 600; font-display: swap; src: url(be-vietnam-pro-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 700; font-display: swap; src: url(be-vietnam-pro-vietnamese-700-normal.woff2) format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 700; font-display: swap; src: url(be-vietnam-pro-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Source Serif 4"; font-weight: 200 900; font-display: swap; src: url(source-serif-4-vietnamese-wght-normal.woff2) format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Source Serif 4"; font-weight: 200 900; font-display: swap; src: url(source-serif-4-latin-wght-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Biến thiết kế */
:root {
  --font-ui: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-read: "Source Serif 4", Georgia, "Times New Roman", serif;
  color-scheme: light;

  --bg: #f2f5f7;
  --surface: #ffffff;
  --surface-2: #f7f9fa;
  --sunken: #ebf0f3;
  --line: #e1e7eb;
  --line-2: #c9d4db;
  --text: #13202a;
  --text-2: #42566a;
  --text-3: #5f7384;

  --brand: #0a5c73;
  --brand-hover: #084a5d;
  --brand-soft: #e0eff4;
  --brand-ink: #ffffff;
  --cover: #0a4a5e;
  --gold: #e2a72a;
  --ring: rgba(10, 92, 115, .22);

  --danger: #b42318;
  --danger-soft: #fdebe8;
  --ok: #17653f;
  --ok-soft: #e0f4e8;
  --warn: #8f5400;
  --warn-soft: #fcefd3;
  --info: #17598a;
  --info-soft: #e1edf9;

  --sc-submitted: #c98a0b; --sb-submitted: #fcf0d3; --sf-submitted: #7d4f06;
  --sc-ready: #7a8d9c;     --sb-ready: #e8edf1;     --sf-ready: #3d5163;
  --sc-reviewing: #2f7db8; --sb-reviewing: #ddecf8; --sf-reviewing: #0f5688;
  --sc-results: #7d5bc4;   --sb-results: #ebe5f8;   --sf-results: #55389a;
  --sc-revision: #d5622f;  --sb-revision: #fde5da;  --sf-revision: #9d3a11;
  --sc-approved: #2e9a64;  --sb-approved: #dcf3e6;  --sf-approved: #14603b;
  --sc-published: #0a7f8f; --sb-published: #d4edf0; --sf-published: #0a5360;
  --sc-reject: #c0392b;    --sb-reject: #fbe3e0;    --sf-reject: #9d2318;

  --shadow-pop: 0 14px 36px rgba(12, 32, 46, .18), 0 2px 6px rgba(12, 32, 46, .08);
  --r-s: 8px; --r-m: 10px; --r-l: 14px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c161c;
  --surface: #131f27;
  --surface-2: #172530;
  --sunken: #0f1a21;
  --line: #243541;
  --line-2: #36505f;
  --text: #e6eef2;
  --text-2: #adbcc7;
  --text-3: #8a9ba8;

  --brand: #4fb4cf;
  --brand-hover: #6cc5dc;
  --brand-soft: #123240;
  --brand-ink: #062630;
  --cover: #0f3b49;
  --ring: rgba(79, 180, 207, .3);

  --danger: #f3918a;
  --danger-soft: #3f1e1b;
  --ok: #7ad6a4;
  --ok-soft: #14382a;
  --warn: #f0c260;
  --warn-soft: #3a2d10;
  --info: #84c3f0;
  --info-soft: #13334a;

  --sc-submitted: #d9a02a; --sb-submitted: #3a2d10; --sf-submitted: #f0c778;
  --sc-ready: #8ea2b2;     --sb-ready: #22303a;     --sf-ready: #b9c8d3;
  --sc-reviewing: #4a9bd6; --sb-reviewing: #13334a; --sf-reviewing: #86c4f2;
  --sc-results: #9a7ddc;   --sb-results: #2a2447;   --sf-results: #c0acf2;
  --sc-revision: #e07b4c;  --sb-revision: #432519;  --sf-revision: #f4a98a;
  --sc-approved: #3fb57b;  --sb-approved: #14382a;  --sf-approved: #84dba9;
  --sc-published: #27a3b4; --sb-published: #0f3840;  --sf-published: #77d4df;
  --sc-reject: #dd6455;    --sb-reject: #451f1b;    --sf-reject: #f59a91;

  --shadow-pop: 0 16px 40px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .3);
}

[data-s="submitted"] { --sc: var(--sc-submitted); --sb: var(--sb-submitted); --sf: var(--sf-submitted); }
[data-s="ready"]     { --sc: var(--sc-ready);     --sb: var(--sb-ready);     --sf: var(--sf-ready); }
[data-s="reviewing"] { --sc: var(--sc-reviewing); --sb: var(--sb-reviewing); --sf: var(--sf-reviewing); }
[data-s="results"]   { --sc: var(--sc-results);   --sb: var(--sb-results);   --sf: var(--sf-results); }
[data-s="revision"]  { --sc: var(--sc-revision);  --sb: var(--sb-revision);  --sf: var(--sf-revision); }
[data-s="approved"]  { --sc: var(--sc-approved);  --sb: var(--sb-approved);  --sf: var(--sf-approved); }
[data-s="published"] { --sc: var(--sc-published); --sb: var(--sb-published); --sf: var(--sf-published); }
[data-s="reject"], [data-s="late"] { --sc: var(--sc-reject); --sb: var(--sb-reject); --sf: var(--sf-reject); }

/* Nền tảng */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin-top: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: inherit; }
ol, ul { padding: 0; margin: 0; list-style: none; }
svg { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
main:focus { outline: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--text-3); }
.pad { padding: 14px 20px; }
.skip { position: absolute; z-index: 100; left: 12px; top: -80px; padding: 10px 14px; background: var(--surface); border-radius: 8px; box-shadow: var(--shadow-pop); }
.skip:focus { top: 12px; }
.noscript { padding: 20px; text-align: center; }
kbd { font: 600 12px/1 var(--font-ui); padding: 4px 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); }

/* Khung ứng dụng */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.workspace { min-width: 0; display: flex; flex-direction: column; }

.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 20px 14px 14px; background: var(--surface); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 24px; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; color: var(--brand); }
.brand strong { display: block; font-size: 16px; font-weight: 700; line-height: 1.2; }
.brand small { display: block; font-size: 12px; color: var(--text-3); }
#navigation { display: grid; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: var(--r-s);
  background: none; color: var(--text-2); font-size: 14.5px; font-weight: 500; text-align: left;
}
.nav-item:hover { background: var(--sunken); color: var(--text); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-count { margin-left: auto; padding: 0 8px; border-radius: 99px; background: var(--sunken); color: var(--text-3); font-size: 12px; font-weight: 600; }
.nav-item.active .nav-count { background: var(--surface); color: var(--brand); }
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.role-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-m);
  background: var(--surface-2); text-align: left;
}
.role-btn:hover { border-color: var(--line-2); }
.role-btn svg { margin-left: auto; color: var(--text-3); width: 18px; height: 18px; }
.role-text { min-width: 0; }
.role-text strong { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role-text small { display: block; font-size: 12px; color: var(--text-3); }

.avatar {
  display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand); font-size: 12.5px; font-weight: 700; letter-spacing: .01em;
}

.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 32px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.top-brand { display: none; }
.search-trigger {
  display: flex; align-items: center; gap: 10px; width: min(420px, 100%); padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--r-m);
  background: var(--surface-2); color: var(--text-3); font-size: 14px; text-align: left;
}
.search-trigger:hover { border-color: var(--text-3); }
.search-trigger span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: var(--r-m);
  background: none; color: var(--text-2);
}
.icon-btn:hover { background: var(--sunken); color: var(--text); }
.icon-btn.small { width: 30px; height: 30px; }
.icon-btn.small svg { width: 16px; height: 16px; }
.bell-count {
  position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
html[data-theme="dark"] .bell-count { color: #2a0b08; }
.role-chip { display: none; padding: 0; border: 0; background: none; border-radius: 50%; }

main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 28px 32px 56px; }

.banner { display: flex; align-items: center; gap: 10px; padding: 9px 32px; font-size: 13.5px; background: var(--info-soft); color: var(--info); border-bottom: 1px solid var(--line); }
.banner[data-tone="warn"] { background: var(--warn-soft); color: var(--warn); }
.banner svg { width: 18px; height: 18px; }
.banner span { flex: 0 1 auto; }
.banner .link { margin-left: 4px; }
.banner .icon-btn { margin-left: auto; color: inherit; }

/* Tiêu đề trang */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-head h1 { margin: 0 0 4px; font-size: 26px; line-height: 1.25; font-weight: 700; letter-spacing: -.015em; }
.page-head p { margin: 0; max-width: 64ch; color: var(--text-2); font-size: 14.5px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Nút */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border: 1px solid var(--line-2); border-radius: var(--r-m);
  background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500; line-height: 1.3; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s;
}
.btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--text-3); }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.btn-primary:hover:not(:disabled) { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 600; }
html[data-theme="dark"] .btn-danger-solid { color: #2a0b08; }
.btn-danger-solid:hover:not(:disabled) { filter: brightness(.94); }
.btn-danger-outline { color: var(--danger); border-color: var(--danger); }
.btn-danger-outline:hover:not(:disabled) { background: var(--danger-soft); border-color: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: var(--r-s); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.link { padding: 0; border: 0; background: none; color: var(--text); font-size: inherit; font-weight: 550; text-align: left; }
.link:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.panel-head .link, .panel-foot .link, .banner .link, .menu-foot .link, .callout .link { color: var(--brand); font-weight: 600; }

/* Nhãn trạng thái */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 99px;
  background: var(--sb); color: var(--sf); font-size: 12.5px; font-weight: 600; line-height: 1.4; white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--sc); }
.due { font-size: 13px; font-weight: 550; color: var(--text-2); white-space: nowrap; }
.due[data-tone="late"] { color: var(--danger); }
.due[data-tone="soon"] { color: var(--warn); }
.due[data-tone="done"] { color: var(--ok); }
.due-date { font-size: 13px; color: var(--text-3); min-width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; }

/* Khung nội dung */
.panel { margin-bottom: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 16px; font-weight: 650; line-height: 1.35; }
.panel-head p { margin: 2px 0 0; font-size: 13px; color: var(--text-3); }
.panel-body { padding: 18px 20px; }
.panel-body.tight { padding-top: 4px; padding-bottom: 4px; }
.panel-foot { padding: 12px 20px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--text-2); }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 20px; }
.grid-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; margin-bottom: 20px; }
.grid-main > .panel, .grid-even > .panel { margin-bottom: 0; }

.callout {
  display: flex; gap: 12px; align-items: flex-start; margin: 0 0 16px; padding: 12px 14px; border-radius: var(--r-m);
  background: var(--info-soft); color: var(--text); font-size: 14px;
}
.callout > svg { margin-top: 2px; color: var(--info); width: 18px; height: 18px; }
.callout p { margin: 0; }
.callout strong { font-weight: 650; }
.callout[data-tone="warn"] { background: var(--warn-soft); }
.callout[data-tone="warn"] > svg { color: var(--warn); }
.callout p + p { margin-top: 4px; }

.empty { display: grid; justify-items: center; gap: 6px; padding: 40px 20px; text-align: center; color: var(--text-2); }
.empty svg { width: 30px; height: 30px; color: var(--text-3); }
.empty strong { color: var(--text); }
.empty p { margin: 0; max-width: 40ch; font-size: 14px; }

/* Thanh tiến trình các bước */
.pipeline { margin-bottom: 20px; padding: 18px 20px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); }
.pipeline-track { display: flex; gap: 3px; height: 10px; border-radius: 99px; overflow: hidden; background: var(--sunken); }
.pipeline-track i { display: block; flex-basis: 0; min-width: 6px; border-radius: 3px; background: var(--sc); transform-origin: left center; }
.pipeline-track i.none { flex: 1; background: transparent; }
.pipeline-track.intro i { animation: grow .7s cubic-bezier(.2, .7, .2, 1) both; }
.pipeline-track.intro i:nth-child(2) { animation-delay: .07s; }
.pipeline-track.intro i:nth-child(3) { animation-delay: .14s; }
.pipeline-track.intro i:nth-child(4) { animation-delay: .21s; }
.pipeline-track.intro i:nth-child(5) { animation-delay: .28s; }
.pipeline-track.intro i:nth-child(6) { animation-delay: .35s; }
.pipeline-track.intro i:nth-child(7) { animation-delay: .42s; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.pipeline-cells { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin: 6px -10px 0; }
.stage {
  display: grid; grid-template-columns: auto 1fr; grid-template-areas: "dot name" "num num"; gap: 0 8px; align-items: center;
  padding: 10px 10px 12px; border: 0; border-radius: var(--r-s); background: none; text-align: left;
}
button.stage:hover { background: var(--surface-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sc); }
.stage .dot { grid-area: dot; }
.stage-name { grid-area: name; font-size: 13px; line-height: 1.3; color: var(--text-2); }
.stage strong { grid-area: num; margin-top: 6px; font-size: 26px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }

/* Việc cần xử lý, hạn, hoạt động */
.task {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line);
}
.task:first-child { border-top: 0; }
.task-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-m); background: var(--info-soft); color: var(--info); }
.task-ico svg { width: 18px; height: 18px; }
.task[data-tone="late"] .task-ico { background: var(--danger-soft); color: var(--danger); }
.task[data-tone="warn"] .task-ico, .task[data-tone="soon"] .task-ico { background: var(--warn-soft); color: var(--warn); }
.task[data-tone="ok"] .task-ico { background: var(--ok-soft); color: var(--ok); }
.task-main { min-width: 0; }
.task-main .link { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-meta { display: block; font-size: 13px; color: var(--text-3); }
.task-note { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.task[data-tone="late"] .task-note { color: var(--danger); font-weight: 550; }

.deadlines li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.deadlines li:first-child { border-top: 0; }
.feed li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; padding: 8px 0; font-size: 14px; }
.feed-dot { width: 8px; height: 8px; margin-top: 8px; border-radius: 50%; background: var(--line-2); }
.feed time { font-size: 13px; color: var(--text-3); white-space: nowrap; }
.feed span { color: var(--text-2); }

/* Số liệu */
.figures {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l);
}
.figures > div { padding: 16px 20px; border-left: 1px solid var(--line); }
.figures > div:first-child { border-left: 0; }
.figures dt { font-size: 13px; color: var(--text-3); }
.figures dd { margin: 4px 0 0; font-size: 28px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.figures small { display: block; margin-top: 2px; font-size: 12px; color: var(--text-3); }
.figures [data-tone="late"] dd { color: var(--danger); }
.figures [data-tone="warn"] dd { color: var(--warn); }

.donut-wrap { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.donut { position: relative; width: 168px; height: 168px; flex: none; }
.donut svg { width: 100%; height: 100%; stroke-linecap: butt; }
.donut .ring { fill: none; stroke: var(--sunken); stroke-width: 5; }
.donut .seg { fill: none; stroke: var(--sc); stroke-width: 5; }
.donut-center { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; }
.donut-center strong { font-size: 32px; font-weight: 600; line-height: 1; }
.donut-center span { font-size: 13px; color: var(--text-3); }
.legend { flex: 1; min-width: 190px; }
.legend li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 5px 0; font-size: 14px; }
.legend strong { font-variant-numeric: tabular-nums; }

.meter { display: block; height: 8px; border-radius: 99px; background: var(--sunken); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.meter.ok i { background: var(--sc-approved); }
.bars li { display: grid; grid-template-columns: minmax(0, 1.2fr) 2fr auto; gap: 14px; align-items: center; padding: 8px 0; font-size: 14px; }
.bars strong { min-width: 1.5em; text-align: right; font-variant-numeric: tabular-nums; }
.progress-line { display: flex; align-items: center; gap: 10px; font-size: 13px; font-variant-numeric: tabular-nums; }
.progress-line .meter { width: 72px; }
.workload li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.workload li:first-child { border-top: 0; padding-top: 0; }
.workload li > div:first-child { display: flex; align-items: center; gap: 12px; }
.workload .stack { display: grid; gap: 6px; font-size: 13px; }
.workload .stack b { margin-left: 10px; font-weight: 600; }

/* Công cụ lọc */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 20px; }
.search { position: relative; flex: 1 1 280px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-3); pointer-events: none; }
.search input[type="search"] { padding-left: 40px; }
.select-wrap select { width: auto; min-width: 150px; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line-2); border-radius: var(--r-m); background: var(--surface-2); }
.segmented button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 0; border-radius: 7px; background: none; color: var(--text-2); font-size: 13.5px; }
.segmented button svg { width: 16px; height: 16px; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border: 1px solid var(--line-2); border-radius: 99px;
  background: var(--surface); color: var(--text-2); font-size: 13.5px;
}
.chip span { color: var(--text-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--text-3); }
.chip[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 600; }
.chip[aria-pressed="true"] span { color: var(--brand); }
.list-foot { padding: 12px 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-3); }

/* Bảng */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { padding: 10px 16px; background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 500; color: var(--text-3); text-align: left; white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { padding-left: 20px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 20px; }
.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.row-link { cursor: pointer; }
.row-link:hover td { background: var(--surface-2); }
.c-title { min-width: 260px; }
.c-title .title { font-size: 15px; line-height: 1.4; }
.c-go { width: 36px; color: var(--text-3); }
.c-go svg { width: 18px; height: 18px; }
.c-due small.due { display: block; }
.c-actions { text-align: right; white-space: nowrap; }
.c-actions .btn + .btn { margin-left: 6px; }
.c-status .sub { margin-top: 4px; }
.sub { display: flex; flex-wrap: wrap; gap: 0 12px; margin-top: 2px; font-size: 13px; color: var(--text-3); }
.who { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.who small { display: block; }
.tbl-plain td { vertical-align: top; }

/* Bảng Kanban */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: 276px; gap: 14px; align-items: start; overflow-x: auto; padding: 4px 20px 20px; }
.lane { padding: 10px; border-radius: var(--r-m); background: var(--sunken); }
.lane header { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; }
.lane h3 { margin: 0; font-size: 13.5px; font-weight: 600; }
.lane .count { margin-left: auto; font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.lane-empty { margin: 0; padding: 14px 4px; font-size: 13px; color: var(--text-3); text-align: center; }
.card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; width: 100%; margin-bottom: 8px; padding: 12px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--sc); border-radius: var(--r-m);
}
.card:hover { border-color: var(--line-2); border-left-color: var(--sc); box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }
.card strong { font-size: 14px; font-weight: 550; line-height: 1.4; }
.card .sub { margin: 0; }

/* Bài của tôi (người nộp) */
.story { margin-bottom: 14px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); }
.story-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.story-title { font-family: var(--font-read); font-size: 19px; font-weight: 600; line-height: 1.35; }
.story-note { margin: 16px 0 0; padding: 10px 14px; border-left: 3px solid var(--sc-revision); border-radius: 0 var(--r-s) var(--r-s) 0; background: var(--warn-soft); font-size: 14px; }
.story-actions { margin-top: 14px; }

/* Các bước xử lý của một hồ sơ */
.stepper { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0 0 20px; }
.stepper li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 12.5px; color: var(--text-3); }
.stepper li::before { content: ""; position: absolute; top: 10px; left: -50%; right: 50%; height: 2px; background: var(--line-2); }
.stepper li:first-child::before { display: none; }
.stepper li[data-state="done"]::before, .stepper li[data-state="current"]::before, .stepper li[data-state="warn"]::before { background: var(--brand); }
.step-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--surface); }
.step-dot svg { width: 12px; height: 12px; stroke-width: 3; }
.stepper li[data-state="done"] .step-dot { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.stepper li[data-state="current"] .step-dot { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
.stepper li[data-state="warn"] .step-dot { background: var(--sc-revision); border-color: var(--sc-revision); box-shadow: 0 0 0 4px var(--sb-revision); }
.stepper li[data-state="current"], .stepper li[data-state="done"] { color: var(--text); }
.stepper li[data-state="current"] .step-label, .stepper li[data-state="warn"] .step-label { font-weight: 600; }
.stepper li[data-state="warn"] { color: var(--sf-revision); }
.step-label { max-width: 90px; line-height: 1.3; }
.stepper.compact { gap: 4px; margin: 0; }
.stepper.compact li { align-items: flex-start; text-align: left; gap: 6px; }
.stepper.compact li::before { display: none; }
.stepper.compact .step-dot { width: 100%; height: 5px; border: 0; border-radius: 3px; background: var(--line); box-shadow: none !important; }
.stepper.compact .step-dot svg { display: none; }
.stepper.compact li[data-state="done"] .step-dot, .stepper.compact li[data-state="current"] .step-dot { background: var(--brand); }
.stepper.compact li[data-state="warn"] .step-dot { background: var(--sc-revision); }
.stepper.compact .step-label { max-width: none; white-space: nowrap; visibility: hidden; }
.stepper.compact li:last-child { align-items: flex-end; text-align: right; }
.stepper.compact li[data-state="current"] .step-label, .stepper.compact li[data-state="warn"] .step-label { visibility: visible; }

/* Số bản tin */
.issues { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 20px; }
.issue { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; }
.issue-cover { padding: 24px 24px 20px; background: var(--cover); color: #fff; border-bottom: 4px solid var(--gold); }
.issue-no { display: block; font: 600 32px/1.1 var(--font-read); }
.issue-cover h3 { margin: 10px 0 0; font: 400 17px/1.4 var(--font-read); opacity: .92; }
.issue-school { display: block; margin-top: 16px; font-size: 12.5px; opacity: .72; }
.issue-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 14px 24px 4px; font-size: 13.5px; color: var(--text-2); }
.toc { padding: 6px 24px 10px 46px; list-style: decimal; }
.toc li { padding: 6px 0 6px 4px; font-size: 14.5px; }
.toc .link { display: block; font-weight: 500; }
.toc li::marker { color: var(--text-3); font-variant-numeric: tabular-nums; }
.issue-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding: 14px 24px 20px; }

/* Lịch hạn phản biện */
.agenda { display: grid; gap: 22px; }
.agenda h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 14px; font-weight: 650; }
.agenda h3 span { padding: 0 8px; border-radius: 99px; background: var(--sunken); font-size: 12.5px; color: var(--text-2); }
.agenda section[data-tone="late"] h3 { color: var(--danger); }
.agenda section[data-tone="soon"] h3 { color: var(--warn); }
.agenda li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }

/* Hướng dẫn */
.flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; counter-reset: step; }
.flow li { counter-increment: step; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-m); }
.flow li::before {
  content: counter(step); display: grid; place-items: center; width: 26px; height: 26px; margin-bottom: 10px; border-radius: 50%;
  background: var(--brand); color: var(--brand-ink); font-size: 13px; font-weight: 700;
}
.flow strong { display: block; margin-bottom: 4px; }
.flow p { margin: 0; font-size: 14px; color: var(--text-2); }
.notes { list-style: disc; padding-left: 20px; }
.notes li { margin-bottom: 10px; font-size: 14.5px; color: var(--text-2); }
.keys > div { display: flex; align-items: center; gap: 14px; padding: 8px 0; border-top: 1px solid var(--line); }
.keys > div:first-child { border-top: 0; }
.keys dt { min-width: 84px; }
.keys dd { margin: 0; font-size: 14px; color: var(--text-2); }

/* Hộp thoại và ngăn kéo */
dialog { max-width: none; max-height: none; padding: 0; border: 0; background: var(--surface); color: var(--text); overflow: hidden; overflow: clip; box-shadow: var(--shadow-pop); }
dialog::backdrop { background: rgba(8, 20, 28, .52); }
dialog[open] { display: flex; flex-direction: column; }
dialog[data-variant="modal"] { width: min(620px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); margin: auto; border-radius: 16px; animation: pop .16s ease-out; }
dialog[data-variant="drawer"] { position: fixed; inset: 0 0 0 auto; width: min(660px, 100vw); height: 100dvh; margin: 0; border-left: 1px solid var(--line); animation: slide .22s ease-out; }
dialog[data-variant="palette"] { width: min(640px, calc(100vw - 24px)); max-height: 72vh; margin: 12vh auto auto; border-radius: 14px; animation: pop .14s ease-out; }
@keyframes slide { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop { from { transform: translateY(8px) scale(.985); opacity: 0; } to { transform: none; opacity: 1; } }
.dlg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 18px 20px 14px 24px; border-bottom: 1px solid var(--line); }
.dlg-head[hidden] { display: none; }
.dlg-head h2 { margin: 0; font-size: 18px; font-weight: 650; line-height: 1.4; }
dialog[data-variant="drawer"] #dialog-title { font-family: var(--font-read); font-size: 21px; font-weight: 600; line-height: 1.35; }
.dlg-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 6px; font-size: 13px; color: var(--text-3); }
.dlg-meta:empty { display: none; }
.dlg-meta .code { font-weight: 600; color: var(--text-2); }
.dlg-content { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.dlg-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.dlg-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 24px; }
.dlg-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 14px 24px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.form-error { display: none; margin-top: 14px; padding: 10px 14px; border-radius: var(--r-s); background: var(--danger-soft); color: var(--danger); font-size: 14px; font-weight: 500; }
.form-error.visible { display: block; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.directory-tools { display: grid; gap: 14px; }
.directory-tools .field { margin: 0; }
.directory-tools > .btn { justify-self: start; }
.person-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.person-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); }
.person-card[hidden] { display: none; }
.person-card header { display: flex; align-items: flex-start; gap: 10px; }
.person-card header > div { min-width: 0; }
.person-card header strong { display: block; font-size: 14px; }
.person-card header span, .person-card p, .person-card small { color: var(--text-2); font-size: 12.5px; }
.person-card strong, .person-card span, .person-card p, .person-card dd { overflow-wrap: anywhere; }
.person-card dl { margin: 12px 0; font-size: 12.5px; }
.person-card dt { color: var(--text-3); }
.person-card dd { margin: 2px 0 10px; }
.person-card footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
@media (max-width: 600px) { .person-list { grid-template-columns: minmax(0, 1fr); } }

.meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; margin: 0 0 20px; padding: 14px 16px; border-radius: var(--r-m); background: var(--surface-2); }
.meta dt { font-size: 12.5px; color: var(--text-3); }
.meta dd { margin: 2px 0 0; font-size: 14px; font-weight: 550; overflow-wrap: anywhere; }
.tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.tabs button { margin-bottom: -1px; padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-3); font-weight: 550; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--brand); }
.pane[hidden] { display: none; }
.block { margin: 0 0 22px; }
.block h3 { margin: 0 0 10px; font-size: 14px; font-weight: 650; }
.reading { margin: 0; max-width: 64ch; font-family: var(--font-read); font-size: 17px; line-height: 1.72; }
.file-card { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-m); }
.file-card > svg { width: 36px; height: 36px; padding: 8px; border-radius: var(--r-s); background: var(--brand-soft); color: var(--brand); }
.file-card > div { flex: 1; min-width: 0; }
.file-card strong { display: block; font-size: 14px; overflow-wrap: anywhere; }
.file-card small { color: var(--text-3); font-size: 12.5px; }
.review-card { margin-bottom: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-m); }
.review-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.comment { margin: 10px 0 0; font-size: 14.5px; color: var(--text); }
.scores { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 22px; margin: 12px 0 0; font-size: 13px; color: var(--text-2); }
.scores li { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pips { display: inline-flex; gap: 3px; }
.pips i { width: 14px; height: 6px; border-radius: 2px; background: var(--line-2); }
.pips i.on { background: var(--brand); }
.feedback { margin: 0 0 10px; padding: 10px 14px; border-left: 3px solid var(--sc-revision); border-radius: 0 var(--r-s) var(--r-s) 0; background: var(--warn-soft); }
.feedback small { color: var(--text-3); font-size: 12.5px; }
.feedback p { margin: 2px 0 0; font-size: 14.5px; }
.timeline { margin-left: 5px; padding-left: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 16px 20px; font-size: 14.5px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--brand); background: var(--surface); }
.timeline time { display: block; font-size: 12.5px; color: var(--text-3); }
.ref { display: flex; flex-direction: column; margin-bottom: 14px; padding: 10px 14px; border-radius: var(--r-m); background: var(--surface-2); border: 1px solid var(--line); font-size: 14.5px; }
.ref strong { font-size: 13px; color: var(--text-3); font-weight: 600; }
.plain-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.plain-list li:first-child { border-top: 0; }

/* Biểu mẫu */
.field { display: block; margin-bottom: 18px; }
.label { display: block; margin-bottom: 6px; font-size: 13.5px; font-weight: 600; }
.label em { color: var(--danger); font-style: normal; }
.hint { display: block; margin-top: 5px; font-size: 12.5px; color: var(--text-3); }
input[type="password"], input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="search"], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--surface); color: var(--text); font-size: 15px;
}
/* Nút hiện / ẩn mật khẩu */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 70px; }
.pw-toggle {
  position: absolute; top: 50%; right: 5px; transform: translateY(-50%); min-width: 56px; min-height: 34px; padding: 0 10px;
  border: 0; border-radius: var(--r-s); background: transparent; color: var(--brand); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.pw-toggle:hover { background: var(--sunken); }
.pw-toggle:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--ring); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
select {
  appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b8c99' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
textarea[readonly] { background: var(--surface-2); }
.counter { display: block; margin-top: 4px; font-size: 12.5px; color: var(--text-3); text-align: right; font-variant-numeric: tabular-nums; }
fieldset { min-width: 0; margin: 0 0 18px; padding: 0; border: 0; }
legend { margin-bottom: 8px; padding: 0; font-size: 13.5px; font-weight: 600; }
legend small { margin-left: 6px; font-size: 12.5px; font-weight: 400; color: var(--text-3); }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 10px 0; font-size: 14.5px; cursor: pointer; }
.check input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand); }
.check small { display: block; font-size: 12.5px; color: var(--text-3); }
.choice-group { display: grid; gap: 8px; }
.choice { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--r-m); cursor: pointer; }
.choice input { margin: 3px 0 0; accent-color: var(--brand); }
.choice strong { display: block; font-size: 14.5px; }
.choice small { color: var(--text-3); font-size: 13px; }
.choice:hover { border-color: var(--text-3); }
.choice:has(input:checked) { border-color: var(--sc); background: var(--sb); }
.choice:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.crit { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.criteria legend { margin-bottom: 4px; }
.scale { display: inline-flex; gap: 6px; }
.scale label { position: relative; }
.scale input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.scale span { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line-2); border-radius: var(--r-s); font-weight: 600; color: var(--text-2); cursor: pointer; }
.scale input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.scale input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.dropzone {
  position: relative; display: grid; justify-items: center; gap: 4px; padding: 20px; border: 1.5px dashed var(--line-2); border-radius: var(--r-m);
  background: var(--surface-2); text-align: center; cursor: pointer;
}
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-soft); }
.dropzone:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.dropzone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone svg { color: var(--brand); }
.dropzone small { color: var(--text-3); font-size: 12.5px; }
.dz-name { margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--ok); overflow-wrap: anywhere; }
.dropzone.has-file { border-style: solid; border-color: var(--sc-approved); }
.pick-row, .issue-pick { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-m); }
.pick-row .check, .issue-pick .check { margin: 0; flex: 1; min-width: 0; }
.pick-due input { width: auto; padding: 7px 10px; font-size: 14px; }
.move { display: flex; gap: 2px; }

/* Menu nổi */
.menu { position: fixed; z-index: 70; max-height: min(580px, calc(100dvh - 24px)); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-pop); }
.menu[hidden] { display: none; }
.menu-head { padding: 14px 16px 10px; }
.menu-head strong { font-size: 15px; }
.menu-head p { margin: 2px 0 0; font-size: 13px; color: var(--text-3); }
.menu-group { padding: 6px 8px; border-top: 1px solid var(--line); }
.menu-group > p { margin: 4px 8px 4px; font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border: 0; border-radius: var(--r-s); background: none; text-align: left; }
.menu-item:hover, .menu-item:focus-visible { background: var(--sunken); }
.menu-item.active { background: var(--brand-soft); }
.menu-item strong { display: block; font-size: 14px; font-weight: 600; }
.menu-item small { display: block; font-size: 12.5px; color: var(--text-3); }
.menu-item > svg:last-child { margin-left: auto; color: var(--brand); width: 18px; height: 18px; }
.note-item { align-items: flex-start; }
.note-item[data-tone="late"] .task-ico { background: var(--danger-soft); color: var(--danger); }
.note-item[data-tone="warn"] .task-ico { background: var(--warn-soft); color: var(--warn); }
.note-item[data-tone="ok"] .task-ico { background: var(--ok-soft); color: var(--ok); }
.note-item strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.menu-foot { padding: 10px 16px 12px; border-top: 1px solid var(--line); }

/* Tìm nhanh */
.palette { display: flex; flex-direction: column; min-height: 0; }
.pal-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pal-input svg { color: var(--text-3); }
.pal-input input { flex: 1; padding: 0; border: 0; background: none; font-size: 16px; box-shadow: none !important; }
#palette-list { max-height: 52vh; padding: 8px; overflow-y: auto; }
#palette-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 10px; border-radius: var(--r-s); cursor: pointer; }
#palette-list li svg { color: var(--text-3); width: 18px; height: 18px; }
#palette-list li[aria-selected="true"] { background: var(--brand-soft); }
#palette-list li[aria-selected="true"] svg { color: var(--brand); }
.pal-main strong { display: block; font-size: 14.5px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-main small { display: block; font-size: 12.5px; color: var(--text-3); }
.pal-kind { font-size: 12.5px; color: var(--text-3); }
#palette-list .pal-empty { display: block; padding: 22px; text-align: center; color: var(--text-3); cursor: default; }

/* Thông báo nhanh */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 90; max-width: min(520px, calc(100vw - 24px)); padding: 11px 18px; border-radius: var(--r-m);
  background: var(--text); color: var(--bg); font-size: 14px; font-weight: 500; box-shadow: var(--shadow-pop);
  opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: opacity .18s, transform .18s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast[data-tone="error"] { background: var(--danger); color: #fff; }
html[data-theme="dark"] .toast[data-tone="error"] { color: #2a0b08; }

/* Thanh điều hướng dưới (điện thoại) */
.tabbar { display: none; }

/* Khổ trung bình */
@media (max-width: 1180px) {
  .grid-main { grid-template-columns: minmax(0, 1fr); }
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figures > div:nth-child(3) { border-left: 0; }
  .figures > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Máy tính bảng và điện thoại */
@media (max-width: 920px) {
  .app { display: block; padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 10px 14px 8px; gap: 8px 12px; }
  .top-brand { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 2px 0 10px; border-bottom: 1px solid var(--line); text-decoration: none; }
  .top-brand .brand-mark { width: 38px; height: 38px; flex: none; }
  .top-brand-text { display: block; min-width: 0; }
  .top-brand-text strong { display: block; font-size: clamp(14px, 4vw, 17px); font-weight: 700; line-height: 1.4; color: var(--text); text-wrap: balance; }
  .top-brand-text strong span { white-space: nowrap; }
  .top-brand-text small { display: block; margin-top: 2px; font-size: 11.5px; line-height: 1.5; color: var(--text-2); }
  .search-trigger { grid-column: 1; grid-row: 2; width: 100%; min-width: 0; height: 40px; font-size: 13px; }
  .top-actions { grid-column: 2; grid-row: 2; margin-left: 0; gap: 2px; }
  .search-trigger kbd { display: none; }
  .role-chip { display: inline-grid; }
  main { padding: 20px 16px 36px; }
  .banner { padding: 9px 16px; }
  .tabbar {
    position: fixed; inset: auto 0 0 0; z-index: 30; display: flex; overflow-x: auto; padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--line);
  }
  .tab-item { flex: 1 0 64px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px; border: 0; border-radius: var(--r-s); background: none; color: var(--text-3); font-size: 11px; font-weight: 500; white-space: nowrap; letter-spacing: -.01em; }
  .tab-item svg { width: 22px; height: 22px; }
  .tab-item.active { color: var(--brand); font-weight: 600; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .pipeline-cells { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid-even { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .page-head { flex-direction: column; align-items: stretch; gap: 14px; }
  .page-head h1 { font-size: 23px; }
  .page-actions .btn { flex: 1; }
  .pipeline { padding: 16px 16px 8px; }
  .pipeline-cells { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 8px -8px 0; }
  .stage { grid-template-columns: auto 1fr auto; grid-template-areas: "dot name num"; gap: 0 10px; padding: 9px 8px; }
  .stage strong { margin: 0; font-size: 19px; }
  .figures dd { font-size: 24px; }
  .figures > div { padding: 14px 16px; }
  .flow { grid-template-columns: minmax(0, 1fr); }
  .toolbar { padding: 14px 16px; gap: 10px; }
  .search { flex-basis: 100%; }
  .select-wrap { flex: 1; }
  .select-wrap select { width: 100%; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding: 0 16px 14px; }
  .chip { flex: none; }
  .panel-head, .panel-body, .panel-foot { padding-left: 16px; padding-right: 16px; }
  .panel-body.tight { padding-left: 16px; padding-right: 16px; }

  .task { grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 16px; }
  .task-note { grid-column: 2; grid-row: 2; white-space: normal; }
  .task .btn { grid-column: 3; grid-row: 1 / span 2; }
  .task .task-main .link { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

  .tbl thead { display: none; }
  .tbl, .tbl tbody { display: block; }
  .tbl tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 14px 16px; border-top: 1px solid var(--line); }
  .tbl tbody tr:first-child { border-top: 0; }
  .tbl td, .tbl td:first-child, .tbl td:last-child { display: block; padding: 0; border: 0; }
  .tbl .c-title, .tbl .c-who { grid-column: 1 / -1; min-width: 0; }
  .tbl .c-status { grid-column: 1; }
  .tbl .c-progress, .tbl .c-due { grid-column: 2; text-align: right; }
  .tbl .c-progress .sub, .tbl .c-due .due { justify-content: flex-end; }
  .tbl .c-progress .progress-line { justify-content: flex-end; }
  .tbl tbody td.c-go { display: none; }
  .tbl .c-actions { grid-column: 1 / -1; display: flex; justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
  .tbl .c-actions .btn + .btn { margin-left: 0; }
  .tbl-reviews .c-due { grid-column: 1; text-align: left; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; }
  .tbl-reviews .c-due small.due { display: inline; }
  .tbl-reviews .c-status { grid-column: 2; text-align: right; }
  .tbl-plain td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 12.5px; color: var(--text-3); }
  .tbl-plain tr { grid-template-columns: minmax(0, 1fr); }
  .tbl-plain td { grid-column: 1; }

  .deadlines li, .agenda li { grid-template-columns: minmax(0, 1fr) auto; }
  .deadlines .due-date, .agenda .due-date { display: none; }
  .donut-wrap { gap: 18px; }
  .workload li { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .story { padding: 16px; }
  .story-top { flex-direction: column; gap: 10px; }
  .stepper:not(.compact) .step-label { font-size: 10.5px; letter-spacing: -.015em; max-width: 56px; }

  dialog[data-variant="modal"] { width: 100vw; max-height: 100dvh; height: auto; margin: auto 0 0; border-radius: 16px 16px 0 0; animation: sheet .22s ease-out; }
  dialog[data-variant="palette"] { margin: 8px auto auto; }
  .dlg-head { padding: 14px 8px 12px 16px; }
  .dlg-body { padding: 16px; }
  .dlg-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .dlg-foot .btn { flex: 1; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scores { grid-template-columns: minmax(0, 1fr); }
  .issues { grid-template-columns: minmax(0, 1fr); }
  .pick-row { flex-wrap: wrap; }
  .board { grid-auto-columns: 82vw; padding: 4px 16px 16px; }
}
@keyframes sheet { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* In mục lục */
.print-sheet { padding: 28px 32px; }
.sheet-school { margin: 0 0 4px; font-size: 13px; color: var(--text-3); }
.print-sheet h3 { margin: 0; font: 600 24px/1.3 var(--font-read); }
.sheet-no { margin: 4px 0 18px; color: var(--text-2); }
.toc.print { padding-left: 24px; }
.toc.print li { display: list-item; padding: 8px 0 8px 4px; font-family: var(--font-read); font-size: 16px; }
.toc.print small { display: block; font-family: var(--font-ui); font-size: 12.5px; color: var(--text-3); }

@media print {
  body > *:not(dialog) { display: none !important; }
  body { background: #fff; }
  dialog[open] { position: static; width: auto; height: auto; max-height: none; overflow: visible; margin: 0; border: 0; box-shadow: none; animation: none; color: #000; background: #fff; }
  .dlg-head, .dlg-foot { display: none !important; }
  .dlg-body { overflow: visible; }
}

/* ===== Khổ màn hình: bổ sung ===== */
.sub-who { display: none; }
dialog[data-variant="drawer"] { height: 100vh; }
dialog[data-variant="modal"] { max-height: calc(100vh - 32px); }
@supports (height: 100dvh) {
  dialog[data-variant="drawer"] { height: 100dvh; }
  dialog[data-variant="modal"] { max-height: calc(100dvh - 32px); }
}
.dlg-foot .btn { white-space: normal; text-align: center; }
.file-card strong, .ref span, .review-card header strong { overflow-wrap: anywhere; }

@media (min-width: 1700px) {
  body { font-size: 16px; }
  .app { grid-template-columns: 276px minmax(0, 1fr); }
  main { max-width: 1400px; }
}

@media (max-width: 1180px) {
  .pipeline-cells { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tbl-reviews thead { display: none; }
  .tbl-reviews, .tbl-reviews tbody { display: block; }
  .tbl-reviews tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 14px 16px; border-top: 1px solid var(--line); }
  .tbl-reviews tbody tr:first-child { border-top: 0; }
  .tbl-reviews tbody td, .tbl-reviews tbody td:first-child, .tbl-reviews tbody td:last-child { display: block; padding: 0; border: 0; }
  .tbl-reviews .c-title, .tbl-reviews .c-who { grid-column: 1 / -1; min-width: 0; }
  .tbl-reviews .c-due { grid-column: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; text-align: left; }
  .tbl-reviews .c-due small.due { display: inline; }
  .tbl-reviews .c-status { grid-column: 2; text-align: right; }
  .tbl-reviews .c-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px; }
  .tbl-reviews .c-actions .btn + .btn { margin-left: 0; }
}

@media (min-width: 761px) and (max-width: 1099px) {
  .tbl-articles .c-who { display: none; }
  .sub-who { display: inline; }
  .tbl-articles th, .tbl-articles td { padding-left: 12px; padding-right: 12px; }
  .tbl-articles th:first-child, .tbl-articles td:first-child { padding-left: 20px; }
}

@media (min-width: 600px) and (max-width: 920px) {
  main { padding: 24px 28px 44px; }
  .topbar { padding-left: 24px; padding-right: 24px; }
  .banner { padding-left: 28px; padding-right: 28px; }
}

@media (max-width: 920px) {
  input[type="password"], input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="search"], select, textarea { font-size: 16px; }
  .topbar { padding-top: calc(8px + env(safe-area-inset-top)); padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  main { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .tabbar { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  .tab-item { flex: 1 1 0; min-width: 0; padding: 7px 2px; white-space: normal; text-align: center; line-height: 1.2; font-size: clamp(10px, 2.9vw, 11.5px); letter-spacing: 0; }
}

@media (max-width: 760px) {
  .pipeline-cells { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tbl-articles .c-who { display: block; }
  .sub-who { display: none; }
}

@media (max-width: 380px) {
  .search-trigger { padding: 8px 10px; gap: 7px; font-size: 12px; }
  .icon-btn { width: 38px; }
  .figures dd { font-size: 22px; }
  .page-head h1 { font-size: 21px; }
  .panel-head h2 { font-size: 15px; }
  .story-title { font-size: 17px; }
  .issue-no { font-size: 28px; }
  .scale span { width: 32px; height: 34px; }
  .crit { flex-wrap: wrap; }
}

@media (max-height: 520px) and (orientation: landscape) and (max-width: 1000px) {
  .topbar { position: static; min-height: 52px; }
  .app { padding-bottom: calc(52px + env(safe-area-inset-bottom)); }
  .tab-item span { display: none; }
  .tab-item { padding: 8px 2px; }
  .page-head h1 { font-size: 22px; }
  .toast { bottom: calc(64px + env(safe-area-inset-bottom)); }
  dialog[data-variant="modal"] { margin: auto; width: min(620px, calc(100vw - 24px)); border-radius: 12px; max-height: calc(100vh - 12px); }
  @supports (height: 100dvh) { dialog[data-variant="modal"] { max-height: calc(100dvh - 12px); } }
  .dlg-head { padding-top: 10px; padding-bottom: 8px; }
  .dlg-body { padding-top: 12px; padding-bottom: 12px; }
  .dlg-foot { padding-top: 8px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .dlg-foot .btn { flex: 0 1 auto; }
}

.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { white-space: nowrap; flex: none; }

.login-page { min-height: 100dvh; display: grid; place-items: center; padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.login-card { width: min(100%, 520px); min-width: 0; padding: clamp(20px, 5vw, 36px); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 16px 50px #17354614; }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.login-brand img { flex: none; }.login-brand strong { font-size: 17px; line-height: 1.4; }.login-brand p { color: var(--text-3); margin: 5px 0 0; font-size: 13px; }
.login-card h1 { font-size: 24px; margin-bottom: 22px; }.auth-submit { width: 100%; min-height: 46px; }.auth-toggle { display: block; margin: 20px auto 0; }
/* Phần tử có thuộc tính hidden phải thật sự ẩn (trước đây ô "Nhập lại mật khẩu" hiện cả ở màn hình đăng nhập). */
.login-card [hidden] { display: none !important; }
@media (max-width:600px) { .login-card input { font-size: 16px; } }
