/* ============ Tokens — theo QuyChuan_GiaoDien.html (mục 01, 19) ============ */
:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --line: #e1e6ee;
  --text: #1f2937;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-2: #1d4ed8;
  --primary-soft: #e8effd;
  --on-primary: #ffffff;
  --brand: #0f2447;
  --brand-2: #1d4ed8;
  --side: #0f2447;
  --side-accent: #60a5fa;
  --hero-a: #1e40af;
  --hero-b: #2563eb;
  --seg-bg: #e6ebf3;
  --seg-on: #ffffff;
  --gold: #d4af6a;
  --gold-2: #e8c887;
  --good: #15803d;
  --good-soft: #e7f6ec;
  --bad: #dc2626;
  --bad-soft: #fdecec;
  --warn: #b45309;
  --warn-soft: #fdf2e0;
  --c1: #2563eb;                /* biểu đồ: vào làm */
  --c2: #b07d2a;                /* biểu đồ: nghỉ việc (cặp đã kiểm tra mù màu) */
  --shadow: 0 1px 2px rgba(15, 36, 71, .05), 0 6px 20px -10px rgba(15, 36, 71, .16);
  --shadow-lg: 0 10px 28px -8px rgba(15, 36, 71, .2);
  --focus: rgba(37, 99, 235, .22);
  --cta-shadow: rgba(37, 99, 235, .45);
  --r: 14px;
  --r-sm: 10px;
  --tabbar: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c2230; --surface: #252c3b; --surface-2: #2e3647; --line: #353e52; --text: #dfe4ec; --muted: #9aa6b8;
    --primary: #6ea8fe; --primary-2: #8fbcff; --primary-soft: rgba(110, 168, 254, .16); --on-primary: #0b1426;
    --brand: #151a24; --brand-2: #2a4a8a; --side: #151a24; --side-accent: #6ea8fe; --hero-a: #22417a; --hero-b: #2c58a3;
    --seg-bg: #151a24; --seg-on: #343d51;
    --good: #5fd08f; --good-soft: rgba(95, 208, 143, .14); --bad: #f47a7a; --bad-soft: rgba(244, 122, 122, .14);
    --warn: #e8b15a; --warn-soft: rgba(232, 177, 90, .14);
    --c1: #3d7fe6; --c2: #b0812c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 6px 18px -10px rgba(0, 0, 0, .45);
    --shadow-lg: 0 12px 30px -8px rgba(0, 0, 0, .5);
    --focus: rgba(110, 168, 254, .3); --cta-shadow: rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1c2230; --surface: #252c3b; --surface-2: #2e3647; --line: #353e52; --text: #dfe4ec; --muted: #9aa6b8;
  --primary: #6ea8fe; --primary-2: #8fbcff; --primary-soft: rgba(110, 168, 254, .16); --on-primary: #0b1426;
  --brand: #151a24; --brand-2: #2a4a8a; --side: #151a24; --side-accent: #6ea8fe; --hero-a: #22417a; --hero-b: #2c58a3;
  --seg-bg: #151a24; --seg-on: #343d51;
  --good: #5fd08f; --good-soft: rgba(95, 208, 143, .14); --bad: #f47a7a; --bad-soft: rgba(244, 122, 122, .14);
  --warn: #e8b15a; --warn-soft: rgba(232, 177, 90, .14);
  --c1: #3d7fe6; --c2: #b0812c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 6px 18px -10px rgba(0, 0, 0, .45);
  --shadow-lg: 0 12px 30px -8px rgba(0, 0, 0, .5);
  --focus: rgba(110, 168, 254, .3); --cta-shadow: rgba(0, 0, 0, .45);
  color-scheme: dark;
}

/* ============ Base ============ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.noscroll { overflow: hidden; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.45rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
a { color: var(--primary); text-decoration: none; }
button { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.grow { flex: 1; min-width: 0; }
.neg { color: var(--bad) !important; }
.pos { color: var(--good); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cn { color: var(--muted); font-size: .85em; font-weight: 400; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ============ Shell ============ */
.app { min-height: 100vh; }
.side { display: none; }
.main { padding-bottom: calc(var(--tabbar) + 90px + env(safe-area-inset-bottom)); }
.page { max-width: 1120px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.page-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-h p { margin: 2px 0 0; font-size: .88rem; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tabbar a, .tabbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: .7rem; font-weight: 500; background: none; border: 0; cursor: pointer;
}
.tabbar .t-ic { font-size: 1.15rem; line-height: 1; filter: grayscale(.4); }
.tabbar .on { color: var(--primary); }
.tabbar .on .t-ic { filter: none; }
@media (min-width: 900px) {
  .side {
    display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: 236px; z-index: 20;
    background: var(--side); color: #fff; padding: 18px 10px 12px; overflow-y: auto; box-shadow: inset -1px 0 0 rgba(255, 255, 255, .06);
  }
  .main { margin-left: 236px; padding-bottom: 90px; }
  .tabbar { display: none; }
  .page { padding: 28px 32px; }
  h1 { font-size: 1.6rem; }
}
.side > * { flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand b { display: block; font-size: 1.05rem; }
.brand small { color: rgba(255, 255, 255, .6); font-size: .78rem; }
.logo { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--primary); color: var(--on-primary); flex-shrink: 0; }
.side .logo { background: rgba(96, 165, 250, .16); border: 1px solid rgba(96, 165, 250, .45); color: #bfdbfe; }
.side nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.side nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm);
  color: rgba(255, 255, 255, .68); font-weight: 500; transition: background .15s, color .15s, transform .15s;
}
.side nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; transform: translateX(2px); }
.side nav a.on { background: rgba(255, 255, 255, .13); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--side-accent); }
.side-sep { height: 1px; background: rgba(255, 255, 255, .08); margin: 6px 10px; }
.side-foot { display: flex; flex-direction: column; gap: 8px; padding: 0 2px; }
.side-foot .who { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 2px 6px; }
.side-foot small { color: rgba(255, 255, 255, .55); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .74rem; }

/* Thẻ quảng bá — ghim đáy menu, dạng gọn 1 hàng (mục 04, 17) */
@keyframes promoGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 106, 0); } 50% { box-shadow: 0 0 16px 2px rgba(212, 175, 106, .28); } }
@keyframes promoBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
.promo-card {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 7px;
  margin: auto 6px 6px; padding: 14px 12px 12px; border-radius: 14px; text-decoration: none;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .14); border-top: 2px solid var(--gold);
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
  animation: promoGlow 2.8s ease-in-out infinite;
}
.promo-card:hover { transform: translateY(-3px); background: rgba(255, 255, 255, .09); border-color: rgba(212, 175, 106, .55); }
.promo-card-icon {
  width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 14px; background: rgba(212, 175, 106, .16); border: 1px solid rgba(212, 175, 106, .45);
  animation: promoBounce 2.4s ease-in-out infinite;
}
.promo-card-text { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.promo-card-text strong { font-size: 11px; font-weight: 700; color: rgba(255, 255, 255, .95); line-height: 1.4; }
.promo-card-text span { font-size: 11px; font-weight: 800; color: var(--gold-2); white-space: nowrap; }
.promo-card.on-light { background: var(--side); margin: 4px 0 0; }
.side .promo-card { flex-direction: row; text-align: left; gap: 8px; padding: 8px 8px; margin: auto 2px 6px; }
.side .promo-card-icon { width: 26px; height: 26px; font-size: 12px; flex: none; }
.side .promo-card-text { align-items: flex-start; gap: 1px; }
.side .promo-card-text strong { font-size: 9.5px; line-height: 1.3; white-space: nowrap; letter-spacing: -.1px; }
.side .promo-card-text span { font-size: 10.5px; }
.theme-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0 6px; padding: 8px;
  border: 0; border-radius: 8px; background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .8);
  font-size: .78rem; font-weight: 500; cursor: pointer; transition: background .15s;
}
.theme-btn:hover { background: rgba(255, 255, 255, .14); color: #fff; }

/* ============ Controls ============ */
.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);
  background: var(--surface); color: var(--text); font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s, transform .12s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-2); box-shadow: 0 6px 16px -4px var(--cta-shadow); transform: translateY(-1px); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--primary); }
.btn.ghost:hover { background: var(--primary-soft); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger-solid:hover { filter: brightness(1.08); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: .88rem; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: transparent; color: var(--muted); cursor: pointer; flex-shrink: 0;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.inp {
  width: 100%; min-height: 44px; padding: 9px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.inp:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); }
.fld { display: flex; flex-direction: column; gap: 5px; }
.fld > span { font-size: .82rem; font-weight: 500; color: var(--muted); }
/* Ô chọn có gợi ý (combo — mục 06) */
.combo-wrap { position: relative; flex: 1; min-width: 200px; }
.combo-wrap .inp { padding-right: 36px; }
.combo-wrap .clear { position: absolute; right: 4px; top: 22px; transform: translateY(-50%); border: 0; background: none; color: var(--muted); width: 34px; height: 34px; cursor: pointer; border-radius: 50%; }
.combo-wrap .clear:hover { background: var(--surface-2); color: var(--text); }
.combo-list {
  position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px;
  list-style: none; max-height: 260px; overflow: auto; min-width: 200px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow-lg);
}
.combo-list li { padding: 9px 12px; border-radius: 8px; cursor: pointer; color: var(--text); }
.combo-list li b { color: var(--primary); }
.combo-list li small { display: block; color: var(--muted); font-size: .78rem; }
.combo-list li:hover, .combo-list li.hi { background: var(--primary-soft); }
.combo-list li.new { color: var(--primary); font-weight: 600; border-top: 1px solid var(--line); margin-top: 2px; }
.combo-list li.none { color: var(--muted); cursor: default; }
.fld .hint:empty { display: none; }
.fld .hint { margin: 0; font-size: .8rem; color: var(--primary); }
.search { position: relative; display: flex; align-items: center; flex: 1; min-width: 180px; }
.search .s-ic { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search .inp { padding-left: 36px; }
.seg { display: inline-flex; background: var(--seg-bg); border-radius: 12px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button {
  border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; font-weight: 500; font-size: .9rem;
  color: var(--muted); cursor: pointer; white-space: nowrap; min-height: 38px;
}
.seg button.on { background: var(--seg-on); color: var(--primary); font-weight: 600; box-shadow: var(--shadow); }
.seg button .cnt { font-size: .78rem; opacity: .8; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  border: 1px solid var(--line); background: var(--surface); padding: 7px 14px; border-radius: 99px;
  font-size: .85rem; font-weight: 500; white-space: nowrap; cursor: pointer; color: var(--muted);
}
.chip.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.badge { display: inline-flex; align-items: center; gap: 3px; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--good-soft); color: var(--good); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--primary-soft); color: var(--primary); }

/* Nút Excel nhỏ (mục 12) */
.xls-mini { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 11px 0 8px; border-radius: 999px;
  border: 0; background: linear-gradient(180deg, #2a8a55, #217346); color: #fff; font: inherit; font-size: .78rem; font-weight: 700; letter-spacing: .2px;
  cursor: pointer; box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 2px 6px -2px rgba(33, 115, 70, .6); transition: transform .15s, box-shadow .15s, filter .15s; }
.xls-mini:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 6px 14px -4px rgba(33, 115, 70, .7); }
.xls-mini:active { transform: none; }
.xls-mini:disabled { opacity: .75; cursor: wait; }
.xls-mini .spin.sm { width: 14px; height: 14px; border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }

/* Thanh chọn kỳ: Tuần / Tháng / Quý / Năm + ‹ kỳ › + Excel */
.pbar { display: flex; flex-direction: column; gap: 10px; }
.pbar-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pnav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.pnav .icon-btn { width: 38px; height: 38px; border: 1px solid var(--line); background: var(--surface); font-size: 1.2rem; }
.pnav .icon-btn:disabled { opacity: .4; cursor: default; }
.plabel { flex: 1; min-width: 0; text-align: center; display: flex; flex-direction: column; line-height: 1.2; }
.plabel b { font-size: 1rem; }
.plabel small { color: var(--muted); font-size: .78rem; }
.ptoday { font-size: .8rem; }
@media (min-width: 900px) {
  .pbar { flex-direction: row; align-items: center; justify-content: space-between; }
  .pnav { flex: none; }
  .plabel { min-width: 210px; }
}

/* ============ Cards, KPI, bảng ============ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card-h p { margin: 2px 0 0; }
.grid2 { display: grid; gap: 14px; }
@media (min-width: 1000px) { .grid2 { grid-template-columns: 1.15fr 1fr; align-items: start; } }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; text-align: left; font: inherit;
  display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); color: var(--text); min-width: 0;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.kpi > span { font-size: .8rem; color: var(--muted); font-weight: 500; }
.kpi b { font-size: clamp(1.25rem, 5vw, 1.6rem); font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi > small { font-size: .74rem; color: var(--muted); }
.kpi:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.kpi.link { cursor: pointer; }
.kpi.link:hover { border-color: var(--primary); }
.kpi.hero {
  grid-column: 1 / -1; position: relative; overflow: hidden; border-color: transparent; color: #fff;
  background: linear-gradient(135deg, var(--hero-a) 0%, var(--hero-b) 100%); box-shadow: var(--shadow-lg);
}
.kpi.hero::before, .kpi.hero::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .08); pointer-events: none; }
.kpi.hero::before { width: 160px; height: 160px; top: -70px; right: -50px; }
.kpi.hero::after { width: 110px; height: 110px; bottom: -60px; left: -30px; background: rgba(255, 255, 255, .06); }
.kpi.hero > * { position: relative; }
.kpi.hero > span, .kpi.hero > small { color: inherit; opacity: .9; }
.kpi.hero b { font-size: 2rem; }
.kpi .k-c1 { color: var(--c1); }
.kpi .k-c2 { color: var(--c2); }
.trend { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 99px; font-weight: 700; font-size: .74rem; background: rgba(255, 255, 255, .18); color: #fff; }
.trend.dn { background: rgba(0, 0, 0, .18); }
@media (min-width: 700px) {
  .kpis { grid-template-columns: 1.3fr 1fr 1fr 1fr; }
  .kpi.hero { grid-column: span 1; }
}
@media (max-width: 699px) { .kpis .kpi:last-child:nth-child(even) { grid-column: 1 / -1; } }

.tbl-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: bottom; }
.tbl th .cn { display: block; text-transform: none; letter-spacing: 0; font-size: .92em; }
.tbl td { padding: 9px 8px; border-bottom: 1px solid var(--line); }
.tbl .r { text-align: right; white-space: nowrap; }
.tbl .c { text-align: center; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl tr.sum-top td { font-weight: 700; background: var(--surface-2); border-bottom: 2px solid var(--line); }
.tbl tr.click { cursor: pointer; }
.tbl tbody tr.rin { animation: exfIn .3s ease both; animation-delay: calc(var(--i, 0) * 22ms); }
.tbl td.sticky, .tbl th.sticky { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.tbl tr.sum-top td.sticky { background: var(--surface-2); }
.tbl tbody tr:hover td.sticky { background: var(--surface-2); }
.tbl td .sub { display: block; font-size: .78rem; color: var(--muted); }
.mat th.r, .mat td.r { min-width: 64px; }
.mat tr.grp td { font-size: .74rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: transparent; padding-top: 16px; }
.mat td.cur, .mat th.cur { background: var(--primary-soft) !important; }
.v-in { color: var(--c1); font-weight: 600; }
.v-out { color: var(--c2); font-weight: 600; }
.zero { color: var(--muted); opacity: .6; }

/* Thanh tỉ lệ ngang (lý do nghỉ, kênh tuyển) */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; }
.bar-row .lb { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.bar-row .vl { font-weight: 700; font-variant-numeric: tabular-nums; font-size: .9rem; }
.bar-track { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: 99px; background: var(--c1); }
.bar-track i.c2 { background: var(--c2); }

/* ============ Biểu đồ (mục 07, 19) ============ */
.chart { position: relative; }
.chart svg { width: 100%; height: 230px; display: block; overflow: visible; }
.chart-tip { font-size: .85rem; min-height: 22px; display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; }
.chart .grid { stroke: var(--line); stroke-dasharray: 3 4; }
.chart text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart .bar.c1 { fill: var(--c1); }
.chart .bar.c2 { fill: var(--c2); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart g.col.hov .hit { fill: var(--surface-2); }
.chart.has-hov g.col:not(.hov) .bar { opacity: .78; }
.chart g.col.cur text.xl { fill: var(--primary); font-weight: 700; }
.chart .line { fill: none; stroke: var(--c1); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--c1); opacity: .1; }
.chart .dot { fill: var(--surface); stroke: var(--c1); stroke-width: 2; }
.chart g.col.hov .dot, .chart g.col.cur .dot { fill: var(--c1); }
.chart .vlab { fill: var(--text); font-weight: 600; font-size: 10.5px; }
.legend { display: flex; align-items: center; gap: 12px; font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legend i.c1 { background: var(--c1); } .legend i.c2 { background: var(--c2); }
.chart.grow .bar { transform-box: fill-box; transform-origin: 50% 100%; animation: barUp .75s cubic-bezier(.34, 1.25, .5, 1) both; animation-delay: calc(var(--i, 0) * 40ms); }
.chart.grow .line, .chart.grow .area, .chart.grow .dot, .chart.grow .vlab { animation: fade .6s ease both .15s; }
@keyframes barUp { from { transform: scaleY(0); } }

/* ============ Trạng thái ============ */
.spin { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--primary); animation: rot .8s linear infinite; }
.spin.sm { width: 16px; height: 16px; border-width: 2px; }
@keyframes rot { to { transform: rotate(360deg); } }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 46px 16px; color: var(--muted); text-align: center; }
.empty .e-ic { font-size: 40px; }
.empty p { margin: 0; }
.empty.sm { padding: 18px 8px; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-sm); background: var(--primary-soft); color: var(--text); font-size: .86rem; line-height: 1.5; }
.note.warn { background: var(--warn-soft); }
.note.warn b { color: var(--warn); }
.note p { margin: 0; }

/* ============ Trang Dữ liệu ============ */
.imp-head { display: flex; align-items: center; gap: 14px; }
.imp-num { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary); color: var(--on-primary); font-weight: 800; box-shadow: 0 6px 14px -6px var(--cta-shadow); }
.imp-head h3 { margin: 0; }
.imp-head p { margin: 2px 0 0; }
.imp-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 150px; padding: 20px;
  border: 2px dashed color-mix(in srgb, var(--primary) 40%, var(--line)); border-radius: 16px; cursor: pointer; text-align: center;
  background: color-mix(in srgb, var(--primary-soft) 45%, transparent); transition: background .2s, border-color .2s, transform .2s;
}
.imp-drop:hover { background: var(--primary-soft); border-color: var(--primary); }
.imp-drop.over { background: var(--primary-soft); border-color: var(--primary); transform: scale(1.015); }
.imp-drop.over .imp-ic { animation: impBounce .6s ease infinite; }
.imp-drop.busy { cursor: progress; pointer-events: none; }
.imp-ic { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--primary); box-shadow: var(--shadow); font-size: 26px; }
.imp-drop p { margin: 0; }
.imp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.imp-stats > div { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); animation: exfPop .3s ease both; }
.imp-stats > div:nth-child(2) { animation-delay: .05s; } .imp-stats > div:nth-child(3) { animation-delay: .1s; } .imp-stats > div:nth-child(4) { animation-delay: .15s; }
.imp-stats b { font-size: 1.4rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.imp-stats span { font-size: .78rem; color: var(--muted); }
.imp-stats .ok { background: var(--good-soft); } .imp-stats .ok b { color: var(--good); }
.imp-stats .err { background: var(--warn-soft); } .imp-stats .err b { color: var(--warn); }
.imp-stats .new { background: var(--primary-soft); } .imp-stats .new b { color: var(--primary); }
.imp-stats .skip { background: var(--surface-2); } .imp-stats .skip b { color: var(--muted); }
.file-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); font-size: .88rem; }
.file-line b { overflow-wrap: anywhere; }
.warn-list { margin: 0; padding-left: 18px; font-size: .86rem; display: flex; flex-direction: column; gap: 4px; }
@keyframes impBounce { 50% { transform: translateY(-6px); } }

/* ============ Hộp thoại kiểu mới + toast (mục 18) ============ */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(9, 18, 36, .55); backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center; animation: fade .18s; }
.sheet { width: 100%; max-height: 94vh; background: var(--surface); border-radius: 22px 22px 0 0; display: flex; flex-direction: column;
  box-shadow: 0 24px 60px -12px rgba(9, 18, 36, .45); animation: up .24s cubic-bezier(.2, .9, .3, 1.1); position: relative; overflow: hidden; }
.sheet::before { content: ''; position: absolute; top: 7px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 99px; background: var(--line); }
.sheet-h { display: flex; align-items: center; gap: 12px; padding: 20px 14px 14px 20px; border-bottom: 1px solid var(--line); }
.sheet-h h2 { font-size: 1.08rem; font-weight: 700; letter-spacing: -.01em; }
.sheet-sub { margin: 2px 0 0; font-size: .82rem; color: var(--muted); }
.sheet-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; background: var(--primary-soft); color: var(--primary); font-size: 18px; }
.sheet-ic.warn { background: var(--warn-soft); color: var(--warn); }
.sheet-ic.danger { background: var(--bad-soft); color: var(--bad); }
.sheet-ic.ok { background: var(--good-soft); color: var(--good); }
.sheet-b { padding: 18px 20px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.sheet-b > * { flex-shrink: 0; }
.sheet-f { display: flex; align-items: center; gap: 10px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--surface-2); }
.confirm-text { margin: 0; line-height: 1.6; }
.confirm-text + .confirm-text { margin-top: -6px; color: var(--muted); font-size: .9rem; }
@media (min-width: 700px) {
  .overlay { align-items: center; padding: 24px; }
  .sheet { width: 560px; border-radius: 18px; max-height: 88vh; animation: pop .2s cubic-bezier(.2, .9, .3, 1.2); }
  .sheet::before { display: none; }
  .sheet.small { width: 440px; }
  .sheet.small .sheet-h { border-bottom: 0; padding-bottom: 4px; }
  .sheet.small .sheet-b { padding-top: 8px; }
  .sheet.small .sheet-f { background: transparent; border-top: 0; padding-top: 4px; padding-bottom: 18px; }
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.97); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes exfIn { from { opacity: 0; transform: translateY(6px); } }
@keyframes exfPop { from { opacity: 0; transform: scale(.85); } }
.toasts { position: fixed; z-index: 100; left: 50%; transform: translateX(-50%); top: calc(12px + env(safe-area-inset-top));
  display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100% - 32px)); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; pointer-events: auto; background: var(--surface); color: var(--text);
  padding: 11px 10px 11px 12px; border-radius: 12px; border: 1px solid var(--line); border-left: 4px solid var(--good);
  box-shadow: var(--shadow-lg); font-weight: 500; font-size: .92rem; line-height: 1.45; animation: up .22s; }
.toast .grow { padding-top: 1px; }
.toast-ic { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; background: var(--good-soft); color: var(--good); font-size: 13px; font-weight: 800; }
.toast.err { border-left-color: var(--bad); }
.toast.err .toast-ic { background: var(--bad-soft); color: var(--bad); }
.toast-x { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.toast-x:hover { background: var(--surface-2); color: var(--text); }

/* Bảng "Thêm" trên điện thoại */
.menu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.menu-grid a, .menu-grid button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: .82rem; font-weight: 500; cursor: pointer; text-align: center;
  transition: transform .18s ease; }
.menu-grid a:hover, .menu-grid button:hover { transform: translateY(-3px); }
.menu-grid .m-ic { font-size: 22px; }

/* ============ Hiệu ứng trang (mục 07) ============ */
@keyframes gtFadeInDown { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes gtFadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes gtFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.page > :not(.fab):not(.overlay) { animation: gtFadeInUp .45s ease both; }
.page > :nth-child(2) { animation-delay: .04s; } .page > :nth-child(3) { animation-delay: .08s; }
.page > :nth-child(4) { animation-delay: .12s; } .page > :nth-child(5) { animation-delay: .16s; }
.page > :nth-child(n+6) { animation-delay: .2s; }
.page.still > * { animation: none !important; }
.kpis > .kpi { animation: gtFadeInUp .45s ease both; }
.kpis > .kpi:nth-child(2) { animation-delay: .06s; } .kpis > .kpi:nth-child(3) { animation-delay: .12s; }
.kpis > .kpi:nth-child(4) { animation-delay: .18s; } .kpis > .kpi:nth-child(5) { animation-delay: .24s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; animation-delay: 0s !important; }
}

/* ============ Trang Giới thiệu (mục 09) ============ */
.intro { --i-deep: #0f2447; --i-mid: #1f3b66; --i-ink: #1f3b66; --i-soft: #eef2f8; --i-soft-line: #dfe6f1; --i-gold: #b8893b; --i-gold-soft: #fbf4e6; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .intro { --i-deep: #1d2a44; --i-mid: #2b3d60; --i-ink: #c3cfe2; --i-soft: #2a3244; --i-soft-line: #39435a; --i-gold: #e3bd72; --i-gold-soft: rgba(227, 189, 114, .12); }
}
:root[data-theme="dark"] .intro { --i-deep: #1d2a44; --i-mid: #2b3d60; --i-ink: #c3cfe2; --i-soft: #2a3244; --i-soft-line: #39435a; --i-gold: #e3bd72; --i-gold-soft: rgba(227, 189, 114, .12); }
.page.intro { gap: 0; }
.page.intro > * { animation: none; }
.gt-hero { position: relative; overflow: hidden; border-radius: 22px; padding: 42px 24px 38px;
  background: linear-gradient(135deg, var(--i-deep) 0%, var(--i-mid) 100%); border-top: 3px solid var(--gold);
  color: #fff; text-align: center; margin-bottom: 20px; box-shadow: var(--shadow-lg); }
.page.intro > .gt-hero { animation: gtFadeInDown .55s ease both; }
.gt-hero::before, .gt-hero::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .06); }
.gt-hero::before { width: 240px; height: 240px; top: -100px; right: -70px; }
.gt-hero::after { width: 170px; height: 170px; bottom: -80px; left: -50px; background: rgba(212, 175, 106, .08); }
.gt-hero-icon { position: relative; font-size: 46px; display: inline-block; margin-bottom: 10px; animation: gtFloat 3s ease-in-out infinite; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .2)); }
.gt-hero-title { position: relative; margin: 0 0 10px; font-size: 27px; font-weight: 800; letter-spacing: -.01em; }
.gt-hero-sub { position: relative; margin: 0 auto; max-width: 580px; font-size: 14.5px; line-height: 1.6; color: rgba(255, 255, 255, .86); }
.gt-card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--i-mid); border-radius: 0 14px 14px 0; padding: 18px 20px; margin-bottom: 22px; box-shadow: var(--shadow); }
.page.intro > .gt-card, .page.intro > .gt-banner, .page.intro > .gt-cta, .page.intro > .gt-social-row { animation: gtFadeInUp .5s ease both; }
.gt-card p { margin: 0 0 12px; line-height: 1.75; font-size: 14px; }
.gt-card p:last-child { margin-bottom: 0; }
.gt-eyebrow { font-size: 11.5px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; margin-bottom: 4px; color: var(--i-gold); }
.gt-section-title { margin: 0 0 16px; font-size: 19px; font-weight: 800; }
.gt-exp-badge { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; margin-left: 4px; font-size: 11.5px; font-weight: 800; color: var(--i-gold); background: var(--i-gold-soft);
  border: 1px solid color-mix(in srgb, var(--i-gold) 40%, transparent); padding: 4px 11px; border-radius: 20px; }
.gt-feature-grid, .gt-service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-bottom: 24px; }
.gt-feature-card { display: flex; align-items: flex-start; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 15px 16px; box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; opacity: 0; animation: gtFadeInUp .5s ease both; }
.gt-feature-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--i-soft-line); }
.gt-feature-icon { flex-shrink: 0; width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: var(--i-soft); font-size: 18px; }
.gt-feature-text { font-size: 13.5px; line-height: 1.55; padding-top: 5px; }
.gt-banner { text-align: center; border-radius: 14px; padding: 16px 22px; font-size: 13.5px; line-height: 1.7; margin-bottom: 26px; background: var(--i-soft); color: var(--i-ink); border: 1px solid var(--i-soft-line); }
.gt-divider { height: 1px; background: linear-gradient(90deg, transparent, var(--line) 20%, var(--line) 80%, transparent); margin: 4px 0 26px; }
.gt-service-grid { gap: 12px; margin-bottom: 26px; }
.gt-service-card { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; font-size: 13.5px; font-weight: 600; color: var(--text);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; opacity: 0; animation: gtFadeInUp .5s ease both; }
.gt-service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--i-gold) 55%, transparent); }
.gt-service-icon { font-size: 17px; flex-shrink: 0; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--i-gold-soft); }
.gt-steps { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; max-width: 800px; margin: 0 auto 26px; }
.gt-step { display: flex; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--line); border-radius: 30px; padding: 7px 16px 7px 7px; font-size: 12.5px; font-weight: 700; opacity: 0; animation: gtFadeInUp .45s ease both; }
.gt-step-num { width: 25px; height: 25px; border-radius: 50%; background: var(--i-mid); color: #fff; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; }
.gt-step-arrow { color: var(--muted); font-size: 18px; font-weight: 800; }
.gt-cta { display: block; text-align: center; text-decoration: none; border-radius: 20px; padding: 30px 20px 26px; margin-bottom: 14px;
  background: linear-gradient(135deg, var(--i-deep) 0%, var(--i-mid) 100%); color: #fff; border-top: 3px solid var(--gold); box-shadow: var(--shadow-lg); transition: transform .18s ease, box-shadow .18s ease; }
.gt-cta:hover { transform: translateY(-4px); box-shadow: 0 16px 36px -10px rgba(15, 36, 71, .55); }
@keyframes gtPulseGold { 0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 106, .45); } 50% { box-shadow: 0 0 0 12px rgba(212, 175, 106, 0); } }
.gt-cta-ring { display: inline-flex; align-items: center; justify-content: center; width: 50px; height: 50px; border-radius: 50%; background: rgba(212, 175, 106, .16); border: 1px solid rgba(212, 175, 106, .5); margin-bottom: 12px; font-size: 23px; animation: gtPulseGold 1.8s ease-in-out infinite; }
.gt-cta-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: rgba(255, 255, 255, .8); margin-bottom: 6px; }
.gt-cta-phone { font-size: 27px; font-weight: 800; letter-spacing: .6px; color: var(--gold-2); }
.gt-social-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 4px 0 18px; }
.gt-social-btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-size: 13.5px; font-weight: 700; color: var(--i-ink); background: var(--surface); border: 1px solid var(--line); border-radius: 30px; padding: 10px 20px; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.gt-social-btn:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--i-gold) 55%, transparent); }
.gt-tagline { text-align: center; font-weight: 800; color: var(--i-ink); margin: 4px 0 0; font-size: 13.5px; }

/* ============ In ấn ============ */
/* ---------- Nhập trên app là chính: nút nổi "＋ Thêm …" (mục 06) — chỉ điện thoại; máy tính dùng nút đầu trang ---------- */
.fab {
  position: fixed; z-index: 25; right: 16px; bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 8px; height: 54px; padding: 0 22px 0 18px; border-radius: 27px;
  border: 0; background: var(--primary); color: var(--on-primary); font: inherit; font-weight: 700; font-size: .98rem; cursor: pointer;
  box-shadow: 0 8px 22px -6px var(--cta-shadow); transition: transform .18s ease, box-shadow .18s ease;
}
.fab:hover { transform: translateY(-3px); background: var(--primary-2); box-shadow: 0 12px 28px -6px var(--cta-shadow); }
.fab:active { transform: translateY(-1px) scale(.98); }
.fab-plus { font-size: 1.25rem; line-height: 1; }
@media (min-width: 900px) { .fab { display: none; } }
@media (max-width: 899px) { .hide-m { display: none !important; } }
.link:not(.kpi) { background: none; border: 0; color: var(--primary); font-weight: 600; cursor: pointer; padding: 0 4px; }
.empty .link { margin-top: 4px; }
/* Hộp có "Lưu & thêm tiếp" trên điện thoại: nút chính 1 hàng riêng rộng hết khung, 2 nút phụ chia đôi hàng dưới */
@media (max-width: 599px) {
  .sheet-f:has([data-do-more]) { flex-wrap: wrap; }
  .sheet-f:has([data-do-more]) .grow { display: none; }
  .sheet-f:has([data-do-more]) [data-do] { order: -1; flex: 1 1 100%; }
  .sheet-f:has([data-do-more]) .btn:not([data-do]) { flex: 1; padding: 0 10px; }
}

@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .side, .tabbar, .toasts, .no-print, .xls-mini, .pnav .icon-btn { display: none !important; }
  .main { margin: 0; padding: 0; }
  .page { padding: 0; max-width: none; }
  .page > * { animation: none !important; }
  .card, .kpi { box-shadow: none; break-inside: avoid; }
  .tbl-wrap { overflow: visible; margin: 0; padding: 0; }
}

/* Tên tiếng Trung xuống dòng dưới trong bảng; cột tên không bẻ chữ */
.tbl td .cn { display: block; font-size: .78rem; line-height: 1.3; }
.tbl td:first-child { white-space: nowrap; }
.tbl td.wide { min-width: 190px; }

/* ======================================================================
   App tuyển dụng — các thành phần mới
   ====================================================================== */
.page-act { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.center { text-align: center; }
.hint-line { margin: 0; }
kbd { font: 600 .68rem/1 inherit; padding: 3px 5px; border-radius: 4px; background: rgba(255, 255, 255, .12); white-space: nowrap; }

/* Băng chạy thử / chỉ xem */
.banner { margin: 12px 16px 0; padding: 9px 14px; border-radius: var(--r-sm); font-size: .86rem; line-height: 1.45; }
.banner.local { background: var(--warn-soft); color: var(--text); border: 1px dashed color-mix(in srgb, var(--warn) 50%, transparent); }
.banner.view { background: var(--primary-soft); color: var(--text); }
@media (min-width: 900px) { .banner { margin: 16px 32px 0; } }

/* Màn hình chờ + đăng nhập */
.splash { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center;
  background: radial-gradient(circle at 50% 35%, #1f3b66 0%, #0f2447 70%); color: #fff; }
.splash b { font-size: 1.2rem; animation: fade .5s ease both .15s; }
.splash p { margin: 0; color: rgba(255, 255, 255, .78); max-width: 420px; }
.splash .spin { border-color: rgba(255, 255, 255, .25); border-top-color: #fff; }
.splash-logo { font-size: 46px; animation: pop .5s cubic-bezier(.2, .9, .3, 1.3) both; }
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px 16px;
  background: radial-gradient(circle at 50% 0%, var(--hero-b) 0%, var(--side) 60%); }
.login-card { width: min(400px, 100%); background: var(--surface); border-radius: 20px; padding: 28px 24px 20px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5); text-align: center; animation: pop .3s cubic-bezier(.2, .9, .3, 1.2); }
.login-card h1 { font-size: 1.4rem; }
.login-card p { margin: 0; }
.login-card .fld { text-align: left; }
.login-logo { width: 62px; height: 62px; margin: 0 auto; border-radius: 18px; display: grid; place-items: center; font-size: 30px; background: var(--primary-soft); }
.login-err { min-height: 1.2em; color: var(--bad); font-size: .88rem; }
.login-promo { width: min(400px, 100%); flex-direction: row; text-align: left; }

/* Tìm nhanh (mục 15) */
.qs-btn { display: flex; align-items: center; gap: 8px; width: calc(100% - 12px); margin: 0 6px 12px; padding: 8px 10px; border-radius: var(--r-sm);
  border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .75); font: inherit; font-size: .88rem; cursor: pointer; text-align: left; }
.qs-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.qs-btn.on-light { width: 100%; margin: 0; background: var(--surface-2); border-color: var(--line); color: var(--muted); min-height: 44px; }
.qs-inp { font-size: 1.05rem; }
.qs-list { display: flex; flex-direction: column; gap: 2px; min-height: 120px; }
.qs-g { margin: 8px 0 2px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.qs-it { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 0; background: none; text-align: left; cursor: pointer; color: var(--text); font: inherit; }
.qs-it small { display: block; color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qs-it.on, .qs-it:hover { background: var(--primary-soft); }
.qs-ic { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--surface-2); flex-shrink: 0; }
.out-btn { border: 0; background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .8); border-radius: 7px; padding: 3px 8px; cursor: pointer; }
.out-btn:hover { background: var(--bad); color: #fff; }

/* Tab con (Biến động nhân sự) */
.subnav { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { padding: 10px 14px; color: var(--muted); font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a:hover { color: var(--text); }
.subnav a.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* Bộ lọc */
.filt { gap: 10px; }
.filt-sel { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.filt-sel > :first-child { grid-column: 1 / -1; }
.sel { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
@media (min-width: 700px) { .filt-sel { grid-template-columns: repeat(3, 1fr); } .filt-sel > :first-child { grid-column: auto; } }

/* Ảnh chữ cái đầu */
.av { --h: #2563eb; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; font-size: .78rem; font-weight: 700; letter-spacing: .02em;
  background: color-mix(in srgb, var(--h) 15%, var(--surface)); color: color-mix(in srgb, var(--h) 75%, var(--text)); }
.av.sm { width: 30px; height: 30px; font-size: .7rem; }
.av.lg { width: 44px; height: 44px; font-size: .95rem; border-radius: 14px; }
.av0 { --h: #2563eb; } .av1 { --h: #0d9488; } .av2 { --h: #7c3aed; } .av3 { --h: #b45309; } .av4 { --h: #be123c; } .av5 { --h: #0369a1; }
.av.mgr { background: linear-gradient(135deg, var(--hero-a), var(--hero-b)); color: #fff; }
.av.grey { --h: #64748b; }
.who { display: flex; align-items: center; gap: 10px; }
.who .sub { display: block; font-size: .78rem; color: var(--muted); }
.sub.clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Bảng tiến trình (kanban) */
.board-wrap { overflow-x: auto; margin: 0 -16px; padding: 2px 16px 10px; scroll-snap-type: x proximity; }
.board { display: flex; gap: 12px; align-items: flex-start; min-width: min-content; }
.bcol { flex: 0 0 272px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; scroll-snap-align: start;
  transition: border-color .15s, box-shadow .15s, background .15s; }
.bcol.closed { background: transparent; border-style: dashed; }
.bcol.drop { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); background: var(--primary-soft); }
.bcol-h { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px; }
.bcol-h b { font-size: .92rem; display: block; line-height: 1.2; }
.bcol-h .cn { font-size: .74rem; }
.bcount { min-width: 26px; height: 24px; padding: 0 8px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center;
  font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.bcards { display: flex; flex-direction: column; gap: 8px; padding: 4px 10px 12px; min-height: 70px; }
.bempty { margin: 0; padding: 18px 6px; text-align: center; font-size: .8rem; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; }
.ccard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 11px; display: flex; flex-direction: column; gap: 6px; cursor: pointer;
  box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease, border-color .15s; animation: exfIn .3s ease both; }
.ccard:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); }
.ccard:focus-visible { outline: 2px solid var(--primary); }
.ccard.stale { border-left: 3px solid var(--warn); }
.ccard.dragging { opacity: .45; transform: rotate(2deg); }
.cc-top { display: flex; align-items: center; gap: 9px; }
.cc-name { display: block; font-size: .92rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-pos { display: block; font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-meta { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-status { font-size: .8rem; line-height: 1.35; color: var(--text); background: var(--surface-2); border-radius: 8px; padding: 5px 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cc-foot { display: flex; align-items: center; gap: 6px; min-height: 20px; }
.cc-owner { font-size: .74rem; color: var(--muted); white-space: nowrap; }
@media (min-width: 900px) { .board-wrap { margin: 0; padding: 2px 0 10px; } }

/* Hộp rộng + hồ sơ chi tiết */
@media (min-width: 700px) { .sheet.wide { width: min(920px, 100%); } }
.sheet-ic.lg { border-radius: 12px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); position: relative; }
.steps li { display: flex; flex-direction: column; align-items: center; gap: 5px; position: relative; text-align: center; }
.steps li::before { content: ''; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.steps li:first-child::before { display: none; }
.steps li.done::before, .steps li.cur::before { background: var(--good); }
.steps .dot { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 700;
  background: var(--surface); border: 2px solid var(--line); color: var(--muted); }
.steps li.done .dot { background: var(--good); border-color: var(--good); color: #fff; }
.steps li.cur .dot { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: 0 0 0 4px var(--focus); }
.steps .lb { font-size: .7rem; color: var(--muted); line-height: 1.2; }
.steps li.cur .lb { color: var(--primary); font-weight: 700; }
@media (min-width: 600px) { .steps .lb { font-size: .78rem; } }
.cd-act { display: flex; gap: 8px; flex-wrap: wrap; }
.cd-act .btn { min-height: 40px; }
.cd-grid { display: grid; gap: 14px; }
@media (min-width: 760px) { .cd-grid { grid-template-columns: 1fr 1fr; } }
.cd-sec { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cd-sec h3 { font-size: .92rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cd-text { margin: 0; white-space: pre-wrap; font-size: .9rem; line-height: 1.5; background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
dl.info { margin: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
dl.info > div { display: grid; grid-template-columns: 140px 1fr; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: .9rem; }
dl.info > div:last-child { border-bottom: 0; }
dl.info dt { color: var(--muted); font-size: .82rem; }
dl.info dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
dl.info dd .sub { display: block; font-size: .78rem; color: var(--muted); }
@media (max-width: 420px) { dl.info > div { grid-template-columns: 112px 1fr; } }
.doc-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.note-form { display: flex; gap: 8px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 6px; display: flex; flex-direction: column; }
.timeline li { display: flex; gap: 12px; position: relative; padding-bottom: 12px; }
.timeline li::before { content: ''; position: absolute; left: 4px; top: 12px; bottom: -2px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); margin-top: 6px; flex-shrink: 0; position: relative; z-index: 1; box-shadow: 0 0 0 3px var(--primary-soft); }
.timeline p { margin: 0; font-size: .9rem; }
.note.bad { background: var(--bad-soft); }
.note.bad b { color: var(--bad); }

/* Biểu mẫu */
.fgrid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 600px) { .fgrid { grid-template-columns: 1fr 1fr; } .fgrid .span2 { grid-column: 1 / -1; } }
textarea.inp { resize: vertical; min-height: 64px; line-height: 1.45; }
.inp.num { text-align: right; font-variant-numeric: tabular-nums; }
.fld small { font-size: .76rem; }
.fld .badge { vertical-align: 1px; }
.fld.total { justify-content: flex-end; }
.fld.total b { font-size: 1.25rem; color: var(--primary); text-align: right; }
.seg.radios { display: flex; width: 100%; }
.seg.radios label { flex: 1; position: relative; }
.seg.radios input { position: absolute; opacity: 0; pointer-events: none; }
.seg.radios span { display: flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 12px; border-radius: 9px; font-weight: 500; font-size: .9rem; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg.radios input:checked + span { background: var(--seg-on); color: var(--primary); font-weight: 600; box-shadow: var(--shadow); }
.seg.radios input:focus-visible + span { outline: 2px solid var(--primary); }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); }
.check small { display: block; color: var(--muted); font-size: .8rem; }
.sal-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.sal-box > p { margin: 0; }
details.sal-box summary { cursor: pointer; }
details.sal-box[open] summary { margin-bottom: 10px; }
.picks { display: grid; gap: 8px; }
.picks.two { grid-template-columns: 1fr; }
@media (min-width: 600px) { .picks.two { grid-template-columns: 1fr 1fr; } }
.pick { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick b { display: block; }
.pick small { display: block; color: var(--muted); font-size: .8rem; line-height: 1.35; }
.pick-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); flex-shrink: 0; font-size: 1.05rem; }
.pick:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); background: var(--primary-soft); }
.pick.danger:has(input:checked) { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); background: var(--bad-soft); }
.pick:has(input:focus-visible) { outline: 2px solid var(--primary); }
.pick-ok { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-style: normal;
  font-size: .75rem; font-weight: 800; display: grid; place-items: center; transform: scale(0); transition: transform .22s cubic-bezier(.3, 1.6, .5, 1); }
.pick:has(input:checked) .pick-ok { transform: scale(1); }

/* Tổng quan */
.kpi .unit { font-size: .9rem; font-weight: 600; opacity: .85; }
.kpi.alert { cursor: pointer; text-align: left; }
.kpi.alert.on { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.kpi.alert.on b { color: var(--bad); }
.kpi.alert.off { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 30%, transparent); }
.kpi.alert.off b { color: var(--good); }
.tq-cmp { display: inline-flex; padding: 1px 7px; border-radius: 99px; font-weight: 700; font-size: .72rem; background: var(--surface-2); color: var(--muted); }
.tq-cmp.up { background: var(--good-soft); color: var(--good); }
.tq-cmp.dn { background: var(--warn-soft); color: var(--warn); }
.funnel { display: flex; flex-direction: column; gap: 9px; }
.fn-row { display: grid; grid-template-columns: 142px 1fr 40px 38px; align-items: center; gap: 8px; font-size: .88rem; }
.fn-lb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fn-track { height: 22px; border-radius: 7px; background: var(--surface-2); overflow: hidden; }
.fn-track i { display: block; height: 100%; width: var(--w); border-radius: 7px; background: linear-gradient(90deg, var(--c1), color-mix(in srgb, var(--c1) 70%, #fff));
  transform-origin: left; animation: grow .8s cubic-bezier(.34, 1.2, .5, 1) both; animation-delay: calc(var(--i) * 70ms); }
.fn-row:last-child .fn-track i { background: linear-gradient(90deg, var(--good), color-mix(in srgb, var(--good) 70%, #fff)); }
.fn-row b { text-align: right; }
.fn-pct { font-size: .75rem; color: var(--muted); text-align: right; }
@keyframes grow { from { transform: scaleX(0); } }
@media (max-width: 520px) { .fn-row { grid-template-columns: 1fr 34px 34px; gap: 2px 8px; font-size: .84rem; } .fn-lb { grid-column: 1 / -1; } .fn-track { height: 16px; } }
.scroll-wrap { position: relative; }
.scroll-box { max-height: calc(var(--rows) * 58px); overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; }
.scroll-wrap.more::after { content: ''; position: absolute; left: 0; right: 0; bottom: 22px; height: 34px; pointer-events: none; background: linear-gradient(transparent, var(--surface)); }
.scroll-hint { margin: 6px 0 0; font-size: .74rem; color: var(--muted); text-align: center; }
.tq-row { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 8px 6px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text);
  text-align: left; font: inherit; cursor: pointer; border-radius: 8px; transition: background .12s; flex-shrink: 0; }
.tq-row:last-child { border-bottom: 0; }
.tq-row:hover { background: var(--surface-2); }
.tq-row b { font-size: .92rem; }
.tq-row small { display: block; color: var(--muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tq-num { text-align: right; white-space: nowrap; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.tq-num small { font-size: .74rem; color: var(--warn); }
.tq-num.pos small { color: var(--good); }
.prog { display: block; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 5px; }
.prog i { display: block; height: 100%; border-radius: 99px; background: var(--good); }

/* Vị trí tuyển */
.pos-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.pos-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 10px; color: var(--text);
  box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease, border-color .18s; animation: gtFadeInUp .4s ease both; }
.pos-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); }
.pos-card.urgent { border-top: 3px solid var(--bad); }
.pos-card.dim { opacity: .72; }
.pc-top { display: flex; align-items: flex-start; gap: 8px; }
.pc-title { display: block; font-size: 1rem; line-height: 1.3; }
.pc-top .cn { display: block; }
.pc-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.pc-prog { display: flex; align-items: center; gap: 10px; font-size: .85rem; }
.pc-prog .prog { margin: 0; height: 8px; }
.pc-pipe { display: flex; flex-wrap: wrap; gap: 4px; }
.pc-pipe span { font-size: .75rem; padding: 2px 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-variant-numeric: tabular-nums; opacity: .6; }
.pc-pipe span.on { opacity: 1; background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.icon-btn.sm { width: 32px; height: 32px; font-size: .95rem; }

/* Giấy tờ */
.tpl-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.tpl-card { gap: 10px; }
.tpl-card h3 { font-size: 1.05rem; }
.tpl-card p { margin: 0; }
.tpl-card.dim { opacity: .7; }
.tpl-ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 22px; background: var(--primary-soft); }
.doc-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; position: sticky; top: 0; z-index: 5; padding: 10px 0; background: var(--bg); }
.doc-bar .grow { min-width: 160px; }
.doc-wrap { display: grid; gap: 14px; align-items: start; }
@media (min-width: 1100px) { .doc-wrap { grid-template-columns: 330px 1fr; } .doc-form { position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow-y: auto; } }
.doc-fields { display: grid; gap: 10px; }
@media (min-width: 600px) and (max-width: 1099px) { .doc-fields { grid-template-columns: 1fr 1fr; } }
.fld.priv .inp { border-style: dashed; }
.doc-view { min-width: 0; overflow-x: auto; padding-bottom: 8px; }
.paper { width: 210mm; min-height: 297mm; padding: 16mm 18mm; margin: 0 auto; box-shadow: 0 6px 30px -8px rgba(15, 36, 71, .35); border-radius: 4px; }
.page.doc-page { max-width: 1400px; }

/* Nhập Excel */
.imp-num.bk { background: var(--surface-2); color: var(--text); box-shadow: none; border: 1px solid var(--line); }
.imp-tbl tr.st-err td { background: var(--bad-soft); }
.imp-tbl tr.st-skip td { color: var(--muted); }
.save-bar { position: sticky; bottom: calc(var(--tabbar) + 10px + env(safe-area-inset-bottom)); z-index: 15; flex-direction: row; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; }
.save-bar.show { border-color: var(--primary); box-shadow: 0 10px 30px -10px var(--cta-shadow); }
@media (min-width: 900px) { .save-bar { bottom: 14px; } }
.imp-run, .imp-done { align-items: center; text-align: center; padding: 30px 16px; }
.imp-run p, .imp-done p { margin: 0; }
.progress { width: min(420px, 100%); height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--primary); border-radius: 99px; transition: width .3s ease; }
.imp-done .imp-stats { width: min(560px, 100%); }
.tick { width: 64px; height: 64px; }
.tick circle { fill: var(--good-soft); stroke: var(--good); stroke-width: 2.5; stroke-dasharray: 160; stroke-dashoffset: 160; animation: draw .6s ease forwards; }
.tick path { fill: none; stroke: var(--good); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .35s ease forwards .45s; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Tài khoản: hộp ghi lại tên đăng nhập + mật khẩu vừa tạo */
.cred { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: .95rem; }
.cred span { color: var(--muted); }

/* In: chỉ in tờ giấy */
@media print {
  @page { size: A4; margin: 14mm 15mm; }
  body.doc-mode .banner, body.doc-mode .doc-bar, body.doc-mode .doc-form { display: none !important; }
  body.doc-mode .doc-wrap { display: block; }
  body.doc-mode .doc-view { overflow: visible; padding: 0; }
  body.doc-mode .paper { width: auto; min-height: 0; padding: 0; box-shadow: none; border-radius: 0; zoom: 1 !important; }
  body.doc-mode .page { padding: 0; }
  .d-tbl, .d-party, .d-signs, .d-art tr { break-inside: avoid; }
  .banner, .page-act, .filt, .qs-btn { display: none !important; }
}
/* ---------- Hạn dùng: băng nhắc + trang gia hạn ---------- */
.lic-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 16px 0; padding: 10px 14px; border-radius: var(--r-sm); border: 1px solid; font-size: 14px; line-height: 1.45; }
.lic-banner.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.lic-banner.bad { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.lic-banner .grow { flex: 1 1 220px; }
.lic-emoji { font-size: 20px; line-height: 1; }
.lic-status { border-left: 4px solid var(--good); }
.lic-status.warn { border-left-color: var(--warn); }
.lic-status.bad { border-left-color: var(--bad); }
.lic-big { font-size: 20px; margin: 0; }
.lic-status p { margin: 0; }
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.plan { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s, transform .15s; }
.plan:hover:not(:disabled) { border-color: var(--primary); transform: translateY(-1px); }
.plan:disabled { opacity: .6; cursor: wait; }
.plan-price { font-size: 20px; font-weight: 700; color: var(--primary); }
.plan-top { display: flex; align-items: center; gap: 8px; width: 100%; justify-content: space-between; }
.plan-off { background: var(--good); color: var(--surface); font-size: .78rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.qr-col { display: flex; flex-direction: column; gap: 8px; width: 280px; max-width: 100%; }
.qr-box { width: 280px; height: 280px; max-width: 100%; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px; box-sizing: border-box; }
img.qr-box { height: auto; aspect-ratio: 1; }
.pay-info { flex: 1 1 240px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pay-info p { margin: 0; }
.pay-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.pay-dl dt { color: var(--muted); }
.pay-dl dd { margin: 0; overflow-wrap: anywhere; }
.pay-wait { display: flex; align-items: center; gap: 8px; color: var(--primary); }
.spin.sm { width: 16px; height: 16px; border-width: 2px; }
.lic-done { display: flex; gap: 12px; align-items: flex-start; background: var(--good-soft); color: var(--good); padding: 14px; border-radius: var(--r-sm); }
.lic-done p { margin: 4px 0 0; }
@media (max-width: 640px) { .lic-banner { margin: 10px 12px 0; } }

/* ---------- Khung QR chuyển khoản kiểu trang payOS / VietQR (luôn nền trắng kể cả chế độ tối) ---------- */
.pay-v { display: flex; flex-direction: column; gap: 12px; }
.pay-v .row.wrap { flex-wrap: wrap; gap: 8px; }
.vq-deadline { margin: 0; text-align: center; font-size: .92rem; }
.vq-card { background: #ffffff; color: #111111; border: 1px solid #e1e6ee; border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); }
.vq-tip { margin: 0 0 14px; text-align: center; font-size: .86rem; color: #333333; }
.vq-body { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 20px 32px; align-items: center; }
.vq-left { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.vq-logo { font-size: 1.6rem; display: inline-flex; align-items: center; letter-spacing: -.01em; }
.vq-logo b { font-weight: 900; }
.vq-v { color: #da251d; font-size: 1.15em; }
.vq-iet { color: #0a4f9e; }
.vq-pro { color: #0a4f9e; background: #f5c400; padding: 0 6px; margin-left: 5px; border-radius: 3px; }
.vq-qr { width: 100%; max-width: 270px; aspect-ratio: 1; border: 2px solid #0a4f9e; padding: 4px; display: grid; place-items: center; background: #ffffff; box-sizing: border-box; }
.vq-qr img { width: 100%; height: 100%; display: block; }
.vq-official { width: 100%; max-width: 300px; aspect-ratio: 1; display: block; }
.vq-banks { display: flex; align-items: center; gap: 12px; }
.vq-napas { color: #0a4f9e; font-weight: 700; font-size: 1.05rem; }
.vq-napas em { margin-left: 3px; color: #1f7ae0; }
.vq-sep { width: 2px; height: 26px; background: #cbd5e1; }
.vq-bank { color: #006b68; font-weight: 900; font-size: 1.35rem; }
.vq-right { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.vq-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.vq-row > div { display: flex; flex-direction: column; min-width: 0; }
.vq-row small { color: #64748b; font-size: .84rem; }
.vq-row b { font-size: 1.02rem; overflow-wrap: anywhere; }
.vq-bankrow { justify-content: flex-start; }
.vq-bankdot { flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%; background: #006b68; color: #ffffff; display: grid; place-items: center; font-size: .66rem; font-weight: 800; }
.vq-copy { flex-shrink: 0; border: 0; background: #e8f5ee; color: #1f5f45; font: inherit; font-size: .8rem; font-weight: 600; padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.vq-copy:hover { background: #d6eee1; }
.vq-note { margin: 16px 0 0; font-size: .86rem; color: #333333; }
@media (max-width: 640px) {
  .vq-card { padding: 14px 12px; }
  .vq-body { grid-template-columns: 1fr; }
  .vq-qr { max-width: 250px; }
}
@media (min-width: 900px) { .lic-banner { margin: 16px 32px 0; } }
.row-btns.left { justify-content: flex-start; }

/* ---------- Tài khoản & phân quyền (mục 16 quy chuẩn): mỗi loại tài khoản một màu ---------- */
:root { --r-admin: #7c3aed; --r-admin-soft: #f1ebfe; --r-kiem: #0f766e; --r-kiem-soft: #e2f5f1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --r-admin: #b794f6; --r-admin-soft: rgba(183, 148, 246, .15); --r-kiem: #4fd1c5; --r-kiem-soft: rgba(79, 209, 197, .13); } }
:root[data-theme="dark"] { --r-admin: #b794f6; --r-admin-soft: rgba(183, 148, 246, .15); --r-kiem: #4fd1c5; --r-kiem-soft: rgba(79, 209, 197, .13); }
.r-admin { --rc: var(--r-admin); --rs: var(--r-admin-soft); }
.r-soan { --rc: var(--warn); --rs: var(--warn-soft); }
.r-in { --rc: var(--primary); --rs: var(--primary-soft); }
.r-kiem { --rc: var(--r-kiem); --rs: var(--r-kiem-soft); }
.r-none { --rc: var(--muted); --rs: var(--surface-2); }
.nv-ic { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 11px; background: var(--rs); color: var(--rc); font-size: 18px; }

.nv-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-bottom: 14px; }
.nv-stat { display: flex; align-items: center; gap: 12px; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--rc); border-radius: var(--r); padding: 12px 14px;
  box-shadow: var(--shadow); transition: transform .15s, border-color .15s, background .15s; }
.nv-stat:hover { transform: translateY(-1px); }
.nv-stat.on { background: var(--rs); border-color: var(--rc); }
.nv-stat b { display: block; font-size: .95rem; }
.nv-stat small { display: block; color: var(--muted); font-size: .76rem; }
.nv-stat em { font-style: normal; font-weight: 700; font-size: 1.35rem; color: var(--rc); font-variant-numeric: tabular-nums; }

@media (max-width: 699px) {
  .nv-sum { grid-template-columns: 1fr 1fr; gap: 8px; }
  .nv-stat { padding: 9px 10px; gap: 8px; border-left-width: 3px; }
  .nv-stat small { display: none; }
  .nv-stat .nv-ic { width: 30px; height: 30px; font-size: 15px; border-radius: 9px; }
  .nv-stat b { font-size: .85rem; }
  .nv-stat em { font-size: 1.1rem; }
}
.nv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.nv-card { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; text-align: left; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; cursor: pointer; overflow: hidden;
  box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s; }
.nv-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--rc); }
.nv-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--rc); }
.nv-av { grid-row: span 2; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--rs); color: var(--rc); font-weight: 700; font-size: .95rem; }
.nv-info { display: flex; flex-direction: column; min-width: 0; }
.nv-info b { font-size: .98rem; }
.nv-info small { font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nv-role { justify-self: start; display: inline-flex; gap: 5px; align-items: center; font-size: .76rem; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--rs); color: var(--rc); }

.nv-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; margin-top: 4px; }
.nv-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--r-sm); cursor: pointer; background: var(--surface); transition: border-color .15s, background .15s; }
.nv-opt input { position: absolute; opacity: 0; pointer-events: none; }
.nv-opt b { display: block; font-size: .92rem; color: var(--text); }
.nv-opt small { display: block; font-size: .76rem; color: var(--muted); line-height: 1.35; font-weight: 400; }
.nv-opt:has(input:checked) { border-color: var(--rc); background: var(--rs); box-shadow: 0 0 0 3px var(--rs); }
.nv-opt:has(input:checked) b { color: var(--rc); }
.nv-opt:has(input:focus-visible) { outline: 2px solid var(--rc); outline-offset: 2px; }
.nv-opt:has(input:disabled) { cursor: not-allowed; opacity: .6; }
.nv-card.me { cursor: default; }
.nv-card.me:hover { transform: none; }
.nv-acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.nv-card.fresh { animation: nvFlash 1.8s ease; }
@keyframes nvFlash { 0%, 40% { background: var(--rs); box-shadow: 0 0 0 3px var(--rs); } }
