@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');
@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400;1,700&display=swap');

/* Spinner from original app */
.spinner-ring {
  width: 56px; height: 56px; border: 5px solid var(--border-color);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#loadingOverlay {
  display: none; position: fixed; top: 0;
            left: 0;
            width: 100%;
            height: 100%;
  background: rgba(255, 255, 255, .8); z-index: 9000;
  align-items: center; justify-content: center; flex-direction: column;
}
#loadingOverlay.show { display: flex; }
    



    
        /* ===== CSS VARIABLES ===== */
        :root {
            --primary: #137fec;
            --primary-hover: #1060b8;
            --bg-page: #f6f7f8;
            --bg-card: #ffffff;
            --text-primary: #0f172a;
            --text-secondary: #475569;
            --text-muted: #94a3b8;
            --border-color: #e2e8f0;
            --border-light: #f1f5f9;
            --hover-bg: #f8fafc;
            --radius: 0.75rem;
            --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);
            --shadow: 0 1px 3px rgba(0, 0, 0, .1), 0 1px 2px rgba(0, 0, 0, .06);
            --shadow-md: 0 4px 6px rgba(0, 0, 0, .07), 0 2px 4px rgba(0, 0, 0, .06);
            --transition: .2s ease;
        }

        [data-theme="dark"] {
            --bg-page: #101922;
            --bg-card: #1e293b;
            --text-primary: #f1f5f9;
            --text-secondary: #94a3b8;
            --text-muted: #64748b;
            --border-color: #334155;
            --border-light: #1e293b;
            --hover-bg: #334155;
        }

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

        body {

            background: var(--bg-page);
            color: var(--text-primary);
            min-height: 100vh;
            display: flex;
            -webkit-font-smoothing: antialiased;
        }

        /* ===== SIDEBAR ===== */
        .sidebar {
            position: fixed;
            top: 0;
            left: 0;
            height: 100vh;
            width: 256px;
            background: var(--bg-card);
            border-right: 1px solid var(--border-color);
            display: flex;
            flex-direction: column;
            z-index: 200;
            transition: transform .3s cubic-bezier(.4, 0, .2, 1);
        }

        .sidebar-brand {
            padding: 20px 20px 16px;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .brand-icon {
            width: 34px;
            height: 34px;
            background: var(--primary);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-weight: 700;
            font-size: 1.1rem;
        }

        .brand-name {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--text-primary);
        }

        .brand-sub {
            display: none;
        }

        /* Sidebar User */
        .sidebar-user {
            padding: 16px 20px;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .user-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: rgba(19, 127, 236, .15);
            color: var(--primary);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: .9rem;
            flex-shrink: 0;
        }

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

        .user-status {
            font-size: .72rem;
            color: #22c55e;
            display: flex;
            align-items: center;
            gap: 4px;
            margin-top: 1px;
        }

        .user-status::before {
            content: '';
            width: 6px;
            height: 6px;
            background: #22c55e;
            border-radius: 50%;
        }

        /* Sidebar Nav */
        .sidebar-section-label {
            font-size: .65rem;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: .8px;
            padding: 16px 20px 8px;
        }

        .sidebar-nav {
            flex: 1;
            overflow-y: auto;
            padding: 0 12px 8px;
        }

        .nav-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 9px 12px;
            cursor: pointer;
            font-size: .875rem;
            font-weight: 500;
            color: var(--text-secondary);
            border-radius: 8px;
            transition: all .15s;
            border: none;
            background: none;
            width: 100%;
            text-align: left;
            margin-bottom: 2px;
        }

        .nav-item .nav-icon {
            font-size: 1.2rem;
            width: 24px;
            text-align: center;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .nav-item .material-symbols-outlined {
            font-size: 22px;
        }

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

        .nav-item.active {
            background: rgba(19, 127, 236, .1);
            color: var(--primary);
            font-weight: 600;
            position: relative;
        }

        .nav-item.active::before {
            content: '';
            position: absolute;
            left: 0;
            top: 4px;
            bottom: 4px;
            width: 3px;
            border-radius: 0 3px 3px 0;
            background: var(--primary);
        }

        /* Sidebar Footer */
        .sidebar-footer {
            padding: 8px 12px;
            border-top: 1px solid var(--border-color);
        }

        .btn-logout {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 9px 12px;
            cursor: pointer;
            font-size: .875rem;
            font-weight: 500;
            color: var(--text-secondary);
            border-radius: 8px;
            transition: all .15s;
            border: none;
            background: none;
            width: 100%;
            text-align: left;
        }

        .btn-logout:hover {
            background: rgba(239, 68, 68, .08);
            color: #ef4444;
        }

        /* ===== MAIN CONTENT ===== */
        .main-content {
            margin-left: 256px;
            flex: 1;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            min-width: 0;
        }

        /* ===== TOPBAR ===== */
        .topbar {
            background: var(--bg-card);
            padding: 12px 24px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom: 1px solid var(--border-color);
            position: sticky;
            top: 0;
            z-index: 100;
        }

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

        .topbar-right {
            display: flex;
            align-items: center;
            gap: 8px;
        }

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

        .topbar-date {
            font-size: .78rem;
            color: var(--text-muted);
            font-weight: 500;
        }

        /* Hamburger */
        .hamburger-btn {
            display: none;
            background: none;
            border: none;
            cursor: pointer;
            color: var(--text-secondary);
            padding: 4px;
            border-radius: 8px;
            transition: .15s;
        }

        .hamburger-btn:hover {
            background: var(--hover-bg);
        }

        .hamburger-btn .material-symbols-outlined {
            font-size: 24px;
        }

        /* ===== BUTTONS ===== */
        .btn {
            cursor: pointer;
            border: none;
            font-weight: 600;
            transition: all .2s cubic-bezier(.4,0,.2,1);
            display: inline-flex;
            align-items: center;
            gap: 6px;
            border-radius: 10px;
            font-size: .82rem;
            padding: 8px 16px;
            position: relative;
            overflow: hidden;
            white-space: nowrap;
            letter-spacing: .01em;
        }
        .btn:active {
            transform: scale(.97) !important;
        }

        .btn-refresh {
            background: var(--bg-card);
            color: var(--text-secondary);
            padding: 8px 14px;
            border: 1px solid var(--border-color);
            box-shadow: 0 1px 2px rgba(0,0,0,.04);
        }
        .btn-refresh:hover {
            background: var(--hover-bg);
            border-color: var(--text-muted);
            box-shadow: 0 2px 8px rgba(0,0,0,.08);
            transform: translateY(-1px);
        }

        .btn-primary-action {
            background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
            color: #fff;
            padding: 8px 18px;
            box-shadow: 0 2px 8px rgba(19,127,236,.35), 0 1px 2px rgba(0,0,0,.06);
            border: none;
        }
        .btn-primary-action:hover {
            background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
            transform: translateY(-1px);
            box-shadow: 0 4px 16px rgba(19,127,236,.4), 0 2px 4px rgba(0,0,0,.08);
        }

        .btn-danger {
            background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
            color: #fff;
            padding: 8px 16px;
            box-shadow: 0 2px 8px rgba(239,68,68,.3);
            border: none;
        }
        .btn-danger:hover {
            background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
            transform: translateY(-1px);
            box-shadow: 0 4px 16px rgba(239,68,68,.35);
        }

        .btn-danger-outline {
            background: rgba(239,68,68,.06);
            color: #dc2626;
            padding: 8px 16px;
            border: 1px solid rgba(239,68,68,.3);
        }
        .btn-danger-outline:hover {
            background: #ef4444;
            color: #fff;
            border-color: #ef4444;
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(239,68,68,.3);
        }

        .btn-warning {
            background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
            color: #fff;
            padding: 8px 16px;
            box-shadow: 0 2px 8px rgba(245,158,11,.3);
            border: none;
        }
        .btn-warning:hover {
            background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
            transform: translateY(-1px);
            box-shadow: 0 4px 16px rgba(245,158,11,.35);
        }

        .btn-info {
            background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
            color: #fff;
            padding: 8px 16px;
            box-shadow: 0 2px 8px rgba(59,130,246,.3);
            border: none;
        }
        .btn-info:hover {
            background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
            transform: translateY(-1px);
            box-shadow: 0 4px 16px rgba(59,130,246,.35);
        }

        /* ===== TOGGLE SWITCH ===== */
        .toggle-switch {
            position: relative;
            display: inline-block;
            width: 44px;
            height: 24px;
            flex-shrink: 0;
        }
        .toggle-switch input { opacity: 0; width: 0; height: 0; }
        .toggle-slider {
            position: absolute;
            cursor: pointer;
            inset: 0;
            background: #cbd5e1;
            border-radius: 24px;
            transition: all .25s cubic-bezier(.4,0,.2,1);
        }
        .toggle-slider::before {
            content: '';
            position: absolute;
            height: 18px;
            width: 18px;
            left: 3px;
            bottom: 3px;
            background: #fff;
            border-radius: 50%;
            transition: all .25s cubic-bezier(.4,0,.2,1);
            box-shadow: 0 1px 3px rgba(0,0,0,.15);
        }
        .toggle-switch input:checked + .toggle-slider {
            background: linear-gradient(135deg, #3b82f6, #2563eb);
            box-shadow: 0 0 8px rgba(59,130,246,.3);
        }
        .toggle-switch input:checked + .toggle-slider::before {
            transform: translateX(20px);
        }


        /* Content */
        .content-wrap {
            padding: 24px;
            flex: 1;
        }

        /* ===== SECTIONS ===== */
        .section {
            display: none;
        }

        .section.active {
            display: block;
        }

        /* ===== STAT CARDS ===== */
        .stat-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 16px;
            margin-bottom: 24px;
        }

        .stat-grid.stat-grid-enhanced {
            grid-template-columns: repeat(3, 1fr);
        }

        .stat-card {
            background: var(--bg-card);
            border-radius: var(--radius);
            padding: 20px;
            box-shadow: var(--shadow-sm);
            border: 1px solid var(--border-color);
            position: relative;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            gap: 6px;
            transition: box-shadow .2s, transform .2s;
        }

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

        .stat-card-label {
            font-size: .78rem;
            font-weight: 500;
            color: var(--text-muted);
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .stat-card-value {
            font-size: 1.85rem;
            font-weight: 700;
            color: var(--text-primary);
            line-height: 1.2;
        }

        .stat-card-sub {
            font-size: .75rem;
            color: var(--text-muted);
            margin-top: 2px;
        }

        .stat-card-icon {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .stat-card-icon .material-symbols-outlined {
            font-size: 18px;
        }

        .icon-blue {
            background: rgba(59, 130, 246, .1);
            color: #3b82f6;
        }

        .icon-green {
            background: rgba(34, 197, 94, .1);
            color: #22c55e;
        }

        .icon-orange {
            background: rgba(168, 85, 247, .1);
            color: #a855f7;
        }

        .icon-purple {
            background: rgba(249, 115, 22, .1);
            color: #f97316;
        }

        .stat-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-size: .72rem;
            font-weight: 600;
            margin-top: 2px;
        }

        .badge-green {
            color: #16a34a;
        }

        .badge-blue {
            color: var(--primary);
        }

        .badge-orange {
            color: #ea580c;
        }

        /* ===== PANELS ===== */
        .bottom-grid {
            display: grid;
            grid-template-columns: 1fr 340px;
            gap: 20px;
        }

        .panel-card {
            background: var(--bg-card);
            border-radius: var(--radius);
            padding: 20px;
            box-shadow: var(--shadow-sm);
            border: 1px solid var(--border-color);
        }

        .panel-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 16px;
            padding-bottom: 12px;
            border-bottom: 1px solid var(--border-light);
        }

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

        .panel-link {
            font-size: .8rem;
            color: var(--primary);
            cursor: pointer;
            font-weight: 500;
            text-decoration: none;
        }

        .panel-link:hover {
            text-decoration: underline;
        }

        /* Activity Items */
        .activity-item {
            display: flex;
            align-items: flex-start;
            gap: 14px;
            padding: 12px 0;
            border-bottom: 1px solid var(--border-light);
            position: relative;
        }

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

        .activity-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            margin-top: 5px;
            flex-shrink: 0;
            box-shadow: 0 0 0 3px var(--bg-card);
        }

        .dot-blue {
            background: #3b82f6;
        }

        .dot-green {
            background: #22c55e;
        }

        .dot-orange {
            background: #f97316;
        }

        .dot-gray {
            background: #94a3b8;
        }

        .activity-title {
            font-size: .85rem;
            font-weight: 600;
            color: var(--text-primary);
        }

        .activity-desc {
            font-size: .78rem;
            color: var(--text-secondary);
            margin-top: 2px;
            line-height: 1.5;
        }

        .activity-time {
            font-size: .72rem;
            color: var(--text-muted);
            margin-top: 3px;
        }

        /* Info Panel */
        .info-panel {
            background: var(--bg-card);
            border-radius: var(--radius);
            padding: 20px;
            border: 1px solid var(--border-color);
            box-shadow: var(--shadow-sm);
        }

        .info-panel-header {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 12px;
        }

        .info-panel-title {
            font-size: .95rem;
            font-weight: 700;
            color: var(--text-primary);
        }

        .info-panel-subtitle {
            font-size: .78rem;
            color: var(--text-muted);
            margin-bottom: 16px;
            line-height: 1.5;
            padding-bottom: 12px;
            border-bottom: 1px solid var(--border-light);
        }

        .info-item {
            background: var(--hover-bg);
            border-radius: 10px;
            padding: 12px 14px;
            margin-bottom: 8px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .info-item:last-child {
            margin-bottom: 0;
        }

        .info-item-icon {
            font-size: 1.2rem;
        }

        .info-item-label {
            font-size: .82rem;
            font-weight: 600;
            color: var(--text-primary);
        }

        .info-item-sub {
            font-size: .72rem;
            color: var(--text-muted);
            margin-top: 2px;
        }

        .info-status {
            margin-left: auto;
            font-size: .68rem;
            font-weight: 600;
            padding: 3px 10px;
            border-radius: 20px;
        }

        .status-ok {
            background: rgba(34, 197, 94, .12);
            color: #16a34a;
        }

        .status-warn {
            background: rgba(249, 115, 22, .12);
            color: #ea580c;
        }

        .info-footer {
            margin-top: 16px;
            padding-top: 12px;
            border-top: 1px solid var(--border-light);
            font-size: .72rem;
            color: var(--text-muted);
            text-align: center;
        }

        /* ===== TABLES ===== */
        .section-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 20px;
        }

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

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

        table {
            width: 100%;
            border-collapse: collapse;
        }

        thead {
            background: var(--hover-bg);
        }

        th {
            padding: 12px 16px;
            font-size: .72rem;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: .5px;
            text-align: left;
            border-bottom: 1px solid var(--border-color);
        }

        td {
            padding: 12px 16px;
            font-size: .85rem;
            border-bottom: 1px solid var(--border-light);
            color: var(--text-secondary);
            vertical-align: middle;
        }

        tr:last-child td {
            border-bottom: none;
        }

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

        /* Badges */
        .badge-status {
            padding: 3px 10px;
            border-radius: 20px;
            font-size: .72rem;
            font-weight: 600;
            display: inline-block;
        }

        .badge-AKTIF {
            background: rgba(34, 197, 94, .1);
            color: #16a34a;
            border: 1px solid rgba(34, 197, 94, .2);
        }

        .badge-DRAFT {
            background: rgba(239, 68, 68, .08);
            color: #dc2626;
            border: 1px solid rgba(239, 68, 68, .15);
        }

        .badge-NONAKTIF,
        .badge-SELESAI {
            background: var(--hover-bg);
            color: var(--text-muted);
            border: 1px solid var(--border-color);
        }

        .badge-LULUS {
            background: rgba(34, 197, 94, .1);
            color: #16a34a;
            border: 1px solid rgba(34, 197, 94, .2);
        }

        .badge-TIDAK_LULUS {
            background: rgba(239, 68, 68, .08);
            color: #dc2626;
            border: 1px solid rgba(239, 68, 68, .15);
        }

        .badge-CURANG {
            background: rgba(239, 68, 68, .08);
            color: #dc2626;
            font-weight: 700;
            border: 1px solid rgba(239, 68, 68, .15);
        }

        .badge-MENUNGGU_KOREKSI {
            background: rgba(249, 115, 22, .1);
            color: #ea580c;
            border: 1px solid rgba(249, 115, 22, .15);
        }

        /* Action Buttons */
        .action-btns {
            display: flex;
            gap: 6px;
        }

        .btn-act {
            padding: 5px 12px;
            border-radius: 6px;
            font-size: .78rem;
            border: 1px solid;
            cursor: pointer;

            font-weight: 500;
            transition: all .15s;
        }

        .btn-edit {
            border-color: var(--primary);
            color: var(--primary);
            background: rgba(19, 127, 236, .08);
        }

        .btn-edit:hover {
            background: var(--primary);
            color: #fff;
        }

        .btn-del {
            border-color: #ef4444;
            color: #ef4444;
            background: rgba(239, 68, 68, .06);
        }

        .btn-del:hover {
            background: #ef4444;
            color: #fff;
        }

        .btn-reset {
            border-color: #f59e0b;
            color: #b45309;
            background: rgba(245, 158, 11, .08);
        }

        .btn-reset:hover {
            background: #f59e0b;
            color: #fff;
        }

        /* Action Dropdown Menu */
        .action-dropdown {
            position: relative;
            display: inline-block;
        }
        
        .action-dropdown-btn {
            background: none;
            border: 1px solid var(--border-color);
            border-radius: 6px;
            padding: 4px 8px;
            cursor: pointer;
            color: var(--text-secondary);
            font-size: 1.2rem;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .action-dropdown-btn:hover {
            background: var(--hover-bg);
            color: var(--primary);
            border-color: var(--primary);
        }
        
        .action-dropdown-content {
            display: none;
            position: fixed;          /* fixed: tidak terpotong overflow container */
            background-color: var(--bg-card);
            min-width: 160px;
            box-shadow: var(--shadow-md);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            z-index: 9999;            /* di atas semua elemen */
            overflow: hidden;
            animation: fadeIn 0.15s ease;
        }
        
        .action-dropdown-content.show {
            display: block;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(-5px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        .action-dropdown-content button {
            color: var(--text-primary);
            padding: 10px 16px;
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 8px;
            width: 100%;
            text-align: left;
            border: none;
            background: none;
            cursor: pointer;
            font-size: 0.85rem;
            font-weight: 500;
            transition: background 0.15s;
        }
        
        .action-dropdown-content button:hover {
            background-color: var(--hover-bg);
            color: var(--primary);
        }
        
        .action-dropdown-content button.text-danger:hover {
            color: #ef4444;
            background-color: rgba(239, 68, 68, 0.05);
        }
        
        .action-dropdown-content .material-symbols-outlined {
            font-size: 18px;
        }

        /* ===== MODAL ===== */
        /* Override Bootstrap's .modal-backdrop.show { opacity: .5 } that makes whole modal transparent */
        .modal-backdrop {
            display: none !important;
            position: fixed !important;
            inset: 0 !important;
            background: rgba(0, 0, 0, .55) !important;
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
            z-index: 1050 !important;
            align-items: flex-start;
            justify-content: center;
            padding: 40px 20px;
            overflow-y: auto;
            opacity: 1 !important;
            width: 100% !important;
            height: 100% !important;
        }

        .modal-backdrop.show {
            display: flex !important;
            opacity: 1 !important;
        }

        @keyframes modalIn {
            from {
                opacity: 0;
                transform: translateY(16px) scale(.98);
            }

            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        .modal-box {
            background: #ffffff !important;
            border-radius: 16px;
            padding: 28px;
            width: 100%;
            max-width: 540px;
            box-shadow: 0 25px 60px rgba(0, 0, 0, .4);
            position: relative;
            z-index: 1051;
            margin: auto;
            border: 1px solid var(--border-color);
            animation: modalIn .25s ease forwards;
            opacity: 1 !important;
            color: var(--text-primary);
        }

        [data-theme="dark"] .modal-box {
            background: #1e293b !important;
            color: #f1f5f9;
        }

        .modal-box.modal-lg {
            max-width: 700px;
        }

        .modal-box.modal-xl {
            max-width: 880px;
        }

        /* ===== UJIAN MODAL PREMIUM STYLING ===== */
        .modal-ujian {
            max-width: 880px !important;
            padding: 0 !important;
            display: flex;
            flex-direction: column;
            max-height: 90vh;
            overflow: hidden;
            border-radius: 20px;
        }

        .modal-ujian .modal-ujian-header {
            background: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #8b5cf6 100%);
            padding: 22px 28px;
            display: flex;
            align-items: center;
            gap: 14px;
            border-radius: 20px 20px 0 0;
            flex-shrink: 0;
        }

        .modal-ujian .modal-ujian-header .header-icon {
            width: 44px;
            height: 44px;
            border-radius: 12px;
            background: rgba(255,255,255,.2);
            backdrop-filter: blur(8px);
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .modal-ujian .modal-ujian-header .header-icon .material-symbols-outlined {
            font-size: 24px;
            color: #fff;
        }

        .modal-ujian .modal-ujian-header .header-text {
            flex: 1;
            min-width: 0;
        }

        .modal-ujian .modal-ujian-header .header-text h3 {
            color: #fff;
            font-size: 1.15rem;
            font-weight: 700;
            margin: 0;
            letter-spacing: -0.01em;
        }

        .modal-ujian .modal-ujian-header .header-text .header-subtitle {
            color: rgba(255,255,255,.75);
            font-size: .78rem;
            margin-top: 2px;
        }

        .modal-ujian .modal-ujian-header .modal-close {
            background: rgba(255,255,255,.15);
            color: #fff;
            border: none;
            width: 36px;
            height: 36px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all .2s;
            font-size: 1.1rem;
            flex-shrink: 0;
        }

        .modal-ujian .modal-ujian-header .modal-close:hover {
            background: rgba(255,255,255,.3);
            transform: scale(1.05);
        }

        .modal-ujian .modal-ujian-body {
            padding: 24px 28px;
            overflow-y: auto;
            flex: 1;
            scrollbar-width: thin;
            scrollbar-color: rgba(0,0,0,.15) transparent;
        }

        .modal-ujian .modal-ujian-body::-webkit-scrollbar {
            width: 6px;
        }

        .modal-ujian .modal-ujian-body::-webkit-scrollbar-thumb {
            background: rgba(0,0,0,.15);
            border-radius: 3px;
        }

        [data-theme="dark"] .modal-ujian .modal-ujian-body::-webkit-scrollbar-thumb {
            background: rgba(255,255,255,.15);
        }

        .ujian-section {
            background: var(--hover-bg);
            border: 1px solid var(--border-light);
            border-radius: 14px;
            padding: 18px 20px;
            margin-bottom: 16px;
            position: relative;
            transition: border-color .2s, box-shadow .2s;
        }

        .ujian-section:hover {
            border-color: var(--border-color);
            box-shadow: 0 2px 12px rgba(0,0,0,.04);
        }

        [data-theme="dark"] .ujian-section:hover {
            box-shadow: 0 2px 12px rgba(0,0,0,.2);
        }

        .ujian-section::before {
            content: '';
            position: absolute;
            left: 0;
            top: 12px;
            bottom: 12px;
            width: 3.5px;
            border-radius: 0 3px 3px 0;
        }

        .ujian-section.section-info::before { background: linear-gradient(180deg, #3b82f6, #60a5fa); }
        .ujian-section.section-time::before { background: linear-gradient(180deg, #16a34a, #4ade80); }
        .ujian-section.section-setting::before { background: linear-gradient(180deg, #f59e0b, #fbbf24); }
        .ujian-section.section-filter::before { background: linear-gradient(180deg, #8b5cf6, #a78bfa); }
        .ujian-section.section-extra::before { background: linear-gradient(180deg, #ec4899, #f472b6); }

        .ujian-section-title {
            display: flex;
            align-items: center;
            gap: 8px;
            font-weight: 700;
            font-size: .85rem;
            color: var(--text-primary);
            margin-bottom: 14px;
            padding-bottom: 10px;
            border-bottom: 1px solid var(--border-light);
        }

        .ujian-section-title .material-symbols-outlined {
            font-size: 18px;
        }

        .ujian-section-title.section-info-title .material-symbols-outlined { color: #3b82f6; }
        .ujian-section-title.section-time-title .material-symbols-outlined { color: #16a34a; }
        .ujian-section-title.section-setting-title .material-symbols-outlined { color: #f59e0b; }
        .ujian-section-title.section-filter-title .material-symbols-outlined { color: #8b5cf6; }
        .ujian-section-title.section-extra-title .material-symbols-outlined { color: #ec4899; }

        .modal-ujian .form-row.cols-3 {
            grid-template-columns: repeat(3, 1fr);
        }

        .modal-ujian .modal-ujian-footer {
            padding: 16px 28px;
            border-top: 1px solid var(--border-light);
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            flex-shrink: 0;
            background: var(--bg-card);
            border-radius: 0 0 20px 20px;
        }

        [data-theme="dark"] .modal-ujian .modal-ujian-footer {
            background: #1e293b;
        }

        @media (max-width: 920px) {
            .modal-ujian {
                max-width: 96vw !important;
            }
        }

        @media (max-width: 768px) {
            .modal-ujian .form-row.cols-3 {
                grid-template-columns: 1fr;
            }
            .modal-ujian .modal-ujian-header {
                padding: 18px 20px;
            }
            .modal-ujian .modal-ujian-body {
                padding: 16px 18px;
            }
            .modal-ujian .modal-ujian-footer {
                padding: 14px 18px;
            }
        }


        .modal-hdr {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 20px;
            padding-bottom: 14px;
            border-bottom: 1px solid var(--border-light);
        }

        .modal-hdr h3 {
            font-size: 1.05rem;
            font-weight: 700;
            color: var(--text-primary);
        }

        .modal-close {
            background: var(--hover-bg);
            border: none;
            font-size: 1.2rem;
            cursor: pointer;
            color: var(--text-muted);
            width: 32px;
            height: 32px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: .15s;
        }

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

        /* ===== FORMS ===== */
        .form-row {
            display: grid;
            gap: 14px;
            margin-bottom: 14px;
            grid-template-columns: 1fr;
        }

        .form-row.cols-2 {
            grid-template-columns: 1fr 1fr;
        }

        .form-row.cols-3 {
            grid-template-columns: repeat(3, 1fr);
        }

        .form-group {
            display: flex;
            flex-direction: column;
            gap: 6px;
            min-width: 0;
        }

        .form-label {
            font-size: .78rem;
            font-weight: 600;
            color: var(--text-secondary);
            display: block;
        }

        .form-control {
            padding: 10px 12px;
            border: 1.5px solid var(--border-color);
            border-radius: 8px;
            font-size: .875rem;

            transition: .2s;
            outline: none;
            color: var(--text-primary);
            background: var(--bg-card);
            background-color: var(--bg-card);
            width: 100%;
            box-sizing: border-box;
            display: block;
            opacity: 1 !important;
        }

        .form-control:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(19, 127, 236, .1);
        }

        [data-theme="dark"] .form-control {
            background: var(--bg-page);
            background-color: var(--bg-page);
            color: #f1f5f9;
        }

        textarea.form-control {
            resize: vertical;
            min-height: 80px;
        }

        .modal-footer-btns {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            margin-top: 20px;
        }

        .btn-secondary {
            background: var(--hover-bg);
            color: var(--text-secondary);
            padding: 10px 20px;
            border-radius: 10px;
            font-size: .875rem;
            border: 1px solid var(--border-color);
            box-shadow: 0 1px 2px rgba(0,0,0,.04);
        }
        .btn-secondary:hover {
            background: var(--bg-card);
            border-color: var(--text-muted);
            box-shadow: 0 2px 8px rgba(0,0,0,.08);
            transform: translateY(-1px);
        }

        .btn-primary {
            background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
            color: #fff;
            padding: 10px 20px;
            border-radius: 10px;
            font-size: .875rem;
            border: none;
            box-shadow: 0 2px 8px rgba(19,127,236,.35), 0 1px 2px rgba(0,0,0,.06);
        }
        .btn-primary:hover {
            background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
            transform: translateY(-1px);
            box-shadow: 0 4px 16px rgba(19,127,236,.4), 0 2px 4px rgba(0,0,0,.08);
        }

        /* ===== KUNCI JAWABAN BUTTONS ===== */
        .btn-kunci {
            width: 44px;
            height: 44px;
            border-radius: 10px;
            border: 2px solid var(--border-color);
            background: var(--bg-card);
            color: var(--text-secondary);

            font-weight: 700;
            font-size: 1rem;
            cursor: pointer;
            transition: all .15s;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .btn-kunci:hover {
            border-color: var(--primary);
            color: var(--primary);
            background: rgba(19, 127, 236, .05);
        }

        .btn-kunci.active {
            background: var(--primary);
            color: #fff;
            border-color: var(--primary);
            box-shadow: 0 2px 8px rgba(19, 127, 236, .3);
            transform: scale(1.05);
        }

        /* ===== GAMBAR ===== */
        .gambar-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
            gap: 12px;
        }

        .gambar-card {
            background: var(--bg-card);
            border-radius: 10px;
            padding: 12px;
            border: 1px solid var(--border-color);
            text-align: center;
        }

        .gambar-thumb {
            width: 100%;
            height: 100px;
            object-fit: cover;
            border-radius: 6px;
            background: var(--hover-bg);
        }

        .gambar-name {
            font-size: .75rem;
            color: var(--text-muted);
            margin-top: 6px;
            word-break: break-all;
        }

        /* ===== SCROLLBAR ===== */
        ::-webkit-scrollbar {
            width: 5px;
        }

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

        /* ===== OVERLAY + SIDEBAR MOBILE ===== */
        .sidebar-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, .4);
            z-index: 190;
            backdrop-filter: blur(2px);
        }

        body.sidebar-open .sidebar-overlay {
            display: block;
        }

        body.sidebar-open .sidebar {
            transform: translateX(0) !important;
        }

        /* ===== RESPONSIVE ===== */
        @media (max-width: 1024px) {
            .stat-grid {
                grid-template-columns: repeat(2, 1fr);
            }

            .bottom-grid {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 768px) {
            .sidebar {
                transform: translateX(-100%);
                box-shadow: 4px 0 24px rgba(0, 0, 0, .15);
            }

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

            .hamburger-btn {
                display: flex;
            }

            .topbar {
                padding: 12px 16px;
            }

            .content-wrap {
                padding: 16px;
            }

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

            .table-wrap {
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
            }

            table {
                min-width: 600px;
            }

            .form-row.cols-2,
            .form-row.cols-3 {
                grid-template-columns: 1fr;
            }

            .modal-backdrop {
                padding: 16px;
            }

            .modal-box {
                padding: 20px;
            }

            .section-header {
                flex-wrap: wrap;
                gap: 12px;
            }
        }

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

            .topbar-date {
                display: none;
            }

            .bottom-grid {
                gap: 16px;
            }
        }

        /* ===== CRITICAL: Override Bootstrap's .modal-backdrop.show { opacity: .5 } ===== */
        /* Bootstrap 5 is loaded and sets .modal-backdrop { opacity:.5 } making all modals transparent */
        .modal-backdrop,
        .modal-backdrop.show,
        .modal-backdrop.fade,
        .modal-backdrop.fade.show {
            opacity: 1 !important;
        }

        /* Also ensure modal-box has always a solid white/dark background */
        .modal-backdrop.show>.modal-box {
            background: #ffffff !important;
            opacity: 1 !important;
        }

        [data-theme="dark"] .modal-backdrop.show>.modal-box {
            background: #1e293b !important;
            opacity: 1 !important;
        }

        /* Ensure all form elements inside modal are also fully opaque */
        .modal-backdrop .form-control,
        .modal-backdrop select,
        .modal-backdrop input,
        .modal-backdrop textarea {
            opacity: 1 !important;
            background-color: #ffffff !important;
        }

        [data-theme="dark"] .modal-backdrop .form-control,
        [data-theme="dark"] .modal-backdrop select,
        [data-theme="dark"] .modal-backdrop input,
        [data-theme="dark"] .modal-backdrop textarea {
            background-color: #0f1929 !important;
            color: #f1f5f9 !important;
        }

        /* ===== MONITOR SISWA ===== */
        .live-dot {
            display: inline-block;
            width: 8px;
            height: 8px;
            background: #22c55e;
            border-radius: 50%;
            margin-right: 6px;
            animation: livePulse 1.5s infinite;
            vertical-align: middle;
        }

        @keyframes livePulse {

            0%,
            100% {
                opacity: 1;
                transform: scale(1);
            }

            50% {
                opacity: 0.4;
                transform: scale(1.3);
            }
        }

        .monitor-tabs {
            display: flex;
            gap: 0;
            margin-bottom: 16px;
            background: var(--hover-bg);
            border-radius: 10px;
            padding: 4px;
            border: 1px solid var(--border-color);
            width: fit-content;
        }

        .monitor-tab {
            padding: 8px 20px;
            border: none;
            background: transparent;
            border-radius: 7px;

            font-size: .82rem;
            font-weight: 500;
            color: var(--text-muted);
            cursor: pointer;
            transition: all .18s;
        }

        .monitor-tab.active {
            background: var(--bg-card);
            color: var(--text-primary);
            font-weight: 600;
            box-shadow: var(--shadow-sm);
        }

        .badge-MENGERJAKAN {
            background: rgba(59, 130, 246, .12);
            color: #2563eb;
            border: 1px solid rgba(59, 130, 246, .2);
            animation: livePulse 2s infinite;
        }

        .badge-SELESAI,
        .badge-LULUS,
        .badge-TIDAK_LULUS {
            background: rgba(34, 197, 94, .1);
            color: #16a34a;
            border: 1px solid rgba(34, 197, 94, .2);
        }

        .badge-CURANG,
        .badge-PELANGGARAN {
            background: rgba(239, 68, 68, .1);
            color: #dc2626;
            border: 1px solid rgba(239, 68, 68, .2);
            font-weight: 700;
        }

        .badge-DIHENTIKAN_ADMIN {
            background: rgba(249, 115, 22, .1);
            color: #c2410c;
            border: 1px solid rgba(249, 115, 22, .2);
            font-weight: 600;
        }

        /* Quick-select kelas buttons */
        .btn-kelas-quick {
            padding: 4px 12px;
            border-radius: 6px;
            border: 1.5px solid var(--border-color);
            background: var(--bg-card);
            color: var(--text-secondary);
            font-size: .72rem;
            font-weight: 600;
            cursor: pointer;
            transition: all .15s;
        }
        .btn-kelas-quick:hover {
            border-color: var(--primary);
            color: var(--primary);
            background: rgba(19, 127, 236, .05);
            transform: translateY(-1px);
        }
        .btn-kq-jenjang {
            background: var(--hover-bg);
            font-weight: 700;
        }

        .btn-reset {
            border-color: #f97316;
            color: #f97316;
            background: rgba(249, 115, 22, .07);
        }


        .disq-header {
            background: linear-gradient(135deg, #ef4444, #991b1b);
            padding: 24px 20px;
            text-align: center;
        }

        .disq-title {
            color: #ffffff;
            font-size: 1.5rem;
            font-weight: 800;
            letter-spacing: 1px;
            margin: 0;
            line-height: 1.2;
            word-wrap: break-word;
            overflow-wrap: break-word;
            hyphens: auto;
        }
        
        @media (max-width: 400px) {
            .disq-title { font-size: 1.25rem; }
        }

        .disq-body {
            padding: 24px;
            text-align: center;
            color: var(--text-primary);
        }

        .disq-body h5 {
            font-size: 1rem;
            font-weight: 600;
            margin-bottom: 16px;
            color: var(--text-secondary);
        }

        .violation-item {
            background: rgba(239, 68, 68, 0.1);
            border: 1px solid rgba(239, 68, 68, 0.2);
            border-radius: 8px;
            padding: 12px;
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 12px;
            text-align: left;
        }

        .violation-item span:first-child {
            background: #ef4444;
            color: #fff;
            padding: 2px 8px;
            border-radius: 4px;
            font-size: 0.7rem;
            font-weight: 700;
        }

        .violation-item span:last-child {
            font-size: 0.85rem;
            font-weight: 500;
            color: var(--text-primary);
        }

        .disq-status {
            background: var(--hover-bg);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 16px;
            margin-bottom: 24px;
            font-size: 0.9rem;
            line-height: 1.6;
            color: var(--text-secondary);
        }

        .disq-status strong {
            color: #ef4444;
            font-weight: 700;
        }

        .btn-close-app {
            background: #ef4444;
            color: #ffffff;
            border: none;
            width: 100%;
            padding: 12px;
            border-radius: 8px;
            font-size: 1rem;
            font-weight: 700;
            cursor: pointer;
            transition: background 0.2s;
            box-shadow: 0 4px 6px rgba(239, 68, 68, 0.3);
        }

        .btn-close-app:hover {
            background: #dc2626;
        }

        /* ===== TOAST NOTIFICATIONS ===== */
        #toast-container {
            position: fixed;
            top: 16px;
            right: 16px;
            z-index: 999999;
            display: flex;
            flex-direction: column;
            gap: 8px;
            max-width: 420px;
            width: calc(100% - 32px);
            pointer-events: none;
        }

        .toast-msg {
            background: #1e293b;
            color: #f8fafc;
            padding: 14px 18px;
            border-radius: 12px;
            font-size: 0.85rem;
            font-weight: 500;
            line-height: 1.4;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25), 0 4px 10px rgba(0, 0, 0, 0.15);
            display: flex;
            align-items: center;
            pointer-events: auto;
            animation: toastSlideIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            border-left: 4px solid #64748b;
        }

        .toast-msg.success {
            background: #065f46;
            border-left-color: #34d399;
        }

        .toast-msg.danger {
            background: #7f1d1d;
            border-left-color: #f87171;
        }

        .toast-msg.warning {
            background: #78350f;
            border-left-color: #fbbf24;
        }

        .toast-msg.info {
            background: #1e3a5f;
            border-left-color: #60a5fa;
        }

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


.btn-success { background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); color: #fff; padding: 8px 16px; box-shadow: 0 2px 8px rgba(34,197,94,.3); border: none; }
.btn-success:hover { background: linear-gradient(135deg, #16a34a 0%, #15803d 100%); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(34,197,94,.35); }

/* Override .btn-kunci to make it larger and more distinct */
.btn-group-kunci {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}
.btn-kunci {
    width: 52px !important;
    height: 52px !important;
    border-radius: 12px !important;
    font-size: 1.15rem !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}
.btn-kunci:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(19, 127, 236, .12);
}
.btn-kunci.active {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(19, 127, 236, .35) !important;
    transform: scale(1.08) translateY(-2px) !important;
    z-index: 2;
}

/* ===== PREMIUM DASHBOARD V2 ===== */

/* Welcome Banner */
.dash-welcome {
    background: linear-gradient(135deg, #1a6fd4 0%, #0f4c8a 40%, #0d3b6e 100%);
    border-radius: 16px;
    padding: 28px 32px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.dash-welcome::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -5%;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(255,255,255,.08) 0%, transparent 70%);
    border-radius: 50%;
}
.dash-welcome::after {
    content: '';
    position: absolute;
    bottom: -60%;
    left: 10%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,.05) 0%, transparent 70%);
    border-radius: 50%;
}
.dash-welcome-text h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}
.dash-welcome-text p {
    font-size: .85rem;
    opacity: .8;
    position: relative;
    z-index: 1;
    line-height: 1.5;
}
.dash-welcome-actions {
    display: flex;
    gap: 10px;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}
.dash-welcome-actions .btn-wa {
    background: rgba(255,255,255,.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.25);
    color: #fff;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.dash-welcome-actions .btn-wa:hover {
    background: rgba(255,255,255,.25);
    transform: translateY(-1px);
}
.dash-welcome-actions .btn-wa.btn-wa-solid {
    background: #fff;
    color: #0f4c8a;
    border-color: #fff;
}
.dash-welcome-actions .btn-wa.btn-wa-solid:hover {
    background: #e8f0fe;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

/* Enhanced Stat Cards V2 */
.stat-card-v2 {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 22px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all .25s cubic-bezier(.4,0,.2,1);
}
.stat-card-v2:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,.08), 0 4px 10px rgba(0,0,0,.04);
    transform: translateY(-3px);
}
.stat-card-v2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 0 4px 4px 0;
}
.stat-card-v2.accent-blue::before { background: linear-gradient(180deg, #3b82f6, #1d4ed8); }
.stat-card-v2.accent-green::before { background: linear-gradient(180deg, #22c55e, #15803d); }
.stat-card-v2.accent-purple::before { background: linear-gradient(180deg, #a855f7, #7c3aed); }
.stat-card-v2.accent-amber::before { background: linear-gradient(180deg, #f59e0b, #d97706); }
.stat-card-v2.accent-teal::before { background: linear-gradient(180deg, #14b8a6, #0d9488); }
.stat-card-v2.accent-red::before { background: linear-gradient(180deg, #f87171, #dc2626); }

.stat-icon-v2 {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-icon-v2 .material-symbols-outlined { font-size: 24px; }
.stat-icon-v2.bg-blue { background: rgba(59,130,246,.1); color: #3b82f6; }
.stat-icon-v2.bg-green { background: rgba(34,197,94,.1); color: #22c55e; }
.stat-icon-v2.bg-purple { background: rgba(168,85,247,.1); color: #a855f7; }
.stat-icon-v2.bg-amber { background: rgba(245,158,11,.1); color: #f59e0b; }
.stat-icon-v2.bg-teal { background: rgba(20,184,166,.1); color: #14b8a6; }
.stat-icon-v2.bg-red { background: rgba(239,68,68,.1); color: #ef4444; }

.stat-info-v2 { flex: 1; min-width: 0; }
.stat-info-v2 .stat-label { font-size: .75rem; font-weight: 500; color: var(--text-muted); margin-bottom: 4px; }
.stat-info-v2 .stat-value { font-size: 1.65rem; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.stat-info-v2 .stat-sub { font-size: .72rem; color: var(--text-muted); margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.stat-info-v2 .stat-sub .stat-badge { font-weight: 600; }

/* Quick Actions Row */
.quick-actions-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}
.quick-action-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all .2s;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}
.quick-action-card:hover {
    border-color: var(--primary);
    background: rgba(19,127,236,.03);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(19,127,236,.08);
}
.qa-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.qa-icon .material-symbols-outlined { font-size: 22px; font-variation-settings: 'wght' 400, 'FILL' 0; }
.qa-text .qa-title { font-size: .82rem; font-weight: 600; color: var(--text-primary); }
.qa-text .qa-desc { font-size: .7rem; color: var(--text-muted); margin-top: 2px; }

/* Redesigned Flow — Horizontal */
.flow-steps-horizontal {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    padding: 20px 10px;
    position: relative;
}
.flow-steps-horizontal::before {
    content: '';
    position: absolute;
    top: 48px;
    left: 12%;
    right: 12%;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #22c55e, #f59e0b, #a855f7);
    opacity: .25;
    border-radius: 2px;
}
.flow-step-h {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}
.flow-step-h .flow-num {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    color: #fff;
    box-shadow: 0 3px 8px rgba(0,0,0,.12);
}
.flow-step-h .flow-h-title { font-size: .82rem; font-weight: 600; color: var(--text-primary); }
.flow-step-h .flow-h-desc { font-size: .7rem; color: var(--text-muted); line-height: 1.4; max-width: 140px; }

/* Info Panel V2 — Glassmorphism */
.info-panel-v2 {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 22px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    position: relative;
    overflow: hidden;
}
.info-panel-v2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #22c55e, #f59e0b, #a855f7);
}
.info-panel-v2 .info-panel-header { margin-top: 6px; }

.info-item-v2 {
    background: var(--hover-bg);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all .2s;
    border: 1px solid transparent;
}
.info-item-v2:hover {
    border-color: var(--border-color);
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.info-item-v2:last-of-type { margin-bottom: 0; }

.info-icon-v2 {
    width: 38px; height: 38px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.info-icon-v2 .material-symbols-outlined { font-size: 20px; }

/* Server Time Widget */
.server-time-widget {
    background: var(--hover-bg);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border-color);
}
.server-time-widget .stw-clock {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}
.server-time-widget .stw-label {
    font-size: .72rem;
    color: var(--text-muted);
}

/* Dashboard responsive */
@media (max-width: 1024px) {
    .dash-welcome { flex-direction: column; align-items: flex-start; padding: 22px; }
    .quick-actions-row { grid-template-columns: repeat(2, 1fr); }
    .stat-grid.stat-grid-enhanced { grid-template-columns: repeat(2, 1fr); }
    .flow-steps-horizontal { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .flow-steps-horizontal::before { display: none; }
}
@media (max-width: 768px) {
    .dash-welcome-actions { flex-wrap: wrap; }
    .quick-actions-row { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-grid.stat-grid-enhanced { grid-template-columns: 1fr 1fr; }
    .flow-steps-horizontal { grid-template-columns: 1fr 1fr; }
    .header-system-status .system-status-text { display: none; }
}
@media (max-width: 480px) {
    .quick-actions-row { grid-template-columns: 1fr; }
    .stat-grid.stat-grid-enhanced { grid-template-columns: 1fr; }
    .flow-steps-horizontal { grid-template-columns: 1fr; }
}


/* ===== EQUATION / MATH RENDERING STYLES ===== */
.soal-text .katex-display {
    margin: 12px 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 0;
}
.soal-text .katex {
    font-size: 1.1em;
}
.opsi-btn .katex {
    font-size: 1em;
}
.katex-display > .katex {
    max-width: 100%;
}
/* Prevent equation overflow on mobile */
.soal-text, .opsi-btn span {
    overflow-wrap: break-word;
    word-wrap: break-word;
}
/* Dark mode KaTeX colors */
[data-theme="dark"] .katex {
    color: #e2e8f0;
}
[data-theme="dark"] .katex-display {
    color: #e2e8f0;
}

/* ===== ARABIC / RTL TEXT STYLES ===== */

/* RTL text detected by math-renderer.js */
.rtl-text {
    direction: rtl;
    text-align: right;
    font-family: 'Amiri', 'Traditional Arabic', 'Scheherazade New', 'Noto Naskh Arabic', serif;
    line-height: 2.2;
    letter-spacing: 0;
    word-spacing: 2px;
}
/* Soal text with Arabic */
.soal-text.rtl-text {
    font-size: 1.25rem;
    line-height: 2.4;
    padding: 4px 0;
}
/* Opsi jawaban with Arabic */
.opsi-btn .rtl-text,
.opsi-btn.rtl-text span:not(.opsi-label) {
    font-size: 1.1rem;
    line-height: 2.2;
}
/* Opsi button layout when RTL */
.opsi-btn.rtl-text {
    flex-direction: row-reverse;
}
.opsi-btn.rtl-text .opsi-label {
    order: 1;
}
/* Arabic in inputs and textareas (admin editor) */
textarea.rtl-text,
input[type="text"].rtl-text {
    font-family: 'Amiri', 'Traditional Arabic', serif;
    font-size: 1.15rem;
    line-height: 2.2;
    direction: rtl;
    text-align: right;
}
/* .arab class used in Word import templates */
.arab {
    font-family: 'Amiri', 'Traditional Arabic', serif;
    font-size: 1.2rem;
    direction: rtl;
    text-align: right;
    line-height: 2.3;
    unicode-bidi: bidi-override;
}
/* BS / JODOH items with Arabic */
.space-y-2 .rtl-text {
    font-family: 'Amiri', 'Traditional Arabic', serif;
    line-height: 2.2;
    font-size: 1.05rem;
}
/* Eq editor preview with Arabic */
.eq-preview-content.rtl-text,
.eq-opsi-preview.rtl-text {
    font-family: 'Amiri', 'Traditional Arabic', serif;
    line-height: 2.2;
    direction: rtl;
    text-align: right;
}
/* Arabic mixed with LTR (e.g. equation inside Arabic text) */
[dir="rtl"] .katex { direction: ltr; display: inline-block; }

/* Dark mode for Arabic text */
[data-theme="dark"] .rtl-text {
    color: #e2e8f0;
}

/* ===== DATA TABLE INSIDE SOAL (from Word import) ===== */
.soal-text table,
.eq-preview-content table,
.opsi-btn table {
    border-collapse: collapse;
    width: auto;
    max-width: 100%;
    margin: 10px 0;
    font-size: .88rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 6px;
    overflow: hidden;
}
.soal-text table th,
.soal-text table td,
.eq-preview-content table th,
.eq-preview-content table td {
    border: 1px solid var(--border-color, #e2e8f0);
    padding: 8px 12px;
    text-align: left;
    vertical-align: top;
}
.soal-text table th,
.eq-preview-content table th {
    background: rgba(59, 130, 246, .06);
    font-weight: 600;
    font-size: .82rem;
    color: var(--text-primary);
}
.soal-text table tr:nth-child(even),
.eq-preview-content table tr:nth-child(even) {
    background: rgba(0, 0, 0, .02);
}
/* Table responsive wrapper */
.soal-text { overflow-x: auto; }
/* Images inside soal content */
.soal-text img,
.eq-preview-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 8px 0;
}
/* Lists inside soal */
.soal-text ul, .soal-text ol {
    padding-left: 24px;
    margin: 8px 0;
}
.soal-text li {
    margin-bottom: 4px;
}
/* Bold/italic in soal */
.soal-text strong, .soal-text b {
    font-weight: 700;
}
.soal-text em, .soal-text i {
    font-style: italic;
}
/* Dark mode for tables */
[data-theme="dark"] .soal-text table,
[data-theme="dark"] .eq-preview-content table {
    border-color: #374151;
}
[data-theme="dark"] .soal-text table th,
[data-theme="dark"] .eq-preview-content table th {
    background: rgba(59, 130, 246, .12);
    color: #e2e8f0;
}
[data-theme="dark"] .soal-text table td,
[data-theme="dark"] .eq-preview-content table td {
    border-color: #374151;
    color: #e2e8f0;
}
[data-theme="dark"] .soal-text table tr:nth-child(even),
[data-theme="dark"] .eq-preview-content table tr:nth-child(even) {
    background: rgba(255, 255, 255, .03);
}

/* ===== SIDEBAR ACCORDION (Data Nilai) ===== */
.nav-accordion {
    margin-bottom: 2px;
}

.nav-accordion-toggle {
    position: relative;
}

.nav-accordion-arrow {
    margin-left: auto;
    font-size: 18px !important;
    transition: transform .25s ease;
    opacity: .6;
    width: auto !important;
}

.nav-accordion.open .nav-accordion-arrow {
    transform: rotate(180deg);
}

.nav-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s cubic-bezier(.4, 0, .2, 1), opacity .25s ease;
    opacity: 0;
    padding-left: 8px;
}

.nav-accordion.open .nav-accordion-body {
    max-height: 120px;
    opacity: 1;
}

.nav-sub-item {
    font-size: .82rem !important;
    padding: 8px 12px 8px 20px !important;
    position: relative;
}

.nav-sub-item::after {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-muted);
    opacity: .5;
}

.nav-sub-item.active::after {
    background: var(--primary);
    opacity: 1;
}

/* ===== HEADER SYSTEM STATUS ===== */
.header-system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(34, 197, 94, .08);
    border: 1px solid rgba(34, 197, 94, .15);
    cursor: default;
    transition: all .2s ease;
}

.header-system-status:hover {
    background: rgba(34, 197, 94, .12);
}

.system-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.system-status-dot.online {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .2);
    animation: statusPulse 2s ease-in-out infinite;
}

.system-status-dot.offline {
    background: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .2);
}

.system-status-text {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .5px;
    color: #16a34a;
}

.system-status-dot.offline ~ .system-status-text {
    color: #dc2626;
}

@keyframes statusPulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
    50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, .05); }
}

/* ===== STAT BADGE COLOR VARIANTS ===== */
.badge-red { color: #dc2626; }
.badge-blue { color: var(--primary); }
.badge-teal { color: #0d9488; }

/* ===== ALERT PULSE (Curang Card) ===== */
.stat-card-v2.alert-pulse {
    animation: alertPulse 2.5s ease-in-out infinite;
}

@keyframes alertPulse {
    0%, 100% {
        box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
        border-color: var(--border-color);
    }
    50% {
        box-shadow: 0 4px 20px rgba(239, 68, 68, .15), 0 0 0 2px rgba(239, 68, 68, .08);
        border-color: rgba(239, 68, 68, .25);
    }
}

/* ===== DARK MODE: New Elements ===== */
[data-theme="dark"] .header-system-status {
    background: rgba(34, 197, 94, .06);
    border-color: rgba(34, 197, 94, .12);
}

[data-theme="dark"] .system-status-text {
    color: #4ade80;
}

[data-theme="dark"] .nav-accordion-body {
    background: transparent;
}

[data-theme="dark"] .stat-card-v2.alert-pulse {
    animation-name: alertPulseDark;
}

@keyframes alertPulseDark {
    0%, 100% {
        box-shadow: 0 1px 3px rgba(0,0,0,.2), 0 1px 2px rgba(0,0,0,.1);
        border-color: var(--border-color);
    }
    50% {
        box-shadow: 0 4px 20px rgba(239, 68, 68, .2), 0 0 0 2px rgba(239, 68, 68, .1);
        border-color: rgba(239, 68, 68, .3);
    }
}

/* ===== NEW REDESIGN STYLES ===== */

/* 1. Shimmer Loading Effect */
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

[data-theme="dark"] #chartSkeleton1, [data-theme="dark"] #chartSkeleton2, [data-theme="dark"] .timeline-skeleton > div {
    background: linear-gradient(90deg, #1e293b 0%, #334155 50%, #1e293b 100%) !important;
    background-size: 200% 100% !important;
}

/* 2. Hover micro-interactions for cards */
.stat-card-v2 {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card-v2:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.05);
}

.quick-action-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s;
}
.quick-action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(0,0,0,0.1);
    background: var(--bg-body);
}
[data-theme="dark"] .quick-action-card:hover {
    background: #1e293b;
}

.panel-card {
    transition: box-shadow 0.2s ease;
}
.panel-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}
[data-theme="dark"] .panel-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

/* 3. Sidebar Hover Indicator */
.sidebar-nav .nav-item {
    position: relative;
    overflow: hidden;
}
.sidebar-nav .nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 4px;
    height: 60%;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
    transition: transform 0.2s ease;
}
.sidebar-nav .nav-item:hover::before {
    transform: translateY(-50%) scaleY(1);
}
.sidebar-nav .nav-item.active::before {
    transform: translateY(-50%) scaleY(1.2);
    height: 70%;
}

/* 4. Global Search Dark Mode Fix */
[data-theme="dark"] .topbar-search input {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}
[data-theme="dark"] .topbar-search input:focus {
    border-color: var(--primary) !important;
}

/* Timeline specific styles */
.timeline-item {
    display: flex;
    gap: 12px;
    padding-bottom: 12px;
    position: relative;
}
.timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 15px;
    top: 30px;
    bottom: 0;
    width: 1px;
    background: var(--border-color);
}
.timeline-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
    z-index: 1;
}
.timeline-content {
    flex: 1;
}
.timeline-title {
.system-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.system-status-dot.online {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .2);
    animation: statusPulse 2s ease-in-out infinite;
}

.system-status-dot.offline {
    background: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .2);
}

.system-status-text {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .5px;
    color: #16a34a;
}

.system-status-dot.offline ~ .system-status-text {
    color: #dc2626;
}

@keyframes statusPulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
    50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, .05); }
}

/* ===== STAT BADGE COLOR VARIANTS ===== */
.badge-red { color: #dc2626; }
.badge-blue { color: var(--primary); }
.badge-teal { color: #0d9488; }

/* ===== ALERT PULSE (Curang Card) ===== */
.stat-card-v2.alert-pulse {
    animation: alertPulse 2.5s ease-in-out infinite;
}

@keyframes alertPulse {
    0%, 100% {
        box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
        border-color: var(--border-color);
    }
    50% {
        box-shadow: 0 4px 20px rgba(239, 68, 68, .15), 0 0 0 2px rgba(239, 68, 68, .08);
        border-color: rgba(239, 68, 68, .25);
    }
}

/* ===== DARK MODE: New Elements ===== */
[data-theme="dark"] .header-system-status {
    background: rgba(34, 197, 94, .06);
    border-color: rgba(34, 197, 94, .12);
}

[data-theme="dark"] .system-status-text {
    color: #4ade80;
}

[data-theme="dark"] .nav-accordion-body {
    background: transparent;
}

[data-theme="dark"] .stat-card-v2.alert-pulse {
    animation-name: alertPulseDark;
}

@keyframes alertPulseDark {
    0%, 100% {
        box-shadow: 0 1px 3px rgba(0,0,0,.2), 0 1px 2px rgba(0,0,0,.1);
        border-color: var(--border-color);
    }
    50% {
        box-shadow: 0 4px 20px rgba(239, 68, 68, .2), 0 0 0 2px rgba(239, 68, 68, .1);
        border-color: rgba(239, 68, 68, .3);
    }
}

/* ===== NEW REDESIGN STYLES ===== */

/* 1. Shimmer Loading Effect */
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

[data-theme="dark"] #chartSkeleton1, [data-theme="dark"] #chartSkeleton2, [data-theme="dark"] .timeline-skeleton > div {
    background: linear-gradient(90deg, #1e293b 0%, #334155 50%, #1e293b 100%) !important;
    background-size: 200% 100% !important;
}

/* 2. Hover micro-interactions for cards */
.stat-card-v2 {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card-v2:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.05);
}

.quick-action-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s;
}
.quick-action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(0,0,0,0.1);
    background: var(--bg-body);
}
[data-theme="dark"] .quick-action-card:hover {
    background: #1e293b;
}

.panel-card {
    transition: box-shadow 0.2s ease;
}
.panel-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}
[data-theme="dark"] .panel-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

/* 3. Sidebar Hover Indicator */
.sidebar-nav .nav-item {
    position: relative;
    overflow: hidden;
}
.sidebar-nav .nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 4px;
    height: 60%;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
    transition: transform 0.2s ease;
}
.sidebar-nav .nav-item:hover::before {
    transform: translateY(-50%) scaleY(1);
}
.sidebar-nav .nav-item.active::before {
    transform: translateY(-50%) scaleY(1.2);
    height: 70%;
}

/* 4. Global Search Dark Mode Fix */
[data-theme="dark"] .topbar-search input {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}
[data-theme="dark"] .topbar-search input:focus {
    border-color: var(--primary) !important;
}

/* Timeline specific styles */
.timeline-item {
    display: flex;
    gap: 12px;
    padding-bottom: 12px;
    position: relative;
}
.timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 15px;
    top: 30px;
    bottom: 0;
    width: 1px;
    background: var(--border-color);
}
.timeline-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
    z-index: 1;
}
.timeline-content {
    flex: 1;
}
.timeline-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}
.timeline-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ===== CETAK KARTU LOGIN ===== */

/* Body class: hide sidebar & content when preview is active */
body.cetak-kartu-active .sidebar,
body.cetak-kartu-active .sidebar-overlay,
body.cetak-kartu-active .topbar,
body.cetak-kartu-active .main-content,
body.cetak-kartu-active .modal-backdrop {
    display: none !important;
}
body.cetak-kartu-active {
    margin: 0 !important;
    padding: 0 !important;
    overflow: auto !important;
}

.kartu-login-page {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #f6f7f8;
    z-index: 99999;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}
[data-theme="dark"] .kartu-login-page {
    background: #101922;
}
.kartu-login-page.active {
    display: block;
}
.kartu-login-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    flex-wrap: wrap;
}
[data-theme="dark"] .kartu-login-toolbar {
    background: #1e293b;
    border-color: #334155;
}
.kartu-login-toolbar .toolbar-info {
    font-size: 0.85rem;
    color: #475569;
    font-weight: 500;
}
.kartu-login-toolbar .toolbar-info strong {
    color: #0f172a;
}
.kartu-print-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: 780px;
    margin: 0 auto;
}
.kartu-login-item {
    border: 2px solid #d0d7de;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    page-break-inside: avoid;
    break-inside: avoid;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.kartu-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #137fec 100%);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}
.kartu-header img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    border-radius: 6px;
    background: rgba(255,255,255,.15);
    padding: 3px;
}
.kartu-header-text h3 {
    font-size: 0.72rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.5px;
    line-height: 1.3;
}
.kartu-header-text p {
    font-size: 0.58rem;
    margin: 0;
    opacity: 0.8;
    font-weight: 400;
}
.kartu-body {
    padding: 10px 14px;
}
.kartu-label-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 0.72rem;
    line-height: 1.4;
}
.kartu-label-row:last-child {
    margin-bottom: 0;
}
.kartu-label-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 4px;
    font-size: 11px;
}
.kartu-label-icon.icon-nama { background: #eff6ff; color: #2563eb; }
.kartu-label-icon.icon-kelas { background: #f0fdf4; color: #16a34a; }
.kartu-label-icon.icon-userid { background: #fefce8; color: #ca8a04; }
.kartu-label-icon.icon-password { background: #fef2f2; color: #dc2626; }
.kartu-label-key {
    font-weight: 600;
    color: #475569;
    min-width: 60px;
    flex-shrink: 0;
}
.kartu-label-sep {
    color: #94a3b8;
    flex-shrink: 0;
}
.kartu-label-val {
    font-weight: 700;
    color: #0f172a;
    word-break: break-all;
}
.kartu-label-val.val-password {
    font-family: 'Courier New', Courier, monospace;
    background: #fef2f2;
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px dashed #fca5a5;
    color: #dc2626;
    letter-spacing: 1.5px;
    font-size: 0.75rem;
}
.kartu-label-val.val-userid {
    font-family: 'Courier New', Courier, monospace;
    background: #fefce8;
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid #fde68a;
    letter-spacing: 0.5px;
}
.kartu-footer {
    padding: 6px 14px 8px;
    border-top: 1px dashed #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.kartu-footer-url {
    font-size: 0.6rem;
    color: #3b82f6;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}
.kartu-footer-url .material-symbols-outlined {
    font-size: 11px;
}
.kartu-footer-warn {
    font-size: 0.55rem;
    color: #ef4444;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 3px;
}
.kartu-footer-warn .material-symbols-outlined {
    font-size: 10px;
}

/* ===== PRINT STYLES ===== */
@media print {
    /* Hide EVERYTHING on the page */
    body * {
        visibility: hidden !important;
    }
    /* Then show ONLY the kartu print content */
    body.cetak-kartu-printing .kartu-login-page,
    body.cetak-kartu-printing .kartu-login-page * {
        visibility: visible !important;
    }
    body.cetak-kartu-printing .kartu-login-page {
        display: block !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: auto !important;
        background: #fff !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
        z-index: auto !important;
    }
    /* Hide toolbar in print */
    body.cetak-kartu-printing .kartu-login-toolbar {
        display: none !important;
        visibility: hidden !important;
    }
    /* Grid layout for cards */
    body.cetak-kartu-printing .kartu-print-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    body.cetak-kartu-printing .kartu-login-item {
        border: 1.5px solid #888 !important;
        border-radius: 8px !important;
        box-shadow: none !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    body.cetak-kartu-printing .kartu-header {
        background: linear-gradient(135deg, #1e3a5f 0%, #137fec 100%) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color: #fff !important;
    }
    body.cetak-kartu-printing .kartu-label-val.val-password {
        background: #fef2f2 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    body.cetak-kartu-printing .kartu-label-val.val-userid {
        background: #fefce8 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    body.cetak-kartu-printing .kartu-label-icon {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    body.cetak-kartu-printing .kartu-footer-url {
        color: #3b82f6 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    body.cetak-kartu-printing .kartu-footer-warn {
        color: #ef4444 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    /* Page break every 4 cards */
    body.cetak-kartu-printing .kartu-page-break {
        page-break-before: always !important;
        break-before: page !important;
    }
    @page {
        size: A4 portrait;
        margin: 10mm;
    }
}
