/* =====================================================================
   A94 — ICTC design layer for the LMS.
   Source of truth: https://staging.ictc.edu.vn/ (read-only review, 2026-10-27),
   documented in evidence/a94/DESIGN-SYSTEM.md (rule ids "DS-x" below).
   Loaded AFTER css/app.css: it re-skins tokens + shared components only and never
   changes layout logic owned by feature cards (A55 tables, pickers, A71 only-mobile).
   ===================================================================== */
@import url("../fonts/be-vietnam-pro.e6bbee3ad1f5.css");
/* A355b CLS (first visit): until Be Vietnam Pro has downloaded (font-display: swap) text is drawn with a local
   sans whose metrics are scaled to match it (widths measured over Vietnamese UI text: 400 ~ +7.9%, 600/700 ~ +4%;
   ascent 1.000 / descent 0.265 em), so the swap no longer re-wraps buttons and paragraphs. */
@font-face { font-family: "Be Vietnam Pro Fallback"; src: local("Arial"), local("Liberation Sans"), local("Helvetica"), local("Roboto");
  font-weight: 100 500; size-adjust: 106%; ascent-override: 100%; descent-override: 26.5%; line-gap-override: 0%; }
@font-face { font-family: "Be Vietnam Pro Fallback"; src: local("Arial Bold"), local("Arial-BoldMT"), local("Liberation Sans Bold"), local("Helvetica Bold"), local("Roboto Bold");
  font-weight: 600 900; size-adjust: 104%; ascent-override: 100%; descent-override: 26.5%; line-gap-override: 0%; }

:root {
  /* DS-1 colour tokens (staging :root --ictc-* / --f22-* custom properties) */
  --ds-o500: #FF9417;   /* brand orange: utility bar, primary button fill, active underline */
  --ds-o400: #FFAD47;   /* primary hover, chip/tile border */
  --ds-o600: #F57C00;   /* link underline, pressed */
  --ds-o700: #E07800;   /* note left rule */
  --ds-o100: #FFEBD2;   /* chip / table head / tile fill */
  --ds-o50:  #FFF7EE;   /* cream section + footer background */
  --ds-o-hover-sec: #FFF1E0; /* secondary button hover fill */
  --ds-ink:  #1E1E24;   /* all text, incl. text on orange (7.5:1 on #FF9417) */
  --ds-ink2: #55555F;   /* muted / meta text (7.37:1 on white) */
  --ds-ink3: #3A3A44;   /* footer links */
  --ds-line: #E6E6EA;   /* card + header rule */
  --ds-line-warm: #F1DEC6; /* post card border */
  --ds-field: #8A8A94;  /* input border (3.4:1 non-text contrast) */
  --ds-ok: #2E7D32;
  --ds-err: #B42318;
  /* DS-4 radii, DS-5 shadow, DS-7 motion */
  --ds-r-pill: 999px; --ds-r-card: 12px; --ds-r-field: 10px; --ds-r-tile: 16px; --ds-r-sm: 4px;
  --ds-sh-1: 0 1px 2px rgba(30,30,36,.04);
  --ds-sh: 0 1px 2px rgba(30,30,36,.06), 0 8px 24px rgba(30,30,36,.08);
  --ds-sh-menu: 0 12px 24px rgba(30,30,36,.18);
  --ds-ease: cubic-bezier(.2,0,0,1); --ds-t1: 150ms; --ds-t2: 200ms;
  --ds-font: "Be Vietnam Pro", "Be Vietnam Pro Fallback", "Open Sans", system-ui, sans-serif;

  /* remap the legacy LMS tokens so every existing rule picks up the new palette */
  --ictc-orange: var(--ds-o500);
  --ictc-orange-ink: var(--ds-ink);
  --ictc-orange-tint: var(--ds-o100);
  --ictc-graphite: var(--ds-ink);
  --ictc-muted: var(--ds-ink2);
  --ictc-silicon: var(--ds-o50);
  --ictc-line: var(--ds-line);
  --ictc-ok: var(--ds-ok);
  --ictc-err: var(--ds-err);
  --radius: var(--ds-r-field);
}

/* ---------- DS-2 typography */
html body, body.font-sans, .font-sans { font-family: var(--ds-font); }
body { font-size: 16px; font-weight: 500; line-height: 1.65; color: var(--ds-ink); background: var(--ds-o50); }
button, input, select, textarea { font-family: inherit; }
h1, h2, h3, h4 { color: var(--ds-ink); font-weight: 700; letter-spacing: 0; }
h1 { font-size: 34px; line-height: 1.2; }
h2 { font-size: 24px; line-height: 1.3; font-weight: 600; }
h3 { font-size: 19px; line-height: 1.4; }
.content h1.text-xl, .content h1.text-2xl { font-size: 34px; }
.lede { color: var(--ds-ink2); font-size: 17px; line-height: 1.6; }
.muted, .empty, .todo-empty, .dt-count, .kv dt, .facts dt { color: var(--ds-ink2); }
@media (max-width: 720px) {
  h1, .content h1.text-xl, .content h1.text-2xl { font-size: 28px; line-height: 1.2; }
  h2 { font-size: 21px; }
}

/* ---------- DS-3 links: ink text, orange underline (staging article links) */
a { color: var(--ds-ink); }
.content a:not([class]), .guide a, .flash a, .note-warn a, .ds-note a {
  color: var(--ds-ink); text-decoration: underline; text-decoration-color: var(--ds-o600);
  text-decoration-thickness: 1.5px; text-underline-offset: 3px;
}
.content a:not([class]):hover, .guide a:hover { text-decoration-color: var(--ds-ink); }

/* ---------- DS-8 focus: 2px ink ring, 2px offset on every interactive element */
a:focus-visible, button:focus-visible, [role=button]:focus-visible, summary:focus-visible,
.btn-primary:focus-visible, .btn-secondary:focus-visible, .ws-tab:focus-visible, .dt-sort:focus-visible, .nav-link:focus-visible {
  outline: 2px solid var(--ds-ink) !important; outline-offset: 2px; box-shadow: none;
}
input:focus-visible, select:focus-visible, textarea:focus-visible,
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ds-ink); outline-offset: 2px; border-color: var(--ds-o500); }

/* ---------- DS-10 buttons: pills, ink text on orange */
.btn-primary, .btn-secondary, .ds-btn {
  border-radius: var(--ds-r-pill); font-weight: 600; font-size: 15px; line-height: 1.2;
  min-height: 44px; padding: 10px 22px; border-width: 2px; border-style: solid; gap: .45rem;
  transition: background-color var(--ds-t1) var(--ds-ease), border-color var(--ds-t1) var(--ds-ease), color var(--ds-t1) var(--ds-ease);
}
.btn-primary { background: var(--ds-o500); border-color: var(--ds-o500); color: var(--ds-ink); }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--ds-o400); border-color: var(--ds-o400); color: var(--ds-ink); }
.btn-primary:active { background: var(--ds-o600); border-color: var(--ds-o600); }
.btn-secondary { background: #fff; border-color: var(--ds-o500); color: var(--ds-ink); }
.btn-secondary:hover, .btn-secondary:focus-visible { background: var(--ds-o-hover-sec); border-color: var(--ds-o500); color: var(--ds-ink); }
.btn-primary:disabled, .btn-secondary:disabled, .btn-primary[aria-disabled=true] { opacity: .5; cursor: not-allowed; }
.btn-sm { min-height: 36px; padding: 6px 16px; font-size: 14px; }
.btn-mini { border-radius: var(--ds-r-pill); border: 1px solid var(--ds-o500); color: var(--ds-ink); background: #fff; font-weight: 600; padding: .2rem .8rem; }
.btn-mini:hover { background: var(--ds-o-hover-sec); }
.btn-danger, button.btn-secondary.is-danger { border-color: var(--ds-err); color: var(--ds-err); }
.icon-btn { border-radius: var(--ds-r-pill); color: var(--ds-ink); }
.icon-btn:hover { background: var(--ds-o100); }
@media (max-width: 720px) { .btn-primary, .btn-secondary { min-height: 44px; } }

/* ---------- DS-11 form fields */
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):not([type=range]), select, textarea {
  border: 1px solid var(--ds-field); border-radius: var(--ds-r-field); background-color: #fff; color: var(--ds-ink);
  font-size: 16px; font-weight: 400; min-height: 48px; padding: 12px 14px; line-height: 1.375;
}
select { padding-right: 32px; }
textarea { min-height: 96px; }
textarea[rows="1"] { min-height: 48px; }
::placeholder { color: #6B6B75; opacity: 1; }
label, .fin-field > label, .fin-field > legend, .form-grid label { font-size: 15px; font-weight: 600; color: var(--ds-ink); }
input[type=checkbox], input[type=radio] { accent-color: var(--ds-o600); }
.dt-bar .input, .dt-bar select { min-height: 44px; padding: 8px 12px; }
.inline-edit select, .rtable td .inline-edit select, td select, td input:not([type=checkbox]):not([type=radio]) { min-height: 40px; padding: 6px 10px; }
select:not([multiple]) { padding-right: 32px; }

/* ---------- DS-12 cards / panels */
.panel, .card, .ws-card, .g-card, .auth-card, .bg-white.rounded.shadow, .ds-card {
  background: #fff; border: 1px solid var(--ds-line); border-radius: var(--ds-r-card); box-shadow: var(--ds-sh-1);
}
.panel, .card, .ds-card { padding: 24px; }
.panel > h2, .card > h2, .ws-card h2, .ws-h2, .g-card h2 { font-size: 19px; font-weight: 700; color: var(--ds-ink); }
.shadow { box-shadow: var(--ds-sh-1) !important; border: 1px solid var(--ds-line); }
.rounded { border-radius: var(--ds-r-card); }
.panel-foot, .link-rows, .link-rows li a, .todo li, .row-item, .plain-list li, .facts > div, .class-card { border-color: var(--ds-line); }
@media (max-width: 720px) { .panel, .card, .ds-card { padding: 16px; } }

/* A471 D1: long fact labels ("Hạn gia hạn", "Hạn nộp (gia hạn riêng)") keep their words whole on
   a phone; the value wraps to its own line instead of squeezing the label mid-word. */
@media (max-width: 720px) {
  .facts > div { flex-wrap: wrap; row-gap: 2px; }
  .facts dt { white-space: nowrap; }
}

/* ---------- DS-13 chips / tags / badges */
.chip, .tag, .ds-chip { background: var(--ds-o100); color: var(--ds-ink); font-size: 13px; font-weight: 600; line-height: 1.4; padding: 3px 10px; border-radius: var(--ds-r-pill); }
.tag-open { background: var(--ds-o100); color: var(--ds-ink); }
.tag-started { background: #E3F1E4; color: #1E5B22; }
.tag-finished, .chip-muted { background: #EEEEF1; color: var(--ds-ink2); }
.chip-warn { background: #FDECEA; color: var(--ds-err); }
/* D-RT29-1: .chip-danger lived only in app.css and lost to the .chip rule above (same specificity, later file). */
.chip-danger { background: #FDE3E0; color: var(--ictc-err, #B42318); border-color: #F2B8B1; }
.bell-count { background: var(--ds-o500); color: var(--ds-ink); }
.avatar { background: var(--ds-o100); color: var(--ds-ink); }

/* ---------- DS-14 notes / alerts (staging "Lưu ý" box) */
.note-warn, .ds-note { background: var(--ds-o50); border-left: 4px solid var(--ds-o700); border-radius: 0 8px 8px 0; padding: 14px 16px; font-size: 15px; line-height: 1.5; color: var(--ds-ink); }
.flash { border-radius: 0 8px 8px 0; border: 0; border-left: 4px solid; padding: 14px 16px; font-size: 15px; }
.flash-success, .flash-info { border-left-color: var(--ds-ok); background: #EEF6EE; }
.flash-error { border-left-color: var(--ds-err); background: #FDF1F0; }
.flash-warning { border-left-color: var(--ds-o700); background: var(--ds-o50); }

/* ---------- DS-15 tables (staging course-schedule table) — A55 zebra/sort kept */
.table-scroll, .table-wrap { border-radius: var(--ds-r-card); }
table { font-size: 15px; background: #fff; }
th { background: var(--ds-o100); color: var(--ds-ink); font-weight: 700; padding: 12px 16px; border-bottom: 0; }
td { padding: 12px 16px; border-bottom: 1px solid var(--ds-line); }
.dt-ready { font-size: 15px; }
.dt-ready thead th { background: var(--ds-o100); color: var(--ds-ink); box-shadow: inset 0 -1px 0 var(--ds-o400); }
thead th.sticky-col, .gradebook thead th { background: var(--ds-o100); }
tbody td.sticky-col { background: #fff; }
.zebra tbody tr:nth-child(even) td.sticky-col { background: var(--ds-o50); }
.dt-ready tbody tr.dt-alt { background: var(--ds-o50); }
.dt-ready tbody tr:hover { background: var(--ds-o100); }
.dt-ind::after { color: var(--ds-ink2); }
.table-scroll:has(> table) { box-shadow: var(--ds-sh); background: #fff; }
@media (max-width: 720px) {
  th, td { padding: 8px 10px; }
  .rtable td { padding: .25rem 0; }
  .table-scroll:has(> .dt-ready) { box-shadow: none; background: transparent; }
  .dt-ready.rtable tbody tr { border-color: var(--ds-line); border-radius: var(--ds-r-card); background: #fff; box-shadow: var(--ds-sh-1); }
  .dt-ready.rtable tbody tr.dt-alt { background: #fff; }
}

/* ---------- DS-16 tabs: 2px orange underline (staging active menu item) */
.ws-tabs { border-bottom: 1px solid var(--ds-line); }
.ws-tab { color: var(--ds-ink); font-weight: 600; font-size: 15px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.ws-tab:hover { background: transparent; border-bottom-color: var(--ds-o400); }
.ws-tab.is-active { color: var(--ds-ink); border-bottom-color: var(--ds-o500); }

/* ---------- DS-17 modal */
dialog.modal { border-radius: var(--ds-r-card); box-shadow: var(--ds-sh-menu); border-top: 3px solid var(--ds-o500); }
dialog.modal::backdrop { background: rgba(30,30,36,.45); }
.usermenu-pop, .picker-list { border-radius: var(--ds-r-card); border-color: var(--ds-line); box-shadow: var(--ds-sh-menu); }
.usermenu-pop a:hover, .usermenu-pop button:hover, .picker-list li.is-active { background: var(--ds-o50); }
.picker-chip { background: var(--ds-o100); }
.picker-pre button { border-radius: var(--ds-r-pill); border-color: var(--ds-field); }
.picker-pre button[aria-pressed="true"] { background: var(--ds-o100); border-color: var(--ds-o500); color: var(--ds-ink); }

/* ---------- DS-20 app shell: white header with 40px orange utility rule, light sidebar */
.shell::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: 4px; background: var(--ds-o500); z-index: 45; }
.sidebar { background: #fff; color: var(--ds-ink); border-right: 1px solid var(--ds-line); padding-top: 4px; }
.sidebar-head { background: #fff; border-bottom: 1px solid var(--ds-line); height: 72px; box-sizing: border-box; padding-top: 0; padding-bottom: 0; }
.sidebar-logo img { height: 44px; }
.nav-group-label { color: var(--ds-ink2); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.nav-link { color: var(--ds-ink); font-size: 14.5px; font-weight: 500; border-radius: 0; margin-right: 0; }
.nav-link:hover { background: var(--ds-o50); color: var(--ds-ink); }
.nav-link svg { opacity: 1; stroke: var(--ds-ink2); }
.nav-link.is-active { background: var(--ds-o100); color: var(--ds-ink); font-weight: 700; }
.nav-link.is-active::before { background: var(--ds-o500); top: 0; bottom: 0; }
.nav-link.is-active::after { display: none; }
.nav-link.is-active svg { stroke: var(--ds-ink); }
/* A275: pending-count badge on approval menu items */
.nav-link .nav-count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--ds-r-pill); background: var(--ds-o500); color: var(--ds-ink); font-size: 12.5px; font-weight: 700; line-height: 22px; text-align: center; flex: none; }
.sidebar-foot { border-top: 1px solid var(--ds-line); background: var(--ds-o50); }
.sidebar-foot a { color: var(--ds-ink3); }
.topbar { background: #fff; border-bottom: 1px solid var(--ds-line); min-height: 72px; top: 4px; }
.crumbs ol { color: var(--ds-ink2); font-size: 14px; }
.crumbs a { color: var(--ds-ink2); }
.crumbs li[aria-current=page], .crumbs li:last-child a { color: var(--ds-ink); font-weight: 600; }
.usermenu-btn { border-radius: var(--ds-r-pill); }
.usermenu-btn:hover { background: var(--ds-o50); }
.main-col { padding-top: 4px; }
.scrim { background: rgba(30,30,36,.45); }
@media (max-width: 1023px) {
  .topbar { min-height: 64px; }
  /* mobile drawer = staging mobile menu: white, 3px orange top, menu shadow, 15px/700 rows */
  .sidebar { border-top: 3px solid var(--ds-o500); padding-top: 0; }
  .sidebar.is-open { box-shadow: var(--ds-sh-menu); }
  .nav-link { font-weight: 700; min-height: 48px; border-bottom: 1px solid rgba(0,0,0,.03); border-radius: 0; margin-right: 0; }
}

/* ---------- DS-21 public shell (logged out): staging header + cream footer */
.public-top { background: #fff; border-bottom: 1px solid var(--ds-line); border-top: 4px solid var(--ds-o500); min-height: 72px; padding: 0 max(1rem, calc((100% - 1180px) / 2)); }
.public-nav a:not(.btn-secondary):not(.btn-primary) { color: var(--ds-ink); font-weight: 600; font-size: 15px; text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.public-nav a:not(.btn-secondary):not(.btn-primary):hover { border-bottom-color: var(--ds-o500); }
.public-nav .btn-secondary { background: var(--ds-o500); border-color: var(--ds-o500); }
.public-nav .btn-secondary:hover { background: var(--ds-o400); border-color: var(--ds-o400); }
.public-foot { background: var(--ds-o50); border-top: 4px solid var(--ds-o500); padding: 32px 1rem 24px; font-size: 15px; }
.public-foot a { color: var(--ds-ink3); text-decoration: none; }
.public-foot a:hover { color: var(--ds-ink); text-decoration: underline; text-decoration-color: var(--ds-o600); }
.public-wrap { background: #fff; }
.public-wrap.auth-center { background: var(--ds-o50); }
.auth-card { padding: 32px !important; }
.auth-card h1 { font-size: 28px; }

/* ---------- misc re-skin */
.todo-n { border-left-color: var(--ds-o500); background: var(--ds-o100); color: var(--ds-ink); }
.meter-bar { background: #EEEEF1; border-radius: var(--ds-r-pill); }
.meter-bar > span { background: var(--ds-o500); }
code { background: var(--ds-o50); border-radius: var(--ds-r-sm); }
.guide figure img { border-radius: var(--ds-r-card); border-color: var(--ds-line); }
.file-card { border-radius: var(--ds-r-card); border-color: var(--ds-line); }
.ds-eyebrow { display: inline-block; background: var(--ds-o100); border-left: 4px solid var(--ds-o500); border-radius: var(--ds-r-sm); padding: 7px 10px; font-size: 15px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.ds-tile { background: var(--ds-o100); border: 1px solid var(--ds-o400); border-radius: var(--ds-r-tile); padding: 20px; font-weight: 700; }
.ds-section { background: var(--ds-o50); padding: 40px 0; }
@media (prefers-reduced-motion: reduce) { .btn-primary, .btn-secondary { transition: none; } }

/* ---------- Tailwind colour utilities used in templates (ADR-9 config hardcodes the old palette) */
.text-ink, body.text-ink { color: var(--ds-ink); }
.bg-silicon, body.bg-silicon, .bg-surface { background-color: var(--ds-o50); }
.text-primary-dk, .text-primary { color: var(--ds-ink); }
.bg-primary { background-color: var(--ds-o500); color: var(--ds-ink); }
.bg-primary-tint { background-color: var(--ds-o100); }
.text-gray-600, .text-gray-500 { color: var(--ds-ink2); }
.bg-gray-50, .bg-gray-100 { background-color: var(--ds-o50); }
.bg-orange-50, .bg-amber-50 { background-color: var(--ds-o50); }
.border-orange-300, .border-amber-300 { border-color: var(--ds-o400); }

/* DS-8 form label rhythm: 6px label->field (login/registration had 0) */
label.block, form label[for] { margin-bottom: 6px; }

/* A92 tracking sheet (table.ts) uses hardcoded greys/old tint: map to DS table colours (colours only) */
table.ts thead th, table.ts thead .sticky-c { background: var(--ds-o100); color: var(--ds-ink); }
table.ts thead th.ts-sess { background: var(--ds-o100); border-bottom-color: var(--ds-o500); }
table.ts thead tr.ts-h2 th { color: var(--ds-ink2); }
table.ts tbody tr:nth-child(2n) td, table.ts tbody tr:nth-child(2n) th { background: var(--ds-o50); }
/* A184: a visible border separates each "Buổi N" column group (header to last row); thin lines inside */
table.ts thead th.ts-sess, table.ts .ts-g0 { border-left: 2px solid var(--ds-ink2, #6b7280); }
table.ts thead th.ts-sess, table.ts .ts-g1 { border-right: 2px solid var(--ds-ink2, #6b7280); }
/* A189 D4: long submission filenames must not push the grading board sideways on phones */
.file-pill { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }

/* ---------- A94 QA fix (t_2826f640) */
/* Q1: drawer/sidebar footer links are touch rows (DS-20/23 >=44px) */
.sidebar-foot a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }
/* Q2: on touch / tablet widths every action button and sortable header control is >=44px (DS-23) */
@media (max-width: 1023px), (pointer: coarse) {
  .btn-primary, .btn-secondary, .btn-sm, .btn-mini { min-height: 44px; }
  .btn-sm, .btn-mini { display: inline-flex; align-items: center; justify-content: center; }
  button.ts-sort, .dt-sort, .th-sort, th a.dt-sort-link { min-height: 44px; display: inline-flex; align-items: center; }
}

/* =====================================================================
   A99 — "datasheet" refinement (evidence/a99/PLAN.md). Same identity
   (orange #FF9417 + ink, Be Vietnam Pro, logo, 4px orange rule, orange
   active underline, "Lưu ý" note); calmer canvas, no shadows, one orange
   action per view, tables as datasheets, session strip as signature.
   Colours/spacing/type only + .wave; no layout logic of feature cards changed.
   ===================================================================== */
:root {
  --a99-wafer: #F3F3F5;  /* canvas (was cream) */
  --a99-rule:  #DCDCE2;  /* hairlines */
  --a99-muted: #5A5A66;
  --a99-ok:    #1F7A4D;
  --a99-r-obj: 14px; --a99-r-ctl: 8px;
  --ictc-line: var(--a99-rule);
  --ictc-muted: var(--a99-muted);
  --ictc-silicon: var(--a99-wafer);
  --ictc-ok: var(--a99-ok);
}
body, .bg-silicon, body.bg-silicon, .bg-surface { background: var(--a99-wafer); }
body { font-size: 15px; line-height: 1.6; font-weight: 400; }
b, strong, th, label { font-weight: 600; }
h1, .content h1.text-xl, .content h1.text-2xl { font-size: 28px; line-height: 1.25; letter-spacing: -.01em; }
h2 { font-size: 21px; } h3 { font-size: 17px; }
.lede { font-size: 16px; }

/* surfaces: hairline, no shadow */
.panel, .card, .ws-card, .g-card, .auth-card, .bg-white.rounded.shadow, .ds-card, .sess, .asg-link, .file-card, .grader-bar, .el-form, .kanban-col {
  border-color: var(--a99-rule); border-radius: var(--a99-r-obj); box-shadow: none;
}
.shadow { box-shadow: none !important; }
.table-scroll:has(> table) { box-shadow: none; border: 1px solid var(--a99-rule); }
.panel > h2, .card > h2, .ws-card h2, .ws-h2, .g-card h2 { font-size: 17px; }
.g-card h2 { color: var(--ds-ink); }

/* buttons: pill kept, quieter secondary (ink hairline, not orange) so orange = the one primary */
.btn-secondary { border-width: 1px; border-color: var(--a99-rule); background: #fff; }
.btn-secondary:hover, .btn-secondary:focus-visible { border-color: var(--ds-ink); background: #fff; }
.btn-primary { border-width: 1px; }
.btn-mini { border-color: var(--a99-rule); }
.btn-mini:hover { border-color: var(--ds-ink); background: #fff; }
.public-nav .btn-secondary { border-color: var(--ds-o500); }

/* fields */
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):not([type=range]), select, textarea {
  border-radius: var(--a99-r-ctl); min-height: 44px; padding: 10px 12px;
}

/* sidebar: plain labels, orange bar + peach for active */
.nav-group-label { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 600; }
.nav-link { font-size: 14.5px; }
.sidebar-foot { background: #fff; }
.topbar { min-height: 64px; }
.sidebar-head { height: 64px; }

/* tables = datasheet: white header, ink caption row rule, tabular figures */
th, .dt-ready thead th, thead th.sticky-col, .gradebook thead th, table.ts thead th, table.ts thead .sticky-c {
  background: #fff; color: var(--a99-muted); font-size: 13px; font-weight: 600;
  box-shadow: inset 0 -1px 0 var(--ds-ink);
}
table.ts thead th.ts-sess { background: #fff; }
td { border-bottom-color: var(--a99-rule); }
table { font-variant-numeric: tabular-nums; }
.dt-ready tbody tr.dt-alt, .zebra tbody tr:nth-child(even) td.sticky-col, table.ts tbody tr:nth-child(2n) td, table.ts tbody tr:nth-child(2n) th,
main table:not(.dt-ready) > tbody > tr:nth-child(2n), table.zebra tbody tr:nth-child(2n) td { background: #FAFAFB; }
.dt-ready tbody tr:hover { background: var(--ds-o50); }

/* chips: square-ish tags, status by colour word */
.chip, .tag, .ds-chip { border-radius: 6px; font-size: 12.5px; }
.chip-ok, .tag-started { background: #E6F2EB; color: var(--a99-ok); border-color: transparent; }
.chip-accent { background: var(--ds-o100); color: var(--ds-ink); border-color: transparent; }

/* tabs (course + workspace): 2px orange underline on hairline */
.el-tabs, .ws-tabs { border-bottom: 1px solid var(--a99-rule); }
.el-tab, .ws-tab { border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--ds-ink); }
.el-tab:hover, .ws-tab:hover { background: transparent; border-bottom-color: var(--a99-rule); }
.el-tab.is-active, .ws-tab.is-active { color: var(--ds-ink); border-bottom-color: var(--ds-o500); }
.el-tab-aux { color: var(--a99-muted); }
.el-kicker { color: var(--a99-muted); }
.el-news { background: #fff; border: 1px solid var(--a99-rule); border-left: 4px solid var(--ds-o700); }

/* sessions list */
.sess-no { background: #fff; color: var(--ds-ink); border: 1px solid var(--ds-ink); border-radius: 6px; font-variant-numeric: tabular-nums; }
.sess-bar > span { background: var(--a99-ok); }
.sess-head:hover { background: #FAFAFB; }

/* A130: session strip removed. A136/A133/A134: header rating card, item scores, student sheet */
.el-rating { flex: 0 1 360px; min-width: 0; padding: 12px 14px; font-size: 13px; }
.el-rating h2 { font-size: 14px; margin: 0 0 4px; }
.el-rating .el-rating-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 0 6px; }
.el-rating .g-big { font-size: 22px; margin: 0; }
.el-rating .g-comps { margin: 0 0 4px; }
.el-rating p { margin: 2px 0; }
.el-rating-more summary { cursor: pointer; font-size: 12.5px; }
.el-rating-th { font-size: 12px; }
.sess-no-ic { display: grid; place-items: center; }
.item-score { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.item-counts { white-space: nowrap; }
/* A167: student Điểm tab = one card like a Buổi học session (same rule/zebra/chip tokens) */
.sheet-card { background: #fff; border: 1px solid var(--ictc-line); border-radius: 10px; overflow: hidden; }
.sheet-h { font-size: 15px; font-weight: 700; margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--a99-rule); }
.sheet-scroll, .table-scroll.sheet-scroll:has(> .dt-ready) { overflow-x: auto; overflow-y: visible; max-height: none; -webkit-overflow-scrolling: touch; border: 0; border-radius: 0; box-shadow: none; background: #fff; }
main table.el-sheet, .el-sheet { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; background: #fff; display: table; white-space: nowrap; }
.el-sheet th, .el-sheet td { padding: 7px 16px; height: 40px; border-bottom: 1px solid var(--a99-rule); text-align: left; vertical-align: middle; }
.el-sheet .num { text-align: right; }
.el-sheet thead th { position: sticky; top: 0; z-index: 2; }
.el-sheet thead .sheet-group td, .el-sheet thead .sheet-group th { height: auto; padding-top: 6px; padding-bottom: 0; border-bottom: 0; box-shadow: none; }
.el-sheet .sheet-group-h { text-align: center; font-size: 12px; letter-spacing: .02em; color: var(--a99-muted); padding-left: 0; padding-right: 0; }
.el-sheet .sheet-group-h::after { content: ""; display: block; height: 1px; margin: 4px 8px 0; background: var(--a99-rule); }
.el-sheet .sticky-col { position: sticky; left: 0; z-index: 1; background: #fff; font-weight: 600; text-align: left; box-shadow: inset -1px 0 0 var(--a99-rule), 6px 0 6px -6px rgba(0,0,0,.18); }
.el-sheet thead .sticky-col { z-index: 3; }
.el-sheet thead tr[data-dt-head] .sticky-col { box-shadow: inset 0 -1px 0 var(--ds-ink), inset -1px 0 0 var(--a99-rule), 6px 0 6px -6px rgba(0,0,0,.18); }
.el-sheet tbody tr:nth-child(2n) .sticky-col { background: #FAFAFB; }
.el-sheet tbody tr:hover td, .el-sheet tbody tr:hover th { background: var(--ds-o50); }
.el-sheet td .chip { font-size: 12px; }
.el-sheet tfoot th, .el-sheet tfoot td { font-weight: 700; border-top: 2px solid var(--ds-ink); border-bottom: 0; background: #fff; }
.el-sheet .dt-sort { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.sheet-extra { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--a99-rule); }
.sheet-extra li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 16px; border-top: 1px solid #f1f2f4; }
.sheet-extra li:first-child { border-top: 0; }
.sheet-extra-t { font-weight: 600; overflow-wrap: anywhere; }
.sheet-note { margin: 0; padding: 10px 16px 12px; font-size: 12.5px; border-top: 1px solid var(--a99-rule); }
@media (max-width: 720px) {
  h1, .content h1.text-xl, .content h1.text-2xl { font-size: 24px; }
  h2 { font-size: 19px; }
  .el-rating { flex: 1 1 100%; }
  .el-sheet th, .el-sheet td { padding: 7px 10px; }
  /* A167: scroll affordance (same fade as .el-tabs) - more columns to the right */
  .sheet-scroll { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); }
  .el-sheet { padding-right: 20px; }
  .sheet-h { padding: 10px 12px; }
  .sheet-extra li, .sheet-note { padding-left: 12px; padding-right: 12px; }
}

/* notes: "Lưu ý" kept, on white for the grey canvas */
.note-warn, .ds-note, .flash-warning { background: #fff; }
.public-wrap.auth-center { background: var(--a99-wafer); }
.public-foot, .ds-section { background: #fff; }
.auth-card h1 { font-size: 24px; }
.todo-n { background: #fff; border: 1px solid var(--a99-rule); border-left: 4px solid var(--ds-o500); }
.meter-bar { background: var(--a99-rule); }
.bell-count { top: 4px; right: 2px; min-width: 18px; height: 18px; font-size: 11px; line-height: 18px; border: 2px solid #fff; box-sizing: content-box; transform: translate(35%, -25%); }
.content a.back, .content .crumbs-back a, .el-kicker a { text-decoration-color: var(--a99-rule); }
.content a:not([class]) { text-decoration-thickness: 1px; }
/* A99 login (A74: logo+title+form only); field focus = ink 2px ring (DS-8) but single, not doubled */
input:focus-visible, select:focus-visible, textarea:focus-visible, input:focus, select:focus, textarea:focus { outline: 2px solid var(--ds-ink); outline-offset: 1px; border-color: var(--ds-ink); }
@media (max-width: 720px) {
  /* D-T3-1: keep A87 vertical centring (no flex-start / fixed top margin) */
  .auth-card { padding: 24px 20px !important; }
}
/* A99 wide screens: let data pages use the room (tables were clipped at 1180 with half the 2560 screen empty) */
/* A276: superseded — content always fills the column beside the menu (no width cap) */
/* page-head subtitle sits under the title, not floating mid-row */
.page-head:has(> h1 + .lede:last-child) { flex-direction: column; align-items: flex-start; gap: 4px; }

/* A105-G4/G6 roster controls: compact checklist + tuition override (no 3-line label wrap, no clipped inputs) */
.chk-inline { display: grid; grid-template-columns: max-content; gap: 2px; align-items: center; }
.chk-inline .pick { white-space: nowrap; padding: 2px 4px; gap: 6px; font-size: 13.5px; }
.chk-inline .pick input { width: 18px; height: 18px; margin: 0; flex: none; }
.chk-inline .btn-mini, .tui-inline .btn-mini { white-space: nowrap; justify-self: start; }
.tui-inline { display: grid; grid-template-columns: minmax(12.5rem, 14rem); gap: 4px; }
.tui-inline select { font-size: 13.5px; }
.tui-inline select, .tui-inline input { width: 100%; min-width: 0; min-height: 34px; }
.tui-inline .chip { justify-self: start; }
.pend-chip { display: block; width: max-content; margin: 2px 0 0 auto; white-space: nowrap; }
@media (max-width: 720px) {
  .rtable td.num:has(.pend-chip) { flex-wrap: wrap; justify-content: flex-end; }
  .rtable td .chk-inline, .rtable td .tui-inline { flex: 1 1 auto; justify-content: end; justify-items: end; grid-template-columns: minmax(0, 15rem); }
  .rtable td .tui-inline select, .rtable td .tui-inline input { width: 100%; }
  .rtable td .chk-inline .pick { justify-content: flex-end; }
}


/* A170: student assignment page = one full-width column:
   info strip -> Đề bài -> Kết quả chấm (if graded) -> Bài nộp của bạn (roomy editor) */
.asg-stack { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.asg-strip { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.75rem; padding: .7rem 1.1rem; background: #fff; border: 1px solid var(--ds-line); border-radius: var(--ds-r-card); }
.asg-fact { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.asg-fact-chip { flex-direction: row; align-items: center; gap: .5rem; }
.asg-k { font-size: .8rem; color: var(--ds-ink2); }
.asg-v { font-weight: 600; font-variant-numeric: tabular-nums; }
.asg-fb-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1.25rem; }
.asg-fb-row p { margin: 0; }
.asg-feedback .g-big { font-size: 1.8rem; }
.asg-sub .st-area { min-height: 60vh; max-height: none; }
.asg-sub .drop { padding: 1.6rem 1.25rem; }
@media (max-width: 720px) {
  .asg-strip { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: start; gap: .6rem 1rem; padding: .75rem .9rem; }
  .asg-fact-chip { grid-column: 1 / -1; }
  .asg-sub .st-area { min-height: 45vh; }
}

/* A121: Máy chủ usage progress bar */
.usage-bar { position: relative; display: inline-block; width: 9rem; max-width: 100%; height: 8px; border-radius: var(--ds-r-pill, 999px); background: #EEEEF1; overflow: hidden; vertical-align: middle; }
.usage-bar > .usage-fill { display: block; height: 100%; min-width: 0; border-radius: inherit; background: var(--ds-o500, #E65728); }
.usage-bar.is-amber > .usage-fill { background: #D97706; }
.usage-bar.is-danger > .usage-fill { background: #B42318; }
.usage-label { white-space: nowrap; }
@media (max-width: 480px) { .usage-bar { width: 6.5rem; } }

/* A158: teacher side panel on Buổi học (edit item / Có mặt-Vắng list) */
.tpanel-scrim { position: fixed; inset: 0; background: rgba(30,30,36,.35); z-index: 55; }
.tpanel { position: fixed; top: 0; right: 0; bottom: 0; width: min(34rem, 100vw); background: #fff; z-index: 56; box-shadow: -8px 0 32px rgba(0,0,0,.18); border-left: 3px solid var(--ds-o500, #E65728); display: flex; flex-direction: column; overflow: hidden; }
.tpanel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; padding: 1rem 1.1rem .75rem; border-bottom: 1px solid var(--ictc-line); }
.tpanel-head h2 { margin: 0; font-size: 1.1rem; overflow-wrap: anywhere; }
.tpanel-body { padding: 1rem 1.1rem 1.5rem; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.tpanel .note-warn { margin: .75rem 1.1rem 0; }
.tpanel-form { border: 0; margin: 0; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-content: start; }
.tpanel-form .contents { display: contents; }
.att-list { width: 100%; font-size: .9rem; }
.att-list td { vertical-align: middle; padding: .45rem .5rem; }
.att-list td:first-child { overflow-wrap: anywhere; }
.att-seg { display: inline-flex; border: 0; padding: 0; margin: 0; gap: .3rem; }
.att-opt { position: relative; display: inline-flex; }
.att-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.att-opt span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 .75rem; border-radius: 999px; border: 1px solid #c9cdd2; font-weight: 600; font-size: .85rem; white-space: nowrap; }
.att-opt input:focus-visible + span { outline: 2px solid var(--ictc-orange); outline-offset: 2px; }
.att-yes input:checked + span { background: #e8f3e8; color: #1e5b22; border-color: #2e7d32; }
.att-no input:checked + span { background: #fdf1f0; color: var(--ictc-err); border-color: var(--ictc-err); }
.att-seg:disabled .att-opt span { opacity: .7; cursor: default; }
/* A338: Có mặt · Trễ · Vắng segmented control (Trễ = amber); 44px tap targets on phones */
.att-late input:checked + span { background: var(--ictc-amber-tint, #fdf5e8); color: #7a4a00; border-color: #c98a1b; }
.att-seg3 { flex-wrap: nowrap; vertical-align: middle; }
.att-seg3 .att-opt span { min-width: 3.4rem; justify-content: center; padding: 0 .6rem; }
.att-note { display: block; margin-top: .2rem; }
.att-chip-late { background: var(--ictc-amber-tint, #fdf5e8); color: #7a4a00; border-color: #f1d8ae; }
.ts-cv.st-late { color: #7a4a00; font-weight: 600; }
/* A338: tracking-sheet cell = compact C · T · V segment + label */
table.ts .ts-seg { display: inline-flex; flex-direction: column; align-items: center; gap: .1rem 0; border: 0; margin: 0; padding: 0; min-width: 0; }
table.ts .ts-seg > span.ts-cv { flex-basis: 100%; text-align: center; font-size: .75em; white-space: nowrap; }
table.ts .ts-o { position: relative; display: inline-flex; }
table.ts .ts-seg { flex-flow: row wrap; justify-content: center; max-width: 6.6rem; }
table.ts .ts-o input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
table.ts .ts-o span { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 1px solid #c9cdd2; font-weight: 700; font-size: .78rem; color: #5d646b; background: #fff; }
table.ts .ts-o:first-of-type span { border-radius: 6px 0 0 6px; }
table.ts .ts-o:nth-of-type(3) span { border-radius: 0 6px 6px 0; }
table.ts .ts-o + .ts-o span { border-left: 0; }
table.ts .ts-o input:focus-visible + span { outline: 2px solid var(--ictc-orange); outline-offset: 1px; position: relative; z-index: 1; }
table.ts .ts-o-p input:checked + span { background: #e8f3e8; color: #1e5b22; border-color: #2e7d32; }
table.ts .ts-o-l input:checked + span { background: #fdf5e8; color: #7a4a00; border-color: #c98a1b; }
table.ts .ts-o-a input:checked + span { background: #fdf1f0; color: var(--ictc-err); border-color: var(--ictc-err); }
table.ts .ts-seg.is-saving { opacity: .5; }
table.ts .ts-seg.is-bad { outline: 2px solid var(--ictc-err); }
.ts-cv.st-present { color: #1e5b22; }
.ts-cv.st-absent { color: var(--ictc-err); }
@media (max-width: 720px), (pointer: coarse) {
  table.ts .ts-o span { width: 44px; height: 44px; }
  table.ts .ts-seg { max-width: none; }
}
@media (max-width: 720px), (pointer: coarse) {
  .att-seg3 .att-opt span { min-height: 44px; min-width: 4rem; }
  /* A338: unmarked/old-value note goes under the 3 buttons so the "Điểm danh" card label never breaks mid-word */
  .att-list td.att-col { flex-wrap: wrap; white-space: normal; }
  .att-list td.att-col::before { flex: none; white-space: nowrap; }
  .att-list td.att-col .att-note { flex-basis: 100%; text-align: right; }
}
.t-eye.is-off { border-style: dashed; }
/* A331: Điểm danh = one checkbox per student (checked = Có mặt, unchecked = Vắng); 44px tap target on phones */
.att-col { text-align: left; white-space: nowrap; }
.att-chk { display: inline-flex; align-items: center; gap: .5rem; min-height: 36px; cursor: pointer; font-weight: 600; font-size: .9rem; }
.att-chk input[type=checkbox] { width: 22px; height: 22px; margin: 0; accent-color: #2e7d32; cursor: pointer; flex: none; }
.att-chk input[type=checkbox]:focus-visible { outline: 2px solid var(--ictc-orange); outline-offset: 2px; }
.att-chk input:disabled { cursor: default; }
.att-chk .att-lbl { color: var(--ictc-err); min-width: 4.2em; }
.att-chk input:checked + .att-lbl { color: #1e5b22; }
.att-chk-all { font-weight: 600; font-size: .85rem; padding-right: .25rem; }
.att-form-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .1rem 1rem; }
table.ts .ts-chk { display: inline-flex; align-items: center; justify-content: center; gap: .25rem; min-width: 44px; min-height: 30px; cursor: pointer; }
table.ts .ts-chk input { width: 18px; height: 18px; margin: 0; accent-color: #2e7d32; cursor: pointer; }
table.ts .ts-chk input:focus-visible { outline: 2px solid var(--ictc-orange); outline-offset: 2px; }
table.ts .ts-chk input.is-bad { outline: 2px solid var(--ictc-err); }
table.ts .ts-chk input.is-saving { opacity: .5; }
table.ts .ts-cv { font-size: inherit; color: inherit; font-weight: inherit; }
table.ts th .ts-chk-all { display: flex; margin: .15rem auto 0; min-height: 28px; }
@media (max-width: 720px), (pointer: coarse) {
  .att-chk { min-height: 44px; }
  .att-chk input[type=checkbox] { width: 24px; height: 24px; }
  table.ts .ts-chk { min-height: 44px; min-width: 44px; }
  table.ts th .ts-chk-all { min-height: 44px; }
}
@media (max-width: 720px) {
  .tpanel { width: 100vw; border-left: 0; border-top: 3px solid var(--ds-o500, #E65728); }
  .tpanel-form { grid-template-columns: minmax(0,1fr); }
}
/* A-att (t_cb74e613): attendance drawer never scrolls sideways — wider on desktop, account under the name,
   Có mặt · Trễ · Vắng as one segmented control that always fits; note on its own line; 44px on touch */
.tpanel[data-mode="attendance"] { width: min(45rem, 90vw); }
.att-list { table-layout: fixed; border-collapse: collapse; }
.att-list th.att-col, .att-list td.att-col { width: 17rem; white-space: normal; }
.att-list td.att-name .att-fn, .att-list td.att-name .att-uid { display: block; overflow-wrap: anywhere; }
.att-seg3 { display: flex; width: 100%; flex-wrap: nowrap; gap: 0; max-width: 100%; }
.att-seg3 .att-opt { flex: 1 1 0; min-width: 0; }
.att-seg3 .att-opt span { width: 100%; min-width: 0; padding: 0 .4rem; border-radius: 0; justify-content: center; }
.att-seg3 .att-opt + .att-opt span { margin-left: -1px; }
.att-seg3 .att-opt:first-of-type span { border-radius: 8px 0 0 8px; }
.att-seg3 .att-opt:nth-of-type(3) span { border-radius: 0 8px 8px 0; }
.att-seg3 .att-opt input:checked + span, .att-seg3 .att-opt input:focus-visible + span { position: relative; z-index: 1; }
.att-seg3 .att-opt input:focus-visible + span { outline-offset: -3px; }
.att-list td.att-col .att-note { display: block; flex-basis: 100%; text-align: left; }
/* the drawer table fills the drawer: beats the global data-table rule (main table.dt-ready = auto width, nowrap cells) */
main aside.tpanel .tpanel-body table.att-list.dt-ready { width: 100%; max-width: 100%; }
main aside.tpanel .tpanel-body table.att-list.dt-ready > * > tr > td,
main aside.tpanel .tpanel-body table.att-list.dt-ready > * > tr > th { white-space: normal; }
main aside.tpanel .tpanel-body table.att-list.dt-ready > * > tr > th.att-col { width: 17rem; }
@media (max-width: 720px) {
  .tpanel[data-mode="attendance"] { width: 100vw; }
  /* card view (.rtable): no repeated "Tên"/"Điểm danh" labels, name block left-aligned, control full width */
  main aside.tpanel .tpanel-body table.att-list.rtable > tbody > tr > td { display: block; width: 100%; text-align: left; }
  main aside.tpanel .tpanel-body table.att-list.rtable > tbody > tr > td::before { content: none; }
  main aside.tpanel .tpanel-body table.att-list.rtable > tbody > tr > td.att-col { padding-top: .35rem; }
}

/* A165/A168/A169: compact class header - title left, rating card right, top-aligned; tabs right below */
.el-head { align-items: flex-start; margin-bottom: .75rem; gap: .75rem 1rem; }
.el-head-main { flex: 1 1 16rem; }
.el-head h1 { margin-bottom: 0; }
.el-rating { padding: 10px 12px; }
.el-rating h2 { margin-bottom: 2px; }
.el-rating .el-rating-top { margin-bottom: 4px; }
.el-rating .g-comps { gap: .2rem; margin: .25rem 0; }
.el-rating-cert { margin-top: 6px !important; padding-top: 6px; border-top: 1px solid var(--a99-rule); overflow-wrap: anywhere; }
@media (max-width: 720px) { .el-head { gap: .5rem; } }

/* A166: LINK MEETING item edit drawer: summary on the right, open form full row width */
.item-meeting-edit { margin-left: auto; }
.item-meeting-edit[open] { flex-basis: 100%; margin-left: 0; }
.item-meeting-edit[open] > .el-form { max-width: 48rem; }

/* A189-D7: sidebar/main-col slide only animates on a user toggle (html.nav-anim). On page load the
   main column used to slide 0->248px, so early/full-page captures showed the sidebar over the grader. */
@media (min-width: 1024px) { html:not(.nav-anim) .sidebar, html:not(.nav-anim) .main-col { transition: none !important; } }

/* A192: class header Xếp loại = full-width 4-column band (no disclosure); 2x2 on tablet; stacked at 390 */
.el-head > .el-rating { flex: 1 1 100%; order: 2; }
.el-rating { display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,1.25fr) minmax(0,1.25fr) minmax(0,.9fr); gap: 0; padding: 0; font-size: 13px; }
.el-rb { padding: 10px 14px; min-width: 0; border-left: 1px solid var(--a99-rule); }
.el-rb:first-of-type { border-left: 0; }
.el-rb > p { margin: 2px 0; }
.el-rb-h { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--a99-muted, #5d646b); margin: 0 0 4px !important; }
.el-rating .el-rating-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 4px; }
.el-rating .g-big { font-size: 26px; margin: 0; }
.el-rating .g-comps { margin: 0; gap: .3rem; font-size: 12.5px; }
.el-rating .g-comps li { grid-template-columns: 7.5rem minmax(3rem,1fr) 4.5rem; }
.el-rb-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.el-rb-miss-h { font-weight: 600; margin-top: 6px !important; }
.el-rating .g-missing { margin: 0 0 0 1rem; font-size: 12.5px; }
.el-rating-cert { margin: 0 !important; padding-top: 10px; border-top: 0; overflow-wrap: anywhere; }
@media (max-width: 1100px) {
  .el-rating { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .el-rb:nth-of-type(3) { border-left: 0; }
  .el-rb:nth-of-type(n+3) { border-top: 1px solid var(--a99-rule); }
}
@media (max-width: 720px) {
  .el-rating { grid-template-columns: minmax(0,1fr); }
  .el-rb { border-left: 0; }
  .el-rb + .el-rb { border-top: 1px solid var(--a99-rule); }
  .el-rating .g-comps li { grid-template-columns: 6.5rem minmax(0,1fr) 4.3rem; }
}

/* A193: student Điểm tab - summary tiles, compact centred chip table, collapsed unopened sessions */
.sheet-tiles { list-style: none; margin: 0; padding: 12px 16px 4px; display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 8px; max-width: 54rem; }
.sheet-tile { border: 1px solid var(--a99-rule); border-radius: 8px; padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sheet-tile > span { font-size: 12px; color: var(--a99-muted, #5d646b); font-weight: 600; }
.sheet-tile strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.sheet-tile small { font-size: 12px; color: var(--a99-muted, #5d646b); font-weight: 500; }
.sheet-tile .chip { align-self: flex-start; font-style: normal; font-size: 12px; }
.sheet-legend { margin: 0; padding: 6px 16px 10px; font-size: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.sheet-legend .chip { font-size: 11px; padding: 0 .45rem; }
.chip-todo { background: #fff; color: var(--ictc-err, #b42318); border-color: #e9a59d; }
.chip-none { background: transparent; color: #9aa1a8; border-color: transparent; }
.sheet-scroll { padding: 0 16px 12px; overflow-x: auto; }
main table.el-sheet, .el-sheet { width: auto; max-width: 760px; min-width: 0; white-space: nowrap; border-collapse: separate; border-spacing: 0; padding-right: 0 !important; }
.el-sheet th, .el-sheet td { padding: 5px 12px; height: 36px; text-align: center; }
.el-sheet thead th { font-size: 12.5px; text-align: center; }
.el-sheet tbody th, .el-sheet thead th:first-child, .el-sheet tfoot th { text-align: left; }
.el-sheet td .chip { font-size: 12px; min-width: 3.2rem; justify-content: center; }
.el-sheet tr.is-current th, .el-sheet tr.is-current td { background: var(--ds-o50, #FFF7EE); }
.el-sheet tr.is-current th { box-shadow: inset 3px 0 0 var(--ds-o500, #FF9417); }
.el-sheet tr.sheet-hidden th { font-weight: 500; color: #8a9097; }
.el-sheet tr.sheet-closed th { font-weight: 500; color: #8a9097; font-style: italic; background: repeating-linear-gradient(135deg,#fff,#fff 8px,#f7f8f9 0,#f7f8f9 16px); }
@media (max-width: 720px) {
  .sheet-tiles { grid-template-columns: repeat(2, minmax(0,1fr)); padding: 10px 12px 4px; }
  .sheet-legend { padding: 6px 12px 8px; }
  .sheet-scroll { padding: 0 6px 10px; -webkit-mask-image: none; mask-image: none; }
  .el-sheet { width: 100%; }
  .el-sheet th, .el-sheet td { padding: 4px 3px; height: 32px; }
  .el-sheet thead th { font-size: 11.5px; white-space: normal; }
  .el-sheet tbody th { font-size: 12.5px; }
  .el-sheet td .chip { min-width: 0; font-size: 11px; padding: .08rem .35rem; }
}
/* A193 polish: amber "Đã làm" (awaiting grade) in sheet, table fills panel up to 760px */
.el-sheet .chip-warn, .sheet-legend .chip-warn { background: #FFF4E0; color: #8A5A00; }
/* D-RT29-1: past-due '0/10 · Chưa nộp' is solid red, stronger than the outlined not-yet-due 'Chưa làm'. */
.el-sheet .chip-danger, .sheet-legend .chip-danger { background: var(--ictc-err, #B42318); color: #fff; border-color: var(--ictc-err, #B42318); }
#my-sheet.el-sheet { width: 100%; max-width: 760px; }
/* RT15: legend items never split (chip + label stay together); row rules span the whole row */
.sheet-leg { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; margin-right: 8px; }
.el-sheet tbody th, .el-sheet tbody td { border-bottom: 1px solid var(--a99-rule, #e6e8eb); }
.el-sheet tbody tr:last-child th, .el-sheet tbody tr:last-child td { border-bottom: 0; }
.el-sheet tfoot th, .el-sheet tfoot td { border-top: 2px solid var(--ds-ink); border-bottom: 0; }
/* GP-3: long filename pills on the grading board wrap instead of widening the page at 390 */
.grading .file-pill { white-space: normal; overflow-wrap: anywhere; max-width: 100%; }
/* A198: Duyệt > Tải dữ liệu cards at phone width: fixed label column; long notes wrap in the value */
@media (max-width: 720px) {
  #queue.rtable td { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: .75rem; text-align: left; align-items: start; }
  #queue.rtable td::before { white-space: nowrap; }
}
/* A294: Liên kết tài khoản cards at phone width: same fixed label column, one value block */
@media (max-width: 720px) {
  #link-review.rtable td { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: .75rem; text-align: left; align-items: start; }
  #link-review.rtable td::before { white-space: normal; }
  #link-review .chip { white-space: normal; }
}
#link-review .lr-people { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }

/* A207: Chi view — grouped by class, Done rows green like the sheet's Completed=Yes */
.chi-filter { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .5rem .75rem; align-items: end; }
.chi-filter .chi-f { display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; font-weight: 600; color: var(--ds-ink2); min-width: 0; }
.chi-filter .chi-f:first-child { grid-column: 1 / -1; }
.chi-filter .chi-f .input, .chi-filter .chi-f select, .chi-filter .chi-f input { width: 100%; }
.chi-filter .chi-f-btn { flex-direction: row; align-items: center; gap: .75rem; }
.chi-groups { display: flex; flex-direction: column; gap: .75rem; }
.chi-group { padding: 0; overflow: hidden; }
.chi-ghead { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; padding: .75rem 1rem; cursor: pointer; min-height: 52px; background: var(--ds-o50); }
.chi-group[open] > .chi-ghead { border-bottom: 1px solid var(--ds-line); }
.chi-gname { font-weight: 700; font-size: 1.05rem; }
.chi-gmeta { flex: 1 1 auto; }
.chi-gsum { font-weight: 700; font-variant-numeric: tabular-nums; }
.chi-table tr.is-done > td { background: #E8F5E9; }
.chi-table tr.is-done > td:first-child { box-shadow: inset 4px 0 0 var(--ds-ok); }
.chi-done { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; min-width: 44px; cursor: pointer; font-weight: 600; }
.chi-done input { width: 22px; height: 22px; accent-color: var(--ds-ok); cursor: pointer; }
.chi-done input:disabled { cursor: not-allowed; }
.chi-done-form { margin: 0; }
.tag-override { background: #fff4d6; color: #7a4b00; border: 1px solid #f0c36d; text-decoration: none; }
/* A242 drift lists: one readable line per overridden field; Chi Nội dung cell keeps one flow on mobile */
.fin-diff li, .ov-li { display: block; }
.ov-pair { display: inline-flex; flex-wrap: wrap; gap: .25rem .5rem; }
.ov-sheet { background: #eef0f2; border-radius: 4px; padding: 0 .35rem; text-decoration: line-through; text-decoration-color: #8a9097; }
.ov-lms { background: #fff4d6; border-radius: 4px; padding: 0 .35rem; font-weight: 600; }
.chi-item { display: block; min-width: 0; overflow-wrap: anywhere; }
.tag-override { align-self: flex-start; }
@media (max-width: 720px) {
  .chi-table.rtable td .chi-item { flex: 1 1 auto; text-align: right; }
  /* A228c: card labels never split mid-word next to long values (Nội dung, Ô khác Sheet) */
  .chi-table.rtable td::before, .ov-table.rtable td::before { flex: 0 0 auto; white-space: nowrap; }
  .ov-table.rtable td .fin-diff { flex: 1 1 0; min-width: 0; text-align: right; }
  .ov-sheet { text-decoration: none; }
}
.chi-done:focus-within { outline: 2px solid var(--ds-ok); outline-offset: 2px; border-radius: 6px; }
.chi-totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin: 0 0 1rem; }
.chi-totals > div { background: #fff; border: 1px solid var(--ds-line); border-radius: var(--ds-r-card); padding: .6rem .9rem; }
.chi-totals dt { font-size: .85rem; color: var(--ds-ink2); }
.chi-totals dd { margin: 0; font-weight: 700; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
/* t_8d4396e4: the A461 "Vận hành HKD" history block has exactly two figures; the shared 4-column grid
   would leave two empty columns, and a long label must never widen the page at 390px. */
.fin-history .chi-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fin-history .chi-totals dt { overflow-wrap: anywhere; }
@media (max-width: 720px) {
  /* One figure per row at 390: "288.935.500 ₫" must not break the ₫ onto its own line. */
  .fin-history .chi-totals { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .chi-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chi-filter { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .chi-table.rtable tr.is-done { background: #E8F5E9; border-left: 4px solid var(--ds-ok); }
  .chi-table.rtable tr.is-done > td { background: transparent; box-shadow: none; }
  .chi-ghead { padding: .65rem .75rem; }
}

/* A204/A210 partner ledger subtotal rows */
.fin-sub > *, .fin-total > * { font-weight: 700; background: var(--ds-o50); }
.fin-total > * { border-top: 2px solid var(--ds-ink); }

/* A459: Chia lợi nhuận — Tổng (share due) / Còn lại next to Đã chuyển. A leader paid more than the
   share shows 0 ₫ plus the visible excess, so the four columns stay readable at 390. */
.fin-none { color: var(--ds-ink2); }
.fin-over { display: block; font-size: .82rem; font-weight: 500; white-space: nowrap; }
.fin-table td[data-label="Tổng"], .fin-table td[data-label="Còn lại"] { white-space: nowrap; }
@media (max-width: 720px) {
  .fin-table td[data-label="Còn lại"] { flex-wrap: wrap; justify-content: flex-end; row-gap: .15rem; }
  .fin-table .fin-over { flex-basis: 100%; text-align: right; }
}

/* A209 Tổng quan: profit summary + course-type groups */
.dash-profit { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 0 0 1.25rem; }
.profit-card { background: #fff; border: 1px solid var(--ds-line); border-left: 4px solid var(--ds-o500); border-radius: var(--ds-r-card); padding: .9rem 1.1rem; }
.profit-label { margin: 0; font-weight: 600; color: var(--ds-ink2); }
.profit-sub, .th-note { display: block; font-weight: 500; font-size: .8rem; color: var(--ds-ink2); }
.profit-val { margin: .15rem 0 .35rem; font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.profit-hint { margin: 0; font-size: .85rem; color: var(--ds-ink2); }
.profit-links { grid-column: 1 / -1; margin: 0; }
/* A460: reconciliation bridge (class gross → accrual → non-class → total net → transfers → cash) */
.profit-bridge { grid-column: 1 / -1; background: #fff; border: 1px solid var(--ds-line); border-radius: var(--ds-r-card); padding: .8rem 1.1rem; }
.profit-bridge-title { margin: 0 0 .5rem; font-size: .95rem; font-weight: 700; }
.profit-bridge-rows { list-style: none; margin: 0; padding: 0; }
.profit-bridge-rows li { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .3rem .15rem; border-top: 1px dashed var(--ds-line); }
.profit-bridge-rows li:first-child { border-top: 0; }
.pb-label { flex: 1 1 auto; min-width: 0; }
.pb-note { display: block; font-size: .78rem; font-weight: 400; color: var(--ds-ink2); }
.pb-val { flex: 0 0 auto; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.pb-subtotal { background: var(--ds-o50); font-weight: 600; }
.pb-total { background: var(--ds-o100); font-weight: 700; }
.pb-foot { margin: .5rem 0 0; font-size: .8rem; }
@media (max-width: 980px) { .dash-profit { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dash-classes .dash-ghead th { background: var(--ds-o100); color: var(--ds-ink); font-size: .95rem; }
.dash-classes .dash-gsub td { background: var(--ds-o50); }
.dash-classes td.num, .dash-classes th.num { text-align: right; white-space: nowrap; }
.dash-leader { min-width: 14rem; }
.dash-leader .nowrap { white-space: nowrap; }
.dash-leader .inline-edit input { width: 4.5rem; min-height: 36px; }
/* A419: Mỹ % / Thế % inline edit cells */
.dash-classes td.pct-edit { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.dash-classes td.pct-edit:hover { background: var(--ds-o50); }
.dash-classes td.pct-edit:focus-visible { outline: 2px solid var(--ds-ink); outline-offset: -2px; }
.dash-classes td .pct-input { width: 5rem; min-height: 36px; text-align: right; }
.dash-classes td.cell-err { background: #FBECEA; }
@media (max-width: 720px) { .dash-profit { grid-template-columns: minmax(0, 1fr); } .profit-val { font-size: 1.35rem; } .profit-bridge-rows li { flex-wrap: wrap; row-gap: .1rem; } .pb-val { flex-basis: 100%; text-align: right; } }
/* A203: shared picker — the list overlays directly under the input (anchored to .picker-box, not to the
   whole wrapper), and inside column-flex field stacks the wrapper no longer grows to flex-basis height. */
.picker-box { position: relative; }
.picker.picker-col { flex: 0 0 auto; }
/* filter bars style `.filter-bar .input{width:auto}` — the input must always fill the picker so the list matches it */
.picker > .picker-box > input.picker-input { width: 100%; max-width: none; box-sizing: border-box; }
.picker-box > .picker-list { top: calc(100% + 2px); left: 0; right: 0; width: 100%; box-sizing: border-box; }
@media (max-width: 720px) { .picker-box > .picker-list { max-height: min(18rem, 50vh); } }

/* A205: Hạng mục colour chips — same tokens in the ledger table, filter/form picker options,
   selected picker value and Tổng quan tài chính. Text label always shown (colour-blind safe);
   text/background pairs are >= 7:1 (WCAG AA/AAA). */
:root {
  --cat-tuition-bg: #e3f2e5; --cat-tuition-fg: #1b5e20; --cat-tuition-dot: #2e7d32;
  --cat-salary-bg: #e6edfb;  --cat-salary-fg: #1e3a8a;  --cat-salary-dot: #2f5fd0;
  --cat-it-bg: #f1e7fc;      --cat-it-fg: #5b21b6;      --cat-it-dot: #8b5cf6;
  --cat-operation-bg: #fdf0d2; --cat-operation-fg: #6b4000; --cat-operation-dot: #d48a00;
  --cat-other-bg: #eceff1;   --cat-other-fg: #37474f;   --cat-other-dot: #78909c;
  --cat-transfer-bg: #fde6ee; --cat-transfer-fg: #8a1442; --cat-transfer-dot: #d6336c;
  /* A269 company cost groups */
  --cat-tax-bg: #fbe9e7;      --cat-tax-fg: #8c2a0b;      --cat-tax-dot: #e64a19;
  --cat-software-bg: #e0f4f4; --cat-software-fg: #004d4d; --cat-software-dot: #00897b;
  --cat-hardware_it-bg: #ede7f6; --cat-hardware_it-fg: #3b1f78; --cat-hardware_it-dot: #5e35b1;
}
.cat-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .1rem .55rem; border-radius: 999px; font-size: .82rem; font-weight: 600; line-height: 1.5; white-space: nowrap; background: var(--cb, #eceff1); color: var(--cf, #37474f); }
.cat-chip::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; flex: none; background: var(--cd, #78909c); }
.cat-tuition { --cb: var(--cat-tuition-bg); --cf: var(--cat-tuition-fg); --cd: var(--cat-tuition-dot); }
.cat-salary { --cb: var(--cat-salary-bg); --cf: var(--cat-salary-fg); --cd: var(--cat-salary-dot); }
.cat-it { --cb: var(--cat-it-bg); --cf: var(--cat-it-fg); --cd: var(--cat-it-dot); }
.cat-operation { --cb: var(--cat-operation-bg); --cf: var(--cat-operation-fg); --cd: var(--cat-operation-dot); }
.cat-other { --cb: var(--cat-other-bg); --cf: var(--cat-other-fg); --cd: var(--cat-other-dot); }
.cat-transfer { --cb: var(--cat-transfer-bg); --cf: var(--cat-transfer-fg); --cd: var(--cat-transfer-dot); }
.cat-tax { --cb: var(--cat-tax-bg); --cf: var(--cat-tax-fg); --cd: var(--cat-tax-dot); }
.cat-software { --cb: var(--cat-software-bg); --cf: var(--cat-software-fg); --cd: var(--cat-software-dot); }
.cat-hardware_it { --cb: var(--cat-hardware_it-bg); --cf: var(--cat-hardware_it-fg); --cd: var(--cat-hardware_it-dot); }
.picker-list li .cat-chip mark { background: #ffe8a3; color: inherit; }
/* selected value inside the picker input: coloured left dot + tinted field */
.picker[data-chip-val]:not([data-chip-val=""]) .picker-box > input.picker-input { padding-left: 1.75rem !important; } /* beats app.css input:not(...) padding */
.picker[data-chip-val]:not([data-chip-val=""]) .picker-box::before { content: ""; position: absolute; left: .7rem; top: 50%; width: .6rem; height: .6rem; margin-top: -.3rem; border-radius: 50%; z-index: 1; pointer-events: none; }
.picker[data-chip-val="tuition"] .picker-box::before { background: var(--cat-tuition-dot); }
.picker[data-chip-val="salary"] .picker-box::before { background: var(--cat-salary-dot); }
.picker[data-chip-val="it"] .picker-box::before { background: var(--cat-it-dot); }
.picker[data-chip-val="operation"] .picker-box::before { background: var(--cat-operation-dot); }
.picker[data-chip-val="other"] .picker-box::before { background: var(--cat-other-dot); }
.picker[data-chip-val="transfer"] .picker-box::before { background: var(--cat-transfer-dot); }
.picker[data-chip-val="tax"] .picker-box::before { background: var(--cat-tax-dot); }
.picker[data-chip-val="software"] .picker-box::before { background: var(--cat-software-dot); }
.picker[data-chip-val="hardware_it"] .picker-box::before { background: var(--cat-hardware_it-dot); }
.cat-legend { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .75rem; }
.cat-legend a { text-decoration: none; }
.cat-bar { display: inline-block; vertical-align: middle; width: 6rem; height: 8px; border-radius: 4px; background: #e6e8eb; overflow: hidden; margin-right: .4rem; }
.cat-bar > span { display: block; height: 100%; background: var(--cd, #78909c); }

/* A215 Tuyển sinh inline edit */
td.cell-edit { cursor: pointer; outline: 1px dashed var(--ds-o300, #f6b37f); outline-offset: -3px; }
td.cell-edit:hover, td.cell-edit:focus { background: var(--ds-o50, #fff7ef); outline-style: solid; }
td.cell-edit form.inline-edit { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; cursor: default; }
td.cell-edit form.inline-edit .input { min-width: 7rem; max-width: 14rem; }
#acct-dialog { max-width: min(36rem, 94vw); }
#acct-dialog table th { text-align: left; padding: .2rem .5rem .2rem 0; font-weight: 600; white-space: nowrap; vertical-align: top; }
#acct-dialog code { word-break: break-all; }

/* RT16 D-RT16-2: .filter-bar .input{flex:1 1 14rem} became a 160px *height* inside the column-flex .chi-f labels */
.chi-filter .chi-f > .input, .chi-filter .chi-f > input, .chi-filter .chi-f > select { flex: none; height: 44px; min-height: 44px; box-sizing: border-box; }
.chi-filter .chi-f .picker { flex: none; width: 100%; }
@media (min-width: 1024px) {
  .chi-filter { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; }
  .chi-filter .chi-f { flex: 1 1 7rem; }
  .chi-filter .chi-f:first-child { grid-column: auto; flex: 2 1 11rem; }
  .chi-filter .chi-f-date { flex: 1 1 8.5rem; }
  .chi-filter .chi-f-btn { flex: 0 0 auto; min-height: 44px; }
}
@media (max-width: 720px) {
  .chi-filter { gap: .4rem .5rem; }
  .chi-filter .chi-f-btn { grid-column: 1 / -1; }
}
/* RT16 D-RT16-3: Tổng quan leader cell 'Sửa %' overflowed the 390 viewport by 1px */
@media (max-width: 720px) {
  .dash-leader { min-width: 0; flex-wrap: wrap; }
  .dash-leader > * { min-width: 0; max-width: 100%; }
}

/* A224: Download approval — FULL path of every requested file/folder, all listed (no inner scroll), wrap at
   "/" (<wbr>) inside the cell, mid-segment only as last resort; no page overflow at 390; click-to-copy */
.dl-paths { min-width: 0; max-width: 100%; }
.rtable td.dl-paths-td { min-width: 20rem; max-width: 36rem; }
.dl-paths-count { font-weight: 600; font-size: .8rem; color: var(--ds-ink2, #3B4650); margin-bottom: .25rem; }
.dl-paths-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.dl-paths-list li { display: grid; grid-template-columns: 1.25rem minmax(0, 1fr); column-gap: .3rem; row-gap: .15rem; align-items: start; min-width: 0; }
.dl-paths .dl-ico { line-height: 1.5; }
.dl-paths .dl-path { min-width: 0; white-space: normal; overflow-wrap: anywhere; font-size: .8rem; line-height: 1.5; background: #F4F6F8; border-radius: 4px; padding: .1rem .35rem; cursor: copy; }
.dl-paths .dl-meta { grid-column: 2; display: flex; align-items: center; gap: .5rem; }
.dl-paths .dl-size { font-size: .75rem; color: var(--ds-ink2, #5B6570); white-space: nowrap; }
.dl-paths .dl-copy { font-size: .75rem; min-height: 32px; padding: 0 .6rem; border: 1px solid var(--ds-line, #DDE1E5); border-radius: 4px; background: #fff; cursor: pointer; }
.dl-paths li.is-copied .dl-path { background: #E8F5E9; }
@media (max-width: 720px) {
  .rtable td.dl-paths-td { min-width: 0; max-width: none; }
  .dl-paths .dl-copy { min-height: 44px; }
}
/* A226: money never breaks inside a number; grouped money inputs are wide enough to read */
.fin-stats dd { overflow-wrap: normal; word-break: keep-all; white-space: nowrap; font-size: clamp(.85rem, 3.4vw, 1.1rem); }
/* A417/t_881c8699: the TA cell prints a SENTENCE when the course has no TA rate ("chưa có mức
   (không tạo dòng)"); A226's nowrap widened the RTLA03 class page to 439px at a 390 viewport.
   Money in this cell (Trợ giảng / học viên) is short, so only this cell may wrap; every other
   money cell keeps A226's no-break rule. */
.fin-stats dd[data-testid="tmpl-ta-rate"] { white-space: normal; word-break: normal; overflow-wrap: anywhere; }
input.money-in, input[data-vnd] { min-width: 8.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.tui-inline input[data-vnd] { min-width: 0; }
/* A234: Chia lợi nhuận inline 'Đã chuyển' editor */
.partner-bal { display: inline; margin: 0; }
.partner-bal-input { width: 11.5rem; max-width: 100%; text-align: right; font: inherit; font-variant-numeric: tabular-nums; padding: .25rem .5rem; border: 1px dashed var(--ds-line, #cbd5e1); border-radius: .375rem; background: transparent; cursor: text; }
.partner-bal-input:hover { border-style: solid; }
.partner-bal-input:focus { border-style: solid; outline: 2px solid var(--ds-accent, #2563eb); outline-offset: 1px; background: #fff; }
.partner-bal-input.is-saved { border-color: #16a34a; background: #f0fdf4; }
.partner-bal-input.is-error { border-color: #dc2626; background: #fef2f2; }

/* A257: Tổng quan class table — Ngày kết thúc, sortable headers, date filters, 'Cột hiển thị' chooser */
.dash-filter { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: flex-end; }
.dash-filter > label, .dash-range { display: flex; flex-direction: column; gap: .15rem; font-weight: 600; color: var(--ds-ink2); }
.dash-range { border: 0; padding: 0; margin: 0; flex-direction: row; flex-wrap: wrap; gap: .3rem; }
.dash-range legend { padding: 0; margin-bottom: .15rem; font-weight: 600; }
.dash-filter select, .dash-filter input[type=date] { min-height: 44px; }
.dash-filter-btns { display: flex; flex-wrap: wrap; gap: .5rem; }
.dash-sortsel { display: none !important; }
.dash-sort { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: .3rem; min-height: 32px; }
.dash-sort:hover { text-decoration: underline; }
th.num .dash-sort { flex-direction: row-reverse; }
.dash-classes th[aria-sort=ascending] .dt-ind::after { content: "▲"; color: var(--ds-o600, #b84520); }
.dash-classes th[aria-sort=descending] .dt-ind::after { content: "▼"; color: var(--ds-o600, #b84520); }
.dash-classes th[data-col=end], .dash-classes td[data-col=end], .dash-classes td[data-col=start] { white-space: nowrap; }
.dash-classes-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin-top: 1.5rem; }
.dash-classes-head h2 { margin: 0 !important; }
.colpick { position: relative; }
.colpick > summary { list-style: none; cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; gap: .35rem; }
.colpick > summary::-webkit-details-marker { display: none; }
.colpick-n { font-weight: 400; }
.colpick-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: 20rem; max-width: calc(100vw - 2rem); background: #fff; border: 1px solid var(--ds-line); border-radius: var(--ds-r-card, 8px); box-shadow: 0 8px 24px rgba(30,34,38,.16); padding: .75rem; }
.colpick-note { margin: 0 0 .5rem; font-size: .85rem; }
.colpick-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.colpick-item { display: flex; align-items: center; gap: .6rem; min-height: 44px; padding: 0 .35rem; border-radius: 6px; cursor: pointer; }
.colpick-item:hover { background: var(--ds-o50); }
.colpick-item input { width: 20px; height: 20px; flex: none; }
.colpick-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .6rem; padding-top: .6rem; border-top: 1px solid var(--ds-line); }
.colpick-actions .btn-sm { min-height: 44px; }
.hide-status [data-col=status], .hide-start [data-col=start], .hide-end [data-col=end], .hide-doanh_thu [data-col=doanh_thu],
.hide-da_thu [data-col=da_thu], .hide-con_no [data-col=con_no], .hide-chi_phi [data-col=chi_phi],
.hide-loi_nhuan [data-col=loi_nhuan], .hide-leader [data-col=leader], .hide-mine [data-col=mine] { display: none !important; }
/* A258: class Học viên tab columns (Cột hiển thị) + clamped long text */
.hide-tai_khoan [data-col=tai_khoan], .hide-dien_thoai [data-col=dien_thoai], .hide-email [data-col=email],
.hide-ngay_sinh [data-col=ngay_sinh], .hide-truong [data-col=truong], .hide-ly_do [data-col=ly_do],
.hide-kien_thuc [data-col=kien_thuc], .hide-lien_he [data-col=lien_he], .hide-khung_gio [data-col=khung_gio],
.hide-hoan_thanh_cb [data-col=hoan_thanh_cb], .hide-ghi_chu_dk [data-col=ghi_chu_dk], .hide-ghi_danh [data-col=ghi_danh],
.hide-hoc_phi [data-col=hoc_phi], .hide-nhap_hoc [data-col=nhap_hoc],
.hide-tt_hoc_phi [data-col=tt_hoc_phi], .hide-con_lai [data-col=con_lai], .hide-minh_chung [data-col=minh_chung], .hide-srv_ipa [data-col=srv_ipa],
.hide-srv_lms [data-col=srv_lms], .hide-srv_fe [data-col=srv_fe], .hide-srv_be [data-col=srv_be],
.hide-srv_disk [data-col=srv_disk], .hide-srv_last [data-col=srv_last] { display: none !important; }
/* A439: inline cell edit on the merged class Học viên table (same affordance as Tuyển sinh / Chi) */
#roster-basic td.cell-err { outline: 2px solid var(--ictc-err, #b42318); background: #fdf1f0; }
#roster-basic td.cell-edit form.inline-edit { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; }
#roster-basic td.cell-edit form.inline-edit .input { min-width: 7rem; max-width: 12rem; min-height: 44px; }
#roster-basic td.cell-edit form.inline-edit label { font-size: .75rem; display: grid; gap: .1rem; }
#roster-basic td.cell-saving { opacity: .6; }
#roster-basic td .inline-msg { flex-basis: 100%; white-space: normal; }
@media (max-width: 720px) { #roster-basic td.cell-edit { flex-wrap: wrap; } #roster-basic td .inline-msg { text-align: right; padding-right: .25rem; } }
@media (max-width: 720px) { #roster-basic td.cell-edit form.inline-edit .input { min-width: 0; max-width: none; width: 100%; } }
.hv-table td[data-col=truong], .hv-table td[data-col=ly_do], .hv-table td[data-col=kien_thuc], .hv-table td[data-col=lien_he], .hv-table td[data-col=ghi_chu_dk] { min-width: 12rem; max-width: 18rem; }
.hv-table td[data-col=truong], .hv-table td[data-col=ly_do], .hv-table td[data-col=lien_he], .hv-table td[data-col=ghi_chu_dk],
main table.dt-ready.hv-table:not(.el-sheet):not(.ts):not(.survey-table) > tbody > tr > td:is([data-col=truong], [data-col=ly_do], [data-col=lien_he], [data-col=ghi_chu_dk], [data-col=kien_thuc]) { white-space: normal; overflow-wrap: anywhere; } /* A436: short text (<60 chars, no clamp) spilled past its nowrap cell into Kiến thức */
.clamp > summary { list-style: none; cursor: pointer; }
.clamp > summary::-webkit-details-marker { display: none; }
.clamp-txt { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.clamp-txt::after { content: ""; }
.clamp > summary::after { content: "Xem thêm"; color: var(--ds-o600, #c2410c); font-size: .75rem; text-decoration: underline; }
.clamp[open] > summary { display: none; }
.clamp-full { white-space: pre-line; overflow-wrap: anywhere; }
.info-kv dd { white-space: pre-line; overflow-wrap: anywhere; }
@media (max-width: 720px) { .hv-table td[data-col] { max-width: none; min-width: 0; } }
@media (max-width: 720px) {
  .dash-sortsel { display: flex !important; }
  .dash-filter > label, .dash-range { flex: 1 1 100%; }
  .dash-filter select { width: 100%; }
  .dash-range label { flex: 1 1 0; min-width: 0; }
  .dash-range input[type=date] { width: 100%; }
  .dash-sort { min-height: 44px; }
  .colpick { width: 100%; }
  .colpick > summary { width: 100%; justify-content: center; }
  .colpick-panel { position: static; width: auto; max-width: none; margin-top: .5rem; }
}

/* A261: one font in every Điểm table cell. The DS-11 field rule (16px, 48px, high specificity) was leaking into the
   inline attendance inputs of the tracking sheet (table.ts), so 'Chuyên cần' rendered larger than every other cell.
   Controls inherit the cell font; 44px tap target on touch/phones; row height unchanged. */
table.ts tbody td, table.ts tbody th, table.ts tbody td a, table.ts td.ts-rating { font-size: inherit; line-height: inherit; }
table.ts tbody td input.ts-in, table.ts tbody td select {
  font: inherit !important; font-size: inherit !important; font-weight: inherit !important; line-height: inherit !important;
  min-height: 30px !important; height: 30px; padding: 0 .25rem !important;
}
@media (max-width: 720px), (pointer: coarse) {
  table.ts tbody td input.ts-in, table.ts tbody td select { min-height: 44px !important; height: 44px; }
}
/* MAX columns are values like the others (same ink, not grey) */
table.ts td.ts-max { color: inherit; }
/* t_e0490918: one marker, no permanent one — a score cell that really navigates shows the pointer
   and underlines on hover/focus only (the operator asked for uniform typography in this read-only
   table; the legend says grading happens in the session item). */
table.ts td.ro a { color: inherit; font: inherit; text-decoration: none; cursor: pointer; }
table.ts td.ro a:hover, table.ts td.ro a:focus-visible {
  text-decoration: underline; text-decoration-color: var(--ds-o600, #F57C00); text-underline-offset: 2px;
}
table.ts td.ro:not(:has(a)) { text-decoration: none; }
/* student Điểm tab (el-sheet): chips and row heads use the table body size/weight/line-height */
.el-sheet tbody th, .el-sheet tbody td, .el-sheet tbody td .chip { font-size: 13px; font-weight: 500; line-height: 1.5; }
@media (max-width: 720px) { .el-sheet tbody th, .el-sheet tbody td, .el-sheet tbody td .chip { font-size: 12.5px; } }
/* A264: manual access switches (Quyền truy cập) */
.chip-off { background: #FDE7E7; color: #8A1C1C; }
.manual-toggles { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: .75rem; }
.manual-toggle { border: 1px solid var(--ds-field, #ddd); border-radius: var(--ds-r-card); padding: .75rem; min-width: 0; }
.manual-toggle[data-state="off"] { border-color: #E9A3A3; background: #FFF8F8; }
.manual-toggle-head { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .25rem; }
@media (max-width: 720px) {
  /* A264b: full-width controls with 44px tap targets on the Quyền truy cập card */
  .manual-toggle form { flex-direction: column; align-items: stretch; }
  .manual-toggle form label, .manual-toggle form .input { width: 100%; }
  .manual-toggle form .input, .manual-toggle form button { min-height: 44px; }
  .manual-toggle form button { width: 100%; }
}

/* ---------- A267 shared date-range filter (datatable.js): visible Từ/Đến on one row, same height as the selects */
.dt-range { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.dt-range > legend { float: left; width: 100%; padding: 0; margin: 0 0 .15rem; }
.dt-range-row { clear: both; display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.dt-range-part { display: flex; align-items: center; gap: 4px; margin: 0; min-width: 0; font-size: 14px; font-weight: 600; color: var(--ds-ink, #2b2f33); }
.dt-range-lab { flex: none; }
.dt-bar .dt-range input[type=date] { width: 10.75rem; min-width: 0; height: 44px; min-height: 44px; padding: 0 6px; box-sizing: border-box; }
.dt-range-clear { flex: none; width: 36px; min-height: 44px; padding: 0; border: 1px solid var(--ds-field, #b9bec4); border-radius: var(--ds-r-field, 6px); background: #fff; color: var(--ds-ink, #2b2f33); font-size: 20px; line-height: 1; cursor: pointer; }
.dt-range-clear:hover { background: var(--ds-o100, #fceee9); }
@media (max-width: 720px) {
  /* 390px: two full-width rows (Từ / Đến) with the × beside them, so nothing overflows or gets clipped */
  .dt-range-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px; }
  .dt-range-part { grid-column: 1; display: grid; grid-template-columns: 2.4em minmax(0,1fr); gap: 4px; min-width: 0; }
  .dt-bar .dt-range input[type=date] { width: 100%; min-width: 0; padding: 0 6px; font-size: 15px; }
  .dt-range-clear { grid-column: 2; grid-row: 1 / span 2; align-self: stretch; width: 44px; }
}

/* ---------- A270 shared row action menu ("Thao tác ▾"), stat chips, tidy grid filter bar */
.row-menu { position: relative; display: inline-block; }
.row-menu > summary { list-style: none; cursor: pointer; white-space: nowrap; gap: 4px; min-height: 44px; display: inline-flex; align-items: center; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu[open] > summary { border-color: var(--ds-o500, #e65728); background: var(--ds-o50, #fdf6f3); }
.row-menu-pop { position: fixed; z-index: 60; min-width: 11rem; background: #fff; border: 1px solid var(--ds-line, #dadde1); border-radius: var(--ds-r-card, 8px); box-shadow: var(--ds-sh-menu, 0 8px 24px rgba(30,34,38,.14)); padding: 4px 0; }
.row-menu-pop form { margin: 0; }
.row-menu-pop button, .row-menu-pop a { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0 16px; border: 0; background: none; font: inherit; font-size: 14px; color: var(--ds-ink, #2b2f33); text-align: left; cursor: pointer; white-space: nowrap; }
.row-menu-pop button:hover, .row-menu-pop button:focus-visible, .row-menu-pop a:hover { background: var(--ds-o50, #fdf6f3); text-decoration: none; }
.stat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.stat-chips .chip { font-size: 13px; padding: 4px 10px; }
/* table sizing (nowrap, width auto) and the filter bar now come from the A276 global rule below */
.ce-table td.col-act { padding-top: 4px; padding-bottom: 4px; }
@media (max-width: 720px) { .ce-table td.col-act { position: static; box-shadow: none; } }

/* A278: Liên kết tài khoản picker results + row quick actions (Tuyển sinh) */
.link-results { display: flex; flex-direction: column; gap: .25rem; margin-top: .25rem; max-height: 16rem; overflow-y: auto; }
.link-results:empty { display: none; }
.link-opt { text-align: left; border: 1px solid var(--ictc-line, #dadde1); background: #fff; border-radius: 6px; padding: .4rem .6rem; min-height: 44px; cursor: pointer; font: inherit; }
.link-opt:hover, .link-opt:focus-visible { background: var(--ictc-orange-tint, #fceee9); }
.row-acts { display: flex; flex-wrap: wrap; gap: .3rem; }
.row-acts .btn-mini { font-size: .78rem; min-height: 30px; padding: .1rem .55rem; }
/* A301: row actions (Ẩn / Bỏ ẩn / Liên kết) are touch targets on phones */
@media (max-width: 1023px), (pointer: coarse) { .row-acts .btn-mini { min-height: 44px; } }
/* A270: a sticky cell is its own stacking context; lift the one holding the open menu above later rows */
td:has(> details.row-menu[open]), td.col-act:has(details.row-menu[open]) { z-index: 50 !important; }

/* ---------- A276 global table + filter-bar layout (all views/roles; folds A270 .dt-bar-grid / .ce-table) ----------
   1) .content has no width cap (app.css); 2) data tables are sized to their content: one line per cell, no stretching,
   spare space stays to the right; 3) only long free-text columns (.dt-long, set by datatable.js) wrap at ~28ch with a
   title tooltip; 4) wider than the screen -> the table box scrolls and the first column (+ checkbox) stays put;
   5) the filter bar stays on one row when there is room (search grows, selects sized to content). */
@media (min-width: 721px) {
  .table-scroll { position: relative; } /* keep .sr-only/absolute children of scrolled cells from widening the page */
  main table.dt-ready:not(.el-sheet):not(.ts):not(.survey-table) { width: auto; max-width: none; }
  main table.dt-ready:not(.el-sheet):not(.ts):not(.survey-table) > * > tr > td,
  main table.dt-ready:not(.el-sheet):not(.ts):not(.survey-table) > * > tr > th { white-space: nowrap; vertical-align: middle; }
  main table.dt-ready:not(.el-sheet):not(.ts):not(.survey-table) > * > tr > .dt-long { white-space: normal; min-width: 14ch; max-width: 28ch; overflow-wrap: anywhere; }
  main table.dt-ready td.dt-long .dt-clip { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  main table.dt-ready > * > tr > .dt-stick { position: sticky; left: var(--dt-left, 0px); z-index: 1; background-color: inherit; }
  main table.dt-ready:has(.dt-stick) { border-collapse: separate; border-spacing: 0; } /* collapsed borders let scrolled cells show through sticky ones */
  main table.dt-ready > tbody > tr > .dt-stick { background-color: #fff; }
  main table.dt-ready > tbody > tr.dt-alt > .dt-stick { background-color: var(--ds-o50, #fdf6f3); }
  main table.dt-ready > tbody > tr:hover > .dt-stick { background-color: var(--ds-o100, #fceee9); }
  main table.dt-ready > thead > tr > th.dt-stick { z-index: 3; background-color: var(--ds-o100, #fceee9); }
  main table.dt-ready > * > tr > .dt-stick-last { box-shadow: inset -1px 0 0 var(--ds-line, #dadde1), 6px 0 6px -6px rgba(0,0,0,.18); }
  main table.dt-ready > thead > tr > th.dt-stick-last { box-shadow: inset 0 -1px 0 var(--ds-o400, #f6a07f), inset -1px 0 0 var(--ds-line, #dadde1), 6px 0 6px -6px rgba(0,0,0,.18); }
  /* filter bar: one row when there is room */
  .dt-bar, .dt-bar.dt-bar-grid { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
  .dt-bar > .dt-search { flex: 1 1 10rem; min-width: 10rem; max-width: 28rem; }
  .dt-bar > .dt-filter { flex: 0 1 auto; min-width: 0; }
  .dt-bar .dt-filter select, .dt-bar.dt-bar-grid .dt-filter select { width: auto; min-width: 6rem; max-width: 11rem; height: 44px; text-overflow: ellipsis; }
  .dt-bar .dt-range input[type=date] { width: 10.75rem; } /* A353 B3-6: full dd/mm/yyyy + picker icon, never clipped */
  .dt-bar > .dt-meta, .dt-bar.dt-bar-grid > .dt-meta { flex: 0 0 auto; margin-left: auto; grid-column: auto; justify-content: flex-end; }
  .dt-bar .dt-meta .btn-sm { min-height: 44px; }
}

/* A270b: Lớp list — Cột hiển thị (Tối đa hidden by default) + 'Đầy' tag next to Sĩ số */
.hide-khoa [data-col=khoa], .hide-lich [data-col=lich], .hide-khai_giang [data-col=khai_giang],
.hide-trang_thai [data-col=trang_thai], .hide-giang_vien [data-col=giang_vien],
.hide-tro_giang [data-col=tro_giang], .hide-si_so [data-col=si_so], .hide-toi_da [data-col=toi_da] { display: none !important; }
.lop-tools { display: flex; justify-content: flex-end; margin-bottom: .5rem; }
.tag-full { display: inline-block; background: #FDE7E4; color: #9B2C1F; font-size: 11.5px; padding: 1px 7px; margin-left: .3rem; vertical-align: 1px; white-space: nowrap; }
td[data-col=si_so] { white-space: nowrap; }
/* t_ee3ae740: Giảng viên / Trợ giảng — long multi-assignee names wrap instead of widening the table */
td[data-col=giang_vien], td[data-col=tro_giang] { min-width: 8rem; max-width: 16rem; overflow-wrap: anywhere; }

/* A284-A287: 'Lớp đang tuyển và đang học' on Tuyển sinh (% đủ bar, anchor tag) */
.class-pick { margin-bottom: 1.25rem; }
.class-pick-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.class-pick-table td { white-space: nowrap; }
.class-pick-table tr[data-row-href] { cursor: pointer; }
.class-pick-table tr.is-anchor td:first-child { box-shadow: inset 3px 0 0 var(--ds-o500, #E65728); }
.tag-anchor { display: inline-block; background: var(--ds-o100, #FDE8DF); color: var(--ds-ink, #1E1E24); font-size: 11.5px; padding: 1px 7px; margin-left: .3rem; white-space: nowrap; }
.fill-pct { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.fill-num { min-width: 2.8rem; text-align: right; font-variant-numeric: tabular-nums; }
.fill-bar { display: inline-block; width: 4.5rem; height: 6px; border-radius: 999px; background: #EEEEF1; overflow: hidden; }
.fill-in { display: block; height: 100%; width: 0; border-radius: inherit; background: #9A9AA5; }
.fill-amber .fill-in { background: #D97706; } .fill-amber .fill-num { color: #8A4B00; }
.fill-green .fill-in, .fill-full .fill-in { background: #2E7D32; } .fill-green .fill-num, .fill-full .fill-num { color: #1E5B22; }
.fill-grey .fill-num { color: var(--ds-ink2, #55555F); }
.tag-fullok { display: inline-block; background: #E3F1E4; color: #1E5B22; font-size: 11.5px; padding: 1px 7px; white-space: nowrap; }
@media (max-width: 720px) { .class-pick-table td { white-space: normal; } .fill-bar { width: 3.5rem; } }
/* Board feedback wraps inside desktop cells; mobile keeps its separate full-width row. */
#board-table td .inline-msg { white-space: normal; overflow-wrap: anywhere; max-width: 16rem; }
/* Inline save feedback must not compete with the saved value in mobile flex cards. */
@media (max-width: 720px) {
  #board-table td[data-edit]:has(.inline-msg), #class-pick-table td[data-cedit]:has(.inline-msg) { flex-wrap: wrap; }
  /* t_1414a6c5: the saved value wraps inside the card. `nowrap` (added with A467) let ONE long legacy
     free-text "Tháng" answer (signup prose, e.g. data-enrollment 2192) widen the whole page to 681 px
     at a 390 px viewport; short month values still sit on one line in the full-width card row. */
  #board-table td[data-edit="month"] { white-space: normal; overflow-wrap: anywhere; }
  #board-table td .inline-msg, #class-pick-table td .inline-msg { flex-basis: 100%; min-width: 0; max-width: none; white-space: normal; overflow-wrap: anywhere; text-align: left; }
}
/* A428: the inline refusal ('Tối đa không được nhỏ hơn sĩ số …') wraps inside its cell, never clipped */
.class-pick-table td .inline-msg { white-space: normal; overflow-wrap: anywhere; max-width: 16rem; }
@media (max-width: 720px) { .class-pick-table td .inline-msg { flex-basis: 100%; max-width: none; text-align: left; } }
/* A288/A289: 'Tự tạo' tag, 'tự động' date hint, per-course 'Tạm dừng' panel */
.tag-auto { display: inline-block; background: var(--ds-g100, #E7F1EC); color: var(--ds-ink, #1E1E24); font-size: 11px; padding: 0 6px; margin-left: .25rem; white-space: nowrap; }
.auto-pause-grid { display: grid; gap: .4rem; margin-top: .5rem; }
.auto-pause-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .9rem; }
.auto-pause-row strong { min-width: 3.5rem; }
/* A322: 'Đã chốt' tag + inline 'Chốt khai giảng' form in the Tuyển sinh class table */
.tag-locked { display: inline-block; background: #E0EAFB; color: #1B3A6B; font-size: 11px; font-weight: 600; padding: 0 6px; margin-left: .25rem; white-space: nowrap; }
.start-lock { margin-top: .25rem; }
.start-lock summary { color: var(--ds-ink2, #55555F); }
.start-lock-form { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-top: .3rem; }
.start-lock-form .input { width: auto; min-width: 0; max-width: 10.5rem; padding: .2rem .4rem; }
/* A280: on phones, lock chips ('Đang ẩn', 'Tự mở lúc …') wrap to a 2nd line so the session title never collapses */
@media (max-width: 720px) {
  .sess-head { flex-wrap: wrap; }
  .sess-head > .sess-title { flex: 1 1 calc(100% - 5.5rem); min-width: 0; }
  .sess-head > .sess-caret { order: 2; }
  .sess-head > .chip { order: 3; white-space: normal; margin-left: 3rem; }
}
/* A273: Giảng viên list 'Lớp' column - compact class chips (GV/TG), current first, past greyed; wraps */
.cls-chip { display: inline-block; background: var(--ds-o100, #FDE8DF); color: var(--ds-ink, #1E1E24); font-size: 11.5px; line-height: 1.5; padding: 0 6px; margin: 1px 0; border-radius: 6px; white-space: nowrap; text-decoration: none; }
.cls-chip b { font-weight: 700; font-size: 10.5px; }
.cls-chip.is-past { background: #EEEEF1; color: var(--ds-ink2, #55555F); }
.cls-chip:hover { text-decoration: underline; }
.cls-more { display: inline-block; font-size: 11.5px; font-weight: 600; color: var(--ds-ink2, #55555F); padding: 0 4px; white-space: nowrap; }
main table.dt-ready:not(.el-sheet):not(.ts):not(.survey-table) > * > tr > td.cls-chips { white-space: normal; min-width: 30ch; max-width: 36ch; text-align: left; }
main table.dt-ready > thead > tr > th.cls-chips { text-align: left; }
main table.dt-ready > thead > tr > th.cls-chips .dt-sort { flex-direction: row; }
@media (max-width: 720px) { .rtable td.cls-chips { flex-wrap: wrap; justify-content: flex-end; gap: 2px 4px; } }
/* A296: cells kept only for table search + CSV export; never displayed (desktop or mobile cards) */
table th.csv-only, table td.csv-only, .rtable td.csv-only { display: none !important; }
/* A299: normal access = empty Truy cập cell; hide the empty label row in mobile cards */
@media (max-width: 720px) { .rtable td[data-testid=student-access]:empty { display: none; } }

/* ---------- A310 Chi: one flat table (shared datatable) + multi Hạng mục filter + Tổng row ---------- */
.cat-unclassified { --cb: var(--cat-other-bg); --cf: var(--cat-other-fg); --cd: var(--cat-other-dot); }
.chi-cat-orig { font-size: .8rem; }
.chi-tools { display: flex; justify-content: flex-end; margin-bottom: .5rem; }
.hide-ngay [data-col=ngay], .hide-lop [data-col=lop], .hide-hang_muc [data-col=hang_muc], .hide-noi_dung [data-col=noi_dung],
.hide-so_tien [data-col=so_tien], .hide-nguoi_nhan [data-col=nguoi_nhan], .hide-done [data-col=done] { display: none !important; }
.dt-multi { position: relative; }
.dt-multi > summary { list-style: none; cursor: pointer; display: flex; align-items: center; flex-wrap: wrap; gap: .25rem .35rem; min-height: 44px; padding: 6px 12px; background: #fff; max-width: 26rem; color: var(--ds-ink); font-weight: 600; }
.dt-multi > summary::-webkit-details-marker { display: none; }
.dt-multi > summary::after { content: "▾"; margin-left: auto; color: var(--ds-ink2); }
.dt-multi.is-on > summary { border-color: var(--ds-o600, #b84520); }
.dt-multi-lab { color: var(--ds-ink2); }
.dt-multi [data-dt-multi-sum] { display: inline-flex; flex-wrap: wrap; gap: .25rem; font-weight: 400; }
.dt-multi-pop { position: absolute; left: 0; top: calc(100% + 4px); z-index: 40; min-width: 16rem; max-width: calc(100vw - 2rem); background: #fff; border: 1px solid var(--ds-line); border-radius: var(--ds-r-card, 8px); box-shadow: 0 8px 24px rgba(30,34,38,.16); padding: .4rem; display: grid; }
.dt-multi-opt { display: flex; align-items: center; gap: .55rem; min-height: 44px; padding: 0 .4rem; border-radius: 6px; cursor: pointer; font-weight: 400; color: var(--ds-ink); }
.dt-multi-opt:hover { background: var(--ds-o50); }
.dt-multi-opt input { width: 20px; height: 20px; flex: none; }
.chi-table tfoot th, .chi-table tfoot td { font-weight: 700; background: var(--ds-o50); border-top: 2px solid var(--ds-ink); white-space: nowrap; }
.chi-table tfoot { position: sticky; bottom: 0; z-index: 2; }
.chi-table td[data-col=ngay], .chi-table td[data-col=lop], .chi-table td[data-col=khoa] { white-space: nowrap; }
/* A310: fit 1440 without sideways scroll: long payees/categories wrap, Nội dung gets the room */
main #chi-table.dt-ready > tbody > tr > td[data-col=nguoi_nhan] { white-space: normal; min-width: 7rem; max-width: 12rem; overflow-wrap: anywhere; }
main #chi-table.dt-ready > tbody > tr > td[data-col=hang_muc] { white-space: normal; max-width: 11rem; }
main #chi-table.dt-ready > tbody > tr > td[data-col=noi_dung] { white-space: normal; min-width: 12rem; max-width: 34rem; }
@media (min-width: 721px) {
  main #chi-table.dt-ready > * > tr > th, main #chi-table.dt-ready > * > tr > td { padding-left: 10px; padding-right: 10px; }
  #chi-table .chi-done > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); } /* checkbox has its aria-label */
}
.chi-table td[data-col=hang_muc] .chi-cat-orig { display: block; margin-top: .15rem; }
.chi-table .chi-done span { font-size: .85rem; }
.dt-multi > summary.input { border: 1px solid rgb(138, 138, 148); border-radius: 6px; }
@media (max-width: 720px) {
  .dt-multi > summary { max-width: none; }
  .dt-multi-pop { left: 0; right: 0; min-width: 0; }
  .chi-table.rtable tfoot { position: static; display: block; }
  .chi-table.rtable tfoot tr { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; border: 2px solid var(--ds-ink); border-radius: var(--ds-r-card); padding: .5rem .75rem; background: var(--ds-o50); }
  .chi-table.rtable tfoot th, .chi-table.rtable tfoot td { display: block; border: 0; padding: 0; background: transparent; }
  .chi-table.rtable tfoot td:empty { display: none; }
  .chi-table.rtable tfoot td[data-label]::before { content: attr(data-label) ": "; font-weight: 600; color: var(--ds-ink2); }
}

/* A308: class status pill (one component: {% cls_status %}). Text unchanged; AA contrast (>= 4.5:1). */
.st-pill { display: inline-flex; align-items: center; gap: .35rem; padding: .1rem .6rem; border-radius: 999px; font-size: .82rem; font-weight: 600; line-height: 1.5; white-space: nowrap; background: #EEEEF1; color: #44444E; border: 1px solid transparent; }
.st-pill::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; flex: none; background: currentColor; opacity: .8; }
.st-open { background: #E3F4E6; color: #1B5E20; border-color: #B9DFC0; }
.st-started { background: #E4EEFB; color: #174A8B; border-color: #BBD0EE; }
.st-finished { background: #EEEEF1; color: #4A4A55; border-color: #D9D9DF; }
.st-planned { background: #FFF3DA; color: #7A4A00; border-color: #F0D49A; }

/* A309b: Tổng quan "Theo lớp" Tổng row: sticky on desktop, one labelled summary card on mobile */
#theo-lop tfoot td { font-weight: 700; background: var(--ds-o50); border-top: 2px solid var(--ds-ink); white-space: nowrap; }
@media (max-width: 720px) {
  #theo-lop.rtable tfoot { display: block; }
  #theo-lop.rtable tfoot tr { display: grid; grid-template-columns: minmax(0, 1fr); gap: .3rem; border: 2px solid var(--ds-ink); border-radius: var(--ds-r-card); padding: .75rem 1rem; background: var(--ds-o50); }
  #theo-lop.rtable tfoot td { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; border: 0; padding: 0; background: transparent; white-space: normal; text-align: right; }
  #theo-lop.rtable tfoot td:empty { display: none; }
  #theo-lop.rtable tfoot td[data-col=lop] { display: block; text-align: left; font-size: 1.05rem; padding-bottom: .2rem; }
  #theo-lop.rtable tfoot td[data-col=leader] { flex-wrap: wrap; }
  #theo-lop.rtable tfoot td[data-col=leader] .tot-l { display: block; white-space: nowrap; }
  #theo-lop.rtable tfoot .tot-sep { display: none; }
  #theo-lop.rtable tfoot td[data-label]:not([data-label=""])::before { content: attr(data-label); font-weight: 600; color: var(--ds-ink2); text-align: left; flex: none; }
}
@media (max-width: 720px) {
  #chi-chung.rtable tfoot, #theo-lop.rtable tfoot { display: block; }
  #chi-chung.rtable tfoot tr { display: grid; grid-template-columns: minmax(0, 1fr); gap: .3rem; border: 2px solid var(--ds-ink); border-radius: var(--ds-r-card); padding: .75rem 1rem; background: var(--ds-o50); }
  #chi-chung.rtable tfoot td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: 0; background: transparent; }
  #chi-chung.rtable tfoot td[data-label]::before { content: attr(data-label); font-weight: 600; color: var(--ds-ink2); }
}
/* RT20 D-RT20-1: Tuyển sinh name cell (name, email, chips, Bỏ ẩn/Liên kết) stacks under one label column at 390 */
@media (max-width: 720px) {
  #board-table.rtable td:has(> .row-acts) { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); column-gap: .75rem; row-gap: .2rem; justify-items: start; text-align: left; }
  #board-table.rtable td:has(> .row-acts)::before { grid-row: 1 / span 20; white-space: nowrap; }
  #board-table.rtable td:has(> .row-acts) > * { grid-column: 2; min-width: 0; max-width: 100%; overflow-wrap: break-word; }
}
/* RT20 D-RT20-2: Chi fits 1440 (no 3px sideways scroll); Thao tác stays a real table cell so it fills the row height */
@media (min-width: 721px) {
  main #chi-table.dt-ready > tbody > tr > td[data-col=noi_dung] { min-width: 11rem; }
  #chi-table td.col-act { display: table-cell; vertical-align: middle; white-space: nowrap; }
  #chi-table td.col-act > form { display: inline-block; margin: 0; }
}

/* A340: staff status chip (what students see right now); compact, wraps at 390 */
.vis-chip { font-size: 12px; padding: 1px 8px; line-height: 1.5; white-space: nowrap; }
.sess-head > .vis-chip { flex: none; }
@media (max-width: 720px) { .sess-head > .vis-chip { white-space: normal; max-width: 60%; } .item > .vis-chip { margin-left: 2.95rem; } }
/* A341: Self Evaluation gate */
.sess-gate { margin: .5rem 1rem; padding: .75rem 1rem; border-left: 3px solid var(--ds-err); }
.sess-gate-staff { margin: .25rem 1rem; }
.gate-list { list-style: none; margin: .5rem 0 0; padding: 0; }
.gate-list li { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; padding: .35rem 0; border-bottom: 1px solid #EEEEF1; }
.gate-list li > span:first-child { flex: 1 1 14rem; min-width: 0; overflow-wrap: anywhere; }
.gate-list li.is-waived > span:first-child { color: var(--ds-ink2); }
.gate-due { white-space: nowrap; }
@media (max-width: 640px) { .sess-gate, .sess-gate-staff { margin: .5rem; } .gate-list li { flex-direction: column; align-items: stretch; } .gate-list li > span:first-child { flex: 0 0 auto; } .gate-list .el-inline-act, .gate-list .btn-sm { width: 100%; } .gate-list .btn-sm { min-height: 44px; } }
/* A335: score formula (weights + points) in the rating card, Điểm tab and Xếp loại page; stacks at 390 */
.score-formula { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--a99-rule, #dadde1); font-size: 12.5px; }
.score-formula-h { font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--a99-muted, #5d646b); margin: 0 0 2px !important; }
.score-formula-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.score-formula-lines li { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sf-name { font-weight: 600; }
.sf-cap { color: #7a4a00; }
.score-formula-total { margin: 3px 0 0 !important; font-variant-numeric: tabular-nums; }
.sheet-formula { padding: 4px 16px 6px; max-width: 54rem; }
@media (max-width: 720px) { .sheet-formula { padding: 4px 12px 6px; } }
/* A342: Nộp trễ / Nộp rất trễ marks in the tracking sheet (T / RT superscript next to the score) */
.late-mark { display: inline-block; margin-left: .2rem; padding: 0 .3rem; border-radius: 4px; font-size: .68rem; font-weight: 600; line-height: 1.4; vertical-align: middle; }
.late-mark.late-late { background: var(--ictc-amber-tint, #fdf5e8); color: #7a4a00; }
.late-mark.late-very_late { background: #fdf1f0; color: var(--ictc-err, #b42318); }
/* A347: per-class role chip on the teacher 'Lớp của tôi' cards (the header role label is hidden at <=720px); class link is a 44px target */
.class-role { flex: none; white-space: nowrap; }
[data-testid="teacher-class-row"] [data-testid="class-link"] { display: inline-flex; align-items: center; min-height: 44px; }
/* A353 B1-2: grading list at desktop widths. Long submission text/usernames wrap inside their own column, so the
   score ("Điểm: x / 10") and the "Xem / sửa" action column stay inside the table box at 1440 without clipping; the sticky
   first column uses exactly the row tint (zebra / dt-alt / hover) instead of its own cream tint. */
@media (min-width: 721px) {
  .grading td:not(.num), .grading td:not(.num) .cv { white-space: normal !important; }
  .grading td .cv, .grading td .cv-name { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
  .grading td[data-label="Học viên"] .cv { width: 11rem; max-width: 11rem; }
  .grading td[data-label="Bài làm"] .cv { width: 18rem; max-width: 18rem; }
  .grading td[data-label="Trạng thái"] .cv { min-width: 8rem; }
  .grading td[data-label="Thao tác"] .cv { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
  .grading td[data-label="Bài làm"] [data-testid="text-preview"] { display: block; white-space: normal !important; overflow-wrap: anywhere; word-break: break-word; }
  .grading td.num { white-space: nowrap; }
  main table.grading > tbody > tr > td, main table.grading.dt-ready > tbody > tr > .dt-stick { background-color: #fff; }
  main table.grading > tbody > tr.dt-alt > td, main table.grading:not(.dt-ready) > tbody > tr:nth-child(2n) > td,
  main table.grading.dt-ready > tbody > tr.dt-alt > .dt-stick { background-color: #FAFAFB; }
  main table.grading.dt-ready > tbody > tr:hover > td, main table.grading.dt-ready > tbody > tr:hover > .dt-stick { background-color: var(--ictc-orange-tint, #fdf1ec); }
  main table.grading > tbody > tr.has-error > td { background-color: #fdf1f0; }
}
/* A353 B3-7: blocked-login form reads as disabled (inputs greyed, not just the button) */
fieldset:disabled input.input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):not([type=range]), input.input:disabled:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):not([type=range]) { background: #f3f4f6; color: #9ca3af; border-color: #e5e7eb; cursor: not-allowed; }
fieldset:disabled label { color: #9ca3af; }
[data-testid="lms-blocked"] a:focus-visible { outline-offset: 2px; }
/* A355b: client paging of long lists (data-dt-page). Rows off the current page are not laid out; the
   header row sticks inside the table box (desktop), zebra restarts per page, pager links sit below. */
main table.dt-ready > tbody > tr.dt-pg-off { display: none; }
@media (min-width: 721px) {
  .table-scroll.dt-paged { max-height: min(78vh, 60rem); overflow: auto; }
  .table-scroll.dt-paged > table.dt-ready > thead > tr > th { position: sticky; top: 0; z-index: 2; }
  .table-scroll.dt-paged > table.dt-ready > thead > tr > th.dt-stick { z-index: 4; }
}
.dt-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 12px 0 4px; min-height: 44px; }
.dt-pager-info { color: var(--ds-ink2); font-size: 14px; }
.dt-pager-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dt-pg { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 12px; border: 1px solid var(--ds-line, #dadde1); border-radius: 8px; background: #fff; color: var(--ds-ink); text-decoration: none; font-weight: 600; }
a.dt-pg:hover { background: var(--ds-o50, #fdf6f3); }
a.dt-pg:focus-visible { outline: 2px solid var(--ds-ink); outline-offset: 2px; }
.dt-pg[aria-current="page"] { background: var(--ds-o500); border-color: var(--ds-o500); color: var(--ds-ink); }
.dt-pg.is-off { color: #9ca3af; background: #f9fafb; cursor: default; }
.dt-pg-gap { padding: 0 2px; color: var(--ds-ink2); }
@media (max-width: 720px) {
  .dt-pager { justify-content: center; }
  .dt-pager-info { width: 100%; text-align: center; }
  .dt-pg-nav { padding: 0 10px; }
  .dt-pager-links { gap: 4px; justify-content: center; }
  .dt-pg-far { display: none; }
  .dt-pg-word { display: none; } /* phones: ‹ › only (aria-label keeps the name), one row at 360px */
}

/* A355b CLS (font swap): `ch` follows the width of "0" in the CURRENT font (Be Vietnam Pro 0.676em, Arial 0.556em),
   so 70ch/110ch boxes grew ~22% when the webfont arrived and re-wrapped page-head buttons and the bang-diem legend.
   Same widths in em (as rendered with Be Vietnam Pro) do not depend on which font is loaded yet. */
.page-head { max-width: 47.3em; }
.ts-legend { max-width: 74.4em; }

/* A355b CLS: until datatable.js has run (html.dt-wait, cleared by base.html right after init), data tables, their
   direct wrapper box (scroll box / card) and everything after them (at every nesting level) keep their boxes but are not painted; headings and text
   ABOVE the first table paint at once (they are the LCP element and never move), so inserting the
   toolbar/scroll box/pager never moves content the user already sees (content above is unaffected). */
.dt-wait main table:not([data-dt-off]), .dt-wait main table:not([data-dt-off]) ~ *,
.dt-wait main :has(> table:not([data-dt-off])), .dt-wait main :has(table:not([data-dt-off])) ~ * { visibility: hidden; }

/* A356-6: staff server-status table on the class Học viên tab (fits 1440 without scrolling) */
.srv-table td, .srv-table th { padding-left: .6rem; padding-right: .6rem; }
.srv-table th, .srv-table th .th-sort { white-space: normal; min-width: 4.5rem; }
.srv-table td[data-col=ten] { white-space: normal; }
.srv-table td[data-col=ten] { min-width: 10rem; }
.srv-table td[data-col=disk] { white-space: nowrap; }
.srv-table td[data-col=disk] .usage-bar { width: 5.5rem; }
.srv-table td[data-col=disk] .usage-label { font-size: .82rem; }
.srv-table td[data-col=last] { white-space: nowrap; }
.srv-table .block { max-width: 11rem; white-space: normal; }
@media (max-width: 720px) {
  .srv-table td[data-col=disk], .srv-table td[data-col=last] { white-space: normal; }
  .srv-table .block { max-width: none; }
  #srv-status-table.rtable td { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: .75rem; text-align: left; align-items: start; }
  #srv-status-table .srv-v { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .4rem; min-width: 0; }
  #srv-status-table .srv-v > .block { flex-basis: 100%; }
  #srv-status-table.rtable td[data-col=ten] { font-weight: 700; }
}
main #srv-status-table.dt-ready > thead > tr > th { white-space: normal; }
main #srv-status-table.dt-ready > tbody > tr > td[data-col=ten], main #srv-status-table.dt-ready > tbody > tr > td[data-col=lms], main #srv-status-table.dt-ready > tbody > tr > td[data-col=be] { white-space: normal; }
/* A398 (Gogito): data tables use the full content width; the table box scrolls only when the table is
   really wider than the space. Panels that cap their width for prose (Máy chủ .srv-panel 1180px) drop
   the cap when they hold a data table. */
main section.srv-panel:has(.table-scroll > table) { max-width: none; }
@media (min-width: 721px) {
  /* A398: download-request queues (Máy chủ > Duyệt tải, /duyet/ Tải dữ liệu): fit >=1280 without scrolling.
     Đường dẫn = fixed max width (paths wrap at "/"), Ghi chú / names / chips wrap, actions pinned right. */
  main table#queue.dt-ready > tbody > tr > td { vertical-align: top; } /* tall path lists: name/actions stay at the row top */
  main table#queue.dt-ready > * > tr > td.dl-paths-td { white-space: normal; min-width: 12rem; max-width: 20rem; width: 20rem; }
  main table#queue.dt-ready > * > tr > td[data-label="Ghi chú"],
  main table#queue.dt-ready > * > tr > td[data-label="Học viên"],
  main table#queue.dt-ready > * > tr > td[data-label="Trạng thái"],
  main table#queue.dt-ready > * > tr > td[data-label="Giao tệp"] { white-space: normal; overflow-wrap: anywhere; min-width: 6rem; max-width: 12rem; }
  main table#queue.dt-ready > * > tr > td[data-label="Ghi chú"] { min-width: 8rem; max-width: 16rem; }
  main table#queue.dt-ready > * > tr > td[data-label="Lớp"] { white-space: normal; min-width: 5.5rem; max-width: 8rem; }
  main table#queue.dt-ready > * > tr > td[data-label="Lớp"] .chip { white-space: normal; }
  main table#queue.dt-ready > * > tr > td[data-label="Ngày"] { white-space: normal; min-width: 5rem; }
  main table#queue.dt-ready > * > tr > .col-act { white-space: normal; min-width: 8.5rem; max-width: 11rem; }
  main table#queue.dt-ready > * > tr > .col-act .inline-edit .input { width: 100%; min-width: 0; }
  /* A398c: the Duyệt / Từ chối buttons wrap under the reason input instead of overflowing the pinned column */
  main table#queue.dt-ready > * > tr > .col-act form.inline-edit { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; }
  main table#queue.dt-ready > * > tr > .col-act form.inline-edit .input { flex: 1 1 100%; }
  main .table-scroll > table#queue.dt-ready > * > tr > .col-act { position: sticky; right: 0; z-index: 1; background-color: #fff; box-shadow: inset 8px 0 8px -8px rgba(0,0,0,.25); }
  main .table-scroll > table#queue.dt-ready > thead > tr > th.col-act { z-index: 3; background-color: var(--ds-o100, #fceee9); }
  main .table-scroll > table#queue.dt-ready > tbody > tr.dt-alt > .col-act { background-color: var(--ds-o50, #fdf6f3); }
}

/* RT31 QA notes (t_fbfdcff4): at 390 card labels never break mid-word (coordinator Cập nhật nhanh "Đã đóng");
   money cells keep label + input + Lưu on one row (Lưu stays >=44px via Q2); the rating-card threshold
   "(≥ 5,0)" stays whole (NBSP from apps/lms/progress.py + normal word breaking in the missing list). */
@media (max-width: 720px) {
  .rtable td::before { overflow-wrap: normal; word-break: keep-all; }
  .rtable td.num::before { flex: 0 0 auto; white-space: nowrap; }
  .rtable td.num > input.money-in { flex: 1 1 8.5rem; min-width: 0; width: auto; }
}
.g-missing li, #missing li { overflow-wrap: break-word; word-break: normal; }

/* t_cea3cf19 (Liên kết tài khoản): a status pill inside a long-text column (.dt-long, max 28ch, set by
   datatable.js on Lý do / Ghi chú …) wraps inside its cell instead of running into the next column.
   Applies to every data table; short pills in normal columns keep one line. */
main table .dt-long .chip, main table td .chip.chip-wrap { white-space: normal; max-width: 100%; overflow-wrap: anywhere; text-align: left; line-height: 1.35; padding-top: .2rem; padding-bottom: .2rem; }
/* review table fills the panel (zebra + sort from datatable.js); links and sort headers are 44px targets */
main table#link-review.dt-ready { width: 100%; }
@media (max-width: 720px) { main table#link-review.rtable td::before { flex: 0 0 8.5rem; padding-right: .75rem; } }
main table#link-review.dt-ready > * > tr > td { vertical-align: middle; }
main table#link-review td a.underline { display: inline-flex; align-items: center; min-height: 44px; }
main table#link-review thead .dt-sort { min-height: 44px; }
@media (min-width: 721px) {
  /* headers wrap (long titles like 'Hồ sơ đang giữ tài khoản' no longer size their column); Lý do gets the room */
  main table#link-review.dt-ready > thead > tr > th { white-space: normal; }
  main table#link-review.dt-ready > thead > tr > th:nth-child(5) { min-width: 8.5rem; }
  main table#link-review.dt-ready > * > tr > td.dt-long, main table#link-review.dt-ready > * > tr > th.dt-long { width: 22rem; min-width: 16rem; max-width: 22rem; }
  main table#link-review.dt-ready > * > tr > td[data-label="Ghi nhận"] { white-space: nowrap; }
}

/* A434 (t_a94ff2a7): class tab bar at 390 keeps the active tab readable (smaller padding) and
   class.html scrolls it into view; no native scrollbar overlapping the active underline.
   The bar overflows 1px vertically (underline), which drew a stray vertical scrollbar at 1440. */
.ws-tabs { overflow-y: hidden; }
@media (max-width: 720px) {
  .ws-tabs { scroll-padding-inline: 1rem; scrollbar-width: none; }
  .ws-tabs::-webkit-scrollbar { display: none; }
  .ws-tab { padding: .6rem .65rem; }
}
/* A418 Chi inline edit */
#chi-table td.cell-err { outline: 2px solid var(--ictc-err, #b42318); background: #fdf1f0; }
#chi-table td .chi-saving { opacity: .6; }
#chi-table td.cell-edit form.inline-edit .input { min-width: 8rem; max-width: 16rem; }
@media (max-width: 720px) { #chi-table td.cell-edit form.inline-edit .input { min-width: 0; max-width: none; width: 100%; } }

/* A436: self-assessment = one row per skill, label left / score right, no truncation */
.skill-rows { list-style: none; margin: 0; padding: 0; min-width: 9rem; }
.skill-rows li { display: flex; justify-content: space-between; gap: .75rem; line-height: 1.35; padding: 1px 0; }
.skill-rows .skill-k { overflow-wrap: anywhere; }
.skill-rows .skill-v { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.skill-more > summary { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; cursor: pointer; color: var(--ds-o600, #c2410c); font-weight: 600; list-style: none; }
.skill-more > summary::-webkit-details-marker { display: none; }
.skill-more[open] > summary { display: none; }
/* A436 (QA r71): header subtitle stacks under its label; sort indicator stays beside the stack */
.th-stack { display: inline-flex; flex-direction: column; align-items: flex-start; text-align: left; }
.th-stack > .th-label, .th-stack > .th-sub { display: block; }
.th-stack > .th-sub { font-weight: 400; }
/* A437: Học phí = paid / total with the status as a small tag underneath */
.fee-cell { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.fee-amt { white-space: nowrap; font-variant-numeric: tabular-nums; }
.fee-tag { font-size: .7rem; padding: 0 .4rem; }
.fee-tag.fee-paid, .fee-tag.fee-waived { background: #dcfce7; color: #166534; }
.fee-tag.fee-deposit, .fee-tag.fee-partial { background: #fef3c7; color: #92400e; }
.fee-tag.fee-unpaid { background: #fee2e2; color: #991b1b; }
.fee-tag.fee-refunded { background: #e5e7eb; color: #374151; }
@media (max-width: 720px) {
  .rtable td[data-col="kien_thuc"] .skill-box { flex: 1 1 0; min-width: 0; max-width: 15rem; }
  .rtable td[data-col="kien_thuc"] .skill-rows { min-width: 0; }
  .rtable td .fee-cell { align-items: flex-end; }
}
/* A447: links inside activity/page text are buttons, never raw long URLs */
a.link-btn { display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; padding: .4rem .9rem; margin: .15rem 0; border: 1px solid var(--ds-o300, #f6b37f); border-radius: 999px; background: var(--ds-o50, #fff7ef); color: var(--ds-ink, #1f2328); font-weight: 600; text-decoration: none; max-width: 100%; overflow-wrap: anywhere; vertical-align: middle; }
a.link-btn::after { content: "↗"; font-weight: 400; }
a.link-btn:hover, a.link-btn:focus-visible { background: var(--ds-o100, #ffe9d6); outline: 2px solid var(--ds-o300, #f6b37f); outline-offset: 1px; }
/* A439b: inline cells of the other merged one-table views (Tài chính hạn mức, quiz Lượt thêm) */
td[data-inline].cell-err { outline: 2px solid var(--ictc-err, #b42318); background: #fdf1f0; }
td[data-inline].cell-edit { min-height: 44px; min-width: 5rem; }
td[data-inline] form.inline-edit .input { min-height: 44px; min-width: 5rem; max-width: 12rem; }
td[data-inline].cell-saving { opacity: .6; }
td[data-inline] .inline-msg { flex-basis: 100%; white-space: normal; text-align: left; }
@media (max-width: 720px) { td[data-inline] form.inline-edit .input { min-width: 0; width: 100%; max-width: none; } }
/* quiz report: attempts nested under their student row */
ul.quiz-att-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
ul.quiz-att-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
ul.quiz-att-list .btn-mini { min-height: 44px; display: inline-flex; align-items: center; }
/* teacher tracking sheet: read-only server columns */
table.ts th.ts-srv, table.ts td.ts-srv { background: #f8fafb; white-space: nowrap; text-align: left; }
td[data-inline].cell-err, td[data-inline]:has(.inline-msg) { white-space: normal; min-width: 15rem; }
td[data-inline] .inline-msg { min-width: 13rem; }
.ce-table td[data-testid=access-state] { min-width: 11rem; }
.ce-table td[data-testid=access-state] .chip { white-space: nowrap; margin: 1px 0; }
@media (max-width: 720px) {
  td[data-inline].cell-edit { outline-offset: -1px; padding-left: .5rem; padding-right: .5rem; }
  td[data-inline]:has(.inline-msg), td[data-inline].cell-err { min-width: 0; }
  .ce-table td[data-testid=access-state] { min-width: 0; }
  ul.quiz-att-list li { justify-content: flex-end; text-align: right; }
}
@media (max-width: 720px) { .ce-table td[data-testid=access-state] { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px 4px; } .ce-table td[data-testid=access-state] .chip { white-space: normal; } }
td[data-inline] form.inline-edit { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
td[data-inline] form.inline-edit .input { flex: 1 1 5rem; }
td[data-inline] form.inline-edit .btn-mini { flex: 0 0 auto; min-height: 44px; }
@media (max-width: 720px) {
  .rtable td[data-inline]:has(form) { display: block; text-align: left; }
  .rtable td[data-inline]:has(form)::before { display: block; margin-bottom: .25rem; }
  td[data-inline] form.inline-edit { width: 100%; }
  td[data-inline] form.inline-edit .input { flex: 1 1 100%; width: 100%; }
}

/* A439b QA (t_9efc4ba6): sortable header controls are >=44px tap targets on desktop too (DS-23);
   the th's vertical padding moves into the control so header rows do not grow by 44px */
main thead button.ts-sort, main thead .dt-sort, main thead .th-sort, main thead a.dt-sort-link { min-height: 44px; display: inline-flex; align-items: center; }
main thead th:has(> button.ts-sort, > .dt-sort, > .th-sort, > a.dt-sort-link) { padding-top: 0; padding-bottom: 0; }

/* A455: approver browses a requested folder (lazy, paginated, read-only tree) */
.dl-tree-toggle { font-size: .75rem; padding: .1rem .45rem; border: 1px solid #C9D2DA; border-radius: 4px; background: #fff; cursor: pointer; justify-self: start; grid-column: 2; }
.dl-tree-toggle:focus-visible, .dt-toggle:focus-visible, .dt-more:focus-visible { outline: 2px solid #1B6AC9; outline-offset: 1px; }
.dl-tree-toggle[aria-expanded="true"] { background: #EEF4FC; }
.dt-host { grid-column: 1 / -1; min-width: 0; margin: .15rem 0 .35rem .4rem; padding-left: .5rem; border-left: 2px solid #E1E7ED; }
.dt-crumbs { font-size: .72rem; color: var(--ds-ink2, #5B6570); overflow-wrap: anywhere; margin-bottom: .2rem; }
.dt-sep { padding: 0 .15rem; }
.dt-crumb-cur { font-weight: 600; color: var(--ds-ink, #1F2A33); }
.dt-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .15rem; }
.dt-node { display: grid; grid-template-columns: 1.1rem minmax(0, 1fr) auto; column-gap: .35rem; align-items: start; font-size: .78rem; min-width: 0; }
.dt-node .dt-host { grid-column: 1 / -1; }
.dt-ico { line-height: 1.5; }
.dt-name, .dt-toggle { min-width: 0; overflow-wrap: anywhere; text-align: left; }
.dt-toggle { border: 0; background: none; color: #1B5AA6; text-decoration: underline; cursor: pointer; padding: 0; font: inherit; }
.dt-toggle[aria-expanded="true"] { font-weight: 600; }
.dt-size { font-size: .72rem; color: var(--ds-ink2, #5B6570); white-space: nowrap; }
.dt-status { font-size: .75rem; margin: .15rem 0; }
.dt-error { color: #A32222; }
.dt-more { font-size: .72rem; margin: .2rem 0 0 .2rem; padding: .1rem .45rem; border: 1px solid #C9D2DA; border-radius: 4px; background: #fff; cursor: pointer; }
/* A455 QA D3: the tree is a bounded pane, so a 250-entry folder cannot stretch the approval row
   to ~5,000 px and push the Duyệt/Từ chối buttons out of view. Nested hosts stay unbounded (they
   live inside the pane) — only the host the template renders for a request row gets the cap. */
.dt-host[data-dt-host] { max-height: min(60vh, 30rem); overflow: auto; overscroll-behavior: contain; border: 1px solid #E1E7ED; border-radius: 4px; padding: .4rem .55rem; background: #FCFDFE; }
/* A455 QA D2: tree controls are 44px tap targets on phone AND tablet widths (390/768 measured);
   desktop keeps the compact look. No horizontal overflow at 390 (verified in the browser pass). */
@media (max-width: 1024px), (pointer: coarse) {
  .dl-tree-toggle, .dt-toggle, .dt-more { min-height: 44px; padding: .55rem .6rem; }
  .dl-tree-toggle, .dt-more { padding-left: .7rem; padding-right: .7rem; }
  .dt-toggle { display: block; width: 100%; }
  .dt-node { column-gap: .45rem; }
  .dt-ico { align-self: center; }
}
@media (max-width: 480px) { .dt-node { grid-template-columns: 1rem minmax(0, 1fr); } .dt-size { grid-column: 2; } }
/* A452 day-first date controls */
.date-df-error { display: block; margin-top: 0.25rem; font-size: 0.75rem; color: #b42318; }
.date-df-invalid { border-color: #b42318 !important; outline: 2px solid rgba(180, 35, 24, 0.25); }

/* ---------- t_82dd0c11 teacher profile photo (round avatar, initials fallback) */
.tavatar { flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%; overflow: hidden;
  background: var(--ds-o100); color: var(--ds-ink); border: 1px solid var(--ds-line);
  font-size: 14px; font-weight: 700; letter-spacing: .01em; line-height: 1;
  object-fit: cover; vertical-align: middle; }
.tavatar-sm { width: 32px; height: 32px; font-size: 12px; }
.tavatar-lg { width: 88px; height: 88px; font-size: 28px; border-width: 2px; }
.tavatar-img { display: block; padding: 0; }
/* the teacher page header: avatar beside the h1, wrapping under it on a phone */
.tavatar-head { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.tavatar-head h1 { margin: 0; }
/* the class Giảng viên tab: label on its own line, then avatar + picker in one row, so both
   columns share the same label baseline and the avatar is centred with the 44px field. */
.teacher-pick { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.teacher-pick-label { display: block; font-weight: 600; }
.teacher-pick-row { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.teacher-pick-row > .teacher-pick-slot { flex: none; display: inline-flex; }
.teacher-pick-row > .picker, .teacher-pick-row > select { flex: 1 1 auto; min-width: 0; }
/* Tổng quan lists: avatar + name on one line */
.teacher-li { display: flex; align-items: center; gap: .5rem; }

/* ---------- t_9a710cc1 recording-summary drawer: one field per mode, one slot per session */
/* `.el-form label` sets display:flex, which out-specifies the `[hidden]` rule in app.css, so a
   drawer field marked hidden still rendered. Applies to the drawer only. */
.rec-summary-edit [hidden] { display: none !important; }
/* The slot grid stays readable at 390 px: the label column is narrow, the url input takes the rest
   and may shrink, and no row may push the panel wider than the viewport. */
.rec-summary-edit .rec-rows { min-width: 0; }
.rec-summary-edit .rec-row { min-width: 0; max-width: 100%; }
.rec-summary-edit .rec-row > .input { flex: 1 1 8rem; min-width: 0; }
