/* Giao diện Công việc và KPI - theo bản mẫu đã thống nhất:
   thanh danh mục 3 tầng (Của tôi, Đơn vị, Toàn trường), màu mặc định xanh lá (tùy chọn xanh dương đậm), điểm nhấn vàng,
   màu phẳng đồng nhất, chữ đậm dễ đọc; điện thoại dùng thanh tab dưới đáy; có chế độ tối. */
:root {
  --bg: #eef4f1; --card: #fff; --surface-2: #eef4f1; --ink: #0f1c17; --muted: #586a62; --line: #d4e0da;
  --brand: #0c3b2e; --brand-ink: #fff; --brand-soft: #e9f5ee; --brand-mid: #2b8565;
  --gold: #f4b400; --gold-ink: #3a2a00; --gold-soft: #fff3cc;
  --ok: #15692b; --ok-bg: #e2f4e4; --warn: #7a4f00; --warn-bg: #fdf1d4; --bad: #a52424; --bad-bg: #fbe2e2; --info: #1c5cab; --info-bg: #e3eefb; --gray-bg: #e9eeeb;
  --s-crit: #d03b3b; --s-warn: #fab219; --s-ok: #0ca30c; --s-info: #2a78d6;
  --h1: #e9f5ee; --h2: #b9dccb; --h3: #74b597; --h4: #2b8565; --h5: #0c3b2e;
  --radius: 10px; --side-w: 276px;
  --f-body: "Be Vietnam Pro", system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  --f-disp: "Lexend", "Be Vietnam Pro", system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}
:root[data-skin="xanh_duong"] { --bg: #edf2f9; --surface-2: #eef3f9; --line: #d4deeb; --ink: #0f1a2b; --muted: #56647b; --brand: #0b2a5b; --brand-soft: #e3e9f3; --brand-mid: #2a5398; --info: #0b6266; --info-bg: #ddf2f2; --h1: #e3e9f3; --h2: #b3c4e0; --h3: #6a8cc4; --h4: #2a5398; --h5: #0b2a5b; }
:root[data-mode="toi"] {
  --bg: #0e1412; --card: #151d1a; --surface-2: #1c2622; --ink: #e9f0ec; --muted: #a3b3ab; --line: #2a3631;
  --brand: #0a2e24; --brand-soft: #163328; --brand-mid: #4cbf8f; --gold-soft: #3a2f0c; --gold-ink: #3a2a00;
  --ok: #6fd17a; --ok-bg: #15301b; --warn: #f5c04f; --warn-bg: #352a10; --bad: #f08585; --bad-bg: #3a1c1c; --info: #86b6ef; --info-bg: #16263b; --gray-bg: #222b28;
  --h1: #1a2a20; --h2: #1c4a2c; --h3: #22743f; --h4: #38a861; --h5: #7ddc9c; color-scheme: dark;
}
:root[data-mode="toi"][data-skin="xanh_duong"] { --bg: #0d121a; --card: #141b26; --surface-2: #1b2431; --line: #283445; --brand: #0a2147; --brand-soft: #16263b; --brand-mid: #5c9bf0; --h1: #172334; --h2: #1c3a63; --h3: #245fb0; --h4: #4f8fe6; --h5: #a3c8f7; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 500 15px/1.55 var(--f-body); color: var(--ink); background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.25; font-family: var(--f-disp); font-weight: 700; color: var(--brand-ink-text, inherit); }
h2 { font-size: 1.12rem; } h3 { font-size: 1rem; }
a { color: var(--info); }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Khung: thanh bên + nội dung ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.side { background: var(--brand); color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow: hidden; border-right: 1px solid rgba(0,0,0,.1); }
.brandbar { display: flex; gap: 10px; align-items: center; padding: 18px 14px 14px; }
.logo { width: 42px; height: 42px; border-radius: 12px; background: var(--gold); color: var(--gold-ink); display: grid; place-items: center; flex: none; font: 700 15px var(--f-disp); }
.brandbar b { display: block; font: 700 17px/1.15 var(--f-disp); white-space: nowrap; }
.brandbar small { display: block; color: var(--gold); font-size: 12.5px; font-weight: 700; line-height: 1.35; margin-top: 4px; }
.ws { margin: 0 12px 6px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.22); border-left: 4px solid var(--gold); border-radius: var(--radius); background: rgba(255,255,255,.1); color: #fff; }
.ws b { display: block; font: 700 13px/1.35 var(--f-disp); text-transform: uppercase; }
.ws small { display: block; color: var(--gold); font-size: 13px; font-weight: 700; margin-top: 3px; }
.roleswitch { margin-top: 8px; width: 100%; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.55); border-radius: 6px; padding: 5px 8px; font-weight: 700; font-size: 13px; cursor: pointer; text-align: center; }
.roleswitch:hover, .roleswitch:focus-visible { background: rgba(255,255,255,.14); outline: none; }
.who.clickable { cursor: pointer; border-radius: 8px; padding: 2px 6px; }
.who.clickable:hover, .who.clickable:focus-visible { background: rgba(255,255,255,.12); outline: none; }
.rolelist { display: grid; gap: 10px; }
.roleopt { display: block; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; }
.roleopt:hover:not([disabled]), .roleopt:focus-visible { border-color: var(--brand-mid); background: var(--brand-soft); outline: none; }
.roleopt b { display: block; font: 700 15px/1.3 var(--f-disp); }
.roleopt span { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.roleopt em { display: inline-block; margin-top: 6px; font-style: normal; font-size: 12px; font-weight: 700; color: var(--gold-ink); background: var(--gold-soft); border-radius: 999px; padding: 1px 8px; }
.roleopt.on { border-left-color: var(--gold); cursor: default; }
.ws select { margin-top: 6px; width: 100%; background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 6px; padding: 4px 6px; min-height: 0; }
.ws select option { color: #13201a; background: #fff; }
.snav { overflow: auto; padding: 4px 8px 12px; flex: 1; }
.sgroup { margin-top: 12px; display: flex; flex-direction: column; gap: 1px; }
.sgroup > p { display: flex; align-items: center; gap: 8px; font: 700 12.5px/1 var(--f-disp); letter-spacing: .06em; text-transform: uppercase; color: var(--gold); padding: 0 10px 5px; margin: 0; }
.sgroup > p::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.16); }
.snav a { display: flex; align-items: center; gap: 9px; padding: 6px 10px; border-radius: 7px; color: rgba(255,255,255,.92); text-decoration: none; font-weight: 600; font-size: 13.5px; }
.snav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.snav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
:root[data-mode="toi"] .snav a.active { color: #fff; }
.snav a .ic { width: 18px; text-align: center; flex: none; opacity: .9; }
.snav a .dot { margin-left: auto; font-size: 11.5px; font-weight: 700; background: var(--s-crit); color: #fff; border-radius: 99px; padding: 0 7px; line-height: 19px; }
.sidefoot { border-top: 1px solid rgba(255,255,255,.12); padding: 10px 14px; font-size: 12px; color: rgba(255,255,255,.72); }

.mainwrap { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 9px 22px; background: var(--brand); color: #fff; border-bottom: 3px solid #fff; position: sticky; top: 0; z-index: 20; flex-wrap: wrap; }
.topbar .title { font: 700 15px var(--f-disp); flex: 1 1 10rem; }
.monthbar { display: flex; align-items: center; gap: .25rem; border: 1px solid rgba(255,255,255,.32); border-radius: 8px; padding: 2px; }
.monthbar button { background: transparent; border: 0; color: #fff; font-size: 1rem; padding: .3rem .65rem; cursor: pointer; border-radius: 6px; }
.monthbar button:hover { background: rgba(255,255,255,.15); }
.monthbar .label { min-width: 7.2rem; text-align: center; font-weight: 700; }
.bell { position: relative; border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.12); color: #fff; width: 38px; height: 36px; border-radius: 8px; cursor: pointer; font-size: 16px; }
.bell .dot { position: absolute; top: -6px; right: -6px; background: var(--s-crit); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; min-width: 19px; height: 19px; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--brand); }
.who { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.who .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--gold); color: var(--gold-ink); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.who b { display: block; line-height: 1.2; } .who small { display: block; color: rgba(255,255,255,.8); line-height: 1.2; }
main { width: 100%; max-width: 1240px; margin: 0 auto; padding: 22px; }
main.wide { max-width: 1680px; }
.pagehead { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pagehead h1 { display: flex; align-items: center; gap: 10px; color: var(--brand); text-transform: uppercase; font-size: 21px; margin: 0; flex: 1 1 16rem; }
:root[data-mode="toi"] .pagehead h1 { color: var(--brand-mid); }
.pagehead h1::before { content: ""; width: 6px; height: 24px; border-radius: 3px; background: var(--brand); flex: none; }
:root[data-mode="toi"] .pagehead h1::before { background: var(--brand-mid); }
.pagehead .sub { width: 100%; color: var(--muted); margin: -4px 0 0 16px; }
.tabbar { display: none; }
.menubtn { display: none; }

/* ---------- Thành phần ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; margin-bottom: .8rem; }
.card > .ch { display: flex; align-items: center; gap: 10px; margin: -1rem -1rem .8rem; padding: 11px 16px; background: var(--brand-soft); border-bottom: 2px solid var(--brand-soft); border-radius: 12px 12px 0 0; }
.card > .ch h2 { margin: 0; flex: 1; color: var(--brand); font-size: 15.5px; }
:root[data-mode="toi"] .card > .ch h2 { color: var(--ink); }
.card.pending { border-left: 4px solid var(--s-warn); }
.card.returned { border-left: 4px solid var(--s-crit); }
.muted { color: var(--muted); } .small { font-size: .88rem; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; }
.stack > * + * { margin-top: .6rem; }
.section-title { font: 700 .9rem var(--f-disp); text-transform: uppercase; letter-spacing: .03em; color: var(--brand); margin: 1.2rem 0 .5rem; }
:root[data-mode="toi"] .section-title { color: var(--brand-mid); }
.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; padding: .5rem 1rem; border-radius: 8px; border: 1px solid var(--brand); background: var(--brand); color: #fff; cursor: pointer; font-weight: 700; min-height: 2.4rem; text-decoration: none; }
:root[data-mode="toi"] .btn { background: var(--brand-mid); border-color: var(--brand-mid); color: #06261b; }
.btn:hover { filter: brightness(1.15); }
.btn.secondary { background: var(--card); color: var(--brand); border-color: var(--line); }
:root[data-mode="toi"] .btn.secondary { color: var(--ink); }
.btn.secondary:hover { background: var(--brand-soft); filter: none; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn.danger { background: var(--card); color: var(--bad); border-color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); filter: none; }
.btn.small { padding: .25rem .7rem; min-height: 2rem; font-size: .86rem; }
.btn[disabled] { opacity: .55; cursor: default; }
.iconbtn { border: 1px solid var(--line); background: var(--card); border-radius: 6px; cursor: pointer; padding: .1rem .5rem; min-height: 1.8rem; color: var(--ink); }
label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: .2rem; }
input[type=text], input[type=password], input[type=date], input[type=number], input[type=file], select, textarea { width: 100%; padding: .5rem .65rem; border: 1px solid var(--line); border-radius: 8px; background: var(--card); min-height: 2.45rem; }
textarea { min-height: 5rem; resize: vertical; }
.field { margin-bottom: .8rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; }
.hint { color: var(--muted); font-size: .85rem; margin-top: .15rem; font-weight: 500; }
.mc-row { display: grid; grid-template-columns: 9rem 1fr 9.5rem 2.2rem; gap: .4rem; margin-bottom: .4rem; align-items: center; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.check input { width: 1.15rem; height: 1.15rem; }
details.more { border: 1px dashed var(--line); border-radius: 8px; padding: .5rem .8rem; margin-bottom: .8rem; }
details.more > summary { cursor: pointer; font-weight: 700; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--surface-2); }
.seg button { border: 0; background: none; color: var(--muted); padding: .35rem .9rem; cursor: pointer; font-weight: 700; border-radius: 6px; }
.seg button.on { background: var(--brand); color: #fff; }
.badge { display: inline-block; padding: .08rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.b-chua { background: var(--gray-bg); color: var(--muted); } .b-dang { background: var(--info-bg); color: var(--info); }
.b-xong { background: var(--ok-bg); color: var(--ok); } .b-vuong { background: var(--warn-bg); color: var(--warn); }
.b-bad { background: var(--bad-bg); color: var(--bad); } .b-wait { background: var(--warn-bg); color: var(--warn); }
.b-gold { background: var(--gold-soft); color: var(--gold-ink); }
:root[data-mode="toi"] .b-gold { color: var(--gold); }
.chip { display: inline-block; background: var(--gray-bg); border-radius: 6px; padding: .05rem .5rem; font-size: .82rem; margin: 0 .25rem .25rem 0; font-weight: 600; }
.task-title { font-weight: 700; }
.task-meta { margin-top: .3rem; }
.lastupd { margin-top: .5rem; padding: .5rem .7rem; background: var(--surface-2); border-radius: 8px; font-size: .9rem; }
.note-bad { background: var(--bad-bg); color: var(--bad); padding: .5rem .7rem; border-radius: 8px; margin-top: .5rem; font-size: .92rem; }
.over { color: var(--bad); font-weight: 700; }
.gd { background: var(--gold-soft); color: var(--gold-ink); border: 1px solid var(--gold); border-radius: 8px; padding: .45rem .8rem; font-weight: 700; font-size: .88rem; margin-bottom: .8rem; }
:root[data-mode="toi"] .gd { color: var(--gold); }

/* Ô số liệu */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius); padding: .65rem .9rem; text-decoration: none; color: inherit; display: block; }
.stat .n { font: 700 1.7rem/1.1 var(--f-disp); font-variant-numeric: tabular-nums; }
.stat.bad { border-left-color: var(--s-crit); } .stat.ok { border-left-color: var(--s-ok); } .stat.warn { border-left-color: var(--s-warn); } .stat.info { border-left-color: var(--s-info); }
.stat.bad .n { color: var(--bad); } .stat.ok .n { color: var(--ok); }
.tablewrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table.t { border-collapse: collapse; width: 100%; font-size: .92rem; }
table.t th, table.t td { padding: .5rem .7rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.t th { background: var(--brand); color: #fff; font-size: .84rem; white-space: nowrap; font-weight: 700; }
table.t td.num, table.t th.num { text-align: center; font-variant-numeric: tabular-nums; }
table.t tr.child td:first-child { padding-left: 2rem; }
.bar { height: .5rem; background: var(--gray-bg); border-radius: 999px; overflow: hidden; min-width: 5rem; }
.bar > i { display: block; height: 100%; background: var(--brand-mid); }
.bar.bad > i { background: var(--s-crit); }

/* Dải mốc tháng */
.track { display: grid; grid-template-columns: repeat(5, 1fr); position: relative; padding: 4px 0; }
.track::before { content: ""; position: absolute; left: 10px; right: 10px; top: 13px; height: 2px; background: var(--line); }
.ms { position: relative; padding-right: 8px; }
.ms .pt { width: 20px; height: 20px; border-radius: 50%; background: var(--card); border: 2px solid var(--line); position: relative; }
.ms.done .pt { background: var(--brand-mid); border-color: var(--brand-mid); }
.ms.now .pt { border-color: var(--brand-mid); border-width: 3px; }
.ms b { display: block; font: 700 13.5px var(--f-disp); margin-top: 6px; }
.ms span { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.hero { background: var(--brand); color: #fff; border-radius: 16px; padding: 22px 22px 60px; margin-bottom: -48px; }
.hero h1 { color: #fff; text-transform: uppercase; font-size: 24px; margin: 0; }
.hero h1::after { content: ""; display: block; width: 48px; height: 4px; border-radius: 2px; background: #fff; margin-top: 8px; }
.hero .eyebrow { color: var(--gold); font-weight: 700; font-size: 13px; }
.hero p { margin: 8px 0 0; }
.hero + .card { margin: 0 14px 14px; position: relative; }

/* Bảng ô màu tổng quan */
table.hm { border-collapse: separate; border-spacing: 3px; width: 100%; }
table.hm th { font-size: 12px; color: var(--muted); text-align: center; padding: 3px 6px; white-space: nowrap; }
table.hm th.u { text-align: left; }
table.hm td.u { font-weight: 700; padding-right: 10px; }
table.hm td.u small { display: block; font-weight: 500; color: var(--muted); }
table.hm td.c { border-radius: 6px; text-align: center; height: 44px; min-width: 70px; font-weight: 700; position: relative; cursor: pointer; font-variant-numeric: tabular-nums; }
table.hm td.c.na { background: var(--surface-2); color: var(--muted); font-weight: 500; cursor: default; }
table.hm td.c .od { position: absolute; top: 2px; right: 3px; background: var(--s-crit); color: #fff; font-size: 10px; border-radius: 99px; padding: 0 5px; line-height: 15px; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 22px; height: 11px; border-radius: 3px; vertical-align: middle; }

/* Cây kế hoạch */
.tree { list-style: none; margin: 0; padding-left: 0; }
.tree .tree { padding-left: 1.4rem; border-left: 2px solid var(--line); margin-left: .5rem; }
.tree li { margin: .35rem 0; }
.node { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .7rem; }

/* Báo cáo */
table.rep { border-collapse: collapse; width: 100%; min-width: 760px; font-size: .9rem; background: var(--card); }
table.rep th, table.rep td { border: 1px solid var(--line); padding: .4rem .5rem; vertical-align: middle; }
table.rep th { background: var(--brand); color: #fff; text-align: center; }
table.rep td.c { text-align: center; }
td.cell { cursor: pointer; white-space: pre-wrap; }
td.cell:hover { background: var(--gold-soft); }
td.cell.edited { box-shadow: inset 3px 0 0 var(--gold); }
.warnbox { background: var(--warn-bg); border: 1px solid var(--s-warn); border-radius: var(--radius); padding: .7rem 1rem; margin-bottom: 1rem; }
.warnbox ul { margin: .3rem 0 0 1.1rem; padding: 0; }
.mv { display: flex; flex-direction: column; gap: .15rem; align-items: center; }
.rep .groupcell { background: var(--brand-soft); font-weight: 700; text-align: left; }
.statline { display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: center; margin: .4rem 0 .8rem; }

/* Trình chiếu giao ban: nền xanh đậm, chữ trắng đậm, đọc được từ cuối phòng */
.stage { position: fixed; inset: 0; background: #0b2a5b; color: #fff; z-index: 90; overflow: auto; padding: 28px 40px; }
.stage h1 { font-size: 38px; color: #fff; margin: 0 0 6px; }
.stage .sub2 { font-size: 22px; font-weight: 700; opacity: .92; margin-bottom: 18px; }
.stage table { width: 100%; border-collapse: collapse; font-size: 24px; font-weight: 700; }
.stage th { font-size: 19px; text-align: left; padding: 10px 12px; border-bottom: 3px solid rgba(255,255,255,.5); }
.stage td { padding: 12px; border-bottom: 1px solid rgba(255,255,255,.25); }
.stage td.r, .stage th.r { text-align: right; }
.stage .late { background: #d03b3b; border-radius: 8px; padding: 2px 12px; }
.stage .bt { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.stage button { background: #123a78; color: #fff; border: 2px solid rgba(255,255,255,.5); border-radius: 10px; padding: 10px 18px; font: 700 18px var(--f-body); cursor: pointer; }

/* Hộp thoại, thông báo */
#modal-root .overlay { position: fixed; inset: 0; background: rgba(10,20,16,.5); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 1rem; overflow-y: auto; }
.modal { background: var(--card); border-radius: 12px; width: 100%; max-width: 640px; margin: 2vh auto; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.modal.wide { max-width: 920px; }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--brand-soft); border-radius: 12px 12px 0 0; z-index: 1; }
.modal header h2 { margin: 0; font-size: 1.05rem; color: var(--brand); }
:root[data-mode="toi"] .modal header h2 { color: var(--ink); }
.modal .body { padding: 1rem; }
.modal footer { padding: .8rem 1rem; border-top: 1px solid var(--line); display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; position: sticky; bottom: 0; background: var(--card); border-radius: 0 0 12px 12px; }
#toast-root { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); z-index: 95; display: flex; flex-direction: column; gap: .4rem; align-items: center; max-width: 92vw; }
.toast { background: #13201a; color: #fff; padding: .6rem 1rem; border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.3); font-weight: 600; }
.toast.err { background: var(--s-crit); }
.notelist { list-style: none; margin: 0; padding: 0; }
.notelist li { display: grid; grid-template-columns: 4px 1fr; gap: 10px; padding: .5rem 0; border-top: 1px solid var(--line); cursor: pointer; }
.notelist li:first-child { border-top: 0; }
.notelist li .sv { border-radius: 3px; background: var(--s-info); }
.notelist li.qua_han .sv { background: var(--s-crit); } .notelist li.sap_den_han .sv { background: var(--s-warn); } .notelist li.can_xu_ly .sv { background: var(--brand-mid); }
.login { max-width: 24rem; margin: 10vh auto 0; padding: 0 1rem; }
.login .card { padding: 1.4rem; border-top: 6px solid var(--brand); }
.login h1 { font-size: 1.3rem; color: var(--brand); text-transform: uppercase; }
.err { color: var(--bad); margin: .4rem 0; font-size: .93rem; }
.pw-box { font: 700 1.05rem ui-monospace, Menlo, Consolas, monospace; background: var(--brand-soft); padding: .25rem .6rem; border-radius: 6px; user-select: all; }

/* Sản phẩm công việc */
.prod { margin: .35rem 0; display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: baseline; }
.prodlink { display: inline-block; background: var(--brand-soft); color: var(--brand); border-radius: 6px; padding: .1rem .55rem; text-decoration: none; font-size: .9rem; word-break: break-word; font-weight: 600; }
:root[data-mode="toi"] .prodlink { color: var(--ink); }
.prodlink:hover { text-decoration: underline; }
.filebox { border: 1px dashed var(--line); border-radius: 8px; padding: .6rem; margin-bottom: .5rem; }
.filerow { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .2rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; word-break: break-word; }
.filerow:last-child { border-bottom: 0; }
.lk-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: .4rem; margin-bottom: .4rem; }
table.tt td, table.tt th { font-size: .9rem; }
table.tt .tt-nd { min-width: 16rem; max-width: 26rem; }
table.tt tr.r-wait td { background: var(--gold-soft); }
table.tt tr.r-bad td { background: var(--bad-bg); }
table.tt .groupcell { background: var(--brand-soft); font-weight: 700; }
.linkbtn { border: 0; background: none; padding: 0; font: inherit; color: var(--info); text-align: left; cursor: pointer; text-decoration: underline; font-weight: 600; }
.linkbtn.small { font-size: .82rem; color: var(--muted); }
.prodbox { border: 2px solid var(--brand-mid); background: var(--brand-soft); border-radius: 8px; padding: .6rem .8rem; margin: .6rem 0; }
.prodbox .prodhead { font-weight: 700; margin-bottom: .35rem; }
.prodbox.warn { border-color: var(--s-warn); background: var(--warn-bg); color: var(--warn); }
.prodbox.none { border: 1px dashed var(--line); background: var(--surface-2); }
.filterrow select { width: auto; flex: 1 1 12rem; min-width: 10rem; }
.kpi-tbl input { width: 5.2rem; text-align: right; }
.big { font: 700 2.4rem/1 var(--f-disp); font-variant-numeric: tabular-nums; }

/* Điện thoại: ẩn thanh bên, thanh tab dưới đáy */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; position: fixed; inset: 0 auto 0 0; width: min(86vw, 300px); z-index: 70; height: 100%; }
  body.menu-open .side { display: flex; }
  body.menu-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 60; }
  main { padding: 14px 14px 86px; }
  .topbar { padding: 8px 12px; }
  .topbar .title, .who div { display: none; }
  .menubtn { display: block; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .track { grid-template-columns: 1fr; gap: 10px; }
  .track::before { display: none; }
  .ms { display: grid; grid-template-columns: 20px 1fr; column-gap: 12px; align-items: start; }
  .ms b { margin-top: 0; } .ms span { grid-column: 2; }
  .seg { display: flex; max-width: 100%; overflow-x: auto; }
  .seg button { white-space: nowrap; flex: none; }
  body.mode-quan-tri .topbar .title { display: block; font-size: 14px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; background: var(--brand); z-index: 40; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 11px; font-weight: 700; color: rgba(255,255,255,.75); text-decoration: none; padding: 6px 0; background: none; border: 0; cursor: pointer; }
  .tabbar .ic { font-size: 18px; }
  .tabbar .active { color: var(--gold); }
  .mc-row { grid-template-columns: 1fr 1fr; }
  .btn { min-height: 2.7rem; }
  .modal { margin: 0; }
  #modal-root .overlay { padding: .4rem; }
  .stage { padding: 16px; } .stage h1 { font-size: 26px; } .stage table { font-size: 17px; }
}
@media print { .side, .topbar, .tabbar, .btn { display: none !important; } .shell { display: block; } }

/* Tiêu đề các màn hình kế thừa: in hoa, đậm như màn hình mới */
main > h2, main > .row.between:first-child > h2, main > .row.between > h2:first-child { text-transform: uppercase; color: var(--brand); font-size: 20px; margin: 0; }
:root[data-mode="toi"] main > h2, :root[data-mode="toi"] main > .row.between > h2 { color: var(--brand-mid); }
