@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700&family=Bitter:wght@400;500;700&display=swap');

:root {
    --rot: #E3000F;
    --rot-dunkel: #B80000;
    --rot-hell: #FF1A2A;
    --dunkelrot: #6F003C;
    --weiss: #FFFFFF;
    --schwarz: #1A1A1A;
    --grau-100: #F5F5F5;
    --grau-200: #E8E8E8;
    --grau-300: #D0D0D0;
    --grau-400: #999999;
    --grau-500: #666666;
    --grau-600: #444444;
    --schrift-titel: 'Bitter', Georgia, serif;
    --schrift-text: 'Open Sans', 'Helvetica Neue', Helvetica, sans-serif;
    --schatten: 0 2px 8px rgba(0, 0, 0, 0.08);
    --schatten-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
    --uebergang: 180ms ease;
    --breite-max: 1200px;
    --abstand: 1.5rem;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--schrift-text);
    color: var(--schwarz);
    background: var(--grau-100);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--rot);
    text-decoration: none;
    transition: color var(--uebergang);
}

a:hover {
    color: var(--rot-dunkel);
}

img {
    max-width: 100%;
    height: auto;
}

/* --- Kopfbereich --- */

.kopfbereich {
    background: var(--rot);
    color: var(--weiss);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.kopf-inhalt {
    max-width: var(--breite-max);
    margin: 0 auto;
    padding: 0 var(--abstand);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--weiss);
    font-family: var(--schrift-titel);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}

.logo:hover {
    color: var(--weiss);
}

.logo-keil {
    width: 32px;
    height: 32px;
    background: var(--weiss);
    clip-path: polygon(0 100%, 50% 0, 100% 100%);
    transform: rotate(-25deg);
    flex-shrink: 0;
}

.navigation {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    color: var(--weiss);
    padding: 0.5rem 0.85rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background var(--uebergang);
}

.nav-link:hover,
.nav-link.aktiv {
    background: rgba(255, 255, 255, 0.18);
    color: var(--weiss);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--weiss);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
}

/* --- Held-Bereich --- */

.held {
    background: linear-gradient(135deg, var(--rot) 0%, var(--dunkelrot) 100%);
    color: var(--weiss);
    padding: 3.5rem var(--abstand);
    position: relative;
    overflow: hidden;
}

.held::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.04);
    clip-path: polygon(0 100%, 50% 0, 100% 100%);
    transform: rotate(-15deg);
}

.held-inhalt {
    max-width: var(--breite-max);
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.held h1 {
    font-family: var(--schrift-titel);
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.held p {
    font-size: 1.1rem;
    opacity: 0.92;
    max-width: 640px;
    margin-bottom: 2rem;
}

/* --- Suchleiste --- */

.suchbereich {
    max-width: var(--breite-max);
    margin: 0 auto;
    padding: 0 var(--abstand);
    position: relative;
}

.suchfeld-wrapper {
    display: flex;
    background: var(--weiss);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    margin-top: -1.75rem;
    position: relative;
    z-index: 10;
}

.held .suchfeld-wrapper {
    margin-top: 0;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.suchfeld {
    flex: 1;
    border: none;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-family: var(--schrift-text);
    outline: none;
    background: transparent;
}

.suchfeld::placeholder {
    color: var(--grau-400);
}

.such-btn {
    background: var(--rot);
    color: var(--weiss);
    border: none;
    padding: 1rem 1.75rem;
    font-family: var(--schrift-text);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--uebergang);
    white-space: nowrap;
}

.such-btn:hover {
    background: var(--rot-dunkel);
}

.vorschlaege {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--weiss);
    border-radius: 0 0 10px 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 20;
    display: none;
    max-height: 400px;
    overflow-y: auto;
}

.vorschlaege.sichtbar {
    display: block;
}

.vorschlag-eintrag {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--grau-200);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background var(--uebergang);
}

.vorschlag-eintrag:hover {
    background: var(--grau-100);
}

.vorschlag-eintrag:last-child {
    border-bottom: none;
}

.vorschlag-titel {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--schwarz);
}

.vorschlag-meta {
    font-size: 0.8rem;
    color: var(--grau-500);
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* --- Filter --- */

.filter-leiste {
    max-width: var(--breite-max);
    margin: 1.5rem auto 0;
    padding: 0 var(--abstand);
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--grau-300);
    border-radius: 6px;
    font-family: var(--schrift-text);
    font-size: 0.9rem;
    background: var(--weiss);
    color: var(--schwarz);
    cursor: pointer;
    transition: border-color var(--uebergang);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.25rem;
    min-width: 180px;
}

.filter-select:focus {
    border-color: var(--rot);
    outline: none;
}

/* --- Statistik-Karten --- */

.statistik-leiste {
    max-width: var(--breite-max);
    margin: 2rem auto;
    padding: 0 var(--abstand);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.statistik-karte {
    background: var(--weiss);
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: var(--schatten);
    text-align: center;
}

.statistik-zahl {
    font-family: var(--schrift-titel);
    font-size: 2rem;
    font-weight: 700;
    color: var(--rot);
    line-height: 1.2;
}

.statistik-bezeichnung {
    font-size: 0.85rem;
    color: var(--grau-500);
    margin-top: 0.25rem;
}

/* --- Karten-Raster --- */

.inhalt-bereich {
    max-width: var(--breite-max);
    margin: 0 auto;
    padding: 2rem var(--abstand);
    flex: 1;
}

.bereich-titel {
    font-family: var(--schrift-titel);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--schwarz);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bereich-titel::before {
    content: '';
    width: 4px;
    height: 1.25em;
    background: var(--rot);
    border-radius: 2px;
}

.karten-raster {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}

.karte {
    background: var(--weiss);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: var(--schatten);
    transition: box-shadow var(--uebergang), transform var(--uebergang);
    display: flex;
    flex-direction: column;
    border-left: 4px solid transparent;
}

.karte:hover {
    box-shadow: var(--schatten-hover);
    transform: translateY(-2px);
}

.karte.typ-antrag {
    border-left-color: var(--rot);
}

.karte.typ-anfrage {
    border-left-color: var(--dunkelrot);
}

.karte-kopf {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    gap: 0.75rem;
}

.karte-typ {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.karte-typ.antrag {
    background: var(--rot);
    color: var(--weiss);
}

.karte-typ.anfrage {
    background: var(--dunkelrot);
    color: var(--weiss);
}

.karte-datum {
    font-size: 0.8rem;
    color: var(--grau-500);
    white-space: nowrap;
}

.karte-titel {
    font-family: var(--schrift-titel);
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
    line-height: 1.35;
    color: var(--schwarz);
}

.karte-titel a {
    color: inherit;
}

.karte-titel a:hover {
    color: var(--rot);
}

.karte-auszug {
    font-size: 0.9rem;
    color: var(--grau-600);
    line-height: 1.55;
    margin-bottom: 1rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.karte-fuss {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--grau-200);
}

.karte-tag {
    font-size: 0.78rem;
    padding: 0.2rem 0.55rem;
    background: var(--grau-100);
    border-radius: 4px;
    color: var(--grau-600);
}

/* --- Dokumentansicht --- */

.dokument-ansicht {
    max-width: 860px;
    margin: 2rem auto;
    padding: 0 var(--abstand);
}

.dokument-kopf {
    background: var(--weiss);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: var(--schatten);
    margin-bottom: 1.5rem;
}

.dokument-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--grau-200);
}

.meta-element {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.meta-bezeichnung {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--grau-500);
}

.meta-wert {
    font-size: 0.95rem;
    color: var(--schwarz);
}

.dokument-inhalt {
    background: var(--weiss);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: var(--schatten);
    line-height: 1.75;
    white-space: pre-wrap;
    font-size: 0.95rem;
}

/* --- Seitennummerierung --- */

.seitennummern {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.35rem;
    margin: 2rem 0;
}

.seiten-link {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--grau-600);
    background: var(--weiss);
    border: 1px solid var(--grau-300);
    transition: all var(--uebergang);
}

.seiten-link:hover {
    background: var(--grau-100);
    color: var(--schwarz);
    border-color: var(--grau-400);
}

.seiten-link.aktiv {
    background: var(--rot);
    color: var(--weiss);
    border-color: var(--rot);
}

/* --- Fussbereich --- */

.fussbereich {
    background: var(--schwarz);
    color: var(--grau-300);
    padding: 2rem var(--abstand);
    margin-top: auto;
}

.fuss-inhalt {
    max-width: var(--breite-max);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.fuss-text {
    font-size: 0.85rem;
}

.fuss-links {
    display: flex;
    gap: 1.25rem;
}

.fuss-links a {
    color: var(--grau-300);
    font-size: 0.85rem;
}

.fuss-links a:hover {
    color: var(--weiss);
}

/* --- Admin-Bereich --- */

.admin-layout {
    display: flex;
    min-height: calc(100vh - 64px);
}

.admin-seite {
    flex: 1;
    padding: 1.5rem var(--abstand);
    max-width: 100%;
}

.admin-seitenleiste {
    width: 240px;
    background: var(--weiss);
    border-right: 1px solid var(--grau-200);
    padding: 1.5rem 0;
    flex-shrink: 0;
}

.admin-nav-link {
    display: block;
    padding: 0.65rem 1.5rem;
    color: var(--grau-600);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--uebergang);
    border-left: 3px solid transparent;
}

.admin-nav-link:hover,
.admin-nav-link.aktiv {
    background: var(--grau-100);
    color: var(--rot);
    border-left-color: var(--rot);
}

.admin-kopf {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-titel {
    font-family: var(--schrift-titel);
    font-size: 1.5rem;
    font-weight: 700;
}

.admin-statistik {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.admin-stat-karte {
    background: var(--weiss);
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: var(--schatten);
    text-align: center;
}

.admin-stat-zahl {
    font-family: var(--schrift-titel);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--rot);
}

.admin-stat-bez {
    font-size: 0.8rem;
    color: var(--grau-500);
    margin-top: 0.15rem;
}

/* --- Tabelle --- */

.tabelle-wrapper {
    overflow-x: auto;
    background: var(--weiss);
    border-radius: 10px;
    box-shadow: var(--schatten);
}

.tabelle {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.tabelle th {
    background: var(--grau-100);
    padding: 0.85rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--grau-600);
    border-bottom: 2px solid var(--grau-200);
    white-space: nowrap;
}

.tabelle td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--grau-200);
    vertical-align: middle;
}

.tabelle tr:hover td {
    background: var(--grau-100);
}

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

/* --- Formular --- */

.formular {
    background: var(--weiss);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: var(--schatten);
    max-width: 860px;
}

.formular-raster {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.formular-gruppe {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.formular-gruppe.voll {
    grid-column: 1 / -1;
}

.formular-bezeichnung {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--grau-600);
}

.formular-bezeichnung .pflicht {
    color: var(--rot);
}

.formular-eingabe,
.formular-auswahl,
.formular-textfeld {
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--grau-300);
    border-radius: 6px;
    font-family: var(--schrift-text);
    font-size: 0.95rem;
    transition: border-color var(--uebergang);
    background: var(--weiss);
}

.formular-eingabe:focus,
.formular-auswahl:focus,
.formular-textfeld:focus {
    border-color: var(--rot);
    outline: none;
    box-shadow: 0 0 0 3px rgba(227, 0, 15, 0.08);
}

.formular-textfeld {
    resize: vertical;
    min-height: 200px;
    line-height: 1.6;
}

/* --- Schaltflaechen --- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-family: var(--schrift-text);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--uebergang);
    text-decoration: none;
    white-space: nowrap;
}

.btn-rot {
    background: var(--rot);
    color: var(--weiss);
}

.btn-rot:hover {
    background: var(--rot-dunkel);
    color: var(--weiss);
}

.btn-dunkel {
    background: var(--dunkelrot);
    color: var(--weiss);
}

.btn-dunkel:hover {
    background: #520030;
    color: var(--weiss);
}

.btn-umriss {
    background: transparent;
    color: var(--rot);
    border: 1px solid var(--rot);
}

.btn-umriss:hover {
    background: var(--rot);
    color: var(--weiss);
}

.btn-geist {
    background: rgba(255,255,255,0.15);
    color: var(--weiss);
    border: 1px solid rgba(255,255,255,0.4);
}

.btn-geist:hover {
    background: rgba(255,255,255,0.25);
    color: var(--weiss);
}

.btn-grau {
    background: var(--grau-200);
    color: var(--grau-600);
}

.btn-grau:hover {
    background: var(--grau-300);
}

.btn-gefahr {
    background: transparent;
    color: var(--rot);
    border: 1px solid var(--rot);
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
}

.btn-gefahr:hover {
    background: var(--rot);
    color: var(--weiss);
}

.btn-klein {
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
}

/* --- Hinweis-Meldungen --- */

.meldungen {
    max-width: var(--breite-max);
    margin: 1rem auto 0;
    padding: 0 var(--abstand);
}

.meldung {
    padding: 0.85rem 1.25rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.meldung-erfolg {
    background: #E6F4EA;
    color: #1B5E20;
    border-left: 4px solid #2E7D32;
}

.meldung-fehler {
    background: #FDECEA;
    color: #B71C1C;
    border-left: 4px solid var(--rot);
}

.meldung-warnung {
    background: #FFF8E1;
    color: #E65100;
    border-left: 4px solid #FB8C00;
}

/* --- Anmeldeseite --- */

.anmelde-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 64px);
    padding: var(--abstand);
}

.anmelde-box {
    background: var(--weiss);
    border-radius: 10px;
    padding: 2.5rem;
    box-shadow: var(--schatten);
    width: 100%;
    max-width: 420px;
}

.anmelde-box h1 {
    font-family: var(--schrift-titel);
    font-size: 1.5rem;
    margin-bottom: 0.35rem;
}

.anmelde-box p {
    color: var(--grau-500);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

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

.kein-ergebnis {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--grau-500);
}

.kein-ergebnis h3 {
    font-family: var(--schrift-titel);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--grau-600);
}

/* --- Verwandte Dokumente --- */

.verwandte-liste {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.verwandte-liste li {
    padding: 0.75rem 1rem;
    background: var(--grau-100);
    border-radius: 6px;
    font-size: 0.9rem;
}

.verwandte-liste li a {
    font-weight: 500;
}

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

.ergebnis-info {
    font-size: 0.9rem;
    color: var(--grau-500);
    margin-bottom: 1.25rem;
}

.ergebnis-info strong {
    color: var(--schwarz);
}

/* --- Responsiv --- */

@media (max-width: 768px) {
    .kopf-inhalt {
        height: 56px;
    }

    .nav-toggle {
        display: block;
    }

    .navigation {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--rot-dunkel);
        flex-direction: column;
        padding: 0.75rem;
        gap: 0.15rem;
    }

    .navigation.offen {
        display: flex;
    }

    .nav-link {
        width: 100%;
    }

    .held h1 {
        font-size: 1.65rem;
    }

    .karten-raster {
        grid-template-columns: 1fr;
    }

    .admin-layout {
        flex-direction: column;
    }

    .admin-seitenleiste {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--grau-200);
        padding: 0.75rem 0;
        display: flex;
        overflow-x: auto;
    }

    .admin-nav-link {
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
    }

    .admin-nav-link:hover,
    .admin-nav-link.aktiv {
        border-left: none;
        border-bottom-color: var(--rot);
    }

    .filter-leiste {
        flex-direction: column;
    }

    .filter-select {
        min-width: 100%;
    }

    .fuss-inhalt {
        flex-direction: column;
        text-align: center;
    }

    .formular-raster {
        grid-template-columns: 1fr;
    }
}
