@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("/assets/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("/assets/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-style: normal; font-display: swap; src: url("/assets/fonts/inter-latin-700-normal.woff2") format("woff2"); }

:root {
  --blau: #2b76bb;
  --blau-dunkel: #1f5a92;
  --tuerkis: #21b19b;
  --grau: #c6c6c6;
  --bg: #f3f6f9;
  --flaeche: #ffffff;
  --flaeche-2: #eef3f8;
  --linie: #dbe3ec;
  --text: #1b2430;
  --text-2: #566273;
  --link: #1f5a92;
  --ok: #17785f;
  --ok-bg: #e0f4ee;
  --warn: #8a5a00;
  --warn-bg: #fdf0d2;
  --fehler: #a32a2a;
  --fehler-bg: #fbe3e3;
  --info-bg: #e3eefa;
  --schatten: 0 1px 2px rgba(20, 40, 70, 0.06), 0 4px 14px rgba(20, 40, 70, 0.05);
  --radius: 10px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0f1722;
  --flaeche: #172231;
  --flaeche-2: #1d2b3d;
  --linie: #2a3a50;
  --text: #e6edf5;
  --text-2: #9fb0c4;
  --link: #7db7ee;
  --ok: #5fd1b3;
  --ok-bg: #12382f;
  --warn: #f1c46b;
  --warn-bg: #3b2f12;
  --fehler: #ff9d9d;
  --fehler-bg: #43201f;
  --info-bg: #17304a;
  --schatten: 0 1px 2px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 15px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 0.6em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 0.9em; }
.klein { font-size: 0.86rem; color: var(--text-2); }
.mono { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ Rahmen */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns 0.2s ease; }
:root[data-nav="zu"] .app { grid-template-columns: 68px minmax(0, 1fr); }
.seitenleiste { overflow: hidden; }
.unten-block { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.werkzeuge { display: flex; gap: 8px; border-top: 1px solid var(--linie); padding-top: 12px; }
/* eingeklappt: schmale Leiste, nur die beiden Knöpfe bleiben */
:root[data-nav="zu"] .seitenleiste { padding-left: 14px; padding-right: 14px; }
:root[data-nav="zu"] .logo-feld, :root[data-nav="zu"] .menue, :root[data-nav="zu"] .nutzer { display: none; }
:root[data-nav="zu"] .werkzeuge { flex-direction: column; align-items: center; }

.icon-knopf {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0;
  border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-knopf:hover { background: var(--flaeche-2); color: var(--text); }
.icon-knopf:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.icon-knopf .icon { display: block; }
.icon-knopf .sonne { display: none; }
:root[data-theme="dark"] .icon-knopf .sonne { display: block; }
:root[data-theme="dark"] .icon-knopf .mond { display: none; }

.seitenleiste {
  background: var(--flaeche);
  border-right: 1px solid var(--linie);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.logo-feld img { display: block; width: 168px; height: auto; }
:root[data-theme="dark"] .logo-feld img { background: #fff; border-radius: 8px; padding: 6px 8px; }
.menue { display: flex; flex-direction: column; gap: 2px; }
.menue a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.93rem;
}
.menue a:hover { background: var(--flaeche-2); text-decoration: none; }
.menue a[aria-current="page"] { background: var(--info-bg); color: var(--link); }
.menue .gruppe { margin: 14px 12px 4px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-2); font-weight: 600; }
.nutzer { border-top: 1px solid var(--linie); padding-top: 12px; }
.nutzer .name { font-weight: 600; }
.version { margin-top: 10px; font-size: 0.75rem; color: var(--text-2); }

.haupt { min-width: 0; }
.kopf {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--linie);
  background: var(--flaeche);
}
.kopf h1 { margin: 0; font-size: 1.2rem; }
.kopf .platz { flex: 1; }
.inhalt { padding: 26px 28px 60px; max-width: 1180px; }

/* ---------------------------------------------------------- Elemente */
.karte {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  padding: 20px 22px;
  margin-bottom: 20px;
}
.karte > h2:first-child, .karte > h3:first-child { margin-top: 0; }
.raster { display: grid; gap: 16px; }
.raster.zwei { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.raster.drei { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.raster.vier { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.zahl-karte { padding: 16px 18px; }
.zahl-karte .zahl { font-size: 2rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.zahl-karte .titel { color: var(--text-2); font-size: 0.86rem; margin-top: 4px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 15px;
  border-radius: 8px;
  border: 1px solid var(--linie);
  background: var(--flaeche);
  color: var(--text);
  font: 600 0.92rem/1.2 "Inter", sans-serif;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--flaeche-2); text-decoration: none; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--blau);
  outline-offset: 2px;
}
.btn.primaer { background: var(--blau); border-color: var(--blau); color: #fff; }
.btn.primaer:hover { background: var(--blau-dunkel); }
.btn.gefahr { color: var(--fehler); }
.btn.klein-btn { padding: 6px 10px; font-size: 0.84rem; }
.aktionen { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--flaeche-2);
  color: var(--text-2);
  white-space: nowrap;
}
.badge.offen { background: var(--info-bg); color: var(--link); }
.badge.achtung { background: var(--warn-bg); color: var(--warn); }
.badge.fertig { background: var(--ok-bg); color: var(--ok); }
.badge.aus { background: var(--fehler-bg); color: var(--fehler); }

.meldung { padding: 11px 14px; border-radius: 8px; margin-bottom: 18px; font-weight: 600; }
.meldung.ok { background: var(--ok-bg); color: var(--ok); }
.meldung.fehler { background: var(--fehler-bg); color: var(--fehler); }
.meldung.info { background: var(--info-bg); color: var(--link); }

/* ------------------------------------------------------------ Tabellen */
.tabellen-rahmen { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--linie); vertical-align: middle; }
th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); font-weight: 600; white-space: nowrap; }
tbody tr:hover { background: var(--flaeche-2); }
td.zahl, th.zahl { text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- Formulare */
form.stapel { display: grid; gap: 16px; }
.feld { display: grid; gap: 6px; }
.feld label, .feld .bezeichnung { font-weight: 600; font-size: 0.88rem; }
.feld .hinweis { font-size: 0.82rem; color: var(--text-2); }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="search"], select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--linie);
  border-radius: 8px;
  background: var(--flaeche);
  color: var(--text);
  font: 400 0.95rem/1.4 "Inter", sans-serif;
}
textarea { min-height: 110px; resize: vertical; }
textarea.gross { min-height: 360px; font-size: 0.9rem; line-height: 1.55; }
.zeile { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.haken { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.haken input { width: 18px; height: 18px; }

.matrix td, .matrix th { padding: 8px 10px; }
.matrix input { max-width: 130px; text-align: right; font-variant-numeric: tabular-nums; }
.matrix .einheit { color: var(--text-2); font-size: 0.85rem; white-space: nowrap; }

/* ----------------------------------------------------------------- Kette */
.kette { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 6px; padding: 0; list-style: none; }
.kette li { padding: 5px 12px; border-radius: 999px; background: var(--flaeche-2); color: var(--text-2); font-size: 0.82rem; font-weight: 600; }
.kette li.erledigt { background: var(--ok-bg); color: var(--ok); }
.kette li.jetzt { background: var(--blau); color: #fff; }

dl.daten { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; margin: 0; }
dl.daten dt { color: var(--text-2); font-size: 0.88rem; }
dl.daten dd { margin: 0; }

/* ------------------------------------------------------------------ Login */
.login-seite { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-karte { width: 100%; max-width: 400px; }
.login-karte img { width: 190px; height: auto; display: block; margin: 0 auto 22px; }
:root[data-theme="dark"] .login-karte img { background: #fff; border-radius: 8px; padding: 8px 10px; }

.oben-s { margin-top: 10px; }
.oben-m { margin-top: 14px; }
.zwischen { justify-content: space-between; }
.ohne-rand { margin: 0; }
.unten { align-items: end; }
.schmal { max-width: 240px; }
a.kachel, a.kachel:hover { text-decoration: none; color: inherit; }
th.zeilenkopf { text-transform: none; letter-spacing: 0; font-size: 0.92rem; color: inherit; font-weight: 600; }

.mobil-knopf { display: none; }
@media (max-width: 900px) {
  .app, :root[data-nav="zu"] .app { grid-template-columns: minmax(0, 1fr); }
  .seitenleiste { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--linie); overflow: visible; }
  .unten-block { margin-top: 0; }
  :root[data-nav="zu"] .seitenleiste { flex-direction: row; padding-top: 8px; padding-bottom: 8px; }
  :root[data-nav="zu"] .werkzeuge { flex-direction: row; border-top: 0; padding-top: 0; }
  .mobil-knopf { display: inline-flex; }
  .raster.zwei, .raster.drei, .raster.vier { grid-template-columns: 1fr; }
  .inhalt, .kopf { padding-left: 16px; padding-right: 16px; }
  dl.daten { grid-template-columns: 1fr; }
}

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