/* Nachtmarsch 2028 — gemeinsames Design-System für alle Seiten.
   --color-accent wird pro Seite serverseitig aus Core\Settings gesetzt
   (siehe src/Core/Layout.php) - hier nie fest codieren. */

/* Design "Fährtenlicht" (docs/DECISIONS.md, 2026-07-13): Dunkel ist der
   einzige und bewusste Standard fürs ganze Projekt (kein Hell/Dunkel-
   Umschalten mehr, siehe ARCHIVE.md 2026-07-13) - der Nachtmarsch läuft
   ausschließlich abends/nachts. Tiefes Nachtblau-Schwarz statt neutralem
   Grau, damit der Sternenhimmel-Canvas (#sternenhimmel) dazu passt.
   color-scheme:dark sorgt dafür, dass native Formularelemente (Datum-Picker,
   Scrollbars etc.) sich ans dunkle Theme anpassen statt hell zu bleiben. */
:root {
    --color-accent: #0f766e;
    --color-on-accent: #ffffff;
    --color-bg: #0a0c0e;
    --color-surface: #14171b;
    --color-border: #262b31;
    --color-text: #eef1f3;
    --color-text-muted: #9aa3ab;
    --color-danger: #b3261e;
    --color-danger-bg: #3a1a19;
    --color-success: #1e7a3d;
    --color-success-bg: #123626;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 10px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
}

/* Rotierender Sternenhimmel als fester Seitenhintergrund (public/assets/js/sternenhimmel.js).
   Fixed statt Teil des normalen Flusses, damit er beim Scrollen stehen bleibt;
   z-index:-1 hält ihn hinter dem normalen Seiteninhalt, aber vor der reinen
   body-Hintergrundfarbe. Wird nur gerendert, wenn Layout::kopf() das Element
   überhaupt ausgibt (nur im dunklen Theme, siehe dort). */
#sternenhimmel {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

a { color: var(--color-accent); }

.nm-nav {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nm-nav a {
    text-decoration: none;
    font-weight: 600;
    color: var(--color-text);
}

.nm-nav a.zurueck {
    color: var(--color-text-muted);
    font-weight: 400;
}

.nm-nav .marke {
    color: var(--color-accent);
    font-weight: 700;
}

/* Profil-Menü ganz rechts in der Nav (Helfer: Avatar + Dropdown; Gruppen:
   nur ein Ausloggen-Link) - margin-left:auto schiebt es unabhängig davon,
   ob ein "Zurück"-Link davor steht, an den rechten Rand. */
.nm-profilmenu,
.nm-profilmenu-rechts {
    margin-left: auto;
}

.nm-profilmenu {
    position: relative;
}

.nm-profilmenu summary {
    list-style: none;
    cursor: pointer;
}
.nm-profilmenu summary::-webkit-details-marker {
    display: none;
}

.nm-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--color-accent);
    color: var(--color-on-accent);
    font-weight: 700;
    font-size: 0.9rem;
    border: 1px solid var(--color-border);
}

.nm-profilmenu-inhalt {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 10rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0.75rem;
}

.nm-profilmenu-name {
    font-weight: 700;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--color-border);
}

/* Nutzt auf normalen/breiten Monitoren fast die volle Breite, deckelt aber
   auf sehr breiten Monitoren (45" curved @ 5120px, später 34"-Dashboards)
   die Zeilenlänge, damit Tabellen/Text nicht absurd auseinandergezogen
   werden - clamp() skaliert den Deckel mit der Bildschirmbreite mit, statt
   einen festen Pixelwert zu setzen (der auf 1920px schon zu eng, auf 5120px
   aber immer noch winzig wirkt - genannt als Bug 2026-07-13). container-type
   gibt Nachfahren einen eigenen Bezugsrahmen für cqi-Einheiten (relativ zur
   gedeckelten Breite, nicht zur vollen Bildschirmbreite). */
.nm-main {
    container-type: inline-size;
    width: 97%;
    max-width: clamp(1400px, 92vw, 2400px);
    margin: 0 auto;
    padding: 1.5rem 0 3rem;
}

.nm-main h1 {
    font-size: 1.5rem;
    margin: 0 0 0.25rem;
}

.nm-main h2 {
    font-size: 1.15rem;
    margin: 2rem 0 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--color-accent);
    display: inline-block;
}

.nm-main h3 {
    font-size: 1rem;
    margin: 1.25rem 0 0.5rem;
}

.nm-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

table {
    border-collapse: collapse;
    width: 100%;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}

th, td {
    padding: 0.55rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}

th {
    background: var(--color-bg);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-muted);
}

tr:last-child td { border-bottom: none; }

input[type="text"], input[type="number"], input[type="password"],
input[type="color"], input[type="date"], input[type="email"], input[type="tel"],
select, textarea {
    font: inherit;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-surface);
    color: var(--color-text);
}

input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 1px;
}

button, .btn {
    font: inherit;
    font-weight: 600;
    padding: 0.45rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--color-accent);
    background: var(--color-accent);
    color: var(--color-on-accent);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

button:hover { filter: brightness(1.08); }

button.sekundaer {
    background: transparent;
    color: var(--color-accent);
}

.fehler {
    background: var(--color-danger-bg);
    border: 1px solid var(--color-danger);
    color: var(--color-danger);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.erfolg {
    background: var(--color-success-bg);
    border: 1px solid var(--color-success);
    color: var(--color-success);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.muted { color: var(--color-text-muted); }

/* Filter-Leiste mit mehreren Fieldsets nebeneinander (z.B. admin/statusverlauf.php)
   - Nutzer-Feedback 2026-07-14: die vorherige einzeilige Filterreihe war "sehr eng
   alle links oben", hier stattdessen eigene Spalten pro Filter-Dimension. */
.nm-filter {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: flex-start;
    margin: 1rem 0 1.5rem;
}

.nm-filter fieldset {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    padding: 0.75rem 1rem;
    min-width: 12em;
}

.nm-filter legend {
    font-weight: 600;
    padding: 0 0.3em;
}

.nm-filter label {
    display: block;
    font-weight: normal;
    margin: 0.15rem 0;
}

.nm-filter-aktionen {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-self: flex-end;
}

.nm-linkliste { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.nm-linkliste li {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem 1.25rem;
}

/* Zugangscode-Anzeige (geblurt, scharf bei Hover, Klick kopiert) */
.code {
    position: relative;
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: 0.1em;
    filter: blur(5px);
    cursor: pointer;
    transition: filter 0.15s ease;
}
.code:hover,
.code.copied {
    filter: none;
}
.code.copied::after {
    content: '✓ kopiert';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 6px;
    white-space: nowrap;
    background: var(--color-success);
    color: #fff;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.8em;
    filter: none;
}

.reihe-flex { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.leer { color: var(--color-text-muted); }

.laufen-kopf { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.laufen-kopf .pfeil { font-size: 1.1em; color: var(--color-accent); }

.scroll-x { overflow-x: auto; }

.nm-main section { margin-bottom: 2rem; }
.nm-linkliste a { font-size: 1.05rem; }
.nm-linkliste p { margin: 0.25rem 0 0; color: var(--color-text-muted); }

/* Hero-Bereich auf der Anmeldeseite */
.nm-hero {
    text-align: center;
    padding: 2.5rem 1rem 1.5rem;
}
.nm-hero h1 {
    font-size: 2.4rem;
    margin: 0 0 0.5rem;
    background: linear-gradient(120deg, var(--color-accent), var(--color-text));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.nm-hero p {
    color: var(--color-text-muted);
    font-size: 1.05rem;
    margin: 0;
}

/* Countdown zum nächsten Nachtmarsch-Termin (Anmeldeseite) */
.nm-countdown {
    text-align: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 2rem;
}
.nm-countdown-einheiten {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 0.5rem;
}
.nm-countdown-einheiten .zahl {
    display: block;
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--color-accent);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.nm-countdown-einheiten .label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 0.25rem;
}
.nm-countdown .label { color: var(--color-text-muted); margin-top: 0.25rem; }

/* Kennzahlen (Anmeldeseite): angemeldete Wehren, freie Plätze, Stationen */
.nm-kennzahlen {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    text-align: center;
    margin-bottom: 2rem;
}
.nm-kennzahlen .zahl {
    display: block;
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-accent);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.nm-kennzahlen .label {
    display: block;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin-top: 0.15rem;
}

/* Zwei Kacheln: Helfer / Gruppen */
.nm-kacheln {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}
.nm-kachel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    border-top: 3px solid var(--color-accent);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.nm-kachel:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}
.nm-kachel h2 {
    margin-top: 0;
    border-bottom: none;
    padding-bottom: 0;
}
.nm-kachel .btn { margin-top: 0.5rem; }
