:root {
  --ink: #24182F; --muted: #6B6075; --line: #E2D6DF; --soft: #EDE3EA;
  --bg: #FBF7F9; --card: #FFFFFF; --floor: #F3ECF1;
  --accent: #D9466F; --accent-dark: #992C4C; --accent-soft: #FBE3EA;
  --free: #1F8A6E; --free-dark: #17705A; --busy: #C77A12; --disabled: #CDBBC8;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: #EFE7EC; color: var(--ink); font-family: Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: #C23A62; }
.phone { max-width: 480px; min-height: 100dvh; margin: 0 auto; background: var(--bg); display: flex; flex-direction: column; position: relative; }
.top { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--card); border-bottom: 1px solid var(--soft); position: sticky; top: 0; z-index: 5; }
.top.dark { background: var(--ink); color: #fff; border-bottom: none; }
.brand { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
.brand b { font-family: var(--display); font-size: 19px; line-height: 1.1; }
.brand small { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.top.dark .brand small { color: #D9CFE0; }
.dot { width: 8px; height: 8px; border-radius: 4px; display: inline-block; flex: 0 0 auto; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); display: flex; align-items: center; justify-content: center; }
main { flex: 1 1 auto; padding: 16px 16px 24px; display: flex; flex-direction: column; gap: 16px; }
h1, h2 { font-family: var(--display); margin: 0; }
h1 { font-size: 23px; } h2 { font-size: 17px; }
.label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.card { background: var(--card); border: 1px solid var(--soft); border-radius: 14px; padding: 14px; }
.row { display: flex; align-items: center; gap: 12px; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.btn { height: 52px; border: none; border-radius: 14px; background: var(--accent); color: #fff; font-size: 16px; font-weight: 600; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn:disabled { background: var(--disabled); }
.btn.ghost { background: var(--card); color: var(--ink); border: 1.5px solid var(--ink); }
.btn.light { background: var(--card); color: var(--ink); border: 1.5px solid var(--disabled); height: 48px; font-size: 14px; }
.chip { min-height: 48px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); text-align: left; display: flex; flex-direction: column; gap: 3px; }
.chip.on { background: var(--accent-soft); border-color: var(--accent); }
.chip b { font-size: 14px; } .chip span { font-size: 12px; color: var(--muted); }
.chip.center { align-items: center; justify-content: center; text-align: center; }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--soft); border-radius: 12px; }
.seg button { height: 40px; border: none; border-radius: 9px; background: transparent; font-weight: 600; font-size: 14px; }
.seg button.on { background: var(--card); }
.slot { height: 44px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); font-size: 13px; font-weight: 600; white-space: nowrap; }
.slot.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.slot:disabled { background: var(--floor); border-color: var(--floor); color: #8A7F93; text-decoration: line-through; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.field input { height: 48px; border-radius: 12px; border: 1.5px solid var(--disabled); padding: 0 14px; font-size: 16px; font-weight: 400; background: var(--card); }
.note { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 0; }
.bottom { position: sticky; bottom: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px 16px 20px; background: var(--card); border-top: 1px solid var(--soft); }
.foot { text-align: center; font-size: 11px; color: var(--muted); padding: 4px 16px 16px; }
/* floor plan */
.host { display: flex; align-items: flex-end; gap: 12px; }
.bubble { flex: 1 1 auto; background: var(--card); border: 1px solid var(--soft); border-radius: 16px 16px 16px 4px; padding: 12px 14px; font-size: 14px; line-height: 1.45; }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 5px; }
.floor { background: var(--floor); border: 3px solid var(--ink); border-radius: 18px; padding: 14px 12px 0; display: flex; flex-direction: column; gap: 14px; }
.spa { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.chair { height: 30px; border-radius: 14px 14px 6px 6px; background: var(--line); border: 1.5px solid var(--disabled); }
.station { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; min-height: 132px; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; transition: transform .12s, border-color .12s; }
.station:hover, .station:focus-visible { border-color: var(--accent); transform: translateY(-2px); }
.table { width: 70%; height: 8px; border-radius: 3px; background: var(--line); }
.station b { font-size: 14px; }
.station small { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.floor-bottom { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: end; }
.desk { height: 34px; border-radius: 8px 8px 0 0; background: var(--ink); color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; }
.door { height: 34px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; font-size: 11px; color: var(--muted); }
.door i { width: 100%; height: 3px; background: var(--floor); border-left: 3px solid var(--ink); border-right: 3px solid var(--ink); margin-bottom: -3px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); font-size: 13px; font-weight: 500; }
.perk { border: 2px dashed var(--accent); border-radius: 14px; padding: 14px; background: #FFF5F8; display: flex; flex-direction: column; gap: 4px; }
.perk b { font-family: var(--display); font-size: 20px; }
/* owner */
.appt { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; min-height: 68px; border-radius: 14px; text-align: left; background: var(--card); border: 1.5px solid #E5DCE6; width: 100%; }
.appt.in { border-color: #F2C98A; }
.appt .who { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.appt .who b { font-size: 15px; }
.appt .who span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt .meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 11px; color: var(--muted); }
.pill { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.pill.booked { background: #EDE7F6; color: #4A3A6B; }
.pill.in { background: #FFF0D9; color: #8A5208; }
.pill.done { background: #DDF2EA; color: var(--free-dark); }
.pill.off { background: #F1EBF0; color: #5E5468; }
.fab { position: sticky; bottom: 84px; margin: 0 16px; z-index: 4; }
.tabs { position: sticky; bottom: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 8px 16px 12px; background: var(--card); border-top: 1px solid #E5DCE6; z-index: 4; }
.tabs button { height: 48px; border: none; border-radius: 10px; background: transparent; font-weight: 600; font-size: 14px; }
.tabs button.on { background: var(--accent-soft); }
.sheet-wrap { position: fixed; inset: 0; background: rgba(36, 24, 47, .45); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.sheet { width: 100%; max-width: 480px; max-height: 92dvh; overflow-y: auto; background: var(--card); border-radius: 20px 20px 0 0; padding: 18px 16px 24px; display: flex; flex-direction: column; gap: 14px; }
.extras { display: flex; flex-direction: column; gap: 6px; background: #F6F3F7; border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid #E5DCE6; padding-top: 12px; }
.total b { font-family: var(--display); font-size: 24px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); top: 84px; width: calc(100% - 32px); max-width: 448px; background: var(--free-dark); color: #fff; border-radius: 12px; padding: 12px 14px; font-size: 14px; font-weight: 600; z-index: 30; }
.recall { display: flex; flex-direction: column; gap: 10px; }
.recall.off { opacity: .6; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* bảng trượt chia 3 phần: đầu · nội dung cuộn · nút cố định đáy */
.sheet.sheet-split { padding: 0; gap: 0; max-height: 90vh; max-height: 90dvh; display: flex; flex-direction: column; overflow: hidden; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 16px 12px; border-bottom: 1px solid #EFE7EC; }
.sheet-title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sheet-title h1 { font-size: 21px; line-height: 1.15; }
.sheet-title .note { font-size: 13px; }
.sheet-body { flex: 1 1 auto; overflow-y: auto; padding: 14px 16px 8px; display: flex; flex-direction: column; gap: 18px; -webkit-overflow-scrolling: touch; }
.sheet-foot { padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid #EFE7EC; background: var(--card); display: flex; flex-direction: column; gap: 10px; }
.sec { display: flex; flex-direction: column; gap: 10px; }
.sec-title { display: flex; flex-direction: column; gap: 2px; }
.sec-title b { font-size: 15px; }
.sec-title span { font-size: 12px; color: var(--muted); }
.chip.svc { flex-direction: row; justify-content: space-between; align-items: center; gap: 6px; }
.chip.svc b { font-size: 13px; }
.svc-name { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--ink) !important; font-size: 13px !important; }
.text-in { width: 100%; height: 48px; border-radius: 12px; border: 1.5px solid var(--disabled); padding: 0 12px; font-size: 16px; background: var(--card); }
.btn.dark-btn { width: auto; height: 48px; padding: 0 14px; font-size: 14px; background: var(--ink); border-radius: 12px; white-space: nowrap; }
.extra-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 36px; }
.price-in { display: flex; align-items: center; gap: 2px; font-weight: 600; color: #8A5208; }
.price-in input { width: 64px; height: 36px; border-radius: 8px; border: 1.5px solid #F2C98A; padding: 0 8px; font-size: 16px; background: #FFF8EC; }
.mini-x { width: 32px; height: 32px; border-radius: 8px; border: none; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; }
.sum { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--muted); }
.sum b { font-family: var(--display); font-size: 22px; color: var(--ink); }

/* Đang xử lý (dùng chung) */
.proc { position: fixed; inset: 0; z-index: 40; background: rgba(251, 247, 249, .94); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 24px; }
.proc b { font-family: var(--display); font-size: 22px; }
.loader { display: flex; gap: 10px; height: 76px; align-items: center; }
.loader span { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); animation: hop 1s ease-in-out infinite; }
.loader span:nth-child(2) { background: #F2B33D; animation-delay: .15s; }
.loader span:nth-child(3) { background: #3FB8A0; animation-delay: .3s; }
@keyframes hop { 0%, 100% { transform: translateY(0); opacity: .6; } 40% { transform: translateY(-14px); opacity: 1; } }
@media (prefers-reduced-motion: no-preference) { .done-check { animation: pop .45s cubic-bezier(.2, 1.6, .4, 1) both; } }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
