/* Dürr CRM – Designsystem „Präzision“.
   Farben aus dem Logo (Signalrot, Graphit, Silber), Raute als Motiv, feines Punktraster wie auf technischem Papier. */
@font-face { font-family: 'Geist'; src: url('fonts/geist-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('fonts/geist-mono-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@view-transition { navigation: auto; }

:root {
  color-scheme: light;
  --bg: #EFEFEB; --punkt: rgba(23,24,27,.055); --flaeche: #FFFFFF; --flaeche2: #F7F7F4; --linie: #E3E2DC; --linie2: #CFCEC7;
  --text: #131416; --text2: #55585F; --text3: #868992;
  --rot: #D10019; --rot2: #AE0015; --rot-weich: #FCEBEC;
  --rail: #121315; --rail2: #1F2024; --rail-text: #9DA0A8; --rail-linie: rgba(255,255,255,.07);
  --gruen: #08754E; --gruen-w: #E0F3EB; --gelb: #8A5B05; --gelb-w: #FAEFD7; --warn: #B3121F; --warn-w: #FCE6E7;
  --info: #24598C; --info-w: #E3EDF7; --lila: #4F3EAD; --lila-w: #EBE8FB; --grau-w: #EDEDE9;
  --s1: #2F6DB5; --s2: #D07A2D;
  --r: 18px; --r2: 11px;
  --schatten: 0 1px 1px rgba(19,20,22,.03), 0 12px 32px -20px rgba(19,20,22,.16);
  --hoch: 0 2px 4px rgba(19,20,22,.05), 0 24px 48px -24px rgba(19,20,22,.28);
  --sanft: cubic-bezier(.2,.7,.2,1);
  --mono: 'Geist Mono', ui-monospace, Consolas, monospace;
}
[data-thema='dunkel'] {
  color-scheme: dark;
  --bg: #0C0D0E; --punkt: rgba(255,255,255,.035); --flaeche: #16171A; --flaeche2: #1C1D21; --linie: #27282D; --linie2: #3A3B42;
  --text: #F3F3F0; --text2: #AAADB5; --text3: #777A83;
  --rot-weich: #36141A; --rail: #16171A; --rail2: #24252A;
  --gruen: #4BCB9C; --gruen-w: #10322A; --gelb: #EDBE66; --gelb-w: #362A10; --warn: #F58C93; --warn-w: #3A161A;
  --info: #8DBCE8; --info-w: #152839; --lila: #B3A8F2; --lila-w: #262146; --grau-w: #24252A;
  --s1: #5A97DA; --s2: #C9762A;
  --schatten: 0 1px 1px rgba(0,0,0,.3); --hoch: 0 24px 48px -20px rgba(0,0,0,.7);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg) radial-gradient(circle at 1px 1px, var(--punkt) 1px, transparent 0) 0 0 / 22px 22px fixed; color: var(--text); font: 400 14px/1.5 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
::selection { background: var(--rot); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--linie2); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
.ic { width: 18px; height: 18px; flex: none; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.leise { color: var(--text2); }
.sehr-leise { color: var(--text3); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.neg { color: var(--warn); } .pos { color: var(--gruen); }
.btn-reihe { display: flex; gap: 6px; }

/* ── Gerüst ── */
.app { display: flex; min-height: 100vh; }
.rail { width: 232px; flex: none; background: var(--rail); color: var(--rail-text); display: flex; flex-direction: column; padding: 12px; margin: 10px 0 10px 10px; border-radius: 22px; position: sticky; top: 10px; height: calc(100vh - 20px); overflow-y: auto; z-index: 30; box-shadow: 0 20px 40px -24px rgba(0,0,0,.5); view-transition-name: rail; }
.rail-logo { display: flex; align-items: center; gap: 11px; padding: 4px 4px 12px; border-bottom: 1px solid var(--rail-linie); margin-bottom: 4px; }
.logo-kachel { display: flex; background: #fff; border-radius: 12px; padding: 5px; flex: none; }
.logo-kachel img { height: 46px; width: auto; display: block; }
.rail-name { color: #fff; font-weight: 600; font-size: 14px; letter-spacing: -.02em; line-height: 1.25; }
.rail-name small { display: block; font: 500 10.5px var(--mono); color: #6C6F78; letter-spacing: .02em; margin-top: 2px; }
.nav-gruppe { font: 500 10.5px var(--mono); color: #5F626B; padding: 16px 11px 6px; letter-spacing: .04em; text-transform: uppercase; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 8px 11px; border-radius: 11px; font-weight: 500; font-size: 13.5px; transition: background .18s, color .18s; margin-bottom: 1px; }
.nav-link:hover { background: var(--rail2); color: #fff; }
.nav-link.aktiv { background: #fff; color: #121315; }
.nav-link.aktiv .ic { color: var(--rot); }
.nav-zahl { margin-left: auto; background: var(--rot); color: #fff; font: 600 10.5px var(--mono); min-width: 19px; height: 19px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.rail-fuss { margin-top: auto; padding-top: 12px; }
.rail-user { display: flex; justify-content: space-between; gap: 8px; padding: 10px 11px 2px; font-size: 12px; border-top: 1px solid var(--rail-linie); margin-top: 8px; }
.rail-user a { color: #6C6F78; } .rail-user a:hover { color: #fff; }
.haupt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 10px; padding: 14px 34px 6px; position: sticky; top: 0; z-index: 20; }
.top::before { content: ''; position: absolute; inset: 0; background: linear-gradient(var(--bg) 40%, transparent); pointer-events: none; z-index: -1; }
.top-rechts { margin-left: auto; display: flex; gap: 8px; align-items: center; }
main { padding: 16px 34px 64px; max-width: 1420px; width: 100%; margin: 0 auto; view-transition-name: inhalt; }
.seitenkopf { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin-bottom: 24px; }
.eyebrow { font: 500 11.5px var(--mono); color: var(--text3); letter-spacing: .02em; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.eyebrow::before { content: ''; width: 7px; height: 7px; background: var(--rot); transform: rotate(45deg); border-radius: 1px; }
.seitenkopf h1 { font-size: 36px; font-weight: 600; letter-spacing: -.042em; line-height: 1.08; }
.seitenkopf p { color: var(--text2); margin-top: 6px; max-width: 72ch; }
.seitenaktionen { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.suche-btn { display: flex; align-items: center; gap: 10px; width: min(360px, 100%); height: 40px; padding: 0 8px 0 13px; border: 1px solid var(--linie); background: var(--flaeche); color: var(--text3); border-radius: 12px; font: inherit; cursor: pointer; text-align: left; transition: border-color .18s, box-shadow .18s; }
.suche-btn:hover { border-color: var(--linie2); box-shadow: var(--schatten); }
.suche-btn span { flex: 1; }
kbd { font: 500 10.5px var(--mono); background: var(--grau-w); color: var(--text2); padding: 3px 6px; border-radius: 6px; }
.icon-btn.menue-btn { display: none; }

/* ── Bedienelemente ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 15px; border-radius: 12px; border: 1px solid var(--linie2); background: var(--flaeche); color: var(--text); font: 500 13.5px 'Geist', system-ui, sans-serif; letter-spacing: -.01em; cursor: pointer; white-space: nowrap; transition: background .18s, border-color .18s, transform .1s, box-shadow .18s; list-style: none; }
.btn:hover { border-color: var(--text3); box-shadow: 0 6px 16px -10px rgba(19,20,22,.3); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.rot { background: var(--rot); border-color: var(--rot); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 8px 18px -10px rgba(209,0,25,.7); }
.btn.rot:hover { background: var(--rot2); border-color: var(--rot2); }
.btn.dunkel { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn.klein { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn.warn { color: var(--warn); border-color: transparent; background: var(--warn-w); }
.btn.gut { color: var(--gruen); border-color: transparent; background: var(--gruen-w); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible, .icon-btn:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--rot); outline-offset: 2px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--linie); background: var(--flaeche); color: var(--text2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: color .18s, border-color .18s; }
.icon-btn:hover { color: var(--text); border-color: var(--linie2); }
.neu-menue { position: relative; }
.neu-menue summary::-webkit-details-marker { display: none; }
.neu-liste { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 15px; box-shadow: var(--hoch); padding: 6px; z-index: 40; animation: auf .18s var(--sanft); }
.neu-liste a { display: block; padding: 8px 11px; border-radius: 9px; font-weight: 500; font-size: 13.5px; }
.neu-liste a:hover { background: var(--grau-w); }
.neu-liste hr { border: 0; border-top: 1px solid var(--linie); margin: 5px 6px; }
.feld { display: block; min-width: 0; }
.feld > span { display: block; font-size: 12.5px; font-weight: 500; color: var(--text2); margin-bottom: 5px; }
input, select, textarea { width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--linie); border-radius: var(--r2); background: var(--flaeche2); color: var(--text); font: 400 14px 'Geist', system-ui, sans-serif; outline: none; transition: border-color .18s, box-shadow .18s, background .18s; }
input:hover, select:hover, textarea:hover { border-color: var(--linie2); }
input:focus, select:focus, textarea:focus { border-color: var(--text); background: var(--flaeche); box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 9%, transparent); }
input[type=checkbox], input[type=radio] { width: 16px; min-height: 16px; height: 16px; accent-color: var(--rot); padding: 0; }
textarea { resize: vertical; min-height: 76px; }
.formular { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.s2 { grid-column: span 2; } .s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s5 { grid-column: span 5; } .s6 { grid-column: span 6; } .s8 { grid-column: span 8; } .s12 { grid-column: span 12; }
.regel-titel { font: 600 11.5px var(--mono); color: var(--rot); margin-top: 4px; text-transform: uppercase; letter-spacing: .05em; }
[data-thema='dunkel'] .regel-titel { color: var(--warn); }

/* ── Karten ── */
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r); box-shadow: var(--schatten); }
.karte-kopf { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 17px 20px 0; flex-wrap: wrap; }
.karte-kopf h2 { font-size: 15px; font-weight: 600; letter-spacing: -.022em; }
.karte-inhalt { padding: 14px 20px 20px; }
.raster { display: grid; gap: 14px; }
.r4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.r3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.r2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.r21 { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }
.mb { margin-bottom: 14px; }
.karte.fuellen { display: flex; flex-direction: column; }
.karte.fuellen .karte-inhalt { flex: 1; }

/* ── Kennzahlen ── */
.kennzahl { padding: 18px 20px; display: block; position: relative; transition: border-color .2s, transform .2s var(--sanft), box-shadow .2s; }
a.kennzahl:hover { border-color: var(--linie2); transform: translateY(-2px); box-shadow: var(--hoch); }
.kennzahl .name { font-size: 13px; color: var(--text2); }
.kennzahl .wert { font-size: 32px; font-weight: 600; letter-spacing: -.045em; line-height: 1.15; margin-top: 10px; }
.kennzahl .wert small { font-size: 16px; font-weight: 500; color: var(--text3); letter-spacing: -.02em; }
.kennzahl .notiz { font-size: 12.5px; color: var(--text2); margin-top: 8px; }
.kennzahl.held { background: var(--rail); border-color: var(--rail); color: #fff; overflow: hidden; }
.kennzahl.held .name, .kennzahl.held .notiz { color: #A5A8B0; }
.kennzahl.held::before { content: ''; position: absolute; right: -34px; top: -38px; width: 112px; height: 112px; background: var(--rot); transform: rotate(45deg); border-radius: 12px; }
.kennzahl.held::after { content: ''; position: absolute; right: 54px; top: -24px; width: 44px; height: 44px; background: #5B5D63; transform: rotate(45deg); border-radius: 6px; }
.kennzahl.held .wert { position: relative; z-index: 1; }

/* ── Ablauf-Band ── */
.band { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r); box-shadow: var(--schatten); margin-bottom: 14px; overflow: hidden; }
.band-schritt { position: relative; padding: 13px 18px 13px 34px; display: flex; flex-direction: column; border-right: 1px solid var(--linie); }
.band-schritt:last-child { border-right: 0; }
.band-schritt i { position: absolute; left: 16px; top: 21px; width: 8px; height: 8px; background: var(--text); transform: rotate(45deg); border-radius: 1.5px; }
.band-schritt.warn i { background: #D8921A; } .band-schritt.gut i { background: var(--gruen); }
.band-schritt b { font-size: 19px; font-weight: 600; letter-spacing: -.03em; line-height: 1.2; order: 2; margin-top: 2px; }
.band-schritt span { font-weight: 500; font-size: 12.5px; color: var(--text2); order: 1; }
.band-schritt small { display: none; }

/* ── Status-Chips ── */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 23px; padding: 0 9px 0 8px; border-radius: 7px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.chip::before { content: ''; width: 6px; height: 6px; background: currentColor; transform: rotate(45deg); border-radius: 1px; }
.chip.gruen { color: var(--gruen); background: var(--gruen-w); } .chip.gelb { color: var(--gelb); background: var(--gelb-w); }
.chip.rot { color: var(--warn); background: var(--warn-w); } .chip.info { color: var(--info); background: var(--info-w); }
.chip.lila { color: var(--lila); background: var(--lila-w); } .chip.grau { color: var(--text2); background: var(--grau-w); }

/* ── Tabellen ── */
.tabelle-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font: 500 11px var(--mono); color: var(--text3); padding: 10px 16px; border-bottom: 1px solid var(--linie); white-space: nowrap; }
.t td { padding: 12px 16px; border-bottom: 1px solid var(--linie); vertical-align: middle; }
.t tbody tr:last-child td { border-bottom: 0; }
.t tbody tr { transition: background .12s; }
.t tbody tr.klick { cursor: pointer; }
.t tbody tr:hover { background: var(--flaeche2); }
.t tbody tr:last-child td:first-child { border-bottom-left-radius: var(--r); }
.t tbody tr:last-child td:last-child { border-bottom-right-radius: var(--r); }
.t .re { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t b { font-weight: 550; letter-spacing: -.012em; }
.reiter { display: flex; gap: 2px; border-bottom: 1px solid var(--linie); padding: 6px 10px 0; overflow-x: auto; }
.reiter a { padding: 9px 11px 11px; color: var(--text2); font-weight: 500; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color .15s; }
.reiter a:hover { color: var(--text); }
.reiter a.aktiv { color: var(--text); border-bottom-color: var(--rot); }
.reiter em { font: 500 11px var(--mono); color: var(--text3); margin-left: 5px; }
.filter { display: flex; gap: 8px; padding: 12px 14px; flex-wrap: wrap; align-items: center; }
.filter input, .filter select { width: auto; min-width: 150px; }
.filter input[type=search] { flex: 1; min-width: 200px; }
.leer { padding: 44px 20px; text-align: center; color: var(--text3); }
.liste-zeile { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--linie); }
.liste-zeile:last-child { border-bottom: 0; padding-bottom: 0; }
.liste-zeile:first-child { padding-top: 2px; }
.liste-zeile > div, .liste-zeile > a { min-width: 0; }
.liste-zeile b { font-weight: 550; letter-spacing: -.012em; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Hinweise ── */
.hinweis { padding: 11px 14px; border-radius: 12px; margin-bottom: 14px; font-weight: 500; font-size: 13.5px; animation: auf .25s var(--sanft); }
.hinweis[hidden] { display: none; }
.hinweis.ok { background: var(--gruen-w); color: var(--gruen); }
.hinweis.fehler { background: var(--warn-w); color: var(--warn); }
.hinweis.gelb { background: var(--gelb-w); color: var(--gelb); }
.hinweis.info { background: var(--info-w); color: var(--info); }
.hinweis a { text-decoration: underline; }

/* ── Chart ── */
.chart { height: 100%; min-height: 232px; display: grid; grid-template-columns: 50px 1fr; }
.chart-achse { display: flex; flex-direction: column; justify-content: space-between; font: 400 11px var(--mono); color: var(--text3); text-align: right; padding: 0 10px 24px 0; }
.chart-flaeche { position: relative; display: flex; gap: 4px; }
.chart-gitter { position: absolute; inset: 0 0 24px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.chart-gitter i { border-top: 1px solid var(--linie); }
.chart-monat { flex: 1; display: flex; flex-direction: column; position: relative; min-width: 0; }
.chart-saeulen { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 3px; position: relative; border-radius: 8px 8px 0 0; transition: background .15s; }
.chart-monat:hover .chart-saeulen { background: color-mix(in srgb, var(--text) 5%, transparent); }
.saeule { width: min(22px, 34%); border-radius: 4px 4px 0 0; min-height: 2px; transform-origin: bottom; animation: wachsen .6s var(--sanft) both; }
.saeule.a { background: var(--s1); } .saeule.b { background: var(--s2); animation-delay: .06s; }
.chart-label { height: 24px; line-height: 26px; text-align: center; font: 400 11.5px var(--mono); color: var(--text3); }
.chart-tip { position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%) translateY(4px); background: var(--rail); color: #fff; padding: 7px 10px; border-radius: 9px; font-size: 12px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 5; }
.chart-monat:hover .chart-tip { opacity: 1; transform: translateX(-50%); }
.legende { display: flex; gap: 14px; font-size: 12.5px; color: var(--text2); }
.legende i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }

/* ── Fertigung ── */
.board { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 12px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.spalte { background: color-mix(in srgb, var(--flaeche2) 70%, transparent); border: 1px solid var(--linie); border-radius: var(--r); padding: 8px; min-height: 420px; transition: border-color .15s, background .15s; }
.spalte.ziel { border-color: var(--rot); background: var(--rot-weich); }
.spalte header { display: flex; align-items: center; gap: 8px; padding: 7px 8px 11px; font-weight: 600; font-size: 13.5px; letter-spacing: -.015em; }
.spalte header i { width: 8px; height: 8px; transform: rotate(45deg); border-radius: 1.5px; background: var(--text3); }
.spalte header i.s-laeuft { background: var(--rot); } .spalte header i.s-fertig { background: #D8921A; } .spalte header i.s-geliefert { background: var(--gruen); }
.spalte header em { margin-left: auto; font: 500 11.5px var(--mono); color: var(--text3); }
.spalte-liste { display: grid; gap: 8px; min-height: 60px; }
.auftrag { display: block; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 13px; padding: 12px 13px; cursor: grab; transition: transform .18s var(--sanft), box-shadow .18s, border-color .18s; }
.auftrag:hover { transform: translateY(-2px); box-shadow: var(--hoch); border-color: var(--linie2); }
.auftrag.zieht { opacity: .4; }
.auftrag-kopf { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.auftrag b { font-weight: 550; letter-spacing: -.015em; display: block; }
.auftrag p { color: var(--text2); font-size: 12.5px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stunden { margin-top: 10px; display: flex; align-items: center; gap: 8px; }
.stunden span { flex: 1; height: 4px; border-radius: 3px; background: var(--grau-w); overflow: hidden; }
.stunden i { display: block; height: 100%; background: var(--text); border-radius: 3px; }
.stunden small { font: 500 11px var(--mono); color: var(--text3); white-space: nowrap; }
.stunden.drueber i { background: var(--rot); } .stunden.drueber small { color: var(--warn); }
.stand { display: inline-flex; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 13px; padding: 4px; gap: 2px; box-shadow: var(--schatten); }
.stand button { border: 0; background: none; font: 500 13px 'Geist', sans-serif; color: var(--text2); padding: 7px 14px; border-radius: 9px; cursor: pointer; transition: background .15s, color .15s; }
.stand button:hover { color: var(--text); }
.stand button.an { background: var(--text); color: var(--bg); }
.datei-form { display: grid; grid-template-columns: 170px 1fr; gap: 8px; margin-bottom: 8px; align-items: stretch; }
.datei-form .ablegen { padding: 8px 14px; display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 40px; border-radius: var(--r2); }

/* ── Dialog ── */
.dialog { border: 1px solid var(--linie); border-radius: 20px; background: var(--flaeche); color: var(--text); padding: 22px; width: min(620px, calc(100vw - 32px)); box-shadow: var(--hoch); }
.dialog::backdrop { background: rgba(10,10,12,.45); backdrop-filter: blur(4px); }
.dialog[open] { animation: auf .22s var(--sanft); }
.dialog h2 { font-size: 19px; font-weight: 600; letter-spacing: -.03em; margin-bottom: 16px; }
.kalk-ergebnis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; background: var(--rail); color: #fff; border-radius: 14px; padding: 14px 16px; margin-top: 16px; }
.kalk-ergebnis span { display: block; color: #A5A8B0; font-size: 12px; }
.kalk-ergebnis b { font-size: 19px; font-weight: 600; letter-spacing: -.03em; }
.dialog-fuss { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ── Dokument-Editor ── */
.pos-tabelle { width: 100%; border-collapse: collapse; }
.pos-tabelle th { font: 500 11px var(--mono); color: var(--text3); text-align: left; padding: 0 6px 6px; }
.pos-tabelle td { padding: 3px; vertical-align: top; }
.pos-tabelle input { padding: 7px 10px; }
.pos-tabelle .re, .pos-tabelle .re input { text-align: right; font-variant-numeric: tabular-nums; }
.pos-summe { padding: 11px 6px; white-space: nowrap; }
.x-btn { border: 0; background: none; color: var(--text3); cursor: pointer; font-size: 18px; line-height: 1; padding: 9px; border-radius: 8px; }
.x-btn:hover { color: var(--warn); background: var(--warn-w); }
.summen { margin-left: auto; width: min(320px, 100%); }
.summen div { display: flex; justify-content: space-between; padding: 4px 0; font-variant-numeric: tabular-nums; }
.summen .gesamt { border-top: 2px solid var(--rot); margin-top: 8px; padding-top: 10px; font-weight: 600; font-size: 20px; letter-spacing: -.03em; }
.kette { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.kette a, .kette span.jetzt { padding: 5px 11px; border-radius: 9px; background: var(--flaeche); border: 1px solid var(--linie); font-weight: 500; }
.kette span.jetzt { background: var(--text); border-color: var(--text); color: var(--bg); }
.kette .ic { width: 14px; height: 14px; color: var(--text3); }
.pdf-rahmen { width: 100%; height: 78vh; min-height: 560px; border: 0; border-radius: 0 0 var(--r) var(--r); background: #525659; display: block; }

/* ── Beleg ── */
.beleg-raster { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, 1fr); gap: 14px; align-items: start; }
.grund { padding: 11px 13px; border-radius: 12px; background: var(--flaeche2); border: 1px solid var(--linie); font-size: 13px; color: var(--text2); }
.sicher { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text2); }
.sicher-balken { width: 76px; height: 4px; border-radius: 3px; background: var(--grau-w); overflow: hidden; }
.sicher-balken i { display: block; height: 100%; background: var(--text); border-radius: 3px; }

/* ── Ablage ── */
.ablage { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 14px; align-items: start; }
.baum { padding: 10px; position: sticky; top: 74px; max-height: calc(100vh - 94px); overflow-y: auto; }
.baum a { display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 9px; color: var(--text2); font-size: 13.5px; transition: background .12s; }
.baum a:hover { background: var(--grau-w); color: var(--text); }
.baum a.aktiv { background: var(--text); color: var(--bg); }
.baum a em { margin-left: auto; font: 500 11px var(--mono); opacity: .6; }
.baum .ic { width: 16px; height: 16px; }
.baum .jahr { font-weight: 600; color: var(--text); margin-top: 4px; }
.baum .e2 { padding-left: 22px; } .baum .e3 { padding-left: 44px; }
.pfad { display: flex; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--text3); padding: 15px 20px 12px; border-bottom: 1px solid var(--linie); }
.pfad b { color: var(--text); font-weight: 550; }
.datei-ico { width: 34px; height: 40px; border-radius: 8px; background: var(--rot-weich); color: var(--rot); font: 600 9.5px var(--mono); display: flex; align-items: center; justify-content: center; flex: none; }
[data-thema='dunkel'] .datei-ico { color: var(--warn); }

/* ── Ablegen ── */
.ablegen { border: 1.5px dashed var(--linie2); border-radius: var(--r); padding: 20px; text-align: center; color: var(--text2); cursor: pointer; display: block; transition: background .18s, border-color .18s; background: color-mix(in srgb, var(--flaeche) 55%, transparent); }
.ablegen:hover, .ablegen.ziehen { border-color: var(--rot); background: var(--rot-weich); }
.ablegen input { display: none; }
.ablegen b { font-weight: 550; color: var(--text); }

/* ── Login ── */
.anmeldung { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; }
.anmeldung-bild { background: #121315; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: 60px; color: #fff; }
.anmeldung-bild::before { content: ''; position: absolute; width: 560px; height: 560px; background: var(--rot); transform: rotate(45deg); border-radius: 36px; right: -230px; top: -230px; }
.anmeldung-bild::after { content: ''; position: absolute; width: 220px; height: 220px; background: #5B5D63; transform: rotate(45deg); border-radius: 20px; right: 210px; top: 190px; }
.anmeldung-bild h2 { font-size: 46px; font-weight: 600; letter-spacing: -.045em; line-height: 1.05; position: relative; max-width: 520px; }
.anmeldung-bild p { color: #A5A8B0; position: relative; margin-top: 14px; max-width: 430px; font-size: 15px; }
.anmeldung-form { display: flex; align-items: center; justify-content: center; padding: 32px; background: var(--flaeche); }
.anmeldung-form form { width: min(360px, 100%); display: grid; gap: 14px; }
.anmeldung-form img { height: 104px; width: auto; margin-bottom: 8px; }
.anmeldung-form h1 { font-size: 26px; font-weight: 600; letter-spacing: -.035em; }

/* ── Suche ── */
.palette { position: fixed; inset: 0; background: rgba(10,10,12,.45); backdrop-filter: blur(4px); z-index: 100; display: flex; justify-content: center; padding-top: 12vh; }
.palette[hidden] { display: none; }
.palette-box { width: min(620px, calc(100% - 32px)); background: var(--flaeche); border-radius: 20px; box-shadow: var(--hoch); overflow: hidden; align-self: flex-start; animation: auf .2s var(--sanft); }
.palette-feld { display: flex; align-items: center; gap: 10px; padding: 6px 18px; border-bottom: 1px solid var(--linie); color: var(--text3); }
.palette-feld input { border: 0; box-shadow: none !important; padding: 12px 0; font-size: 16px; background: transparent !important; }
.palette-liste { max-height: 380px; overflow-y: auto; padding: 6px; }
.palette-liste a { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: 10px; }
.palette-liste a:hover, .palette-liste a.an { background: var(--grau-w); }
.palette-liste small { color: var(--text3); white-space: nowrap; }

/* ── Bewegung ── */
@keyframes auf { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes wachsen { from { transform: scaleY(0); } to { transform: none; } }
@keyframes blass { to { opacity: 0; } }
main > * { animation: auf .34s var(--sanft) both; }
main > *:nth-child(2) { animation-delay: .03s; } main > *:nth-child(3) { animation-delay: .06s; } main > *:nth-child(4) { animation-delay: .09s; } main > *:nth-child(n+5) { animation-delay: .12s; }
::view-transition-old(inhalt) { animation: .12s ease both blass; }
::view-transition-new(inhalt) { animation: none; }

@media (max-width: 1180px) { .r4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .r21, .beleg-raster { grid-template-columns: 1fr; } .ablage { grid-template-columns: 1fr; } .baum { position: static; max-height: 320px; } }
@media (max-width: 860px) {
  .rail { position: fixed; left: -260px; top: 10px; margin: 0; transition: left .25s var(--sanft); } .rail.offen { left: 10px; }
  .icon-btn.menue-btn { display: inline-flex; } .top, main { padding-left: 16px; padding-right: 16px; }
  .seitenkopf h1 { font-size: 30px; }
  .band { grid-template-columns: repeat(2, 1fr); } .band-schritt { border-bottom: 1px solid var(--linie); }
  .r3, .r2 { grid-template-columns: 1fr; } .formular > * { grid-column: span 12; }
  .anmeldung { grid-template-columns: 1fr; } .anmeldung-bild { display: none; }
  kbd { display: none; } .datei-form { grid-template-columns: 1fr; } .stand { display: flex; overflow-x: auto; }
}
@media (max-width: 520px) { .r4 { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
