/* =============================================
   APP RAPORT SD - Premium Design System
   Kurikulum Merdeka (IKM) 2025
   Dark Mode + Glassmorphism
   ============================================= */

/* ---- CSS Variables ---- */
:root {
    /* Primary Palette - Deep Blue & Gold */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;

    /* Accent - Gold */
    --accent-400: #fbbf24;
    --accent-500: #f59e0b;
    --accent-600: #d97706;

    /* Success / Warning / Danger */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #6366f1;

    /* Dark Theme Backgrounds */
    --bg-darkest: #0a0e1a;
    --bg-dark: #0f1629;
    --bg-card: #151d35;
    --bg-card-hover: #1a2442;
    --bg-input: #1a2340;
    --bg-sidebar: #0c1222;

    /* Text Colors */
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-white: #ffffff;

    /* Borders */
    --border-color: rgba(148, 163, 184, 0.12);
    --border-light: rgba(255, 255, 255, 0.06);

    /* Glass Effect */
    --glass-bg: rgba(15, 22, 41, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

    /* Sidebar */
    --sidebar-width: 270px;
    --sidebar-collapsed: 70px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-darkest);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

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

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-white);
}

/* ---- Animated Background ---- */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(99, 102, 241, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(245, 158, 11, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
    position: fixed;
    left: 0; top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-normal);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo .material-icons-round {
    font-size: 32px;
    background: linear-gradient(135deg, var(--primary-500), var(--accent-500));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-logo h1 {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--text-white) 0%, var(--primary-300) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.sidebar-toggle:hover { color: var(--text-white); background: var(--bg-card); }

/* Nav */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 10px; }

.nav-section { margin-bottom: 24px; }

.nav-section-title {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    position: relative;
    margin-bottom: 2px;
}

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

.nav-item.active {
    color: var(--text-white);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(99, 102, 241, 0.1));
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: linear-gradient(180deg, var(--primary-400), var(--accent-500));
    border-radius: 0 4px 4px 0;
}

.nav-item .material-icons-round { font-size: 20px; }

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

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    margin-bottom: 8px;
}

.user-avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary-600), var(--info));
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar .material-icons-round { font-size: 18px; color: white; }

.user-name { font-size: 0.85rem; font-weight: 600; color: var(--text-white); display: block; }
.user-role { font-size: 0.7rem; color: var(--text-muted); display: block; }

.logout-btn:hover {
    color: var(--danger) !important;
    background: rgba(239, 68, 68, 0.1) !important;
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    position: relative;
    z-index: 1;
    transition: margin-left var(--transition-normal);
}

.page-content {
    padding: 24px;
    max-width: 1400px;
}

/* ---- Topbar ---- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(15, 22, 41, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 20px; }

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.breadcrumb .material-icons-round { font-size: 16px; }
.breadcrumb span:last-child { color: var(--text-white); font-weight: 600; }

.topbar-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 6px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

.topbar-info .material-icons-round { font-size: 14px; color: var(--primary-400); }

/* =============================================
   CARDS & GLASSMORPHISM
   ============================================= */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: rgba(59, 130, 246, 0.15);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.card-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--glass-shadow);
}

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

.card-header h2 { font-size: 1.15rem; }
.card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.card-subtitle { font-size: 0.8rem; color: var(--text-muted); }

/* ---- Stat Cards ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 100px; height: 100px;
    border-radius: 50%;
    opacity: 0.05;
    transition: opacity var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.stat-card:hover::after { opacity: 0.1; }

.stat-icon {
    width: 52px; height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon .material-icons-round { font-size: 24px; color: white; }

.stat-icon.blue { background: linear-gradient(135deg, #3b82f6, #6366f1); }
.stat-icon.green { background: linear-gradient(135deg, #10b981, #059669); }
.stat-icon.amber { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-icon.purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }

.stat-card::after { background: var(--primary-500); }
.stat-card:nth-child(2)::after { background: var(--success); }
.stat-card:nth-child(3)::after { background: var(--warning); }
.stat-card:nth-child(4)::after { background: var(--info); }

.stat-content { flex: 1; }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--text-white); line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; font-weight: 500; }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn .material-icons-round { font-size: 18px; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
    color: white;
}

.btn-success { background: linear-gradient(135deg, #10b981, #059669); color: white; }
.btn-success:hover { transform: translateY(-1px); color: white; }

.btn-warning { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; }
.btn-warning:hover { transform: translateY(-1px); color: white; }

.btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626); color: white; }
.btn-danger:hover { transform: translateY(-1px); color: white; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--primary-500); color: var(--primary-400); background: rgba(59, 130, 246, 0.05); }

.btn-ghost { background: transparent; color: var(--text-secondary); border: none; }
.btn-ghost:hover { color: var(--text-white); background: var(--bg-card); }

.btn-sm { padding: 6px 12px; font-size: 0.78rem; }
.btn-lg { padding: 14px 28px; font-size: 0.95rem; }

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* =============================================
   FORMS
   ============================================= */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

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

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-inline {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.form-inline .form-group { margin-bottom: 0; }

/* =============================================
   TABLES
   ============================================= */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

thead {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(99, 102, 241, 0.05));
}

thead th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 700;
    color: var(--text-white);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    vertical-align: middle;
}

tbody tr {
    transition: background var(--transition-fast);
}

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

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

/* Table Input Mode */
.table-input {
    width: 60px;
    padding: 6px 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: inherit;
    text-align: center;
    transition: all var(--transition-fast);
}

.table-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* =============================================
   ALERTS
   ============================================= */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    margin: 0 24px 16px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 2px;
    opacity: 0.6;
}

.alert-close:hover { opacity: 1; }

/* =============================================
   MODALS
   ============================================= */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-backdrop.active { opacity: 1; visibility: visible; }

.modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 { font-size: 1.1rem; }

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.modal-close:hover { color: var(--text-white); background: var(--bg-card-hover); }

.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* =============================================
   BADGES & TAGS
   ============================================= */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary { background: rgba(59, 130, 246, 0.15); color: var(--primary-400); }
.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

/* =============================================
   LOADING
   ============================================= */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 26, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.loading-overlay.active { opacity: 1; visibility: visible; }

.spinner {
    width: 48px; height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* =============================================
   PAGE-SPECIFIC: Dashboard
   ============================================= */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h2 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.page-header p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 2px;
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.welcome-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(99, 102, 241, 0.08));
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}

.welcome-card::before {
    content: '';
    position: absolute;
    top: -50%; right: -20%;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.welcome-card h2 {
    font-size: 1.5rem;
    margin-bottom: 6px;
}

.welcome-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .material-icons-round {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h3 {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.empty-state p { font-size: 0.85rem; margin-bottom: 20px; }

/* =============================================
   STUDENT NAVIGATION (PREV/NEXT)
   ============================================= */
.student-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

.student-nav-info {
    text-align: center;
}

.student-nav-info .name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-white);
}

.student-nav-info .detail {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* =============================================
   PRINT RAPORT STYLES
   ============================================= */
.raport-container {
    background: white;
    color: #1a1a2e;
    padding: 40px;
    border-radius: var(--radius-lg);
    max-width: 210mm;
    margin: 0 auto;
}

.raport-container h1, .raport-container h2, .raport-container h3, 
.raport-container h4, .raport-container h5, .raport-container h6 {
    color: #1a1a2e;
}

.raport-header {
    text-align: center;
    border-bottom: 3px double #1a1a2e;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.raport-header h2 { font-size: 1.2rem; text-transform: uppercase; letter-spacing: 2px; }
.raport-header h3 { font-size: 1.1rem; margin-top: 4px; }
.raport-header p { font-size: 0.8rem; color: #666; }

.raport-identity { margin-bottom: 20px; }
.raport-identity table { width: 100%; }
.raport-identity td { padding: 4px 0; font-size: 0.85rem; }
.raport-identity td:first-child { width: 160px; font-weight: 600; }

.raport-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 0.8rem;
}

.raport-table th, .raport-table td {
    border: 1px solid #333;
    padding: 8px 10px;
}

.raport-table thead th {
    background: #f0f0f0;
    color: #1a1a2e;
    font-size: 0.75rem;
    text-align: center;
}

.raport-table tbody td { color: #1a1a2e; }
.raport-table .nilai-cell { text-align: center; font-weight: 700; }

.raport-signature {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    font-size: 0.8rem;
    color: #1a1a2e;
}

.raport-signature .sig-block { text-align: center; width: 200px; }
.raport-signature .sig-name { 
    border-bottom: 1px solid #1a1a2e; 
    margin-top: 60px; 
    padding-bottom: 4px; 
    font-weight: 700; 
}

/* =============================================
   TABS
   ============================================= */
.tabs {
    display: flex;
    gap: 2px;
    background: var(--bg-dark);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active {
    background: var(--primary-600);
    color: white;
}

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }

/* =============================================
   SEARCH & FILTERS
   ============================================= */
.search-bar {
    position: relative;
    max-width: 300px;
}

.search-bar .material-icons-round {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--text-muted);
}

.search-bar input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* =============================================
   SIDEBAR OVERLAY (Mobile)
   ============================================= */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.sidebar-overlay.active { opacity: 1; visibility: visible; }

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

.animate-in {
    animation: slideUp 0.4s ease forwards;
    opacity: 0;
}

.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.1s; }
.animate-in:nth-child(3) { animation-delay: 0.15s; }
.animate-in:nth-child(4) { animation-delay: 0.2s; }

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-darkest);
    position: relative;
}

.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 30% 30%, rgba(59, 130, 246, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 70%, rgba(245, 158, 11, 0.06) 0%, transparent 50%);
}

.login-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.5s ease;
}

.login-card .login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-card .login-logo .material-icons-round {
    font-size: 48px;
    background: linear-gradient(135deg, var(--primary-500), var(--accent-500));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-card .login-logo h2 {
    font-size: 1.5rem;
    margin-top: 8px;
    font-weight: 800;
}

.login-card .login-logo p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

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

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

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

    .mobile-toggle { display: flex; }

    .topbar-right .school-name { display: none; }

    .page-content { padding: 16px; }

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

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

    .page-header { flex-direction: column; align-items: flex-start; }

    .student-nav { flex-direction: column; gap: 12px; }
}

@media (max-width: 480px) {
    .login-card { margin: 16px; padding: 28px; }
    .topbar { padding: 12px 16px; }
    .topbar-info { display: none; }
}

/* =============================================
   PRINT STYLES
   ============================================= */
@media print {
    body {
        background: white !important;
        color: black !important;
    }

    .sidebar, .topbar, .no-print, .btn, .alert, 
    .modal, .modal-backdrop, .loading-overlay,
    .sidebar-overlay { display: none !important; }

    .main-content { margin-left: 0 !important; }
    .page-content { padding: 0 !important; max-width: none !important; }

    .raport-container {
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 20mm !important;
    }

    .raport-table th, .raport-table td {
        border: 1px solid #000 !important;
    }

    @page {
        size: A4;
        margin: 10mm;
    }
}

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* =============================================
   PAGINATION
   ============================================= */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
}

.pagination .page-btn {
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination .page-btn:hover { border-color: var(--primary-500); color: var(--primary-400); }
.pagination .page-btn.active {
    background: var(--primary-600);
    border-color: var(--primary-600);
    color: white;
}

/* =============================================
   TOOLTIP
   ============================================= */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    pointer-events: none;
    z-index: 100;
}

[data-tooltip]:hover::after { opacity: 1; visibility: visible; }
