/**
 * Zeitleiste - Admin Stylesheet
 * 
 * Zentrale Styles für alle Backend-Seiten:
 * - login.php
 * - 2fa-setup.php
 * - setup.php
 * - event_editor.php
 * - public.php (öffentliche Ansicht)
 * - preview.php (Admin-Vorschau)
 * - index.php (User-Header)
 */

/* Hinzugefügt KOW */
a.btn-primary {
    color: white;
}

/* ===========================================
   1. CSS-VARIABLEN
   =========================================== */
:root {
    /* Primäre Farben */
    --admin-primary: #0077bb;
    --admin-primary-dark: #005588;
    --admin-danger: #c43c3c;
    --admin-success: #2b7a3d;
    --admin-warning: #ff9800;
    --admin-info: #0077bb;
    
    /* Hintergrund-Farben */
    --admin-bg: #1a1a2e;
    --admin-bg-card: #16213e;
    --admin-bg-input: #1e2a47;
    --admin-bg-hover: rgba(255,255,255,0.05);
    
    /* Text-Farben */
    --admin-text: #e0e0e0;
    --admin-text-muted: #888;
    --admin-text-white: #fff;
    
    /* Rahmen */
    --admin-border: #333;
    --admin-border-light: rgba(255,255,255,0.1);
    
    /* === ALIASE für Rückwärtskompatibilität === */
    --primary: #0077bb;
    --primary-dark: #005588;
    --danger: #c43c3c;
    --success: #2b7a3d;
    --warning: #ff9800;
    --bg: #1a1a2e;
    --bg-card: #16213e;
    --bg-input: #1e2a47;
    --text: #e0e0e0;
    --text-muted: #888;
    --border: #333;
}

/* ===========================================
   2. RESET & BASIS
   =========================================== */
.admin-page * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.admin-page {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--admin-bg);
    color: var(--admin-text);
    min-height: 100vh;
    line-height: 1.5;
}

.admin-page a {
    color: var(--admin-primary);
    text-decoration: none;
}

.admin-page a:hover {
    text-decoration: underline;
}

/* ===========================================
   3. LAYOUT-CONTAINER
   =========================================== */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.admin-container--narrow {
    max-width: 600px;
}

.admin-container--medium {
    max-width: 900px;
}

/* Zentrierter Container (für Login etc.) */
.admin-centered {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ===========================================
   4. HEADER
   =========================================== */
.admin-header {
    background: var(--admin-bg-card);
    border-bottom: 1px solid var(--admin-border);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-header h1 {
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--admin-text-white);
}

.admin-header-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-header-nav a,
.admin-header-nav span {
    color: var(--admin-text-muted);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.admin-header-nav a:hover {
    background: var(--admin-bg-hover);
    color: var(--admin-text);
    text-decoration: none;
}

/* ===========================================
   5. USER-HEADER (für index.php)
   =========================================== */
.user-header {
    position: fixed;
    top: 8px;
    right: 16px;
    z-index: 110;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
}

.user-header__info {
    color: rgba(255,255,255,0.7);
}

.user-header__info strong {
    color: #fff;
}

.user-header__link {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(255,255,255,0.1);
    transition: all 0.2s;
}

.user-header__link:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
    text-decoration: none;
}

.user-header__link--primary {
    background: rgba(0, 119, 187, 0.6);
}

/* ===========================================
   6. KARTEN
   =========================================== */
.admin-card {
    background: var(--admin-bg-card);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--admin-border-light);
}

.admin-card h2 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--admin-border-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-card h3 {
    font-size: 1rem;
    margin: 20px 0 12px;
    color: var(--admin-text-muted);
}

/* Login-spezifische Karte */
.login-card {
    background: var(--admin-bg-card);
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-header h1 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: var(--admin-text-white);
}

.login-header p {
    color: var(--admin-text-muted);
    font-size: 0.9rem;
}

.login-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--admin-border);
    text-align: center;
}

.login-footer a {
    color: var(--admin-primary);
    font-size: 0.9rem;
}

/* ===========================================
   7. TABS
   =========================================== */
.admin-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.admin-tab {
    padding: 10px 20px;
    background: var(--admin-bg-card);
    border: 1px solid var(--admin-border);
    border-radius: 8px 8px 0 0;
    color: var(--admin-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
    cursor: pointer;
}

.admin-tab:hover {
    background: var(--admin-bg-hover);
    color: var(--admin-text);
    text-decoration: none;
}

.admin-tab.active {
    background: var(--admin-primary);
    border-color: var(--admin-primary);
    color: #fff;
}

/* Editor-Tabs (kleiner) */
.editor-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.editor-tab {
    padding: 8px 16px;
    background: rgba(255,255,255,0.05);
    border: none;
    border-radius: 6px 6px 0 0;
    color: var(--admin-text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.editor-tab.active {
    background: var(--admin-bg-input);
    color: #fff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ===========================================
   8. FORMULARE
   =========================================== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--admin-text-muted);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--admin-bg-input);
    border: 1px solid var(--admin-border-light);
    border-radius: 6px;
    color: var(--admin-text);
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--admin-primary);
}

.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Checkbox-Label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    cursor: pointer;
}

.checkbox-label input {
    width: auto;
    margin: 0;
}

/* TOTP-Eingabe (groß, zentriert) */
.totp-input {
    text-align: center;
    font-size: 1.5rem;
    font-family: "Courier New", monospace;
    letter-spacing: 0.5em;
    padding: 16px !important;
}

/* ===========================================
   9. BUTTONS
   =========================================== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    color: #fff;
    transition: all 0.2s;
}

.btn:hover {
    opacity: 0.9;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

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

.btn-primary { background: var(--admin-primary); }
.btn-primary:hover { background: var(--admin-primary-dark); }

.btn-success { background: var(--admin-success); }
.btn-danger { background: var(--admin-danger); }
.btn-warning { background: var(--admin-warning); color: #000; }

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: var(--admin-text);
    border: 1px solid var(--admin-border);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.15);
}

.btn-small {
    padding: 4px 10px;
    font-size: 0.75rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ===========================================
   10. ALERTS & MESSAGES
   =========================================== */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert--error {
    background: rgba(196, 60, 60, 0.2);
    border: 1px solid var(--admin-danger);
    color: #ff8a8a;
}

.alert--success {
    background: rgba(43, 122, 61, 0.2);
    border: 1px solid var(--admin-success);
    color: #6dda82;
}

.alert--warning {
    background: rgba(255, 152, 0, 0.2);
    border: 1px solid var(--admin-warning);
    color: #ffb74d;
}

.alert--info {
    background: rgba(0, 119, 187, 0.1);
    border: 1px solid var(--admin-primary);
    color: var(--admin-text-muted);
}

/* Flash-Messages (für index.php) */
.flash-message {
    position: fixed;
    top: 95px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 120;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.85rem;
    animation: flashFade 4s ease-out forwards;
}

.flash-message--success {
    background: rgba(43, 122, 61, 0.9);
    color: #fff;
}

.flash-message--error {
    background: rgba(196, 60, 60, 0.9);
    color: #fff;
}

.flash-message--info {
    background: rgba(0, 119, 187, 0.9);
    color: #fff;
}

@keyframes flashFade {
    0%, 80% { opacity: 1; }
    100% { opacity: 0; pointer-events: none; }
}

/* Lockout-Warnung */
.lockout-warning {
    background: rgba(255, 152, 0, 0.2);
    border: 1px solid #ff9800;
    color: #ffb74d;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* DB-Fehler */
.db-error {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(196, 60, 60, 0.9);
    color: #fff;
    padding: 24px 32px;
    border-radius: 12px;
    text-align: center;
    z-index: 200;
}

.db-error h2 {
    margin-bottom: 12px;
}

.db-error a {
    color: #fff;
    text-decoration: underline;
}

/* ===========================================
   11. TABELLEN
   =========================================== */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.admin-table th,
.admin-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--admin-border-light);
}

.admin-table th {
    color: var(--admin-text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table tr:hover {
    background: rgba(255,255,255,0.02);
}

.admin-table .deleted-row {
    opacity: 0.5;
}

/* Scrollbarer Container für Tabellen */
.table-scroll {
    max-height: 400px;
    overflow-y: auto;
}

/* ===========================================
   12. BADGES & STATUS
   =========================================== */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge--category {
    /* Wird per Kategorie-Farbe gestylt */
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge--active {
    background: rgba(43, 122, 61, 0.2);
    color: #6dda82;
}

.status-badge--inactive {
    background: rgba(136, 136, 136, 0.2);
    color: #aaa;
}

.status-badge--enforced {
    background: rgba(255, 152, 0, 0.2);
    color: #ffb74d;
}

/* Action-Badges (für History) */
.action-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.action-badge--insert,
.action-INSERT {
    background: rgba(43, 122, 61, 0.3);
    color: #7ee787;
}

.action-badge--update,
.action-UPDATE {
    background: rgba(232, 106, 52, 0.3);
    color: #ffa657;
}

.action-badge--delete,
.action-DELETE {
    background: rgba(196, 60, 60, 0.3);
    color: #ff7b72;
}

.action-badge--restore,
.action-RESTORE {
    background: rgba(0, 119, 187, 0.3);
    color: #79c0ff;
}

/* ===========================================
   13. SQL-VORSCHAU
   =========================================== */
.sql-preview {
    background: #0d1117;
    padding: 12px;
    border-radius: 6px;
    font-family: Monaco, Menlo, "Courier New", monospace;
    font-size: 0.8rem;
    color: #7ee787;
    white-space: pre-wrap;
    min-height: 60px;
    border: 1px solid var(--admin-border-light);
    overflow-x: auto;
}

.sql-input {
    font-family: Monaco, Menlo, "Courier New", monospace;
    min-height: 100px;
}

/* ===========================================
   14. INFO-BOXEN
   =========================================== */
.info-box {
    background: rgba(0, 119, 187, 0.15);
    border: 1px solid var(--admin-primary);
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.85rem;
}

.info-box code {
    background: rgba(255,255,255,0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.info-box ul {
    margin: 12px 0 0 20px;
    color: var(--admin-text-muted);
}

.info-box li {
    margin-bottom: 6px;
}

/* ===========================================
   15. QR-CODE & 2FA
   =========================================== */
.qr-section {
    text-align: center;
    margin: 20px 0;
}

.qr-code {
    display: inline-block;
    background: #fff;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.qr-code img {
    display: block;
    width: 200px;
    height: 200px;
}

.secret-display {
    background: rgba(0,0,0,0.3);
    padding: 12px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 1rem;
    letter-spacing: 2px;
    margin-top: 12px;
    word-break: break-all;
}

/* TOTP-Info */
.totp-info {
    background: rgba(0,119,187,0.1);
    border: 1px solid var(--admin-primary);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: var(--admin-text-muted);
}

.totp-info strong {
    color: var(--admin-text);
}

/* Steps */
.steps {
    margin: 20px 0;
}

.step {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.step-number {
    flex: 0 0 28px;
    height: 28px;
    background: var(--admin-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
}

.step-content {
    flex: 1;
}

.step-content h4 {
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.step-content p {
    font-size: 0.85rem;
    color: var(--admin-text-muted);
}

/* Step-Indikator (Login) */
.step-indicator {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--admin-border);
}

.step-dot.active {
    background: var(--admin-primary);
}

/* ===========================================
   16. PREVIEW-HEADER
   =========================================== */
.preview-header {
    position: fixed;
    top: 8px;
    right: 16px;
    z-index: 110;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
}

.preview-header__info {
    background: rgba(255, 152, 0, 0.3);
    padding: 6px 14px;
    border-radius: 16px;
    color: #fff;
}

.preview-header__link {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(255,255,255,0.1);
    transition: all 0.2s;
}

.preview-header__link:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
    text-decoration: none;
}

.preview-badge {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 110;
    background: rgba(255, 152, 0, 0.9);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.8rem;
    color: #fff;
}

.preview-badge strong {
    color: #fff;
}

/* ===========================================
   17. PUBLIC TIMELINE HEADER
   =========================================== */
.public-header {
    position: fixed;
    top: 8px;
    right: 16px;
    z-index: 110;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
}

.public-header__info {
    background: rgba(0, 119, 187, 0.3);
    padding: 6px 14px;
    border-radius: 16px;
    color: #fff;
}

.public-header__link {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(255,255,255,0.1);
    transition: all 0.2s;
}

.public-header__link:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
    text-decoration: none;
}

/* ===========================================
   18. GRID-LAYOUTS
   =========================================== */
.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 1024px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

/* ===========================================
   19. STATS
   =========================================== */
.stats-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-card {
    background: var(--admin-bg-card);
    padding: 12px 20px;
    border-radius: 8px;
    min-width: 120px;
    border: 1px solid var(--admin-border-light);
}

.stat-card .number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--admin-primary);
}

.stat-card .label {
    font-size: 0.75rem;
    color: var(--admin-text-muted);
}

/* ===========================================
   20. HISTORY ITEMS
   =========================================== */
.history-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--admin-border-light);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
}

.history-item .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.json-preview {
    background: rgba(0,0,0,0.3);
    padding: 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.7rem;
    max-height: 100px;
    overflow-y: auto;
    white-space: pre-wrap;
    color: var(--admin-text-muted);
}

/* ===========================================
   21. SUCHE & FILTER
   =========================================== */
.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box input {
    margin-bottom: 0;
    max-width: 300px;
}

.search-box .btn {
    padding: 10px 16px;
}

.result-count {
    color: var(--admin-text-muted);
    font-size: 0.85rem;
}

.filter-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.filter-row > div {
    min-width: 140px;
}

.filter-row input,
.filter-row select {
    margin-bottom: 0;
}

/* ===========================================
   22. DB-SELECTOR
   =========================================== */
.db-selector {
    background: var(--admin-bg-input);
    border: 1px solid var(--admin-border-light);
    padding: 6px 12px;
    border-radius: 6px;
    color: var(--admin-text);
    font-size: 0.85rem;
    max-width: 300px;
}

.db-selector-banner {
    background: rgba(0,119,187,0.2);
    border-bottom: 1px solid var(--admin-primary);
    padding: 8px 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ===========================================
   23. TYPEN-INDIKATOR
   =========================================== */
.type-indicator {
    font-size: 0.85rem;
    color: var(--admin-text-muted);
}

/* ===========================================
   24. ERROR PAGE
   =========================================== */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.error-box {
    background: var(--admin-bg-card);
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
}

.error-box h1 {
    color: #ff8a8a;
    margin-bottom: 16px;
}

.error-box p {
    color: var(--admin-text-muted);
    margin-bottom: 24px;
}

/* ===========================================
   25. RESPONSIVE
   =========================================== */
@media (max-width: 768px) {
    .admin-header {
        padding: 12px 16px;
    }
    
    .admin-header h1 {
        font-size: 1.1rem;
    }
    
    .admin-container {
        padding: 12px;
    }
    
    .admin-card {
        padding: 16px;
    }
    
    .login-card {
        padding: 24px;
    }
    
    .stats-row {
        gap: 8px;
    }
    
    .stat-card {
        padding: 8px 12px;
        min-width: 80px;
    }
    
    .stat-card .number {
        font-size: 1.4rem;
    }
    
    .user-header {
        font-size: 0.7rem;
        gap: 8px;
    }
}

/* ===========================================
   26. UTILITIES
   =========================================== */
.text-muted { color: var(--admin-text-muted); }
.text-success { color: #6dda82; }
.text-danger { color: #ff8a8a; }
.text-warning { color: #ffb74d; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.text-center { text-align: center; }
.text-right { text-align: right; }

hr {
    border: none;
    border-top: 1px solid var(--admin-border);
    margin: 24px 0;
}

/* ===========================================
   27. EVENT-EDITOR SPECIFIC STYLES
   =========================================== */

/* Navigation */
.nav {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.nav a {
    padding: 10px 20px;
    background: var(--admin-bg-card);
    border: 1px solid var(--admin-border);
    border-radius: 8px 8px 0 0;
    color: var(--admin-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.nav a:hover {
    background: var(--admin-bg-hover);
    color: var(--admin-text);
}

.nav a.active {
    background: var(--admin-primary);
    border-color: var(--admin-primary);
    color: #fff;
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 1200px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

/* Panel */
.panel {
    background: var(--admin-bg-card);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--admin-border-light);
}

.panel h2 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--admin-border-light);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.tab {
    padding: 8px 16px;
    background: rgba(255,255,255,0.05);
    border: none;
    border-radius: 6px 6px 0 0;
    color: var(--admin-text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.tab:hover {
    background: rgba(255,255,255,0.1);
}

.tab.active {
    background: var(--admin-bg-input);
    color: #fff;
}

/* Flash Messages */
.flash {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.flash--success {
    background: rgba(43, 122, 61, 0.2);
    border: 1px solid var(--admin-success);
    color: #6dda82;
}

.flash--error {
    background: rgba(196, 60, 60, 0.2);
    border: 1px solid var(--admin-danger);
    color: #ff8a8a;
}

/* Scrollable Container */
.scrollable {
    max-height: 400px;
    overflow-y: auto;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Stats Row */
.stats {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Role Badges */
.role-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 8px;
}

.role-super_admin {
    background: rgba(156, 39, 176, 0.3);
    color: #ce93d8;
}

.role-class_admin {
    background: rgba(0, 119, 187, 0.3);
    color: #79c0ff;
}

/* Sort Header */
.sort-header {
    cursor: pointer;
    white-space: nowrap;
}

.sort-header:hover {
    color: var(--admin-primary);
}

/* Login-spezifisch */
.login-container {
    width: 100%;
    max-width: 400px;
}

/* Event-Editor spezifisch */
.form-row > div {
    flex: 1;
    min-width: 200px;
}

.form-row label {
    display: block;
    font-size: 0.85rem;
    color: var(--admin-text-muted);
    margin-bottom: 6px;
}

.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--admin-bg-input);
    border: 1px solid var(--admin-border-light);
    border-radius: 6px;
    color: var(--admin-text);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: var(--admin-primary);
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--admin-border-light);
}

th {
    color: var(--admin-text-muted);
    font-weight: 600;
    font-size: 0.8rem;
}

tr:hover {
    background: rgba(255,255,255,0.02);
}

/* Category Badge */
.cat-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 16px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    text-decoration: none;
}

.pagination a {
    background: var(--admin-bg-input);
    color: var(--admin-text);
}

.pagination a:hover {
    background: var(--admin-primary);
    color: #fff;
}

.pagination span.current {
    background: var(--admin-primary);
    color: #fff;
}

/* History Items */
.history-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--admin-border-light);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
}

.history-item .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

/* Deleted Row */
.deleted-row {
    opacity: 0.5;
}

/* ===========================================
   28. MODALS
   =========================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--admin-bg-card);
    border-radius: 12px;
    padding: 24px;
    max-width: 450px;
    width: 100%;
    border: 1px solid var(--admin-border-light);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.modal-content h3 {
    font-size: 1.2rem;
    margin-bottom: 16px;
    color: var(--admin-text-white);
}

.modal-content .form-group {
    margin-bottom: 16px;
}

.modal-content .checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
}

.modal-content .checkbox-group input[type="checkbox"] {
    width: auto;
}

.modal-content .checkbox-group label {
    margin: 0;
    color: var(--admin-text);
}

/* ===========================================
   29. FILTER-ROW LABELS FIX
   =========================================== */
.filter-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 16px;
    background: var(--admin-bg-card);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--admin-border-light);
}

.filter-row > div,
.filter-row .filter-group {
    min-width: 120px;
}

.filter-row label {
    display: block;
    font-size: 0.8rem;
    color: var(--admin-text-muted);
    margin-bottom: 6px;
}

.filter-row input,
.filter-row select {
    width: 100%;
    padding: 8px 10px;
    background: var(--admin-bg-input);
    border: 1px solid var(--admin-border-light);
    border-radius: 6px;
    color: var(--admin-text);
    font-size: 0.85rem;
}

.filter-row input:focus,
.filter-row select:focus {
    outline: none;
    border-color: var(--admin-primary);
}

.filter-row .btn {
    margin-bottom: 0;
}

/* ===========================================
   30. TABLE INPUT STYLES
   =========================================== */
table input[type="text"],
table input[type="color"],
table select {
    background: var(--admin-bg-input);
    border: 1px solid var(--admin-border-light);
    border-radius: 4px;
    color: var(--admin-text);
    font-size: 0.85rem;
}

table input[type="text"]:focus,
table select:focus {
    outline: none;
    border-color: var(--admin-primary);
}

table code {
    background: rgba(255,255,255,0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* ===========================================
   31. STANDALONE FORM FIELDS
   =========================================== */
/* For labels/inputs not in .form-row */
.panel > label,
.admin-card > label,
.tab-content > form > label {
    display: block;
    font-size: 0.85rem;
    color: var(--admin-text-muted);
    margin-bottom: 6px;
    margin-top: 12px;
}

.panel > label:first-of-type,
.admin-card > label:first-of-type {
    margin-top: 0;
}

.panel > input,
.panel > textarea,
.panel > select,
.admin-card > input,
.admin-card > textarea,
.admin-card > select,
.tab-content > form > input,
.tab-content > form > textarea,
.tab-content > form > select {
    width: 100%;
    padding: 10px 12px;
    background: var(--admin-bg-input);
    border: 1px solid var(--admin-border-light);
    border-radius: 6px;
    color: var(--admin-text);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.panel > input:focus,
.panel > textarea:focus,
.panel > select:focus,
.admin-card > input:focus,
.admin-card > textarea:focus,
.admin-card > select:focus,
.tab-content > form > input:focus,
.tab-content > form > textarea:focus,
.tab-content > form > select:focus {
    outline: none;
    border-color: var(--admin-primary);
}

.panel > textarea,
.admin-card > textarea,
.tab-content > form > textarea {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

/* Form fields in #tab-form specifically */
#tab-form form > label {
    display: block;
    font-size: 0.85rem;
    color: var(--admin-text-muted);
    margin-bottom: 6px;
    margin-top: 12px;
}

#tab-form form > input,
#tab-form form > textarea,
#tab-form form > select {
    width: 100%;
    padding: 10px 12px;
    background: var(--admin-bg-input);
    border: 1px solid var(--admin-border-light);
    border-radius: 6px;
    color: var(--admin-text);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

#tab-form form > input:focus,
#tab-form form > textarea:focus,
#tab-form form > select:focus {
    outline: none;
    border-color: var(--admin-primary);
}

#tab-form form > textarea {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

/* ===========================================
   32. CATEGORY BADGE FIX
   =========================================== */
.category-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #fff;
}

/* ===========================================
   33. FORM-GROUP UNIVERSAL STYLES
   =========================================== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--admin-text-muted);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--admin-bg-input);
    border: 1px solid var(--admin-border-light);
    border-radius: 6px;
    color: var(--admin-text);
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--admin-primary);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

/* ===========================================
   34. FILTER-GROUP (für Änderungsverlauf)
   =========================================== */
.filter-group {
    min-width: 120px;
}

.filter-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--admin-text-muted);
    margin-bottom: 6px;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 8px 10px;
    background: var(--admin-bg-input);
    border: 1px solid var(--admin-border-light);
    border-radius: 6px;
    color: var(--admin-text);
    font-size: 0.85rem;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--admin-primary);
}

/* ===========================================
   35. CHECKBOX-GROUP (für Modals)
   =========================================== */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
}

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

.checkbox-group label {
    margin: 0;
    color: var(--admin-text);
    font-size: 0.9rem;
}


/* Event-Titel Links */
.event-title-link {
    color: inherit;
    text-decoration: none;
}

.event-title-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}
