:root {
  --primary: #0e2a6b;
  --primary-dark: #081a47;
  --primary-soft: #e8edf8;
  --accent: #f5a623;
  --accent-dark: #e0790c;
  --bg: #f3f5f9;
  --card: #ffffff;
  --line: #e3e7ef;
  --text: #1f2933;
  --muted: #6b7280;
  --ok: #0f9d6b;
  --ok-bg: #e3f6ee;
  --warn: #c76a00;
  --warn-bg: #fff2dc;
  --bad: #d63031;
  --bad-bg: #fde8e8;
  --info: #2563eb;
  --info-bg: #e5edff;
  --leave: #7c3aed;
  --leave-bg: #f0e9ff;
  --ot: #0e7490;
  --ot-bg: #dff4f8;
  --off-bg: #f1f2f5;
  --radius: 10px;
  --shadow: 0 10px 30px -18px rgba(14, 42, 107, 0.35);
  --font: 'IBM Plex Sans', 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.cc-app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.cc-side { background: var(--primary); color: #dbe3f5; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.cc-brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.cc-brand img { width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 8px; padding: 3px; }
.cc-brand b { display: block; font-family: 'Oswald', sans-serif; font-size: 17px; letter-spacing: .5px; color: #fff; text-transform: uppercase; }
.cc-brand small { color: var(--accent); font-size: 12px; }
.cc-nav { padding: 10px 8px; flex: 1; overflow-y: auto; }
.cc-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin: 2px 0; border-radius: 8px; color: inherit; text-decoration: none; font-weight: 500; }
.cc-nav a i { width: 18px; text-align: center; opacity: .85; }
.cc-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.cc-nav a.active { background: var(--accent); color: var(--primary-dark); }
.cc-nav a .cc-badge { margin-left: auto; }
.cc-side-foot { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; }
.cc-side-foot button { margin-top: 8px; width: 100%; }

.cc-main { min-width: 0; display: flex; flex-direction: column; }
.cc-top { display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.cc-top h1 { font-size: 19px; margin: 0; font-weight: 700; color: var(--primary); }
.cc-top .cc-spacer { flex: 1; }
.cc-clock { font-family: var(--mono); color: var(--muted); font-size: 13px; }
.cc-menu-btn { display: none; }
.cc-content { padding: 20px 24px 40px; }

/* ---------- Components ---------- */
.cc-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 16px; }
.cc-card h2 { font-size: 16px; margin: 0 0 12px; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.cc-card h2 .cc-spacer { flex: 1; }
.cc-grid { display: grid; gap: 16px; }
.cc-grid.two { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.cc-grid.half { grid-template-columns: 1fr 1fr; }

.cc-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.cc-kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; transition: transform .15s, box-shadow .15s; border-left: 4px solid var(--primary); }
.cc-kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.cc-kpi.active { outline: 2px solid var(--accent); }
.cc-kpi span { color: var(--muted); font-size: 13px; }
.cc-kpi b { display: block; font-size: 28px; font-family: 'Oswald', sans-serif; color: var(--primary); line-height: 1.2; }
.cc-kpi.ok { border-left-color: var(--ok); } .cc-kpi.ok b { color: var(--ok); }
.cc-kpi.warn { border-left-color: var(--warn); } .cc-kpi.warn b { color: var(--warn); }
.cc-kpi.bad { border-left-color: var(--bad); } .cc-kpi.bad b { color: var(--bad); }
.cc-kpi.info { border-left-color: var(--info); } .cc-kpi.info b { color: var(--info); }
.cc-kpi.leave { border-left-color: var(--leave); } .cc-kpi.leave b { color: var(--leave); }
.cc-kpi.muted { border-left-color: #9ca3af; } .cc-kpi.muted b { color: #6b7280; }

.cc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--text); padding: 7px 14px; border-radius: 8px; cursor: pointer; font-weight: 500; white-space: nowrap; text-decoration: none; }
.cc-btn:hover { border-color: var(--primary); color: var(--primary); }
.cc-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.cc-btn.primary:hover { background: var(--primary-dark); color: #fff; }
.cc-btn.accent { background: var(--accent); border-color: var(--accent); color: var(--primary-dark); }
.cc-btn.danger { color: var(--bad); border-color: #f3c4c4; }
.cc-btn.danger:hover { background: var(--bad); color: #fff; border-color: var(--bad); }
.cc-btn.sm { padding: 4px 9px; font-size: 12.5px; }
.cc-btn.ghost { border-color: transparent; background: transparent; }
.cc-btn:disabled { opacity: .55; cursor: not-allowed; }

.cc-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.cc-dash-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.cc-dash-bar .cc-spacer { flex: 1; }
.cc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer; }
.cc-chip:hover { border-color: var(--primary); }
.cc-chip b { font-family: 'Oswald', sans-serif; font-size: 15px; color: var(--primary); }
.cc-chip.ok b { color: var(--ok); } .cc-chip.warn b { color: var(--warn); } .cc-chip.bad b { color: var(--bad); } .cc-chip.leave b { color: var(--leave); }
.cc-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.cc-chip.active b { color: #fff; }
.cc-input.sm { padding: 5px 8px; font-size: 13px; }
.cc-toolbar .cc-spacer { flex: 1; }
.cc-field { display: flex; flex-direction: column; gap: 4px; }
.cc-field > span { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.cc-field small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.cc-input, .cc-field input:not([type=checkbox]):not([type=radio]), .cc-field select, .cc-field textarea {
  border: 1px solid #cfd6e3; border-radius: 8px; padding: 7px 10px; background: #fff; min-width: 0; color: var(--text);
}
.cc-field textarea { min-height: 64px; resize: vertical; }
.cc-field input:disabled, .cc-field select:disabled { background: #f1f3f8; color: var(--muted); border-color: #e2e6ee; cursor: not-allowed; }
.cc-input:focus, .cc-field input:focus, .cc-field select:focus, .cc-field textarea:focus { outline: 2px solid rgba(245,166,35,.45); border-color: var(--accent); }
.cc-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 14px; }
.cc-form .full { grid-column: 1 / -1; }
.cc-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; margin-right: 10px; }
.cc-days { display: flex; flex-wrap: wrap; gap: 4px; }
.cc-days label { border: 1px solid #cfd6e3; border-radius: 6px; padding: 4px 8px; cursor: pointer; user-select: none; }
.cc-days input { display: none; }
.cc-days input:checked + span { color: #fff; }
.cc-days label:has(input:checked) { background: var(--primary); border-color: var(--primary); color: #fff; }

.cc-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.cc-table { width: 100%; border-collapse: collapse; }
.cc-table th, .cc-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.cc-table th { background: #f7f8fb; font-size: 12.5px; color: var(--muted); font-weight: 600; position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.cc-table tr:last-child td { border-bottom: 0; }
.cc-table tbody tr:hover td { background: #fafbff; }
.cc-table tr.clickable { cursor: pointer; }
.cc-table td.num, .cc-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.cc-table .mono { font-family: var(--mono); font-size: 13px; }
.cc-table tr.is-ignored td { color: #9ca3af; text-decoration: line-through; }
.cc-empty { padding: 30px; text-align: center; color: var(--muted); }

.cc-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--off-bg); color: var(--muted); white-space: nowrap; }
.cc-badge.ok { background: var(--ok-bg); color: var(--ok); }
.cc-badge.warn { background: var(--warn-bg); color: var(--warn); }
.cc-badge.bad { background: var(--bad-bg); color: var(--bad); }
.cc-badge.info { background: var(--info-bg); color: var(--info); }
.cc-badge.leave, .cc-badge.holiday { background: var(--leave-bg); color: var(--leave); }
.cc-badge.ot { background: var(--ot-bg); color: var(--ot); }
.cc-badge.count { background: var(--bad); color: #fff; min-width: 20px; justify-content: center; }

.cc-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.cc-tabs button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.cc-tabs button.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.cc-alert { border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; line-height: 1.5; }
.cc-alert i { margin-top: 3px; }
.cc-alert.ok { background: var(--ok-bg); color: #0b6b4a; }
.cc-alert.warn { background: var(--warn-bg); color: #8a4b00; }
.cc-alert.bad { background: var(--bad-bg); color: #9b1c1c; }
.cc-alert.info { background: var(--info-bg); color: #1e40af; }

.cc-feed { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow: auto; }
.cc-feed li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); align-items: center; }
.cc-feed li:last-child { border-bottom: 0; }
.cc-feed time { font-family: var(--mono); font-weight: 600; color: var(--primary); min-width: 64px; }
.cc-feed .who { flex: 1; min-width: 0; }
.cc-feed .who small { display: block; color: var(--muted); }

/* ---------- Bảng công ---------- */
.ts-wrap { overflow: auto; max-height: calc(100vh - 230px); border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.ts { border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.ts th, .ts td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0; text-align: center; }
.ts thead th { position: sticky; top: 0; background: #f7f8fb; z-index: 3; font-weight: 600; color: var(--muted); padding: 4px 2px; }
.ts thead th.sun, .ts td.sun { background: #f6f6f8; }
.ts thead th.hol { background: var(--leave-bg); color: var(--leave); }
.ts thead th.today { background: var(--accent); color: var(--primary-dark); }
.ts .sticky { position: sticky; left: 0; z-index: 2; background: #fff; text-align: left; padding: 4px 10px; white-space: nowrap; }
.ts .sticky2 { left: 64px; }
.ts thead .sticky { z-index: 4; background: #f7f8fb; }
.ts td.name { min-width: 170px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.ts td.name small { display: block; color: var(--muted); font-size: 11.5px; }
.ts td.code { width: 64px; min-width: 64px; font-family: var(--mono); }
.ts td.day { width: 38px; min-width: 38px; height: 40px; cursor: pointer; position: relative; font-weight: 600; }
.ts td.day:hover { outline: 2px solid var(--accent); outline-offset: -2px; z-index: 1; }
.ts td.day .ot { position: absolute; right: 2px; bottom: 1px; font-size: 9.5px; color: var(--ot); font-weight: 600; }
.ts td.day .lv { position: absolute; left: 2px; top: 1px; font-size: 9px; color: var(--leave); }
.ts td.day .dot { position: absolute; right: 3px; top: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.ts td.day .adj { position: absolute; left: 2px; bottom: 0; font-size: 9px; color: var(--info); }
.ts td.s-ok { color: var(--ok); }
.ts td.s-warn { color: var(--warn); background: #fffaf0; }
.ts td.s-bad { color: var(--bad); background: var(--bad-bg); }
.ts td.s-info { color: var(--info); background: #f3f7ff; }
.ts td.s-leave, .ts td.s-holiday { color: var(--leave); background: #faf6ff; }
.ts td.s-ot { color: var(--ot); background: #f1fbfd; }
.ts td.s-off { background: #f6f6f8; color: #9ca3af; }
.ts td.s-na { background: repeating-linear-gradient(45deg, #fafafa, #fafafa 4px, #f0f0f0 4px, #f0f0f0 8px); cursor: default; }
.ts td.s-future, .ts td.s-muted { color: #9ca3af; }
.ts td.action { box-shadow: inset 0 0 0 2px var(--bad); }
.ts td.sum { padding: 4px 8px; font-variant-numeric: tabular-nums; white-space: nowrap; background: #fbfcfe; }
.ts td.sum.total { font-weight: 700; color: var(--primary); background: #fff8eb; }
.ts thead th.sum { min-width: 56px; padding: 4px 6px; }
.ts-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.ts-legend b { display: inline-block; min-width: 26px; text-align: center; border-radius: 4px; padding: 1px 4px; margin-right: 4px; }

/* ---------- Modal ---------- */
.cc-modal-back { position: fixed; inset: 0; background: rgba(8, 26, 71, .45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 100; overflow-y: auto; }
.cc-modal { background: #fff; border-radius: 12px; width: 100%; max-width: 560px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.45); animation: pop .15s ease-out; }
.cc-modal.wide { max-width: 880px; }
.cc-modal header { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.cc-modal header h3 { margin: 0; font-size: 16px; color: var(--primary); flex: 1; }
.cc-modal .body { padding: 16px 18px; }
.cc-modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.cc-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 12px 0; }
.cc-facts div { background: #f7f8fb; border-radius: 8px; padding: 8px 10px; }
.cc-facts span { display: block; font-size: 12px; color: var(--muted); }
.cc-facts b { font-size: 16px; color: var(--primary); }
.cc-section { margin-top: 18px; }
.cc-section h4 { margin: 0 0 8px; font-size: 14px; color: var(--primary); }
.cc-flags { list-style: none; padding: 0; margin: 8px 0 0; }
.cc-flags li { padding: 6px 10px; border-radius: 6px; margin-bottom: 6px; background: #f7f8fb; line-height: 1.45; }
.cc-flags li.bad { background: var(--bad-bg); color: #9b1c1c; }
.cc-flags li.warn { background: var(--warn-bg); color: #8a4b00; }
.cc-flags li.info { background: var(--info-bg); color: #1e40af; }
details.cc-acc { border: 1px solid var(--line); border-radius: 8px; margin-top: 10px; }
details.cc-acc summary { cursor: pointer; padding: 10px 12px; font-weight: 600; color: var(--primary); }
details.cc-acc > div { padding: 0 12px 12px; }

/* ---------- Toast / loading ---------- */
.cc-toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.cc-toast { background: var(--primary-dark); color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); max-width: 380px; animation: pop .15s; }
.cc-toast.bad { background: var(--bad); }
.cc-toast.ok { background: var(--ok); }
.cc-toast.busy { display: flex; align-items: center; }
.cc-toast .cc-spin, .cc-btn .cc-spin { width: 14px; height: 14px; border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
.cc-loading { padding: 40px; text-align: center; color: var(--muted); }
.cc-spin { display: inline-block; width: 18px; height: 18px; border: 2px solid #cfd6e3; border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; vertical-align: middle; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Login ---------- */
.cc-login { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary-dark), var(--primary) 60%, #23479b); padding: 20px; }
.cc-login form { background: #fff; width: 100%; max-width: 380px; border-radius: 14px; padding: 28px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); }
.cc-login .logo { text-align: center; margin-bottom: 14px; }
.cc-login .logo img { height: 64px; }
.cc-login h1 { text-align: center; font-family: 'Oswald', sans-serif; text-transform: uppercase; color: var(--primary); margin: 0; font-size: 22px; letter-spacing: .5px; }
.cc-login p { text-align: center; color: var(--muted); margin: 4px 0 20px; }
.cc-login .cc-field { margin-bottom: 12px; }
.cc-login .cc-btn { width: 100%; padding: 10px; margin-top: 6px; }
.cc-login .err { color: var(--bad); min-height: 20px; font-size: 13px; text-align: center; }

.cc-key { font-family: var(--mono); background: var(--primary-dark); color: #ffe3b0; padding: 10px 12px; border-radius: 8px; word-break: break-all; }
.cc-steps { padding-left: 20px; line-height: 1.7; }
.cc-steps code, .cc-code { font-family: var(--mono); background: #f1f3f8; padding: 1px 6px; border-radius: 4px; font-size: 12.5px; }
.cc-snap { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); vertical-align: middle; background: #f1f3f8; }
.cc-face { width: 34px; height: 34px; object-fit: cover; border-radius: 50%; border: 1px solid var(--line); vertical-align: middle; background: #f1f3f8; }
.cc-face-preview { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.cc-face-preview img { width: 140px; height: 140px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: #f1f3f8; }
.cc-places { display: grid; gap: 8px; margin-bottom: 12px; }
.cc-places label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.cc-places label small { display: block; color: var(--muted); }
.cc-copy { display: flex; gap: 6px; align-items: stretch; }
.cc-copy .cc-key { flex: 1; font-size: 12.5px; padding: 8px 10px; }
.text-muted { color: var(--muted); }
.text-bad { color: var(--bad); }
.text-ok { color: var(--ok); }
.text-warn { color: var(--warn); }

/* Tài khoản Chỉ xem: ẩn mọi thao tác sửa dữ liệu (máy chủ cũng chặn) */
.role-viewer .cc-modal details.cc-acc,
.role-viewer [data-ignore], .role-viewer [data-restore], .role-viewer [data-del], .role-viewer [data-hol], .role-viewer [data-edit],
.role-viewer #pAdd, .role-viewer #lAdd, .role-viewer #eAdd, .role-viewer #sAdd, .role-viewer #fHol,
.role-viewer [data-face], .role-viewer [data-del-emp] { display: none !important; }
.cc-side-foot small { color: #9fb0d6; }

/* ---------- Tài liệu ---------- */
.cc-grow { flex: 1 1 320px; }
.cc-combo { position: relative; }
.cc-combo input { width: 100%; padding-right: 32px !important; }
.cc-combo > i { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 12px; pointer-events: none; }
.cc-combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; max-height: 240px; overflow-y: auto; background: #fff; border: 1px solid #cfd6e3; border-radius: 8px; box-shadow: var(--shadow); padding: 4px; }
.cc-combo-opt, .cc-combo-new, .cc-combo-empty { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; }
.cc-combo-opt { cursor: pointer; }
.cc-combo-opt i { color: var(--accent-dark); }
.cc-combo-opt span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cc-combo-opt small { color: var(--muted); white-space: nowrap; }
.cc-combo-opt:hover, .cc-combo-opt.active { background: var(--primary-soft); }
.cc-combo-new { cursor: pointer; color: var(--primary); border-top: 1px dashed var(--line); }
.cc-combo-new:first-child { border-top: 0; }
.cc-combo-new:hover { background: #fff8ec; }
.cc-combo-empty { color: var(--muted); font-size: 13px; }
.cc-search { position: relative; display: flex; align-items: center; }
.cc-search > i { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.cc-search input.cc-input { width: 100%; height: 38px; padding-left: 36px; }
#fList.is-loading { opacity: .45; pointer-events: none; transition: opacity .15s; }
.cc-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 16px; border: 2px dashed #c3cde0; border-radius: var(--radius); background: #fafbfe; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.cc-drop i { font-size: 30px; color: var(--primary); }
.cc-drop small { color: var(--muted); }
.cc-drop:hover, .cc-drop.over { border-color: var(--accent); background: #fff8ec; }
.cc-drop.compact { flex-direction: row; justify-content: center; padding: 12px 16px; gap: 10px; }
.cc-drop.compact i { font-size: 20px; }
.cc-drop.compact small { display: none; }
.cc-up-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; margin-top: 14px; align-items: start; }
.cc-up-panel { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; min-width: 0; }
.cc-up-panel > header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.cc-up-panel > header b { color: var(--primary); }
.cc-up-panel > header small { color: var(--muted); font-size: 12.5px; }
.cc-up-panel > header .cc-spacer { flex: 1; }
.cc-up-panel > header .cc-btn { white-space: nowrap; }
.cc-step { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; }
.cc-up-meta { background: #f7f9fd; display: flex; flex-direction: column; gap: 12px; padding-bottom: 14px; }
.cc-up-meta > header { background: #fff; border-radius: var(--radius) var(--radius) 0 0; }
.cc-up-meta > .cc-field { padding: 0 14px; }
.cc-up-meta .cc-field > span small { font-weight: 400; }
.cc-up-meta input, .cc-up-meta textarea { width: 100%; }
.cc-up-submit { margin: 2px 14px 0; padding: 10px 14px; font-size: 15px; }
.cc-up-list { display: flex; flex-direction: column; max-height: 420px; overflow-y: auto; }
.cc-up-list:empty { display: none; }
.cc-up-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fff; }
.cc-up-item:last-child { border-bottom: 0; border-radius: 0 0 var(--radius) var(--radius); }
@media (max-width: 1199px) {
  .cc-up-wrap { grid-template-columns: 1fr; }
}
.cc-up-item > i { font-size: 20px; color: var(--primary); width: 22px; text-align: center; }
.cc-up-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cc-up-status { font-size: 12.5px; color: var(--muted); }
.cc-up-item.done { background: var(--ok-bg); }
.cc-up-item.done .cc-up-status { color: var(--ok); }
.cc-up-item.error { background: var(--bad-bg); }
.cc-up-item.error .cc-up-status { color: var(--bad); }
.cc-progress { height: 5px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 5px; }
.cc-progress span { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.cc-overlay { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(8, 26, 71, .45); animation: pop .15s; }
.cc-overlay-box { width: min(380px, 100%); display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; background: #fff; border-radius: 14px; padding: 26px 24px 20px; box-shadow: 0 24px 60px -20px rgba(0,0,0,.45); }
.cc-overlay-box .cc-spin { width: 44px; height: 44px; border-width: 4px; margin: 0 0 4px; border-top-color: var(--accent); }
.cc-overlay-box b { color: var(--primary); font-size: 15px; }
.cc-overlay-box .cc-progress { width: 100%; height: 8px; margin: 0; }
.cc-overlay-box small { color: var(--muted); font-size: 12.5px; }
.cc-fname { display: flex; gap: 10px; align-items: flex-start; min-width: 220px; }
.cc-fname > i { font-size: 20px; color: var(--primary); margin-top: 2px; width: 20px; text-align: center; }
.cc-fname b { overflow-wrap: anywhere; }
.cc-fname .fa-file-pdf { color: #d63031; } .cc-fname .fa-file-word { color: #2563eb; }
.cc-fname .fa-file-excel { color: #0f9d6b; } .cc-fname .fa-file-powerpoint { color: #e0790c; }
.audit-detail { font-size: 13px; line-height: 1.5; min-width: 320px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .cc-grid.two, .cc-grid.half { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .cc-app { grid-template-columns: 1fr; }
  .cc-side { position: fixed; left: 0; top: 0; bottom: 0; width: 250px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .cc-app.nav-open .cc-side { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.4); }
  .cc-menu-btn { display: inline-flex; }
  .cc-content { padding: 14px 12px 30px; }
  .cc-top { padding: 10px 12px; }
  .cc-clock { display: none; }
  .ts td.name { min-width: 110px; max-width: 130px; }
  .ts .sticky { padding: 4px 6px; }
  .ts td.code { width: 46px; min-width: 46px; }
  .ts .sticky2 { left: 46px; }
}

@media print {
  .cc-side, .cc-top, .cc-toolbar, .ts-legend, .no-print { display: none !important; }
  .cc-app { display: block; }
  .cc-content { padding: 0; }
  .ts-wrap { max-height: none; overflow: visible; border: 0; }
  .ts { font-size: 9px; }
  .ts td.day { width: auto; min-width: 0; height: 22px; }
  .cc-card { box-shadow: none; border: 0; padding: 0; }
  .print-title { display: block !important; }
}
.print-title { display: none; text-align: center; margin-bottom: 8px; }
