/* DEE / COZY v2 — the one stylesheet. No !important. Sections: base, documents (print). */

/* ---------- fonts ---------- */
/* Screens: Noto Sans Thai (variable weight 100–900). Printed documents: TH Sarabun New. */
@font-face { font-family: "Noto Sans Thai"; src: url("fonts/NotoSansThai-Variable.ttf") format("truetype"); font-weight: 100 900; font-stretch: 62.5% 100%; font-display: swap; }
@font-face { font-family: "TH Sarabun New"; src: url("fonts/THSarabunNew-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "TH Sarabun New"; src: url("fonts/THSarabunNew-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

/* ---------- base ---------- */
:root {
  --ink: #1d1d1f;
  --muted: #6b6b70;
  --line: #1d1d1f;
  --soft: #e9e9ec;
  --void: #b71c1c;
  --font: "Noto Sans Thai", Tahoma, sans-serif;
  --doc-font: "TH Sarabun New", "Noto Sans Thai", Tahoma, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); color: var(--ink); }

/* ---------- documents ---------- */
body.print { background: #8a8a8f; padding: 12px 0; }
.sheet { position: relative; background: #fff; margin: 0 auto 12px; padding: 5mm 8mm 4mm; display: flex; flex-direction: column; gap: 1.5mm; font-family: var(--doc-font); font-size: 15pt; line-height: 1.2; overflow: hidden; }
.sheet.a5 { width: 210mm; height: 148mm; }
.sheet.a4 { width: 210mm; min-height: 297mm; font-size: 17pt; }
.sheet.a4l { width: 297mm; min-height: 210mm; font-size: 16pt; }

.doc-head { display: flex; align-items: flex-start; gap: 3mm; }
.doc-head .logo { width: 16mm; height: 17mm; object-fit: contain; }
.doc-head .issuer span { font-size: .9em; }
.doc-head .issuer { flex: 1; display: flex; flex-direction: column; gap: 0; font-size: .88em; }
.doc-head .issuer b { font-size: 1.2em; }
.doc-title { width: 52mm; text-align: center; display: flex; flex-direction: column; align-items: center; background: var(--soft); padding: 1mm 1.5mm; line-height: 1.1; }
.doc-title b { font-size: 1em; white-space: nowrap; }
.a4 .doc-title, .a4l .doc-title { width: 58mm; }
.doc-title em { font-style: normal; font-weight: 700; margin-top: 1mm; }
.doc-meta { display: flex; justify-content: space-between; font-size: .9em; }

.payer p, .facts p { margin: 0; }
.payer span, .facts span { display: inline-block; min-width: 26mm; color: var(--muted); }
.facts { display: grid; grid-template-columns: 1fr 1fr; column-gap: 6mm; }
.facts span { min-width: 34mm; }

table.lines { width: 100%; border-collapse: collapse; }
table.lines th { background: var(--soft); font-weight: 700; font-size: .9em; line-height: 1.15; }
table.lines th, table.lines td { border: .2mm solid var(--line); padding: .8mm 1.2mm .2mm; vertical-align: middle; }
table.lines tbody td { border-top: 0; border-bottom: 0; }
table.lines tbody tr:last-child td { border-bottom: .2mm solid var(--line); }
table.lines tr.blank td { height: 5.6mm; }
.num { text-align: right; white-space: nowrap; }
.receipt table.lines td:nth-child(n+5):nth-child(-n+6) { text-align: center; }

.sums { display: flex; justify-content: space-between; align-items: flex-start; gap: 4mm; }
.sums .words { flex: 1; margin: 1mm 0 0; }
.sums table { border-collapse: collapse; width: 66mm; border: .2mm solid var(--line); }
.sums td { padding: .3mm 1.5mm 0; }
.sums tr.total td { font-weight: 700; border-top: .2mm solid var(--line); }

.note { margin: 0; font-size: .9em; }
.doc-foot { display: flex; gap: 6mm; align-items: flex-end; margin-top: auto; font-size: .9em; }
.doc-foot .sign { margin-left: auto; text-align: center; }
.ref { margin: 0; text-align: center; font-size: .75em; color: var(--muted); }

.confirmation { font-size: 14.5pt; }
.conf-body { display: flex; gap: 4mm; min-height: 0; flex: 1; }
.conf-main { flex: 1; display: flex; flex-direction: column; gap: 2mm; min-width: 0; }
.confirmation .facts span { min-width: 27mm; margin-right: 1.5mm; }
.sheet.a5.confirmation { height: auto; min-height: 148mm; overflow: visible; }
.payments { margin-top: 1mm; }
.slips { width: 44mm; display: flex; flex-direction: column; gap: 1.5mm; min-height: 0; }
.slips h3 { margin: 0; font-size: 1em; }
.slips figure { margin: 0; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.slips img { width: 100%; flex: 1; min-height: 0; object-fit: contain; border: .2mm solid var(--soft); }
.slips figcaption { font-size: .85em; text-align: center; }

.voided { color: var(--void); }
.void-stamp { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 48pt; font-weight: 700; color: var(--void); opacity: .8; transform: rotate(-14deg); pointer-events: none; }
.void-stamp small { font-size: 16pt; }

@page { margin: 0; }
@page a5 { size: A5 landscape; margin: 0; }
@page a4 { size: A4; margin: 0; }
@page a4l { size: A4 landscape; margin: 0; }
.sheet.a5 { page: a5; }
.sheet.a4 { page: a4; }
.sheet.a4l { page: a4l; }
@media print {
  body.print { background: none; padding: 0; }
  .sheet { margin: 0; break-after: page; }
  .sheet:last-child { break-after: auto; }
}

/* quotation */
.quotation { font-size: 14pt; line-height: 1.2; color: #172c25; }
.quote-title { text-align: right; display: flex; flex-direction: column; }
.quote-title h1 { margin: 0; font-size: 22pt; line-height: 1; }
.quote-title b { font-size: 14pt; }
.quote-title .hotel { font-size: 16pt; }
.quotation .issuer { font-size: 10.5pt; align-self: center; }
.quote-fields p { display: grid; grid-template-columns: 40mm 1fr; gap: 2mm; margin: .3mm 0; font-size: 13pt; }
.quote-lines th, .quote-lines td { text-align: center; border-color: #465951; }
.quote-lines thead th, .quote-lines tfoot th { background: #eef3ef; }
.quote-lines th small { display: block; font-weight: 400; }
.quote-lines tbody td:first-child { text-align: left; }
.quote-lines tbody tr:last-child td { border-bottom: .2mm solid #465951; }
.quote-lines tfoot td, .quote-lines tfoot th { border: .2mm solid #465951; }
.quote-lines tfoot .empty { border: 0; }
.terms b { display: block; }
.terms p { margin: 0; white-space: pre-wrap; }
.quote-end { display: flex; justify-content: space-between; align-items: flex-end; margin-top: auto; }
.pay { display: flex; gap: 4mm; align-items: center; }
.pay-qr { width: 42mm; }
.pay p { margin: 0; }
.quote-end .sign { text-align: center; }
.sign-line { display: block; width: 55mm; border-bottom: .2mm dotted var(--ink); height: 12mm; margin-bottom: 1mm; }

/* ---------- screens ---------- */
body.app { background: #f4f5f2; font-size: 15px; line-height: 1.45; }
button, input, select, textarea { font: inherit; }
.muted { color: var(--muted); }
.btn { border: 1px solid #c9ccc4; background: #fff; border-radius: 8px; padding: 6px 12px; cursor: pointer; color: var(--ink); }
.btn:hover { background: #f0f1ec; }
.btn.primary { background: #12302f; border-color: #12302f; color: #fff; }
.btn.primary:hover { background: #1d4544; }
.btn.danger { color: var(--void); border-color: #e3b9b9; }
.btn.small { padding: 2px 8px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: wait; }
.field { display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.field > span { color: var(--muted); }
.field input, .field select, .field textarea, table.edit input, table.edit select { border: 1px solid #c9ccc4; border-radius: 6px; padding: 6px 8px; background: #fff; width: 100%; }
.check { display: flex; align-items: center; gap: 6px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; margin-bottom: 10px; }
.span2 { grid-column: span 2; }
.span3 { grid-column: span 3; }
fieldset { border: 1px solid #dcdfd6; border-radius: 8px; }
.dlg-error { color: var(--void); min-height: 1.2em; margin: 6px 0; }

.login { max-width: 340px; margin: 10vh auto; background: #fff; padding: 28px; border-radius: 14px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 6px 30px #0001; }
.login h1 { margin: 0; font-size: 22px; text-align: center; }
.login-logo { width: 72px; align-self: center; }

.top { display: flex; align-items: center; gap: 14px; padding: 8px 16px; background: #fff; border-bottom: 1px solid #e2e4dd; position: sticky; top: 0; z-index: 5; }
.top-logo { width: 34px; height: 34px; object-fit: contain; }
.menu { display: flex; gap: 4px; flex: 1; }
.menu a { padding: 6px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.menu a.on { background: #12302f; color: #fff; }
.who { color: var(--muted); }
#page { padding: 14px 16px; }

.board-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.board-bar input { border: 1px solid #c9ccc4; border-radius: 6px; padding: 5px; }
.legend { display: flex; align-items: center; gap: 6px; margin-left: auto; color: var(--muted); }
.legend i { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }
.board { background: #fff; border: 1px solid #e2e4dd; border-radius: 10px; overflow: auto; max-height: calc(100vh - 130px); }
.brow { display: grid; grid-template-columns: 96px repeat(var(--days), minmax(62px, 1fr)); grid-auto-rows: 44px; border-bottom: 1px solid #eef0ea; }
.brow.head { position: sticky; top: 0; background: #fff; z-index: 3; grid-auto-rows: 40px; }
.brow .room { grid-column: 1; grid-row: 1; position: sticky; left: 0; z-index: 2; background: #fff; border: 0; border-right: 1px solid #e2e4dd; text-align: left; padding: 3px 8px; display: flex; flex-direction: column; justify-content: center; cursor: pointer; }
.brow .room small, .brow .day small, .stay small { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.brow.closed .room { background: repeating-linear-gradient(45deg, #fff, #fff 6px, #f3e7e7 6px, #f3e7e7 12px); }
.brow .day { grid-row: 1; text-align: center; display: flex; flex-direction: column; justify-content: center; border-left: 1px solid #f0f1ec; }
.day.weekend { background: #fafaf6; }
.day.today, .cell.today { background: #fff7e8; }
.cell { grid-row: 1; border: 0; border-left: 1px solid #f0f1ec; background: transparent; cursor: pointer; }
.cell:hover { background: #eef5f1; }
.stay { grid-row: 1; z-index: 1; margin: 4px 2px; border-radius: 7px; border: 0; padding: 2px 8px; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: flex; flex-direction: column; justify-content: center; cursor: pointer; }
.stay b { overflow: hidden; text-overflow: ellipsis; font-weight: 600; font-size: 13px; }
.st.reserved { background: #dbe8f7; }
.st.inhouse { background: #cfeedd; }
.st.out { background: #e6e6e3; }

dialog.dlg { border: 0; border-radius: 14px; padding: 0; width: min(980px, 96vw); max-height: 92vh; box-shadow: 0 20px 60px #0003; }
dialog.dlg::backdrop { background: #0005; }
dialog.dlg form { display: flex; flex-direction: column; max-height: 92vh; }
dialog.dlg header, .panel header { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-bottom: 1px solid #eceee8; }
dialog.dlg h2, .panel h2 { margin: 0; font-size: 19px; }
.dlg-body { padding: 14px 18px; overflow: auto; }
dialog.dlg .dlg-error { padding: 0 18px; }
dialog.dlg footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid #eceee8; }
.x { border: 0; background: none; font-size: 24px; cursor: pointer; line-height: 1; }
.picks { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }
.pick { text-align: left; border: 1px solid #e2e4dd; background: #fff; border-radius: 6px; padding: 6px 8px; cursor: pointer; }
.chosen { font-weight: 600; margin: 6px 0; }
.slip-preview { max-width: 160px; max-height: 200px; display: block; margin: 8px 0; }
.slip-preview:not([src]) { display: none; }

.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: #fff; box-shadow: -10px 0 40px #0002; z-index: 10; overflow: auto; padding-bottom: 24px; }
.panel > :not(header) { margin-left: 18px; margin-right: 18px; }
.panel header p { margin: 2px 0 0; color: var(--muted); }
.panel dl.sums { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; background: #f6f7f3; padding: 10px 14px; border-radius: 10px; }
.panel dl.sums dt, .panel dl.sums dd { margin: 0; }
.panel dl.sums dd { text-align: right; font-variant-numeric: tabular-nums; }
.panel .due { font-weight: 700; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 18px; }
.panel h3 { font-size: 15px; margin: 16px 0 4px; }
table.mini, table.list { border-collapse: collapse; width: 100%; font-size: 14px; }
table.mini td, table.list td, table.list th { border-bottom: 1px solid #eef0ea; padding: 4px 6px; }
table.list { background: #fff; border-radius: 10px; }
table.list th { text-align: left; color: var(--muted); font-weight: 500; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

table.edit { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 14px; }
table.edit th { text-align: left; color: var(--muted); font-weight: 500; padding: 2px 4px; }
table.edit td { padding: 2px 3px; }
.receipt-editor .row { display: flex; justify-content: space-between; align-items: center; }
.draft + .draft { border-top: 2px dashed #e2e4dd; margin-top: 10px; }
#page h1 { font-size: 22px; margin: 4px 0 10px; }
#page > .btn { margin-top: 10px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #12302f; color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 50; box-shadow: 0 8px 30px #0003; }
.toast.error { background: var(--void); }
.print-frame { position: fixed; width: 0; height: 0; border: 0; right: 0; bottom: 0; }
.receipt-editor table.edit td:first-child { width: 28%; }
.receipt-editor table.edit td:nth-child(2) { width: 13%; }
.receipt-editor table.edit td:nth-child(5) { width: 7%; }
.receipt-editor table.edit td:nth-child(6), .receipt-editor table.edit td:nth-child(7) { width: 11%; }

/* board: floors, money state, drag, right-click menu */
.bgroup { position: sticky; left: 0; padding: 4px 10px; background: #eef1ea; font-weight: 600; font-size: 13px; color: #3c4a40; border-bottom: 1px solid #e2e4dd; }
.legend .pay { width: 9px; height: 9px; border-radius: 50%; }
.pay.paid, .pay-paid .dot { background: #1f9d55; }
.pay.deposit, .pay-deposit .dot { background: #e0a100; }
.pay.unpaid, .pay-unpaid .dot { background: #d64545; }
.stay .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.stay.st.out .dot { display: none; }
.stay { position: relative; touch-action: none; user-select: none; }
.stay .owe { position: absolute; right: 4px; top: 3px; background: #d64545; color: #fff; font-size: 10px; padding: 0 5px; border-radius: 6px; }
.hint { font-size: 12px; }
.stay.lifted { opacity: .45; outline: 2px dashed #12302f; }
.board.dragging, .board.dragging * { cursor: grabbing; }
.cell.drop-ok { background: #bfe8cc; }
.cell.drop-bad { background: #f6c9c9; }
.drop-label { position: fixed; z-index: 60; pointer-events: none; padding: 5px 10px; border-radius: 8px; font-size: 13px; color: #fff; max-width: 360px; box-shadow: 0 6px 20px #0003; }
.drop-label.ok { background: #1d6b45; }
.drop-label.bad { background: #b3261e; }
.ctx { position: fixed; z-index: 40; background: #fff; border-radius: 10px; box-shadow: 0 10px 34px #0003; padding: 6px; min-width: 210px; display: flex; flex-direction: column; }
.ctx p { margin: 2px 8px 6px; font-size: 12px; color: var(--muted); }
.ctx button { text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.ctx button:hover, .ctx button:focus { background: #eef3ef; outline: none; }
.ctx button.danger { color: var(--void); }
table.confirm th { text-align: left; color: var(--muted); font-weight: 500; width: 90px; }

/* booking panel header, like the old booking card */
.panel { width: min(860px, 100vw); }
.bhead { display: grid; grid-template-columns: 70px minmax(180px, 1.2fr) 1fr; grid-template-areas: "room guest doc" "steps steps doc" "chips chips chips"; gap: 12px 16px; padding: 14px 0; border-bottom: 1px solid #eceee8; }
.broom { grid-area: room; text-align: center; align-self: center; }
.broom span { display: block; color: var(--muted); }
.broom b { font-size: 40px; line-height: 1; }
.bguest { grid-area: guest; }
.bguest h2 { margin: 0 0 2px; font-size: 21px; }
.bguest p { margin: 1px 0; }
.bguest .strong { font-weight: 700; }
.channel { display: inline-block; border: 2px solid #c9393c; border-radius: 8px; padding: 0 10px; font-weight: 600; }
.steps { grid-area: steps; display: grid; grid-template-columns: repeat(3, 1fr); }
.step { display: flex; flex-direction: column; padding: 0 12px; border-left: 1px solid #dcdfd6; }
.step b { font-size: 17px; }
.step span:first-child { color: var(--muted); }
.ota-doc { grid-area: doc; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 1px solid #dcdfd6; border-radius: 12px; padding: 8px; text-decoration: none; color: var(--ink); box-shadow: 0 3px 0 #e6e8e2; max-width: 170px; justify-self: end; }
.ota-doc img { width: 120px; height: 140px; object-fit: cover; object-position: top; border: 1px solid #eee; }
.ota-doc .pdf { width: 120px; height: 140px; display: grid; place-items: center; background: #f4f5f2; font-weight: 700; color: #b3261e; }
.chips { grid-area: chips; display: flex; flex-wrap: wrap; gap: 0; }
.chips span { padding: 2px 16px; border-left: 1px solid #dcdfd6; }
.chips span:first-child { border-left: 0; padding-left: 0; }
.panel header p { margin: 0; color: var(--muted); }
.month-receipts { font-size: 12.5pt; }
.month-receipts .void-row td { color: var(--void); }
.month-receipts tfoot th { background: var(--soft); border: .2mm solid var(--line); }
.payer .branch { margin-left: 8mm; color: var(--ink); min-width: 0; }

/* receipt workspace: the paper with blue fill-in boxes, like the old editor */
.rbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #fff; padding: 10px 12px; border-radius: 12px; margin-bottom: 8px; }
.rbar > b { margin-right: auto; font-size: 17px; }
.rbar .grow { flex: 1; }
.rnote { font-size: 13px; margin: 6px 4px 10px; }
.drafts { background: #fff; border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; }
.drafts summary { cursor: pointer; font-weight: 600; }
.row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.card { background: #fff; border-radius: 12px; padding: 14px; }
.tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.stage { zoom: 1.45; display: flex; justify-content: center; padding: 4px 0 10px; }
.stage-tools { display: flex; gap: 12px; align-items: center; justify-content: center; margin-bottom: 10px; }
.sheet.editing { height: auto; min-height: 148mm; overflow: visible; box-shadow: 0 2px 14px #0002; margin: 0; }
.ink { border: 0; background: #e3effa; font: inherit; color: inherit; padding: 0 1mm; border-radius: .8mm; width: 100%; min-width: 0; line-height: inherit; }
.ink:focus { outline: .35mm solid #3b82c4; background: #f1f7fd; }
.ink.bad { background: #fbe0e0; }
.ink::placeholder { color: #9aa8b5; }
.ink.num { text-align: right; }
.ink.date { width: 24mm; text-align: center; }
.editing .doc-meta .ink.date { width: 26mm; }
.editing .no { display: inline-block; min-width: 24mm; text-align: right; font-weight: 700; }
.editing .payer p { display: flex; align-items: center; gap: 1mm; margin: 0 0 .6mm; }
.editing .payer p > span:first-child { flex: none; }
.editing .payer .with-suggest { flex: 1; }
.editing .payer .ink.tax { width: 40mm; }
.editing .payer p:has(.tax) .with-suggest { flex: none; }
.editing .branch-label { margin-left: 6mm; min-width: 0; color: var(--ink); }
.editing table.lines td { position: relative; padding: .5mm .8mm; }
.editing .pair { display: flex; align-items: center; gap: 1mm; }
.editing .ink.room { width: 13mm; flex: none; }
.editing .room-word { color: var(--muted); font-size: .85em; flex: none; }
.editing small.pair { margin-top: .5mm; font-size: .8em; color: var(--muted); justify-content: flex-end; }
.editing .ink.disc { width: 17mm; flex: none; }
.editing tr.blank { cursor: pointer; }
.editing tr.blank:hover td { background: #f3f8fd; }
.editing .del { position: absolute; right: -6mm; top: .6mm; width: 4.5mm; height: 4.5mm; border: 0; border-radius: 50%; background: #e9e9e9; color: #555; font-size: 3mm; line-height: 1; cursor: pointer; opacity: 0; }
.editing tr.line:hover .del, .editing .del:focus { opacity: 1; }
.editing .note { display: flex; align-items: center; gap: 1mm; }
.editing .doc-foot .ink.short { width: 32mm; }
.editing .sums .words { font-weight: 600; }
.with-suggest { position: relative; display: block; }
.suggest { zoom: .7; }
.hist { max-width: 1100px; margin: 10px auto; }
.with-suggest { position: relative; flex: 1; display: block; }
.suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: #fff; box-shadow: 0 8px 24px #0002; border-radius: 8px; display: flex; flex-direction: column; font-family: var(--font); font-size: 14px; }
.suggest:empty { display: none; }
.suggest button { text-align: left; border: 0; background: none; padding: 7px 10px; cursor: pointer; display: flex; flex-direction: column; }
.suggest button:hover, .suggest button:focus { background: #e8f3fc; }
.suggest small { color: var(--muted); }
.editing .branch-label, .editing .note, .editing .doc-foot span { white-space: nowrap; }
.editing .payer span.branch-label { min-width: 0; }
.editing table.lines th:nth-child(1) { width: 29%; }
.editing table.lines th:nth-child(2) { width: 13%; }
.editing table.lines th:nth-child(3) { width: 7%; }
.editing table.lines th:nth-child(4) { width: 14%; }
.editing table.lines th:nth-child(7) { width: 13%; }

/* booking popup (replaces the side panel) */
dialog.booking-pop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; margin: auto; height: fit-content; width: min(1000px, 96vw); max-height: 94vh; padding: 0; border: 0; border-radius: 18px; box-shadow: 0 30px 80px #0004; overflow: auto; background: #fff; }
dialog.booking-pop::backdrop { background: #0f1f1c55; backdrop-filter: blur(3px); }
.booking-pop .pop-card > * { margin-left: 20px; margin-right: 20px; }
.booking-pop .pop-card > header { margin: 0; padding: 14px 20px 10px; border-bottom: 1px solid #eceee8; display: flex; justify-content: space-between; align-items: flex-start; position: sticky; top: 0; background: #fff; z-index: 2; }
.booking-pop header small { color: var(--muted); }
.booking-pop header h2 { margin: 0; font-size: 19px; }
.booking-pop .x { width: 34px; height: 34px; border-radius: 50%; border: 1px solid #dcdfd6; background: #fff; }
.track { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); padding: 7px 0; margin-top: 14px; margin-bottom: 12px; border: 1px solid #e2e4dd; border-radius: 10px; background: #fafbf8; text-align: center; font-size: 14px; color: var(--muted); }
.track li.done { color: var(--ink); font-weight: 700; }
.banner { margin-top: 14px; padding: 8px 12px; border-radius: 10px; background: #fbe9e9; color: var(--void); font-weight: 700; text-align: center; }
.booking-pop .bhead { border: 1px solid #e2e4dd; border-radius: 12px; padding: 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.tile { border: 1px solid #e2e4dd; border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; }
.tile span { font-size: 12px; color: var(--muted); }
.tile b { font-size: 20px; font-variant-numeric: tabular-nums; }
.tile.due b { color: var(--void); }
.tile.ok b { color: #1d6b45; }
.booking-pop .actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; margin-bottom: 12px; }
.booking-pop .actions .btn { border-radius: 999px; padding: 9px 10px; box-shadow: 0 2px 0 #e6e8e2; }
.log { list-style: none; border: 1px solid #e2e4dd; border-radius: 10px; padding: 8px 12px; font-size: 14px; margin-top: 0; }
.log li::before { content: '· '; }
details.money { border: 1px solid #e2e4dd; border-radius: 12px; padding: 10px 14px; margin-top: 4px; }
details.money summary { cursor: pointer; font-weight: 600; }
details.money dl.sums { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 10px 0 0; background: none; padding: 0; }
details.money dl.sums dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
details.money .due { font-weight: 700; font-size: 17px; border-top: 1px solid #e2e4dd; padding-top: 6px; }
.note-box h3 { font-size: 15px; margin: 14px 0 2px; }
.note-box p { margin: 0; }
.booking-pop .pop-card > footer { display: flex; justify-content: flex-end; gap: 8px; margin: 16px 0 0; padding: 12px 20px; border-top: 1px solid #eceee8; }
.booking-pop .bhead { grid-template-columns: 64px minmax(200px, 1fr) minmax(420px, 2fr) auto; grid-template-areas: "room guest steps doc" "chips chips chips doc"; }
.booking-pop .steps { align-self: start; }
@media (max-width: 820px) { .booking-pop .actions { grid-template-columns: repeat(2, 1fr); } .booking-pop .bhead { grid-template-columns: 64px 1fr; grid-template-areas: "room guest" "steps steps" "doc doc" "chips chips"; } }
.booking-pop .step { white-space: nowrap; }

/* registration card ร.ร.3 (A5 portrait): quiet and airy, black and white friendly, no boxes around guest details */
@page a5p { size: A5; margin: 0; }
.sheet.a5p { page: a5p; width: 148mm; min-height: 210mm; font-size: 12pt; padding: 7mm 9mm 6mm; gap: 1.4mm; }
.registration { --hair: #d4d4d8; --tint: #f4f4f5; line-height: 1.25; }
.registration small { font-size: .72em; color: var(--muted); }
.r-head { display: flex; align-items: center; gap: 3mm; padding-bottom: 2.5mm; border-bottom: .35mm solid var(--ink); }
.r-head .logo { width: 13mm; height: 14mm; object-fit: contain; }
.r-hotel { flex: 1; display: flex; flex-direction: column; font-size: .78em; color: var(--muted); line-height: 1.3; }
.r-hotel b { font-size: 1.35em; color: var(--ink); letter-spacing: .02em; }
.r-title { text-align: right; display: flex; flex-direction: column; line-height: 1.2; }
.r-title b { font-size: 1.3em; }
.r-title span { font-size: .62em; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.r-title em { font-style: normal; font-size: .8em; margin-top: .8mm; }
.r-sec { display: flex; align-items: baseline; gap: 2mm; margin: 2mm 0 0; font-size: .82em; font-weight: 400; border-bottom: .2mm solid var(--hair); padding-bottom: .4mm; }
.r-sec b { font-weight: 700; }
.r-sec span { font-size: .78em; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.r-guest { display: grid; grid-template-columns: max-content 1fr max-content 1fr; column-gap: 2.5mm; row-gap: .9mm; margin: .6mm 0 0; align-items: baseline; }
.r-guest dt { font-size: .76em; color: var(--muted); white-space: nowrap; }
.r-guest dt small { margin-left: .8mm; font-size: .85em; }
.r-guest dd { margin: 0 3mm 0 0; min-width: 0; border-bottom: .2mm dotted transparent; }
.r-guest dd:empty { border-bottom-color: var(--hair); }
.r-guest dd:empty::before { content: "\200b"; }
.r-guest dd.wide { grid-column: span 3; }
.r-stay { width: 100%; border-collapse: collapse; font-size: .92em; }
.r-stay th { font-weight: 700; font-size: .8em; text-align: center; padding: .6mm 1mm; border-bottom: .3mm solid var(--ink); line-height: 1.15; }
.r-stay th small { display: block; font-weight: 400; }
.r-stay td { text-align: center; padding: .9mm 1mm; border-bottom: .2mm solid var(--hair); }
.r-stay .l { text-align: left; } .r-stay .r { text-align: right; }
.r-stay tfoot td { font-weight: 700; border-bottom: 0; border-top: .3mm solid var(--ink); }
.r-key { display: grid; grid-template-columns: 1fr 1fr; gap: 3mm; margin-top: 1.5mm; }
.r-key > div { background: var(--tint); border-left: 1mm solid #a1a1aa; padding: 1.4mm 2.5mm; display: flex; flex-direction: column; gap: .2mm; }
.r-key span { font-size: .68em; letter-spacing: .06em; color: var(--muted); }
.r-key b { font-size: 1.05em; }
.r-key .owe { border-left-color: var(--ink); }
.r-key .nobf b { font-weight: 400; }
.r-note { margin: .5mm 0 0; font-size: .85em; }
.r-note span { color: var(--muted); margin-right: 1.5mm; }
.r-rules { font-size: .62em; line-height: 1.3; color: #3f3f46; columns: 1; }
.r-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 12mm; margin-top: auto; text-align: center; font-size: .8em; }
.r-sign .line { display: flex; align-items: flex-end; justify-content: center; border-bottom: .2mm solid var(--ink); height: 9mm; margin-bottom: 1mm; font-size: 1.05em; }
.r-sign small { display: block; }
/* one guest, several rooms: tighten a little so every room still fits one A5 page */
.registration.many { gap: 1.1mm; }
.registration.many .r-stay td { padding: .6mm 1mm; }
.registration.crowded { font-size: 11.5pt; gap: .8mm; }
.registration.crowded .r-sec { margin-top: 1.2mm; }
.registration.crowded .r-guest { row-gap: .4mm; }
.registration.crowded .r-stay td { padding: .35mm 1mm; }
.registration.crowded .r-key > div { padding: 1mm 2.5mm; }
.registration.crowded .r-sign .line { height: 6mm; }
.registration.crowded .r-guest dd, .registration.crowded .r-guest dt { line-height: 1.15; }
.registration.crowded .r-rules { font-size: .58em; line-height: 1.22; }
.registration.crowded .r-head { padding-bottom: 1.5mm; }
.registration.crowded .r-head .logo { width: 11mm; height: 12mm; }
.checkin fieldset { margin: 0 0 10px; }
.checkin legend { font-weight: 700; }
details.later { border: 1px dashed #c9ccc4; border-radius: 8px; padding: 8px 12px; }
details.later summary { cursor: pointer; color: var(--muted); }
details.later h4 { margin: 10px 0 4px; font-size: 14px; }
.slip { margin-top: 8px; }

/* breakfast coupon, 80 mm thermal roll */
@page coupon { size: 80mm 120mm; margin: 0; }
.sheet.coupon { page: coupon; width: 80mm; min-height: 120mm; padding: 4mm; align-items: center; text-align: center; gap: 1.2mm; font-size: 13pt; }
.coupon .c-hotel { font-size: 1.1em; }
.coupon .c-title { font-size: 1.6em; }
.coupon .c-room { font-size: 1.5em; font-weight: 700; }
.coupon .c-qr svg { width: 42mm; height: 42mm; }
.coupon small { font-size: .75em; }

/* breakfast this morning (front desk, read-only) */
.station { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.bf-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.bf-room { background: #fff; border-radius: 10px; padding: 6px; text-align: center; display: flex; flex-direction: column; border: 1px solid #e2e4dd; }
.bf-room.some { background: #fff4d6; }
.bf-room.full { background: #d9f2e3; }
.coupon .c-valid { font-weight: 700; border: .4mm solid #000; border-radius: 1.5mm; padding: .5mm 2mm; }

/* group bookings */
.stay.grp { box-shadow: inset 3px 0 0 #5b5bd6; }
.channel.grp { border-color: #5b5bd6; color: #3b3ba6; }
.grp-rooms { max-height: 300px; overflow: auto; border: 1px solid #e2e4dd; border-radius: 8px; }
.grp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.grp-table th { text-align: left; font-weight: 600; color: var(--muted); padding: 6px 6px; border-bottom: 1px solid #e2e4dd; position: sticky; top: 0; background: #fff; }
.grp-table td { padding: 4px 6px; border-bottom: 1px solid #f0f1ec; vertical-align: middle; }
.grp-table td small { color: var(--muted); }
.grp-table input:not([type=checkbox]) { width: 100%; min-width: 0; }
.grp-table input[type=number] { width: 64px; }
.grp-table tr.later { opacity: .5; }
.dlg:has(.grp-in), .dlg:has(.grp-new) { width: min(1080px, 96vw); }

/* receipt page top bar */
.rbar .rtitle { display: flex; flex-direction: column; line-height: 1.2; margin-right: 8px; }
.rbar .rtitle b { font-size: 17px; }
.rbar .rtitle small { color: var(--muted); font-size: 12.5px; }
.rbar .seg { display: inline-flex; }
.rbar .seg .btn { border-radius: 0; }
.rbar .seg .btn:first-child { border-radius: 8px 0 0 8px; }
.rbar .seg .btn:last-child { border-radius: 0 8px 8px 0; margin-left: -1px; }
.rbar .btn.icon { font-size: 18px; line-height: 1; padding: 6px 11px; }
.more { position: relative; }
.more > summary { list-style: none; }
.more > summary::-webkit-details-marker { display: none; }
.more-list { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 290px; background: #fff; border: 1px solid #e2e4dd; border-radius: 10px; box-shadow: 0 10px 30px #0002; padding: 6px; display: flex; flex-direction: column; }
.more-item { text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 7px; cursor: pointer; font: inherit; color: var(--ink); }
.more-item:hover { background: #f2f3ef; }
.more-item.danger { color: var(--void); }

/* receipt / tax invoice, design C (rounded boxes, light lines). The editor uses the same markup with .ink fields. */
.sheet.receipt.rcx { font-size: 12.5pt; line-height: 1.22; padding: 6.5mm 8mm 5mm; gap: 1.8mm; }
.rcx .rc-head { display: grid; grid-template-columns: auto 1fr auto; gap: 3mm; align-items: center; }
.rcx .rc-head .logo { width: 14mm; height: 15mm; object-fit: contain; }
.rcx .rc-co { display: flex; flex-direction: column; font-size: .8em; line-height: 1.3; }
.rcx .rc-co b { font-size: 1.3em; }
.rcx .rc-title { border: .35mm solid var(--ink); border-radius: 2mm; text-align: center; padding: 1.2mm 4mm; line-height: 1.15; }
.rcx .rc-title b { display: block; font-size: 1.12em; white-space: nowrap; }
.rcx .rc-title span { font-size: .72em; }
.rcx .rc-title em { display: block; font-style: normal; font-size: .78em; margin-top: .6mm; border-top: .2mm solid var(--ink); padding-top: .5mm; }
.rcx .rc-box { border: .25mm solid var(--ink); border-radius: 2mm; display: grid; grid-template-columns: 1fr 52mm; }
.rcx .rc-box > div { padding: 1.2mm 3mm; }
.rcx .rc-box > div + div { border-left: .25mm solid var(--ink); }
.rcx .rc-kv { display: grid; grid-template-columns: max-content 1fr; column-gap: 2.5mm; row-gap: .2mm; font-size: .92em; align-items: center; align-content: start; }
.rcx .rc-kv > span { color: #52525b; white-space: nowrap; }
.rcx .rc-kv em { font-style: normal; }
.rcx .rc-lines { width: 100%; border-collapse: separate; border-spacing: 0; border: .25mm solid var(--ink); border-radius: 2mm; overflow: hidden; font-size: .9em; }
.rcx .rc-lines th { background: #f1f1f2; font-size: .78em; padding: .6mm 1mm; border-bottom: .25mm solid var(--ink); line-height: 1.1; }
.rcx .rc-lines th small { display: block; font-weight: 400; color: #52525b; }
.rcx .rc-lines th + th, .rcx .rc-lines td + td { border-left: .2mm solid #d4d4d8; }
.rcx .rc-lines td { padding: .45mm 1.2mm; height: 6.3mm; vertical-align: middle; }
.rcx .rc-lines td small { display: block; font-size: .78em; color: #52525b; }
.rcx .rc-lines .c { text-align: center; }
.rcx .rc-ft { display: grid; grid-template-columns: 1fr 64mm; gap: 3mm; }
.rcx .rc-words { border: .25mm solid var(--ink); border-radius: 2mm; padding: 1.2mm 3mm; font-size: .92em; display: flex; flex-direction: column; justify-content: space-between; }
.rcx .rc-words small { color: #52525b; }
.rcx .rc-sum { border: .25mm solid var(--ink); border-radius: 2mm; font-size: .92em; overflow: hidden; }
.rcx .rc-sum div { display: flex; justify-content: space-between; padding: .35mm 3mm; }
.rcx .rc-sum .t { border-top: .25mm solid var(--ink); font-weight: 700; font-size: 1.08em; background: #f1f1f2; }
.rcx .rc-note { margin: 0; font-size: .85em; }
.rcx .rc-bot { display: flex; justify-content: space-between; align-items: flex-end; gap: 6mm; margin-top: auto; font-size: .82em; color: #52525b; }
.rcx .rc-sig { text-align: center; color: var(--ink); }
.rcx .rc-sig i { display: block; width: 56mm; border-bottom: .2mm dotted var(--ink); height: 6mm; }
/* editor */
.rcx.editing .rc-kv { row-gap: .6mm; }
.rcx.editing .rc-kv .ink.tax { width: 34mm; }
.rcx.editing .rc-kv .taxrow { display: flex; align-items: center; gap: 1.5mm; }
.rcx.editing .rc-kv .taxrow .with-suggest { flex: none; }
.rcx.editing .rc-kv .ink.date { width: 26mm; text-align: left; }
.rcx.editing .no { font-weight: 700; }
.rcx.editing .rc-lines td { position: relative; padding: .5mm .8mm; }
.rcx.editing .rc-lines th:nth-child(1) { width: 29%; }
.rcx.editing .rc-lines th:nth-child(2) { width: 13%; }
.rcx.editing .rc-lines th:nth-child(3) { width: 7%; }
.rcx.editing .rc-lines th:nth-child(4) { width: 14%; }
.rcx.editing .rc-lines th:nth-child(7) { width: 13%; }
.rcx.editing .rc-words b { font-weight: 700; }
.rcx.editing .rc-note { display: flex; align-items: center; gap: 1.5mm; white-space: nowrap; }
.ink.c { text-align: center; }

/* board: today strip, search, cleaning badges */
.today-strip { display: flex; gap: 8px; flex-wrap: wrap; margin: -2px 0 10px; }
.tchip { display: inline-flex; align-items: baseline; gap: 8px; background: #fff; border: 1px solid #e2e4dd; border-radius: 10px; padding: 6px 12px; cursor: pointer; font: inherit; color: var(--ink); text-decoration: none; }
.tchip span { color: var(--muted); font-size: 13px; }
.tchip b { font-size: 17px; }
.tchip.warn b { color: #b45309; }
.tchip.bad b { color: #c9393c; }
.tchip[aria-pressed=true] { border-color: #12302f; box-shadow: inset 0 0 0 1px #12302f; background: #f3f7f5; }
.board[data-focus=arr] .stay:not(.f-arr), .board[data-focus=dep] .stay:not(.f-dep), .board[data-focus=owe] .stay:not(.f-owe), .board[data-focus=in] .stay:not(.f-in) { opacity: .18; }
.board[data-focus=dirty] .brow:not(.bgroup):not(.head):has(.room:not(.clean-dirty)) { opacity: .25; }
.board[data-focus=free] .stay { opacity: .18; }
.bsearch-wrap { width: 260px; flex: none; }
.bsearch { width: 100%; }
.bsearch-wrap .suggest { min-width: 360px; zoom: 1; }
.brow .room.clean-dirty small.cl { color: #a05a06; font-weight: 600; }
.brow .room.clean-inspected small.cl { color: #11502f; font-weight: 600; }
.brow .room.clean-dirty { box-shadow: inset 3px 0 0 #e8a33d; }

/* ---- attendance ---- */
.ck { max-width: 520px; margin: 0 auto; display: grid; gap: 12px; }
.ck-main { text-align: center; display: grid; gap: 10px; padding: 22px 16px; }
.ck-now { font-size: 44px; font-weight: 600; letter-spacing: 1px; }
.ck-st { padding: 8px; border-radius: 8px; background: #f1f5f9; }
.ck-st.in { background: #dcfce7; color: #166534; }
.ck-st.warn { background: #fef3c7; color: #92400e; }
.ck-btn { font-size: 20px; padding: 16px; width: 100%; }
.ck-btn.out { background: #0f766e; color: #fff; border-color: #0f766e; }
.ck-ph img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; margin-right: 4px; vertical-align: middle; }
tr.strike td { text-decoration: line-through; }
tr.clickable { cursor: pointer; } tr.clickable:hover td, tr.sel td { background: #f1f5f9; }
table.att td small { color: #64748b; }
.menu { overflow-x: auto; scrollbar-width: none; } .menu a { white-space: nowrap; }
@media (max-width: 600px) { .top { flex-wrap: wrap; gap: 8px; } .top .who { flex: 1 1 100%; order: 9; font-size: 13px; } }
