/* ====================================================================
   Hausverwaltung Hauk Immobilien GbR - Oberfläche

   Gestaltungsgrundlage: ruhige Flächen, viel Luft, wenig Linien.
   Farbe nur dort, wo sie etwas bedeutet. Die Schrift kommt vom
   Betriebssystem (auf Mac und iPhone ist das San Francisco) - das
   sieht nicht nur richtig aus, es lädt auch nichts von fremden
   Servern nach, was sowohl die Sicherheitsregeln der Anwendung als
   auch den Datenschutz erfordert.

   Kein Framework, eine einzige Datei.
   ==================================================================== */

/* ---------------- Farben und Maße ---------------- */
:root {
  color-scheme: light dark;

  --bg:          #f5f5f7;
  --bg-2:        #ffffff;
  --card:        #ffffff;
  --card-2:      #fbfbfd;

  --ink:         #1d1d1f;
  --ink-2:       #424245;
  --muted:       #6e6e73;
  --muted-2:     #86868b;

  --line:        rgba(0, 0, 0, .08);
  --line-2:      rgba(0, 0, 0, .14);

  --accent:      #0071e3;
  --accent-2:    #0077ed;
  --accent-weich:rgba(0, 113, 227, .10);
  --accent-ring: rgba(0, 113, 227, .28);

  --ok:          #1d7d3f;
  --ok-bg:       rgba(29, 125, 63, .10);
  --warn:        #9a6200;
  --warn-bg:     rgba(154, 98, 0, .10);
  --err:         #c1231b;
  --err-bg:      rgba(193, 35, 27, .09);

  --r-gross:     18px;
  --r-mittel:    12px;
  --r-klein:     8px;
  --r-pille:     980px;

  --schatten:    0 1px 2px rgba(0, 0, 0, .04), 0 6px 20px rgba(0, 0, 0, .045);
  --schatten-2:  0 2px 6px rgba(0, 0, 0, .06), 0 16px 40px rgba(0, 0, 0, .10);

  --breite:      1120px;
  --kopfhoehe:   52px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #000000;
    --bg-2:        #1d1d1f;
    --card:        #1c1c1e;
    --card-2:      #242426;

    --ink:         #f5f5f7;
    --ink-2:       #d6d6d8;
    --muted:       #98989d;
    --muted-2:     #8a8a8e;

    --line:        rgba(255, 255, 255, .10);
    --line-2:      rgba(255, 255, 255, .18);

    --accent:      #2997ff;
    --accent-2:    #47a5ff;
    --accent-weich:rgba(41, 151, 255, .14);
    --accent-ring: rgba(41, 151, 255, .35);

    --ok:          #4fd06b;
    --ok-bg:       rgba(79, 208, 107, .13);
    --warn:        #ffb340;
    --warn-bg:     rgba(255, 179, 64, .13);
    --err:         #ff6961;
    --err-bg:      rgba(255, 105, 97, .13);

    --schatten:    0 1px 2px rgba(0, 0, 0, .5);
    --schatten-2:  0 12px 40px rgba(0, 0, 0, .6);
  }
}

/* ---------------- Grundlagen ---------------- */
* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
               "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

h1 {
  font-size: 2rem; line-height: 1.12; font-weight: 600;
  letter-spacing: -.022em; margin: 0 0 .35rem;
}
h2 {
  font-size: 1.25rem; line-height: 1.2; font-weight: 600;
  letter-spacing: -.018em; margin: 2.2rem 0 .9rem;
}
h3 {
  font-size: 1rem; font-weight: 600; letter-spacing: -.012em;
  margin: 1.6rem 0 .6rem;
}
p { margin: .55rem 0; }
small, .klein { font-size: .8125rem; line-height: 1.45; color: var(--muted); }

::selection { background: var(--accent-weich); }

:focus-visible {
  outline: 3px solid var(--accent-ring);
  outline-offset: 2px;
  border-radius: var(--r-klein);
}

/* ---------------- Kopfzeile ---------------- */
.kopf {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg-2) 72%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
@supports not (backdrop-filter: blur(1px)) {
  .kopf { background: var(--bg-2); }
}

.kopf-innen {
  max-width: var(--breite); margin: 0 auto;
  padding: 0 1.5rem; min-height: var(--kopfhoehe);
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
}

.kopf .marke {
  font-size: .9375rem; font-weight: 600; letter-spacing: -.014em;
  color: var(--ink); white-space: nowrap;
}
.kopf .marke span { color: var(--muted); font-weight: 400; }

.kopf nav {
  display: flex; align-items: center; gap: .1rem;
  flex-wrap: wrap; margin-left: auto;
}
.kopf nav a {
  color: var(--ink-2); font-size: .8125rem; font-weight: 400;
  padding: .34rem .68rem; border-radius: var(--r-pille);
  transition: background .18s ease, color .18s ease;
  white-space: nowrap;
}
.kopf nav a:hover { background: var(--line); color: var(--ink); text-decoration: none; }
.kopf nav a.aktiv { background: var(--ink); color: var(--bg-2); font-weight: 500; }

.kopf form { display: inline-flex; margin-left: .35rem; }
.kopf .abmelden {
  background: none; border: 1px solid var(--line-2); color: var(--ink-2);
  padding: .28rem .78rem; border-radius: var(--r-pille);
  cursor: pointer; font: inherit; font-size: .8125rem;
  transition: border-color .18s ease, color .18s ease;
}
.kopf .abmelden:hover { border-color: var(--ink); color: var(--ink); }

/* ---------------- Seitenrahmen ---------------- */
.huelle {
  max-width: var(--breite); margin: 0 auto;
  padding: 2.5rem 1.5rem 6rem;
}
.huelle > h1:first-child,
.seiten-kopf { margin-bottom: 1.75rem; }
.seiten-kopf h1 { margin-bottom: .3rem; }
.seiten-kopf p  { color: var(--muted); margin: 0; font-size: .9375rem; }
.seiten-kopf {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}

/* ---------------- Karten ---------------- */
.kachel {
  background: var(--card);
  border-radius: var(--r-gross);
  padding: 1.5rem 1.65rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--schatten);
}
.kachel > :first-child { margin-top: 0; }
.kachel > :last-child  { margin-bottom: 0; }
.kachel h2 { font-size: 1.0625rem; margin-top: 0; }

/* Hervorgehobene Karte - für Hinweise, die keine Warnung sind */
.kachel.hervor {
  background: var(--accent-weich);
  box-shadow: none;
}
.kachel.hervor h2 { color: var(--ink); }

.gitter { display: grid; gap: 1.25rem; align-items: start; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); }

/* ---------------- Kennzahlen ---------------- */
.zahl {
  background: var(--card); border-radius: var(--r-gross);
  padding: 1.35rem 1.5rem; box-shadow: var(--schatten);
}
.zahl .wert {
  font-size: 2.125rem; font-weight: 600; letter-spacing: -.025em;
  line-height: 1.1; font-variant-numeric: tabular-nums;
}
.zahl .titel {
  font-size: .8125rem; color: var(--muted); font-weight: 400;
  text-transform: none; letter-spacing: -.005em; margin-top: .2rem;
}

/* ---------------- Meldungen ---------------- */
.meldung {
  border-radius: var(--r-mittel); padding: .85rem 1.15rem;
  margin-bottom: 1rem; font-size: .9375rem;
  display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap;
}
.meldung::before { font-weight: 600; }
.meldung.erfolg  { background: var(--ok-bg);   color: var(--ok);   }
.meldung.fehler  { background: var(--err-bg);  color: var(--err);  }
.meldung.hinweis { background: var(--warn-bg); color: var(--warn); }
.meldung a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ---------------- Tabellen ---------------- */
table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
th, td {
  text-align: left; padding: .8rem .75rem;
  border-bottom: 1px solid var(--line); vertical-align: top;
}
th {
  font-size: .75rem; font-weight: 500; color: var(--muted);
  letter-spacing: 0; text-transform: none; background: none;
  padding-top: 0; padding-bottom: .5rem;
}
thead th { border-bottom: 1px solid var(--line-2); }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: var(--card-2); }
tr:last-child td { border-bottom: none; }
td.zahl-re, th.zahl-re, .rechts { text-align: right; }
td.zahl-re, th.zahl-re { font-variant-numeric: tabular-nums; }
.tabelle-huelle { overflow-x: auto; margin: 0 -1.65rem; padding: 0 1.65rem; }

/* ---------------- Formulare ---------------- */
label {
  display: block; font-size: .8125rem; font-weight: 500;
  color: var(--muted); margin-bottom: .35rem; letter-spacing: -.006em;
}
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=number], input[type=tel], input[type=url], select, textarea {
  width: 100%; padding: .68rem .85rem;
  border: 1px solid var(--line-2); border-radius: var(--r-mittel);
  font: inherit; letter-spacing: inherit;
  background: var(--bg-2); color: var(--ink);
  transition: border-color .18s ease, box-shadow .18s ease;
  -webkit-appearance: none; appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%236e6e73' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .85rem center;
  background-size: 12px; padding-right: 2.4rem;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 1rem; height: 1rem; }
textarea {
  min-height: 7rem; line-height: 1.5;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .8125rem;
}
.feld { margin-bottom: 1.1rem; }
.feld .hilfe { font-size: .8125rem; color: var(--muted); margin-top: .35rem; }
fieldset {
  border: none; border-top: 1px solid var(--line);
  padding: 1.4rem 0 0; margin: 2rem 0 0;
}
fieldset:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
legend {
  font-size: .9375rem; font-weight: 600; padding: 0;
  color: var(--ink); letter-spacing: -.012em;
}
.pflicht { color: var(--err); }

/* ---------------- Schaltflächen ---------------- */
.knopf {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .62rem 1.25rem; border-radius: var(--r-pille);
  border: 1px solid transparent; background: var(--accent); color: #fff;
  font: inherit; font-size: .9375rem; font-weight: 500; letter-spacing: -.01em;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .18s ease, transform .1s ease, opacity .18s ease;
}
.knopf:hover { background: var(--accent-2); color: #fff; text-decoration: none; }
.knopf:active { transform: scale(.975); }
.knopf.leer {
  background: none; color: var(--accent); border-color: var(--line-2);
}
.knopf.leer:hover { background: var(--accent-weich); color: var(--accent); }
/* Loeschen ist zurueckhaltend getoent, nicht knallrot gefuellt - eine
   Zeilenaktion soll nicht lauter sein als der eigentliche Inhalt.
   Fuer wirklich prominente Loeschvorgaenge gibt es zusaetzlich .voll. */
.knopf.gefahr { background: var(--err-bg); color: var(--err); border-color: transparent; }
.knopf.gefahr:hover { background: color-mix(in srgb, var(--err) 18%, transparent); color: var(--err); }
.knopf.gefahr.voll { background: var(--err); color: #fff; }
.knopf.gefahr.voll:hover { background: color-mix(in srgb, var(--err) 85%, #000); color: #fff; }
.knopf.klein { padding: .34rem .85rem; font-size: .8125rem; }
.knopf[disabled] { opacity: .4; cursor: not-allowed; }
.knopf[disabled]:active { transform: none; }
.knopfreihe {
  display: flex; gap: .65rem; flex-wrap: wrap; align-items: center;
  margin-top: 1.75rem;
}

/* ---------------- Kennzeichen ---------------- */
.marke-chip {
  display: inline-block; padding: .2rem .65rem; border-radius: var(--r-pille);
  font-size: .75rem; font-weight: 500; letter-spacing: -.004em;
  border: none; background: var(--line); color: var(--ink-2); white-space: nowrap;
}
.marke-chip.ok   { background: var(--ok-bg);   color: var(--ok);   }
.marke-chip.warn { background: var(--warn-bg); color: var(--warn); }
.marke-chip.err  { background: var(--err-bg);  color: var(--err);  }
.marke-chip.info { background: var(--accent-weich); color: var(--accent); }

/* ---------------- Reiter als Segmentschalter ---------------- */
.reiter {
  display: inline-flex; gap: .15rem; border-bottom: none;
  background: var(--line); padding: .22rem; border-radius: var(--r-mittel);
  margin-bottom: 1.75rem; flex-wrap: wrap;
}
.reiter a {
  padding: .4rem .95rem; border-radius: calc(var(--r-mittel) - .22rem);
  color: var(--ink-2); font-size: .875rem; font-weight: 500;
  border: none; margin: 0; transition: background .18s ease, color .18s ease;
}
.reiter a:hover { text-decoration: none; color: var(--ink); }
.reiter a.aktiv {
  background: var(--card); color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
}

/* ---------------- Fortschritt ---------------- */
.balken {
  height: 6px; background: var(--line); border-radius: var(--r-pille);
  overflow: hidden;
}
.balken > i {
  display: block; height: 100%; background: var(--accent);
  border-radius: var(--r-pille); transition: width .4s ease;
}
.balken.warn > i { background: var(--warn); }
.balken.err  > i { background: var(--err); }

/* ---------------- Checkliste ---------------- */
.check { list-style: none; padding: 0; margin: 0; }
.check li {
  display: flex; gap: .9rem; padding: .95rem 0;
  border-bottom: 1px solid var(--line);
}
.check li:first-child { padding-top: 0; }
.check li:last-child { border-bottom: none; padding-bottom: 0; }
.check .haken {
  flex: none; width: 1.5rem; height: 1.5rem; border-radius: 50%;
  display: grid; place-items: center; font-size: .8rem; font-weight: 600;
  margin-top: .05rem; border: none;
}
.check .haken.ja   { background: var(--ok-bg);   color: var(--ok);   }
.check .haken.nein { background: var(--warn-bg); color: var(--warn); }
.check .titel { font-weight: 500; font-size: .9375rem; letter-spacing: -.01em; }

/* ---------------- Anmeldeseite ---------------- */
.mitte {
  min-height: 100vh; display: grid; place-items: center;
  padding: 2rem 1.5rem; background: var(--bg);
}
.anmeldebox { width: 100%; max-width: 25rem; }
.anmeldebox .kachel { padding: 2.25rem 2rem; box-shadow: var(--schatten-2); }
.anmeldebox h1 { font-size: 1.5rem; letter-spacing: -.021em; }
.anmeldebox .knopf { width: 100%; }

/* ---------------- Sonstiges ---------------- */
/* .mono setzt nur die Schrift - Flaechen wuerden in Tabellen stoeren.
   Wer eine hervorgehobene Flaeche will, nimmt <code>. */
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .875em; letter-spacing: 0;
}
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .85em; background: var(--line); color: var(--ink-2);
  padding: .12rem .42rem; border-radius: 6px; letter-spacing: 0;
}
.trenner { border: none; border-top: 1px solid var(--line); margin: 2rem 0; }
.nowrap { white-space: nowrap; }

details > summary {
  cursor: pointer; font-weight: 500; font-size: .875rem; color: var(--accent);
  list-style: none;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::before {
  content: "\25B8"; display: inline-block; margin-right: .45rem;
  transition: transform .2s ease;
}
details[open] > summary::before { transform: rotate(90deg); }
details[open] > summary { margin-bottom: .9rem; }

.diff {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .8125rem; background: var(--card-2);
  border: 1px solid var(--line); border-radius: var(--r-klein);
  padding: .7rem .85rem; white-space: pre-wrap; word-break: break-word;
  margin: .4rem 0; line-height: 1.5;
}
.ohne-inhalt { text-align: center; color: var(--muted); padding: 3rem 1rem; }

/* ---------------- Bewegung sparsam ---------------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------------- Schmale Bildschirme ---------------- */
@media (max-width: 700px) {
  h1 { font-size: 1.625rem; }
  .huelle { padding: 1.75rem 1.15rem 4rem; }
  .kachel { padding: 1.25rem 1.15rem; border-radius: var(--r-mittel); }
  .tabelle-huelle { margin: 0 -1.15rem; padding: 0 1.15rem; }
  .kopf-innen { padding: .5rem 1.15rem; }
  .kopf nav { width: 100%; margin-left: 0; overflow-x: auto; padding-bottom: .3rem; }
}

/* ---------------- Druck ---------------- */
@media print {
  :root { --bg: #fff; --card: #fff; --ink: #000; }
  .kopf, .knopfreihe, .reiter, form, .meldung { display: none !important; }
  body { background: #fff; color: #000; }
  .kachel { box-shadow: none; border: 1px solid #ddd; padding: 0; margin-bottom: 1.5rem; }
  a { color: #000; }
}
