/* HavenUP — design system
   Brand: deep forest green + midnight navy structure, metallic gold accents,
   white / warm cream surfaces. Task-status colours are deliberately outside the
   brand ramp so a status can never be confused with a brand accent. */

:root {
  --navy-900: #0a1723;
  --navy-800: #10263a;
  --navy-700: #17364f;
  --navy-500: #2b5878;
  --forest-900: #0d2b22;
  --forest-700: #14503d;
  --forest-500: #1d7a5c;
  --gold-600: #b78c22;
  --gold-500: #d3a63c;
  --gold-400: #e5bf63;
  --gold-100: #f7ecd2;
  --cream: #fbf7ef;
  --cream-2: #f4eee1;
  --white: #ffffff;

  /* task status — never brand colours, never colour alone */
  --st-full: #c2321f;      /* Full Clean */
  --st-light: #1f6fd0;     /* Light Clean */
  --st-linen: #d97a15;     /* Linen Change */
  --st-ready: #17855a;     /* Inspected / Ready */
  --st-ooo: #6b7480;       /* Out of order / decommissioned */

  --bg: var(--cream);
  --surface: var(--white);
  --surface-2: var(--cream-2);
  --line: #e2d9c7;
  --line-strong: #cdc0a6;
  --text: #16212b;
  --text-2: #4d5b68;
  --text-3: #7d8895;
  --header: var(--navy-900);
  --header-text: #eef4f8;
  --accent: var(--gold-600);
  --accent-text: #2a1f06;
  --focus: #2b7fd4;

  --r-sm: 4px;
  --r: 7px;
  --r-lg: 12px;
  --shadow: 0 1px 2px rgba(10, 23, 35, .07), 0 6px 18px -8px rgba(10, 23, 35, .16);
  --shadow-lg: 0 12px 40px -12px rgba(10, 23, 35, .35);
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, monospace;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --row-h: 30px;
  --col-w: 74px;
  --gutter: 210px;
}

html[data-theme="night"] {
  --bg: #071019;
  --surface: #0d1b27;
  --surface-2: #122536;
  --line: #1e3245;
  --line-strong: #2b4459;
  --text: #e8eef4;
  --text-2: #a6b6c4;
  --text-3: #7a8b9a;
  --header: #050c13;
  --header-text: #e8eef4;
  --accent: var(--gold-400);
  --accent-text: #1a1204;
  --st-full: #e2543f;
  --st-light: #4f9bf0;
  --st-linen: #eb9a3c;
  --st-ready: #2fae7a;
  --st-ooo: #8593a1;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 24px -10px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 14px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--forest-500); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- app frame ---------- */
.app { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  background: linear-gradient(103deg, var(--header) 0%, var(--navy-800) 58%, var(--forest-900) 100%);
  color: var(--header-text); border-bottom: 2px solid var(--gold-600);
  display: flex; align-items: center; gap: 18px; padding: 9px 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { display: block; width: auto; }
.brand .mark { height: 40px; }
.brand .wordmark { height: 26px; }
.brand .promise {
  font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--gold-400);
  border-left: 1px solid rgba(255, 255, 255, .22); padding-left: 12px;
}
@media (max-width: 1500px) {
  .brand .promise { display: none; }
}
@media (max-width: 900px) {
  .brand .wordmark { display: none; }
  .brand .promise { display: none; }
}
.brand .wm { display: flex; flex-direction: column; line-height: 1.05; }
.brand .wm b { font-size: 17px; letter-spacing: .01em; font-weight: 700; }
.brand .wm b i { font-style: normal; color: var(--gold-400); }
.brand .wm span { font-size: 10.5px; color: #9fb4c4; letter-spacing: .08em; text-transform: uppercase; }

.strip { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-left: 6px; }
.stat { display: flex; flex-direction: column; min-width: 62px; }
.stat b { font: 600 15px/1.1 var(--mono); color: var(--white); }
.stat span { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: #93a9ba; }
.topbar .spacer { flex: 1; }

.tb-btn {
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .16);
  color: var(--header-text); border-radius: var(--r); padding: 6px 11px; font-size: 12.5px;
  display: inline-flex; align-items: center; gap: 7px;
}
.tb-btn:hover { background: rgba(255, 255, 255, .14); }
.tb-btn kbd {
  font: 600 10.5px var(--mono); background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 3px; padding: 1px 4px;
}
.conn { display: flex; align-items: center; gap: 7px; font-size: 12px; color: #c9d8e3; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--st-ready); box-shadow: 0 0 0 3px rgba(23, 133, 90, .25); }
.dot.off { background: var(--st-full); box-shadow: 0 0 0 3px rgba(194, 50, 31, .25); }
.dot.wait { background: var(--st-linen); box-shadow: 0 0 0 3px rgba(217, 122, 21, .25); }
.pending-chip {
  font: 600 11px var(--mono); background: var(--st-linen); color: #1c1102;
  border-radius: 999px; padding: 2px 7px;
}
.who { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #c9d8e3; }
.who select {
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18);
  border-radius: var(--r-sm); padding: 4px 6px; color: var(--header-text); font-size: 12px;
}
.who select option { color: #16212b; }

/* ---------- module bar ---------- */
.modules {
  display: flex; gap: 2px; background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 0 10px; overflow-x: auto; position: sticky; top: 0; z-index: 30;
}
.mod {
  border: 0; background: none; padding: 11px 13px 9px; font-size: 13px; color: var(--text-2);
  border-bottom: 3px solid transparent; white-space: nowrap; display: flex; align-items: center; gap: 7px;
}
.mod:hover { color: var(--text); background: var(--surface-2); }
.mod[aria-selected="true"] { color: var(--text); border-bottom-color: var(--gold-600); font-weight: 600; }
.mod .badge {
  font: 600 10.5px var(--mono); background: var(--st-full); color: #fff; border-radius: 999px; padding: 1px 6px;
}
main { flex: 1; padding: 14px 16px 60px; }
.view { display: none; }
.view.on { display: block; }

/* ---------- generic pieces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card > header {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line);
}
.card > header h3 { font-size: 13.5px; }
.card > header .spacer { flex: 1; }
.card .body { padding: 14px; }
.muted { color: var(--text-3); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 12px; }
.btn {
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r);
  padding: 6px 11px; font-size: 12.5px; color: var(--text);
}
.btn:hover { border-color: var(--text-3); background: var(--surface-2); }
.btn.primary {
  background: linear-gradient(180deg, var(--gold-400), var(--gold-600)); border-color: var(--gold-600);
  color: var(--accent-text); font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.danger { border-color: var(--st-full); color: var(--st-full); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-lg { padding: 9px 14px; font-size: 13.5px; min-height: 40px; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--text-2); }
label.f input, label.f select, label.f textarea {
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  padding: 7px 8px; font-size: 13px; min-height: 36px;
}
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th {
  text-align: left; font: 600 10.5px/1 var(--sans); letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-3); padding: 8px 10px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--surface);
}
table.t td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:hover td { background: var(--surface-2); }
.mono { font-family: var(--mono); font-size: 12.5px; }

.tag {
  display: inline-flex; align-items: center; gap: 5px; font: 600 10.5px/1 var(--sans);
  letter-spacing: .04em; text-transform: uppercase; border-radius: 999px; padding: 4px 8px;
  border: 1px solid var(--line-strong); color: var(--text-2); background: var(--surface-2);
}
.tag.solid { color: #fff; border: 0; }
.tag[data-st="FULL"] { background: var(--st-full); color: #fff; border: 0; }
.tag[data-st="LIGHT"] { background: var(--st-light); color: #fff; border: 0; }
.tag[data-st="LINEN"] { background: var(--st-linen); color: #1c1102; border: 0; }
.tag[data-st="READY"] { background: var(--st-ready); color: #fff; border: 0; }
.tag[data-st="OOO"] { background: var(--st-ooo); color: #fff; border: 0; }
.tag.gold { background: var(--gold-100); color: #6d5210; border-color: var(--gold-400); }
.tag.vip { background: var(--forest-700); color: #fff; border: 0; }

.state { padding: 34px 16px; text-align: center; color: var(--text-3); }
.state h4 { font-size: 14px; color: var(--text-2); margin-bottom: 4px; }
.state.err { color: var(--st-full); }
.skel { background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: sh 1.3s infinite; border-radius: var(--r-sm); height: 12px; }
@keyframes sh { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---------- tape chart ---------- */
.tape-wrap { position: relative; overflow: hidden; }
.tape-tools { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11px; color: var(--text-2); align-items: center; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-right: 4px; }
.tape-scroll { overflow: auto; max-height: 68vh; position: relative; }
.tape { position: relative; min-width: max-content; }
.tape .thead { display: flex; position: sticky; top: 0; z-index: 12; background: var(--surface); box-shadow: 0 1px 0 var(--line); }
.tape .thead .cnr { width: var(--gutter); flex: none; border-right: 1px solid var(--line-strong); padding: 6px 10px; font: 600 10.5px/1.3 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.tape .day {
  width: var(--col-w); flex: none; text-align: center; padding: 5px 2px; border-right: 1px solid var(--line);
  font-size: 11px; color: var(--text-2);
}
.tape .day b { display: block; font: 600 13px var(--mono); color: var(--text); }
.tape .day.today { background: var(--gold-100); }
html[data-theme="night"] .tape .day.today { background: #2a2109; }
.tape .day.we { background: var(--surface-2); }
.trow { display: flex; height: var(--row-h); position: relative; }
.trow:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.trow .rmeta {
  width: var(--gutter); flex: none; display: flex; align-items: center; gap: 6px; padding: 0 10px;
  white-space: nowrap; min-width: 0;
  border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line); font-size: 12px;
  position: sticky; left: 0; background: var(--surface); z-index: 8;
}
.trow .rmeta b { font: 600 12.5px var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .rmeta .t { font: 600 10px var(--sans); letter-spacing: .05em; color: var(--text-3); }
.trow .rmeta .pip { width: 7px; height: 7px; border-radius: 2px; }
.trow.ooo .rmeta { background: repeating-linear-gradient(45deg, var(--surface) 0 6px, var(--surface-2) 6px 12px); color: var(--text-3); }
.cell { width: var(--col-w); flex: none; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cell.we { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.cell.drop { background: color-mix(in srgb, var(--gold-400) 28%, transparent); }
.bar {
  position: absolute; height: calc(var(--row-h) - 8px); top: 4px; border-radius: var(--r-sm);
  display: flex; align-items: center; gap: 6px; padding: 0 7px; font-size: 11.5px; color: #fff;
  cursor: grab; overflow: hidden; white-space: nowrap; z-index: 6;
  border-left: 3px solid rgba(255, 255, 255, .55); touch-action: none; user-select: none;
}
.bar:hover { filter: brightness(1.08); z-index: 9; }
.bar.drag { opacity: .32; cursor: grabbing; }
.bar[data-state="confirmed"] { background: var(--navy-700); }
.bar[data-state="arriving"] { background: var(--forest-700); }
.bar[data-state="in_house"] { background: var(--forest-500); }
.bar[data-state="departing"] { background: var(--navy-500); }
.bar[data-state="checked_out"] { background: #6a7787; }
.bar[data-state="ooo"] { background: repeating-linear-gradient(45deg, #5d6874 0 5px, #48525d 5px 10px); }
.bar .vipdot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold-400); flex: none; }
.ghost {
  position: absolute; height: calc(var(--row-h) - 8px); top: 4px; border-radius: var(--r-sm);
  border: 2px dashed var(--gold-500); background: color-mix(in srgb, var(--gold-400) 22%, transparent);
  z-index: 25; pointer-events: none; display: flex; align-items: center; padding: 0 6px;
  font: 600 11px var(--mono); color: var(--text);
}
.ghost.bad { border-color: var(--st-full); background: color-mix(in srgb, var(--st-full) 20%, transparent); color: var(--st-full); }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-5px); } 60% { transform: translateX(5px); } }
.shake { animation: shake .3s; }

/* ---------- room board ---------- */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 10px; }
.tile {
  background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--st-ooo);
  border-radius: var(--r); padding: 9px 10px; text-align: left; min-height: 96px;
  display: flex; flex-direction: column; gap: 5px; box-shadow: var(--shadow);
}
.tile:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.tile .num { display: flex; align-items: baseline; gap: 6px; }
.tile .num b { font: 700 18px var(--mono); }
.tile .num span { font: 600 10px var(--sans); letter-spacing: .06em; color: var(--text-3); }
.tile .who2 { font-size: 11.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .foot { margin-top: auto; display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.tile[data-st="FULL"] { border-left-color: var(--st-full); }
.tile[data-st="LIGHT"] { border-left-color: var(--st-light); }
.tile[data-st="LINEN"] { border-left-color: var(--st-linen); }
.tile[data-st="READY"] { border-left-color: var(--st-ready); }
.tile[data-st="OOO"] { border-left-color: var(--st-ooo); background: repeating-linear-gradient(45deg, var(--surface) 0 7px, var(--surface-2) 7px 14px); }
.tile .ico { font: 700 11px var(--mono); }

/* ---------- side panel ---------- */
.panel {
  position: fixed; top: 0; right: 0; height: 100%; width: min(440px, 94vw); background: var(--surface);
  border-left: 1px solid var(--line-strong); box-shadow: var(--shadow-lg); z-index: 60;
  transform: translateX(102%); transition: transform .22s ease; display: flex; flex-direction: column;
}
.panel.on { transform: none; }
.panel header { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.panel header h3 { font-size: 15px; }
.panel .content { overflow: auto; padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 14px; }
.kv { display: grid; grid-template-columns: 116px 1fr; gap: 6px 10px; font-size: 13px; }
.kv dt { color: var(--text-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; padding-top: 2px; }
.kv dd { margin: 0; }
.backdrop { position: fixed; inset: 0; background: rgba(6, 14, 22, .42); z-index: 55; display: none; }
.backdrop.on { display: block; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; display: none; align-items: flex-start; justify-content: center; z-index: 70; padding: 8vh 16px; }
.modal.on { display: flex; }
.modal .sheet { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); width: min(660px, 100%); max-height: 78vh; display: flex; flex-direction: column; }
.modal .sheet header { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.modal .sheet .content { padding: 14px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.modal .sheet footer { padding: 12px 14px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.cmp { display: grid; grid-template-columns: 1fr 26px 1fr; gap: 10px; align-items: center; }
.cmp .side { border: 1px solid var(--line); border-radius: var(--r); padding: 10px; background: var(--surface-2); }
.cmp .side h5 { margin: 0 0 6px; font: 600 10.5px var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); }
.delta { font: 700 14px var(--mono); }
.delta.up { color: var(--st-ready); }
.delta.down { color: var(--st-full); }

/* command bar */
.cmdbar { position: fixed; inset: 0; z-index: 80; display: none; padding: 12vh 16px; background: rgba(6, 14, 22, .5); }
.cmdbar.on { display: block; }
.cmdbox { width: min(700px, 100%); margin: 0 auto; background: var(--surface); border: 1px solid var(--gold-500); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.cmdbox input { width: 100%; border: 0; padding: 15px 16px; font-size: 16px; background: transparent; }
.cmdbox .out { border-top: 1px solid var(--line); padding: 12px 16px; max-height: 46vh; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.cmdbox .hint { font-size: 11.5px; color: var(--text-3); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.steps li { display: flex; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.steps li::before { content: "→"; color: var(--gold-600); }

/* toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--navy-800); color: #eef4f8; border-left: 4px solid var(--gold-500);
  border-radius: var(--r); padding: 9px 12px; font-size: 12.5px; box-shadow: var(--shadow-lg); max-width: 380px;
  animation: tin .18s ease;
}
.toast.bad { border-left-color: var(--st-full); }
.toast.good { border-left-color: var(--st-ready); }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* agents */
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 10px; }
.agent { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 11px 12px; display: flex; flex-direction: column; gap: 8px; }
.agent h4 { font-size: 13px; display: flex; align-items: center; gap: 7px; }
.agent p { margin: 0; font-size: 12px; color: var(--text-2); }
.agent .ctl { display: flex; gap: 6px; align-items: center; margin-top: auto; }
.agent select { font-size: 11.5px; padding: 4px 6px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); }
.approval { border: 1px solid var(--line); border-left: 4px solid var(--gold-500); border-radius: var(--r); padding: 10px 12px; background: var(--surface); display: flex; flex-direction: column; gap: 7px; }
.approval .why { font-size: 12px; color: var(--text-2); font-style: italic; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 11px 12px; }
.kpi b { display: block; font: 700 22px/1.1 var(--mono); }
.kpi span { font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); }
.bars { display: flex; flex-direction: column; gap: 7px; }
.barline { display: grid; grid-template-columns: 150px 1fr 88px; gap: 9px; align-items: center; font-size: 12.5px; }
.barline .track { height: 9px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.barline .fill { height: 100%; background: linear-gradient(90deg, var(--forest-500), var(--gold-500)); }

@media (max-width: 780px) {
  :root { --gutter: 152px; --col-w: 62px; }
  .topbar { gap: 10px; }
  .strip .stat { min-width: 52px; }
  .board { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
  .cmp { grid-template-columns: 1fr; }
  main { padding: 10px 10px 60px; }
}

/* ---------- labelled form field (integrations dialogs) ---------- */
.fld { display: grid; gap: 5px; margin: 0 0 12px; }
.fld > span { font: 600 11.5px/1.3 var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.fld input, .fld select {
  font: 400 13.5px var(--sans); color: var(--text); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 10px; width: 100%;
}
.fld input:focus-visible, .fld select:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 1px; border-color: var(--gold-500); }

/* ---------- wide tables scroll themselves rather than the page ---------- */
.t-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.t-scroll > .t { min-width: 520px; }
@media (max-width: 700px) {
  .t-scroll > .t { min-width: 460px; font-size: 12px; }
  .t-scroll > .t td, .t-scroll > .t th { padding: 7px 8px; }
}

/* ==========================================================================
   Housekeeping Operations Board
   Colour is never the only signal here: every state carries its label in words
   and a group glyph, and each state group also differs in border weight and
   background tint, so the board survives a monochrome screen or a colour-blind
   reader.
   ========================================================================== */
.hk-top { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.hk-top-l h2 { font: 600 19px/1.25 var(--serif, var(--sans)); margin: 0 0 3px; letter-spacing: -.01em; }
.hk-top-l p { margin: 0; font-size: 12px; }
.hk-top-r { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.seg { display: inline-flex; }
.seg .btn { border-radius: 0; margin-left: -1px; }
.seg .btn:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.seg .btn:last-child { border-radius: 0 8px 8px 0; }
.btn.on { background: var(--navy-800); color: #eef4f8; border-color: var(--navy-800); }
.btn.off, .btn:disabled { opacity: .45; cursor: not-allowed; }

/* Ten figures, sized to sit on one row on a desk monitor rather than orphaning two. */
.hk-kpis { margin-bottom: 12px; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
.hk-kpis .kpi b { font-size: 19px; }
.hk-kpis .kpi span { display: block; min-height: 2.1em; }
.hk-kpis .kpi { border-left: 4px solid var(--line-strong); }
.kpi.g-occupied { border-left-color: #1f6fd0; }
.kpi.g-dirty { border-left-color: #c2321f; }
.kpi.g-working { border-left-color: #d97a15; }
.kpi.g-ready { border-left-color: #17855a; }
.kpi.g-blocked { border-left-color: #6b7480; }
.kpi.g-exception { border-left-color: #8c2bb0; }

.hk-notes { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tag.warn { background: #fdf1e3; border-color: #e0b072; color: #7a4708; }

.hk-filters { margin-bottom: 12px; }
.hk-cnote { font-size: 11.5px; max-width: 46ch; text-align: right; }
.hk-legend { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font: 500 12px var(--sans); color: var(--text-2);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 5px 11px 5px 8px;
}
.chip i { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.chip b { font: 700 12px var(--mono); color: var(--text); }
.chip:hover { border-color: var(--gold-500); }
.chip.on { background: var(--navy-800); color: #dce7ef; border-color: var(--navy-800); }
.chip.on b { color: #fff; }
.chip:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 1px; }

.hk-fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 0 12px; }
.hk-fgrid .fld { margin-bottom: 10px; }
.fld.row { display: flex; align-items: center; gap: 8px; }
.fld.row > span { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 12.5px; color: var(--text-2); }
.fld.row input[type="checkbox"] { width: auto; }

/* ---------- bulk bar ---------- */
.hk-bulkbar { margin-bottom: 12px; border-color: var(--gold-500); background: var(--gold-100); }
.hk-bulkbar .body { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.hk-bulk-l { display: grid; gap: 2px; }
.hk-bulk-l b { font-size: 13.5px; }
.hk-bulk-l span { font-size: 12px; }
.hk-bulk-r { display: flex; gap: 7px; flex-wrap: wrap; margin-left: auto; align-items: center; }

/* ---------- tiles ---------- */
.hk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 11px; }
.hk-tile {
  background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--line-strong);
  border-radius: var(--r); padding: 11px 12px 10px; cursor: pointer;
  display: grid; gap: 5px; align-content: start; text-align: left;
}
.hk-tile:hover { border-color: var(--gold-500); box-shadow: 0 2px 10px rgba(16, 38, 58, .09); }
.hk-tile:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 2px; }
.hk-tile.picked { background: var(--gold-100); border-color: var(--gold-500); }
.hk-tile.g-occupied { border-left-color: #1f6fd0; }
.hk-tile.g-dirty { border-left-color: #c2321f; border-left-width: 7px; }
.hk-tile.g-working { border-left-color: #d97a15; border-left-style: dashed; }
.hk-tile.g-ready { border-left-color: #17855a; }
.hk-tile.g-exception { border-left-color: #8c2bb0; border-left-style: double; border-left-width: 7px; }
.hk-tile.g-blocked { border-left-color: #6b7480; background: var(--surface-2); }

.hk-tile-h { display: flex; align-items: flex-start; gap: 8px; }
.hk-pick { flex: none; display: flex; align-items: center; padding: 1px 2px 0 0; cursor: pointer; }
.hk-pick input { width: 15px; height: 15px; accent-color: var(--gold-600); cursor: pointer; }
.hk-name { display: grid; gap: 1px; min-width: 0; }
.hk-name b { font: 600 14px/1.25 var(--sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hk-name span { font-size: 11px; }
.hk-glyph { margin-left: auto; font-size: 15px; line-height: 1; flex: none; }

.hk-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.hk-state i, .swatch { width: 10px; height: 10px; border-radius: 2px; flex: none; display: inline-block; }
.hk-state b { font-weight: 600; }
.hk-state.big { font-size: 15px; margin-bottom: 4px; }
.hk-svc, .hk-who, .hk-min { font-size: 11.5px; color: var(--text-2); }
.hk-sla { font: 600 11.5px var(--mono); color: var(--text-2); }
.hk-sla.over { color: #c2321f; }
.hk-guest { font-size: 11.5px; color: var(--navy-700); }
.hk-note {
  font-size: 11.5px; color: var(--text); background: var(--surface-2);
  border-left: 3px solid var(--line-strong); border-radius: 0 4px 4px 0; padding: 4px 7px;
}
.hk-flags { display: flex; gap: 5px; flex-wrap: wrap; }
.hk-flags .tag { font-size: 10.5px; padding: 2px 7px; }
tr.picked > td { background: var(--gold-100); }

/* ---------- one unit ---------- */
.hk-room { display: grid; gap: 12px; }
.hk-kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 9px 14px; }
.hk-kv > div { display: grid; gap: 1px; }
.hk-kv span { font: 600 10.5px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.hk-kv b { font-size: 12.5px; font-weight: 600; }
.hk-kv b.bad { color: #c2321f; }
.card.sub { border-color: var(--line); box-shadow: none; }
.card.sub > header { padding: 9px 12px; }
.card.sub > header h4 { font: 600 12.5px var(--sans); margin: 0; letter-spacing: .02em; }
.card.sub > .body { padding: 11px 12px; }
.hk-acts { display: flex; gap: 7px; flex-wrap: wrap; }
.hk-acts .btn { font-size: 12px; }
.hk-chk { display: grid; gap: 2px; }
.hk-chk .fld { margin: 0; }
.hk-ul { margin: 0; padding-left: 17px; display: grid; gap: 7px; font-size: 12.5px; }
.hk-ul .muted { display: block; font-size: 11px; }
.bad { color: #c2321f; }

@media (max-width: 780px) {
  .hk-grid { grid-template-columns: 1fr; }
  .hk-top-r { margin-left: 0; width: 100%; }
  .hk-cnote { display: none; }
  .hk-bulk-r { margin-left: 0; }
}
/* Beats `.kpi span`, which would otherwise shout this in small caps. */
.kpi b .nodata, .nodata {
  font: 400 12px/1.35 var(--sans); color: var(--text-3);
  letter-spacing: 0; text-transform: none; display: inline-block;
}
.hk-gov { font-size: 11.5px; margin: 12px 0 0; padding-top: 9px; border-top: 1px solid var(--line); }
.hk-unreach { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 9px; }
.hk-unreach summary { font: 600 12px var(--sans); color: var(--text-2); cursor: pointer; }
.hk-unreach .hk-acts { margin-top: 9px; }
.hk-unreach p { margin: 8px 0 0; font-size: 11.5px; }
/* A whole sentence, so not shouted in small caps the way a one-word .tag is. */
.note-warn {
  font: 400 12px/1.45 var(--sans); color: #7a4708;
  background: #fdf1e3; border: 1px solid #e0b072; border-radius: 8px;
  padding: 7px 10px; max-width: 52ch;
}
/* Free text someone typed — a fault, a failed-inspection reason — reads in normal case. */
.tag.reason { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 11px; line-height: 1.35; text-align: left; }

/* ---- signed-in identity in the toolbar (replaced the acting-role dropdown) ---- */
.who{display:flex;align-items:center;gap:9px}
.who-name{font-weight:600;font-size:13px}
.who-role{font-size:11.5px;letter-spacing:.04em;text-transform:uppercase;
  padding:2px 7px;border-radius:999px;background:rgba(183,140,34,.16);
  color:var(--header-text);border:1px solid rgba(183,140,34,.5);white-space:nowrap}
.who .mono{font-size:12px;opacity:.75}

/* ---- staff & access ---- */
.tb-link{background:none;border:0;padding:0;font:inherit;color:inherit;cursor:pointer;text-decoration:underline;text-decoration-color:rgba(229,191,99,.55);text-underline-offset:3px}
.tb-link:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
.err-line{margin:4px 0 0;padding:9px 11px;border-radius:6px;border:1px solid rgba(198,40,40,.4);background:rgba(198,40,40,.07);color:#8e1f1f;font-size:13.5px}
.err-line::before{content:"Problem: ";font-weight:600}
#modal-body label{display:grid;gap:5px;font-size:13px;font-weight:500}
#modal-body input,#modal-body select{padding:9px 10px;border:1px solid var(--line-strong);border-radius:6px;font:inherit;background:var(--panel,#fff);color:inherit}

/* ---------- guest ID capture (desk) ---------- */
.idc { display: flex; flex-direction: column; gap: 10px; }
.idc-wrap { border: 1px solid var(--line); border-radius: var(--r-md, 8px); padding: 8px 12px; }
.idc-wrap > summary { cursor: pointer; padding: 4px 0; }
.idc-wrap[open] > summary { margin-bottom: 8px; }
.idc-photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.idc-slot { border: 1px dashed var(--line-strong); border-radius: var(--r-md, 8px); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.idc-slot-head { font-size: 13px; }
.idc-req { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--st-dirty, #a33); }
.idc-opt { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #667); }
.idc-preview { min-height: 120px; border-radius: 6px; background: var(--surface-2, rgba(127,127,127,.08)); display: grid; place-items: center; overflow: hidden; font-size: 12px; color: var(--muted, #667); }
.idc-preview img { max-width: 100%; max-height: 260px; display: block; }
.idc-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.idc-file { cursor: pointer; }
.idc-cam video { width: 100%; border-radius: 6px; background: #000; max-height: 260px; }
.idc-hint { margin: 0; font-size: 12px; color: var(--muted, #667); min-height: 1em; }
.idc-hint.bad { color: var(--st-dirty, #a33); font-weight: 600; }
.idc-hint.bad::before { content: "✕ "; }
.idc-confirm { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-2, rgba(127,127,127,.06)); font-size: 13px; }
.idc-confirm input { width: 20px; height: 20px; min-height: auto; flex: none; margin-top: 1px; }
.idc-error { margin: 0; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--st-dirty, #a33); color: var(--st-dirty, #a33); font-size: 13px; }
.idc-error::before { content: "✕ Problem: "; font-weight: 700; }
.tag.id-ok { border-color: var(--st-ready, #1d7a4a); color: var(--st-ready, #1d7a4a); }
.tag.id-wait { border-color: var(--gold, #b8892a); color: var(--gold, #8a6417); }
.tag.id-none { border-color: var(--st-dirty, #a33); color: var(--st-dirty, #a33); }
.linklike { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }
.idc-lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.78); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; }
.idc-lightbox img { max-width: min(1100px, 100%); max-height: 82vh; border-radius: 6px; }

.idc [hidden] { display: none !important; }
.idc > .f { flex: none; }

/* Walk-in booking: always visible at the top, before the occupancy strip */
.walkin-top{display:inline-flex;align-items:center;gap:10px;margin:0 14px 0 6px;padding:10px 20px 10px 14px;border-radius:12px;
  border:1px solid #f5c542;background:linear-gradient(180deg,#f7cf55,#d9a21b);color:#1b1302;cursor:pointer;flex:0 0 auto;
  box-shadow:0 4px 14px rgba(217,162,27,.35),inset 0 1px 0 rgba(255,255,255,.45);font-family:inherit;transition:transform .12s,box-shadow .12s}
.walkin-top:hover{transform:translateY(-1px);box-shadow:0 6px 18px rgba(217,162,27,.5),inset 0 1px 0 rgba(255,255,255,.5)}
.walkin-top:focus-visible{outline:3px solid #fff;outline-offset:2px}
.walkin-top .wi-plus{font-size:26px;font-weight:900;line-height:1}
.walkin-top .wi-txt{display:flex;flex-direction:column;align-items:flex-start;line-height:1.1}
.walkin-top .wi-txt b{font-size:18px;font-weight:800;letter-spacing:.02em}
.walkin-top .wi-txt small{font-size:11.5px;font-weight:700;opacity:.8;text-transform:uppercase;letter-spacing:.06em}
.walkin-top[hidden]{display:none}
.walkin-dock{flex:0 0 auto;align-self:center;margin:4px 10px 4px 0;padding:7px 16px;border-radius:9px;border:1px solid #f5c542;
  background:linear-gradient(180deg,#f7cf55,#d9a21b);color:#1b1302;font:800 14px/1 inherit;font-family:inherit;cursor:pointer;
  box-shadow:0 3px 10px rgba(217,162,27,.35);position:sticky;left:0;z-index:2}
.walkin-dock[hidden]{display:none}
