/* CRM Nha Khoa — giao diện tông xanh y khoa nhẹ. Không dùng font/CDN ngoài (chạy offline). */
:root {
  --bg: #f3f7fa; --surface: #ffffff; --surface-2: #f7fafc; --border: #dbe5ec; --border-strong: #c3d2dd;
  --text: #1c2b36; --muted: #5f7383; --primary: #0e7c86; --primary-600: #0a6670; --primary-50: #e6f4f5;
  --accent: #1f6fd1; --accent-600: #1859aa; --danger: #c62f3b; --danger-50: #fdecee; --warn: #b26a00; --warn-50: #fff5e0;
  --ok: #1b8a4b; --ok-50: #e7f6ee; --info-50: #e9f1fc; --purple: #6b47b8;
  --radius: 10px; --shadow: 0 1px 2px rgba(16, 42, 60, .06), 0 2px 8px rgba(16, 42, 60, .05);
  --sidebar-w: 236px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 14.5px; line-height: 1.45; color: var(--text); background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; font-weight: 650; }
h3 { margin: 0; }
input, select, textarea, button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Bố cục ---------- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: #0d3b4a; color: #d8e9ef; display: flex; flex-direction: column; z-index: 50; transition: transform .2s; }
.brand { display: flex; flex-direction: column; gap: 8px; padding: 14px 14px 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand b { color: #fff; font-size: 16px; display: block; }
.brand small { color: #9fc3cf; font-size: 12px; }
.brand-logo { background: #fff; border-radius: 10px; padding: 6px 10px; display: flex; justify-content: center; } /* logo Tâm An (xanh + chữ đen) cần nền trắng trên menu tối */
.brand-logo img { display: block; height: 54px; width: auto; max-width: 100%; object-fit: contain; }
.nav { padding: 10px 8px; flex: 1; overflow-y: auto; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; color: #d8e9ef; border-radius: 8px; margin-bottom: 2px; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.nav a.active { background: #19a3a9; color: #fff; }
.nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sidebar-foot { font-size: 12px; color: #9fc3cf; padding: 12px 16px 16px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-foot a { color: #fff; text-decoration: underline; }
.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 40; display: flex; gap: 12px; align-items: center; padding: 10px 20px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--border); backdrop-filter: blur(6px); }
.quick-search { position: relative; flex: 1; min-width: 220px; max-width: 520px; }
.topbar { flex-wrap: wrap; }
.quick-search input { width: 100%; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface-2); }
.branch-pick { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.branch-pick select { padding: 7px 10px; border: 1px solid var(--primary); border-radius: 8px; background: var(--primary-50); color: var(--primary-600); font-weight: 600; max-width: 230px; }
.top-actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.nav-toggle { display: none; }
.nav-overlay { display: none; }
.view { padding: 18px 22px 40px; outline: none; }
body.loading .view { opacity: .6; }

/* ---------- Nút ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 8px; cursor: pointer; font-weight: 500; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--surface-2); border-color: #a9bccb; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-600); border-color: var(--accent-600); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #a92530; }
.btn-danger-outline { color: var(--danger); border-color: #eab3b8; }
.btn-danger-outline:hover { background: var(--danger-50); }
.btn-ok { color: var(--ok); border-color: #a9d8bd; }
.btn-ok:hover { background: var(--ok-50); }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-xs { padding: 2px 8px; font-size: 12px; border-radius: 6px; }
.icon-btn { border: 0; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; padding: 4px 8px; border-radius: 6px; color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.row-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg-btn { border: 0; background: transparent; padding: 7px 12px; cursor: pointer; border-right: 1px solid var(--border); }
.seg-btn:last-child { border-right: 0; }
.seg-btn.active { background: var(--primary); color: #fff; }

/* ---------- Banner / alert ---------- */
.banner { padding: 8px 22px; font-size: 13.5px; border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.banner-warn { background: var(--warn-50); color: #7a4a00; }
.banner-err { background: var(--danger-50); color: #8d1f28; }
.banner-info { background: var(--info-50); color: #1d4b8a; }
.alert { padding: 10px 14px; border-radius: 8px; margin: 10px 0; border: 1px solid transparent; }
.alert-info { background: var(--info-50); border-color: #c9dbf4; color: #1d4b8a; }
.alert-warn { background: var(--warn-50); border-color: #f2d59b; color: #7a4a00; }
.alert-err { background: var(--danger-50); border-color: #f0bcc1; color: #8d1f28; }
.alert-ok { background: var(--ok-50); border-color: #b4e0c6; color: #145c33; }
.allergy-band { background: #c62f3b; color: #fff; padding: 9px 14px; border-radius: 8px; margin: 10px 0; font-weight: 500; }

/* ---------- Trang ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.sec-title { font-size: 15px; margin: 18px 0 8px; font-weight: 650; }
.mt { margin-top: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin: 10px 0 14px; }
.filters label { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }
.filters select, .filters input { padding: 6px 9px; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface); color: var(--text); }
.filters input.sm { width: 118px; }
.filters .grow { flex: 1; min-width: 220px; max-width: 360px; }
.filters .spacer, .spacer { flex: 1; }
.quick-range { display: inline-flex; gap: 4px; }
.chk { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.field .chk input[type=checkbox] { width: 18px; height: 18px; margin: 0; padding: 0; flex: none; } /* ô tích trong .field không bị kéo dài như ô nhập */
.chk-group { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 4px 0; }
.field .chk input[type=radio] { width: 18px; height: 18px; margin: 0; padding: 0; flex: none; }
.lost-why { display: grid; gap: 6px; } /* đóng lead: lý do chọn sẵn, mỗi dòng 1 lý do */
.lost-why .chk { display: flex; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.lost-why .chk:has(input:checked) { border-color: var(--danger); background: var(--danger-50); }
.empty { padding: 28px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); }

/* ---------- Thẻ ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 14px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 16px; margin-bottom: 14px; }
.card-title { font-weight: 650; margin-bottom: 10px; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.stat { padding: 12px 14px; display: block; color: inherit; }
.stat.link:hover { border-color: var(--primary); text-decoration: none; }
.stat-label { font-size: 12.5px; color: var(--muted); }
.stat-value { font-size: 20px; font-weight: 650; margin-top: 4px; }
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat.aging { cursor: pointer; border-top: 3px solid var(--ok); }
.stat.aging.a1 { border-top-color: #d4a017; } .stat.aging.a2 { border-top-color: #e07a1f; } .stat.aging.a3 { border-top-color: var(--danger); }
.stat.aging.sel { outline: 2px solid var(--primary); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-2 > .card { margin-bottom: 14px; }

/* ---------- Bảng ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card .table-wrap { border: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 13.8px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; background: var(--surface-2); padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text); }
.table td { padding: 8px 10px; border-bottom: 1px solid #edf2f6; vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { font-weight: 650; background: var(--surface-2); border-top: 1px solid var(--border); padding: 9px 10px; }
.table.clickable tbody tr { cursor: pointer; }
.table tbody tr:hover td { background: #f6fafc; }
.table.compact td, .table.compact th { padding: 6px 8px; }
.r, .table .r { text-align: right; }
.empty-cell { text-align: center; color: var(--muted); padding: 22px !important; }
.row-muted td { color: #93a3af; }
.strike td { text-decoration: line-through; }
.row-cancel td { color: #9aa7b1; text-decoration: line-through; }
.row-cancel td .badge, .row-cancel td .btn { text-decoration: none; }
.row-sub td { background: #f0f6f8; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; padding: 8px 2px; }
.dt-tools { margin-bottom: 8px; }
.dt-search { padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: 7px; width: 280px; max-width: 100%; }
select.mini { padding: 3px 6px; border: 1px solid var(--border-strong); border-radius: 6px; font-size: 13px; background: var(--surface); }

/* ---------- Nhãn & tiền ---------- */
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: #eef2f5; color: #4a5c69; }
.b-gray { background: #eef2f5; color: #4a5c69; } .b-blue { background: #e4eefc; color: #1d55a5; } .b-teal { background: var(--primary-50); color: #0a6670; }
.b-green { background: var(--ok-50); color: #156b3b; } .b-purple { background: #efe9fa; color: var(--purple); } .b-red { background: var(--danger-50); color: #a5212c; }
.b-amber { background: var(--warn-50); color: #8a5300; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.money.neg, .neg { color: var(--danger); }
.money.debt, .debt { color: #c0392b; font-weight: 600; }
.money.over { color: #d9730d; font-weight: 600; }
.money.strong, .strong { font-weight: 700; }
.age-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--ok-50); color: #156b3b; white-space: nowrap; }
.age-badge.a1 { background: #fff6d6; color: #866400; } .age-badge.a2 { background: #ffe9d6; color: #9a4b00; } .age-badge.a3 { background: var(--danger-50); color: #a5212c; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin: 6px 0 14px; overflow-x: auto; }
.tab { border: 0; background: transparent; padding: 9px 14px; cursor: pointer; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab .count { background: #e8eef2; border-radius: 999px; padding: 0 7px; font-size: 11.5px; margin-left: 2px; }
.tab-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }

/* ---------- Hồ sơ KH ---------- */
.profile-head { display: grid; grid-template-columns: 1fr auto; gap: 12px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); }
.profile-head .back { font-size: 13px; }
.profile-head h1 .code { font-size: 15px; font-weight: 500; }
.ph-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 13.5px; margin-top: 4px; align-items: center; }
.ph-meta .phone { font-weight: 600; font-size: 15px; }
.inline-status select { padding: 3px 6px; border: 1px solid var(--border-strong); border-radius: 6px; }
.ph-sum { display: flex; gap: 18px; align-items: center; }
.ph-sum > div { display: flex; flex-direction: column; text-align: right; }
.ph-sum span { font-size: 12px; color: var(--muted); }
.ph-sum .money { font-size: 17px; font-weight: 650; }
.ph-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 18px; margin-bottom: 12px; }
.detail-grid.wide { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.detail-grid > div span { display: block; font-size: 12px; color: var(--muted); }

/* ---------- Kế hoạch ---------- */
.plan-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; box-shadow: var(--shadow); overflow: hidden; }
.plan-card.cancelled { opacity: .7; }
.plan-head { display: flex; justify-content: space-between; gap: 10px; padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.plan-title { font-weight: 600; margin-left: 6px; }
.plan-sum { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); align-items: center; }
.plan-sum .money { color: var(--text); font-weight: 600; }
.plan-actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.plan-card .table-wrap { border: 0; border-radius: 0; }
.table.items td:nth-child(2) { min-width: 190px; }
.table.items td:nth-child(9) { min-width: 150px; }
/* Bảng dịch vụ phiếu điều trị (trình bày lại theo mẫu sếp gửi 03/11/2026) */
.table.items .svc-nm { font-weight: 600; line-height: 1.35; }
.table.items .svc-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 6px; }
.table.items .ppl { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; font-size: 13px; line-height: 1.4; }
.table.items .ppl-btn { width: 100%; min-width: 150px; margin: -4px -6px; padding: 4px 6px; border: 1px dashed transparent; border-radius: 8px; background: none; font: inherit; font-size: 13px; color: inherit; text-align: left; cursor: pointer; }
.table.items .ppl-btn:hover, .table.items .ppl-btn[aria-expanded=true] { border-color: var(--border-strong); background: var(--primary-50); }
.table.items .ppl-btn:focus-visible { outline: 3px solid rgba(14,124,134,.35); outline-offset: 1px; } .table.items .ppl-btn:disabled { opacity: .6; cursor: progress; }
.ppl-menu { position: fixed; z-index: 2000; width: 290px; max-width: calc(100vw - 16px); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: 0 6px 20px rgba(16,42,60,.16); padding: 6px 14px 14px; }
.ppl-menu label { display: block; margin-top: 8px; } .ppl-menu label > span { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.ppl-menu select { width: 100%; min-height: 38px; text-transform: uppercase; } .ppl-menu select.ppl-ph { color: var(--muted); text-transform: none; }
.ppl-menu select option { color: var(--text); text-transform: none; }
/* Nút X bỏ trống người thực hiện (sếp chốt 07/11/2026) */
.ppl-f { display: flex; align-items: flex-end; gap: 6px; } .ppl-f > label { flex: 1; min-width: 0; } .ppl-f > select { flex: 1; min-width: 0; width: auto; }
.ppl-x { flex: none; width: 38px; height: 38px; padding: 0; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: #dc2626; font-size: 22px; line-height: 1; cursor: pointer; }
.ppl-x:hover { background: #fef2f2; border-color: #dc2626; }
/* Ô Người giới thiệu (chị duyệt 07/11/2026) */
.rf { position: relative; } .rf [hidden] { display: none !important; }
.rf-add { align-self: flex-start; border: 1px dashed var(--primary); color: var(--primary); background: var(--surface); border-radius: 8px; padding: 8px 14px; font-weight: 600; cursor: pointer; }
.rf-add:hover { background: var(--primary-50); }
.rf-q, .rf-chip, .rf-new { display: flex; gap: 6px; align-items: flex-end; }
.rf-q { position: relative; } .rf-q > input { flex: 1; min-width: 0; }
.rf-chip { align-items: center; min-height: 40px; border: 1px solid var(--border-strong); border-radius: 8px; padding: 0 1px 0 12px; background: var(--surface); }
.rf-chip .rf-lbl { flex: 1; min-width: 0; font-weight: 600; } .rf-chip .ppl-x { border: 0; }
.rf-new > .field { flex: 1; min-width: 0; }
.rf-it { display: flex; justify-content: space-between; align-items: center; gap: 8px; } .rf-mk { color: var(--primary); font-weight: 600; }
.rf-tag { flex: none; font-size: 12px; padding: 1px 8px; border-radius: 8px; background: #e0f2fe; color: #075985; } .rf-tag.nv { background: #dcfce7; color: #166534; } .ppl-x:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.table.items .pp-r { font-weight: 700; color: var(--primary-600); white-space: nowrap; }
.table.items .pp-n { text-transform: uppercase; white-space: nowrap; } .table.items .pp-e { color: var(--muted); }
.table.items .svc-teeth { color: #0a7d36; font-weight: 600; }
.ico-actions { flex-wrap: nowrap; gap: 2px; }
.ico-btn { width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--accent); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.ico-btn:hover { background: var(--primary-50); } .ico-btn.danger { color: var(--danger); } .ico-btn.danger:hover { background: var(--danger-50); }
.ico-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Voucher tặng khi hoàn tất điều trị (sếp chốt 03/11/2026) */
.gift-box { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin: 14px 0 0; padding: 10px 12px; border: 1px solid #f0b98f; background: #fff1e6; border-radius: 10px; font-size: 13.5px; }
.gift-box .g-t { font-weight: 700; color: #b4541a; } .gift-box .g-code { font-family: Consolas, Menlo, monospace; font-weight: 700; letter-spacing: 1.5px; color: #b4541a; background: var(--surface); border: 1px dashed currentColor; border-radius: 6px; padding: 0 8px; }
.gift-box .g-st { font-weight: 600; } .gift-box.used { border-color: var(--border-strong); background: var(--bg, #f4f7f9); } .gift-box.used .g-t, .gift-box.used .g-code { color: var(--muted); }
.gift-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 14px 0 0; padding-top: 12px; border-top: 1px dashed var(--border-strong); }
/* Ví voucher + chọn voucher khi thu tiền (sếp chốt 03/11/2026, kiểu mã giảm giá Shopee) */
/* Báo cáo › Tổng quan: biểu đồ Thu – Chi (sếp duyệt 03/11/2026) */
.tcr { display: flex; flex-direction: column; gap: 8px; }
.tcr-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; } .tcr-h b { font-size: 16px; letter-spacing: .3px; }
.tcr-lg { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; } .tcr-lg::before { content: ''; width: 15px; height: 15px; border-radius: 50%; background: #1a73e8; } .tcr-lg.chi::before { background: #d93025; }
.ch-pair { pointer-events: none; } .ch-pair.thu { fill: #1a73e8; } .ch-pair.chi { fill: #d93025; }
.ch-bar.ch-hit { fill: transparent; } .ch-bar.ch-hit.on { fill: rgba(16,42,60,.06); filter: none; }
.ch-tip-v i.thu { background: #1a73e8; } .ch-tip-v i.chi { background: #d93025; }
.tcr-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.tcr-col h3 { display: flex; justify-content: space-between; gap: 10px; font-size: 17px; margin: 0 0 4px; padding-bottom: 6px; border-bottom: 2px solid currentColor; font-variant-numeric: tabular-nums; }
.tcr-col.thu h3 { color: #1a73e8; } .tcr-col.chi h3 { color: #d93025; }
.tcr-ln { display: flex; justify-content: space-between; gap: 10px; padding: 6px 2px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.tcr-ln b { font-weight: 600; } .tcr-ln.zero { color: var(--muted); } .tcr-ln.zero b { font-weight: 400; }
.tcr-sub { margin: 12px 0 2px; font-size: 12.5px; font-weight: 700; color: #1a73e8; text-transform: uppercase; letter-spacing: .3px; }
.tcr-ln.m { padding-left: 14px; background: #f3f8ff; }
.dtd { border: 2px solid #b45309; background: #fffbeb; }
.dtd-h { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 10px; } .dtd-h b { font-size: 16px; color: #92400e; letter-spacing: .3px; }
.dtd-g { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.dtd-g > div { background: #fff; border: 1px solid #fcd34d; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.dtd-g span { font-size: 13px; color: var(--muted); } .dtd-g b { font-size: 20px; font-variant-numeric: tabular-nums; }
.dtd-g .vip b { color: #7c3aed; } .dtd-g .t { background: #92400e; border-color: #92400e; } .dtd-g .t span { color: #fde68a; } .dtd-g .t b { color: #fff; }
.dtd-m { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 14px; } .dtd-m b { font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .dtd-g { grid-template-columns: 1fr; } }
.tcr-net { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; background: var(--primary-50); border: 2px solid var(--primary-600); }
.tcr-net b { font-size: 19px; color: var(--primary-600); font-variant-numeric: tabular-nums; } .tcr-net.neg b { color: #b3261e; }
@media (max-width: 720px) { .tcr-cols { grid-template-columns: 1fr; gap: 16px; } }
button.tcr-ln { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--border); font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.tcr-ln:hover, button.tcr-ln:focus-visible { background: var(--primary-50); } .tcr-ln .go { color: var(--primary-600); font-weight: 700; margin-left: 8px; }
.tcd tbody tr { cursor: pointer; } .tcd tbody tr:hover, .tcd tbody tr:focus-visible { background: var(--primary-50); outline: none; }
.tcd .thu { color: #1a73e8; font-weight: 600; } .tcd .chi { color: #d93025; font-weight: 600; } .tcd tfoot td { font-weight: 700; } .tcd td { font-variant-numeric: tabular-nums; }
/* Báo cáo › Tổng quan: Khách đến trong kỳ theo nguồn (sếp duyệt 03/11/2026) */
.ng { display: flex; flex-direction: column; gap: 10px; }
.ng-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; } .ng-h b { font-size: 16px; letter-spacing: .3px; }
.ng-lg { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; } .ng-lg::before { content: ''; width: 15px; height: 15px; border-radius: 4px; background: #19a3a9; } .ng-lg.cu::before { background: #ff8f3f; }
.ng-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ng-sum > div { border-radius: 12px; padding: 10px 14px; border: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.ng-sum span { font-size: 13px; color: var(--muted); font-weight: 600; } .ng-sum b { font-size: 24px; line-height: 1.2; font-variant-numeric: tabular-nums; } .ng-sum small { font-size: 12px; color: var(--muted); }
.ng-sum .t { background: #f3f6f8; } .ng-sum .n { background: #e8f6f6; border-color: #9fd3d4; } .ng-sum .n b { color: #11777c; } .ng-sum .c { background: #fff3e8; border-color: #ffc89a; } .ng-sum .c b { color: #c4610f; }
.ng-body { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.ng-bar { display: grid; grid-template-columns: minmax(90px, 150px) minmax(0, 1fr) 92px; gap: 10px; align-items: center; padding: 6px 0; }
.ng-bar .tr { height: 22px; background: #f0f4f6; border-radius: 6px; overflow: hidden; } .ng-bar .tr i { display: block; height: 100%; min-width: 2px; background: #19a3a9; border-radius: 6px; }
.ng-bar .v { text-align: right; font-variant-numeric: tabular-nums; } .ng-bar .v b { font-size: 15.5px; } .ng-bar .v small { color: var(--muted); margin-left: 4px; }
.ng-bar.cu { border-top: 1px dashed var(--border-strong); margin-top: 4px; padding-top: 10px; } .ng-bar.cu .tr i { background: #ff8f3f; } .ng-bar.cu .nm { color: #c4610f; font-weight: 700; }
.ng-bar.zero:not(.cu) .nm, .ng-bar.zero .v, .ng-bar.zero .v b { color: var(--muted); font-weight: 400; } .ng-bar.zero .tr i { display: none; } .ng-t tr.zero td { color: var(--muted); }
.ng-t tr.cu td { color: #c4610f; font-weight: 600; } .ng-t tfoot td { font-weight: 700; } .ng-t td { font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .ng-body { grid-template-columns: minmax(0, 1fr); gap: 14px; } .ng-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ng-sum .t { grid-column: 1 / -1; } .ng-h { gap: 6px 12px; } .ng-lg { font-size: 14px; } }
#dup-warn .dup-other:not(:empty) { margin-top: 4px; padding: 6px 10px; border-radius: 8px; background: #fff3e8; border: 1px solid #ffc89a; color: #8a4b0f; }
/* Thu chi hôm nay ở Tổng quan (sếp duyệt 03/11/2026) */
.tc-card { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.tc-card .tc-h { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; } .tc-card .tc-h b { font-size: 16px; letter-spacing: .3px; }
.tc-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: center; }
.tc-donut { position: relative; width: 220px; height: 220px; }
.tc-donut svg { width: 100%; height: 100%; transform: rotate(-90deg); } .tc-donut circle { fill: none; stroke-width: 26; }
.dn-bg { stroke: #edf1f4; } .dn-tm { stroke: #1a73e8; } .dn-nh { stroke: #ff8f3f; } .dn-chi { stroke: #d93025; }
.tc-mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.tc-mid small { font-size: 12px; font-weight: 600; color: var(--muted); } .tc-mid span { font-size: 12px; color: var(--muted); }
.tc-mid b { font-size: 22px; line-height: 1.25; color: var(--primary-600); font-variant-numeric: tabular-nums; } .tc-mid.neg b { color: #b3261e; }
.tc-leg { display: flex; flex-direction: column; gap: 4px; max-width: 520px; font-variant-numeric: tabular-nums; }
.tc-row { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 12px; border-radius: 10px; }
.tc-row i { width: 14px; height: 14px; border-radius: 4px; display: block; } .tc-row i.tm { background: #1a73e8; } .tc-row i.nh { background: #ff8f3f; } .tc-row i.chi { background: #d93025; }
.tc-row b { font-size: 16px; } .tc-row .op { color: var(--muted); font-weight: 700; text-align: center; }
.tc-row.sum { background: #f3f6f8; font-weight: 600; }
.tc-row.net { background: var(--primary-50); border: 2px solid var(--primary-600); } .tc-row.net b { color: var(--primary-600); font-size: 19px; } .tc-row.net.neg b { color: #b3261e; }
@media (max-width: 720px) { .tc-body { grid-template-columns: 1fr; justify-items: center; } .tc-leg { width: 100%; max-width: none; } }
/* Chốt cuối ngày ở Thu chi (sếp yêu cầu 03/11/2026) */
.day-close { display: flex; flex-direction: column; gap: 12px; margin: 12px 0; }
.day-close .dc-h { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; } .day-close .dc-h b { font-size: 16px; }
.dc-eq { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1.2fr); align-items: stretch; gap: 10px; }
.dc-op { display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; color: var(--muted); }
.dc-t { border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.dc-t span { font-size: 13px; font-weight: 600; color: var(--muted); } .dc-t b { font-size: 22px; line-height: 1.2; } .dc-t small { font-size: 12px; color: var(--muted); }
.dc-t.in { background: #e8f6ee; border-color: #9bd2b0; } .dc-t.in b { color: #1d7a44; }
.dc-t.out { background: #fdeceb; border-color: #f2b8b3; } .dc-t.out b { color: #b3261e; }
.dc-t.net { background: var(--primary-50); border: 2px solid var(--primary-600); } .dc-t.net b { color: var(--primary-600); font-size: 26px; } .dc-t.net.neg b { color: #b3261e; }
.dc-print tfoot td { font-weight: 700; }
.dc-mix { font-size: 13px; color: var(--muted); margin-top: -4px; } .dc-mix b { color: var(--text, inherit); font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .dc-eq { grid-template-columns: 1fr; } .dc-op { display: none; } }
.btn-wallet { border: 1.5px solid #ee4d2d; color: #c2410c; background: #fff4ef; font-weight: 700; }
.wl-n { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: #ee4d2d; color: #fff; font-size: 12px; line-height: 20px; text-align: center; }
.wl-h { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 4px 0 8px; }
.wl-acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; margin-bottom: 14px; }
.wl-act { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; white-space: normal; height: auto; } .wl-act small { color: var(--muted); font-weight: 500; } .wl-act:disabled { opacity: .55; cursor: not-allowed; }
.vc-stub.fam { background: linear-gradient(160deg, #0e7c86, #22a3ad); }
.btn-gift { background: #fff1e6; border-color: #f0b98f; color: #b4541a; font-weight: 700; } .btn-gift:disabled { opacity: .55; cursor: not-allowed; }
.vw-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.vw-tab { font: inherit; font-weight: 600; border: 0; background: none; color: var(--muted); padding: 7px 12px; border-bottom: 2px solid transparent; cursor: pointer; }
.vw-tab[aria-selected=true] { color: #e8461f; border-bottom-color: #e8461f; }
.vw-list, .vp-list { display: grid; gap: 10px; }
.vc { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; align-items: stretch; width: 100%; padding: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: inherit; font: inherit; text-align: left; overflow: hidden; }
button.vc { cursor: pointer; } button.vc:hover { border-color: #f08a5d; } .vc:focus-visible, .vfield:focus-visible, .vw-tab:focus-visible { outline: 3px solid rgba(14,124,134,.35); outline-offset: 2px; }
.vc[aria-checked=true] { border-color: #e8461f; box-shadow: 0 0 0 1px #e8461f; }
.vc-stub { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 10px 6px; background: linear-gradient(160deg, #ee4d2d, #ff7a45); color: #fff; text-align: center; }
.vc-stub::after { content: ""; position: absolute; right: -6px; top: 0; bottom: 0; width: 12px; background: radial-gradient(circle at 6px 8px, var(--surface) 4px, transparent 4.5px) 0 0 / 12px 16px repeat-y; }
.vc-amt { font-size: 20px; font-weight: 800; line-height: 1.1; } .vc-kind { font-size: 11px; font-weight: 600; }
.vc-body { display: flex; flex-direction: column; gap: 2px; padding: 9px 14px; min-width: 0; } .vc-t { font-weight: 700; } .vc-code { font-family: Consolas, Menlo, monospace; letter-spacing: 1px; }
.vc-s { font-size: 12.5px; color: var(--muted); } .vc-ok { color: #1d7a44; font-weight: 600; } .vc-why { color: #b3261e; }
.vc-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 6px; padding: 9px 12px; }
.vc-tag { font-size: 11.5px; font-weight: 700; border-radius: 6px; padding: 1px 8px; white-space: nowrap; background: var(--primary-50); color: var(--primary-600); }
.vc-tag.ok { background: #e3f4ea; color: #1d7a44; } .vc-tag.bad { background: #fdeceb; color: #b3261e; } .vc-tag.mut { background: #eef2f5; color: var(--muted); } .vc-tag.best { background: #f5a623; color: #3a2400; }
.vc-radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-strong); }
.vc[aria-checked=true] .vc-radio { border-color: #e8461f; background: radial-gradient(circle, #e8461f 45%, transparent 50%); }
.vc.off { opacity: .6; } .vc.off .vc-stub { background: #9aa7b1; }
.vfield { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 9px 12px; border: 1px dashed #ee4d2d; border-radius: 8px; background: #fff4ef; color: #c2410c; font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.vp-top { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 8px; } .vp-other { flex: 1 1 260px; } .vp-other input { flex: 1 1 160px; min-width: 0; }
.btn-best { background: #f5a623; border-color: #f5a623; color: #3a2400; font-weight: 700; } .btn-best:disabled { opacity: .5; }
.vp-grp { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 6px; }
@media (max-width: 560px) { .vc { grid-template-columns: 76px minmax(0, 1fr); } .vc-side { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; border-top: 1px dashed var(--border); } }
.gift-opts { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 0 26px; } .gift-tick { font-size: 15px; }
.gift-progs input[name=g_name] { min-width: 180px; } .gift-progs input[name=g_amount] { width: 120px; } .gift-progs input[name=g_months] { width: 70px; }
.f-voucher .lg-box { margin-top: 8px; }

/* ---------- Form & modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(14, 30, 40, .45); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 12px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 12px; box-shadow: 0 18px 50px rgba(0,0,0,.25); width: 100%; display: flex; flex-direction: column; max-height: 92vh; }
.modal-sm { max-width: 440px; } .modal-md { max-width: 620px; } .modal-lg { max-width: 860px; } .modal-xl { max-width: 1120px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; background: var(--surface-2); border-radius: 0 0 12px 12px; }
.confirm-msg { font-size: 15px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-grid.one { grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field.full, .form-grid .full { grid-column: 1 / -1; }
.field > span { font-size: 13px; color: var(--muted); font-weight: 550; }
.field input, .field select, .field textarea, .inline-form input, .src-label { width: 100%; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(14,124,134,.15); }
.field .hint { color: var(--muted); }
.req { color: var(--danger); }
.invalid { border-color: var(--danger) !important; box-shadow: 0 0 0 3px rgba(198,47,59,.14) !important; }
.inline { display: flex; gap: 6px; align-items: center; }
.inline > input { flex: 1; }
.inline > select { width: auto; flex: none; }
.inline-form { display: flex; gap: 8px; margin-top: 10px; }
input.big { font-size: 17px; font-weight: 650; }
input.allergy-input { border-color: #eab3b8; }
.calc-amount { font-size: 18px; font-weight: 700; color: var(--primary); padding: 6px 0; }
.quick-teeth { display: flex; gap: 4px; margin-top: 4px; }
.extra-row { margin-bottom: 6px; }
.extra-row select { padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: 7px; }
.alloc-head { font-weight: 600; margin: 4px 0 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.table.alloc input { width: 130px; text-align: right; padding: 5px 8px; border: 1px solid var(--border-strong); border-radius: 6px; }
.table input.money, .table .ra-in { width: 130px; text-align: right; padding: 5px 8px; border: 1px solid var(--border-strong); border-radius: 6px; }
.dup-warn { font-size: 12.5px; color: var(--warn); }
.pay-box { display: flex; gap: 16px; align-items: flex-end; margin-top: 12px; padding: 12px; background: var(--primary-50); border-radius: 8px; flex-wrap: wrap; }
.try-out { margin-top: 14px; }
.logo-prev { height: 40px; border: 1px solid var(--border); border-radius: 6px; }
.full-w { width: 100%; }

/* ---------- Ô tự gợi ý ---------- */
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.15); z-index: 2000; max-height: 320px; overflow-y: auto; }
.ac-item { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid #f0f4f7; }
.ac-item:hover, .ac-item.active { background: var(--primary-50); }
.ac-empty { padding: 10px 12px; color: var(--muted); }

/* ---------- Toast ---------- */
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 5000; max-width: 420px; }
.toast { padding: 10px 14px; border-radius: 8px; color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.2); font-weight: 500; transition: opacity .3s, transform .3s; }
.toast-ok { background: #17824a; } .toast-err { background: #c62f3b; } .toast-warn { background: #b26a00; } .toast-info { background: #1f5fa8; }
.toast.hide { opacity: 0; transform: translateY(8px); }

/* ---------- Biểu đồ & nhắc việc ---------- */
.chart { width: 100%; height: auto; max-height: 320px; display: block; margin: 4px 0 10px; }
.ch-label { font-size: 12px; fill: var(--muted); }
/* Biểu đồ cột giãn đủ bề ngang (vẽ lại theo bề rộng thật — dashboard.js fitDraw, sếp yêu cầu 03/11/2026) */
.ch-fit { width: 100%; } .ch-fit.fitted .chart { max-height: none; } .ch-fit .ch-label, .ch-fit .ch-tick { font-size: 12.5px; }
.ch-val { font-size: 12px; fill: var(--text); font-weight: 600; }
.ch-bar { fill: #19a3a9; } .ch-bar.neg { fill: #d9534f; }
.ch-axis { stroke: var(--border-strong); stroke-width: 1; }
.ch-grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 3; } .ch-tick { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart.col { max-height: 340px; }
.reminders { list-style: none; margin: 0; padding: 0; }
.reminders li { padding: 7px 0; border-bottom: 1px solid #edf2f6; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.reminders li:last-child { border-bottom: 0; }
.report-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.chip { border: 1px solid var(--border-strong); background: var(--surface); padding: 6px 12px; border-radius: 999px; cursor: pointer; font-size: 13px; }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Tablet / hẹp ---------- */
@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); box-shadow: 0 0 30px rgba(0,0,0,.3); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .nav-overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 45; }
  .main { margin-left: 0; }
  .nav-toggle { display: inline-block; }
  .topbar { padding: 8px 12px; flex-wrap: wrap; }
  .quick-search { order: 3; flex-basis: 100%; max-width: none; }
  .view { padding: 14px 12px 40px; }
  .profile-head { grid-template-columns: 1fr; }
  .ph-sum { justify-content: flex-start; }
  .ph-sum > div { text-align: left; }
}
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .top-actions .btn { padding: 6px 10px; font-size: 13px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 17px; }
}

/* ---------- In ---------- */
#print-area { display: none; }
@media print {
  body { background: #fff; font-size: 12px; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; color: #000; }
  .p-doc { position: relative; font-family: "Times New Roman", Times, serif; font-size: 12.5px; }
  .p-headrow { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
  .p-clinic { display: flex; gap: 10px; align-items: flex-start; font-size: 11.5px; }
  .p-logo { max-height: 48px; max-width: 120px; }
  .p-name { font-weight: 700; font-size: 14px; text-transform: uppercase; }
  .p-meta { text-align: right; font-size: 12px; }
  .p-title { text-align: center; font-size: 18px; margin: 8px 0 2px; letter-spacing: 1px; }
  .p-sub { text-align: center; margin-bottom: 8px; font-size: 12px; }
  .p-info div { margin: 2px 0; }
  .p-table { width: 100%; border-collapse: collapse; margin: 6px 0; font-size: 11.5px; }
  .p-table th, .p-table td { border: 1px solid #555; padding: 3px 5px; text-align: left; }
  .p-table th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .p-table .r, .p-table td.r { text-align: right; }
  .p-table tfoot td { font-weight: 700; }
  .p-table .strike td, tr.strike td { text-decoration: line-through; }
  .p-table .row-sub td { background: #f2f2f2; }
  .p-amount { font-size: 15px; margin-top: 6px; }
  .p-words { margin: 2px 0 4px; }
  .p-sum { margin-top: 4px; }
  .p-cancel { color: #000; font-weight: 700; margin-top: 4px; }
  .p-sign { display: flex; justify-content: space-around; text-align: center; margin-top: 12px; font-weight: 700; }
  .p-sign small { font-weight: 400; }
  .p-watermark { position: absolute; top: 35%; left: 0; right: 0; text-align: center; font-size: 72px; font-weight: 800; color: rgba(200,0,0,.18); transform: rotate(-18deg); pointer-events: none; }
  .p-foot { margin-top: 10px; font-size: 10px; }
  body[data-print="K80"] .p-doc { font-size: 11px; width: 74mm; }
  body[data-print="K80"] .p-headrow, body[data-print="K80"] .p-clinic { display: block; }
  body[data-print="K80"] .p-meta { text-align: left; }
  body[data-print="K80"] .p-sign { display: block; }
  .muted { color: #333; }
}

/* ---------- VIP & chế độ chủ ---------- */
.b-vip { background: #fff3cd; color: #8a5a00; border: 1px solid #e6c36a; }
.btn-vip { color: #8a5a00; border-color: #e6c36a; background: #fffaf0; }
.btn-mode { border-color: var(--border-strong); color: var(--muted); }
.btn-mode.owner { background: #8a5a00; border-color: #8a5a00; color: #fff; }
.stat.vip { border-top: 3px solid #e6c36a; }
.vip-field { padding: 2px 0; }
.vip-field .chk { justify-content: flex-start; width: auto; }
.vip-field .chk input[type=checkbox] { width: 18px; height: 18px; margin: 0; flex: none; }
.lock-panel { max-width: 560px; }

/* ---------- Bảng lịch tháng (ô ngày) ---------- */
.cal-pop { position: fixed; z-index: 3000; width: 316px; max-width: calc(100vw - 16px); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: 0 14px 40px rgba(0,0,0,.2); padding: 10px; user-select: none; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.cal-head b { font-size: 15px; }
.cal-nav { border: 0; background: transparent; font-size: 22px; line-height: 1; width: 32px; height: 32px; border-radius: 6px; cursor: pointer; color: var(--muted, #667); }
.cal-nav:hover { background: var(--surface-2); color: inherit; }
.cal-sel { display: flex; gap: 6px; }
.cal-sel select { font: inherit; font-size: 13.5px; padding: 5px 6px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); color: inherit; cursor: pointer; }
.cal-day.out span { color: #a3adb5; }
.cal-day.out.sel span { color: #fff; }
.cal-foot.c { justify-content: center; border-top: 1px solid var(--border); padding-top: 6px; }
.cal-today { border: 0; background: transparent; font: inherit; color: #2a78d6; font-weight: 600; cursor: pointer; padding: 6px 14px; border-radius: 6px; }
.cal-today:hover { background: var(--surface-2); }
.cal-hint { font-size: 12px; color: var(--muted, #667); text-align: center; margin-bottom: 4px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-dow { text-align: center; font-size: 11px; font-weight: 600; color: var(--muted, #667); padding: 2px 0; }
.cal-day { min-height: 40px; border: 1px solid transparent; border-radius: 6px; background: transparent; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2px 0; font: inherit; color: inherit; }
.cal-day:hover { background: var(--surface-2); border-color: var(--border); }
.cal-day span { font-size: 14px; line-height: 1.1; }
.cal-day small { font-size: 10px; line-height: 1.1; color: #0b7a8a; font-weight: 600; }
.cal-day.today { border-color: #0b7a8a; }
.cal-day.inrange { background: #d9f0f3; }
.cal-day.sel { background: #0b7a8a; color: #fff; }
.cal-day.sel small { color: #e6fbff; }
.cal-day[disabled] { opacity: .35; cursor: default; }
.cal-day[disabled]:hover { background: transparent; border-color: transparent; }
.cal-months { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin: 6px 0 8px; }
.cal-mo { border: 1px solid var(--border); border-radius: 6px; background: transparent; font: inherit; font-size: 12.5px; padding: 4px 0; cursor: pointer; color: inherit; }
.cal-mo:hover { background: var(--surface-2); }
.cal-mo.on { background: #0b7a8a; border-color: #0b7a8a; color: #fff; font-weight: 600; }
.ph-msg { font-size: 12px; color: var(--muted, #667); min-height: 0; margin-top: 2px; }
.ph-msg:empty { display: none; }
.ph-msg.err { color: #b42318; font-weight: 600; }
.cal-foot { display: flex; justify-content: space-between; margin-top: 8px; }
.ap-day-row td { background: var(--surface-2); font-weight: 600; }
@media print { .cal-pop { display: none !important; } }

/* ---------- Hành trình khách: Lead (tím) · Khách hàng (xanh) ---------- */
:root { --lead: #6b4fbb; --lead-soft: #efeafc; }
.bigtabs { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 14px; }
.bigtab { border: 2px solid var(--border); background: var(--surface); border-radius: 12px; padding: 10px 16px; text-align: left; min-width: 260px; cursor: pointer; font: inherit; color: inherit; }
.bigtab b { display: block; font-size: 15px; }
.bigtab span { font-size: 12px; color: var(--muted, #667); }
.bigtab.lead.on { border-color: var(--lead); background: var(--lead-soft); }
.bigtab.cust.on { border-color: #0b7a8a; background: #d9f0f3; }
.jbar .journey { display: flex; flex-wrap: wrap; gap: 6px; }
.jbar .lost-row { margin-top: 8px; align-items: center; }
.jstep { border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 7px 10px; min-width: 112px; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.jstep b { display: block; font-size: 19px; line-height: 1.1; }
.jstep span { font-size: 12px; color: var(--muted, #667); }
.jstep.active { background: #0b7a8a; border-color: #0b7a8a; color: #fff; }
.lead-bar .jstep.active { background: var(--lead); border-color: var(--lead); }
.jstep.active span { color: #fff; }
.jstep.lost { border-color: #f0c2bc; background: #fdecea; }
.jstep.lost.active { background: #c0392b; border-color: #c0392b; }
.jstep.conv { border-color: #b9e2c9; background: #eaf7ef; }
.jstep.conv.active { background: #2f855a; border-color: #2f855a; }
.btn-lead { background: var(--lead); border-color: var(--lead); color: #fff; }
.btn-lead:hover { filter: brightness(1.08); }
.badge.b-lead { background: var(--lead-soft); color: var(--lead); }
.nocode { color: var(--lead); font-size: 12px; font-style: italic; }
.note-box { border-radius: 8px; padding: 8px 10px; font-size: 13px; margin-bottom: 12px; }
.note-box.lead { background: var(--lead-soft); }
.note-box.cust { background: #d9f0f3; }
input.prefill { background: var(--lead-soft); }
.warn-text { color: #b7791f; font-weight: 600; }
.lead-head { margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.tab-actions.wrap { flex-wrap: wrap; }
.jcard .card-title { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hstep { display: flex; align-items: flex-start; overflow-x: auto; padding: 6px 2px 2px; }
.hs { flex: 1 0 96px; text-align: center; position: relative; }
.hs::before { content: ""; position: absolute; top: 12px; left: -50%; width: 100%; height: 2px; background: var(--border); z-index: 0; }
.hs:first-child::before { display: none; }
.hs.done::before, .hs.cur::before { background: #0b7a8a; }
.hs .dot { position: relative; z-index: 1; width: 26px; height: 26px; margin: 0 auto; border-radius: 50%; border: 2px solid var(--border); background: var(--surface); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--muted, #667); }
.hs.done .dot { background: #0b7a8a; border-color: #0b7a8a; color: #fff; }
.hs.cur .dot { border-color: #0b7a8a; color: #0b7a8a; box-shadow: 0 0 0 4px #d9f0f3; }
.hs.lostd .dot { background: #c0392b; border-color: #c0392b; color: #fff; }
.hs .lb { font-size: 11px; margin-top: 4px; line-height: 1.25; }
.hs .dt { font-size: 11px; color: var(--muted, #667); }
.hs.cur .lb { font-weight: 700; color: #0b7a8a; }
.from-lead { background: var(--lead-soft); border-radius: 8px; padding: 8px 10px; margin-top: 10px; font-size: 13px; }
.jtimeline { list-style: none; margin: 4px 0 0 6px; padding: 0 0 0 16px; border-left: 2px solid var(--border); }
.jtimeline li { position: relative; margin-bottom: 12px; }
.jtimeline li::before { content: ""; position: absolute; left: -22px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: #0b7a8a; }
.jtimeline li.lead::before { background: var(--lead); }
.jtimeline li.bad::before { background: #c0392b; }
.jtimeline li.future::before { background: #fff; border: 2px solid #0b7a8a; }
.jtimeline .d { font-size: 12px; color: var(--muted, #667); }
.todo-list { display: flex; flex-direction: column; gap: 6px; }
.todo-item { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 8px; background: #fff4dd; border: 1px solid #f2dfb5; }
.todo-item:hover { border-color: #b7791f; }
.todo-link, .todo-link:hover { display: flex; gap: 8px 10px; align-items: center; flex-wrap: wrap; flex: 1; min-width: 0; color: inherit; text-decoration: none; cursor: pointer; }
.todo-txt { display: flex; flex-direction: column; flex: 1 1 260px; min-width: 0; }
.todo-sub { font-size: 12px; color: var(--muted); }
.todo-item.done { background: var(--ok-50); border-color: #bfe3cd; }
.todo-item.done:hover { border-color: var(--ok); }
.todo-item.done .todo-sub { color: var(--ok); }
.todo-item .ok-ic { color: var(--ok); font-weight: 700; }
.todo-item .who { font-size: 11px; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.todo-item .who.lead { background: var(--lead-soft); color: var(--lead); }
.todo-item .who.cust { background: #d9f0f3; color: #0b5b67; }
.todo-item .who.remind { background: #fbe3b4; color: #6e4300; }
.prog { height: 8px; border-radius: 4px; background: #e3ebf1; overflow: hidden; margin: 2px 0 6px; }
.prog > div { height: 100%; background: var(--ok); }
@media (max-width: 640px) { .bigtab { min-width: 0; flex: 1 1 100%; } .jstep { min-width: 0; flex: 1 1 30%; } }

/* ---------- Nút hỗ trợ (góc dưới trái thanh menu) — thực chất là nút mở / khóa chế độ chủ ---------- */
.support-fab { margin: auto 0 0 14px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: #1a6fd1; display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; box-shadow: 0 2px 8px rgba(0,0,0,.25); flex: none; }
.support-fab:hover { filter: brightness(1.1); }
.support-fab .fab-dot { display: none; position: absolute; right: 0; bottom: 0; width: 10px; height: 10px; border-radius: 50%; background: #2ecc71; border: 2px solid #0d3b4a; }
.support-fab.owner .fab-dot { display: block; }
.sidebar-foot { margin-top: 10px; }

/* ---------- Menu con "Báo cáo" ---------- */
.nav a .grow { flex: 1; }
.nav-chev { font-size: 16px; line-height: 1; transition: transform .15s; opacity: .7; }
.nav a.group-open .nav-chev { transform: rotate(90deg); }
.nav-sub { margin: 2px 0 6px; }
.nav-sub a { padding: 7px 12px 7px 40px; font-weight: 400; font-size: 13.5px; color: #b9d3dc; position: relative; }
.nav-sub a::before { content: ""; position: absolute; left: 24px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: transparent; }
.nav-sub a.active { background: transparent; color: #fff; font-weight: 600; }
.nav-sub a.active::before { background: #3b8cff; }
.nav-sub a:hover { color: #fff; }
.report-chart { overflow-x: auto; }

/* ---------- Bản online: trạng thái kết nối máy chủ ---------- */
.cloud-status { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.cloud-status.online { background: #e3f4ea; color: #2f855a; }
.cloud-status.offline { background: #fdecea; color: #c0392b; }

/* ---------- Hồ sơ khách 8 tab (profile.js) ---------- */
.pf-tabs { margin-top: 10px; }
.pf-tabs a.tab, .ptabs a.tab { text-decoration: none; }
.pf-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.pf-main { min-width: 0; }
.pf-side { position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow-y: auto; }
.sec-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.stabs { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.stabs button { flex: 1; border: 0; background: var(--surface); padding: 7px 4px; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.stabs button.on { background: var(--primary); color: #fff; font-weight: 600; }
.feed .day { font-weight: 600; font-size: 13px; margin: 10px 0 6px; display: flex; align-items: center; gap: 8px; }
.feed .day::before { content: ""; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--accent); flex: none; }
.feed .fi { font-size: 13px; padding: 0 0 8px 17px; border-left: 1px solid var(--border); margin-left: 5px; }
.feed .fi.bad { color: var(--danger); } .feed .fi.lead { color: var(--lead); }
.side-form { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.side-form input, .side-form select, .side-form textarea { width: 100%; }
.side-form .inline { display: flex; gap: 6px; } .side-form .inline > * { flex: 1; min-width: 0; }
.side-form .btn { align-self: flex-start; }
.task { display: flex; gap: 8px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.task > div { flex: 1; } .task.done span { text-decoration: line-through; color: var(--muted); }
.task .icon-btn, .note-item .icon-btn { font-size: 15px; padding: 0 4px; }
.note-item { background: #fffbea; border: 1px solid #f3e3a6; border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; font-size: 13px; white-space: pre-wrap; }
.note-item .small { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; white-space: normal; }
.visit { border-left: 3px solid var(--primary); background: var(--surface-2); border-radius: 6px; padding: 9px 12px; margin-bottom: 9px; }
.visit .d { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.visit .v-acts { margin-left: auto; display: inline-flex; gap: 4px; }
.crumb { font-size: 13px; color: var(--muted); margin: 0 0 8px; } .crumb b { color: var(--primary); }
.phead { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.phead h2 { margin: 0 0 4px; font-size: 18px; }
.ptabs { margin-top: 0; }
.tot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 680px; margin: 14px 0 0 auto; }
.tot .box { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; }
.tot .row { display: flex; justify-content: space-between; padding: 3px 0; }
.tot .big { font-size: 18px; }
.ok-text { color: var(--ok); }
.paybar { height: 5px; background: #e7edf0; border-radius: 99px; overflow: hidden; margin-top: 4px; width: 100px; }
.paybar i { display: block; height: 100%; background: var(--ok); }
.rx-row { display: flex; gap: 6px; margin-bottom: 6px; } .rx-row .rx-name { flex: 2; } .rx-row .rx-qty { flex: 1; } .rx-row .rx-usage { flex: 2; } .rx-row input { min-width: 0; }
@media (max-width: 1100px) { .pf-grid { grid-template-columns: 1fr; } .pf-side { position: static; max-height: none; } }
@media (max-width: 640px) { .tot { grid-template-columns: 1fr; } .rx-row { flex-wrap: wrap; } .rx-row input { flex: 1 1 100%; } }
.pf-grid.wide { grid-template-columns: 1fr; } .pf-grid.wide .pf-side { position: static; max-height: none; }
.pf-main .table.items td:first-child { min-width: 170px; }

/* ---------- Đợt 2: sơ đồ răng · bệnh án · labo (clinical.js) ---------- */
/* Sơ đồ răng SVG (clinical.js K.chartSvg) */
.odo { overflow-x: auto; padding: 4px 0 2px; background: linear-gradient(180deg, #fbfdfe, #f4f8fa); border: 1px solid var(--border); border-radius: 14px; margin: 8px 0 4px; }
.odo-cap { display: grid; grid-template-columns: 1fr auto auto; gap: 18px; align-items: center; min-width: 620px; max-width: 980px; margin: 4px auto 0; padding: 4px 14px; font-size: 12px; color: var(--muted); }
.odo-cap b { color: var(--primary); font-size: 12.5px; letter-spacing: .3px; text-transform: uppercase; }
.odo-svg { display: block; width: 100%; min-width: 620px; max-width: 980px; height: auto; margin: 0 auto; -webkit-user-select: none; user-select: none; }
.odo-svg.milk, .odo-cap.milk { max-width: 680px; }
.odo-svg .midline { stroke: #c7d3dc; stroke-width: 1; stroke-dasharray: 4 5; }
.odo-svg .root { stroke: #d4bf9a; stroke-width: .8; }
.odo-svg .root.back { fill: #e6d4b2; stroke: #d2bb92; }
.odo-svg .screw { stroke: #7f8b96; stroke-width: .8; }
.odo-svg .thread { stroke: #75818c; stroke-width: .8; opacity: .7; }
.odo-svg .canal { fill: none; stroke: #9a6fdc; stroke-width: 2; stroke-linecap: round; }
.odo-svg .gum { pointer-events: none; }
.odo-svg .gum-line { fill: none; stroke: #f1b7c6; stroke-width: .8; opacity: .6; pointer-events: none; }
.odo-svg .crown { stroke: #a9b6c1; stroke-width: .9; transition: stroke .15s; }
.odo-svg .groove { fill: none; stroke: #c3cdd6; stroke-width: .8; stroke-linecap: round; pointer-events: none; }
.odo-svg .gloss { fill: #fff; opacity: .75; pointer-events: none; }
.odo-svg .caries { fill: #8a5136; opacity: .8; }
.odo-svg .filling { fill: #b3dbf8; stroke: #6aaee0; stroke-width: .8; }
.odo-svg .bracket { fill: #5f6c77; }
.odo-svg .wire { stroke: #9aa6b0; stroke-width: 1.2; }
.odo-svg .xmark { fill: none; stroke: #e46a6a; stroke-width: 2.4; stroke-linecap: round; opacity: .85; pointer-events: none; }
.odo-svg .ghost { opacity: .28; }
.odo-svg .ghost .crown, .odo-svg .ghost .root { stroke-dasharray: 3 3; }
.odo-svg .tooth { cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; }
.odo-svg .hit { fill: transparent; transition: fill .15s; }
/* hover và focus tách 2 quy tắc: trình duyệt cũ không hiểu :focus-visible vẫn giữ hiệu ứng rê chuột */
.odo-svg .tooth:hover .hit { fill: rgba(13, 138, 145, .08); stroke: var(--primary); stroke-width: 1; stroke-dasharray: 3 3; }
.odo-svg .tooth:focus-visible .hit { fill: rgba(13, 138, 145, .1); stroke: var(--primary); stroke-width: 1.6; stroke-dasharray: 3 3; }
.odo-svg .tooth:hover .crown { stroke: var(--primary); stroke-width: 1.5; }
.odo-svg .tooth:focus-visible .crown { stroke: var(--primary); stroke-width: 1.5; }
.odo-svg .num { font: 600 11.5px system-ui, -apple-system, "Segoe UI", sans-serif; fill: #7a8893; }
.odo-svg .tooth.marked .num { fill: #13222c; font-weight: 750; }
.odo-svg .tooth.dark .num { fill: #fff; }
.odo-svg .pill { opacity: .95; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 4px; } .legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid #dde5ea; }
.badge.tooth-badge { color: var(--text); border-color: transparent; }
.ba-list { display: flex; gap: 8px; flex-wrap: wrap; }
.ba-pick { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 8px 12px; text-decoration: none; color: inherit; }
.ba-pick.on { border-color: var(--primary); background: var(--primary-50); }
.ba-pick small { display: block; color: var(--muted); }
.ba-form .chk-group { margin-bottom: 6px; }
.p-consent { margin: 10px 0; padding: 8px; border: 1px solid #999; font-size: 12.5px; }

/* ---------- Kho vật tư (stock.js) ---------- */
.stk-tabs a.tab { text-decoration: none; }
.stk-guide { margin: 6px 0 4px 18px; line-height: 1.7; }
.stat-value.neg { color: var(--danger); } .stat-value.warn { color: #b26a00; }
.qty-neg { color: var(--danger); font-weight: 650; } .qty-low { color: #b26a00; font-weight: 650; }
.badges { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.stk-lines td { vertical-align: middle; }
.stk-lines input, .stk-lines select { min-width: 0; width: 100%; }
.stk-lines .ln-mat { min-width: 230px; } .stk-lines .ln-qty { width: 90px; text-align: right; } .stk-lines .ln-price { width: 115px; text-align: right; }
.stk-lines .ln-lot { width: 95px; } .stk-lines .ln-exp { width: 115px; } .stk-lines .ln-unit { white-space: nowrap; } .stk-lines .chk { white-space: nowrap; }
.kk-count { width: 100px; text-align: right; }
.table.kv th { width: 130px; text-align: left; color: var(--muted); font-weight: 500; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.stk-loans { margin-bottom: 14px; } .stk-loans .reminders { margin: 0; }
/* Sinh nhật khách + voucher */
.bd-row { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border, #e3e8ec); }
.bd-row:last-child { border-bottom: 0; }
.bd-row .bd-main { flex: 1 1 320px; min-width: 0; }
.bd-row .btn-row { margin: 0; }
.bd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
/* Marketing — danh sách chương trình */
.mk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 14px; max-width: 1100px; }
.mk-card { display: flex; flex-direction: column; gap: 12px; }
.mk-card > .btn { align-self: flex-start; margin-top: auto; }
.mk-head { display: flex; gap: 10px; align-items: center; }
.mk-head .mk-title { flex: 1; min-width: 0; margin: 0; }
.mk-ico { font-size: 28px; line-height: 1; }
.mk-title { font-weight: 650; font-size: 16px; }
.mk-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.mk-stats b { display: block; font-size: 20px; font-weight: 650; }
.mk-stats span { font-size: 12.5px; color: var(--muted); }
.mk-soon { border-style: dashed; box-shadow: none; background: transparent; justify-content: center; }
.vc-img { display: block; width: 100%; max-width: 560px; height: auto; margin: 0 auto; border-radius: 12px; } /* ảnh 2 mặt (dọc) */
.field.v-field .v-msg { margin-top: 4px; }
/* Thẻ Người Nhà: mỗi người nhà 1 khối */
.fam-row { padding: 8px 0 10px; border-bottom: 1px dashed var(--border); margin-bottom: 4px; }

/* Đăng nhập tên + mật khẩu (02/11/2026) */
.login-screen { position: fixed; inset: 0; z-index: 9999; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-box { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 26px 24px; width: min(360px, 100%); display: grid; gap: 10px; }
.login-box .login-logo { height: 64px; margin: 0 auto; }
.login-box h1 { font-size: 18px; text-align: center; margin: 0 0 4px; }
.login-box .field { display: grid; gap: 4px; }
.login-box input { width: 100%; box-sizing: border-box; }
.login-err { color: var(--danger); font-size: 13px; }
/* Nút con mắt xem / ẩn mật khẩu (02/11/2026) */
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap input { width: 100%; padding-right: 42px !important; box-sizing: border-box; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 6px 8px; border-radius: 6px; line-height: 0; }
.pw-eye:hover { color: var(--primary); background: var(--primary-50); }

/* Lịch hẹn trực quan: Ngày (cột theo bác sĩ) / Tuần (cột theo ngày) — sếp duyệt 02/11/2026 */
.apc-nav { align-items: center; }
.apc-title { font-size: 15px; min-width: 190px; text-align: center; }
.apc-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--muted); margin: 4px 0 6px; }
.apc-legend span { display: inline-flex; align-items: center; gap: 5px; }
.apc-legend .lg { width: 13px; height: 13px; border-radius: 3px; border: 1px solid; display: inline-block; position: static; }
.apc-legend .lg-now { width: 16px; height: 0; border-top: 2px solid var(--danger); display: inline-block; }
.apc-wrap { margin-top: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow: auto; max-height: calc(100vh - 250px); min-height: 360px; }
.apc-grid { display: grid; position: relative; }
.apc-corner, .apc-head { position: sticky; top: 0; z-index: 3; background: var(--surface-2); border-bottom: 1px solid var(--border-strong); }
.apc-corner { left: 0; z-index: 4; }
.apc-head { padding: 9px 6px; text-align: center; font-weight: 600; font-size: 13px; border-left: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apc-head.muted { color: var(--muted); font-weight: 550; }
.apc-head.today { background: var(--primary); color: #fff; }
.apc-n { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: rgba(0,0,0,.08); font-size: 11.5px; font-weight: 600; }
.apc-head.today .apc-n { background: rgba(255,255,255,.25); }
.apc-times { position: sticky; left: 0; z-index: 2; background: var(--surface); border-right: 1px solid var(--border); }
.apc-times span { position: absolute; right: 6px; font-size: 11.5px; color: var(--muted); transform: translateY(2px); }
.apc-col { position: relative; z-index: 0; border-left: 1px solid var(--border); cursor: copy;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(#f1f4f7 1px, transparent 1px); background-size: 100% 64px, 100% 32px; }
.apc-col:hover { background-color: #fafcfd; }
.apc-now { position: absolute; left: 0; right: 0; border-top: 2px solid var(--danger); z-index: 2; pointer-events: none; }
.apc-now::before { content: ''; position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.ev { position: absolute; z-index: 1; border-radius: 6px; padding: 3px 6px; overflow: hidden; cursor: pointer; line-height: 1.3; font-size: 12px; border: 1px solid; border-left-width: 4px; }
.ev:hover { z-index: 3; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.ev b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev i { display: block; font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev u { text-decoration: none; font-weight: 650; }
.ev.sm { padding: 1px 5px; line-height: 1.2; }
.apc-col.off { cursor: default; background-color: #fafafa; }
.ev-hen { background: #e6f1fb; border-color: #85b7eb; color: #0c447c; }
.ev-den { background: #e7f6ee; border-color: #7cc79c; color: #145c33; }
.ev-ko { background: #fdecee; border-color: #ef9aa2; color: #8f1d27; }
.ev-lead { background: #efe9fa; border-color: #b9a6e6; color: #4b2f8f; }
.apc-legend .ev-hen, .apc-legend .ev-den, .apc-legend .ev-ko, .apc-legend .ev-lead { border-left-width: 1px; }
.ap-pop { display: grid; gap: 8px; }
.ap-pop .row-actions { margin-top: 4px; }
@media (max-width: 700px) { .apc-wrap { max-height: calc(100vh - 200px); } .apc-title { min-width: 0; } }
/* Lịch hẹn làm lại (sếp duyệt 04/11/2026): mỗi bác sĩ 1 màu (--c viền · --t nền · --x chữ), tên khách hiện đủ, chấm trạng thái góc thẻ */
.apc-title { font-size: 17px; }
.apc-q { margin-left: auto; width: min(330px, 100%); padding: 7px 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); }
.dchips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 6px; }
.dchip { display: inline-flex; align-items: center; gap: 7px; border: 2px solid var(--c); background: var(--t); color: var(--x); border-radius: 20px; padding: 4px 12px; font: inherit; font-size: 13.5px; font-weight: 650; cursor: pointer; }
.dchip i { width: 11px; height: 11px; border-radius: 50%; background: var(--c); display: inline-block; }
.dchip .apc-n { background: rgba(0, 0, 0, .08); }
.dchip.on { box-shadow: 0 0 0 3px rgba(14, 124, 134, .25); }
.dchip.dim { opacity: .45; }
.dchip:hover { opacity: 1; filter: brightness(.97); }
.dchips .apc-legend { margin: 0 0 0 auto; }
.ev-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0, 0, 0, .15); flex: none; }
.d-hen { background: #f59e0b; } .d-den { background: #16a34a; } .d-ko { background: #dc2626; }
.apc-legend .lg-lead { width: 16px; height: 12px; border: 1.5px dashed #7c5cc4; border-radius: 3px; display: inline-block; }
.apc-qn b { color: #b45309; }
.apc-head.dh { background: var(--surface-2); color: var(--text, #1c2b36); font-weight: 750; font-size: 13.5px; text-transform: uppercase; letter-spacing: .2px; white-space: normal; padding: 11px 6px 10px; } /* nền trắng, không tô màu bác sĩ (sếp duyệt 06/11/2026) */
.apc-head.dh .apc-n { background: rgba(0, 0, 0, .07); }
.apc-head.dh.none { font-weight: 650; }
.apc-col.dc { background-color: #fff; }
.apc-col.dc:hover { background-color: #fafcfd; }
/* Lịch ngày xếp theo thời gian (sếp duyệt 06/11/2026): mỗi giờ 1 hàng, thẻ xếp ngang */
.apm { margin-left: 6px; flex: none; }
.apm .seg-btn { padding: 6px 10px; line-height: 0; color: var(--muted); }
.apm .seg-btn.active { color: #fff; }
.apm .seg-btn svg { width: 18px; height: 18px; }
.apt-wrap { position: relative; }
.apt-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); border-bottom: 1px solid var(--border); min-height: 60px; }
.apt-row:last-child { border-bottom: 0; }
.apt-h { padding: 10px 8px; font-size: 13px; font-weight: 600; color: var(--muted); border-right: 1px solid var(--border); position: sticky; left: 0; z-index: 2; background: var(--surface); cursor: copy; }
.apt-row.now .apt-h { color: var(--danger); }
.apt-cards { display: flex; flex-wrap: wrap; gap: 10px; padding: 8px 10px; align-content: flex-start; border-right: 1px solid var(--border); cursor: copy; min-width: 0; }
.apt-cards:hover { background: #fafcfd; }
/* Xếp theo thời gian, mỗi bác sĩ 1 cột (11/11/2026): hàng tên bác sĩ dính trên cùng */
.apt-hd { position: sticky; top: 0; z-index: 3; background: var(--surface); min-height: 0; box-shadow: 0 1px 0 var(--border); }
.apt-hd .apt-h { z-index: 4; }
.apt-dh { display: flex; align-items: center; gap: 7px; padding: 9px 12px; font-size: 13px; font-weight: 700; color: var(--x); border-right: 1px solid var(--border); min-width: 0; }
.apt-dh i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.apt-dh .apt-dn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apt-dh.off { opacity: .6; }
.apt-cards .evt { width: 228px; flex: none; }
.evt { width: 228px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 6px; cursor: pointer; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }
.evt:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, .15); }
.evt-top { display: flex; justify-content: flex-end; margin: -2px 0 4px; }
.evt-ed { border: 0; background: transparent; padding: 3px 5px; border-radius: 6px; cursor: pointer; color: var(--muted); line-height: 0; }
.evt-ed:hover { background: var(--surface-2); color: var(--text, #1c2b36); }
.evt-ed svg { width: 16px; height: 16px; }
.evt-in { background: var(--t); border-radius: 8px; padding: 9px 11px; color: #33414c; }
.evt-nm { display: block; color: var(--x); font-weight: 750; font-size: 13.5px; text-transform: uppercase; margin-bottom: 4px; overflow-wrap: anywhere; }
.evt-nm u { text-decoration: none; font-size: 10.5px; background: #7c5cc4; color: #fff; border-radius: 5px; padding: 0 5px; vertical-align: 1px; }
.evt-li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.35; margin-top: 6px; }
.evt-li svg { width: 15px; height: 15px; flex: none; margin-top: 1px; color: #6b7a86; }
.evt-li span { overflow-wrap: anywhere; min-width: 0; }
.evt-ld .evt-in { background: #efe9fa; border: 1.5px dashed #7c5cc4; }
.evt-ld .evt-nm { color: #4b2f8f; }
.evt .ev-al { color: var(--danger); }
.evt.hit { box-shadow: 0 0 0 3px #f59e0b, 0 4px 14px rgba(0, 0, 0, .2); }
.evt.miss { opacity: .22; }
@media (max-width: 700px) { .evt { width: 100%; } }
/* Form đặt lịch (sếp duyệt 06/11/2026): 2 ô tick, giờ : phút sổ danh sách */
.ap-flags { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 28px; margin-top: -4px; }
.ap-flags .chk { width: auto; margin: 0; }
.ap-flags .chk:has(input:disabled) { opacity: .8; cursor: default; }
.ap-rv-note { color: #0a6670; font-weight: 600; }
/* Nhãn màu lịch hẹn (sếp duyệt 06/11/2026) */
.ap-clr { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 2px 0; }
.clr-dot { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--c); background: var(--c); box-shadow: inset 0 0 0 3px #fff; cursor: pointer; padding: 0; position: relative; flex: none; }
.clr-dot:hover { transform: scale(1.08); }
.clr-dot:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.clr-dot[aria-checked="true"]::after { content: '✓'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 15px; }
.clr-note { font-size: 12.5px; color: var(--muted); min-height: 1em; }
.tpick { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tpick .tp-in { width: 62px; text-align: center; font-size: 17px; font-weight: 650; color: var(--primary); }
.tpick > b { color: var(--muted); font-size: 17px; }
.tpick .tp-dur { display: inline-flex; align-items: stretch; margin-left: 6px; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; background: var(--surface); }
.tpick .tp-dur input { width: 62px; border: 0; border-radius: 0; text-align: center; box-shadow: none; }
.tpick .tp-dur i { font-style: normal; background: var(--surface-2); border-left: 1px solid var(--border); padding: 0 10px; display: flex; align-items: center; font-size: 13px; font-weight: 600; white-space: nowrap; }
.tp-list { position: fixed; z-index: 3000; max-height: 236px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); padding: 4px; display: flex; flex-direction: column; }
.tp-opt { border: 0; background: transparent; font: inherit; font-size: 14px; text-align: left; padding: 7px 16px; border-radius: 6px; cursor: pointer; color: inherit; }
.tp-opt:hover { background: var(--surface-2); }
.tp-opt.on { background: #e6f4f5; font-weight: 700; color: var(--primary); }
input.date.ico { padding-right: 34px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364727f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='5' width='16' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M4 11h16M8 15h2v2H8z'/%3E%3C/svg%3E") no-repeat right 10px center / 17px; }
.apc-col.today { background-color: #f0f9fa; }
.ev.ev2 { background: var(--t); border: 1px solid var(--c); border-bottom-width: 4px; color: var(--x); border-radius: 8px; padding: 4px 8px 3px; font-size: 12.5px; line-height: 1.3; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.apc-grid.week .ev.ev2 { border-bottom-width: 1px; border-left-width: 5px; }
.ev.ev2:hover { height: auto !important; min-height: var(--h); z-index: 6; box-shadow: 0 4px 14px rgba(0, 0, 0, .2); }
.ev.ev2 .ev-nm { display: block; font-weight: 750; font-size: 13px; text-transform: uppercase; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.25; }
.ev.ev2 .ev-tm, .ev.ev2 .ev-ph, .ev.ev2 .ev-bs { display: block; font-weight: 600; color: #33414c; }
.ev.ev2 .ev-bs { color: var(--x); }
.ev.ev2 .ev-ct { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: #33414c; }
.ev.ev2 .ev-dot { position: absolute; top: 6px; right: 6px; }
.ev.ev2 .ev-al { color: var(--danger); }
.ev.ev2 u { display: inline-block; text-decoration: none; border-radius: 5px; padding: 0 5px; margin-left: 4px; font-size: 10.5px; font-weight: 700; color: #fff; line-height: 1.5; vertical-align: 1px; }
.ev.ev2 .ev-tm { white-space: nowrap; overflow: hidden; } /* giờ 1 dòng; lịch không hiện trạng thái (sếp chốt 05/11/2026) */
.ev.ev2 .ev-tp { display: flex; flex-wrap: wrap; column-gap: 8px; } /* giờ + SĐT cùng dòng, hẹp thì SĐT xuống dòng */
.ev.ev2 .ev-tp > span { display: inline-block; white-space: nowrap; }
.ev.ev2 .ev-ct.clamp1 { -webkit-line-clamp: 1; }
.ev.ev2 .fit-hide { display: none !important; }
.ev.ev2:hover .ev-ct { -webkit-line-clamp: 6; }
.ev.ev2:hover .fit-hide { display: block !important; }
.ev.ev2:hover .ev-tp > .fit-hide { display: inline-block !important; }
.ev.ev2:hover .ev-ct.fit-hide { display: -webkit-box !important; }
.ev.ev2 u.t-den { background: #16a34a; } .ev.ev2 u.t-ko { background: #dc2626; } .ev.ev2 u.t-ld { background: #7c5cc4; }
.ev.ev2.sm { padding: 3px 7px 2px; }
.ev.ev2.sm .ev-nm { font-size: 12.5px; line-height: 1.2; }
.ev.ev2.ko { opacity: .62; background-image: repeating-linear-gradient(135deg, transparent 0 8px, rgba(255, 255, 255, .55) 8px 14px); }
.ev.ev2.ev-ld { background: #fff; border: 1.5px dashed #7c5cc4; color: #4b2f8f; }
.ev.ev2.hit { box-shadow: 0 0 0 3px #f59e0b, 0 4px 14px rgba(0, 0, 0, .2); z-index: 5; opacity: 1; }
.ev.ev2.miss { opacity: .22; }
/* Chọn màu bác sĩ trên lịch hẹn (form Nhân viên) */
.clr-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.clr-opt { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; font-size: 11.5px; color: var(--muted); max-width: 96px; text-align: center; }
.clr-opt input { position: absolute; opacity: 0; pointer-events: none; }
.clr-sw { display: inline-block; min-width: 84px; padding: 6px 8px; border: 2px solid var(--c); background: var(--t); color: var(--x); border-radius: 8px; font-weight: 650; font-size: 13px; }
.clr-opt input:checked + .clr-sw { box-shadow: 0 0 0 3px var(--c); }
.clr-opt input:focus-visible + .clr-sw { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Nút Đổi mật khẩu / Đăng xuất to, dễ nhìn ở chân thanh menu (02/11/2026) */
.sidebar-foot .sf-user { font-size: 13.5px; color: #d8e9ef; margin-bottom: 10px; word-break: break-all; }
.sidebar-foot .sf-user b { color: #fff; font-size: 14.5px; }
.sf-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; margin: 0 0 8px; padding: 10px 12px; border-radius: 10px; font-size: 15px; font-weight: 650; cursor: pointer; transition: filter .15s, background .15s; }
.sf-btn svg { flex: none; }
.sf-pw { background: #fff; color: #0d3b4a; border: 2px solid #fff; }
.sf-pw:hover { background: #e6f4f5; border-color: #e6f4f5; }
.sf-out { background: #d9534f; color: #fff; border: 2px solid #d9534f; }
.sf-out:hover { filter: brightness(1.08); }
.sf-btn:focus-visible { outline: 3px solid #ffd666; outline-offset: 2px; }
.sidebar-foot .sf-note { font-size: 11.5px; color: #9fc3cf; margin-top: 4px; }

/* Dải "Đang mở khách VIP" (nhân viên nhập mã — 02/11/2026) */
.vip-bar { display: inline-flex; align-items: center; gap: 8px; background: #e7f6ee; color: #145c33; border: 1px solid #7cc79c; border-radius: 999px; padding: 3px 5px 3px 12px; font-size: 13px; white-space: nowrap; }
.vip-bar a { color: inherit; }
.vip-bar.warn { background: #fff5e0; color: #7a4a00; border-color: #f2d59b; }
.vip-code-big { font-size: 30px; font-weight: 700; letter-spacing: 6px; text-align: center; padding: 12px; margin-top: 8px; border-radius: 10px; background: var(--primary-50); color: #0a6670; font-variant-numeric: tabular-nums; }

/* ===== Hồ sơ khách: địa chỉ 4 ô + ô chọn nhiều xổ xuống (sếp duyệt 02/11/2026) ===== */
.addr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px 12px; }
.addr-cell { display: flex; flex-direction: column; gap: 3px; min-width: 0; position: relative; }
.addr-cell > small { color: var(--muted); font-size: 12px; } .addr-cell > small i { font-style: normal; opacity: .8; }
.addr-full { margin-top: 4px; }
.combo-list { border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); max-height: 280px; overflow: auto; margin-top: 2px; box-shadow: var(--shadow); }
.combo-head { font-size: 12px; color: var(--muted); padding: 6px 10px 2px; }
.combo-opt { padding: 6px 10px; cursor: pointer; font-size: 14px; }
.combo-opt small { display: block; color: var(--muted); font-size: 12px; }
.combo-opt:hover, .combo-opt.on { background: var(--primary-50); }
.pick { position: relative; }
.pick-box { min-height: 38px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); padding: 5px 30px 5px 8px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; cursor: pointer; position: relative; }
.pick-box:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(14,124,134,.15); }
.pick-caret { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 12px; }
.pick.open .pick-caret { transform: translateY(-50%) rotate(180deg); }
.pick-ph { color: var(--muted); font-size: 14px; }
.pick-chip { font-size: 13px; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.pick-chip.red { background: var(--danger-50); color: var(--danger); border-color: #f3b8be; font-weight: 600; }
.pick-chip.ok { background: var(--ok-50); color: var(--ok); border-color: #b5e2c8; }
.pick-pan { border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); margin-top: 4px; padding: 6px; box-shadow: var(--shadow); }
.pick-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 8px; }
.pick-opts .pick-opt { display: flex; align-items: flex-start; gap: 8px; padding: 6px 8px; border-radius: 6px; font-size: 14px; }
.pick-opts .pick-opt input { margin-top: 2px; }
.pick-opts .pick-opt:hover { background: var(--surface-2); }
.pick-opts .pick-opt small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.pick-opts .pick-opt.red > span { color: var(--danger); }
.pick-opts .pick-opt.none > span { color: var(--ok); font-weight: 600; }
.pick-opts .pick-opt:has(input:checked) { background: var(--primary-50); }
.pick-other { display: flex; gap: 6px; padding: 6px 4px 2px; }
.pick-other input { flex: 1; }
.pick-foot { text-align: right; padding: 4px 4px 0; }
#pick-card .pk-list .table input.pk-t { min-width: 170px; } #pick-card .pk-list .table input.pk-h { min-width: 220px; }
#pick-card .pk-list .table input { width: 100%; padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: 6px; }
#pick-card .pk-list .table input[type=checkbox] { width: 18px; height: 18px; }

/* ===== Ô giai đoạn điều trị dưới tên dịch vụ (mẫu sếp chọn 02/11/2026) ===== */
.ws-wrap { display: flex; width: max-content; margin-top: 6px; }
.ws-pill { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 3px 10px; border-radius: 7px; border: 1px solid; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; }
.ws-pill:disabled { cursor: default; } .ws-pill:disabled:not(.ws-busy) .ws-caret { display: none; } .ws-pill.ws-busy { opacity: .6; cursor: progress; }
.ws-pill:focus-visible, .ws-item:focus-visible { outline: 3px solid rgba(14,124,134,.35); outline-offset: 1px; }
.ws-dot { width: 15px; height: 8px; border-radius: 4px; flex: none; }
.ws-caret { font-size: 10px; opacity: .8; }
.ws-CHUA_LAM { color: #4b5560; border-color: #b9c3cb; background: #f1f4f6; } .ws-CHUA_LAM .ws-dot { background: #8a96a0; }
.ws-DANG_LAM { color: #1859aa; border-color: #6ea4e6; background: #e9f1fc; } .ws-DANG_LAM .ws-dot { background: #1f6fd1; }
.ws-XONG { color: #146c3a; border-color: #84c9a1; background: #e7f6ee; } .ws-XONG .ws-dot { background: #1b8a4b; }
.ws-HUY { color: #a3242f; border-color: #eba2a9; background: #fdecee; } .ws-HUY .ws-dot { background: #c62f3b; }
.ws-menu { position: fixed; z-index: 2000; min-width: 190px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 9px; box-shadow: 0 6px 20px rgba(16,42,60,.16); padding: 4px; display: flex; flex-direction: column; }
.ws-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; background: transparent; border-radius: 6px; font-size: 14px; color: var(--text); cursor: pointer; text-align: left; }
.ws-item:hover, .ws-item:focus-visible { background: var(--surface-2); }
.ws-item.ws-HUY { color: var(--danger); border-top: 1px solid var(--border); border-radius: 0 0 6px 6px; margin-top: 2px; }

.code-input { text-transform: uppercase; } .code-input::placeholder { text-transform: none; }

/* ===== Slogan mỗi ngày (đầu màn Tổng quan) ===== */
.motto { background: #17468f; color: #fff; border-radius: 14px; padding: 18px 20px; margin-bottom: 16px; display: grid; gap: 8px; }
.motto-eyebrow { font-size: 12px; letter-spacing: .07em; text-transform: uppercase; opacity: .8; font-weight: 600; }
.motto-line { font-size: clamp(20px, 2.6vw, 27px); font-weight: 700; line-height: 1.3; text-wrap: balance; }
.motto-line em { font-style: normal; color: #ffb3ba; }
.motto-hi { font-size: 15px; opacity: .95; } .motto-hi b { font-weight: 700; }
.motto-bar { height: 8px; border-radius: 4px; background: rgba(255,255,255,.22); overflow: hidden; }
.motto-bar i { display: block; height: 100%; background: #7fd3a5; border-radius: 4px; transition: width .4s; }
.motto-done { font-size: 14px; font-weight: 600; color: #b8f0cf; }
.login-motto { margin: -4px 0 6px; font-size: 15px; font-weight: 600; color: #17468f; text-align: center; text-wrap: balance; }
.login-motto em { font-style: normal; color: #d23b45; }
@media (prefers-reduced-motion: reduce) { .motto-bar i { transition: none; } }

/* ===== Khung số khi rê chuột vào cột biểu đồ (02/11/2026) ===== */
.ch-bar[data-tip] { cursor: pointer; transition: opacity .15s; }
.chart:has(.ch-bar.on) .ch-bar[data-tip]:not(.on) { opacity: .55; }
.ch-bar.on { opacity: 1; filter: drop-shadow(0 2px 4px rgba(16,42,60,.25)); }
.ch-bar[data-tip]:focus { outline: none; }
.ch-tip { position: fixed; z-index: 3000; pointer-events: none; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: 0 6px 18px rgba(16,42,60,.16); padding: 8px 12px; font-size: 13.5px; color: var(--text); max-width: 280px; }
.ch-tip-h { color: var(--muted); font-size: 12.5px; margin-bottom: 3px; }
.ch-tip-v { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.ch-tip-v i { width: 9px; height: 9px; border-radius: 50%; background: #19a3a9; flex: none; }
.ch-tip-v b { font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .ch-bar[data-tip] { transition: none; } }

/* ===== Voucher cũ (giấy, phát trước CRM) trong form dịch vụ ===== */
.btn-link { background: none; border: 0; padding: 4px 0; color: var(--accent); text-decoration: underline; cursor: pointer; justify-self: start; }
.lg-box { border: 1px solid var(--border-strong); border-radius: 10px; padding: 12px; background: var(--surface-2); display: grid; gap: 8px; margin-top: 4px; }
.lg-title { font-weight: 600; }
.lg-grid .lg-types { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.lg-grid .lg-types label { flex-direction: row; align-items: center; gap: 6px; font-size: 14px; color: var(--text); }
.lg-grid .lg-types input { width: auto; padding: 0; }
.lg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px 12px; }
.lg-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--muted); }
.lg-grid input, .lg-grid select { width: 100%; padding: 7px 9px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); }

/* ---------- Trợ lý Tâm An (03/11/2026): chấm tròn góc dưới phải + khung hỏi đáp ---------- */
body.has-bot #toasts { right: 84px; }
.bot-dot { position: fixed; right: 18px; bottom: 18px; z-index: 4900; width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); box-shadow: 0 4px 14px rgba(16, 42, 60, .28); display: flex; align-items: center; justify-content: center; transition: transform .15s; }
.bot-dot:hover { transform: scale(1.06); } .bot-dot.on { background: var(--accent-600); }
.bot-dot:focus-visible { outline: 3px solid #9cc2f3; outline-offset: 2px; }
.bot-panel { position: fixed; right: 18px; bottom: 80px; z-index: 4950; width: 390px; max-width: calc(100vw - 24px); height: min(600px, calc(100vh - 110px)); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 12px 40px rgba(16, 42, 60, .25); overflow: hidden; }
.bot-panel[hidden] { display: none; }
.bot-head { display: flex; align-items: center; gap: 6px; padding: 10px 10px 10px 14px; background: var(--accent); color: #fff; }
.bot-title { flex: 1; min-width: 0; } .bot-title b { display: block; font-size: 15px; } .bot-title small { opacity: .85; font-size: 12px; }
.bot-x { width: 32px; height: 32px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .15); color: #fff; font-size: 18px; cursor: pointer; }
.bot-x:hover { background: rgba(255, 255, 255, .28); }
.bot-body { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.5; }
.bot-msg { max-width: 92%; padding: 8px 12px; border-radius: 12px; word-wrap: break-word; }
.bot-msg.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.bot-msg.ai { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.bot-msg.ai.err { background: var(--danger-50); border-color: #f3c3c8; color: #8a1f29; }
.bot-msg p { margin: 0 0 6px; } .bot-msg p:last-child { margin-bottom: 0; }
.bot-msg ol, .bot-msg ul { margin: 4px 0 6px; padding-left: 20px; } .bot-msg li { margin: 2px 0; }
.bot-msg code { background: #e8eef3; padding: 0 4px; border-radius: 4px; font-size: 13px; }
.bot-tbl { overflow-x: auto; margin: 4px 0 6px; } .bot-tbl table { border-collapse: collapse; font-size: 12.5px; } .bot-tbl td { border: 1px solid var(--border); padding: 3px 6px; vertical-align: top; }
.bot-dots { display: inline-flex; gap: 4px; padding: 4px 2px; vertical-align: middle; }
.bot-dots i { width: 8px; height: 8px; border-radius: 50%; background: #8a9aa8; animation: botdot 1.3s infinite ease-in-out; }
.bot-dots i:nth-child(2) { animation-delay: .2s; } .bot-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes botdot { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-6px); } } /* kiểu Messenger: 3 chấm nảy lần lượt */
@keyframes botfade { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bot-dots i { animation-name: botfade; } .bot-dot { transition: none; } } /* máy tắt hiệu ứng: chỉ sáng–mờ, không nảy */
.bot-hello p { margin: 0 0 10px; }
.bot-tips { display: flex; flex-wrap: wrap; gap: 6px; }
.bot-tip { padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 13px; cursor: pointer; text-align: left; }
.bot-tip:hover { border-color: var(--accent); color: var(--accent-600); }
.bot-left { align-self: center; font-size: 12px; color: var(--warn); }
.bot-warn { padding: 8px 10px; border-radius: 8px; background: var(--warn-50); border: 1px solid #f2d59b; color: #7a4a00; font-size: 13px; }
.bot-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); background: var(--surface); }
.bot-form[hidden] { display: none; }
.bot-form textarea { flex: 1; resize: none; min-height: 44px; max-height: 120px; font: inherit; }
.bot-foot { padding: 0 12px 8px; font-size: 11.5px; color: var(--muted); background: var(--surface); }
.bot-howto { margin: 8px 0 12px; } .bot-howto summary { cursor: pointer; } .bot-howto ol { margin: 8px 0 0; padding-left: 20px; } .bot-howto li { margin: 4px 0; }
@media (max-width: 640px) {
  .bot-dot { right: 12px; bottom: 12px; width: 48px; height: 48px; }
  .bot-panel { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
  body.has-bot #toasts { right: 12px; bottom: 70px; }
}
@media print { .bot-dot, .bot-panel { display: none !important; } }

/* ---------- Cài đặt → Nhóm quyền (05/11/2026, bố cục theo mẫu Wion sếp gửi) ---------- */
.pq { display: grid; grid-template-columns: 250px minmax(0, 1fr); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; min-height: 560px; }
.pq .sp { flex: 1; }
.pq-g { background: #f4f6f8; padding: 10px; border-right: 1px solid var(--border); }
.pq-gh { display: flex; align-items: center; gap: 6px; background: #fff; border-radius: 8px 8px 0 0; padding: 10px 10px 8px; }
.pq-gh b { font-size: 17px; }
.pq-ib { width: 30px; height: 30px; border-radius: 6px; border: 1px solid #d1d5db; background: #fff; cursor: pointer; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; }
.pq-ib.add { background: #16a34a; border-color: #16a34a; color: #fff; font-weight: 700; font-size: 18px; }
.pq-q { width: 100%; margin: 0 0 6px; }
.pq-gl { background: #fff; border-radius: 0 0 8px 8px; padding: 4px 8px 8px; display: flex; flex-direction: column; gap: 2px; }
.pq-gi { display: flex; align-items: center; gap: 6px; padding: 10px 10px; border-radius: 8px; cursor: pointer; font-weight: 600; border: 1px solid transparent; }
.pq-gi:hover { background: #f8fafc; }
.pq-gi.on { border-color: #3b82f6; background: #eff6ff; }
.pq-gi .nm { flex: 1; }
.pq-gi button { display: none; border: 0; background: transparent; cursor: pointer; font-size: 14px; padding: 2px 4px; }
.pq-gi.on button { display: inline-block; }
.pq-gi .pq-ed { color: #16a34a; } .pq-gi .pq-dl { color: #dc2626; }
.pq-r { display: flex; flex-direction: column; min-width: 0; }
.pq-tabs { display: flex; align-items: center; gap: 22px; border-bottom: 1px solid var(--border); padding: 0 14px; flex-wrap: wrap; }
.pq-tab { border: 0; background: transparent; padding: 13px 2px 11px; font: inherit; font-weight: 600; color: #64748b; cursor: pointer; border-bottom: 3px solid transparent; }
.pq-tab.on { color: #16a34a; border-bottom-color: #16a34a; }
.pq-cnt { display: inline-block; background: #eef2f7; color: #475569; border-radius: 10px; padding: 0 7px; font-size: 12px; margin-left: 3px; }
.pq-save { background: #16a34a; border-color: #16a34a; color: #fff; font-weight: 700; }
.pq-save:hover { background: #15803d; }
.pq-dirty { color: #b45309; font-size: 12.5px; font-weight: 600; }
.pq-body { display: block; flex: 1; }
.pq-c { border-right: 1px solid var(--border); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.pq-c > b, .pq-lh > b { font-size: 16px; margin-bottom: 8px; }
.pq-cat { display: flex; align-items: center; gap: 10px; padding: 10px 10px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; font: inherit; text-align: left; color: #334155; }
.pq-cat:hover { background: #eef2f7; }
.pq-cat i { font-style: normal; width: 18px; text-align: center; }
.pq-l { padding: 14px 16px; min-width: 0; }
.pq-lh { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.pq-lh > b { margin-bottom: 0; }
.pq-tg { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; cursor: pointer; font: inherit; color: inherit; }
.pq-sw { width: 34px; height: 18px; border-radius: 9px; background: #e5e7eb; border: 1px solid #d1d5db; position: relative; flex: none; }
.pq-sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #94a3b8; transition: left .15s; }
.pq-tg.on .pq-sw { background: #16a34a; border-color: #16a34a; } .pq-tg.on .pq-sw::after { left: 18px; background: #fff; }
.pq-sec { border-top: 1px solid var(--border); padding: 10px 0 6px; } .pq-sec:first-of-type { border-top: 0; }
.pq-st { color: #64748b; font-weight: 600; margin: 4px 0 8px; }
.pq-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 12px; }
.pq-it { padding: 5px 0; min-width: 0; }
.pq-row { display: flex; align-items: center; gap: 10px; }
.pq-chev { width: 18px; border: 0; background: transparent; color: #64748b; cursor: pointer; font-size: 15px; padding: 0; transition: transform .15s; }
.pq-chev.open { transform: rotate(90deg); }
.pq-cb { width: 19px; height: 19px; flex: none; border-radius: 4px; border: 1.5px solid #cbd5e1; background: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: #fff; font-weight: 900; font-size: 13px; }
.pq-cb.full, .pq-cb.part { background: #16a34a; border-color: #16a34a; }
.pq-cb.lock { background: #f1f5f9; border-color: #e2e8f0; cursor: not-allowed; font-size: 10px; }
.pq-lb { cursor: pointer; } .pq-lb.lock { color: #94a3b8; cursor: not-allowed; }
.pq-sub { margin: 6px 0 4px 28px; padding: 6px 10px; border-left: 2px solid #bbf7d0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.pq-sub .pq-cb { width: 16px; height: 16px; font-size: 11px; }
.pq-why { font-size: 12px; color: #94a3b8; }
.pq-mem { padding: 14px 16px; }
.pq-mh { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
@media (max-width: 1100px) { .pq-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .pq { grid-template-columns: 1fr; } .pq-g { border-right: 0; border-bottom: 1px solid var(--border); } .pq-body { grid-template-columns: 1fr; } .pq-c { display: none; } .pq-grid { grid-template-columns: 1fr; } }

/* ---------- Cài đặt & Dữ liệu › Chương trình marketing (05/11/2026, kiểu "Cấu hình khác" Wion) ---------- */
.mkc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; row-gap: 4px; }
.mkc-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 10px 0; }
.mkc-ic { width: 44px; height: 44px; border-radius: 8px; background: #f1f5f9; display: flex; align-items: center; justify-content: center; font-size: 21px; }
.mkc-t { font-weight: 600; font-size: 15.5px; margin-top: 2px; }
.mkc-d { color: var(--muted, #64748b); font-size: 13.5px; margin-top: 2px; line-height: 1.45; }
.mkc-sub { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13.5px; cursor: pointer; }
.mkc-sub input { width: 17px; height: 17px; accent-color: #16a34a; }
.mkc-cfg { margin-top: 6px; padding: 0; border: 0; background: transparent; color: #0b7a8a; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.mkc-cfg:hover { text-decoration: underline; }
.mkc-sw { display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 8px; }
.mkc-tg { width: 42px; height: 24px; border-radius: 12px; background: #e5e7eb; border: 1px solid #d1d5db; position: relative; cursor: pointer; padding: 0; }
.mkc-tg::after { content: ''; position: absolute; top: 4px; left: 4px; width: 14px; height: 14px; border-radius: 50%; background: #94a3b8; transition: left .15s; }
.mkc-tg.on { background: #16a34a; border-color: #16a34a; } .mkc-tg.on::after { left: 23px; background: #fff; }
.mkc-tg:disabled { opacity: .6; cursor: wait; }
.mkc-st { font-size: 12px; font-weight: 700; color: #94a3b8; white-space: nowrap; } .mkc-st.on { color: #16a34a; }
@media (max-width: 900px) { .mkc-grid { grid-template-columns: 1fr; } }
/* Nhân viên: 3 tab + Setup hoa hồng (sếp chốt 05/11/2026) */
.sf-tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--border); margin: 0 0 18px; flex-wrap: wrap; }
.sf-tab { border: 1px solid var(--border); border-bottom: 0; background: #f1f5f9; color: #64748b; padding: 11px 24px; border-radius: 6px 6px 0 0; font: inherit; font-weight: 550; margin-bottom: -1px; cursor: pointer; }
.sf-tab.on { background: #fff; color: #16a34a; }
.sf-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 40px; }
.sf-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: 12px; }
.sf-row b { font-weight: 600; }
.sf-row select:disabled { background: #f8fafc; color: #0f172a; opacity: 1; }
@media (max-width: 760px) { .sf-grid2 { grid-template-columns: 1fr; } .sf-row { grid-template-columns: 1fr; gap: 6px; } }
.hh-note { margin-top: 16px; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; font-size: 13px; color: #475569; line-height: 1.55; }
.hh { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 14px; align-items: start; }
.hh-l, .hh-r { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; min-width: 0; }
.hh-lh { font-size: 19px; font-weight: 600; margin-bottom: 12px; }
.hh-lth { display: flex; justify-content: space-between; background: #f1f5f9; margin: 0 -16px; padding: 10px 16px; font-weight: 600; font-size: 13.5px; }
.hh-it { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; margin: 0 -16px; border-bottom: 1px solid var(--border); cursor: pointer; }
.hh-it:hover { background: #f8fafc; } .hh-it.on { background: #f0fdf4; } .hh-it.on .hh-n b { color: #16a34a; }
.hh-n { display: flex; flex-direction: column; min-width: 0; } .hh-n small { color: #0b7a8a; font-weight: 600; font-size: 12.5px; margin-top: 2px; }
.hh-pct { width: 112px; padding: 7px 8px; }
.hh-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.hh-title { font-weight: 700; font-size: 16px; margin-right: auto; }
.hh-badge { background: #dcfce7; color: #166534; border-radius: 999px; padding: 2px 10px; font-size: 13px; } .hh-badge.off { background: #f1f5f9; color: #64748b; }
.hh-dirty { color: #b45309; font-size: 12.5px; font-weight: 600; }
.btn.hh-save { background: #16a34a; border-color: #16a34a; color: #fff; min-width: 90px; } .btn.hh-save:disabled { opacity: .5; }
.hh-search { display: flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 6px; padding: 0 10px; min-width: 260px; }
.hh-search input { border: 0; outline: 0; padding: 8px 0; width: 100%; background: transparent; }
.hh-empty { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 10px 14px; margin-bottom: 10px; font-size: 13.5px; }
.hh-tb td { vertical-align: middle; } .hh-tb small { font-size: 12px; }
.hh-g td { background: #f8fafc; padding-top: 10px; padding-bottom: 10px; }
.hh-gbtn { background: #16a34a; border-color: #16a34a; color: #fff; } .hh-gbtn:disabled { opacity: .45; }
.hh-own td { background: #fefce8; }
.hh-in { display: inline-flex; border: 1px solid #cbd5e1; border-radius: 6px; overflow: hidden; background: #fff; }
.hh-in input { width: 110px; border: 0; padding: 7px 10px; outline: 0; } .hh-in select { border: 0; border-left: 1px solid #cbd5e1; padding: 0 8px; background: #fff; }
.hh-in input:disabled, .hh-in select:disabled { background: #f8fafc; }
@media (max-width: 1000px) { .hh { grid-template-columns: 1fr; } .hh-search { min-width: 0; flex: 1; } }

/* Màn tạo phiếu điều trị 1 trang (sếp duyệt mẫu 05/11/2026, kiểu Wion) */
.pe-top { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.pe-top .sp, .pe-tq .sp { flex: 1; }
.pe-bc { font-size: 13px; color: #64748b; } .pe-bc a { color: #64748b; } .pe-bc b { color: #16a34a; font-weight: 500; }
.pe-top h2 { margin: 2px 0 0; font-size: 22px; }
.pe-cards { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.pe-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; min-width: 0; }
.pe-cust { display: flex; gap: 14px; } .pe-cb { flex: 1; min-width: 0; }
.pe-av { width: 44px; height: 44px; border-radius: 8px; background: var(--primary-50); color: var(--primary); font-weight: 700; font-size: 20px; display: flex; align-items: center; justify-content: center; flex: none; }
.pe-name { font-size: 18px; font-weight: 700; } .pe-name small { font-size: 13.5px; font-weight: 400; color: #475569; margin-left: 10px; }
.pe-kv { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 7px 10px; margin-top: 8px; font-size: 14px; align-items: center; }
.pe-card > .pe-kv { margin-top: 0; }
.pe-kv > span { color: #334155; }
.pe-red { color: var(--danger); font-weight: 600; }
.pe-tag { display: inline-block; border: 1px solid #cbd5e1; background: #f1f5f9; border-radius: 6px; padding: 1px 8px; font-size: 12.5px; }
.pe-inl { border: 0; border-bottom: 1px dashed #94a3b8; border-radius: 0; padding: 2px 0; background: transparent; color: var(--primary-600); width: 100%; max-width: 240px; font: inherit; }
.pe-inl:focus { outline: 0; border-bottom-color: var(--primary); }
.pe-main { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.pe-search { display: flex; align-items: center; gap: 8px; border: 1px solid #cbd5e1; border-radius: 8px; padding: 0 12px; max-width: 460px; position: relative; background: #fff; }
.pe-search input { border: 0; outline: 0; padding: 10px 0; width: 100%; background: transparent; }
.pe-res { position: absolute; left: 0; top: 44px; width: min(600px, 92vw); background: #fff; border: 1px solid #cbd5e1; border-radius: 8px; box-shadow: 0 12px 28px rgba(15, 23, 42, .18); z-index: 40; max-height: 380px; overflow: auto; }
.pe-res button { display: grid; grid-template-columns: 70px minmax(0, 1fr) 110px; gap: 8px; width: 100%; text-align: left; padding: 9px 12px; border: 0; border-bottom: 1px solid #f1f5f9; background: #fff; font: inherit; font-size: 13.5px; cursor: pointer; }
.pe-res button:hover, .pe-res button.on { background: #f0fdf4; } .pe-res .r { text-align: right; }
.pe-res-h { padding: 8px 12px; font-size: 12px; color: #64748b; }
.pe-tw { overflow: visible; }
.pe-tb { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
.pe-tb th { background: #f1f5f9; text-align: left; padding: 10px 8px; font-weight: 600; color: #334155; white-space: nowrap; }
.pe-tb td { padding: 11px 8px; border-bottom: 1px solid #e2e8f0; vertical-align: middle; }
.pe-tb .r { text-align: right; } .pe-rel { position: relative; }
.pe-tb input, .pe-tb select { border: 1px solid #cbd5e1; border-radius: 6px; padding: 6px 8px; background: #fff; font: inherit; }
.pe-sn { font-weight: 500; } .pe-rdate { width: 128px; margin-top: 6px; }
.pe-qty { width: 56px; } .pe-price { width: 118px; text-align: right; } .pe-vat { width: 74px; }
.pe-ppl { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 4px; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.pe-ppl i { font-style: normal; color: #16a34a; } .pe-ppl small { display: block; color: #64748b; font-size: 12px; }
.pe-ppl:hover { background: #f8fafc; border-radius: 6px; }
.pe-all { border: 0; background: #e2e8f0; border-radius: 6px; padding: 2px 7px; margin-left: 8px; cursor: pointer; }
.pe-tooth { border: 0; background: transparent; color: #16a34a; font-weight: 600; cursor: pointer; padding: 2px 0; font: inherit; }
.pe-dx { display: block; margin-top: 6px; width: 160px; background: #f8fafc !important; font-size: 13px !important; }
.pe-disc { display: inline-flex; } .pe-disc input { width: 76px; text-align: right; border-radius: 6px 0 0 6px !important; } .pe-disc select { border-left: 0 !important; border-radius: 0 6px 6px 0 !important; background: #f8fafc !important; }
.pe-fam { font-size: 12.5px; color: #166534; }
.pe-del { border: 0; background: transparent; color: #dc2626; cursor: pointer; font-size: 16px; }
.pe-pop { position: absolute; z-index: 35; left: 4px; top: calc(100% - 4px); background: #fff; border: 1px solid #cbd5e1; border-radius: 8px; box-shadow: 0 12px 28px rgba(15, 23, 42, .18); padding: 12px 14px; width: 290px; text-align: left; font-weight: 400; white-space: normal; }
.pe-pop label { display: block; font-weight: 600; font-size: 13.5px; margin: 6px 0 5px; }
.pe-pop select { width: 100%; }
.pe-pop-t { font-weight: 600; font-size: 13.5px; margin-bottom: 6px; } .pe-pop-b { margin-top: 10px; text-align: right; }
.pe-tp { width: 560px; left: -60px; }
.pe-trow { display: flex; gap: 4px; justify-content: center; margin: 4px 0; }
.pe-t { width: 27px; height: 28px; border: 1px solid #cbd5e1; border-radius: 5px; background: #fff; font-size: 12px; cursor: pointer; padding: 0; }
.pe-t.on { background: #16a34a; border-color: #16a34a; color: #fff; } .pe-tgap { width: 14px; }
.pe-tq { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.pe-saved td { background: #f0fdf4; } .pe-err td { background: #fef2f2; } .pe-errmsg { color: var(--danger); font-size: 12.5px; margin-top: 4px; }
.pe-empty { text-align: center; color: #64748b; padding: 28px 8px !important; }
.pe-foot { display: flex; justify-content: space-between; align-items: flex-start; margin-top: 16px; gap: 16px; flex-wrap: wrap; }
.pe-offer { border: 1px solid #16a34a; color: #16a34a; border-radius: 8px; padding: 9px 16px; background: #fff; cursor: pointer; font: inherit; font-weight: 600; }
.pe-offer-on { margin-top: 8px; font-size: 13.5px; }
.pe-hint { font-size: 12.5px; color: #64748b; margin-top: 8px; max-width: 520px; }
.pe-sum { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px 16px; width: 380px; max-width: 100%; font-size: 14px; }
.pe-sum > div { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; gap: 8px; }
.pe-sum .tot { font-weight: 700; font-size: 15px; border-top: 1px solid #e2e8f0; margin-top: 4px; padding-top: 8px; } .pe-sum .tot b { color: #16a34a; font-size: 20px; }
.pe-g { display: inline-flex; align-items: center; gap: 6px; } .pe-g input { width: 96px; text-align: right; border: 1px solid #cbd5e1; border-radius: 6px; padding: 5px 8px; }
.pe-seg { display: inline-flex; border: 1px solid #cbd5e1; border-radius: 6px; overflow: hidden; } .pe-seg button { border: 0; background: #fff; padding: 5px 9px; cursor: pointer; font: inherit; font-size: 13px; } .pe-seg button.on { background: #16a34a; color: #fff; }
.pe-reason input { width: 100%; border: 1px solid #cbd5e1; border-radius: 6px; padding: 6px 8px; }
.pe-warn { color: var(--warn); font-size: 12.5px; display: block !important; }
.pe-card-opt { display: block; padding: 8px 0; border-bottom: 1px solid #f1f5f9; }
@media (max-width: 1100px) { .pe-cards { grid-template-columns: 1fr; } .pe-tw { overflow-x: auto; } .pe-tp { left: 0; width: 330px; } .pe-t { width: 22px; } }
.sf-ck { display: flex; align-items: center; gap: 8px; cursor: pointer; } .sf-ck input { width: 17px; height: 17px; accent-color: #16a34a; } .sf-ck input:disabled { cursor: not-allowed; }
.sf-pct { display: block; border: 1px solid var(--border); background: #f8fafc; border-radius: 6px; padding: 6px 10px; font-weight: 600; } .sf-pct.off { font-weight: 400; color: var(--muted); }

/* Báo cáo khách đến theo nguồn: biểu đồ tròn (sếp yêu cầu 05/11/2026) */
.ng-body-pie { grid-template-columns: minmax(240px, 380px) minmax(0, 1fr); align-items: center; }
.ng-pie { display: block; width: 100%; max-width: 330px; margin: 0 auto; }
.ng-pie path, .ng-pie circle { cursor: pointer; transition: opacity .12s; } .ng-pie path:hover, .ng-pie circle:hover { opacity: .82; }
.ng-sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
.ng-t tr.zero .ng-sw { opacity: .45; }
@media (max-width: 760px) { .ng-body-pie { grid-template-columns: 1fr; } }

.ng-pie-box { position: relative; }
.ng-pie [data-ng].on { opacity: .85; }
.ng-tip { position: absolute; z-index: 5; display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 20px rgba(15, 23, 42, .16); padding: 7px 12px; font-size: 13.5px; white-space: nowrap; pointer-events: none; }
.ng-tip i { width: 10px; height: 10px; border-radius: 50%; flex: none; } .ng-tip span { color: var(--muted); } .ng-tip b { font-variant-numeric: tabular-nums; }
.clr-same { display: flex; align-items: center; gap: 8px; margin: 10px 0 2px; padding: 8px 10px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; font-size: 13.5px; } .clr-same input { width: 16px; height: 16px; accent-color: #16a34a; }


/* Phiếu thu — tick ✓ dịch vụ khách trả (sếp duyệt 05/11/2026) */
.alloc .ck-col { width: 46px; text-align: center; } .alloc .alloc-ck { width: 18px; height: 18px; accent-color: #16a34a; cursor: pointer; vertical-align: middle; }
.alloc tbody tr.on { background: #f0fdf4; } .alloc tbody tr.off td:not(:last-child) { color: #94a3b8; }
.alloc-warn { margin-top: 6px; color: #b91c1c; font-weight: 600; font-size: 13.5px; }
#alloc-sum .pos { color: #15803d; font-weight: 700; }

/* Ô Doanh thu hôm nay ở chế độ lễ tân (sếp duyệt 05/11/2026) */
.dtd-g.one { grid-template-columns: minmax(0, 1fr); max-width: 380px; }
.dtd-g .tn b { color: #8a5a00; }
/* Hoa hồng của tôi (tài khoản bác sĩ, 06/11/2026) */
.mine-hh { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; background: #ecfeff; border: 1px solid #a5f3fc; color: #155e75; border-radius: 10px; padding: 8px 12px; margin: 8px 0 12px; }
.dtd-open { background: #dcfce7; color: #166534; border: 1px solid #86efac; border-radius: 12px; padding: 2px 10px; font-size: 13px; font-weight: 600; } .dtd-open b { font-variant-numeric: tabular-nums; }
/* Ô gõ mã ở nút Hỗ trợ: che chấm nhưng không phải ô mật khẩu → trình duyệt không lưu (sếp dặn 05/11/2026) */
.code-mask { -webkit-text-security: disc; letter-spacing: 2px; }
/* Chế độ chủ của lễ tân (mã riêng, 06/11/2026) */
.vip-bar.elev { background: #ede9fe; border-color: #c4b5fd; color: #4c1d95; }

/* Bảng giá (08/11/2026): ô đơn giá khóa theo giá cố định (nhân viên) */
input.money[readonly] { background: #eef2f5; color: #4a5c69; cursor: not-allowed; }
/* Nạp dữ liệu phần mềm cũ (legacy.js) */
.oc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 10px; }
.oc-tile { border-top: 3px solid var(--border-strong); }
.oc-tile.ok { border-top-color: var(--ok); }
.oc-tile.ok .stat-sub { color: #145c33; }
.oc-paste { width: 100%; box-sizing: border-box; }
.cell-short { max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep-list tfoot td { white-space: nowrap; }
.care-sel, .care-note { width: 200px; box-sizing: border-box; }
/* ---------- Chatbot khách (11/11/2026): lịch NHÁP trên màn Lịch hẹn + khung chat thử giống Zalo + hộp thư ---------- */
.ap-draft-row td { background: #fff8e8; }
.ev.ev2.ev-draft { background: #fff8e8; border: 1.5px dashed #d98a00; color: #7a4b00; } .ev.ev2.ev-draft u.t-ld { background: #d98a00; }
.evt-draft .evt-in { background: #fff3d6; border: 1.5px dashed #d98a00; } .evt-draft .evt-nm { color: #7a4b00; } .evt-draft .evt-nm u { background: #d98a00; }
.cb-tabs { margin-bottom: 12px; }
.cb-wrap { display: grid; grid-template-columns: minmax(320px, 400px) 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .cb-wrap { grid-template-columns: 1fr; } }
.cb-phone { display: flex; flex-direction: column; height: min(640px, calc(100vh - 190px)); min-height: 420px; background: #fff; border: 1px solid var(--border-strong); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.cb-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #0068ff; color: #fff; }
.cb-ava { width: 36px; height: 36px; border-radius: 50%; background: #fff; color: #0068ff; display: flex; align-items: center; justify-content: center; font-weight: 800; flex: none; }
.cb-head b { display: block; line-height: 1.2; } .cb-head small { opacity: .85; }
.cb-head .cb-new { margin-left: auto; background: rgba(255,255,255,.18); border: 0; color: #fff; border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.cb-body { flex: 1; overflow-y: auto; padding: 12px; background: #eaf0f6; display: flex; flex-direction: column; gap: 6px; }
.cb-b { max-width: 82%; padding: 8px 12px; border-radius: 14px; word-wrap: break-word; overflow-wrap: anywhere; box-shadow: 0 1px 1px rgba(0,0,0,.06); }
.cb-b.bot { align-self: flex-start; background: #fff; border-bottom-left-radius: 4px; }
.cb-b.me { align-self: flex-end; background: #cfe6ff; border-bottom-right-radius: 4px; }
.cb-b.sys { align-self: center; max-width: 94%; background: #fff8e8; border: 1px dashed #d98a00; color: #7a4b00; font-size: 12.5px; border-radius: 8px; text-align: center; box-shadow: none; }
.cb-b.err { align-self: center; background: var(--danger-50); color: #8a1f29; border: 1px solid #f3c3c8; font-size: 13px; }
.cb-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; } .cb-quick button { border: 1px solid #0068ff; color: #0068ff; background: #fff; border-radius: 999px; padding: 4px 12px; cursor: pointer; }
.cb-form { display: flex; gap: 8px; padding: 8px; border-top: 1px solid var(--border); background: #fff; }
.cb-form textarea { flex: 1; resize: none; border: 1px solid var(--border-strong); border-radius: 18px; padding: 8px 12px; }
.cb-fake { background: var(--warn-50); border: 1px solid #f0d49a; color: #7a4b00; border-radius: 8px; padding: 6px 10px; margin-bottom: 10px; }
.cb-list { display: flex; flex-direction: column; gap: 6px; }
.cb-row { display: block; width: 100%; text-align: left; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; cursor: pointer; }
.cb-row.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--info-50); }
.cb-row .cb-r1 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .cb-row .cb-last { color: var(--muted); font-size: 13px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-acts { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.cb-info { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 13.5px; margin-bottom: 8px; } .cb-info dt { color: var(--muted); } .cb-info dd { margin: 0; }
.cb-price td input { width: 100%; min-width: 90px; } .cb-price td.c { text-align: center; }

/* ---------- Đào tạo Bot · Chat đa kênh (menu chính — ảnh mẫu sếp gửi 11/11/2026) ---------- */
.nav-pill { background: #d92d3a; color: #fff; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 6px; line-height: 16px; }
.cbx { position: relative; display: grid; grid-template-columns: 290px 1fr; height: calc(100vh - 118px); min-height: 460px; background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.cbx-side { display: flex; flex-direction: column; border-right: 1px solid var(--border); min-height: 0; }
.cbx-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 12px 10px 14px; }
.cbx-h b { font-size: 19px; }
.cbx-ch { border: 0; background: transparent; font-size: 14px; padding: 4px 2px; cursor: pointer; max-width: 165px; }
.cbx-search { padding: 0 12px; }
.cbx-search input { width: 100%; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 8px; }
.cbx-tools { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; }
.cbx-sort { display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; cursor: pointer; font-size: 14px; padding: 4px 0; }
.cbx-sort svg, .cbx-flt svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.cbx-flt { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong); background: #fff; border-radius: 999px; padding: 6px 16px; cursor: pointer; }
.cbx-flt.on { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
.cbx-pop, .cbx-menu { position: absolute; z-index: 6; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 6px 20px rgba(16,42,60,.15); padding: 6px; display: flex; flex-direction: column; }
.cbx-pop { right: 12px; top: 46px; min-width: 150px; }
.cbx-menu { width: 150px; }
.cbx-pop button, .cbx-menu button { text-align: left; border: 0; background: transparent; padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.cbx-pop button:hover, .cbx-menu button:hover { background: var(--surface-2); }
.cbx-pop button.on { color: var(--primary); font-weight: 600; background: var(--primary-50); }
.cbx-list { flex: 1; overflow-y: auto; min-height: 0; }
.cbx-it { display: flex; gap: 10px; align-items: center; padding: 9px 12px; cursor: pointer; }
.cbx-it:hover { background: var(--surface-2); }
.cbx-it.on { background: #eef0fd; }
.cbx-ava { position: relative; flex: none; width: 40px; height: 40px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; }
.cbx-ava.lg { width: 44px; height: 44px; }
.cbx-chb { position: absolute; left: -2px; bottom: -2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; padding: 1px; display: flex; }
.cbx-chb svg { width: 100%; height: 100%; }
.cbx-mid { flex: 1; min-width: 0; }
.cbx-l1 { display: flex; align-items: center; gap: 6px; }
.cbx-l1 b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.cbx-tag { flex: none; display: flex; }
.cbx-tag svg { width: 15px; height: 15px; }
.cbx-tag.t-gray svg { fill: #8a8f98; } .cbx-tag.t-red svg { fill: #e5484d; } .cbx-tag.t-amber svg { fill: #e0a100; } .cbx-tag.t-blue svg { fill: #3b82f6; } .cbx-tag.t-green svg { fill: #2fb344; }
.cbx-botc { flex: none; width: 15px; height: 15px; border-radius: 50%; background: #d6ccf6; }
.cbx-l2 { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 13px; }
.cbx-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #e5484d; }
.cbx-last { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cbx-r { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.cbx-more { border: 0; background: transparent; cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; color: var(--muted); }
.cbx-t { font-size: 12px; color: var(--muted); }
.cbx-none { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; }
.cbx-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.cbx-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px; text-align: center; }
.cbx-illu { width: min(360px, 80%); height: auto; }
.cbx-et { font-size: 18px; font-weight: 700; color: var(--purple); }
.cbx-eb { margin-top: 6px; background: #ece6fb; border-color: #ece6fb; color: #5b3fd0; }
.cbx-top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.cbx-who { flex: 1; min-width: 180px; }
.cbx-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.cbx-back { display: none; border: 0; background: transparent; font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; }
.cbx-info { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 8px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 13px; }
.cbx-msgs { flex: 1; overflow-y: auto; min-height: 0; padding: 14px 16px; background: #f4f6fb; display: flex; flex-direction: column; gap: 6px; }
.cbx-msgs .cb-b.me { align-self: flex-start; background: #fff; border-radius: 14px; border-bottom-left-radius: 4px; }
.cbx-msgs .cb-b.bot { align-self: flex-end; background: #e6e0fb; border-radius: 14px; border-bottom-right-radius: 4px; }
@media (max-width: 900px) {
  .cbx { grid-template-columns: 1fr; height: calc(100vh - 150px); }
  .cbx .cbx-main { display: none; } .cbx.open .cbx-main { display: flex; } .cbx.open .cbx-side { display: none; }
  .cbx-back { display: block; }
}
.ti-head { margin: -18px -22px 0; padding: 14px 22px; background: #fff; border-bottom: 1px solid var(--border); }
.ti-head h1 { font-size: 20px; }
.ti { display: grid; grid-template-columns: 280px 1fr; margin: 0 -22px -40px; min-height: calc(100vh - 120px); background: #fff; }
.ti-nav { display: flex; flex-direction: column; gap: 4px; padding: 12px 0 12px 10px; border-right: 1px solid var(--border); }
.ti-tab { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border: 0; background: transparent; border-radius: 8px 0 0 8px; cursor: pointer; font-size: 15.5px; font-weight: 600; text-align: left; color: var(--text); }
.ti-tab:hover { background: var(--surface-2); }
.ti-tab.on { background: #f3f0fd; box-shadow: inset -3px 0 0 #7c5ce0; }
.ti-ic { width: 40px; height: 40px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex: none; }
.ti-ic svg { width: 40px; height: 40px; }
.ti-ic[style] svg { width: 25px; height: 25px; }
.ti-main { padding: 18px 22px; min-width: 0; }
.ti-t { font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.ti-bar { display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; align-items: center; }
.ti-search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border-strong); border-radius: 8px; padding: 0 10px; width: min(400px, 100%); background: #fff; }
.ti-search svg { width: 17px; height: 17px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; flex: none; }
.ti-search input { border: 0; outline: none; padding: 9px 0; flex: 1; min-width: 0; background: transparent; }
.ti-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.ti-b { display: inline-flex; align-items: center; gap: 6px; border-color: #b9a6ef; color: #6b47b8; background: #fff; }
.ti-b svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.ti-b:disabled { opacity: .5; cursor: default; }
.ti-all { display: inline-flex; margin: 16px 0 12px; font-size: 15px; }
.ti-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; }
.ti-card { display: flex; align-items: flex-start; gap: 14px; border: 1px solid var(--border); border-radius: 12px; padding: 18px 16px; cursor: pointer; background: #fff; }
.ti-card.on { border-color: #9f87ea; box-shadow: 0 0 0 2px #efeafd; }
.ti-card input { margin-top: 18px; width: 18px; height: 18px; flex: none; }
.ti-logo { width: 56px; height: 40px; object-fit: contain; margin-top: 8px; flex: none; }
.ti-body { min-width: 0; }
.ti-body b { font-size: 16px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ti-id { font-size: 13px; color: var(--muted); margin: 2px 0 4px; overflow-wrap: anywhere; }
.ti-st { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.ti-st i { display: flex; } .ti-st i svg { width: 15px; height: 15px; }
.ti-wait { color: var(--warn); font-weight: 600; }
.ti-bot { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.ti-b1 { width: 20px; height: 20px; border-radius: 50%; background: #eef0f3; color: #555; font-size: 11px; display: flex; align-items: center; justify-content: center; }
.ti-none { padding: 30px; text-align: center; color: var(--muted); }
@media (max-width: 980px) {
  .ti-head { margin: -14px -12px 0; padding: 12px; }
  .ti { margin: 0 -12px -40px; grid-template-columns: 1fr; }
  .ti-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 8px; }
  .ti-tab { border-radius: 8px; white-space: nowrap; }
  .ti-tab.on { box-shadow: inset 0 -3px 0 #7c5ce0; }
  .ti-grid { grid-template-columns: 1fr; }
}
/* Tích hợp nền tảng — đợt 2 (kết nối thật Facebook / Zalo OA, 11/11/2026) */
.ti-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ti-add { position: relative; display: inline-flex; }
.ti-addm { position: absolute; right: 0; top: calc(100% + 6px); z-index: 7; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 6px 20px rgba(16,42,60,.15); padding: 6px; display: flex; flex-direction: column; min-width: 190px; }
.ti-addm[hidden] { display: none; }
.ti-addm button { display: flex; align-items: center; gap: 8px; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.ti-addm button:hover { background: var(--surface-2); }
.ti-addm svg { width: 18px; height: 18px; flex: none; }
.ti-err { color: var(--danger); font-weight: 600; }
.ti-bot.off { opacity: .7; }
.ti-kv { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 13.5px; flex-wrap: wrap; }
.ti-kv > span:first-child { color: var(--muted); min-width: 210px; }
.ti-kv code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; overflow-wrap: anywhere; flex: 1; min-width: 0; }
.ti-okk { color: var(--ok); font-weight: 600; } .ti-miss { color: var(--danger); font-weight: 600; }
.cbx-botc.off { background: #d5d9df; }

/* Chatbot — giờ trả lời + thư viện hình / video (11/11/2026) */
.cb-srow { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 6px 0; }
.cb-srow select { min-width: 220px; }
.cb-srow input[type=number] { width: 70px; }
.cb-sched { max-width: 560px; margin: 6px 0 6px auto; }
.cb-sched td:first-child { width: 90px; font-weight: 600; }
.cb-sched input[type=time] { width: 110px; }
.cbm-list { display: flex; flex-direction: column; border: 1px solid var(--border, #e3e6ea); border-radius: 8px; margin-top: 8px; }
.cbm-list > .muted { padding: 12px; }
.cbm-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto auto auto; gap: 10px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--border, #e3e6ea); }
.cbm-row:last-child { border-bottom: 0; }
.cbm-row.off { opacity: .55; }
.cbm-th { position: relative; width: 64px; height: 48px; border-radius: 6px; overflow: hidden; background: #f1f3f5; }
.cbm-th img, .cbm-th video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cbm-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 16px; text-shadow: 0 0 4px rgba(0,0,0,.6); }
.cbm-tx { display: flex; flex-direction: column; min-width: 0; }
.cbm-tx span { font-size: 12.5px; color: var(--muted, #6b7280); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-b.cb-media { padding: 4px; }
.cb-b.cb-media img, .cb-b.cb-media video { display: block; max-width: 240px; max-height: 240px; border-radius: 10px; }
.cb-cap { font-size: 12px; color: var(--muted, #6b7280); padding: 4px 6px 2px; }
@media (max-width: 640px) { .cbm-row { grid-template-columns: 56px minmax(0, 1fr) auto; } .cbm-row .badge { display: none; } }
/* Chatbot — bot thả tim vào tin khách (12/11/2026) */
.cb-b.me.has-rx { position: relative; margin-bottom: 10px; }
.cb-rx { position: absolute; right: 6px; bottom: -10px; font-size: 11px; line-height: 1; background: #fff; border-radius: 10px; padding: 2px 3px; box-shadow: 0 1px 2px rgba(0,0,0,.18); }
/* Chatbot — hình khách gửi (12/11/2026) */
.cb-imgrow { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.cb-imgrow img { display: block; max-width: 160px; max-height: 160px; border-radius: 8px; object-fit: cover; }
/* Nhãn hộp thư chat ↔ CRM (sếp chốt 12/11/2026): tím = nhãn (chung danh sách Cài đặt → Nhãn), xanh ngọc = dịch vụ quan tâm */
.cbx-l3 { display: flex; flex-wrap: nowrap; gap: 4px; margin-top: 4px; overflow: hidden; }
.cbx-l3 .cbx-chip { font-size: 11px; padding: 0 7px; }
.cbx-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 7px 16px; border-bottom: 1px solid var(--border); }
.cbx-chip { display: inline-flex; align-items: center; font-size: 12px; padding: 2px 9px; border-radius: 999px; background: #efeafd; color: #4b3aa8; border: 1px solid #ddd3fb; white-space: nowrap; }
.cbx-chip.dv { background: var(--primary-50); color: #0a6670; border-color: #bfe3e6; }
.cbx-chip button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 0 0 4px; opacity: .65; }
.cbx-chip button:hover { opacity: 1; }
.cbx-tadd { border: 1px dashed var(--border-strong); background: transparent; color: var(--primary); border-radius: 999px; font-size: 12px; padding: 2px 10px; cursor: pointer; }
.cbx-tpop { min-width: 170px; max-height: 260px; overflow-y: auto; }
.cbx-tnone { padding: 6px 10px; }
.cbx-tagf { margin-top: 4px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; max-width: 210px; background: #fff; }

/* Báo ca chuyển người thật (sếp chốt 13/11/2026): chuông thanh trên cùng, ô báo góc phải (mọi màn), nhóm Gấp / Cần xử lý ở hộp thư */
.cb-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 36px; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: #5a6b78; text-decoration: none; }
.cb-bell svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cb-bell.on { color: var(--warn); border-color: #f2d59b; background: var(--warn-50); }
.cb-bell.urg { color: var(--danger); border-color: #f3b9bf; background: var(--danger-50); }
.cb-bell-n { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.cb-bell.on .cb-bell-n { background: var(--warn); }
.cba { position: fixed; top: 64px; right: 16px; z-index: 45; display: flex; flex-direction: column; gap: 8px; width: 340px; max-width: calc(100vw - 24px); }
.cba:empty { display: none; }
body:has(.modal-backdrop) .cba, body:has(.login-screen) .cba { display: none; }
.cba-card { background: #fff; border: 1px solid #f2d59b; border-left: 4px solid var(--warn); border-radius: 0 10px 10px 0; box-shadow: 0 8px 24px rgba(16,42,60,.16); padding: 10px 12px; font-size: 13px; }
.cba-card.urg { border-color: #f3b9bf; border-left-color: var(--danger); }
.cba-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; color: var(--warn); }
.cba-card.urg .cba-h { color: var(--danger); }
.cba-x { border: 0; background: none; font-size: 18px; line-height: 1; color: #8a97a3; cursor: pointer; padding: 0 2px; }
.cba-who { margin-top: 4px; font-weight: 600; }
.cba-r { margin-top: 2px; color: #445; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cba-f { margin-top: 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; color: #6b7a86; font-size: 12px; }
.cba-b { display: flex; gap: 6px; flex-shrink: 0; }
.cba-more { align-self: flex-end; font-size: 12.5px; font-weight: 600; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px; text-decoration: none; }
.cbx-sec { display: block; width: 100%; text-align: left; padding: 8px 12px 4px; font-size: 12.5px; font-weight: 700; border: 0; background: none; }
.cbx-sec.urg { color: var(--danger); }
.cbx-sec.need { color: var(--warn); }
.cbx-sec.rest { color: #6b7a86; cursor: pointer; padding-bottom: 8px; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; }
.cbx-it.urg { background: var(--danger-50); }
.cbx-it.urg.on { background: #f9dde0; }
.cbx-l4 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 3px; font-size: 12px; color: #6b7a86; }
.cbx-l4 > * { white-space: nowrap; }
.cbx-l4 .late { color: var(--danger); font-weight: 700; }
.cbx-cl { color: #2b7a3d; font-weight: 600; font-size: 12px; }
.cbx-acts .cbx-cl { align-self: center; margin-right: 4px; }
@media (max-width: 720px) { .cba { top: 58px; right: 8px; } .cb-bell { width: 34px; height: 34px; } }
/* Ảnh đại diện khách Facebook / Zalo trong hộp thư (sếp dặn 14/11/2026, mẫu Preny) — ảnh phủ kín vòng tròn, huy hiệu kênh vẫn nằm góc trái dưới */
.cbx-avai { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #fff; }
.cbx-ava .cbx-chb { z-index: 1; }
/* Tích hợp nền tảng: ảnh đại diện thật của trang / OA + logo nền tảng (mẫu Preny, 14/11/2026) */
.ti-logo.ti-pic { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; margin: 4px 6px 0; }
.ti-pf { display: flex; flex: none; width: 18px; height: 18px; }
.ti-pf svg { width: 18px; height: 18px; }
