/* ==========================================================
   Bandbutler – zentrales Stylesheet
   Erscheinungsbild: graphitfarbene Seitenleiste, warmgrauer Inhalt,
   Violett als Akzent. Rot/Gelb/Grün sind der Ampel vorbehalten.
   ========================================================== */

/* Überschrift-Schrift: liegt die Datei nicht auf dem Server, greift
   automatisch die Systemschrift (kein Fehler, nur eine Zeile im Log). */
@font-face {
    font-family: "Space Grotesk";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("fonts/space-grotesk-latin-600.woff2") format("woff2");
}
@font-face {
    font-family: "Space Grotesk";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("fonts/space-grotesk-latin-700.woff2") format("woff2");
}

:root {
    --color-bg: #f2f1ee;
    --color-surface: #ffffff;
    --color-border: #e4e2dd;
    --color-text: #17181c;
    --color-text-muted: #5e6068;
    --color-accent: #266c8a;
    --color-accent-hover: #1d566f;
    --color-accent-tint: #dcebf2;
    --color-danger: #b3261e;
    --color-danger-hover: #8f1f19;
    --color-warning: #8a5a00;
    --color-success: #1e7a3d;

    /* Ampel (nur für Dringlichkeit verwenden) */
    --amp-rot-bg: #fbe9e7;
    --amp-rot-text: #a12b1f;
    --amp-gelb-bg: #fff4d6;
    --amp-gelb-text: #7a5200;
    --amp-gruen-bg: #e3f4e8;
    --amp-gruen-text: #1e6b3a;

    /* Seitenleiste */
    --side-bg: #14161b;
    --side-hover: #1e2128;
    --side-active: #262a33;
    --side-text: #c9cdd6;
    --side-muted: #8a90a0;
    --side-accent: #79e6f2;
    --side-width: 248px;

    --radius: 12px;
    --shadow: 0 1px 2px rgba(20, 22, 27, 0.04), 0 1px 6px rgba(20, 22, 27, 0.04);
    --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--color-text);
    background-color: var(--color-bg);
    margin: 0;
    padding: 24px;
}

.page {
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-text);
    margin: 0 0 4px 0;
}

h2 {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--color-text);
    margin: 28px 0 12px 0;
}

h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 20px 0 8px 0;
}

a {
    color: var(--color-accent);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

a.back {
    display: inline-block;
    font-size: 14px;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}
a.back:hover { color: var(--color-accent); }

/* Karten / Container */
.card, .form-container, .veranstalter, .notiz, .wiedervorlage-item, .dokument-item {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 18px;
}

/* Buttons */
button, .btn, .neuer-button, .neuer-veranstalter-button, .edit-button, .edit-link,
.detail-button, .delete-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 0 16px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

button, .btn, .neuer-button, .neuer-veranstalter-button {
    background-color: var(--color-accent);
    color: #fff;
}
button:hover, .btn:hover, .neuer-button:hover, .neuer-veranstalter-button:hover {
    background-color: var(--color-accent-hover);
    text-decoration: none;
}

.edit-button, .detail-button, .edit-link {
    background-color: var(--color-surface);
    color: var(--color-text);
    border: 1px solid #c9ced6;
}
.edit-button:hover, .detail-button:hover, .edit-link:hover {
    background-color: var(--color-bg);
    text-decoration: none;
}

.delete-button {
    background-color: var(--color-surface);
    color: var(--color-danger);
    border: 1px solid #c9ced6;
}
.delete-button:hover { background-color: #fdf0ee; }

/* Mail-Button: direkt neben einer E-Mail-Adresse, öffnet mailto: */
.mail-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    min-height: 0;
    padding: 0;
    margin-left: 8px;
    border-radius: 8px;
    background-color: var(--color-accent-tint);
    color: var(--color-accent);
    text-decoration: none;
    font-size: 16px;
    vertical-align: middle;
    line-height: 1;
}
.mail-button:hover {
    background-color: var(--color-accent);
    color: #fff;
    text-decoration: none;
}

.actions a.logout {
    background-color: transparent;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}
.actions a.logout:hover { background-color: var(--color-bg); }

/* Aktionsleiste auf den Seiten */
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 24px 0;
}
.actions a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    background-color: var(--color-surface);
    color: var(--color-text);
    border: 1px solid #c9ced6;
    padding: 0 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
}
.actions a:hover { background-color: var(--color-bg); text-decoration: none; }

/* Formulare */
form { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-top: 12px; }

/* Kleine Formulare, die nur einen Button enthalten (z.B. Löschen-Buttons in Listen) */
form.inline-form {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
    display: inline;
}

/* Löschen-Button etwas auf Abstand zu den anderen Aktionen, damit man nicht versehentlich draufklickt */
form.inline-form.delete-form {
    margin-left: 24px;
}

/* Aktions-Buttons in Tabellenzeilen (z.B. Bearbeiten + Löschen) nebeneinander statt untereinander */
.aktion-buttons {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
}
.aktion-buttons form.inline-form.delete-form {
    margin-left: 0;
}

/* Veranstalter-Karten: Titel links, Aktionen (Details/Bearbeiten/Löschen) rechtsbündig zur Karte */
.veranstalter h2 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.veranstalter .buttons {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 8px;
}

label {
    display: block;
    margin-top: 12px;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-muted);
}

input, select, textarea {
    width: 100%;
    padding: 9px 12px;
    font-size: 15px;
    font-family: inherit;
    color: var(--color-text);
    background-color: var(--color-surface);
    border: 1px solid #c9ced6;
    border-radius: 10px;
    box-sizing: border-box;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(38, 108, 138, 0.20);
}

/* Tabellen */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0 20px 0;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    font-size: 14px;
}
th, td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}
/* Dashboard (index.php): die Tabellen haben unterschiedlich viele/breite Spalten,
   dadurch rutscht die letzte Spalte ("Aktion") je nach Tabelle unterschiedlich weit
   nach links. Rechtsbündig ausgerichtet landet sie immer am gleichen Rand. */
.dashboard-tabelle th:last-child,
.dashboard-tabelle td:last-child {
    text-align: right;
}
/* Lange, nicht umbrechende Inhalte würden die Tabelle sonst breiter als 100% drücken. */
.dashboard-tabelle td {
    overflow-wrap: break-word;
}
/* Datum (erste Spalte) und Aktion (letzte Spalte) nie umbrechen */
.dashboard-tabelle td:first-child,
.dashboard-tabelle td:last-child,
.dashboard-tabelle td:last-child a {
    white-space: nowrap;
}
.dashboard-tabelle td:last-child .detail-button {
    min-height: 34px;
}

th {
    background-color: #f7f6f3;
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background-color: #faf9f7; }

/* Rolle (Bandmitglieder-Übersicht): Etikett */
.rolle-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}
.rolle-admin { background-color: var(--color-accent-tint); color: #1d566f; }
.rolle-nutzer { background-color: #e9e8e4; color: #4b4d55; }

/* Auftritt-Status: <select> mit Etiketten-Optik. Direkt änderbar statt nur Text.
   Bewusst ohne Rot/Gelb/Grün, diese Farben gehören der Ampel. */
.auftritt-status-form { display: inline-block; margin: 0; background: none; border: none; box-shadow: none; padding: 0; }
select.status-select {
    display: inline-block;
    width: auto;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 22px 3px 10px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23555' stroke-width='2'%3E%3Cpath d='M5 8l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 7px center;
    background-size: 9px;
}
select.status-select:focus { outline: none; box-shadow: 0 0 0 3px rgba(38, 108, 138, 0.28); }
select.status-select:hover { opacity: 0.85; }
.status-angefragt { background-color: var(--color-accent-tint); color: #1d566f; }
.status-bestätigt { background-color: #d5eef1; color: #0f5c66; }
.status-abgesagt { background-color: #e9e8e4; color: #5e6068; }

.wiedervorlage-row td { background-color: #fdf3f1; }
.empty-hint, .hinweis { color: var(--color-text-muted); font-style: italic; font-size: 14px; }

.typ-badge {
    font-size: 12px;
    font-weight: 600;
    background-color: #e9e8e4;
    color: #4b4d55;
    padding: 3px 10px;
    border-radius: 20px;
    margin-left: 6px;
    vertical-align: middle;
}

/* Veranstalter-Status: Etikett, direkt änderbar (<select>) */
.veranstalter-status-form {
    display: inline-block;
    margin: 0;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    vertical-align: middle;
}
select.status-badge {
    display: inline-block;
    width: auto;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 22px 3px 10px;
    border-radius: 20px;
    margin-left: 6px;
    border: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23555' stroke-width='2'%3E%3Cpath d='M5 8l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 7px center;
    background-size: 9px;
}
select.status-badge:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(38, 108, 138, 0.28);
}
select.status-badge:hover { opacity: 0.85; }
.status-in-kontakt { background-color: #e9e8e4; color: #4b4d55; }
.status-in-verhandlung { background-color: var(--color-accent-tint); color: #1d566f; }
.status-bestaetigt { background-color: #d5eef1; color: #0f5c66; }
.status-nicht-aktiv { background-color: #f1f0ed; color: #6b6d75; }

/* Tabs (Veranstalter-Detail) */
.tabs { display: flex; gap: 4px; margin-bottom: 0; border-bottom: 1px solid var(--color-border); }
.tab {
    padding: 10px 18px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.tab.active { color: var(--color-accent); border-bottom-color: var(--color-accent); font-weight: 600; }
.tab-content {
    display: none;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 20px;
}
.tab-content.active { display: block; }

.notiz, .wiedervorlage-item, .dokument-item {
    border-left: 3px solid var(--color-accent);
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 10px 14px;
    box-shadow: none;
}
.wiedervorlage-item { border-left-color: var(--color-warning); }
.dokument-item { border-left-color: var(--color-accent); }

.status-ausstehend { color: var(--color-warning); font-weight: 600; }
.status-erledigt { color: var(--color-success); font-weight: 600; }
.status-abgelehnt { color: var(--color-danger); font-weight: 600; }

/* ==========================================================
   Ampel: Dringlichkeit. Immer Farbe UND Wort/Symbol, damit sie
   auch ohne Farbwahrnehmung lesbar ist.
   ========================================================== */
.amp {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}
.amp-rot { background-color: var(--amp-rot-bg); color: var(--amp-rot-text); }
.amp-gelb { background-color: var(--amp-gelb-bg); color: var(--amp-gelb-text); }
.amp-gruen { background-color: var(--amp-gruen-bg); color: var(--amp-gruen-text); }

/* ==========================================================
   Seitenleiste (ersetzt die obere Navigationsleiste)
   ========================================================== */
body.with-nav { padding: 36px 40px 36px calc(var(--side-width) + 40px); }

.sidenav-toggle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.sidenav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--side-width);
    background-color: var(--side-bg);
    padding: 22px 14px 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    z-index: 100;
}
.sidenav-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 8px 14px 8px;
}
.sidenav-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 19px;
    letter-spacing: -0.01em;
}
.sidenav-brand:hover { text-decoration: none; }
.sidenav-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background-color: var(--color-accent);
    color: #fff;
    font-size: 17px;
    font-weight: 700;
}
.sidenav-burger { display: none; }

.sidenav-bandlogo {
    display: block;
    background-color: #fff;
    border-radius: 10px;
    padding: 8px 10px;
    margin: 0 8px 14px 8px;
}
.sidenav-bandlogo img {
    display: block;
    max-height: 34px;
    max-width: 100%;
    margin: 0 auto;
}

.sidenav-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}
.sidenav a.sidenav-link {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    color: var(--side-text);
    font-size: 15px;
    font-weight: 500;
}
.sidenav a.sidenav-link:hover {
    background-color: var(--side-hover);
    color: #fff;
    text-decoration: none;
}
.sidenav a.sidenav-link.active {
    background-color: var(--side-active);
    color: #fff;
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--side-accent);
}
.sidenav a.sidenav-link.klein { font-size: 14px; min-height: 36px; }
.sidenav-gruppe {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--side-muted);
    padding: 20px 12px 6px 12px;
}
.sidenav-abstand { flex-grow: 1; min-height: 20px; }

/* Schmale Bildschirme: Seitenleiste wird zur oberen Leiste mit "Menü"-Knopf */
@media (max-width: 900px) {
    body.with-nav { padding: 76px 16px 24px 16px; }
    .sidenav {
        right: 0;
        bottom: auto;
        width: auto;
        padding: 10px 14px;
        gap: 0;
        overflow-y: visible;
    }
    .sidenav-head { padding: 0; }
    .sidenav-burger {
        display: inline-flex;
        align-items: center;
        min-height: 40px;
        padding: 0 14px;
        border-radius: 10px;
        background-color: var(--side-active);
        color: #fff;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
    }
    .sidenav-bandlogo { display: none; }
    .sidenav-body { display: none; padding-top: 10px; }
    .sidenav-toggle:checked ~ .sidenav .sidenav-body {
        display: flex;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
}

/* Login-Seite */
.login-form { max-width: 360px; margin: 60px auto 0 auto; }
.error { color: var(--color-danger); font-size: 14px; margin-top: 8px; }

/* Techniker-Checkbox-Liste */
.techniker-liste {
    margin-top: 5px;
    padding: 10px;
    border: 1px solid #c9ced6;
    border-radius: 10px;
    max-height: 150px;
    overflow-y: auto;
    background-color: var(--color-bg);
}
.techniker-liste label {
    font-weight: 400;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}
.techniker-liste input[type="checkbox"] { width: auto; }

/* Ausklappbare Anleitung "eigenen Kalender verknüpfen" – wiederverwendbar
   auf mehreren Seiten (Kalenderübersicht, Bandmitglied bearbeiten, ...) */
.kalender-anleitung { margin: 12px 0 20px 0; }
.kalender-anleitung summary { cursor: pointer; font-weight: 600; color: var(--color-accent); padding: 4px 0; }
.kalender-anleitung-inhalt { background-color: var(--color-surface); border: 1px solid var(--color-border); border-radius: 10px; padding: 16px 20px; margin-top: 8px; font-size: 15px; }
.kalender-anleitung-inhalt h4 { margin: 16px 0 6px 0; }
.kalender-anleitung-inhalt h4:first-child { margin-top: 0; }
.kalender-anleitung-inhalt ol { margin: 0 0 0 20px; padding: 0; }
.kalender-anleitung-inhalt li { margin-bottom: 4px; }

/* Status-Anzeige beim Testen eines Kalender-Links (Sofort-Prüfung) */
.kalender-check-status { margin-top: 8px; font-size: 14px; font-weight: 500; }
.kalender-check-status.erfolg { color: var(--color-success); }
.kalender-check-status.fehler { color: var(--color-danger); }
.kalender-check-status.laeuft { color: var(--color-text-muted); }

/* ==========================================================
   Dashboard: Kacheln und zentrale Wiedervorlagen-Liste
   ========================================================== */
.kacheln {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 20px 0 8px 0;
}
.kachel {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 18px 20px;
}
.kachel-titel { font-size: 14px; font-weight: 500; color: var(--color-text-muted); }
.kachel-zahl {
    font-family: var(--font-display);
    font-size: 38px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-top: 6px;
}
.kachel-text { font-size: 13px; color: var(--color-text-muted); margin-top: 4px; }
.kachel-dunkel { background-color: var(--side-bg); border-color: var(--side-bg); }
.kachel-dunkel .kachel-titel, .kachel-dunkel .kachel-text { color: var(--side-text); }
.kachel-dunkel .kachel-zahl { color: #fff; }
.kachel-dunkel a { color: #9fe9f2; }

/* Kürzel-Kreis (zuständige Person) */
.kuerzel-kreis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    background-color: var(--color-accent-tint);
    color: #1d566f;
}

/* Dashboard: große Karte, Filter-Chips, Zusatzzeilen */
.karte-gross {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 18px 20px 6px 20px;
    margin: 20px 0;
}
.karte-kopf {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
button.chip {
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    background-color: var(--color-surface);
    color: var(--color-text);
    border: 1px solid #c9ced6;
    font-weight: 500;
}
button.chip:hover { background-color: var(--color-bg); }
button.chip.aktiv {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
    font-weight: 600;
}
table.tabelle-in-karte {
    border: none;
    border-radius: 0;
    margin-bottom: 6px;
}
.zusatz { font-size: 12px; color: var(--color-text-muted); }
.zusatz-rot { color: var(--amp-rot-text); font-weight: 600; }

/* Papierkram: Checklistenpunkte als Etiketten (Fortschritt) */
.fortschritt-zahl { font-size: 13px; color: var(--color-text-muted); margin-right: 8px; white-space: nowrap; }
.pk {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    margin: 2px 5px 2px 0;
    border: 1px solid #c9ced6;
    color: #8a8d96;
    background-color: var(--color-surface);
    white-space: nowrap;
}
.pk-verschickt { background-color: #e4f1e9; border-color: #9fcab0; color: #1f6040; }
.pk-erledigt { background-color: #2f7d57; border-color: #2f7d57; color: #fff; }

/* Etiketten-Menü (Status direkt im Dashboard ändern) */
table.tabelle-offen { overflow: visible; }
table.tabelle-offen tr:first-child th:first-child { border-top-left-radius: var(--radius); }
table.tabelle-offen tr:first-child th:last-child { border-top-right-radius: var(--radius); }
details.pk-menu { display: inline-block; position: relative; }
details.pk-menu > summary { list-style: none; cursor: pointer; }
details.pk-menu > summary::-webkit-details-marker { display: none; }
details.pk-menu[open] > summary { box-shadow: 0 0 0 3px rgba(38, 108, 138, 0.28); }
.pk-popup {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 50;
    margin-top: 4px;
    min-width: 170px;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(20, 22, 27, 0.16);
    padding: 8px;
    white-space: normal;
}
.pk-popup-titel { font-size: 13px; font-weight: 600; color: var(--color-text-muted); padding: 4px 8px 6px 8px; }
.pk-popup form.inline-form { display: block; }
button.pk-option {
    display: flex;
    width: 100%;
    justify-content: flex-start;
    min-height: 36px;
    background: none;
    color: var(--color-text);
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    padding: 0 10px;
}
button.pk-option:hover { background-color: var(--color-bg); }
button.pk-option.aktuell { font-weight: 700; color: var(--color-accent); }

/* Etiketten-Zeile: "x von y" links fest, Etiketten daneben; bei Umbruch fluchten sie sauber */
.pk-zeile { display: flex; align-items: flex-start; gap: 10px; }
.pk-zeile .fortschritt-zahl { margin: 6px 0 0 0; min-width: 52px; }
.pk-liste { display: flex; flex-wrap: wrap; gap: 4px 5px; }
.pk-liste .pk, .pk-liste details.pk-menu { margin: 0; }
table.tabelle-offen td:nth-child(4) { min-width: 340px; }

/* Papierkram-Tabelle: Spalten neu verteilt, damit der Fortschritt Platz hat */
table.tabelle-offen td:nth-child(2) { max-width: 200px; }
table.tabelle-offen td:nth-child(3) { white-space: nowrap; }
table.tabelle-offen td:nth-child(4) { min-width: 380px; }
.pk { padding: 2px 9px; }

/* Checkliste: Status-Auswahl in der Zeile nicht als eigene Karte darstellen */
form.checkliste-status-form {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
}
.checkliste-item { padding: 10px 16px; min-height: 52px; }
.checkliste-item select.checkliste-status-select { font-size: 13px; padding: 4px 24px 4px 12px; }

/* "Zuständig"-Etikett in der Veranstalter-Übersicht (Seite setzt eigenen Hintergrund) an Akzentfarbe angleichen */
body .zustaendig-badge { background-color: var(--color-accent-tint); }

/* Ampel in der Veranstalter-Übersicht (Kopfzeile der Karte) */
.veranstalter-name .amp { margin-left: 6px; vertical-align: middle; font-size: 12px; padding: 3px 10px; }

/* Dashboard: "Dran?"- und Aktion-Spalte in allen Tabellen gleich breit und bündig untereinander */
.dashboard-tabelle th:nth-last-child(2), .dashboard-tabelle td:nth-last-child(2) { width: 150px; }
.dashboard-tabelle th:last-child, .dashboard-tabelle td:last-child { width: 100px; }
/* Wiedervorlagen-Tabelle reicht bis an den Kartenrand, damit die Spalten mit den anderen Tabellen fluchten */
.karte-gross { overflow: hidden; padding-bottom: 0; }
.karte-gross table.tabelle-in-karte {
    margin: 12px -20px 0 -20px;
    width: calc(100% + 40px);
    border-top: 1px solid var(--color-border);
}
.karte-gross .tabelle-in-karte tr:last-child td { border-bottom: none; }

/* Aktion-Spalte: Überschrift und Button linksbündig untereinander */
.dashboard-tabelle th:last-child,
.dashboard-tabelle td:last-child { text-align: left; width: 120px; }

/* Letzte zwei Spalten ("Dran?" und "Aktion") in allen drei Dashboard-Tabellen exakt gleich breit,
   damit sie senkrecht untereinander stehen (feste Breite, unabhängig vom Inhalt der anderen Spalten) */
.dashboard-tabelle th:nth-last-child(2), .dashboard-tabelle td:nth-last-child(2) {
    width: 170px; min-width: 170px; max-width: 170px;
}
.dashboard-tabelle th:last-child, .dashboard-tabelle td:last-child {
    width: 130px; min-width: 130px; max-width: 130px;
}

/* Kacheln sind Links */
a.kachel { display: block; color: inherit; text-decoration: none; transition: box-shadow 0.15s ease, transform 0.15s ease; }
a.kachel:hover { text-decoration: none; box-shadow: 0 4px 16px rgba(20, 22, 27, 0.10); transform: translateY(-1px); }
a.kachel:focus-visible { outline: 3px solid rgba(38, 108, 138, 0.35); outline-offset: 2px; }
.kachel-link { color: var(--color-accent); font-weight: 500; }
.kachel-dunkel .kachel-link { color: #9fe9f2; }
#papierkram, #wiedervorlagen { scroll-margin-top: 16px; }
html { scroll-behavior: smooth; }

/* Einheitliche Dashboard-Blöcke: farbiger Kopf, bündig mit der Tabelle */
.karte-gross { padding: 0; overflow: hidden; margin: 0 0 28px 0; }
.karte-gross.karte-offen { overflow: visible; }
.karte-gross .karte-kopf {
    background-color: var(--color-accent);
    color: #fff;
    padding: 12px 22px;
    min-height: 48px;
    border-radius: 13px 13px 0 0;
}
.karte-gross .karte-kopf h2 { margin: 0; color: #fff; font-size: 19px; }
.kopf-hinweis { font-size: 13px; color: rgba(255, 255, 255, 0.88); }
.kopf-hinweis a { color: #fff; text-decoration: underline; }
.karte-gross table.tabelle-in-karte { margin: 0; width: 100%; border-top: none; }
.karte-gross table.tabelle-in-karte tr:last-child td:first-child { border-bottom-left-radius: 13px; }
.karte-gross table.tabelle-in-karte tr:last-child td:last-child { border-bottom-right-radius: 13px; }
.karte-gross table.tabelle-offen tr:first-child th:first-child,
.karte-gross table.tabelle-offen tr:first-child th:last-child { border-radius: 0; }
.karte-kopf button.chip {
    background-color: transparent;
    border-color: rgba(255, 255, 255, 0.6);
    color: #fff;
    min-height: 36px;
}
.karte-kopf button.chip:hover { background-color: rgba(255, 255, 255, 0.15); }
.karte-kopf button.chip.aktiv { background-color: #fff; border-color: #fff; color: var(--color-accent); }

/* Papierkram-Block: Ecken sauber, obwohl das Etiketten-Menü über den Rand ragen darf */
.karte-gross.karte-offen table.tabelle-in-karte { border-collapse: separate; border-spacing: 0; }
.karte-gross.karte-offen table.tabelle-in-karte tr:last-child td { border-bottom: none; }
.karte-gross.karte-offen table.tabelle-in-karte th { border-bottom: 1px solid var(--color-border); }
.karte-gross.karte-offen table.tabelle-in-karte { border-radius: 0 0 13px 13px; }
.kacheln { margin-bottom: 28px; }

/* Auftrittsliste: Öffnen + "⋯"-Menü */
.aktion-zeile { display: flex; align-items: center; gap: 8px; }
.mehr-button {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; min-height: 40px; border-radius: 10px;
    border: 1px solid #c9ced6; background-color: var(--color-surface);
    font-size: 20px; font-weight: 700; line-height: 1; color: var(--color-text); cursor: pointer;
}
.mehr-button:hover { background-color: var(--color-bg); }
details.aktion-menu[open] > .mehr-button { box-shadow: 0 0 0 3px rgba(38, 108, 138, 0.28); }
.aktion-popup { left: auto; right: 0; min-width: 160px; padding: 6px; }
.menue-eintrag {
    display: block; width: 100%; box-sizing: border-box; text-align: left;
    padding: 9px 12px; border: none; border-radius: 8px; background: transparent;
    font: inherit; font-size: 14px; font-weight: 500; color: var(--color-text); text-decoration: none; cursor: pointer;
}
.menue-eintrag:hover { background-color: var(--color-accent-tint); text-decoration: none; }
.menue-loeschen { color: var(--color-danger); border-top: 1px solid var(--color-border); border-radius: 0 0 8px 8px; margin-top: 4px; }
.menue-loeschen:hover { background-color: #fbe9e7; }
.auftritte-tabelle th, .auftritte-tabelle td { white-space: nowrap; }
.auftritte-tabelle td:nth-child(4) { white-space: normal; min-width: 150px; }
table.auftritte-tabelle { overflow: visible; }

/* Filterleiste über Listen (Auftritte, Veranstalter) */
.filter-leiste {
    display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
    margin-bottom: 28px; padding: 12px 16px;
    background-color: var(--color-surface); border: 1px solid var(--color-border); border-radius: 10px;
}
.aktion-zeile form.inline-form { margin: 0; }

/* Formulare im Karten-Stil (Anlegen/Bearbeiten) */
form.form-seite {
    background: transparent; border: none; box-shadow: none; padding: 0; margin: 0;
    max-width: none; border-radius: 0;
}
.form-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 24px; padding: 6px 22px 22px 22px;
}
.form-grid.drei { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .feld-voll { grid-column: 1 / -1; }
.form-grid label { margin-top: 14px; }
.tba-zeile {
    display: flex; align-items: center; gap: 8px; font-weight: 400;
    margin-top: 8px; font-size: 14px; color: var(--color-text-muted);
}
.tba-zeile input[type="checkbox"] { width: auto; margin: 0; }
.feld-hinweis { font-size: 13px; color: var(--color-text-muted); margin: 6px 0 0 0; }
.form-seite .techniker-liste { max-height: 220px; margin-top: 0; }
.form-seite .liste-titel { margin-top: 14px; }
.form-aktionen { display: flex; align-items: center; gap: 18px; margin: 4px 0 40px 0; }
.form-aktionen a { color: var(--color-text-muted); }
@media (max-width: 700px) {
    .form-grid, .form-grid.drei { grid-template-columns: 1fr; }
}
.form-grid label.tba-zeile { margin-top: 8px; }
.form-grid .techniker-liste label { margin-top: 6px; }
.form-grid .feld-voll > textarea:first-child { margin-top: 16px; }

/* ==========================================================
   Handy-Layout (Schritt 1+2): feste Kopfzeile, untere Leiste,
   größere Tippflächen. PC-Ansicht bleibt unverändert.
   ========================================================== */
.nav-unten { display: none; }
.test-schild {
    display: none;
    background: #f5c518; color: #1a1a1a;
    font-size: 12px; font-weight: 700; letter-spacing: 0.08em;
    padding: 3px 9px; border-radius: 6px;
}
@media (max-width: 900px) {
    .sidenav {
        border-bottom: 3px solid var(--color-accent);
        padding-top: calc(10px + env(safe-area-inset-top));
        padding-left: calc(14px + env(safe-area-inset-left));
        padding-right: calc(14px + env(safe-area-inset-right));
    }
    .sidenav-head { justify-content: flex-start; }
    .sidenav-burger { margin-left: auto; }
    .test-schild { display: inline-block; }
    body.with-nav { padding-top: calc(76px + env(safe-area-inset-top)); }
}
@media (max-width: 760px) {
    /* Menü-Knopf oben entfällt, "Mehr" unten übernimmt */
    .sidenav-burger { display: none; }
    body.with-nav {
        padding-left: 14px; padding-right: 14px;
        padding-bottom: calc(84px + env(safe-area-inset-bottom));
    }
    .sidenav-toggle:checked ~ .sidenav .sidenav-body {
        max-height: calc(100vh - 160px - env(safe-area-inset-bottom));
    }
    .nav-unten {
        display: flex;
        position: fixed; left: 0; right: 0; bottom: 0;
        z-index: 110;
        background: var(--side-bg);
        border-top: 1px solid rgba(255,255,255,0.12);
        padding: 4px env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    }
    .nav-unten-link {
        flex: 1;
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        gap: 2px;
        min-height: 56px;
        color: var(--side-muted, #9aa0a8);
        font-size: 11px; font-weight: 600;
        cursor: pointer; text-decoration: none;
        -webkit-tap-highlight-color: transparent;
    }
    .nav-unten-link:hover { text-decoration: none; color: #fff; }
    .nav-unten-link.active { color: #fff; box-shadow: inset 0 3px 0 var(--color-accent); }
    .nav-symbol { font-size: 22px; line-height: 1; }
    .sidenav-toggle:checked ~ .nav-unten .nav-mehr { color: #fff; }

    /* Tippen & Eingaben */
    input, select, textarea { font-size: 16px; min-height: 44px; }
    textarea { min-height: 88px; }
    input[type="checkbox"], input[type="radio"] { min-height: 0; width: 22px; height: 22px; }
    button, .detail-button, .mehr-button, input[type="submit"] { min-height: 44px; }
    .karte-gross, .form-seite { max-width: 100%; }
    table { font-size: 14px; }
}
@media (max-width: 760px) {
    select.status-badge, select.status-select { min-height: 0; font-size: 13px; }
}
.nur-handy { display: none; }
@media (max-width: 760px) {
    .nur-pc { display: none; }
    .nur-handy { display: inline; }
    .monats-nav-kopf { gap: 8px; padding-left: 14px; padding-right: 14px; }
    .monats-nav-kopf h2 { font-size: 18px; text-align: center; flex: 1; }
    .monat-knopf { padding: 0 12px; white-space: nowrap; }
    /* Menü: letzter Eintrag nicht von der Leiste verdeckt */
    .sidenav-body { padding-bottom: 24px; }
    .sidenav-toggle:checked ~ .sidenav .sidenav-body { max-height: calc(100vh - 150px - env(safe-area-inset-bottom)); max-height: calc(100dvh - 150px - env(safe-area-inset-bottom)); }
}

/* ==========================================================
   Handy: Tabellen werden zu Zeilen-Karten (Klasse "stapel")
   ========================================================== */
@media (max-width: 760px) {
    table.stapel, table.stapel tbody { display: block; width: 100% !important; min-width: 0 !important; }
    table.stapel thead, table.stapel tr:has(> th) { display: none; }
    table.stapel tr {
        display: block;
        padding: 12px 16px 10px 16px;
        border-bottom: 1px solid var(--color-border);
        background: transparent;
    }
    table.stapel tr:last-child { border-bottom: none; }
    table.stapel td {
        display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
        width: auto !important; min-width: 0 !important; max-width: none !important;
        padding: 3px 0 !important; border: none !important;
        white-space: normal !important; text-align: left !important;
        font-size: 15px;
    }
    table.stapel td::before {
        content: attr(data-label);
        flex: 0 0 92px;
        font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
        text-transform: uppercase; color: var(--color-text-muted);
    }
    /* erste Zelle (Datum/Fällig) als Überschrift der Karte */
    table.stapel td:first-child { font-weight: 700; font-size: 17px; padding-bottom: 6px !important; }
    table.stapel td:first-child::before { flex: 0 0 auto; margin-right: 0; }
    /* Aktionsknopf unten, volle Breite */
    table.stapel td:last-child { display: block; padding-top: 10px !important; }
    table.stapel td:last-child::before { display: none; }
    table.stapel td:last-child .detail-button,
    table.stapel td:last-child a.detail-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
    table.stapel td[colspan] { display: block; }
    table.stapel td[colspan]::before { display: none; }
    /* Papierkram-Punkte: Zelle darf umbrechen */
    table.stapel td .pk-zeile { flex-wrap: wrap; }
    table.stapel td .pk-liste { flex-wrap: wrap; }
}
@media (max-width: 760px) {
    table.stapel td[data-label="Fortschritt"] { flex-direction: column; align-items: flex-start; gap: 4px; }
    table.stapel td[data-label="Fortschritt"] .pk-zeile { flex-direction: column; gap: 4px; }
    table.stapel td[data-label="Fortschritt"] .fortschritt-zahl { margin: 0; }
}

/* ==========================================================
   Handy: Veranstalter-Liste als Karten
   ========================================================== */
@media (max-width: 760px) {
    table.veranstalter-tabelle, table.veranstalter-tabelle tbody { display: block; width: 100% !important; min-width: 0 !important; }
    table.veranstalter-tabelle thead { display: none; }
    table.veranstalter-tabelle tr.v-zeile {
        display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px;
        padding: 14px 16px; border-bottom: none;
    }
    table.veranstalter-tabelle tr.v-zeile td {
        display: block; width: auto !important; min-width: 0 !important; max-width: none !important;
        padding: 0 !important; border: none !important; white-space: normal !important;
    }
    table.veranstalter-tabelle tr.v-zeile td.v-name { flex: 1 1 100%; }
    table.veranstalter-tabelle tr.v-zeile td:last-child { flex: 1 1 100%; padding-top: 4px !important; }
    table.veranstalter-tabelle tr.v-zeile.offen { background: #f7f6f3; border-bottom: none; }
    table.veranstalter-tabelle tr.v-zeile:not(.offen) { border-bottom: 1px solid var(--color-border); }
    table.veranstalter-tabelle tr.v-details { border-bottom: 1px solid var(--color-border); }
    table.veranstalter-tabelle tr.v-details td {
        display: block; padding: 4px 16px 16px 16px !important; font-size: 15px; background: #f7f6f3;
    }
    table.veranstalter-tabelle tr.v-details p { font-size: 15px; margin: 6px 0; word-break: break-word; }
    table.veranstalter-tabelle tr.v-details strong { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); display: block; margin-bottom: 1px; }
    table.veranstalter-tabelle .mail-button { min-height: 36px; }
    table.veranstalter-tabelle .aktion-zeile { display: flex; align-items: center; gap: 10px; }
    table.veranstalter-tabelle .detail-button { min-height: 44px; display: inline-flex; align-items: center; }
    table.veranstalter-tabelle .mehr-button { min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
    .filter-leiste input[type="text"] { min-width: 0; width: 100%; }
}
@media (max-width: 760px) {
    .veranstalter-toggle { width: 22px !important; font-size: 18px !important; margin-top: 0 !important; color: var(--color-accent) !important; }
    .v-name-zeile { align-items: center; }
}
@media (max-width: 760px) {
    .filter-leiste { flex-direction: column; align-items: stretch; gap: 8px; box-sizing: border-box; max-width: 100%; }
    .filter-leiste input[type="text"], .filter-leiste input[type="search"], .filter-leiste select { width: 100%; min-width: 0; box-sizing: border-box; }
    .filter-status { flex-wrap: wrap; }
}
.sidenav-version {
    padding: 10px 12px 2px 12px;
    font-size: 11px; letter-spacing: 0.03em;
    color: var(--side-muted, #9aa0a8); opacity: 0.8;
}

/* Handy: größere Häkchen, Eckdaten in 2 Spalten */
@media (max-width: 760px) {
    input[type="checkbox"], input[type="radio"] { width: 28px; height: 28px; }
    .tba-zeile input[type="checkbox"] { width: 24px; height: 24px; }
    .au-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 16px 18px !important; }
}
