
        /* === SECTION: VARIABLES & RESET === */
        :root {
            --primary: #1e40af;
            --primary-light: #3b82f6;
            --primary-lighter: #93c5fd;
            --primary-bg: #eff6ff;
            
            --success: #22c55e;
            --success-light: #dcfce7;
            --warning: #eab308;
            --warning-light: #fef08a;
            --info: #60a5fa;
            --info-light: #dbeafe;
            --danger: #ef4444;
            --danger-light: #fee2e2;

            --bg: #f8fafc;
            --card-bg: #ffffff;
            --border: #e2e8f0;
            
            --text-main: #0f172a;
            --text-muted: #64748b;

            --radius: 12px;
            --shadow: 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);
            
            --font-body: 'Plus Jakarta Sans', sans-serif;
            --font-heading: 'Syne', sans-serif;
        }

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

        body {
            font-family: var(--font-body);
            background-color: var(--bg);
            color: var(--text-main);
            line-height: 1.5;
            -webkit-font-smoothing: antialiased;
        }

        h1, h2, h3, h4, h5, h6 {
            font-family: var(--font-heading);
            color: var(--primary);
            font-weight: 700;
        }

        a {
            text-decoration: none;
            color: var(--primary-light);
        }

        /* === SECTION: LAYOUT & COMPONENTS === */
        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0.5rem 1.25rem;
            font-family: var(--font-body);
            font-weight: 600;
            border-radius: var(--radius);
            border: none;
            cursor: pointer;
            transition: all 0.2s ease;
            gap: 0.5rem;
            font-size: 0.9rem;
        }

        .btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
        }

        .btn-primary {
            background: linear-gradient(135deg, var(--primary-light), var(--primary));
            color: white;
        }

        .btn-danger {
            background: var(--danger);
            color: white;
        }
        
        .btn-danger:hover {
            box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
        }

        .btn-outline {
            background: transparent;
            border: 1px solid var(--border);
            color: var(--text-main);
        }
        
        .btn-outline:hover {
            background: var(--bg);
            box-shadow: none;
            transform: translateY(0);
        }

        .btn-small {
            padding: 0.25rem 0.75rem;
            font-size: 0.8rem;
        }

        .card {
            background: var(--card-bg);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            padding: 1.5rem;
            border: 1px solid var(--border);
        }

        .form-group {
            margin-bottom: 1rem;
        }

        .form-group label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 600;
            font-size: 0.9rem;
            color: var(--text-main);
        }

        .form-control {
            width: 100%;
            padding: 0.75rem 1rem;
            border: 1px solid var(--border);
            border-radius: 8px;
            font-family: var(--font-body);
            font-size: 0.95rem;
            transition: border-color 0.2s;
        }

        .form-control:focus {
            outline: none;
            border-color: var(--primary-light);
            box-shadow: 0 0 0 3px var(--primary-bg);
        }

        table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.95rem;
            min-width: 500px; /* Ensures table doesn't squash too much */
        }

        .table-responsive {
            width: 100%;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }

        th, td {
            padding: 1rem;
            text-align: left;
            border-bottom: 1px solid var(--border);
        }

        th {
            font-weight: 600;
            color: var(--text-muted);
            background-color: var(--bg);
            text-transform: uppercase;
            font-size: 0.8rem;
            letter-spacing: 0.5px;
        }

        tbody tr:hover {
            background-color: var(--bg);
        }

        .badge {
            padding: 0.25rem 0.75rem;
            border-radius: 9999px;
            font-size: 0.8rem;
            font-weight: 600;
            display: inline-block;
        }

        .badge-hadir { background: var(--success-light); color: var(--success); }
        .badge-sakit { background: var(--warning-light); color: #a16207; }
        .badge-izin { background: var(--info-light); color: var(--primary); }
        .badge-alpa { background: var(--danger-light); color: var(--danger); }
        
        .badge-admin { background: var(--primary-bg); color: var(--primary); }
        .badge-guru { background: var(--bg); color: var(--text-main); border: 1px solid var(--border); }

        /* === SECTION: LOGIN VIEW === */
        #login-view {
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, var(--primary-bg), var(--bg));
        }

        .login-card {
            width: 100%;
            max-width: 400px;
            text-align: center;
            padding: 2.5rem;
        }

        .login-card h1 {
            font-size: 1.75rem;
            margin-bottom: 0.5rem;
        }

        .login-card p {
            color: var(--text-muted);
            margin-bottom: 2rem;
            font-size: 0.95rem;
        }

        /* === SECTION: APP VIEW (LAYOUT) === */
        #app-view {
            display: flex;
            min-height: 100vh;
        }

        #sidebar {
            width: 260px;
            background: var(--card-bg);
            border-right: 1px solid var(--border);
            display: flex;
            flex-direction: column;
            position: fixed;
            height: 100vh;
            z-index: 10;
        }

        .sidebar-brand {
            padding: 1.5rem;
            border-bottom: 1px solid var(--border);
        }

        .sidebar-brand h2 {
            font-size: 1.25rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .sidebar-menu {
            padding: 1.5rem 1rem;
            flex: 1;
            overflow-y: auto;
        }

        .menu-item {
            display: flex;
            align-items: center;
            padding: 0.75rem 1rem;
            color: var(--text-muted);
            border-radius: 8px;
            font-weight: 500;
            margin-bottom: 0.5rem;
            transition: all 0.2s;
            cursor: pointer;
        }

        .menu-item:hover {
            background-color: var(--bg);
            color: var(--primary-light);
        }

        .menu-item.active {
            background-color: var(--primary-bg);
            color: var(--primary);
            font-weight: 600;
        }

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

        #main-content {
            flex: 1;
            margin-left: 260px;
            display: flex;
            flex-direction: column;
        }

        #header {
            background: var(--card-bg);
            border-bottom: 1px solid var(--border);
            padding: 1rem 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: sticky;
            top: 0;
            z-index: 5;
        }

        .user-profile {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            font-weight: 600;
        }

        .avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: var(--primary-light);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
        }

        #content-container {
            padding: 2rem;
            flex: 1;
        }

        .page {
            display: none;
            animation: fadeIn 0.3s ease;
        }

        .page.active {
            display: block;
        }

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

        .page-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-end;
            margin-bottom: 2rem;
        }

        .page-header h2 {
            font-size: 1.5rem;
            margin-bottom: 0.25rem;
        }

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

        /* === SECTION: DASHBOARD WIDGETS & APP LAUNCHER === */
        .app-launcher-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 1.5rem;
            margin-bottom: 2rem;
        }

        .app-launcher-card {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 1.5rem;
            display: flex;
            align-items: center;
            gap: 1rem;
            cursor: pointer;
            transition: all 0.2s ease;
            box-shadow: var(--shadow);
        }

        .app-launcher-card:hover {
            transform: translateY(-4px);
            box-shadow: var(--shadow-lg);
            border-color: var(--primary-light);
        }

        .app-icon {
            width: 56px;
            height: 56px;
            border-radius: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.75rem;
            flex-shrink: 0;
        }

        .app-title {
            font-family: var(--font-heading);
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--primary);
            margin-bottom: 0.25rem;
        }

        .app-desc {
            font-size: 0.85rem;
            color: var(--text-muted);
            line-height: 1.3;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
            gap: 1.5rem;
            margin-bottom: 2rem;
        }

        .stat-card {
            display: flex;
            align-items: center;
            padding: 1.5rem;
        }

        .stat-icon {
            width: 48px;
            height: 48px;
            border-radius: 12px;
            background: var(--primary-bg);
            color: var(--primary);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            margin-right: 1rem;
        }

        .stat-info h3 {
            font-family: var(--font-body);
            font-size: 0.85rem;
            color: var(--text-muted);
            font-weight: 600;
            text-transform: uppercase;
            margin-bottom: 0.25rem;
        }

        .stat-info p {
            font-family: var(--font-heading);
            font-size: 1.75rem;
            font-weight: 700;
            color: var(--text-main);
        }

        .dashboard-grid {
            display: grid;
            grid-template-columns: 2fr 1fr;
            gap: 1.5rem;
        }

        /* === SECTION: INPUT ABSENSI === */
        .radio-group {
            display: flex;
            gap: 0.5rem;
        }

        .radio-label {
            padding: 0.25rem 0.75rem;
            border: 1px solid var(--border);
            border-radius: 20px;
            font-size: 0.85rem;
            cursor: pointer;
            transition: all 0.2s;
            user-select: none;
            font-weight: 500;
        }

        .radio-label input {
            display: none;
        }

        /* Custom radio states */
        .radio-label:has(input[value="hadir"]:checked) { background: var(--success); color: white; border-color: var(--success); }
        .radio-label:has(input[value="sakit"]:checked) { background: var(--warning); color: white; border-color: var(--warning); }
        .radio-label:has(input[value="izin"]:checked) { background: var(--info); color: white; border-color: var(--info); }
        .radio-label:has(input[value="alpa"]:checked) { background: var(--danger); color: white; border-color: var(--danger); }

        .form-row {
            display: flex;
            gap: 1rem;
            align-items: flex-end;
            margin-bottom: 1.5rem;
        }
        
        .form-row > div {
            flex: 1;
        }

        /* === SECTION: MODALS / DIALOG === */
        #dialog-overlay {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(15, 23, 42, 0.5);
            backdrop-filter: blur(4px);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 100;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s;
        }

        #dialog-overlay.show {
            opacity: 1;
            pointer-events: auto;
        }

        .dialog {
            background: var(--card-bg);
            border-radius: var(--radius);
            width: 100%;
            max-width: 500px;
            padding: 2rem;
            box-shadow: var(--shadow-lg);
            transform: translateY(20px);
            transition: transform 0.2s;
        }

        #dialog-overlay.show .dialog {
            transform: translateY(0);
        }

        .dialog-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
        }

        .dialog-close {
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            color: var(--text-muted);
        }

        .dialog-footer {
            margin-top: 2rem;
            display: flex;
            justify-content: flex-end;
            gap: 1rem;
        }

        /* === SECTION: TOAST NOTIFICATIONS === */
        #toast-container {
            position: fixed;
            bottom: 2rem;
            right: 2rem;
            z-index: 1000;
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .toast {
            background: var(--text-main);
            color: white;
            padding: 1rem 1.5rem;
            border-radius: 8px;
            box-shadow: var(--shadow-lg);
            display: flex;
            align-items: center;
            gap: 0.75rem;
            font-weight: 500;
            animation: toastSlideIn 0.3s forwards, toastFadeOut 0.3s forwards 2.7s;
        }

        @keyframes toastSlideIn {
            from { transform: translateX(100%); opacity: 0; }
            to { transform: translateX(0); opacity: 1; }
        }

        @keyframes toastFadeOut {
            from { transform: translateX(0); opacity: 1; }
            to { transform: translateX(100%); opacity: 0; }
        }

        /* Helper Classes */
        .text-center { text-align: center; }
        .text-right { text-align: right; }
        .mb-1 { margin-bottom: 1rem; }
        .mb-2 { margin-bottom: 2rem; }
        .mt-2 { margin-top: 2rem; }
        .d-flex { display: flex; gap: 1rem; }
        .justify-between { justify-content: space-between; }
        .align-center { align-items: center; }

        /* === SECTION: RESPONSIVE / MOBILE === */
        @media (max-width: 768px) {
            .form-row {
                flex-direction: column;
                align-items: stretch;
                gap: 0.5rem;
            }
            .radio-group {
                flex-wrap: wrap;
            }
            .radio-label {
                padding: 0.5rem 1rem; /* Make it easier to tap on mobile */
                font-size: 0.95rem;
                flex: 1; /* Make buttons expand */
                text-align: center;
            }
            .dashboard-grid {
                grid-template-columns: 1fr;
            }
        }

        /* === SECTION: PRINT STYLES === */
        @media print {
            body { background: white; color: black; }
            #sidebar, #header, .btn, .page-header, .form-row, .card { box-shadow: none; border: none; }
            #sidebar, #header, .btn, .form-row { display: none !important; }
            #main-content { margin-left: 0; }
            #content-container { padding: 0; }
            .card { padding: 0; }
            table { border: 1px solid #000; }
            th, td { border: 1px solid #000; padding: 0.5rem; color: black !important; background: transparent !important; }
            .badge { border: 1px solid #ccc; background: transparent !important; font-weight: bold; }
            .badge-hadir { color: var(--success) !important; border-color: var(--success) !important; }
            .badge-sakit { color: var(--warning) !important; border-color: var(--warning) !important; }
            .badge-izin { color: var(--info) !important; border-color: var(--info) !important; }
            .badge-alpa { color: var(--danger) !important; border-color: var(--danger) !important; }
            
            /* Print Header for Laporan */
            #print-header { display: block !important; text-align: center; margin-bottom: 2rem; }
            #print-header h1 { font-size: 1.5rem; margin-bottom: 0.2rem; color: black; }
            #print-header p { font-size: 1rem; margin-bottom: 1rem; border-bottom: 2px solid black; padding-bottom: 1rem; }

            /* Jurnal Print Specifics */
            body.printing-jurnal > #login-view,
            body.printing-jurnal > #app-view,
            body.printing-jurnal > #dialog-overlay,
            body.printing-jurnal > #toast-container {
                display: none !important;
            }
            #temp-print-area {
                display: block;
                width: 100%;
                color: black;
                background: white;
            }
            #print-info-table, #print-info-table th, #print-info-table td {
                border: none !important;
            }
        }

        #print-header { display: none; }
    
