/* Verwaltung Trockene Schaefchen - ein Stylesheet, Systemschriften (nichts von aussen,
   die CSP erlaubt nur 'self'). Farben aus trockene-schaefchen/src/styles/global.css. */
:root {
  --creme: #f6f4ef; --papier: #fcfbf8; --weiss: #fff; --dunkel: #1b2025; --dunkel-2: #262d34;
  --tinte: #23282d; --tinte-weich: #5c666f; --tinte-leise: #8a929a; --linie: #e3dfd6; --linie-stark: #cfc9bc;
  --akzent: #b88744; --akzent-dunkel: #8f6528; --akzent-hell: #f3e8d6;
  --ok: #2f7d4f; --ok-hell: #e6f3ea; --warn: #9a6a00; --warn-hell: #fbf0d4; --fehler: #b3261e; --fehler-hell: #fbe7e5; --info: #2c5c8f; --info-hell: #e7eff8;
  --r: 10px; --schatten: 0 1px 2px rgba(35,40,45,.06), 0 6px 20px rgba(35,40,45,.06);
  --schrift: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font: 15px/1.5 var(--schrift); color: var(--tinte); background: var(--creme); -webkit-font-smoothing: antialiased; }
a { color: var(--akzent-dunkel); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { margin: 0; letter-spacing: -.01em; line-height: 1.2; }
h1 { font-size: 26px; font-weight: 650; }
h2 { font-size: 15px; font-weight: 650; margin-bottom: 12px; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
code { background: var(--creme); border: 1px solid var(--linie); border-radius: 5px; padding: 1px 6px; }
.leise { color: var(--tinte-weich); }
.klein, small { font-size: 12.5px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }

/* Geruest */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.seitenleiste { background: var(--dunkel); color: #d7dbdf; display: flex; flex-direction: column; gap: 22px; padding: 22px 16px; position: sticky; top: 0; height: 100vh; }
.marke { display: flex; gap: 10px; align-items: center; color: #fff; }
.marke:hover { text-decoration: none; }
.marke svg, .marke-gross svg { width: 38px; height: 38px; flex: none; }
.marke span, .marke-gross span { display: grid; line-height: 1.2; }
.marke b { font-size: 14px; } .marke small { color: var(--tinte-leise); }
.seitenleiste nav { display: grid; gap: 2px; }
.seitenleiste nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: #c4cad0; font-weight: 500; }
.seitenleiste nav a:hover { background: var(--dunkel-2); color: #fff; text-decoration: none; }
.seitenleiste nav a[aria-current] { background: var(--dunkel-2); color: #fff; box-shadow: inset 3px 0 0 var(--akzent); }
.seitenleiste nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.zaehler { margin-left: auto; background: var(--akzent); color: #fff; font-size: 11px; border-radius: 999px; padding: 1px 7px; }
.suche input { width: 100%; background: var(--dunkel-2); border: 1px solid #343c44; color: #fff; border-radius: 8px; padding: 8px 10px; font: inherit; }
.nutzer { margin-top: auto; display: flex; justify-content: space-between; align-items: center; font-size: 13px; border-top: 1px solid #343c44; padding-top: 14px; }
.nutzer button { background: none; border: 0; color: var(--tinte-leise); cursor: pointer; font: inherit; padding: 0; }
.nutzer button:hover { color: #fff; }
.inhalt { padding: 28px 34px 60px; min-width: 0; }
.seitenkopf { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.seitenkopf p { margin: 6px 0 0; }
.pfad { margin: 0 0 4px !important; font-size: 13px; }

/* Bausteine */
.kasten { background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--schatten); margin-bottom: 18px; }
.kasten.breit { max-width: 860px; }
.kasten.leer { text-align: center; padding: 40px; }
.kasten.gefahr { border-color: #efc7c3; }
.raster-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.raster-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.raster-plz { display: grid; grid-template-columns: 110px 1fr; gap: 14px; }
.raster-haupt { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.raster-karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.oben { margin-bottom: 6px; }
.knopf { display: inline-flex; align-items: center; gap: 6px; background: var(--tinte); color: #fff; border: 0; border-radius: 8px; padding: 9px 16px; font: 600 14px var(--schrift); cursor: pointer; white-space: nowrap; }
.knopf:hover { background: var(--akzent-dunkel); text-decoration: none; }
.leise-knopf { background: var(--weiss); color: var(--tinte); box-shadow: inset 0 0 0 1px var(--linie-stark); }
.leise-knopf:hover { background: var(--creme); }
.knopf-gefahr { background: var(--fehler); }
button.leise { background: none; border: 0; color: var(--tinte-weich); cursor: pointer; font: inherit; padding: 4px 0; text-decoration: underline; }
.knoepfe { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.meldung { border-radius: 8px; padding: 10px 14px; margin: 0 0 16px; background: var(--info-hell); color: var(--info); }
.meldung.ok { background: var(--ok-hell); color: var(--ok); }
.meldung.fehler, .meldung.frist-ueber { background: var(--fehler-hell); color: var(--fehler); }
.meldung.frist-bald { background: var(--warn-hell); color: var(--warn); }
.meldung.frist-ok { background: var(--info-hell); color: var(--info); }
.abzeichen { display: inline-block; font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 1px 8px; background: var(--creme); color: var(--tinte-weich); white-space: nowrap; }
.frist-ueber { background: var(--fehler-hell); color: var(--fehler); }
.frist-bald { background: var(--warn-hell); color: var(--warn); }
.frist-ok { background: var(--info-hell); color: var(--info); }
.abzeichen-mail, .abzeichen-freigabe { background: var(--ok-hell); color: var(--ok); }
.abzeichen-loeschen { background: var(--fehler-hell); color: var(--fehler); }
.status { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 6px; padding: 2px 8px; background: var(--creme); }
.status-online { background: var(--info-hell); color: var(--info); }
.status-brief { background: var(--akzent-hell); color: var(--akzent-dunkel); }
.status-antwort { background: var(--warn-hell); color: var(--warn); }
.status-auftrag, .status-live { background: var(--ok-hell); color: var(--ok); }
.status-abgelehnt { background: var(--fehler-hell); color: var(--fehler); }
.liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.liste li a { display: block; padding: 7px 8px; border-radius: 7px; color: var(--tinte); }
.liste li a:hover { background: var(--creme); text-decoration: none; }
.liste li.ungelesen b { color: var(--akzent-dunkel); }
.daten { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; margin: 0 0 12px; }
.daten dt { color: var(--tinte-weich); font-size: 13px; }
.daten dd { margin: 0; word-break: break-word; }
.notiz { background: var(--papier); border-left: 3px solid var(--akzent); padding: 10px 12px; border-radius: 0 6px 6px 0; }
details summary { cursor: pointer; color: var(--akzent-dunkel); font-weight: 600; }
details[open] summary { margin-bottom: 12px; }

/* Formulare */
.formular { display: grid; gap: 14px; }
.formular.klein { gap: 10px; }
.formular label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--tinte-weich); }
.formular label small { font-weight: 400; }
input, select, textarea { font: inherit; color: var(--tinte); background: var(--weiss); border: 1px solid var(--linie-stark); border-radius: 8px; padding: 9px 11px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--akzent); box-shadow: 0 0 0 3px var(--akzent-hell); }
.haken { display: flex !important; align-items: center; gap: 8px; font-weight: 500 !important; }
.haken input { width: auto; accent-color: var(--akzent); }
.reihe { display: flex; gap: 10px; align-items: center; }
.reihe input, .reihe select { width: auto; flex: 1; min-width: 160px; }
.code-feld { font: 600 24px var(--mono); letter-spacing: .3em; text-align: center; }

/* Tafel */
.tafel { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(176px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.spalte { background: #efece5; border-radius: var(--r); padding: 12px; min-height: 260px; border-top: 3px solid var(--linie-stark); }
.spalte header { display: flex; justify-content: space-between; align-items: center; }
.spalte h2 { margin: 0; font-size: 13.5px; }
.spalte .zahl { font-size: 12px; color: var(--tinte-weich); background: var(--weiss); border-radius: 999px; padding: 0 8px; }
.spalte-hilfe { font-size: 12px; color: var(--tinte-leise); margin: 2px 0 10px; }
.spalte-online { border-top-color: var(--info); } .spalte-brief { border-top-color: var(--akzent); } .spalte-antwort { border-top-color: #d9a634; }
.spalte-auftrag { border-top-color: var(--ok); } .spalte-live { border-top-color: #1f5e39; }
.spalte-karten { display: grid; gap: 8px; min-height: 120px; border-radius: 8px; transition: background .15s; }
.spalte-karten.drueber { background: var(--akzent-hell); }
.pkarte { display: grid; gap: 4px; background: var(--weiss); border: 1px solid var(--linie); border-radius: 9px; padding: 11px 12px; color: var(--tinte); box-shadow: 0 1px 2px rgba(35,40,45,.05); cursor: grab; }
.pkarte:hover { border-color: var(--akzent); text-decoration: none; }
.pkarte.zieht { opacity: .5; }
.pkarte-firma { font-size: 12px; color: var(--tinte-weich); }
.pkarte-titel { font-weight: 600; }
.pkarte-fuss { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.abseits { margin-top: 20px; }

/* Tabellen, Reiter, Mail */
.tabelle-rahmen { background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--r); overflow-x: auto; box-shadow: var(--schatten); }
.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th { text-align: left; font-size: 12px; font-weight: 600; color: var(--tinte-weich); padding: 10px 14px; border-bottom: 1px solid var(--linie); background: var(--papier); }
.tabelle td { padding: 11px 14px; border-bottom: 1px solid var(--linie); vertical-align: top; }
.tabelle tr:last-child td { border-bottom: 0; }
.tabelle tr[data-link] { cursor: pointer; }
.tabelle tr[data-link]:hover td { background: var(--papier); }
.tabelle tr.ungelesen td { font-weight: 600; }
.reiter { display: flex; gap: 4px; margin-bottom: 14px; flex-wrap: wrap; }
.reiter a { padding: 6px 12px; border-radius: 999px; color: var(--tinte-weich); font-weight: 500; }
.reiter a[aria-current] { background: var(--tinte); color: #fff; }
.mailtext { white-space: pre-wrap; font: 14px/1.6 var(--schrift); background: var(--papier); border: 1px solid var(--linie); border-radius: 8px; padding: 14px 16px; max-height: 70vh; overflow: auto; }
.umbruch { white-space: pre-wrap; word-break: break-all; background: var(--creme); padding: 10px; border-radius: 6px; }

/* Chronik, Aufgaben, Partner */
.chronik { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; }
.chronik li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; }
.chronik p { margin: 0; }
.chronik-symbol { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--creme); color: var(--tinte-weich); font-size: 13px; }
.chronik-freigabe .chronik-symbol { background: var(--ok-hell); color: var(--ok); }
.chronik-loeschen .chronik-symbol { background: var(--fehler-hell); color: var(--fehler); }
.chronik-status .chronik-symbol { background: var(--akzent-hell); color: var(--akzent-dunkel); }
.aufgaben { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.aufgaben li { display: flex; gap: 8px; align-items: flex-start; }
.aufgaben li.erledigt span { text-decoration: line-through; color: var(--tinte-leise); }
.haken-knopf { background: none; border: 0; font-size: 17px; line-height: 1; cursor: pointer; padding: 0; color: var(--akzent-dunkel); }
.partner { border-bottom: 1px solid var(--linie); padding: 8px 0; }
.partner summary { color: var(--tinte); font-weight: 400; }

/* Einzelseiten: Anmelden, Einrichtung */
body.einzeln { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(60% 60% at 70% 10%, var(--akzent-hell), var(--creme) 70%); }
.karte-einzeln { width: min(420px, 100%); background: var(--weiss); border: 1px solid var(--linie); border-radius: 14px; padding: 30px 30px 26px; box-shadow: 0 30px 80px rgba(35,40,45,.12); display: grid; gap: 14px; }
.marke-gross { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; }
.marke-gross b { font-size: 15px; } .marke-gross small { color: var(--tinte-weich); }
.karte-einzeln h1 { font-size: 22px; }
.karte-einzeln p { margin: 0; }
.qr { width: 220px; height: 220px; justify-self: center; border: 1px solid var(--linie); border-radius: 10px; padding: 6px; background: #fff; }

@media (max-width: 1100px) { .raster-haupt { grid-template-columns: 1fr; } }
@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; }
  .seitenleiste { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 14px; gap: 10px; }
  .seitenleiste nav { grid-auto-flow: column; }
  .seitenleiste nav a span { display: none; }
  .suche, .nutzer span { display: none; }
  .nutzer { margin: 0 0 0 auto; border: 0; padding: 0; }
  .inhalt { padding: 20px 16px 40px; }
  .raster-2, .raster-3 { grid-template-columns: 1fr; }
  .daten { grid-template-columns: 1fr; gap: 2px 0; } .daten dd { margin-bottom: 8px; }
  .tafel { grid-auto-columns: 82%; }
}

/* Phase 2: Rechnungen, Dokumente */
.rechts { text-align: right; white-space: nowrap; }
.text-fehler { color: var(--fehler); }
.status-r-entwurf { background: var(--creme); color: var(--tinte-weich); }
.status-r-offen { background: var(--info-hell); color: var(--info); }
.status-r-bezahlt { background: var(--ok-hell); color: var(--ok); }
.status-r-storniert { background: var(--creme); color: var(--tinte-leise); text-decoration: line-through; }
.status-r-ueber { background: var(--fehler-hell); color: var(--fehler); }
.positionen { display: grid; gap: 10px; }
.position { border: 1px solid var(--linie); border-radius: 8px; padding: 10px 12px 12px; display: grid; gap: 8px; margin: 0; }
.position legend { font-size: 12px; font-weight: 600; color: var(--tinte-weich); padding: 0 4px; }
.tabelle.schlicht th { background: none; }
.tabelle.schlicht td, .tabelle.schlicht th { padding-left: 0; }
.dokument { display: flex; align-items: center; gap: 8px; }
.dokument a { flex: 1; }
.dokument form button { font-size: 12px; }
.knopf-passkey { justify-content: center; width: 100%; padding: 12px 16px; background: var(--akzent-dunkel); }
.knopf-passkey:hover { background: var(--tinte); }
.trenner { display: flex; align-items: center; gap: 10px; color: var(--tinte-leise); font-size: 12.5px; margin: 0; }
.trenner::before, .trenner::after { content: ''; flex: 1; height: 1px; background: var(--linie); }
.trenner[hidden] { display: none; }
.ueberlauf { overflow-x: auto; } .raster-haupt > *, .raster-2 > *, .raster-3 > * { min-width: 0; }
