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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f4f5f7;
    color: #1a1a2e;
    min-height: 100vh;
}

/* ── Hauptmenü ───────────────────────────────────────────── */
.hauptmenue {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1a1a2e;
    color: #fff;
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-bild {
    height: 38px;
    width: auto;
    display: block;
}

.untertitel {
    margin-left: 0.6rem;
    font-size: 0.9rem;
    color: #a8b2d8;
}

.menue-rechts {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.benutzer {
    font-size: 0.9rem;
    color: #a8b2d8;
}

.abmelden {
    font-size: 0.85rem;
    color: #e63946;
    text-decoration: none;
    border: 1px solid #e63946;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    transition: background 0.15s;
}

.abmelden:hover { background: #e63946; color: #fff; }

/* ── Login ───────────────────────────────────────────────── */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-box {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 380px;
}

.login-box h1 {
    font-size: 1.6rem;
    color: #e63946;
    margin-bottom: 0.2rem;
}

.login-untertitel {
    color: #6b7280;
    margin-bottom: 1.8rem;
    font-size: 0.95rem;
}

.fehler-meldung {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    padding: 0.7rem 1rem;
    margin-bottom: 1.2rem;
    font-size: 0.9rem;
}

.formfeld {
    margin-bottom: 1.1rem;
}

.formfeld label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.35rem;
}

.formfeld input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.15s;
}

.formfeld input:focus {
    outline: none;
    border-color: #1a1a2e;
}

.anmelde-button {
    width: 100%;
    padding: 0.7rem;
    background: #1a1a2e;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background 0.15s;
}

.anmelde-button:hover { background: #e63946; }

/* ── Dashboard ───────────────────────────────────────────── */
main { padding: 2rem 1.5rem; }

.dashboard-wrapper { max-width: 960px; margin: 0 auto; }

.dashboard-wrapper h2 {
    font-size: 1.4rem;
    margin-bottom: 0.4rem;
}

.rolle-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    margin-bottom: 2rem;
    background: #e0e7ff;
    color: #3730a3;
}

.rolle-badge.rolle-admin { background: #fee2e2; color: #b91c1c; }
.rolle-badge.rolle-redakteur { background: #dcfce7; color: #166534; }
.rolle-badge.rolle-moderator { background: #fef9c3; color: #854d0e; }

.platzhalter-karten {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.karte {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.2rem 1.4rem;
}

.karte h3 {
    font-size: 1rem;
    margin-bottom: 0.4rem;
    color: #1a1a2e;
}

.karte p {
    font-size: 0.85rem;
    color: #9ca3af;
}

.karte-aktiv { border-color: #1a1a2e; }
.karte-aktiv p { color: #374151; }
.karte-aktiv a { color: #1a1a2e; text-decoration: underline; font-size: 0.85rem; }

.etappe-hinweis {
    font-size: 0.85rem;
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
    padding-top: 1rem;
}

/* ── Hauptnavigation (Stammdaten-Links) ──────────────────── */
.hauptmenue {
    flex-wrap: wrap;
    gap: 0.5rem;
}

.menue-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.menue-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    justify-content: center;
}

.menue-link {
    font-size: 0.875rem;
    color: #a8b2d8;
    text-decoration: none;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}

.menue-link:hover { background: rgba(255,255,255,0.1); color: #fff; }
.menue-link.aktiv { background: rgba(230,57,70,0.2); color: #e63946; font-weight: 600; }

/* ── Stammdaten-Seiten – gemeinsames Layout ───────────────── */
.seite-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 0.5rem;
}

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

.seite-kopf h2 {
    font-size: 1.4rem;
}

/* ── Meldungen (Erfolg / Fehler) ─────────────────────────── */
.meldung {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1.2rem;
    font-size: 0.9rem;
}

.meldung-erfolg {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.meldung-fehler {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

/* ── Datentabelle ─────────────────────────────────────────── */
.datentabelle {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    font-size: 0.9rem;
}

.datentabelle thead {
    background: #1a1a2e;
    color: #fff;
}

.datentabelle th {
    padding: 0.7rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.datentabelle td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #f0f0f4;
    vertical-align: middle;
}

.datentabelle tbody tr:last-child td { border-bottom: none; }
.datentabelle tbody tr:hover { background: #f8f9ff; }

/* Elemente-Baum */
.zeile-parent { background: #fff; }
.zeile-kind { background: #fafbff; }
.zeile-kind td { font-size: 0.88rem; }

.kind-einzug { padding-left: 2rem !important; }
.baum-linie { color: #9ca3af; margin-right: 0.4rem; }
.baum-marker { color: #9ca3af; margin-right: 0.4rem; font-size: 0.7rem; }
.kinder-anzahl { font-size: 0.8rem; color: #6b7280; margin-left: 0.5rem; }

.aktionen { white-space: nowrap; }

/* ── Schaltflächen ────────────────────────────────────────── */
.schaltflaeche {
    display: inline-block;
    padding: 0.45rem 0.9rem;
    border-radius: 5px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: background 0.15s, opacity 0.15s;
}

.schaltflaeche-primaer  { background: #1a1a2e; color: #fff; }
.schaltflaeche-primaer:hover  { background: #e63946; }

.schaltflaeche-neutral  { background: #e5e7eb; color: #374151; }
.schaltflaeche-neutral:hover  { background: #d1d5db; }

.schaltflaeche-gefahr   { background: #fee2e2; color: #b91c1c; }
.schaltflaeche-gefahr:hover   { background: #fca5a5; }

.schaltflaeche-klein { padding: 0.25rem 0.6rem; font-size: 0.8rem; }
.schaltflaeche:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Badges & Kästchen ────────────────────────────────────── */
.farbklotz {
    display: inline-block;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.1);
    vertical-align: middle;
}

.kategorie-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.kategorie-wort     { background: #dbeafe; color: #1e40af; }
.kategorie-werbung  { background: #fef9c3; color: #854d0e; }
.kategorie-service  { background: #dcfce7; color: #166534; }
.kategorie-musik    { background: #f3e8ff; color: #6b21a8; }

.badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.badge-gruen { background: #dcfce7; color: #166534; }
.badge-grau  { background: #f3f4f6; color: #6b7280; }

.typ-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.82rem;
}

/* ── Formular ─────────────────────────────────────────────── */
.formular {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    padding: 1.8rem 2rem;
    max-width: 720px;
}

.formular-abschnitt {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 1.2rem 1.4rem;
    margin-bottom: 1.5rem;
}

.formular-abschnitt legend {
    padding: 0 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: #1a1a2e;
}

.abschnitt-hinweis {
    font-size: 0.84rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.formular-zeile {
    margin-bottom: 1.1rem;
}

.formular-zeile label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.3rem;
}

.formular-zeile input[type="text"],
.formular-zeile input[type="url"],
.formular-zeile input[type="number"],
.formular-zeile select,
.formular-zeile textarea {
    width: 100%;
    padding: 0.55rem 0.8rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.92rem;
    font-family: inherit;
    transition: border-color 0.15s;
    background: #fff;
}

.formular-zeile input:focus,
.formular-zeile select:focus,
.formular-zeile textarea:focus {
    outline: none;
    border-color: #1a1a2e;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500 !important;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.farbe-eingabe {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.farbe-eingabe input[type="color"] {
    width: 3rem;
    height: 2.2rem;
    padding: 0.1rem;
    border-radius: 4px;
    cursor: pointer;
}

.farbe-vorschau {
    font-size: 0.85rem;
    color: #6b7280;
    font-family: monospace;
}

.hinweis {
    display: block;
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 0.3rem;
}

.pflicht { color: #e63946; }

.formular-aktionen {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* ── Sonstige Hilfselemente ───────────────────────────────── */
.dauer-readonly {
    display: inline-block;
    padding: 0.55rem 0.8rem;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.92rem;
    color: #6b7280;
}

.leer-hinweis {
    color: #6b7280;
    padding: 2rem;
    text-align: center;
    background: #fff;
    border-radius: 8px;
    border: 1px dashed #d1d5db;
}

.leer-wert { color: #9ca3af; }
.kurztext { color: #374151; }
.link-extern { color: #1a1a2e; font-size: 0.85rem; }

/* ── Select mit "+ Neu"-Button ───────────────────────────── */
.select-mit-neu {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.select-mit-neu select { flex: 1; }

/* ── Schnell-Dialog ──────────────────────────────────────── */
.schnell-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 1.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.schnell-dialog h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #1a1a2e;
}
.schnell-dialog::backdrop {
    background: rgba(0,0,0,0.4);
}

/* ── Programm-Verwaltung ──────────────────────────────────── */
.seite-wrapper-breit { max-width: 1400px; }
.formular-breit { max-width: 860px; }

/* Datum- und Zeitfelder wie die übrigen Eingabefelder gestalten */
.formular-zeile input[type="date"],
.formular-zeile input[type="time"] {
    width: 100%;
    padding: 0.55rem 0.8rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.92rem;
    font-family: inherit;
    background: #fff;
}
.formular-zeile input[type="date"]:focus,
.formular-zeile input[type="time"]:focus { outline: none; border-color: #1a1a2e; }
.formular-zeile input[readonly] { background: #f3f4f6; color: #6b7280; }

/* Zwei Felder nebeneinander (gültig ab / gültig bis) */
.formular-zeile-doppelt {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}
@media (max-width: 640px) {
    .formular-zeile-doppelt { grid-template-columns: 1fr; }
}

/* Umschalter "vorhandener Inhalt" / "neuer Inhalt" */
.auswahl-schalter {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    background: #f8f9ff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.7rem 1rem;
}
.auswahl-schalter input[type="radio"] { width: auto; margin: 0; }

/* Wochentags-Auswahl */
.wochentage-auswahl {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.wochentag-feld {
    display: flex !important;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    background: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500 !important;
    margin-bottom: 0 !important;
    user-select: none;
}
.wochentag-feld input[type="checkbox"] { width: auto; margin: 0; }
.wochentag-feld:has(input:checked) { border-color: #1a1a2e; background: #eef0ff; }

/* Programm-Tabelle */
.tabelle-scroll { overflow-x: auto; }
.programm-tabelle { min-width: 1150px; font-size: 0.86rem; }
.zelle-zeit strong { font-variant-numeric: tabular-nums; }
.toleranz { display: block; font-size: 0.72rem; color: #6b7280; }
.zeittext { font-style: italic; color: #374151; }
.sendung-hinweis { display: block; font-size: 0.75rem; color: #6b7280; }
.programm-tabelle .badge { margin-left: 0.3rem; }

.badge.sidebar-voll         { background: #dbeafe; color: #1e40af; }
.badge.sidebar-nur_vorschau { background: #fef9c3; color: #854d0e; }
.badge.sidebar-aus          { background: #f3f4f6; color: #6b7280; }

.tabellen-fussnote { font-size: 0.8rem; color: #6b7280; margin-top: 0.9rem; }
