/* =============================================
   SL-UP - Modernes helles Design
   ============================================= */

:root {
    /* Primärfarben */
    --primary: #2563EB;
    --primary-light: #3B82F6;
    --primary-dark: #1D4ED8;
    --primary-50: #EFF6FF;
    --primary-100: #DBEAFE;

    /* Akzentfarben */
    --accent: #06B6D4;
    --accent-light: #22D3EE;

    /* Grautöne */
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    /* #1664: AA-konformer Muted-Text (#6B7280 = 4.74:1 auf Weiß) — für sekundäre
       Labels statt --gray-400 (#9CA3AF, nur 2.58:1, verfehlt WCAG AA). */
    --text-muted: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    /* Statusfarben */
    --success: #10B981;
    --success-light: #D1FAE5;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --info: #3B82F6;
    --info-light: #DBEAFE;

    /* Abwesenheitsfarben */
    --absence-vacation: #10B981;
    --absence-sick: #EF4444;
    --absence-homeoffice: #3B82F6;
    --absence-travel: #F59E0B;
    --absence-training: #8B5CF6;
    --absence-parental: #EC4899;

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-width-collapsed: 68px;
    --header-height: 64px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --transition: all 0.2s ease;
}

/* ---- Reset & Basis ---- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: var(--notice-h, 0px);
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

/* ---- Login-Seite ---- */
.login-page {
    min-height: 100vh;          /* Fallback */
    min-height: 100dvh;         /* iOS-Fix #938: dynamic viewport */
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 2rem 1rem;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: loginBgPulse 8s ease-in-out infinite;
}

@keyframes loginBgPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease-out;
}

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

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo .logo-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.login-logo .logo-icon i {
    font-size: 2rem;
    color: white;
}

.login-logo h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.5px;
}

.login-logo p {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* ---- Formular Elemente ---- */
.form-floating {
    position: relative;
    margin-bottom: 1rem;
}

.form-floating .form-control {
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    padding: 1rem 1rem 0.5rem 2.75rem;
    font-size: 0.95rem;
    transition: var(--transition);
    background: var(--gray-50);
    height: auto;
}

.form-floating .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    background: white;
}

.form-floating .input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    z-index: 5;
    pointer-events: none;
    transition: var(--transition);
    line-height: 1;
    font-size: 1rem;
}
/* Login-Seite: Icon immer auf feste 29px (Mitte des 58px-Inputs), unabhängig von Container-Höhe */
.login-page .form-floating .input-icon {
    top: 29px !important;
    transform: translateY(-50%) !important;
}

.form-floating .form-control:focus ~ .input-icon {
    color: var(--primary);
}

.btn-login {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    color: white;
    padding: 0.85rem 2rem;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    width: 100%;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: white;
}

.btn-login:active {
    transform: translateY(0);
}

/* ---- Impersonation Banner ---- */
.impersonation-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 42px;
    z-index: 2000;
    background: linear-gradient(135deg, #dc2626, #991b1b);
    color: white;
    font-size: 0.82rem;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
}

.impersonation-banner-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 1.25rem;
    max-width: 100%;
}

.impersonation-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.impersonation-info i {
    font-size: 1rem;
}

.impersonation-exit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.impersonation-exit-btn:hover {
    background: rgba(255,255,255,0.35);
    color: white;
    text-decoration: none;
}

body.impersonating {
    padding-top: calc(42px + var(--notice-h, 0px));
}

body.impersonating .sidebar {
    top: calc(42px + var(--notice-h, 0px));
    height: calc(100vh - 42px - var(--notice-h, 0px));
}

/* ---- App Layout ---- */
.app-wrapper {
    display: flex;
    min-height: 100vh;          /* Fallback */
    min-height: 100dvh;         /* iOS-Fix #938 */
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--notice-h, 0);
    left: 0;
    bottom: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
}

.sidebar-header img {
    flex-shrink: 0;
}

.sidebar-header > div {
    flex: 1;
    min-width: 0;
    width: 100%;
}

.sidebar-header .logo-sm {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-header .logo-sm i {
    color: white;
    font-size: 1.2rem;
}

.sidebar-header > div > div {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.3;
    color: var(--gray-900);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.3px;
}

.sidebar-header small {
    color: var(--gray-400);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--gray-400);
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--border-radius-sm);
    color: var(--gray-600);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 2px;
}

.nav-link:hover {
    background: var(--primary-50);
    color: var(--primary);
}

.nav-link.active {
    background: var(--primary-50);
    color: var(--primary);
    font-weight: 600;
}

.nav-link i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.nav-link .badge {
    margin-left: auto;
    font-size: 0.7rem;
    padding: 0.2em 0.55em;
    border-radius: 20px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--gray-100);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.user-menu:hover {
    background: var(--gray-100);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-info .name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info .role {
    font-size: 0.75rem;
    color: var(--text-muted); /* #1664: AA-Kontrast */
}

/* Sidebar-Footer Dropdown: über Sidebar-Inhalt, unter Modals */
.sidebar-footer-dropdown {
    border-radius: var(--border-radius-sm);
    z-index: 1050;
}

/* ---- Main Content ---- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;          /* Fallback */
    min-height: 100dvh;         /* iOS-Fix #938 */
    min-width: 0;               /* #942: verhindert Flex-Item-Aufblähung durch breite Inhalte */
    overflow-x: hidden;         /* #942: kappt absolutes Overflow auf Page-Ebene */
}

/* ---- Footer (#943: bessere Touch-Targets) ---- */
.app-footer {
    text-align: center;
    padding: .75rem 1rem;
    font-size: .72rem;
    color: #94a3b8;
    border-top: 1px solid #f1f5f9;
    margin-top: auto;
}
.app-footer-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: .5rem .25rem;
}
.app-footer-link,
.app-footer-lang {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    text-decoration: none;
    padding: .5rem .65rem;     /* Mobile-Touch-Target: 44px+ */
    border-radius: 6px;
    min-height: 36px;
    transition: background-color .15s, color .15s;
}
.app-footer-link:hover,
.app-footer-lang:hover {
    color: #475569;
    background: rgba(0,0,0,.03);
}
.app-footer-lang-active {
    color: #475569;
    font-weight: 600;
    cursor: default;
}
.app-footer-lang-active:hover {
    background: transparent;
}
.app-footer-langs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .15rem;
    margin-top: .35rem;
}
@media (max-width: 480px) {
    .app-footer-link,
    .app-footer-lang {
        min-width: 44px;
        min-height: 44px;
        padding: .65rem .8rem;
        font-size: .8rem;
    }
}

/* ---- Header ---- */
.app-header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: var(--notice-h, 0);
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--gray-600);
    cursor: pointer;
    padding: 0.25rem;
    /* #1663: WCAG 2.5.5 — Touch-Target mind. 44x44px (zentrale Mobile-Navigation) */
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

/* ---- Sidebar Collapse Toggle (Desktop) ---- */
.sidebar-collapse-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.25rem 0.4rem;
    border-radius: var(--border-radius-sm);
    transition: background 0.15s, color 0.15s;
}
.sidebar-collapse-toggle:hover {
    background: var(--gray-100);
    color: var(--primary);
}
/* Sauberer Fokus-Stil statt des default schwarzen Browser-Outlines */
.sidebar-collapse-toggle:focus { outline: none; }
.sidebar-collapse-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.sidebar-collapse-toggle i { transition: transform 0.3s ease; }
/* Eingeklappt: Pfeil dreht sich (zeigt nach rechts = ausklappen) */
html.sidebar-collapsed .sidebar-collapse-toggle i { transform: rotate(180deg); }
/* Auf Mobile ist der Collapse-Button irrelevant (dort gilt das Overlay-Pattern) */
@media (max-width: 991px) {
    .sidebar-collapse-toggle { display: none; }
}

/* ---- Eingeklappte Sidebar (nur Desktop ≥992px) ---- */
@media (min-width: 992px) {
    html.sidebar-collapsed .sidebar {
        width: var(--sidebar-width-collapsed);
    }
    html.sidebar-collapsed .main-content {
        margin-left: var(--sidebar-width-collapsed);
    }
    /* Texte & Sektionstitel ausblenden, nur Icons zeigen */
    html.sidebar-collapsed .sidebar .nav-link {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
        position: relative;
    }
    html.sidebar-collapsed .sidebar .nav-link-text,
    html.sidebar-collapsed .sidebar .nav-section-title,
    html.sidebar-collapsed .sidebar-header > div,
    html.sidebar-collapsed .sidebar .nav-more-toggle-text,
    html.sidebar-collapsed .sidebar-footer .user-info,
    html.sidebar-collapsed .sidebar-footer .user-menu > i.bi-three-dots-vertical {
        display: none !important;
    }
    html.sidebar-collapsed .sidebar-footer .user-menu {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }
    /* Reiner Textinhalt von nav-links (kein span) ausblenden via font-size:0 */
    html.sidebar-collapsed .sidebar .nav-link {
        font-size: 0;            /* versteckt direkten Text */
        gap: 0;
    }
    html.sidebar-collapsed .sidebar .nav-link i {
        font-size: 1.15rem;      /* Icon wieder sichtbar */
        margin: 0;
    }
    /* Badge (z.B. offene Genehmigungen) als kleiner Punkt oben rechts am Icon */
    html.sidebar-collapsed .sidebar .nav-link .badge {
        position: absolute;
        top: 4px;
        right: 12px;
        width: 9px;
        min-width: 9px;
        height: 9px;
        padding: 0;
        font-size: 0 !important;
        border-radius: 50%;
        line-height: 0;
        background-color: var(--danger, #dc2626) !important;
        color: transparent !important;
        overflow: hidden;
    }
    html.sidebar-collapsed .sidebar-header {
        padding: 1rem 0.5rem;
    }
    html.sidebar-collapsed .sidebar-header img {
        max-width: 44px;
        height: auto;
    }
    /* "Mehr"-Toggle (#896) ergibt in der Icon-Leiste keinen Sinn → ausblenden,
       sekundäre Items immer als Icons zeigen. */
    html.sidebar-collapsed #navMoreToggle { display: none !important; }
    html.sidebar-collapsed #navMoreItems { display: block !important; }
    /* Tooltip im eingeklappten Zustand: natives title-Attribut (per JS gesetzt),
       da ein CSS-::after-Tooltip vom overflow:auto der .sidebar-nav abgeschnitten würde. */
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-sm);
    border: none;
    background: var(--gray-100);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.header-btn:hover {
    background: var(--primary-50);
    color: var(--primary);
}

.header-btn .notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid white;
}

/* ---- Dashboard Content ---- */
.dashboard-content {
    padding: 1.5rem;
}

/* Stat Cards */
.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

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

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.stat-card.vacation::after { background: var(--absence-vacation); }
.stat-card.sick::after { background: var(--absence-sick); }
.stat-card.pending::after { background: var(--warning); }
.stat-card.team::after { background: var(--primary); }

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.stat-card.vacation .stat-icon { background: #D1FAE5; color: var(--absence-vacation); }
.stat-card.sick .stat-icon { background: #FEE2E2; color: var(--absence-sick); }
.stat-card.pending .stat-icon { background: #FEF3C7; color: var(--warning); }
.stat-card.team .stat-icon { background: #DBEAFE; color: var(--primary); }

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--gray-500);
    font-weight: 500;
}

.stat-card .stat-detail {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Content Cards */
.content-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    overflow: hidden;
}

.content-card .card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
}

.content-card .card-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.content-card .card-body {
    padding: 1.25rem 1.5rem;
}

/* Quick Actions */
.quick-action {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: var(--border-radius-sm);
    background: var(--gray-50);
    border: 1px solid var(--gray-100);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 0.5rem;
}

.quick-action:hover {
    background: var(--primary-50);
    border-color: var(--primary-100);
    transform: translateX(4px);
}

.quick-action .action-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.quick-action:nth-child(1) .action-icon { background: #D1FAE5; color: var(--success); }
.quick-action:nth-child(2) .action-icon { background: #FEE2E2; color: var(--danger); }
.quick-action:nth-child(3) .action-icon { background: #DBEAFE; color: var(--info); }
.quick-action:nth-child(4) .action-icon { background: #FEF3C7; color: var(--warning); }

.quick-action .action-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-700);
}

/* Abwesenheitsliste */
.absence-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.absence-item:last-child { border-bottom: none; }

.absence-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.absence-details {
    flex: 1;
    min-width: 0;
}

.absence-details .name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-800);
}

.absence-details .type {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.absence-badge {
    padding: 0.2em 0.6em;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.absence-badge.vacation { background: #D1FAE5; color: #059669; }
.absence-badge.sick { background: #FEE2E2; color: #DC2626; }
.absence-badge.homeoffice { background: #DBEAFE; color: #2563EB; }
.absence-badge.travel { background: #FEF3C7; color: #D97706; }

/* Mini Kalender */
.mini-calendar {
    width: 100%;
}

.mini-calendar .cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.mini-calendar .cal-header h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-800);
}

.mini-calendar .cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}

.mini-calendar .cal-day-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    padding: 0.25rem;
}

.mini-calendar .cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    color: var(--gray-700);
}

.mini-calendar .cal-day:hover { background: var(--gray-100); }
.mini-calendar .cal-day.today { background: var(--primary); color: white; font-weight: 700; }
.mini-calendar .cal-day.weekend { color: var(--gray-400); }
.mini-calendar .cal-day.holiday { color: var(--danger); font-weight: 600; }
.mini-calendar .cal-day.has-absence { position: relative; }
.mini-calendar .cal-day.has-absence::after {
    content: '';
    position: absolute;
    bottom: 2px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--success);
}
.mini-calendar .cal-day.other-month { color: var(--gray-300); }

/* ---- Jahreskalender-Tabelle ---- */
.calendar-table {
    font-size: 0.72rem;
    border-collapse: collapse;
}

.calendar-table th,
.calendar-table td {
    text-align: center;
    vertical-align: middle;
    padding: 0;
    border: 1px solid var(--gray-200);
}

.cal-name-col {
    text-align: left !important;
    white-space: nowrap;
    padding: 0.25rem 0.5rem !important;
    font-weight: 500;
    font-size: 0.78rem;
    min-width: 140px;
    background: white;
}

.cal-day-col {
    width: 28px;
    min-width: 28px;
    padding: 0.2rem !important;
}

.cal-day-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1;
}

.cal-dow {
    font-size: 0.6rem;
    color: var(--gray-400);
    font-weight: 500;
}

.cal-dom {
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--gray-700);
}

.cal-weekend {
    background: var(--gray-100) !important;
}

.cal-weekend .cal-dom,
.cal-weekend .cal-dow {
    color: var(--gray-400);
}

.cal-holiday {
    background: #ffebee !important;
}

.cal-holiday .cal-dom {
    color: var(--danger);
}

.cal-today {
    background: var(--primary-100) !important;
}

.cal-today .cal-dom {
    color: var(--primary);
    font-weight: 800;
}

.cal-cell {
    width: 28px;
    height: 26px;
    padding: 0 !important;
    position: relative;
    cursor: default;
    transition: opacity 0.15s ease;
}

.cal-cell-text {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: white;
    font-weight: 700;
    font-size: 0.6rem;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}

.cal-avatar {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.55rem;
    flex-shrink: 0;
}

.cal-emp-name {
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

.dept-separator td {
    border-left: none !important;
    border-right: none !important;
}

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

.status-approved {
    background: var(--success-light);
    color: #059669;
}

.status-pending {
    background: var(--warning-light);
    color: #D97706;
}

.status-rejected {
    background: var(--danger-light);
    color: #DC2626;
}

.status-cancelled {
    background: var(--gray-100);
    color: var(--gray-500);
}

/* ---- Kalender Scroll-Indikation (Mobile) ---- */
.cal-scroll-wrapper {
    position: relative;
}
.cal-scroll-wrapper .table-responsive {
    position: relative;
}
.cal-scroll-hint {
    display: none;
}
@media (max-width: 768px) {
    .cal-scroll-wrapper::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 24px;
        background: linear-gradient(to right, transparent, rgba(0,0,0,0.06));
        pointer-events: none;
        z-index: 3;
        border-radius: 0 var(--border-radius) var(--border-radius) 0;
        transition: opacity 0.3s;
    }
    .cal-scroll-wrapper.scrolled-end::after {
        opacity: 0;
    }
    .cal-scroll-hint {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.4rem;
        padding: 0.35rem 0.75rem;
        font-size: 0.72rem;
        color: var(--gray-400);
        background: var(--gray-50);
        border-radius: 20px;
        margin: 0.35rem auto 0;
        width: fit-content;
    }
    .cal-scroll-hint i {
        font-size: 0.85rem;
    }
}

/* ---- Responsive Kalender ---- */
@media (max-width: 991px) {
    .cal-name-col {
        min-width: 100px !important;
    }
    .cal-emp-name {
        max-width: 70px;
    }
}

@media (max-width: 575px) {
    .cal-name-col {
        min-width: 80px !important;
        font-size: 0.72rem !important;
        padding: 0.2rem 0.35rem !important;
    }
    .cal-emp-name {
        max-width: 55px;
        font-size: 0.7rem;
    }
    .cal-avatar {
        width: 20px;
        height: 20px;
        font-size: 0.6rem;
        border-radius: 4px;
    }
    .cal-day-col {
        width: clamp(28px, 5vw, 36px);
        min-width: clamp(28px, 5vw, 36px);
    }
    .cal-cell {
        width: clamp(28px, 5vw, 36px);
        height: 22px;
    }
    .cal-cell-text {
        font-size: clamp(0.65rem, 2vw, 0.85rem);
    }
    .cal-dom {
        font-size: clamp(0.65rem, 2vw, 0.85rem);
    }
    .cal-dow {
        font-size: clamp(0.6rem, 1.8vw, 0.75rem);
    }
    .calendar-table {
        font-size: clamp(0.65rem, 2vw, 0.85rem);
    }
    /* Tooltip auf Mobile nicht anzeigen (Touch hat kein Hover) */
    #blackoutTooltip {
        display: none !important;
    }
    /* Toast zentriert auf Mobile */
    #blackoutToast {
        bottom: 4rem;
        max-width: calc(100% - 1rem);
        font-size: 0.8rem;
    }
}

/* ---- Mobile Responsive ---- */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 999;
        backdrop-filter: blur(2px);
    }

    .sidebar-overlay.active { display: block; }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: flex;
    }

    .dashboard-content {
        padding: 1rem;
    }

    /* Impersonation Banner mobile */
    .impersonation-banner {
        height: auto;
        min-height: 42px;
    }
    .impersonation-banner-inner {
        flex-wrap: wrap;
        gap: 0.35rem;
        padding: 0.4rem 0.75rem;
    }
    .impersonation-info {
        font-size: 0.75rem;
    }
    .impersonation-exit-btn {
        font-size: 0.72rem;
        padding: 0.2rem 0.5rem;
    }
    body.impersonating .sidebar {
        top: var(--notice-h, 0);
        height: calc(100vh - var(--notice-h, 0px));
    }
}

@media (max-width: 575px) {
    .stat-card {
        padding: 1rem;
    }

    .stat-card .stat-value {
        font-size: 1.4rem;
    }

    .stat-card .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }

    .page-title {
        font-size: 1.05rem;
    }

    .login-card {
        padding: 2rem 1.5rem;
    }

    /* Touch-Targets: mindestens 44px */
    .btn-sm {
        min-height: 44px;
        min-width: 44px;
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    .btn-xs {
        min-height: 38px;
        min-width: 38px;
    }

    /* Inline-Buttons in Tabellen kleiner aber Touch-tauglich (Apple HIG: min 40px) */
    td .btn-sm, th .btn-sm {
        min-height: 40px;
        min-width: 40px;
        padding: 0.35rem 0.6rem;
    }

    /* Modals fast-fullscreen auf Mobile */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    .modal-dialog.modal-lg,
    .modal-dialog.modal-xl {
        max-width: calc(100% - 1rem);
    }

    .modal-body {
        padding: 1rem;
    }

    /* Nav-Tabs horizontal scrollbar auf Mobile */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0;
        padding-bottom: 2px;
    }
    .nav-tabs::-webkit-scrollbar { display: none; }
    .nav-tabs .nav-item { white-space: nowrap; flex-shrink: 0; }
    .nav-tabs .nav-link { padding: 0.5rem 0.85rem; font-size: 0.82rem; }

    /* Scroll-Hinweis für Tabs */
    .nav-tabs::after {
        content: '';
        display: block;
        min-width: 1px;
        flex-shrink: 0;
    }

    /* Kalender-Legende besser lesbar */
    .content-card .card-body .d-flex.flex-wrap.gap-3 {
        font-size: 0.82rem;
    }

    /* Content Cards: weniger Padding */
    .content-card .card-header {
        padding: 1rem;
    }
    .content-card .card-body {
        padding: 1rem;
    }

    /* Tabellen: kleinere Schrift + kompakter */
    .table {
        font-size: 0.8rem;
    }
    .table th, .table td {
        padding: 0.5rem 0.65rem;
    }

    /* Flex-Container mit vielen Items wrappen */
    .d-flex.gap-2:not(.flex-nowrap),
    .d-flex.gap-3:not(.flex-nowrap) {
        flex-wrap: wrap;
    }

    /* Badge-Reihen auf Mobile wrappen */
    .d-flex.flex-wrap.gap-2 .badge {
        font-size: 0.75rem;
    }

    /* Alert-Banner kompakter */
    .alert {
        padding: 0.85rem 1rem;
        font-size: 0.85rem;
    }
    .alert .flex-grow-1 div:first-child {
        font-size: 0.88rem;
    }

    /* Header: kompakter */
    .app-header {
        padding: 0 1rem;
        height: 56px;
    }

    /* Dashboard Content: weniger Padding */
    .dashboard-content {
        padding: 0.75rem;
    }

    /* Absence-Items: kompakter */
    .absence-item {
        padding: 0.65rem 0;
        gap: 0.5rem;
    }
    .absence-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.7rem;
    }

    /* Quick-Actions: Touch-optimiert */
    .quick-action {
        padding: 0.75rem;
        min-height: 48px;
    }

    /* Form-Controls: größere Touch-Targets */
    .form-control, .form-select {
        min-height: 44px;
        font-size: 16px; /* verhindert iOS Zoom */
    }
    .form-control-sm, .form-select-sm {
        min-height: 40px;
        font-size: 16px;
    }

    /* Dropdown-Items: Touch-tauglich */
    .dropdown-item {
        padding: 0.6rem 1rem;
    }
}

/* Extra-Small: unter 380px (iPhone SE, kleine Android) */
@media (max-width: 380px) {
    .stat-card .stat-value {
        font-size: 1.2rem;
    }
    .stat-card .stat-label {
        font-size: 0.75rem;
    }
    .stat-card .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    .page-title {
        font-size: 0.95rem;
    }
    .dashboard-content {
        padding: 0.5rem;
    }
    .row.g-3 {
        --bs-gutter-x: 0.5rem;
        --bs-gutter-y: 0.5rem;
    }
}

/* ---- Dashboard Alert-Banner ---- */
.dash-alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: none;
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    color: #fff;
}
.dash-alert .dash-alert-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.dash-alert .dash-alert-icon i {
    font-size: 1.4rem;
}
.dash-alert .dash-alert-title {
    font-weight: 700;
    font-size: 0.95rem;
}
.dash-alert .dash-alert-sub {
    font-size: 0.82rem;
    opacity: 0.8;
    margin-top: 0.15rem;
}
.dash-alert .dash-alert-btn {
    border-radius: 50px;
    white-space: nowrap;
    color: #fff;
}
/* Varianten */
.dash-alert-clockin {
    background: linear-gradient(135deg, #0f172a, #1e3a5f);
    box-shadow: 0 4px 15px rgba(8,145,178,0.25);
}
.dash-alert-clockin .dash-alert-icon { background: rgba(8,145,178,0.3); }
.dash-alert-clockin .dash-alert-icon i { color: #67e8f9; }
.dash-alert-clockin .dash-alert-btn { background: rgba(8,145,178,0.4); border: 1px solid rgba(8,145,178,0.5); }

.dash-alert-clocked {
    background: linear-gradient(135deg, #064e3b, #065f46);
}
.dash-alert-clocked .dash-alert-icon { background: rgba(16,185,129,0.25); }
.dash-alert-clocked .dash-alert-icon i { color: #6ee7b7; }
.dash-alert-clocked .dash-alert-btn { background: rgba(16,185,129,0.3); border: 1px solid rgba(16,185,129,0.4); }

.dash-alert-substitute {
    background: linear-gradient(135deg, #4c1d95, #6d28d9);
}
.dash-alert-substitute .dash-alert-icon { background: rgba(167,139,250,0.25); }
.dash-alert-substitute .dash-alert-icon i { color: #c4b5fd; }
.dash-alert-substitute .dash-alert-btn { background: rgba(167,139,250,0.3); border: 1px solid rgba(167,139,250,0.4); }

.dash-alert-expiry-warn {
    background: linear-gradient(135deg, #92400e, #b45309);
    box-shadow: 0 4px 15px rgba(180,83,9,0.25);
}
.dash-alert-expiry-warn .dash-alert-icon { background: rgba(251,191,36,0.25); }
.dash-alert-expiry-warn .dash-alert-icon i { color: #fde68a; }
.dash-alert-expiry-warn .dash-alert-btn { background: rgba(251,191,36,0.3); border: 1px solid rgba(251,191,36,0.4); }

.dash-alert-expiry-expired {
    background: linear-gradient(135deg, #7f1d1d, #991b1b);
}
.dash-alert-expiry-expired .dash-alert-icon { background: rgba(248,113,113,0.25); }
.dash-alert-expiry-expired .dash-alert-icon i { color: #fca5a5; }

/* ---- Animationen ---- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.fade-in { animation: fadeIn 0.4s ease-out; }
.fade-in-up { animation: fadeInUp 0.5s ease-out; }

.delay-1 { animation-delay: 0.1s; animation-fill-mode: both; }
.delay-2 { animation-delay: 0.2s; animation-fill-mode: both; }
.delay-3 { animation-delay: 0.3s; animation-fill-mode: both; }
.delay-4 { animation-delay: 0.4s; animation-fill-mode: both; }

/* ---- Urlaubsbalken ---- */
.vacation-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.75rem;
}

.vacation-bar .bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--success), var(--accent));
    transition: width 1s ease-out;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ═══════════════════════════════════════════════
   ONBOARDING WIZARD
═══════════════════════════════════════════════ */
.onboarding-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    z-index: 1040;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37,99,235,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    transition: transform 0.2s, box-shadow 0.2s;
}
.onboarding-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(37,99,235,0.55);
}
.onboarding-fab.pulse {
    animation: onboardingPulse 2s ease-in-out infinite;
}
.onboarding-fab.fly-to-menu {
    animation: obFlyToMenu 0.55s cubic-bezier(0.68,-0.55,0.27,1.55) forwards;
}

@keyframes onboardingPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37,99,235,0.65); }
    60%       { box-shadow: 0 0 0 16px rgba(37,99,235,0); }
}
@keyframes obFlyToMenu {
    0%   { transform: scale(1) translate(0,0); opacity:1; }
    100% { transform: scale(0.12) translate(-820px,180px); opacity:0; }
}

/* Wizard Steps */
.ob-step { display: none; }
.ob-step.active { display: block; animation: fadeInUp 0.35s ease-out; }

/* Sidebar Tour-Link Einblend-Animation */
.ob-sidebar-tour { transition: opacity 0.3s; }
.ob-sidebar-appear { animation: fadeIn 0.4s ease-out; }

/* ========== Accessibility ========== */

/* Skip-Navigation */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--primary, #0d6efd);
    color: #fff;
    padding: .75rem 1.5rem;
    z-index: 10000;
    font-weight: 700;
    text-decoration: none;
    border-radius: 0 0 8px 0;
    transition: top .2s;
}
.skip-link:focus {
    top: 0;
    color: #fff;
    outline: 2px solid var(--primary-dark);
}

/* Focus-Styles */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
button:focus-visible,
.btn:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* =============================================
   DARK MODE
   ============================================= */
[data-theme="dark"] {
    --card-bg: #1e293b;

    /* Primärfarben — leicht aufgehellt für dunklen Hintergrund */
    --primary: #3B82F6;
    --primary-light: #60A5FA;
    --primary-dark: #2563EB;
    --primary-50: rgba(59,130,246,0.12);
    --primary-100: rgba(59,130,246,0.18);

    /* Akzentfarben */
    --accent: #22D3EE;
    --accent-light: #67E8F9;

    /* Grautöne — invertiert für Dark Mode */
    --gray-50: #0f172a;
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-400: #94a3b8;
    --gray-500: #94a3b8;
    --gray-600: #cbd5e1;
    --gray-700: #e2e8f0;
    --gray-800: #e2e8f0;
    --gray-900: #f1f5f9;

    /* Statusfarben — leicht aufgehellt */
    --success: #34D399;
    --success-light: rgba(16,185,129,0.15);
    --warning: #FBBF24;
    --warning-light: rgba(245,158,11,0.15);
    --danger: #F87171;
    --danger-light: rgba(239,68,68,0.15);
    --info: #60A5FA;
    --info-light: rgba(59,130,246,0.15);

    /* Shadows — dunkler/subtiler */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -1px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -2px rgba(0,0,0,0.3);

    color-scheme: dark;
}

/* Body */
[data-theme="dark"] body {
    background: #0f172a;
    color: #e2e8f0;
}

/* Sidebar */
[data-theme="dark"] .sidebar {
    background: #1e293b;
    border-right-color: #334155;
}

[data-theme="dark"] .sidebar-header {
    border-bottom-color: #334155;
}

[data-theme="dark"] .sidebar-header > div > div {
    color: #f1f5f9;
}

[data-theme="dark"] .sidebar-footer {
    border-top-color: #334155;
}

[data-theme="dark"] .user-menu:hover {
    background: #334155;
}

[data-theme="dark"] .user-info .name {
    color: #e2e8f0;
}

/* Header */
[data-theme="dark"] .app-header {
    background: #1e293b;
    border-bottom-color: #334155;
}

[data-theme="dark"] .page-title {
    color: #f1f5f9;
}

[data-theme="dark"] .menu-toggle {
    color: #94a3b8;
}

[data-theme="dark"] .header-btn {
    background: #334155;
    color: #94a3b8;
}

[data-theme="dark"] .header-btn:hover {
    background: rgba(59,130,246,0.15);
    color: #60A5FA;
}

[data-theme="dark"] .header-btn .notification-dot {
    border-color: #1e293b;
}

/* Cards */
[data-theme="dark"] .stat-card,
[data-theme="dark"] .content-card {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .content-card .card-header {
    background: #1e293b;
    border-bottom-color: #334155;
}

[data-theme="dark"] .content-card .card-header h3 {
    color: #e2e8f0;
}

[data-theme="dark"] .stat-card .stat-value {
    color: #f1f5f9;
}

/* Stat-Card Icon-Hintergründe */
[data-theme="dark"] .stat-card.vacation .stat-icon { background: rgba(16,185,129,0.15); }
[data-theme="dark"] .stat-card.sick .stat-icon { background: rgba(239,68,68,0.15); }
[data-theme="dark"] .stat-card.pending .stat-icon { background: rgba(245,158,11,0.15); }
[data-theme="dark"] .stat-card.team .stat-icon { background: rgba(59,130,246,0.15); }

/* Quick Actions */
[data-theme="dark"] .quick-action {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .quick-action:hover {
    background: rgba(59,130,246,0.1);
    border-color: rgba(59,130,246,0.3);
}

[data-theme="dark"] .quick-action .action-text {
    color: #e2e8f0;
}

[data-theme="dark"] .quick-action:nth-child(1) .action-icon { background: rgba(16,185,129,0.15); }
[data-theme="dark"] .quick-action:nth-child(2) .action-icon { background: rgba(239,68,68,0.15); }
[data-theme="dark"] .quick-action:nth-child(3) .action-icon { background: rgba(59,130,246,0.15); }
[data-theme="dark"] .quick-action:nth-child(4) .action-icon { background: rgba(245,158,11,0.15); }

/* Absence Items */
[data-theme="dark"] .absence-item {
    border-bottom-color: #334155;
}

[data-theme="dark"] .absence-details .name {
    color: #e2e8f0;
}

[data-theme="dark"] .absence-badge.vacation { background: rgba(16,185,129,0.15); color: #34d399; }
[data-theme="dark"] .absence-badge.sick { background: rgba(239,68,68,0.15); color: #f87171; }
[data-theme="dark"] .absence-badge.homeoffice { background: rgba(59,130,246,0.15); color: #60a5fa; }
[data-theme="dark"] .absence-badge.travel { background: rgba(245,158,11,0.15); color: #fbbf24; }

/* Mini-Kalender */
[data-theme="dark"] .mini-calendar .cal-day {
    color: #cbd5e1;
}

[data-theme="dark"] .mini-calendar .cal-day:hover {
    background: #334155;
}

[data-theme="dark"] .mini-calendar .cal-day.weekend {
    color: #64748b;
}

[data-theme="dark"] .mini-calendar .cal-day.other-month {
    color: #475569;
}

/* Jahreskalender */
[data-theme="dark"] .calendar-table th,
[data-theme="dark"] .calendar-table td {
    border-color: #334155;
}

[data-theme="dark"] .cal-name-col {
    background: #1e293b;
    color: #e2e8f0;
}

[data-theme="dark"] .cal-weekend {
    background: #162032 !important;
}

[data-theme="dark"] .cal-weekend .cal-dom,
[data-theme="dark"] .cal-weekend .cal-dow {
    color: #64748b;
}

[data-theme="dark"] .cal-holiday {
    background: rgba(239,68,68,0.12) !important;
}

[data-theme="dark"] .cal-today {
    background: rgba(59,130,246,0.2) !important;
}

[data-theme="dark"] .cal-dom {
    color: #cbd5e1;
}

/* Login-Seite */
[data-theme="dark"] .login-card {
    background: #1e293b;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

[data-theme="dark"] .login-logo h1 {
    color: #f1f5f9;
}

[data-theme="dark"] .login-logo p {
    color: #94a3b8;
}

[data-theme="dark"] .form-floating .form-control {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .form-floating .form-control:focus {
    background: #1e293b;
    border-color: #3b82f6;
}

/* Vacation Bar */
[data-theme="dark"] .vacation-bar {
    background: #334155;
}

/* Scrollbar */
[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #475569;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* ---- Bootstrap Overrides für Dark Mode ---- */

/* Tables */
[data-theme="dark"] .table {
    color: #e2e8f0;
    --bs-table-bg: transparent;
    --bs-table-border-color: #334155;
    --bs-table-striped-bg: rgba(255,255,255,0.03);
    --bs-table-hover-bg: rgba(255,255,255,0.05);
}

[data-theme="dark"] .table th {
    color: #94a3b8;
    background: #162032;
    border-color: #334155;
}

[data-theme="dark"] .table td {
    border-color: #334155;
}

[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-bg-type: rgba(255,255,255,0.03);
}

[data-theme="dark"] .table-hover > tbody > tr:hover > * {
    --bs-table-bg-state: rgba(255,255,255,0.05);
}

/* Modals */
[data-theme="dark"] .modal-content {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .modal-header {
    border-bottom-color: #334155;
}

[data-theme="dark"] .modal-footer {
    border-top-color: #334155;
}

[data-theme="dark"] .modal-header .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Form Controls */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background-color: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background-color: #1e293b;
    border-color: #3b82f6;
    color: #e2e8f0;
    box-shadow: 0 0 0 4px rgba(59,130,246,0.15);
}

[data-theme="dark"] .form-control::placeholder {
    color: #64748b;
}

[data-theme="dark"] .form-label {
    color: #cbd5e1;
}

[data-theme="dark"] .form-text,
[data-theme="dark"] .text-muted {
    color: #64748b !important;
}

[data-theme="dark"] .input-group-text {
    background-color: #334155;
    border-color: #334155;
    color: #94a3b8;
}

/* Dropdowns */
[data-theme="dark"] .dropdown-menu {
    background-color: #1e293b;
    border-color: #334155;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

[data-theme="dark"] .dropdown-item {
    color: #e2e8f0;
}

[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
    background-color: #334155;
    color: #f1f5f9;
}

[data-theme="dark"] .dropdown-divider {
    border-color: #334155;
}

/* Alerts */
[data-theme="dark"] .alert-info {
    background: rgba(59,130,246,0.12);
    border-color: rgba(59,130,246,0.25);
    color: #93c5fd;
}

[data-theme="dark"] .alert-warning {
    background: rgba(245,158,11,0.12);
    border-color: rgba(245,158,11,0.25);
    color: #fcd34d;
}

[data-theme="dark"] .alert-danger {
    background: rgba(239,68,68,0.12);
    border-color: rgba(239,68,68,0.25);
    color: #fca5a5;
}

[data-theme="dark"] .alert-success {
    background: rgba(16,185,129,0.12);
    border-color: rgba(16,185,129,0.25);
    color: #6ee7b7;
}

/* Nav Tabs */
[data-theme="dark"] .nav-tabs {
    border-bottom-color: #334155;
}

[data-theme="dark"] .nav-tabs .nav-link {
    color: #94a3b8;
}

[data-theme="dark"] .nav-tabs .nav-link:hover {
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .nav-tabs .nav-link.active {
    background: #1e293b;
    border-color: #334155 #334155 #1e293b;
    color: #f1f5f9;
}

/* Buttons */
[data-theme="dark"] .btn-outline-secondary {
    border-color: #475569;
    color: #94a3b8;
}

[data-theme="dark"] .btn-outline-secondary:hover {
    background: #334155;
    border-color: #64748b;
    color: #e2e8f0;
}

[data-theme="dark"] .btn-secondary {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .btn-light {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Badges */
[data-theme="dark"] .badge.bg-light {
    background: #334155 !important;
    color: #e2e8f0 !important;
}

/* Cards (Bootstrap) */
[data-theme="dark"] .card {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .card-header {
    background: #1e293b;
    border-bottom-color: #334155;
}

[data-theme="dark"] .card-footer {
    background: #1e293b;
    border-top-color: #334155;
}

/* Progress Bars */
[data-theme="dark"] .progress {
    background-color: #334155;
}

/* List Group */
[data-theme="dark"] .list-group-item {
    background-color: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

/* Borders */
[data-theme="dark"] .border,
[data-theme="dark"] .border-bottom,
[data-theme="dark"] .border-top,
[data-theme="dark"] .border-start,
[data-theme="dark"] .border-end {
    border-color: #334155 !important;
}

/* Background utilities */
[data-theme="dark"] .bg-white {
    background-color: #1e293b !important;
}

[data-theme="dark"] .bg-light {
    background-color: #0f172a !important;
}

[data-theme="dark"] [style*="background:#f8f9fa"],
[data-theme="dark"] [style*="background: #f8f9fa"] {
    background: #0f172a !important;
}

/* Notification-Dropdown */
[data-theme="dark"] #notificationDropdown {
    background: #1e293b;
}

[data-theme="dark"] #notificationDropdown .border-bottom {
    border-color: #334155 !important;
}

[data-theme="dark"] #notificationDropdown [style*="background:#f8f9fa"] {
    background: #162032 !important;
}

[data-theme="dark"] .notif-item:hover {
    background: #334155;
}

[data-theme="dark"] .bg-primary-subtle {
    background-color: rgba(59,130,246,0.1) !important;
}

/* Sidebar Footer Dropdown */
[data-theme="dark"] .sidebar-footer-dropdown {
    background: #1e293b;
    border-color: #334155;
}

/* Sidebar Overlay */
[data-theme="dark"] .sidebar-overlay.active {
    background: rgba(0,0,0,0.6);
}

/* Pagination */
[data-theme="dark"] .page-link {
    background-color: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

[data-theme="dark"] .page-link:hover {
    background-color: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .page-item.active .page-link {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

/* Dark Mode Toggle Button */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-sm);
    border: none;
    background: var(--gray-100);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.15rem;
    position: relative;
}

.theme-toggle:hover {
    background: var(--primary-50);
    color: var(--primary);
}

[data-theme="dark"] .theme-toggle {
    background: #334155;
    color: #fbbf24;
}

[data-theme="dark"] .theme-toggle:hover {
    background: rgba(251,191,36,0.15);
    color: #fbbf24;
}

/* Kostenlose-Version Badge in Dark Mode */
[data-theme="dark"] .sidebar-header [style*="background:#fef3c7"] {
    background: rgba(146,64,14,0.3) !important;
    color: #fcd34d !important;
    border-color: rgba(252,211,77,0.3) !important;
}

/* =============================================
   Skeleton Loading States
   ============================================= */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}
@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text-sm { height: 10px; margin-bottom: 6px; width: 60%; }
.skeleton-card { height: 80px; margin-bottom: 12px; border-radius: 8px; }
.skeleton-circle { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--gray-100);
}

.spinner-inline {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e0e0e0;
    border-top-color: var(--primary, #0d6efd);
    border-radius: 50%;
    animation: spin .6s linear infinite;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.75;
}
.btn-loading .btn-text { visibility: hidden; }
.btn-loading .btn-spinner {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* Dark Mode Skeleton */
[data-theme="dark"] .skeleton {
    background: linear-gradient(90deg, #2d3748 25%, #4a5568 50%, #2d3748 75%);
    background-size: 200% 100%;
}
[data-theme="dark"] .skeleton-notif-item {
    border-bottom-color: #374151;
}

/* Help icon + iOS nav badge (extracted from layout_header.php) */
.help-icon{cursor:pointer;color:var(--gray-400);font-size:.85em;margin-left:.35rem;transition:color .15s;vertical-align:middle;}
.help-icon:hover{color:var(--primary);}
@keyframes _ios-shimmer{0%{background-position:-200% center}100%{background-position:200% center}}
.slup-ios-nav-link{color:var(--gray-600)!important;}
.slup-ios-nav-link:hover{background:transparent!important;}
.slup-ios-nav-inner{display:flex;align-items:center;gap:.5rem;width:100%;}
.slup-ios-badge{
    margin-left:auto;font-size:.62rem;font-weight:700;letter-spacing:.02em;
    padding:.18rem .45rem;border-radius:999px;
    background:linear-gradient(105deg,#fff9d6 0%,#ffe566 25%,#ffd700 50%,#ffe566 75%,#fff9d6 100%);
    background-size:200% auto;
    animation:_ios-shimmer 2.8s linear infinite;
    color:#7a5500;border:1px solid rgba(212,175,55,.5);
    box-shadow:0 1px 4px rgba(212,175,55,.25);
    white-space:nowrap;flex-shrink:0;
}
.sidebar.collapsed .slup-ios-badge{display:none;}
.sidebar.collapsed .slup-ios-nav-inner{justify-content:center;}

/* Feature-Gate Block (includes/feature_gate.php) */
.feature-gate-card{background:var(--card-bg,#fff);border-radius:1.25rem;padding:2.5rem 2rem;text-align:center;box-shadow:0 4px 24px rgba(0,0,0,.08);}
.feature-gate-icon{width:72px;height:72px;background:#f1f5f9;border-radius:50%;display:flex;align-items:center;justify-content:center;margin:0 auto 1.5rem;font-size:2rem;}
.feature-gate-title{font-size:1.35rem;font-weight:800;margin-bottom:.5rem;}
.feature-gate-text{color:#64748b;font-size:.9rem;line-height:1.6;margin-bottom:1.5rem;}
.feature-gate-back{display:block;margin-top:.75rem;color:#94a3b8;font-size:.85rem;text-decoration:none;}
