/* HRS Backoffice – Arbeitsoberfläche für Rezeption, Housekeeping und Verwaltung.
   Farben und Anmutung folgen der VELORA-Website (Bodensee-Petrol, Schilfgold), sind aber
   dichter und ruhiger gesetzt: lange Schichten, viele Tabellen, keine Abhängigkeiten. */

:root {
  color-scheme: light;

  /* Flächen */
  --bg: #eef2f1;
  --surface: #ffffff;
  --surface-2: #f7faf9;
  --surface-3: #eef3f2;
  --border: #dde5e3;
  --border-strong: #c7d4d1;

  /* Schrift */
  --text: #16262d;          /* Tiefsee */
  --muted: #5f7278;

  /* Marke */
  --primary: #1e5a6b;       /* Bodensee */
  --primary-hover: #174b5a;
  --primary-soft: #e3edf0;
  --primary-line: #bad3db;
  --deep: #0c3644;          /* Seegrund – Seitenleiste */
  --accent: #b8944f;        /* Schilfgold – Fokus, aktive Marker */
  --accent-soft: #f6eeda;

  /* Signale */
  --success: #35664f;
  --success-soft: #e4efe9;
  --warning: #96690f;
  --warning-soft: #faefd9;
  --danger: #b03a31;
  --danger-soft: #fbe9e7;
  --info: #3f5c8c;
  --info-soft: #e9eef8;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(12, 54, 68, .07);
  --shadow: 0 1px 2px rgba(12, 54, 68, .05), 0 8px 20px -14px rgba(12, 54, 68, .45);
  --shadow-lg: 0 28px 64px -32px rgba(12, 54, 68, .55);

  --sidebar: 244px;
  --topbar-h: 58px;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
/* Blazor setzt nach jeder Navigation den Fokus auf die Überschrift (FocusOnNavigate) – dort gehört kein Rahmen hin. */
h1:focus, h1:focus-visible, [tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; }

h1 { font-size: 24px; font-weight: 650; letter-spacing: -.01em; margin: 0 0 2px; }
h2 { font-size: 16px; font-weight: 650; margin: 0 0 14px; }
h3 { font-size: 12px; font-weight: 700; margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
/* Erläuterung hinter einer Zwischenüberschrift ist Fließtext – Versalien nur für die Überschrift selbst. */
h3 .text-muted { text-transform: none; letter-spacing: normal; font-weight: 500; }

/* ---------- Grundgerüst ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar);
  flex-shrink: 0;
  background: linear-gradient(180deg, #17515f 0%, #103f4e 55%, var(--deep) 100%);
  color: #cfdde1;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}

svg.icon { width: 18px; height: 18px; flex-shrink: 0; }

.brand {
  display: block;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .01em;
  padding: 13px 18px 11px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.brand:hover { color: #fff; text-decoration: none; background: rgba(255, 255, 255, .05); }
.brand small { display: block; font-size: 11px; font-weight: 500; color: #93b0b9; letter-spacing: .04em; margin-top: 2px; }

/* Die Navigation ist so dicht gesetzt, dass alle Einträge auf einen üblichen Bildschirm passen – eine zweite
   Scrollleiste neben der Seite ist unruhig. Auf wirklich flachen Fenstern scrollt sie trotzdem (Regel unten). */
.nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .22) transparent;
}
.nav::-webkit-scrollbar { width: 8px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 999px; }
.nav::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .3); }

.nav a {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 6px 10px; border-radius: var(--radius-sm);
  color: #cfdde1; font-weight: 500; line-height: 1.3;
  /* Einzeilig: Ein umbrechender Eintrag kostet 18 px und bringt die Leiste zum Scrollen. */
  white-space: nowrap; overflow: hidden;
}
.nav a + a { margin-top: 1px; }
.nav a:hover { background: rgba(255, 255, 255, .08); text-decoration: none; color: #fff; }
.nav a.active { background: rgba(255, 255, 255, .13); color: #fff; font-weight: 600; }
.nav a.active::before {
  content: ""; position: absolute; left: -10px; top: 6px; bottom: 6px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav a:focus-visible { outline-offset: -2px; }
.nav .icon { opacity: .8; }
.nav a.active .icon { opacity: 1; }
.nav .section {
  font-size: 10px; font-weight: 700; color: #85a3ac; text-transform: uppercase; letter-spacing: .1em;
  padding: 12px 10px 4px;
}
.nav .section:first-child { padding-top: 2px; }
/* Stammdaten: Überschrift als Klappschalter – sieht aus wie die anderen, der Pfeil zeigt den Zustand. */
.nav .section-toggle {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  background: none; border: 0; border-radius: var(--radius-sm); cursor: pointer; font-family: inherit; text-align: left;
}
.nav .section-toggle:hover { color: #fff; }
.nav .section-toggle .icon { width: 14px; height: 14px; transition: transform .15s; }
.nav .section-toggle[aria-expanded="true"] .icon { transform: rotate(90deg); }
.nav .subsection { font-size: 11px; font-weight: 600; color: #6f8f99; padding: 6px 10px 2px; }

.sidebar-footer {
  flex-shrink: 0;
  font-size: 11px; color: #87a4ad; padding: 7px 18px 9px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

/* Flachere Fenster (Laptop, geteilter Bildschirm) rücken die Navigation in zwei Stufen zusammen, damit sie ohne
   eigene Scrollleiste auskommt. Unter etwa 640 px Fensterhöhe geht es nicht mehr auf – dann scrollt sie doch. */
@media (max-height: 900px) {
  .brand { padding: 11px 18px 10px; }
  .nav a { padding: 5px 10px; }
  .nav .section { padding: 10px 10px 4px; }
  .sidebar-footer { padding: 6px 18px 8px; }
}

@media (max-height: 760px) {
  .brand { padding: 9px 18px 8px; font-size: 16px; }
  .nav { padding: 4px 8px; }
  .nav a { padding: 3px 10px; }
  .nav .section { padding: 7px 10px 2px; }
  .sidebar-footer { padding: 4px 18px 6px; }
}

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------- Kopfleiste ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h); flex-shrink: 0;
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-toggle, .scrim { display: none; }

.quick-search { position: relative; flex: 1; max-width: 420px; }
.quick-search input {
  padding: 7px 14px 7px 35px; background: var(--surface-2); border-radius: 999px;
}
.quick-search input:focus { background: #fff; }
.quick-search .glyph { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; line-height: 0; }
.quick-search .glyph svg.icon { width: 16px; height: 16px; }

.topbar-meta { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.clock {
  display: inline-flex; align-items: baseline; gap: 8px;
  padding: 5px 12px; border-radius: 999px; background: var(--primary-soft); color: var(--primary);
  font-weight: 600; white-space: nowrap;
}
.clock .time { font-variant-numeric: tabular-nums; font-size: 15px; }
.clock .date { font-size: 12px; font-weight: 500; opacity: .85; }

.main { flex: 1; min-width: 0; padding: 24px 22px 56px; width: 100%; max-width: 1640px; margin-inline: auto; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-header .subtitle { color: var(--muted); }
.page-header .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.page-header h1 .badge { vertical-align: middle; margin-left: 8px; font-size: 13px; }
.page-header.stacked { align-items: flex-start; }

/* ---------- Karten & Raster ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 18px 20px;
}
/* Abstand gestapelter Karten. Im Raster macht das `gap` – sonst bekäme jede Karte außer der ersten
   zusätzlich 16 px Rand und die erste Kachel einer Reihe wirkte höher als ihre Nachbarn. */
.card + .card { margin-top: 16px; }
.grid > .card + .card, .split > .card + .card, .form-row > .card + .card { margin-top: 0; }
.card > h2:first-child { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }

/* Kopfzeile einer Karte: die Erklärung dahinter ist Fließtext, keine Überschrift. */
.card > h2 .text-muted { font-weight: 400; font-size: 13px; }
/* Schaltflächen in der Kartenüberschrift rechts (Profil, Bearbeiten, Erfassen). */
.card > h2 > .head-actions { margin-left: auto; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
/* Detailseite: links der Inhalt, rechts eine schmalere Spalte (Gastkonto). Unter 1250 px untereinander –
   zwei halbe Spalten mit Tabellen sind dort nicht mehr lesbar. */
.grid-detail { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
@media (max-width: 1250px) { .grid-detail { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1100px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Faktenleiste (Kopf einer Detailseite) ----------
   Die Zahlen, die am Telefon zuerst gefragt werden, in einer Zeile – ohne Karte drumherum zu wiederholen. */
.factbar { display: flex; flex-wrap: wrap; padding: 0; }
.factbar .fact { flex: 1 1 170px; min-width: 0; padding: 12px 18px; border-left: 1px solid var(--border); }
.factbar .fact:first-child { border-left: none; }
.factbar .label { display: block; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.factbar .value { display: block; font-size: 15px; font-weight: 650; line-height: 1.35; font-variant-numeric: tabular-nums; }
.factbar .value .badge { font-weight: 600; }
.factbar .sub { display: block; color: var(--muted); font-size: 12px; }
@media (max-width: 900px) { .factbar .fact { flex-basis: 45%; border-left: none; } }

/* ---------- Reiter (Detailseiten) ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tabs .tab {
  display: inline-flex; align-items: center; gap: 7px; width: auto;
  padding: 8px 14px; min-height: 36px; margin-bottom: -1px;
  border: none; border-bottom: 2px solid transparent; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: none; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer;
}
.tabs .tab:hover { color: var(--text); background: var(--surface-2); }
.tabs .tab.is-active { color: var(--primary); border-bottom-color: var(--primary); }
.tabs .tab .badge { font-size: 11px; padding: 1px 7px; }

/* ---------- Kennzahlen ---------- */
.stat {
  position: relative; display: flex; flex-direction: column; gap: 3px;
  padding-left: 20px; text-align: left; overflow: hidden;
}
.stat::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--border-strong);
}
.stat.tone-primary::before { background: var(--primary); }
.stat.tone-ok::before { background: var(--success); }
.stat.tone-warn::before { background: var(--accent); }
.stat.tone-danger::before { background: var(--danger); }
.stat .label { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.stat .value { font-size: 30px; font-weight: 680; line-height: 1.05; white-space: nowrap; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .value.sm { font-size: 20px; }
.stat .value .of { font-size: 16px; font-weight: 500; color: var(--muted); }
.stat .sub { color: var(--muted); font-size: 12px; }
.stat .sub.warn { color: var(--warning); font-weight: 600; }
.stat .sub.bad { color: var(--danger); font-weight: 600; }

/* Anklickbare Kachel – als Button bzw. Link, damit sie auch mit der Tastatur erreichbar ist. */
button.stat, a.stat { width: 100%; font: inherit; color: var(--text); cursor: pointer; transition: box-shadow .12s, transform .12s, border-color .12s; }
button.stat:hover, a.stat:hover { box-shadow: var(--shadow); transform: translateY(-1px); border-color: var(--border-strong); text-decoration: none; color: var(--text); }
button.stat:active, a.stat:active { transform: none; }
/* Kachel, deren Filter gerade aktiv ist – erneuter Klick schaltet zurück auf „Alles“. */
button.stat.is-active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
button.stat.is-active .label { color: var(--primary); }

/* margin-top: auto – in der Kachel steht der Balken unten, damit er in einer Reihe überall auf gleicher Höhe liegt. */
.meter { height: 5px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.stat .meter { margin-top: auto; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.meter.ok > span { background: var(--success); }
.meter.warn > span { background: var(--accent); }
.meter.bad > span { background: var(--danger); }

/* ---------- Tabellen ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
thead th {
  font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  background: var(--surface-2); border-bottom: 1px solid var(--border-strong); white-space: nowrap;
}
thead th:first-child { border-top-left-radius: var(--radius-sm); }
thead th:last-child { border-top-right-radius: var(--radius-sm); }
tbody tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; }
tbody tr.clickable:hover td { background: var(--primary-soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.nowrap, th.nowrap { white-space: nowrap; }
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
td.muted { color: var(--muted); }
table.compact th, table.compact td { padding: 6px 8px; }
table.compact input, table.compact select { padding: 5px 8px; }
tr.voided td { color: var(--muted); text-decoration: line-through; }
tbody tr.selected td { background: var(--accent-soft); }

/* Aktionsspalte am Zeilenende: schmal, rechtsbündig und deutlich vom Inhalt davor abgesetzt,
   damit Schaltflächen nicht an Beträgen und Badges kleben. */
td.col-actions, th.col-actions { width: 1%; white-space: nowrap; text-align: right; padding-left: 24px; }
td.col-actions .btn-group { justify-content: flex-end; flex-wrap: nowrap; }
tbody td:last-child:has(.btn) { padding-left: 24px; }
/* Zeilen mit Schaltflächen bleiben so hoch wie Zeilen ohne – der Button treibt sie sonst auseinander. */
tbody tr:has(.btn) td { padding-top: 8px; padding-bottom: 8px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent;
}
.badge-neutral { background: var(--surface-3); color: #4e6066; border-color: #dbe3e1; }
.badge-primary { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-line); }
.badge-success { background: var(--success-soft); color: var(--success); border-color: #c5ded1; }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: #ecd6a6; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: #f0c9c4; }
.badge-info { background: var(--info-soft); color: var(--info); border-color: #ccd8ee; }
/* Zimmernummer in fester Breite (Ziffern gleich breit), damit die Badges dahinter
   eine gerade Spalte bilden – egal ob Chalet 7 oder Zimmer 361. */
td .unit-no { display: inline-block; min-width: 3ch; margin-right: 8px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* In Tabellenzellen stehen Badges hinter Text oder Beträgen – ein Leerzeichen allein ist zu wenig. */
td .badge + .badge { margin-left: 2px; }
td.num .badge { margin-right: 4px; }

/* ---------- Schaltflächen & Formulare ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 6px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn:disabled:hover { background: var(--surface); border-color: var(--border-strong); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-danger { color: var(--danger); border-color: #edc3bd; }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn-sm { min-height: 28px; padding: 3px 10px; font-size: 13px; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-group.nowrap { flex-wrap: nowrap; }
.btn-group.nowrap .btn { white-space: nowrap; }
.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; }

label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
input, select, textarea {
  width: 100%; min-height: 34px; padding: 7px 10px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font: inherit; color: var(--text); background: #fff;
}
input::placeholder, textarea::placeholder { color: #93a5aa; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
input[type="checkbox"], input[type="radio"] { min-height: 0; width: 16px; height: 16px; accent-color: var(--primary); }
.field { margin-bottom: 12px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.toolbar {
  display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.toolbar .field { margin-bottom: 0; min-width: 160px; }

/* Filterleiste als eigene Fläche – trennt Steuerung sichtbar von Daten. */
.card > .toolbar:only-child { margin: 0; }

/* ---------- Hinweise ---------- */
.alert { padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; border: 1px solid transparent; }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: #f0c9c4; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: #c5ded1; }
.alert-info { background: var(--info-soft); color: var(--info); border-color: #ccd8ee; }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: #ecd6a6; }
.alert .btn { margin-left: 8px; vertical-align: baseline; }
.empty { color: var(--muted); padding: 24px; text-align: center; background: var(--surface-2); border-radius: var(--radius-sm); }

.kv { display: grid; grid-template-columns: 150px 1fr; row-gap: 7px; column-gap: 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.mono { font-family: "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.sm { font-size: 12px; }
.text-muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.right { text-align: right; }

/* Blazor-Fehlerleiste */
#blazor-error-ui {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--warning-soft); color: var(--warning); border-top: 1px solid #ecd6a6;
  padding: 12px 20px; box-shadow: 0 -4px 16px rgba(12, 54, 68, .12); z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 12px; top: 10px; }

/* ---------- Modale Dialoge ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(12, 54, 68, .5); z-index: 900;
  display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px; overflow-y: auto;
}
.modal {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 640px; display: flex; flex-direction: column; max-height: calc(100vh - 120px);
}
.modal.wide { max-width: 880px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; }
.modal-close { border: none; background: none; font-size: 20px; cursor: pointer; color: var(--muted); line-height: 1; padding: 4px 8px; border-radius: 6px; width: auto; min-height: 0; }
.modal-close:hover { background: var(--surface-3); color: var(--text); }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.modal-foot .left { margin-right: auto; }

/* ---------- Checkliste (Check-in/Check-out) ---------- */
.checklist { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.checklist li .mark { font-weight: 700; width: 18px; flex-shrink: 0; text-align: center; }
.checklist li.ok .mark { color: var(--success); }
.checklist li.warn { border-color: #ecd6a6; background: var(--warning-soft); }
.checklist li.warn .mark { color: var(--warning); }
.checklist li.bad { border-color: #f0c9c4; background: var(--danger-soft); }
.checklist li.bad .mark { color: var(--danger); }
.checklist li .body { flex: 1; min-width: 0; }
.checklist li .body small { display: block; color: var(--muted); }

/* Belegliste am Gastkonto (Rechnungen und Gutschriften) */
.doclist { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.doclist li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }

/* ---------- Aufklappbare Details ---------- */
details.collapsible > summary { cursor: pointer; font-weight: 650; font-size: 16px; margin: 0 0 12px; list-style: none; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
details.collapsible > summary::-webkit-details-marker { display: none; }
details.collapsible > summary::before { content: "▸"; font-size: 12px; color: var(--muted); transition: transform .15s; }
details.collapsible[open] > summary::before { transform: rotate(90deg); }
details.collapsible[open] > summary { margin-bottom: 14px; }
details.collapsible:not([open]) > summary { margin-bottom: 0; }
details.collapsible > summary .text-muted { font-weight: 400; font-size: 13px; }
details.collapsible > summary:hover { color: var(--primary); }

/* Eingabeformular am Fuß einer Karte – zugeklappt, bis es gebraucht wird. Die Karte zeigt damit
   zuerst den Stand und erst auf Wunsch die Eingabe. */
details.subform { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--border-strong); }
details.subform > summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
}
details.subform > summary::-webkit-details-marker { display: none; }
details.subform > summary::before { content: "▸"; font-size: 11px; transition: transform .15s; }
details.subform[open] > summary::before { transform: rotate(90deg); }
details.subform > summary:hover { color: var(--primary); }
details.subform > summary + * { margin-top: 12px; }

/* ---------- Kompakte Info-Zeile im Detail ---------- */
.facts { display: flex; flex-wrap: wrap; gap: 6px 22px; color: var(--muted); }
.facts strong { color: var(--text); }
.diff-pos { color: var(--danger); }
.diff-neg { color: var(--success); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 700px) { .split { grid-template-columns: 1fr; } }

/* ---------- Zimmerplan (Einheiten × Tage) ---------- */
.rp { overflow-x: auto; --label: 200px; --cell: 44px; font-size: 12px; }
.rp-row { display: grid; grid-template-columns: var(--label) minmax(calc(var(--days) * var(--cell)), 1fr); border-bottom: 1px solid var(--border); }
.rp-row:last-child { border-bottom: none; }
.rp-label { position: sticky; left: 0; z-index: 3; background: var(--surface); padding: 4px 10px; border-right: 1px solid var(--border); display: flex; flex-direction: column; justify-content: center; min-height: 30px; }
.rp-label small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-lane { position: relative; display: grid; grid-template-columns: repeat(var(--days), 1fr); }
.rp-cell { border-right: 1px solid #eff3f2; min-height: 30px; }
.rp-cell:last-child { border-right: none; }
.rp-cell.weekend { background: var(--surface-2); }
.rp-cell.today { background: var(--accent-soft); }
.rp-head { position: sticky; top: 0; z-index: 4; background: var(--surface); border-bottom: 2px solid var(--border-strong); }
.rp-head .rp-label { font-weight: 700; color: var(--muted); }
.rp-head .rp-cell { text-align: center; padding: 4px 0; line-height: 1.2; }
.rp-head .dow { display: block; color: var(--muted); font-size: 11px; }
.rp-head .dom { display: block; font-weight: 700; font-size: 13px; }
.rp-head .mon { display: block; color: var(--primary); font-size: 10px; text-transform: uppercase; }
.rp-group { background: var(--surface-3); }
.rp-group .rp-label { background: var(--surface-3); }
.rp-group .rp-cell { text-align: center; color: var(--success); font-weight: 700; padding-top: 6px; }
.rp-group .rp-cell.full { color: var(--danger); }
.rp-row:not(.rp-group):not(.rp-head) .rp-cell.free { cursor: pointer; }
.rp-row:not(.rp-group):not(.rp-head) .rp-cell.free:hover { background: var(--success-soft); }
.rp-bar { position: absolute; top: 4px; bottom: 4px; border-radius: 6px; padding: 0 6px; line-height: 22px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; z-index: 2; box-shadow: var(--shadow-sm); }
.rp-bar:hover { filter: brightness(.96); }
.rp-bar.st-Confirmed, .rp-swatch.st-Confirmed { background: #cfe1e7; color: #124a5e; border: 1px solid #9dc2cf; }
.rp-bar.st-CheckedIn, .rp-swatch.st-CheckedIn { background: #d3e5da; color: #1f5540; border: 1px solid #a3c9b3; }
.rp-bar.st-Held, .rp-swatch.st-Held { background: var(--warning-soft); color: var(--warning); border: 1px dashed #d3ac62; }
.rp-bar.st-CheckedOut, .rp-swatch.st-CheckedOut { background: var(--surface-3); color: var(--muted); border: 1px solid #d3dcda; }
.rp-bar.st-Blackout, .rp-swatch.st-Blackout { background: repeating-linear-gradient(45deg, var(--danger-soft), var(--danger-soft) 5px, #f4d6d2 5px, #f4d6d2 10px); color: var(--danger); border: 1px solid #f0c9c4; cursor: default; }
.rp-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; margin-bottom: 12px; font-size: 13px; }
.rp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rp-swatch { display: inline-block; width: 22px; height: 12px; border-radius: 4px; }
label.check { display: flex; align-items: center; gap: 7px; margin: 0; padding: 8px 0; white-space: nowrap; font-size: 14px; font-weight: 500; color: var(--text); }
label.check input { width: auto; }

/* ---------- Aufgaben (Traces) ---------- */
table.traces tr.overdue td:first-child { color: var(--danger); font-weight: 700; }
table.traces tr.done td { color: var(--muted); }
/* Umbricht nach Platz, nicht nach Fensterbreite – das Formular steht in einer Spalte, die auf breiten
   Bildschirmen trotzdem schmal ist. */
.trace-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.trace-form .field { margin-bottom: 0; flex: 0 1 150px; min-width: 120px; }
.trace-form .field:first-child { flex: 1 1 220px; }
.trace-form .btn { flex: 0 0 auto; }

/* ---------- Kasse ---------- */
table tr.refund td.num { color: var(--danger); }
table tr.muted td { color: var(--muted); }

/* ---------- Schmale Fenster: Seitenleiste wird eingeblendet ---------- */
@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; min-height: 34px; padding: 0; font-size: 16px;
  }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%); transition: transform .18s ease-out;
    box-shadow: var(--shadow-lg);
  }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(12, 54, 68, .4); z-index: 35; }
  .main { padding: 18px 14px 48px; }
  .topbar { padding: 0 14px; }
  .clock .date { display: none; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .table-wrap { margin: 0 -20px; }
}

@media print {
  /* Gedruckt wird der Reiter, der auf dem Schirm steht – die Umschalter selbst gehören nicht aufs Papier. */
  .sidebar, .topbar, .page-header .actions, .page-header .btn-group, .tabs, #blazor-error-ui { display: none !important; }
  .main { padding: 0; max-width: none; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
}

/* ---------- Anmeldung und angemeldeter Mitarbeiter (ADR 0010) ---------- */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--surface-2);
}
.login-card {
  width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 28px;
}
.login-brand { display: flex; flex-direction: column; gap: 2px; margin-bottom: 20px; }
.login-title { font-size: 26px; font-weight: 700; letter-spacing: .06em; color: var(--primary); }
.login-sub { font-size: 13px; color: var(--muted); }
.login-hint { margin-top: 14px; font-size: 12px; color: var(--muted); text-align: center; }
.btn-block { width: 100%; justify-content: center; margin-top: 8px; }

.user-chip {
  display: flex; flex-direction: column; justify-content: center; line-height: 1.2;
  padding: 4px 10px; border-radius: var(--radius-sm); text-decoration: none; color: inherit;
}
.user-chip:hover { background: var(--surface-3); }
.user-name { font-size: 13px; font-weight: 600; }
.user-roles { font-size: 11px; color: var(--muted); }

@media (max-width: 900px) {
  .user-roles { display: none; }
}

/* ---------- Kasse: Tastenfeld (ADR 0013) ---------- */
/* Große Flächen statt Auswahllisten: Am Tresen wird getippt, nicht gescrollt – auch mit dem Finger. */
.keypad { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.keypad .key {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 6px;
  min-height: 84px; padding: 12px 14px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font: inherit; transition: border-color .12s, box-shadow .12s, transform .06s;
}
.keypad .key:hover:not(:disabled) { border-color: var(--primary); box-shadow: var(--shadow); }
.keypad .key:active:not(:disabled) { transform: translateY(1px); }
.keypad .key:disabled { opacity: .5; cursor: default; }
.keypad .key-label { font-weight: 600; line-height: 1.25; }
.keypad .key-price { font-variant-numeric: tabular-nums; color: var(--muted); }
.keypad .key-note {
  position: absolute; top: 8px; right: 10px;
  font-size: 11px; font-weight: 600; color: var(--muted);
}
.keypad .key { position: relative; }

/* Geparkte Bons: die Tischübersicht. Bezug groß, Summe daneben – aus zwei Metern Entfernung lesbar. */
.parked { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.parked-bon {
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  padding: 10px 12px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font: inherit; transition: border-color .12s, background .12s;
}
.parked-bon:hover:not(:disabled) { border-color: var(--primary); }
.parked-bon:disabled { opacity: .5; cursor: default; }
.parked-bon.is-active { border-color: var(--primary); background: var(--info-soft); }
.parked-ref { font-weight: 600; }
.parked-sum { font-variant-numeric: tabular-nums; font-size: 18px; }

/* Kartenauswahl über die Zimmernummer: Treffer als Zeilen zum Antippen, nicht als Auswahlliste. */
.card-picker { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 12px; }
.card-picker .empty { padding: 12px; }
.card-hit {
  display: grid; grid-template-columns: 64px 1fr auto auto; align-items: center; gap: 12px;
  padding: 9px 12px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font: inherit; transition: border-color .12s, background .12s;
}
.card-hit:hover:not(:disabled) { border-color: var(--primary); background: var(--surface-2); }
.card-hit:disabled { opacity: .5; cursor: default; }
.card-hit-room { font-weight: 600; }
.card-hit-name { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.card-hit-flags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

.card-picked {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 7px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.card-picked .btn { margin-left: auto; }

@media (max-width: 640px) {
  .card-hit { grid-template-columns: 48px 1fr; }
  .card-hit-flags, .card-hit .mono.text-muted { grid-column: 2; justify-content: flex-start; }
}

/* ---------------------------------------------------------------- Sterne (Zufriedenheit, ADR 0023) */
.stars-wrap { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.stars { position: relative; display: inline-block; color: var(--border-strong); font-size: 14px; line-height: 1; letter-spacing: 1px; }
.stars::before { content: "★★★★★"; position: absolute; inset: 0 auto 0 0; width: var(--pct); overflow: hidden; color: var(--accent); }
.stars-lg { font-size: 22px; letter-spacing: 2px; }
.stars-value { font-weight: 650; font-variant-numeric: tabular-nums; }
.stars-warn .stars-value { color: var(--warning); }
.stars-bad .stars-value { color: var(--danger); }
.stars-bad .stars::before { color: var(--danger); }
.incident-voided td { color: var(--muted); text-decoration: line-through; }
.incident-voided td.col-actions, .incident-voided td .badge { text-decoration: none; }
.mood-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.sub-line { display: block; color: var(--muted); font-size: 12px; text-decoration: none; }
.mood-chip { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 14px; font-weight: 400; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; cursor: pointer; vertical-align: middle; }
.mood-chip:hover { border-color: var(--primary-line); background: var(--primary-soft); }
.stars-compact { gap: 3px; }
.stars-one { color: var(--accent); font-size: 13px; }
.stars-bad .stars-one { color: var(--danger); }
.section-title { font-size: 17px; font-weight: 650; margin: 26px 0 12px; }
.section-title .text-muted { font-size: 13px; font-weight: 400; }

/* ---------- Hausinfo A–Z (/houseinfo) ----------
   Buchstabenleiste, darunter je Buchstabe ein Block mit den Stichwörtern in Spalten. */
.az-letters { display: flex; flex-wrap: wrap; gap: 2px; margin: 4px 0 8px; }
.az-letters a { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: var(--radius-sm); font-weight: 700; }
.az-letters a:hover { background: var(--primary-soft); text-decoration: none; }
.az-group { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; padding: 14px 0; border-top: 1px solid var(--border); scroll-margin-top: calc(var(--topbar-h) + 12px); }
.az-letter { font-size: 26px; font-weight: 700; color: var(--primary); line-height: 1; }
.az-entries { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 12px 24px; }
.az-entry { min-width: 0; }
.az-entry h4 { margin: 0 0 3px; font-size: 14px; }
.az-entry p { margin: 0; color: var(--text); }
.az-entry .az-hint { margin-top: 6px; padding: 6px 10px; background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 13px; }
@media (max-width: 640px) { .az-group { grid-template-columns: minmax(0, 1fr); gap: 6px; } }
