/* --- 1. VARIABLES & RESET --- */
:root {
    /* Farbpalette (Slate / Blue / Red) */
    --bg-body: #0f172a;       /* Sehr dunkles Blau/Grau */
    --bg-card: #1e293b;       /* Panel Hintergrund */
    --bg-header: rgba(15, 23, 42, 0.85); /* Header (transparent) */
    
    --border-subtle: #334155; /* Dezent für Trennlinien */
    --border-focus: #475569;  /* Etwas stärker */

    --text-main: #f1f5f9;     /* Haupttext (fast Weiß) */
    --text-muted: #94a3b8;    /* Nebentext (Grau) */
    
    --primary: #3b82f6;       /* Hauptfarbe (Blau) */
    --primary-hover: #2563eb;
    
    --danger: #ef4444;        /* Rot für Fehler/Überfällig */
    --danger-bg: #450a0a;     /* Dunkelrot für Hintergründe */
    
    --success: #22c55e;       /* Grün */
    --warning: #f59e0b;       /* Orange */
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased; /* Schärfere Schrift auf Macs */
}

*, *::before, *::after {
    box-sizing: border-box;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover);
}

/* --- 2. HEADER & NAVIGATION --- */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    background-color: var(--bg-header);
    backdrop-filter: blur(12px); /* Milchglas-Effekt */
    border-bottom: 1px solid var(--border-subtle);
}

.brand h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
    letter-spacing: -0.025em;
}

.brand .subtitle {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: -2px;
}

.app-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Die Navigation-Links als "Pills" */
.nav-link {
    color: var(--text-muted);
    padding: 0.5rem 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background-color: rgba(255,255,255, 0.05);
    color: #fff;
    text-decoration: none;
}

.nav-link.active {
    background-color: var(--primary);
    color: #fff;
}

.nav-separator {
    width: 1px;
    height: 24px;
    background-color: var(--border-subtle);
    margin: 0 0.5rem;
}

.nav-link-logout {
    color: var(--danger);
}
.nav-link-logout:hover {
    background-color: var(--danger-bg);
    color: #fca5a5;
}

/* --- 3. LAYOUT & CARDS --- */
.app-main {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
}

.card h2 {
    margin-top: 0;
    font-size: 1.5rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

/* Header innerhalb einer Card (Titel + Button rechts) */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 1rem;
}
.card-header h2 {
    margin: 0;
    border: none;
    padding: 0;
}

/* --- 4. DASHBOARD GRID --- */
.dashboard-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(370px, 1fr));
    gap: 1rem;
    align-items: start;
}

.dashboard-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 0.75rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    min-height: 800px;
}

.dashboard-panel h3 {
    margin-top: 0;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

/* --- 5. TABELLEN --- */
.table-wrapper, .scrollable-table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-top: 0.5rem;
}

.scrollable-table-wrapper {
    max-height: 600px;
    overflow-y: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    white-space: nowrap; /* Verhindert Umbrüche in engen Spalten */
}

.table th {
    text-align: left;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-subtle);
}

.table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255, 0.05);
    color: var(--text-main);
}

/* Hover-Effekt für Zeilen */
.table tbody tr:hover {
    background-color: rgba(255,255,255, 0.03);
}

/* Überfällige Zeilen */
.row-overdue {
    background-color: rgba(239, 68, 68, 0.15); /* Leichtes Rot */
}
.row-overdue:hover {
    background-color: rgba(239, 68, 68, 0.25) !important;
}

/* --- 6. BUTTONS & FORMS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: transparent;
    border-color: var(--border-focus);
    color: var(--text-main);
}
.btn-secondary:hover {
    background-color: rgba(255,255,255, 0.05);
    border-color: #fff;
    color: #fff;
}

.btn-danger {
    background-color: transparent;
    border-color: var(--danger);
    color: var(--danger);
}
.btn-danger:hover {
    background-color: var(--danger);
    color: #fff;
}

.btn-small {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

/* Formulare */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-field-full {
    grid-column: 1 / -1;
}

label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

input[type="text"],
input[type="date"],
input[type="month"],
input[type="password"],
select {
    background-color: rgba(0,0,0, 0.2);
    border: 1px solid var(--border-subtle);
    color: #fff;
    padding: 0.6rem 0.8rem;
    border-radius: 0.375rem;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.app-footer {
    text-align: center;
    margin-top: 4rem;
    padding: 2rem;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- NEWS TICKER --- */
.news-ticker {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(90deg, #0f172a, #111827);
    border: 1px solid #334155;
    border-radius: 0.75rem;
    padding: 0.6rem 1rem;
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.news-ticker-label {
    background: #f97316;
    color: #111827;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    flex-shrink: 0;
}

.news-ticker-marquee {
    overflow: hidden;
    position: relative;
    flex: 1;
}

/* UL als durchlaufendes Band */
.news-ticker-marquee ul {
    display: inline-flex;
    gap: 3rem;
    margin: 0;
    padding: 0;
    list-style: none;
    white-space: nowrap;
    animation: ticker-scroll 20s linear infinite;
}

.news-ticker-marquee li {
    font-size: 1rem;              /* größer */
    color: #e5e7eb;
}

.news-ticker-title {
    font-weight: 700;             /* fetter */
    color: #f9fafb;
    font-size: 1.05rem;
}

.news-ticker-sep {
    margin: 0 0.5rem;
    color: #9ca3af;
}

.news-ticker-content {
    color: #cbd5f5;
    font-size: 0.98rem;
}

/* Animation: komplette Liste von rechts nach links scrollen */
@keyframes ticker-scroll {
    0%   { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}