/* DIP-ECM-Radar
   Gestaltungsidee: Behördenpapier. Alles grau und tintenschwarz, damit die
   einzige gesättigte Farbe der Seite genau das markiert, wonach gesucht wird,
   nämlich Drucksachen mit Vergabebezug. */

:root {
    --papier:      #eef0f3;
    --flaeche:     #ffffff;
    --tinte:       #16202b;
    --tinte-leise: #5c6b7a;
    --linie:       #cbd3db;
    --linie-fein:  #e3e8ed;
    --signal:      #b4530a;
    --signal-bg:   #fdf1e3;
    --kern:        #0f5c63;
    --kern-bg:     #e5eff0;
    --mark:        #fff3bf;

    --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--papier);
    color: var(--tinte);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.5;
}

.huelle { max-width: 1180px; margin: 0 auto; padding: 0 20px 80px; }

/* ---------------------------------------------------------------- Kopf */

.kopf {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    padding: 28px 0 18px;
    border-bottom: 2px solid var(--tinte);
}

.kopf h1 {
    margin: 0;
    font-size: 19px;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.kopf p { margin: 4px 0 0; color: var(--tinte-leise); font-size: 13px; }

.bestand {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--tinte-leise);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------- Filter */

.filter {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--papier);
    border-bottom: 1px solid var(--linie);
    padding: 14px 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px 16px;
    align-items: end;
}

.feld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }

.feld > span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--tinte-leise);
    font-weight: 600;
}

input[type="text"], input[type="date"], input[type="number"], select {
    font: inherit;
    font-size: 14px;
    padding: 7px 9px;
    border: 1px solid var(--linie);
    border-radius: 2px;
    background: var(--flaeche);
    color: var(--tinte);
    min-width: 0;
    width: 100%;
}

.schalter {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    padding-bottom: 8px;
    cursor: pointer;
}

.schalter input { width: 16px; height: 16px; accent-color: var(--signal); }

button {
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    border: 1px solid var(--tinte);
    border-radius: 2px;
    background: var(--tinte);
    color: #fff;
    cursor: pointer;
}

button.leise { background: transparent; color: var(--tinte); border-color: var(--linie); }
button:hover { opacity: 0.88; }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

/* ------------------------------------------------------------ Ergebnis */

.leiste {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 0 10px;
    font-size: 13px;
    color: var(--tinte-leise);
    flex-wrap: wrap;
}

.leiste strong { color: var(--tinte); font-variant-numeric: tabular-nums; }

.liste { list-style: none; margin: 0; padding: 0; }

.zeile {
    background: var(--flaeche);
    border: 1px solid var(--linie-fein);
    border-left: 3px solid var(--linie);
    margin-bottom: 8px;
}

.zeile.vergabe { border-left-color: var(--signal); }

.zeile > .kopfzeile {
    display: grid;
    grid-template-columns: 92px 84px 1fr auto;
    gap: 16px;
    align-items: start;
    padding: 12px 16px;
    width: 100%;
    background: none;
    border: 0;
    border-radius: 0;
    color: inherit;
    font: inherit;
    font-weight: 400;
    text-align: left;
    cursor: pointer;
}

.zeile > .kopfzeile:hover { background: #f7f9fa; opacity: 1; }

.nummer {
    font-family: var(--mono);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    color: var(--tinte);
}

.nummer small { display: block; color: var(--tinte-leise); font-size: 11px; letter-spacing: 0.02em; }

.wert { font-variant-numeric: tabular-nums; }

.wert b { font-size: 16px; font-weight: 650; }

.balken { height: 3px; background: var(--linie-fein); margin-top: 4px; }
.balken i { display: block; height: 100%; background: var(--tinte); }
.zeile.vergabe .balken i { background: var(--signal); }

.titel { font-size: 14px; line-height: 1.45; }

.meta {
    margin-top: 5px;
    font-size: 12px;
    color: var(--tinte-leise);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tags { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; max-width: 320px; }

.tag {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 2px;
    background: var(--kern-bg);
    color: var(--kern);
    white-space: nowrap;
}

.tag.vergabe { background: var(--signal-bg); color: var(--signal); font-weight: 600; }
.tag.umfeld  { background: var(--linie-fein); color: var(--tinte-leise); }

/* -------------------------------------------------------------- Auszug */

.auszuege {
    border-top: 1px solid var(--linie-fein);
    padding: 4px 16px 14px;
    background: #fcfdfd;
}

.auszug { padding: 10px 0; border-bottom: 1px dotted var(--linie-fein); font-size: 13.5px; }
.auszug:last-child { border-bottom: 0; }

.auszug > .wer {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--tinte-leise);
    font-weight: 600;
    margin-bottom: 3px;
}

.auszug mark { background: var(--mark); color: var(--tinte); padding: 0 2px; font-weight: 600; }

.aktionen { padding: 10px 0 2px; display: flex; gap: 14px; font-size: 13px; }
.aktionen a { color: var(--kern); text-decoration: none; border-bottom: 1px solid currentColor; }

.hinweis {
    background: var(--flaeche);
    border: 1px dashed var(--linie);
    padding: 28px;
    text-align: center;
    color: var(--tinte-leise);
    font-size: 14px;
}

@media (max-width: 720px) {
    .zeile > .kopfzeile { grid-template-columns: 1fr; gap: 8px; }
    .tags { justify-content: flex-start; max-width: none; }
    .filter { position: static; }
}

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

/* ===================================================================
   Reiter, Auslaufradar und Ebenen
   =================================================================== */

.reiter {
    display: flex;
    gap: .25rem;
    margin: 0 0 1.25rem;
    border-bottom: 1px solid var(--rand, #d8dbe0);
}
.reiter button {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: .6rem 1rem;
    font: inherit;
    font-weight: 600;
    color: #5b6470;
    cursor: pointer;
}
.reiter button:hover { color: #1c2430; }
.reiter button.aktiv {
    color: #1c2430;
    border-bottom-color: #2f6fdb;
}

.erklaerung {
    margin: 0 0 1rem;
    color: #4a535f;
    font-size: .93rem;
    max-width: 70ch;
}
.erklaerung.leise-text { color: #6b727d; font-size: .88rem; }

.feld.weit { grid-column: span 2; }

.knopfgruppe { display: flex; flex-wrap: wrap; gap: .35rem; }
.umschalter {
    border: 1px solid #ccd2da;
    background: #fff;
    border-radius: 999px;
    padding: .3rem .75rem;
    font: inherit;
    font-size: .85rem;
    cursor: pointer;
    color: #3c454f;
}
.umschalter:hover { border-color: #9aa4b1; }
.umschalter.an {
    background: #1c2430;
    border-color: #1c2430;
    color: #fff;
}

/* Ebenen-Kennzeichnung, farblich unterscheidbar aber ruhig */
.ebene {
    font-weight: 600;
    font-size: .78rem;
    padding: .1rem .45rem;
    border-radius: 3px;
    letter-spacing: .01em;
}
.ebene.bund     { background: #e3edfb; color: #1c4a8a; }
.ebene.land     { background: #e6f4ea; color: #1e6b3a; }
.ebene.kommunal { background: #fdf0e3; color: #8a5320; }
.ebene.sonstige { background: #eef0f2; color: #5b6470; }
.umschalter.ebene { color: #3c454f; }
.umschalter.ebene.an { color: #fff; }

/* Zeilen im Auslaufradar */
.zeile.ted .wert.auslauf {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 8.5rem;
}
.zeile.ted .wert.auslauf b { font-size: 1rem; }
.zeile.ted .wert.auslauf small { color: #6b727d; }

.zeile.ted.ist-aktiv { border-left: 3px solid #2f6fdb; }
.zeile.ted.ist-ueberfaellig { border-left: 3px solid #c9ccd1; }

.tag.jetzt   { background: #2f6fdb; color: #fff; }
.tag.spaeter { background: #eef0f2; color: #5b6470; }
.tag.alt     { background: #f3f4f6; color: #8a909a; }
.tag.rahmen  { background: #efe8fb; color: #573a94; }
.tag.guete-explizit  { background: #e6f4ea; color: #1e6b3a; }
.tag.guete-berechnet { background: #fff8e1; color: #7a5c00; }
.tag.guete-gedeckelt { background: #fdf0e3; color: #8a5320; }
.tag.guete-unbekannt { background: #f3f4f6; color: #8a909a; }

/* Datenliste im aufgeklappten Bereich */
.daten {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: .5rem 1.5rem;
    margin: 0 0 .75rem;
}
.daten > div { display: flex; gap: .5rem; align-items: baseline; }
.daten dt {
    color: #6b727d;
    font-size: .82rem;
    min-width: 8rem;
    flex: 0 0 auto;
}
.daten dd { margin: 0; font-size: .9rem; }

.aktionen .verknuepfen {
    border: 1px solid #ccd2da;
    background: #fff;
    border-radius: 4px;
    padding: .25rem .6rem;
    font: inherit;
    font-size: .85rem;
    cursor: pointer;
}
.aktionen .verknuepfen:hover { border-color: #2f6fdb; color: #2f6fdb; }

.tag.score { font-variant-numeric: tabular-nums; }
.tag.score.passt      { background: #e3edfb; color: #1c4a8a; }
.tag.score.passt-nicht { background: #f3f4f6; color: #8a909a; }
