:root {
  --brand: #0068ac; --brand-dark: #004f84; --teal: #02b9bf; --brand-soft: #e6f2fa; --teal-soft: #e2f8f8;
  --ink: #15212c; --ink-2: #4c5c6a; --ink-3: #7a8894; --line: #dfe6ec; --line-2: #eef2f5; --bg: #f4f7f9; --card: #fff;
  --ok: #12805c; --ok-soft: #e3f5ee; --warn: #a65f00; --warn-soft: #fdf1dc; --bad: #c0362c; --bad-soft: #fcebe9; --gray-soft: #eef1f4;
  --r: 8px; --shadow: 0 1px 2px rgba(16, 40, 60, .07); --side: 236px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

.layout { display: flex; min-height: 100vh; }
.side { width: var(--side); flex: none; background: var(--card); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 14px 10px 24px; z-index: 30; }
.side-logo { display: flex; align-items: center; gap: 10px; padding: 2px 8px 14px; color: var(--ink); }
.side-logo:hover { text-decoration: none; }
.side-logo img { width: 42px; height: 35px; object-fit: contain; }
.side-logo b { display: block; font-size: 15px; color: var(--brand); }
.side-logo span { font-size: 11px; color: var(--ink-3); }
.nav-group { font-size: 11px; font-weight: 600; color: var(--ink-3); padding: 12px 10px 4px; text-transform: uppercase; letter-spacing: .04em; }
.nav a { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 6px; color: var(--ink-2); }
.nav a:hover { background: var(--line-2); text-decoration: none; }
.nav a.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav svg, .ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { height: 56px; background: var(--card); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 0 18px; position: sticky; top: 0; z-index: 20; }
.btn.menu-btn { display: none; }
.top-search { flex: 1; max-width: 460px; position: relative; }
.top-search .combo-input { padding-left: 32px; background: var(--bg); }
.top-search > .ic { position: absolute; left: 10px; top: 10px; color: var(--ink-3); z-index: 1; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.who { text-align: right; line-height: 1.2; } .who b { display: block; font-size: 13px; } .who span { font-size: 11px; color: var(--ink-3); }
.demo-bar { background: var(--warn-soft); color: var(--warn); font-size: 12px; text-align: center; padding: 4px 10px; }
.content { padding: 18px; flex: 1; max-width: 1500px; width: 100%; }
.page-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.page-head h1 { font-size: 20px; }
.page-head p { margin: 2px 0 0; color: var(--ink-3); font-size: 13px; }
.page-head .actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 12px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; white-space: nowrap; color: var(--ink); }
.btn:hover { background: var(--line-2); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.danger { color: var(--bad); border-color: #f0c9c5; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.sm { height: 27px; padding: 0 8px; font-size: 12px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-row { display: flex; gap: 4px; flex-wrap: wrap; }
input, select, textarea { width: 100%; height: 34px; padding: 0 9px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; }
textarea { height: auto; min-height: 66px; padding: 7px 9px; resize: vertical; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.inline { width: auto; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--line-2); }
.card-head h3 { font-size: 14px; } .card-head .right { margin-left: auto; }
.card-body { padding: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack > *, .grid-2 > * { min-width: 0; }
.no-strike { display: inline-block; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; box-shadow: var(--shadow); }
.kpi span { display: block; color: var(--ink-3); font-size: 12px; }
.kpi b { display: block; font-size: 22px; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi small { color: var(--ink-3); font-size: 11px; }
.kpi.brand b { color: var(--brand); } .kpi.bad b { color: var(--bad); }

.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-2); background: #f8fafb; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:hover { background: #fafcfd; }
.tbl tr.voided td { color: var(--ink-3); text-decoration: line-through; }
.tbl tr.voided td.no-strike { text-decoration: none; }
.tbl tr.staff-off td:not(:last-child) { opacity: .42; }
.tbl tfoot td { font-weight: 700; background: #f8fafb; border-top: 1px solid var(--line); border-bottom: none; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.muted { color: var(--ink-3); } .small { font-size: 12px; } .red { color: var(--bad); font-weight: 600; } .green { color: var(--ok); font-weight: 600; }
.empty { padding: 34px 14px; text-align: center; color: var(--ink-3); }
.badge { display: inline-block; padding: 2px 7px; font-size: 11.5px; font-weight: 600; border-radius: 999px; background: var(--gray-soft); color: var(--ink-2); white-space: nowrap; }
.badge.blue { background: var(--brand-soft); color: var(--brand); } .badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); } .badge.bad { background: var(--bad-soft); color: var(--bad); } .badge.teal { background: var(--teal-soft); color: #067d81; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.filters input[type=date] { width: 148px; } .filters select { width: auto; max-width: 230px; } .filters input[type=search] { width: 300px; max-width: 100%; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 14px; color: var(--ink-3); font-size: 13px; }

.chart { display: flex; align-items: flex-end; gap: 6px; height: 215px; min-width: 620px; padding-top: 4px; }
.bar { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.bar b { font-size: 11px; font-weight: 600; color: var(--ink-2); white-space: nowrap; margin-bottom: 3px; }
.bar i { display: block; width: 100%; max-width: 40px; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--brand); }
.bar.today i { background: var(--teal); }
.bar span { font-size: 11px; color: var(--ink-3); margin-top: 5px; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line-2); }
.list-row:last-child { border-bottom: none; }
.list-row .t { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--brand); width: 44px; flex: none; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .grow > * { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 8px; overflow-x: auto; }
.tabs button { background: none; border: none; border-bottom: 2px solid transparent; padding: 10px 12px; cursor: pointer; color: var(--ink-2); white-space: nowrap; }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tabs button em { font-style: normal; color: var(--ink-3); font-weight: 400; font-size: 12px; margin-left: 3px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--card); }
.seg button { border: none; border-right: 1px solid var(--line); background: none; height: 32px; padding: 0 10px; cursor: pointer; white-space: nowrap; }
.seg button:last-child { border-right: none; } .seg button.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.profile { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; padding: 14px; }
.avatar { width: 50px; height: 50px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 700; flex: none; }
.profile h2 { font-size: 19px; } .profile .meta { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.money-strip { display: flex; margin-left: auto; gap: 22px; } .money-strip span { display: block; font-size: 12px; color: var(--ink-3); } .money-strip b { font-size: 17px; font-variant-numeric: tabular-nums; }
.alert-note { margin: 0 14px 12px; padding: 7px 10px; font-size: 13px; color: var(--bad); background: var(--bad-soft); border-radius: 6px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px 22px; }
.info-grid div span { display: block; color: var(--ink-3); font-size: 12px; }

.cal-wrap { overflow: auto; max-height: calc(100vh - 195px); }
.cal { display: grid; position: relative; min-width: 100%; }
.cal-h { position: sticky; top: 0; z-index: 6; background: #f8fafb; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line-2); padding: 8px; font-weight: 600; font-size: 12.5px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; height: 36px; }
.cal-h.corner { left: 0; z-index: 7; }
.cal-times { position: sticky; left: 0; background: var(--card); z-index: 4; border-right: 1px solid var(--line); }
.cal-times div { height: 64px; font-size: 11px; color: var(--ink-3); text-align: right; padding: 2px 6px 0 0; border-bottom: 1px solid var(--line-2); }
.cal-col { position: relative; border-right: 1px solid var(--line-2); cursor: copy; background-image: linear-gradient(to bottom, var(--line-2) 1px, transparent 1px); background-size: 100% 64px; }
.cal-col:hover { background-color: #fbfdfe; }
.ev { position: absolute; border-radius: 5px; padding: 3px 6px; font-size: 11.5px; line-height: 1.25; overflow: hidden; cursor: pointer; background: var(--brand-soft); border: 1px solid #b8d9ee; border-left: 3px solid var(--brand); color: var(--ink); text-align: left; }
.ev b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.da_den { background: var(--ok-soft); border-color: #bde3d3; border-left-color: var(--ok); }
.ev.khong_den { background: var(--warn-soft); border-color: #f2dcb4; border-left-color: var(--warn); }
.ev.huy { background: var(--gray-soft); border-color: var(--line); border-left-color: var(--ink-3); color: var(--ink-3); text-decoration: line-through; }
.ev:hover { z-index: 3; box-shadow: 0 2px 8px rgba(16, 40, 60, .18); }

.modal-back { position: fixed; inset: 0; background: rgba(15, 32, 45, .45); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 14px; overflow-y: auto; z-index: 100; }
.modal { background: var(--card); border-radius: 10px; width: 100%; max-width: 560px; box-shadow: 0 12px 40px rgba(10, 30, 45, .3); }
.modal.wide { max-width: 780px; }
.modal-head { display: flex; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--line-2); }
.modal-head h2 { font-size: 16px; } .modal-head button { margin-left: auto; }
.modal-body { padding: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 12px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 3px; }
.field label i { color: var(--bad); font-style: normal; }
.field.full { grid-column: 1 / -1; }
.field .hint { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.check-line { display: flex; align-items: center; gap: 7px; min-height: 34px; font-weight: 400; cursor: pointer; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 40px; }
.pw-wrap input::-ms-reveal { display: none; }
.pw-eye { position: absolute; right: 2px; top: 2px; width: 34px; height: 30px; display: flex; align-items: center; justify-content: center; background: none; border: none; border-radius: 5px; color: var(--ink-3); cursor: pointer; }
.pw-eye:hover { background: var(--line-2); color: var(--brand); }
.pw-eye[aria-pressed="true"] { color: var(--brand); }
.form-err { margin-top: 12px; padding: 8px 10px; background: var(--bad-soft); color: var(--bad); border-radius: 6px; font-size: 13px; }
.ward-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 5px; font-size: 11.5px; color: var(--ink-3); }
.ward-chips button { max-width: 100%; padding: 2px 8px; font-size: 11.5px; color: var(--brand); background: var(--brand-soft); border: 1px solid #b8d9ee; border-radius: 999px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ward-chips button:hover { background: #d4e9f6; }
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 39px; padding: 3px 5px; background: var(--card); border: 1px solid #c9d7e2; border-radius: 9px; cursor: text; transition: border-color .15s, box-shadow .15s; }
.tags:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 104, 172, .16); }
.tags input.tags-input { flex: 1; width: auto; min-width: 150px; height: 29px; padding: 0 5px; background: transparent; border: none; border-radius: 0; box-shadow: none; }
.tag { display: inline-flex; align-items: center; gap: 2px; height: 29px; padding: 0 3px 0 9px; font-weight: 700; color: var(--brand-dark); background: var(--brand-soft); border: 1px solid #b8d9ee; border-radius: 7px; animation: pop .14s ease-out; }
.tag button { width: 21px; height: 21px; padding: 0; font-size: 16px; line-height: 1; color: var(--brand-dark); background: none; border: none; border-radius: 5px; cursor: pointer; }
.tag button:hover { color: #fff; background: var(--bad); }
.jaw-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.jaw-row button { height: 27px; padding: 0 10px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); background: #fff; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; transition: background .12s, color .12s, border-color .12s; }
.jaw-row button:hover { color: var(--brand); border-color: #a9d3ee; }
.jaw-row button.on, .jaw-row button.on:hover { color: #fff; font-weight: 700; background: var(--grad); border-color: transparent; }
.svc-line .jaw-row { flex-wrap: nowrap; gap: 3px; }
.svc-line .jaw-row button { flex: 1 1 auto; padding: 0 5px; font-size: 12px; white-space: nowrap; }
.tags-err { margin-top: 4px; font-size: 12.5px; font-weight: 600; color: var(--bad); }
.combo { position: relative; }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 3px); background: var(--card); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 22px rgba(10, 30, 45, .18); max-height: min(430px, 56vh); overflow-y: auto; z-index: 60; }
.combo-group { position: sticky; top: 0; z-index: 1; padding: 5px 10px; font-size: 11px; font-weight: 700; color: var(--ink-2); background: #eef3f7; border-bottom: 1px solid var(--line); }
.combo-list button { display: block; width: 100%; text-align: left; background: none; border: none; padding: 7px 10px; cursor: pointer; border-bottom: 1px solid var(--line-2); }
.combo-list button:hover, .combo-list button.hl { background: var(--brand-soft); }
.combo-list small { display: block; color: var(--ink-3); }
.combo-none { padding: 9px 10px; color: var(--ink-3); }
.perm-table td, .perm-table th { text-align: center; } .perm-table td:first-child, .perm-table th:first-child { text-align: left; white-space: nowrap; }
.perm-table input { margin: 0; }

#toast { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 9px 14px; border-radius: 7px; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); max-width: 340px; }
.toast.err { background: var(--bad); }
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(160deg, var(--brand-soft), #fff 55%, var(--teal-soft)); }
.login-box { width: 100%; max-width: 410px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 26px; box-shadow: 0 10px 34px rgba(0, 70, 120, .12); }
.login-box img { display: block; width: 116px; margin: 0 auto 10px; }
.login-box h1 { text-align: center; font-size: 18px; } .login-box > p { text-align: center; color: var(--ink-3); margin: 3px 0 18px; }
.login-box .field { margin-bottom: 11px; } .login-box .btn.primary { width: 100%; height: 38px; }
.demo-pick { margin-top: 18px; border-top: 1px solid var(--line-2); padding-top: 14px; }
.demo-pick h3 { font-size: 12.5px; color: var(--ink-2); margin-bottom: 8px; }
.demo-pick div { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#print-root { display: none; }
.receipt { color: #000; max-width: 720px; margin: 0 auto; font-size: 14px; }
.receipt header { display: flex; align-items: center; gap: 14px; border-bottom: 2px solid var(--brand); padding-bottom: 10px; }
.receipt header img { width: 80px; } .receipt h2 { text-align: center; margin: 18px 0 4px; font-size: 21px; } .receipt .c { text-align: center; }
.receipt table { width: 100%; margin: 14px 0; border-collapse: collapse; } .receipt td { padding: 5px 0; } .receipt td:first-child { width: 180px; color: #444; }
.receipt .sign { display: grid; grid-template-columns: 1fr 1fr; text-align: center; margin-top: 26px; min-height: 110px; }

/* ===== Giao diện DC: chữ rõ nét, màu thương hiệu, chuyển động nhẹ ===== */
:root {
  --ink: #0a1a2a; --ink-2: #2d4256; --ink-3: #566b7f; --line: #d3dfe9; --line-2: #e7eff5; --bg: #edf4f9;
  --brand: #0068ac; --brand-dark: #004a7e; --teal: #02b9bf; --brand-soft: #e1f0fb; --teal-soft: #d9f6f6;
  --ok: #067a55; --ok-soft: #d9f5e9; --warn: #975400; --warn-soft: #ffefd2; --bad: #c42b20; --bad-soft: #fde6e3; --gray-soft: #e9eff4;
  --grad: linear-gradient(120deg, #005c9a 0%, #0074a3 60%, #007d8c 100%);
  --side-bg: linear-gradient(185deg, #062f52 0%, #00508a 62%, #056d8f 100%);
  --r: 14px; --side: 252px;
  --shadow: 0 1px 2px rgba(10, 40, 66, .06), 0 6px 18px rgba(10, 40, 66, .06);
  --shadow-up: 0 3px 8px rgba(10, 40, 66, .09), 0 16px 32px rgba(10, 40, 66, .13);
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px; line-height: 1.5; color: var(--ink); text-rendering: optimizeLegibility; -webkit-font-smoothing: auto;
  background: radial-gradient(1100px 380px at 88% -130px, #cfeaf8 0, transparent 72%), var(--bg); background-attachment: fixed;
}
h1, h2, h3 { letter-spacing: -.012em; }
a { font-weight: 600; }

.side { background: var(--side-bg); border-right: none; padding: 14px 12px 28px; -webkit-font-smoothing: antialiased; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .28) transparent; }
.side-logo { padding: 8px 10px; margin-bottom: 6px; background: #fff; border-radius: 12px; box-shadow: 0 5px 16px rgba(0, 24, 48, .28); }
.side-logo img { width: 44px; height: 37px; }
.side-logo b { font-size: 16.5px; font-weight: 800; letter-spacing: -.01em; }
.side-logo span { color: var(--ink-3); font-size: 11.5px; font-weight: 500; }
.nav-group { color: rgba(255, 255, 255, .82); font-size: 11px; font-weight: 700; letter-spacing: .08em; padding: 15px 10px 5px; }
.nav a { color: rgba(255, 255, 255, .94); font-size: 14.5px; font-weight: 500; padding: 8px 11px; border-radius: 9px; margin-bottom: 1px; transition: background .15s, color .15s, transform .15s; }
.nav a:hover { background: rgba(255, 255, 255, .14); color: #fff; transform: translateX(2px); }
.nav a.on, .nav a.on:hover { background: #fff; color: var(--brand); font-weight: 700; transform: none; box-shadow: 0 5px 14px rgba(0, 24, 48, .3); }
.nav svg, .ic { width: 17px; height: 17px; stroke-width: 2; }

.top { height: 62px; padding: 0 22px; background: rgba(255, 255, 255, .88); border-bottom: 1px solid var(--line-2); -webkit-backdrop-filter: saturate(160%) blur(10px); backdrop-filter: saturate(160%) blur(10px); }
.top-search .combo-input { height: 40px; padding-left: 36px; background: #f1f6fa; border-color: transparent; border-radius: 10px; }
.top-search .combo-input:focus { background: #fff; }
.top-search > .ic { left: 12px; top: 12px; color: var(--brand); }
.top-right select { height: 40px; font-weight: 600; border-radius: 10px; color: var(--brand-dark); background-color: var(--brand-soft); border-color: transparent; }
.who b { font-size: 13.5px; font-weight: 700; } .who span { color: var(--ink-3); font-size: 12px; }
.me-avatar { width: 38px; height: 38px; flex: none; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 15px; border-radius: 50%; background: var(--grad); box-shadow: 0 3px 9px rgba(0, 104, 172, .35); }
.demo-bar { font-weight: 600; font-size: 12.5px; background: linear-gradient(90deg, #ffefd2, #fff6e4); }

.content { padding: 22px; }
.page-head { margin-bottom: 18px; }
.page-head > div:first-child { position: relative; padding-left: 14px; }
.page-head > div:first-child::before { content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 5px; border-radius: 3px; background: linear-gradient(180deg, var(--teal), var(--brand)); }
.page-head h1 { font-size: 25px; font-weight: 800; letter-spacing: -.02em; }
.page-head p { color: var(--ink-3); font-size: 14px; font-weight: 500; }

.btn { height: 37px; padding: 0 14px; font-weight: 600; color: var(--ink-2); border-color: var(--line); border-radius: 9px; box-shadow: 0 1px 1px rgba(10, 40, 66, .05); transition: background .15s, box-shadow .15s, transform .12s, border-color .15s, color .15s; }
.btn:hover { background: var(--brand-soft); border-color: #a9d3ee; color: var(--brand-dark); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; font-weight: 700; box-shadow: 0 4px 12px rgba(0, 104, 172, .32); }
.btn.primary:hover { background: var(--grad); color: #fff; filter: brightness(1.07); box-shadow: 0 7px 18px rgba(0, 104, 172, .38); }
.btn.danger { color: var(--bad); border-color: #f3c3bd; }
.btn.danger:hover { background: var(--bad-soft); border-color: #eda59c; color: var(--bad); }
.btn.ghost { box-shadow: none; color: var(--ink-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn:disabled { transform: none; }

input, select, textarea { height: 39px; padding: 0 11px; border-color: #c9d7e2; border-radius: 9px; font-size: 14.5px; transition: border-color .15s, box-shadow .15s; }
textarea { padding: 8px 11px; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 104, 172, .16); }
.field label { font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 4px; }
.field .hint { font-size: 12.5px; color: var(--ink-3); }
.pw-eye { height: 35px; }
.form-grid { gap: 13px 14px; }

.card { border-color: var(--line-2); border-radius: var(--r); box-shadow: var(--shadow); }
.card-head { padding: 13px 16px; }
.card-head h3 { font-size: 15.5px; font-weight: 800; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin-bottom: 18px; }
@media (min-width: 761px) { .kpis:has(> .kpi:nth-child(6)) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1180px) { .kpis:has(> .kpi:nth-child(6)) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.kpi { --kc: #0068ac; --kb: #e1f0fb; position: relative; overflow: hidden; padding: 16px 18px 15px; border: 1px solid var(--line-2); border-radius: var(--r); transition: transform .16s, box-shadow .16s; }
.kpi::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--kc); }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-up); }
.kpis .kpi:nth-child(6n+2) { --kc: #02a6ad; --kb: #d9f6f6; }
.kpis .kpi:nth-child(6n+3) { --kc: #6a4fd8; --kb: #ece8fd; }
.kpis .kpi:nth-child(6n+4) { --kc: #0b8f63; --kb: #d9f5e9; }
.kpis .kpi:nth-child(6n+5) { --kc: #d97a06; --kb: #ffefd2; }
.kpis .kpi:nth-child(6n+6) { --kc: #d23a2e; --kb: #fde6e3; }
.kpi span { color: var(--ink-2); font-size: 13.5px; font-weight: 600; }
.kpi b { font-size: clamp(21px, 1.9vw, 28px); font-weight: 800; line-height: 1.2; letter-spacing: -.02em; margin-top: 4px; color: var(--ink); white-space: nowrap; }
.kpi small { color: var(--ink-3); font-size: 12.5px; font-weight: 500; }
.kpi.brand b { color: var(--brand); }
.kpi-ic { position: absolute; right: 14px; top: 16px; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; color: var(--kc); background: var(--kb); border-radius: 11px; }
.kpi-ic .ic { width: 20px; height: 20px; }
.kpi:has(.kpi-ic) > span { padding-right: 44px; min-height: 40px; }

.tbl th { padding: 11px 13px; font-size: 13px; font-weight: 700; color: var(--ink-2); background: #f1f7fb; border-bottom: 1.5px solid var(--line); }
.tbl th:first-child { border-top-left-radius: 13px; } .tbl th:last-child { border-top-right-radius: 13px; }
.tbl td { padding: 11px 13px; font-size: 14.5px; color: var(--ink); border-bottom-color: var(--line-2); }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: #ecf6fd; }
.tbl tfoot td { background: #f1f7fb; }
.muted { color: var(--ink-3); } .small { font-size: 13px; }
.empty { padding: 42px 16px; font-size: 15px; font-weight: 500; color: var(--ink-3); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; font-size: 12.5px; font-weight: 700; }
.badge::before { content: ""; width: 6px; height: 6px; flex: none; border-radius: 50%; background: currentColor; }
.badge.blue { color: #005a96; } .badge.teal { color: #056a6e; }

.tabs { padding: 0 10px; }
.tabs button { padding: 12px 14px; font-weight: 600; font-size: 14.5px; transition: color .15s; }
.tabs button:hover { color: var(--brand); }
.tabs button.on { font-weight: 800; border-bottom-width: 3px; }
.seg { border-radius: 9px; box-shadow: 0 1px 1px rgba(10, 40, 66, .05); }
.seg button { height: 37px; padding: 0 13px; font-weight: 600; color: var(--ink-2); transition: background .15s, color .15s; }
.seg button:hover { background: var(--brand-soft); }
.seg button.on, .seg button.on:hover { background: var(--grad); color: #fff; font-weight: 700; }
.seg-field { display: flex; width: 100%; }
.seg-field button { flex: 1; min-width: 0; height: 39px; padding: 0 6px; }
.pager { font-weight: 600; }

.chart { min-width: 1060px; gap: 4px; }
.bar b { font-size: 11.5px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
@media (max-width: 1500px) { .bar b { font-size: 10.5px; letter-spacing: -.01em; } }
.bar i { border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #0a8fce, #0068ac); transform-origin: bottom; transition: filter .15s; }
.bar:hover i { filter: brightness(1.15); }
.bar.today i { background: linear-gradient(180deg, #27d6c4, #02a6ad); }
.bar span { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.list-row { padding: 10px 16px; transition: background .12s; }
.list-row:hover { background: #f1f8fd; }
.list-row .t { font-weight: 800; }
.avatar { background: var(--grad); color: #fff; font-weight: 800; box-shadow: 0 4px 12px rgba(0, 104, 172, .3); }
.profile h2 { font-size: 22px; font-weight: 800; letter-spacing: -.015em; }
.profile .meta { font-size: 14px; font-weight: 500; }
.money-strip span { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.money-strip b { font-size: 21px; font-weight: 800; letter-spacing: -.01em; }
.info-grid div { font-weight: 500; } .info-grid div span { font-size: 12.5px; font-weight: 600; }
.ev { border-radius: 7px; font-size: 12.5px; font-weight: 500; box-shadow: 0 1px 3px rgba(10, 40, 66, .12); transition: box-shadow .15s, transform .12s; }
.ev b { font-weight: 700; }
.cal-h { font-size: 13.5px; font-weight: 700; color: var(--ink-2); background: #f1f7fb; }
.cal-times div { font-size: 12px; font-weight: 600; }

.modal-back { background: rgba(6, 30, 50, .5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade .16s ease-out; }
.modal { border-radius: 18px; box-shadow: 0 24px 60px rgba(4, 28, 48, .38); animation: pop .2s cubic-bezier(.2, .8, .25, 1); }
.modal-head { padding: 15px 20px; border-radius: 18px 18px 0 0; background: linear-gradient(100deg, #e1f0fb, #f4fbfd 70%, #fff); }
.modal-head h2 { font-size: 18px; font-weight: 800; }
.modal-body { padding: 18px 20px 20px; }
.combo-list { border-radius: 10px; }
.combo-list button { font-weight: 500; font-size: 14.5px; transition: background .08s; }
.combo-list small { font-size: 12.5px; color: var(--ink-3); }
.toast { padding: 11px 16px; font-weight: 600; border-radius: 10px; background: var(--ink); animation: pop .2s ease-out; }
.login { background: radial-gradient(760px 420px at 18% 12%, rgba(2, 185, 191, .5), transparent 70%), var(--side-bg); }
.login-box { max-width: 430px; padding: 30px; border: none; border-radius: 20px; box-shadow: 0 26px 60px rgba(0, 20, 40, .42); animation: pop .3s cubic-bezier(.2, .8, .25, 1); }
.login-box img { width: 132px; }
.login-box h1 { font-size: 22px; font-weight: 800; }
.login-box .btn.primary { height: 42px; font-size: 15px; }

@keyframes rise { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
#view.enter > * { animation: rise .3s cubic-bezier(.2, .7, .2, 1) backwards; }
#view.enter > *:nth-child(2) { animation-delay: .04s; } #view.enter > *:nth-child(3) { animation-delay: .08s; }
#view.enter .bar i { animation: grow .5s cubic-bezier(.2, .8, .25, 1) backwards; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.svc-lines { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.svc-empty { padding: 11px; font-size: 13.5px; font-weight: 500; text-align: center; color: var(--ink-3); background: #f6fafd; border: 1px dashed var(--line); border-radius: 10px; }
.svc-line { padding: 10px 12px 12px; background: #f6fafd; border: 1px solid var(--line); border-radius: 12px; animation: pop .16s ease-out; }
.svc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
/* Tên việc, thủ thuật vừa chọn: in đậm, cỡ lớn cho dễ nhìn (BS Cường 26/11/2026). */
.svc-head b { font-size: 16.5px; font-weight: 800; color: var(--brand-dark); letter-spacing: -.005em; }
.svc-head small { flex: none; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.svc-head .btn { flex: none; width: 30px; margin-left: auto; padding: 0; color: var(--ink-3); }
.svc-head .btn:hover { color: var(--bad); background: var(--bad-soft); border-color: transparent; }
.svc-grid { display: grid; grid-template-columns: minmax(195px, 1.7fr) minmax(100px, 1fr) 88px minmax(88px, .85fr) minmax(100px, .95fr); gap: 8px; align-items: start; }
.svc-grid label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Dịch vụ tính theo lần, cái, hộp…: không có ô vị trí răng. */
.svc-line.no-tooth .svc-grid { grid-template-columns: minmax(110px, 1fr) 88px minmax(88px, .85fr) minmax(100px, .95fr); }
.svc-grid .svc-count { max-width: 170px; }
@media (max-width: 760px) { .svc-line.no-tooth .svc-grid { grid-template-columns: 1fr 96px; } .svc-line.no-tooth .svc-total { grid-column: 1 / -1; } }
.svc-line .tags { background: #fff; }
.svc-line .tags input.tags-input { min-width: 70px; }
.svc-total b { display: block; line-height: 39px; font-size: 15px; font-weight: 800; color: var(--brand); white-space: nowrap; }
.svc-grand { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 9px; padding: 9px 13px; font-weight: 700; color: var(--brand-dark); background: var(--brand-soft); border-radius: 10px; }
.svc-grand[hidden] { display: none; }
.svc-grand b { font-size: 19px; font-weight: 800; color: var(--brand); }
.svc-more { margin-top: 7px; color: var(--brand); }
@media (max-width: 760px) {
  .svc-grid { grid-template-columns: 1fr 96px; }
  .svc-grid .svc-tooth, .svc-grid .svc-total { grid-column: 1 / -1; }
  .svc-total b { line-height: 1.5; }
}

@media (max-width: 960px) {
  .grid-2 { grid-template-columns: 1fr; }
  .money-strip { margin-left: 0; width: 100%; }
}
@media (max-width: 760px) {
  .side { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .18s; box-shadow: none; }
  .side.open { transform: none; box-shadow: 6px 0 24px rgba(0, 0, 0, .3); }
  .btn.menu-btn { display: inline-flex; flex: none; }
  .top { padding: 0 10px; gap: 6px; }
  .who { display: none; }
  .top-right select { max-width: 112px; }
  .content { padding: 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .filters input[type=date] { width: calc(50% - 4px); }
  .money-strip { gap: 14px; justify-content: space-between; }
  .money-strip b { font-size: 15px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi b { font-size: 17px; letter-spacing: -.01em; }
  .kpi-ic { width: 30px; height: 30px; right: 10px; top: 12px; border-radius: 9px; }
  .kpi-ic .ic { width: 16px; height: 16px; }
  .kpi { padding: 13px 13px 12px; }
  .kpi:has(.kpi-ic) > span { padding-right: 32px; min-height: 36px; font-size: 12.5px; line-height: 1.4; }
  .top { height: 58px; }
  .me-avatar { display: none; }
  .content { padding: 14px 12px; }
  .page-head h1 { font-size: 22px; }
  .cal-wrap { max-height: none; }
}
/* Các lần làm nằm trong khối thủ thuật */
.tbl .no-strike { margin-left: 8px; }
.item-time { margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--brand); }
.tbl .step-add { margin-top: 7px; color: var(--brand); border-color: var(--brand); white-space: nowrap; }
.step-no { display: inline-block; margin-right: 7px; padding: 1px 8px; font-size: 12px; font-weight: 700; color: var(--brand); background: var(--brand-soft); border-radius: 999px; white-space: nowrap; }
.tbl tr.step-main td { border-bottom-color: transparent; }
.tbl tr.step-row td { background: #f5fafe; }
.tbl tr.step-row td:nth-child(2) { padding-left: 34px; position: relative; }
.tbl tr.step-row td:nth-child(2)::before { content: ""; position: absolute; left: 18px; top: 0; bottom: 0; border-left: 2px solid var(--brand); opacity: .35; }
.tbl tr.step-row b { font-weight: 700; color: var(--ink); }
.vt-pick { display: flex; gap: 8px; align-items: center; } .vt-pick .combo { flex: 1; } .vt-pick .btn { flex: none; }
.vt-lines { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; max-height: 52vh; overflow-y: auto; }
.vt-line { display: grid; grid-template-columns: minmax(180px, 1fr) 92px 110px 30px; gap: 10px; align-items: center; padding: 8px 10px; background: #f6fafd; border: 1px solid var(--line); border-radius: 10px; }
.vt-line.vt-nhap { grid-template-columns: minmax(170px, 1fr) 80px 96px 118px 112px 30px; }
.vt-line.vt-kiem { grid-template-columns: minmax(170px, 1fr) 92px 110px 70px 30px; }
.vt-line.vt-nhan { grid-template-columns: minmax(170px, 1fr) 92px 110px; }
.vt-name b { display: block; font-size: 14px; font-weight: 700; line-height: 1.3; } .vt-name small { color: var(--ink-3); font-size: 12px; }
.vt-have span, .vt-f span, .vt-sum span { display: block; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.vt-have b, .vt-sum b { font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; } .vt-sum b { color: var(--brand); }
.vt-f input { width: 100%; height: 34px; }
.vt-line .vt-rm { width: 30px; padding: 0; color: var(--ink-3); } .vt-line .vt-rm:hover { color: var(--bad); background: var(--bad-soft); border-color: transparent; }
.vt-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px 16px; margin: 0; }
.vt-info dt { font-size: 12px; color: var(--ink-3); } .vt-info dd { margin: 1px 0 0; font-weight: 600; }
.vt-alert { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 10px 14px; color: var(--warn); background: var(--warn-soft); border-color: transparent; }
p.hint { font-size: 12.5px; color: var(--ink-3); }
.item-buy { display: flex; gap: 5px; align-items: flex-start; margin-top: 4px; font-size: 12.5px; font-weight: 600; color: #8a4b00; } .item-buy .ic { flex: none; width: 14px; height: 14px; margin-top: 2px; }
.item-vt { display: flex; gap: 5px; align-items: flex-start; margin-top: 4px; font-size: 12.5px; color: var(--ink-2); } .item-vt .ic { flex: none; width: 14px; height: 14px; margin-top: 2px; color: var(--teal); }
.tbl tr.muted td { color: var(--ink-3); }
.vt-line.vt-bom { grid-template-columns: minmax(160px, 1fr) 118px 104px 128px 96px 30px; }
.vt-pick .vt-copy { flex: 0 1 300px; }
.pay-inline { display: grid; grid-template-columns: minmax(280px, 1.4fr) minmax(160px, 1fr); gap: 8px; align-items: center; padding: 10px 12px; background: #f3fbf7; border: 1px solid #cfeede; border-radius: 12px; }
.pay-inline .pay-amount { grid-column: 1 / -1; display: flex; gap: 6px; } .pay-inline .pay-amount input { flex: 1; min-width: 0; font-weight: 700; } .pay-inline .pay-amount .btn { flex: none; }
.pay-inline .pay-debt { grid-column: 1 / -1; font-size: 13px; color: var(--ink-2); } .pay-inline .pay-debt b { color: var(--bad); }
@media (max-width: 760px) { .pay-inline { grid-template-columns: 1fr; } }
.vt-conv { display: grid; gap: 4px; padding: 10px 12px; font-size: 13.5px; background: var(--brand-soft); border-radius: 10px; }
.vt-xk { margin-top: 12px; } .vt-xk .kpi b { font-size: 20px; }
.vt-xk-err { margin-top: 10px; padding: 10px 12px; } .vt-xk-err > b { display: block; margin-bottom: 6px; color: var(--bad); }
.modal [data-checks="also"] { max-height: 190px; overflow-y: auto; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.vt-line.vt-auto { border-style: dashed; border-color: var(--teal); }
.vt-line .vt-have b { display: block; white-space: normal; line-height: 1.25; }
.vt-line.vt-auto .vt-name small::after { content: " · theo định mức"; color: #067d81; font-weight: 600; }
@media (max-width: 760px) {
  .vt-line, .vt-line.vt-nhap, .vt-line.vt-kiem, .vt-line.vt-nhan, .vt-line.vt-bom { grid-template-columns: 1fr 1fr; }
  .vt-line { position: relative; } .vt-line .vt-name { grid-column: 1 / -1; padding-right: 30px; }
  .vt-line .vt-rm { position: absolute; top: 6px; right: 6px; }
  .vt-pick { flex-direction: column; align-items: stretch; }
}
@media print {
  body { background: #fff; }
  #app, #modal-root, #toast { display: none !important; }
  #print-root { display: block; }
}
.login-ver { margin-top: 14px; text-align: center; font-size: 11.5px; color: var(--ink-3); }
