/* =============================================================================
   Portal : St. Vitus Apotheke – Stylesheet v2.0
   Design: Bold & Modern (Teal/Cyan Gradient Accents, Dark Sidebar)
   Fonts:  Outfit (Display) + DM Sans (Body)
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=DM+Sans:ital,wght@0,400;0,500;0,600;1,400&display=swap');

/* =============================================================================
   DESIGN TOKENS
   ============================================================================= */
:root {
    /* --- Typografie --- */
    --font-display: 'Outfit', system-ui, sans-serif;
    --font-body: 'DM Sans', system-ui, sans-serif;

    /* --- Sidebar (dunkel) --- */
    --dark-950: #0a0c10;
    --dark-900: #0f1117;
    --dark-800: #161921;
    --dark-700: #1e222d;
    --dark-600: #282d3a;
    --dark-500: #3d4355;
    --dark-400: #5a6178;
    --dark-300: #8890a4;

    /* --- Content (hell) --- */
    --surface-0: #f8f9fc;
    --surface-1: #ffffff;
    --surface-2: #f1f3f8;
    --surface-3: #e4e8f1;

    /* --- Text --- */
    --text: #111827;
    --text-muted: #6b7280;
    --text-tertiary: #9ca3af;
    --text-inverse: #f1f3f8;

    /* --- Akzent (Teal/Cyan-Gradient) --- */
    --accent-start: #10b981;
    --accent-end: #06b6d4;
    --accent: #0ea5e9;
    --accent-hover: #0284c7;
    --accent-glow: rgba(14, 165, 233, 0.15);
    --accent-glow-strong: rgba(14, 165, 233, 0.25);

    /* --- Semantische Farben --- */
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.12);
    --warn: #f59e0b;
    --warn-bg: rgba(245, 158, 11, 0.12);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --info-bg: var(--accent-glow);

    /* --- Oberflächen (Kompatibilitäts-Aliase) --- */
    --bg: var(--surface-0);
    --bg-card: var(--surface-1);
    --bg-dark: var(--dark-900);

    /* --- Borders --- */
    --border: rgba(0,0,0,0.08);
    --border-subtle: rgba(0,0,0,0.06);
    --border-dark: rgba(255,255,255,0.06);
    --border-dark-hover: rgba(255,255,255,0.12);

    /* --- Radii --- */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* --- Shadows --- */
    --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04);
    --shadow-lg: 0 2px 4px rgba(0,0,0,0.04), 0 12px 40px rgba(0,0,0,0.08);

    /* --- Layout --- */
    --sidebar-width: 260px;

    /* --- Animation --- */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    /* --- Altlasten-Kompatibilität (wird von einigen Templates genutzt) --- */
    --ci-green: #10b981;
    --ci-red: #ef4444;
}

/* =============================================================================
   RESET & BASE
   ============================================================================= */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text);
    line-height: 1.6;
    background: var(--surface-0);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-variant-numeric: tabular-nums;
    min-height: 100vh;
}

/* =============================================================================
   APP LAYOUT (Sidebar + Main)
   ============================================================================= */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* =============================================================================
   SIDEBAR
   ============================================================================= */
.sidebar {
    width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    z-index: 50;
    overflow-x: hidden;
    overflow-y: auto;
    /* Dunkler Hintergrund mit subtilerm Akzent-Schimmer */
    background:
        linear-gradient(180deg, rgba(14, 165, 233, 0.03) 0%, transparent 40%),
        var(--dark-900);
}

/* --- Brand/Logo --- */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 4px 8px;
    margin-bottom: 32px;
    text-decoration: none;
    color: inherit;
}

.sidebar-brand img {
    width: 40px;
    height: 40px;
    max-width: 40px;
    max-height: 40px;
    min-width: 40px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.sidebar-brand-name {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--text-inverse);
    letter-spacing: -0.02em;
}

.sidebar-brand-sub {
    font-size: 12px;
    color: var(--dark-300);
    letter-spacing: 0.04em;
}

/* --- Nav-Sektionen --- */
.sidebar-section { margin-top: 28px; }
.sidebar-section:first-of-type { margin-top: 0; }

.sidebar-section-label {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 700;
    color: var(--dark-400);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0 12px;
    margin-bottom: 8px;
}

/* --- Nav-Items --- */
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--dark-300);
    cursor: pointer;
    transition: all 200ms var(--ease-out-expo);
    text-decoration: none;
    position: relative;
    margin-bottom: 2px;
}

.sidebar-item svg {
    width: 18px;
    height: 18px;
    opacity: 0.5;
    transition: opacity 200ms ease;
    flex-shrink: 0;
}

.sidebar-item:hover {
    color: var(--text-inverse);
    background: var(--dark-700);
}

.sidebar-item:hover svg { opacity: 0.8; }

/* Aktiver Nav-Item mit Gradient-Hintergrund und Akzent-Leiste */
.sidebar-item.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(16, 185, 129, 0.08));
    border: 1px solid rgba(14, 165, 233, 0.15);
    margin-left: -1px;
    margin-right: -1px;
}

.sidebar-item.active svg { opacity: 1; color: var(--accent); }

.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, var(--accent-start), var(--accent-end));
}

/* Geplante/deaktivierte Items */
.sidebar-item.disabled {
    opacity: 0.25;
    pointer-events: none;
}

.sidebar-badge {
    margin-left: auto;
    font-size: 10px;
    color: var(--dark-400);
    font-style: italic;
}

/* --- Sidebar-Spacer (schiebt User-Block nach unten) --- */
.sidebar-spacer { flex: 1; }

/* --- User-Block (unten in der Sidebar) --- */
.sidebar-user {
    border-top: 1px solid var(--border-dark);
    padding-top: 20px;
    margin-top: 20px;
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-inverse);
}

.sidebar-user-role {
    font-size: 11px;
    color: var(--dark-400);
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--dark-400);
    cursor: pointer;
    transition: all 150ms ease;
    text-decoration: none;
}

.sidebar-logout:hover {
    color: var(--dark-300);
    background: var(--dark-800);
}

.sidebar-logout svg { width: 14px; height: 14px; }

/* =============================================================================
   MAIN CONTENT AREA
   ============================================================================= */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 40px 48px;
    max-width: calc(1080px + 96px);
    min-height: 100vh;
    /* Subtiles Punkt-Raster als Hintergrundtextur */
    background-image: radial-gradient(circle at 1px 1px, rgba(0,0,0,0.03) 1px, transparent 0);
    background-size: 24px 24px;
}

/* Container-Klasse für Kompatibilität (wird von einigen Templates genutzt) */
.container {
    max-width: 960px;
    /* Im neuen Layout kein extra padding nötig, da .main-content es schon hat */
}

/* =============================================================================
   PAGE HEADER
   ============================================================================= */
.page-header {
    margin-bottom: 36px;
}

.page-header h1 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
    line-height: 1.15;
}

.page-header p {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* =============================================================================
   CARDS
   ============================================================================= */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: box-shadow 300ms ease;
}

.card:hover { box-shadow: var(--shadow-lg); }
.card + .card { margin-top: 16px; }

.card-header {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.01em;
}

.card-header svg {
    width: 18px;
    height: 18px;
    color: var(--text-tertiary);
}

/* Warn-Card (Doppelzahlungen, Rücklastschriften) */
.card-warn {
    border-color: var(--warn);
    background: var(--warn-bg);
}

.card-warn .card-header { color: var(--warn); }
.card-warn .detail-table td { border-bottom-color: rgba(245, 158, 11, 0.15); }
.card-warn .detail-table tr:hover td { background: rgba(245, 158, 11, 0.06); }

/* =============================================================================
   BUTTONS
   ============================================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 200ms var(--ease-out-expo);
    letter-spacing: -0.01em;
    line-height: 1;
    color: var(--text);
}

.btn:active { transform: scale(0.98); }
.btn svg { width: 16px; height: 16px; }

.btn-primary {
    background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    color: #fff;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.35);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background: var(--surface-3);
    color: var(--text-tertiary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-outline {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background: var(--surface-2);
    color: var(--text);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-block {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
    font-size: 14px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Button-Varianten für Admin-Seite */
.btn-warn { color: var(--warn); border-color: var(--warn); }
.btn-warn:hover { background: var(--warn-bg); }

.btn-danger-outline { color: var(--danger); border-color: var(--danger); }
.btn-danger-outline:hover { background: var(--danger-bg); }

.btn-success-outline { color: var(--success); border-color: var(--success); }
.btn-success-outline:hover { background: var(--success-bg); }

/* =============================================================================
   ALERTS
   ============================================================================= */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 500;
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.alert-warn {
    background: var(--warn-bg);
    color: var(--warn);
    border: 1px solid rgba(245, 158, 11, 0.15);
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.alert-info {
    background: var(--accent-glow);
    color: var(--accent);
    border: 1px solid rgba(14, 165, 233, 0.15);
}

/* =============================================================================
   MODULE GRID (Dashboard)
   ============================================================================= */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.module-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 28px;
    text-decoration: none;
    color: var(--text);
    transition: all 350ms var(--ease-out-expo);
    display: block;
    position: relative;
    overflow: hidden;
}

/* Gradient-Leiste am unteren Rand bei Hover */
.module-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 24px;
    right: 24px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-start), var(--accent-end));
    opacity: 0;
    transition: opacity 350ms ease;
    border-radius: 2px 2px 0 0;
}

.module-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.module-card:hover::after { opacity: 1; }

.module-card.geplant {
    opacity: 0.35;
    pointer-events: none;
}

.module-card.gesperrt {
    opacity: 0.55;
}

.module-card.gesperrt .icon svg {
    color: var(--dark-400) !important;
}

.module-card.gesperrt .badge {
    background: rgba(239, 68, 68, 0.10);
    color: #ef4444;
}

.module-card .icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--accent-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    font-size: 1.3rem;
}

.module-card h3 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.module-card p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.55;
}

.module-card .badge {
    display: inline-block;
    margin-top: 14px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 99px;
    background: var(--success-bg);
    color: var(--success);
}

.module-card.geplant .badge {
    background: var(--warn-bg);
    color: var(--warn);
}

/* =============================================================================
   UPLOAD ZONE
   ============================================================================= */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 32px;
    text-align: center;
    cursor: pointer;
    transition: all 250ms var(--ease-out-expo);
    position: relative;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-zone .icon {
    font-size: 2.5rem;
    margin-bottom: 14px;
    display: block;
}

.upload-zone h3 {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

.upload-zone p {
    font-size: 13px;
    color: var(--text-tertiary);
}

.upload-zone .dateiname {
    margin-top: 12px;
    font-weight: 600;
    color: var(--accent);
    display: none;
}

/* =============================================================================
   STATS GRID (Ergebnis-Seite)
   ============================================================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 18px;
    text-align: center;
    transition: all 250ms var(--ease-out-expo);
}

.stat-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.stat-card .zahl {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--text);
}

.stat-card .label {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 500;
    margin-top: 4px;
}

.stat-card.highlight { border-color: var(--accent); }
.stat-card.highlight .zahl { color: var(--accent); }

.stat-card.warnung { border-color: var(--warn); }
.stat-card.warnung .zahl { color: var(--warn); }

.stat-card.fehler { border-color: var(--danger); }
.stat-card.fehler .zahl { color: var(--danger); }

/* =============================================================================
   STATUS ROW (Datenquelle-Anzeige, Erfolgsmeldungen)
   ============================================================================= */
.status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
}

.status-row svg { flex-shrink: 0; }

.status-row.success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.1);
}

.status-row.warning {
    background: var(--warn-bg);
    color: var(--warn);
    border: 1px solid rgba(245, 158, 11, 0.1);
}

.status-row.danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.1);
}

/* =============================================================================
   KONTROLLE (Prüfsummen-Bar)
   ============================================================================= */
.kontrolle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
}

.kontrolle.ok {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.kontrolle.fehler {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

/* =============================================================================
   DOWNLOAD LIST
   ============================================================================= */
.download-list { list-style: none; }

.download-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--surface-2);
}

.download-list li:last-child { border-bottom: none; }

.download-list .datei-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.download-list .datei-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
}

.download-list .datei-desc {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* =============================================================================
   HISTORIE TABLE
   ============================================================================= */
.historie-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.historie-table th {
    text-align: left;
    padding: 10px 14px;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--surface-3);
}

.historie-table td {
    padding: 14px;
    border-bottom: 1px solid var(--surface-2);
    color: var(--text-muted);
}

.historie-table tr:hover td {
    background: var(--surface-2);
}

.historie-table a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: gap 150ms ease;
}

.historie-table a:hover { gap: 8px; }

/* =============================================================================
   DETAIL TABLE (Zugeordnete, Doppelzahlungen, Sonstige)
   ============================================================================= */
.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.detail-table th {
    text-align: left;
    padding: 8px 10px;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--surface-3);
}

.detail-table td {
    padding: 10px;
    border-bottom: 1px solid var(--surface-2);
    vertical-align: top;
    color: var(--text-muted);
}

.detail-table tr:hover td { background: var(--surface-2); }

.detail-table .nowrap { white-space: nowrap; }

.detail-table .vzweck {
    font-size: 12px;
    color: var(--text-tertiary);
    max-width: 300px;
    word-break: break-word;
}

/* =============================================================================
   COLLAPSIBLE SECTIONS (Ergebnis-Seite)
   ============================================================================= */
.section-toggle {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-toggle:hover { color: var(--accent); }

.toggle-icon {
    font-size: 1.1rem;
    transition: transform 0.2s;
}

/* =============================================================================
   BADGES
   ============================================================================= */
.badge-sm {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99px;
    background: var(--accent-glow);
    color: var(--accent);
}

.badge-admin { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.badge-gesperrt { background: var(--danger-bg); color: var(--danger); }

.nowrap { white-space: nowrap; }

/* =============================================================================
   LOADING OVERLAY
   ============================================================================= */
.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(248, 249, 252, 0.9);
    backdrop-filter: blur(4px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
}

.loading-overlay.active { display: flex; }

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--surface-3);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

/* =============================================================================
   FORMS (Login + Admin)
   ============================================================================= */
.form-group { margin-bottom: 16px; }

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text);
    background: var(--surface-1);
    outline: none;
    transition: border-color 200ms ease, box-shadow 200ms ease;
}

.form-group input::placeholder { color: var(--text-tertiary); }

.form-group input:focus,
.form-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Admin-Formulare */
.form-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-row .form-group { flex: 1; min-width: 140px; }
.form-row .form-group-btn { flex: 0; }

.inline-form {
    display: flex;
    align-items: center;
    gap: 6px;
}

.input-sm {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 12px;
    width: 140px;
    color: var(--text);
    outline: none;
    transition: border-color 200ms ease;
}

.input-sm:focus { border-color: var(--accent); }

/* =============================================================================
   ADMIN – Nutzer-Karten
   ============================================================================= */
.user-card {
    padding: 20px 0;
    border-bottom: 1px solid var(--surface-2);
}

.user-card:last-child { border-bottom: none; }
.user-inactive { opacity: 0.45; }

.user-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-info strong {
    font-family: var(--font-display);
    font-weight: 700;
}

.user-meta {
    font-size: 12px;
    color: var(--text-tertiary);
}

.user-modules {
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.module-checkboxes {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
}

.user-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

/* =============================================================================
   LOGIN PAGE
   Beachte: login.html hat eine eigene body-Klasse und nutzt NICHT base.html
   ============================================================================= */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--dark-900);
    background-image:
        radial-gradient(ellipse at 30% 20%, rgba(14, 165, 233, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 80%, rgba(16, 185, 129, 0.06) 0%, transparent 60%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 24px;
}

.login-card {
    background: var(--dark-800);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-xl);
    padding: 40px 32px;
}

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

.login-header img {
    height: 52px;
    margin-bottom: 20px;
}

.login-header h1 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
    color: var(--text-inverse);
    letter-spacing: -0.02em;
}

.login-header p {
    font-size: 13px;
    color: var(--dark-300);
    margin-top: 4px;
}

/* Login-Seite: Inputs brauchen Dark-Theme-Overrides */
.login-page .form-group input {
    background: var(--dark-700);
    border-color: var(--border-dark);
    color: var(--text-inverse);
}

.login-page .form-group input::placeholder { color: var(--dark-500); }

.login-page .form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.login-page .form-group label {
    color: var(--dark-300);
}

/* =============================================================================
   TOAST NOTIFICATIONS
   ============================================================================= */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 400px;
    pointer-events: auto;
}

.toast--success { border-left: 3px solid var(--success); }
.toast--error   { border-left: 3px solid var(--danger); }
.toast--info    { border-left: 3px solid var(--accent); }

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-tertiary);
    padding: 2px;
    display: flex;
    border-radius: 4px;
    transition: color 150ms ease, background 150ms ease;
    flex-shrink: 0;
}

.toast-close:hover {
    color: var(--text);
    background: var(--surface-2);
}

/* Alpine.js Transition Utilities */
.opacity-0 { opacity: 0; }
.opacity-100 { opacity: 1; }
.translate-y-\[-8px\] { transform: translateY(-8px); }
.translate-y-0 { transform: translateY(0); }
.translate-x-\[20px\] { transform: translateX(20px); }
.transition { transition-property: opacity, transform; }
.ease-out { transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }
.ease-in { transition-timing-function: ease-in; }
.duration-300 { transition-duration: 300ms; }
.duration-200 { transition-duration: 200ms; }

/* =============================================================================
   COLLAPSIBLE SECTIONS (Alpine.js)
   ============================================================================= */
.collapse-icon {
    transition: transform 250ms var(--ease-out-expo);
    color: var(--text-tertiary);
}

.collapse-icon.rotated {
    transform: rotate(180deg);
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */
@media (max-width: 1024px) {
    .main-content { padding: 32px 24px; }
}

@media (max-width: 768px) {
    /* Auf kleinen Screens: Sidebar ausblenden, Content volle Breite */
    .sidebar { display: none; }
    .main-content {
        margin-left: 0;
        padding: 24px 16px;
    }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .module-grid { grid-template-columns: 1fr; }
    .detail-table .vzweck { max-width: 150px; }
}
