:root {
  --pri: #15a34a; --pri-d: #0f7a37; --pri-l: #e8f7ee; --pri-ll: #f3fbf6;
  --side: #0f5132; --side-2: #136c42; --side-t: #d8f3e3;
  --bg: #f3f5f7; --card: #fff; --line: #e5e8ec; --line-2: #eef1f4;
  --tx: #1d2530; --tx-2: #5b6574; --tx-3: #8b95a3;
  --red: #e5484d; --red-l: #fdecec; --orange: #f59e0b; --orange-l: #fff6e0;
  --blue: #2f7de1; --blue-l: #e9f2fd; --violet: #7c5ce0; --violet-l: #f1edfd;
  --r: 10px; --sh: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --sh-lg: 0 12px 40px rgba(16, 24, 40, .18);
  --side-w: 248px; --top-h: 58px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.5 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--tx); background: var(--bg); -webkit-font-smoothing: antialiased;
}
a { color: var(--pri-d); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
.hide { display: none !important; }
.muted { color: var(--tx-3); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
svg { flex: none; }
.right { text-align: right; }
.center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.gap-s { gap: 6px; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }

/* ---------- Khung ---------- */
.layout { display: flex; min-height: 100vh; }
.side {
  width: var(--side-w); flex: none; background: linear-gradient(180deg, var(--side), #0b3f27);
  color: var(--side-t); position: fixed; inset: 0 auto 0 0; z-index: 40; display: flex; flex-direction: column;
  transition: transform .25s ease;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 14px 16px; height: var(--top-h); border-bottom: 1px solid rgba(255, 255, 255, .08); }
.side-brand .logo { width: 34px; height: 34px; border-radius: 9px; background: #fff; display: grid; place-items: center; color: var(--pri); font-weight: 800; overflow: hidden; flex: none; }
.side-brand .logo img { width: 100%; height: 100%; object-fit: cover; }
.side-brand b { color: #fff; font-size: 15px; line-height: 1.2; display: block; }
.side-brand span { font-size: 11.5px; opacity: .7; }
.side-nav { overflow-y: auto; padding: 8px 8px 24px; flex: 1; }
.side-nav::-webkit-scrollbar { width: 6px; }
.side-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .15); border-radius: 3px; }
.nav-g > .nav-h, .nav-a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--side-t);
  cursor: pointer; user-select: none; font-weight: 500; text-decoration: none !important;
}
.nav-g > .nav-h:hover, .nav-a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-a.on { background: var(--pri); color: #fff; }
.nav-ic { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav-h .chev { margin-left: auto; transition: transform .2s; opacity: .6; width: 14px; height: 14px; }
.nav-g.open > .nav-h .chev { transform: rotate(180deg); }
.nav-sub { display: none; padding: 2px 0 4px 18px; }
.nav-g.open > .nav-sub { display: block; }
.nav-sub .nav-a { font-weight: 400; padding: 7px 12px; font-size: 13.5px; }
.nav-sub .nav-t { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; opacity: .5; padding: 8px 12px 2px; }
.nav-sep { height: 1px; background: rgba(255, 255, 255, .08); margin: 8px 6px; }

.main { flex: 1; margin-left: var(--side-w); min-width: 0; display: flex; flex-direction: column; }
.top {
  height: var(--top-h); background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center;
  gap: 12px; padding: 0 20px; position: sticky; top: 0; z-index: 30;
}
.top .burger { display: none; }
.top-title { font-weight: 600; font-size: 15px; }
.top-sp { flex: 1; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--violet); color: #fff; display: grid; place-items: center;
  font-weight: 700; flex: none; overflow: hidden; font-size: 14px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.avatar.lg { width: 72px; height: 72px; font-size: 26px; }
.user-chip { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px; border-radius: 10px; }
.user-chip:hover { background: var(--bg); }
.user-chip .nm { font-weight: 500; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { padding: 20px; max-width: 1480px; width: 100%; margin: 0 auto; }
.crumb { color: var(--tx-3); font-size: 13px; margin-bottom: 4px; }
.page-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-h h1 { font-size: 22px; font-weight: 700; }
.page-h .sp { flex: 1; }
.scrim { display: none; }
.demo-bar { background: #fff4d6; color: #7a5200; font-size: 12.5px; padding: 6px 20px; text-align: center; border-bottom: 1px solid #f3dd9c; }

/* ---------- Thẻ, nút, form ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); }
.card-b { padding: 18px; }
.card-h { padding: 14px 18px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-h h3 { font-size: 15.5px; font-weight: 600; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px;
  border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 500;
  white-space: nowrap; transition: background .15s, border-color .15s, color .15s; text-decoration: none !important; color: var(--tx);
}
.btn:hover { border-color: var(--pri); color: var(--pri-d); }
.btn svg { width: 16px; height: 16px; }
.btn.pri { background: var(--pri); border-color: var(--pri); color: #fff; }
.btn.pri:hover { background: var(--pri-d); border-color: var(--pri-d); color: #fff; }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red); background: var(--red-l); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--bg); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 12.5px; border-radius: 6px; }
.btn.icon { width: 34px; padding: 0; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.block { width: 100%; }

.f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.f > label { font-size: 13px; font-weight: 500; color: var(--tx-2); }
.f > label .req { color: var(--red); }
.f .hint { font-size: 12px; color: var(--tx-3); }
.inp, select.inp, textarea.inp {
  height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; width: 100%;
  outline: none; transition: border-color .15s, box-shadow .15s; min-width: 0;
}
textarea.inp { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; }
.inp:focus { border-color: var(--pri); box-shadow: 0 0 0 3px rgba(21, 163, 74, .14); }
.inp.sm { height: 32px; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.chk { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.chk input { width: 16px; height: 16px; accent-color: var(--pri); }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cfd5dc; border-radius: 22px; cursor: pointer; transition: .2s; }
.switch span::after { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--pri); }
.switch input:checked + span::after { transform: translateX(16px); }
.multi { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; min-height: 38px; max-height: 160px; overflow: auto; }
.multi label { display: inline-flex; gap: 5px; align-items: center; background: var(--bg); border-radius: 6px; padding: 3px 8px; font-size: 13px; cursor: pointer; }
.multi input { accent-color: var(--pri); }

/* ---------- Bộ lọc, bảng ---------- */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.toolbar .inp { width: auto; min-width: 150px; height: 34px; }
.toolbar .search { min-width: 220px; flex: 1; max-width: 340px; }
.tbl-wrap { overflow: auto; max-width: 100%; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left; font-weight: 600; color: var(--tx-2); background: #f8fafb; padding: 10px 12px; white-space: nowrap;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; font-size: 13px;
}
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:hover td { background: #fafcfb; }
.tbl tr.click { cursor: pointer; }
.tbl .acts { white-space: nowrap; text-align: right; width: 1%; }
.tbl .acts .btn { margin-left: 4px; }
.empty { padding: 40px 16px; text-align: center; color: var(--tx-3); }
.empty svg { width: 44px; height: 44px; opacity: .35; display: block; margin: 0 auto 8px; }
.pager { display: flex; gap: 6px; align-items: center; justify-content: flex-end; padding: 10px 14px; color: var(--tx-2); font-size: 13px; flex-wrap: wrap; }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 500; background: var(--line-2); color: var(--tx-2); white-space: nowrap; }
.tag.green { background: var(--pri-l); color: var(--pri-d); }
.tag.red { background: var(--red-l); color: #c22b30; }
.tag.orange { background: var(--orange-l); color: #a86a00; }
.tag.blue { background: var(--blue-l); color: #1e5fb4; }
.tag.violet { background: var(--violet-l); color: #5b3fc0; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 14px; color: var(--tx-2); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; text-decoration: none !important; }
.tabs a:hover { color: var(--pri-d); }
.tabs a.on { color: var(--pri-d); border-bottom-color: var(--pri); }

/* ---------- Thống kê ---------- */
.stat { padding: 16px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.stat .ic { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.stat .ic svg { width: 22px; height: 22px; }
.stat .v { font-size: 24px; font-weight: 700; line-height: 1.1; }
.stat .l { color: var(--tx-2); font-size: 13px; }
.c-green { background: var(--pri-l); color: var(--pri-d); }
.c-red { background: var(--red-l); color: var(--red); }
.c-orange { background: var(--orange-l); color: #c27c00; }
.c-blue { background: var(--blue-l); color: var(--blue); }
.c-violet { background: var(--violet-l); color: var(--violet); }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 50px; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .track { height: 10px; border-radius: 6px; background: var(--line-2); overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--pri); border-radius: 6px; }
.chart { width: 100%; height: 220px; }

/* ---------- Modal, toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 32, .45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; animation: fade .15s; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 640px; box-shadow: var(--sh-lg); animation: pop .18s ease; }
.modal.lg { max-width: 900px; }
.modal.sm { max-width: 440px; }
.modal-h { padding: 16px 20px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; }
.modal-h h3 { font-size: 16px; font-weight: 600; flex: 1; }
.modal-b { padding: 18px 20px; }
.modal-f { padding: 12px 20px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
.toast { background: #1d2530; color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: var(--sh-lg); font-size: 13.5px; animation: pop .2s; max-width: 380px; }
.toast.ok { background: var(--pri-d); }
.toast.err { background: #b42318; }
.spin { width: 18px; height: 18px; border: 2px solid rgba(0, 0, 0, .12); border-top-color: var(--pri); border-radius: 50%; animation: rot .7s linear infinite; display: inline-block; }
.btn .spin { width: 14px; height: 14px; vertical-align: -2px; margin-right: 6px; }
.btn.pri .spin { border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
@keyframes rot { to { transform: rotate(360deg); } }
.loading { padding: 60px; display: grid; place-items: center; }

/* ---------- Đăng nhập ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-l { background: linear-gradient(150deg, #15a34a, #0b5a30); color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 48px; position: relative; overflow: hidden; }
.auth-l::after { content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%; border: 70px solid rgba(255, 255, 255, .06); right: -200px; bottom: -200px; }
.auth-l h1 { font-size: 38px; font-weight: 800; letter-spacing: -.02em; }
.auth-l p { opacity: .85; font-size: 16px; max-width: 420px; }
.auth-l ul { padding-left: 18px; opacity: .9; line-height: 1.9; }
.auth-r { display: flex; align-items: center; justify-content: center; padding: 32px 20px; background: #fff; }
.auth-box { width: 100%; max-width: 380px; }
.auth-box h2 { font-size: 22px; margin-bottom: 6px; }

/* ---------- Màn hình chấm công nhân viên ---------- */
.ck-hero { background: linear-gradient(140deg, #15a34a, #0e6e37); color: #fff; border-radius: 16px; padding: 22px; position: relative; overflow: hidden; }
.ck-hero .clock { font-size: 44px; font-weight: 800; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.ck-hero .date { opacity: .85; margin-top: 4px; }
.ck-btn {
  width: 168px; height: 168px; border-radius: 50%; border: 0; background: #fff; color: var(--pri-d); font-weight: 700;
  font-size: 17px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  box-shadow: 0 0 0 10px rgba(255, 255, 255, .18), 0 0 0 22px rgba(255, 255, 255, .08); margin: 26px auto 10px; transition: transform .15s;
}
.ck-btn:active { transform: scale(.96); }
.ck-btn svg { width: 40px; height: 40px; }
.ck-btn.out { color: #c2410c; }
.ck-meta { display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; font-size: 13px; opacity: .92; }
.ck-meta b { display: block; font-size: 16px; }
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.tl-item:last-child { border-bottom: 0; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--pri); margin-top: 6px; flex: none; }
.tl-dot.out { background: var(--orange); }
.greet { background: var(--pri-ll); border: 1px dashed #9edcb5; border-radius: 12px; padding: 12px 14px; color: var(--pri-d); }

/* ---------- Bảng công ---------- */
.ts td, .ts th { padding: 6px 6px; text-align: center; font-size: 12.5px; }
.ts th.nm, .ts td.nm { text-align: left; position: sticky; left: 0; background: #fff; z-index: 2; min-width: 170px; border-right: 1px solid var(--line); }
.ts th.nm { background: #f8fafb; z-index: 3; }
.ts th.we { color: var(--red); }
.ts th.today { background: var(--pri-l); color: var(--pri-d); }
.cell { display: inline-flex; min-width: 30px; height: 24px; align-items: center; justify-content: center; border-radius: 5px; font-weight: 600; font-size: 11.5px; padding: 0 4px; cursor: default; }
.cell.X { background: var(--pri-l); color: var(--pri-d); }
.cell.M, .cell.S, .cell.MS { background: var(--orange-l); color: #a86a00; }
.cell.V, .cell.KR { background: var(--red-l); color: #c22b30; }
.cell.P, .cell.L, .cell.CT, .cell.WFH { background: var(--blue-l); color: #1e5fb4; }
.cell.KL { background: var(--violet-l); color: #5b3fc0; }
.cell.OFF { color: var(--tx-3); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--tx-2); }

/* ---------- Lịch tuần (phòng họp / lịch làm việc) ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 8px; }
.day-col { background: #fff; border: 1px solid var(--line); border-radius: 10px; min-height: 160px; display: flex; flex-direction: column; }
.day-col .dh { padding: 8px 10px; border-bottom: 1px solid var(--line-2); font-weight: 600; font-size: 13px; display: flex; justify-content: space-between; }
.day-col.today .dh { color: var(--pri-d); background: var(--pri-ll); border-radius: 10px 10px 0 0; }
.day-col .db { padding: 6px; display: flex; flex-direction: column; gap: 6px; }
.ev { background: var(--blue-l); border-left: 3px solid var(--blue); border-radius: 6px; padding: 5px 7px; font-size: 12.5px; cursor: pointer; }
.ev b { display: block; font-size: 12.5px; }

/* ---------- Cây nhân sự ---------- */
.org { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.org > *, .grid > *, .col > * { min-width: 0; }
.tree { padding: 8px; }
.tree-n { display: flex; align-items: center; gap: 6px; padding: 7px 8px; border-radius: 7px; cursor: pointer; }
.tree-n:hover { background: var(--bg); }
.tree-n.on { background: var(--pri-l); color: var(--pri-d); font-weight: 600; }
.tree-n .cnt { margin-left: auto; font-size: 12px; color: var(--tx-3); }
.tree-c { padding-left: 16px; border-left: 1px dashed var(--line); margin-left: 12px; }

/* ---------- Bản tin ---------- */
.post { padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.post:last-child { border-bottom: 0; }
.post-c { white-space: pre-wrap; margin-top: 10px; }
.post img.ph { border-radius: 10px; margin-top: 10px; max-height: 360px; object-fit: cover; }

/* ---------- Kiosk QR ---------- */
.kiosk { min-height: 100vh; background: linear-gradient(150deg, #15a34a, #0b5a30); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; gap: 14px; }
.kiosk .qr { background: #fff; padding: 18px; border-radius: 18px; box-shadow: var(--sh-lg); }
.kiosk .qr canvas, .kiosk .qr img { display: block; width: min(70vw, 340px) !important; height: auto !important; }
.kiosk .clock { font-size: 56px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.kiosk .bar { width: min(70vw, 376px); height: 6px; background: rgba(255, 255, 255, .25); border-radius: 4px; overflow: hidden; }
.kiosk .bar i { display: block; height: 100%; background: #fff; transition: width 1s linear; }

/* ---------- Thanh dưới cho nhân viên trên điện thoại ---------- */
.bottom-nav { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .side { transform: translateX(-100%); box-shadow: var(--sh-lg); }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 35; }
  .main { margin-left: 0; }
  .top .burger { display: inline-flex; }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .org { grid-template-columns: 1fr; }
  .week { grid-template-columns: repeat(7, minmax(130px, 1fr)); overflow-x: auto; }
}
@media (max-width: 768px) {
  .content { padding: 14px 12px 90px; }
  .top { padding: 0 12px; }
  .user-chip .nm { display: none; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .page-h h1 { font-size: 19px; }
  .auth { grid-template-columns: 1fr; }
  .auth-l { padding: 28px 22px; min-height: auto; }
  .auth-l h1 { font-size: 28px; }
  .auth-l ul { display: none; }
  .toolbar .inp, .toolbar .search { min-width: 0; flex: 1 1 140px; max-width: none; }
  .modal-bg { padding: 0; align-items: flex-end; }
  .modal { border-radius: 16px 16px 0 0; max-height: 92vh; display: flex; flex-direction: column; }
  .modal-b { overflow-y: auto; }
  .bar-row { grid-template-columns: 100px 1fr 40px; }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); z-index: 30;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--tx-3); padding: 6px 0; text-decoration: none !important; }
  .bottom-nav a svg { width: 22px; height: 22px; }
  .bottom-nav a.on { color: var(--pri-d); }
  .ck-hero .clock { font-size: 38px; }
}
@media (max-width: 420px) {
  .g4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 12px; gap: 10px; }
  .stat .v { font-size: 20px; }
  .stat .ic { width: 36px; height: 36px; }
}
@media print {
  .side, .top, .bottom-nav, .toolbar, .no-print, .demo-bar { display: none !important; }
  .main { margin: 0; }
  body { background: #fff; }
  /* đang mở hộp thoại (phiếu lương, QR): chỉ in nội dung hộp thoại */
  body:has(.modal-bg) #app, body:has(.modal-bg) .toasts { display: none !important; }
  .modal-bg { position: static; overflow: visible; padding: 0; background: none; animation: none; }
  .modal { max-width: none !important; max-height: none !important; box-shadow: none; border-radius: 0; }
  .modal-b { overflow: visible !important; }
  .modal-f, .modal-h button { display: none !important; }
}
