/* Colours come from the shared Blueshade theme (lib/blueshade-theme/theme.css, pinned in blueshade-theme.json): Bridge navy
   and gold, light and dark. HPMS keeps its own names below so the rest of this file reads as before; each one points at a
   --bs-* token (or a mix of them), so every page switches with the Light / Dark / System choice. Text pairs meet WCAG AA. */
:root {
  --bg: var(--bs-bg);
  --surface: var(--bs-surface);
  --surface-2: var(--bs-surface-2);
  --ink: var(--bs-text);
  --muted: var(--bs-muted);
  --line: var(--bs-border);
  --line-soft: color-mix(in srgb, var(--bs-border) 60%, var(--bs-surface));
  --accent: var(--bs-link);          /* links, highlights, hover borders */
  --accent-soft: var(--bs-info-soft);
  --free: var(--bs-ok);
  --free-soft: var(--bs-ok-soft);
  --free-line: color-mix(in srgb, var(--bs-ok) 40%, var(--bs-surface));
  --allocated: var(--bs-warn);
  --allocated-soft: var(--bs-warn-soft);
  --allocated-bar: color-mix(in srgb, var(--bs-warn) 30%, var(--bs-surface));
  --occupied: var(--bs-bad);
  --occupied-soft: var(--bs-bad-soft);
  --occupied-line: color-mix(in srgb, var(--bs-bad) 40%, var(--bs-surface));
  --neutral-soft: color-mix(in srgb, var(--bs-muted) 18%, var(--bs-surface));
  --on-solid: var(--bs-surface);    /* text on a solid status colour (white in light, navy in dark) */
  --env: var(--bs-warn);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif; }
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: 0; }
h1 small { font-weight: 400; color: var(--muted); font-size: 1rem; margin-left: .5rem; }
h2 { margin: 0 0 1rem; font-size: 1.2rem; }
code { background: var(--bs-code-bg); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--muted); } .small { font-size: .85rem; }

.env-banner { background: var(--allocated-soft); color: var(--env); text-align: center; font-size: .8rem; padding: 3px; letter-spacing: .04em; border-bottom: 1px solid var(--allocated-bar); }
/* Scrolling non-production banner (Dev / Demo), matching the Blueshade Hub dev banner: pinned to the top of the
   window, amber stripes, navy label pill. Two identical groups slide left by 50% for a seamless loop. */
:root { --env-banner-h: 30px; }
.env-banner.marquee { position: fixed; top: 0; left: 0; right: 0; height: var(--env-banner-h); z-index: 60; overflow: hidden;
  display: flex; align-items: center; padding: 0; text-align: left; white-space: nowrap;
  background: repeating-linear-gradient(-45deg, #b7791f 0 14px, #a86c17 14px 28px); color: #fff; font-size: .8rem; letter-spacing: .03em;
  border-bottom: 2px solid #0b2a3c; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.marquee-track { display: flex; width: max-content; animation: env-marquee 40s linear infinite; }
.env-banner.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-group { display: flex; flex-shrink: 0; }
.marquee-item { white-space: nowrap; padding: 0 2.5rem; }
.marquee-item strong { background: #0b2a3c; color: #e9cf8f; padding: .1rem .5rem; border-radius: 4px; margin-right: .35rem; letter-spacing: .06em; }
@keyframes env-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
body.has-env-banner { padding-top: var(--env-banner-h); }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none !important; } }
.topbar { display: flex; align-items: center; gap: 1.5rem; padding: .6rem 1.5rem; background: var(--bs-header-bg); color: var(--bs-header-text); flex-wrap: wrap; border-bottom: 3px solid var(--bs-gold); }
.topbar a { color: var(--bs-header-text); text-decoration: none; }
.brand { font-weight: 700; font-size: 1.15rem; } .brand span { font-weight: 300; }
.nav { display: flex; gap: 1.1rem; } .nav a { opacity: .9; } .nav a:hover { opacity: 1; text-decoration: underline; }
.hotel-actions { align-self: stretch; align-items: center; gap: .35rem; }
.action-group { position: relative; }
.action-group summary { list-style: none; cursor: pointer; padding: .45rem .65rem; border-radius: 4px; }
.action-group summary::-webkit-details-marker { display: none; }
.action-group summary::after { content: "▾"; margin-left: .4rem; font-size: .75em; }
.action-group[open] summary, .action-group summary:hover { background: rgba(255,255,255,.14); }
.action-menu { position: absolute; z-index: 5; top: calc(100% + .25rem); left: 0; min-width: 210px; padding: .35rem 0; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--bs-shadow); }
.action-menu a { display: block; padding: .5rem .8rem; color: var(--ink); white-space: nowrap; }
.action-menu a:hover { background: var(--accent-soft); text-decoration: none; }
.who { margin-left: auto; display: flex; gap: 1rem; align-items: center; font-size: .9rem; }
.who small { opacity: .8; }
.settings-link { display: inline-flex; width: 2rem; height: 2rem; align-items: center; justify-content: center; border-radius: 4px; }
.settings-link:hover { background: rgba(255,255,255,.14); }
.settings-link svg { width: 1.25rem; height: 1.25rem; fill: currentColor; }
.page { max-width: 1200px; margin: 1.5rem auto; padding: 0 1.5rem 3rem; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.actions, .datebar { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

button, .btn { font: inherit; padding: .4rem .8rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 6px; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { border-color: var(--accent); }
button.primary, .btn.primary { background: var(--bs-primary); border-color: var(--bs-primary); color: var(--bs-primary-text); }
button.primary:hover, .btn.primary:hover { background: var(--bs-primary-hover); border-color: var(--bs-primary-hover); }
button.danger { color: var(--occupied); border-color: var(--occupied-line); }
button.link { background: none; border: none; color: var(--bs-header-text); padding: 0; text-decoration: underline; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--bs-focus); outline-offset: 2px; }
form.inline { display: inline-flex; gap: .4rem; align-items: center; }

input, select, textarea { font: inherit; padding: .45rem .6rem; border: 1px solid var(--bs-field-border); border-radius: 6px; background: var(--bs-field); color: var(--ink); width: 100%; }
.datebar input, .datebar select, form.inline input { width: auto; }
label { display: block; margin: .9rem 0 .25rem; font-weight: 600; font-size: .9rem; }
label small { font-weight: 400; color: var(--muted); }
.error { color: var(--occupied); font-size: .85rem; display: block; }
.notice { padding: .6rem .9rem; border-radius: 6px; margin-bottom: 1rem; }
.notice.ok { background: var(--free-soft); border: 1px solid var(--free-line); }
.notice.bad { background: var(--occupied-soft); border: 1px solid var(--occupied-line); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1.4rem; }
.card.narrow { max-width: 520px; }
.form { max-width: 640px; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-actions { margin-top: 1.4rem; display: flex; gap: .6rem; }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 1rem 0 0; padding: 0 1rem 1rem; }
legend { padding: 0 .4rem; font-weight: 600; }

.login { display: grid; grid-template-columns: 1fr 380px; gap: 3rem; align-items: center; max-width: 900px; margin: 4rem auto; }
.login-brand h1 { font-size: 2.4rem; color: var(--bs-primary); } .login-brand h1 span { font-weight: 300; }
.login-brand p { color: var(--muted); font-size: 1.1rem; }
.login-card button { margin-top: 1.4rem; width: 100%; padding: .6rem; }
@media (max-width: 800px) { .login { grid-template-columns: 1fr; margin: 2rem auto; } }
@media (max-width: 800px) {
  .hotel-actions { order: 3; width: 100%; overflow-x: auto; }
  .action-menu { position: fixed; top: auto; }
  .who { gap: .6rem; }
}

.tiles { display: flex; gap: 1rem; margin-bottom: .6rem; flex-wrap: wrap; }
.planner { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; margin-bottom: 2rem; }
.planner-inner { min-width: calc(180px + var(--days) * 58px); }
.planner-head, .planner-row { display: grid; grid-template-columns: 180px 1fr; border-bottom: 1px solid var(--line-soft); }
.planner-row:last-child { border-bottom: none; }
.planner-head { background: var(--surface-2); border-bottom: 1px solid var(--line); }
.planner-label { padding: .4rem .8rem; border-right: 1px solid var(--line); line-height: 1.25; }
.planner-label small { display: block; color: var(--muted); font-size: .75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.planner-head .planner-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); align-self: center; }
.planner-track { position: relative; min-height: 2.6rem; }
.planner-head .planner-track { min-height: 2.4rem; }
.planner-day { position: absolute; top: 0; bottom: 0; text-align: center; font-size: .8rem; padding-top: .3rem; border-left: 1px solid var(--line); }
.planner-day span { display: block; font-size: .68rem; text-transform: uppercase; color: var(--muted); }
.planner-day.today { background: var(--accent-soft); font-weight: 600; }
.planner-line { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line-soft); }
.planner-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); z-index: 2; }
.pbar { position: absolute; top: 5px; bottom: 5px; z-index: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 .5rem; border-radius: 4px; font-size: .8rem; line-height: 2.1rem; text-decoration: none; border: 1px solid transparent; }
.pbar:hover, .pbar:focus-visible { filter: brightness(.94); z-index: 3; outline-offset: 0; }
.pbar.allocated { background: var(--allocated-soft); border-color: var(--allocated); color: var(--ink); }
.pbar.occupied { background: var(--occupied); color: var(--on-solid); }
.pbar.occupied.overstay { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.18) 0 6px, transparent 6px 12px); }
.pbar.completed { background: var(--free-soft); border-color: var(--free-line); color: var(--free); }
.planner-key { margin: 1.2rem 0 .5rem; }
.booking-list { list-style: none; margin: 0 0 .8rem; padding: 0; }
.booking-list li { padding: .35rem 0; border-bottom: 1px solid var(--line-soft); }
.booking-list li:last-child { border-bottom: none; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.2rem; margin: 0; }
.facts dt { color: var(--muted); font-size: .9rem; } .facts dd { margin: 0; }
.action-menu .menu-heading { display: block; padding: .45rem .8rem .2rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.section-gap { margin-top: 2rem; }
.card.form { margin-top: 1.5rem; }
.form input[type="color"] { padding: .15rem; height: 2.4rem; }
.tile { background: var(--surface); border: 1px solid var(--line); border-left-width: 5px; border-radius: 8px; padding: .5rem 1.1rem; min-width: 140px; }
.tile strong { font-size: 1.6rem; margin-right: .5rem; }
.tile.free { border-left-color: var(--free); } .tile.allocated { border-left-color: var(--allocated); } .tile.occupied { border-left-color: var(--occupied); }

.pill { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.pill.free, .pill.completed { background: var(--free-soft); color: var(--free); }
.pill.allocated { background: var(--allocated-soft); color: var(--allocated); }
.pill.occupied { background: var(--occupied-soft); color: var(--occupied); }
.pill.cancelled { background: var(--neutral-soft); color: var(--ink); }

.grid { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
.grid-head, .grid-row { display: grid; grid-template-columns: 190px 110px minmax(220px, 1fr) minmax(300px, 1.3fr); gap: 1rem; padding: .55rem 1rem; align-items: center; min-width: 900px; }
.grid-head { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--line); }
.grid-row { border-bottom: 1px solid var(--line-soft); } .grid-row:last-child { border-bottom: none; }
.col-unit small { display: block; color: var(--muted); font-size: .8rem; }
.col-note { font-size: .9rem; }
.hours { position: relative; height: 1rem; } .hours span { position: absolute; transform: translateX(-30%); }
.track { position: relative; height: 22px; background: var(--neutral-soft); border-radius: 4px; overflow: hidden; }
.seg { position: absolute; top: 0; bottom: 0; display: block; }
.seg:hover { filter: brightness(.9); }
.seg.allocated { background: var(--allocated-bar); }
.seg.occupied { background: var(--occupied); top: 5px; bottom: 5px; border-radius: 3px; }
.now { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--accent); }

.table { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: .6rem .8rem; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.table td { padding: .55rem .8rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.row-actions { white-space: nowrap; display: flex; gap: .4rem; }

/* =====================================================================================================
   Brand type and the dashboard pieces the layout uses (gold shield, Jost)
   ===================================================================================================== */
@font-face { font-family: "Jost"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("../fonts/jost-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("../fonts/jost-latin-ext.woff2") format("woff2"); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/source-serif-4-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/source-serif-4-latin-ext.woff2") format("woff2"); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root { --gold: var(--bs-accent); --gold-soft: var(--bs-accent-soft); --gold-text: var(--bs-accent-text); --display: var(--bs-font-heading); --waiting: #6a4fb0; --waiting-soft: color-mix(in srgb, var(--waiting) 16%, var(--bs-surface)); }
/* The theme has no purple: "waiting for a room" gets a lighter purple on the dark palette (AA on its soft tint). */
[data-theme="dark"] { --waiting: #c3b1f2; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --waiting: #c3b1f2; } }
h1, h2, h3, .brand, .nav, .action-group summary, .kpi .value, .tabs a { font-family: var(--display); }
h1 { font-weight: 500; letter-spacing: -.01em; }
h2 { font-weight: 500; }
h3 { font-size: 1rem; font-weight: 600; margin: 1rem 0 .5rem; }
.brand { display: inline-flex; align-items: center; gap: .5rem; }
.brand img { display: block; }
.brand-word { font-weight: 500; letter-spacing: .02em; }
.brand-pms { font-weight: 300; color: #f4ead6; }   /* on the navy top bar in both themes */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.site-footer { max-width: 1200px; margin: 0 auto; padding: 1rem 1.5rem 2rem; display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .8rem; border-top: 1px solid var(--line); }

.welcome { display: flex; justify-content: space-between; align-items: center; gap: 2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1.5rem 1.8rem; margin-bottom: 1rem; flex-wrap: wrap; }
.welcome h1 { font-size: 1.9rem; margin: .2rem 0 .4rem; }
.welcome p { margin: 0 0 1rem; color: var(--muted); }
.eyebrow { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--gold-text); font-weight: 600; }
.quick { display: flex; gap: .5rem; flex-wrap: wrap; }
.ring { --pct: 0; width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; flex: none;
        background: conic-gradient(var(--gold) calc(var(--pct) * 1%), var(--neutral-soft) 0); }
.ring > div { width: 104px; height: 104px; border-radius: 50%; background: var(--surface); display: grid; place-content: center; text-align: center; color: var(--muted); font-size: .8rem; }
.ring strong { display: block; font-family: var(--display); font-size: 1.7rem; color: var(--ink); font-weight: 500; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem; }
.kpi .label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.kpi .value { font-size: 1.7rem; font-weight: 500; line-height: 1.25; font-variant-numeric: tabular-nums; }
.kpi .value.small-value { font-size: 1.15rem; padding-top: .2rem; }
.kpi .sub { font-size: .8rem; color: var(--muted); }
.kpi.alert { border-color: var(--occupied-line); background: var(--occupied-soft); }
.kpis.compact .kpi { padding: .6rem .9rem; }
.kpis.compact .kpi .value { font-size: 1.3rem; }
.statbar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--neutral-soft); margin-bottom: .6rem; }
.statbar i { display: block; height: 100%; }
.statbar i.occupied { background: var(--occupied); } .statbar i.allocated { background: var(--gold); } .statbar i.free { background: var(--free); }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
.legend i, .chip i { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: .15rem; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .15rem .65rem; font-size: .85rem; }
.chip strong { margin-left: .35rem; }
.chip.small { font-size: .75rem; padding: 0 .5rem; margin-left: .4rem; }

/* =====================================================================================================
   Hotel operations (phase 1): reservations, availability, billing, housekeeping, reports, setup
   ===================================================================================================== */
.section-gap-sm { margin-top: 1rem; }
.lede { max-width: 70ch; color: var(--ink); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table th.num { text-align: right; }
.owed { color: var(--occupied); font-weight: 600; }
.table-wrap { overflow-x: auto; }
.table.plain { border: none; border-radius: 0; background: transparent; }
.table.plain th { background: transparent; }
.table tr.group th { background: var(--surface-2); color: var(--ink); font-size: .8rem; }
.table tr.subtotal td, .table tfoot th, .table tfoot td { font-weight: 600; border-top: 1px solid var(--line); }
.table tr.voided td { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, currentColor 50%, transparent); }
.table tr.voided td .small { text-decoration: none; }
.table tr.chosen td { background: var(--gold-soft); }
.table tr.unavailable td { color: var(--muted); }
.table.narrow { max-width: 420px; }

.pill.waiting { background: var(--waiting-soft); color: var(--waiting); }
.pill.noshow { background: var(--occupied-soft); color: var(--occupied); }
.hk-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-left: .35rem; }

.searchbar { display: flex; gap: .8rem; flex-wrap: wrap; align-items: flex-end; padding: 1rem 1.2rem; }
.searchbar > div { min-width: 130px; flex: 1 1 130px; }
.searchbar label { margin-top: 0; }
.searchbar-go { flex: 0 0 auto !important; min-width: 0 !important; }
.searchbar .check { align-self: center; flex: 0 0 auto; }
.search { min-width: 260px; }
.inline-label { margin: 0; font-weight: 600; font-size: .9rem; }
select.auto, input.auto { width: auto; }
.num-sm { width: 5.5rem !important; } .num-md { width: 7.5rem !important; }
form.inline.grow { display: flex; width: 100%; }
form.inline.grow input[name="name"] { flex: 1; }
.inline.wrap, .row-actions.wrap { flex-wrap: wrap; }
.form.wide { max-width: none; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }
.three { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 1rem; }
label.check, .check label { display: flex; align-items: center; gap: .45rem; font-weight: 400; margin: .8rem 0 0; }
label.check input, .check input, .checks input, .segmented input { width: auto; }
.checks { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.checks label { display: flex; align-items: center; gap: .35rem; font-weight: 400; margin: .6rem 0 0; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; margin-top: .4rem; }
.segmented label { margin: 0; padding: .35rem .8rem; font-weight: 400; display: flex; gap: .35rem; align-items: center; border-right: 1px solid var(--line); cursor: pointer; }
.segmented label:last-child { border-right: none; }
.segmented label:has(input:checked) { background: var(--accent-soft); }
button[disabled] { opacity: .5; cursor: not-allowed; }

.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; margin-bottom: 1rem; }
.tabs a { padding: .5rem .9rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--ink); border-bottom-color: var(--gold); font-weight: 500; }
.page-head.sub { margin-bottom: .5rem; }
.page-head.sub h2 { margin: 0; }

.nightly { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0 .8rem; }
.nightly span { border: 1px solid var(--line); border-radius: 6px; padding: .25rem .6rem; font-variant-numeric: tabular-nums; background: var(--surface-2); }
.nightly span small { display: block; font-size: .7rem; color: var(--muted); }
.nightly span.posted { background: var(--free-soft); border-color: var(--free-line); }

.table.avail th, .table.avail td { text-align: center; padding: .45rem .4rem; }
.table.avail th:first-child, .table.avail tbody th, .table.avail tfoot th { text-align: left; white-space: nowrap; padding-left: .8rem; }
.table.avail tbody th small { display: block; color: var(--muted); font-weight: 400; font-size: .75rem; }
.table.avail th.day { font-weight: 500; font-size: .8rem; min-width: 3.2rem; }
.table.avail th.day span { display: block; font-size: .68rem; text-transform: uppercase; color: var(--muted); }
.table.avail th.weekend { background: var(--neutral-soft); }
.table.avail th.today { background: var(--gold-soft); }
.table.avail td.cell { font-variant-numeric: tabular-nums; font-weight: 600; }
.table.avail td.cell a { text-decoration: none; display: block; }
.table.avail td.last { background: var(--allocated-soft); }
.table.avail td.none { background: var(--occupied-soft); color: var(--occupied); }
.table.avail td.over { background: var(--occupied); color: var(--on-solid); }
.table.avail td.over a { color: inherit; }
.table.avail td.changed { background: var(--accent-soft); }
.table.avail tfoot td { font-weight: 400; color: var(--muted); font-size: .85rem; }
.table.avail tfoot tr:first-child td { color: var(--ink); font-weight: 600; }
.flag { display: block; font-size: .62rem; font-weight: 700; color: var(--occupied); }
.band { display: inline-block; padding: 0 .45rem; border-radius: 4px; font-weight: 600; font-size: .8rem; }
.band.quiet { background: var(--neutral-soft); color: var(--ink); }
.band.steady { background: var(--free-soft); color: var(--free); }
.band.busy { background: var(--allocated-soft); color: var(--allocated); }
.band.full { background: var(--occupied); color: var(--on-solid); }

.inline-menu { display: inline-block; position: relative; }
.inline-menu summary { cursor: pointer; color: var(--accent); font-size: .85rem; list-style: none; }
.inline-menu summary::-webkit-details-marker { display: none; }
.inline-menu[open] form { position: absolute; right: 0; z-index: 4; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: .5rem; box-shadow: var(--bs-shadow); }
.inline-menu input { width: 14rem; }

.trend { display: inline-block; width: 0; height: 0; margin-right: .35rem; vertical-align: 1px; border-left: 5px solid transparent; border-right: 5px solid transparent; }
.trend.up { border-bottom: 7px solid var(--free); }
.trend.down { border-top: 7px solid var(--occupied); }
.trend.flat { width: 8px; height: 2px; background: var(--muted); border: none; vertical-align: 3px; }

.hk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .8rem; }
.hk-card { background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--hk); border-radius: 8px; padding: .7rem .9rem; display: flex; flex-direction: column; gap: .5rem; }
.hk-card header { display: flex; align-items: baseline; gap: .5rem; }
.hk-card .room { font-family: var(--display); font-size: 1.35rem; font-weight: 500; }
.hk-card .hk-status { margin-left: auto; font-size: .75rem; font-weight: 700; letter-spacing: .04em; }
.hk-card.offsale { background: repeating-linear-gradient(135deg, var(--surface) 0 10px, var(--surface-2) 10px 20px); }
.hk-body { display: flex; flex-direction: column; gap: .25rem; }
.hk-actions { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: auto; }
.hk-actions button { font-size: .75rem; padding: .25rem .55rem; }
.tray { margin-bottom: 2rem; border-left: 4px solid var(--waiting); }

.invoice { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 2rem 2.2rem; max-width: 860px; }
.invoice-head { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; border-bottom: 2px solid var(--gold); padding-bottom: 1rem; margin-bottom: 1rem; }
.invoice-head h2 { margin: .4rem 0 0; font-family: "Source Serif 4", Georgia, serif; font-size: 1.5rem; font-weight: 600; }
.invoice-to { margin: 1rem 0 1.4rem; }

@media print {
  .topbar, .env-banner, .site-footer, .no-print, .notice { display: none !important; }
  body { background: #fff; }
  body.has-env-banner { padding-top: 0; }
  .page { margin: 0; padding: 0; max-width: none; }
  .invoice, .card, .table, .kpi { border-color: #ccc; box-shadow: none; }
}

/* ---- Demo environment: banner and sign-in shortcuts ---- */
.env-banner.demo:not(.marquee) { background: var(--gold-soft); color: var(--gold-text); border-bottom-color: color-mix(in srgb, var(--gold) 50%, var(--bs-surface)); }
.demo-card { grid-column: 2; padding: 1.1rem 1.2rem; }
.demo-card h2 { margin: 0 0 .3rem; font-size: 1.05rem; }
.demo-card code { background: var(--gold-soft); padding: 0 .3rem; border-radius: 4px; }
.demo-accounts { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .4rem; }
.demo-fill { width: 100%; text-align: left; display: flex; flex-direction: column; gap: .05rem; padding: .45rem .7rem; }
.demo-fill span { font-size: .78rem; color: var(--muted); }
.demo-fill:hover, .demo-fill:focus-visible { border-color: var(--gold); background: var(--gold-soft); }
@media (max-width: 800px) { .demo-card { grid-column: 1; } }

/* =====================================================================================================
   HPMS: settings menu, roles, hotel details, weather, payment devices, Back of House, stock
   ===================================================================================================== */
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.small-heading { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin: 0 0 .6rem; }
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.head-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.row-muted td { color: var(--muted); }
.muted-card { background: var(--surface-2); }
.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; }
.inline-form > div { flex: 1 1 160px; }
.inline-form label { margin-top: 0; }
.inline-form.compact { gap: .3rem; align-items: center; flex-wrap: nowrap; }
.inline-form.compact input, .inline-form.compact select { padding: .25rem .4rem; font-size: .85rem; }
.inline-form.compact button { padding: .25rem .6rem; font-size: .85rem; }
form.inline.role-form select { width: auto; max-width: 14rem; }
form.inline.reset input { width: 11rem; }
.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.filters select, .filters input:not([type="checkbox"]) { width: auto; }
.filters label { margin: 0; }
details.help { margin: .6rem 0 1rem; }
details.help summary { cursor: pointer; color: var(--accent); }
details.help > div, details.help > ul, details.help > p { margin-top: .5rem; }

/* settings cog and hotel switcher */
.who .switch-link { font-size: .85rem; padding: .2rem .55rem; border: 1px solid rgba(255,255,255,.35); border-radius: 4px; }
.who .switch-link:hover { background: rgba(255,255,255,.14); }
.settings-group summary.settings-link { padding: 0; display: inline-flex; width: 2.1rem; height: 2.1rem; border-radius: 50%; }
.settings-group summary.settings-link::after { content: none; }
.settings-group summary.settings-link svg { width: 1.3rem; height: 1.3rem; transition: transform .25s ease; }
.settings-group[open] summary.settings-link svg { transform: rotate(60deg); }
.action-menu.align-right { left: auto; right: 0; }
@media (prefers-reduced-motion: reduce) { .settings-group summary.settings-link svg { transition: none; } }

/* hotel chooser */
.hotel-choices { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; }
.hotel-choices form { margin: 0; }
.hotel-choice { width: 100%; text-align: left; display: flex; flex-direction: column; gap: .2rem; padding: 1rem 1.1rem; border-radius: 10px; }
.hotel-choice strong { font-family: var(--display); font-weight: 500; font-size: 1.1rem; }
.hotel-choice span { color: var(--muted); font-size: .85rem; }
.hotel-choice.current { border-color: var(--accent); background: var(--accent-soft); opacity: 1; cursor: default; }

/* roles */
.role-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; margin-bottom: 1.5rem; }
.role-card h3 { margin-top: 0; }
.role-card p { margin: .2rem 0 .6rem; color: var(--muted); font-size: .9rem; }
.perm-list { margin: 0; padding-left: 1.1rem; font-size: .85rem; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .1rem 1.2rem; }
.perm-grid label { display: flex; gap: .45rem; align-items: flex-start; font-weight: 400; margin: .5rem 0 0; }
.perm-grid input { width: auto; margin-top: .25rem; }

/* hotel header on invoices and reports */
.hotel-header { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.hotel-name { display: block; font-family: "Source Serif 4", Georgia, serif; font-size: 1.4rem; font-weight: 600; }
.hotel-header address { font-style: normal; margin: .2rem 0; line-height: 1.4; }
.hotel-contact, .hotel-tax { display: flex; gap: .3rem 1rem; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.hotel-doc { text-align: right; display: flex; flex-direction: column; }
.hotel-doc strong { font-family: var(--display); font-weight: 500; font-size: 1.1rem; }
.hotel-doc span { color: var(--muted); font-size: .9rem; }
.invoice-head .hotel-header { flex: 1 1 320px; }
.report-hotel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .9rem 1.2rem; margin-bottom: 1rem; }
.hotel-footer { margin-top: 1.6rem; padding-top: .8rem; border-top: 1px solid var(--line); font-size: .9rem; }
.hotel-footer p { margin: .2rem 0; }
.invoice-preview { padding: 1.2rem; }
.invoice-footer { margin-top: 1rem; padding-top: .6rem; border-top: 1px solid var(--line); white-space: pre-wrap; font-size: .9rem; }

/* weather */
.weather { display: flex; flex-direction: column; gap: .8rem; }
.weather-now { display: flex; gap: .9rem; align-items: center; }
.wx-icon { width: 3rem; height: 3rem; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.wx-icon.small { width: 1.6rem; height: 1.6rem; }
.wx-temp { font-family: var(--display); font-size: 2rem; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.wx-sum { font-weight: 600; }
.wx-days { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.wx-days li { border: 1px solid var(--line); border-radius: 8px; padding: .45rem .5rem; display: flex; flex-direction: column; align-items: center; gap: .15rem; font-size: .85rem; font-variant-numeric: tabular-nums; }
.wx-day { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* payment devices */
.provider-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .8rem; margin-bottom: 1.5rem; }
.provider-card h3 { margin-top: 0; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

/* Back of House */
.report-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; }
.report-tile { display: flex; flex-direction: column; gap: .3rem; text-decoration: none; color: var(--ink); }
.report-tile strong { font-family: var(--display); font-weight: 500; font-size: 1.1rem; color: var(--accent); }
.report-tile span { color: var(--muted); font-size: .9rem; }
.report-tile:hover { border-color: var(--accent); }
/* Reports (Pages/Reports): the list, the preview table and the CSV button */
.report-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.report-downloads h2 small { font-size: .85rem; font-weight: 400; margin-left: .4rem; }
.report-count { margin-bottom: .4rem; }
.report-preview tfoot td { background: var(--surface-2); }
.notes-body { min-height: 8rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.notes-card .prewrap { max-height: 14rem; overflow-y: auto; margin-bottom: .4rem; }
textarea.notes { min-height: 16rem; font-family: inherit; line-height: 1.5; }

/* housekeeping assignment */
.hk-assign { display: flex; gap: .3rem; }
.hk-assign select { padding: .2rem .35rem; font-size: .8rem; }
.hk-assign button { font-size: .75rem; padding: .2rem .55rem; }

@media print {
  .report-hotel { border: none; padding: 0; }
}

/* ---- patients and owners (VPMS phase 2) ---- */
.searchbar .grow { flex: 1 1 280px; }
.searchbar .grow input { width: 100%; }
.searchbar label.check { margin-bottom: .55rem; }
.patient-alerts { font-weight: 600; }
.table .flag { margin-top: .15rem; font-size: .7rem; }
.page-head h1 .pill { vertical-align: middle; margin-left: .4rem; }

/* ---- VPMS phase 2: diary, clinical notes, accounts, stock ---- */
.four { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0 1rem; }
.datebar.card { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .7rem 1rem; margin-bottom: 1rem; }
.diary-tabs { margin-left: auto; }
.flag-text { color: var(--allocated); font-weight: 600; }

.diary-wrap { padding: 0; overflow: auto; max-height: 75vh; }
.diary { display: grid; position: relative; min-width: max-content; }
.diary-corner, .diary-head { position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--line); }
.diary-corner { grid-column: 1; grid-row: 1; left: 0; z-index: 4; }
.diary-head { padding: .55rem .7rem; display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.diary-head small { color: var(--muted); font-size: .72rem; }
.diary-time { position: sticky; left: 0; z-index: 2; background: var(--surface); font-size: .72rem; color: var(--muted);
  padding: 0 .5rem; text-align: right; border-top: 1px dotted var(--line); line-height: 1; padding-top: 2px; }
.diary-time.hour { border-top: 1px solid var(--line); color: var(--ink); font-weight: 600; }
.diary-slot { border-left: 1px solid var(--line); border-top: 1px dotted var(--line); display: block; }
.diary-slot.hour { border-top: 1px solid var(--line); }
.diary-slot.past { background: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--ink) 4%, transparent) 6px 12px); }
a.diary-slot:hover, a.diary-slot:focus-visible { background: var(--accent-soft); outline: none; }
.diary-now { z-index: 2; height: 0; border-top: 2px solid var(--occupied); align-self: start;
  margin-top: calc(var(--frac) * 38px); pointer-events: none; }
.appt.short { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: .4rem; white-space: nowrap; }
.appt.short .appt-meta, .appt.short .pill { display: none; }
.appt { z-index: 1; margin: 1px 4px; padding: .2rem .45rem; border-radius: 6px; overflow: hidden; text-decoration: none; color: var(--ink);
  background: color-mix(in srgb, var(--appt) 14%, var(--bs-surface)); border-left: 4px solid var(--appt); font-size: .78rem; line-height: 1.25;
  display: flex; flex-direction: column; gap: 1px; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.appt:hover, .appt:focus-visible { box-shadow: var(--bs-shadow); z-index: 5; }
.appt .appt-time { font-size: .7rem; color: var(--muted); font-weight: 600; }
.appt .appt-meta { font-size: .7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt .appt-alert { font-size: .7rem; color: var(--occupied); font-weight: 700; }
.appt .pill { align-self: flex-start; font-size: .66rem; padding: 0 6px; }
.appt.status-completed { opacity: .65; }
.appt.status-arrived { box-shadow: 0 0 0 2px var(--allocated) inset; }
.appt.status-inconsult { box-shadow: 0 0 0 2px var(--occupied) inset; }

.type-picker { flex-wrap: wrap; }
.type-picker label small { color: var(--muted); }
.type-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.workflow { padding: 1rem 1.2rem; }
.steps { list-style: none; display: flex; gap: 0; margin: 0; padding: 0; counter-reset: step; }
.steps li { flex: 1; position: relative; padding: .4rem .6rem .4rem 2.2rem; color: var(--muted); border-top: 3px solid var(--line); }
.steps li::before { counter-increment: step; content: counter(step); position: absolute; left: .4rem; top: .45rem; width: 1.3rem; height: 1.3rem;
  border-radius: 50%; background: var(--line); color: var(--ink); font-size: .75rem; display: grid; place-items: center; }
.steps li small { display: block; font-size: .72rem; }
.steps li.done { color: var(--ink); border-top-color: var(--free); }
.steps li.done::before { background: var(--free); color: var(--on-solid); content: "\2713"; }
.steps li.now { color: var(--ink); font-weight: 600; border-top-color: var(--accent); }
.steps li.now::before { background: var(--accent); color: var(--on-solid); }

.clinical-note { border-left: 3px solid var(--accent); padding: .5rem .8rem; margin: .7rem 0; background: var(--bg); border-radius: 0 6px 6px 0; }
.clinical-note.kind-hospital { border-left-color: var(--occupied); }
.clinical-note.kind-nursing { border-left-color: var(--free); }
.clinical-note.kind-phone { border-left-color: var(--muted); }
.clinical-note.kind-procedure { border-left-color: var(--allocated); }
.clinical-note header { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.clinical-note .vitals { margin: .3rem 0; font-size: .85rem; font-weight: 600; color: var(--accent); }
.soap { display: grid; grid-template-columns: max-content 1fr; gap: .2rem 1rem; margin: .3rem 0 0; }
.soap dt { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding-top: 2px; }
.soap dd { margin: 0; }

.weight-chart { margin: .5rem 0 1rem; }
.weight-chart svg { width: 100%; max-width: 680px; height: auto; display: block; }
.weight-chart .axis { stroke: var(--line); }
.weight-chart .lbl { font-size: 11px; fill: var(--muted); }
.weight-chart .trend-line { fill: none; stroke: var(--accent); stroke-width: 2; }
.weight-chart .dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }

@media (max-width: 700px) {
  .steps { flex-direction: column; }
  .soap { grid-template-columns: 1fr; }
}
@media print {
  .diary-wrap { max-height: none; overflow: visible; }
}

/* ---- Reports and invoices: fit the page in portrait and landscape, on screen and in print ---- */
.detail-grid > *, .card, .table-wrap { min-width: 0; }
/* Side-by-side cards only when each gets at least 380px (landscape / desktop); otherwise they stack (portrait). */
.detail-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.hotel-doc { margin-left: auto; }
.table td.num, .table th.num { white-space: nowrap; }
.table td { overflow-wrap: break-word; }
/* Narrower screens (tablets in portrait, small laptops): tighter tables so columns stay inside their cards. */
@media (max-width: 1100px) {
  .card .table, .table-wrap .table { font-size: .86rem; }
  .card .table th, .card .table td, .table-wrap .table th, .table-wrap .table td { padding: .4rem .5rem; }
  .card .table th, .table-wrap .table th { letter-spacing: .02em; font-size: .7rem; }
}
@media (max-width: 760px) {
  .detail-grid { grid-template-columns: 1fr; }
  .page { padding: 0 .8rem 2rem; }
}
/* Paper: A4 or Letter, whichever orientation the person picks in the print dialog. */
@page { margin: 12mm; }
@media print {
  html { font-size: 10pt; }
  body { font-size: 9.5pt; line-height: 1.35; }
  .page { padding: 0; margin: 0; max-width: none; }
  h1 { font-size: 15pt; margin: 0 0 .3rem; }
  h2 { font-size: 11.5pt; margin: .2rem 0 .4rem; }
  .page-head { margin-bottom: .4rem; }
  .card { padding: .5rem .7rem; border-radius: 4px; }
  .report-hotel { margin-bottom: .5rem; }
  .hotel-header { flex-wrap: nowrap; gap: 1rem; }
  .hotel-name { font-size: 13pt; }
  .hotel-contact, .hotel-tax { font-size: 8pt; }
  .table-wrap, .grid, .planner { overflow: visible !important; }
  .table { font-size: 8.5pt; border-radius: 0; overflow: visible; width: 100%; box-sizing: border-box; }
  .table th, .table td { padding: .22rem .35rem; }
  .table th { font-size: 7pt; letter-spacing: .02em; background: #f3f3f3 !important; }
  .table thead { display: table-header-group; }
  .table tr { break-inside: avoid; }
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; margin-bottom: .5rem; }
  .kpi { padding: .35rem .55rem; border-radius: 4px; }
  .kpi .value { font-size: 14pt; }
  .kpi .sub, .kpi .label { font-size: 7pt; }
  /* Two columns only when the paper is wide enough (landscape); one column on portrait. */
  .detail-grid { grid-template-columns: repeat(auto-fit, minmax(110mm, 1fr)); gap: .5rem; margin-bottom: .5rem; }
  .lede { max-width: none; font-size: 9pt; }
  .section-gap { margin-top: .6rem; }
  a { color: inherit; text-decoration: none; }
  .invoice { padding: 0; border: none; max-width: none; }
  .print-break { break-before: page; }
}

/* ---- Settings > Integrations: weather service choice ---- */
.tabs-group { align-self: center; margin-left: .8rem; padding-left: .8rem; border-left: 1px solid var(--line); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.provider-choice { border: none; padding: 0; margin: .4rem 0 .8rem; display: grid; gap: .45rem; }
.provider-option { display: flex; gap: .6rem; align-items: flex-start; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: normal; }
.provider-option input { width: auto; margin-top: .25rem; }
.provider-option > span { display: flex; flex-direction: column; gap: .15rem; }
.provider-option .pill { align-self: flex-start; font-size: .68rem; }
.provider-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pill.free { background: var(--free-soft); color: var(--free); }
.wx-source { font-size: .72rem; color: var(--muted); }

/* ---- settings: every entry is a page (cog menu, tabs, landing pages) */
.settings-menu a { display: flex; flex-direction: column; gap: .05rem; }
.settings-menu a small { color: var(--muted); font-size: .76rem; white-space: normal; max-width: 15rem; }
.settings-menu a.menu-all { font-weight: 600; border-bottom: 1px solid var(--line); margin-bottom: .2rem; }
.crumbs { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin: -.4rem 0 .9rem; }
.crumbs a { color: var(--accent); }
.crumbs [aria-current] { color: var(--ink); }
.settings-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 1rem; margin-top: 1rem; }
a.settings-card { display: flex; flex-direction: column; gap: .5rem; text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
a.settings-card:hover, a.settings-card:focus-visible { border-color: var(--accent); box-shadow: var(--bs-shadow); }
a.settings-card h2 { margin: 0; }
a.settings-card p { margin: 0; }
.settings-items { margin: 0; padding-left: 1.1rem; font-size: .9rem; }
.settings-open { margin-top: auto; padding-top: .4rem; color: var(--accent); font-weight: 500; }
@media (prefers-reduced-motion: reduce) { a.settings-card { transition: none; } }

/* Pay now (owner account): Card / Cash choice, and the card payment page waiting on the PDQ. */
.pay-type { display: flex; gap: .6rem; margin-bottom: .8rem; }
.pay-option { flex: 1; display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .7rem 1rem;
  border: 2px solid var(--line); border-radius: 8px; background: var(--surface); font-weight: 600; cursor: pointer; }
.pay-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.pay-option input { accent-color: var(--accent); width: auto; margin: 0; }
.card-pay { max-width: 520px; margin: 1rem auto; text-align: center; border-top: 6px solid var(--accent); }
.card-pay.ok { border-top-color: var(--free); }
.card-pay.bad { border-top-color: var(--occupied); }
.card-pay-amount { font-size: 2.6rem; font-weight: 700; margin-top: .5rem; }
.card-pay-terminal { color: var(--muted); margin-bottom: 1rem; }
.card-pay .inline-form, .card-pay .form-actions { justify-content: center; margin-top: 1rem; }
.card-pay-spinner { width: 42px; height: 42px; margin: .5rem auto 0; border: 4px solid var(--accent-soft); border-top-color: var(--accent);
  border-radius: 50%; animation: card-spin 1s linear infinite; }
@keyframes card-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .card-pay-spinner { animation: none; } }
@media print { .pay-now, .card-pay form { display: none; } }
[hidden] { display: none !important; }

/* =====================================================================================================
   Phones and tablets (reception tablets, phones in the consult room). Desktop is unchanged: everything below is
   either inside a max-width media query, or only takes effect when something would otherwise overflow.
   ===================================================================================================== */
.nav-toggle { display: none; }
img, video { max-width: 100%; height: auto; }
.search { min-width: min(260px, 100%); }
.who .site, .who .user, .facts dd, .notice, .kpi .sub, .col-note { overflow-wrap: anywhere; }
.who { flex-wrap: wrap; min-width: 0; }
.who .user { min-width: 0; }

/* Touch screens: comfortable tap targets (44px is the aim; small in-table buttons at least 32px). */
@media (hover: none), (pointer: coarse) {
  button, .btn { min-height: 44px; }
  .hk-actions button, .inline-form.compact button, .hk-assign button, .table button, .table .btn { min-height: 32px; }
  .who button.link { min-height: 32px; padding: .3rem .2rem; }
  .action-group summary { min-height: 44px; display: flex; align-items: center; }
  .settings-group summary.settings-link { width: 2.75rem; height: 2.75rem; }
  .action-menu a { padding: .7rem .9rem; }
  .tabs a { padding: .7rem .9rem; }
}

/* Tablets in portrait and phones: the practice menus fold behind a Menu button (nav.js), the signed-in strip wraps. */
@media (max-width: 800px) {
  .topbar { padding: .5rem 1rem; gap: .4rem .8rem; }
  .js-nav .topbar .nav-toggle { display: inline-flex; align-items: center; gap: .5rem; order: 1; margin-left: auto; min-height: 44px;
    padding: .4rem .85rem; background: transparent; color: var(--bs-header-text); border: 1px solid rgba(255,255,255,.45); border-radius: 6px; font-family: var(--display); }
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 1px; position: relative; }
  .nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-bars::before { top: -6px; } .nav-toggle-bars::after { top: 6px; }
  .topbar.nav-open .nav-toggle { background: rgba(255,255,255,.14); }
  .who { order: 2; width: 100%; margin-left: 0; gap: .3rem .9rem; font-size: .85rem; }
  .hotel-actions { order: 3; width: 100%; overflow-x: visible; }
  .js-nav .topbar .hotel-actions { display: none; }
  .js-nav .topbar.nav-open .hotel-actions { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: .3rem 0 .5rem;
    border-top: 1px solid rgba(255,255,255,.25); }
  .topbar .hotel-actions .action-group summary { padding: .65rem .6rem; }
  /* Inside the open menu each group's links drop down in place instead of floating over the page. */
  .topbar .hotel-actions .action-menu { position: static; min-width: 0; margin: 0 0 .4rem .6rem; box-shadow: none; }
  .topbar .hotel-actions .action-menu a { white-space: normal; }
  /* The settings cog's menu stays a drop-down, kept on screen. */
  .settings-menu { position: fixed; top: auto; left: .5rem !important; right: .5rem !important; min-width: 0; max-height: 70vh; overflow-y: auto; }
  .page { margin-top: 1rem; }
  .page-head h1 { font-size: 1.35rem; }
  h1 small { display: block; margin-left: 0; }
  .diary-tabs { margin-left: 0; }
  .login { margin: 1.5rem auto; gap: 1.5rem; }
  .login-brand img { width: 220px; }
}

/* Tablets and phones: wide tables scroll sideways inside their own box, never the page; action buttons wrap. */
.card .row-actions { flex-wrap: wrap; }
@media (max-width: 1100px) {
  .card:has(> .table), .card:has(> table), section:has(> .table), .card:has(> form > .table) { overflow-x: auto; }
  /* A list table straight on the page (Owners, pen bookings...) becomes its own scrolling box. */
  .page > .table, .page > table, .page > form > .table { display: block; overflow-x: auto; }
  /* A scrolling box would clip a floating pop-up, so in-table pop-ups (Void ...) open in place. */
  .inline-menu[open] form { position: static; box-shadow: none; padding: .4rem 0 0; border: none; background: transparent; }
}

/* Phones: one column, 16px fields (smaller ones make iPhones zoom in), tables and wide grids scroll inside their box. */
@media (max-width: 767px) {
  input:not([type=checkbox]):not([type=radio]), select, textarea { font-size: 16px !important; }
  .form .two, .two, .three, .four { grid-template-columns: 1fr; }
  .inline-form > div { flex-basis: 100%; }
  .inline-form.compact { flex-wrap: wrap; }
  .card { padding: 1rem; }
  .inline-menu input, form.inline.reset input, form.inline.role-form select { width: 100%; max-width: 100%; }
  form.inline { flex-wrap: wrap; }
  .datebar input, .datebar select, form.inline input { max-width: 100%; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis.compact { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
  .kpi .value { font-size: 1.35rem; }
  .welcome { padding: 1rem 1.1rem; gap: 1rem; }
  .welcome h1 { font-size: 1.5rem; }
  .ring { width: 104px; height: 104px; } .ring > div { width: 82px; height: 82px; }
  .tile { min-width: 0; flex: 1 1 100px; padding: .45rem .7rem; overflow-wrap: anywhere; }
  .tile strong { font-size: 1.3rem; margin-right: .3rem; }
  .facts { grid-template-columns: 1fr; gap: 0 1rem; }
  .facts dt { margin-top: .4rem; }
  .pay-type { flex-wrap: wrap; }
  .form-actions { flex-wrap: wrap; }
  .site-footer { flex-direction: column; gap: .3rem; padding: 1rem; }
  .steps li { padding-left: 2rem; }
  .invoice { padding: 1rem; }
  .hotel-doc { text-align: left; margin-left: 0; }
  .wx-days { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .segmented { flex-wrap: wrap; }
  .perm-grid, .role-cards, .provider-cards, .hotel-choices, .report-tiles, .hk-grid { grid-template-columns: 1fr; }
}

/* The pen timeline and the diary scroll sideways inside their own box; the pen / time column stays put. */
.grid .col-unit { position: sticky; left: 0; z-index: 1; background: var(--surface); }
@media (max-width: 767px) {
  .grid-head, .grid-row { grid-template-columns: 120px 90px minmax(180px, 1fr) minmax(280px, 1.3fr); min-width: 760px; gap: .6rem; padding: .5rem .6rem; }
  .diary-wrap { max-height: 70vh; }
  .diary-time { padding: 0 .3rem; }
}

/* Light / Dark / System switch: in the signed-in strip of the top bar (it stays visible on phones); signed out, at the right. */
.who .theme-slot { display: inline-flex; }
@media (max-width: 800px) {
  .topbar > .who.signed-out { order: 1; width: auto; margin-left: auto; }   /* signed out: beside the brand, not on a row of its own */
}

@media print {
  .bs-theme-toggle { display: none !important; }
}

/* ---- Paper is always light: bills, invoices, clinical histories and reports print with the light palette even when the
   screen is dark. ---- */
@media print {
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
    color-scheme: light;
    --bs-bg: #ffffff; --bs-surface: #ffffff; --bs-surface-2: #f7f9fc; --bs-field: #ffffff; --bs-code-bg: #edf1f6;
    --bs-text: #142033; --bs-muted: #5d6b80; --bs-border: #d9dfe8; --bs-border-strong: #b6c1d1; --bs-field-border: #7d8a9e;
    --bs-link: #24588f; --bs-primary: #0d2240; --bs-primary-hover: #163156; --bs-primary-text: #ffffff;
    --bs-accent: #c8a24c; --bs-accent-soft: #f4ead2; --bs-accent-text: #7a5d17;
    --bs-ok: #276b48; --bs-ok-soft: #e2f2e9; --bs-warn: #8a5a0f; --bs-warn-soft: #fbefd6;
    --bs-bad: #b23a33; --bs-bad-soft: #f8e1df; --bs-info: #24588f; --bs-info-soft: #e1ecf8;
    --waiting: #6a4fb0;
  }
  html, body { background: #fff !important; color: #142033; }
}

/* ---- Wide screens (23 Oct 2026): the page and footer follow the window instead of stopping at 1200px.
   The gutter grows with the screen (16px phones -> 48px wide monitors). Sign-in, invoices and the booking page
   keep their own readable widths. ---- */
.page, .site-footer {
  max-width: none;
  width: 100%;
  box-sizing: border-box;
  padding-left: clamp(1rem, 2.5vw, 3rem);
  padding-right: clamp(1rem, 2.5vw, 3rem);
}