/* Indoortek Booking. Dùng chung cho trang khách (index.html) và trang quản trị (admin.html). */

:root {
  --ink: #0D0F14;
  --ink-2: #161922;
  --ink-3: #1E222D;
  --line-dark: #2A2F3B;
  --muted-dark: #A3A7B3;
  --paper: #FFFFFF;
  --paper-2: #F4F4F1;
  --text: #0D0F14;
  --muted: #4E525C;
  --line: #E1E2E6;
  --accent: #F9BF3E;
  --accent-hover: #FFCD5C;
  --ok: #1F7A3D;
  --ok-bg: #E6F4EA;
  --wait: #8A5A00;
  --wait-bg: #FFF4D6;
  --bad: #B3263E;
  --bad-bg: #FDE8EC;
  --radius: 12px;
  --gutter: 20px;
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); font-size: 16px; line-height: 1.55; color: var(--text); background: var(--paper-2); -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
[hidden] { display: none !important; }
b, strong { font-weight: 600; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Header ---------- */
.bk-header { position: sticky; top: 0; z-index: 50; background: var(--ink); color: #fff; }
.signal { display: flex; height: 3px; }
.signal i { flex: 1; }
.signal i:nth-child(1) { background: #E9DF3D; }
.signal i:nth-child(2) { background: #BDC940; }
.signal i:nth-child(3) { background: #F9BF3E; }
.signal i:nth-child(4) { background: #EFB641; }
.signal i:nth-child(5) { background: #F38E41; }
.signal i:nth-child(6) { background: #EC4C66; }
.signal i:nth-child(7) { background: #AB2E75; }
.bk-header .row { display: flex; align-items: center; gap: 16px; min-height: 57px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand img { height: 28px; width: auto; }
.brand span { font-size: 13px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; padding-left: 10px; border-left: 1px solid var(--line-dark); }
.bk-nav { display: flex; gap: 4px; order: 3; width: 100%; overflow-x: auto; }
.bk-nav a { padding: 8px 12px; border-radius: 8px; font-size: 15px; font-weight: 500; color: var(--muted-dark); text-decoration: none; white-space: nowrap; }
.bk-nav a[aria-current="page"] { color: #fff; background: var(--ink-3); }
.bk-nav a:hover { color: #fff; }
.bk-user { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--ink-3); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.pill .lbl { color: var(--muted-dark); font-weight: 500; }
.link-btn { font-size: 14px; color: var(--muted-dark); text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: #fff; }
@media (min-width: 900px) {
  .bk-nav { order: 0; width: auto; margin-left: 24px; }
}

/* ---------- Khung trang ---------- */
main { flex: 1; padding: 28px 0 64px; }
.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: clamp(26px, 5vw, 36px); line-height: 1.15; letter-spacing: -0.02em; }
.page-head p { color: var(--muted); margin-top: 8px; max-width: 46em; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; }
.card + .card { margin-top: 16px; }
.card h2 { font-size: 18px; letter-spacing: -0.01em; margin-bottom: 14px; }
.card h3 { font-size: 15px; margin-bottom: 10px; }
.step-no { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; margin-right: 10px; vertical-align: 2px; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.grid-2 > * { min-width: 0; }
@media (min-width: 960px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
  .sticky { position: sticky; top: 84px; }
}
.notice { padding: 14px 16px; border-radius: 10px; background: var(--wait-bg); color: var(--wait); font-size: 15px; }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice a { color: inherit; font-weight: 600; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }

/* ---------- Nút ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 8px; font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap; border: 1.5px solid transparent; transition: background-color .2s, border-color .2s; }
.btn-primary { background: var(--accent); color: var(--ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-3); }
.btn-line { border-color: var(--line); background: var(--paper); }
.btn-line:hover { border-color: var(--ink); }
.btn-danger { border-color: #F2B8C2; color: var(--bad); background: var(--paper); }
.btn-danger:hover { border-color: var(--bad); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Form ---------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; border: 0; min-width: 0; align-content: start; }
.field-row { display: grid; gap: 16px; }
@media (min-width: 640px) { .field-row { grid-template-columns: 1fr 1fr; } }
.field label, .field legend { font-size: 14px; font-weight: 500; }
.field .hint { font-size: 13px; color: var(--muted); }
.opt { color: var(--muted); font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; font-size: 16px;
  background: var(--paper); border: 1px solid #C9CBD1; border-radius: 8px; transition: border-color .2s;
}
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(249,191,62,.45); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.5; cursor: pointer; }
.check input { flex: none; width: 20px; height: 20px; margin-top: 1px; accent-color: var(--ink); }
.status-line { font-size: 15px; }
.status-line.bad { color: var(--bad); }
.status-line.ok { color: var(--ok); }

/* Chọn chuỗi */
.nets { display: grid; gap: 10px; }
@media (min-width: 640px) { .nets { grid-template-columns: 1fr 1fr; } }
.net { position: relative; display: block; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; }
.net input { position: absolute; opacity: 0; }
.net b { display: block; font-size: 16px; }
.net span { font-size: 14px; color: var(--muted); }
.net:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.net:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.net.off { cursor: not-allowed; opacity: .6; }

/* Chọn khu vực */
.areas-head { display: flex; justify-content: space-between; align-items: center; margin: 20px 0 10px; }
.areas { display: grid; gap: 8px; }
@media (min-width: 640px) { .areas { grid-template-columns: 1fr 1fr; } }
.area { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.area input { width: 18px; height: 18px; accent-color: var(--ink); flex: none; }
.area .nm { flex: 1; font-size: 15px; }
.area .ct { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.area:has(input:checked) { border-color: var(--ink); background: #FAFAF7; }

.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; background: var(--paper); }
.chip:hover { border-color: var(--ink); }

/* Tóm tắt ước lượng */
.summary { background: var(--ink); color: #fff; border-color: var(--ink); }
.summary h2 { color: #fff; }
.summary .big { font-size: clamp(32px, 7vw, 44px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.summary .big-lbl { color: var(--muted-dark); font-size: 14px; margin-top: 4px; }
.kv { display: grid; gap: 0; margin-top: 18px; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-dark); font-size: 15px; }
.kv dt { color: var(--muted-dark); }
.kv dd { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.kv .total dd { font-size: 20px; color: var(--accent); }
.summary .note { font-size: 13px; color: var(--muted-dark); margin-top: 14px; line-height: 1.5; }
.summary .btn { margin-top: 18px; }
.kv.light > div { border-top-color: var(--line); }
.kv.light dt { color: var(--muted); }

/* ---------- Bảng ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; white-space: nowrap; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #FAFAF7; }
.plus { color: var(--ok); }
.minus { color: var(--bad); }

/* Trạng thái */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.wait { background: var(--wait-bg); color: var(--wait); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.muted { background: #ECEDF0; color: var(--muted); }
.badge.run { background: var(--ink); color: var(--accent); }

/* Danh sách chiến dịch dạng thẻ trên điện thoại */
.camp { display: grid; gap: 10px; }
.camp a { display: grid; gap: 4px; padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; text-decoration: none; }
.camp a:hover { border-color: var(--ink); }
.camp .top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.camp .nm { font-weight: 600; }
.camp .meta { font-size: 14px; color: var(--muted); }

/* Tiến trình duyệt */
.steps { display: grid; gap: 0; counter-reset: s; }
.steps li { position: relative; padding: 0 0 18px 34px; font-size: 15px; }
.steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: #ECEDF0; color: var(--muted); }
.steps li::after { content: ""; position: absolute; left: 11px; top: 26px; bottom: 2px; width: 2px; background: var(--line); }
.steps li:last-child::after { display: none; }
.steps li.done::before { content: "\2713"; background: var(--ok); color: #fff; }
.steps li.now::before { background: var(--accent); color: var(--ink); }
.steps li.fail::before { content: "\00D7"; background: var(--bad); color: #fff; }
.steps small { display: block; color: var(--muted); font-size: 13px; }

/* KPI report */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
@media (min-width: 800px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpis > div { border-left: 2px solid var(--ink); padding-left: 12px; }
.kpis dt { font-size: clamp(22px, 5vw, 30px); font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpis dd { font-size: 13px; color: var(--muted); margin-top: 4px; }
.progress { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 4px 0 20px; }
.progress i { display: block; height: 100%; background: var(--ink); }
.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--ink); }
.chart .bar:hover { fill: #F38E41; }
.chart .ax { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.chart .grid { stroke: var(--line); stroke-width: 1; }

/* Chuyển khoản */
.transfer { display: grid; gap: 20px; align-items: start; }
@media (min-width: 640px) { .transfer { grid-template-columns: 220px 1fr; } }
.transfer img { width: 220px; border: 1px solid var(--line); border-radius: 10px; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; font-size: 18px; letter-spacing: .06em; background: var(--paper-2); padding: 4px 10px; border-radius: 6px; }
.copy { margin-left: 8px; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; color: var(--muted); }

/* Tab quản trị */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button { padding: 10px 14px; font-weight: 600; font-size: 15px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--ink); }
.tabs .count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--accent); color: var(--ink); font-size: 12px; text-align: center; }
.review { display: grid; gap: 14px; }
.review .head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.review dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; }
.review dt { color: var(--muted); }
.review dd { word-break: break-word; }
.review dd a { color: var(--text); font-weight: 600; }

/* Thông báo nổi */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 15px; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.bad { background: var(--bad); }

/* Footer */
.bk-footer { background: #07080B; color: var(--muted-dark); font-size: 13px; padding: 20px 0; }
.bk-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; }
.bk-footer a { color: var(--muted-dark); }

.loading { padding: 40px 0; text-align: center; color: var(--muted); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Dời lịch (trang quản trị) */
.resched { border-top: 1px solid var(--line); padding-top: 12px; }
.resched summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.review .notice { font-size: 14px; }

/* ---------- Lịch chọn khoảng ngày (calendar.js) ---------- */
.rp-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rp-field { text-align: left; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper); min-width: 0; }
.rp-field > span { display: block; font-size: 12px; color: var(--muted); }
.rp-field b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-field[aria-current="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.rp-days { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 6px; padding: 8px 14px; border-radius: 10px; background: var(--ink); color: #fff; }
.rp-days b { font-size: 20px; color: var(--accent); font-variant-numeric: tabular-nums; }
.rp-days span { font-size: 13px; color: var(--muted-dark); }
@media (min-width: 720px) {
  .rp-fields { grid-template-columns: 1fr 1fr auto; }
  .rp-days { grid-column: auto; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-width: 96px; }
}
.rp-help { font-size: 14px; color: var(--muted); margin: 12px 0 10px; }
.rp-cal { position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 14px 10px 12px; }
.rp-nav { position: absolute; top: 10px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; }
.rp-nav:hover:not(:disabled) { background: var(--paper-2); }
.rp-nav:disabled { opacity: .25; cursor: default; }
.rp-nav.prev { left: 8px; }
.rp-nav.next { right: 8px; }
.rp-months { display: grid; gap: 24px; }
.rp-months.two { grid-template-columns: 1fr 1fr; }
.rp-month h4 { text-align: center; font-size: 16px; line-height: 36px; margin-bottom: 6px; }
.rp-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 4px; }
.rp-wd { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0 6px; }
.rp-wd.sun, .rp-day.sun { color: #C62845; }
.rp-day { position: relative; height: 44px; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.rp-day:disabled { color: #C3C5CB; font-weight: 400; cursor: default; }
.rp-day:not(:disabled):hover { box-shadow: inset 0 0 0 2px var(--ink); border-radius: 8px; }
.rp-day small { position: absolute; top: 1px; left: 0; right: 0; font-size: 9px; font-weight: 500; color: var(--muted); }
.rp-day.hol::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: #C62845; }
.rp-day.inrange, .rp-day.preview { background: #FFF1CC; }
.rp-day.start, .rp-day.end { background: var(--accent); color: var(--ink); border-radius: 8px; }
.rp-day.start.has-end:not(.end) { border-radius: 8px 0 0 8px; }
.rp-day.end:not(.start) { border-radius: 0 8px 8px 0; }
.rp-day.solo, .rp-day.start.end { border-radius: 8px; }
.rp-hols { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.rp-hols b { color: #C62845; margin-right: 4px; }
@media (max-width: 480px) { .rp-lg { display: none; } }

.h2-note { font-weight: 500; color: var(--muted); }

/* Chỗ trống theo khu vực */
.area .av { display: block; font-size: 12px; font-weight: 600; }
.area .av:empty { display: none; }
.area .av.full { color: var(--bad); }
.area .av.low { color: var(--wait); }
.area.is-full { border-color: #F2B8C2; background: #FFF8F9; }

/* ---------- Tab Cấu hình (admin) ---------- */
.cfg-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cfg-head h2 { margin: 0; }
.cfg-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.cfg-wide { grid-column: 1 / -1; }
.cfg-actions { grid-column: 1 / -1; margin-top: 4px; }
.field .lbl { font-size: 14px; font-weight: 500; }
.cfg-days { display: flex; flex-wrap: wrap; gap: 8px; }
.cfg-days label { cursor: pointer; }
.cfg-days input { position: absolute; opacity: 0; }
.cfg-days span { display: inline-grid; place-items: center; min-width: 44px; height: 38px; padding: 0 10px; border: 1.5px solid var(--line); border-radius: 8px; font-weight: 600; font-size: 14px; }
.cfg-days input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.cfg-days input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.cfg-calc { margin: 18px 0 14px; padding: 16px; border-radius: 10px; background: var(--paper-2); }
.cfg-out { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 10px; }
.cfg-out > div { border-left: 2px solid var(--ink); padding-left: 10px; }
.cfg-out dt { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.cfg-out dd { font-size: 13px; color: var(--muted); }
.cfg-areas input:not([type=checkbox]) { min-height: 38px; padding: 0 10px; border: 1px solid #C9CBD1; border-radius: 8px; width: 100%; }
.cfg-areas input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--ink); }
.cfg-areas td { vertical-align: middle; }

/* Tài khoản nhận tiền, ngày lễ (tab Cấu hình) */
.cfg-qr { margin: 16px 0 4px; display: grid; gap: 8px; justify-items: start; }
.cfg-qr img { border: 1px solid var(--line); border-radius: 10px; }
.cfg-bank select { appearance: auto; }
tr.is-past td { opacity: .55; }
tr.is-tentative input { border-color: #E9C46A; background: var(--wait-bg); }

/* ---------- Tab Inventory (admin) ---------- */
.inv-bar { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.inv-bar .field { min-width: 180px; }
.inv-bar select { appearance: auto; }
.inv-month { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.inv-seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.inv-seg button { padding: 0 14px; min-height: 46px; font-weight: 600; font-size: 14px; color: var(--muted); border-right: 1px solid var(--line); }
.inv-seg button:last-child { border-right: 0; }
.inv-seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.inv-trail { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 2px; font-size: 14px; }
.inv-trail .link-btn { color: var(--text); }
.inv-kpis { margin-top: 4px; }
.inv-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin: 0 0 12px; }
.inv-legend span { display: inline-flex; align-items: center; gap: 6px; }
.inv-legend i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.lg-a { background: var(--ink); }
.lg-h { background: var(--accent); }
.lg-f { background: #E6F4EA; border: 1px solid #B7DFC2; }
.lg-off { background: repeating-linear-gradient(45deg, #E1E2E6 0 3px, #fff 3px 6px); border: 1px solid var(--line); }
.inv-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); margin: 0; padding: 0; }
.inv-table { font-size: 13px; }
.inv-table th, .inv-table td { padding: 6px 6px; }
.inv-table .inv-name { position: sticky; left: 0; background: var(--paper); z-index: 1; min-width: 200px; max-width: 260px; }
.inv-table th.inv-d { text-align: center; font-size: 11px; padding: 6px 2px; min-width: 26px; }
.inv-table th.inv-d span { display: block; font-weight: 500; color: var(--muted); text-transform: none; letter-spacing: 0; }
.inv-table th.inv-d.sun span { color: #C62845; }
.inv-table th.inv-d.today { background: var(--wait-bg); }
.inv-table tr.click:hover td.inv-name { background: #FAFAF7; }
.ic { position: relative; padding: 4px 2px !important; text-align: center; }
.ic i { display: block; width: 18px; height: 30px; margin: 0 auto; border-radius: 3px;
  background: linear-gradient(to top, var(--ink) 0 var(--a), var(--accent) var(--a) calc(var(--a) + var(--h)), #E6F4EA calc(var(--a) + var(--h)) 100%);
  border: 1px solid #D5D7DC; }
.ic span { display: block; font-size: 11px; font-variant-numeric: tabular-nums; color: var(--muted); }
.ic.off { background: repeating-linear-gradient(45deg, #EEEFF2 0 3px, #fff 3px 6px); }
.inv-store-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 12px; }
.inv-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.inv-wd { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.inv-wd.sun { color: #C62845; }
.inv-day { min-height: 104px; border: 1px solid var(--line); border-radius: 8px; padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.inv-day.today { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.inv-day.off { background: repeating-linear-gradient(45deg, #F4F4F1 0 4px, #fff 4px 8px); }
.inv-dh { display: flex; justify-content: space-between; align-items: baseline; }
.inv-dh .full { color: var(--bad); font-weight: 600; }
.inv-bar-s { display: flex; height: 6px; border-radius: 3px; background: #E6F4EA; overflow: hidden; }
.inv-bar-s .a { background: var(--ink); }
.inv-bar-s .h { background: var(--accent); }
.inv-day ul { display: grid; gap: 2px; }
.inv-day li { font-size: 11px; line-height: 1.3; padding: 1px 5px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-day li.a { background: var(--ink); color: #fff; }
.inv-day li.h { background: var(--wait-bg); color: var(--wait); }
.inv-day li.more { color: var(--muted); }
.inv-blank { min-height: 1px; }
@media (max-width: 640px) { .inv-day { min-height: 70px; } .inv-day ul { display: none; } }

/* ---------- Lịch chiến dịch của khách (campaign-calendar.js) ---------- */
.cc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 10px; }
.cc-nav { display: flex; align-items: center; gap: 8px; }
.cc-nav h2 { margin: 0 6px; min-width: 130px; text-align: center; font-size: 20px; }
.cc-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 12px; color: var(--muted); }
.cc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cc-legend i { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }
.cc { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cc-wd { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--paper-2); border-bottom: 1px solid var(--line); }
.cc-wd span { padding: 8px 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.cc-wd span.sun, .cc-num.sun { color: #C62845; }
.cc-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 3px; border-bottom: 1px solid var(--line); }
.cc-week:last-child { border-bottom: 0; }
.cc-cell { border-right: 1px solid var(--line); }
.cc-cell:nth-child(14n + 13) { border-right: 0; }
.cc-cell.other { background: #FAFAF8; }
.cc-cell.today { background: var(--wait-bg); }
.cc-num { position: relative; padding: 6px 8px 0; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 6px; z-index: 1; }
.cc-num span { font-size: 10px; font-weight: 600; color: var(--wait); }
.cc-hol { width: 6px; height: 6px; border-radius: 50%; background: #C62845; display: inline-block; }
.cc-bar { position: relative; z-index: 2; display: flex; align-items: center; gap: 6px; min-width: 0; margin: 0 4px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; line-height: 26px; text-decoration: none; white-space: nowrap; overflow: hidden; }
.cc-bar b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.cc-bar span { opacity: .75; flex: none; }
.cc-bar.cl { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cc-bar.cr { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cc-bar:hover { filter: brightness(1.08); box-shadow: 0 0 0 2px var(--accent); }
.k-run { background: var(--ink); color: #fff; }
.k-ok { background: var(--ok); color: #fff; }
.k-wait { background: var(--accent); color: var(--ink); }
.k-done { background: #D5D7DC; color: var(--text); }
.k-off { background: #ECEDF0; color: var(--muted); }
.cc-bar.k-off b { text-decoration: line-through; }
.cc-list-title { font-size: 18px; margin: 28px 0 12px; }
@media (max-width: 640px) {
  .cc-bar { font-size: 11px; padding: 0 5px; margin: 0 2px; }
  .cc-bar span { display: none; }
  .cc-num { padding: 4px 4px 0; font-size: 12px; }
  .cc-num span { display: none; }
  .cc-wd span { padding: 6px 2px; font-size: 11px; text-align: center; }
}

/* Report: trong giờ / ngoài giờ */
.chart .bar2 { fill: #C9CBD1; }
.chart .bar.est { fill: #5B606B; }
.chart g:hover .bar { fill: #F38E41; }
.chart g:hover .bar2 { fill: #F9D3A8; }
.rp-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 8px; color: var(--muted); }
.rp-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.rp-legend i.in { background: var(--ink); }
.rp-legend i.out { background: #C9CBD1; }
.rp-legend i.est { background: #5B606B; }

/* Tab Báo cáo (admin) */
.rt-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.rt-head select { min-height: 38px; padding: 0 10px; border: 1px solid #C9CBD1; border-radius: 8px; background: var(--paper); font: inherit; font-size: 14px; }
.rt-help { margin: -4px 0 16px; }
.rt-help summary { cursor: pointer; color: var(--text); font-weight: 600; }
.rt-help ol { margin: 8px 0 8px 20px; display: grid; gap: 4px; }
#rt-prev .notice + .notice, #rt-prev .notice { margin-top: 10px; }
.notice.rt-info { background: var(--paper-2); color: var(--muted); }
.rt-table tbody tr { cursor: pointer; }
.rt-table tbody tr:hover, .rt-table tbody tr:focus-visible { background: var(--paper-2); outline: none; }
.rt-table tbody tr.sel { background: var(--wait-bg); }
.rt-pace { display: inline-block; padding: 2px 8px; border-radius: 999px; font-weight: 700; font-size: 13px; background: var(--paper-2); }
.rt-pace.ok { background: var(--ok-bg); color: var(--ok); }
.rt-pace.wait { background: var(--wait-bg); color: var(--wait); }
.rt-pace.bad { background: var(--bad-bg); color: var(--bad); }
.rt-files td, .rt-files th { font-size: 13px; }
#rt-detail:not(:empty) { margin-top: 16px; }
#rt-form, #rt-form .field { min-width: 0; grid-template-columns: minmax(0, 1fr); }
#rt-form select { width: 100%; min-width: 0; max-width: 100%; text-overflow: ellipsis; }
#rt-up, #rt-detail, #report .small { overflow-wrap: anywhere; }

/* Bản đồ chọn tỉnh/thành */
.pm { display: grid; gap: 16px; margin-top: 16px; }
@media (min-width: 640px) { .pm { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; } }
.pm-map { position: relative; background: #EEF3F6; border-radius: 10px; padding: 8px; }
.pm-map svg { width: 100%; height: auto; display: block; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.pm-p { stroke: #fff; stroke-width: 1.2; stroke-linejoin: round; transition: fill .12s; }
.pm-p.none { fill: #DCDFE4; }
.pm-p.has { fill: hsl(220 8% var(--l, 60%)); cursor: pointer; }
.pm-p.has:hover { fill: #F38E41; }
.pm-p.sel, .pm-p.sel:hover { fill: var(--accent); stroke: var(--ink); stroke-width: 1.6; }
.pm-p.full { fill: #F2B8C2; }
.pm-p.sel.full { fill: #EC4C66; }
.pm-isl circle { fill: #8A8F99; }
.pm-isl text, .pm-sea { font-family: var(--font); font-size: 15px; fill: #6B717C; }
.pm-sea { font-style: italic; font-size: 18px; fill: #9AA7B2; }
.pm-tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: 13px; line-height: 1.4; padding: 6px 10px; border-radius: 6px; white-space: nowrap; z-index: 2; }
.pm-help { margin: 6px 4px 0; }
.pm-help kbd { font: inherit; font-weight: 600; border: 1px solid #C9CBD1; border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: #fff; }
.pm-touch { display: none; }
@media (hover: none) { .pm-desk { display: none; } .pm-touch { display: inline; } }
.pm-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pm-quick .chip { font-size: 13px; padding: 5px 10px; }
.pm-quick .chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pm-quick .chip-clear { border-style: dashed; }
.pm-list { display: grid; gap: 4px; max-height: 420px; overflow-y: auto; padding-right: 4px; }
.pm-item { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.pm-item input { width: 17px; height: 17px; accent-color: var(--ink); flex: none; }
.pm-item .nm { flex: 1; font-size: 14px; }
.pm-item .ct { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pm-item:has(input:checked) { border-color: var(--ink); background: #FFF9E8; }
.pm-item .av { display: block; font-size: 12px; font-weight: 600; }
.pm-item .av:empty { display: none; }
.pm-item .av.full { color: var(--bad); }
.pm-item .av.low { color: var(--wait); }
.pm-item.is-full { border-color: #F2B8C2; background: #FFF8F9; }
.pm-count { margin: 10px 0 0; }
.field input:not([type=checkbox]):not([type=radio]):not([type=file]), .field select { height: 48px; box-sizing: border-box; }
.ld-note { width: 100%; margin-top: 6px; min-height: 34px; padding: 4px 8px; border: 1px solid #C9CBD1; border-radius: 6px; font: inherit; font-size: 13px; }
