/* Snow Lion PMS — one stylesheet, no external requests (Kaza internet is slow). */

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/atkinson-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/atkinson-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #F3F4F2;
  --panel: #FFFFFF;
  --ink: #1C2230;
  --ink-2: #485064;
  --ink-3: #6E7687;
  --line: #DCDFE4;
  --line-2: #ECEEF1;
  --field: #C4C9D2;
  --ridge: #E2DFD6;
  --maroon: #7A1E2C;
  --maroon-2: #5F1622;
  --maroon-tint: #F5E8EA;
  --ochre: #C98A1B;
  /* Prayer-flag colours: one per state of a stay */
  --flag-blue: #2B5BA6;   --flag-blue-bg: #E4ECF8;
  --flag-green: #1F7A4F;  --flag-green-bg: #DDF0E5;
  --flag-yellow: #D9A520; --flag-yellow-bg: #FBF0CF; --flag-yellow-ink: #7D5A0B;
  --flag-red: #B83A2E;    --flag-red-bg: #F8E2DF;
  --grey: #7D8494;        --grey-bg: #EEF0F3;
  --font: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
}
a { color: var(--maroon); }
h1, h2, h3 { line-height: 1.25; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
p { margin: 0 0 10px; }
code { font-size: 13px; background: var(--line-2); padding: 2px 5px; border-radius: 4px; word-break: break-all; }
img, svg { display: block; }
:focus-visible { outline: 3px solid var(--ochre); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; top: 12px; z-index: 100; background: #fff; padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 12px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
  background: var(--panel); border-right: 1px solid var(--line);
  padding: 18px 12px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; color: var(--ink); text-decoration: none; }
.brand-name { font-weight: 700; font-size: 17px; line-height: 1.2; }
.logo-mark { width: 52px; height: 34px; flex: none; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: 8px;
  color: var(--ink-2); text-decoration: none; font-size: 15px;
}
.nav-link:hover { background: var(--line-2); color: var(--ink); }
.nav-link.is-active { background: var(--maroon-tint); color: var(--maroon); font-weight: 700; }
.ic { width: 20px; height: 20px; flex: none; }
.badge {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--maroon); color: #fff; font-size: 12px; font-weight: 700;
  display: inline-grid; place-items: center;
}
.side-foot {
  margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--line-2);
  display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink-3);
}
.side-foot .ic { width: 18px; height: 18px; }
.linkish {
  background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; text-align: left;
}
.linkish:hover { color: var(--maroon); }
.scrim { display: none; }
.page { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 22px 32px 12px; }
.title-wrap { min-width: 0; }
.topbar h1 { font-size: 26px; margin: 0; letter-spacing: -0.01em; }
.subtitle { margin: 2px 0 0; color: var(--ink-3); font-size: 15px; }
.actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.main { padding: 8px 32px 56px; max-width: 1480px; width: 100%; }
.menu-btn {
  display: none; width: 42px; height: 42px; flex: none; place-items: center;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); cursor: pointer;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--ink);
  font: inherit; font-size: 14.5px; font-weight: 700; line-height: 1;
  text-decoration: none; white-space: nowrap; cursor: pointer;
}
.btn:hover { background: #F7F8F9; border-color: #C9CDD4; }
.btn .ic { width: 18px; height: 18px; }
.btn-primary { background: var(--maroon); border-color: var(--maroon); color: #fff; }
.btn-primary:hover { background: var(--maroon-2); border-color: var(--maroon-2); }
.btn-go { background: var(--flag-green); border-color: var(--flag-green); color: #fff; }
.btn-go:hover { background: #17633F; border-color: #17633F; }
.btn-danger { color: var(--flag-red); border-color: #E6C2BD; }
.btn-danger:hover { background: var(--flag-red-bg); border-color: var(--flag-red); }
.btn-small { height: 32px; padding: 0 10px; font-size: 13.5px; border-radius: 7px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--line-2); border-color: transparent; }
.btn[disabled], .btn.is-disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.inline-form { display: inline; }

/* ---------- Panels & layout ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 20px; margin-bottom: 20px; min-width: 0;
}
.panel > h2:first-child { margin-top: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; }
.panel-flush { padding: 0; overflow: hidden; }
.panel-flush .panel-head { padding: 16px 20px 0; }
.cols { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.split { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.muted { color: var(--ink-3); }
.small { font-size: 13.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 16px; }
.mb0 { margin-bottom: 0; }
.hide { display: none !important; }
.good-text { color: var(--flag-green); }
.warn-text { color: var(--flag-yellow-ink); }
.bad-text { color: var(--flag-red); }
.strong { font-weight: 700; }

/* ---------- Flash, callouts, empty states ---------- */
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 700; border: 1px solid; }
.flash-success { background: var(--flag-green-bg); border-color: #B5DCC5; color: #155C3A; }
.flash-error { background: var(--flag-red-bg); border-color: #EBC4BF; color: #8E2A20; }
.flash-info { background: var(--flag-blue-bg); border-color: #C7D6EE; color: #1F477F; }
.flash-warning { background: var(--flag-yellow-bg); border-color: #EBD9A0; color: var(--flag-yellow-ink); }
.callout {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: 10px; margin-bottom: 18px;
  background: var(--flag-red-bg); border: 1px solid #EBC4BF;
}
.callout .ic { color: var(--flag-red); margin-top: 1px; }
.callout.info { background: var(--flag-blue-bg); border-color: #C7D6EE; }
.callout.info .ic { color: var(--flag-blue); }
.callout.warn { background: var(--flag-yellow-bg); border-color: #EBD9A0; }
.callout.warn .ic { color: var(--flag-yellow-ink); }
.callout p:last-child { margin-bottom: 0; }
.empty { padding: 26px 20px; text-align: center; color: var(--ink-3); border: 1px dashed var(--field); border-radius: 12px; }
.empty p { margin: 0 0 12px; }
.empty p:last-child { margin: 0; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.t { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.t th {
  text-align: left; font-size: 13px; font-weight: 700; color: var(--ink-3);
  padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.t td { padding: 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.t tbody tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: #FAFBFB; }
.t .num { text-align: right; white-space: nowrap; }
.t tfoot td { font-weight: 700; border-top: 1px solid var(--line); border-bottom: 0; }
.t .row-link { color: var(--ink); font-weight: 700; text-decoration: none; }
.t .row-link:hover { color: var(--maroon); text-decoration: underline; }
.t .sub { display: block; font-size: 13px; color: var(--ink-3); }
.t-compact td { padding: 7px 10px; }
.panel-flush .t th:first-child, .panel-flush .t td:first-child { padding-left: 20px; }
.panel-flush .t th:last-child, .panel-flush .t td:last-child { padding-right: 20px; }

/* ---------- Status pills: a small flag + label ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 1px 9px 1px 7px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; line-height: 1.7; white-space: nowrap;
}
.pill::before { content: ""; width: 10px; height: 7px; border-radius: 1px; background: currentColor; }
.flag-blue { background: var(--flag-blue-bg); color: var(--flag-blue); }
.flag-green { background: var(--flag-green-bg); color: var(--flag-green); }
.flag-yellow { background: var(--flag-yellow-bg); color: var(--flag-yellow-ink); }
.flag-yellow::before { background: var(--flag-yellow); }
.flag-red { background: var(--flag-red-bg); color: var(--flag-red); }
.flag-white { background: #fff; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.flag-white::before { background: #fff; box-shadow: 0 0 0 1px var(--ink-3); }
.flag-grey { background: var(--grey-bg); color: var(--grey); }
.chan { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; }
.chan i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.hk { font-size: 13px; font-weight: 700; white-space: nowrap; }
.hk-ok { color: var(--flag-green); }
.hk-warn { color: var(--flag-yellow-ink); }
.hk-bad { color: var(--flag-red); }
.tag { display: inline-block; padding: 0 7px; border-radius: 5px; background: var(--line-2); color: var(--ink-2); font-size: 12.5px; font-weight: 700; line-height: 1.7; }
.tag-bad { background: var(--flag-red-bg); color: var(--flag-red); }
.tag-warn { background: var(--flag-yellow-bg); color: var(--flag-yellow-ink); }
.tag-good { background: var(--flag-green-bg); color: var(--flag-green); }
a.tag { text-decoration: none; }
.tag-group { background: #EDE7F6; color: #5B3F99; }
a.tag-group:hover { background: #E0D6F2; }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 14px 16px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.span-2 { grid-column: span 2; }
.field.full { grid-column: 1 / -1; }
label, .label { font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
input:not([type]), input[type="text"], input[type="number"], input[type="date"], input[type="email"], input[type="tel"],
input[type="password"], input[type="search"], input[type="url"], input[type="time"], input[type="datetime-local"], select, textarea {
  width: 100%; height: 42px; padding: 0 12px;
  border: 1px solid var(--field); border-radius: 8px; background: #fff;
  font: inherit; font-size: 15px; color: var(--ink);
}
select { padding-right: 32px; }
textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(201, 138, 27, .35); outline-offset: 0; border-color: var(--ochre); }
input[readonly] { background: var(--line-2); }
.hint { font-size: 13px; color: var(--ink-3); font-weight: 400; }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: 14.5px; font-weight: 400; color: var(--ink); cursor: pointer; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--maroon); flex: none; }
fieldset { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
legend { font-weight: 700; font-size: 16px; margin-bottom: 12px; padding: 0; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
.input-prefix { position: relative; }
.input-prefix span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.input-prefix input { padding-left: 30px; }
.input-suffix { position: relative; }
.input-suffix span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.input-suffix input { padding-right: 32px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.filters .field { min-width: 150px; }
.filters .field.wide { min-width: 240px; flex: 1; }
details.drawer { border: 1px solid var(--line); border-radius: 12px; padding: 0 18px; margin-bottom: 18px; background: #fff; }
details.drawer > summary { cursor: pointer; padding: 14px 0; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 8px; }
details.drawer > summary::-webkit-details-marker { display: none; }
details.drawer > summary::before { content: "+"; width: 20px; text-align: center; color: var(--maroon); font-size: 18px; line-height: 1; }
details.drawer[open] > summary::before { content: "–"; }
details.drawer[open] > summary { border-bottom: 1px solid var(--line-2); margin-bottom: 16px; }
details.drawer > :last-child { margin-bottom: 18px; }

/* ---------- Tabs & pager ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tab {
  padding: 10px 14px; margin-bottom: -1px;
  color: var(--ink-2); font-weight: 700; text-decoration: none; white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--maroon); border-bottom-color: var(--maroon); }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 16px; color: var(--ink-3); }

/* ---------- Today: the key board ---------- */
.board-note { color: var(--ink-2); margin: -2px 0 14px; }
.keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; }
.key {
  position: relative; display: flex; flex-direction: column; gap: 1px;
  min-height: 116px; padding: 26px 12px 11px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  color: var(--ink); text-decoration: none;
}
.key::before {
  content: ""; position: absolute; top: 8px; left: 50%;
  width: 12px; height: 12px; margin-left: -6px; border-radius: 50%;
  background: var(--paper); box-shadow: inset 0 0 0 2px var(--line);
}
.key:hover { border-color: #B9BEC7; }
.key .no { font-size: 24px; font-weight: 700; line-height: 1.1; letter-spacing: -0.01em; }
.key .type { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.key .state { margin-top: auto; font-size: 13.5px; font-weight: 700; }
.key .who { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.key .dirt { position: absolute; top: 6px; right: 8px; font-size: 11.5px; font-weight: 700; color: var(--flag-yellow-ink); }
.key.is-in { background: var(--flag-green-bg); border-color: #A9D5BC; }
.key.is-in .state { color: var(--flag-green); }
.key.is-arriving { background: var(--flag-blue-bg); border-color: #B7C9E8; }
.key.is-arriving .state { color: var(--flag-blue); }
.key.is-tentative { background: var(--flag-yellow-bg); border-color: #E6D193; }
.key.is-tentative .state { color: var(--flag-yellow-ink); }
.key.is-hold { background: var(--flag-red-bg); border-color: #E6BDB7; }
.key.is-hold .state { color: var(--flag-red); }
.key.is-out { background: repeating-linear-gradient(135deg, #fff, #fff 6px, var(--line-2) 6px, var(--line-2) 12px); }
.key.is-out .state { color: var(--flag-red); }
.key.is-free .state { color: var(--ink-3); }
.key .leave { font-size: 12.5px; font-weight: 700; color: var(--maroon); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; font-size: 13px; color: var(--ink-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 10px; border-radius: 2px; display: inline-block; border: 1px solid var(--line); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.list li:last-child { border-bottom: 0; }
.list .name { font-weight: 700; }
.list .meta { font-size: 13.5px; color: var(--ink-3); }
.list a.name { color: var(--ink); text-decoration: none; }
.list a.name:hover { color: var(--maroon); text-decoration: underline; }
.attn .ic { color: var(--flag-red); }
.attn .ic.warn { color: var(--flag-yellow-ink); }
.money-rows { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; font-variant-numeric: tabular-nums; }
.money-rows .total { border-top: 1px solid var(--line); padding-top: 8px; font-weight: 700; }
.sync-line { font-size: 13.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.sync-line .ic { width: 16px; height: 16px; }

/* ---------- Calendar (tape chart) ---------- */
.cal-nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.cal-nav form { display: flex; gap: 8px; align-items: center; }
.cal-nav input[type="date"] { width: 170px; height: 40px; }
.cal-nav select { width: auto; height: 40px; }
.tape { --cell: 58px; --label: 128px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; container-type: inline-size; }
.tape-inner { min-width: calc(var(--label) + var(--days) * var(--cell)); }
/* Stretch the days to fill wide screens; never narrower than 58px. */
@supports (width: 1cqw) {
  .tape-inner { --cell: max(58px, calc((100cqw - var(--label) - 1px) / var(--days))); }
}
.tape-row { display: flex; border-bottom: 1px solid var(--line-2); }
.tape-row:last-child { border-bottom: 0; }
.tape-label {
  position: sticky; left: 0; z-index: 3; width: var(--label); flex: none;
  display: flex; flex-direction: column; justify-content: center;
  padding: 6px 10px; background: #fff; border-right: 1px solid var(--line);
}
.tape-label a { color: var(--ink); text-decoration: none; font-weight: 700; }
.tape-label small { font-size: 12px; color: var(--ink-3); font-weight: 400; }
.tape-track { position: relative; display: grid; grid-template-columns: repeat(var(--days), var(--cell)); min-height: 46px; }
.tape-head { position: sticky; top: 0; z-index: 4; background: #fff; border-bottom: 1px solid var(--line); }
.tape-head .tape-label { font-size: 13px; color: var(--ink-3); }
.tape-day { text-align: center; padding: 7px 0 6px; font-size: 12px; color: var(--ink-3); border-left: 1px solid var(--line-2); line-height: 1.25; }
.tape-day b { display: block; font-size: 15px; color: var(--ink); }
.tape-day.is-weekend, .cell.is-weekend { background: #FAFAF7; }
.tape-day.is-today { background: var(--maroon-tint); }
.tape-day.is-today b { color: var(--maroon); }
.cell { grid-row: 1; border-left: 1px solid var(--line-2); }
a.cell:hover { background: var(--flag-blue-bg); }
.cell.is-today { background: #FCF6F7; }
.tape-type .tape-label { background: #F7F8F6; font-weight: 700; font-size: 14px; }
.tape-type .tape-track { min-height: 30px; background: #F7F8F6; }
.avail { grid-row: 1; align-self: center; text-align: center; font-size: 12.5px; color: var(--ink-3); }
.avail.is-zero { color: var(--flag-red); font-weight: 700; }
.avail.is-neg { color: #fff; background: var(--flag-red); font-weight: 700; align-self: stretch; display: grid; place-items: center; }
.bar {
  grid-row: 1; z-index: 2; align-self: center; height: 32px; min-width: 0;
  margin: 0 calc(var(--cell) / 2 + 1px);
  display: flex; align-items: center; gap: 6px; padding: 0 8px;
  border-radius: 6px; font-size: 13px; font-weight: 700; line-height: 1;
  white-space: nowrap; overflow: hidden; text-decoration: none; color: #fff;
}
.bar span { overflow: hidden; text-overflow: ellipsis; }
.bar.clip-l { margin-left: 1px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.bar.clip-r { margin-right: 1px; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.bar i { width: 8px; height: 8px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1.5px #fff; }
.bar.flag-blue { background: var(--flag-blue); color: #fff; }
.bar.flag-green { background: var(--flag-green); color: #fff; }
.bar.flag-yellow { background: var(--flag-yellow); color: var(--ink); }
.bar.flag-red { background: var(--flag-red); color: #fff; }
.bar.flag-white { background: #fff; color: var(--ink-2); box-shadow: inset 0 0 0 1.5px #9AA1AE; }
.bar::before { display: none; }
.bar .warnmark { background: #fff; color: var(--flag-red); border-radius: 50%; width: 16px; height: 16px; display: inline-grid; place-items: center; font-size: 11px; flex: none; }
.bar:hover { filter: brightness(1.08); }
.bar.is-group { background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .2) 0 5px, transparent 5px 10px); }
.bar.flag-white.is-group { background-image: repeating-linear-gradient(135deg, rgba(28, 34, 48, .07) 0 5px, transparent 5px 10px); }
.tape-unassigned .tape-label { color: var(--flag-red); font-size: 13px; font-weight: 700; }

/* ---------- Availability board ---------- */
.avail-table th, .avail-table td { text-align: center; padding: 8px 6px; min-width: 46px; }
.avail-table th:first-child, .avail-table td:first-child { text-align: left; position: sticky; left: 0; background: #fff; z-index: 1; min-width: 170px; }
.avail-table .day b { display: block; font-size: 14px; color: var(--ink); }
.avail-table .is-weekend { background: #FAFAF7; }
.a-zero { background: var(--flag-red-bg); color: var(--flag-red); font-weight: 700; }
.a-one { background: var(--flag-yellow-bg); color: var(--flag-yellow-ink); font-weight: 700; }
.a-neg { background: var(--flag-red); color: #fff; font-weight: 700; }

/* ---------- Booking & folio ---------- */
.res-head { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 18px; }
.res-head .ref { color: var(--ink-3); }
.dl { display: grid; grid-template-columns: minmax(96px, 150px) 1fr; gap: 7px 14px; margin: 0; }
.dl dt { color: var(--ink-3); font-size: 14px; }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 5px 24px; max-width: 380px; margin: 14px 0 0 auto; font-variant-numeric: tabular-nums; }
.totals .grand { font-size: 18px; font-weight: 700; border-top: 1px solid var(--line); padding-top: 8px; }
.totals .due { font-weight: 700; }
.action-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.mini-form { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-items: end; }

/* ---------- Groups ---------- */
.choice { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.choice:has(input:checked) { border-color: var(--maroon); background: var(--maroon-tint); }
.choice > span { display: flex; flex-direction: column; gap: 2px; }
.group-rooms td { vertical-align: middle; }
.group-rooms input { height: 38px; }
.rooming { min-width: 1040px; }
.rooming td { vertical-align: top; padding: 8px 6px; }
.rooming th { padding: 8px 6px; }
.rooming input, .rooming select { height: 36px; font-size: 14px; padding: 0 8px; }
.rooming select { padding-right: 26px; }
.rooming .room-pick { width: 132px; }
.rooming td:nth-child(2) input { width: 100%; min-width: 160px; }
.rooming td:nth-child(3) input { width: 124px; }
.rooming td:nth-child(4) input { width: 104px; }
.rooming .id-cell { display: flex; gap: 6px; }
.rooming .id-cell select { width: 120px; }
.rooming .id-cell input { width: 124px; }
.rooming .people { white-space: nowrap; }
.rooming .people input { width: 56px; }
.rooming .people input + label + input { margin-left: 4px; }
.rooming tr.is-done td { color: var(--ink-3); background: #FAFBFB; }
.rooming .sub { margin-top: 3px; }
.panel-flush .rooming th:first-child, .panel-flush .rooming td:first-child { padding-left: 20px; }
.downloads { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px 24px; }
.downloads li { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.downloads span { font-size: 13.5px; color: var(--ink-3); }

/* ---------- POS ---------- */
body.pos-mode .main { padding-bottom: 16px; max-width: none; }
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 18px; height: calc(100vh - 118px); min-height: 560px; }
.pos-menu { display: flex; flex-direction: column; min-height: 0; }
.running { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; min-height: 0; }
.run-chip {
  flex: none; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; font: inherit; text-align: left; cursor: pointer; color: var(--ink);
}
.run-chip b { display: block; font-size: 14px; }
.run-chip span { font-size: 12.5px; color: var(--ink-3); }
.run-chip.is-current { border-color: var(--maroon); box-shadow: inset 0 0 0 1px var(--maroon); }
.run-chip.new { border-style: dashed; color: var(--maroon); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.pos-cats { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; }
.cat-btn {
  flex: none; height: 38px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; font: inherit; font-weight: 700; font-size: 14px; color: var(--ink-2); cursor: pointer;
}
.cat-btn.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.pos-search { margin: 2px 0 10px; }
.pos-items { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; align-content: start; padding: 2px 2px 12px; }
.item-btn {
  position: relative; text-align: left; min-height: 86px; padding: 12px 12px 10px;
  border-radius: 10px; border: 1px solid var(--line); background: #fff;
  font: inherit; color: var(--ink); cursor: pointer; display: flex; flex-direction: column; gap: 6px;
}
.item-btn:hover { border-color: #B9BEC7; }
.item-btn:active { transform: scale(.98); }
.item-btn .nm { font-weight: 700; line-height: 1.25; padding-right: 18px; }
.item-btn .pr { margin-top: auto; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.item-btn .in-order { position: absolute; right: 8px; bottom: 8px; min-width: 22px; height: 22px; border-radius: 11px; background: var(--maroon); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }
.veg { position: absolute; top: 11px; right: 10px; width: 13px; height: 13px; border: 1.5px solid var(--flag-green); display: grid; place-items: center; border-radius: 2px; }
.veg::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--flag-green); }
.veg.non { border-color: #8F3A23; }
.veg.non::after { background: #8F3A23; }
.pos-order { background: #fff; border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; min-height: 0; }
.pos-order-head { padding: 14px 16px 12px; border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 10px; }
.seg { display: flex; background: var(--line-2); border-radius: 9px; padding: 3px; gap: 3px; }
.seg button {
  flex: 1; height: 34px; border: 0; border-radius: 7px; background: transparent;
  font: inherit; font-weight: 700; font-size: 14px; color: var(--ink-2); cursor: pointer;
}
.seg button.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(28, 34, 48, .14); }
.pos-lines { flex: 1; overflow-y: auto; padding: 4px 16px; }
.pos-empty { color: var(--ink-3); text-align: center; padding: 32px 8px; }
.line { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.line:last-child { border-bottom: 0; }
.line .nm { font-weight: 700; line-height: 1.3; }
.line .sub { font-size: 13px; color: var(--ink-3); }
.line .amt { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.line .note-in { grid-column: 1 / -1; height: 34px; font-size: 14px; }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: #fff;
  font: inherit; font-size: 18px; line-height: 1; cursor: pointer; color: var(--ink);
}
.qty span { min-width: 26px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.line .sent { font-size: 12px; color: var(--flag-green); font-weight: 700; }
.pos-total { padding: 12px 16px; border-top: 1px solid var(--line); }
.pos-total .money-rows { font-size: 14.5px; }
.pos-total .grand { font-size: 20px; font-weight: 700; }
.pos-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 16px 16px; }
.pos-buttons .btn { height: 50px; font-size: 15px; }
.pos-buttons .wide { grid-column: 1 / -1; }
.pos-jump { display: none; }

dialog {
  border: 0; border-radius: 14px; padding: 0; width: min(540px, calc(100vw - 24px));
  color: var(--ink); box-shadow: 0 24px 64px rgba(28, 34, 48, .32);
}
dialog::backdrop { background: rgba(28, 34, 48, .45); }
.dlg-head { padding: 18px 20px 6px; display: flex; align-items: center; justify-content: space-between; }
.dlg-head h2 { margin: 0; }
.dlg-body { padding: 10px 20px; max-height: 70vh; overflow-y: auto; }
.dlg-foot { padding: 12px 20px 18px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.pay-row { display: grid; grid-template-columns: 1fr 130px 34px; gap: 8px; margin-bottom: 8px; }
.pay-row .btn { padding: 0; height: 42px; }
.dlg-error { color: var(--flag-red); font-weight: 700; min-height: 1.5em; }

/* ---------- Reports ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 20px; overflow: hidden; }
.stat { padding: 16px 18px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); margin: 0 -1px -1px 0; }
.stat .v { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat .l { font-size: 13.5px; color: var(--ink-3); }
.barline { height: 8px; border-radius: 4px; background: var(--line-2); overflow: hidden; min-width: 80px; }
.barline span { display: block; height: 100%; background: var(--maroon); }

/* ---------- Plain pages (login, install, errors) ---------- */
body.plain { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.plain-box, .login-card {
  width: min(440px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 30px 28px;
}
.login-card .logo-mark { width: 78px; height: 51px; margin-bottom: 14px; }
.login-card h1 { font-size: 24px; margin: 0 0 4px; }
.login-card .field { margin-bottom: 14px; }
.login-card .btn { width: 100%; height: 46px; margin-top: 4px; }
.install-box { width: min(720px, 100%); }
.checklist { list-style: none; padding: 0; margin: 0 0 18px; }
.checklist li { padding: 6px 0; display: flex; gap: 8px; align-items: center; }
.checklist .ic { width: 18px; height: 18px; }

/* ---------- Print: invoices, bills, kitchen tickets ---------- */
.print-body { background: #E7E9EC; font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif; }
.print-tools { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding: 16px; }
.print-flash { max-width: 640px; margin: 0 auto 14px; }
.sheet { background: #fff; margin: 0 auto 40px; box-shadow: 0 4px 24px rgba(0, 0, 0, .12); color: #000; }
.print-a4 .sheet { width: 210mm; max-width: 100%; min-height: 297mm; padding: 14mm 14mm; font-size: 12.5px; line-height: 1.45; }
.print-receipt .sheet { width: 80mm; padding: 4mm 4mm 8mm; font-size: 12.5px; line-height: 1.35; }
.paper-58.print-receipt .sheet { width: 58mm; font-size: 11.5px; }
.inv-head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 12px; border-bottom: 2px solid #000; }
.inv-head .logo-mark { width: 60px; height: 40px; margin-bottom: 6px; }
.inv-hotel { font-size: 18px; font-weight: 700; }
.inv-title { font-size: 20px; font-weight: 700; text-align: right; }
.inv-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 14px 0; }
.inv-meta h3 { font-size: 12px; margin: 0 0 4px; color: #444; }
.inv-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.inv-table th, .inv-table td { border: 1px solid #B8BEC8; padding: 5px 7px; vertical-align: top; }
.inv-table th { background: #F1F2F4; font-size: 11.5px; text-align: left; }
.inv-table .num { text-align: right; white-space: nowrap; }
.inv-sum { display: flex; justify-content: space-between; gap: 24px; margin-top: 12px; align-items: flex-start; }
.inv-sum .totals { margin: 0; min-width: 270px; }
.words { font-style: italic; margin-top: 8px; }
.sign { margin-top: 56px; display: flex; justify-content: space-between; gap: 24px; }
.sign div { border-top: 1px solid #000; padding-top: 4px; min-width: 180px; text-align: center; }
.inv-foot { margin-top: 18px; font-size: 11.5px; color: #333; }
.rc-center { text-align: center; }
.rc-hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
.rc-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.rc-table td { padding: 2px 0; vertical-align: top; }
.rc-table .r { text-align: right; white-space: nowrap; padding-left: 6px; }
.rc-big { font-size: 15px; font-weight: 700; }
.rc-name { font-size: 15px; font-weight: 700; }
.kot-line td { font-size: 16px; font-weight: 700; padding: 4px 0; }
.kot-cancel td { text-decoration: line-through; }

@page { margin: 12mm; }
@page receipt { size: 80mm auto; margin: 2mm; }
@page receipt58 { size: 58mm auto; margin: 2mm; }
@media print {
  .print-tools, .print-flash { display: none !important; }
  .print-body { background: #fff; }
  .sheet { box-shadow: none; margin: 0; min-height: 0 !important; padding: 0 !important; width: auto !important; }
  .print-receipt .sheet { page: receipt; }
  .paper-58.print-receipt .sheet { page: receipt58; }
  a { color: #000; text-decoration: none; }
}

/* ---------- Small screens ---------- */
@media (max-width: 1180px) {
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 50;
    transform: translateX(-102%); transition: transform .2s ease;
    box-shadow: 0 0 40px rgba(28, 34, 48, .2);
  }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(28, 34, 48, .35); z-index: 40; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 14px 16px 8px; flex-wrap: wrap; }
  .topbar h1 { font-size: 22px; }
  .actions { width: 100%; justify-content: flex-start; margin-left: 0; }
  .main { padding: 6px 16px 40px; }
  .panel { padding: 16px; }
  .panel.panel-flush { padding: 0; }
  .panel-flush .panel-head { padding: 14px 16px 0; }
  .rooming { min-width: 0; }
  .rooming thead { display: none; }
  .rooming, .rooming tbody, .rooming tr, .rooming td { display: block; width: 100%; }
  .rooming tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .rooming td, .panel-flush .rooming td:first-child { padding: 4px 0; border: 0; }
  .rooming td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 3px; font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
  .rooming .room-pick, .rooming td input, .rooming td select { width: 100% !important; min-width: 0; height: 40px; }
  .rooming .id-cell { display: flex; gap: 8px; }
  .rooming td.id-cell { flex-wrap: wrap; }
  .rooming td.id-cell::before { position: static; flex-basis: 100%; }
  .rooming .id-cell select, .rooming .id-cell input { flex: 1; width: auto !important; }
  .rooming .people input { width: 80px !important; }
  .pos { grid-template-columns: minmax(0, 1fr); height: auto; }
  .pos-items { max-height: 52vh; }
  .pos-order { min-height: 420px; scroll-margin-top: 12px; }
  .keys { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
  .key { min-height: 100px; padding: 24px 10px 10px; }
  .key .no { font-size: 21px; }
  .pos-jump {
    position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 16px; border-radius: 12px; background: var(--ink); color: #fff;
    font-weight: 700; text-decoration: none; box-shadow: 0 8px 24px rgba(28, 34, 48, .3);
  }
  .pos-jump.hide { display: none; }
  body.pos-mode .main { padding-bottom: 84px; }
  .field.span-2 { grid-column: auto; }
  .downloads { grid-template-columns: minmax(0, 1fr); }
  .tape { --label: 96px; }
  .tape-label { padding: 6px 8px; font-size: 14px; }
  .inv-meta { grid-template-columns: 1fr; }
  .print-a4 .sheet { padding: 8mm 6mm; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
