/* Brick Bay Retreat · staff console. Calm, paper-on-limewash, one brick accent. */
:root {
  --bg: #F3EEE6; --paper: #FBF8F3; --paper-2: #F7F2EA; --ink: #1E1A17; --ink-2: #4A433D; --muted: #736A60;
  --brick: #9A3A24; --brick-hover: #7A2C1A; --brick-tint: #F1DDD4; --lake: #0F2A26; --lake-2: #173833;
  --moss: #4F6B45; --moss-tint: #E3EADD; --amber: #9A6412; --amber-tint: #F5E8D2; --danger: #B42318; --danger-tint: #F7E0DC;
  --lake-tint: #DAE6E2; --line: rgba(30, 26, 23, .12); --line-2: rgba(30, 26, 23, .07);
  --radius: 12px; --r-sm: 8px; --shadow: 0 1px 2px rgba(30, 26, 23, .05), 0 8px 24px rgba(30, 26, 23, .06);
  --sans: 'Jost', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; --serif: 'Noto Serif Display', 'Jost', Georgia, 'Times New Roman', serif;
  --side: 236px; --top: 64px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15.5px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--brick); text-decoration: none; }
a:hover { color: var(--brick-hover); text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; }
p { margin: 0 0 .6em; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.hide { display: none !important; }

/* ---------- brand mark (the logo PNG is white on transparent: recolour it with a mask) ---------- */
.logo-mask { display: block; background: currentColor; -webkit-mask: url(/assets/brand/logo.png) no-repeat center / contain; mask: url(/assets/brand/logo.png) no-repeat center / contain; }

/* ---------- boot + sign in ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 500px at 50% -10%, #fff8 0, transparent 70%), var(--bg); }
.login-card { width: min(400px, 100%); background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 36px 32px 30px; box-shadow: var(--shadow); }
.login-card .logo-mask { width: 190px; height: 68px; color: var(--brick); margin: 0 auto 6px; }
.login-card h1 { font-family: var(--serif); font-size: 22px; text-align: center; margin-bottom: 22px; color: var(--ink-2); font-weight: 400; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 8px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { background: var(--lake); color: rgba(255, 255, 255, .78); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 14px 16px; z-index: 30; }
.side .brand { display: block; padding: 4px 10px 22px; color: #fff; }
.side .brand img { display: block; width: 150px; height: auto; opacity: .95; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px; color: inherit; font-weight: 400; letter-spacing: .01em; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav-item.on { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: inset 3px 0 0 #D98A6C; }
.nav-item .badge { margin-left: auto; }
.side-foot { margin-top: auto; padding: 12px 12px 0; font-size: 12.5px; color: rgba(255, 255, 255, .45); border-top: 1px solid rgba(255, 255, 255, .08); }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #C4553A; color: #fff; font-size: 12px; font-weight: 500; line-height: 1; }
.badge.soft { background: var(--brick-tint); color: var(--brick-hover); }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 28px; background: rgba(243, 238, 230, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line-2); }
.top .menu-btn { display: none; }
.search { position: relative; flex: 1; max-width: 440px; }
.search input { width: 100%; height: 40px; padding: 0 12px 0 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.search input:focus { outline: none; border-color: var(--brick); box-shadow: 0 0 0 3px var(--brick-tint); }
.search > svg.i { position: absolute; left: 12px; top: 11px; color: var(--muted); }
.search-results { position: absolute; top: 46px; left: 0; right: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; max-height: 70vh; overflow: auto; }
.search-results a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; color: var(--ink); }
.search-results a:hover, .search-results a.on { background: var(--paper-2); text-decoration: none; }
.top .spacer { flex: 1; }
.user-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); display: grid; place-items: center; font-weight: 500; font-size: 14px; cursor: pointer; color: var(--ink-2); }
.user-btn:hover { border-color: var(--brick); color: var(--brick); }
.page { padding: 26px 28px 60px; width: 100%; max-width: 1320px; }
.update-bar { background: var(--lake); color: #fff; padding: 9px 28px; display: flex; gap: 12px; align-items: center; font-size: 14px; }
.update-bar .btn { height: 30px; }

/* ---------- page header ---------- */
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-family: var(--serif); font-size: 30px; line-height: 1.15; font-weight: 400; letter-spacing: -.005em; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-weight: 500; font-size: 14.5px; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .12s, border-color .12s, color .12s; }
.btn:hover { border-color: rgba(30, 26, 23, .28); text-decoration: none; color: var(--ink); }
.btn:focus-visible, .icon-btn:focus-visible, .nav-item:focus-visible, .tab:focus-visible { outline: 3px solid var(--brick-tint); outline-offset: 1px; }
.btn.primary { background: var(--brick); border-color: var(--brick); color: #fff; }
.btn.primary:hover { background: var(--brick-hover); border-color: var(--brick-hover); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--brick); padding: 0 10px; }
.btn.ghost:hover { background: var(--brick-tint); color: var(--brick-hover); }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13.5px; border-radius: 7px; }
.btn[disabled], .btn.busy { opacity: .55; pointer-events: none; }
.btn.big { height: 46px; padding: 0 22px; font-size: 15.5px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--paper-2); border-color: var(--line); color: var(--ink); }

/* ---------- cards ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; min-width: 0; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; gap: 10px; margin: -2px 0 12px; min-height: 32px; }
.card-head h2 { font-size: 16.5px; font-weight: 500; letter-spacing: .005em; }
.card-head .count { color: var(--muted); font-size: 14px; }
.card-head .actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card.flush { padding: 6px 0; }
.card.flush > .card-head { padding: 12px 20px 0; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid-2 > div > .card + .card { margin-top: 16px; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- status pills, chips, bars ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12.5px; font-weight: 500; white-space: nowrap; background: var(--paper-2); color: var(--ink-2); border: 1px solid transparent; }
.s-enquiry { background: var(--brick-tint); color: var(--brick-hover); }
.s-quoted { background: #EFE3F0; color: #6B3B6E; }
.s-hold { background: var(--amber-tint); color: var(--amber); border-color: rgba(154, 100, 18, .25); border-style: dashed; }
.s-confirmed { background: var(--moss-tint); color: #3E5836; }
.s-in_house { background: var(--lake); color: #fff; }
.s-checked_out { background: var(--lake-tint); color: var(--lake); }
.s-closed { background: #ECE6DD; color: var(--muted); }
.s-cancelled, .s-lost { background: var(--danger-tint); color: var(--danger); }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 10px; font-size: 12.5px; background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line-2); white-space: nowrap; }
.chip.ok { background: var(--moss-tint); color: #3E5836; border-color: transparent; }
.chip.warn { background: var(--amber-tint); color: var(--amber); border-color: transparent; }
.chip.bad { background: var(--danger-tint); color: var(--danger); border-color: transparent; }
.chip.new { background: var(--brick); color: #fff; border-color: transparent; }
.rbar { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.rbar .track { display: flex; gap: 2px; width: 70px; height: 6px; }
.rbar .seg { flex: 1; border-radius: 2px; background: rgba(30, 26, 23, .1); }
.rbar .seg.done { background: var(--moss); }
.rbar .seg.over { background: var(--danger); }
.rbar.full { color: var(--moss); }

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-top: 1px solid var(--line-2); color: var(--ink); min-height: 56px; }
.li:first-child { border-top: 0; }
a.li:hover, .li.click:hover { background: var(--paper-2); text-decoration: none; cursor: pointer; }
.li .title { font-weight: 500; }
.li .meta { color: var(--muted); font-size: 13.5px; }
.li .end { margin-left: auto; display: flex; align-items: center; gap: 12px; flex: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--muted); }
.dot.new_enquiry, .dot.hold_expiring, .dot.form_c_due { background: var(--brick); }
.dot.hold_expired, .dot.balance_overdue, .dot.checkout_overdue, .dot.arrival_missed { background: var(--danger); }
.dot.payment_to_verify, .dot.document_to_review { background: var(--amber); }
.dot.docs_missing, .dot.deposit_to_settle { background: #5E7C8C; }
.datebox { width: 46px; flex: none; text-align: center; line-height: 1.05; border: 1px solid var(--line); border-radius: 9px; padding: 5px 0 6px; background: var(--paper); }
.datebox b { display: block; font-size: 18px; font-weight: 500; }
.datebox span { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* table-like rows that fold into cards on phones */
.tbl { width: 100%; }
.tr { display: grid; align-items: center; gap: 14px; padding: 11px 20px; border-top: 1px solid var(--line-2); color: var(--ink); }
.tr.head { border-top: 0; padding-top: 4px; padding-bottom: 8px; font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
a.tr:hover { background: var(--paper-2); text-decoration: none; }
.bk-row { grid-template-columns: 112px minmax(140px, 1.4fr) minmax(130px, 1.1fr) 92px 110px 118px 96px 110px; }
.tr .sub { display: block; font-size: 13px; color: var(--muted); }
.cu-row { grid-template-columns: minmax(170px, 1.6fr) minmax(110px, 1fr) minmax(130px, 1fr) 110px 110px; }
.due-row { grid-template-columns: 96px minmax(150px, 1.5fr) minmax(130px, 1fr) 120px 120px 130px; }
b.due, .due-row .late, .kpis .v.late { color: var(--danger); }
.right { text-align: right; }
a.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); margin-bottom: 8px; }
a.back:hover { color: var(--brick); text-decoration: none; }
a.back svg.i { width: 16px; height: 16px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 400; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.on { color: var(--brick); border-bottom-color: var(--brick); font-weight: 500; }
.tab .n { font-size: 12px; color: var(--muted); background: var(--paper-2); border-radius: 9px; padding: 1px 7px; }
.tab.on .n { background: var(--brick-tint); color: var(--brick-hover); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search-inline { position: relative; }
.toolbar .search-inline input { padding-left: 36px; width: 280px; }
.toolbar .search-inline svg.i { position: absolute; left: 11px; top: 11px; color: var(--muted); }

/* ---------- empty states, banners ---------- */
.empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty .ic { width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--paper-2); color: var(--ink-2); margin-bottom: 10px; }
.empty h3 { color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.empty .btn { margin-top: 12px; }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 10px; border: 1px solid; margin-bottom: 14px; font-size: 14.5px; }
.banner svg.i { margin-top: 2px; }
.banner.warn { background: var(--amber-tint); border-color: rgba(154, 100, 18, .25); color: #6E4A10; }
.banner.bad { background: var(--danger-tint); border-color: rgba(180, 35, 24, .2); color: #8A1C13; }
.banner.info { background: var(--lake-tint); border-color: rgba(15, 42, 38, .15); color: var(--lake); }
.banner.ok { background: var(--moss-tint); border-color: rgba(79, 107, 69, .2); color: #3E5836; }
.banner .btn { margin-left: auto; }
.banner ul { margin: 4px 0 0; padding-left: 18px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
.field .hint { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=file]), .field select, .field textarea, .input-plain { height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; width: 100%; min-width: 0; }
.field textarea, textarea.input { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--brick); box-shadow: 0 0 0 3px var(--brick-tint); }
.field.bad input, .field.bad select { border-color: var(--danger); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.six { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-top: 12px; }
.pkg-list { display: grid; gap: 12px; margin: 6px 0 12px; }
.pkg { border: 1px solid var(--line-2); border-radius: 10px; padding: 14px 16px 10px; background: var(--paper); }
.pkg-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 6px 0; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brick); flex: none; }
.seg-ctl { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; padding: 3px; background: #fff; gap: 2px; flex-wrap: wrap; }
.seg-ctl button { border: 0; background: transparent; padding: 7px 14px; border-radius: 7px; cursor: pointer; color: var(--ink-2); }
.seg-ctl button.on { background: var(--brick); color: #fff; }
.form-error { color: var(--danger); background: var(--danger-tint); border-radius: 8px; padding: 9px 12px; font-size: 14px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.file-drop { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1.5px dashed var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.file-drop:hover { border-color: var(--brick); }
.file-drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }

/* ---------- key/value details ---------- */
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
.kv > div { min-width: 0; }
.kv dt, .kv .k { font-size: 12.5px; color: var(--muted); letter-spacing: .02em; }
.kv dd, .kv .v { margin: 1px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.kv .full { grid-column: 1 / -1; }
.note-box { background: var(--paper-2); border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- booking page ---------- */
.bk-head { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 16px; }
.bk-head .crumbs { display: flex; gap: 10px; align-items: center; font-size: 13.5px; color: var(--muted); margin-bottom: 6px; flex-wrap: wrap; }
.bk-head .crumbs a { color: var(--muted); }
.bk-head .crumbs a:hover { color: var(--brick); }
.bk-head .title-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.bk-head h1 { font-family: var(--serif); font-weight: 400; font-size: 29px; line-height: 1.2; }
.bk-head .meta { color: var(--ink-2); margin-top: 6px; display: flex; gap: 6px 14px; flex-wrap: wrap; }
.bk-head .meta span { display: inline-flex; align-items: center; gap: 6px; }
.bk-head .next { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.bk-head .next .hint { font-size: 13px; color: var(--muted); text-align: right; max-width: 220px; }
.items { width: 100%; border-collapse: collapse; }
.items th { text-align: left; font-weight: 400; font-size: 12.5px; color: var(--muted); letter-spacing: .03em; text-transform: uppercase; padding: 0 8px 8px 0; }
.items td { padding: 9px 8px 9px 0; border-top: 1px solid var(--line-2); vertical-align: middle; }
.items td.num, .items th.num { text-align: right; padding-right: 0; }
.items .cat { font-size: 12.5px; color: var(--muted); }
.items input, .items select { height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; width: 100%; }
.items input.n { text-align: right; }
.totals { margin-left: auto; width: min(320px, 100%); margin-top: 10px; }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals .grand { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; font-weight: 500; font-size: 16px; }
.totals .due { color: var(--brick); font-weight: 500; }
.money-row { display: flex; gap: 10px 22px; flex-wrap: wrap; padding: 12px 14px; background: var(--paper-2); border-radius: 10px; margin-top: 12px; font-size: 14px; }
.money-row b { font-weight: 500; }
.ready-item { display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line-2); }
.ready-item:first-of-type { border-top: 0; }
.ready-item .st { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; margin-top: 1px; }
.ready-item .st svg.i { width: 14px; height: 14px; stroke-width: 2.4; }
.ready-item.done .st { background: var(--moss); color: #fff; }
.ready-item.pending .st { border: 1.5px solid rgba(30, 26, 23, .3); }
.ready-item.overdue .st { background: var(--danger); color: #fff; }
.ready-item.na { opacity: .5; }
.ready-item.na .st { border: 1.5px dashed rgba(30, 26, 23, .25); }
.ready-item .lbl { font-weight: 500; font-size: 14.5px; }
.ready-item .det { font-size: 13px; color: var(--muted); }
.ready-item.overdue .det { color: var(--danger); }
.who { font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-left: auto; padding-top: 2px; }
.link-box { display: flex; gap: 8px; align-items: center; background: var(--paper-2); border-radius: 9px; padding: 8px 8px 8px 12px; }
.link-box code { font: 13px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.tpl-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tpl-list button { border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 5px 12px; cursor: pointer; font-size: 13.5px; color: var(--ink-2); }
.tpl-list button.on { border-color: var(--brick); color: var(--brick); background: var(--brick-tint); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 12px 18px; font-size: 14px; }
.timeline li::before { content: ''; position: absolute; left: 3px; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: rgba(30, 26, 23, .25); }
.timeline li::after { content: ''; position: absolute; left: 6px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .when { display: block; color: var(--muted); font-size: 12.5px; }
.guest-row { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.guest-row:first-child { border-top: 0; }
.guest-row .n { width: 26px; height: 26px; border-radius: 50%; background: var(--paper-2); display: grid; place-items: center; font-size: 12.5px; color: var(--muted); flex: none; }
.doc-row { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line-2); }
.doc-row:first-child { border-top: 0; }
.thumb { width: 44px; height: 44px; border-radius: 7px; object-fit: cover; background: var(--paper-2); border: 1px solid var(--line); flex: none; display: grid; place-items: center; color: var(--muted); }
.pay-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-2); }
.pay-row:first-child { border-top: 0; }
.pay-row .amt { font-weight: 500; text-align: right; }
.pay-row .amt.out { color: var(--danger); }
.pay-row.void { opacity: .5; }
.pay-row.void .amt { text-decoration: line-through; }

/* ---------- Today ---------- */
.today-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 16px; align-items: start; margin-top: 16px; }
.prop-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.prop-cols h3 { font-size: 12.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin-bottom: 6px; }
.prop-cols a { display: block; padding: 3px 0; }
.kpis { display: flex; flex-wrap: wrap; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.kpis > div { flex: 1 1 128px; min-width: 0; background: var(--paper); padding: 14px 16px; }
.kpis .k { font-size: 12.5px; color: var(--muted); letter-spacing: .02em; }
.kpis .v { font-size: 21px; font-weight: 500; margin-top: 2px; font-variant-numeric: tabular-nums; }
.section-label { font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 26px 0 10px; font-weight: 500; }

/* ---------- calendar ---------- */
.cal { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow div { padding: 9px 10px; font-size: 12.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.cal-day { min-height: 108px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 6px 6px 8px; cursor: pointer; position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day:hover { background: #fffdf9; }
.cal-day .d { font-size: 13.5px; color: var(--ink-2); padding: 1px 4px; align-self: flex-start; border-radius: 6px; }
.cal-day.other { background: rgba(243, 238, 230, .45); }
.cal-day.other .d { color: rgba(115, 106, 96, .6); }
.cal-day.past .d { color: var(--muted); }
.cal-day.today .d { background: var(--brick); color: #fff; font-weight: 500; }
.cal-day.blocked { background-image: repeating-linear-gradient(135deg, rgba(30, 26, 23, .06) 0 6px, transparent 6px 12px); }
.cal-block { font-size: 11.5px; color: var(--ink-2); padding: 1px 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip { display: block; font-size: 12.5px; line-height: 1.25; padding: 3px 6px; border-radius: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); border: 1px solid transparent; }
.cal-chip:hover { text-decoration: none; filter: brightness(.96); color: var(--ink); }
.cal-chip.expired { opacity: .55; text-decoration: line-through; }
.cal-chip.s-in_house, .cal-chip.s-in_house:hover { color: #fff; }
.legend { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); }
.legend .pill { height: 22px; font-size: 12px; }
.hatch { display: inline-block; width: 22px; height: 14px; border-radius: 4px; border: 1px solid var(--line); background-image: repeating-linear-gradient(135deg, rgba(30, 26, 23, .12) 0 4px, transparent 4px 8px); vertical-align: -2px; }

/* ---------- menus, dialogs, toasts ---------- */
.menu { position: fixed; z-index: 90; min-width: 220px; max-width: min(320px, calc(100vw - 24px)); background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgba(30, 26, 23, .16); padding: 6px; max-height: 80vh; overflow: auto; }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border: 0; background: transparent; border-radius: 8px; text-align: left; cursor: pointer; color: var(--ink); font-size: 14.5px; }
.menu button:hover, .menu a:hover { background: var(--paper-2); text-decoration: none; }
.menu .danger { color: var(--danger); }
.menu .sep { height: 1px; background: var(--line); margin: 5px 4px; }
.menu .label { font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 4px; }
.menu .hint { margin-left: auto; font-size: 12.5px; color: var(--muted); }
dialog.dlg { border: 0; padding: 0; border-radius: 16px; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); background: var(--paper); color: var(--ink); box-shadow: 0 24px 64px rgba(15, 42, 38, .28); }
dialog.dlg.wide { width: min(780px, calc(100vw - 32px)); }
dialog.dlg::backdrop { background: rgba(15, 42, 38, .42); }
.dlg-inner { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.dlg-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px 8px; }
.dlg-head h2 { font-size: 19px; font-weight: 500; }
.dlg-head .icon-btn { margin-left: auto; }
.dlg-body { padding: 8px 22px 6px; overflow: auto; }
.dlg-body > p { color: var(--ink-2); }
.dlg-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 22px 20px; flex-wrap: wrap; }
.dlg-foot .left { margin-right: auto; }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--lake); color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); font-size: 14.5px; display: flex; gap: 10px; align-items: center; pointer-events: auto; }
.toast.bad { background: var(--danger); }
.pwd { font: 500 20px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; background: var(--paper-2); border-radius: 10px; padding: 14px; text-align: center; user-select: all; }

/* ---------- settings ---------- */
.settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.subnav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: calc(var(--top) + 16px); }
.subnav a { padding: 9px 12px; border-radius: 8px; color: var(--ink-2); }
.subnav a:hover { background: var(--paper); text-decoration: none; color: var(--ink); }
.subnav a.on { background: var(--paper); color: var(--brick); font-weight: 500; box-shadow: inset 3px 0 0 var(--brick); }
.set-table { width: 100%; border-collapse: collapse; }
.set-table th { text-align: left; font-weight: 400; font-size: 12.5px; color: var(--muted); padding: 0 6px 6px 0; white-space: nowrap; }
.set-table td { padding: 4px 6px 4px 0; vertical-align: middle; }
.set-table input, .set-table select { height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; width: 100%; background: #fff; min-width: 60px; }
.set-table .n { width: 96px; }
.md-preview { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; font-size: 14px; min-height: 88px; }
.md-preview h3, .md-preview h4, .md-preview h5 { font-size: 15px; margin: 6px 0; }
.md-preview ul { padding-left: 20px; margin: 4px 0; }
.scroll-x { overflow-x: auto; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .bk-row { grid-template-columns: 104px minmax(120px, 1.4fr) minmax(120px, 1fr) 100px 100px 104px; }
  .bk-row .c-kind, .bk-row .c-guests { display: none; }
  .due-row { grid-template-columns: minmax(130px, 1.4fr) minmax(110px, 1fr) 104px 128px; }
  .due-row .d-ref, .due-row .d-total { display: none; }
  .cu-row { grid-template-columns: minmax(150px, 1.6fr) minmax(120px, 1fr) 100px 100px; }
  .cu-row .c-count { display: none; }
}
@media (max-width: 1020px) {
  .grid-2, .today-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  :root { --top: 58px; }
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 48px rgba(0, 0, 0, .3); }
  .shell.nav-open .side { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(15, 42, 38, .4); z-index: 25; }
  .top { padding: 0 12px; gap: 8px; }
  .top .menu-btn { display: inline-grid; }
  .top .new-label { display: none; }
  .top .btn.primary { width: 40px; padding: 0; }
  .page { padding: 18px 14px 80px; }
  .page-head h1 { font-size: 26px; }
  .settings { grid-template-columns: 1fr; }
  .subnav { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .subnav a { white-space: nowrap; }
  .bk-head { padding: 16px; }
  .bk-head .next { margin-left: 0; width: 100%; }
  .bk-head .next .btn.primary { flex: 1; }
  .bk-head .next .hint { display: none; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .btn { height: 44px; }
  .btn.small { height: 36px; }
  .icon-btn { width: 42px; height: 42px; }
  .card { padding: 16px; border-radius: 12px; }
  .card.flush > .card-head { padding: 12px 16px 0; }
  .li { padding: 12px 16px; }
  .form-grid, .form-grid.three, .kv, .cols-2, .prop-cols { grid-template-columns: minmax(0, 1fr); }
  .form-grid.six { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tr.head { display: none; }
  .bk-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 16px; }
  .bk-row .c-ref { order: 3; font-size: 13px; color: var(--muted); }
  .bk-row .c-guest { order: 1; }
  .bk-row .c-status { order: 2; justify-self: end; }
  .bk-row .c-dates { order: 4; justify-self: end; font-size: 13.5px; }
  .bk-row .c-money { order: 5; }
  .bk-row .c-ready { order: 6; justify-self: end; }
  .bk-row .c-kind, .bk-row .c-guests { display: none; }
  .cu-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 16px; }
  .cu-row .c-name { order: 1; } .cu-row .c-due { order: 2; } .cu-row .c-when { order: 3; font-size: 13.5px; } .cu-row .c-paid { order: 4; }
  .cu-row .c-count { display: none; }
  .due-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 16px; }
  .due-row .d-guest { order: 1; } .due-row .d-next { order: 2; } .due-row .d-when { order: 3; font-size: 13.5px; } .due-row .d-bal { order: 4; }
  .due-row .d-ref, .due-row .d-total { display: none; }
  .pay-row { grid-template-columns: minmax(0, 1fr) auto; }
  .pay-row .p-date { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
  .cal-day { min-height: 64px; padding: 4px 3px; }
  .cal-chip { font-size: 0; height: 7px; padding: 0; border-radius: 4px; }
  .cal-block { font-size: 0; }
  .cal-dow div { padding: 8px 4px; font-size: 11px; text-align: center; }
  .toolbar .search-inline input { width: 100%; }
  .toolbar .search-inline { flex: 1; }
  dialog.dlg, dialog.dlg.wide { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 18px 18px 0 0; }
  .dlg-inner { max-height: 92vh; }
  .dlg-foot .btn { flex: 1; }
  .search { max-width: none; }
  .items .hide-sm { display: none; }
}
@media print { .side, .top { display: none; } }

/* phones: the search takes the spare width instead of sharing it with the spacer */
@media (max-width: 700px) { .top .spacer { display: none; } .search { max-width: none; } }

/* New booking: a mobile number we already know */
.known { background: var(--brick-tint); color: var(--ink); border-radius: 10px; padding: 9px 12px; }
