/* =========================================================
   SOCA Live — giao diện cam–đen của SOCA Media
   Nền đen ấm, cam gradient lấy từ logo (cam vàng → cam đỏ). Chữ: Inter (SIL OFL) — Inter cho nội dung,
   Inter Display cho tiêu đề và chữ số; bật chữ "a" một tầng (cv11) cho khớp chữ "a" trong logo.
   Màu có nghĩa: đèn đỏ = đang phát sóng, cam = thương hiệu và việc cần làm, vàng = chờ duyệt, xanh = đã duyệt.
   ========================================================= */
@font-face { font-family: "SOCA Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/inter-400.woff") format("woff"); }
@font-face { font-family: "SOCA Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/inter-500.woff") format("woff"); }
@font-face { font-family: "SOCA Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/inter-600.woff") format("woff"); }
@font-face { font-family: "SOCA Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/inter-700.woff") format("woff"); }
@font-face { font-family: "SOCA Display"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/inter-display-700.woff") format("woff"); }

/* ---------- màu: tối (mặc định) ---------- */
:root {
  --bg: #0d0c0b;
  --panel: #110f0e;
  --sheet: #181614;
  --sheet-2: #211e1b;
  --line: #2a2623;
  --line-2: #3b3631;
  --text: #f7f2eb;
  --text-2: #d6cec4;
  --muted: #a0968b;

  --brand: #ff7a1a;            /* cam logo */
  --brand-hi: #ff9442;
  --brand-ink: #1a0b02;        /* chữ trên nền cam */
  --brand-text: #ff9a4d;       /* chữ / số màu cam trên nền tối */
  --brand-soft: rgba(255, 122, 26, .16);
  --grad: linear-gradient(135deg, #ffa21f 0%, #ff6b1a 52%, #f0441e 100%);
  --grad-soft: linear-gradient(135deg, rgba(255, 162, 31, .2), rgba(240, 68, 30, .12));

  --live: #ff3b4e;             /* đèn tally */
  --live-text: #ff8591;
  --live-soft: rgba(255, 59, 78, .15);
  --amber: #f5b21a; --amber-text: #f8c451; --amber-soft: rgba(245, 178, 26, .15);
  --green: #2fcf93; --green-lamp: #2fcf93; --green-text: #55dfaa; --green-soft: rgba(47, 207, 147, .15);
  --blue: #5b8def; --blue-text: #93b5ff; --blue-soft: rgba(91, 141, 239, .18);
  --violet-text: #c0a8ff; --violet-soft: rgba(139, 92, 246, .2);

  --monitor: #080706; --monitor-2: #17140f; --monitor-line: rgba(255, 240, 225, .11);
  --monitor-text: #f8f3ec; --monitor-muted: #a89d90;

  --r: 18px; --r-sm: 13px;
  --pop: 0 28px 70px -14px rgba(0, 0, 0, .85);
  --glow: radial-gradient(60% 38% at 85% -8%, rgba(255, 106, 26, .17), transparent 70%), radial-gradient(45% 30% at 0% 100%, rgba(240, 68, 30, .07), transparent 70%);
  --font: "SOCA Sans", "Inter", "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --num: "SOCA Display", "SOCA Sans", "Inter", "Segoe UI", system-ui, sans-serif;
  --sidebar-w: 256px;
  color-scheme: dark;
}
/* ---------- màu: sáng (người dùng chọn) ---------- */
:root[data-theme="light"] {
  --bg: #f6f1ea;
  --panel: #fbf8f3;
  --sheet: #ffffff;
  --sheet-2: #f3eee6;
  --line: #e4ddd2;
  --line-2: #cfc6b8;
  --text: #1c1814;
  --text-2: #3f3832;
  --muted: #6d645a;

  --brand: #ff7a1a;
  --brand-hi: #ff9442;
  --brand-text: #bf4a07;
  --brand-soft: rgba(255, 122, 26, .14);
  --grad-soft: linear-gradient(135deg, rgba(255, 162, 31, .22), rgba(240, 68, 30, .1));

  --live-text: #c2182c; --live-soft: rgba(255, 59, 78, .1);
  --amber: #f2a516; --amber-text: #7a4f00; --amber-soft: rgba(242, 165, 22, .17);
  --green: #0b7a52; --green-lamp: #19b07a; --green-text: #076b47; --green-soft: rgba(25, 176, 122, .13);
  --blue-text: #1d4fb0; --blue-soft: rgba(47, 107, 219, .11);
  --violet-text: #6439bd; --violet-soft: rgba(100, 57, 189, .11);
  --pop: 0 24px 60px -14px rgba(40, 24, 8, .35);
  --glow: radial-gradient(60% 38% at 85% -8%, rgba(255, 122, 26, .16), transparent 70%);
  color-scheme: light;
}

* { box-sizing: border-box; }
svg:not([width]) { width: 18px; height: 18px; vertical-align: -4px; flex: none; }
html, body { margin: 0; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font); font-feature-settings: "cv11" 1, "ss03" 1, "calt" 1; background: transparent; color: var(--text); min-height: 100vh;
  font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  overflow-x: hidden; -webkit-tap-highlight-color: transparent;
}
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--glow); pointer-events: none; }
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; }
h1 { font: 700 32px/1.18 var(--num); letter-spacing: -.025em; }
h2 { font-size: 16px; font-weight: 700; line-height: 1.35; }
h3 { font-size: 14.5px; font-weight: 600; }
p { margin: 0; }
b, strong { font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pre { white-space: pre-wrap; word-break: break-word; }
.hidden, [hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.money { font-variant-numeric: tabular-nums; font-weight: 700; }
.txt-red { color: var(--live-text); } .txt-green { color: var(--green-text); } .txt-amber { color: var(--amber-text); }
::selection { background: var(--brand-soft); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* chữ số lớn: Inter Display, khít, rộng đều (tnum), số kiểu mở (ss01) */
.kpi .value, .timecode, .oa-money b, .ps-line b, .rd-side, .rd-date b, .sc-times b, .todo-tile .tt-n, .live-row .timer, .auth-clock, .pay-preview b, .stat .value {
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1, "ss01" 1, "cv11" 1, "calt" 1; letter-spacing: -.02em;
}

/* ---------- khung ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.app > div:last-child { min-width: 0; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2px; overflow-y: auto;
  padding: 20px 14px 16px; background: var(--panel); border-right: 1px solid var(--line);
}
.nav-scrim { display: none; }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; padding: 6px 10px 24px; }
.brand small { font-weight: 600; color: var(--brand-text); font-size: 12.5px; line-height: 1; padding: 5px 10px; border-radius: 99px; background: var(--brand-soft); }
.logo { display: block; width: auto; height: 34px; }
.logo-lt { display: none; }
:root[data-theme="light"] .logo-dk { display: none; }
:root[data-theme="light"] .logo-lt { display: block; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 10px;
  color: var(--text-2); font: 500 14.5px/1.3 var(--font); background: none; border: 0; text-align: left; cursor: pointer;
}
.nav-link svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.nav-link:hover { background: var(--sheet); text-decoration: none; }
.nav-link.active { background: var(--grad-soft); color: var(--text); font-weight: 600; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 32%, transparent); }
.nav-link.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--grad); }
.nav-link.active svg { color: var(--brand-text); }
.nav-link .nav-badge { margin-left: auto; }
.nav-btn svg:last-child { margin-left: auto; width: 15px; height: 15px; }
.nav-sep { margin: 20px 12px 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.nav-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--live); color: #fff; font-size: 11.5px; font-weight: 700; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.sidebar-tools { display: flex; gap: 8px; margin-top: auto; padding: 14px 4px 10px; }
.sidebar-tools .icon-btn { flex: 1; }
.sidebar .sidebar-foot { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 12px; background: var(--sheet); border: 1px solid var(--line); color: var(--text); line-height: 1.3; }
.sidebar-foot:hover { text-decoration: none; border-color: var(--line-2); }
.topbar, .bottom-nav { display: none; }
.main { padding: 40px 44px 90px; max-width: 1140px; }
.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 40px 0; }
.loading::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--grad); animation: tally 1.2s ease-in-out infinite; }

/* ---------- đầu trang, mục, thanh tab ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 62ch; }
.period-head { margin-bottom: 18px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.month-nav { display: inline-flex; align-items: center; gap: 4px; background: var(--sheet); border: 1px solid var(--line); border-radius: 99px; padding: 3px; }
.month-nav .icon-btn { width: 34px; height: 34px; border: 0; background: none; }
.month-nav .icon-btn:disabled { opacity: .3; }
.period-label { font-weight: 600; font-size: 14px; padding: 0 10px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sec-title { display: flex; align-items: center; gap: 9px; margin: 34px 0 12px; font-size: 16px; font-weight: 700; color: var(--text); }
.sec-title:first-child { margin-top: 0; }
.sec-title svg { color: var(--muted); }
.sec-title .count { background: var(--live); color: #fff; font-size: 12px; border-radius: 99px; padding: 0 7px; line-height: 19px; font-weight: 700; }
.sec-title .live-dot, .live-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--live); box-shadow: 0 0 8px 1px rgba(240, 41, 59, .55); animation: tally 1.6s ease-in-out infinite; flex: none; }
.sheet-hint { color: var(--muted); font-size: 13.5px; margin: 0 0 14px; }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -2px 10px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 0 16px; min-height: 40px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--sheet); color: var(--text-2); font: 600 14px/1 var(--font); cursor: pointer; white-space: nowrap; }
.tab:hover { border-color: var(--text-2); }
.tab.active { background: var(--grad); color: var(--brand-ink); border-color: transparent; }
.tab .count { background: var(--live); color: #fff; font-size: 11.5px; border-radius: 99px; padding: 0 6px; line-height: 18px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.filters select, .filters input { width: auto; min-width: 160px; }
.kind-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--sheet); color: var(--text-2); font: 600 13.5px/1 var(--font); cursor: pointer; }
.chip:hover { border-color: var(--text-2); }
.chip.active { background: var(--grad); color: var(--brand-ink); border-color: transparent; }

/* ---------- khối ---------- */
.card { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: inset 0 1px 0 rgba(255, 240, 225, .04); }
:root[data-theme="light"] .card { box-shadow: 0 1px 2px rgba(60, 40, 10, .05); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.link-card { display: block; color: inherit; }
a.link-card:hover { text-decoration: none; border-color: var(--line-2); }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid + .grid, .grid + .sec-title + .grid { margin-top: 14px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack.tight { gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.right { text-align: right; }
.full { grid-column: 1 / -1; }
.form-grid, .set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.set-grid { gap: 16px 18px; }
.set-grid.set-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* dải số: một khung chung, các ô ngăn bằng đường kẻ mảnh */
.kpis { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 14px; }
.kpi { background: var(--sheet); padding: 16px 18px 17px; min-width: 0; display: block; color: inherit; }
a.kpi:hover { text-decoration: none; background: var(--sheet-2); }
.kpi .label { font-size: 13px; color: var(--muted); font-weight: 500; line-height: 1.35; display: flex; align-items: center; gap: 8px; }
.k-ico { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--grad-soft); color: var(--brand-text); }
.k-ico svg { width: 15px; height: 15px; stroke-width: 2; }
.kpi.attn .k-ico { background: rgba(255, 59, 78, .14); color: var(--live-text); }
.kpi .value { font: 700 38px/1.1 var(--num); margin-top: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi .value small { font: 500 13px var(--font); color: var(--muted); margin-left: 5px; letter-spacing: 0; }
.kpi.attn .value { color: var(--live-text); }
.kpi.hl .value { color: var(--brand-text); }
.stat { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.stat .label { font-size: 13px; color: var(--muted); }
.stat .value { font: 700 32px/1.15 var(--num); margin-top: 6px; }
.stat.attn .value { color: var(--live-text); } .stat.hl .value { color: var(--brand-text); }

.table-wrap { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); padding: 12px 16px; background: var(--sheet-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th.right, td.right { text-align: right; }
td .row { flex-wrap: nowrap; white-space: nowrap; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 38px 20px 34px; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--r); background: linear-gradient(180deg, var(--sheet) 0%, transparent 100%); }
.empty-text { max-width: 34ch; line-height: 1.5; font-size: 15px; }
/* hình mặt cho chỗ trống: mặt cam, nét đậm màu mực, huy hiệu biểu tượng ở góc */
.mascot { position: relative; width: 92px; height: 92px; filter: drop-shadow(0 10px 22px rgba(255, 122, 26, .28)); }
.mascot .face { width: 92px; height: 92px; display: block; overflow: visible; }
.face .f-bg { fill: var(--brand); }
.face .f-shine { fill: none; stroke: rgba(255, 255, 255, .55); stroke-width: 4; stroke-linecap: round; }
.face .f-cheek { fill: rgba(255, 255, 255, .3); }
.face .f-ink { fill: var(--brand-ink); }
.face .f-line { fill: none; stroke: var(--brand-ink); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.face .f-line.thin { stroke-width: 2.6; stroke: var(--brand-text); }
.face .f-hat { fill: var(--brand-text); stroke: var(--brand-ink); stroke-width: 2.4; stroke-linejoin: round; }
.mascot-badge { position: absolute; right: -6px; bottom: 0; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--sheet-2); border: 1px solid var(--line-2); box-shadow: 0 4px 12px rgba(0, 0, 0, .3); }
.mascot-badge svg { width: 17px; height: 17px; color: var(--brand-text); stroke-width: 2; }

/* ---------- nút, ô nhập ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--sheet); color: var(--text); font: 600 14.5px/1.2 var(--font); cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, transform .06s; text-decoration: none;
}
.btn:hover { background: var(--sheet-2); border-color: var(--text-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--grad); border-color: transparent; color: var(--brand-ink); box-shadow: 0 10px 26px -12px rgba(255, 106, 26, .8); }
.btn.primary:hover { background: var(--grad); border-color: transparent; filter: brightness(1.08); }
.btn.success { background: var(--green); border-color: var(--green); color: #052a1d; }
:root[data-theme="light"] .btn.success { color: #fff; }
.btn.success:hover { filter: brightness(1.08); background: var(--green); border-color: var(--green); }
.btn.danger { color: var(--live-text); border-color: color-mix(in srgb, var(--live) 45%, var(--line-2)); }
.btn.danger:hover { background: var(--live-soft); border-color: var(--live); }
.btn.danger.solid { background: #c4122a; border-color: #c4122a; color: #fff; }
.btn.danger.solid:hover { background: #d8152f; }
.btn.danger-soft { color: var(--live-text); }
.btn.ghost { background: none; border-color: transparent; }
.btn.ghost:hover { background: var(--sheet-2); border-color: transparent; }
.btn.sm { min-height: 36px; padding: 0 13px; font-size: 13.5px; border-radius: 10px; }
.btn.lg { min-height: 52px; font-size: 16px; padding: 0 24px; }
.btn.xl { min-height: 62px; font-size: 18px; border-radius: 16px; }
.btn.block { display: flex; width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--sheet); color: var(--text-2); cursor: pointer; flex: none; }
.icon-btn:hover { border-color: var(--text-2); background: var(--sheet-2); }
.icon-btn svg { width: 20px; height: 20px; }
.ic-sun { display: none; } .ic-moon { display: inline-grid; }
:root[data-theme="dark"] .ic-sun { display: inline-grid; } :root[data-theme="dark"] .ic-moon { display: none; }

.field { display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.field .hint, .hint { font-size: 13px; font-weight: 400; color: var(--muted); line-height: 1.45; }
input, select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--sheet-2); color: var(--text);
  font: 400 15px/1.4 var(--font); transition: border-color .12s, box-shadow .12s;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; accent-color: var(--brand); flex: none; margin: 2px 0 0; }
select { appearance: auto; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.check-line { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; cursor: pointer; line-height: 1.45; }

/* ---------- nhãn, đèn, cảnh báo ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; line-height: 1.6; background: var(--sheet-2); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }
.badge svg { width: 13px; height: 13px; }
.badge.green { background: var(--green-soft); color: var(--green-text); border-color: transparent; }
.badge.amber { background: var(--amber-soft); color: var(--amber-text); border-color: transparent; }
.badge.red { background: var(--live-soft); color: var(--live-text); border-color: transparent; }
.badge.blue { background: var(--blue-soft); color: var(--blue-text); border-color: transparent; }
.badge.purple { background: var(--violet-soft); color: var(--violet-text); border-color: transparent; }
/* đèn trạng thái của ca */
.lamp { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text-2); line-height: 1.3; }
.status.st-working .lamp { background: var(--live); box-shadow: 0 0 7px 1px rgba(240, 41, 59, .6); animation: tally 1.6s ease-in-out infinite; }
.status.st-submitted .lamp, .status.st-mgr_ok .lamp { background: var(--amber); }
.status.st-approved .lamp { background: var(--green-lamp); }
.status.st-returned .lamp { background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.status.st-returned { color: var(--brand-text); }
.status.st-void .lamp { background: transparent; border: 2px solid var(--muted); }
.status.st-void { color: var(--muted); }
.callout { padding: 12px 14px; border-radius: var(--r-sm); background: var(--sheet-2); border: 1px solid var(--line); border-left: 4px solid var(--line-2); font-size: 14px; line-height: 1.5; }
.callout strong { display: block; font-weight: 600; margin-bottom: 2px; }
.callout a { font-weight: 600; }
.callout.amber { background: var(--amber-soft); border-color: transparent; border-left-color: var(--amber); }
.callout.red { background: var(--live-soft); border-color: transparent; border-left-color: var(--live); }
.callout.green { background: var(--green-soft); border-color: transparent; border-left-color: var(--green-lamp); }
.callout.small { font-size: 13.5px; }
.grid + .callout, .card + .callout, .table-wrap + .callout { margin-top: 14px; }
.flags, .sc-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.flag { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 2px 10px; border-radius: 99px; background: var(--amber-soft); color: var(--amber-text); line-height: 1.6; }
.flag.red { background: var(--live-soft); color: var(--live-text); }
.flag svg { width: 13px; height: 13px; flex: none; }
.avatar { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; flex: none; background: var(--c, #6b7480); color: #fff; font-weight: 700; font-size: 15px; text-decoration: none; }
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.av-0 { --c: #b64a14; } .av-1 { --c: #a8304f; } .av-2 { --c: #6446b8; } .av-3 { --c: #2459b8; }
.av-4 { --c: #0b7358; } .av-5 { --c: #8a6200; } .av-6 { --c: #0e7490; } .av-7 { --c: #b3261e; }

/* ---------- thông báo, hộp thoại ---------- */
.toast-wrap { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 10px; z-index: 90; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast { background: var(--text); color: var(--bg); border-radius: 14px; padding: 13px 18px; font-weight: 600; font-size: 14.5px; box-shadow: var(--pop); animation: toast-in .22s ease-out; }
.toast.success { background: #0b7a52; color: #fff; }
.toast.error { background: #c4122a; color: #fff; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }
.modal-backdrop { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; background: rgba(6, 5, 4, .72); animation: fade .16s ease-out; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 40px); overflow-y: auto; background: var(--sheet); border-radius: 22px; box-shadow: var(--pop); animation: pop .2s cubic-bezier(.2, .8, .2, 1); }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 14px; position: sticky; top: 0; background: var(--sheet); z-index: 1; border-bottom: 1px solid var(--line); }
.modal-head h2 { font: 700 21px/1.25 var(--num); letter-spacing: -.02em; }
.modal-body { padding: 18px 22px 24px; }
.modal-body > p { margin-bottom: 14px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(14px) scale(.98); opacity: 0; } }
@keyframes sheet { from { transform: translateY(40px); opacity: .5; } }
.reason-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.reason-chip { border: 1px solid var(--line-2); background: var(--sheet); color: var(--text-2); border-radius: 99px; padding: 7px 13px; font: 500 13px/1.3 var(--font); cursor: pointer; text-align: left; }
.reason-chip:hover { border-color: var(--brand); background: var(--brand-soft); }
.lightbox img { width: 100%; max-height: 72vh; object-fit: contain; border-radius: 12px; background: var(--sheet-2); display: block; margin-bottom: 14px; }

@keyframes tally { 0%, 100% { opacity: 1; } 50% { opacity: .38; } }
@keyframes ring { from { transform: scale(.6); opacity: .55; } to { transform: scale(2.6); opacity: 0; } }

/* =========================================================
   Màn hình "đang live" (monitor)
   ========================================================= */
.onair { position: relative; overflow: hidden; border-radius: 28px; padding: 22px; background: radial-gradient(90% 60% at 100% 0%, rgba(255, 106, 26, .2), transparent 62%), var(--monitor); color: var(--monitor-text); border: 1px solid rgba(255, 140, 60, .22); }
.onair.is-live { background: radial-gradient(90% 65% at 100% 0%, rgba(255, 74, 40, .36), transparent 62%), radial-gradient(70% 50% at 0% 100%, rgba(255, 150, 30, .14), transparent 65%), var(--monitor); border-color: rgba(255, 110, 60, .42); }
.oa-top { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
.oa-top .oa-ch { margin-left: auto; color: var(--monitor-muted); font-weight: 500; font-size: 13.5px; text-align: right; line-height: 1.3; }
.tally { width: 13px; height: 13px; border-radius: 50%; background: #ff3b4e; box-shadow: 0 0 14px 3px rgba(255, 59, 78, .65); animation: tally 1.6s ease-in-out infinite; flex: none; }
.tally.off { background: #38414a; box-shadow: none; animation: none; }
.tally.ok { background: #2fcf93; box-shadow: 0 0 12px 2px rgba(47, 207, 147, .5); animation: none; }
.timecode { font: 700 clamp(54px, 17.5vw, 96px)/1 var(--num); letter-spacing: -.01em; font-variant-numeric: tabular-nums; margin: 20px 0 12px; white-space: nowrap; }
.oa-line { color: var(--monitor-muted); font-size: 14.5px; line-height: 1.5; max-width: 46ch; }
.oa-line b { color: var(--monitor-text); }
.tape { position: relative; height: 34px; margin-top: 16px; --hours: 4; }
.tape::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 12px; background-image: linear-gradient(90deg, rgba(255, 255, 255, .34) 1px, transparent 1px); background-size: calc(100% / var(--hours)) 100%; }
.tape::after { content: ""; position: absolute; right: 0; bottom: 0; width: 1px; height: 12px; background: rgba(255, 255, 255, .34); }
.tape-rail { position: absolute; left: 0; right: 0; bottom: 12px; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .12); }
.tape-fill { position: absolute; left: 0; bottom: 12px; height: 8px; width: calc(var(--w, 0) * 1%); border-radius: 99px; background: var(--grad); transition: width 1s linear; }
.tape-head { position: absolute; bottom: 8px; left: calc(var(--w, 0) * 1%); width: 3px; height: 26px; margin-left: -1.5px; border-radius: 2px; background: #fff; box-shadow: 0 0 10px rgba(255, 255, 255, .7); transition: left 1s linear; }
.tape-scale { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12.5px; color: var(--monitor-muted); font-variant-numeric: tabular-nums; }
.oa-money { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--monitor-line); }
.oa-money > span { color: var(--monitor-muted); font-size: 14px; }
.oa-money b { font: 700 36px/1 var(--num); color: var(--brand-hi); font-variant-numeric: tabular-nums; }
.oa-money b small { font: 500 14px var(--font); color: var(--monitor-muted); margin-left: 5px; }
.oa-actions { display: grid; gap: 10px; margin-top: 20px; }
.oa-actions .btn.primary { box-shadow: 0 14px 34px -12px rgba(255, 106, 26, .85); }
.btn.stop { background: var(--monitor-text); border-color: var(--monitor-text); color: #0d1013; }
.btn.stop:hover { background: #fff; border-color: #fff; }
.btn.stop::before { content: ""; width: 14px; height: 14px; border-radius: 3px; background: #ff3b4e; flex: none; }
.oa-sub { display: flex; justify-content: space-between; align-items: center; gap: 0 16px; flex-wrap: wrap; }
.btn.text { background: none; border-color: transparent; color: var(--monitor-muted); min-height: 40px; padding: 0; gap: 7px; font-weight: 500; font-size: 14px; }
.btn.text:hover { color: var(--monitor-text); background: none; border-color: transparent; }
.onair .flags { margin-top: 14px; }
.onair .flag { background: rgba(242, 165, 22, .18); color: #ffd27a; }
.onair .flag.red { background: rgba(240, 41, 59, .22); color: #ff9ca6; }
.onair .hero-select { display: flex; flex-direction: column; gap: 7px; color: var(--monitor-muted); font-size: 13px; font-weight: 600; margin-top: 18px; }
.onair select { background: var(--monitor-2); border-color: rgba(255, 255, 255, .18); color: var(--monitor-text); font-weight: 600; min-height: 50px; }
.onair select:focus { border-color: var(--brand); }
.onair select option { background: #1a2026; color: #f3f5f7; }
.onair .btn:disabled { background: var(--monitor-2); border-color: var(--monitor-line); color: var(--monitor-muted); opacity: 1; }
.home-cols { display: grid; gap: 22px; }

/* ---------- phiếu lương ---------- */
.payslip { position: relative; display: block; margin: 22px 0 18px; padding: 18px 20px 20px; background: var(--sheet); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--r) var(--r) 0 0; color: inherit; }
.payslip:hover { text-decoration: none; }
.payslip::after { content: ""; position: absolute; left: -1px; right: -1px; top: calc(100% - 1px); height: 10px; border: 1px solid var(--line); border-top: 0; background: radial-gradient(circle at 9px 100%, var(--bg) 6px, var(--sheet) 6.6px) -1px 0 / 18px 10px repeat-x; }
.ps-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.ps-head b { font-size: 15px; }
.ps-head span { color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.ps-line { display: flex; align-items: baseline; gap: 10px; padding: 5px 0; }
.ps-line > span { font-size: 14.5px; color: var(--text-2); }
.ps-line .lead { flex: 1; min-width: 14px; border-bottom: 2px dotted var(--line-2); transform: translateY(-4px); }
.ps-line b { font: 700 28px/1 var(--num); font-variant-numeric: tabular-nums; }
.ps-line b small { font: 500 13px var(--font); color: var(--muted); margin-left: 4px; }
.ps-line.total b { font-size: 38px; color: var(--green-text); }
.ps-line.soft b { color: var(--text-2); }
.ps-line.plain b { font: 600 15px/1.2 var(--font); }
.ps-line.plain > span { font-size: 14px; }
.payslip.full { margin-top: 0; }
.payslip.full .ps-line.total b { font-size: 52px; }
.ps-foot { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-2); font-size: 13.5px; color: var(--muted); }
.ps-foot b { color: var(--text); }

/* ---------- danh sách ca gọn ---------- */
.rundown { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.rd-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 14px; align-items: center; width: 100%; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--line); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.rd-row:last-child { border-bottom: 0; }
.rd-row:hover { background: var(--sheet-2); }
.rd-date { display: grid; justify-items: center; line-height: 1; }
.rd-date b { font: 700 30px/1 var(--num); }
.rd-date small { font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 500; }
.rd-main { min-width: 0; }
.rd-main > b { display: block; font-size: 15px; line-height: 1.3; }
.rd-main .rd-sub { display: flex; flex-wrap: wrap; gap: 3px 12px; align-items: center; margin-top: 3px; font-size: 13px; color: var(--muted); }
.rd-side { text-align: right; font: 700 24px/1 var(--num); font-variant-numeric: tabular-nums; }
.rd-side small { font: 500 12px var(--font); color: var(--muted); margin-left: 3px; }
.rd-row.st-void .rd-side { color: var(--muted); text-decoration: line-through; }
.rd-gay { color: var(--live-text); font-weight: 600; }

/* ---------- thẻ ca (duyệt ca, chi tiết ca) ---------- */
.shift-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; }
.shift-card.st-returned { border-color: color-mix(in srgb, var(--brand) 55%, var(--line)); }
.shift-card.st-void { opacity: .65; }
.sc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sc-who { display: flex; gap: 12px; align-items: center; min-width: 0; }
.sc-who b { display: block; font-size: 15.5px; line-height: 1.25; }
.sc-meta { font-size: 13.5px; color: var(--muted); margin-top: -6px; line-height: 1.45; }
.sc-meta b { color: var(--text-2); font-weight: 600; }
/* thanh thời gian: đoạn nhạt = khung ca, đoạn cam = thời gian thực tế làm */
.span { margin: 2px 0; }
.span-track { position: relative; height: 22px; }
.span-win { position: absolute; top: 8px; height: 6px; border-radius: 3px; background: var(--line-2); left: calc(var(--w0, 0) * 1%); width: calc((var(--w1, 100) - var(--w0, 0)) * 1%); }
.span-work { position: absolute; top: 3px; height: 16px; border-radius: 5px; background: var(--grad); left: calc(var(--c0, 0) * 1%); width: calc((var(--c1, 100) - var(--c0, 0)) * 1%); min-width: 4px; }
.span-lab { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 3px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.sw.win { background: var(--line-2); } .sw.work { background: var(--grad); }
.shift-card { container-type: inline-size; }
.sc-times { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.sc-times > div { background: var(--sheet); padding: 10px 12px; min-width: 0; }
.sc-times > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
.sc-times > div > small:first-child { display: block; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.sc-times b { display: block; font: 700 24px/1.15 var(--num); font-variant-numeric: tabular-nums; white-space: nowrap; margin-top: 2px; }
.sc-times b small { display: inline; font: 500 12px var(--font); color: var(--muted); margin-left: 3px; }
.sc-times .sc-money b { color: var(--brand-text); }
.sc-times .sc-money.final b { color: var(--green-text); }
@container (min-width: 440px) { .sc-times { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); } .sc-times > div:last-child:nth-child(odd) { grid-column: auto; } }
.inc-list { display: flex; flex-direction: column; gap: 8px; }
.inc-item { border-radius: 12px; padding: 12px 15px; background: var(--sheet); border: 1px solid var(--line); border-left: 4px solid var(--line-2); }
.inc-list .inc-item { background: var(--sheet-2); border: 0; border-left: 4px solid var(--line-2); }
.card.inc-item { padding: 16px 18px; }
.inc-item.red { border-left-color: var(--live); }
.inc-item.amber { border-left-color: var(--amber); }
.inc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.inc-top svg { width: 16px; height: 16px; flex: none; }
.inc-top .muted { margin-left: auto; }
.inc-note { font-size: 14.5px; margin-top: 5px; white-space: pre-wrap; word-break: break-word; }
.inc-item .photo-row, .inc-item .sc-who, .inc-item > .muted { margin-top: 8px; }
.inc-item .sc-actions { margin-top: 14px; }
.main > p.muted.small:last-child { margin-top: 18px; }
.photo-row { display: flex; gap: 10px; flex-wrap: wrap; }
.photo-thumb { position: relative; width: 108px; height: 108px; padding: 0; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; background: var(--sheet-2); cursor: zoom-in; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb span { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 6px 5px; font-size: 11.5px; font-weight: 600; color: #fff; text-align: center; background: linear-gradient(transparent, rgba(0, 0, 0, .72)); }
.photo-thumb.rev { border: 2px solid var(--brand); }
.photo-locked { width: 108px; height: 108px; border: 1px dashed var(--line-2); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.3; padding: 6px; }
.photo-locked svg { width: 20px; height: 20px; }
.sc-note { font-size: 14px; color: var(--text-2); background: var(--sheet-2); border-radius: 12px; padding: 9px 13px; white-space: pre-wrap; word-break: break-word; }
.sc-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line); }
.sc-actions .btn { padding: 0 14px; }
@media (min-width: 761px) { .sc-actions .btn.ghost { margin-left: -14px; } }
.shift-log { display: flex; flex-direction: column; }
.tl-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.tl-row:last-child { border-bottom: 0; }
.tl-time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; padding-top: 1px; }
.shift-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }

/* ---------- ô chọn ảnh, có/không gậy, form báo gậy ---------- */
.photo-field { display: flex; flex-direction: column; gap: 7px; }
.pf-label { font-weight: 600; font-size: 14px; color: var(--text-2); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.photo-pick { position: relative; display: grid; place-items: center; min-height: 132px; padding: 14px; text-align: center; cursor: pointer; overflow: hidden; border: 2px dashed var(--line-2); border-radius: var(--r); background: var(--sheet-2); transition: border-color .12s, background .12s; }
.photo-pick:hover { border-color: var(--brand); }
.pf-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; min-height: 0; padding: 0; }
.pp-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-2); }
.pp-empty svg { width: 32px; height: 32px; color: var(--brand-text); }
.pp-img { max-width: 100%; max-height: 210px; border-radius: 10px; display: block; margin: 0 auto; object-fit: contain; }
.pp-state { display: block; font-size: 13px; color: var(--muted); margin-top: 8px; }
.photo-field.shown .pp-empty { display: none; }
.photo-field.has .photo-pick { border-style: solid; border-color: var(--green-lamp); background: var(--green-soft); }
.photo-field.has .pp-state { color: var(--green-text); font-weight: 600; }
.photo-field.busy .photo-pick { border-color: var(--brand); }
.photo-field.bad .photo-pick { border-color: var(--live); background: var(--live-soft); }
.photo-field.bad .pp-state { color: var(--live-text); font-weight: 600; }
.q-label { font-weight: 700; font-size: 15px; margin: 0 0 8px; display: block; }
.yn { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.yn label { position: relative; display: block; cursor: pointer; }
.yn input { position: absolute; opacity: 0; pointer-events: none; }
.yn span { display: flex; flex-direction: column; gap: 2px; align-items: center; text-align: center; padding: 15px 10px; border: 2px solid var(--line-2); border-radius: var(--r); background: var(--sheet); font-weight: 700; transition: border-color .12s, background .12s; }
.yn span small { font-weight: 500; color: var(--muted); font-size: 12.5px; }
.yn .no input:checked + span { border-color: var(--green-lamp); background: var(--green-soft); color: var(--green-text); }
.yn .yes input:checked + span { border-color: var(--live); background: var(--live-soft); color: var(--live-text); }
.yn input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.inc-form { display: flex; flex-direction: column; gap: 14px; padding: 14px; border-radius: var(--r); background: var(--live-soft); border: 1px solid color-mix(in srgb, var(--live) 25%, transparent); }
.inc-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.inc-kind { position: relative; display: block; cursor: pointer; }
.inc-kind input { position: absolute; opacity: 0; pointer-events: none; }
.inc-kind > span { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 11px 13px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--sheet); }
.inc-kind b { font-size: 14px; }
.inc-kind small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.inc-kind input:checked + span { border-color: var(--brand); background: var(--brand-soft); }
.inc-kind.inc-gay input:checked + span { border-color: var(--live); background: var(--live-soft); }
.inc-kind input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- duyệt ca, tổng quan, lương, nhân sự, cài đặt ---------- */
.rev-big { text-align: center; }
.rev-big img { max-width: 100%; max-height: 46vh; border-radius: 12px; border: 2px solid var(--brand); background: var(--sheet-2); cursor: zoom-in; }
.rev-big .cap { font-size: 13px; color: var(--muted); margin-top: 7px; }
.approve-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pay-preview { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 14px 16px; border-radius: var(--r-sm); background: var(--sheet-2); border: 1px dashed var(--line-2); }
.pay-preview b { font: 700 32px/1 var(--num); color: var(--green-text); font-variant-numeric: tabular-nums; }
.todo-tile { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px; border-radius: var(--r); background: var(--sheet); border: 1px solid var(--line); margin-bottom: 14px; }
.todo-tile.on { background: var(--grad); border-color: transparent; color: var(--brand-ink); box-shadow: 0 18px 44px -22px rgba(255, 106, 26, .9); }
.todo-tile .tt-n { font: 700 54px/1 var(--num); font-variant-numeric: tabular-nums; }
.todo-tile .tt-t { font-size: 17px; font-weight: 700; line-height: 1.3; }
.todo-tile .tt-s { font-size: 14px; opacity: .8; margin-top: 2px; }
.todo-tile .tt-l { display: flex; align-items: center; gap: 16px; min-width: 0; }
.todo-tile.on .btn { background: var(--brand-ink); border-color: var(--brand-ink); color: #fff; flex: none; }
.live-board { background: var(--monitor); color: var(--monitor-text); border-radius: var(--r); padding: 6px 18px; border: 1px solid rgba(255, 140, 60, .2); }
.live-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--monitor-line); }
.live-row:last-child { border-bottom: 0; }
.live-row .lr-body { flex: 1; min-width: 0; line-height: 1.35; }
.live-row .lr-body b { display: block; font-size: 15.5px; }
.live-row .lr-body .muted { color: var(--monitor-muted); }
.live-row .timer { font: 700 32px/1 var(--num); font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--monitor-text); }
.live-board .empty { border: 0; color: var(--monitor-muted); }
.live-board .flag { background: rgba(242, 165, 22, .18); color: #ffd27a; }
.pay-card { display: flex; flex-direction: column; gap: 14px; container-type: inline-size; }
.pay-card .pc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pay-card .pc-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pay-card .pc-who b { display: block; }
.pc-stats { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; color: var(--text-2); }
.bank-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--sheet-2); border-radius: 12px; padding: 10px 13px; font-size: 14px; }
.bank-line .grow { word-break: break-word; }
.bank-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.bank-box .bank-text { min-width: 0; }
.bank-box .bank-text b { display: block; }
.banner { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: var(--r); background: var(--sheet); border: 1px solid var(--line); border-left: 4px solid var(--brand); margin-bottom: 16px; }
.banner svg { width: 26px; height: 26px; color: var(--brand-text); flex: none; }
.banner b { display: block; font-size: 16px; }
.banner div { color: var(--muted); font-size: 14px; }
.revenue-card .photo-thumb { width: 100%; height: 160px; }
.revenue-card .photo-thumb img { object-position: top; }
.revenue-card .photo-thumb span { display: none; }
.revenue-card .photo-thumb::after { content: ""; position: absolute; inset: auto 0 0 0; height: 34px; background: linear-gradient(transparent, rgba(0, 0, 0, .35)); pointer-events: none; }
.rv-line { display: flex; gap: 8px; align-items: center; }
.rv-line input { flex: 1; min-width: 0; }
.person-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.person-row:last-child { border-bottom: 0; padding-bottom: 0; }
.person-row:first-child { padding-top: 0; }
.person-row .pr-body { flex: 1; min-width: 190px; }
.person-row .pr-body b { display: block; }
.pr-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.person-row.locked { opacity: .6; }
.chan-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.chan-row:last-child { border-bottom: 0; }
.chan-row .grow { font-weight: 600; }
.hist-row { display: flex; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px dashed var(--line-2); font-size: 14.5px; }
.hist-row:last-child { border-bottom: 0; }
.pw-box { font: 700 24px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .06em; background: var(--sheet-2); border: 1px dashed var(--line-2); border-radius: var(--r-sm); padding: 16px; text-align: center; user-select: all; word-break: break-all; }

/* ---------- đăng nhập ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 28px 18px; background: radial-gradient(75% 55% at 50% 0%, rgba(255, 106, 26, .3), transparent 70%), radial-gradient(60% 40% at 50% 100%, rgba(240, 68, 30, .12), transparent 70%), #070605; color: var(--monitor-text); position: relative; overflow: hidden; }
.auth-wrap { width: 100%; max-width: 420px; position: relative; z-index: 1; }
.auth-stage { text-align: center; padding: 6px 0 26px; }
.auth-logo { display: inline-block; height: 52px; width: auto; }
.auth-mark { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: var(--grad); color: var(--brand-ink); }
.auth-mark svg { width: 30px; height: 30px; stroke-width: 2; }
.auth-clock { font: 700 60px/1 var(--num); letter-spacing: -.01em; font-variant-numeric: tabular-nums; margin-top: 26px; }
.auth-day { color: var(--monitor-muted); margin-top: 8px; font-size: 14.5px; }
.auth .card { background: rgba(24, 22, 20, .92); color: var(--text); border-radius: 26px; padding: 26px 24px 24px; border: 1px solid rgba(255, 150, 70, .2); backdrop-filter: blur(10px); }
.auth .card form { display: flex; flex-direction: column; gap: 16px; }
.auth .card h1 { font-size: 26px; }
.auth .card > p.muted { margin: 6px 0 20px; }

/* ---------- máy tính bảng, điện thoại ---------- */
@media (min-width: 1000px) {
  .home-cols { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; gap: 28px; }
  .home-cols .payslip { margin-top: 0; }
}
@media (max-width: 1180px) { .main { padding: 32px 28px 80px; } .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .grid-3, .grid-2, .shift-grid, .set-grid { grid-template-columns: 1fr; } .set-grid.set-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .set-grid.set-3 > :nth-child(3) { grid-column: 1 / -1; } }
@media (max-width: 760px) {
  body { font-size: 15.5px; }
  h1 { font-size: 27px; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 300px; max-width: 86vw; height: auto; z-index: 40; transform: translateX(-102%); transition: transform .24s cubic-bezier(.2, .8, .2, 1); border-right: 1px solid var(--line-2); box-shadow: none; visibility: hidden; transition: transform .24s cubic-bezier(.2, .8, .2, 1), box-shadow .24s, visibility 0s .24s; }
  .nav-link.active::before { left: -14px; }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--pop); visibility: visible; transition: transform .24s cubic-bezier(.2, .8, .2, 1), box-shadow .24s, visibility 0s; }
  .app.nav-open .nav-scrim { display: block; position: fixed; inset: 0; background: rgba(8, 11, 14, .55); z-index: 39; }
  .topbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); background: color-mix(in srgb, var(--bg) 86%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
  .topbar .logo { height: 26px; }
  .topbar .title { display: flex; align-items: center; gap: 9px; }
  .live-chip { font-style: normal; font-size: 11.5px; font-weight: 700; line-height: 1; padding: 5px 9px; border-radius: 99px; background: var(--grad); color: var(--brand-ink); }
  .topbar .title { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15.5px; }
  .topbar .icon-btn { border-color: transparent; background: none; }
  .topbar a.avatar { width: 36px; height: 36px; font-size: 14px; }
  .main { padding: 20px 16px calc(96px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 20px; align-items: flex-start; }
  .page-head > .btn, .page-head > a.btn { width: 100%; }
  .grid { gap: 12px; }
  .card { padding: 17px; }
  .kpis { --n: 2 !important; }
  .kpi { padding: 14px 15px 15px; }
  .kpis .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .kpi .value { font-size: 29px; }
  .approve-grid, .form-grid, .inc-kinds { grid-template-columns: 1fr; }
  .inc-kinds { grid-template-columns: 1fr 1fr; }
  .inc-kind > span { padding: 10px; } .inc-kind small { display: none; }
  .inc-form { padding: 12px; }
  .hide-sm { display: none; }
  .toast-wrap { bottom: calc(92px + env(safe-area-inset-bottom)); }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal, .modal.wide { max-width: none; border-radius: 24px 24px 0 0; max-height: 94vh; animation: sheet .26s cubic-bezier(.2, .8, .2, 1); padding-bottom: env(safe-area-inset-bottom); }
  .modal-head { padding: 22px 18px 12px; }
  .modal-head::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--line-2); }
  .modal-body { padding: 16px 18px 24px; }
  .form-actions .btn { flex: 1 1 130px; }
  .sc-actions .btn { flex: 1 1 130px; }
  .filters select, .filters input { flex: 1 1 150px; }
  .photo-thumb, .photo-locked { width: 94px; height: 94px; }
  .period-head { flex-direction: column; align-items: stretch; }
  .period-head .month-nav { justify-content: space-between; }
  .tl-row { grid-template-columns: 80px minmax(0, 1fr); }
  .todo-tile { padding: 16px; flex-wrap: wrap; }
  .todo-tile .tt-l { flex: 1 1 100%; }
  .todo-tile .btn { width: 100%; }
  .todo-tile .tt-n { font-size: 52px; }
  .inc-top .muted { margin-left: 0; flex-basis: 100%; }
  .sc-actions .btn.success { flex-basis: 100%; }
  .table-wrap .avatar { display: none; }
  td.num, th.right { white-space: nowrap; }
  th, td { padding: 11px 9px; }
  .live-row .timer { font-size: 26px; }
  .auth { align-items: end; padding: 0; }
  .auth-wrap { max-width: none; }
  .auth-stage { padding: 56px 0 30px; }
  .auth .card { border-radius: 26px 26px 0 0; padding: 26px 20px calc(24px + env(safe-area-inset-bottom)); }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--panel) 90%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border-top: 1px solid var(--line); }
  .bottom-nav.n3 { grid-template-columns: repeat(3, 1fr); } .bottom-nav.n4 { grid-template-columns: repeat(4, 1fr); }
  .bottom-nav a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 2px 5px; color: var(--muted); font-size: 11.5px; font-weight: 600; text-decoration: none; text-align: center; line-height: 1.2; }
  .bottom-nav a svg { width: 24px; height: 24px; stroke-width: 1.8; }
  .bottom-nav a.active { color: var(--text); }
  .bottom-nav a.active svg { color: var(--brand-text); stroke-width: 2.1; }
  .bottom-nav a.active::before { content: ""; position: absolute; top: -7px; left: 50%; width: 32px; height: 4px; margin-left: -16px; border-radius: 0 0 4px 4px; background: var(--grad); }
  .bottom-nav .nav-badge { position: absolute; top: 3px; left: 54%; min-width: 17px; height: 17px; font-size: 10.5px; padding: 0 4px; line-height: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .tally, .live-dot, .loading::before, .status.st-working .lamp { animation: none; }
  .tape-fill, .tape-head { transition: none; }
  .modal, .toast, .modal-backdrop { animation: none; }
}
