/* ========== ธีม ========== */
:root {
  --bg: #f6f6f5; --panel: #ffffff; --ink: #111111; --ink-2: #2b2b2b; --muted: #737373; --line: #e7e7e5; --line-2: #f2f2f1;
  --accent: #582232; --accent-2: #45192A; --accent-soft: #F6ECEE; --accent-ink: #ffffff; --bar-h: 32px;
  --ok: #059669; --ok-soft: #e8f8f1; --warn: #b45309; --warn-soft: #fff6e5; --bad: #dc2626; --bad-soft: #fdeeee;
  --info: #2563eb; --info-soft: #ebf2ff;
  --radius: 16px; --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .04);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, .18);
  --grad: linear-gradient(135deg, #6E2A3E 0%, #582232 55%, #45192A 100%);
  --side-w: 248px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Anuphan', 'IBM Plex Sans Thai', system-ui, sans-serif; font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0 0 .6em; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.08rem; }
a { color: var(--accent); }
svg.i { width: 18px; height: 18px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
.right { text-align: right; } .center { text-align: center; } .num { font-variant-numeric: tabular-nums; text-align: right; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 16px; }
.full { grid-column: 1 / -1; }
@media (max-width: 700px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }

/* ========== โครงหน้า: แถบเมนูด้านข้าง ========== */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 14px; gap: 14px; z-index: 5; }
.side-head { display: flex; gap: 12px; align-items: center; padding: 4px 6px 14px; border-bottom: 1px solid var(--line-2); }
.logo { width: 40px; height: 40px; border-radius: 12px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 1.1rem; flex: 0 0 auto; box-shadow: 0 6px 16px rgba(0, 0, 0, .35); }
.brand { min-width: 0; font-weight: 700; line-height: 1.25; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: .78rem; margin-top: 2px; }
.tabs { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; scrollbar-width: none; }
.tabs button { display: flex; align-items: center; gap: 11px; background: none; border: 0; color: var(--ink-2); padding: 9px 12px; border-radius: 10px; cursor: pointer; text-align: left; font-weight: 500; white-space: nowrap; }
.tabs button svg.i { color: #9a9a98; }
.tabs button:hover { background: var(--line-2); }
.tabs button.active { background: var(--accent-soft); color: var(--accent-2); }
.tabs button.active svg.i { color: var(--accent); }
.tabs button span.lbl { flex: 1; }
.badge { background: var(--bad); color: #fff; border-radius: 99px; padding: 0 7px; font-size: .72rem; font-weight: 600; line-height: 1.6; }
.side-foot { display: flex; align-items: center; gap: 8px; padding: 14px 6px 0; border-top: 1px solid var(--line-2); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-2); display: grid; place-items: center; font-weight: 700; flex: 0 0 auto; }
.who-name { flex: 1; min-width: 0; font-weight: 600; font-size: .9rem; line-height: 1.2; }
.who-name small { display: block; color: var(--muted); font-weight: 400; font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); flex: 0 0 auto; }
.icon-btn:hover { background: var(--line-2); }
.main { padding: 26px 30px 40px; max-width: 1440px; width: 100%; }
.page-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 1.55rem; }
.page-head .page-sub { color: var(--muted); font-size: .9rem; }

@media (max-width: 900px) {
  .shell { display: block; }
  .side { position: sticky; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px 0; gap: 8px; border-right: 0; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(10px); }
  .side-head { border: 0; padding: 0; flex: 1; min-width: 0; }
  .logo { width: 34px; height: 34px; border-radius: 10px; font-size: .95rem; }
  .side-foot { border: 0; padding: 0; }
  .side-foot .avatar, .side-foot .who-name { display: none; }
  .tabs { order: 3; flex-basis: 100%; flex-direction: row; overflow-x: auto; padding-bottom: 8px; }
  .tabs button { padding: 7px 11px; font-size: .9rem; }
  .tabs button span.lbl { flex: none; }
  .main { padding: 16px 14px 32px; }
  .page-head h1 { font-size: 1.3rem; }
}

/* ========== การ์ด ========== */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card.soft { background: #f7f7f6; box-shadow: none; border-color: var(--line-2); }
.card h3 { font-size: 1.02rem; }

/* ========== ฟอร์ม ========== */
label.f { display: flex; flex-direction: column; gap: 6px; font-size: .84rem; color: var(--muted); font-weight: 500; }
label.chk { display: flex; gap: 10px; align-items: center; cursor: pointer; color: var(--ink-2); }
input, select, textarea { border: 1px solid #dededc; border-radius: var(--radius-sm); padding: 9px 12px; background: #fff; min-width: 0; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: #a8a8a6; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); padding: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(0, 0, 0, .14); }
input:disabled { background: #f4f4f3; color: var(--muted); }
select { appearance: none; background-image: 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='%23737373' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[inputmode=decimal], input[inputmode=numeric] { text-align: right; font-variant-numeric: tabular-nums; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #dededc; background: #fff; padding: 9px 16px; border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap; font-weight: 500; color: var(--ink-2); box-shadow: var(--shadow-sm); transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: #f7f7f6; border-color: #c8c8c6; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 12px rgba(0, 0, 0, .25); }
.btn.primary:hover { background: var(--accent-2); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.bad { background: #fff; border-color: #f3c4c4; color: var(--bad); }
.btn.bad:hover { background: var(--bad-soft); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.big { padding: 15px 22px; font-size: 1.08rem; font-weight: 600; border-radius: 12px; }
.btn.sm { padding: 5px 11px; font-size: .84rem; border-radius: 8px; }
.btn.link { border: 0; background: none; color: var(--accent); padding: 4px; box-shadow: none; }
.btn.link:hover { text-decoration: underline; background: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* ========== ตาราง ========== */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: middle; }
th { font-weight: 600; color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; background: #fafafa; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; } tr.click:hover td { background: #f7f7f6; }
tr.void td { color: var(--muted); }
tr.void td.no { text-decoration: line-through; }
tr.total td { font-weight: 700; border-top: 1px solid var(--line); background: #fafafa; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 99px; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); } .pill.n { background: #efefee; color: #556070; } .pill.info { background: var(--info-soft); color: var(--info); }

/* ========== หน้าเข้าใช้งาน ========== */
.entry-bg { min-height: 100vh; background: radial-gradient(1000px 520px at 50% -12%, #ffffff 0%, transparent 70%), var(--bg); padding: 1px 0; }
.entry { max-width: 720px; margin: 9vh auto; padding: 0 18px; text-align: center; }
.entry .logo { width: 64px; height: 64px; border-radius: 20px; font-size: 1.7rem; margin: 0 auto 16px; }
.entry h1 { font-size: 1.9rem; margin-bottom: 4px; }
.entry .sub { color: var(--muted); margin-bottom: 22px; }
.branch-pill { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 5px 8px 5px 14px; box-shadow: var(--shadow-sm); font-weight: 500; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 24px 0; text-align: left; }
.choice { background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 18px; padding: 22px 20px; cursor: pointer; font-size: 1.08rem; font-weight: 600; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s; }
.choice:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(15, 23, 42, .1); border-color: #bdbdbd; }
.choice .ic { width: 46px; height: 46px; border-radius: 13px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 14px; }
.choice .ic svg.i { width: 24px; height: 24px; }
.choice small { display: block; font-weight: 400; color: var(--muted); font-size: .84rem; margin-top: 4px; }
.entry-links { display: flex; justify-content: center; gap: 22px; margin-top: 6px; }

/* ========== POS ========== */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 470px; gap: 16px; align-items: start; }
@media (max-width: 1150px) { .pos { grid-template-columns: minmax(0, 1fr); } }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.svc { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 14px; cursor: pointer; text-align: left; transition: border-color .15s, box-shadow .15s, transform .1s; position: relative; }
.svc:hover { border-color: #bdbdbd; box-shadow: 0 6px 18px rgba(0, 0, 0, .12); }
.svc:active { transform: scale(.98); }
.svc > div:first-child { font-weight: 600; padding-right: 44px; }
.svc .p { color: var(--accent); font-weight: 700; margin-top: 8px; font-size: 1.08rem; }
.svc .t { font-size: .7rem; color: var(--muted); position: absolute; top: 12px; right: 10px; background: var(--line-2); padding: 1px 8px; border-radius: 99px; }
.edit-banner { background: var(--warn-soft); color: var(--warn); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.line { padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.line .head { display: flex; gap: 6px; align-items: center; }
.line .head .nm { flex: 1; font-weight: 600; }
.line input.price { width: 92px; } .line input.qty { width: 52px; text-align: center; }
.splits { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.split { display: flex; gap: 6px; align-items: center; }
.split .who { flex: 1; background: var(--accent-soft); color: var(--accent-2); border-radius: 8px; padding: 6px 10px; font-size: .9rem; font-weight: 500; }
.split input { width: 104px; padding: 6px 10px; }
.split-add { display: flex; gap: 6px; align-items: center; }
.split-add select { flex: 1; padding: 6px 32px 6px 10px; }
.split-add select.need { border-color: #f3b4b4; background-color: var(--bad-soft); color: var(--bad); }
.split-warn { color: var(--bad); font-size: .82rem; margin: 4px 0; }
.member-box { background: #f7f7f6; border: 1px solid #e2e2e0; border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.totals > div { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; gap: 8px; }
.totals .grand { font-size: 1.5rem; font-weight: 700; border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 12px; }
.remain { border-radius: 12px; padding: 10px 14px; margin-top: 12px; display: flex; justify-content: space-between; font-weight: 600; }
.remain.ok { background: var(--ok-soft); color: var(--ok); } .remain.bad { background: var(--bad-soft); color: var(--bad); }
.pay-methods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.pay-method { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 13px 6px; cursor: pointer; font-weight: 600; color: var(--ink-2); transition: all .15s; }
.pay-method:hover:not(:disabled) { border-color: #bdbdbd; }
.pay-method.on { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, .25); }
.pay-method:disabled { opacity: .4; cursor: not-allowed; }
.pay-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.pay-row .pay-name { width: 130px; font-size: .9rem; font-weight: 500; }
.pay-row input { flex: 1; width: 0; font-size: 1.1rem; padding: 10px 12px; }
@media (max-width: 420px) { .pay-methods { grid-template-columns: repeat(2, 1fr); } }
.open-bar { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; margin-bottom: 12px; }
.open-chip { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 160px; max-width: 230px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 11px 15px; cursor: pointer; text-align: left; box-shadow: var(--shadow-sm); transition: all .15s; }
.open-chip:hover { border-color: #bdbdbd; }
.open-chip b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.open-chip small { color: var(--muted); font-size: .74rem; white-space: nowrap; }
.open-chip.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px rgba(0, 0, 0, .12); }
.open-chip.new { justify-content: center; align-items: center; border-style: dashed; border-color: #bdbdbd; color: var(--accent); font-weight: 600; min-width: 140px; background: transparent; box-shadow: none; }

/* ========== สถิติ ========== */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.stat .v { font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat .k { color: var(--muted); font-size: .82rem; font-weight: 500; }
.stat.hl { background: var(--grad); color: #fff; border: 0; box-shadow: 0 10px 24px rgba(0, 0, 0, .3); }
.stat.hl .k { color: rgba(255,255,255,.8); }
/* ----- หน้ายอดขาย (ตารางเรียบ) ----- */
.rp-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0; overflow: hidden; }
.rp-sum > div { padding: 16px 18px; border-left: 1px solid var(--line); min-width: 0; }
.rp-sum > div:first-child { border-left: 0; }
.rp-sum span { display: block; font-size: .9rem; color: var(--ink-2); }
.rp-sum b { display: block; font-size: 1.5rem; font-variant-numeric: tabular-nums; color: var(--ink); margin: 2px 0; }
.rp-sum small { display: block; font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .rp-sum { grid-template-columns: 1fr 1fr; } .rp-sum > div:nth-child(3) { border-left: 0; } .rp-sum > div:nth-child(n+3) { border-top: 1px solid var(--line); } }
.rp-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin: 4px 0 8px; overflow-x: auto; scrollbar-width: none; }
.rp-tabs button { flex: none; border: 0; background: none; padding: 10px 14px; font-size: .95rem; color: var(--ink-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.rp-tabs button.on { color: var(--ink); font-weight: 700; border-bottom-color: var(--ink); }
.rp-tbl td, .rp-tbl th { font-size: .95rem; }
.rp-tbl td { color: var(--ink); }
.rp-h4 { font-size: .95rem; margin: 16px 0 4px; }
.rk-by { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 8px; }
.rp-tbl td.rk-col, .rp-tbl th:first-child:empty { width: 44px; }
.rk { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 50%; font-size: .85rem; font-weight: 700; color: var(--ink-2); background: var(--line-2); }
.rk.rk1 { background: #111; color: #fff; }
.kpi-ok { color: #15803d; }
.pos-pick { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 6px 0 2px; }
.pos-pick .chk { padding: 3px 0; }
.rp-sum.kpi-sum { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 760px) { .rp-sum.kpi-sum { grid-template-columns: 1fr 1fr; } .rp-sum.kpi-sum > div { border-left: 0; border-top: 1px solid var(--line); } .rp-sum.kpi-sum > div:first-child { grid-column: span 2; border-top: 0; } .rp-sum.kpi-sum > div:nth-child(odd):not(:first-child) { border-left: 1px solid var(--line); } }
.kpi-bad { color: #b91c1c; }
.rk.rk2, .rk.rk3 { background: #e4e4e2; color: var(--ink); }
/* จอแคบ: การ์ดไม่ดันจอให้กว้าง ตารางเลื่อนในตัว · ตัวเลือกช่วงวันที่เลื่อนแนวนอน วันที่วางคู่กัน */
#rout .grid2 > *, #rout > .card { min-width: 0; }
@media (max-width: 520px) {
  .rp-tbl .rp-pct { display: none; }
  #r-ctl .row:has([data-preset]) { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  #r-ctl [data-preset] { flex: none; white-space: nowrap; }
  #r-ctl .row:has(#r-from) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  #r-ctl .row:has(#r-from) > label { min-width: 0; margin: 0; }
  #r-ctl .row:has(#r-from) > span { grid-column: span 2; padding: 0 !important; }
  #r-ctl #r-from, #r-ctl #r-to { width: 100%; min-width: 0; padding-left: 8px; padding-right: 6px; font-size: .9rem; }
}

/* ========== บิลรายวัน ========== */
.bills-layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 16px; align-items: start; }
@media (max-width: 1060px) { .bills-layout { grid-template-columns: minmax(0, 1fr); } .bills-side { position: static !important; } }
.bills-side { position: sticky; top: 20px; }
.bills-side h4 { margin: 18px 0 6px; font-size: .74rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.side-big { margin: 8px 0 14px; }
.side-big .k { font-size: .84rem; color: var(--muted); }
.side-big .v { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.side-cash { background: var(--grad); color: #fff; border-radius: 14px; padding: 14px 16px; box-shadow: 0 10px 24px rgba(0, 0, 0, .3); }
.side-cash .k, .side-cash .small { color: rgba(255,255,255,.82); font-size: .84rem; }
.side-cash .v { font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.side-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line-2); font-variant-numeric: tabular-nums; }
.side-row.sum { border-bottom: 0; border-top: 1.5px solid var(--ink); margin-top: 2px; }
.side-pending { margin-top: 16px; background: var(--warn-soft); color: var(--warn); border-radius: 12px; padding: 12px 14px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px; }
.side-pending .small { flex-basis: 100%; }
.seg { display: inline-flex; background: #efefee; border-radius: 11px; padding: 4px; margin-bottom: 14px; flex-wrap: wrap; gap: 2px; }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 8px; cursor: pointer; font-weight: 500; color: var(--ink-2); }
.seg button.on { background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .1); color: var(--ink); font-weight: 600; }
.seg small { color: var(--muted); margin-left: 4px; }
.bills-tbl tr.pending td { background: #fffcf3; }
.bills-tbl tr.void td { color: var(--muted); }
.bills-tbl tr.void .no { text-decoration: line-through; }
.live { font-size: .8rem; color: var(--ok); display: inline-flex; align-items: center; gap: 7px; font-weight: 500; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; }
.live.tick i { animation: ping .6s ease-out; }
@keyframes ping { from { box-shadow: 0 0 0 0 rgba(5,150,105,.5); } to { box-shadow: 0 0 0 8px rgba(5,150,105,0); } }
details.card > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: '›'; font-size: 1.3rem; line-height: 1; transition: transform .15s; color: var(--muted); }
details.card[open] > summary::before { transform: rotate(90deg); }

/* ========== ตอกบัตร ========== */
.month-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; }
.month-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 92px; padding: 12px 6px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); font: inherit; cursor: pointer; }
.month-tile:hover { border-color: #bdbdbd; }
.month-tile svg.i { width: 24px; height: 24px; }
.month-tile b { font-weight: 600; font-size: .92rem; }
.month-tile small { color: var(--muted); font-size: .72rem; }
.month-tile.now { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.pay-mask { position: relative; display: block; width: 100%; padding: 22px 64px 22px 20px; margin-bottom: 16px; font: inherit; text-align: left; cursor: pointer; }
.pay-mask .v { font-size: 2rem; letter-spacing: .08em; }
.pay-mask .small { margin-top: 6px; color: rgba(255,255,255,.8); }
.pay-eye { position: absolute; top: 50%; right: 18px; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.14); display: grid; place-items: center; }
.pay-eye svg.i { width: 22px; height: 22px; }
.stat.link { display: block; width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.stat.link:hover { border-color: #bdbdbd; }
.home-alert { display: flex; align-items: center; gap: 10px; width: 100%; padding: 13px 16px; margin-bottom: 16px; border: 1px solid var(--bad); border-radius: 14px; background: #fff; color: var(--bad); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.clock-big { text-align: center; padding: 34px 20px; background: linear-gradient(180deg, #fff, #f7f7f6); }
.clock-big .time { font-size: 3.6rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.03em; margin: 4px 0; }
.clock-big .btn.big { min-width: 260px; padding: 16px 26px; border-radius: 14px; font-size: 1.15rem; }

/* ========== ปฏิทิน ========== */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .h { text-align: center; font-size: .76rem; color: var(--muted); padding: 4px; font-weight: 600; }
.cal .d { min-height: 92px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px 7px; font-size: .74rem; cursor: pointer; overflow: hidden; transition: border-color .15s, background .15s; }
.cal .d:hover { border-color: #bdbdbd; }
.cal .d.empty { background: transparent; border: 0; cursor: default; }
.cal .d.today { border: 2px solid var(--accent); }
.cal .d.today .n { color: var(--accent); }
.cal .d.lock { background: repeating-linear-gradient(45deg, #fff, #fff 6px, #fdf0f0 6px, #fdf0f0 12px); }
.cal .d.closed { background: #f1f2f5; }
.cal .d.picked { background: var(--accent-soft); border: 2px solid var(--accent); }
.cal .d.past { opacity: .55; }
.cal .d .n { font-weight: 700; font-size: .92rem; }
.cal .tag { display: block; border-radius: 6px; padding: 1px 6px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.cal .tag.approved { background: var(--ok-soft); color: var(--ok); }
.cal .tag.vac { background: var(--info-soft); color: var(--info); }
.cal .tag.pending { background: var(--warn-soft); color: var(--warn); }
.cal .tag.auto, .cal .tag.lockt { background: var(--bad-soft); color: var(--bad); }
.cal .tag.closedt { background: #e4e6eb; color: #4b5563; }
.cal .tag.mine { box-shadow: inset 3px 0 0 currentColor; }
@media (max-width: 600px) { .cal { gap: 3px; } .cal .d { min-height: 60px; font-size: .64rem; padding: 3px 4px; border-radius: 8px; } }
.legend { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ========== ใบเตือน / ข้อความ ========== */
.notice { border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; background: #fff; }
.notice.manual { border-left-color: var(--bad); }
.notice.acked { opacity: .7; border-left-color: var(--ok); }

/* ========== หน้าต่าง / แจ้งเตือน ========== */
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 20; padding: 16px; animation: fade .15s ease-out; }
.modal-box { background: #fff; border-radius: 20px; padding: 24px; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; }
.modal-box.wide { max-width: 920px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; z-index: 30; max-width: 90vw; box-shadow: var(--shadow-lg); font-weight: 500; }
.toast.err { background: var(--bad); }

/* ========== เอกสาร ========== */
.thumbs { display: flex; gap: 12px; flex-wrap: wrap; }
.thumbs a { display: block; width: 150px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-decoration: none; color: var(--ink); font-size: .8rem; box-shadow: var(--shadow-sm); }
.thumbs img { width: 100%; height: 96px; object-fit: cover; display: block; background: #efefee; }
.thumbs span { display: block; padding: 6px 8px; }
.rc-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .rc-layout { grid-template-columns: minmax(0, 1fr); } }
.rc-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }
.rc-group { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px; border: 1px solid var(--line-2); border-radius: 12px; }
.rc-group [hidden] { display: none; }
.rc-group .btn { justify-self: start; }
.rc-group textarea, .rc-group input[type=file], .rc-group input[type=range] { width: 100%; box-sizing: border-box; }
.rc-group input[type=range] { padding: 0; border: 0; }
.rc-preview { padding: 16px; border: 1px dashed var(--line); border-radius: 12px; background: #fff; overflow: hidden; overflow-wrap: anywhere; }
.sig-preview { max-height: 80px; border: 1px dashed var(--line); padding: 4px; background: #fff; border-radius: 8px; }

/* ========== ใบเสร็จ & หนังสือรับรอง ========== */
.receipt { font-family: ui-monospace, Menlo, monospace; font-size: calc(var(--rc-fs, 11px) * 1.18); max-width: 300px; margin: 0 auto; }
.receipt .l span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.receipt .c { text-align: center; } .receipt hr { border: 0; border-top: 1px dashed #999; margin: 8px 0; }
.receipt .l { display: flex; justify-content: space-between; gap: 8px; }
/* ตอนพิมพ์: กว้างเท่ากระดาษใบเสร็จ 72mm (พื้นที่พิมพ์ของกระดาษ 80mm) */
.rc-raster { position: fixed; left: -10000px; top: 0; background: #fff; }
.rc-raster .receipt, .rc-preview .receipt { width: 64mm !important; padding: 0 1mm 1mm !important; }
html.print-rc .receipt, .rc-raster .receipt, .rc-preview .receipt { width: 72mm; max-width: none; box-sizing: border-box; padding: 0 4mm 18mm; margin: 0; overflow-wrap: anywhere; font-size: var(--rc-fs, 11px); line-height: 1.3; }
html.print-rc .receipt small, html.print-rc .receipt .small, .rc-raster .receipt small, .rc-raster .receipt .small, .rc-preview .receipt small, .rc-preview .receipt .small { font-size: calc(var(--rc-fs, 11px) - 1px); }
html.print-rc .receipt hr, .rc-raster .receipt hr, .rc-preview .receipt hr { margin: 5px 0; }
.rc-preview .receipt { margin: 0 auto; }
.rc-preview { overflow-x: auto; overflow-y: hidden; }
html.print-rc .receipt img, .rc-raster .receipt img { max-width: 100% !important; margin-top: 0 !important; }
.cert { font-family: 'Anuphan', serif; max-width: 640px; margin: 0 auto; padding: 24px 28px; line-height: 1.9; color: #111; }
.cert .hd { text-align: center; margin-bottom: 18px; }
.cert .ttl { text-align: center; font-size: 1.3rem; font-weight: 700; margin: 16px 0; }
.cert .body { text-indent: 3em; }
.cert .sign { margin-top: 40px; margin-left: auto; width: 280px; text-align: center; }
.cert .sign img { max-height: 70px; max-width: 220px; display: block; margin: 0 auto -6px; }
.cert .sign .ln { border-top: 1px dotted #555; margin-top: 4px; padding-top: 2px; }

@media print {
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area { position: absolute; left: 0; top: 0; width: 100%; }
  .modal { background: none; position: absolute; backdrop-filter: none; }
  .modal-box { max-height: none; overflow: visible; box-shadow: none; }
  /* ใบเสร็จกระดาษความร้อน 80mm (พื้นที่พิมพ์จริง ~72mm) — ซ่อนส่วนอื่นทั้งหมด กระดาษจะได้ไม่ไหลเปล่า */
  html.print-rc body > *:not(#modal), html.print-rc #modal-body > :not(.print-area) { display: none !important; }
  html.print-rc body { margin: 0; padding: 0; background: #fff; }
  html.print-rc .modal { position: static; display: block; padding: 0; animation: none; }
  html.print-rc .modal-box { padding: 0; border-radius: 0; max-width: none; width: auto; animation: none; }
  html.print-rc .print-area { position: static; width: auto; }
}
input[type=file] { padding: 6px; background: #fafafa; }
input[type=file]::file-selector-button { border: 1px solid #dededc; background: #fff; border-radius: 8px; padding: 6px 12px; margin-right: 10px; font: inherit; font-weight: 500; cursor: pointer; color: var(--ink-2); }
.logo svg.i { width: 55%; height: 55%; stroke-width: 2; }
/* โลโก้ร้าน */
.entry-logo { width: min(320px, 78vw); display: block; margin: 0 auto 18px; mix-blend-mode: multiply; }
.logo-mark { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: #fff; object-fit: contain; padding: 4px; flex: 0 0 auto; }
@media (max-width: 900px) { .logo-mark { width: 36px; height: 36px; border-radius: 10px; } }
/* โทนขาว-ดำ */
.tabs button.active { background: var(--ink); color: #fff; }
.tabs button.active svg.i { color: #fff; }
.choice .ic { background: var(--ink); color: #fff; }
.choice:hover { border-color: var(--ink); }
.split .who { background: #f0f0ef; color: var(--ink); }
.avatar { background: var(--ink); color: #fff; }
.svc .p { color: var(--ink); }
.cal .d.picked { background: #f0f0ef; }
/* แท็บหมวดในหน้าคิดเงิน */
.cat-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: none; }
.cat-tabs button { flex: 0 0 auto; border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 8px 16px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.cat-tabs button small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.cat-tabs button:hover { border-color: #bdbdbd; }
.cat-tabs button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.cat-tabs button.on small { color: rgba(255,255,255,.7); }
/* หน้าสินค้าและบริการ */
.catalog { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .catalog { grid-template-columns: minmax(0, 1fr); } }
.cat-list { display: flex; flex-direction: column; gap: 6px; }
.cat-item { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: all .15s; }
.cat-item:hover { border-color: #bdbdbd; }
.cat-item.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.cat-item.on .muted { color: rgba(255,255,255,.7); }
.icon-btn.sm { width: 28px; height: 28px; border-radius: 7px; font-size: .85rem; }
.icon-btn:disabled { opacity: .3; cursor: default; }
/* รายการย่อย */
.svc .vcount { font-size: .76rem; color: var(--muted); margin-top: 2px; }
.variant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.variant { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 14px; cursor: pointer; text-align: left; font-weight: 600; transition: all .15s; }
.variant b { font-size: 1.05rem; }
.variant:hover { border-color: var(--ink); background: var(--ink); color: #fff; }
.var-rows { display: flex; flex-direction: column; gap: 6px; }
.var-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px auto auto; gap: 6px; align-items: center; }
@media (max-width: 500px) { .var-row { grid-template-columns: minmax(0, 1fr) 90px auto auto; } }
.var-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.var-chips span { font-size: .74rem; background: var(--line-2); border-radius: 6px; padding: 1px 7px; color: var(--ink-2); font-weight: 500; }
.var-chips span.off { opacity: .45; text-decoration: line-through; }
.var-row { grid-template-columns: minmax(0, 1fr) 96px 104px auto auto; }
.var-head { display: grid; grid-template-columns: minmax(0, 1fr) 96px 104px 64px 28px; gap: 6px; font-size: .74rem; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
@media (max-width: 500px) { .var-row { grid-template-columns: minmax(0, 1fr) 64px 80px auto auto; } .var-head { grid-template-columns: minmax(0, 1fr) 64px 80px 64px 28px; } }
.var-row { grid-template-columns: minmax(110px, 1fr) 64px 84px auto 28px; }
.var-head { grid-template-columns: minmax(110px, 1fr) 64px 84px 64px 28px; }
.var-row input { padding: 7px 9px; }
/* ปุ่มบริการแสดงเฉพาะชื่อ */
.svc { min-height: 64px; display: flex; flex-direction: column; justify-content: center; }
.svc > div:first-child { padding-right: 0; }
.svc .t { position: static; align-self: flex-start; margin-top: 6px; }
/* ปุ่มที่มีรูป */
.svc.has-img { justify-content: flex-start; padding-top: 0; overflow: hidden; }
.svc .svc-img { display: block; width: calc(100% + 28px); margin: 0 -14px 10px; aspect-ratio: 4 / 3; max-height: 150px; object-fit: cover; background: #f3f3f2; }
.svc.has-img > div:nth-of-type(1) { font-weight: 600; }
/* จอแคบ: รูปเล็กชิดซ้าย ปุ่มไม่สูงเกิน */
@media (max-width: 500px) {
  .svc.has-img { display: grid; grid-template-columns: 72px minmax(0, 1fr); column-gap: 12px; align-content: center; padding: 0 12px 0 0; min-height: 72px; }
  .svc.has-img > :not(.svc-img) { grid-column: 2; }
  .svc .svc-img { grid-row: 1 / span 3; width: 72px; height: 100%; min-height: 72px; max-height: none; margin: 0; aspect-ratio: auto; }
  .svc.has-img .p { margin-top: 2px; }
}
.svc-thumb { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; vertical-align: middle; margin-right: 8px; background: #f3f3f2; }
.img-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.img-pick .ph { width: 88px; height: 88px; border-radius: 12px; border: 1px dashed var(--line); background: #f7f7f6; display: grid; place-items: center; overflow: hidden; color: var(--muted); font-size: .75rem; text-align: center; }
.img-pick .ph img { width: 100%; height: 100%; object-fit: cover; }
/* ประวัติรับบริการของสมาชิก */
.visit { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; background: #fff; }
.visit.void { opacity: .55; }
.visit-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.visit-items { margin: 8px 0; padding: 8px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); display: flex; flex-direction: column; gap: 3px; }
.visit-items > div { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.visit-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
/* ทิป */
.tip-box { margin-top: 12px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 12px; background: #fafafa; }
.tip-methods { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tip-methods button { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 4px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.tip-methods button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.tip-box select { flex: 1; }

/* ===== คิดเงินแบบ 2 ขั้น ===== */
.line .head { gap: 10px; }
.line .head .nm { font-size: 1rem; }
.techs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.tech { display: inline-flex; align-items: center; gap: 6px; background: #f0f0ef; border-radius: 99px; padding: 4px 6px 4px 12px; font-weight: 500; font-size: .9rem; }
.tech input { width: 76px; padding: 3px 8px; border-radius: 8px; font-size: .85rem; }
.tech .rm { border: 0; background: #fff; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; color: var(--muted); line-height: 1; }
.techs select.add { width: auto; padding: 5px 30px 5px 12px; border-radius: 99px; font-size: .88rem; }
.techs select.add.need { border-color: #f3b4b4; background-color: var(--bad-soft); color: var(--bad); font-weight: 600; }
.line-edit { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.line-edit input { width: 110px; }
.cart-sum { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.sum-total { font-size: 1.6rem; letter-spacing: -.02em; }

.co-head { text-align: center; padding: 6px 0 16px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.co-label { color: var(--muted); font-size: .85rem; margin-top: 6px; }
.co-due { font-size: 2.6rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.co-due small { font-size: 1rem; color: var(--muted); font-weight: 600; }
.co-break { color: var(--muted); font-size: .84rem; }
.co-sec { padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.co-title { font-weight: 600; margin-bottom: 8px; }
.seg2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg2 button { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 11px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.seg2 button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.opt-chip { border: 1px dashed #c8c8c6; background: #fff; border-radius: 99px; padding: 6px 14px; cursor: pointer; font-weight: 500; color: var(--ink-2); }
.opt-chip.on { border-style: solid; border-color: var(--ink); background: #f0f0ef; color: var(--ink); }
.sub-box { margin-top: 10px; padding: 12px; background: #fafafa; border: 1px solid var(--line-2); border-radius: 12px; }
.pay-method small { display: block; font-weight: 500; font-size: .72rem; opacity: .75; margin-top: 2px; }
.quick-cash { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.quick-cash button { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 11px 4px; cursor: pointer; font-weight: 600; font-variant-numeric: tabular-nums; }
.quick-cash button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
@media (max-width: 480px) { .quick-cash { grid-template-columns: repeat(2, 1fr); } }
.change-row { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; font-weight: 600; }
.change-row b { font-size: 1.6rem; color: var(--ok); font-variant-numeric: tabular-nums; }
.change-row b.neg { color: var(--bad); }
.co-errs { margin-top: 12px; background: var(--warn-soft); color: var(--warn); border-radius: 12px; padding: 10px 14px; font-size: .88rem; font-weight: 500; }
.paid-ok { background: var(--ok-soft); color: var(--ok); font-weight: 700; text-align: center; padding: 12px; border-radius: 12px; margin-bottom: 14px; font-size: 1.05rem; }
.pay-row input + input { flex: 1; }
.disc-mode { display: inline-flex; background: #efefee; border-radius: 10px; padding: 3px; gap: 2px; flex: none; }
.disc-mode button { border: 0; background: none; padding: 7px 12px; border-radius: 8px; cursor: pointer; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.disc-mode button.on { background: var(--ink); color: #fff; font-weight: 600; }
@media (max-width: 420px) { .pay-row:has(.disc-mode) .pay-name { width: auto; } }
/* ลิ้นชักเงินสด */
.drawer { margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fafafa; }
.drawer h4 { margin-top: 0 !important; }
.drawer #dr-float { width: 100px; padding: 5px 8px; }
.dr-exp { margin: 8px 0; }
.dr-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.dr-add { display: grid; grid-template-columns: minmax(0, 1fr) 80px auto; gap: 6px; margin-bottom: 8px; }
.dr-add input { padding: 6px 8px; font-size: .88rem; }
.side-row b.neg { color: var(--bad); }
/* สีวันหยุดตามประเภท */
.cal .tag.approved { background: #dcf5e8; color: #047857; }
.cal .tag.vac { background: #fde2e2; color: #c81e1e; }
.cal .tag.sick { background: #ffedd5; color: #c2410c; }
.cal .tag.auto { background: #1f1f1f; color: #fff; }
.cal .tag.pend { background: #fff !important; outline: 1.5px dashed currentColor; outline-offset: -1.5px; }
.cal .d.picked.pk-weekly { background: #dcf5e8; border: 2px solid #059669; }
.cal .d.picked.pk-vacation { background: #fde2e2; border: 2px solid #dc2626; }
.cal .d.picked.pk-sick { background: #ffedd5; border: 2px solid #ea580c; }
.cal .d.wk-sep { }
.legend .lg { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--ink-2); }
.legend .lg::before { content: ''; width: 12px; height: 12px; border-radius: 4px; }
.legend .lg.wk::before { background: #dcf5e8; border: 1px solid #059669; }
.legend .lg.vac::before { background: #fde2e2; border: 1px solid #dc2626; }
.legend .lg.sick::before { background: #ffedd5; border: 1px solid #ea580c; }
.legend .lg.pend::before { background: #fff; border: 1.5px dashed #777; }
.legend .lg.auto::before { background: #1f1f1f; }
.legend .lg.lock::before { background: repeating-linear-gradient(45deg, #fff, #fff 3px, #f3c4c4 3px, #f3c4c4 6px); border: 1px solid #f3c4c4; }
.legend .lg.closed::before { background: #e4e6eb; }
/* เลือกประเภทวันหยุด */
.kind-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kind-pick button { border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 14px 10px; cursor: pointer; text-align: left; font-weight: 600; }
.kind-pick button small { display: block; font-weight: 400; color: var(--muted); font-size: .82rem; margin-top: 4px; }
.kind-pick button small b { color: var(--ink); }
.leave-dates { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.leave-dates span { font-size: .82rem; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; background: #fff; }
.leave-dates span.borrow { border-color: #f97316; color: #c2410c; }
.kind-pick button i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; }
.kind-pick button[data-kind=weekly] i { background: #059669; }
.kind-pick button[data-kind=vacation] i { background: #dc2626; }
.kind-pick button[data-kind=sick] i { background: #ea580c; }
.kind-pick button.on[data-kind=weekly] { border-color: #059669; background: #ecfdf5; }
.kind-pick button.on[data-kind=vacation] { border-color: #dc2626; background: #fef2f2; }
.kind-pick button.on[data-kind=sick] { border-color: #ea580c; background: #fff7ed; }
@media (max-width: 560px) { .kind-pick { grid-template-columns: 1fr; } }
.week-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.week-list span { font-size: .78rem; border: 1px solid var(--line); border-radius: 8px; padding: 3px 9px; background: #fff; }
.week-list span.full { border-color: #059669; background: #ecfdf5; color: #047857; }
/* ลาป่วย = ฟ้า · ใช้วันหยุดของเดือนอื่น = กรอบส้ม · เกินโควตาทั้งปี = กรอบแดง */
.cal .tag.sick { background: #dbeafe; color: #1d4ed8; }
.cal .d.picked.pk-sick { background: #dbeafe; border: 2px solid #2563eb; }
.kind-pick button[data-kind=sick] i { background: #2563eb; }
.kind-pick button.on[data-kind=sick] { border-color: #2563eb; background: #eff6ff; }
.legend .lg.sick::before { background: #dbeafe; border: 1px solid #2563eb; }
.cal .tag.borrow { box-shadow: inset 0 0 0 2px #f97316; }
.cal .tag.overq { box-shadow: inset 0 0 0 2px #dc2626; }
.cal .d.has-borrow, .cal .d.picked.pk-borrow { border: 2.5px solid #f97316 !important; }
.cal .d.picked.pk-borrow { background: #dcf5e8; }
.legend .lg.borrow::before { background: #dcf5e8; border: 2px solid #f97316; }

/* ===== POS: หน้าเลือกบิล / บิลที่กำลังทำ ===== */
.bp-hero { display: flex; gap: 16px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 16px; box-shadow: var(--shadow); }
.bp-hero h2 { margin: 0 0 2px; }
.bp-hero p { margin: 0; }
.bp-icon { width: 54px; height: 54px; border-radius: 16px; background: var(--ink); color: #fff; display: grid; place-items: center; flex: 0 0 auto; }
.bp-icon svg.i { width: 28px; height: 28px; }
.bp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 12px; }
.bp-new { border: 2px dashed #bdbdbd; background: transparent; border-radius: 18px; padding: 22px; cursor: pointer; font-size: 1.15rem; font-weight: 700; color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 150px; transition: all .15s; }
.bp-new:hover { border-color: var(--ink); background: #fff; }
.bp-new small { font-weight: 400; color: var(--muted); font-size: .85rem; }
.bp-plus { width: 46px; height: 46px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 1.5rem; margin-bottom: 6px; }
.bp-card { border: 1px solid var(--line); background: #fff; border-radius: 18px; padding: 16px 18px; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 3px; min-height: 150px; box-shadow: var(--shadow); transition: all .15s; }
.bp-card:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.08); }
.bp-name { font-size: 1.15rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-no { font-size: .8rem; color: var(--muted); }
.bp-meta { font-size: .82rem; color: var(--muted); margin-top: auto; }
.bp-total { font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.active-bill { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--grad); color: #fff; border-radius: var(--radius); padding: 14px 18px; margin-bottom: 14px; box-shadow: 0 10px 24px rgba(0,0,0,.18); }
.ab-left { flex: 1; min-width: 0; }
.ab-label { font-size: .78rem; opacity: .7; }
.ab-name { display: flex; align-items: center; gap: 10px; font-size: 1.45rem; font-weight: 700; line-height: 1.2; }
.ab-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ab-sub { font-size: .82rem; opacity: .75; }
.ab-actions { display: flex; gap: 8px; }
.active-bill .btn { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); color: #fff; box-shadow: none; }
.active-bill .btn:hover { background: rgba(255,255,255,.22); }
.svc-for { background: #f0f0ef; border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; font-size: .9rem; color: var(--ink-2); }
.svc-for b { color: var(--ink); }

/* เงินยืมในหน้าแก้เงินเดือน */
.loan-note { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: #f7f7f6; border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 14px; font-size: .9rem; }
.loan-note small { color: var(--muted); }

/* เมนูผู้ดูแลแบบแบ่งหมวด */
.nav-chips { display: none; }
.nav-group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.tabs button.nav-title { font-size: .8rem; font-weight: 700; color: var(--muted); letter-spacing: .02em; padding: 8px 12px; width: 100%; }
.tabs button.nav-title:hover { color: var(--ink); }
.nav-title .chev { width: 15px; height: 15px; color: inherit !important; transition: transform .15s; }
.nav-group.closed .chev { transform: rotate(-90deg); }
@media (min-width: 901px) {
  .nav-group.closed [data-tab] { display: none; }
  .nav-group.closed { margin-bottom: 2px; }
}
@media (max-width: 900px) {
  .tabs:has(.nav-chips) { display: block; overflow: hidden; flex: 0 0 100%; width: 100%; max-width: 100%; min-width: 0; }
  .nav-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 8px; }
  .tabs .nav-chips button { flex: 0 0 auto; display: inline-flex; gap: 4px; border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 14px; font-weight: 600; }
  .tabs .nav-chips button:hover { background: #fff; }
  .tabs .nav-chips button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
  .tabs button.nav-title { display: none; }
  .nav-group { display: none; flex-direction: row; overflow-x: auto; scrollbar-width: none; margin: 0; padding-bottom: 8px; }
  .nav-group.cur { display: flex; }
  .nav-group button { flex: 0 0 auto; }
}

/* ปุ่มวิธีชำระ 5 แบบ (รวมแต้ม) */
.pay-methods { grid-template-columns: repeat(5, 1fr); }
.pay-method { padding: 12px 4px; font-size: .92rem; }
@media (max-width: 520px) { .pay-methods { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .pay-row:has(#m-q) { flex-wrap: wrap; } .pay-row #m-q { flex: 1 0 100%; width: 100%; } }

/* แพ็กเกจเติมเครดิต */
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.pkg { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 14px; cursor: pointer; color: var(--ink); transition: border-color .15s; }
.pkg:hover { border-color: #bdbdbd; }
.pkg > b { font-size: 1.1rem; }
.pkg-pay { color: var(--muted); font-size: .9rem; }
.pkg small { color: var(--muted); }
.pkg.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.pkg.on .pkg-pay, .pkg.on small { color: rgba(255,255,255,.75); }

/* Privilege */
.tier { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; flex: 0 0 auto; padding: 2px 10px 2px 8px; border-radius: 99px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.tier svg.i { width: 14px; height: 14px; stroke-width: 2; }
.tier.sweetheart { background: #fde7ef; color: #be185d; }
.tier.bombshell { background: #f1e9fe; color: #7c3aed; }
.tier.queen { background: #f7ecc4; color: #8a6400; }
.tier-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.tier-card .v { font-size: 1.4rem; font-weight: 700; margin-top: 8px; }
.tier-card ul { margin: 10px 0 0; padding-left: 18px; font-size: .9rem; }
.sp-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; }
.sp-row:hover b { text-decoration: underline; }
.sp-list { max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; margin-top: 8px; }
.sp-m { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; font-weight: 400; }
.sp-m:last-child { border-bottom: 0; }
.sp-m input { width: 18px; height: 18px; flex: none; }
.sp-m .grow { min-width: 0; line-height: 1.5; }
.perk-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 0 0; font-size: .9rem; }

/* ===== หน้าโชว์บิลให้ลูกค้าดู (ปุ่ม View) ===== */
.cv-btn { margin-right: 8px; border-color: #582232; color: #582232; letter-spacing: 1px; }
body.cv-open { overflow: hidden; }
.cv-overlay { --bg: #582232; --pink: #EFD2D8; --rose: #CBABAC; --cream: #FEFDF9; --ink: #211D1D;
  position: fixed; inset: 0; z-index: 60; background: var(--cream); color: var(--ink); display: flex; flex-direction: column; animation: fade .15s ease-out; }
.cv-top { background: var(--bg); color: var(--pink); text-align: center; font-size: 13px; letter-spacing: .45em; padding: 12px 52px; display: flex; justify-content: center; gap: 18px; align-items: center; }
.cv-top span { color: var(--rose); letter-spacing: 0; }
.cv-close { position: absolute; top: 4px; right: 8px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--pink); font-size: 20px; cursor: pointer; }
.cv-close:hover { background: rgba(255,255,255,.12); }
.cv-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(240px, 36%) 1fr; }
.cv-side { background: var(--bg); color: var(--pink); padding: 28px 28px 22px; display: flex; flex-direction: column; gap: 22px; border-top: 1px solid #6E3343; }
.cv-hi span { display: block; font-size: 14px; color: var(--rose); }
.cv-hi b { display: block; font-size: 26px; font-weight: 600; color: var(--cream); line-height: 1.25; overflow-wrap: anywhere; }
.cv-mem { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.cv-tier { font-size: 12px; letter-spacing: .2em; border: 1px solid var(--rose); border-radius: 99px; padding: 3px 12px; text-transform: uppercase; }
.cv-pts { font-size: 38px; font-weight: 600; color: var(--cream); line-height: 1.1; margin-top: 6px; }
.cv-pts small { font-size: 14px; font-weight: 400; color: var(--rose); }
.cv-earn { font-size: 13px; color: var(--rose); }
.cv-join { font-size: 20px; color: var(--cream); line-height: 1.4; margin-top: 6px; }
.cv-join b { color: var(--pink); }
.cv-brand { margin-top: auto; }
.cv-brand img { width: 130px; max-width: 70%; filter: brightness(0) invert(.86) sepia(.25) hue-rotate(300deg); opacity: .9; }
.cv-main { padding: 28px 36px 24px; display: flex; flex-direction: column; min-height: 0; }
.cv-h { font-size: 13px; letter-spacing: .3em; color: var(--bg); border-bottom: 1.5px solid var(--bg); padding-bottom: 10px; }
.cv-list { flex: 1; overflow: auto; padding: 4px 0; }
.cv-row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid #EFE4E2; font-size: 19px; }
.cv-nm small { display: block; font-size: 13px; color: #8C6B70; margin-top: 2px; }
.cv-q { color: #8C6B70; }
.cv-amt { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cv-sep { height: 6px; }
.cv-off, .cv-sub { border-bottom: 0; padding: 6px 0; font-size: 16px; }
.cv-off { color: var(--bg); }
.cv-sub { color: #8C6B70; }
.cv-total { background: #F6ECEC; border-radius: 14px; padding: 16px 20px; display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; }
.cv-total span { font-size: 15px; color: #8C6B70; }
.cv-total b { font-size: 44px; font-weight: 600; color: var(--bg); font-variant-numeric: tabular-nums; }
/* มือถือ / iPad แนวตั้ง: แถบเบอร์กันดีย่อขึ้นไปด้านบน */
@media (max-width: 760px), (orientation: portrait) and (max-width: 1100px) {
  .cv-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .cv-side { flex-direction: row; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; padding: 16px 20px 18px; gap: 10px 16px; }
  .cv-hi b { font-size: 21px; }
  .cv-pts { font-size: 26px; margin-top: 2px; }
  .cv-join { font-size: 16px; }
  .cv-brand { display: none; }
  .cv-main { padding: 18px 20px 16px; }
  .cv-row { font-size: 17px; padding: 12px 0; }
  .cv-total b { font-size: 36px; }
}

/* ดอกไม้บนแถบเบอร์กันดีของหน้า View (สุ่มทุกครั้งที่เปิด) */
.cv-side { position: relative; overflow: hidden; }
.cv-side > :not(.cv-fl) { position: relative; z-index: 1; }
.cv-fl { position: absolute; z-index: 0; pointer-events: none; filter: drop-shadow(0 10px 18px rgba(0,0,0,.3)); }
.cv-fl-anemone { width: 82%; right: -22%; bottom: -12%; transform: rotate(-12deg); }
.cv-fl-lotus { width: 50%; right: -2%; bottom: -16%; transform: rotate(-6deg); }
.cv-fl-pitcher { width: 52%; right: -4%; bottom: -12%; }
.cv-fl-orchid { height: 50%; width: auto; max-width: 78%; left: 0; bottom: 0; }
.cv-side.fl-left .cv-brand { text-align: right; }
.cv-fl-cymbidium { height: 58%; width: auto; max-width: 62%; right: 6%; bottom: -3%; }
.cv-fl-cymbidium2 { height: 60%; width: auto; max-width: 56%; right: 8%; bottom: -3%; }
@media (max-width: 760px), (orientation: portrait) and (max-width: 1100px) {
  .cv-fl { display: none; }
}

/* เมนูผู้ดูแล: หัวหมวดเป็นป้ายชื่อ กางตลอด */
.tabs .nav-label { cursor: default; pointer-events: none; font-size: .8rem; font-weight: 700; color: var(--muted); letter-spacing: .02em; padding: 8px 12px 4px; }
@media (max-width: 900px) { .tabs .nav-label { display: none; } }
.set-tabs { margin: 0 0 14px; }
.set-tabs + .card, .set-tabs ~ .card { margin-top: 0; }
tr.hl td { background: #fff8e6; }

/* ===== ธีมเบอร์กันดี (แบบ C): แถบแบรนด์บนสุด + จุดเน้นสีเบอร์กันดี ===== */
.brand-bar { position: sticky; top: 0; z-index: 8; height: var(--bar-h); background: #582232; color: #EFD2D8; display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 12px; }
.brand-bar .nm { letter-spacing: .4em; margin-right: -.4em; }
.brand-bar .md { color: #CBABAC; }
.brand-bar .md::before { content: '·'; margin-right: 10px; }
.brand-bar .st { color: #CBABAC; }
.side { top: var(--bar-h); height: calc(100vh - var(--bar-h)); }
@media (max-width: 900px) { .side { top: var(--bar-h); height: auto; } .brand-bar .md { display: none; } }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 4px rgba(88, 34, 50, .16); }
.btn.primary, .pay-method.on { box-shadow: 0 4px 12px rgba(88, 34, 50, .28); }
.open-chip.on { box-shadow: 0 0 0 3px rgba(88, 34, 50, .16); }
.tabs button.active, .tabs .nav-chips button.on, .cat-tabs button.on, .cat-item.on, .variant:hover, .tip-methods button.on, .seg2 button.on,
.quick-cash button.on, .disc-mode button.on, .pkg.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tabs button.active svg.i { color: #fff; }
.choice .ic, .avatar, .bp-icon, .bp-plus { background: var(--accent); color: #fff; }
.rp-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.choice:hover, .bp-new:hover, .bp-card:hover, .opt-chip.on { border-color: var(--accent); }
.month-tile.now { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.svc .p { color: var(--accent); }

.bad-txt { color: var(--bad); font-weight: 600; }

/* ===== ข้อควรระวังลูกค้า + แจ้งเตือนช่าง ===== */
.m-alert { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: #FCEBEB; color: #791F1F; font-size: .9rem; font-weight: 600; }
.m-alert svg.i { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.notice { padding: 10px 0; border-top: 1px solid var(--line); }
.notice:first-of-type { border-top: 0; }
.notice.unread { background: var(--accent-soft); margin: 0 -12px; padding: 10px 12px; border-radius: 10px; }
.notice-last { margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: rgba(0,0,0,.04); }

/* ===== หน้าต่างการจอง (สแกน QR) — สไตล์เดียวกับเว็บจองคิว ===== */
.bp-scan .bp-plus { background: var(--accent, #582232); }
.bp-scan .bp-plus svg.i { width: 24px; height: 24px; stroke: #fff; }
.bk-ov { --bk-body: "DM Sans","Noto Sans Thai",sans-serif; --bk-disp: "Libre Caslon Display","Noto Sans Thai",serif; --bk-wine: #561b2c; --bk-plum: #3f202d; --bk-mauve: #967383; --bk-line: #e8e1e3; --bk-blush: #f7eff2; --bk-rose: #cbb5be;
  position: fixed; inset: 0; z-index: 19; background: rgba(40, 18, 27, .55); backdrop-filter: blur(2px); display: grid; place-items: center; padding: 16px; animation: fade .15s ease-out; font-family: var(--bk-body); color: #111; }
.bk-box { width: min(780px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #faf9fa; border-radius: 26px; box-shadow: 0 40px 90px rgba(20,6,12,.45); }
.bk-top { padding: 20px 28px; display: flex; align-items: center; border-bottom: 1px solid var(--bk-line); gap: 12px; }
.bk-brand { font-family: var(--bk-disp); font-size: 20px; letter-spacing: 1.6px; }
.bk-ref { margin-left: auto; font-size: 11px; letter-spacing: 1.8px; color: var(--bk-mauve); text-align: right; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-x { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--bk-line); background: #fff; color: var(--bk-mauve); font-size: 15px; cursor: pointer; flex: none; }
.bk-cols { display: grid; grid-template-columns: 1.15fr 1fr; }
.bk-l { padding: 22px 28px 26px; border-right: 1px solid var(--bk-line); }
.bk-r { padding: 22px 28px 26px; background: #fff; display: flex; flex-direction: column; }
.bk-eyebrow { font-size: 10.5px; font-weight: 500; letter-spacing: 2.4px; color: var(--bk-mauve); text-transform: uppercase; }
.bk-name { display: flex; align-items: baseline; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.bk-name h1 { font-family: "Noto Sans Thai", var(--bk-body); font-weight: 500; font-size: 30px; color: var(--bk-plum); margin: 0; line-height: 1.15; }
.bk-tier { font-family: var(--bk-disp); font-size: 16px; color: var(--bk-wine); }
.bk-meta { font-size: 13px; color: #6b6b6b; margin-top: 4px; }
.bk-prev { display: inline-block; margin-top: 10px; font-size: 12.5px; color: var(--bk-wine); border-bottom: 1px solid var(--bk-rose); padding-bottom: 1px; text-decoration: none; }
.bk-list { margin-top: 18px; border-top: 1px solid var(--bk-line); }
.bk-li { display: flex; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--bk-line); }
.bk-li .k { width: 76px; flex: none; font-size: 10.5px; letter-spacing: 2px; color: var(--bk-mauve); text-transform: uppercase; }
.bk-li .v { flex: 1; font-size: 14.5px; }
.bk-li .v small { display: block; font-size: 12px; color: #6b6b6b; margin-top: 2px; }
.bk-li select { margin-top: 4px; width: 100%; font-family: inherit; }
.bk-warn { color: #9b2c3d; font-weight: 500; }
.bk-dep { display: flex; align-items: flex-end; justify-content: space-between; padding: 18px 20px; border-radius: 18px; background: var(--bk-blush); }
.bk-dep .lbl { font-size: 12.5px; color: #714e60; }
.bk-dep .lbl small { display: block; color: var(--bk-mauve); font-size: 11px; margin-top: 2px; }
.bk-dep .amt { font-family: var(--bk-disp); font-size: 44px; line-height: 1; color: var(--bk-plum); }
.bk-care { margin-top: 14px; padding: 12px 16px; border-left: 2px solid var(--bk-wine); background: #faf6f7; font-size: 13.5px; color: var(--bk-wine); }
.bk-care b { display: block; font-size: 10.5px; letter-spacing: 2px; font-weight: 500; color: var(--bk-mauve); margin-bottom: 2px; }
.bk-ask { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: #fff7e8; border: 1px solid #f1dcb3; font-size: 13.5px; color: #6b4a12; }
.bk-ask b { display: block; margin-bottom: 4px; font-weight: 600; }
.bk-ask select { width: 100%; margin-top: 6px; }
.bk-ask-btns { display: flex; gap: 8px; margin-top: 10px; }
.bk-ask-btns .bk-btn { flex: 1; padding: 10px; }
.bk-note { font-size: 13.5px; line-height: 1.6; color: #714e60; margin-top: 14px; }
.bk-note.bad { color: #9b2c3d; }
.bk-grow { flex: 1; min-height: 14px; }
.bk-cta { display: flex; align-items: center; justify-content: space-between; width: 100%; text-align: left; background: var(--bk-wine); color: #fff; border: 0; border-radius: 10px; padding: 16px 20px; font-size: 16px; font-family: inherit; cursor: pointer; }
.bk-cta small { display: block; font-size: 11.5px; opacity: .75; margin-top: 2px; }
.bk-cta .ar { font-size: 20px; }
.bk-cta:disabled { opacity: .45; cursor: not-allowed; }
.bk-sec { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.bk-sec.one { grid-template-columns: 1fr; }
.bk-btn { text-align: center; padding: 13px; border-radius: 10px; border: 1px solid var(--bk-line); background: #fff; color: var(--bk-plum); font-size: 14px; font-family: inherit; cursor: pointer; }
.bk-btn:hover:not(:disabled) { border-color: var(--bk-rose); }
.bk-btn:disabled { opacity: .45; cursor: not-allowed; }
.bk-btn.dark { background: var(--bk-plum); color: #fff; border-color: var(--bk-plum); }
.bk-kbd { margin-top: 12px; text-align: center; font-size: 11px; color: var(--bk-mauve); letter-spacing: .5px; }
.bk-kbd span { border: 1px solid var(--bk-line); border-radius: 5px; padding: 1px 6px; margin: 0 3px; background: #fff; }
.bk-status { display: flex; align-items: center; gap: 14px; padding: 16px 28px; border-bottom: 1px solid var(--bk-line); }
.bk-status .big { font-family: var(--bk-disp); font-size: 36px; line-height: 1; }
.bk-status .t { font-size: 15.5px; font-weight: 500; }
.bk-status .t small { display: block; font-weight: 400; font-size: 12.5px; color: #6b6b6b; margin-top: 2px; }
@media (max-width: 720px) {
  .bk-cols { grid-template-columns: 1fr; }
  .bk-l { border-right: 0; border-bottom: 1px solid var(--bk-line); padding: 18px 20px; }
  .bk-r { padding: 18px 20px 22px; }
  .bk-top, .bk-status { padding: 16px 20px; }
  .bk-kbd { display: none; }
}

/* ปุ่มลบข้อมูล (รีเซ็ต) */
.btn.danger { background: #B42318; border-color: #B42318; color: #fff; }
.btn.danger:hover { background: #912018; }
