/* ═══════════════════════════════════════════════════════════
   BUSHALTESTELLEN DASHBOARD – DESIGN SYSTEM
   Bergisch Gladbach – Premium Dark Theme
   ═══════════════════════════════════════════════════════════ */

/* ──────────────── CSS VARIABLEN ──────────────── */
:root {
    /* Farben – Dunkel */
    --bg-primary: #0f1117;
    --bg-secondary: #161822;
    --bg-card: #1c1f2e;
    --bg-card-hover: #242738;
    --bg-elevated: #252840;
    --bg-input: #1a1d2e;
    --bg-modal: #1c1f2eee;
    
    /* Textfarben */
    --text-primary: #e8eaf6;
    --text-secondary: #9ea4c0;
    --text-muted: #636a8a;
    --text-on-accent: #ffffff;
    
    /* Akzent */
    --accent-primary: #6366f1;
    --accent-primary-hover: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.25);
    --accent-secondary: #22d3ee;
    
    /* Status-Ampelfarben */
    --status-offen: #78909c;
    --status-gestartet: #ffc107;
    --status-bearbeitung: #ff9800;
    --status-fertig: #4caf50;
    --status-abgelegt: #607d8b;
    --status-planer: #2196f3;
    --status-leer: #37394d;
    
    /* Prioritäten */
    --prio-a: #ef4444;
    --prio-b: #f97316;
    --prio-c: #eab308;
    --prio-d: #9ca3af;
    
    /* Borders */
    --border-color: #2a2d42;
    --border-color-light: #363a54;
    
    /* Spacing */
    --sidebar-width: 260px;
    --header-height: 64px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    /* Schatten */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px var(--accent-glow);
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-medium: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color-light);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ──────────────── LOGIN OVERLAY ──────────────── */
.login-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.5s ease;
}

.login-overlay.hidden {
    display: none;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    width: 420px;
    max-width: 90vw;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.login-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    animation: bounce 2s infinite;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.login-form input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition-fast);
}

.login-form input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.login-hint {
    margin-top: 24px;
    padding: 16px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.8;
}

.login-hint code {
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--accent-secondary);
}

/* ──────────────── BUTTONS ──────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-primary);
    color: var(--text-on-accent);
}

.btn-primary:hover {
    background: var(--accent-primary-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

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

.btn-outline:hover {
    background: var(--bg-elevated);
    border-color: var(--border-color-light);
    color: var(--text-primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 12px;
}

.btn-ghost:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

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

.btn-xs {
    padding: 4px 8px;
    font-size: 0.75rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 14px;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-accent {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn-accent:hover {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    transform: translateY(-1px);
}

.btn-action-edit {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.btn-action-edit:hover {
    background: var(--accent-primary);
    color: white;
}

.sync-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-xl);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.sync-ok {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.sync-pending {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
    animation: pulse 2s infinite;
}

.sync-conflict {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.45);
    animation: pulse 1.2s infinite;
}

.hidden {
    display: none !important;
}

.table-info-banner {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    margin-bottom: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.table-info-banner strong {
    color: var(--text-primary);
}

.clickable-row {
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.clickable-row:hover {
    background-color: var(--bg-card-hover) !important;
}

/* ──────────────── SIDEBAR ──────────────── */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: var(--transition-medium);
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.4));
}

.logo-title {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-city {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-menu {
    list-style: none;
    padding: 12px 0;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    margin: 2px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition-fast);
    user-select: none;
}

.nav-item:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-glow);
    color: var(--accent-primary-hover);
    font-weight: 600;
}

.nav-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.user-avatar {
    font-size: 1.5rem;
}

.user-name {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-login {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.user-role {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-user-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-user-actions .btn {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    padding: 7px 10px;
    font-size: 0.8rem;
}

/* ──────────────── MAIN CONTENT ──────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    max-width: calc(100vw - var(--sidebar-width));
    overflow-x: hidden;
    transition: var(--transition-medium);
}

.main-content.expanded {
    margin-left: 0;
    max-width: 100vw;
}

.content-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: var(--header-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    background: rgba(15, 17, 23, 0.85);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
}

#page-title {
    font-size: 1.2rem;
    font-weight: 700;
}

.last-update {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ──────────────── VIEWS ──────────────── */
.view {
    display: none;
    padding: 24px 28px;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

/* ──────────────── 1. OVERVIEW HERO & MEILENSTEINE ──────────────── */
.overview-hero-card {
    background: linear-gradient(135deg, rgba(30, 34, 53, 0.95), rgba(22, 24, 37, 0.95));
    border: 1px solid var(--border-color-light);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-md), 0 0 24px rgba(99, 102, 241, 0.08);
    position: relative;
    overflow: hidden;
}

.overview-hero-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #38bdf8, #10b981);
}

.hero-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.hero-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hero-badge {
    align-self: flex-start;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary-hover);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.hero-heading {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin: 0;
}

.hero-sub {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

.hero-total-badge {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 18px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.hero-total-icon {
    font-size: 1.8rem;
}

.hero-total-info {
    display: flex;
    flex-direction: column;
}

.hero-total-val {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}

.hero-total-lbl {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Meilensteine Grid (Pipeline) */
.milestones-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    position: relative;
}

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

.milestone-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--ms-color, var(--accent-primary));
}

.milestone-card:hover {
    border-color: var(--ms-color, var(--accent-primary));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--ms-glow, rgba(0,0,0,0.3));
}

.ms-step-badge {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-elevated);
    padding: 2px 8px;
    border-radius: 10px;
}

.ms-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ms-icon {
    font-size: 1.3rem;
}

.ms-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.ms-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
}

.ms-prozent-badge {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--ms-color, var(--text-primary));
    background: var(--ms-glow, rgba(255,255,255,0.05));
    padding: 2px 6px;
    border-radius: 6px;
}

.ms-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ms-value-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.ms-big-num {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.ms-sub-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.2;
}

.ms-progress-track {
    width: 100%;
    height: 8px;
    background: var(--bg-elevated);
    border-radius: 4px;
    overflow: hidden;
}

.ms-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.ms-detail-note {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.ms-detail-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--ms-color, var(--text-muted));
}

/* ──────────────── 2. DASHBOARD SECTIONS & HEADERS ──────────────── */
.dashboard-section {
    margin-bottom: 32px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.section-legend {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-pill {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* ──────────────── 3. PRIORITÄTEN-COCKPIT (A, B, C, D) ──────────────── */
.prio-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.prio-cockpit-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
    transition: var(--transition-medium);
}

.prio-cockpit-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.prio-card-a::before { background: #ef4444; }
.prio-card-b::before { background: #f97316; }
.prio-card-c::before { background: #eab308; }
.prio-card-d::before { background: #94a3b8; }

.prio-cockpit-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-color-light);
}

.prio-card-a:hover { box-shadow: 0 8px 24px rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.4); }
.prio-card-b:hover { box-shadow: 0 8px 24px rgba(249, 115, 22, 0.15); border-color: rgba(249, 115, 22, 0.4); }
.prio-card-c:hover { box-shadow: 0 8px 24px rgba(234, 179, 8, 0.15); border-color: rgba(234, 179, 8, 0.4); }
.prio-card-d:hover { box-shadow: 0 8px 24px rgba(148, 163, 184, 0.15); border-color: rgba(148, 163, 184, 0.4); }

.prio-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.prio-card-title-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.prio-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    width: fit-content;
}

.prio-badge-a { background: rgba(239, 68, 68, 0.18); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.35); }
.prio-badge-b { background: rgba(249, 115, 22, 0.18); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.35); }
.prio-badge-c { background: rgba(234, 179, 8, 0.18); color: #facc15; border: 1px solid rgba(234, 179, 8, 0.35); }
.prio-badge-d { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.35); }

.prio-card-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.prio-card-total-box {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.prio-total-num {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.prio-total-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Prio Overall Progress */
.prio-overall-progress {
    background: var(--bg-elevated);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.prio-op-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.74rem;
}

.prio-op-label {
    color: var(--text-secondary);
    font-weight: 600;
}

.prio-op-val {
    color: var(--text-primary);
    font-weight: 800;
}

.prio-op-track {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    overflow: hidden;
}

.prio-op-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Prio Card Phases */
.prio-card-phases {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.prio-phase-block {
    background: rgba(22, 24, 37, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.prio-phase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
}

.phase-name {
    font-weight: 700;
    color: var(--text-primary);
}

.phase-highlight {
    font-weight: 600;
    font-size: 0.74rem;
}

.segmented-progress-bar {
    width: 100%;
    height: 7px;
    background: var(--bg-elevated);
    border-radius: 3.5px;
    overflow: hidden;
    display: flex;
}

.seg-fill {
    height: 100%;
    transition: width 0.6s ease;
}

.seg-success { background: #10b981; }
.seg-info { background: #0ea5e9; }
.seg-warning { background: #eab308; }
.seg-empty { background: transparent; }

.phase-breakdown-row {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    font-size: 0.68rem;
    color: var(--text-muted);
}

.phase-badge {
    font-weight: 500;
}

/* Fördermittel Block */
.foerder-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.foerder-item {
    background: var(--bg-elevated);
    padding: 6px 8px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.foerder-lbl {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.foerder-val {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Prio Card Footer Button */
.prio-card-footer {
    margin-top: auto;
}

.prio-filter-btn {
    width: 100%;
    font-size: 0.78rem;
    padding: 8px 10px;
    justify-content: center;
    border-color: var(--border-color-light);
}

.prio-filter-btn:hover {
    background: var(--accent-glow);
    border-color: var(--accent-primary);
    color: var(--accent-primary-hover);
}

/* ──────────────── 4. STATUS- & PRIORITÄTS-MATRIX ──────────────── */
.matrix-hint-badge {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-elevated);
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.matrix-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.matrix-table-wrapper {
    overflow-x: auto;
}

.matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.matrix-table thead th {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.76rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.matrix-table thead .th-group-sa {
    border-left: 1px solid var(--border-color);
    color: #10b981;
    text-align: center;
}

.matrix-table thead .th-group-sv {
    border-left: 1px solid var(--border-color);
    color: #0ea5e9;
    text-align: center;
}

.matrix-table thead .th-group-foerder {
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    color: #a855f7;
    text-align: center;
}

.matrix-table thead .th-subrow th {
    background: rgba(22, 24, 37, 0.85);
    font-size: 0.7rem;
    padding: 6px 10px;
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 2px solid var(--border-color);
}

.matrix-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-fast);
}

.matrix-row {
    cursor: pointer;
}

.matrix-row:hover {
    background: var(--bg-elevated);
}

.matrix-table td {
    padding: 12px 14px;
    vertical-align: middle;
}

.col-prio-name {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.prio-label-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
}

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

.matrix-count {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.82rem;
}

.count-warn { color: #facc15; }
.count-success { color: #10b981; }
.count-info { color: #0ea5e9; }
.count-info-soft { color: #93c5fd; }

.col-quote {
    min-width: 110px;
}

.matrix-quote-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quote-text {
    font-size: 0.78rem;
    font-weight: 700;
    min-width: 36px;
}

.mini-bar-track {
    flex: 1;
    height: 6px;
    background: var(--bg-elevated);
    border-radius: 3px;
    overflow: hidden;
}

.mini-bar-wide {
    width: 90px;
}

.mini-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.col-progress {
    min-width: 140px;
}

.matrix-overall-progress {
    display: flex;
    align-items: center;
    gap: 8px;
}

.matrix-overall-pct {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-primary);
}

.col-action-mini {
    text-align: right;
    width: 30px;
}

.matrix-filter-arrow {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.matrix-row:hover .matrix-filter-arrow {
    color: var(--accent-primary-hover);
    transform: translateX(3px);
}

/* Matrix Gesamtzeile */
.matrix-total-row {
    background: rgba(99, 102, 241, 0.08) !important;
    border-top: 2px solid var(--accent-primary);
    font-weight: 700;
}

.matrix-total-row td {
    color: var(--text-primary);
}

/* ──────────────── 5. SEKUNDÄRE CHARTS (Unten) ──────────────── */
.section-secondary {
    margin-top: 10px;
}

.chart-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.chart-scroll-box {
    max-height: 320px;
    overflow-y: auto;
    padding-right: 8px;
}

/* ──────────────── 6. HELPER & RESPONSIVE DESIGN ──────────────── */
.text-success { color: #10b981 !important; }
.text-info { color: #0ea5e9 !important; }
.text-warning { color: #f59e0b !important; }

/* Responsive Grids */
@media (max-width: 1280px) {
    .milestones-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .prio-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .milestones-grid {
        grid-template-columns: 1fr;
    }
    .prio-cards-grid {
        grid-template-columns: 1fr;
    }
    .hero-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .hero-total-badge {
        width: 100%;
        justify-content: center;
    }
}

/* ──────────────── CHARTS GRID (BASE) ──────────────── */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

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

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: var(--transition-medium);
}

.chart-card:hover {
    border-color: var(--border-color-light);
}

.chart-card.chart-wide {
    grid-column: span 2;
}

.chart-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0;
}

/* Bar Charts */
.chart-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bar-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    min-width: 120px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.bar-track {
    flex: 1;
    height: 28px;
    background: var(--bg-elevated);
    border-radius: 14px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    border-radius: 14px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    padding-left: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    min-width: fit-content;
}

.bar-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 30px;
    text-align: right;
}

/* Horizontal bars for Stadtteile */
.chart-bars-horizontal .bar-label {
    min-width: 140px;
}

/* ──────────────── FILTER BAR ──────────────── */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 14px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-select, .filter-input {
    padding: 7px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.82rem;
    min-width: 130px;
    max-width: 160px;
    transition: var(--transition-fast);
}

.filter-group-search .filter-input {
    min-width: 180px;
    max-width: 240px;
}

.filter-select:focus, .filter-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.filter-actions {
    margin-left: auto;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.filter-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

/* ──────────────── DATA TABLE ──────────────── */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) var(--bg-elevated);
}

.table-container::-webkit-scrollbar {
    height: 10px;
}

.table-container::-webkit-scrollbar-track {
    background: var(--bg-elevated);
    border-radius: 6px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 6px;
    border: 2px solid var(--bg-elevated);
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

.data-table {
    width: 100%;
    min-width: 1320px;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.data-table thead {
    position: sticky;
    top: 0;
    z-index: 5;
}

.data-table th {
    background: var(--bg-elevated);
    padding: 10px 12px;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    user-select: none;
}

.data-table th.sortable {
    cursor: pointer;
    transition: var(--transition-fast);
}

.data-table th.sortable:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.data-table th.sort-asc::after {
    content: ' ▲';
    font-size: 0.6rem;
}

.data-table th.sort-desc::after {
    content: ' ▼';
    font-size: 0.6rem;
}

.data-table td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

/* Kompakte Spaltenbreiten & Ausrichtungen */
.col-nr {
    width: 46px;
    min-width: 46px;
    max-width: 46px;
    text-align: center !important;
    font-weight: 700;
    color: var(--text-muted);
}

.col-action {
    width: 78px;
    min-width: 78px;
    text-align: center !important;
}

.col-prio {
    width: 52px;
    min-width: 52px;
    text-align: center !important;
}

.col-paket {
    width: 64px;
    min-width: 64px;
    text-align: center !important;
}

.col-stadtteil {
    min-width: 105px;
    max-width: 135px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col-name {
    min-width: 160px;
    font-weight: 600;
    color: var(--text-primary);
}

.name-with-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.info-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    padding: 1px 4px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 4px;
    color: var(--accent-primary-hover);
    cursor: help;
    transition: var(--transition-fast);
    line-height: 1;
}

.info-indicator:hover {
    background: rgba(99, 102, 241, 0.3);
    transform: scale(1.1);
}

.col-datum {
    min-width: 95px;
    white-space: nowrap;
    font-size: 0.78rem;
}

.col-buero {
    min-width: 115px;
    max-width: 155px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col-status {
    min-width: 110px;
    white-space: nowrap;
}

.data-table tbody tr {
    transition: var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--bg-card-hover);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-offen { background: rgba(120,144,156,0.15); color: #b0bec5; }
.status-offen::before { background: var(--status-offen); }

.status-gestartet { background: rgba(255,193,7,0.15); color: #ffd54f; }
.status-gestartet::before { background: var(--status-gestartet); }

.status-bearbeitung { background: rgba(255,152,0,0.15); color: #ffb74d; }
.status-bearbeitung::before { background: var(--status-bearbeitung); }

.status-fertig { background: rgba(76,175,80,0.15); color: #81c784; }
.status-fertig::before { background: var(--status-fertig); }

.status-abgelegt { background: rgba(96,125,139,0.15); color: #90a4ae; }
.status-abgelegt::before { background: var(--status-abgelegt); }

.status-planer { background: rgba(33,150,243,0.15); color: #64b5f6; }
.status-planer::before { background: var(--status-planer); }

.status-leer { background: rgba(55,57,77,0.3); color: var(--text-muted); }
.status-leer::before { background: var(--status-leer); }

/* Priorität Badges */
.prio-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.prio-A { background: var(--prio-a); box-shadow: 0 0 12px rgba(239,68,68,0.4); }
.prio-B { background: var(--prio-b); box-shadow: 0 0 12px rgba(249,115,22,0.3); }
.prio-C { background: var(--prio-c); color: #1a1a1a; }
.prio-D { background: var(--prio-d); color: #1a1a1a; }

/* Action buttons in table */
.btn-action {
    padding: 6px 10px;
    font-size: 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-action:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* ──────────────── TIMELINE VIEW ──────────────── */
.timeline-header {
    margin-bottom: 24px;
}

.timeline-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

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

.timeline-legend {
    display: flex;
    gap: 20px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-dot-green { background: var(--status-fertig); }
.legend-dot-yellow { background: var(--status-gestartet); }
.legend-dot-red { background: var(--prio-a); }
.legend-dot-grey { background: var(--status-leer); }

.timeline-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.timeline-card {
    display: grid;
    grid-template-columns: 50px 1fr auto;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    align-items: center;
    transition: var(--transition-fast);
}

.timeline-card:hover {
    border-color: var(--border-color-light);
    transform: translateX(4px);
}

.timeline-nr {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-muted);
    text-align: center;
}

.timeline-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.timeline-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.timeline-stadtteil {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.timeline-dates {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.timeline-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    min-width: 130px;
}

.timeline-date-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.timeline-date-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2px;
}

.timeline-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* ──────────────── AUDIT LOG ──────────────── */
.audit-header {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.audit-header-text h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.audit-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.audit-entry {
    display: grid;
    grid-template-columns: 150px minmax(150px, 230px) minmax(140px, 200px) 1fr;
    gap: 16px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    align-items: center;
    animation: slideIn 0.3s ease;
}

.audit-time {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: inherit;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.audit-user {
    color: var(--accent-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.audit-badge-s {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 600;
    background: rgba(59, 130, 246, 0.18);
    color: #93c5fd;
    white-space: nowrap;
}

.audit-haltestelle,
.audit-nr {
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audit-change {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.audit-field {
    font-weight: 600;
    color: var(--text-primary);
}

.audit-old {
    text-decoration: line-through;
    color: var(--prio-a);
    opacity: 0.7;
    padding: 2px 6px;
    background: rgba(239,68,68,0.1);
    border-radius: 4px;
    font-size: 0.8rem;
}

.audit-new {
    color: var(--status-fertig);
    padding: 2px 6px;
    background: rgba(76,175,80,0.1);
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.audit-deleted {
    color: var(--prio-a);
    padding: 2px 6px;
    background: rgba(239,68,68,0.15);
    border: 1px dashed rgba(239,68,68,0.35);
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.audit-arrow {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.audit-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

/* ──────────────── BENUTZERVERWALTUNG ──────────────── */
.benutzer-header {
    margin-bottom: 24px;
}

.benutzer-create-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.benutzer-form-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 20px;
    margin-bottom: 20px;
}

.benutzer-form-grid .form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.benutzer-form-grid .form-group input,
.benutzer-form-grid .form-group select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
}

.benutzer-list-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 28px;
}

.benutzer-table-wrap {
    overflow-x: auto;
}

.benutzer-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.benutzer-table th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
}

.benutzer-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color-light);
    color: var(--text-primary);
}

.benutzer-row:hover {
    background: var(--bg-card-hover);
}

.badge-aktuell {
    display: inline-block;
    background: var(--accent-primary);
    color: #fff;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 0.7rem;
    margin-left: 6px;
}

.empty-cell {
    text-align: center;
    color: var(--text-muted);
    padding: 24px;
}

/* ──────────────── MODAL ──────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

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

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 720px;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-content-sm {
    width: 450px;
}

.benutzer-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px 28px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 28px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Detail Fields in Modal */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.detail-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-field.full-width {
    grid-column: span 2;
}

.detail-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-value {
    font-size: 0.95rem;
    color: var(--text-primary);
    padding: 8px 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    min-height: 38px;
    display: flex;
    align-items: center;
}

.detail-value.editable {
    border-color: var(--border-color);
    cursor: text;
}

.detail-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.detail-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Editable fields */
.edit-select, .edit-input {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.edit-select:focus, .edit-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-glow);
}

/* ──────────────── TOAST NOTIFICATIONS ──────────────── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    font-size: 0.85rem;
    animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    min-width: 280px;
    max-width: 420px;
}

.toast.success {
    border-left: 3px solid var(--status-fertig);
}

.toast.error {
    border-left: 3px solid var(--prio-a);
}

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

.toast-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    color: var(--text-primary);
}

/* ──────────────── ANIMATIONS ──────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateX(-10px);
    }
    to { 
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from { 
        opacity: 0;
        transform: translateX(40px);
    }
    to { 
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* Loading Spinner */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--text-muted);
    font-size: 0.9rem;
    gap: 12px;
}

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

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

/* ──────────────── RESPONSIVE ──────────────── */
@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
    .chart-card.chart-wide {
        grid-column: span 1;
    }
    .detail-grid {
        grid-template-columns: 1fr;
    }
    .detail-field.full-width {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar-toggle {
        display: block;
    }
    .content-header {
        padding: 0 16px;
    }
    .view {
        padding: 16px;
    }
    .kpi-grid {
        grid-template-columns: 1fr 1fr;
    }
    .filter-bar {
        flex-direction: column;
    }
    .filter-select, .filter-input {
        min-width: auto;
        width: 100%;
    }
    .filter-actions {
        margin-left: 0;
    }
    .audit-entry {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .data-table {
        font-size: 0.75rem;
    }
    .data-table th, .data-table td {
        padding: 8px;
    }
    .modal-content {
        margin: 16px;
    }
    .timeline-card {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .timeline-dates {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    .login-card {
        padding: 32px 24px;
    }
}
