/* style.css */
/* === MODERN SAAS CSS VARIABLES === */
:root {
    --font-main: 'Plus Jakarta Sans', sans-serif;
    --bg-body: #F4F4F5; --bg-sidebar: #09090B; --bg-card: #FFFFFF;
    --bg-element: #F4F4F5; --border-color: #E4E4E7;
    --text-main: #09090B; --text-muted: #71717A;
    --primary: #166534; --primary-light: #DCFCE7; --accent: #F59E0B; 
    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
    --radius-card: 20px; --sidebar-w-full: 280px;
}

/* DARK MODE (DEFAULT) */
html.dark {
    --bg-body: #09090B; --bg-sidebar: #000000; --bg-card: #18181B;
    --bg-element: #27272A; --border-color: #27272A;
    --text-main: #FAFAFA; --text-muted: #A1A1AA;
    --primary: #22C55E; --primary-light: rgba(34, 197, 94, 0.15);
}

* { box-sizing: border-box; outline: none; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body { 
    margin: 0; padding: 0; font-family: var(--font-main); 
    background: var(--bg-body); color: var(--text-main); 
    min-height: 100vh; overflow-x: hidden;
}

.material-symbols-rounded { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.app-container { display: flex; width: 100%; min-height: 100vh; }

/* LOADING SPINNER */
#loading-overlay { background: rgba(9, 9, 11, 0.8); backdrop-filter: blur(8px); transition: 0.3s; }
.spinner { width: 40px; height: 40px; border: 3px solid var(--border-color); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* SIDEBAR */
.sidebar { 
    background: var(--bg-sidebar); border-right: 1px solid rgba(255,255,255,0.05); 
    display: flex; flex-direction: column; padding: 24px 16px; 
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
    z-index: 50; flex-shrink: 0; height: 100vh; width: var(--sidebar-w-full); 
    position: fixed; top: 0; left: 0;
}
body.sidebar-closed .sidebar { transform: translateX(-100%); }
.brand { display: flex; align-items: center; margin-bottom: 40px; padding: 0 8px; }
.nav-menu { flex: 1; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; overflow-x: hidden; padding-bottom: 20px; }
.nav-menu::-webkit-scrollbar { display: none; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; cursor: pointer; color: #A1A1AA; text-decoration: none; transition: 0.2s; font-size: 13px; font-weight: 500; }
.nav-item:hover { color: white; background: rgba(255,255,255,0.05); }
.nav-item.active { color: white; font-weight: 600; background: rgba(255,255,255,0.1); }
.nav-item.active .nav-icon { color: var(--primary); }
.nav-group-header { font-size: 10px; font-weight: 700; color: #71717A; text-transform: uppercase; letter-spacing: 1px; padding: 16px 14px 6px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.nav-child-container { overflow: hidden; transition: max-height 0.3s ease; max-height: 500px; }
.nav-child-container.collapsed { max-height: 0; }
.sidebar-footer { margin-top: auto; padding: 20px 16px; background: rgba(255,255,255,0.03); border-radius: 14px; text-align: center; border-top: 1px solid rgba(255,255,255,0.05); }

/* MAIN CONTENT */
.main-content { 
    flex: 1; display: flex; flex-direction: column; min-height: 100vh; 
    margin-left: var(--sidebar-w-full); width: calc(100% - var(--sidebar-w-full));
    transition: margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1), width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
body.sidebar-closed .main-content { margin-left: 0; width: 100%; }
.top-bar { position: sticky; top: 0; z-index: 30; background: rgba(9, 9, 11, 0.85); backdrop-filter: blur(12px); display: flex; justify-content: space-between; align-items: center; padding: 16px 32px; border-bottom: 1px solid var(--border-color); }
.header-brand { display: flex; align-items: center; gap: 12px; }
.header-brand h1 { font-size: 20px; font-weight: 800; color: var(--text-main); margin: 0; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; background: var(--bg-card); border: 1px solid var(--border-color); color: var(--text-main); display: grid; place-items: center; cursor: pointer; transition: 0.2s; }
.icon-btn:hover { background: var(--bg-element); }
.content-area { padding: 32px; max-width: 1400px; margin: 0 auto; width: 100%; flex: 1; }

@media (max-width: 768px) { 
    .sidebar { transform: translateX(-100%); } 
    body.mobile-active .sidebar { transform: translateX(0); } 
    .backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 40; display: none; backdrop-filter: blur(4px); } 
    body.mobile-active .backdrop { display: block; } 
    .main-content, body.sidebar-closed .main-content { margin-left: 0; width: 100%; transition: none; }
    .top-bar { padding: 16px; }
    .content-area { padding: 16px; padding-bottom: 60px; } 
}

/* CARDS & DASHBOARD GRID */
.page-banner { background: var(--bg-card); border: 1px solid var(--border-color); padding: 24px 32px; border-radius: var(--radius-card); margin-bottom: 24px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; border-left: 6px solid var(--primary); }
.banner-text h2 { margin: 0 0 4px 0; font-size: 24px; font-weight: 800; color: var(--text-main); }
.banner-text p { margin: 0; color: var(--text-muted); font-size: 14px; }
.btn-action { background: var(--primary); color: white; border: none; padding: 10px 16px; border-radius: 12px; cursor: pointer; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; transition: 0.2s; box-shadow: 0 4px 10px var(--primary-light); }
.btn-action:hover { transform: translateY(-2px); opacity: 0.9; }
.card { background: var(--bg-card); padding: 24px; border-radius: var(--radius-card); border: 1px solid var(--border-color); box-shadow: var(--shadow-soft); transition: 0.3s; }
.dashboard-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 24px; }
@media (max-width: 1200px) { .dashboard-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .dashboard-grid { grid-template-columns: 1fr; } }
.stat-card { position: relative; overflow: hidden; padding: 24px; display: flex; flex-direction: column; justify-content: center; border: none; cursor: pointer; transition: transform 0.2s; }
.stat-card:hover { transform: translateY(-3px); }
.stat-label { font-size: 13px; color: rgba(255,255,255,0.9); font-weight: 600; margin-bottom: 6px; }
.stat-val { font-size: 32px; font-weight: 800; margin: 0; color: white; line-height: 1.1; }
.stat-sub { font-size: 12px; color: rgba(255,255,255,0.8); margin-top: 6px; font-weight: 500; }

html.dark .card-gradient-1 { background: linear-gradient(135deg, #166534 0%, #064e3b 100%); box-shadow: inset 0 0 0 1px #059669; } 
html.dark .card-gradient-2 { background: linear-gradient(135deg, #0284c7 0%, #0c4a6e 100%); box-shadow: inset 0 0 0 1px #0284c7; } 
html.dark .card-gradient-3 { background: linear-gradient(135deg, #d97706 0%, #78350f 100%); box-shadow: inset 0 0 0 1px #d97706; } 
html.dark .card-gradient-4 { background: linear-gradient(135deg, #7e22ce 0%, #3b0764 100%); box-shadow: inset 0 0 0 1px #7e22ce; }

/* ENROLMENT CARDS */
.class-card-mini { background: var(--bg-card); border: 1px solid var(--border-color); padding: 12px; border-radius: 12px; display: flex; align-items: center; gap: 12px; cursor: pointer; transition: all 0.2s ease; box-shadow: 0 2px 5px rgba(0,0,0,0.02); }
.class-card-mini:hover { border-color: var(--primary); transform: translateY(-2px); }
.class-card-mini .cc-icon { height: 36px; width: 36px; background: var(--bg-element); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: 0.2s; }
.class-card-mini.active { background: rgba(34, 197, 94, 0.1); border-color: #22C55E; }
.class-card-mini.active .cc-icon { background: #22C55E; color: #000000; }

/* FORMS & BUTTONS */
.filter-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; background: var(--bg-element); padding: 12px; border-radius: 16px; border: 1px solid var(--border-color); }
.form-select, .form-input { background: var(--bg-card); border: 1px solid var(--border-color); color: var(--text-main); padding: 0 16px; border-radius: 10px; font-size: 13px; font-weight: 500; height: 40px; transition: 0.2s; }
.btn { padding: 0 16px; border-radius: 10px; border: none; cursor: pointer; font-weight: 600; font-size: 13px; height: 40px; display: inline-flex; align-items: center; justify-content: center; transition: 0.2s; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { opacity: 0.9; }
.btn-outline { background: var(--bg-card); border: 1px solid var(--border-color); color: var(--text-main); }
.btn-outline:hover { background: var(--bg-element); }
/* --- TAMBAHAN style.css --- */
/* LOGO TOPBAR BEHAVIOR */
.topbar-logo { display: none !important; }
body.sidebar-closed .topbar-logo { display: flex !important; }

@media (max-width: 768px) {
    /* Pada skrin kecil, logo tunjuk KECUALI bila menu dibuka */
    .topbar-logo { display: flex !important; }
    body.mobile-active .topbar-logo { display: none !important; }
}

/* Mengelakkan tulisan berbungkus pada butang log masuk/keluar di sidebar */
.sidebar-footer .btn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
