/* AktenAtlas – Anwendung */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }

/* Seitenleiste */
.leiste { background: var(--nacht); color: var(--silber); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.leiste-marke { display: flex; align-items: center; gap: .6rem; padding: 1.1rem 1.2rem 1rem; text-decoration: none; font-size: var(--t-l); border-bottom: 1px solid var(--nacht-3); }
.leiste-marke img { width: 42px; }
.leiste-kanzlei { padding: .8rem 1.2rem; font-size: var(--t-xs); color: var(--silber); border-bottom: 1px solid var(--nacht-3); }
.leiste-kanzlei strong { display: block; color: var(--silber-hell); font-size: var(--t-s); font-weight: 600; }
.leiste nav { padding: .8rem .6rem; display: flex; flex-direction: column; gap: 2px; }
.leiste nav .gruppe { font-size: var(--t-xs); color: #8a94a6; padding: .9rem .7rem .3rem; }
.leiste nav a { display: flex; align-items: center; justify-content: space-between; gap: .5rem; color: var(--silber); text-decoration: none; padding: .5rem .7rem; border-radius: var(--radius); font-size: var(--t-s); }
.leiste nav a:hover { background: var(--nacht-2); color: var(--weiss); }
.leiste nav a.aktiv { background: var(--nacht-2); color: var(--weiss); box-shadow: inset 3px 0 0 var(--gold); }
.zahl { background: var(--rot); color: #fff; font-size: .72rem; font-weight: 600; border-radius: 99px; padding: .1em .55em; }
.zahl-ruhig { background: var(--nacht-3); color: var(--silber-hell); }
.leiste-fuss { margin-top: auto; padding: 1rem 1.2rem; border-top: 1px solid var(--nacht-3); font-size: var(--t-xs); }
.leiste-fuss a { color: var(--silber); }
.leiste-fuss form { display: inline; }
.leiste-fuss button { background: none; border: 0; color: var(--silber); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }

/* Inhalt */
.haupt { min-width: 0; display: flex; flex-direction: column; }
.kopfleiste { display: flex; align-items: center; gap: 1rem; padding: .8rem 2rem; background: var(--weiss); border-bottom: 1px solid var(--linie); position: sticky; top: 0; z-index: 5; }
.kopfleiste form.suche { flex: 1; max-width: 520px; }
.kopfleiste input[type=search] { width: 100%; }
.kopfleiste .ich { margin-left: auto; font-size: var(--t-s); color: var(--grau); text-decoration: none; }
.inhalt { padding: 1.75rem 2rem 4rem; max-width: 1400px; width: 100%; }
.titelzeile { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.titelzeile h1 { font-size: var(--t-2xl); margin: 0; }
.titelzeile .unter { color: var(--grau); margin: .25rem 0 0; font-size: var(--t-s); }
.aktionen { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

.support-band { background: var(--gelb); color: #fff; padding: .5rem 2rem; font-size: var(--t-s); display: flex; gap: 1rem; align-items: center; }
.support-band button { background: #fff; color: var(--tinte); border: 0; border-radius: var(--radius); padding: .25rem .7rem; cursor: pointer; }

/* Meldungen */
.meldung { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: var(--t-s); border-left: 4px solid; background: var(--weiss); }
.meldung-ok { border-color: var(--gruen); }
.meldung-info { border-color: #3a6ea5; }
.meldung-warnung { border-color: var(--gelb); background: #fff8e8; }
.meldung-fehler { border-color: var(--rot); background: #fbeceb; }

/* Flächen */
.flaeche { background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius-gross); padding: 1.25rem 1.4rem; margin-bottom: 1.25rem; }
.flaeche > h2, .flaeche > h3 { font-size: var(--t-l); margin-bottom: .8rem; }
.flaeche-kopf { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .8rem; }
.flaeche-kopf h2, .flaeche-kopf h3 { margin: 0; font-size: var(--t-l); }
.raster { display: grid; gap: 1.25rem; }
.raster-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.raster-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.raster-haupt { grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); align-items: start; }
.leer { color: var(--grau); font-size: var(--t-s); padding: .5rem 0; }

/* Kennzahlen */
.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.kennzahl { background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius-gross); padding: 1rem 1.2rem; text-decoration: none; }
.kennzahl b { display: block; font: 600 var(--t-2xl)/1.1 var(--serif); }
.kennzahl span { color: var(--grau); font-size: var(--t-s); }
.kennzahl.rot b { color: var(--rot); }

/* Tabellen */
.tabelle-huelle { overflow-x: auto; }
table.tabelle { width: 100%; border-collapse: collapse; font-size: var(--t-s); }
.tabelle th { text-align: left; font-weight: 600; color: var(--grau); font-size: var(--t-xs); padding: .55rem .6rem; border-bottom: 1px solid var(--linie); white-space: nowrap; }
.tabelle td { padding: .65rem .6rem; border-bottom: 1px solid #eceef2; vertical-align: top; }
.tabelle tr:hover td { background: #fafbfc; }
.tabelle a { text-decoration: none; }
.tabelle a:hover { text-decoration: underline; }
.tabelle .nowrap { white-space: nowrap; }
.tabelle .rechts { text-align: right; }
.zeile-titel { font-weight: 600; }
.klein { font-size: var(--t-xs); color: var(--grau); }
.ruhig { color: var(--grau); }

/* Marken */
.marke { display: inline-flex; align-items: center; gap: .35em; font-size: .75rem; font-weight: 600; padding: .2em .6em; border-radius: 99px; background: #eef0f4; color: #3c4658; white-space: nowrap; }
.ampel-rot { background: #f7e4e2; color: var(--rot); }
.ampel-gelb { background: #fbf0d9; color: #8a6514; }
.ampel-gruen { background: #e3f1e8; color: var(--gruen); }
.punkt::before { content: ""; width: .55em; height: .55em; border-radius: 50%; background: currentColor; }
.marke-gold { background: #f6ecd8; color: var(--gold-dunkel); }
.marke-nacht { background: var(--nacht); color: var(--silber-hell); }

/* Formulare */
label { display: block; font-size: var(--t-s); font-weight: 500; margin-bottom: .3rem; }
.feld { margin-bottom: .9rem; }
.feld .hilfe { font-size: var(--t-xs); color: var(--grau); margin-top: .25rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=url], input[type=search], select, textarea {
  width: 100%; font: 400 var(--t-m)/1.4 var(--sans); color: var(--tinte); background: var(--weiss);
  border: 1px solid #cdd2db; border-radius: var(--radius); padding: .55rem .7rem; min-height: 42px;
}
textarea { min-height: 120px; resize: vertical; }
textarea.gross { min-height: 420px; font-family: var(--serif); font-size: 1.02rem; line-height: 1.6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: var(--fokus); }
.felder-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.felder-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1rem; }
.check { display: flex; gap: .5rem; align-items: flex-start; font-weight: 400; }
.check input { margin-top: .25rem; }
.inline-form { display: inline; }
.zeilenform { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; }
.zeilenform .feld { margin: 0; }

.knopf { min-height: 40px; }
.knopf-klein { padding: .45em .8em; font-size: var(--t-s); min-height: 34px; }
.knopf-nacht { background: var(--nacht); color: var(--silber-hell); }
.knopf-nacht:hover { background: var(--nacht-2); }
.knopf-hell { background: var(--weiss); color: var(--tinte); border-color: #cdd2db; }
.knopf-hell:hover { border-color: var(--gold); }
.knopf-rot { background: var(--rot); color: #fff; }
.knopf-link { background: none; border: 0; color: #2c5b8f; padding: 0; min-height: 0; text-decoration: underline; font-weight: 400; }

/* Reiter */
.reiter { display: flex; gap: .25rem; border-bottom: 1px solid var(--linie); margin-bottom: 1.25rem; overflow-x: auto; }
.reiter a { padding: .6rem .9rem; text-decoration: none; color: var(--grau); font-size: var(--t-s); border-bottom: 2px solid transparent; white-space: nowrap; }
.reiter a.aktiv, .reiter a:hover { color: var(--tinte); border-color: var(--gold); }

/* Listen */
.liste { list-style: none; margin: 0; padding: 0; }
.liste > li { padding: .7rem 0; border-bottom: 1px solid #eceef2; }
.liste > li:last-child { border-bottom: 0; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; font-size: var(--t-s); margin: 0; }
.dl dt { color: var(--grau); }
.dl dd { margin: 0; }

/* Eingang */
.brief { background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius-gross); padding: 1.25rem 1.4rem; }
.brief-text { font-family: var(--serif); white-space: pre-wrap; line-height: 1.65; font-size: .98rem; max-height: 520px; overflow-y: auto; }
.bewertung { border-left: 3px solid var(--gold); padding-left: 1rem; }
.fund { display: flex; gap: .6rem; align-items: baseline; padding: .4rem 0; border-bottom: 1px dashed #e3e6ec; font-size: var(--t-s); }
.richtung-pro { color: var(--gruen); }
.richtung-contra { color: var(--rot); }

/* Kalender */
.monat { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--linie); border-left: 1px solid var(--linie); background: var(--weiss); border-radius: var(--radius); overflow: hidden; }
.monat .wt { font-size: var(--t-xs); color: var(--grau); padding: .4rem .5rem; border-right: 1px solid var(--linie); border-bottom: 1px solid var(--linie); background: #f7f8fa; }
.tag { min-height: 112px; padding: .35rem .4rem; border-right: 1px solid var(--linie); border-bottom: 1px solid var(--linie); font-size: var(--t-xs); }
.tag.fremd { background: #fafbfc; color: #a5acb8; }
.tag.feiertag, .tag.wochenende { background: #f6f4ef; }
.tag.heute .nr { background: var(--gold); color: var(--nacht); border-radius: 99px; padding: 0 .45em; }
.tag .nr { font-weight: 600; display: inline-block; margin-bottom: .2rem; }
.tag .ft { display: block; color: var(--gold-dunkel); font-size: .7rem; }
.eintrag { display: block; text-decoration: none; padding: .15rem .35rem; border-radius: 4px; margin-bottom: 2px; background: #e8eef6; color: #23406a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eintrag.notfrist { background: #f7e4e2; color: var(--rot); font-weight: 600; }
.eintrag.gerichtlich, .eintrag.vertraglich, .eintrag.verjaehrung { background: #fbf0d9; color: #7a5a12; }
.eintrag.erledigt { text-decoration: line-through; opacity: .6; }

/* KI-Arbeitsbereich */
.ki { display: flex; flex-direction: column; gap: .8rem; }
.ki-verlauf { display: flex; flex-direction: column; gap: .8rem; max-height: 640px; overflow-y: auto; padding-right: .25rem; }
.ki-frage { align-self: flex-end; background: var(--nacht); color: var(--silber-hell); padding: .7rem .9rem; border-radius: 12px 12px 2px 12px; max-width: 88%; white-space: pre-wrap; font-size: var(--t-s); }
.ki-antwort { background: #f5f6f8; border: 1px solid var(--linie); padding: .8rem 1rem; border-radius: 12px 12px 12px 2px; white-space: pre-wrap; font-size: var(--t-s); line-height: 1.6; }
.ki-quellen { margin-top: .5rem; font-size: var(--t-xs); color: var(--grau); }
.ki-uebernehmen { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .6rem; }
.ki-uebernehmen button { font-size: .75rem; padding: .3em .6em; min-height: 28px; }
.ki-warten { display: none; font-size: var(--t-s); color: var(--grau); }
.ki-warten.an { display: block; }

/* Öffentlich (Anmeldung) */
.oeffentlich { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; background: radial-gradient(ellipse 70% 60% at 50% 25%, #172744 0%, var(--nacht) 70%); }
.karte { background: var(--weiss); border-radius: var(--radius-gross); padding: 2rem; width: min(440px, 100%); box-shadow: 0 30px 60px -30px rgba(0,0,0,.6); }
.karte-marke { text-align: center; margin-bottom: 1.5rem; }
.karte-marke img { width: 150px; margin: 0 auto .5rem; }
.karte-marke .wortmarke { font-size: var(--t-2xl); }
.karte-marke .wortmarke .w-akten { color: var(--tinte); }
.karte h1 { font-size: var(--t-xl); text-align: center; }
.geheim { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--papier); border: 1px dashed var(--gold); padding: .8rem 1rem; border-radius: var(--radius); word-break: break-all; font-size: var(--t-m); }
.text-seite { max-width: 760px; margin: 0 auto; padding: 3rem 1.5rem; white-space: pre-wrap; }

/* Druck */
@media print {
  .leiste, .kopfleiste, .aktionen, .support-band, .nicht-drucken { display: none !important; }
  .app { display: block; }
  .inhalt { padding: 0; }
  body { background: #fff; }
}

@media (max-width: 1100px) {
  .raster-haupt, .raster-3 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .leiste { position: static; height: auto; }
  .leiste nav { flex-direction: row; flex-wrap: wrap; }
  .leiste nav .gruppe { display: none; }
  .leiste-fuss { margin-top: 0; padding: .6rem 1.2rem; }
  .inhalt, .kopfleiste { padding-left: 1rem; padding-right: 1rem; }
  .raster-2, .felder-2, .felder-3 { grid-template-columns: 1fr; }
  .tag { min-height: 70px; }
  .eintrag { white-space: normal; }
}

/* Schritt 5: Empfehlung, Schriftstück zur Vorlage, zugehörige Dokumente */
.empfehlung { margin-top: .9rem; padding: .8rem 1rem; background: rgba(201, 162, 94, .12); border-radius: 6px; }
.empfehlung p { margin: .25rem 0; }
.empfehlung-titel { font-weight: 600; color: var(--nacht, #0c1627); }
.entwurf-vorlage { border-top: 3px solid var(--gold); }
.vorlage-zeile { display: flex; gap: 1rem; justify-content: space-between; align-items: flex-start; padding: .6rem 0; }
.vorlage-zeile + .vorlage-zeile { border-top: 1px solid var(--linie); }
.vorlage-zeile .vorschau { white-space: pre-wrap; font-family: var(--serif); font-size: var(--t-s); color: var(--grau); margin: .4rem 0 0; max-height: 9.5em; overflow: hidden; }
.flaeche .zwischen, .zwischen { font-family: var(--sans, inherit); font-size: var(--t-s); font-weight: 600; margin: 1rem 0 .3rem; color: var(--grau); }
@media (max-width: 700px) { .vorlage-zeile { flex-direction: column; } }
.protokoll-text { white-space: pre-wrap; font-size: var(--t-xs, .78rem); background: #f5f6f8; border: 1px solid var(--linie); border-radius: 6px; padding: .8rem; max-height: 420px; overflow: auto; }
