/* warnwart — Lagebild-Konsole.
   Dunkle Tinte, Haarlinienraster, Signalfarben ausschließlich für Schweregrade.
   Helles Thema gespiegelt, Umschaltung folgt dem System und dem Schalter. */

@import url("https://fonts.bunny.net/css?family=instrument-serif:400,400i|ibm-plex-sans:400,500,600|ibm-plex-mono:400,500");

:root {
    --tinte: #0b0d10;
    --tinte-2: #12151a;
    --tinte-3: #191d24;
    --linie: #262b34;
    --linie-hell: #333a45;
    --text: #e7e4dd;
    --text-leise: #9aa1ad;
    --text-still: #6b727e;
    --papier: #e7e4dd;

    --kritisch: #ff4d3d;
    --hoch: #ff9f1c;
    --mittel: #cbb04a;
    --niedrig: #6ba368;
    --akzent: #6fb3d2;

    --serif: "Instrument Serif", Georgia, serif;
    --sans: "IBM Plex Sans", -apple-system, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, monospace;

    --rand: 2px;
    --raster: 68px;
}

:root[data-thema="hell"] {
    --tinte: #f2f0ea;
    --tinte-2: #ffffff;
    --tinte-3: #faf8f3;
    --linie: #ddd8cc;
    --linie-hell: #c6c0b1;
    --text: #17191d;
    --text-leise: #565b64;
    --text-still: #82878f;
    --kritisch: #c62a1c;
    --hoch: #b3660a;
    --mittel: #8a7513;
    --niedrig: #3f6b3d;
    --akzent: #1f5f80;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--tinte);
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Haarlinienraster + Korn: gibt der Fläche Tiefe ohne Bildmaterial */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(to right, color-mix(in srgb, var(--linie) 45%, transparent) 1px, transparent 1px),
        linear-gradient(to bottom, color-mix(in srgb, var(--linie) 45%, transparent) 1px, transparent 1px);
    background-size: var(--raster) var(--raster);
    opacity: .5;
    mask-image: radial-gradient(circle at 20% 0%, #000 0%, transparent 75%);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: .035;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.huelle { position: relative; z-index: 2; display: flex; min-height: 100vh; }

/* ---------------------------------------------------------- Seitenleiste */
.rand {
    width: 232px;
    flex: 0 0 232px;
    border-right: 1px solid var(--linie);
    background: color-mix(in srgb, var(--tinte-2) 90%, transparent);
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.marke {
    padding: 22px 20px 18px;
    border-bottom: 1px solid var(--linie);
}

.marke b {
    font-family: var(--serif);
    font-size: 30px;
    font-weight: 400;
    letter-spacing: -.01em;
    display: block;
    line-height: 1;
}

.marke span {
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .22em;
    color: var(--text-still);
    display: block;
    margin-top: 8px;
}

.navi { padding: 12px 10px; flex: 1; }

.navi a {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 9px 12px;
    color: var(--text-leise);
    text-decoration: none;
    font-size: 14px;
    border-left: var(--rand) solid transparent;
    transition: color .15s, background .15s, border-color .15s;
}

.navi a:hover { color: var(--text); background: color-mix(in srgb, var(--tinte-3) 70%, transparent); }
.navi a.aktiv { color: var(--text); border-left-color: var(--akzent); background: var(--tinte-3); }
.navi a i { font-family: var(--mono); font-style: normal; font-size: 11px; color: var(--text-still); width: 14px; }
.navi a .zahl { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--text-still); }

.rand-fuss {
    border-top: 1px solid var(--linie);
    padding: 14px 20px;
    font-size: 12px;
    color: var(--text-still);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.rand-fuss a { color: var(--text-leise); text-decoration: none; }
.rand-fuss a:hover { color: var(--text); }

/* ------------------------------------------------------------- Hauptteil */
.buehne { flex: 1; min-width: 0; padding: 30px 38px 80px; max-width: 1280px; }

.kopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }

h1 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 40px;
    line-height: 1.05;
    margin: 0;
    letter-spacing: -.015em;
}

.kopf p { margin: 8px 0 0; color: var(--text-leise); font-size: 14px; max-width: 62ch; }

h2 {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .2em;
    color: var(--text-still);
    margin: 34px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--linie);
}

/* ------------------------------------------------------------- Kennzahlen */
.zahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--linie); border: 1px solid var(--linie); }
.zahl-karte { background: var(--tinte-2); padding: 16px 18px; }
.zahl-karte b { display: block; font-family: var(--mono); font-size: 30px; font-weight: 400; letter-spacing: -.02em; }
.zahl-karte span { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .16em; color: var(--text-still); }

/* Balken der Schwereverteilung */
.verteilung { display: flex; height: 6px; margin-top: 14px; border: 1px solid var(--linie); background: var(--tinte-2); }
.verteilung i { display: block; height: 100%; }

/* ----------------------------------------------------------- Meldungen */
.liste { border: 1px solid var(--linie); border-bottom: none; }

.zeile {
    display: grid;
    grid-template-columns: 4px 96px 1fr auto;
    gap: 0 16px;
    align-items: start;
    padding: 14px 18px 14px 0;
    border-bottom: 1px solid var(--linie);
    background: var(--tinte-2);
    animation: auf .35s ease both;
}
.zeile:hover { background: var(--tinte-3); }
.zeile > .balken { grid-row: 1 / -1; align-self: stretch; }

.zeile .stufe {
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .16em;
    padding-top: 3px;
    padding-left: 14px;
}

.zeile .titel { font-size: 15px; font-weight: 500; margin: 0; }
.zeile .titel a { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; }
.zeile .titel a:hover { border-bottom-color: var(--text-still); }
.zeile .unter { margin-top: 5px; font-family: var(--mono); font-size: 11px; color: var(--text-still); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.zeile .grund { margin-top: 6px; font-size: 12.5px; color: var(--text-leise); }
.zeile .rechts { text-align: right; font-family: var(--mono); font-size: 11px; color: var(--text-still); white-space: nowrap; }

.neu-punkt { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--akzent); margin-right: 6px; vertical-align: middle; }

/* Schweregrad-Farbgebung, eine Quelle der Wahrheit */
.s4 .balken, .b4 { background: var(--kritisch); }
.s3 .balken, .b3 { background: var(--hoch); }
.s2 .balken, .b2 { background: var(--mittel); }
.s1 .balken, .b1 { background: var(--niedrig); }
.s4 .stufe { color: var(--kritisch); }
.s3 .stufe { color: var(--hoch); }
.s2 .stufe { color: var(--mittel); }
.s1 .stufe { color: var(--niedrig); }

@keyframes auf { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.zeile:nth-child(1) { animation-delay: .02s } .zeile:nth-child(2) { animation-delay: .04s }
.zeile:nth-child(3) { animation-delay: .06s } .zeile:nth-child(4) { animation-delay: .08s }
.zeile:nth-child(5) { animation-delay: .10s } .zeile:nth-child(6) { animation-delay: .12s }
.zeile:nth-child(7) { animation-delay: .14s } .zeile:nth-child(8) { animation-delay: .16s }

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

/* ---------------------------------------------------------------- Karten */
.karten { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.karte { border: 1px solid var(--linie); background: var(--tinte-2); padding: 18px 20px; }
.karte h3 { margin: 0 0 4px; font-size: 17px; font-weight: 600; }
.karte .hinweis { color: var(--text-still); font-family: var(--mono); font-size: 11px; }

.marken { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.merkmal {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--mono); font-size: 11px;
    border: 1px solid var(--linie-hell); padding: 3px 8px;
    color: var(--text-leise); background: var(--tinte-3);
}
.merkmal form { display: inline; }
.merkmal button { background: none; border: none; color: var(--text-still); cursor: pointer; padding: 0; font-size: 13px; line-height: 1; }
.merkmal button:hover { color: var(--kritisch); }

/* --------------------------------------------------------------- Tabellen */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
    text-align: left; font-family: var(--mono); font-size: 10px; font-weight: 500;
    text-transform: uppercase; letter-spacing: .16em; color: var(--text-still);
    padding: 9px 12px; border-bottom: 1px solid var(--linie); white-space: nowrap;
}
td { padding: 10px 12px; border-bottom: 1px solid var(--linie); vertical-align: middle; }
tr:hover td { background: var(--tinte-3); }
td.mono, .mono { font-family: var(--mono); font-size: 12px; }

/* --------------------------------------------------------------- Formular */
form.reihe { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
label { display: block; font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .14em; color: var(--text-still); margin-bottom: 5px; }

input[type="text"], input[type="email"], input[type="password"], input[type="time"], input[type="search"], select {
    background: var(--tinte-3);
    border: 1px solid var(--linie-hell);
    color: var(--text);
    font-family: var(--sans);
    font-size: 14px;
    padding: 8px 10px;
    min-width: 0;
    width: 100%;
    border-radius: 0;
}
input:focus, select:focus { outline: 2px solid var(--akzent); outline-offset: -1px; border-color: var(--akzent); }
.feld { flex: 1 1 180px; }
.feld.schmal { flex: 0 0 140px; }

button, .knopf {
    font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .14em;
    background: var(--text); color: var(--tinte);
    border: 1px solid var(--text); padding: 9px 16px; cursor: pointer;
    text-decoration: none; display: inline-block; transition: opacity .15s;
}
button:hover, .knopf:hover { opacity: .82; }
button.leise, .knopf.leise { background: transparent; color: var(--text-leise); border-color: var(--linie-hell); }
button.leise:hover { color: var(--text); border-color: var(--text-still); }
button.gefahr { background: transparent; border-color: var(--kritisch); color: var(--kritisch); }

/* ------------------------------------------------------------ Filterband */
.filter { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 18px; }
.filter a {
    font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .12em;
    padding: 6px 11px; border: 1px solid var(--linie-hell); color: var(--text-leise); text-decoration: none;
}
.filter a.aktiv { border-color: var(--text); color: var(--text); }
.filter form { display: flex; gap: 6px; margin-left: auto; }
.filter input[type="search"] { width: 220px; }

/* ------------------------------------------------------------- Meldungen */
.notiz { border-left: var(--rand) solid var(--akzent); background: var(--tinte-2); padding: 11px 16px; margin-bottom: 20px; font-size: 13.5px; }
.notiz.schlecht { border-left-color: var(--kritisch); }

.leer { border: 1px dashed var(--linie-hell); padding: 40px 24px; text-align: center; color: var(--text-still); background: var(--tinte-2); }
.leer b { display: block; font-family: var(--serif); font-size: 22px; color: var(--text-leise); margin-bottom: 6px; font-weight: 400; }

/* ------------------------------------------------------------- Anmeldung */
.tor { display: grid; place-items: center; min-height: 100vh; position: relative; z-index: 2; padding: 24px; }
.tor-karte { width: 100%; max-width: 380px; border: 1px solid var(--linie); background: var(--tinte-2); padding: 34px 32px; }
.tor-karte .marke { border: none; padding: 0 0 22px; }
.tor-karte label { margin-top: 14px; }
.tor-karte button { width: 100%; margin-top: 20px; padding: 11px; }
.tor-trenner { display: flex; align-items: center; gap: 12px; margin: 20px 0 0; color: var(--text-still); font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .16em; }
.tor-trenner::before, .tor-trenner::after { content: ""; height: 1px; background: var(--linie); flex: 1; }

/* ------------------------------------------------------------- Profilgitter */
.profil-gitter { width: 100%; border: 1px solid var(--linie); border-collapse: collapse; }
.profil-gitter select { font-family: var(--mono); font-size: 11px; padding: 5px 6px; }
.profil-gitter td:first-child { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .14em; }

@media (max-width: 880px) {
    .huelle { flex-direction: column; }
    .rand { width: 100%; flex: none; height: auto; position: static; flex-direction: row; align-items: center; overflow-x: auto; }
    .marke { border-bottom: none; border-right: 1px solid var(--linie); white-space: nowrap; }
    .navi { display: flex; padding: 6px; }
    .navi a { border-left: none; border-bottom: var(--rand) solid transparent; white-space: nowrap; }
    .navi a.aktiv { border-left: none; border-bottom-color: var(--akzent); }
    .navi a .zahl { display: none; }
    .rand-fuss { border: none; }
    .buehne { padding: 22px 18px 60px; }
    .zeile { grid-template-columns: 4px 1fr; }
    .zeile .rechts, .zeile .stufe { grid-column: 2; text-align: left; padding-left: 14px; }
}
