/* oneRECHNUNG Leseansicht – CI v1.3, Profil „Admin & Tools“ (Inter, kompakt nach oneVERBAND).
   Schriften selbst gehostet (nie Google Fonts). Farben nur aus one-tokens (DESIGN.md §3). */
@font-face { font-family: "Inter"; src: url("/static/fonts-inter-latin-ext-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Inter"; src: url("/static/fonts-inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  --bg: #F5F5F5; --surface: #FFFFFF;
  --text: #191919; --text-2: #5E5E5E; --text-3: #737373;
  --primary: #004489; --on-primary: #FFFFFF; --primary-strong: #073F7C; --primary-pressed: #0E3A6F; --primary-muted: #E7F5FB;
  --line: #E3E3E3; --line-strong: #8C8C8C;
  --success: #1B7F4B; --success-muted: #E4F0E9;
  --warning: #A15C00; --warning-muted: #F4EBE0;
  --danger: #C0262D; --danger-muted: #F7E5E6;
  --info: #004489; --info-muted: #E7F5FB;
  --neutral: #5E5E5E; --neutral-muted: #E3E3E3;
  --sidebar: #232A47; --sidebar-active: #4F556C; --sidebar-hover: #393F59; --sidebar-text: #D3D4DA; --sidebar-group: #B2B4BF;
  --signal: #D20073;
  --chart-1: #004489;
  --font-ui: "Inter", system-ui, sans-serif;
  --radius-sm: 8px; --radius-md: 12px;
  --shadow-1: 0 1px 2px rgba(35,42,71,.08);
  --shadow-2: 0 4px 16px rgba(35,42,71,.12);
  --shadow-3: 0 12px 40px rgba(35,42,71,.18);
  --dur: 120ms; --ease: cubic-bezier(.2,0,0,1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 400 14px/20px var(--font-ui); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-ui); margin: 0; letter-spacing: -0.01em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.leise { color: var(--text-2); }
.klein { font-size: 12px; line-height: 16px; }
.stark { font-weight: 600; }
.mono { font-variant-numeric: tabular-nums; }
.zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ic { width: 18px; height: 18px; flex: none; }
.ic.klein { width: 16px; height: 16px; }

/* ── Rahmen ─────────────────────────────────────────────────────────────── */
.app { min-height: 100vh; }
.leiste { display: none; }
.marke { display: inline-flex; align-items: center; gap: 8px; color: #fff; white-space: nowrap; }
.marke .symbol { width: 22px; height: 22px; flex: none; }
.marke-name { font-size: 16px; line-height: 1; letter-spacing: -0.01em; }
.marke-name .one { font-weight: 300; }
.marke-name b { font-weight: 700; }
.leiste-kopf { display: flex; align-items: center; gap: 10px; padding: 20px 20px 16px; }
.leiste-kopf onedehoga-launcher { margin-left: auto; }
.nav { flex: 1; overflow-y: auto; padding: 4px 12px 12px; }
.nav-gruppe { padding: 0 12px 8px; font-size: 9px; line-height: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--sidebar-group); }
.nav-eintrag { position: relative; display: flex; align-items: center; gap: 10px; min-height: 34px; margin: 1px 0; padding: 6px 12px; border-radius: var(--radius-sm); color: var(--sidebar-text); font-size: 13px; white-space: nowrap; transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.nav-eintrag:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.nav-eintrag.aktiv { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.nav-eintrag.aktiv::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--signal); }
.person { display: flex; align-items: center; gap: 12px; padding: 16px; border-top: 1px solid rgba(255,255,255,.1); color: #fff; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--sidebar-active); font-size: 12px; font-weight: 700; }
.person-text { min-width: 0; flex: 1; }
.person-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-rolle { font-size: 12px; color: var(--sidebar-text); }
.rund-knopf { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--sidebar-text); cursor: pointer; transition: background-color var(--dur) var(--ease); }
.rund-knopf:hover { background: var(--sidebar-hover); color: #fff; }
.rund-knopf.hell { color: #fff; }
.rund-knopf .ic { width: 22px; height: 22px; }

/* Handy: dunkle Kopfleiste + Schublade */
.handy-kopf { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 4px; height: 56px; padding: 0 12px 0 4px; background: var(--sidebar); color: #fff; }
.launcher-rechts { margin-left: auto; }
.schleier { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.4); opacity: 0; pointer-events: none; transition: opacity 200ms var(--ease); }
.schublade { position: fixed; inset: 0 auto 0 0; z-index: 50; display: flex; flex-direction: column; width: 280px; max-width: 85vw; background: var(--sidebar); color: #fff; box-shadow: var(--shadow-3); transform: translateX(-100%); transition: transform 200ms var(--ease); }
.schublade-zu { position: absolute; top: 12px; right: 8px; }
html.schublade-offen .schleier { opacity: 1; pointer-events: auto; }
html.schublade-offen .schublade { transform: none; }
html.schublade-offen body { overflow: hidden; }
.flaeche-kopf { display: none; }
.inhalt { padding: 20px 16px 48px; max-width: 1280px; }

@media (min-width: 768px) {
  /* Rahmen wie oneVERBAND: dunkle Fläche um alles, Inhalt als helle, runde Fläche mit eigener Kopfzeile. */
  .app { display: flex; height: 100vh; overflow: hidden; background: var(--sidebar); }
  .leiste { display: flex; flex-direction: column; width: 248px; flex: none; height: 100vh; background: var(--sidebar); color: #fff; }
  html[data-seitenleiste="zu"] .leiste { display: none; }
  .handy-kopf, .schleier, .schublade { display: none; }
  .flaeche { display: flex; flex-direction: column; flex: 1; min-width: 0; margin: 8px 8px 8px 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--bg); box-shadow: var(--shadow-1); }
  html[data-seitenleiste="zu"] .flaeche { margin-left: 8px; }
  .flaeche-kopf { display: flex; align-items: center; gap: 12px; min-height: 60px; flex: none; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--bg); }
  .kopf-knopf { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-2); cursor: pointer; }
  .kopf-knopf:hover { background: var(--neutral-muted); color: var(--text); }
  .kopf-titel { font-size: 13px; font-weight: 600; }
  .kopf-aktionen { margin-left: auto; }
  .inhalt { flex: 1; overflow-y: auto; padding: 24px 32px 48px; max-width: none; }
  .inhalt > * { max-width: 1280px; }
}

/* ── Seitenaufbau ───────────────────────────────────────────────────────── */
.seitenkopf { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 20px; }
.seitentitel { font-size: 24px; line-height: 32px; font-weight: 700; }
@media (min-width: 768px) { .seitentitel { font-size: 28px; line-height: 36px; } }
.seitenkopf p { margin: 4px 0 0; }
.mono-titel { font-variant-numeric: tabular-nums; }
.unterzeile { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.zurueck { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px; font-size: 13px; font-weight: 600; }
.karte { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 16px; box-shadow: var(--shadow-1); }
.karte-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.karte-kopf h2 { font-size: 16px; line-height: 24px; font-weight: 600; }
.stapel { display: grid; gap: 16px; align-content: start; }
.raster-2, .raster-detail { display: grid; gap: 16px; }
@media (min-width: 1100px) {
  .raster-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .raster-detail { grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr); }
}
.hinweis { margin: 0 0 16px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warning-muted); color: var(--text); font-size: 13px; }
.hinweis.info { background: var(--info-muted); }
.hinweis.gefahr { background: var(--danger-muted); color: var(--danger); }
.leer { text-align: center; padding: 40px 16px; }
.leer h2 { font-size: 18px; margin-bottom: 4px; }
.leer .knopf { margin-top: 12px; }
.link { font-size: 13px; font-weight: 600; }

/* ── Kennzahlen ─────────────────────────────────────────────────────────── */
.kacheln { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (min-width: 1100px) { .kacheln { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kachel { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); transition: border-color var(--dur) var(--ease); }
a.kachel:hover { border-color: var(--primary); text-decoration: none; }
.kachel-titel { font-size: 12px; font-weight: 600; color: var(--text-2); }
.kachel-wert { margin-top: 4px; font-size: 22px; line-height: 28px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.kachel-unter { margin-top: 2px; font-size: 12px; color: var(--text-2); }
.kachel.warnung .kachel-wert { color: var(--warning); }
.kachel.gefahr .kachel-wert { color: var(--danger); }
@media (max-width: 420px) { .kachel-wert { font-size: 18px; } }

/* ── Chips ──────────────────────────────────────────────────────────────── */
.chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip.ok { background: var(--success-muted); color: var(--success); }
.chip.warnung { background: var(--warning-muted); color: var(--warning); }
.chip.gefahr { background: var(--danger-muted); color: var(--danger); }
.chip.info { background: var(--info-muted); color: var(--info); }
.chip.neutral { background: var(--neutral-muted); color: var(--neutral); }

/* ── Knöpfe und Felder (Admin: S 28 / M 32 / L 36, Felder 32) ─────────────── */
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: 600 13px/1 var(--font-ui); white-space: nowrap; cursor: pointer; transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.knopf:hover { background: var(--bg); text-decoration: none; }
.knopf.primaer { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.knopf.primaer:hover { background: var(--primary-strong); border-color: var(--primary-strong); }
.knopf.primaer:active { background: var(--primary-pressed); }
.knopf.still { border-color: transparent; background: transparent; color: var(--primary); }
.knopf.klein { height: 28px; padding: 0 10px; font-size: 12px; }
.knopf.gross { height: 36px; padding: 0 16px; font-size: 14px; }
.knopf.breit { width: 100%; }
.knopfreihe { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.feld { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.feld input, .feld select { height: 32px; min-width: 0; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: 400 14px/20px var(--font-ui); }
.feld select { padding-right: 28px; }
.feld input:focus, .feld select:focus { outline: 2px solid var(--primary-muted); border-color: var(--primary); }
.feld.suche { position: relative; }
.feld.suche input { padding-left: 34px; width: 100%; }
.feld-icon { position: absolute; left: 10px; bottom: 7px; color: var(--text-3); pointer-events: none; }
.filter { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; align-items: end; margin-bottom: 16px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.filter .suche, .filter-knoepfe { grid-column: 1 / -1; }
.filter-knoepfe { display: flex; gap: 8px; }
@media (min-width: 1000px) {
  .filter { grid-template-columns: minmax(220px, 2fr) repeat(5, minmax(0, 1fr)) auto; }
  .filter .suche, .filter-knoepfe { grid-column: auto; }
}
.filterleiste { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; }
.filterleiste .feld select { min-width: 140px; }
html.js [data-auto] .filter-knoepfe .primaer { display: none; }

/* ── Tabellen (Zeile 40), mobil als Karten ─────────────────────────────── */
.tabelle-rahmen { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-1); }
.tabelle { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabelle th { height: 36px; padding: 0 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap; background: var(--surface); }
.tabelle td { height: 40px; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tabelle tbody tr:last-child td { border-bottom: 0; }
.tabelle th.zahl { text-align: right; }
.tabelle tfoot td { border-top: 1px solid var(--line-strong); border-bottom: 0; font-weight: 700; }
.klickbar tbody tr { cursor: pointer; transition: background-color var(--dur) var(--ease); }
.klickbar tbody tr:hover { background: var(--primary-muted); }
.kunde { max-width: 320px; }
.kunde div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.monate td, .monate th { padding-left: 8px; padding-right: 8px; }
.leer-zeile td { color: var(--text-3); }
.balken-spalte { width: 22%; }
.balken { display: block; height: 8px; width: var(--w); min-width: 0; border-radius: 4px; background: var(--chart-1); }
.mehr { display: flex; justify-content: center; margin-top: 16px; }

@media (max-width: 767px) {
  .tabelle-rahmen { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .karten-mobil thead { display: none; }
  .karten-mobil, .karten-mobil tbody, .karten-mobil tr, .karten-mobil td { display: block; width: 100%; }
  .karten-mobil tbody { display: grid; gap: 8px; }
  .karten-mobil tr { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-1); }
  .karten-mobil td { display: flex; justify-content: space-between; gap: 12px; height: auto; padding: 3px 0; border: 0; text-align: right; }
  .karten-mobil td::before { content: attr(data-label); color: var(--text-2); font-size: 12px; font-weight: 600; text-align: left; flex: none; }
  .karten-mobil td.karte-titel { display: block; padding-bottom: 6px; text-align: left; font-size: 15px; }
  .karten-mobil td.karte-titel::before { display: none; }
  .karten-mobil .kunde { max-width: none; }
  .karten-mobil .kunde div { white-space: normal; }
  .karten-mobil .kunde > span { display: grid; justify-items: end; min-width: 0; }
  .positionen.karten-mobil tr { box-shadow: none; }
  .monate .balken-spalte { display: none; }
  .monate td, .monate th { padding: 8px 4px; font-size: 12px; }
  .monate th:nth-child(3), .monate td:nth-child(3), .monate th:nth-child(4), .monate td:nth-child(4) { display: none; }
}

/* ── Detail ─────────────────────────────────────────────────────────────── */
.detail-kopf { align-items: flex-start; }
.summen { margin: 12px 0 0 auto; max-width: 320px; display: grid; gap: 4px; font-size: 14px; }
.summen div { display: flex; justify-content: space-between; gap: 24px; }
.summen dt { color: var(--text-2); }
.summen dd { margin: 0; font-variant-numeric: tabular-nums; }
.summen .gesamt { padding-top: 6px; margin-top: 2px; border-top: 1px solid var(--line-strong); font-weight: 700; font-size: 16px; }
.summen .gesamt dt { color: var(--text); }
.dl { margin: 0; display: grid; gap: 0; }
.dl-zeile { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.dl-zeile:last-child { border-bottom: 0; }
.dl dt { color: var(--text-2); }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.anschrift { font-style: normal; line-height: 20px; margin-bottom: 8px; }
.verlauf { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.verlauf li { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.verlauf li:last-child { border-bottom: 0; }
.verlauf-zeit { color: var(--text-2); font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .verlauf li, .dl-zeile { grid-template-columns: 1fr; gap: 2px; } }
.mehr-menue { position: relative; }
.mehr-menue summary { list-style: none; }
.mehr-menue summary::-webkit-details-marker { display: none; }
.mehr-menue .menue { position: absolute; right: 0; top: calc(100% + 4px); z-index: 10; min-width: 240px; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-2); }
.mehr-menue .menue a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text); font-size: 13px; }
.mehr-menue .menue a:hover { background: var(--primary-muted); text-decoration: none; }

/* ── Übersicht: Nummernkreise, Listen ───────────────────────────────────── */
.kreise, .liste-einfach { list-style: none; margin: 0; padding: 0; }
.kreis { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.kreis:first-child { padding-top: 0; }
.kreis:last-child { border-bottom: 0; padding-bottom: 0; }
.kreis-kopf { display: flex; justify-content: space-between; gap: 12px; }
.kreis-zahlen { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--text-2); }
.kreis-zahlen b { color: var(--text); }
.pruef { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.pruef.ok { color: var(--success); }
.pruef.gefahr { color: var(--danger); }
.liste-einfach li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); }
.liste-einfach li:last-child { border-bottom: 0; }
.liste-einfach.dicht li { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); padding: 6px 0; }

/* ── Export ─────────────────────────────────────────────────────────────── */
.formular { display: grid; gap: 14px; align-content: start; }
.formular .karte-kopf { margin-bottom: 0; }
.schnellwahl { display: flex; flex-wrap: wrap; gap: 6px; }
.felder-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.formate { margin: 0; padding: 0; border: 0; display: grid; gap: 8px; }
.formate legend { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.wahl { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.wahl:has(input:checked) { border-color: var(--primary); background: var(--primary-muted); }
.wahl input { margin-top: 3px; accent-color: var(--primary); }

/* ── Anmelden ───────────────────────────────────────────────────────────── */
.anmelden { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg, #004489 0%, #232A47 70%); }
.anmelden-karte { width: 100%; max-width: 400px; display: grid; gap: 14px; justify-items: center; text-align: center; padding: 32px 28px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-3); }
.anmelden-karte h1 { font-size: 26px; line-height: 32px; font-weight: 300; }
.anmelden-karte h1 b { font-weight: 700; }
.anmelden-karte p { margin: 0; }
.anmelden-karte .hinweis { margin: 0; text-align: left; width: 100%; }
.symbol.gross { width: 56px; height: 56px; }
.dev { display: grid; gap: 8px; width: 100%; padding-top: 10px; border-top: 1px dashed var(--line-strong); }
.dev input { height: 32px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: inherit; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0ms !important; } }
@media print {
  .leiste, .handy-kopf, .flaeche-kopf, .filter, .knopfreihe, .mehr, .zurueck { display: none !important; }
  .app, .flaeche { display: block; height: auto; overflow: visible; margin: 0; border: 0; box-shadow: none; background: #fff; }
  .inhalt { overflow: visible; padding: 0; }
}
