/* KOI Sales - giao diện theo KOI Brand Guidelines: Đen #221F20, Nâu đất #7D3F0F, Beige #E2D2B4 */
:root {
  --black: #221F20;
  --brown: #7D3F0F;
  --brown-2: #9A5419;
  --beige: #E2D2B4;
  --cream: #F6F1E8;
  --white: #FFFFFF;
  --ink: #221F20;
  --muted: #7A716B;
  --line: #E6DDCF;
  --ok: #2E7D4F;
  --ok-bg: #E4F2E9;
  --warn: #A86B00;
  --warn-bg: #FFF3D6;
  --bad: #B3261E;
  --bad-bg: #FCE8E6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(34, 31, 32, .06), 0 4px 14px rgba(34, 31, 32, .06);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--cream);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.4;
  min-height: 100vh;
  overscroll-behavior-y: contain;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

/* ---------- khung ---------- */
.app { max-width: 640px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--black); color: var(--beige);
  padding: calc(10px + var(--safe-t)) 16px 10px;
  display: flex; align-items: center; gap: 10px;
}
.topbar .brand { font-family: 'Roboto Condensed', 'Roboto', sans-serif; font-weight: 700; letter-spacing: .12em; font-size: 18px; }
.topbar .brand small { display: block; font-weight: 400; letter-spacing: .02em; font-size: 12px; color: #BFB3A0; }
.topbar .spacer { flex: 1; }
.topbar .who { text-align: right; font-size: 13px; line-height: 1.2; }
.topbar .who b { display: block; font-size: 14px; color: var(--white); }
.topbar .iconbtn { background: transparent; border: 0; color: var(--beige); padding: 6px; border-radius: 10px; display: inline-flex; }
.topbar .iconbtn:active { background: rgba(255, 255, 255, .08); }

.content { flex: 1; padding: 14px 16px calc(96px + var(--safe-b)); }
.page-title { font-family: 'Roboto Condensed', 'Roboto', sans-serif; font-size: 20px; font-weight: 700; margin: 4px 0 12px; display: flex; align-items: center; gap: 8px; }
.page-title .grow { flex: 1; }

.banner { margin: 0 16px; margin-top: 10px; padding: 10px 12px; border-radius: 12px; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.bad { background: var(--bad-bg); color: var(--bad); }
.banner button { margin-left: auto; }

/* ---------- điều hướng dưới ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--white); border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + var(--safe-b));
  display: flex; justify-content: space-around; align-items: flex-end;
  max-width: 640px; margin: 0 auto;
}
.tab { flex: 1; background: none; border: 0; padding: 6px 2px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); }
.tab svg { width: 24px; height: 24px; }
.tab.active { color: var(--brown); font-weight: 700; }
.tab.plus { flex: 0 0 auto; }
.tab.plus span.fab {
  width: 54px; height: 54px; margin-top: -26px; border-radius: 50%;
  background: var(--brown); color: var(--white); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(125, 63, 15, .35); border: 4px solid var(--cream);
}
.tab.plus svg { width: 26px; height: 26px; }

/* ---------- thẻ ---------- */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px; }
.card h3 { margin: 0 0 10px; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card h3 .grow { flex: 1; }
.card.dark { background: var(--black); color: var(--beige); }
.card.dark h3 { color: #BFB3A0; }

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kpi { background: var(--cream); border-radius: 12px; padding: 10px 12px; }
.card.dark .kpi { background: rgba(255, 255, 255, .06); }
.kpi .lbl { font-size: 12px; color: var(--muted); }
.card.dark .kpi .lbl { color: #BFB3A0; }
.kpi .val { font-size: 22px; font-weight: 700; font-family: 'Roboto Condensed', 'Roboto', sans-serif; }
.card.dark .kpi .val { color: var(--white); }
.kpi .sub { font-size: 12px; color: var(--muted); }
.kpi .sub b { color: var(--ink); }
.card.dark .kpi .sub b { color: var(--beige); }

.big-number { font-family: 'Roboto Condensed', 'Roboto', sans-serif; font-size: 34px; font-weight: 700; color: var(--white); line-height: 1.1; }
.progress { height: 10px; background: rgba(0, 0, 0, .08); border-radius: 99px; overflow: hidden; margin: 8px 0 4px; }
.card.dark .progress { background: rgba(255, 255, 255, .12); }
.progress > i { display: block; height: 100%; background: var(--brown); border-radius: 99px; }
.card.dark .progress > i { background: var(--beige); }
.progress.ok > i { background: var(--ok); }

.bars { display: flex; align-items: flex-end; gap: 2px; height: 90px; padding-top: 6px; }
.bars i { flex: 1; background: var(--beige); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.bars i.today { background: var(--brown); }
.bars i.future { background: var(--line); opacity: .5; }
.bars-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th { text-align: left; font-weight: 700; color: var(--muted); font-size: 12px; padding: 6px 4px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.tbl td { padding: 8px 4px; border-bottom: 1px solid var(--line); }
table.tbl td.r, table.tbl th.r { text-align: right; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tr.total td { font-weight: 700; background: var(--cream); }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -14px; padding: 0 14px; }

/* ---------- danh sách ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.item { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; border: 0; width: 100%; text-align: left; }
.item:active { background: #FBF8F3; }
.item .main { flex: 1; min-width: 0; }
.item .t1 { font-weight: 700; display: flex; gap: 6px; align-items: center; }
.item .t1 .ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .t2 { color: var(--muted); font-size: 13px; margin-top: 2px; }
.item .right { text-align: right; white-space: nowrap; }
.item .amt { font-weight: 700; font-family: 'Roboto Condensed', 'Roboto', sans-serif; font-size: 16px; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.empty svg { width: 44px; height: 44px; opacity: .4; }

.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--cream); color: var(--ink); white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.brown { background: var(--brown); color: var(--white); }
.chip.dark { background: var(--black); color: var(--beige); }

/* ---------- thanh công cụ ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--white); border-radius: 12px; padding: 3px; box-shadow: var(--shadow); }
.seg button { border: 0; background: transparent; padding: 8px 12px; border-radius: 10px; font-size: 13px; font-weight: 500; color: var(--muted); }
.seg button.on { background: var(--black); color: var(--beige); }
.pill-select { appearance: none; -webkit-appearance: none; border: 0; background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237A716B' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; padding: 9px 30px 9px 12px; border-radius: 12px; box-shadow: var(--shadow); font-size: 14px; font-weight: 500; }
.search { flex: 1; min-width: 160px; border: 0; background: var(--white); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); font-size: 16px; }
.datenav { display: inline-flex; align-items: center; background: var(--white); border-radius: 12px; box-shadow: var(--shadow); }
.datenav button { border: 0; background: none; padding: 8px 10px; font-size: 18px; color: var(--brown); }
.datenav input { border: 0; background: none; font-size: 14px; font-weight: 500; width: 140px; text-align: center; }

/* ---------- form ---------- */
.form-page { position: fixed; inset: 0; z-index: 50; background: var(--cream); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.form-page .inner { max-width: 640px; margin: 0 auto; padding: 0 16px calc(110px + var(--safe-b)); }
.form-head { position: sticky; top: 0; z-index: 5; background: var(--black); color: var(--beige); margin: 0 -16px 14px; padding: calc(12px + var(--safe-t)) 16px 12px; display: flex; align-items: center; gap: 10px; }
.form-head h2 { margin: 0; font-size: 17px; flex: 1; font-family: 'Roboto Condensed', 'Roboto', sans-serif; letter-spacing: .02em; }
.form-head button { background: none; border: 0; color: var(--beige); padding: 4px; display: inline-flex; }
.section { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px; }
.section > .sec-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brown); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.field { margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 5px; }
.field label .req { color: var(--bad); }
.input, .select, textarea.input {
  width: 100%; border: 1.5px solid var(--line); background: var(--white); border-radius: 12px;
  padding: 12px; font-size: 16px; outline: none; min-height: 48px;
}
.select { appearance: none; -webkit-appearance: none; background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237A716B' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; padding-right: 34px; }
.input:focus, .select:focus { border-color: var(--brown); box-shadow: 0 0 0 3px rgba(125, 63, 15, .12); }
.input.err, .select.err { border-color: var(--bad); background-color: #FFF8F7; }
.input.upper { text-transform: uppercase; }
.input.money { font-weight: 700; font-size: 18px; letter-spacing: .02em; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.hint.bad { color: var(--bad); }
.hint.ok { color: var(--ok); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { border: 1.5px solid var(--line); background: var(--white); border-radius: 99px; padding: 9px 14px; font-size: 14px; font-weight: 500; min-height: 42px; }
.chips button.on { background: var(--black); color: var(--beige); border-color: var(--black); }
.chips.err button { border-color: #F2B8B5; }
.lookup { border-radius: 12px; padding: 10px 12px; font-size: 13px; margin-top: 8px; background: var(--cream); }
.lookup.new { background: var(--ok-bg); color: var(--ok); }
.lookup b { color: var(--ink); }
.lookup button { margin-top: 8px; }
.share-row { display: grid; grid-template-columns: 1fr 90px; gap: 8px; align-items: center; margin-bottom: 8px; }
.share-row .select { min-height: 46px; }
.share-sum { font-size: 13px; font-weight: 700; }
.switch { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 6px 0; }
.switch input { width: 22px; height: 22px; accent-color: var(--brown); }
.checklist .switch { border-bottom: 1px solid var(--line); padding: 12px 0; }
.checklist .switch:last-child { border-bottom: 0; }
.errors { background: var(--bad-bg); color: var(--bad); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; font-size: 14px; }
.errors ul { margin: 6px 0 0; padding-left: 18px; }
.warnings { background: var(--warn-bg); color: var(--warn); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; font-size: 14px; }
.warnings ul { margin: 6px 0 0; padding-left: 18px; }

.sticky-actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--white); border-top: 1px solid var(--line); padding: 10px 16px calc(10px + var(--safe-b)); }
.sticky-actions .inner2 { max-width: 640px; margin: 0 auto; display: flex; gap: 10px; }

.btn { border: 0; border-radius: 12px; padding: 13px 18px; font-size: 16px; font-weight: 700; min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.primary { background: var(--brown); color: var(--white); flex: 1; }
.btn.primary:active { background: var(--brown-2); }
.btn.dark { background: var(--black); color: var(--beige); flex: 1; }
.btn.ghost { background: var(--white); color: var(--ink); border: 1.5px solid var(--line); }
.btn.danger { background: var(--bad-bg); color: var(--bad); }
.btn.small { min-height: 38px; padding: 8px 12px; font-size: 14px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; }

/* ---------- đăng nhập ---------- */
.login { min-height: 100vh; background: var(--black); color: var(--beige); display: flex; flex-direction: column; }
.login .top { padding: calc(40px + var(--safe-t)) 24px 20px; text-align: center; }
.login .logo { font-family: 'Roboto Condensed', 'Roboto', sans-serif; font-size: 44px; font-weight: 700; letter-spacing: .3em; color: var(--beige); margin-left: .3em; }
.login .tag { font-size: 12px; letter-spacing: .28em; color: #BFB3A0; margin-top: 2px; }
.login .panel { flex: 1; background: var(--cream); color: var(--ink); border-radius: 24px 24px 0 0; padding: 22px 18px calc(24px + var(--safe-b)); }
.login h2 { margin: 0 0 4px; font-size: 20px; font-family: 'Roboto Condensed', 'Roboto', sans-serif; }
.login p.sub { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.grid-btns { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.grid-btns button { background: var(--white); border: 0; border-radius: 14px; box-shadow: var(--shadow); padding: 16px 12px; text-align: left; min-height: 72px; }
.grid-btns button b { display: block; font-size: 17px; }
.grid-btns button span { font-size: 12px; color: var(--muted); }
.grid-btns button:active { background: var(--beige); }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 22px 0 18px; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--brown); }
.pin-dots i.on { background: var(--brown); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 320px; margin: 0 auto; }
.pad button { background: var(--white); border: 0; border-radius: 16px; box-shadow: var(--shadow); height: 62px; font-size: 24px; font-weight: 500; }
.pad button:active { background: var(--beige); }
.pad button.fn { font-size: 15px; background: transparent; box-shadow: none; color: var(--brown); font-weight: 700; }
.backlink { background: none; border: 0; color: var(--brown); font-weight: 700; padding: 0; margin-bottom: 12px; display: inline-flex; align-items: center; gap: 4px; }
.login .err { color: var(--bad); text-align: center; min-height: 20px; font-size: 14px; }

/* ---------- sheet / toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20, 18, 19, .45); z-index: 70; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease; }
.sheet { background: var(--cream); width: 100%; max-width: 640px; max-height: 88vh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 10px 16px calc(18px + var(--safe-b)); animation: up .2s ease; }
.sheet .grab { width: 40px; height: 5px; background: var(--line); border-radius: 99px; margin: 0 auto 12px; }
.sheet h3 { margin: 0 0 12px; font-family: 'Roboto Condensed', 'Roboto', sans-serif; font-size: 19px; }
.sheet .actions { display: flex; gap: 10px; margin-top: 14px; }
.menu-btn { width: 100%; background: var(--white); border: 0; border-radius: 14px; box-shadow: var(--shadow); padding: 16px; display: flex; gap: 14px; align-items: center; text-align: left; margin-bottom: 10px; }
.menu-btn .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--black); color: var(--beige); display: flex; align-items: center; justify-content: center; }
.menu-btn b { display: block; font-size: 16px; }
.menu-btn span { font-size: 13px; color: var(--muted); }
dl.kv { margin: 0; display: grid; grid-template-columns: 38% 62%; row-gap: 8px; font-size: 14px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; font-weight: 500; word-break: break-word; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(92px + var(--safe-b)); z-index: 90; background: var(--black); color: var(--beige); padding: 12px 18px; border-radius: 12px; font-size: 14px; box-shadow: 0 8px 20px rgba(0, 0, 0, .25); max-width: calc(100% - 32px); animation: up .2s ease; }
.toast.bad { background: var(--bad); color: var(--white); }
.spinner { width: 22px; height: 22px; border: 3px solid rgba(125, 63, 15, .2); border-top-color: var(--brown); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
.loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; gap: 12px; }
.loading .slow-hint { font-size: 13px; color: var(--muted); text-align: center; max-width: 340px; opacity: 0; animation: slowhint .3s ease 6s forwards; }
@keyframes slowhint { to { opacity: 1; } }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; }
.flex { display: flex; gap: 8px; align-items: center; }
.grow { flex: 1; }
.pos { color: var(--ok); } .neg { color: var(--bad); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes up { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@media (min-width: 700px) {
  .kpis.k4 { grid-template-columns: repeat(4, 1fr); }
  .content { padding-top: 20px; }
}
.tab.plus .fab-lbl { display: none; }
#s-club button { font-size: 13px; padding: 8px 12px; min-height: 38px; }
.stc { opacity: .7; font-weight: 400; }
.tab { position: relative; }
.tab .badge { position: absolute; top: 2px; left: 50%; margin-left: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: var(--white); font-size: 11px; font-style: normal; font-weight: 700; line-height: 18px; text-align: center; }
.sec-title-l { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brown); margin: 16px 0 8px; }
.pay-row { display: grid; grid-template-columns: 1fr 130px 36px; gap: 8px; align-items: start; margin-bottom: 8px; }
.pay-row .pay-extra { grid-column: 1 / 3; display: grid; grid-template-columns: 1fr 90px; gap: 8px; }
.pay-row .x { border: 0; background: var(--bad-bg); color: var(--bad); border-radius: 10px; height: 46px; font-size: 18px; }
.pay-row .input, .pay-row .select { min-height: 46px; }
.pay-sum { font-size: 13px; font-weight: 700; }
.ref-list button { display: block; width: 100%; text-align: left; border: 1.5px solid var(--line); background: var(--white); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; font-size: 14px; }
.ref-list button.on { border-color: var(--brown); background: #FBF4EC; }
.ref-list button[disabled] { opacity: .5; }
.readonly-val { display: flex; align-items: center; min-height: 48px; padding: 0 12px; border-radius: 12px; background: var(--cream); font-weight: 700; }

/* ---------- ô chọn nhân viên có tìm kiếm ---------- */
.sp { position: relative; }
.sp .sp-native { display: none; }
.sp-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--white); border: 1.5px solid var(--line); border-radius: 12px; box-shadow: 0 10px 28px rgba(34, 31, 32, .16); max-height: 280px; overflow-y: auto; padding: 4px; }
.sp-list button { display: flex; width: 100%; align-items: baseline; gap: 8px; border: 0; background: none; text-align: left; padding: 11px 10px; border-radius: 8px; font-size: 15px; min-height: 44px; }
.sp-list button span { margin-left: auto; font-size: 12px; color: var(--muted); }
.sp-list button:hover, .sp-list button.on { background: var(--cream); }
.sp-list button.sp-clear { color: var(--muted); font-size: 14px; }
.sp-none { padding: 10px; font-size: 13px; color: var(--muted); }
.sp .sp-native.err + .sp-input { border-color: var(--bad); background-color: #FFF8F7; }
.share-row .sp-input { min-height: 46px; }

/* ---------- thẻ tập thử (Open GP) ---------- */
.gp-box { background: var(--cream); border-radius: 12px; padding: 12px; }
.gp-box .sec-title { margin-bottom: 8px; }
.input.gp-to { display: flex; align-items: center; background: var(--cream); font-weight: 700; }
.gp-card { background: var(--black); color: var(--beige); border-radius: 18px; padding: 20px 20px 16px; margin-bottom: 10px; position: relative; overflow: hidden; }
.gp-card::after { content: ''; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: var(--brown); opacity: .55; }
.gp-card .gp-brand { font-family: 'Roboto Condensed', 'Roboto', sans-serif; font-weight: 700; font-size: 26px; letter-spacing: .25em; position: relative; z-index: 1; }
.gp-card .gp-brand small { display: block; font-size: 10px; letter-spacing: .28em; font-weight: 400; color: #BFB3A0; }
.gp-card .gp-kind { margin-top: 14px; font-size: 11px; letter-spacing: .14em; color: #BFB3A0; }
.gp-card .gp-name { font-size: 20px; font-weight: 700; color: var(--white); margin-top: 2px; }
.gp-card .gp-code { font-family: 'Roboto Condensed', 'Roboto', sans-serif; font-size: 24px; font-weight: 700; letter-spacing: .06em; color: var(--beige); margin: 8px 0 12px; padding: 8px 12px; border: 1.5px dashed rgba(226, 210, 180, .5); border-radius: 10px; display: inline-block; }
.gp-card dl { margin: 0; display: grid; grid-template-columns: 72px 1fr; row-gap: 4px; font-size: 13px; }
.gp-card dt { color: #BFB3A0; }
.gp-card dd { margin: 0; color: var(--white); font-weight: 500; }

/* ---------- máy tính: menu bên trái, nội dung trải hết màn hình ---------- */
@media (min-width: 1024px) {
  :root { --side: 232px; --top: 64px; }
  body { font-size: 15px; }
  .app { max-width: none; }
  .topbar { height: var(--top); padding: 0 24px; position: fixed; left: 0; right: 0; top: 0; }
  .topbar .brand { font-size: 20px; }

  .tabbar {
    top: var(--top); bottom: 0; left: 0; right: auto; width: var(--side); max-width: none; margin: 0;
    flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 4px;
    padding: 20px 14px; border-top: 0; border-right: 1px solid var(--line);
  }
  .tab { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 14px; border-radius: 12px; font-size: 15px; }
  .tab svg { width: 22px; height: 22px; }
  .tab:hover { background: var(--cream); color: var(--ink); }
  .tab.active { background: var(--cream); }
  .tab.plus { order: -1; margin-bottom: 14px; padding: 0; }
  .tab.plus:hover { background: none; }
  .tab.plus span.fab { width: 100%; height: 48px; margin: 0; border: 0; border-radius: 12px; gap: 8px; font-size: 15px; font-weight: 700; box-shadow: 0 4px 12px rgba(125, 63, 15, .25); }
  .tab.plus span.fab:hover { background: var(--brown-2); }
  .tab.plus svg { width: 22px; height: 22px; }
  .tab.plus .fab-lbl { display: inline; }
  .tab .badge { position: static; margin-left: auto; }

  #banner { margin-left: var(--side); }
  #banner:not(:empty) { padding-top: var(--top); }
  #banner .banner { margin: 16px 32px 0; }
  .content { margin-left: var(--side); padding: calc(var(--top) + 24px) 32px 40px; }
  #banner:not(:empty) + .content { padding-top: 20px; }
  .content > * { max-width: 1600px; }
  .page-title { font-size: 24px; margin-bottom: 16px; }

  /* dashboard dạng lưới 12 cột */
  .dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: start; }
  .dash-grid > * { grid-column: span 12; margin-bottom: 0; }
  .dash-grid > .g-5 { grid-column: span 5; }
  .dash-grid > .g-6 { grid-column: span 6; }
  .dash-grid > .g-7 { grid-column: span 7; }
  .dash-grid > .g-last { order: 10; }
  .dash-grid > .card.dark { align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
  .card { padding: 18px 20px; }
  .scroll-x { margin: 0 -20px; padding: 0 20px; }
  .big-number { font-size: 44px; }
  .bars { height: 150px; }
  table.tbl tr[data-club-row] { cursor: pointer; }
  table.tbl tr[data-club-row]:hover td { background: var(--cream); }

  /* danh sách HĐ / khách: nhiều cột */
  #lst.list, #glst.list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
  #lst.list > .empty, #glst.list > .empty, #lst.list > .errors, #glst.list > .errors, #lst.list > .loading, #glst.list > .loading { grid-column: 1 / -1; }
  .item:hover { background: #FBF8F3; }
  .search { max-width: 420px; }

  /* tài khoản: cột vừa đọc */
  .content > .card, .content > .page-title + .card { max-width: 720px; }
  #gsum.card { max-width: none; }

  /* form nhập: 1 cột vừa mắt, giữa màn hình */
  .form-page { overflow-x: hidden; }
  .form-page .inner { max-width: 820px; padding: 0 32px 120px; }
  .form-head { margin: 0 calc(50% - 50vw) 20px; padding: 14px calc(50vw - 50%); }
  .sticky-actions .inner2 { max-width: 756px; }

  /* bảng chọn: hộp thoại giữa màn hình */
  .overlay { align-items: center; }
  .sheet { max-width: 560px; border-radius: 22px; padding: 22px 24px; }
  .sheet .grab { display: none; }
  .toast { bottom: 28px; }

  /* đăng nhập */
  .login { align-items: center; justify-content: center; }
  .login .top { padding-top: 0; }
  .login .panel { flex: none; width: 100%; max-width: 620px; border-radius: 24px; padding: 28px; margin-bottom: 40px; }
  .grid-btns { grid-template-columns: repeat(3, 1fr); }
}

/* v1.8: ảnh CCCD / bằng chứng, lịch sử thu */
.sec-sub { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brown); margin: 12px 0 8px; }
.mt4 { margin-top: 4px; }
.photo-row { align-items: start; }
.photo-box { border: 1.5px dashed var(--line); border-radius: 12px; padding: 10px; margin-bottom: 10px; background: var(--white); }
.photo-box.err { border-color: var(--bad); }
.photo-lbl { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.photo-lbl:empty { display: none; }
.photo-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-grid:empty { display: none; }
.photo-grid.ro { margin: 2px 0; }
.photo-th { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; background: var(--cream); flex: 0 0 auto; }
.photo-th img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; }
.photo-th.broken::after { content: 'Không tải được'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--muted); text-align: center; }
.photo-th .x { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(34, 31, 32, .75); color: #fff; font-size: 16px; line-height: 24px; padding: 0; }
.photo-add { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 14px; margin-top: 8px; border-radius: 10px; background: var(--cream); color: var(--brown); font-weight: 600; font-size: 14px; cursor: pointer; }
.photo-add input { display: none; }
.photo-grid:empty + .photo-add { margin-top: 0; }
.photo-full { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; border-radius: 12px; }
.pay-hist { padding: 6px 0; border-bottom: 1px solid var(--line); }
.pay-hist:last-child { border-bottom: 0; }
.seg .badge.in { position: static; display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 99px; background: var(--bad); color: var(--white); font-size: 11px; font-style: normal; font-weight: 700; line-height: 18px; text-align: center; }

/* ============================ THANH TOÁN THEO KỲ (v2.0) ============================ */
.chip.kp-paid { background: var(--ok-bg); color: var(--ok); }
.chip.kp-partial { background: #FFF4C2; color: #7A5A00; }
.chip.kp-overdue { background: #8E1B1B; color: var(--white); }
.chip.kp-due_soon { background: #FFE2C4; color: #A14A00; }
.chip.kp-not_due { background: #ECE8E3; color: #6B6460; }
.kpis.k5 { grid-template-columns: repeat(2, 1fr); }
.tbl tr.hl td { background: var(--beige); }
.pay-hist.void { opacity: .7; }
.pay-hist.void b { text-decoration: line-through; }
.ky-sum { font-size: 14px; margin: 4px 0 8px; }
.tbl.ky-mini td, .tbl.ky-mini th { padding: 5px 6px; font-size: 13px; }
.ky-tbl td { vertical-align: middle; }
.ky-right { margin-top: 8px; }
.ky-frame { overflow: auto; background: #E9E2D6; border-radius: 12px; }
.ky-scale { width: 210mm; transform-origin: top left; }
.ky-call { cursor: pointer; }
.ky-call .t1, .ky-item .t1 { flex-wrap: wrap; }
.ky-call .t1 .ell, .ky-item .t1 .ell { white-space: normal; }
.ky-call .right .btn { display: inline-block; text-decoration: none; }
@media (min-width: 1024px) {
  .form-page.ky-page .inner { max-width: 1400px; }
  .ky-grid { display: grid; grid-template-columns: minmax(360px, 460px) 1fr; gap: 28px; align-items: start; }
  .ky-right { position: sticky; top: 76px; margin-top: 0; }
  .kpis.k5 { grid-template-columns: repeat(5, 1fr); }
}

/* Bản in Phụ lục thanh toán theo kỳ: A4, 2 trang, lề 10mm nằm trong nội dung (thông số theo mẫu đã chốt) */
.doc { width: 210mm; margin: 0 auto; font-family: Roboto, Arial, sans-serif; font-size: 10.5pt; line-height: 1.35; color: #221F20; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.doc .page { width: 210mm; height: 297mm; padding: 10mm; background: #FFFFFF; overflow: hidden; box-shadow: 0 8px 28px rgba(34,31,32,.12); margin: 0 0 18px; box-sizing: border-box; }
.doc p { margin: 0 0 3pt; }
.doc .hdr { display: grid; grid-template-columns: 42% 58%; text-align: center; font-size: 9.5pt; font-weight: 700; margin-bottom: 6pt; }
.doc .hdr .co { color: #7D3F0F; }
.doc .hdr small { display: block; font-weight: 400; font-size: 9pt; }
.doc h1 { text-align: center; color: #7D3F0F; font-size: 16pt; font-weight: 700; margin: 4pt 0 2pt; }
.doc .sub { text-align: center; font-style: italic; font-size: 9.5pt; margin-bottom: 10pt; }
.doc h2 { color: #7D3F0F; font-size: 11pt; font-weight: 700; margin: 7pt 0 3pt; }
.doc .v { font-weight: 700; }
.doc .dl { color: #7A7069; letter-spacing: .12em; }
.doc table { width: 100%; border-collapse: collapse; }
.doc .info td { border: 1px solid #9A9A9A; padding: 3pt 6pt; font-size: 10pt; vertical-align: middle; }
.doc .info td:first-child { width: 42%; background: #F4EFE7; }
.doc .sch th { background: #7D3F0F; color: #FFF; font-size: 9pt; font-weight: 700; padding: 5pt 3pt; border: 1px solid #9A9A9A; text-align: center; line-height: 1.2; }
.doc .sch td { border: 1px solid #9A9A9A; padding: 0 5pt; height: 24pt; font-size: 10pt; font-variant-numeric: tabular-nums; }
.doc .sch td.c { text-align: center; }
.doc .sch td.r { text-align: right; }
.doc .sch tr.tot td { background: #E2D2B4; font-weight: 700; height: 20pt; }
.doc .cl { font-size: 10pt; margin: 0 0 2.5pt; text-align: justify; }
.doc .sig { display: grid; grid-template-columns: 1fr 1fr; text-align: center; margin-top: 14pt; }
.doc .sig b { display: block; font-size: 10.5pt; }
.doc .sig i { display: block; font-size: 9pt; margin-bottom: 56pt; }
.doc .sig .nm { font-weight: 700; font-size: 10pt; }
.doc .int { margin-top: 18pt; }
.doc .int th { background: #7D3F0F; color: #FFF; font-size: 9pt; padding: 4pt; border: 1px solid #9A9A9A; }
.doc .int td { border: 1px solid #9A9A9A; padding: 5pt 6pt; font-size: 9.5pt; vertical-align: top; width: 33.33%; }
.doc .int td b { display: block; margin-bottom: 4pt; }
.doc .int td .ln { display: block; margin-top: 3pt; }
.doc .foot { margin-top: 8pt; font-size: 8.5pt; color: #7A7069; text-align: center; }

#printRoot { display: none; }
/* nguồn dựng PDF: đặt ngoài màn hình, trang A4 không bóng / không khoảng cách */
.ky-pdf-src { position: fixed; left: -10000px; top: 0; width: 210mm; background: #FFF; }
.ky-pdf-src .doc .page { box-shadow: none; margin: 0; }
/* v2.5 phiếu thu (MS in sau mỗi khoản Paid): nằm nửa trên trang A4 */
.doc.rcpt .page { height: auto; min-height: 0; font-family: 'Times New Roman', Times, serif; font-size: 11pt; }
.rcpt .rc-logo { text-align: center; margin: 2mm 0 5mm; }
.rcpt .rc-logo .k { font-family: Roboto, Arial, sans-serif; font-size: 30pt; font-weight: 700; letter-spacing: .08em; line-height: 1; }
.rcpt .rc-logo .t { font-family: Roboto, Arial, sans-serif; font-size: 7pt; font-weight: 700; letter-spacing: .06em; }
.rcpt .rc-head { text-align: center; line-height: 1.45; margin-bottom: 4mm; }
.rcpt .rc-head .ti { font-weight: 700; font-size: 12pt; }
.rcpt p { margin: 0 0 1.5pt; }
.rcpt .rc-tb { margin: 3pt 0 6pt; border: 2px solid #555; }
.rcpt .rc-tb th { border: 1px solid #222; padding: 4pt; font-size: 10.5pt; }
.rcpt .rc-tb td { border: 1px solid #222; padding: 4pt 5pt; font-size: 10.5pt; vertical-align: top; }
.rcpt .rc-tb td.r { text-align: right; white-space: nowrap; }
.rcpt .rc-tb td:nth-child(2), .rcpt .rc-tb td:nth-child(3) { white-space: nowrap; }
.rcpt .rc-head > b:first-child { font-size: 10pt; }
.rcpt .it { font-style: italic; }
.rcpt .bi { font-style: italic; font-weight: 700; }
.rcpt .sig { margin-top: 8pt; }
.rcpt .sig i { margin-bottom: 40pt; }
@page { size: A4; margin: 0; }
@media print {
  html, body { margin: 0; padding: 0; background: #FFF; }
  /* ẩn toàn bộ giao diện app, chỉ để lại bản in */
  body.printing > *:not(#printRoot) { display: none !important; }
  body.printing #printRoot { display: block; }
  .doc { margin: 0; }
  .doc .page { box-shadow: none; margin: 0; height: auto; min-height: 0; overflow: visible; break-after: page; page-break-after: always; }
  .doc .page:last-child { break-after: auto; page-break-after: auto; }
}

/* đang hiện số lần trước, chờ số mới */
.stale-note { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin: -4px 0 8px; }
.stale-note .spinner, .spinner.sm { width: 12px; height: 12px; border-width: 2px; }

/* ============================ LƯƠNG (v2.1) ============================ */
.pr-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.pr-card { padding: 8px 14px; }
table.pr-grid { font-size: 13px; min-width: 1060px; }
table.pr-grid th { white-space: normal; line-height: 1.25; }
table.pr-grid th, table.pr-grid td { padding: 6px 4px; vertical-align: middle; }
table.pr-grid tr.hl td { background: #FBF4E6; }
table.pr-grid tfoot td { font-weight: 700; background: var(--cream); }
.pr-grid .pr-name { min-width: 140px; position: sticky; left: 0; background: var(--white); z-index: 1; }
table.pr-grid tr.hl td.pr-name { background: #FBF4E6; }
.pr-name .chip { margin: 2px 4px 0 0; }
.pr-open { display: block; border: 0; background: none; padding: 0; text-align: left; color: var(--ink); font: inherit; cursor: pointer; }
.pr-open b { display: block; text-decoration: underline; text-decoration-color: var(--beige); text-underline-offset: 3px; }
.pr-open span { font-size: 11px; color: var(--muted); }
.pr-in { width: 100%; min-width: 52px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 6px; font: inherit; font-size: 13px; text-align: right; background: var(--white); color: var(--ink); }
.pr-in.money { min-width: 84px; }
.pr-in:focus { outline: none; border-color: var(--brown); box-shadow: 0 0 0 2px rgba(125, 63, 15, .15); }
.pr-in.dirty { background: var(--beige); border-color: var(--brown); font-weight: 700; }
.pr-in:disabled { background: transparent; border-color: transparent; }
.pr-in::placeholder { color: #A89C90; }
.pr-detail { max-height: 46vh; overflow-y: auto; }
.pr-prev { max-height: 56vh; overflow-y: auto; font-size: 14px; }
.pr-prev ul { margin: 6px 0 10px; padding-left: 18px; }
.slip-top { text-align: left; }
.slip-net { font-family: 'Roboto Condensed', 'Roboto', sans-serif; font-size: 34px; font-weight: 700; color: var(--white); margin: 4px 0 6px; }
.slip-grid { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 1024px) {
  .slip-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .slip-grid .card { margin-bottom: 16px; }
}
/* v2.1.1: trả lương 2 lần, nhân viên xác nhận */
.seg .stc { font-weight: 400; opacity: .8; }
.pr-ack { border: 0; background: none; padding: 0; cursor: pointer; }
.pr-ackbox { background: var(--cream); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.slip-part { margin-bottom: 18px; }
.slip-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 10px; font-size: 16px; }
.slip-ack { background: var(--white); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); }
.slip-ack .actions { margin-top: 10px; }
table.slip-comm { font-size: 13px; }
table.slip-comm td, table.slip-comm th { padding: 6px 4px; }

/* Máy tính màn ngang: form nhập dài chia cột trải hết bề ngang (Lộc 30/09/2026: không còn "giả desktop" 1 cột giữa màn hình) */
@media (min-width: 1100px) {
  .form-page.wide .inner { max-width: 1680px; padding: 0 32px 120px; columns: 3 440px; column-gap: 20px; }
  .form-page.wide .inner > .form-head { column-span: all; position: relative; }
  .form-page.wide .inner > #errs, .form-page.wide .inner > .errors, .form-page.wide .inner > .warnings { column-span: all; }
  .form-page.wide .section, .form-page.wide .card, .form-page.wide .field, .form-page.wide .hint { break-inside: avoid; }
  .form-page.wide .section { display: inline-block; width: 100%; }
  body.wide-form .sticky-actions .inner2 { max-width: 1680px; padding: 0 32px; justify-content: flex-end; }
  body.wide-form .sticky-actions .inner2 .btn { flex: 0 0 auto; min-width: 180px; }
}

/* v2.6 bảng khách hàng: màn rộng là bảng, màn hẹp mỗi dòng thành 1 thẻ (nhãn cột ở bên trái) */
.rtable { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--white); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; font-size: 14px; }
.rtable th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 10px 12px; background: #FBF8F3; border-bottom: 1px solid var(--line); }
.rtable td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.rtable tbody tr { cursor: pointer; }
.rtable tbody tr:hover td { background: #FBF8F3; }
.rtable tbody tr:last-child td { border-bottom: 0; }
.rtable .chip { margin: 0 2px 2px 0; }
button.link { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--brown); text-decoration: underline; cursor: pointer; }
.icon-btn { border: 0; background: var(--white); box-shadow: var(--shadow); width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); cursor: pointer; }
.search-box { flex: 1; min-width: 200px; position: relative; display: flex; }
.search-box .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; pointer-events: none; }
.search-box .search { padding-left: 40px; }
.cust-code { display: inline-block; background: var(--black); color: var(--beige); font-weight: 700; border-radius: 8px; padding: 3px 9px; letter-spacing: .04em; }
@media (max-width: 899px) {
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; box-sizing: border-box; }
  .rtable { background: none; box-shadow: none; border-radius: 0; }
  .rtable thead { display: none; }
  .rtable tbody tr { background: var(--white); border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 10px; padding: 6px 0; }
  .rtable td { position: relative; border-bottom: 0; padding: 5px 14px 5px 122px; min-height: 26px; }
  .rtable td::before { content: attr(data-l); position: absolute; left: 14px; top: 7px; width: 100px; font-size: 12px; color: var(--muted); }
}

/* giá bán: số tiền + dòng giảm giá xếp dọc */
#f-priceView { display: block; }
#f-priceView .small { margin-top: 2px; line-height: 1.35; }

/* ---------- v2.8 ---------- */
@media (max-width: 1023px) {
  .tabbar.many .tab { font-size: 9.5px; padding: 6px 0; }
  .tabbar.many .tab svg { width: 21px; height: 21px; }
}
.chip.dep { background: #FBE9D0; color: #8A4B08; }
.chip.off { background: #E4E0DC; color: #5E5750; }
.av { position: relative; flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--beige, #E2D2B4); color: var(--brown, #7D3F0F); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; overflow: hidden; }
.av.big { width: 64px; height: 64px; font-size: 24px; }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.av:not(.has) img { visibility: hidden; }
.cu-cell { display: flex; gap: 10px; align-items: center; }
.sur-rev { grid-column: 1 / 3; display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; margin-top: -2px; }
.sur-rev label { display: inline-flex; gap: 6px; align-items: center; }
.item.srch { cursor: pointer; }
.srch-act { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
@media (min-width: 700px) { .srch-act { flex-direction: row; align-items: center; } }
.doc.hdoc .page { position: relative; }
.doc.hdoc .info td:first-child { width: 32%; }
.doc.hdoc .cl { font-size: 9.6pt; }
.doc.hdoc h2 { margin-top: 8pt; }
.doc .mt { margin-top: 8pt; }
.hd-draft { background: #B3261E; color: #FFF; text-align: center; font-weight: 700; font-size: 10pt; padding: 3pt 0; margin: -2mm 0 4mm; letter-spacing: .02em; }
.hd-wm { position: absolute; left: 0; right: 0; top: 42%; text-align: center; font-size: 86pt; font-weight: 900; color: rgba(179, 38, 30, .11); transform: rotate(-30deg); pointer-events: none; z-index: 0; letter-spacing: .06em; }
.doc.hdoc .page > *:not(.hd-wm) { position: relative; z-index: 1; }
.toast.act { display: flex; gap: 12px; align-items: center; padding: 8px 8px 8px 16px; top: calc(64px + env(safe-area-inset-top, 0px)); bottom: auto; pointer-events: none; }
.toast.act .btn { flex: none; pointer-events: auto; }
/* v2.8.1 mẫu Hợp đồng hội viên (theo mẫu Lộc gửi) */
.kdoc .page { padding: 12mm 13mm 10mm; font-size: 9.6pt; line-height: 1.35; }
.kdoc .kh { display: flex; justify-content: space-between; align-items: flex-start; gap: 10mm; padding-bottom: 5mm; border-bottom: 2px solid #7D3F0F; }
.kdoc .kh-logo .k { font-size: 30pt; font-weight: 700; letter-spacing: .12em; line-height: 1; color: #221F20; }
.kdoc .kh-logo .t { font-size: 6.6pt; font-weight: 700; letter-spacing: .06em; margin-top: 2pt; }
.kdoc .kh-addr { text-align: right; font-size: 8.8pt; line-height: 1.45; max-width: 115mm; }
.kdoc .kt-title { text-align: center; font-family: 'Roboto Condensed', Roboto, sans-serif; font-size: 20pt; font-weight: 700; letter-spacing: .06em; margin: 5mm 0 1.5mm; }
.kdoc .kt-sub { text-align: center; color: #5E5750; font-size: 9pt; margin-bottom: 3mm; }
.kdoc .kt-sub b { color: #221F20; }
.kdoc .kt-sub .sep { margin: 0 3mm; color: #B9B0A6; }
.kdoc .kt-h { font-family: 'Roboto Condensed', Roboto, sans-serif; color: #7D3F0F; font-weight: 700; font-size: 11pt; letter-spacing: .02em; border-bottom: 1.5px solid #7D3F0F; padding-bottom: 1.5pt; margin: 4.5mm 0 2mm; }
.kdoc .ks { font-weight: 700; font-size: 9.2pt; margin: 2mm 0 1mm; color: #221F20; }
.kdoc table.kt { width: 100%; border-collapse: collapse; table-layout: fixed; }
.kdoc .kt td { border: 1px solid #C9BFB3; padding: 4pt 6pt; vertical-align: middle; height: 17pt; }
.kdoc .kt td.lb { background: #F4EFE7; width: 18%; }
.kdoc .kt td.b, .kdoc .kn td.b { font-weight: 700; }
.kdoc .kt-note { font-style: italic; color: #5E5750; font-size: 8.6pt; margin: -0.5mm 0 1.5mm; }
.kdoc .kt-gn { font-size: 8.6pt; font-style: italic; margin-top: 1.5mm; }
.kdoc .kt-gn ul { margin: 1pt 0 0 5mm; padding: 0; }
.kdoc table.kn { width: 100%; border-collapse: collapse; }
.kdoc .kn td { border: 1px solid #C9BFB3; padding: 4pt 6pt; }
.kdoc .kn td.no { width: 9mm; text-align: center; color: #5E5750; }
.kdoc .kn td.r { text-align: right; width: 42mm; font-variant-numeric: tabular-nums; }
.kdoc .kn tr.tot td { background: #E2D2B4; font-weight: 700; }
.kdoc .kn tr.tot td.r { color: #7D3F0F; font-size: 11pt; }
.kdoc .kx { display: flex; gap: 5mm; margin-top: 3.5mm; }
.kdoc .kx > .no { font-weight: 700; color: #7D3F0F; min-width: 5mm; }
.kdoc .kx > div { flex: 1; }
.kdoc .kx-h { font-weight: 700; color: #7D3F0F; }
.kdoc .kx p { margin: 1.5pt 0; }
.kdoc .kx ol { margin: 1pt 0 0; padding-left: 5mm; }
.kdoc .kx ol li { margin-bottom: 1.5pt; }
.kdoc .kx ol li::marker { color: #7D3F0F; font-weight: 700; }
.kdoc .kx-dots { border-bottom: 1.5px dotted #B9B0A6; height: 7mm; }
.kdoc .kack { border-left: 3px solid #7D3F0F; padding: 1mm 0 1mm 3.5mm; margin: 5mm 0 4mm; font-style: italic; }
.kdoc .kack p { margin: 0 0 2pt; }
.kdoc table.ksig { width: 100%; border-collapse: collapse; table-layout: fixed; }
.kdoc .ksig th { background: #F4EFE7; border: 1px solid #C9BFB3; font-family: 'Roboto Condensed', Roboto, sans-serif; font-size: 10pt; padding: 4pt; }
.kdoc .ksig th i { display: block; font-family: Roboto, sans-serif; font-weight: 400; font-size: 8.2pt; color: #5E5750; }
.kdoc .ksig td { border: 1px solid #C9BFB3; text-align: center; font-weight: 700; font-size: 9pt; }
.kdoc .ksig tr.sp td { height: 30mm; }
.kdoc .ksig tr.nm td { height: 8mm; }
.kdoc .kfoot { position: absolute; left: 13mm; right: 13mm; bottom: 5mm; text-align: center; font-size: 7.5pt; color: #7A7069; }
.kdoc .hd-draft { margin: -4mm 0 3mm; }
.doc.kdoc .page > .kfoot { position: absolute; }

/* ---------- v2.9 ---------- */
/* menu trái máy tính: chữ đứng sát icon, số đếm dồn phải */
@media (min-width: 1024px) {
  .tab > span { order: 2; }
  .tab > .badge { order: 3; }
}
/* bảng ngang trong danh sách lưới (Xử lý, Khách): chiếm hết chiều ngang */
#lst.list > .rtable, #glst.list > .rtable { grid-column: 1 / -1; }
.rtable th.r, .rtable td.r { text-align: right; }
.rtable td.r { white-space: nowrap; }
/* chọn ngày / tháng / năm */
.dmy { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pill-input { width: 78px; border: 0; background: var(--white); padding: 9px 10px; border-radius: 12px; box-shadow: var(--shadow); font-size: 14px; font-weight: 500; font-family: inherit; color: var(--ink); }
.pill-input::placeholder { color: var(--muted); font-weight: 400; }
.seg-scroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.seg-scroll button { white-space: nowrap; flex: none; }
.btn.sm { padding: 7px 12px; font-size: 13px; min-height: 0; }
/* so sánh cùng kỳ */
.cmp-bar { display: flex; flex-direction: column; gap: 10px; }
.cmp-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cmp-tag { display: inline-block; min-width: 20px; padding: 2px 7px; border-radius: 6px; font-size: 12px; font-weight: 700; text-align: center; }
.cmp-tag.a { background: var(--brown); color: var(--white); }
.cmp-tag.b { background: var(--beige); color: var(--ink); }
table.tbl td.up { color: var(--ok); font-weight: 600; }
table.tbl td.down { color: var(--bad); font-weight: 600; }
table.cmp th { white-space: nowrap; }
svg.cum { width: 100%; height: 150px; display: block; }
svg.cum polyline { fill: none; stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
svg.cum .la { stroke: var(--brown); }
svg.cum .lb { stroke: #BFB3A0; stroke-dasharray: 5 4; }
/* cơ cấu gói */
table.mix tr.grp { cursor: pointer; }
table.mix tr.grp:hover td { background: var(--cream); }
table.mix tr.sub td { font-size: 12.5px; background: #FCFAF6; }
table.mix td.share { min-width: 110px; }
.sharebar { height: 6px; background: var(--cream); border-radius: 3px; overflow: hidden; margin-bottom: 3px; }
.sharebar > i { display: block; height: 100%; background: var(--brown); }
/* burn theo tháng */
.burn-bars { display: flex; gap: 4px; align-items: flex-end; height: 170px; margin: 8px 0; }
.burn-bars .bb { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; position: relative; min-width: 0; }
.burn-bars .bb > i { display: block; width: 100%; max-width: 38px; background: var(--beige); border-radius: 4px 4px 0 0; }
.burn-bars .bb.cur > i { background: var(--brown); }
.burn-bars .bb.fut > i { background: repeating-linear-gradient(45deg, #E2D2B4, #E2D2B4 4px, #EFE5D3 4px, #EFE5D3 8px); }
.burn-bars .bb > span { font-size: 10px; color: var(--muted); margin-top: 3px; }
.burn-bars .bb > b { position: absolute; top: 0; font-size: 10px; font-weight: 600; color: var(--ink); writing-mode: vertical-rl; transform: rotate(180deg); opacity: .8; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--cream); }
table.tbl tr[data-staff-row] { cursor: pointer; }
table.tbl tr[data-staff-row]:hover td { background: var(--cream); }
.photo-th.pdf { display: flex; align-items: center; justify-content: center; background: #FBE9E7; }
.pdf-tile { font-weight: 800; font-size: 15px; color: var(--bad); cursor: pointer; letter-spacing: .05em; }
/* v2.10 KOC */
.bad-t { color: var(--bad); }
.rtable.ki input.input { min-width: 90px; padding: 8px 10px; }
.select.sm { padding: 6px 8px; font-size: 13px; min-height: 0; }
