        /* --- CORE VARIABLES --- */
        :root {
            --bg-deep: #030305;
            --bg-glass: rgba(22, 22, 26, 0.65);
            --bg-sidebar: rgba(10, 10, 12, 0.95);
            --sidebar-width: 220px;
            --primary: #a855f7;
            --primary-rgb: 168, 85, 247;
            --primary-dim: rgba(var(--primary-rgb), 0.1);
            --text-main: #f8fafc;
            --text-muted: #94a3b8;
            --success: #10b981;
            --danger: #ef4444;
            --school: #3b82f6; 
            --holiday: #f59e0b; 
            --audit-ok: #10b981;
            --audit-warn: #fbbf24;
            --ihk: #ff6347; /* IHK/Karriere Farbe (Tomato) */
            --work-color: var(--primary); 
            --expected-color: #64748b; 
            --border: rgba(255, 255, 255, 0.06);
            --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            --font-mono: 'JetBrains Mono', 'Roboto Mono', monospace;
            --radius: 20px;
            --note-good: #10b981; /* Für Noten 1.0 - 2.0 */
            --note-mid: #fbbf24; /* Für Noten 2.1 - 3.0 */
            --note-bad: #ef4444; /* Für Noten > 3.0 */
            --heatmap-low: #1e293b;
            --heatmap-mid: #64748b;
            --heatmap-high: var(--primary);
            /* Farben für Ziel-Kategorien */
            --goal-work: var(--primary);
            --goal-saldo: #06b6d4;
            --goal-weeks: #10b981;
            --goal-perfect: #f59e0b;
        }
        

        /* Light theme overrides (applied via data-theme="light" on <html>) */
        [data-theme="light"] {
            --bg-deep: #f8fafc;
            --bg-glass: rgba(255,255,255,0.85);
            --bg-sidebar: rgba(255,255,255,0.98);
            --text-main: #071023;
            --text-muted: #475569;
            --border: rgba(7, 16, 35, 0.06);
            --primary-dim: rgba(var(--primary-rgb), 0.08);
            --heatmap-low: #f1f5f9;
            --heatmap-mid: #cbd5e1;
        }

        * { margin: 0; padding: 0; box-sizing: border-box; }

        body {
            font-family: var(--font-main);
            background-color: var(--bg-deep);
            background-image: 
                radial-gradient(circle at 15% 15%, rgba(var(--primary-rgb), 0.08), transparent 40%),
                radial-gradient(circle at 85% 85%, rgba(var(--primary-rgb), 0.05), transparent 40%);
            color: var(--text-main);
            height: 100vh;
            display: flex;
            overflow: hidden;
        }
        

        .cloud-login-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 2000;
            display: flex !important;
            align-items: center;
            justify-content: center;
            padding: 2rem;
        }

        .cloud-login-modal[style*="display: none"] {
            display: none !important;
        }

        .cloud-login-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(7, 16, 35, 0.6);
            backdrop-filter: blur(2px);
            -webkit-backdrop-filter: blur(2px);
        }

        .cloud-login-box {
            position: relative;
            width: 100%;
            max-width: 500px;
            background: var(--bg-glass);
            border: 1px solid var(--border);
            padding: 2rem;
            border-radius: 14px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            z-index: 2010;
            animation: modalSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
        }

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

        .cloud-modal-close {
            position: absolute;
            top: 14px;
            right: 14px;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            border: 1px solid var(--border);
            background: transparent;
            cursor: pointer;
            font-size: 24px;
            color: var(--text-main);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
            padding: 0;
        }

        .cloud-modal-close:hover {
            background: rgba(var(--primary-rgb), 0.1);
            border-color: var(--primary);
            transform: scale(1.1);
        }

        .cloud-modal-close:active {
            transform: scale(0.95);
        }

        @media (max-width: 520px) {
            .cloud-login-box {
                padding: 1.5rem;
                border-radius: 12px;
                max-width: 95vw;
            }
            
            .cloud-login-modal {
                padding: 1rem;
            }
        }
        

        /* Range Slider Styling */
        input[type="range"] {
            -webkit-appearance: none;
            width: 100%;
            height: 6px;
            border-radius: 3px;
            background: linear-gradient(90deg, rgba(var(--primary-rgb),0.2) 0%, rgba(var(--primary-rgb),0.4) 50%, rgba(var(--primary-rgb),0.2) 100%);
            outline: none;
            cursor: pointer;
        }
        
        input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--primary), #8b5cf6);
            cursor: pointer;
            box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.6);
            transition: all 0.2s;
        }
        
        input[type="range"]::-webkit-slider-thumb:hover {
            box-shadow: 0 0 20px rgba(var(--primary-rgb), 0.8);
            transform: scale(1.2);
        }
        
        input[type="range"]::-moz-range-thumb {
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--primary), #8b5cf6);
            cursor: pointer;
            border: none;
            box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.6);
            transition: all 0.2s;
        }
        
        input[type="range"]::-moz-range-thumb:hover {
            box-shadow: 0 0 20px rgba(var(--primary-rgb), 0.8);
            transform: scale(1.2);
        }


        /* --- CUSTOM SCROLLBAR (ÜBERALL) --- */
        ::-webkit-scrollbar {
            width: 10px;
            height: 10px;
        }

        ::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.03);
            border-radius: 10px;
        }

        ::-webkit-scrollbar-thumb {
            background: linear-gradient(180deg, var(--primary), rgba(var(--primary-rgb), 0.7));
            border-radius: 10px;
            border: 2px solid rgba(255, 255, 255, 0.05);
            transition: background 0.3s ease;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.9), var(--primary));
            box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.4);
        }

        /* Firefox Scrollbar */
        * {
            scrollbar-color: var(--primary) rgba(255, 255, 255, 0.03);
            scrollbar-width: thin;
        }


        /* External link style: small "open in new tab" icon */
        .external-link {
            color: inherit;
            text-decoration: underline dotted rgba(255,255,255,0.08);
            text-underline-offset: 3px;
            transition: color 0.18s ease, opacity 0.18s ease;
        }
        .external-link::after {
            content: "";
            display: inline-block;
            width: 0.95em;
            height: 0.95em;
            margin-left: 6px;
            vertical-align: text-bottom;
            background-repeat: no-repeat;
            background-size: contain;
            background-position: center;
            opacity: 0.95;
            pointer-events: none;
            background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a855f7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M7 17L17 7'/><path d='M7 7h10v10'/></svg>");
        }
        .external-link:hover { color: var(--primary); opacity: 0.95; }

        /* =============================================================

        /* --- MAIN CONTENT & VIEWS --- */
        .main {
            flex: 1;
            transition: margin-left 0.3s ease-in-out;
        }

        .view-section { display: none; animation: fadeIn 0.4s ease forwards; }
        .view-section.active { display: block; }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }


        /* ===== AMBIENT FLOATING ORBS ===== */
        .ambient-orbs {
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            pointer-events: none;
            z-index: 0;
            overflow: hidden;
        }
        .ambient-orb {
            position: absolute;
            border-radius: 50%;
            filter: blur(80px);
            opacity: 0;
            animation: orbFloat linear infinite, orbFadeIn 2s ease forwards;
            will-change: transform, opacity;
        }
        .ambient-orb.orb-1 {
            width: 350px; height: 350px;
            background: radial-gradient(circle, rgba(var(--primary-rgb),0.12), transparent 70%);
            top: 10%; left: 15%;
            animation-duration: 25s;
            animation-delay: 0s;
        }
        .ambient-orb.orb-2 {
            width: 280px; height: 280px;
            background: radial-gradient(circle, rgba(6,182,212,0.1), transparent 70%);
            top: 60%; right: 10%;
            animation-duration: 30s;
            animation-delay: 0.5s;
        }
        .ambient-orb.orb-3 {
            width: 220px; height: 220px;
            background: radial-gradient(circle, rgba(16,185,129,0.08), transparent 70%);
            bottom: 15%; left: 40%;
            animation-duration: 22s;
            animation-delay: 1s;
        }
        @keyframes orbFloat {
            0%   { transform: translate(0, 0) scale(1); }
            25%  { transform: translate(40px, -30px) scale(1.05); }
            50%  { transform: translate(-20px, 20px) scale(0.95); }
            75%  { transform: translate(30px, 40px) scale(1.03); }
            100% { transform: translate(0, 0) scale(1); }
        }
        @keyframes orbFadeIn {
            to { opacity: 1; }
        }


        /* ===== 3D CARD TILT + GLOW ===== */
        .card-3d {
            perspective: 800px;
        }
        .card-3d > .card,
        .card-3d > .kpi-grid > .card {
            transform-style: preserve-3d;
            transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
                        box-shadow 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
                        border-color 0.35s;
        }
        .card-3d > .card:hover,
        .card-3d > .kpi-grid > .card:hover {
            box-shadow: 0 12px 40px rgba(0,0,0,0.35);
            border-color: rgba(255, 255, 255, 0.1);
        }
        /* Cards with SVG filters: disable 3D to prevent glow clipping */
        .card-3d > .charts-row > .card,
        .card-3d > .card:has(svg),
        .card-3d > .charts-row .card,
        .card-3d > .kpi-grid > .card:has(svg) {
            transform-style: flat !important;
            perspective: none !important;
        }
        /* Prevent backdrop-filter from killing SVG drop-shadow glow in any card */
        .card:has(svg[class*="trend"]),
        .card:has(.trend-container),
        .card:has(.donut-container),
        .card:has(.progress-ring),
        .charts-row .card,
        .chart-deep-row {
            backdrop-filter: none !important;
            -webkit-backdrop-filter: none !important;
        }

        /* Glow halo on hover behind cards */
        .card-glow {
            position: relative;
        }
        .card-glow::before {
            content: '';
            position: absolute;
            top: 50%; left: 50%;
            width: 80%; height: 80%;
            transform: translate(-50%, -50%);
            background: radial-gradient(ellipse, rgba(255, 255, 255, 0.03), transparent 70%);
            border-radius: var(--radius);
            opacity: 0;
            transition: opacity 0.4s ease;
            pointer-events: none;
            z-index: -1;
        }
        .card-glow:hover::before {
            opacity: 1;
        }


        /* --- LOADING SPINNER & SKELETON --- */
        .loading-spinner {
            display: inline-block;
            width: 24px;
            height: 24px;
            border: 3px solid rgba(var(--primary-rgb), 0.2);
            border-radius: 50%;
            border-top-color: var(--primary);
            animation: spin 0.8s linear infinite;
        }
        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        .loading-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(3, 3, 5, 0.7);
            backdrop-filter: blur(8px);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 999;
            opacity: 1;
            transition: opacity 0.3s ease;
        }
        .loading-overlay.hidden {
            opacity: 0;
            pointer-events: none;
        }

        .loading-spinner-container {
            text-align: center;
        }
        .loading-spinner-container h2 {
            color: var(--text-main);
            font-size: 1.25rem;
            margin-top: 1.5rem;
            font-weight: 600;
        }

        /* Skeleton Loader */
        .skeleton {
            background: linear-gradient(90deg, rgba(var(--primary-rgb), 0.1) 0%, rgba(var(--primary-rgb), 0.2) 50%, rgba(var(--primary-rgb), 0.1) 100%);
            background-size: 200% 100%;
            animation: skeleton-loading 1.5s infinite;
            border-radius: 8px;
        }
        @keyframes skeleton-loading {
            0% { background-position: 200% 0; }
            100% { background-position: -200% 0; }
        }

        .skeleton-card {
            background: var(--bg-glass);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 1.75rem;
            margin-bottom: 1.5rem;
        }
        .skeleton-line {
            height: 16px;
            margin-bottom: 12px;
            border-radius: 8px;
            background: linear-gradient(90deg, rgba(var(--primary-rgb), 0.1) 0%, rgba(var(--primary-rgb), 0.2) 50%, rgba(var(--primary-rgb), 0.1) 100%);
            background-size: 200% 100%;
            animation: skeleton-loading 1.5s infinite;
        }
        .skeleton-line.full { width: 100%; }
        .skeleton-line.half { width: 60%; }
        


        /* --- PRINT STYLESHEET --- */
        @media print {
            /* Hide UI elements nicht nötig beim Drucken */
            .sidebar, .nav-item, .btn, .search-box, input[type="button"], button { display: none !important; }
            
            /* Optimale Seitenformat */
            body {
                background: white;
                color: black;
                margin: 0;
                padding: 1cm;
            }

            .main {
                width: 100%;
                margin-left: 0;
                padding: 0;
                max-height: 100%;
            }

            .main.full-width {
                margin-left: 0;
                width: 100%;
            }

            /* Karten für Druck optimieren */
            .card, .view-section {
                page-break-inside: avoid;
                background: white;
                border: 1px solid #ccc;
                box-shadow: none;
                margin-bottom: 1.5rem;
                padding: 1.5rem;
            }

            h1, h2, h3 { 
                page-break-after: avoid;
                color: #000;
                font-weight: bold;
                margin-top: 1.5rem;
            }

            /* Tabellen für Druck */
            table {
                width: 100%;
                border-collapse: collapse;
                page-break-inside: avoid;
            }

            table th {
                background: #f0f0f0;
                color: #000;
                font-weight: bold;
                border-bottom: 2px solid #333;
                padding: 0.75rem;
                text-align: left;
            }

            table td {
                border-bottom: 1px solid #ccc;
                padding: 0.75rem;
                color: #000;
            }

            table tr:last-child td {
                border-bottom: 2px solid #333;
            }

            /* Links sichtbar machen */
            a {
                color: #0066cc;
                text-decoration: underline;
            }

            /* QR-Codes und Bilder */
            img {
                max-width: 100%;
                height: auto;
                page-break-inside: avoid;
            }

            /* Hintergründe entfernen */
            * {
                background: transparent !important;
                box-shadow: none !important;
                backdrop-filter: none !important;
                -webkit-backdrop-filter: none !important;
            }

            /* Loading Spinner beim Druck verstecken */
            .loading-overlay, .loading-spinner { display: none !important; }

            /* Seitengröße und Ausrichtung */
            @page {
                size: A4;
                margin: 1cm;
            }

            /* Print-Button Helper */
            .print-only { display: block !important; }
            .no-print { display: none !important; }
        }


        /* --- GLASS CARDS (Refined) --- */
        .card {
            background: var(--bg-glass);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 1rem;
            margin-bottom: 1rem;
            box-shadow: 0 4px 20px rgba(0,0,0,0.2);
        }


        /* --- HEADER --- */
        .header { 
            display: flex; 
            justify-content: space-between; 
            align-items: flex-end; 
            margin-bottom: 1rem; 
            position: relative; /* Für den Mobile Button */
        }
        .greeting { font-size: 0.85rem; color: var(--primary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.5rem; }
        .page-title { font-size: 2rem; font-weight: 700; letter-spacing: -0.5px; }
        .date-badge { 
            background: rgba(255,255,255,0.03); padding: 10px 20px; border-radius: 50px; 
            border: 1px solid var(--border); font-family: var(--font-mono); font-size: 0.9rem; color: var(--text-muted); 
        }
        /* Mobile Menu Button */
        #mobileMenuToggle {
            display: none;
            position: absolute;
            top: 20px;
            left: 20px;
            background: var(--primary);
            color: #fff;
            border: none;
            padding: 10px 14px;
            border-radius: 8px;
            font-size: 1.2rem;
            cursor: pointer;
            z-index: 101;
        }



        /* --- INPUTS --- */
        .input-wrapper { display: grid; grid-template-columns: 1fr 300px; gap: 2rem; }
        
        .glass-input, .glass-select {
            background: rgba(0,0,0,0.3); border: 1px solid var(--border);
            padding: 16px; border-radius: 12px; color: #fff; font-size: 0.95rem; width: 100%; outline: none; transition: 0.2s;
            font-family: var(--font-main);
        }
        .glass-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-dim); background: rgba(0,0,0,0.4); }
        
        /* Textarea Scrollbar */
        textarea.glass-input {
            resize: vertical;
        }
        textarea.glass-input::-webkit-scrollbar {
            width: 8px;
        }
        textarea.glass-input::-webkit-scrollbar-thumb {
            background: linear-gradient(180deg, var(--primary), rgba(var(--primary-rgb), 0.6));
            border-radius: 8px;
        }
        textarea.glass-input::-webkit-scrollbar-thumb:hover {
            background: var(--primary);
        }
        
        .timer-box { 
            background: rgba(0,0,0,0.3); border: 1px solid var(--border); border-radius: 16px; padding: 1.5rem; 
            display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
        }
        .timer-display { font-family: var(--font-mono); font-size: 2rem; font-weight: 700; color: #fff; text-shadow: 0 0 20px rgba(0,0,0,0.5); }
        .timer-active .timer-display { color: var(--primary); text-shadow: 0 0 20px var(--primary); }
        
        .btn { border: none; padding: 14px 24px; border-radius: 12px; font-weight: 600; cursor: pointer; transition: 0.2s; font-size: 0.9rem; letter-spacing: 0.5px; }
        .btn-primary { background: var(--primary); color: #fff; width: 100%; box-shadow: 0 5px 20px -5px var(--primary); }
        .btn-primary:hover { filter: brightness(1.1); transform: translateY(-2px); }
        
        .btn-icon-row { display: flex; gap: 8px; width: 100%; }
        .btn-ghost { background: rgba(255,255,255,0.05); color: #fff; flex: 1; padding: 10px; }
        .btn-ghost:hover { background: rgba(255,255,255,0.1); }
        .btn.active { background: var(--primary); color: #fff; }

        /* Moderne Icon-Buttons für Bearbeiten und Löschen */
        .btn-icon {
            width: 32px;
            height: 32px;
            border-radius: 8px;
            border: none;
            background: rgba(255,255,255,0.05);
            color: var(--text-main);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s ease;
            font-size: 1rem;
        }
        .btn-icon:hover {
            background: rgba(255,255,255,0.15);
            transform: scale(1.05);
            box-shadow: 0 2px 8px rgba(0,0,0,0.2);
        }
        .btn-icon.danger:hover {
            background: var(--danger);
            color: #fff;
        }

        /* Very small slim help button that uses the theme color */
        .help-slim {
            width: 28px;
            height: 28px;
            padding: 0;
            border-radius: 6px;
            background: var(--primary);
            color: #fff;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 0.85rem;
            border: none;
            cursor: pointer;
            box-shadow: 0 4px 14px rgba(var(--primary-rgb),0.12);
        }
        .help-slim:hover { filter:brightness(1.05); }


        /* --- LISTS --- */
        .entry-row {
            display: flex; justify-content: space-between; align-items: center;
            background: rgba(255,255,255,0.02); padding: 16px 20px; border-radius: 14px;
            margin-bottom: 8px; border-left: 3px solid transparent; transition: 0.2s;
        }
        .entry-row:hover { background: rgba(255,255,255,0.04); padding-left: 24px; }
        .entry-row.type-work { border-color: var(--primary); }
        .entry-row.type-vacation { border-color: var(--success); }
        .entry-row.type-gleittag { border-color: #f59e0b; }
        .entry-row.type-sick { border-color: var(--danger); }
        .entry-row.type-school { border-color: var(--school); }
        .entry-row.type-holiday { border-color: var(--holiday); } 

        .entry-date { font-weight: 600; color: var(--text-main); font-size: 0.95rem; }
        .entry-meta { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }
        .tag { padding: 4px 10px; border-radius: 6px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; background: rgba(255,255,255,0.05); }
        .project-tag { background: rgba(var(--primary-rgb), 0.1); color: var(--primary); }
        

        /* --- Smooth number transition --- */
        .counter-animate {
            transition: color 0.5s;
        }


