/* ==============================================================================
   Gemeinde Ehingen am Ries · Belzheim — Komponenten
   ============================================================================== */

/* ------------------------------------------------------------------ *
 *  Seiten-Einleitung
 * ------------------------------------------------------------------ */

.page-intro { margin-bottom: 28px; max-width: 780px; }

.page-eyebrow {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--c-gold);
    margin-bottom: 6px;
}

.page-title { font-size: 30px; margin-bottom: 10px; }
.page-title-sm { font-size: 24px; margin-bottom: 4px; }

.page-lead { font-size: 16.5px; color: var(--text-muted); }

/* ------------------------------------------------------------------ *
 *  Sprechzeiten-Banner
 * ------------------------------------------------------------------ */

.hours-banner {
    background: linear-gradient(to right, #fff9ec, #fff3dd);
    border: 1px solid #f3e5c4;
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.hours-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 5px; height: 100%;
    background: var(--grad-wappen-v);
}

.hours-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.hour-card {
    background: var(--bg-card);
    border: 1px solid #efe9da;
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    position: relative;
    overflow: hidden;
}

.hour-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--grad-wappen);
}

.hour-day {
    font-weight: 700;
    color: var(--c-primary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.hour-time {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.hour-location {
    font-size: 13px;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 26px 28px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 26px;
}

.card-narrow { max-width: 680px; margin-left: auto; margin-right: auto; }

.card-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--bg-surface);
}

.card-title h3 {
    font-size: 19px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.title-icon { color: var(--c-gold); }

/* ------------------------------------------------------------------ *
 *  Schaltflächen
 * ------------------------------------------------------------------ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14.5px;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
    line-height: 1.3;
}

.btn:disabled { opacity: 0.65; cursor: not-allowed; }

.btn-primary {
    background: linear-gradient(135deg, #cc1e1e 0%, #a31515 100%);
    color: #ffffff;
    box-shadow: 0 2px 5px rgba(163, 21, 21, 0.28);
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, #b91c1c 0%, #8f1313 100%); }

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-main);
    border-color: var(--border-strong);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg-surface); border-color: #b3ab97; }

/* Destruktive Aktionen: Umriss-Stil, gefüllt erst beim Hover (Schutz vor Fehlklicks) */
.btn-danger {
    background: var(--bg-card);
    color: var(--c-primary);
    border-color: var(--c-primary);
}
.btn-danger:hover:not(:disabled) { background: var(--c-primary); color: #ffffff; }

.btn-danger-solid {
    background: var(--c-primary);
    color: #ffffff;
}
.btn-danger-solid:hover:not(:disabled) { background: var(--c-primary-dark); }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* ------------------------------------------------------------------ *
 *  Badges
 * ------------------------------------------------------------------ */

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: middle;
    white-space: nowrap;
}

.badge-free { background: var(--ok-bg); color: var(--ok-text); }
.badge-booked { background: var(--err-bg); color: var(--err-text); }
.badge-canceled { background: var(--neutral-bg); color: var(--neutral-text); }
.badge-neutral { background: var(--neutral-bg); color: var(--neutral-text); }
.badge-pending { background: var(--warn-bg); color: var(--warn-text); }
.badge-info { background: var(--info-bg); color: var(--info-text); }
.badge-role { background: var(--bg-surface-deep); color: var(--text-main); }
.badge-series { background: var(--info-bg); color: var(--info-text); }

/* ------------------------------------------------------------------ *
 *  Termin-Übersicht (öffentlich)
 * ------------------------------------------------------------------ */

.filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-label { font-size: 13.5px; color: var(--text-muted); font-weight: 600; }

.result-count { font-size: 13.5px; color: var(--text-muted); margin-bottom: 14px; }

.day-group { margin-bottom: 26px; }

.day-heading {
    font-family: var(--font-sans);
    font-size: 15.5px;
    font-weight: 700;
    color: var(--c-primary-dark);
    border-bottom: 1px solid var(--border);
    padding-bottom: 7px;
    margin-bottom: 14px;
}

.slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.slot-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.slot-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: var(--grad-wappen-v);
}

.slot-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}

.slot-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }

.slot-time {
    font-size: 18px;
    font-weight: 700;
    color: var(--c-primary);
    margin-bottom: 6px;
}

.slot-meta {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
}

.slot-note {
    font-size: 12.5px;
    color: var(--text-muted);
    background: var(--bg-surface);
    padding: 7px 10px;
    border-radius: var(--radius-sm);
}

.privacy-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 13px;
    color: var(--text-muted);
    max-width: 720px;
    margin: -8px 0 26px;
}
.privacy-note svg { flex: 0 0 auto; margin-top: 2px; color: var(--c-gold); }

/* ------------------------------------------------------------------ *
 *  Leere Zustände
 * ------------------------------------------------------------------ */

.empty-state { text-align: center; padding: 44px 20px; color: var(--text-muted); }
.empty-icon { color: var(--border-strong); margin-bottom: 10px; }
.empty-title { font-size: 16px; font-weight: 700; color: var(--text-main); }
.empty-text { font-size: 13.5px; margin-top: 5px; max-width: 460px; margin-left: auto; margin-right: auto; }

/* ------------------------------------------------------------------ *
 *  Formulare
 * ------------------------------------------------------------------ */

.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--text-main);
}

.req { color: var(--c-primary); }
.optional { font-weight: 400; color: var(--text-muted); font-size: 12.5px; }

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    background: var(--bg-card);
    color: var(--text-main);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(153, 27, 27, 0.14);
}

.form-control-inline { width: auto; padding: 7px 12px; font-size: 13.5px; }

textarea.form-control { min-height: 96px; resize: vertical; }

.form-hint { font-size: 12.5px; color: var(--text-muted); margin-top: 5px; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0 16px;
}
.form-grid-2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 6px; }

.checkbox-label {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400 !important;
    font-size: 13.5px !important;
    line-height: 1.55;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    flex: 0 0 auto;
    width: 17px; height: 17px;
    margin-top: 2px;
    accent-color: var(--c-primary);
    cursor: pointer;
}

.input-with-button { display: flex; gap: 8px; align-items: stretch; }
.input-with-button .form-control { flex: 1; }
.input-with-button .btn { flex: 0 0 auto; }

/* Fehleranzeige */
.input-error { border-color: var(--c-primary) !important; background: #fffafa; }

.field-error {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--err-text);
    font-size: 12.5px;
    font-weight: 600;
    margin-top: 6px;
}

.form-error-box {
    background: var(--err-bg);
    color: var(--err-text);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 14px;
}

/* Passwort-Stärkeanzeige */
.pw-meter { display: flex; align-items: center; gap: 10px; margin-top: 7px; }

.pw-meter-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-surface-deep);
    border-radius: 999px;
    overflow: hidden;
}

.pw-meter-fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: var(--border-strong);
    transition: width 0.2s ease, background 0.2s ease;
}

.pw-meter[data-level="low"] .pw-meter-fill { background: #dc2626; }
.pw-meter[data-level="ok"] .pw-meter-fill { background: var(--c-gold-light); }
.pw-meter[data-level="high"] .pw-meter-fill { background: #16a34a; }

.pw-meter-label { font-size: 12px; color: var(--text-muted); min-width: 86px; text-align: right; }

/* ------------------------------------------------------------------ *
 *  Suchfeld
 * ------------------------------------------------------------------ */

.search-field { display: flex; align-items: center; gap: 8px; }
.search-field svg { color: var(--text-muted); flex: 0 0 auto; }
.search-field .form-control-inline { min-width: 220px; }

/* ------------------------------------------------------------------ *
 *  Tabellen
 * ------------------------------------------------------------------ */

.table-responsive { width: 100%; overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
}

.data-table th, .data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.data-table th {
    background: var(--bg-surface);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.data-table tbody tr:hover { background: #fcfbf7; }

.data-table-compact th, .data-table-compact td { padding: 8px 12px; font-size: 13px; }

.cell-time { color: var(--c-primary); font-weight: 700; }
.cell-wrap { max-width: 300px; }
.cell-nowrap { white-space: nowrap; }
.cell-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.cell-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ref-code {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 1px 7px;
    font-size: 12.5px;
    white-space: nowrap;
}

/* ------------------------------------------------------------------ *
 *  Reiter (Tabs)
 * ------------------------------------------------------------------ */

.tabs-header {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    font-weight: 600;
    font-size: 14px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    color: var(--text-muted);
    white-space: nowrap;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.tab-btn:hover { color: var(--c-primary); }

.tab-btn.active {
    color: var(--c-primary-dark);
    border-bottom-color: var(--c-primary);
}

/* ------------------------------------------------------------------ *
 *  Dashboard
 * ------------------------------------------------------------------ */

.dashboard-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.dashboard-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.lastlogin { font-size: 12.5px; }

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.stat-tile {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.stat-tile::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--grad-wappen);
}

.stat-value {
    font-family: var(--font-serif);
    font-size: 28px;
    font-weight: 700;
    color: var(--c-primary-dark);
    line-height: 1.1;
}

.stat-label { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }

.notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.notice svg { flex: 0 0 auto; }
.notice span { flex: 1; min-width: 200px; }

.notice-warning { background: var(--warn-bg); color: var(--warn-text); border: 1px solid #f3d48a; }
.notice-info { background: var(--info-bg); color: var(--info-text); border: 1px solid #bae0f5; }

.past-details { margin-top: 18px; }

.past-details summary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
    padding: 6px 4px;
    list-style: none;
}
.past-details summary::-webkit-details-marker { display: none; }
.past-details summary:hover { color: var(--c-primary); }
.past-details[open] summary { margin-bottom: 10px; }
.past-details[open] summary svg { transform: rotate(180deg); }

/* ------------------------------------------------------------------ *
 *  Anmeldung / Ersteinrichtung
 * ------------------------------------------------------------------ */

.auth-card { max-width: 460px; margin: 32px auto; padding: 34px 36px; }

.auth-head { text-align: center; margin-bottom: 24px; }
.auth-head h2 { font-size: 22px; margin-bottom: 6px; }
.auth-head .muted { font-size: 14px; }

.auth-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px; height: 54px;
    border-radius: 50%;
    background: var(--bg-surface);
    color: var(--c-primary);
    margin-bottom: 12px;
    border: 1px solid var(--border);
}

.auth-icon-warn { color: var(--warn-text); background: var(--warn-bg); }

.auth-footnote {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 12.5px;
    color: var(--text-muted);
    text-align: center;
}

/* ------------------------------------------------------------------ *
 *  Modal-Dialoge
 * ------------------------------------------------------------------ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(28, 25, 23, 0.55);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    max-width: 560px;
    width: 100%;
    padding: 28px 30px;
    box-shadow: var(--shadow-lg);
    transform: translateY(12px);
    transition: transform 0.18s ease;
    max-height: 92vh;
    overflow-y: auto;
}

.modal-overlay.active .modal-card { transform: translateY(0); }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 20px; }

.close-modal {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: inline-flex;
    padding: 6px;
    border-radius: var(--radius-sm);
}
.close-modal:hover { color: var(--text-main); background: var(--bg-surface); }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 22px;
    flex-wrap: wrap;
}

.modal-actions-column { flex-direction: column; align-items: stretch; }

.slot-summary {
    background: var(--bg-surface);
    border-left: 4px solid var(--c-primary);
    border-radius: var(--radius-sm);
    padding: 13px 16px;
    margin-bottom: 18px;
    font-size: 14px;
}
.slot-summary p { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.slot-summary svg { color: var(--c-gold); flex: 0 0 auto; }

/* Bestätigungs-Varianten */
.modal-confirm { text-align: center; max-width: 480px; }
.modal-confirm h3 { margin-bottom: 8px; font-size: 21px; }

.confirm-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--bg-surface);
    color: var(--c-primary);
    margin-bottom: 14px;
    border: 1px solid var(--border);
}

.confirm-icon-success { background: var(--ok-bg); color: var(--ok-text); border-color: #bbe7c9; }
.confirm-icon-danger { background: var(--err-bg); color: var(--err-text); border-color: #f5c6c6; }

.confirm-message { color: var(--text-muted); font-size: 14.5px; margin-bottom: 16px; }

.booking-ref {
    font-family: 'Cascadia Mono', Consolas, 'Courier New', monospace;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--c-primary-dark);
    background: var(--bg-surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    margin-bottom: 16px;
    display: inline-block;
    user-select: all;
}

.confirm-details { text-align: left; margin-bottom: 14px; }

.detail-list div {
    display: flex;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 14px;
}
.detail-list div:last-child { border-bottom: none; }
.detail-list dt { flex: 0 0 92px; font-weight: 700; color: var(--text-muted); }
.detail-list dd { flex: 1; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ *
 *  Toast-Meldungen
 * ------------------------------------------------------------------ */

.toast-region {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(400px, calc(100vw - 40px));
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left-width: 4px;
    border-radius: var(--radius-sm);
    padding: 13px 14px;
    box-shadow: var(--shadow-md);
    font-size: 14px;
    animation: toast-in 0.22s ease;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.toast-leaving { opacity: 0; transform: translateY(6px); transition: opacity 0.2s ease, transform 0.2s ease; }

.toast-info { border-left-color: var(--info-text); }
.toast-info .toast-icon { color: var(--info-text); }
.toast-success { border-left-color: #16a34a; }
.toast-success .toast-icon { color: #16a34a; }
.toast-error { border-left-color: var(--c-primary); }
.toast-error .toast-icon { color: var(--c-primary); }

.toast-icon { flex: 0 0 auto; margin-top: 1px; }
.toast-msg { flex: 1; }

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 2px;
    display: inline-flex;
    border-radius: 4px;
}
.toast-close:hover { color: var(--text-main); }

.spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ *
 *  Protokolle
 * ------------------------------------------------------------------ */

.protocol-list { display: flex; flex-direction: column; gap: 16px; }

.protocol-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px 22px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    flex-wrap: wrap;
}

.protocol-main { flex: 1; min-width: 280px; }

.protocol-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.protocol-head h4 { font-size: 17px; }

.protocol-meta {
    font-size: 13.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.protocol-topics {
    background: var(--bg-surface);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
}
.protocol-topics ul { margin: 6px 0 0 20px; }
.protocol-topics li { margin-bottom: 3px; }

.protocol-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.protocol-filemeta { font-size: 12px; color: var(--text-muted); }

/* ------------------------------------------------------------------ *
 *  Rechtstexte
 * ------------------------------------------------------------------ */

.legal-text { max-width: 860px; }
.legal-text h3 { font-size: 17.5px; margin: 22px 0 8px; }
.legal-text h3:first-child { margin-top: 0; }
.legal-text p { margin-bottom: 10px; }
.legal-text ul { margin: 0 0 12px 22px; }
.legal-text li { margin-bottom: 5px; }

.todo-mark {
    background: var(--warn-bg);
    color: var(--warn-text);
    padding: 1px 7px;
    border-radius: 4px;
    font-size: 0.92em;
    font-weight: 600;
}

.legal-stand {
    margin-top: 24px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
}

/* ------------------------------------------------------------------ *
 *  Aktuelles aus der Gemeinde — öffentliche Beiträge
 * ------------------------------------------------------------------ */

.news-list { display: flex; flex-direction: column; gap: 22px; max-width: 860px; }

.news-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.news-card-important { border-color: #f0b4b4; }
.news-card-important .news-body { border-left: 4px solid var(--c-primary); }

.news-card-highlight { box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.45); transition: box-shadow 0.4s ease; }

.news-images { display: grid; gap: 3px; background: var(--bg-surface-deep); }
.news-images-1 { grid-template-columns: 1fr; }
.news-images-2 { grid-template-columns: 1fr 1fr; }
.news-images-3 { grid-template-columns: 1fr 1fr 1fr; }

.news-image-btn {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: zoom-in;
    line-height: 0;
}

.news-images-1 .news-image-btn img {
    width: 100%;
    max-height: 440px;
    object-fit: cover;
}

.news-images-2 .news-image-btn img,
.news-images-3 .news-image-btn img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-body { padding: 22px 26px; }

.news-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.news-date { font-size: 13px; color: var(--text-muted); }

.news-title { font-size: 21px; margin-bottom: 10px; }

.news-text {
    white-space: pre-line;
    overflow-wrap: anywhere;
    font-size: 15px;
    margin-bottom: 12px;
}

.news-event-info {
    background: linear-gradient(to right, #fff9ec, #fff4e0);
    border: 1px solid #f3e5c4;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 14px;
    font-size: 14.5px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}
.news-event-info p { display: flex; align-items: center; gap: 8px; }
.news-event-info svg { color: var(--c-gold); flex: 0 0 auto; }

.news-author {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--text-muted);
    border-top: 1px solid var(--bg-surface);
    padding-top: 10px;
}

/* Kasten „Anstehende Veranstaltungen" */
.events-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    margin-bottom: 24px;
    max-width: 860px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.events-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 5px; height: 100%;
    background: var(--grad-wappen-v);
}

.events-box h3 {
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 10px;
}

.events-list { list-style: none; }

.events-list li {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    padding: 7px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 14px;
}
.events-list li:last-child { border-bottom: none; }

.event-date { font-weight: 700; color: var(--c-primary-dark); white-space: nowrap; }

.event-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-weight: 600;
    color: var(--c-primary);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.event-link:hover { color: var(--c-primary-dark); }

.event-loc { font-size: 12.5px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px; }

/* Lightbox */
.lightbox-card {
    position: relative;
    max-width: min(960px, 94vw);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.lightbox-card img {
    max-width: 100%;
    max-height: 82vh;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    background: #ffffff;
}

.lightbox-close {
    position: absolute;
    top: -14px; right: -14px;
    z-index: 2;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 40px; height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main);
    box-shadow: var(--shadow-md);
}

.lightbox-caption { color: #f5f5f4; font-size: 14px; text-align: center; }

.spinner-dark {
    border-color: rgba(28, 25, 23, 0.2);
    border-top-color: var(--c-primary);
    width: 22px; height: 22px;
    display: inline-block;
    margin-bottom: 8px;
}

/* ------------------------------------------------------------------ *
 *  Aktuelles — Verwaltung (Beiträge pflegen)
 * ------------------------------------------------------------------ */

.event-fields {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px 4px;
    margin-bottom: 18px;
}

.event-fields .form-hint { display: flex; align-items: center; gap: 6px; }

.image-preview-strip {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
    align-items: center;
}

.image-preview-item {
    position: relative;
    width: 108px; height: 82px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-strong);
}

.image-preview-item img { width: 100%; height: 100%; object-fit: cover; }

.image-preview-remove {
    position: absolute;
    top: 4px; right: 4px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    width: 24px; height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main);
}
.image-preview-remove:hover { background: #ffffff; color: var(--c-primary); }

.image-preview-busy {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.news-import-label { position: relative; overflow: hidden; }

.howto-list { margin: 8px 0 12px 22px; font-size: 14px; }
.howto-list li { margin-bottom: 7px; }

.news-admin-list { display: flex; flex-direction: column; }

.news-admin-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.news-admin-row:last-child { border-bottom: none; }

.news-admin-thumb {
    width: 62px; height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--border);
    flex: 0 0 auto;
}

.news-admin-thumb-empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    color: var(--text-muted);
}

.news-admin-main {
    flex: 1;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.news-admin-main .muted { font-size: 12.5px; }

/* ------------------------------------------------------------------ *
 *  Berechtigungen (Konten & Rechte)
 * ------------------------------------------------------------------ */

.permission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 4px 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}

.permission-item { padding: 5px 0; }

.permission-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}

.permission-chip {
    display: inline-block;
    background: var(--bg-surface-deep);
    color: var(--text-muted);
    border-radius: 4px;
    padding: 1px 7px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

/* ------------------------------------------------------------------ *
 *  Bereichsschalter (Seite aktivieren / deaktivieren)
 * ------------------------------------------------------------------ */

.module-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-left: 5px solid var(--neutral-text);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
}

.module-toggle-on { border-left-color: var(--ok-text); background: #f4fbf6; }

.module-toggle-text { flex: 1; min-width: 260px; }

.module-toggle-state {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    margin-bottom: 4px;
}
.module-toggle .module-toggle-state svg { color: var(--neutral-text); }
.module-toggle-on .module-toggle-state svg { color: var(--ok-text); }

.file-info { margin-top: 8px; }

.file-chosen {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13.5px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
}
.file-chosen svg { color: var(--ok-text); flex: 0 0 auto; }

/* ------------------------------------------------------------------ *
 *  Einmalcodes (TOTP)
 * ------------------------------------------------------------------ */

.otp-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.otp-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.otp-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: var(--grad-wappen-v);
}

.otp-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.otp-label { font-weight: 700; font-size: 15px; }
.otp-account { font-size: 12.5px; color: var(--text-muted); overflow-wrap: anywhere; }

.otp-code {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.otp-code:hover { background: var(--bg-surface-deep); border-color: var(--c-primary); }

.otp-digits {
    font-family: 'Cascadia Mono', Consolas, 'Courier New', monospace;
    font-size: 27px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--c-primary-dark);
    line-height: 1.1;
}

.otp-copy-icon { color: var(--text-muted); flex: 0 0 auto; }
.otp-code:hover .otp-copy-icon { color: var(--c-primary); }

.otp-timer { display: flex; align-items: center; gap: 10px; }

.otp-timer-bar {
    flex: 1;
    height: 5px;
    background: var(--bg-surface-deep);
    border-radius: 999px;
    overflow: hidden;
}

.otp-timer-fill {
    display: block;
    height: 100%;
    width: 100%;
    border-radius: 999px;
    background: var(--c-gold);
    transition: width 0.9s linear, background 0.3s ease;
}

.otp-seconds {
    font-size: 12.5px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    min-width: 32px;
    text-align: right;
}

.otp-card-expiring .otp-timer-fill { background: var(--c-primary); }
.otp-card-expiring .otp-digits { color: var(--c-primary); }

/* ------------------------------------------------------------------ *
 *  Mobile Feinschliff
 * ------------------------------------------------------------------ */

@media (max-width: 600px) {
    .card { padding: 20px 18px; }
    .page-title { font-size: 25px; }
    .modal-card { padding: 22px 18px; }
    .form-actions { justify-content: stretch; }
    .form-actions .btn { width: 100%; }
    .dashboard-actions { width: 100%; }
    .cell-wrap { max-width: 200px; }
}
