@charset "UTF-8";
/* ==========================================================================
   Ferienhausverwaltung Kranich — Oberfläche

   Ein Werkzeug, kein Prospekt: ruhige Farben, große Klickflächen, gut
   lesbare Zahlen. Dieselbe Farbwelt wie die Website (Gold #d09c6a und
   warme Brauntöne), damit sich beides zusammengehörig anfühlt.

     1  Marken und Grundlagen
     2  Gerüst: Kopf, Seitenleiste, Inhalt
     3  Schaltflächen und Felder
     4  Kacheln und Listen
     5  Tabellen
     6  Formulare und Dialoge
     7  Belegungsplan
     8  Meldungen
     9  Druckstücke (Vertrag, Abrechnung, Rechnung)
   ========================================================================== */

/* ---------- 1. Marken und Grundlagen ------------------------------------ */

:root {
  color-scheme: light dark;

  --knopf-text:  #ffffff;
  --gold:        #d09c6a;
  --gold-hell:   #f3e3d2;
  --braun:       #8a5a31;
  --braun-tief:  #5a3d26;
  --braun-nacht: #241c15;

  --grund:       #faf7f3;
  --grund-2:     #f3ece3;
  --flaeche:     #ffffff;
  --flaeche-2:   #fdfaf6;
  --linie:       #e6dccf;
  --linie-stark: #d3c3ae;
  /* Eingabefelder brauchen einen Rahmen mit mindestens 3:1, sonst sieht
     man nicht, wo das Feld anfängt. */
  --feldrand:    #97836b;

  --text:        #2e2b27;
  --text-leise:  #605950;
  --text-zart:   #6e675e;   /* 5,6:1 auf Weiß – auch klein noch lesbar */

  --gruen:       #4c6b3c;
  --gruen-zart:  #e8f0e2;
  --gelb:        #7d5609;   /* dunkler als zuvor, sonst zu blass */
  --gelb-zart:   #fcf1d8;
  --rot:         #a8402a;
  --rot-zart:    #fae5e0;
  --blau:        #35566e;
  --blau-zart:   #e5eef4;

  --schrift: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
             "Helvetica Neue", Arial, sans-serif;
  --schrift-zahl: "SF Mono", "Cascadia Mono", "Segoe UI Mono", Consolas,
                  "Liberation Mono", monospace;

  --rund:    10px;
  --rund-sm: 6px;
  --rund-lg: 16px;

  --schatten-sm: 0 1px 2px rgba(59,42,28,.07), 0 1px 3px rgba(59,42,28,.05);
  --schatten:    0 2px 8px rgba(59,42,28,.08), 0 8px 24px rgba(59,42,28,.07);
  --schatten-lg: 0 12px 40px rgba(59,42,28,.18);

  --leiste: 15rem;
  --kopf: 3.75rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-thema="hell"]) {
    --grund:       #191410;
    --grund-2:     #1f1913;
    --flaeche:     #241d17;
    --flaeche-2:   #2b231b;
    --linie:       #3a2f26;
    --linie-stark: #4d3f33;
    --feldrand:    #8b7663;
    --text:        #f0e8df;
    --text-leise:  #c4b6a7;
    --text-zart:   #988b7e;
    --knopf-text:  #241c15;
    --braun:       #e0b183;
    --braun-tief:  #eec49a;
    --gold-hell:   #392b1d;
    --gruen-zart:  #23301c;
    --gelb-zart:   #362a12;
    --rot-zart:    #3a1f18;
    --blau-zart:   #1d2b34;
    --gruen:       #93b47f;
    --gelb:        #d9ac5a;
    --rot:         #e08a72;
    --blau:        #8ab4d0;
    --schatten-sm: 0 1px 2px rgba(0,0,0,.4);
    --schatten:    0 4px 14px rgba(0,0,0,.45);
    --schatten-lg: 0 18px 48px rgba(0,0,0,.6);
  }
}
:root[data-thema="dunkel"] {
  --grund: #191410; --grund-2: #1f1913; --flaeche: #241d17;
  --flaeche-2: #2b231b; --linie: #3a2f26; --linie-stark: #4d3f33; --feldrand: #8b7663;
  --text: #f0e8df; --text-leise: #c4b6a7; --text-zart: #988b7e;
  --knopf-text: #241c15;
  --braun: #e0b183; --braun-tief: #eec49a; --gold-hell: #392b1d;
  --gruen-zart: #23301c; --gelb-zart: #362a12; --rot-zart: #3a1f18;
  --blau-zart: #1d2b34; --gruen: #93b47f; --gelb: #d9ac5a; --rot: #e08a72;
  --blau: #8ab4d0;
  --schatten-sm: 0 1px 2px rgba(0,0,0,.4);
  --schatten: 0 4px 14px rgba(0,0,0,.45);
  --schatten-lg: 0 18px 48px rgba(0,0,0,.6);
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font-family: var(--schrift);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--braun);
  outline-offset: 2px;
  border-radius: var(--rund-sm);
}

h1, h2, h3, h4 { margin: 0 0 .6rem; line-height: 1.25; font-weight: 600; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .7rem; }
p:last-child { margin-bottom: 0; }
a { color: var(--braun); }

.nur-vorlesen {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%);
  white-space: nowrap;
}

.zahl { font-variant-numeric: tabular-nums; }
.rechts { text-align: right; }
.zart { color: var(--text-zart); }
.leise { color: var(--text-leise); }
.klein { font-size: .85rem; }
.dick { font-weight: 600; }
.abstand { margin-top: 1rem; }
.abstand-l { margin-top: 1.75rem; }
[hidden] { display: none !important; }


/* ---------- 2. Gerüst ---------------------------------------------------- */

.anmeldung {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(120% 90% at 50% 0%, var(--gold-hell) 0%, transparent 60%),
    var(--grund);
}
.anmeldung__kasten {
  width: min(100%, 24rem);
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--rund-lg);
  box-shadow: var(--schatten);
  padding: 2rem;
}
.anmeldung__marke {
  display: grid; place-items: center; gap: .75rem;
  margin-bottom: 1.5rem; text-align: center;
}
.anmeldung__marke img { width: 3.5rem; height: 3.5rem; }
.anmeldung__marke strong { font-size: 1.1rem; }

.gerippe { display: grid; grid-template-columns: 1fr; min-height: 100dvh; }
@media (min-width: 60rem) {
  .gerippe { grid-template-columns: var(--leiste) 1fr; }
}

/* Seitenleiste */
.leiste {
  background: var(--braun-nacht);
  color: #efe6db;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
}
@media (max-width: 59.99rem) {
  .leiste {
    position: fixed; inset: 0 auto 0 0; width: min(84vw, 17rem);
    z-index: 60; transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.22,.61,.36,1);
    box-shadow: var(--schatten-lg);
  }
  .leiste[data-offen="ja"] { transform: none; }
}

.leiste__marke {
  display: flex; align-items: center; gap: .7rem;
  padding: 1rem 1.1rem; min-height: var(--kopf);
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.leiste__marke img { width: 2rem; height: 2rem; border-radius: 7px; }
.leiste__marke span { font-weight: 600; font-size: .95rem; }

.leiste nav { padding: .75rem .6rem; flex: 1; }
.leiste__gruppe {
  padding: .9rem .55rem .35rem;
  font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(239, 230, 219, .62);   /* 6:1 auf dem dunklen Grund */
}
.leiste a {
  display: flex; align-items: center; gap: .7rem;
  padding: .52rem .6rem; border-radius: var(--rund-sm);
  color: rgba(239,230,219,.82); text-decoration: none;
  font-size: .92rem;
}
.leiste a:hover { background: rgba(255,255,255,.07); color: #fff; }
.leiste a[aria-current="page"] {
  background: var(--gold); color: var(--braun-nacht); font-weight: 600;
}
.leiste a svg { width: 1.05rem; height: 1.05rem; flex: 0 0 auto; }
.leiste__zaehler {
  margin-left: auto; min-width: 1.35rem; padding: 0 .35rem;
  border-radius: 999px; background: var(--rot); color: #fff;
  font-size: .72rem; font-weight: 700; text-align: center;
}
.leiste a[aria-current="page"] .leiste__zaehler { background: var(--braun-nacht); color: #fff; }

.leiste__fuss {
  padding: .8rem 1.1rem 1.1rem;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; gap: .5rem;
  font-size: .8rem; color: rgba(239,230,219,.6);
}

.verdunkeln {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(20,14,10,.5);
}
@media (min-width: 60rem) { .verdunkeln { display: none; } }

/* Kopfzeile und Inhalt */
.haupt { display: flex; flex-direction: column; min-width: 0; }

.kopf {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: .75rem;
  min-height: var(--kopf); padding: .5rem clamp(.9rem, 2vw, 1.6rem);
  background: color-mix(in srgb, var(--grund) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--linie);
}
.kopf h1 { margin: 0; font-size: 1.12rem; }
.kopf__werkzeuge { margin-left: auto; display: flex; align-items: center; gap: .45rem; }

.inhalt {
  padding: clamp(1rem, 2.2vw, 1.75rem);
  flex: 1;
  max-width: 90rem;
  width: 100%;
}


/* ---------- 3. Schaltflächen und Felder --------------------------------- */

/* Die Schriftfarbe gefüllter Knöpfe steht in --knopf-text und wechselt mit
   dem Farbmodus. Wichtig: nicht über eine Regel mit höherem Gewicht
   umfärben – sonst erwischt es auch die stillen Knöpfe, und deren
   Beschriftung verschwindet im dunklen Modus. */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 2.4rem; padding: 0 .95rem;
  border: 1px solid var(--braun); border-radius: var(--rund-sm);
  background: var(--braun); color: var(--knopf-text);
  font: inherit; font-weight: 600; font-size: .9rem;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: filter .15s, background .15s, border-color .15s;
}
.knopf:hover { filter: brightness(1.08); }
.knopf:disabled { opacity: .5; cursor: not-allowed; }
.knopf svg { width: 1.05rem; height: 1.05rem; }

.knopf--still {
  background: var(--flaeche); color: var(--text); border-color: var(--linie-stark);
}
.knopf--still:hover { background: var(--flaeche-2); border-color: var(--braun); }

.knopf--leer {
  background: transparent; border-color: transparent; color: var(--text-leise);
}
.knopf--leer:hover { background: var(--grund-2); color: var(--text); }

.knopf--gefahr {
  background: var(--rot); border-color: var(--rot); color: var(--knopf-text);
}
.knopf--klein { min-height: 2rem; padding: 0 .6rem; font-size: .82rem; }
.knopf--symbol { padding: 0; width: 2.4rem; }
.knopf--symbol.knopf--klein { width: 2rem; }

.feld { display: grid; gap: .3rem; }
.feld > label { font-size: .82rem; font-weight: 600; color: var(--text-leise); }
.feld .hinweis { font-size: .76rem; color: var(--text-zart); }

input, select, textarea {
  width: 100%; min-height: 2.4rem; padding: .38rem .6rem;
  border: 1px solid var(--linie-stark); border-radius: var(--rund-sm);
  background: var(--flaeche); color: var(--text);
  font: inherit; font-size: .92rem;
}
textarea { min-height: 5rem; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--braun);
  box-shadow: 0 0 0 3px var(--gold-hell);
}
input[type="checkbox"] { width: 1.05rem; height: 1.05rem; min-height: 0; accent-color: var(--braun); }
input:disabled, select:disabled, textarea:disabled {
  background: var(--grund-2); color: var(--text-zart);
}
input.geld, input.zahl { font-family: var(--schrift-zahl); text-align: right; }

.reihe { display: grid; gap: .85rem; }
@media (min-width: 34rem) {
  .reihe--2 { grid-template-columns: 1fr 1fr; }
  .reihe--3 { grid-template-columns: 1fr 1fr 1fr; }
  .reihe--4 { grid-template-columns: repeat(4, 1fr); }
}
.werkzeugleiste {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  margin-bottom: 1rem;
}
.werkzeugleiste .wachsen { flex: 1 1 12rem; }


/* ---------- 4. Kacheln und Listen --------------------------------------- */

.karte {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--rund);
  box-shadow: var(--schatten-sm);
}
.karte__kopf {
  display: flex; align-items: center; gap: .6rem;
  padding: .8rem 1rem; border-bottom: 1px solid var(--linie);
}
.karte__kopf h2, .karte__kopf h3 { margin: 0; font-size: .98rem; }
.karte__kopf .knopf { margin-left: auto; }
.karte__koerper { padding: 1rem; }

.kacheln { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }

.kachel {
  display: block; padding: .95rem 1.05rem;
  background: var(--flaeche); border: 1px solid var(--linie);
  border-left: 3px solid var(--linie-stark);
  border-radius: var(--rund); text-decoration: none; color: inherit;
  box-shadow: var(--schatten-sm);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
a.kachel:hover { box-shadow: var(--schatten); transform: translateY(-1px); }
.kachel__wert {
  display: block; font-size: 1.7rem; font-weight: 600; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.kachel__text { display: block; font-size: .82rem; color: var(--text-leise); margin-top: .15rem; }
.kachel--rot   { border-left-color: var(--rot); }
.kachel--rot   .kachel__wert { color: var(--rot); }
.kachel--gelb  { border-left-color: var(--gelb); }
.kachel--gelb  .kachel__wert { color: var(--gelb); }
.kachel--gruen { border-left-color: var(--gruen); }
.kachel--gruen .kachel__wert { color: var(--gruen); }
.kachel--blau  { border-left-color: var(--blau); }
.kachel--blau  .kachel__wert { color: var(--blau); }

.marke {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .1rem .5rem; border-radius: 999px;
  font-size: .76rem; font-weight: 600; white-space: nowrap;
  background: var(--grund-2); color: var(--text-leise);
}
.marke--gruen { background: var(--gruen-zart); color: var(--gruen); }
.marke--gelb  { background: var(--gelb-zart);  color: var(--gelb); }
.marke--rot   { background: var(--rot-zart);   color: var(--rot); }
.marke--blau  { background: var(--blau-zart);  color: var(--blau); }
.marke__punkt { width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }

.leerhinweis {
  padding: 2.5rem 1rem; text-align: center; color: var(--text-zart);
}
.leerhinweis svg { width: 2.2rem; height: 2.2rem; margin: 0 auto .6rem; opacity: .5; }


/* ---------- 5. Tabellen -------------------------------------------------- */

.tabellenrahmen {
  border: 1px solid var(--linie); border-radius: var(--rund);
  background: var(--flaeche); overflow-x: auto;
}
table.liste { width: 100%; border-collapse: collapse; font-size: .89rem; }
table.liste th, table.liste td {
  padding: .55rem .75rem; text-align: left;
  border-bottom: 1px solid var(--linie); white-space: nowrap;
}
table.liste thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--grund-2); color: var(--text-leise);
  font-size: .74rem; letter-spacing: .06em; text-transform: uppercase;
  font-weight: 600;
}
table.liste tbody tr:last-child th,
table.liste tbody tr:last-child td { border-bottom: 0; }
table.liste tbody tr:hover { background: var(--flaeche-2); }
table.liste tr[data-klickbar] { cursor: pointer; }
table.liste td.geld, table.liste th.geld {
  text-align: right; font-variant-numeric: tabular-nums;
}
table.liste td.weit { white-space: normal; min-width: 12rem; }
table.liste tfoot td {
  font-weight: 600; background: var(--grund-2);
  border-top: 2px solid var(--linie-stark);
}

.sortierbar { cursor: pointer; user-select: none; }
.sortierbar::after { content: " ↕"; opacity: .35; }
.sortierbar[data-sortiert="auf"]::after { content: " ↑"; opacity: 1; }
.sortierbar[data-sortiert="ab"]::after { content: " ↓"; opacity: 1; }


/* ---------- 6. Formulare und Dialoge ------------------------------------ */

.dialog {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: end center;
  background: rgba(25,18,12,.45);
  backdrop-filter: blur(3px);
  padding: 0;
}
@media (min-width: 46rem) { .dialog { place-items: center; padding: 1.5rem; } }
.dialog[hidden] { display: none !important; }

.dialog__kasten {
  width: min(100%, 56rem);
  max-height: 92dvh;
  display: flex; flex-direction: column;
  background: var(--grund);
  border: 1px solid var(--linie);
  border-radius: var(--rund-lg) var(--rund-lg) 0 0;
  box-shadow: var(--schatten-lg);
  overflow: hidden;
}
@media (min-width: 46rem) { .dialog__kasten { border-radius: var(--rund-lg); } }
.dialog__kopf {
  display: flex; align-items: center; gap: .6rem;
  padding: .85rem 1.1rem; border-bottom: 1px solid var(--linie);
  background: var(--flaeche);
}
.dialog__kopf h2 { margin: 0; font-size: 1.05rem; }
.dialog__kopf .knopf--leer { margin-left: auto; }
.dialog__koerper { padding: 1.1rem; overflow-y: auto; flex: 1; }
.dialog__fuss {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  padding: .85rem 1.1rem; border-top: 1px solid var(--linie);
  background: var(--flaeche);
}
.dialog__fuss .rechtsbuendig { margin-left: auto; display: flex; gap: .5rem; }

fieldset {
  margin: 0 0 1.25rem; padding: 0; border: 0;
}
fieldset legend {
  padding: 0; margin-bottom: .6rem;
  font-size: .74rem; letter-spacing: .09em; text-transform: uppercase;
  font-weight: 700; color: var(--braun);
}

.reiter {
  display: flex; gap: .2rem; flex-wrap: wrap;
  border-bottom: 1px solid var(--linie); margin-bottom: 1.1rem;
}
.reiter button {
  min-height: 2.4rem; padding: 0 .85rem;
  border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--text-leise);
  font: inherit; font-weight: 600; font-size: .88rem; cursor: pointer;
}
.reiter button:hover { color: var(--text); }
.reiter button[aria-selected="true"] { color: var(--braun); border-bottom-color: var(--braun); }


/* ---------- 7. Belegungsplan -------------------------------------------- */

.plan { display: grid; gap: 1.25rem; }
.plan__monat {
  border: 1px solid var(--linie); border-radius: var(--rund);
  background: var(--flaeche); overflow: hidden;
}
.plan__monat h3 {
  margin: 0; padding: .55rem .8rem; font-size: .9rem;
  background: var(--grund-2); border-bottom: 1px solid var(--linie);
}
.plan__tage {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 1px; background: var(--linie); padding: 1px;
}
.plan__wochentag {
  background: var(--flaeche-2); padding: .3rem;
  text-align: center; font-size: .68rem; font-weight: 700;
  color: var(--text-zart); text-transform: uppercase;
}
.plan__tag {
  background: var(--flaeche); min-height: 3.1rem; padding: .28rem;
  font-size: .72rem; position: relative;
}
.plan__tag[data-leer] { background: var(--grund-2); }
.plan__tag .nummer { color: var(--text-zart); font-variant-numeric: tabular-nums; }
.plan__tag[data-heute] { box-shadow: inset 0 0 0 2px var(--braun); }
.plan__belegt {
  display: block; margin-top: .12rem; padding: .06rem .28rem;
  border-radius: 3px; font-size: .68rem; color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  cursor: pointer;
}
.plan__belegt[data-storniert] { opacity: .45; text-decoration: line-through; }
.plan__legende { display: flex; flex-wrap: wrap; gap: .75rem; font-size: .82rem; }
.plan__legende span { display: inline-flex; align-items: center; gap: .35rem; }
.plan__legende i { width: .9rem; height: .9rem; border-radius: 3px; }


/* ---------- 8. Meldungen ------------------------------------------------ */

.meldungen {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 90;
  display: grid; gap: .5rem; max-width: min(24rem, calc(100vw - 2rem));
}
.meldung {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .7rem .9rem; border-radius: var(--rund);
  background: var(--flaeche); border: 1px solid var(--linie);
  box-shadow: var(--schatten); font-size: .88rem;
  animation: hoch .25s cubic-bezier(.22,.61,.36,1);
}
@keyframes hoch { from { opacity: 0; transform: translateY(8px); } }
.meldung[data-art="fehler"] { border-left: 3px solid var(--rot); }
.meldung[data-art="erfolg"] { border-left: 3px solid var(--gruen); }
.meldung[data-art="hinweis"] { border-left: 3px solid var(--blau); }

.laden {
  display: inline-block; width: 1.05rem; height: 1.05rem;
  border: 2px solid var(--linie-stark); border-top-color: var(--braun);
  border-radius: 50%; animation: drehen .7s linear infinite;
}
@keyframes drehen { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; transition-duration: .01ms !important;
  }
}
