/* Revenue Management Novapart Wels.
   Aufbau wie die übrigen Eigenentwicklungen (Sidebar links, Inhalt in Karten,
   Mobil-Schublade, Druck ohne Bedienelemente) - aber bewusst in der hellen
   Novapart-Optik: Logo steht frei auf Weiß, Messing-Gold aus dem Logo als
   Markenfarbe (Robert: Logo mit weißem Hintergrund in der dunklen Sidebar
   wirkt schwierig, Oberfläche soll Nicht-Techniker ansprechen). */
:root {
  --bg: #f6f6f4;
  --card-bg: #ffffff;
  --border: #e6e4df;
  --text: #24262a;
  --muted: #6a6c71;
  --primary: #2f3135;          /* Knöpfe, starke Schrift */
  --primary-dark: #1d1e21;
  --gold: #bca675;             /* exakt aus dem Novapart-Logo */
  --gold-text: #7a6638;        /* Gold für Schrift, 5,5:1 auf Weiß */
  --gold-hell: #f5f0e4;
  --danger: #c43d3d;
  --green: #1f8a4c;
  --sidebar-w: 248px;
  --radius: 12px;
  /* Nachfrage (eine Farbfamilie, hell -> dunkel, immer mit Textlabel) */
  --nf-normal: #f4efe3;
  --nf-gefragt: #e3d5b1;
  --nf-sehr: #7f6a3a;
  /* Diagramm: gebucht / zusätzlich erwartet */
  --chart-otb: #7f6a3a;
  --chart-prognose: #d9c79a;
  --chart-grid: #ecebe7;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; text-wrap: balance; }
html { -webkit-tap-highlight-color: rgba(188, 166, 117, 0.2); }
a, button, summary { touch-action: manipulation; }
.skip-link { position: absolute; left: 1rem; top: -3rem; z-index: 3000; background: var(--primary); color: #fff; padding: 0.5rem 0.9rem; border-radius: 8px; text-decoration: none; }
.skip-link:focus { top: 1rem; }
.content:focus { outline: none; }

a:not([class]), a:not([class]):visited {
  color: var(--gold-text); text-decoration: underline;
  text-decoration-color: rgba(122, 102, 56, 0.35); text-underline-offset: 3px;
}
a:not([class]):hover { text-decoration-color: currentColor; }

.link-dezent, .link-dezent:visited {
  display: inline-flex; align-items: center; gap: 0.35rem;
  color: var(--gold-text); font-size: 0.9rem; font-weight: 600; text-decoration: none;
}
.link-dezent:hover { text-decoration: underline; text-underline-offset: 3px; }

input[type="checkbox"], input[type="radio"] { accent-color: var(--gold-text); width: 1rem; height: 1rem; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold-text); outline-offset: 2px; }

body.app-shell { display: flex; align-items: stretch; min-height: 100vh; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1.5rem; background: var(--card-bg); border-bottom: 1px solid var(--border);
}

.brand-link { text-decoration: none; color: var(--text); }
.brand-mark { display: inline-flex; align-items: center; gap: 0.75rem; }
.brand-logo { display: block; height: 40px; width: auto; }
.brand-mark img { max-width: 100%; }
.brand-sub { font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.brand-mark-lg { display: flex; flex-direction: column; align-items: center; gap: 1rem; margin-bottom: 1.75rem; }
.brand-mark-lg .brand-logo { height: 120px; }
.brand-mark-lg .brand-sub { font-size: 0.95rem; }
.brand-mark-sidebar { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; text-align: center; }
.brand-mark-sidebar .brand-logo { height: 92px; }

/* ── Sidebar (hell) ──────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--card-bg); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar-brand { padding: 1.75rem 1.25rem 1.25rem; flex-shrink: 0; }
.sidebar-brand .brand-link { display: block; }
.sidebar-nav { overscroll-behavior: contain; flex: 1; padding: 0.5rem 0.75rem; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.sidebar-unten { margin-top: auto; padding-top: 0.75rem; display: flex; flex-direction: column; gap: 2px; }
.sidebar-section { font-size: 0.78rem; font-weight: 600; color: var(--muted); padding: 1rem 0.75rem 0.35rem; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.75rem; border-radius: 8px;
  color: var(--text); font-size: 0.92rem; font-weight: 500; text-decoration: none;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--muted); }
.nav-item:hover { background: var(--bg); }
.nav-item.active { background: var(--gold-hell); color: var(--primary-dark); font-weight: 600; }
.nav-item.active svg { color: var(--gold-text); }
.nav-item.active::before {
  content: ""; position: absolute; left: -0.75rem; top: 0.45rem; bottom: 0.45rem; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--gold);
}

.sidebar-user { position: relative; padding: 0.75rem; border-top: 1px solid var(--border); flex-shrink: 0; }
.user-menu-button {
  display: flex; align-items: center; justify-content: flex-start; gap: 0.6rem; width: 100%;
  background: none; border: none; padding: 0.4rem; border-radius: 8px; color: var(--text); cursor: pointer; text-align: left;
}
.user-menu-button:hover { background: var(--bg); color: var(--text); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--gold-hell); color: var(--gold-text);
  display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; flex-shrink: 0;
}
.user-name { font-size: 0.88rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-dropdown {
  display: none; position: absolute; left: 0.75rem; right: 0.75rem; bottom: calc(100% + 0.4rem);
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12); padding: 0.3rem; z-index: 1000;
}
.user-menu-dropdown.open { display: block; }
.user-menu-dropdown a { display: block; padding: 0.5rem 0.6rem; border-radius: 4px; font-size: 0.88rem; color: var(--text); text-decoration: none; }
.user-menu-dropdown a:hover { background: var(--bg); }

.content { flex: 1; min-width: 0; max-width: 1360px; margin: 0 auto; padding: 2.25rem 2.75rem 3rem; }

.mobile-topbar {
  display: none; align-items: center; gap: 0.75rem; padding: 0.6rem 1rem;
  background: var(--card-bg); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1100;
}
.mobile-menu-knopf { background: none; border: none; color: var(--text); padding: 0.3rem; line-height: 1; cursor: pointer; flex-shrink: 0; }
.mobile-menu-knopf:hover { background: none; color: var(--text); }
.mobile-menu-knopf svg { width: 26px; height: 26px; display: block; }
.mobile-topbar .brand-logo { height: 36px; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.3); z-index: 1150; }

/* ── Grundbausteine ──────────────────────────────────────────────────── */
.card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem 1.6rem;
  margin-bottom: 1.25rem;
}
.card h2 { margin: 0 0 0.35rem; font-size: 1.12rem; }
.card .einleitung { margin: 0 0 1.1rem; color: var(--muted); font-size: 0.9rem; max-width: 70ch; }
.card-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.card-kopf h2 { margin: 0; }
.cards-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.25rem; align-items: start; margin-bottom: 1.25rem; }
.cards-row .card { margin-bottom: 0; min-width: 0; }

.page-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap; }
.page-header h1 { margin: 0; font-size: 1.75rem; font-weight: 700; }
.page-header .untertitel { margin: 0.35rem 0 0; color: var(--muted); font-size: 1rem; max-width: 70ch; }
.kopf-aktionen { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

label { display: block; margin-top: 1rem; margin-bottom: 0.25rem; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
label > select, label > textarea, label > input:not([type="checkbox"]):not([type="radio"]) { display: block; margin-top: 0.35rem; }
.hilfe { display: block; font-weight: 400; font-size: 0.8rem; color: var(--muted); margin-top: 0.3rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="number"],
input[type="url"], input[type="search"], textarea, select {
  width: 100%; padding: 0.55rem 0.65rem; border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.95rem; font-family: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold-text); box-shadow: 0 0 0 3px rgba(188, 166, 117, 0.25); }
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; color: var(--text); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.5rem; align-items: start; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .span-full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 0.5rem; margin-top: 1.25rem; flex-wrap: wrap; align-items: center; }
.form-actions .aktion-links { margin-right: auto; }

.button, button, input[type="submit"] {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  background: var(--primary); color: #fff; border: 1px solid var(--primary); border-radius: 8px;
  padding: 0.55rem 1.05rem; font-family: inherit; font-size: 0.92rem; font-weight: 600; line-height: 1.25;
  text-decoration: none; vertical-align: middle; cursor: pointer;
}
.button:visited { color: #fff; }
.button:hover, button:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.button.secondary, button.secondary, .button.secondary:visited { background: var(--card-bg); color: var(--text); border: 1px solid var(--border); }
.button.secondary:hover, button.secondary:hover { background: var(--bg); border-color: #d4d1ca; color: var(--text); }
.button.danger, button.danger { background: var(--card-bg); color: var(--danger); border: 1px solid #ebc4c4; }
.button.danger:hover, button.danger:hover { background: #fcefef; color: var(--danger); }
button.klein, .button.klein { padding: 0.3rem 0.65rem; font-size: 0.82rem; }
.inline-form { display: inline; margin: 0; }

.alert-error { background: #fcefef; color: #a12f2f; border: 1px solid #f0cccc; border-radius: 10px; padding: 0.7rem 1rem; font-size: 0.9rem; margin-bottom: 1rem; }
.alert-erfolg { background: #ecf7f0; color: #1d6b3d; border: 1px solid #c6e6d2; border-radius: 10px; padding: 0.7rem 1rem; font-size: 0.9rem; margin-bottom: 1rem; }
.hinweis-kasten { background: var(--gold-hell); border: 1px solid #e8dcc0; border-radius: 10px; padding: 0.8rem 1rem; font-size: 0.9rem; margin-bottom: 1rem; }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--card-bg); }
th, td { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--border); text-align: left; font-size: 0.9rem; vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; vertical-align: bottom; line-height: 1.3; }
tbody tr:last-child td { border-bottom: none; }
td.zahl, th.zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.zeile-link { cursor: pointer; }
tr.zeile-link:hover td { background: #faf8f3; }
.muted { color: var(--muted); }
.klein-text { font-size: 0.82rem; }
.nowrap { white-space: nowrap; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.login-card { width: 100%; max-width: 380px; padding: 2.5rem 2.25rem; border-radius: 16px; box-shadow: 0 20px 45px rgba(40, 36, 28, 0.07); }

/* ── Kopfzeile Datenstand ────────────────────────────────────────────── */
.datenstand { font-size: 0.82rem; color: var(--muted); display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.demo-band { display: inline-block; padding: 0.1rem 0.6rem; border-radius: 999px; background: #fff3e3; color: #8a5414; border: 1px solid #f1d7b3; font-size: 0.78rem; font-weight: 600; }

/* ── Übersicht ───────────────────────────────────────────────────────── */
.lage { font-size: 1.15rem; margin: 0.4rem 0 0; max-width: 62ch; color: var(--text); }

.hinweise { list-style: none; margin: 0; padding: 0; }
.hinweis-zeile {
  display: grid; grid-template-columns: 4.2rem 1fr auto; gap: 1rem; align-items: center;
  padding: 0.9rem 0; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit;
}
.hinweise li:last-child .hinweis-zeile { border-bottom: none; }
.hinweis-zeile:hover .hinweis-text strong { text-decoration: underline; text-underline-offset: 3px; }
.datum-block { text-align: center; border-radius: 10px; padding: 0.35rem 0; background: var(--gold-hell); color: var(--gold-text); line-height: 1.15; }
.datum-block .tag { display: block; font-size: 1.35rem; font-weight: 700; color: var(--primary-dark); }
.datum-block .wt { display: block; font-size: 0.78rem; font-weight: 600; }
.hinweis-text strong { display: block; font-size: 0.98rem; }
.hinweis-text span { color: var(--muted); font-size: 0.88rem; }
.hinweis-preis { text-align: right; white-space: nowrap; }
.hinweis-preis b { display: block; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.hinweis-preis span { font-size: 0.8rem; color: var(--muted); }

.zahlen-reihe { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; margin-bottom: 1.25rem; }
.zahl-satz { padding: 1.1rem 1.25rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card-bg); }
.zahl-satz .gross { display: block; font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.zahl-satz p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.9rem; }
.zahl-satz p strong { color: var(--text); }
.delta-plus { color: var(--green); font-weight: 600; }
.delta-minus { color: var(--danger); font-weight: 600; }

/* ── Nachfrage-Kalender (das prägende Element) ───────────────────────── */
.kalender { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.kalender-kopf { font-size: 0.8rem; font-weight: 600; color: var(--muted); padding: 0 0.4rem 0.2rem; }
.kalender-tag {
  position: relative; display: flex; flex-direction: column; gap: 0.15rem; min-height: 104px; padding: 0.5rem 0.55rem;
  border-radius: 10px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text); text-decoration: none;
}
a.kalender-tag:hover { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.kalender-tag.leer { border: none; background: none; }
.kalender-tag.vergangen { opacity: 0.45; }
.kalender-tag .kt-datum { font-size: 0.85rem; font-weight: 700; }
.kalender-tag .kt-preis { font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: auto; }
.kalender-tag .kt-info { font-size: 0.74rem; color: var(--muted); line-height: 1.3; }
.kalender-tag .kt-event { font-size: 0.74rem; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.kalender-tag .kt-pfeil { position: absolute; top: 0.45rem; right: 0.55rem; font-size: 0.72rem; font-weight: 700; }
.nf-normal { background: var(--nf-normal); border-color: #ebe3cf; }
.nf-gefragt { background: var(--nf-gefragt); border-color: #d6c495; }
.nf-sehr { background: var(--nf-sehr); border-color: var(--nf-sehr); color: #fff; }
.nf-sehr .kt-info { color: rgba(255, 255, 255, 0.85); }
.nf-zu { background: repeating-linear-gradient(135deg, #f1f0ed 0 6px, #f8f7f5 6px 12px); color: var(--muted); }
.kalender-legende { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.82rem; color: var(--muted); margin-top: 0.9rem; align-items: center; }
.kalender-legende span { display: inline-flex; align-items: center; gap: 0.4rem; }
.kalender-legende i { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--border); display: inline-block; }

.umschalter { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: #ecebe7; border-radius: 10px; }
.umschalter a { padding: 0.35rem 0.8rem; border-radius: 7px; font-size: 0.86rem; color: var(--text); text-decoration: none; font-weight: 500; }
.umschalter a.aktiv { background: var(--card-bg); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.monat-nav { display: flex; align-items: center; gap: 0.75rem; }
.monat-nav h2 { margin: 0; min-width: 9.5rem; text-align: center; font-size: 1.15rem; }
.steuerleiste { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }

/* Chips für Events/Nachfrage */
.chip { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; white-space: nowrap; background: #efeeeb; color: var(--text); margin: 0.1rem 0.2rem 0.1rem 0; }
.chip-sehr-hoch { background: var(--nf-sehr); color: #fff; }
.chip-hoch { background: var(--nf-gefragt); color: #4a3d1e; }
.chip-mittel { background: var(--nf-normal); color: #5a4b26; }
.chip-niedrig { background: #f1f0ee; color: var(--muted); }
.chip-negativ { background: #eef1f5; color: #3d4b5c; }
.chip-geschlossen { background: #2f3135; color: #fff; }
.chip-geschaetzt { background: #fff; border: 1px dashed #c9c6c1; color: var(--muted); font-weight: 500; }

/* Diagramm */
.diagramm { width: 100%; height: auto; display: block; overflow: visible; }
.diagramm .gitter { stroke: var(--chart-grid); stroke-width: 1; }
.diagramm .achse-text { fill: var(--muted); font-size: 10px; }
.diagramm .balken-otb { fill: var(--chart-otb); }
.diagramm .balken-prognose { fill: var(--chart-prognose); }
.diagramm .event-punkt { fill: var(--primary); }
.diagramm .kap-linie { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.diagramm .tag-treffer { fill: transparent; cursor: pointer; }
.diagramm .tag-gruppe:hover .tag-treffer { fill: rgba(122, 102, 56, 0.07); }
.legende { display: flex; gap: 1.25rem; flex-wrap: wrap; font-size: 0.82rem; color: var(--muted); margin-top: 0.6rem; }
.legende span { display: inline-flex; align-items: center; gap: 0.4rem; }
.legende i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.legende i.punkt { width: 8px; height: 8px; border-radius: 50%; }
.diagramm-tooltip {
  position: fixed; pointer-events: none; z-index: 2000; background: var(--primary-dark); color: #fff;
  padding: 0.5rem 0.7rem; border-radius: 8px; font-size: 0.8rem; line-height: 1.45; max-width: 280px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Preis-Tabelle (alle Kategorien) */
.preis { font-weight: 700; font-variant-numeric: tabular-nums; }
.preis-vgl { display: block; font-size: 0.75rem; color: var(--muted); font-weight: 400; }
.auslastung-balken { display: inline-block; width: 64px; height: 8px; border-radius: 4px; background: #eceae6; position: relative; vertical-align: middle; overflow: hidden; }
.auslastung-balken b { position: absolute; left: 0; top: 0; bottom: 0; background: var(--chart-otb); }
.auslastung-balken i { position: absolute; top: 0; bottom: 0; background: var(--chart-prognose); }
tr.geschlossen td { color: var(--muted); background: #f8f7f5; }

/* Tagesansicht */
.begruendung { font-size: 1.08rem; line-height: 1.6; max-width: 68ch; margin: 0; }
.empfehlung-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.9rem; }
.empfehlung-kachel { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; }
.empfehlung-kachel h3 { margin: 0; font-size: 0.95rem; }
.empfehlung-kachel .ek-preis { font-size: 1.8rem; font-weight: 700; font-variant-numeric: tabular-nums; margin: 0.25rem 0 0.15rem; letter-spacing: -0.02em; }
.empfehlung-kachel p { margin: 0; font-size: 0.84rem; color: var(--muted); }
.faktor-liste { list-style: none; margin: 0; padding: 0; font-size: 0.92rem; }
.faktor-liste li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.45rem 0; border-bottom: 1px solid var(--border); }
.faktor-liste li:last-child { border-bottom: none; }
.faktor-liste li > span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.faktor-liste .summe { font-weight: 700; }
.tag-nav { display: flex; gap: 0.5rem; }
details.mehr > summary { cursor: pointer; color: var(--gold-text); font-weight: 600; font-size: 0.9rem; list-style: none; }
details.mehr > summary::-webkit-details-marker { display: none; }
details.mehr > summary::before { content: "+ "; }
details.mehr[open] > summary::before { content: "– "; }
details.mehr[open] > summary { margin-bottom: 0.75rem; }

/* ── Druck ───────────────────────────────────────────────────────────── */
@media print {
  .no-print, .sidebar, .sidebar-user, .mobile-topbar { display: none !important; }
  body.app-shell { display: block; }
  .content { max-width: none; margin: 0; padding: 0; }
  .card { break-inside: avoid; }
  .kalender-tag { min-height: 80px; }
  table { font-size: 9pt; }
  a { color: inherit; text-decoration: none; }
  @page { size: A4 landscape; margin: 12mm; }
}

/* ── Mobil (am Ende, damit es die Basisregeln überstimmt) ────────────── */
@media screen and (max-width: 880px) {
  body.app-shell { display: block; }
  .mobile-topbar { display: flex; }
  .sidebar {
    position: fixed; top: 0; left: 0; z-index: 1200; transform: translateX(-100%);
    transition: transform 0.25s ease; box-shadow: 0 0 30px rgba(0, 0, 0, 0.18);
  }
  .sidebar.offen { transform: translateX(0); }
  .sidebar-backdrop.offen { display: block; }
  .content { padding: 1.25rem 1rem 2rem; max-width: none; }
  .page-header h1 { font-size: 1.4rem; }
  .card { padding: 1.1rem; }
  .form-grid, .form-grid-3, .zahlen-reihe { grid-template-columns: 1fr; }
  .kalender { gap: 3px; }
  .kalender-tag { min-height: 64px; padding: 0.3rem; border-radius: 6px; }
  .kalender-tag .kt-info, .kalender-tag .kt-event, .kalender-tag .kt-pfeil { display: none; }
  .kalender-tag .kt-preis { font-size: 0.85rem; }
  .kalender-tag .kt-datum { font-size: 0.75rem; }
  .kalender-tag .kt-eur { display: none; }
  .hinweis-zeile { grid-template-columns: 3.4rem 1fr; }
  .hinweis-preis { grid-column: 2; text-align: left; }
  .nur-desktop { display: none !important; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

/* Passwort setzen (Admin) direkt in der Benutzerzeile */
.passwort-setzen > summary { list-style: none; }
.passwort-setzen > summary::-webkit-details-marker { display: none; }
.passwort-setzen[open] > summary { background: var(--bg); }
.passwort-form { min-width: 240px; padding: 0.25rem 0 0.5rem; white-space: normal; }

/* "Neu laden": sichtbar beschäftigt, solange die Seite neu lädt */
.neu-laden-form button[aria-busy="true"] { opacity: 0.75; cursor: progress; }
.neu-laden-form button[aria-busy="true"] .neu-laden-symbol { animation: drehen 0.9s linear infinite; }
@keyframes drehen { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .neu-laden-form button[aria-busy="true"] .neu-laden-symbol { animation: none; } }

/* ── Geschützte Formular-Fenster ─────────────────────────────────────── */
.formular-dialog {
  border: none; border-radius: 16px; padding: 0; width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 48px); color: var(--text); background: var(--card-bg);
  box-shadow: 0 30px 80px rgba(20, 18, 12, 0.28);
}
.formular-dialog.breit { width: min(900px, calc(100vw - 32px)); }
.formular-dialog::backdrop { background: rgba(28, 26, 22, 0.45); backdrop-filter: blur(2px); }
.formular-dialog[open] { display: flex; flex-direction: column; }
.dialog-kopf {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--border); background: var(--gold-hell);
}
.dialog-kopf h2 { margin: 0; font-size: 1.1rem; }
.dialog-x {
  background: none; border: none; color: var(--muted); font-size: 1.6rem; line-height: 1;
  padding: 0.1rem 0.45rem; border-radius: 6px;
}
.dialog-x:hover { background: rgba(0, 0, 0, 0.06); color: var(--text); }
.dialog-inhalt { padding: 0.4rem 1.4rem 1.4rem; overflow-y: auto; }
.dialog-inhalt .form-actions { justify-content: flex-end; position: sticky; bottom: -1.4rem; background: var(--card-bg); padding: 0.9rem 0 0.2rem; margin-top: 1rem; border-top: 1px solid var(--border); }
.formular-dialog.wackeln { animation: wackeln 0.3s; }
@keyframes wackeln { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .formular-dialog.wackeln { animation: none; } }
button[aria-busy="true"] { cursor: progress; opacity: 0.8; }
.dialog-oeffner { display: inline-flex; }

/* Tagesansicht im Fenster: Karten ohne eigenen Rahmen, dafür Trennlinien */
.dialog-inhalt .card { border: none; border-radius: 0; padding: 1rem 0 0; margin: 0 0 1rem; border-top: 1px solid var(--border); }
.dialog-inhalt .cards-row { gap: 1.5rem; margin-bottom: 0; }
.fenster-leiste { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 0.9rem 0 0.6rem; }
.formular-dialog.breit { width: min(980px, calc(100vw - 32px)); }

/* Einstellungen → Raten: ruhende Raten ausblendbar */
.raten-tabelle.nur-aktive tr.rate-ruht { display: none; }

/* Sortierbare Tabellen: Spaltenüberschrift als Knopf mit Richtungspfeil */
.sortier-knopf {
  all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 0.3rem;
  font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit;
}
.sortier-knopf:hover { color: var(--text); }
.sortier-knopf:focus-visible { outline: 2px solid var(--gold-text); outline-offset: 2px; border-radius: 3px; }
.sortier-knopf::after { content: "↕"; opacity: 0.35; font-size: 0.85em; }
th[aria-sort="ascending"] .sortier-knopf::after { content: "↑"; opacity: 1; color: var(--gold-text); }
th[aria-sort="descending"] .sortier-knopf::after { content: "↓"; opacity: 1; color: var(--gold-text); }
th.zahl .sortier-knopf { flex-direction: row-reverse; }
