/* Accent ladder (tasteskill, seed 1356312638): raspberry hue on small marks only, its tints on areas.
   Grid: sidebar 230 + canvas with 29px gutters; overview = 1fr + 384px rail, 24px gap. */
:root {
  --ground: #fbf7f8; --surface: #ffffff; --raised: #f3f4f6; --border: #e5e7eb; --rule: #f2eef0;
  --control: #d1d5db; --text: #111827; --muted: #5f6672;
  --accent: #b8336a; --accent-soft: #fdf2f7; --accent-track: #f8dbe8; --accent-ink: #6b1d3e;
  --positive: #247b50; --negative: #c4242a;
  --pill-positive-bg: #dcfce7; --pill-positive-ink: #14532d;
  --pill-negative-bg: #ffedea; --pill-negative-ink: #831c1e;
  --pill-warning-bg: #fffbeb; --pill-warning-ink: #92400e;
  --pill-neutral-bg: #f3f4f6; --pill-neutral-ink: #374151;
  --radius-card: 8px; --radius-control: 6px; --gap: 24px; --pad: 24px;
  --font: "DM Sans", Inter, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ground); color: var(--text); font: 400 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
small { font-size: 13px; }
.who .sub { white-space: nowrap; }
.boot { padding: 40px; color: var(--muted); }
a { color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 14px;
  border-radius: var(--radius-control); border: 1px solid var(--control); background: var(--surface); cursor: pointer;
  font-weight: 500; white-space: nowrap; transition: background .12s, transform .08s; }
.btn:hover { background: var(--raised); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.primary { background: var(--text); border-color: var(--text); color: #fff; }
.btn.primary:hover { background: #2b3444; }
.btn.danger { color: var(--negative); }
.btn.link { border: 0; background: none; padding: 0 6px; color: var(--accent-ink); text-decoration: underline; min-height: 32px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 14px; font-weight: 500; }
.field small { color: var(--muted); font-size: 13px; }
input[type=text], input[type=number], input[type=password], input[type=search], input[type=url], select {
  min-height: 40px; padding: 0 12px; border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--surface); width: 100%; }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.pill.sent { background: var(--pill-positive-bg); color: var(--pill-positive-ink); }
.pill.failed { background: var(--pill-negative-bg); color: var(--pill-negative-ink); }
.pill.pending, .pill.skipped { background: var(--pill-warning-bg); color: var(--pill-warning-ink); }
.pill.none { background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); }

/* Sign in */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.signin form { width: min(380px, 100%); display: grid; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 32px; }
.signin h1 { font-size: 24px; }

/* Shell: sidebar + top bar */
.shell { display: grid; grid-template-columns: 230px 1fr; grid-template-rows: 64px 1fr; min-height: 100vh; }
.side { grid-row: 1 / 3; border-right: 1px solid var(--border); padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; }
.mono { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center;
  font-weight: 700; font-size: 11px; letter-spacing: -.02em; flex: none; box-shadow: inset 0 0 0 1.5px var(--accent); }
.brand b { display: block; font-size: 15px; line-height: 1.2; }
.brand small { color: var(--muted); font-size: 13px; }
.nav a { display: flex; align-items: center; height: 40px; padding: 0 12px; border-radius: var(--radius-control); text-decoration: none; color: var(--text); font-weight: 500; }
.nav a:hover { background: var(--raised); }
.nav a[aria-current=page] { background: var(--accent-soft); color: var(--accent-ink); }
.nav a .count { margin-left: auto; font-size: 13px; color: var(--muted); }
.side .who { margin-top: auto; padding: 12px; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.top { border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 16px; padding: 0 29px; }
.top .search { width: min(320px, 100%); }
.top .scope { margin-left: auto; display: flex; align-items: center; gap: 12px; height: 100%; padding-left: 16px; border-left: 1px solid var(--border); font-size: 14px; }
.canvas { padding: 24px 29px 64px; min-width: 0; }
.bottom-nav, .top-mono { display: none; }

/* Title row */
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.title-row h1 { font-size: 26px; font-weight: 700; }
.title-row p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.title-row .actions { display: flex; gap: 8px; }

/* Overview */
.overview { display: grid; grid-template-columns: minmax(0, 1fr) 384px; gap: var(--gap); align-items: start; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); margin-bottom: 16px; }
.kpis div { padding: 16px 20px; border-left: 1px solid var(--border); }
.kpis div:first-child { border-left: 0; }
.kpis span { display: block; font-size: 14px; color: var(--muted); }
.kpis b { display: block; font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpis small { font-size: 13px; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.card-head h2 { font-size: 18px; font-weight: 600; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); align-items: center; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.hotel-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.hotel-tabs button { border: 0; background: none; height: 36px; padding: 0 12px; border-radius: var(--radius-control); cursor: pointer; font-weight: 500; color: var(--muted); white-space: nowrap; }
.hotel-tabs button[aria-pressed=true] { background: var(--accent-soft); color: var(--accent-ink); }

/* The board: floors as rows, rooms as tiles, beds as dots */
.board { padding: 8px 20px 20px; }
.floor { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.floor:last-child { border-bottom: 0; }
.floor > h3 { font-size: 14px; font-weight: 500; color: var(--muted); padding-top: 10px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.tile { text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-card); padding: 10px 12px; cursor: pointer;
  display: grid; gap: 6px; min-height: 92px; transition: border-color .12s, background .12s; }
.tile:hover { border-color: var(--accent); }
.tile.full { background: var(--accent-soft); border-color: var(--accent-track); }
.tile .rn { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; font-size: 16px; }
.tile .rn small { font-weight: 400; font-size: 13px; color: var(--muted); }
.beds { display: flex; gap: 4px; flex-wrap: wrap; }
.bed { width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--accent-track); }
.bed.on { background: var(--accent); box-shadow: none; }
.tile .names { font-size: 13px; color: var(--text); line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tile .names.empty { color: var(--muted); }

.rail h2 { font-size: 16px; font-weight: 600; margin: 0 0 8px; }
.rail section + section { margin-top: 24px; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 6px 16px; border-bottom: 1px solid var(--rule); }
.rows li:last-child { border-bottom: 0; }
.rows .sub { display: block; font-size: 13px; color: var(--muted); }
.rail .more { display: block; margin: 8px 0 0; }
.empty-note { padding: 20px; color: var(--muted); font-size: 14px; }

/* Guests list */
.tabs { scrollbar-width: none; display: flex; gap: 20px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 0 2px 10px; border-bottom: 2px solid transparent; cursor: pointer; font-weight: 500; color: var(--muted); white-space: nowrap; min-height: 40px; }
.tabs button[aria-selected=true] { color: var(--text); border-bottom-color: var(--accent); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.toolbar input { max-width: 316px; }
.toolbar > span { white-space: nowrap; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 13px; font-weight: 500; color: var(--muted); padding: 8px 12px; }
td { padding: 10px 12px; border-top: 1px solid var(--rule); vertical-align: middle; }
td.actions { text-align: right; white-space: nowrap; }
tbody tr:hover { background: #fdfbfc; }

/* Hotels and settings */
.stack { display: grid; gap: var(--gap); }
.panel { padding: 20px; }
.hotel-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; }
.map { width: 100%; height: 220px; border: 0; border-radius: var(--radius-card); background: var(--raised); }
.map-none { height: 220px; border-radius: var(--radius-card); background: var(--raised); display: grid; place-items: center; color: var(--muted); font-size: 14px; text-align: center; padding: 20px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; align-items: end; }
.room-table input { min-height: 36px; }
.room-table td { padding: 6px 8px; }
.settings { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 32px; max-width: 1100px; }
.settings h2 { font-size: 16px; font-weight: 500; }
.settings .label p { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.settings .box { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; display: grid; gap: 16px; }
.preview { white-space: pre-wrap; background: #e7f6e7; border-radius: 10px; padding: 14px 16px; font-size: 15px; max-width: 420px; }
details summary { cursor: pointer; font-weight: 500; min-height: 36px; display: flex; align-items: center; }

/* Sheet (dialog) */
dialog { border: 0; border-radius: 12px; padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: 0 16px 48px rgba(17, 24, 39, .18); }
dialog::backdrop { background: rgba(17, 24, 39, .35); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--rule); position: sticky; top: 0; background: var(--surface); }
.sheet-head h2 { font-size: 18px; }
.sheet-body { padding: 16px 20px 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.sheet-body select, .sheet-body input { min-width: 0; }
.sheet-body .form-row { grid-template-columns: repeat(auto-fit, minmax(min(120px, 100%), 1fr)); }
.pick { display: grid; gap: 6px; max-height: 50vh; overflow: auto; }
.pick button { text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-control); padding: 10px 12px; cursor: pointer; min-height: 48px; }
.pick button:hover { border-color: var(--accent); background: var(--accent-soft); }
.room-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.skipped { margin: 0; padding-left: 18px; font-size: 14px; max-height: 200px; overflow: auto; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; background: var(--text); color: #fff; padding: 12px 16px;
  border-radius: 10px; font-size: 14px; transition: opacity .2s, transform .2s; pointer-events: none; max-width: calc(100vw - 32px); z-index: 10; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--negative); }

/* Tablet */
@media (max-width: 1100px) {
  .overview { grid-template-columns: 1fr; }
  .hotel-grid, .settings { grid-template-columns: 1fr; }
}
/* Guest table becomes two-line rows below desktop width, so the room column never squeezes */
@media (max-width: 1100px) {
  .guest-table thead { display: none; }
  .guest-table tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--rule); }
  .guest-table td { border: 0; padding: 0; }
  .guest-table td.who { grid-column: 1; }
  .guest-table td.where { grid-column: 1; font-size: 14px; color: var(--muted); }
  .guest-table td.msg { grid-column: 2; grid-row: 1; text-align: right; }
  .guest-table td.actions { grid-column: 1 / -1; text-align: left; padding-top: 6px; }
  .guest-table td.actions:empty { display: none; }
}
/* Phone: sidebar becomes a bottom bar of four destinations */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .shell { grid-template-columns: 1fr; grid-template-rows: 56px 1fr; }
  .side { display: none; }
  .top { padding: 0 16px; gap: 10px; }
  .top .scope { border-left: 0; padding-left: 0; gap: 8px; }
  .top .scope .role { display: none; }
  .top .mono { width: 32px; height: 32px; font-size: 12px; }
  .canvas { padding: 16px 16px 96px; }
  .bottom-nav { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); position: fixed; inset: auto 0 0 0; background: var(--surface);
    border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
  .bottom-nav a { display: grid; place-items: center; height: 56px; text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 500; }
  .bottom-nav a[aria-current=page] { color: var(--accent-ink); box-shadow: inset 0 2px 0 var(--accent); }
  .title-row h1 { font-size: 22px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpis div { border-left: 0; border-top: 1px solid var(--border); }
  .kpis div:nth-child(-n+2) { border-top: 0; }
  .kpis div:nth-child(even) { border-left: 1px solid var(--border); }
  .kpis b { font-size: 22px; }
  .board { padding: 4px 12px 12px; }
  .floor { grid-template-columns: 1fr; gap: 6px; }
  .floor > h3 { padding-top: 0; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .card-head { padding: 14px 16px; }
  .rows li { padding: 6px 12px; }
  .btn, .btn.link, .hotel-tabs button { min-height: 44px; }
  .top .top-mono { display: grid; }
  .toolbar input { max-width: none; }
  .room-table thead { display: none; }
  .room-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 0; border-top: 1px solid var(--rule); }
  .room-table td { border: 0; padding: 0; }
  .room-table td.actions { grid-column: 1 / -1; text-align: left; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
