[hidden] { display: none !important; }
:root {
  --navy: #1b2433;          /* màu chữ chính */
  --navy-2: #2b2b40;
  --side: #1e1e2d;          /* nền menu trái */
  --side-2: #11263a;
  --blue: #0079c1;          /* xanh Bảo Việt */
  --blue-d: #00639e;
  --sky: #e8f3fb;
  --paper: #f3f6f9;
  --card: #ffffff;
  --line: #e4e8ee;
  --muted: #6b7686;
  --gold: #e8b10f;
  --red: #d9364f;
  --red-bg: #fdecef;
  --green: #2f9e57;
  --green-bg: #e7f6ec;
  --orange: #d48806;
  --r: 8px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px -1px rgba(16, 24, 40, .06);
  font-family: Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--navy);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--paper); font-size: 14.5px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
h1 { font-size: 20px; font-weight: 700; }
h2 { font-size: 16.5px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0 0 10px; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid #7fbfe8; outline-offset: 2px; }
.boot { padding: 40px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.c, th.c, td.c { text-align: center; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grow { flex: 1 1 auto; }
.stack { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.pre { white-space: pre-wrap; }

/* ---------- khung (theo bố cục AD Portal) ---------- */
.shell { display: grid; grid-template-columns: 265px 1fr; min-height: 100vh; }
body.nav-collapsed .shell { grid-template-columns: 0 1fr; }
body.nav-collapsed .nav { transform: translateX(-100%); }
.nav { background: var(--side); color: #fff; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; z-index: 40; transition: transform .2s ease; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.brand { display: block; padding: 14px 18px; background: #1a1a27; text-decoration: none; min-height: 64px; }
.brand-logo { display: flex; flex-direction: column; justify-content: center; min-height: 36px; }
.brand-logo img { max-height: 40px; max-width: 190px; object-fit: contain; object-position: left center; display: block; }
.brand-logo b { font-size: 18px; color: #fff; letter-spacing: .01em; }
.brand-logo span { font-size: 12px; color: #9fb3c8; }
.brand-logo:not(.dark) b { color: var(--navy); }
.brand-logo:not(.dark) img { max-height: 56px; margin: 0 auto; object-position: center; }
.nav-scroll { flex: 1; overflow-y: auto; padding: 14px 10px; background: var(--side-2); scrollbar-width: thin; scrollbar-color: #33475e transparent; }
.menu, .submenu { list-style: none; margin: 0; padding: 0; }
.mi { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; border: 0; background: none; color: rgba(255,255,255,.72); font: inherit; font-size: 14.5px; text-decoration: none; border-radius: 8px; cursor: pointer; text-align: left; }
.mi:hover { color: #fff; }
.mi.on { background: rgba(255,255,255,.12); color: #fff; font-weight: 500; }
.mi svg { flex: none; opacity: .9; }
.mi .caret { margin-left: auto; display: flex; transition: transform .15s; }
.group.open > .mi .caret { transform: rotate(180deg); }
.submenu { display: none; padding: 2px 0 6px; }
.group.open > .submenu { display: block; }
.mi.sub { padding-left: 44px; font-size: 14px; }
.who { display: flex; align-items: center; gap: 8px; padding: 12px 10px 12px 14px; background: #1a1a27; border-top: 1px solid rgba(255,255,255,.06); }
.who-link { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; flex: 1; min-width: 0; }
.who-text { min-width: 0; }
.who-text b { display: block; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-text span { display: block; font-size: 12px; color: #93a4b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .icon-btn { color: #93a4b8; }
.who .icon-btn:hover { color: #fff; }
.avatar { border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center; background: #d8e6f3; color: var(--blue-d); font-weight: 600; text-transform: uppercase; }
.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; background: #fff; padding: 10px 24px 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); border-bottom: 1px solid var(--line); min-height: 64px; }
.topbar h1 { font-size: 18px; }
.top-text { min-width: 0; }
.crumbs { display: flex; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--blue); }
.crumbs .cur { color: var(--navy); }
.content { min-width: 0; padding: 20px 24px 60px; }
.page-actions { display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.scrim { display: none; }
.icon-btn { background: none; border: 0; color: inherit; width: 40px; height: 40px; border-radius: 8px; cursor: pointer; display: inline-grid; place-items: center; flex: none; }
.icon-btn:hover { background: rgba(0,0,0,.05); }

@media (max-width: 900px) {
  .shell, body.nav-collapsed .shell { grid-template-columns: 1fr; }
  .nav { position: fixed; inset: 0 auto 0 0; width: 280px; transform: translateX(-100%); }
  body.nav-open .nav { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(17, 24, 39, .5); z-index: 30; }
  .topbar { padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top)); min-height: 56px; gap: 8px; }
  .topbar h1 { font-size: 16.5px; }
  .crumbs { font-size: 12px; }
  .content { padding: 14px 12px calc(50px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .nav, .mi .caret { transition: none; } }

/* ---------- nút & form ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 16px;
  font: inherit; font-weight: 600; font-size: 14.5px; border-radius: 8px; border: 1px solid var(--blue);
  background: var(--blue); color: #fff; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--blue-d); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.ghost { background: #fff; color: var(--blue); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--blue); background: #fff; }
.btn.danger { background: #fff; color: var(--red); border-color: #E7C2BA; }
.btn.danger:hover { background: var(--red-bg); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.icon-btn { background: none; border: 0; color: inherit; font-size: 20px; width: 42px; height: 42px; border-radius: 8px; cursor: pointer; }
.field { display: grid; gap: 5px; font-size: 13.5px; color: var(--muted); font-weight: 500; }
input, select, textarea {
  font: inherit; font-size: 15px; color: var(--navy); background: #fff; border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 12px; min-height: 42px; width: 100%;
}
textarea { min-height: 96px; resize: vertical; }
select { height: 42px; padding-top: 0; padding-bottom: 0; }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--blue); }
input[type=file] { padding: 8px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--navy); }

.card { background: var(--card); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.card > h2 { margin-bottom: 12px; }
.empty { background: var(--card); border: 1px dashed var(--line); border-radius: var(--r); padding: 32px 20px; text-align: center; }
.empty h2 { margin-bottom: 6px; }
.alert { border-radius: 8px; padding: 10px 14px; font-size: 14px; background: var(--sky); }
.alert.warn { background: #FFF6E0; }
.alert.err { background: var(--red-bg); color: var(--red); }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--sky); color: var(--blue-d); }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.gray { background: #ECEFF3; color: var(--muted); }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 500; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--navy); border-bottom-color: var(--blue); font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { font: inherit; font-weight: 600; padding: 9px 18px; border: 0; background: #fff; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--navy); color: #fff; }

/* ---------- doanh thu cá nhân ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 18px; }
.chip { font: inherit; font-size: 14px; white-space: nowrap; padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line); background: #fff; color: var(--navy); cursor: pointer; }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.hero { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 22px 20px; margin-bottom: 14px; }
.hero-name { font-weight: 600; font-size: 15px; }
.hero-code { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.hero-label { color: var(--muted); font-size: 14px; }
.figure { font-size: clamp(34px, 10vw, 56px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; word-break: break-all; }
.figure-rule { width: 64px; height: 5px; background: var(--gold); border-radius: 3px; margin: 12px 0 14px; }
.hero-meta { font-size: 13px; color: var(--muted); }
.kv { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin: 0; display: grid; grid-template-columns: 1fr auto; }
.kv dt, .kv dd { margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.kv dt { color: var(--muted); font-size: 14px; }
.kv dd { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.kv dt:nth-last-child(2), .kv dd:last-child { border-bottom: 0; }
.note { background: #FFF6E0; border-radius: 8px; padding: 10px 14px; font-size: 14px; }
.content > .narrow, .narrow { max-width: 640px; }

/* ---------- bảng ---------- */
.tbl-wrap { overflow: auto; max-height: 72vh; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; text-align: left; }
th { position: sticky; top: 0; background: #EDF1F6; font-weight: 600; font-size: 13px; color: var(--navy-2); z-index: 1; }
th.num, td.num { text-align: right; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: #F5F8FC; }
tfoot td { position: sticky; bottom: 0; background: #F4F7FB; font-weight: 700; border-top: 2px solid var(--line); border-bottom: 0; }
td.low { color: var(--red); font-weight: 700; }
tr.cancelled td { color: #9AA6B6; text-decoration: line-through; }
.wrap-cell { white-space: normal; min-width: 180px; }

/* ---------- modal ---------- */
dialog.modal { border: 0; border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); color: var(--navy); box-shadow: 0 20px 60px rgba(16, 42, 76, .25); }
dialog.modal.wide { width: min(880px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(16, 42, 76, .5); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 10px 6px 20px; }
.modal-body { padding: 8px 20px 16px; overflow: auto; max-height: calc(100vh - 180px); }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* ---------- toast ---------- */
#toasts { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: min(440px, calc(100vw - 24px)); }
.toast { background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 10px; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }
.toast.err { background: var(--red); }

/* ---------- đăng nhập ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(circle at 80% 0%, #3a5a7c 0, transparent 40%), linear-gradient(180deg, #17304d 0%, #1f5d99 100%); }
.login-box { width: min(420px, 100%); background: #fff; border-radius: 18px; padding: 32px 28px 28px; box-shadow: 0 20px 50px rgba(0,0,0,.25); text-align: center; }
.login-box .brand-logo { margin-bottom: 18px; align-items: center; }
.login-box h1 { margin-bottom: 4px; font-size: 26px; font-weight: 500; }
.login-box .org { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.login-box form { display: grid; gap: 14px; text-align: left; }
/* ---------- ảnh ---------- */
.day-group { margin-bottom: 22px; }
.day-group > h3 { font-size: 14px; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.reports { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.report { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: grid; gap: 8px; align-content: start; }
.report .by { font-size: 13px; color: var(--muted); }
.report p { white-space: pre-wrap; margin: 0; font-size: 14px; }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.thumbs button { padding: 0; border: 0; background: #E8EDF3; border-radius: 6px; overflow: hidden; aspect-ratio: 1; cursor: zoom-in; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.pick { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #E8EDF3; }
.pick img { width: 100%; height: 100%; object-fit: cover; }
.pick button { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(16, 42, 76, .8); color: #fff; cursor: pointer; }
.lightbox img { width: 100%; height: auto; display: block; border-radius: 8px; }

/* ---------- phiếu kho ---------- */
.voucher-form { max-width: 860px; }
.line-row { display: grid; grid-template-columns: 44px 1fr 110px 130px 42px; grid-template-areas: 'img sel q p x' '. hint hint hint hint'; gap: 8px; align-items: center; }
.line-thumb { grid-area: img; width: 44px; height: 44px; }
.l-sel { grid-area: sel; min-width: 0; } .l-q { grid-area: q; } .l-p { grid-area: p; } .l-x { grid-area: x; padding: 0; }
.line-row .stock-hint { grid-area: hint; font-size: 12.5px; color: var(--muted); margin-top: -4px; }
input[readonly] { background: #F4F6F9; color: var(--muted); }
.v-total { font-weight: 600; }

/* kho: ảnh hàng hoá */
.thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; display: block; background: #E8EDF3; flex: none; }
.thumb.xs { width: 34px; height: 34px; border-radius: 6px; }
.thumb.sm { width: 40px; height: 40px; }
.thumb.lg { width: 88px; height: 88px; border-radius: 12px; }
.ph { display: grid; place-items: center; background: var(--sky); color: var(--blue-d); font-weight: 700; font-size: 15px; }
.thumb.lg.ph { font-size: 32px; }
.cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover.ph { display: grid; place-items: center; font-size: 40px; color: #8FA9C9; background: linear-gradient(160deg, #EEF3F9, #E1E9F3); }
.goods { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.good { all: unset; box-sizing: border-box; cursor: pointer; background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; }
.good:hover { border-color: var(--blue); }
.good:focus-visible { outline: 3px solid #7FB0E6; outline-offset: 2px; }
.good-img { position: relative; aspect-ratio: 4 / 3; background: #EEF2F7; }
.good-img .badge { position: absolute; left: 8px; top: 8px; }
.good-body { padding: 10px 12px 12px; display: grid; gap: 2px; flex: 1; align-content: start; }
.good-name { font-weight: 600; font-size: 14.5px; line-height: 1.35; }
.good-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 6px; font-size: 14px; }
.good-foot b { font-size: 18px; font-variant-numeric: tabular-nums; }
.badge.warn { background: #FFF1CC; color: #8A5A00; }
.txt-red { color: var(--red); } .txt-warn { color: #A86E00; } .txt-green { color: var(--green); }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.detail-img { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #EEF2F7; }
.detail-img img { width: 100%; height: 100%; object-fit: contain; display: block; background: #fff; }
.detail-qty { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
.detail-qty span { font-size: 16px; font-weight: 500; color: var(--muted); }
.desc { white-space: pre-wrap; font-size: 14px; background: #F6F8FB; border-radius: 8px; padding: 10px 12px; margin: 0; }
.edit-item { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.img-pick { aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px dashed var(--line); background: #F6F8FB; }
.img-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-pick .ph { font-size: 14px; font-weight: 500; }
.ledger-head { display: flex; gap: 16px; align-items: flex-start; }
/* kho: tổng quan */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.tile-label { font-size: 13.5px; color: var(--muted); }
.tile-val { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.tile-sub { font-size: 12.5px; color: var(--muted); }
.tile.warn { border-color: #EBC46A; background: #FFFAEB; }
.two-col { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; gap: 12px; align-items: center; padding: 9px 4px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 6px; }
.mini-list li:last-child { border-bottom: 0; }
.mini-list li:hover { background: #F5F8FC; }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 14px; }
.bar-track { height: 10px; background: #EDF1F6; border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--blue); border-radius: 99px; }
.bar-val { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 80px; text-align: right; }
/* kho: kiểm kê */
.count-cell { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.count-in { width: 100px; min-height: 34px; padding: 4px 8px; text-align: right; }
.diff { min-width: 52px; text-align: left; font-weight: 600; font-size: 13px; }
.print-sheet { display: none; }
@media print {
  body.printing > *:not(.print-sheet) { display: none !important; }
  body.printing { background: #fff; }
  .print-sheet { display: block; color: #000; font-size: 13pt; padding: 10mm; }
  .print-sheet h2 { text-align: center; font-size: 18pt; margin: 8mm 0 2mm; }
  .print-sheet .ps-no { text-align: center; margin-bottom: 6mm; }
  .print-sheet table { margin: 4mm 0 10mm; width: 100%; }
  .print-sheet th, .print-sheet td { border: 1px solid #000; position: static; background: none; color: #000; }
  .ps-sign { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; gap: 6mm; }
  .ps-sign i { display: block; font-size: 11pt; margin-bottom: 22mm; }
}
@media (max-width: 560px) {
  .card { padding: 14px; }
  .hero { padding: 18px 16px; }
  .line-row { grid-template-columns: 44px 1fr 1fr 42px; grid-template-areas: 'img sel sel x' 'q q p p' 'hint hint hint hint'; }
  .detail, .edit-item { grid-template-columns: 1fr; }
  .edit-item .img-pick { max-width: 220px; }
  .goods { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .good-name { font-size: 13.5px; }
  .bar-row { grid-template-columns: 1fr auto; }
  .bar-track { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- nút phụ ---------- */
.btn { border-radius: 6px; }
.btn.warn { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn.warn:hover { background: #cf9c08; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 4px; background: #e6f4ff; color: #0958d9; border: 1px solid #b6dcff; margin-top: 3px; }
.em-g { color: var(--green); font-weight: 700; } .em-r { color: var(--red); font-weight: 700; } .em-o { color: var(--orange); font-weight: 700; } .em-b { color: var(--blue); font-weight: 700; }
.inline-sel { width: auto; min-height: 34px; height: 34px; font-size: 14px; font-weight: 500; }

/* ---------- bộ lọc ---------- */
.filters { display: grid; gap: 12px; }
.f-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.note-i { font-style: italic; color: var(--muted); font-size: 12.5px; margin: 0; }
.upd { font-size: 14px; } .upd b { color: var(--green); }

/* ---------- KPI ---------- */
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; }
.kpi { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 14px; text-align: center; display: grid; gap: 4px; align-content: start; }
.kpi-title { font-weight: 700; font-size: 14.5px; }
.kpi-val { font-size: 28px; font-weight: 700; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 13px; color: #4b5563; }
.dash-top { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: start; }
.dash-top > .card { height: 100%; min-width: 0; }
.mini-kpis + .stack, .card { min-width: 0; }
.chart { margin: 0; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid { stroke: #edf0f4; }
.chart .ax { font-size: 11px; fill: #6b7686; font-family: inherit; }
.chart .pt { font-size: 10px; fill: #1b2433; font-weight: 600; font-family: inherit; }
.legend { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; font-size: 12.5px; margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

/* ---------- bảng kiểu AD ---------- */
.tbl-wrap { border: 1px solid var(--line); border-radius: var(--r); }
th { background: #f8fafc; color: #1f2937; font-weight: 700; font-size: 13px; border-bottom: 1px solid var(--line); }
td { border-bottom: 1px solid #f0f2f5; }
.tbl-wrap.tall { max-height: 78vh; }
.sum-tbl th, .prog-tbl th { white-space: normal; text-align: center; vertical-align: middle; border-right: 1px solid var(--line); }
.sum-tbl td, .prog-tbl td { border-right: 1px solid #f0f2f5; }
.sum-tbl tr.total td { font-weight: 700; background: #fbfcfe; }
.sum-tbl tbody tr.click { cursor: pointer; }
.sum-tbl tbody tr.click:hover td { background: #f5f9ff; }
.act-tbl td { vertical-align: middle; }
.act-tbl th.sort { cursor: pointer; user-select: none; }
.act-tbl th.sort .sort-i { color: #a0aab8; font-size: 11px; }
.act-tbl th.sort.on .sort-i { color: var(--blue); }
.exp-btn { width: 18px; height: 18px; border: 1px solid #c8cfd9; border-radius: 3px; background: #fff; cursor: pointer; position: relative; padding: 0; }
.exp-btn::before, .exp-btn::after { content: ''; position: absolute; background: #4b5563; left: 4px; right: 4px; top: 8px; height: 1px; }
.exp-btn::after { left: 8px; right: auto; width: 1px; top: 4px; bottom: 4px; height: auto; }
.exp-btn.open::after { display: none; }
.exp-row > td { background: #fafbfd; white-space: normal; padding: 14px 18px; }
.exp-body { display: grid; gap: 8px; font-size: 14px; }
.exp-body .badge { margin-left: 8px; }
.act-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.act-thumbs button { padding: 0; border: 1px solid var(--line); background: #eef2f6; border-radius: 6px; overflow: hidden; width: 110px; height: 140px; cursor: zoom-in; }
.act-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.del-btn { border: 0; background: none; color: #ff4d4f; cursor: pointer; padding: 4px; border-radius: 6px; display: inline-grid; place-items: center; }
.del-btn:hover { background: #fff1f0; }
.switch { width: 44px; height: 22px; border-radius: 11px; border: 0; background: #bfc5cd; position: relative; cursor: pointer; padding: 0; transition: background .15s; }
.switch i { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s; }
.switch.on { background: var(--blue); }
.switch.on i { left: 24px; }
.switch:disabled { cursor: not-allowed; opacity: .6; }
.gallery img { width: 100%; max-height: 72vh; object-fit: contain; background: #111; border-radius: 8px; display: block; margin-bottom: 10px; }

/* ---------- cuộc tư vấn của tôi ---------- */
.mini-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.mini-kpis > div { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 12px; text-align: center; }
.mini-kpis b { display: block; font-size: 22px; }
.mini-kpis span { font-size: 12.5px; color: var(--muted); }
.act-card { display: flex; gap: 14px; background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; align-items: flex-start; }
.act-date { width: 58px; flex: none; text-align: center; border-right: 1px solid var(--line); padding-right: 12px; }
.act-date b { display: block; font-size: 18px; }
.act-date span { font-size: 12.5px; color: var(--muted); }
.act-loc { font-weight: 600; margin-bottom: 4px; }
.act-card .act-thumbs { margin-top: 10px; }
.act-card .act-thumbs button { width: 72px; height: 72px; }
.act-actions { display: flex; flex-direction: column; gap: 6px; flex: none; }

/* ---------- tiến độ kinh doanh ---------- */
.prog-tiles { display: grid; gap: 14px; grid-template-columns: 1fr 2fr 1.1fr; }
.pt { border-radius: var(--r); padding: 18px; display: grid; align-content: center; text-align: center; min-height: 150px; box-shadow: var(--shadow); }
.pt-l { font-size: 13.5px; } .pt-d { font-size: 13px; font-weight: 700; color: var(--green); }
.pt-v { font-size: 30px; font-weight: 700; margin-top: 8px; font-variant-numeric: tabular-nums; }
.pt-v small { font-size: 18px; font-weight: 600; }
.pt-v.sm { font-size: 22px; }
.pt-day { background: #fdf6e3; }
.pt-main { background: linear-gradient(135deg, #1e61f0 0%, #4f8df9 100%); color: #fff; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; }
.pt-sep { width: 1px; height: 70%; background: rgba(255,255,255,.4); }
.pt-side { background: linear-gradient(135deg, #2f6fe8, #4a8cf7); color: #fff; grid-template-columns: 1fr 1fr; gap: 10px; }
.prog-tbl tr.grp td { font-weight: 700; background: #f7f9fc; }

/* ---------- hồ sơ ---------- */
.prof { display: flex; gap: 24px; flex-wrap: wrap; }
.prof-left { display: grid; gap: 8px; justify-items: center; align-content: start; width: 150px; }
.prof-left .btn { width: 100%; }
.prof-av .avatar { border-radius: 10px; }
.prof-right { flex: 1; min-width: 260px; display: grid; gap: 4px; align-content: start; }
.prof-name { font-size: 20px; }
.prof-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px 22px; margin-top: 12px; }
.prof-stats > div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed var(--line); padding: 6px 0; font-size: 14px; }
.prof-stats span { color: var(--muted); }
.people { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.person { display: flex; gap: 12px; align-items: center; background: #fff; border-radius: var(--r); padding: 12px; box-shadow: var(--shadow); }
.org .person { box-shadow: none; border: 1px solid var(--line); }
.org h2 { margin-bottom: 12px; }
.hello { display: flex; gap: 14px; align-items: center; }
.quick { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 10px; }
.quick a { display: grid; gap: 2px; text-decoration: none; color: var(--navy); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.quick a:hover { border-color: var(--blue); background: #f7fbff; }
.quick span { font-size: 13px; color: var(--muted); }
.tabs { border-bottom: 1px solid var(--line); }

@media (max-width: 1100px) { .dash-top { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .prog-tiles { grid-template-columns: 1fr; }
  .pt { min-height: 0; }
  .kpi-val { font-size: 24px; }
  .mini-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .act-card { flex-wrap: wrap; }
  .act-actions { flex-direction: row; width: 100%; }
  .prof-left { width: 100%; grid-template-columns: auto 1fr 1fr; align-items: center; }
}

@media (max-width: 760px) { .my-bar .btn { flex: 1 1 40%; } .my-bar .grow { display: none; } .my-bar > div:first-child { width: 100% !important; } }
.org-ad { margin-top: 14px; }
.org-ad h3 { font-size: 14px; color: var(--blue-d); margin-bottom: 8px; }

.badge.kind-nn { background: #fff4d6; color: #8a5a00; }
.sup-pick { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; display: grid; gap: 2px; }
.sup-pick .check { gap: 10px; padding: 6px 2px; border-bottom: 1px solid #f2f4f7; flex-wrap: wrap; }
.sup-pick .check:last-child { border-bottom: 0; }
.sup-code { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 92px; font-size: 13px; }
.sup-list { display: inline-flex; flex-wrap: wrap; gap: 4px; }

.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 46px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 36px; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 6px; display: grid; place-items: center; }
.pw-eye:hover { color: var(--blue); background: var(--sky); }
.req { color: var(--red); }
.invalid, input.invalid, select.invalid { border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(217, 54, 79, .12); }
.stack.invalid, .picks.invalid { border: 1px solid var(--red); border-radius: 8px; padding: 6px; }
ul.miss { margin: 6px 0 0; padding-left: 20px; }

.adv-card { display: grid; gap: 10px; }
.adv-meta { display: grid; gap: 2px; font-size: 14px; }
.adv-line { grid-template-columns: 44px 1fr 120px 42px; grid-template-areas: 'img sel q x' '. hint hint hint'; }
@media (max-width: 560px) { .adv-line { grid-template-columns: 44px 1fr 42px; grid-template-areas: 'img sel x' 'q q q' 'hint hint hint'; } }

/* ===== Chấm công ===== */
.row.between { justify-content: space-between; }
button.link { background: none; border: 0; padding: 0; color: var(--blue, #0079c1); cursor: pointer; font: inherit; text-decoration: underline; }
button.link.muted { color: var(--muted); }
td.weekend { color: #b3261e; font-weight: 500; }
.att-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) { .att-grid { grid-template-columns: minmax(0, 440px) minmax(0, 1fr); align-items: start; } }
.att-card { display: grid; gap: 16px; }
.att-clock { text-align: center; padding: 6px 0 2px; }
.att-time { font-size: 44px; font-weight: 700; letter-spacing: 1px; font-variant-numeric: tabular-nums; color: #11263a; }
.att-date { font-size: 16px; text-transform: capitalize; margin-bottom: 4px; }
.att-shifts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.att-shifts button { display: grid; gap: 2px; padding: 10px 8px; border: 1.5px solid #d5dbe3; border-radius: 10px; background: #fff; cursor: pointer; text-align: center; font: inherit; color: inherit; }
.att-shifts button b { font-size: 14px; }
.att-shifts button span { font-size: 12px; color: var(--muted); }
.att-shifts button.on { border-color: #0079c1; background: #e8f3fb; box-shadow: 0 0 0 1px #0079c1 inset; }
.att-shifts button:disabled:not(.on) { opacity: .45; cursor: not-allowed; }
.att-cam { position: relative; aspect-ratio: 4 / 3; background: #11263a; border-radius: 12px; overflow: hidden; }
.att-cam video, .att-cam img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att-cam video { transform: scaleX(-1); }
.att-cam-msg { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; color: #fff; font-size: 14px; }
.btn.att-go { min-height: 54px; font-size: 18px; font-weight: 700; width: 100%; }
.btn.att-go.out { background: #c0392b; border-color: #c0392b; }
.att-cell { display: inline-flex; align-items: center; gap: 8px; }
.att-th { border: 0; padding: 0; background: none; cursor: pointer; }
.att-th img { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; display: block; }
.att-entries { display: grid; gap: 6px; }
.att-entry { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.att-entry.dim { opacity: .6; }
button.link.danger-link { color: #c0392b; margin-left: 4px; }
.att-geo { text-decoration: none; font-size: 14px; }
.att-geo-msg { margin-top: 8px; color: var(--muted); }
.att-geo-msg.err { color: #c0392b; font-weight: 500; }
/* ===== Điểm danh ===== */
.roll-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.roll-card { display: grid; gap: 8px; align-content: start; }
.roll-card h3 { margin: 0; }
.chk-grid { display: grid; gap: 6px 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.roll-home { display: grid; gap: 10px; }
.roll-home-item { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 12px; background: linear-gradient(135deg, #0079c1, #005a92); color: #fff; box-shadow: 0 6px 18px rgba(0, 90, 146, .25); flex-wrap: wrap; }
.roll-home-item.done { background: #e8f6ee; color: #1b6b3a; box-shadow: none; }
.roll-home-ic { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; font-size: 20px; flex: none; }
.roll-home-item.done .roll-home-ic { background: #cdebd8; }
.roll-home-txt { flex: 1 1 200px; display: grid; gap: 2px; }
.roll-home-txt b { font-size: 17px; }
.roll-home-item .btn { background: #fff; color: #0079c1; border-color: #fff; font-weight: 700; }
/* ===== Top 10 trang chủ ===== */
.top-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); }
.tp-card { padding: 0; overflow: hidden; border: 0; background: #fff; }
.tp-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; padding: 18px 20px 70px; color: #fff;
  background: radial-gradient(120% 140% at 50% 0%, #1d4f91 0%, #0e2a4f 55%, #0a1d38 100%); position: relative; }
.tp-head::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 20% 30%, rgba(255,214,102,.18), transparent 40%), radial-gradient(circle at 85% 20%, rgba(255,214,102,.12), transparent 35%); pointer-events: none; }
.tp-kicker { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #ffd666; font-weight: 700; }
.tp-head h2 { margin: 2px 0 0; font-size: 19px; color: #fff; }
.tp-date { font-size: 12px; color: #c9d6ea; white-space: nowrap; }
.tp-podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 8px; padding: 0 14px; margin-top: -58px; position: relative; z-index: 1; }
.tp-slot { display: grid; justify-items: center; text-align: center; gap: 3px; min-width: 0; }
.tp-slot.empty { visibility: hidden; }
.tp-trophy { width: 46px; height: 46px; filter: drop-shadow(0 4px 8px rgba(226,164,0,.45)); animation: tpFloat 3s ease-in-out infinite; }
@keyframes tpFloat { 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .tp-trophy { animation: none; } }
.tp-star { width: 26px; height: 26px; }
.tp-star.silver path { fill: #c4ccd6; } .tp-star.bronze path { fill: #d8955a; }
.tp-face { position: relative; border-radius: 50%; padding: 3px; background: #fff; }
.tp-slot.r1 .tp-face { box-shadow: 0 0 0 3px #f5c242, 0 8px 22px rgba(245,194,66,.55); }
.tp-slot.r2 .tp-face { box-shadow: 0 0 0 3px #b9c3cf, 0 6px 16px rgba(120,135,150,.35); }
.tp-slot.r3 .tp-face { box-shadow: 0 0 0 3px #d8955a, 0 6px 16px rgba(216,149,90,.35); }
.tp-face .avatar { display: block; }
.tp-badge { position: absolute; right: -2px; bottom: -2px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; border: 2px solid #fff; }
.r1 .tp-badge { background: #e2a400; } .r2 .tp-badge { background: #8995a3; } .r3 .tp-badge { background: #c27a3d; }
.tp-name { font-size: 14px; line-height: 1.25; max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin-top: 4px; }
.tp-sub { font-size: 11.5px; color: var(--muted); line-height: 1.3; min-height: 30px; }
.tp-ip { font-size: 19px; font-weight: 800; color: #0b5ea8; font-variant-numeric: tabular-nums; }
.tp-slot.r1 .tp-ip { font-size: 23px; color: #b37e00; }
.tp-ip small { font-size: 12px; font-weight: 600; }
.tp-extra { font-size: 11.5px; color: var(--muted); }
.tp-step { width: 100%; margin-top: 6px; border-radius: 10px 10px 0 0; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px; letter-spacing: .03em; }
.tp-slot.r1 .tp-step { height: 46px; background: linear-gradient(180deg, #f7cf5a, #e2a400); }
.tp-slot.r2 .tp-step { height: 32px; background: linear-gradient(180deg, #ccd4dd, #9aa6b4); }
.tp-slot.r3 .tp-step { height: 24px; background: linear-gradient(180deg, #e7ae7c, #c27a3d); }
.tp-slot.me .tp-name { color: #0079c1; }
.tp-list { list-style: none; margin: 0; padding: 6px 14px 14px; border-top: 1px solid #eef1f5; display: grid; gap: 2px; }
.tp-list li { display: flex; align-items: center; gap: 12px; padding: 8px 6px; border-radius: 10px; }
.tp-list li:nth-child(odd) { background: #f8fafc; }
.tp-list li.me { background: #e8f3fb; box-shadow: inset 3px 0 0 #0079c1; }
.tp-no { width: 26px; text-align: center; font-weight: 800; color: #8a94a3; font-variant-numeric: tabular-nums; }
.tp-who { flex: 1; min-width: 0; display: grid; }
.tp-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.tp-who span, .tp-val span { font-size: 11.5px; color: var(--muted); }
.tp-val { text-align: right; display: grid; font-variant-numeric: tabular-nums; }
.tp-val b { color: #0b5ea8; font-size: 15.5px; }
.tp-grp-av { background: linear-gradient(135deg, #e8f1fb, #cfe0f5); color: #0b5ea8; }
@media (max-width: 480px) { .tp-head { padding-bottom: 64px; } .tp-ip { font-size: 16px; } .tp-slot.r1 .tp-ip { font-size: 19px; } .tp-sub { font-size: 10.5px; } }
tr.dim td { color: var(--muted); } .ct-kv dt { text-transform: none; }
/* ===== Mục tiêu ===== */
.goal-card { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; padding: 22px; border-radius: 16px; color: #fff;
  background: radial-gradient(120% 140% at 0% 0%, #1d5fae 0%, #0f3566 55%, #0a2447 100%); box-shadow: 0 10px 28px rgba(10,36,71,.28); }
.goal-card.done { background: radial-gradient(120% 140% at 0% 0%, #1e8f4e 0%, #136b39 60%, #0d4f2a 100%); }
.goal-l { background: #fff; border-radius: 50%; padding: 6px; flex: none; box-shadow: 0 0 0 6px rgba(255,255,255,.12); }
.goal-ring .goal-pct { font-size: 22px; font-weight: 800; font-family: inherit; }
.goal-ring .goal-lbl { font-size: 10px; fill: #667085; font-family: inherit; }
.goal-arc { transition: stroke-dasharray .8s ease; }
.goal-r { flex: 1 1 280px; display: grid; gap: 8px; min-width: 0; }
.goal-k { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #ffd666; font-weight: 700; }
.goal-card h2 { margin: 0; font-size: 22px; color: #fff; }
.goal-sub { font-size: 13px; color: #c9d6ea; }
.goal-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 4px; }
.goal-nums div { background: rgba(255,255,255,.1); border-radius: 10px; padding: 8px 10px; display: grid; }
.goal-nums span { font-size: 11.5px; color: #c9d6ea; }
.goal-nums b { font-size: 20px; font-variant-numeric: tabular-nums; }
.goal-nums small { font-size: 11px; color: #c9d6ea; }
.goal-bar { height: 12px; background: rgba(255,255,255,.18); border-radius: 99px; overflow: hidden; }
.goal-bar i { display: block; height: 100%; border-radius: 99px; transition: width .8s ease; }
.goal-bar.sm { height: 8px; background: #e6ecf3; }
.goal-foot { font-size: 13px; color: #e3ecf8; }
.goal-mini { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; vertical-align: middle; }
.gm-track { display: block; width: 64px; height: 6px; background: #e6ecf3; border-radius: 99px; overflow: hidden; }
.gm-track i { display: block; height: 100%; border-radius: 99px; }
.goal-mini span { font-size: 12px; font-weight: 700; }
.goal-list h3 { margin: 0 0 8px; }
.gl-row { display: grid; grid-template-columns: 26px minmax(0, 1.2fr) minmax(0, 2fr) 70px; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid #f0f2f5; }
.gl-row:last-child { border-bottom: 0; }
.gl-no { font-weight: 800; color: #8a94a3; text-align: center; }
.gl-who { display: grid; min-width: 0; } .gl-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .gl-who span { font-size: 11.5px; color: var(--muted); }
.gl-bar { display: grid; gap: 3px; } .gl-bar span { font-size: 11.5px; color: var(--muted); }
.gl-pct { text-align: right; font-variant-numeric: tabular-nums; }
.tgt-in { width: 130px; text-align: right; }
.tgt-unit { padding-left: 28px !important; }
@media (max-width: 560px) { .goal-l svg { width: 110px; height: 110px; } .goal-nums b { font-size: 16px; } .gl-row { grid-template-columns: 22px 1fr 60px; } .gl-no { grid-row: 1; } .gl-who { grid-column: 2; grid-row: 1; } .gl-pct { grid-column: 3; grid-row: 1; } .gl-bar { grid-column: 2 / 4; grid-row: 2; } }
.goal-link { text-decoration: none; color: inherit; display: block; } .goal-link:hover .goal-card { filter: brightness(1.06); }
/* Kế hoạch AD: tông vàng */
.goal-card.gold { background: radial-gradient(120% 140% at 0% 0%, #f7d774 0%, #e9b730 50%, #c98f0a 100%); color: #3b2a00; box-shadow: 0 10px 28px rgba(201,143,10,.35); }
.goal-card.gold h2 { color: #2b1f00; }
.goal-card.gold .goal-k { color: #7a4f00; }
.goal-card.gold .goal-sub, .goal-card.gold .goal-foot, .goal-card.gold .goal-nums span, .goal-card.gold .goal-nums small { color: #5c4300; }
.goal-card.gold .goal-nums div { background: rgba(255,255,255,.35); }
.goal-card.gold .goal-bar { background: rgba(255,255,255,.45); }
.goal-card.gold .goal-l { box-shadow: 0 0 0 6px rgba(255,255,255,.35); }
.goal-card.gold.done { background: radial-gradient(120% 140% at 0% 0%, #f7d774 0%, #e9b730 45%, #1e8f4e 100%); }
.goal-list.gold { border-top: 4px solid #e9b730; background: #fffbea; }
.goal-list.gold h3 { color: #7a4f00; }
.tgt-ad { border-top: 4px solid #e9b730; background: #fffbea; }
.tgt-ad-head h3 { margin: 0; color: #7a4f00; } .tgt-ad-head p { margin: 4px 0 10px; color: #5c4300; }
/* Bấm tên để xem thông tin */
button.link.name-link { text-decoration: none; color: #0b5ea8; font-weight: 600; text-align: left; }
button.link.name-link:hover { text-decoration: underline; }
tr.grp button.link.name-link { color: #0a3d75; }
.info-head { display: flex; align-items: center; gap: 14px; } .info-head h3 { margin: 0; }
.info-kv dd button.link { font-weight: 600; }
.info-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.info-stats div { background: #f3f7fc; border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; }
.info-stats span { font-size: 12px; color: var(--muted); } .info-stats b { font-size: 17px; color: #0b5ea8; font-variant-numeric: tabular-nums; }
.stack h4 { margin: 4px 0 6px; }
.app-ver { font-size: 11px; opacity: .55; padding: 2px 18px 6px; color: inherit; }
.nav-collapsed .app-ver { display: none; }
.goal-card h2 .name-link, .gl-who .name-link { font: inherit; color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
/* Thu nhập tạm tính 2026 */
.bn-hero { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; background: linear-gradient(135deg, #f3f8ff, #fff8e6); }
.bn-hero h2 { margin: 0 0 4px; }
.bn-hero .kpis { flex: 1 1 420px; }
.bn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; align-items: start; }
.bn-card { display: flex; flex-direction: column; gap: 12px; border-top: 4px solid #0070c0; }
.bn-card.new { border-top-color: #16a34a; }
.bn-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.bn-head h3 { margin: 0 0 2px; font-size: 16px; }
.bn-val { font-size: 22px; font-weight: 800; color: #94a3b8; white-space: nowrap; }
.bn-val.on { color: #16a34a; }
.bn-kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.bn-kv > div { background: #f6f8fb; border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.bn-kv span { font-size: 12px; color: #64748b; }
.bn-tbl { font-size: 13px; }
.bn-tbl tr.on td, .bn-tbl td.hit { background: #dcfce7; font-weight: 700; color: #166534; }
.bn-note { font-size: 13.5px; padding: 8px 10px; border-radius: 10px; background: #f8fafc; }
.bn-note.goal { background: #fff7e6; color: #8a5300; }
.bn-note.warn { background: #fef2f2; color: #991b1b; }
.bn-quarters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bn-quarters > div { border: 1px solid #e2e8f0; border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 2px; text-align: center; }
.bn-quarters > div.ok { background: #dcfce7; border-color: #86efac; }
.bn-quarters > div.na { opacity: .5; }
.bn-quarters small { color: #64748b; }
@media (max-width: 560px) { .bn-grid { grid-template-columns: 1fr; } .bn-val { font-size: 18px; } .bn-head { flex-direction: column; } }
.bn-months { grid-template-columns: repeat(6, 1fr); margin-top: 10px; }
@media (max-width: 560px) { .bn-months { grid-template-columns: repeat(4, 1fr); } }
.tile-bonus { font-size: 12.5px; line-height: 1.35; margin-top: 4px; padding: 4px 8px; border-radius: 8px; text-align: left; }
.tile-bonus.ok { background: #dcfce7; color: #166534; font-weight: 600; }
.tile-bonus.up { background: #fff7e6; color: #8a5300; }
/* Khung Sao Việt trên ảnh đại diện */
.av-wrap { position: relative; display: inline-block; flex: none; line-height: 0; vertical-align: middle; }
.av-wrap > .avatar { width: 100% !important; height: 100% !important; line-height: normal; }
.av-wrap.sv > .avatar { box-shadow: 0 0 0 2px #f5c518, 0 0 0 3.5px #b3121b, 0 2px 8px rgba(201,138,0,.35); }
.av-wrap .sv-top, .av-wrap .sv-bot { position: absolute; left: 50%; z-index: 1; display: inline-flex; align-items: center; gap: .12em; white-space: nowrap;
  font: 800 max(8px, calc(var(--s) * .19))/1.35 Arial, sans-serif; letter-spacing: .02em; color: #ffe066; padding: 0 .45em;
  background: linear-gradient(180deg, #d4202a, #9e0f17); border: 1.5px solid #f5c518; border-radius: 999px; box-shadow: 0 1px 3px rgba(0,0,0,.3); pointer-events: none; }
.av-wrap .sv-top { top: 0; transform: translate(-50%, -58%); }
.av-wrap .sv-bot { bottom: 0; transform: translate(-50%, 58%); font-size: max(7px, calc(var(--s) * .16)); }
.av-wrap .sv-star { width: 1.15em; height: 1.15em; fill: #ffd21f; stroke: #fff3b0; stroke-width: 1; filter: drop-shadow(0 0 1px rgba(0,0,0,.4)); }
.tp-face .avatar.ph-av { display: grid; place-items: center; }
.carry-note { font-size: 12px; color: #6d28d9; background: #f3e8ff; border-radius: 6px; padding: 2px 6px; margin-top: 3px; display: inline-block; line-height: 1.35; cursor: help; }
.bn-note.carry { background: transparent; padding: 0; }
/* Pháo hoa chúc mừng hoàn thành mục tiêu */
.fw-wrap { position: fixed; inset: 0; z-index: 9999; background: radial-gradient(ellipse at center, rgba(10,20,50,.72), rgba(5,10,30,.9)); display: grid; place-items: center; animation: fwIn .35s ease; }
.fw-wrap.out { opacity: 0; transition: opacity .4s; }
.fw-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.fw-msg { position: relative; text-align: center; color: #fff; max-width: 520px; padding: 28px 30px; margin: 16px; border-radius: 20px; background: linear-gradient(160deg, rgba(255,210,31,.18), rgba(179,18,27,.25)); border: 1.5px solid rgba(255,210,31,.6); box-shadow: 0 10px 40px rgba(0,0,0,.4); backdrop-filter: blur(3px); }
.fw-cup { font-size: 64px; line-height: 1; animation: fwBounce 1.2s ease-in-out infinite; }
.fw-k { margin-top: 6px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #ffd21f; }
.fw-msg h2 { margin: 6px 0 8px; font-size: 24px; color: #fff; }
.fw-msg p { margin: 0 0 18px; color: #e8edf7; }
.fw-msg .btn { background: linear-gradient(180deg, #ffd21f, #e0a800); color: #3a2a00; border: 0; font-weight: 800; padding: 10px 26px; }
@keyframes fwIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fwBounce { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-8px) scale(1.06); } }

/* =====================================================================
   GIAO DIỆN 2026 (v50): Bảo Việt xanh – vàng, chữ Be Vietnam Pro,
   số liệu lớn dễ đọc, điều hướng dưới cùng trên điện thoại
   ===================================================================== */
:root {
  --navy: #0f1e33; --navy-2: #24364f; --muted: #5f6b7a;
  --side: #0b2545; --side-2: #0e2d52;
  --blue: #0067b1; --blue-d: #00508a; --sky: #e8f1fa;
  --paper: #f2f5f9; --line: #e2e8f0; --gold: #f2b705;
  --green: #1e9e5a; --green-bg: #e6f6ed; --red: #d23b3b; --red-bg: #fdeceb; --orange: #c77c02;
  --r: 14px; --r-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 30, 51, .06), 0 4px 14px rgba(15, 30, 51, .05);
  --tabbar-h: 64px;
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'tnum' 1;
}
body { font-size: 14.5px; letter-spacing: -.003em; }
h1 { font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
h3 { font-weight: 600; }
.card { border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid #eaeef4; }
.btn, .btn.sm { border-radius: 10px; }
input, select, textarea { border-radius: 10px; border-color: #d8e0ea; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 103, 177, .15); }

/* Menu trái: xanh đậm Bảo Việt, mục đang chọn có vạch vàng */
.nav { background: var(--side); box-shadow: none; }
.brand, .who { background: #091f3b; }
.nav-scroll { background: var(--side); }
.mi { border-radius: 10px; color: rgba(255,255,255,.74); }
.mi.on { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 3px 0 0 var(--gold); font-weight: 600; }
.mi.sub.on { box-shadow: inset 3px 0 0 var(--gold); }

/* Thanh tiêu đề */
.topbar { background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom-color: #e6ebf1; }
.top-back { display: none; }

/* Ô số liệu (KPI): số lớn căn trái, nhãn nhỏ phía trên, bấm được thì có mũi tên */
.kpis { gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.kpi { text-align: left; padding: 16px 18px; border-radius: var(--r); border: 1px solid #eaeef4; gap: 2px; color: inherit; text-decoration: none; position: relative; }
.kpi-title { font-size: 13.5px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi-val { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; margin: 4px 0 2px; color: var(--navy); }
.kpi-val .em-r { color: var(--blue); }
.kpi-sub { font-size: 13px; color: var(--muted); }
.kpi-sub:first-of-type { margin-top: -2px; }
.kpi-go { margin-left: auto; display: inline-flex; color: #9aa8b8; transition: transform .15s, color .15s; }
.kpi-link { cursor: pointer; }
.kpi-link:hover { border-color: #c9d8ea; }
.kpi-link:hover .kpi-go { color: var(--blue); transform: translateX(2px); }
.kpi .tile-bonus { text-align: left; }
.kpi .carry-note { justify-self: start; }

/* Bảng: dòng thoáng, số căn phải, dòng tổng nổi bật */
.tbl-wrap { border-radius: var(--r-sm); border-color: #e6ebf1; }
th { background: #f4f7fb; color: var(--muted); font-weight: 600; font-size: 12.5px; }
td { font-size: 14px; }
tbody tr:hover td { background: #f8fafd; }
tr.grp td { background: #f2f7fd; font-weight: 600; }
tfoot td { background: #eef3f9; }

/* Thẻ mục tiêu: giữ nguyên bố cục, bo góc thống nhất */
.goal-card, .goal-list { border-radius: var(--r); }

/* Bộ lọc */
.filters select, .filters input { min-height: 40px; }

/* Chip, tab */
.chip.on, .seg button.on { background: var(--blue); border-color: var(--blue); }
.tabs a.on { border-bottom-color: var(--gold); }

/* Thanh điều hướng dưới cùng (chỉ trên điện thoại) */
.tabbar { display: none; }
@media (max-width: 900px) {
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255,255,255,.96); backdrop-filter: saturate(1.4) blur(12px); border-top: 1px solid #e3e9f0; }
  .tab { all: unset; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer;
    color: #7a8797; font-size: 11px; font-weight: 600; text-align: center; -webkit-tap-highlight-color: transparent; position: relative; }
  .tab svg { width: 22px; height: 22px; }
  .tab.on { color: var(--blue); }
  .tab.on::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold); }
  .tab:focus-visible { outline: 2px solid var(--blue); outline-offset: -4px; border-radius: 8px; }
  .content { padding: 12px 12px calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom)); }
  #toasts { bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); }
  .top-menu { display: none; }
  body:not(.is-root) .top-back { display: inline-grid; }
  body.is-root .topbar { padding-left: 16px; }
  .crumbs { display: none; }
  .topbar { min-height: 52px; }
  .topbar h1 { font-size: 17px; }
}

/* Điện thoại: ô số 2 cột, chữ số vừa màn hình, bảng giữ cột đầu */
@media (max-width: 560px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px 12px 14px; }
  .kpi-title { font-size: 12.5px; }
  .kpi-val { font-size: 24px; }
  .kpi .tile-bonus { font-size: 12px; padding: 4px 7px; }
  .kpis > .kpi:only-child, .kpis > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .card { padding: 14px; border-radius: 12px; }
  .stack { gap: 12px; }
  .tbl-wrap { max-height: none; }
  th, td { padding: 8px 10px; }
  .filters .row, .filters { gap: 8px; }
  .f-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  /* Cửa sổ dạng tấm trượt từ dưới lên */
  dialog.modal, dialog.modal.wide { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 18px 18px 0 0; max-height: 92vh; }
  dialog.modal .modal-body { max-height: calc(92vh - 130px); }
  dialog.modal[open] { animation: sheetUp .22s ease-out; }
  .modal-head::before { content: ''; position: absolute; left: 50%; top: 6px; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: #d5dde7; }
  .modal-head { position: relative; padding-top: 18px; }
  .modal-foot .btn { flex: 1 1 auto; }
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { dialog.modal[open] { animation: none; } .kpi-go { transition: none; } }
.kpi-unit { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 5px; letter-spacing: 0; }
.stack > :empty { display: none; }
.hello { padding: 14px 18px; }
.hello h2 { font-size: 18px; }
@media (max-width: 560px) {
  .hello { padding: 12px 14px; gap: 12px; }
  .hello h2 { font-size: 16px; }
  .kpi-unit { font-size: 12px; margin-left: 3px; }
}

/* Ô tổng hợp ở Tiến độ kinh doanh: nền trắng, ô chính xanh đậm */
.prog-tiles { gap: 12px; grid-template-columns: 1fr 2fr 1.3fr; }
.pt { text-align: left; min-height: 0; padding: 16px 18px; border: 1px solid #eaeef4; align-content: start; }
.pt-day, .pt-side { background: #fff; color: var(--navy); }
.pt-day { box-shadow: inset 4px 0 0 var(--gold), var(--shadow); }
.pt-main { background: var(--side); color: #fff; grid-template-columns: 1fr auto 1fr; }
.pt-main .pt-l, .pt-main .small { color: #b9c7da; }
.pt-l { font-size: 13px; font-weight: 600; color: var(--muted); }
.pt-d { font-size: 12.5px; color: var(--green); }
.pt-v { font-size: 30px; margin-top: 4px; letter-spacing: -.02em; }
.pt-v small { font-size: 15px; }
.pt-side .small, .pt-day .small { color: var(--muted); }
.pt-sep { background: rgba(255,255,255,.2); }
@media (max-width: 900px) {
  .prog-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pt-main { grid-column: 1 / -1; order: -1; }
}
@media (max-width: 560px) {
  .pt { padding: 12px 14px; }
  .pt-v { font-size: 22px; }
  .pt-v small { font-size: 12px; }
  .pt-side { grid-template-columns: 1fr; gap: 8px; }
  /* Thẻ mục tiêu: vòng % và tên ở hàng trên, số liệu bên dưới */
  .goal-card { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; row-gap: 8px; padding: 16px 14px; align-items: center; }
  .goal-r { display: contents; }
  .goal-l { grid-row: 1 / span 3; padding: 4px; box-shadow: 0 0 0 4px rgba(255,255,255,.14); }
  .goal-l svg { width: 84px !important; height: 84px !important; }
  .goal-k, .goal-card h2, .goal-sub { grid-column: 2; }
  .goal-k { font-size: 10.5px; align-self: end; }
  .goal-card h2 { font-size: 17px; }
  .goal-sub { align-self: start; }
  .goal-nums, .goal-bar, .goal-foot { grid-column: 1 / -1; }
  .goal-nums { gap: 6px; margin-top: 2px; }
  .goal-nums div { padding: 6px 8px; }
  .goal-nums b { font-size: 15px; }
  /* Bảng tiến độ: ẩn cột STT, tên xuống dòng để thấy cột số */
  .prog-tbl th:first-child, .prog-tbl td:first-child { display: none; }
  .prog-tbl td.sub-grp { padding: 0 4px; }
  .prog-tbl td, .prog-tbl th { white-space: normal; }
  .prog-tbl td.num, .prog-tbl th.num { white-space: nowrap; }
  .prog-tbl tr.grp td:nth-child(2) { min-width: 150px; }
  .prog-tbl .name-link { text-align: left; }
}
/* Danh sách tiến độ trên điện thoại */
.m-list { display: none; }
@media (max-width: 560px) {
  .desk-tbl { display: none; }
  .m-list { display: grid; border: 1px solid #e6ebf1; border-radius: 12px; overflow: hidden; background: #fff; }
  .m-head { display: flex; justify-content: space-between; padding: 8px 12px; background: #f4f7fb; font-size: 12px; font-weight: 600; color: var(--muted); }
  .m-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 12px; border-top: 1px solid #eef2f6; }
  .m-item:not(:has(.m-rank)) { grid-template-columns: minmax(0, 1fr) auto; }
  .m-item.click { cursor: pointer; }
  .m-item.click:active { background: #f2f7fd; }
  .m-item.grp { background: #f2f7fd; border-top: 1px solid #dbe6f3; }
  .m-item.grp .m-title { font-weight: 700; font-size: 15px; }
  .m-rank { min-width: 22px; height: 22px; border-radius: 50%; background: #eef2f7; color: var(--muted); font-size: 11.5px; font-weight: 700; display: grid; place-items: center; margin-top: 1px; }
  .m-title { font-weight: 600; line-height: 1.3; }
  .m-title .name-link { text-align: left; }
  .m-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
  .m-main .goal-mini { margin: 4px 0 0; }
  .m-num { text-align: right; display: grid; justify-items: end; }
  .m-num b { font-size: 16px; letter-spacing: -.01em; }
  .m-num span { font-size: 11px; color: var(--muted); white-space: nowrap; }
  .m-total { background: #eef3f9; }
  .m-total .m-title { font-weight: 700; }
}
.kpi-text .kpi-val { font-size: 18px; letter-spacing: 0; }
.goal-list:not(.all) .gl-extra { display: none; }
.gl-more { margin-top: 8px; }
.rec-filters > select { width: auto; min-width: 170px; } .rec-filters > input { width: 110px; } @media (max-width: 560px) { .rec-filters > select { flex: 1 1 140px; } }
/* Dòng tuyển dụng trong thẻ vàng */
.goal-rec { margin-top: 6px; padding-top: 10px; border-top: 1px dashed rgba(92, 67, 0, .35); display: grid; gap: 6px; }
.gr-k { font-size: 12px; font-weight: 700; color: #7a4f00; }
.gr-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.gr-part { background: rgba(255,255,255,.35); border-radius: 10px; padding: 8px 10px; display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 8px; }
.gr-part > span { grid-column: 1 / -1; font-size: 11.5px; color: #5c4300; }
.gr-part > b { font-size: 18px; color: #2b1f00; }
.gr-part > b small { font-size: 11.5px; font-weight: 600; color: #5c4300; }
.gr-pct { font-style: normal; font-weight: 800; font-size: 14px; color: #2b1f00; }
.gr-part .goal-bar { grid-column: 1 / -1; margin-top: 4px; background: rgba(255,255,255,.55); }
@media (max-width: 560px) { .goal-rec { grid-column: 1 / -1; } .gr-part > b { font-size: 16px; } }

/* v57: bảng vàng – tên cách xa ảnh hơn, dòng phụ nhóm tách 2 dòng */
.tp-slot .tp-name { margin-top: 16px; }
.tp-ln { display: block; }
.tp-who .tp-ln { font-size: 11.5px; }

/* v60: thông báo phiếu ứng chờ duyệt */
.nb { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #e5383b; color: #fff; font-size: 11.5px; font-weight: 700; line-height: 1; margin-left: auto; box-shadow: 0 0 0 2px rgba(255,255,255,.15); animation: nbPulse 2s ease-in-out infinite; }
.nb[hidden] { display: none; }
.mi .nb + .caret { margin-left: 8px; }
.mi.sub { display: flex; align-items: center; }
.tab { position: relative; }
.tab-nb { position: absolute; top: 2px; left: 55%; margin: 0; min-width: 18px; height: 18px; font-size: 10.5px; }
body.nav-collapsed .nav .mi > .nb { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
@keyframes nbPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(229,56,59,.5); } 50% { box-shadow: 0 0 0 5px rgba(229,56,59,0); } }
body.nav-collapsed .nav .mi { position: relative; }
/* v61: ảnh giao nhận hàng ứng */
.pick.add { border: 2px dashed #9fb3c8; background: #f4f7fb; color: var(--blue); display: grid; place-content: center; justify-items: center; gap: 4px; font-size: 26px; cursor: pointer; font-family: inherit; }
.pick.add span { font-size: 12px; font-weight: 600; }
.adv-photos { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.adv-photos .att-th img { width: 56px; height: 56px; border-radius: 8px; }
/* v64: ứng hàng / hoàn hàng */
.adv-seg { display: flex; width: 100%; max-width: 460px; border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(16,42,76,.06); }
.adv-seg button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 16px; font-size: 15px; }
.adv-seg button.on { background: var(--side, #0b2545); color: #fff; }
.adv-seg button:nth-child(2).on { background: #0f7a55; }
.adv-seg .nb { margin-left: 2px; animation: none; }
.badge.kind-u { background: #e6f0fb; color: #0b4f8a; }
.badge.kind-h { background: #e3f6ee; color: #0f7a55; }
.adv-card.hoan { border-left: 4px solid #0f7a55; }
/* v65: chụp ảnh giao nhận trực tiếp */
.adv-cam video { transform: none; }
.adv-cam video.mirror { transform: scaleX(-1); }
.cam-clock { position: absolute; left: 10px; bottom: 10px; background: rgba(0,0,0,.55); color: #ffd54a; font-size: 13px; font-weight: 600; padding: 3px 8px; border-radius: 6px; font-variant-numeric: tabular-nums; }
/* v66: thời gian dự kiến nhận */
.adv-expect { font-weight: 600; color: #0b4f8a; }
.adv-expect.on { display: inline-block; width: fit-content; background: #fff4d6; color: #8a5a00; padding: 2px 8px; border-radius: 6px; }

/* Tiến độ năm: ba thẻ tổng quan */
.yr-tiles { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.yr-card { background: #fff; border: 1px solid #eaeef4; border-top: 4px solid var(--ac, #0079c1); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 18px 14px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.yr-h { display: flex; gap: 10px; align-items: center; }
.yr-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: color-mix(in srgb, var(--ac, #0079c1) 14%, #fff); flex: none; }
.yr-t { font-weight: 700; font-size: 15px; color: var(--navy, #0f2a4a); }
.yr-s { font-size: 12.5px; color: var(--muted, #6b7a90); }
.yr-body { display: flex; align-items: center; gap: 14px; min-height: 112px; }
.yr-body .goal-ring { flex: none; }
.yr-main { min-width: 0; }
.yr-v { font-size: 30px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--navy, #0f2a4a); overflow-wrap: anywhere; }
.yr-v small { font-size: 14px; font-weight: 600; color: var(--muted, #6b7a90); }
.yr-of { margin-top: 4px; font-size: 12.5px; color: var(--muted, #6b7a90); }
.yr-noplan { font-size: 12.5px; color: var(--muted, #6b7a90); background: #f4f6fa; border-radius: 10px; padding: 10px 12px; max-width: 120px; text-align: center; }
.yr-track { position: relative; height: 10px; background: #e6ecf3; border-radius: 99px; }
.yr-track i { display: block; height: 100%; border-radius: 99px; }
.yr-track u { position: absolute; top: -4px; width: 2px; height: 18px; background: #1b2433; border-radius: 2px; text-decoration: none; }
.yr-pace { font-size: 11.5px; color: var(--muted, #6b7a90); margin-top: -6px; }
.yr-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; }
.yr-f { background: #f6f8fb; border-radius: 10px; padding: 8px 10px; display: grid; gap: 2px; min-width: 0; }
.yr-f span { font-size: 11.5px; color: var(--muted, #6b7a90); }
.yr-f b { font-size: 14.5px; font-variant-numeric: tabular-nums; color: var(--navy, #0f2a4a); }
.yr-f.ok b { color: #16a34a; } .yr-f.bad b { color: #d93025; }
.yr-spark { display: flex; align-items: flex-end; gap: 4px; height: 92px; }
.yr-bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; }
.yr-bar i { width: 100%; background: #9cc7e6; border-radius: 4px 4px 0 0; display: block; }
.yr-bar.now i { background: #0079c1; }
.yr-bar span { font-size: 10px; color: var(--muted, #6b7a90); }
@media (max-width: 1100px) { .yr-tiles { grid-template-columns: 1fr; } }

/* Bảng chọn dưới thanh điều hướng điện thoại */
dialog.sheet { position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-width: 100%; max-height: 85vh; border: 0; padding: 0 0 calc(18px + env(safe-area-inset-bottom)); background: #f7f9fc; color: var(--navy); border-radius: 24px 24px 0 0; box-shadow: 0 -10px 40px rgba(10,20,40,.3); overflow: auto; animation: sheet-up .22s cubic-bezier(.2,.8,.2,1); transition: transform .2s ease; }
dialog.sheet::backdrop { background: rgba(10, 20, 40, .5); }
.sheet-grab { display: grid; place-items: center; padding: 10px 0 2px; touch-action: none; }
.sheet-grab i { width: 42px; height: 5px; border-radius: 99px; background: #cdd5e1; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 18px 10px; font-size: 18px; }
.sheet-x { all: unset; box-sizing: border-box; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #e9eef6; color: #4a5a72; font-size: 15px; cursor: pointer; }
.sheet-list { display: grid; gap: 10px; padding: 2px 14px 4px; }
.sheet-item { display: flex; align-items: center; gap: 14px; min-height: 68px; padding: 12px 14px; background: #fff; border: 1.5px solid #e6ecf3; border-radius: 18px; text-decoration: none; color: inherit; box-shadow: 0 1px 2px rgba(16,24,40,.04); -webkit-tap-highlight-color: transparent; }
.sheet-item:active { background: #eef3fb; transform: scale(.985); }
.sheet-item.on { border-color: var(--blue, #0079c1); background: #f0f7fd; }
.sheet-ic { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: var(--t, #0079c1); background: color-mix(in srgb, var(--t, #0079c1) 14%, #fff); }
.sheet-tx { flex: 1; min-width: 0; display: grid; gap: 2px; }
.sheet-tx b { font-size: 16.5px; font-weight: 700; line-height: 1.25; }
.sheet-tx small { font-size: 13px; color: var(--muted); line-height: 1.3; }
.sheet-go { font-style: normal; color: #9aa7ba; font-size: 26px; line-height: 1; }
.sheet-on { font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--blue, #0079c1); background: #dcecf9; border-radius: 99px; padding: 4px 9px; white-space: nowrap; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@media (min-width: 901px) { dialog.sheet { max-width: 460px; left: 50%; right: auto; transform: translateX(-50%); } }

/* ===== Tối ưu điện thoại (v96) ===== */
.seg-nav { display: flex; gap: 4px; padding: 4px; background: #e9eff6; border-radius: 12px; }
.seg-nav a { flex: 1; text-align: center; padding: 9px 6px; border-radius: 9px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; }
.seg-nav a.on { background: #fff; color: var(--blue-d); box-shadow: 0 1px 3px rgba(16,24,40,.12); }
.quick { display: none; }
.sec-link { display: inline-flex; align-items: center; gap: 2px; margin-top: 10px; font-weight: 600; text-decoration: none; }
.sx-hint { display: none; }
.f-toggle { display: none; }
@media (max-width: 900px) {
  .quick { display: flex; gap: 8px; overflow-x: auto; margin: -2px -12px 0; padding: 2px 12px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
  .quick::-webkit-scrollbar { display: none; }
  .quick a { flex: none; scroll-snap-align: start; padding: 9px 14px; border-radius: 99px; background: #fff; border: 1px solid #d5e3f1; color: var(--blue-d); font-weight: 600; font-size: 13.5px; text-decoration: none; box-shadow: var(--shadow); }
  .quick a:active { background: var(--sky); }
}
@media (max-width: 560px) {
  /* Tab ngang: cuộn mượt, mờ mép khi còn nội dung */
  .tabs { scrollbar-width: none; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; margin-left: -12px; margin-right: -12px; padding: 0 12px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { scroll-snap-align: center; padding: 12px 14px; }
  .tabs.more-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
  .tabs.more-l { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 36px), transparent); }
  .tabs.more-l.more-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); }

  /* Bảng vuốt ngang: bóng mờ hai mép + dòng gợi ý */
  .tbl-wrap.sx { background: linear-gradient(to right, #fff 30%, rgba(255,255,255,0)) left / 36px 100% no-repeat local, linear-gradient(to left, #fff 30%, rgba(255,255,255,0)) right / 36px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(16,24,40,.2), transparent) left / 10px 100% no-repeat scroll, radial-gradient(farthest-side at 100% 50%, rgba(16,24,40,.2), transparent) right / 10px 100% no-repeat scroll, #fff; -webkit-overflow-scrolling: touch; }
  .sx-hint { display: flex; align-items: center; justify-content: center; gap: 2px; margin: 6px 0 0; font-size: 12px; color: var(--muted); }
  /* Dòng bấm được: vạch xanh bên trái + mũi tên + phản hồi khi chạm */
  tbody tr.click td:first-child { box-shadow: inset 3px 0 0 var(--blue); }
  tbody tr.click:active td { background: #eaf3fc; }
  tbody tr.click td:last-child::after { content: '›'; margin-left: 8px; color: #9aa8b8; font-size: 18px; line-height: 1; font-weight: 400; }
  .m-item { position: relative; }
  .m-item.click { padding-right: 28px; }
  .m-item.click::after { content: '›'; position: absolute; right: 10px; top: 50%; margin-top: -13px; font-size: 22px; color: #9aa8b8; line-height: 1; }
  .m-grp > .m-item.grp.click::after { transform: rotate(90deg); transition: transform .15s; }
  .m-grp.open > .m-item.grp.click::after { transform: rotate(-90deg); }
  .m-grp:not(.open) > .m-mems { display: none; }
  .m-grp > .m-mems { border-left: 3px solid #cfe0f3; }
  .m-list:not(.all) .m-extra { display: none; }
  .m-moreb { margin: 10px; width: calc(100% - 20px); }
  /* Tên bấm được: gạch chân chấm */
  button.link.name-link { text-decoration: underline dotted; text-decoration-color: #7fb2e0; text-underline-offset: 3px; }
  .card.click:active, .kpi-link:active { background: #f2f7fd; }
  a, button, .tab, .quick a { -webkit-tap-highlight-color: rgba(0,121,193,.12); }

  /* Ô nhập, nút: đủ lớn để chạm; chữ 16px để iOS không tự phóng to */
  select, input:not([type=checkbox]):not([type=radio]):not([type=file]), textarea { font-size: 16px; min-height: 44px; }
  .btn { min-height: 44px; padding-top: 9px; padding-bottom: 9px; }
  .btn.sm { min-height: 38px; }
  .chip { min-height: 38px; }
  .icon-btn { width: 44px; height: 44px; }
  .page-actions { justify-content: stretch; }
  .page-actions .btn { flex: 1 1 auto; }
  .row.end { justify-content: stretch; } .row.end > .btn { flex: 1 1 auto; }

  /* Bộ lọc thu gọn */
  .card.f-fold { padding: 0; overflow: hidden; }
  .f-toggle { display: flex; align-items: center; gap: 8px; width: 100%; padding: 13px 14px; border: 0; background: none; font: inherit; text-align: left; color: var(--navy); cursor: pointer; }
  .f-toggle b { font-weight: 700; flex: none; }
  .f-toggle .f-sum { flex: 1; min-width: 0; color: var(--blue-d); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .f-toggle .f-chev { display: inline-flex; color: #9aa8b8; transform: rotate(90deg); transition: transform .15s; }
  .f-fold.f-open .f-chev { transform: rotate(-90deg); }
  .f-fold:not(.f-open) .f-body { display: none; }
  .f-fold.f-open .f-body { padding: 0 14px 14px; border-top: 1px solid var(--line); padding-top: 12px; }
  .f-fold.f-open .f-toggle { padding-bottom: 10px; }

  /* Trang chủ: bảng vàng gọn, xem đủ khi cần */
  .tp-card:not(.all) .tp-list li:nth-child(n+3) { display: none; }
  .tp-more { width: 100%; margin-top: 10px; }
  .goal-list .gl-more { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .f-chev, .m-grp > .m-item.grp.click::after { transition: none; } }
.tp-more { display: none; }
.tp-card > .sec-link { margin: 4px 16px 16px; }
@media (max-width: 560px) { .tp-more { display: inline-flex; justify-content: center; margin: 0 14px 4px; width: calc(100% - 28px); } }
@media (max-width: 560px) {
  /* Hồ sơ: ảnh nhỏ bên trái, hai nút xếp dọc bên phải */
  .prof-left { grid-template-columns: 88px minmax(0, 1fr); gap: 8px 14px; justify-items: stretch; }
  .prof-left .prof-av { grid-row: 1 / span 2; }
  .prof-left .prof-av .avatar { width: 88px !important; height: 88px !important; font-size: 30px; }
  .prof-left .btn { white-space: normal; text-align: center; line-height: 1.25; }
  .prof-right { min-width: 0; }
  .prof-stats { grid-template-columns: 1fr; }
  /* Ô số liệu phụ của tiến độ: hai ô cạnh nhau */
  .pt-side { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
  /* Mở rộng vùng chạm cho nút nhỏ trong bảng (không đổi hình dạng) */
  .exp-btn, .del-btn, .switch { position: relative; }
  .exp-btn::after, .del-btn::after, .switch::after { content: ''; position: absolute; inset: -12px; }
  .f-toggle { min-width: 0; }
  .f-toggle .f-sum { display: block; flex: 1 1 0; min-width: 0; }
  .card.f-fold { min-width: 0; max-width: 100%; }
}
@media (max-width: 560px) {
  .ppl-more { width: 100%; margin-top: 10px; }
  .card.org.fold > h2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; }
  .card.org.fold > h2::after { content: '›'; font-size: 24px; font-weight: 400; color: #9aa8b8; transform: rotate(90deg); transition: transform .15s; line-height: 1; }
  .card.org.fold.open > h2::after { transform: rotate(-90deg); }
  .card.org.fold:not(.open) > :not(h2) { display: none; }
  .card.org.fold:not(.open) { padding-top: 12px; padding-bottom: 12px; }
  .person { padding: 8px 10px; }
}
@media (max-width: 560px) {
  .clampable:not(.open) { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
  .clamp-btn { justify-self: start; margin: -6px 0 0; padding: 8px 2px; font-weight: 600; color: var(--blue-d); }
  button.link.name-link { position: relative; padding: 5px 0; }
  button.link.name-link::after { content: ''; position: absolute; inset: -4px -6px; }
}
@media (max-width: 560px) {
  /* Danh sách mặt hàng: dạng dòng gọn, ảnh nhỏ bên trái */
  .goods { grid-template-columns: 1fr; gap: 8px; }
  .good { flex-direction: row; align-items: stretch; }
  .good-img { width: 80px; aspect-ratio: auto; min-height: 80px; flex: none; }
  .good-img img { width: 100%; height: 100%; object-fit: cover; }
  .good-body { padding: 8px 12px; }
  .good-foot { margin-top: 2px; }
}

/* So sánh 5 ngày (Tiến độ ngày) */
.cmp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.cmp-nav { display: flex; gap: 6px; }
.cmp-bars { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; align-items: end; }
.cmp-bar { all: unset; box-sizing: border-box; cursor: pointer; display: grid; justify-items: center; gap: 3px; padding: 8px 2px 6px; border-radius: 12px; border: 1px solid transparent; -webkit-tap-highlight-color: transparent; }
.cmp-bar:hover { background: #f4f8fc; }
.cmp-bar.on { background: #eaf3fc; border-color: #b9d6f1; }
.cmp-bar:focus-visible { outline: 3px solid #7fbfe8; }
.cmp-col { width: 100%; max-width: 44px; height: 120px; display: flex; align-items: flex-end; background: #f1f4f8; border-radius: 8px; overflow: hidden; }
.cmp-col i { display: block; width: 100%; background: #9cc3e6; border-radius: 8px 8px 0 0; }
.cmp-bar.on .cmp-col i { background: var(--blue); }
.cmp-v { font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.cmp-d { font-size: 12.5px; font-weight: 600; }
.cmp-w { font-size: 11.5px; color: var(--muted); }
.cmp-dl { font-size: 11.5px; font-weight: 700; color: var(--green); min-height: 14px; }
.cmp-dl.dn { color: var(--red); }
.cmp-note { margin: 10px 0 0; }

/* ===== Doanh thu theo phòng PTKD ===== */
.seg-nav button { flex: 1; font: inherit; border: 0; background: none; cursor: pointer; text-align: center; padding: 9px 6px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14px; }
.seg-nav button.on { background: #fff; color: var(--blue-d); box-shadow: 0 1px 3px rgba(16,24,40,.12); }
.rv-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr); gap: 18px; align-items: center; padding: 20px 22px; border-radius: 16px; color: #fff; background: linear-gradient(135deg, #0b2a4a 0%, #0f4c81 60%, #0079c1 100%); box-shadow: 0 6px 18px rgba(0,60,110,.22); }
.rv-h-l { font-size: 13px; font-weight: 600; color: #b9d4ee; }
.rv-h-v { font-size: 40px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.rv-h-s { font-size: 12.5px; color: #9fc0e0; }
.rv-h-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.rv-st { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; }
.rv-st span { font-size: 12px; color: #b9d4ee; }
.rv-st b { font-size: 18px; font-variant-numeric: tabular-nums; }
.rv-bar-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rv-list { display: grid; gap: 10px; }
.rv-list.cards { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.rv-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; background: #fff; border: 1px solid #e6ebf1; border-radius: 14px; padding: 14px; box-shadow: var(--shadow); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.rv-item:hover { border-color: #b9d6f1; box-shadow: 0 4px 14px rgba(0,80,140,.12); }
.rv-item:active { background: #f2f7fd; }
.rv-item:focus-visible { outline: 3px solid #7fbfe8; }
.rv-rank { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: #eef2f7; color: var(--muted); }
.rv-item.top1 .rv-rank { background: linear-gradient(135deg, #ffe27a, #e2a400); color: #5a3d00; }
.rv-item.top2 .rv-rank { background: linear-gradient(135deg, #e6ebf1, #aeb9c6); color: #35404d; }
.rv-item.top3 .rv-rank { background: linear-gradient(135deg, #f1c69b, #c98445); color: #4a2a08; }
.rv-main { min-width: 0; display: grid; gap: 5px; }
.rv-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.rv-name { font-size: 15.5px; min-width: 0; overflow-wrap: anywhere; }
.rv-item.big .rv-name { font-size: 17px; }
.rv-val { font-size: 19px; font-weight: 800; color: var(--blue-d); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rv-item.big .rv-val { font-size: 24px; }
.rv-par { font-size: 12.5px; color: var(--muted); }
.rv-bar { height: 9px; border-radius: 99px; background: #e8eef5; overflow: hidden; }
.rv-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #4aa3df, #0079c1); }
.rv-item.top1 .rv-bar i { background: linear-gradient(90deg, #f2c23a, #e0a000); }
.rv-meta { font-size: 12.5px; color: var(--muted); }
.rv-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rv-chips span { font-size: 12px; background: #f1f6fb; border-radius: 99px; padding: 3px 10px; color: var(--muted); }
.rv-chips b { color: var(--navy); font-variant-numeric: tabular-nums; }
.rv-go { color: #9aa8b8; display: inline-flex; }
.rv-item:hover .rv-go { color: var(--blue); }
.rv-more > summary { cursor: pointer; font-weight: 700; padding: 2px 0 10px; list-style: none; display: flex; align-items: center; gap: 8px; }
.rv-more > summary::before { content: '›'; font-size: 20px; transition: transform .15s; }
.rv-more[open] > summary::before { transform: rotate(90deg); }
.rv-more > summary::-webkit-details-marker { display: none; }
@media (max-width: 760px) { .rv-hero { grid-template-columns: 1fr; gap: 12px; padding: 16px; } .rv-h-v { font-size: 34px; } .rv-list.cards { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .rv-item { padding: 12px; gap: 10px; } .rv-item.big .rv-val { font-size: 21px; } .rv-h-grid { grid-template-columns: 1fr 1fr; } }
.rv-back { justify-self: start; display: inline-flex; align-items: center; gap: 4px; }

/* Tiến độ ngày: thẻ IP theo khu vực */
.dy-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 2px; }
.dy-stats div { background: #f4f8fc; border-radius: 10px; padding: 6px 8px; display: grid; gap: 1px; min-width: 0; }
.dy-stats span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.dy-stats b { font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dy-stats small, .rv-val small { font-size: 11px; font-weight: 600; color: var(--muted); }
.dy-zero { display: grid; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.dy-more { margin-top: 12px; }
@media (max-width: 560px) { .dy-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Khung cán bộ công ty: vòng xanh nước biển đậm + chức vụ phía trên */
.av-wrap.cbf > .avatar { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0b2f73, 0 2px 8px rgba(11,47,115,.35); }
.av-wrap .cb-top { position: absolute; left: 50%; top: 0; transform: translate(-50%, -62%); z-index: 1; white-space: nowrap; pointer-events: none;
  font: 800 max(8px, calc(var(--s) * .2))/1.35 Arial, sans-serif; letter-spacing: .03em; color: #fff; padding: 0 .55em;
  background: linear-gradient(180deg, #14429a, #072259); border: 1.5px solid #bcd8ff; border-radius: 999px; box-shadow: 0 1px 3px rgba(0,0,0,.35); }

/* Sơ đồ tổ chức: bấm vào người để xem thông tin */
.person.clickable { cursor: pointer; border-radius: 12px; transition: background .15s, box-shadow .15s; }
.person.clickable:hover, .person.clickable:focus-visible { background: #eef4fc; box-shadow: 0 0 0 1.5px #bcd3f0; outline: none; }
.person.clickable:active { background: #e1ecfa; }
.pp-head { display: flex; align-items: center; gap: 16px; padding: 8px 4px 14px; }
.pp-name { font-size: 18px; }

/* Tiến độ ngày: ô IP ngày gọn theo hàng ngang */
.pt-day2 { display: block; padding-top: 12px; padding-bottom: 12px; }
.pt-day2 .pd-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pt-day2 .pt-v { margin-top: 0; font-size: 28px; line-height: 1.1; text-align: right; }
.pt-day2 .pt-v small { font-size: 13px; color: var(--muted); }
.pt-day2 .pd-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.pt-day2 .pd-stats div { background: #f7f1df; border-radius: 10px; padding: 5px 8px; min-width: 0; display: grid; }
.pt-day2 .pd-stats span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.pt-day2 .pd-stats b { font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* thẻ khu vực: 4 chỉ số trên một hàng, thanh tiến độ gọn */
@media (max-width: 560px) {
  .dy-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .dy-stats div { padding: 4px 5px; }
  .dy-stats span { font-size: 10px; }
  .dy-stats b { font-size: 12.5px; }
  .dy-stats small { display: none; }
  .dy-item { padding-top: 8px; padding-bottom: 8px; }
}
.comp-card table.tbl td, .comp-card table.tbl th { white-space: normal; min-width: 72px; vertical-align: top; }
.comp-card table.tbl { width: 100%; }
.comp-imgs { display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.comp-imgs img { max-height: 260px; max-width: 100%; border-radius: 10px; cursor: zoom-in; flex: none; border: 1px solid var(--line, #e3e7ee); }
.comp-imgs.edit { flex-wrap: wrap; margin: 6px 0; }
.comp-imgs.edit .ci { position: relative; }
.comp-imgs.edit img { height: 90px; width: auto; cursor: default; }
.comp-imgs.edit .ci button { position: absolute; top: 2px; right: 2px; background: #fff; }
.chk-grid { display: flex; flex-wrap: wrap; gap: 6px 14px; max-height: 150px; overflow: auto; }
.chk { display: flex; align-items: center; gap: 5px; font-size: 14px; }
.comp-res { background: #F4F8FD; border: 1px solid #DCE7F5; border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; }
.comp-me { display: flex; align-items: baseline; gap: 10px; }
.comp-amt { font-size: 22px; font-weight: 700; color: var(--green, #0a7a3d); }
.ce-card { background: #FAFBFD; border: 1px solid #DCE3EE; padding: 10px; }
.ce-card .field { min-width: 120px; flex: 1; }

/* ===== Chấm công: giao diện mới, ưu tiên điện thoại, chỉ cuộn dọc ===== */
.pc { display: grid; gap: 14px; max-width: 560px; margin: 0 auto; min-width: 0; }
.pc > * { min-width: 0; }
.pc-hero { text-align: center; color: #fff; border-radius: 18px; padding: 22px 16px 18px; background: linear-gradient(135deg, #0b3a63 0%, #0079c1 100%); box-shadow: 0 6px 18px rgba(0,80,140,.25); }
.pc-hero .att-time { color: #fff; font-size: 46px; line-height: 1.1; }
.pc-hero .att-date { color: rgba(255,255,255,.9); font-size: 15px; margin: 4px 0 8px; }
.pc-who { display: inline-block; font-size: 13px; background: rgba(255,255,255,.16); border-radius: 99px; padding: 3px 12px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-card { display: grid; gap: 12px; }
.pc-step { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14.5px; color: #11263a; margin-top: 4px; }
.pc-step i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; background: #0079c1; color: #fff; display: inline-grid; place-items: center; font-size: 12px; }
.pc-snap .btn { width: 100%; }
.pc .att-shifts button { padding: 12px 6px; }
.pc .att-shifts button span { font-size: 11.5px; line-height: 1.25; }
.att-list { display: grid; gap: 10px; }
.att-item, .att-day, .att-p { border: 1px solid #e3e9f0; border-radius: 12px; padding: 12px; background: #fff; min-width: 0; }
.att-item-h, .att-day-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.att-item-v, .att-day-v { color: #0079c1; font-weight: 700; }
.att-io { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.att-io small, .att-p-g small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.att-days { display: grid; gap: 10px; margin-top: 10px; grid-template-columns: minmax(0, 1fr); }
.att-day.wk { background: #fafbfd; }
.att-day.wk .att-day-h b { color: #c0392b; }
.att-day-f { margin-top: 8px; }
.att-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
.att-kpis .kpi { padding: 12px !important; }
.att-kpis .kpi-val { font-size: 24px !important; }
.att-kpis .kpi-title { font-size: 12.5px !important; }
.att-people { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.att-p { cursor: pointer; display: grid; gap: 10px; }
.att-p:active { background: #f3f8fc; }
.att-p-h { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.att-p-n { display: grid; gap: 2px; min-width: 0; }
.att-p-n b { overflow-wrap: anywhere; }
.att-p-t { text-align: right; flex: none; }
.att-p-t b { display: block; font-size: 22px; color: #0079c1; line-height: 1.1; font-variant-numeric: tabular-nums; }
.att-p-g { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; background: #f5f8fb; border-radius: 10px; padding: 8px; text-align: center; }
.att-p-g b { font-size: 14px; font-variant-numeric: tabular-nums; }
.att-p-f { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.att-entry { min-width: 0; }
@media (min-width: 700px) {
  .att-days, .att-people { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .att-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
}
@media (min-width: 1100px) { .att-people { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ===== Thông báo sự kiện ===== */
.ev-tabs { margin-bottom: 12px; }
.ev-tabs .ev-new { margin-left: auto; }
.ev-list { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .ev-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ev-card { display: grid; gap: 10px; min-width: 0; border-left: 4px solid #0079c1; }
.ev-card h3 { margin: 0; overflow-wrap: anywhere; }
.ev-card.past { border-left-color: #b8c2cf; opacity: .85; }
.ev-card.off { border-left-color: #e0a100; background: #fffdf5; }
.ev-body { display: grid; gap: 6px; min-width: 0; }
.ev-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.ev-row { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 8px; font-size: 14.5px; }
.ev-k { color: var(--muted); }
.ev-v { overflow-wrap: anywhere; font-weight: 500; }
.ev-note { margin: 4px 0 0; padding: 10px 12px; background: #f5f8fb; border-radius: 10px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.ev-rsvp .btn { flex: 1 1 140px; }
.ev-adm { border-top: 1px solid #eef1f5; padding-top: 10px; }
.ev-sec { border: 1px solid #e3e9f0; border-radius: 12px; padding: 10px 12px 12px; display: grid; gap: 10px; min-width: 0; margin: 0; }
.ev-sec legend { font-weight: 700; font-size: 14px; padding: 0 6px; }
.ev-ul { margin: 4px 0 0; padding-left: 18px; font-size: 14px; }
tr.sel td { background: #e8f3fb !important; }
.rv-inc:empty { display: none; }
dialog.modal.wide.inc-modal { width: min(1040px, calc(100vw - 24px)); }
@media (max-width: 700px) { dialog.modal.wide.inc-modal { width: 100vw; } }

/* ===== Tài khoản (danh sách thẻ) ===== */
.badge.amber { background: #fff4dc; color: var(--orange); }
.us-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.us-stat { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--r-sm, 10px); background: var(--card); cursor: pointer; text-align: left; font: inherit; color: var(--navy); }
.us-stat b { font-size: 22px; line-height: 1.1; }
.us-stat span { font-size: 12.5px; color: var(--muted); }
.us-stat.green b { color: var(--green); } .us-stat.amber b { color: var(--orange); } .us-stat.red b { color: var(--red); }
.us-stat.on { border-color: var(--blue); background: var(--sky); }
.us-bar { display: grid; gap: 10px; margin-bottom: 12px; }
.us-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.us-tools .grow { flex: 1 1 220px; min-width: 0; }
.us-tools select { flex: 0 1 180px; }
.us-more { position: relative; }
.us-more > summary { list-style: none; cursor: pointer; }
.us-more > summary::-webkit-details-marker { display: none; }
.us-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 240px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(15, 30, 51, .16); padding: 6px; display: grid; }
.us-mi { text-align: left; background: none; border: 0; padding: 11px 12px; border-radius: 8px; font: inherit; color: var(--navy); cursor: pointer; }
.us-mi:hover { background: var(--sky); }
.us-org-f > summary { cursor: pointer; color: var(--blue-d); font-size: 14px; font-weight: 600; }
.us-org-f[open] > summary { margin-bottom: 10px; }
.us-list { display: grid; gap: 8px; }
.us-row { display: grid; grid-template-columns: 44px minmax(160px, 1.1fr) minmax(0, 1.6fr) auto; align-items: center; gap: 12px; padding: 10px 14px; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); cursor: pointer; border: 1.5px solid transparent; }
.us-row:hover, .us-row:focus-visible { border-color: var(--blue); outline: none; }
.us-row.off { opacity: .6; }
.us-main b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.us-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.us-head { display: flex; align-items: center; gap: 12px; }
@media (max-width: 720px) {
  .us-stats { grid-template-columns: repeat(2, 1fr); }
  .us-row { grid-template-columns: 44px 1fr; row-gap: 6px; }
  .us-org { grid-column: 1 / -1; }
  .us-tags { grid-column: 1 / -1; justify-content: flex-start; }
  .us-tools select, .us-tools .btn { flex: 1 1 auto; }
  .us-menu { max-width: calc(100vw - 48px); }
}

/* ===== Bảng bậc thưởng, tiến độ thi đua ===== */
.tt { display: grid; gap: 8px; }
.tt-row { display: grid; grid-template-columns: calc(var(--n, 1) * 104px + (var(--n, 1) - 1) * 6px) 150px minmax(0, 1.2fr) minmax(0, 1fr) 40px; gap: 8px; align-items: start; }
.tt-mins { display: grid; grid-template-columns: repeat(var(--n, 1), minmax(0, 1fr)); gap: 6px; }
.tt-mins > span { white-space: normal; line-height: 1.25; }
.tt-row.tt-head { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.tt-val { display: grid; gap: 6px; }
.comp-part { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.comp-prog { height: 8px; border-radius: 99px; background: #e8edf3; overflow: hidden; }
.comp-prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--green)); border-radius: 99px; }
@media (max-width: 720px) {
  .tt-row { grid-template-columns: 1fr 1fr 40px; }
  .tt-row.tt-head { display: none; }
  .tt-row > :nth-child(3), .tt-row > :nth-child(4) { grid-column: 1 / -1; }
  .tt-row > :nth-child(5) { grid-column: 3; grid-row: 1; }
  .tt.multi .tt-row { grid-template-columns: 1fr 40px; }
  .tt.multi .tt-row > * { grid-column: 1 / -1; }
  .tt.multi .tt-row > .tt-mins { grid-column: 1; grid-row: 1; }
  .tt.multi .tt-row > :nth-child(5) { grid-column: 2; grid-row: 1; }
}
.tt.pts .tt-row { grid-template-columns: calc(var(--n, 1) * 104px + (var(--n, 1) - 1) * 6px) minmax(0, 1fr) minmax(0, 1fr) 40px; }
.cd-box { display: grid; gap: 8px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; }
.cd-row { display: grid; grid-template-columns: minmax(0, 2fr) auto 90px minmax(0, 1.5fr) 40px; gap: 8px; align-items: center; }
.cd-ok { color: var(--green); font-weight: 600; } .cd-no { color: var(--red); font-weight: 600; }
@media (max-width: 720px) { .cd-row { grid-template-columns: 1fr 1fr 40px; } .cd-row > :first-child, .cd-row > :nth-child(4) { grid-column: 1 / -1; } .cd-row > :nth-child(2) { display: none; } }
/* Nhóm đối tượng (Hệ thống đại lý / Cán bộ công ty) */
.aud-sec { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 12px; margin: 0; min-width: 0; }
.aud-sec > legend { padding: 0 6px; font-size: 14px; }
.aud-top b { font-size: 14.5px; color: var(--blue); }
.aud-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px 16px; align-items: start; }
.aud-sub { display: grid; gap: 4px; padding: 6px 8px; border-radius: 8px; background: var(--bg, #f5f7fa); }
.aud-subs { display: grid; gap: 2px; padding-left: 22px; }
/* Quản lý điểm danh: thẻ hoạt động */
.roll-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; align-items: start; }
.roll-card { display: grid; gap: 8px; padding: 14px; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); border-left: 5px solid var(--line); min-width: 0; }
.roll-card.open { border-left-color: var(--green); }
.roll-card.soon { border-left-color: var(--orange); }
.roll-card.done { opacity: .92; }
.roll-name { margin: 0; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.roll-aud { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.roll-bar { height: 8px; border-radius: 99px; background: #e8edf3; overflow: hidden; margin-top: 4px; }
.roll-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--green)); border-radius: 99px; }
.roll-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 2px; }
.roll-foot .btn:first-child { flex: 1 1 140px; justify-content: center; }
@media (max-width: 720px) { .roll-list { grid-template-columns: 1fr; } }
/* Câu lạc bộ */
.club-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; align-items: start; margin-top: 10px; }
.club-card { display: grid; gap: 8px; padding: 14px; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); border-left: 5px solid var(--line); min-width: 0; }
.club-card.member { border-left-color: var(--green); }
.club-card.pending { border-left-color: var(--orange); }
.club-card.rejected { border-left-color: var(--red); }
.club-name { margin: 0; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.don { display: grid; gap: 10px; line-height: 1.5; }
.don p { margin: 0; }
.don-t { text-align: center; margin: 0 0 4px; font-size: 15.5px; line-height: 1.4; }
.don-ul { margin: 4px 0 0; padding-left: 20px; }
@media (max-width: 720px) { .club-grid { grid-template-columns: 1fr; } }

/* Danh sách thành viên CLB */
.mem-list{display:flex;flex-direction:column;border:1px solid var(--line,#e3e8ef);border-radius:12px;overflow:hidden;max-height:52vh;overflow-y:auto;background:var(--card,#fff)}
.mem-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border-bottom:1px solid var(--line,#e3e8ef)}
.mem-row:last-child{border-bottom:0}
.mem-main{min-width:0;flex:1}
.mem-name{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.mem-row .btn{flex:none}

/* Trang chủ: phiếu kho chờ duyệt */
.adv-home{display:flex;align-items:center;gap:12px;padding:12px 14px;margin-bottom:12px;text-decoration:none;color:inherit;border-left:4px solid #e5383b;background:#fff5f5}
.adv-home-ic{display:grid;place-items:center;width:40px;height:40px;border-radius:12px;background:#e5383b;color:#fff;flex:none}
.adv-home-tx{display:flex;flex-direction:column;flex:1;min-width:0}
.adv-home-tx small{color:#667085}
.sheet-item .nb{margin-left:auto;margin-right:6px;animation:none}

/* Mục Kho trên điện thoại: bảng ít cột → danh sách thẻ; số liệu tổng quan 2 cột */
@media (max-width: 560px) {
  .tbl-wrap.stack { max-height: none; overflow: visible; background: none; box-shadow: none; border: 0; }
  .tbl-wrap.stack table, .tbl-wrap.stack tbody, .tbl-wrap.stack tfoot, .tbl-wrap.stack tr, .tbl-wrap.stack td { display: block; width: 100%; }
  .tbl-wrap.stack thead { display: none; }
  .tbl-wrap.stack tr { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 0 0 8px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
  .tbl-wrap.stack td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; border: 0 !important; text-align: right; min-height: 0; }
  .tbl-wrap.stack td::before { content: attr(data-l); color: #667085; font-size: 12.5px; text-align: left; flex: none; }
  .tbl-wrap.stack td:first-child { font-weight: 700; font-size: 15px; text-align: left; justify-content: flex-start; }
  .tbl-wrap.stack td:first-child::before { content: none; }
  .tbl-wrap.stack td:empty { display: none; }
  .tbl-wrap.stack tfoot tr { background: #f2f6fb; }
  .tbl-wrap.stack tr.click:active { background: #f2f6fb; }
  .tbl-wrap.stack td > * { max-width: 100%; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tiles .tile, .tiles > * { padding: 12px; }
}
@media (max-width: 560px) {
  .tbl-wrap.stack tbody tr, .tbl-wrap.stack tfoot tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; }
  .tbl-wrap.stack td { box-shadow: none !important; flex-direction: column; align-items: flex-start; text-align: left; justify-content: flex-start; gap: 1px; padding: 3px 0; min-width: 0; overflow-wrap: anywhere; }
  .tbl-wrap.stack td.num { align-items: flex-start; text-align: left; }
  .tbl-wrap.stack td:first-child { grid-column: 1 / -1; flex-direction: row; align-items: center; }
  .tbl-wrap.stack td:last-child:nth-child(even) { grid-column: auto; }
  .tbl-wrap.stack td::before { font-size: 11.5px; }
}
@media (max-width:560px){.tbl-wrap.stack td{background:transparent !important}.tbl-wrap.stack td:not([data-l]):not(:first-child){grid-column:1/-1}}

/* Ứng hàng: ảnh lớn hơn để phân biệt mặt hàng; phiếu đã xử lý hiện thẻ gọn */
.thumb.md { width: 64px; height: 64px; border-radius: 10px; }
.thumb.md.ph { font-size: 24px; }
.line-thumb { width: 64px; height: 64px; }
.adv-line { grid-template-columns: 64px 1fr 120px 42px; }
@media (max-width: 560px) { .adv-line { grid-template-columns: 64px 1fr 42px; } }
.adv-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px; }
.adv-chip { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfd; min-width: 0; }
.adv-chip-tx { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.adv-chip-tx b { font-size: 14px; overflow-wrap: anywhere; }
.adv-chip-tx small, .adv-chip-q small { color: #667085; font-size: 12px; }
.adv-chip-q { display: flex; flex-direction: column; align-items: flex-end; flex: none; line-height: 1.2; }
.adv-chip-q b { font-size: 16px; }
.adv-chip .thumb { width: 40px; height: 40px; }

/* Mục Kho trên điện thoại: gọn, bớt khoảng trắng */
@media (max-width: 560px) {
  .stack.kho { gap: 8px; }
  .kho .card, .kho section.card { padding: 10px 12px; }
  .kho .card h2, .kho section.card h2 { font-size: 16px; margin: 0 0 6px; }
  .kho .card h3 { margin: 6px 0 4px; font-size: 15px; }
  .kho .tile { padding: 8px 10px; }
  .kho .tile-val { font-size: 18px; margin-top: 0; }
  .kho .tile-label, .kho .tile-sub { font-size: 12px; }
  .kho .filters, .kho .card.filters { gap: 6px; }
  .kho .form-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kho .row { gap: 6px; }
  .kho .mini-list li { padding: 6px 0; }
  .kho .bar-row { margin: 4px 0; }
  .kho .btn { min-height: 38px; padding-top: 6px; padding-bottom: 6px; }
  .kho .two-col { gap: 8px; }
  .kho .tabs { margin-bottom: 0; }
  .tbl-wrap.stack tr { padding: 6px 10px; margin: 0 0 6px; }
  .tbl-wrap.stack td { padding: 1px 0; }
  .tbl-wrap.stack td::before { font-size: 11px; }
  .tbl-wrap.stack.wide tbody tr, .tbl-wrap.stack.wide tfoot tr { grid-template-columns: repeat(3, 1fr); gap: 0 10px; }
  .tbl-wrap.stack.wide td:nth-child(2) { grid-column: 1 / -1; flex-direction: row; font-weight: 600; }
  .tbl-wrap.stack.wide td:nth-child(2)::before { content: none; }
  .tbl-wrap.stack.wide td:first-child { font-size: 12.5px; color: #667085; font-weight: 600; }
  .tbl-wrap.stack.wide td:nth-child(3) { grid-column: 1 / -1; flex-direction: row; gap: 6px; }
}

/* Nhập xuất tồn trên điện thoại: mỗi mặt hàng một thẻ 4 dòng (mã/ĐVT, tên, số lượng, giá trị) */
@media (max-width: 560px) {
  .tbl-wrap.stack.nxt tbody tr, .tbl-wrap.stack.nxt tfoot tr { grid-template-columns: repeat(12, 1fr); gap: 0 6px; padding: 6px 10px; }
  .tbl-wrap.stack.nxt td { grid-column: auto; flex-direction: column; align-items: flex-start; font-size: 14px; font-variant-numeric: tabular-nums; }
  .tbl-wrap.stack.nxt td:nth-child(1) { grid-column: 1 / 9; grid-row: 1; font-size: 12px; color: #667085; font-weight: 600; flex-direction: row; }
  .tbl-wrap.stack.nxt td:nth-child(3) { grid-column: 9 / 13; grid-row: 1; flex-direction: row; justify-content: flex-end; font-size: 12px; color: #667085; }
  .tbl-wrap.stack.nxt td:nth-child(3)::before { content: none; }
  .tbl-wrap.stack.nxt td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; font-size: 15px; font-weight: 700; flex-direction: row; }
  .tbl-wrap.stack.nxt td:nth-child(2)::before { content: none; }
  .tbl-wrap.stack.nxt td:nth-child(n+4):nth-child(-n+7) { grid-column: span 3; grid-row: 3; padding-top: 4px; }
  .tbl-wrap.stack.nxt td:nth-child(n+8):nth-child(-n+10) { grid-column: span 4; grid-row: 4; border-top: 1px dashed #e4e8ee !important; margin-top: 3px; padding-top: 3px; }
  .tbl-wrap.stack.nxt td:nth-child(7) { font-weight: 700; }
  .tbl-wrap.stack.nxt td:nth-child(n+8):nth-child(-n+10), .tbl-wrap.stack.nxt td:nth-child(n+4):nth-child(-n+7) { text-align: left; }
}
@media (max-width:560px){.tbl-wrap.stack.nxt td:nth-child(n+11){display:none}}

/* Tiến độ ngày: khu vực không có doanh thu hôm trước */
.dy-prev { margin-top: 14px; padding: 12px; border: 1px solid #f3d9a4; background: #fffaf0; border-radius: 12px; display: grid; gap: 8px; }
.dy-prev-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.dy-prev-item { display: flex; flex-direction: column; padding: 6px 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; line-height: 1.3; min-width: 0; }
.dy-prev-item b { font-size: 14px; overflow-wrap: anywhere; }
.dy-prev-item small { color: #667085; font-size: 12px; }

/* Chọn mặt hàng có hình ảnh */
.ipick { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 10px 6px 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: left; cursor: pointer; font: inherit; color: inherit; min-height: 56px; }
.ipick:hover { border-color: #9db7d5; }
.ipick.empty { border-style: dashed; }
.ipick-ph { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 10px; background: #eef3f9; color: #7a8ba3; flex: none; }
.ipick .thumb.md { flex: none; }
.ipick-tx { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.ipick-tx b { font-size: 14.5px; overflow-wrap: anywhere; }
.ipick-tx small { color: #667085; font-size: 12.5px; }
.ipick-go { color: #7a8ba3; font-style: normal; flex: none; }
.ipick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ipick-cat { grid-column: 1 / -1; font-weight: 700; font-size: 13px; color: #44566f; padding: 6px 0 0; border-bottom: 1px solid var(--line); }
.ipick-card { display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: left; cursor: pointer; font: inherit; color: inherit; position: relative; min-width: 0; }
.ipick-card:hover { border-color: #5b8fc7; box-shadow: 0 2px 8px rgba(0,60,130,.12); }
.ipick-card.on { border-color: #0079c1; box-shadow: 0 0 0 2px #0079c1 inset; }
.ipick-card.out { opacity: .6; }
.ipick-card b { font-size: 13.5px; line-height: 1.25; overflow-wrap: anywhere; }
.ipick-card small { color: #667085; font-size: 12px; }
.ipick-img { width: 100%; aspect-ratio: 1; height: auto; object-fit: cover; border-radius: 8px; background: #E8EDF3; display: block; }
div.ipick-img.ph { display: grid; place-items: center; font-size: 36px; font-weight: 700; color: #7a8ba3; }
.ipick-ton { font-size: 12px; font-weight: 600; color: #0f7a55; }
.ipick-card.out .ipick-ton { color: #c0362c; }
@media (max-width: 560px) { .ipick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }
/* dòng hàng dùng ô chọn có ảnh: bỏ cột ảnh riêng */
.line-row.pk { grid-template-columns: 1fr 110px 130px 42px; grid-template-areas: 'sel q p x' 'hint hint hint hint'; }
.line-row.adv-line.pk { grid-template-columns: 1fr 120px 42px; grid-template-areas: 'sel q x' 'hint hint hint'; }
@media (max-width: 560px) {
  .line-row.pk { grid-template-columns: 1fr 1fr 42px; grid-template-areas: 'sel sel x' 'q p p' 'hint hint hint'; }
  .line-row.adv-line.pk { grid-template-columns: 1fr 42px; grid-template-areas: 'sel x' 'q q' 'hint hint'; }
}

.ipick-search { position: sticky; top: 0; z-index: 2; background: #fff; padding: 2px 0 6px; }
.ipick-search input { width: 100%; min-height: 44px; font-size: 16px; }

/* Chi tiết doanh thu: mức hoàn thành kế hoạch */
.rv-plan { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 12.5px; margin-top: 4px; }
.rv-plan-b { font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.rv-plan.ok .rv-plan-b { background: #e3f6ea; color: #137a3c; }
.rv-plan.no .rv-plan-b { background: #fdecea; color: #c0362c; }
.rv-plan-m { color: #c0362c; font-weight: 600; }
.rv-item:has(.rv-plan.ok) { border-left: 4px solid #16a34a; }
.rv-item:has(.rv-plan.no) { border-left: 4px solid #d93025; }
.rv-planbar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; }
.rv-chipsel { display: flex; flex-wrap: wrap; gap: 6px; }
.rv-chipbtn { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.rv-chipbtn.on { background: #0b3a6b; border-color: #0b3a6b; color: #fff; }
.plan-pct.ok { color: #137a3c; font-weight: 700; } .plan-pct.no { color: #c0362c; font-weight: 700; }

/* Tiến độ năm trên điện thoại: thanh tiến độ từng tháng / phòng / AD */
.ym-list { display: grid; gap: 8px; }
.ym-row { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 6px; background: #fff; }
.ym-row.now { border-color: #0079c1; box-shadow: 0 0 0 1px #0079c1 inset; }
.ym-row.fut { background: #f7f9fc; color: #667085; }
.ym-h { display: flex; align-items: center; gap: 6px; }
.ym-h b { font-size: 15px; }
.ym-chip { font-weight: 700; font-size: 13px; padding: 2px 10px; border-radius: 999px; }
.ym-chip.none { background: #eef1f5; color: #667085; font-weight: 500; font-size: 12px; }
.ym-bar { height: 8px; border-radius: 6px; background: #e8edf3; overflow: hidden; }
.ym-bar i { display: block; height: 100%; border-radius: 6px; }
.ym-n { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: #44566f; }
.ym-n b { color: #0b2a4a; font-variant-numeric: tabular-nums; }
.ym-c { font-size: 12.5px; color: #667085; }
.ym-lab { display: flex; align-items: center; font-size: 12.5px; color: #667085; margin-top: 2px; }
.ym-tot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; padding: 10px 12px; background: #eef4fb; border-radius: 12px; }
.ym-tot span { flex: 1; font-size: 13px; }
.ym-calc > summary { font-weight: 700; cursor: pointer; font-size: 16px; }

/* Theo dõi thăng tiến */
.pm-card { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 6px; background: #fff; }
.pm-card.ok { border-color: #16a34a; box-shadow: 0 0 0 1px #16a34a inset; }
.pm-c { display: grid; gap: 4px; }
.pm-kids > summary { cursor: pointer; font-size: 13px; color: #0079c1; }
.pm-kids .ym-n { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.ym-chip { white-space: nowrap; flex: none; }
.pm-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.pm-tabs .rv-chipbtn { white-space: nowrap; flex: none; }

/* Chế độ xem theo vai trò người dùng (chỉ quản trị, chỉ đọc) */
.va-bar { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 99999; display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 24px); padding: 8px 8px 8px 16px; border-radius: 999px; background: #b45309; color: #fff; font-size: .9rem; box-shadow: 0 6px 24px rgba(0, 0, 0, .35); }
.va-bar button { border: 0; border-radius: 999px; padding: 7px 14px; background: #fff; color: #7c2d12; font-weight: 700; cursor: pointer; white-space: nowrap; }
body.viewas { box-shadow: inset 0 0 0 3px #b45309; }

/* Tuyển ngang: thẻ theo tháng, xếp dọc trên điện thoại */
.tg-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.tg-tot { text-align: right; } .tg-tot b { font-size: 1.15rem; }
.tg-list { display: grid; gap: 8px; margin-top: 10px; }
.tg-m { border: 1px solid var(--line, rgba(127, 127, 127, .25)); border-radius: 10px; padding: 10px 12px; }
.tg-m.now { border-color: #2563eb; } .tg-m.cum { background: rgba(127, 127, 127, .08); }
.tg-mh { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.tg-pay { font-size: .9rem; color: var(--muted, #6b7280); white-space: nowrap; } .tg-pay.ok { color: #16a34a; font-weight: 700; }
.tg-k { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tg-c.off { opacity: .5; } .tg-l { font-size: .8rem; color: var(--muted, #6b7280); } .tg-v { font-size: 1.02rem; }
.tg-bar { height: 6px; border-radius: 4px; background: rgba(127, 127, 127, .2); margin-top: 4px; overflow: hidden; } .tg-bar i { display: block; height: 100%; }
.tg-sg { display: flex; justify-content: space-between; gap: 8px; align-items: center; border-bottom: 1px solid rgba(127, 127, 127, .15); padding-bottom: 6px; }
@media (max-width: 560px) { .tg-k { grid-template-columns: 1fr 1fr; } .tg-head { flex-direction: column; } .tg-tot { text-align: left; } }

/* Cảnh báo ngày cuối thi đua trên trang chủ */
.cw-card { border-left: 4px solid #f59e0b; }
.cw-row { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border-radius: 8px; background: rgba(245, 158, 11, .1); color: inherit; text-decoration: none; }
.cw-row.hot { background: rgba(217, 48, 37, .12); } .cw-row.hot .cw-d { color: #d93025; font-weight: 700; }
.cw-n { font-weight: 600; } .cw-d { font-size: .9rem; color: #b45309; }
.rv-total { margin-top: 10px; }

/* Cuộc bán hàng từ AD Portal */
.pt-bar { display: grid; gap: 10px; }
.pt-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pt-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.pt-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.pt-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.pt-kpis > div { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 12px; text-align: center; display: grid; gap: 2px; }
.pt-kpis b { font-size: 22px; }
.pt-kpis span { font-size: 12px; color: var(--muted); }
.pt-grp { padding: 0; overflow: hidden; }
.pt-gh { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; padding: 10px 14px; background: var(--sky); }
.pt-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid #eef0f3; padding: 10px 14px; cursor: pointer; font: inherit; color: inherit; }
.pt-row:hover, .pt-row:focus-visible { background: #f6f9fc; }
.pt-who { display: grid; gap: 2px; min-width: 0; }
.pt-who b, .pt-who span { overflow: hidden; text-overflow: ellipsis; }
.pt-nums { display: flex; gap: 14px; flex: none; }
.pt-nums > div { display: grid; text-align: center; min-width: 44px; }
.pt-nums b { font-size: 17px; }
.pt-nums span { font-size: 11px; color: var(--muted); }
.pt-sess { display: grid; gap: 0; }
.pt-s { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 2px; border-top: 1px solid #eef0f3; }
.pt-s:first-child { border-top: 0; }
.pt-s-main { display: grid; gap: 2px; min-width: 0; }
.pt-s-side { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 560px) { .pt-nums { gap: 8px; } .pt-nums > div { min-width: 38px; } .pt-row { padding: 10px; } }
.pt-dates input, .pt-filters select, .pt-filters input { min-width: 0; width: 100%; }

/* Quản lý thành viên CLB: thẻ câu lạc bộ + danh sách thành viên */
.mgrid { margin-top: 0; }
.mcard { border-left: 0; gap: 12px; padding: 16px; }
.mc-head { display: flex; gap: 12px; align-items: center; }
.mc-ic { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; color: #fff; background: linear-gradient(135deg, #d4a017, #e0602f); }
.mc-t { min-width: 0; }
.mc-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.mc-stats > div { background: var(--sky); border-radius: 10px; padding: 8px 10px; display: grid; gap: 1px; }
.mc-stats b { font-size: 20px; line-height: 1.1; }
.mc-stats span { font-size: 12px; color: var(--muted); }
.mc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mc-actions .btn { flex: 1 1 auto; justify-content: center; }
.mc-admin { display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid #eef0f3; padding-top: 10px; }
.mem-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.mem-search { position: sticky; top: -1px; z-index: 2; background: var(--card, #fff); padding: 6px 0; }
.mem-search input { width: 100%; min-height: 44px; border-radius: 12px; }
.mem-add { border: 1px solid var(--line, #e3e8ef); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: #fafbfd; }
.mem-add summary { cursor: pointer; font-weight: 700; min-height: 32px; display: flex; align-items: center; }
.mem-row { gap: 12px; padding: 12px; }
.mem-av { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; background: linear-gradient(135deg, #0079c1, #1e9bd6); }
.mem-av.off { background: #b6bec9; }
.mem-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; align-items: center; }
.mem-code { font-size: 12px; font-weight: 600; color: var(--blue-d); background: var(--sky); padding: 1px 8px; border-radius: 99px; }
.mem-chip { font-size: 12px; color: #8a5a00; background: #fff4d6; padding: 1px 8px; border-radius: 99px; }
.mem-org { margin-top: 3px; overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .mem-list { max-height: none; border-radius: 14px; }
  .mem-row .btn.sm { min-height: 36px; padding: 0 10px; }
  .mem-row { padding: 10px; gap: 10px; }
  .mem-av { width: 38px; height: 38px; font-size: 13px; }
  .mc-actions .btn { flex: 1 1 calc(50% - 8px); }
  .mc-actions .btn:first-child { flex-basis: 100%; }
}

/* Trang Câu lạc bộ của TVV (điện thoại) và thanh "đang xem với vai trò" */
.club-card { gap: 10px; }
.club-card .club-name { font-size: 17px; }
.club-card .badge { white-space: nowrap; }
.club-det { background: #f6f8fb; border-radius: 10px; padding: 8px 12px; }
.club-det summary { cursor: pointer; font-weight: 600; font-size: 13.5px; min-height: 28px; display: flex; align-items: center; }
.club-det[open] summary { margin-bottom: 4px; }
.club-box { background: #eef6ff; border-radius: 10px; padding: 10px 12px; line-height: 1.45; }
.club-box.bad { background: #fdeceb; color: var(--red); }
.club-comps { display: grid; gap: 6px; }
.club-comp { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; padding: 10px 12px; border-radius: 10px; background: #fff7e6; color: inherit; text-decoration: none; min-height: 48px; }
.club-comp .cc-n { font-weight: 700; grid-column: 1; }
.club-comp .cc-d { font-size: 12.5px; color: #b45309; grid-column: 1; }
.club-comp i { grid-column: 2; grid-row: 1 / span 2; font-style: normal; font-size: 22px; color: #b45309; }
@media (max-width: 900px) {
  .va-bar { left: 0; right: 0; transform: none; max-width: none; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); border-radius: 0; justify-content: space-between; gap: 8px; padding: 6px 10px 6px 14px; font-size: 13px; box-shadow: 0 -2px 10px rgba(0, 0, 0, .2); }
  .va-bar span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .va-bar button { flex: none; padding: 6px 12px; }
}
