:root {
  --bg: #f3faf1; --surface: #fff; --text: #17261b; --muted: #587060; --line: #d5e8d0;
  /* Tông màu cam tươi – xanh lá tươi mát, sáng rõ (hợp logo PPT) */
  --primary: #e0530a; --primary-ink: #fff; --primary-soft: #ffeadb; --gold: #d9f99d; --gold-soft: #ecfccb; --accent: #16a34a;
  --ok: #15803d; --ok-soft: #dcfce7; --warn: #b45309; --warn-soft: #fff3da; --bad: #dc2626; --bad-soft: #fee2e2;
  --side: #166534; --side-text: #e8fbe9; --radius: 10px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1a11; --surface: #16251a; --text: #eef8ee; --muted: #a6bfaa; --line: #2a4130;
    --primary: #ff8a3d; --primary-ink: #2a1000; --primary-soft: #4a2a14; --gold: #bef264; --gold-soft: #2c3a12; --accent: #4ade80;
    --ok: #4ade80; --ok-soft: #14391f; --warn: #fbbf24; --warn-soft: #3b2f10; --bad: #ff7b6e; --bad-soft: #3d1c19;
    --side: #0f2e19;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14.5px/1.5 system-ui, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; margin: 0; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
h3 { margin: 0; font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, Consolas, monospace; }
[hidden] { display: none !important; }

/* ----- Khung ứng dụng ----- */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-text); padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { font-weight: 700; color: #fff; font-size: 1.15rem; padding: 2px 4px 14px; }
.brand .logo-plate { background: #fff; border-radius: 12px; padding: 10px 12px 8px; margin-bottom: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.brand .logo-plate img { display: block; width: 100%; height: auto; }
.brand .name { padding: 0 6px; }
.brand small { display: block; font-weight: 400; color: var(--gold); font-size: .78rem; }
.nav-group { margin: 14px 10px 4px; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); opacity: .85; }
.nav a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--side-text); }
.nav a:hover { background: rgba(255,255,255,.12); text-decoration: none; }
.nav a.active { background: rgba(255,255,255,.2); color: #fff; font-weight: 600; box-shadow: inset 4px 0 0 #fb923c; }
.nav a.soon { opacity: .45; pointer-events: none; }
.nav a .tag { margin-left: auto; font-size: .68rem; border: 1px solid currentColor; border-radius: 99px; padding: 0 6px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top .spacer { flex: 1; }
.menu-btn { display: none; }
.content { padding: 24px; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .spacer { flex: 1; }

/* ----- Thành phần ----- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.stat .n { font-size: 1.2rem; font-weight: 700; line-height: 1.3; }
.stat .l { color: var(--muted); font-size: .85rem; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.cols > .card + .card { margin-top: 0; }

.btn { font: inherit; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.sm { padding: 3px 9px; font-size: .84rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.icon-btn { background: none; border: 0; font-size: 1.3rem; cursor: pointer; color: var(--muted); padding: 0 6px; }

.badge { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--primary-soft); color: var(--primary); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.gray { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.toolbar .spacer { flex: 1; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; width: 100%; }
.toolbar input, .toolbar select { width: auto; min-width: 150px; }
textarea { min-height: 80px; resize: vertical; }
label.field { display: block; }
label.field > span { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 3px; }
label.field .hint { font-weight: 400; color: var(--muted); font-size: .8rem; margin-top: 3px; display: block; }
label.check { display: flex; gap: 8px; align-items: center; }
label.check input { width: auto; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.grid .full { grid-column: 1 / -1; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--bg); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tr.off td { opacity: .55; }
td.actions { white-space: nowrap; text-align: right; }
td.actions .btn { margin-left: 4px; }
.empty { padding: 36px; text-align: center; color: var(--muted); }

.warn-list { list-style: none; margin: 0; padding: 0; }
.warn-list li { display: flex; gap: 10px; padding: 9px 12px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); margin-bottom: 8px; }
.warn-list li.click { cursor: pointer; }
.warn-list li.click:hover { filter: brightness(.96); }
.warn-list li a { margin-left: auto; white-space: nowrap; font-weight: 600; }
.ok-box { padding: 10px 14px; border-radius: 8px; background: var(--ok-soft); color: var(--ok); }
.bar-row { display: grid; grid-template-columns: 140px 1fr 36px; gap: 10px; align-items: center; margin: 7px 0; font-size: .9rem; }
.bar { height: 10px; border-radius: 99px; background: var(--primary-soft); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 7px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; font-size: .88rem; }
.timeline li:last-child { border: 0; }
.timeline time { color: var(--muted); white-space: nowrap; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 12px; }

/* ----- Hộp thoại ----- */
dialog.modal { border: 0; border-radius: 14px; padding: 0; width: min(560px, 94vw); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog.modal::backdrop { background: rgba(10,16,30,.55); }
dialog.modal header { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
dialog.modal header h3 { flex: 1; }
dialog.modal .body { padding: 18px; max-height: 70vh; overflow-y: auto; }
dialog.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.form-error { color: var(--bad); background: var(--bad-soft); padding: 8px 12px; border-radius: 8px; margin: 12px 0 0; }
.secret { display: flex; gap: 8px; align-items: center; background: var(--bg); border: 1px dashed var(--line); border-radius: 8px; padding: 10px 14px; font-size: 1.15rem; margin: 10px 0; }
.secret code { flex: 1; user-select: all; }

#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 100; }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); max-width: 360px; }
.toast.err { background: var(--bad); color: #fff; }

/* ----- Đăng nhập ----- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: linear-gradient(135deg, #15803d 0%, #4ade80 48%, #fb923c 100%); }
.login-card { width: min(400px, 100%); background: var(--surface); border-radius: 16px; padding: 30px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.login-card .login-logo { display: block; width: min(260px, 80%); height: auto; margin: 0 auto 10px; }
.login-card h1 { margin-bottom: 4px; text-align: center; font-size: 1.25rem; }
.login-card > .muted { text-align: center; }
.login-card form { display: grid; gap: 14px; margin-top: 20px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 20; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; }
  .menu-btn { display: inline-block; }
  .content { padding: 16px; }
  .top { padding: 10px 16px; }
  .grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 100px 1fr 30px; }
  /* Trên điện thoại nhân viên: ẩn phần tài khoản (chuyển tài khoản, mục Tài khoản trong menu); vẫn bấm tên ở thanh trên để vào.
     Admin/BGĐ (body.admin-lv) giữ đủ để quản trị và chuyển tài khoản. */
  body:not(.admin-lv) #switchBtn, body:not(.admin-lv) .acct-nav { display: none !important; }
  /* Thanh trên gọn lại và xuống dòng được khi có nhiều nút */
  .top { flex-wrap: wrap; gap: 8px; }
  .top .btn.sm { padding: 6px 10px; }
  .admin-lv .table-wrap { -webkit-overflow-scrolling: touch; }
}

/* ----- Chấm công ----- */
.att-today { display: grid; gap: 16px; }
.clock { font-size: 2.6rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.att-status { display: flex; gap: 32px; flex-wrap: wrap; }
.att-status .big { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.att-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.big-btn { font-size: 1.1rem; padding: 12px 28px; }
.cam-wrap { display: flex; justify-content: center; }
.cam-wrap video.rear { transform: none; }
.cam-pick { display: inline-flex; align-items: center; gap: 8px; }
.cam-wrap video { width: 100%; max-width: 420px; aspect-ratio: 4 / 3; background: #000; border-radius: 12px; transform: scaleX(-1); object-fit: cover; }
.cam-status { text-align: center; font-weight: 600; min-height: 1.5em; }

/* ----- Ca làm việc, quyền, lương ----- */
.day-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.day-chips label { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 99px; cursor: pointer; font-size: .85rem; }
.day-chips input { width: auto; margin: 0; }
.day-chips label:has(input:checked) { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.known-accounts { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.known-accounts .btn { text-align: left; }
.copy-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; margin: 8px 0; max-height: 300px; overflow: auto; }
.copy-list .check, [data-all] + b { cursor: pointer; }
.shift-block { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.shift-block.on { border-color: var(--primary); background: var(--primary-soft); }
.perm-group { margin-bottom: 18px; }
.perm-row { display: grid; grid-template-columns: 1fr 210px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.today-shifts { display: flex; flex-wrap: wrap; gap: 8px; }
.shift-chip { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; min-width: 150px; }
.shift-chip.done { border-color: var(--ok); background: var(--ok-soft); }
.shift-chip.open { border-color: var(--primary); background: var(--primary-soft); }
.shift-chip.missed { border-color: var(--bad); background: var(--bad-soft); }
.pay { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.bell { position: relative; }
.bell .dot { position: absolute; top: -4px; right: -4px; background: var(--bad); color: #fff; border-radius: 99px; font-size: .68rem; min-width: 17px; padding: 0 4px; text-align: center; }
.notice { background: var(--warn-soft); color: var(--warn); padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.notice a { font-weight: 600; }
.notif-item { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.notif-item.unread { font-weight: 600; }
@media (max-width: 860px) { .perm-row { grid-template-columns: 1fr; } .att-today .att-status { gap: 18px; } }
.stat .n.money { font-size: 1.2rem; white-space: nowrap; line-height: 1.3; }

/* ----- Kiểm tra thiết bị chấm công ----- */
.dev-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.dev-list li { display: flex; gap: 10px; align-items: flex-start; }
.dev-ic { flex: none; width: 1.4em; text-align: center; }

/* ---------- Roster ---------- */
.rs-shift input { width: auto; margin: 0; }
.rs-shift { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; margin: 2px 8px 2px 0; border: 1px solid var(--line); border-radius: 99px; cursor: pointer; background: var(--surface); }
.rs-shift.off { border-color: var(--warn); background: var(--warn-soft); text-decoration: line-through; text-decoration-color: var(--warn); }
.rs-shift.locked { cursor: default; opacity: .75; }
.rs-week tr.rs-past td { background: var(--bg); }
.rs-week tr.rs-today td { box-shadow: inset 3px 0 0 var(--primary); }
.rs-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: .85rem; color: var(--muted); }
.rs-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rs-grid { border-collapse: separate; border-spacing: 0; }
.rs-grid th, .rs-grid td { padding: 4px 2px; text-align: center; border-bottom: 1px solid var(--line); min-width: 30px; }
.rs-grid .rs-name { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; padding: 6px 12px; min-width: 150px; white-space: nowrap; }
.rs-grid th.rs-name { background: var(--bg); }
.rs-grid th.rs-d { font-size: .7rem; line-height: 1.2; }
.rs-grid th.sun { color: var(--bad); }
.rs-grid th.today { background: var(--primary-soft); color: var(--primary); }
.rs-grid td.rs-none { background: repeating-linear-gradient(135deg, transparent 0 5px, var(--line) 5px 6px); opacity: .5; }
.rs-cell { display: inline-block; min-width: 24px; padding: 2px 3px; border-radius: 6px; font-size: .78rem; font-weight: 700; font-style: normal; text-decoration: none; line-height: 1.3; }
.rs-cell.ok { background: var(--ok-soft); color: var(--ok); }
.rs-cell.def { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.rs-cell.off { background: var(--warn-soft); color: var(--warn); }
.rs-cell.half { background: var(--warn-soft); color: var(--warn); border: 1px dashed var(--warn); }
.rs-cell.pend { background: var(--primary-soft); color: var(--primary); border: 1px dashed var(--primary); }
.rs-cell.sudden { background: var(--bad-soft); color: var(--bad); }
a.rs-cell:hover { outline: 2px solid var(--primary); }
.shift-chip.rest { border-color: var(--warn); background: var(--warn-soft); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
@media (max-width: 860px) {
  /* Roster tuần trên điện thoại: mỗi ngày là một khối, không phải kéo ngang */
  .rs-week thead { display: none; }
  .rs-week tr { display: block; padding: 8px 4px; border-bottom: 1px solid var(--line); }
  .rs-week td { display: block; border: 0; padding: 4px 10px; }
}

/* Roster tháng theo ký hiệu ca: mỗi ca một chip (N, S, C…) */
.rs-cell { display: inline-flex; gap: 2px; padding: 1px; min-width: 0; background: none; border: 0; }
.rs-grid th, .rs-grid td { min-width: 34px; }
.rs-c { display: inline-block; min-width: 20px; padding: 2px 5px; border-radius: 6px; font-size: .75rem; font-weight: 700; font-style: normal; line-height: 1.3; text-align: center; }
.rs-c.ok { background: var(--ok-soft); color: var(--ok); }
.rs-c.def { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.rs-c.off { background: var(--warn-soft); color: var(--warn); text-decoration: line-through; }
.rs-c.pend { background: var(--primary-soft); color: var(--primary); border: 1px dashed var(--primary); }
.rs-c.sudden { background: var(--bad-soft); color: var(--bad); }

/* ---------- Dashboard & trang gộp có thẻ (chữ to, dễ nhìn cho người ít dùng máy tính) ---------- */
.dash-h { margin: 24px 0 10px; font-size: 1.2rem; }
.dash-stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat.ok .n { color: var(--ok); } .stat.warn .n { color: var(--warn); } .stat.bad .n { color: var(--bad); }
.dash-cols { margin-top: 16px; }
.hint-list { list-style: none; margin: 0; padding: 0; }
.hint-list li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-radius: 8px; background: var(--ok-soft); margin-bottom: 8px; }
.hint-list li .ic { font-size: 1.1rem; }
.hint-list li a { margin-left: auto; white-space: nowrap; font-weight: 600; }
.hint-list li.click, .warn-list li.click { cursor: pointer; }
.shortcuts { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.shortcut { display: flex; flex-direction: column; gap: 2px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); color: var(--text); text-decoration: none; }
.shortcut:hover { border-color: var(--primary); text-decoration: none; }
.shortcut .ic { font-size: 1.8rem; }
.shortcut b { font-size: 1.05rem; }
.shortcut small { color: var(--muted); }
details.more { margin-top: 20px; }
details.more > summary { cursor: pointer; font-weight: 600; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tab { font: inherit; font-size: 1rem; font-weight: 600; padding: 10px 18px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.tab:hover { border-color: var(--primary); }
.tab.active { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.tab-body > .page-head h1 { font-size: 1.15rem; }
details.nav-soon > summary { cursor: pointer; list-style: none; }
details.nav-soon > summary::before { content: '▸ '; }
details.nav-soon[open] > summary::before { content: '▾ '; }

/* Đang mở bảng sửa người dùng: ẩn nội dung trang phía sau, chỉ còn bảng sửa */
#view.editing { visibility: hidden; }
/* Chấm công & lương nhân viên (dashboard trực quan) */
.sb-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.sb-chip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 10px; background: var(--surface); }
.sb-chip > div { flex: 1; min-width: 0; }
.sb-chip.ok { border-left-color: var(--ok); } .sb-chip.warn { border-left-color: var(--warn); } .sb-chip.bad { border-left-color: var(--bad); }
.sb-chip .av { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; }
.sb-row { display: grid; grid-template-columns: minmax(90px, 150px) 1fr 76px auto; gap: 10px; align-items: center; margin: 9px 0; }
.sb-row .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-row b { text-align: right; white-space: nowrap; }
.prog { height: 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--accent); border-radius: 8px; }
.prog.warn i { background: var(--warn); }
/* Dashboard km xe */
.km-today { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.km-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.km-bars { display: flex; align-items: flex-end; gap: 3px; height: 110px; padding: 6px 4px 0; border-bottom: 2px solid var(--line); }
.km-bars i { flex: 1; min-width: 4px; background: var(--accent); border-radius: 3px 3px 0 0; cursor: default; }
.km-bars i.open { background: repeating-linear-gradient(45deg, var(--warn), var(--warn) 3px, var(--warn-soft) 3px, var(--warn-soft) 6px); }
.km-bars i.void { background: var(--bad); opacity: .6; }
.km-bars i.today { outline: 2px solid var(--primary); }
.km-axis { display: flex; justify-content: space-between; margin-top: 4px; }
/* Kết xuất công */
.exp-table th.num, .exp-table td.num { text-align: right; white-space: nowrap; }
.exp-table .exp-sub td { font-weight: 700; background: var(--bg); }
.exp-table .exp-total td { font-weight: 800; background: var(--primary-soft); }
@media print {
  .side, .top, .no-print, #banner, .page-head, #toasts { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; }
  .card, .table-wrap { box-shadow: none; border: 0; }
  .exp-table { font-size: 11px; }
}
/* Danh sách nhân viên nhỏ gọn khi xếp roster */
.rs-who-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.rs-who { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: .9rem; cursor: pointer; }
.rs-who:hover { border-color: var(--primary); }
.rs-who.active { border-color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.rs-who .av { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .8rem; font-weight: 700; }
.rs-who.active .av { background: var(--primary); }
.rs-who .mk { font-size: .8rem; }
.rs-who .mk.ok { color: var(--ok); } .rs-who .mk.warn { color: var(--warn); } .rs-who .mk.bad { color: var(--bad); } .rs-who .mk.none { color: var(--muted); }
.rs-who-key { margin-left: 4px; }
.bell-tools { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.warn-list li .dismiss { margin-left: 8px; white-space: nowrap; flex: none; }
.warn-list li > span { flex: 1; }
.task.overdue { border-left: 3px solid var(--bad); }
/* Mục lớn trong menu: gom các nhóm nhỏ theo chức năng */
details.nav-sec { margin-top: 10px; }
details.nav-sec > summary { cursor: pointer; list-style: none; padding: 8px 10px; border-radius: 8px; font-weight: 700; font-size: .92rem; color: #fff; background: rgba(255,255,255,.08); display: flex; align-items: center; }
details.nav-sec > summary::-webkit-details-marker { display: none; }
details.nav-sec > summary::after { content: '▾'; margin-left: auto; opacity: .7; }
details.nav-sec:not([open]) > summary::after { content: '▸'; }
details.nav-sec > a { margin-left: 8px; }
.nav-sub { margin: 10px 10px 2px 18px; font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); opacity: .8; }

/* Giao việc */
.tk { cursor: pointer; margin-bottom: 10px; }
.tk:hover { border-color: var(--primary); }
.tk.overdue { border-left: 3px solid var(--bad); }
.tk-top { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 4px; }
.tk-ex { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 4px; white-space: pre-wrap; }
.tk-sec { margin: 18px 0 8px; font-size: .95rem; color: var(--muted); }
.tk-tabs { gap: 6px; }
.tk-tabs .btn b { margin-left: 4px; }
.tk-head { display: flex; gap: 8px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.tk-desc { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.tk-box { margin-top: 12px; padding: 12px 14px; }
.tk-files { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; align-items: center; }
.tk-thumb { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.tk-file, .tk-chip { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); }
.tk-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tk-chip .icon-btn { width: 20px; height: 20px; line-height: 1; padding: 0; }
.tk-people { max-height: 200px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 12px; }
.tk-scope { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 6px; }
.tk-prog { display: flex; gap: 10px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.tk-prog .bar { width: 150px; }
.tk-ext { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tk-note { display: flex; gap: 8px; margin: 8px 0; }
.tk-note select { width: auto; max-width: 180px; }
.tk-row { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 9px 4px; border-bottom: 1px solid var(--line); cursor: pointer; color: inherit; flex-wrap: wrap; }
.tk-row:last-child { border-bottom: 0; }
.tk-row:hover { background: var(--primary-soft); text-decoration: none; }
.tk-run { align-items: flex-start; }
a.tk-stat { color: inherit; display: block; }
a.tk-stat:hover { border-color: var(--primary); text-decoration: none; }
