/* ==========================================================================
   FF Musterhausen — Raum- & Fahrzeugbuchung
   Design-Tokens exakt nach Design-Spezifikation. Nur über Tokens verwenden,
   keine Direktwerte in Komponenten (siehe Abschnitt 13 der Spezifikation).
   ========================================================================== */

/* Selbst gehostete Schriftart (statt Google-Fonts-CDN) — vermeidet die
   Übertragung der Besucher-IP an Google bei jedem Seitenaufruf. Eine
   variable Schriftdatei (Latin-Subset) deckt alle genutzten Schnitte ab. */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/archivo-variable-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/archivo-variable-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/archivo-variable-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/archivo-variable-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/assets/fonts/archivo-variable-latin.woff2') format('woff2');
}

:root {
  /* Grundflächen und Text */
  --bg: #FBF9F7;
  --surface: #FFFFFF;
  --surface-sunken: #FBF9F7;
  --surface-tint: #F6F2EE;
  --surface-tint-2: #F3EEE9;
  --ink: #1B1A19;
  --ink-2: #3A3733;
  --ink-3: #5C5752;
  --ink-muted: #75706B;
  --ink-faint: #A09892;
  --ink-disabled: #C4BDB7;
  --border: #EFE9E3;
  --border-card: #F0EAE4;
  --border-strong: #E7E0DA;
  --divider: #F3EEE9;

  /* Akzent */
  --accent: #EC3013;
  --accent-ink: #C9280D;
  --accent-ink-strong: #8F1B08;
  --accent-tint: #FDF0ED;
  --accent-tint-border: #F9DED8;
  --accent-tint-soft: #FFF6F3;
  --accent-disabled: #E4DED8;

  /* Statusfarben (systemweit gleich) */
  --status-open-bg: #FDF4E6;
  --status-open-fg: #8A5A11;
  --status-open-border: #F7E6C6;
  --status-ok-bg: #E9F6F4;
  --status-ok-fg: #0A6459;
  --status-ok-border: #CFEAE6;
  --status-bad-bg: #FDF0ED;
  --status-bad-fg: #A32109;
  --status-bad-border: #F9DED8;
  --status-info-bg: #EEF3FA;
  --status-info-fg: #2F4F7C;
  --status-info-icon: #4A6FA5;
  --status-neutral-bg: #F4F1EE;
  --status-neutral-fg: #5C5752;

  --teal: #0E8C7F;

  /* Radien */
  --radius-lg: 24px;
  --radius-list: 20px;
  --radius-nested: 18px;
  --radius-tile: 16px;
  --radius-field: 14px;
  --radius-pill: 999px;
  --radius-dialog: 26px;
  --radius-swatch: 13px;

  /* Schatten */
  --shadow-card: 0 1px 2px rgba(27, 26, 25, .03), 0 14px 34px rgba(27, 26, 25, .05);
  --shadow-list: 0 1px 2px rgba(27, 26, 25, .03);
  --shadow-primary: 0 8px 22px rgba(236, 48, 19, .26);
  --shadow-brand: 0 6px 16px rgba(236, 48, 19, .24);
  --shadow-dialog: 0 30px 70px rgba(27, 26, 25, .28);
  --shadow-segment: 0 2px 6px rgba(27, 26, 25, .08);

  --font: 'Archivo', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }
ul { list-style: none; margin: 0; padding: 0; }
img, svg { display: block; }

.text-wrap-pretty { text-wrap: pretty; }

*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ==========================================================================
   App-Shell / Header
   ========================================================================== */

.app-shell { min-height: 100%; padding-bottom: 24px; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(251, 249, 247, .85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-card);
}

.app-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  max-width: 1340px;
  margin: 0 auto;
}

.brand-mark {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: var(--radius-swatch);
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-brand);
}

.brand-title-block { min-width: 0; margin-right: auto; }
.brand-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-subtitle {
  font-size: 11.5px;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.role-select-wrap { position: relative; display: none; }

.pill-select {
  appearance: none;
  -webkit-appearance: none;
  height: 42px;
  padding: 0 34px 0 16px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--ink-2);
  font-weight: 700;
  font-size: 13px;
}
.role-select-wrap .chevron {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-faint);
  pointer-events: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-weight: 800;
  font-size: 13.5px;
  padding: 0 18px;
  height: 44px;
  white-space: nowrap;
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, color 120ms ease;
}
.btn-sm { height: 38px; padding: 0 14px; font-size: 13px; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover { background: var(--accent-ink); }
.btn-primary:disabled,
.btn-primary[aria-disabled="true"] {
  background: var(--accent-disabled);
  color: #fff;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink-2);
  border-color: var(--border-strong);
}
.btn-secondary:hover { border-color: var(--ink-3); }

.btn-danger {
  background: var(--accent-tint);
  color: var(--accent-ink);
  border-color: var(--accent-tint-border);
}
.btn-danger:hover { background: var(--accent-tint-border); }

.btn-teal {
  background: var(--teal);
  color: #fff;
}
.btn-teal:hover { filter: brightness(0.94); }
.btn-teal:disabled { background: var(--accent-disabled); color: #fff; cursor: not-allowed; }

.btn-icon {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.btn-icon:hover { border-color: var(--ink-3); background: var(--surface-tint); }
.btn-icon.sm { width: 40px; height: 40px; min-width: 40px; }

.nav-tabs {
  display: none;
  gap: 7px;
  padding: 0 24px 14px;
  max-width: 1340px;
  margin: 0 auto;
  overflow-x: auto;
}
.nav-pill {
  height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--ink-2);
  font-weight: 700;
  font-size: 13.5px;
  white-space: nowrap;
  gap: 8px;
}
.nav-pill.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.nav-pill .count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  font-weight: 800;
  background: var(--accent-tint);
  color: var(--accent-ink);
}
.nav-pill.active .count { background: var(--accent); color: #fff; }

/* ==========================================================================
   Inhaltsbereich
   ========================================================================== */

.content {
  max-width: 1340px;
  margin: 0 auto;
  padding: 26px 24px 60px;
}

/* ==========================================================================
   Footer / Rechtstexte
   ========================================================================== */

.app-footer {
  max-width: 1340px;
  margin: 0 auto;
  padding: 16px 24px 28px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  color: var(--ink-muted);
}
.app-footer a { color: var(--ink-muted); text-decoration: none; }
.app-footer a:hover { color: var(--ink); text-decoration: underline; }
.app-footer-sep { color: var(--ink-faint); }
.auth-footer { padding: 16px 0 0; justify-content: center; }

.legal-page {
  max-width: 760px;
  margin: 0 auto;
  line-height: 1.6;
}
.legal-page h1 { font-size: 26px; font-weight: 800; margin: 0 0 20px; }
.legal-page h2 { font-size: 16px; font-weight: 700; margin: 28px 0 8px; }
.legal-page p, .legal-page ul { color: var(--ink-2); margin: 0 0 4px; }
.legal-page ul { padding-left: 20px; }
.legal-page a { color: var(--accent-ink); }
.legal-intro { color: var(--ink-muted) !important; margin-bottom: 24px !important; }
.legal-footnote { margin-top: 32px !important; font-size: 13px; }

.page-head { margin-bottom: 20px; }
.kicker {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: block;
  margin-bottom: 4px;
}
.page-title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.page-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Karten
   ========================================================================== */

.card {
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 22px;
}
.card-list {
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-list);
  box-shadow: var(--shadow-list);
  padding: 18px;
  transition: border-color 120ms ease, background 120ms ease;
}
.card-list:hover { border-color: var(--border-strong); }
.card-nested {
  background: var(--surface-sunken);
  border-radius: var(--radius-nested);
  padding: 16px;
}

.list-stack { display: flex; flex-direction: column; gap: 12px; }
.grid-2col { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 1180px) {
  .grid-2col { grid-template-columns: 1fr 1fr; gap: 12px 20px; }
}

.divider { border: none; border-top: 1px solid var(--divider); margin: 16px 0; }

/* ==========================================================================
   Formulare
   ========================================================================== */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field[hidden] { display: none; }
.field label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-3);
}
.field-hint { font-size: 12px; color: var(--ink-faint); }

.input, select.input {
  height: 46px;
  padding: 0 14px;
  border-radius: var(--radius-field);
  border: 1px solid var(--border-strong);
  background: var(--surface-sunken);
  color: var(--ink);
}
textarea.input { height: auto; padding: 12px 14px; resize: vertical; min-height: 90px; }

.field-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 12px; }
@media (max-width: 899px) {
  .field-row { grid-template-columns: 1fr; }
}

.segment {
  display: inline-flex;
  padding: 4px;
  background: var(--surface-tint-2);
  border-radius: var(--radius-pill);
  gap: 4px;
}
.segment a, .segment button, .segment label {
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-3);
  border: none;
  background: transparent;
}
.segment .active,
.segment label:has(input:checked) {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-segment);
}
.segment label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.sr-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pill-choice {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px 0 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-2);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.pill-choice .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill-choice:has(input:checked) { border-color: var(--cat-color, var(--accent)); background: var(--cat-tint, var(--accent-tint-soft)); color: var(--cat-text, var(--accent-ink)); }
.pill-choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.checkbox-tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  border-radius: var(--radius-tile);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  padding: 8px 14px;
  cursor: pointer;
}
.checkbox-tile:has(input:checked) { background: var(--accent-tint-soft); border-color: var(--accent); }
.checkbox-tile:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.checkbox-tile-inactive { opacity: .75; }
.checkbox-box {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 7px;
  border: 1px solid #D6CFC9;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.checkbox-tile:has(input:checked) .checkbox-box { background: var(--accent); border-color: var(--accent); }
.checkbox-tile-name { font-weight: 700; font-size: 15px; }
.checkbox-tile-meta { font-size: 12px; color: var(--ink-faint); }

.field-error { font-size: 12px; color: var(--accent-ink-strong); margin-top: 2px; }

/* ==========================================================================
   Chips / Badges
   ========================================================================== */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 800;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-neutral { background: var(--status-neutral-bg); color: var(--status-neutral-fg); }
.chip-open { background: var(--status-open-bg); color: var(--status-open-fg); }
.chip-ok { background: var(--status-ok-bg); color: var(--status-ok-fg); }
.chip-bad { background: var(--status-bad-bg); color: var(--status-bad-fg); }
.chip-info { background: var(--status-info-bg); color: var(--status-info-fg); }
.chip-category { background: var(--cat-tint); color: var(--cat-text); }
.chip-resource {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--ink-2);
  font-weight: 700;
}

/* ==========================================================================
   Meldungen
   ========================================================================== */

.message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-radius: var(--radius-tile);
  padding: 14px;
}
.message-icon { flex-shrink: 0; margin-top: 1px; }
.message-title { font-size: 13.5px; font-weight: 800; margin-bottom: 2px; }
.message-text { font-size: 12.5px; line-height: 1.5; }
.message-bad { background: var(--status-bad-bg); border: 1px solid var(--status-bad-border); color: var(--status-bad-fg); }
.message-warn { background: var(--status-open-bg); border: 1px solid var(--status-open-border); color: var(--status-open-fg); }
.message-ok { background: var(--status-ok-bg); border: 1px solid var(--status-ok-border); color: var(--status-ok-fg); }
.message-info { background: var(--status-info-bg); color: var(--status-info-fg); }
.message-info .message-icon { color: var(--status-info-icon); }
.message-neutral { background: var(--status-neutral-bg); color: var(--status-neutral-fg); }

.flash-stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }

.empty-state {
  border: 1px dashed var(--border-strong);
  background: var(--surface-sunken);
  border-radius: var(--radius-list);
  padding: 24px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 13px;
}

/* ==========================================================================
   Kalender
   ========================================================================== */

.calendar-layout { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
@media (min-width: 1180px) {
  .calendar-layout { grid-template-columns: 1fr 376px; }
}

.calendar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.month-title { font-size: 23px; font-weight: 800; letter-spacing: -0.02em; }
.calendar-nav { display: flex; align-items: center; gap: 8px; }

.weekday-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 8px;
}
.weekday-row span {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #B4ACA6;
  text-align: center;
}
.wd-abbr { display: inline; }
.wd-full { display: none; }
@media (min-width: 900px) {
  .wd-abbr { display: none; }
  .wd-full { display: inline; }
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.day-tile {
  border: 1px solid var(--border-card);
  border-radius: var(--radius-tile);
  background: var(--surface);
  padding: 8px;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  position: relative;
  color: var(--ink);
}
.day-tile.outside { background: #FCFAF8; border-color: var(--surface-tint); color: var(--ink-disabled); }
.day-tile.outside .day-number { color: var(--ink-disabled); }
.day-tile.selected { background: var(--accent-tint-soft); border-color: var(--accent); }

.day-number { font-size: 13px; font-weight: 700; }
.day-number.today {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
}
.day-dots { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; }
.day-dots .dot { width: 8px; height: 8px; border-radius: 50%; }
.day-count {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--surface-tint-2);
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 800;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.legend { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 16px; margin-top: 4px; border-top: 1px solid var(--divider); }

.calendar-tools { display: flex; flex-wrap: wrap; gap: 16px; padding-top: 14px; margin-top: 4px; }
.calendar-tools a { font-size: 12.5px; font-weight: 700; color: var(--accent-ink); }
.calendar-tools a:hover { color: var(--accent-ink-strong); }

/* Wochenansicht */
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: start; }
@media (max-width: 899px) {
  .week-grid { grid-template-columns: 1fr; }
}
.week-day {
  background: var(--surface-sunken);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-tile);
  padding: 12px;
  min-height: 120px;
}
.week-day-today { border-color: var(--accent); background: var(--accent-tint-soft); }
.week-day-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.week-day-name { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint); }
.week-day-number { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.week-day-number.today { color: var(--accent-ink); }
.week-day-empty { font-size: 12px; color: var(--ink-faint); font-style: italic; }
.week-day .day-occupancy-item { cursor: pointer; }
.week-day .day-occupancy-item:hover { filter: brightness(0.98); }

/* Tagesdetail */
.day-detail-date { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; margin: 4px 0 2px; }
.day-detail-count { font-size: 12.5px; color: var(--ink-muted); margin-bottom: 16px; }
.booking-card { display: flex; flex-direction: column; gap: 8px; }
.booking-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.booking-time { font-size: 12.5px; font-weight: 800; color: var(--ink-2); }
.booking-title { font-size: 15.5px; font-weight: 800; letter-spacing: -0.015em; }
.booking-resources { display: flex; flex-wrap: wrap; gap: 6px; }
.booking-meta { font-size: 12px; color: var(--ink-faint); }
.booking-actions { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }

/* ==========================================================================
   Formularseite (Buchung/Antrag) — als eigenständige Seite gerendert,
   optisch wie ein zentrierter Dialog
   ========================================================================== */

.dialog-backdrop {
  min-height: calc(100vh - 66px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 28px 16px 60px;
}
.dialog-card {
  width: 100%;
  max-width: 900px;
  background: var(--surface);
  border-radius: var(--radius-dialog);
  box-shadow: var(--shadow-dialog);
  overflow: hidden;
}
.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 26px;
  border-bottom: 1px solid var(--divider);
}
.dialog-title { font-size: 22px; font-weight: 800; letter-spacing: -0.025em; }
.dialog-body { padding: 22px 26px; display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 1180px) {
  .dialog-body { grid-template-columns: 1fr 330px; }
}
.dialog-foot {
  display: flex;
  gap: 12px;
  padding: 18px 26px;
  border-top: 1px solid var(--divider);
}
.dialog-foot .btn-primary { flex: 1; min-width: 180px; }

.category-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.resource-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 1180px) {
  .resource-grid { grid-template-columns: 1fr 1fr; }
}

.side-panel { display: flex; flex-direction: column; gap: 20px; }
.side-panel-block .kicker { margin-bottom: 10px; }
.day-occupancy-item {
  background: var(--surface);
  border-radius: var(--radius-nested);
  padding: 10px 12px;
  border-left: 3px solid var(--cat-color, var(--accent));
  margin-bottom: 8px;
}
.day-occupancy-item .title { font-weight: 800; font-size: 13.5px; }
.day-occupancy-item .meta { font-size: 12px; color: var(--ink-muted); }

/* ==========================================================================
   Mitglieder / Registrierungen / Ressourcen / Kategorien
   ========================================================================== */

.avatar {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
}
.list-item { display: flex; align-items: center; gap: 14px; }
.list-item-main { min-width: 0; flex: 1; }
.list-item-name { font-size: 15px; font-weight: 800; }
.list-item-sub { font-size: 12.5px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.icon-tile {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.category-swatch { width: 38px; height: 38px; min-width: 38px; border-radius: var(--radius-swatch); }

/* ==========================================================================
   Login / Registrierung
   ========================================================================== */

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 900px) {
  .auth-shell { grid-template-columns: 1.05fr 1fr; }
}
.auth-hero {
  background: linear-gradient(150deg, #C9280D 0%, #EC3013 52%, #F2603F 100%);
  color: #fff;
  padding: 26px 20px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 220px;
}
@media (min-width: 900px) {
  .auth-hero { padding: 52px 48px; min-height: auto; }
}
.auth-hero::before, .auth-hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
}
.auth-hero::before { width: 420px; height: 420px; top: -140px; right: -120px; background: rgba(255,255,255,.10); }
.auth-hero::after { width: 340px; height: 340px; bottom: -140px; left: -100px; background: rgba(255,255,255,.07); }
.auth-hero-brand { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.auth-hero-brand .mark { width: 34px; height: 34px; border-radius: 11px; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; }
.auth-hero-copy { position: relative; z-index: 1; }
.auth-hero-copy h1 { font-size: 32px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.05; margin-bottom: 10px; }
@media (min-width: 900px) {
  .auth-hero-copy h1 { font-size: 52px; line-height: 1.02; }
}
.auth-hero-copy p { font-size: 14px; opacity: .92; max-width: 40ch; }

.auth-form-side { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 26px 20px; }
@media (min-width: 900px) {
  .auth-form-side { padding: 20px; }
}
.auth-form-wrap { width: 100%; max-width: 420px; }
.auth-form-wrap h2 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 6px; }
.auth-form-wrap .lead { color: var(--ink-muted); font-size: 13.5px; margin-bottom: 22px; }
.auth-tabs { margin-bottom: 24px; }
.auth-forgot { display: block; text-align: center; margin-top: 14px; font-size: 13px; color: var(--accent-ink); }

/* ==========================================================================
   Mobile Bottom-Nav
   ========================================================================== */

.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-card);
  padding-bottom: calc(7px + env(safe-area-inset-bottom));
}
.bottom-nav-row { display: flex; }
.bottom-nav-item {
  flex: 1;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--ink-muted);
  position: relative;
  padding-top: 7px;
}
.bottom-nav-item .dot { width: 6px; height: 6px; border-radius: 50%; background: #D6CFC9; }
.bottom-nav-item span { font-size: 10.5px; font-weight: 800; }
.bottom-nav-item.active { color: var(--accent-ink); }
.bottom-nav-item.active .dot { background: var(--accent); }
.bottom-nav-item .badge {
  position: absolute;
  top: 2px;
  right: 22%;
  background: var(--accent);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  min-width: 15px;
  height: 15px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

/* ==========================================================================
   Breakpoints — globale Umschaltungen
   ========================================================================== */

@media (min-width: 900px) {
  .nav-tabs { display: flex; }
  .role-select-wrap { display: block; }
}

@media (max-width: 899px) {
  .app-header-row { padding: 10px 14px; gap: 8px; }
  .content { padding: 18px 14px 92px; }
  .brand-title { font-size: 15px; }
  .btn-primary.primary-action span.label { display: none; }
  .btn-primary.primary-action { width: 44px; height: 44px; padding: 0; border-radius: 50%; }
  .logout-desktop { display: none; }
  .bottom-nav { display: block; }
  .day-tile { min-height: 60px; }
  .card { padding: 16px; }
  .card-list { padding: 14px; }
}

@media (min-width: 900px) {
  .bottom-nav { display: none; }
}

/* ==========================================================================
   Benutzermenü (Header) + Mobiles "Mehr"-Sheet
   ========================================================================== */

.user-menu { position: relative; }
.user-menu summary { list-style: none; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-list);
  box-shadow: var(--shadow-dialog);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 60;
}
.user-menu-name { font-weight: 800; font-size: 14px; }
.user-menu-role { font-size: 12px; color: var(--ink-faint); margin-bottom: 6px; }
.user-menu-panel a,
.user-menu-panel button {
  text-align: left;
  padding: 8px 10px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 13px;
}
.user-menu-panel a:hover,
.user-menu-panel button:hover { background: var(--surface-tint); }
.user-menu-panel form { margin: 0; }

.more-sheet {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 76px;
  background: var(--surface);
  border-radius: var(--radius-list);
  box-shadow: var(--shadow-dialog);
  border: 1px solid var(--border-card);
  padding: 10px;
  z-index: 55;
}
.more-sheet ul { display: flex; flex-direction: column; }
.more-sheet a { display: block; padding: 12px 10px; font-weight: 700; font-size: 14px; border-radius: 10px; }
.more-sheet a:hover { background: var(--surface-tint); }
.more-sheet-user { border-top: 1px solid var(--divider); margin-top: 6px; padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.more-sheet-user a, .more-sheet-user button { padding: 8px 10px; border-radius: 10px; border: none; background: transparent; text-align: left; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.more-sheet-user form { margin: 0; }
.more-sheet-user a:hover, .more-sheet-user button:hover { background: var(--surface-tint); }
