/* ================================================================
   BelajarKu — "Frosted Aurora" Design System
   Light & Clean · Emerald/Teal · Glassmorphism
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* ── Variables ───────────────────────────────────────────────── */
:root {
  --em-50:  #ecfdf5; --em-100: #d1fae5; --em-200: #a7f3d0;
  --em-300: #6ee7b7; --em-400: #34d399; --em-500: #10b981;
  --em-600: #059669; --em-700: #047857; --em-800: #065f46;
  --teal-400: #2dd4bf; --teal-500: #14b8a6;

  --primary:       #10b981;
  --primary-dark:  #059669;
  --primary-light: #34d399;
  --primary-soft:  #ecfdf5;
  --primary-glow:  rgba(16,185,129,.18);

  /* Secondary (teal) — dipakai di gradient avatar */
  --secondary:     #14b8a6;

  --ink-900: #0d1117; --ink-800: #161b22; --ink-700: #21262d;
  --ink-600: #30363d; --ink-400: #6e7681; --ink-300: #8b949e;
  --ink-200: #c9d1d9; --ink-100: #e6edf3; --ink-50:  #f6f8fa;

  --bg: #f0faf6;
  --surface: #ffffff;
  --surface-2: rgba(255,255,255,.72);
  --glass: rgba(255,255,255,.70);
  --glass-border: rgba(255,255,255,.92);
  --glass-shadow: 0 8px 32px rgba(16,185,129,.07), 0 2px 8px rgba(0,0,0,.05);

  --text-primary:   #0d1117;
  --text-secondary: #374151;
  --text-muted:     #6b7280;
  --text-faint:     #9ca3af;

  --danger: #ef4444; --danger-soft: #fef2f2;
  --warning: #f59e0b; --warning-soft: #fffbeb;
  --success: #10b981; --success-soft: #ecfdf5;
  --info: #3b82f6; --info-soft: #eff6ff;

  --border:   rgba(16,185,129,.15);
  --border-2: rgba(0,0,0,.08);

  --r-xs: 6px; --r-sm: 10px; --r: 14px;
  --r-lg: 20px; --r-xl: 28px; --r-full: 9999px;

  /* Alias lama yang masih dipakai di beberapa view inline-style */
  --radius:      14px;
  --radius-sm:   10px;
  --border-light: rgba(0,0,0,.06);

  --sidebar-w: 256px;
  --sidebar-bg: rgba(13,17,23,.94);
  --sidebar-border: rgba(255,255,255,.06);
  --topbar-h: 64px;

  --t-fast: 150ms cubic-bezier(.4,0,.2,1);
  --t:      240ms cubic-bezier(.4,0,.2,1);
  --transition: var(--t);
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(16,185,129,.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 85% 110%, rgba(45,212,191,.10) 0%, transparent 55%);
  background-attachment: fixed;
}

input, select, textarea, button { font-family: 'DM Sans', sans-serif; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; }

/* ── App Layout ──────────────────────────────────────────────── */
.app-wrapper { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-right: 1px solid var(--sidebar-border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0;
  z-index: 200;
  transition: width var(--t), transform var(--t);
  overflow: hidden;
}
.sidebar.collapsed { width: 68px; }
.sidebar.collapsed .nav-label,
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .user-info { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px; }
.sidebar.collapsed .sidebar-logo { justify-content: center; padding: 0 0 0 2px; }

.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--sidebar-border);
}
.logo-mark {
  width: 34px; height: 34px; flex-shrink: 0;
  background: linear-gradient(135deg, #34d399, #059669);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff;
  box-shadow: 0 4px 14px rgba(16,185,129,.45);
}
.logo-text {
  font-family: 'Sora', sans-serif;
  font-size: 17px; font-weight: 700;
  color: #fff; letter-spacing: -.3px;
}

.sidebar-nav {
  flex: 1; padding: 16px 12px;
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-section-title {
  font-size: 10px; font-weight: 600;
  color: rgba(255,255,255,.22);
  text-transform: uppercase; letter-spacing: .08em;
  padding: 8px 8px 4px; margin-top: 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--r-sm);
  color: rgba(255,255,255,.52);
  font-size: 13.5px; font-weight: 500;
  transition: var(--t-fast);
  white-space: nowrap; position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.9); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(16,185,129,.22), rgba(45,212,191,.12));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(16,185,129,.28);
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 22%; bottom: 22%;
  width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #34d399, #10b981);
  margin-left: -12px;
}
.nav-item i { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; opacity: .75; }
.nav-item.active i { opacity: 1; color: #6ee7b7; }

.sidebar-footer {
  padding: 14px 12px;
  border-top: 1px solid var(--sidebar-border);
}
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-sm);
  background: rgba(255,255,255,.05);
}
.user-avatar-sm {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, #34d399, #14b8a6);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px;
  font-family: 'Sora', sans-serif;
}
.user-name { font-size: 12.5px; font-weight: 600; color: rgba(255,255,255,.82); }
.user-role { font-size: 11px; color: rgba(255,255,255,.32); margin-top: 1px; }

.mobile-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 199;
  backdrop-filter: blur(2px);
}
.mobile-overlay.show { display: block; }

/* ── Main Content ────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1; min-height: 100vh;
  display: flex; flex-direction: column;
  transition: margin-left var(--t);
}
.main-content.expanded { margin-left: 68px; }

/* ── Topbar ──────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid rgba(16,185,129,.10);
  display: flex; align-items: center; gap: 12px;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 0 rgba(16,185,129,.06), 0 4px 20px rgba(0,0,0,.03);
}
.topbar-toggle {
  width: 36px; height: 36px; border: none;
  background: transparent; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 16px;
  transition: var(--t-fast);
}
.topbar-toggle:hover { background: var(--primary-soft); color: var(--primary); }

.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-full);
  padding: 0 14px; height: 36px;
  flex: 1; max-width: 320px;
  transition: var(--t-fast);
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.search-box i { color: var(--text-faint); font-size: 12px; }
.search-box input { flex: 1; border: none; outline: none; background: transparent; font-size: 13px; color: var(--text-primary); }
.search-box input::placeholder { color: var(--text-faint); }

.topbar-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.topbar-btn {
  width: 36px; height: 36px; border: none;
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 15px;
  position: relative; transition: var(--t-fast);
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.topbar-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.topbar-badge {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px;
  background: var(--danger); border-radius: 50%;
  border: 2px solid var(--surface);
}

.topbar-profile {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px; border-radius: var(--r-full);
  background: var(--surface); border: 1px solid var(--border-2);
  cursor: pointer; transition: var(--t-fast);
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.topbar-profile:hover { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.topbar-avatar {
  width: 28px; height: 28px; border-radius: var(--r-full);
  background: linear-gradient(135deg, #34d399, #14b8a6);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 11px;
  font-family: 'Sora', sans-serif;
}
.topbar-profile-name { font-size: 13px; font-weight: 600; color: var(--text-secondary); }

/* ── Page Content ────────────────────────────────────────────── */
.page-content { padding: 28px; flex: 1; }
.page-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; flex-wrap: wrap; gap: 12px;
  margin-bottom: 28px;
}
.page-eyebrow { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--primary); margin-bottom: 4px; }
.page-title { font-family: 'Sora', sans-serif; font-size: 22px; font-weight: 700; color: var(--text-primary); line-height: 1.2; letter-spacing: -.4px; }
.page-subtitle { font-size: 13.5px; color: var(--text-muted); margin-top: 3px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── Stat Cards ──────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--glass);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg); padding: 22px;
  display: flex; align-items: flex-start; gap: 16px;
  box-shadow: var(--glass-shadow);
  transition: transform var(--t), box-shadow var(--t);
  position: relative; overflow: hidden;
}
.stat-card::after {
  content: ''; position: absolute; top: -20px; right: -20px;
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--primary-glow); pointer-events: none;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 16px 48px rgba(16,185,129,.12), 0 4px 12px rgba(0,0,0,.06); }
.stat-icon { width: 46px; height: 46px; flex-shrink: 0; border-radius: var(--r); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.stat-icon.blue   { background: #eff6ff; color: #3b82f6; }
.stat-icon.green  { background: var(--em-50); color: var(--em-600); }
.stat-icon.yellow { background: #fffbeb; color: #d97706; }
.stat-icon.red    { background: #fef2f2; color: #ef4444; }
.stat-icon.teal   { background: #f0fdfa; color: #0d9488; }
.stat-icon.cyan   { background: #ecfeff; color: #0891b2; }
.stat-body { flex: 1; min-width: 0; }
.stat-value { font-family: 'Sora', sans-serif; font-size: 28px; font-weight: 700; line-height: 1.1; color: var(--text-primary); letter-spacing: -.5px; }
.stat-label { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }

/* ── Card ────────────────────────────────────────────────────── */
.card {
  background: var(--glass);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-shadow);
  overflow: hidden;
}
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid rgba(16,185,129,.08); }
.card-title { font-family: 'Sora', sans-serif; font-size: 14.5px; font-weight: 600; color: var(--text-primary); }
.card-body { padding: 20px 22px; }

/* ── Table ───────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 16px; text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); background: rgba(16,185,129,.04); border-bottom: 1px solid rgba(16,185,129,.10); white-space: nowrap; }
td { padding: 13px 16px; font-size: 13.5px; vertical-align: middle; border-bottom: 1px solid rgba(0,0,0,.04); color: var(--text-secondary); }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--t-fast); }
tbody tr:hover td { background: rgba(16,185,129,.03); }

/* ── Badge ───────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--r-full); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge i { font-size: 9px; }
.badge-primary { background: var(--em-50); color: var(--em-700); border: 1px solid var(--em-200); }
.badge-success { background: var(--em-50); color: var(--em-700); border: 1px solid var(--em-200); }
.badge-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.badge-danger  { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.badge-gray    { background: var(--ink-50); color: var(--ink-400); border: 1px solid var(--ink-100); }
.badge-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 18px; border-radius: var(--r-full); font-size: 13.5px; font-weight: 600; border: none; cursor: pointer; transition: all var(--t-fast); white-space: nowrap; font-family: 'DM Sans', sans-serif; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }
.btn-primary { background: linear-gradient(135deg, #34d399, #059669); color: #fff; box-shadow: 0 4px 14px rgba(16,185,129,.3); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(16,185,129,.4); }
.btn-secondary { background: var(--surface); color: var(--text-secondary); border: 1px solid var(--border-2); box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn-ghost { background: transparent; color: var(--text-muted); border: none; }
.btn-ghost:hover { background: var(--primary-soft); color: var(--primary); }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; transform: translateY(-1px); }
.btn-success { background: linear-gradient(135deg, #34d399, #059669); color: #fff; }
.btn-success:hover { transform: translateY(-1px); }
.btn-sm { padding: 6px 14px; font-size: 12.5px; gap: 5px; }
.btn-lg { padding: 12px 28px; font-size: 14.5px; }
.btn-icon { padding: 7px; width: 34px; height: 34px; }
.w-full { width: 100%; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-secondary); }
.form-control { width: 100%; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-sm); font-size: 13.5px; color: var(--text-primary); transition: var(--t-fast); outline: none; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.form-control::placeholder { color: var(--text-faint); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { -webkit-appearance: none; -moz-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2310b981' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 8px; padding-right: 36px; cursor: pointer; }
select.form-control::-ms-expand { display: none; }
.form-hint { font-size: 11.5px; color: var(--text-faint); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Upload Area ─────────────────────────────────────────────── */
.upload-area { border: 2px dashed rgba(16,185,129,.28); border-radius: var(--r); padding: 28px 20px; text-align: center; cursor: pointer; transition: var(--t); background: rgba(16,185,129,.025); }
.upload-area:hover, .upload-area.drag { border-color: var(--primary); background: var(--em-50); }
.upload-area i { font-size: 28px; color: var(--primary); margin-bottom: 8px; display: block; opacity: .8; }
.upload-area-text { font-size: 13.5px; color: var(--text-secondary); font-weight: 500; }
.upload-area-hint { font-size: 11.5px; color: var(--text-faint); margin-top: 4px; }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(13,17,23,.45); backdrop-filter: blur(6px); z-index: 1000; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border: 1px solid rgba(16,185,129,.12); border-radius: var(--r-xl); width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; box-shadow: 0 24px 64px rgba(0,0,0,.14), 0 4px 16px rgba(16,185,129,.08); animation: modalIn .22s cubic-bezier(.34,1.56,.64,1); }
@keyframes modalIn { from { opacity:0; transform:scale(.95) translateY(8px); } to { opacity:1; transform:scale(1) translateY(0); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 18px; border-bottom: 1px solid rgba(16,185,129,.08); }
.modal-title { font-family: 'Sora', sans-serif; font-size: 16px; font-weight: 700; color: var(--text-primary); }
.modal-close { width: 32px; height: 32px; border: none; background: var(--ink-50); border-radius: var(--r-full); display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 13px; transition: var(--t-fast); }
.modal-close:hover { background: var(--danger-soft); color: var(--danger); }
.modal-body { padding: 22px 24px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px 22px; border-top: 1px solid rgba(16,185,129,.08); }

/* ── Toast ───────────────────────────────────────────────────── */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--ink-900); border-radius: var(--r); min-width: 280px; max-width: 360px; box-shadow: 0 8px 24px rgba(0,0,0,.22); animation: toastIn .25s cubic-bezier(.34,1.56,.64,1); pointer-events: all; border: 1px solid rgba(255,255,255,.06); }
.toast.success { border-left: 3px solid #34d399; }
.toast.error   { border-left: 3px solid #ef4444; }
.toast.warning { border-left: 3px solid #f59e0b; }
.toast.info    { border-left: 3px solid #3b82f6; }
.toast.hide    { animation: toastOut .22s ease forwards; }
@keyframes toastIn  { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:translateX(0); } }
@keyframes toastOut { from { opacity:1; transform:translateX(0); } to { opacity:0; transform:translateX(20px); } }
.toast-icon { font-size: 15px; flex-shrink: 0; }
.toast.success .toast-icon { color: #34d399; }
.toast.error   .toast-icon { color: #f87171; }
.toast.warning .toast-icon { color: #fbbf24; }
.toast.info    .toast-icon { color: #60a5fa; }
.toast-text  { font-size: 13px; font-weight: 500; flex: 1; color: rgba(255,255,255,.9); }
.toast-close { border: none; background: none; color: rgba(255,255,255,.4); cursor: pointer; font-size: 13px; padding: 0; pointer-events: all; }

/* ── Empty State ─────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 56px 24px; color: var(--text-faint); }
.empty-state > i { font-size: 36px; margin-bottom: 14px; opacity: .3; display: block; color: var(--primary); }
.empty-state h3 { font-size: 15px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.empty-state p  { font-size: 13px; max-width: 280px; margin: 0 auto; }

/* ── Filter Bar ──────────────────────────────────────────────── */
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-bar label { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; }
.filter-bar select { -webkit-appearance: none; -moz-appearance: none; appearance: none; padding: 8px 32px 8px 12px; border-radius: var(--r-full); font-size: 13px; background-size: 10px 7px; background-color: var(--surface); border: 1px solid var(--border-2); cursor: pointer; }

/* ── Grid / Materi ───────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.materi-card { background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--glass-border); border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--glass-shadow); transition: transform var(--t), box-shadow var(--t); }
.materi-card:hover { transform: translateY(-3px); box-shadow: 0 16px 48px rgba(16,185,129,.12); }
.materi-icon { width: 44px; height: 44px; flex-shrink: 0; background: linear-gradient(135deg, var(--em-50), var(--em-100)); border: 1px solid var(--em-200); border-radius: var(--r); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.materi-title { font-size: 13.5px; font-weight: 700; color: var(--text-primary); line-height: 1.4; }
.materi-meta  { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.materi-desc  { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.materi-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; padding-top: 10px; border-top: 1px solid rgba(16,185,129,.08); }

/* ── Tugas Cards ─────────────────────────────────────────────── */
.tugas-card { background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--glass-border); border-radius: var(--r-lg); padding: 16px 18px; display: flex; align-items: center; gap: 14px; box-shadow: var(--glass-shadow); transition: var(--t-fast); }
.tugas-card:hover { transform: translateX(4px); box-shadow: 0 8px 28px rgba(16,185,129,.10); }
.tugas-card-left { flex: 1; min-width: 0; }
.tugas-card-title { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tugas-card-meta  { font-size: 12px; color: var(--text-muted); display: flex; gap: 12px; flex-wrap: wrap; }
.tugas-card-meta i { margin-right: 3px; }

.deadline-near { color: var(--danger); font-weight: 600; }
.deadline-ok   { color: var(--em-600); }

.submission-box { background: var(--ink-50); border: 1px solid var(--ink-100); border-radius: var(--r-sm); padding: 12px 14px; font-size: 13px; line-height: 1.7; color: var(--text-secondary); }

/* ── Progress Bar (dipakai di tabel tugas & data siswa) ──────── */
.progress-bar {
  height: 6px;
  background: var(--ink-100);
  border-radius: var(--r-full);
  overflow: hidden;
  min-width: 40px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #60a5fa, #3b82f6);
  border-radius: var(--r-full);
  transition: width .4s ease;
}
.progress-fill.success {
  background: linear-gradient(90deg, #34d399, #059669);
}

/* ── Login ───────────────────────────────────────────────────── */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-split { width: 100%; max-width: 880px; display: grid; grid-template-columns: 1fr 1fr; border-radius: var(--r-xl); overflow: hidden; box-shadow: 0 32px 80px rgba(0,0,0,.12), 0 0 0 1px rgba(16,185,129,.1); }
.login-hero { background: linear-gradient(145deg, #0d1117 0%, #065f46 100%); padding: 48px 40px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 70% 60% at 10% 80%, rgba(16,185,129,.3) 0%, transparent 55%), radial-gradient(ellipse 50% 40% at 90% 20%, rgba(45,212,191,.2) 0%, transparent 50%); pointer-events: none; }
.login-hero-content { position: relative; z-index: 1; }
.login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 48px; }
.login-logo-mark { width: 38px; height: 38px; background: linear-gradient(135deg, #34d399, #10b981); border-radius: var(--r); display: flex; align-items: center; justify-content: center; font-size: 18px; color: #fff; box-shadow: 0 4px 14px rgba(16,185,129,.45); }
.login-logo-name { font-family: 'Sora', sans-serif; font-size: 20px; font-weight: 700; color: #fff; }
.login-hero-title { font-family: 'Sora', sans-serif; font-size: 26px; font-weight: 700; line-height: 1.35; color: #fff; letter-spacing: -.4px; margin-bottom: 12px; }
.login-hero-title span { color: #6ee7b7; }
.login-hero-subtitle { font-size: 13.5px; color: rgba(255,255,255,.5); line-height: 1.75; }
.login-hero-footer { position: relative; z-index: 1; font-size: 12px; color: rgba(255,255,255,.25); }
.login-form-panel { background: var(--surface); padding: 48px 40px; display: flex; flex-direction: column; justify-content: center; }
.login-title { font-family: 'Sora', sans-serif; font-size: 22px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; letter-spacing: -.3px; }
.login-subtitle { font-size: 13.5px; color: var(--text-muted); margin-bottom: 32px; line-height: 1.6; }
.login-btn { width: 100%; padding: 13px; font-size: 14px; border-radius: var(--r); margin-top: 8px; }
.login-footer-text { font-size: 12px; color: var(--text-faint); text-align: center; margin-top: 20px; }

/* ── Helpers ─────────────────────────────────────────────────── */
.text-sm { font-size: 12.5px; }
.text-muted { color: var(--text-muted); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.responsive-grid { }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .login-split { grid-template-columns: 1fr; max-width: 440px; }
  .login-hero  { display: none; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); width: var(--sidebar-w) !important; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; }
  .page-content { padding: 20px 16px; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr !important; }
  .grid-2 { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar > * { width: 100%; max-width: 100% !important; }
  .topbar { padding: 0 16px; }
  /* Inline 2-kolom layout di monitoring.php & siswa/tugas.php — collapse di mobile */
  #monitoring-layout,
  #tugas-layout {
    grid-template-columns: 1fr !important;
  }
  /* Dashboard siswa "responsive-grid" inline 1fr 1fr — collapse di mobile */
  .responsive-grid {
    grid-template-columns: 1fr !important;
  }
  /* Sticky panel jangan ngunci di sisi atas saat layout sudah single-column */
  #grade-panel { position: static !important; }
  /* Sembunyikan nama profil di topbar agar tidak overflow */
  .topbar-profile-name { display: none; }
  /* Materi-card footer agar tombol bisa wrap kalau nama guru panjang */
  .materi-footer { flex-wrap: wrap; gap: 8px; }
  /* Modal padding lebih kecil di mobile */
  .modal-overlay { padding: 12px; }
  .modal-header, .modal-body, .modal-footer { padding-left: 18px; padding-right: 18px; }
  .page-header { flex-direction: column; align-items: stretch; }
  .page-actions { width: 100%; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr !important; }
  .search-box { max-width: 100% !important; }
}

/* ── Notification System ─────────────────────────────────────── */
.notif-wrapper {
  position: relative;
}

.topbar-btn.active {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary);
}

/* Badge — angka unread di atas bell */
.topbar-badge {
  position: absolute; top: -3px; right: -3px;
  min-width: 17px; height: 17px;
  background: var(--danger); border-radius: var(--r-full);
  border: 2px solid var(--surface);
  font-size: 9px; font-weight: 700; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Sora', sans-serif;
  padding: 0 3px;
}

/* Panel dropdown */
.notif-panel {
  display: none;
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 360px;
  background: var(--surface);
  border: 1px solid rgba(16,185,129,.14);
  border-radius: var(--r-xl);
  box-shadow: 0 20px 60px rgba(0,0,0,.13), 0 4px 16px rgba(16,185,129,.08);
  z-index: 500;
  overflow: hidden;
  animation: notifIn .2s cubic-bezier(.34,1.56,.64,1);
}
.notif-panel.open { display: flex; flex-direction: column; }

@keyframes notifIn {
  from { opacity: 0; transform: translateY(-8px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Panel header */
.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(16,185,129,.08);
  background: rgba(16,185,129,.02);
}
.notif-panel-title {
  font-family: 'Sora', sans-serif;
  font-size: 14px; font-weight: 700;
  color: var(--text-primary);
}
.notif-read-all {
  font-size: 11.5px; font-weight: 600;
  color: var(--primary); background: none; border: none;
  cursor: pointer; padding: 0;
  transition: var(--t-fast);
}
.notif-read-all:hover { color: var(--primary-dark); text-decoration: underline; }

/* Scrollable list */
.notif-list {
  max-height: 380px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(16,185,129,.2) transparent;
}
.notif-list::-webkit-scrollbar { width: 4px; }
.notif-list::-webkit-scrollbar-thumb { background: rgba(16,185,129,.2); border-radius: 4px; }

/* Loading */
.notif-loading {
  text-align: center; padding: 32px;
  color: var(--text-faint); font-size: 20px;
}

/* Empty state */
.notif-empty {
  text-align: center; padding: 40px 20px;
  color: var(--text-faint);
}
.notif-empty > i { font-size: 30px; margin-bottom: 10px; display: block; opacity: .3; color: var(--primary); }
.notif-empty p   { font-size: 13px; margin: 0; }

/* Individual item */
.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(0,0,0,.04);
  cursor: pointer;
  transition: background var(--t-fast);
  position: relative;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: rgba(16,185,129,.04); }
.notif-item.unread { background: rgba(16,185,129,.05); }
.notif-item.unread:hover { background: rgba(16,185,129,.09); }

/* Icon */
.notif-icon-wrap {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}

/* Content */
.notif-content { flex: 1; min-width: 0; padding-right: 8px; }
.notif-title {
  font-size: 13px; font-weight: 700;
  color: var(--text-primary); line-height: 1.4;
  margin-bottom: 3px;
}
.notif-msg {
  font-size: 12px; color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.notif-time {
  font-size: 11px; color: var(--text-faint);
  margin-top: 5px;
}
.notif-time i { margin-right: 3px; }

/* Unread dot */
.notif-dot {
  width: 8px; height: 8px; flex-shrink: 0;
  background: var(--primary); border-radius: 50%;
  margin-top: 5px;
  box-shadow: 0 0 0 3px rgba(16,185,129,.2);
}

/* Delete button */
.notif-del-btn {
  position: absolute; top: 10px; right: 10px;
  width: 22px; height: 22px;
  background: none; border: none;
  color: var(--text-faint); font-size: 11px;
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: var(--t-fast);
  cursor: pointer;
}
.notif-item:hover .notif-del-btn { opacity: 1; }
.notif-del-btn:hover { background: var(--danger-soft); color: var(--danger); }

/* Footer */
.notif-panel-footer {
  padding: 10px 18px;
  border-top: 1px solid rgba(16,185,129,.08);
  background: rgba(16,185,129,.02);
  font-size: 11.5px; color: var(--text-faint);
  text-align: center;
}

/* Mobile: panel full width — pakai posisi fixed agar tidak menyebabkan horizontal scroll */
@media (max-width: 480px) {
  .notif-panel {
    position: fixed;
    top: calc(var(--topbar-h) + 6px);
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
  }
}

/* ── Preview Modal ───────────────────────────────────────────── */
.preview-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(13,17,23,.75);
  backdrop-filter: blur(8px);
  z-index: 2000;
  align-items: center; justify-content: center;
  padding: 16px;
}
.preview-modal-overlay.open { display: flex; }

.preview-modal {
  background: var(--surface);
  border: 1px solid rgba(16,185,129,.12);
  border-radius: var(--r-xl);
  width: 100%; max-width: 900px;
  height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 32px 80px rgba(0,0,0,.25);
  animation: modalIn .22s cubic-bezier(.34,1.56,.64,1);
  overflow: hidden;
}

.preview-modal-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(16,185,129,.08);
  background: rgba(16,185,129,.02);
  flex-shrink: 0;
}
.preview-modal-title {
  font-family: 'Sora', sans-serif;
  font-size: 14px; font-weight: 700;
  color: var(--text-primary);
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.preview-modal-actions { display: flex; gap: 8px; flex-shrink: 0; }

.preview-modal-body {
  flex: 1; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink-50);
  position: relative;
}

/* PDF & Office iframe */
.preview-iframe {
  width: 100%; height: 100%;
  border: none;
}

/* Image preview */
.preview-img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  border-radius: var(--r-sm);
}

/* Video preview */
.preview-video {
  max-width: 100%; max-height: 100%;
  border-radius: var(--r-sm);
  outline: none;
}

/* TXT preview */
.preview-txt {
  width: 100%; height: 100%;
  overflow: auto;
  padding: 24px;
  font-family: 'DM Mono', 'Courier New', monospace;
  font-size: 13px; line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-wrap; word-break: break-word;
  background: #fff;
}

/* No preview */
.preview-unavail {
  text-align: center; padding: 40px 24px;
  color: var(--text-faint);
}
/* Direct-child selector saja, jangan gunting semua <i> di dalam (termasuk ikon di tombol) */
.preview-unavail > i { font-size: 48px; display: block; margin-bottom: 16px; opacity: .3; color: var(--primary); }
.preview-unavail h3 { font-size: 16px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.preview-unavail p  { font-size: 13px; margin-bottom: 20px; }

/* Loading spinner inside preview */
.preview-loading {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  color: var(--text-muted); font-size: 13px;
}
.preview-loading i { font-size: 28px; color: var(--primary); }

/* Preview button in cards */
.btn-preview {
  background: var(--em-50);
  color: var(--em-700);
  border: 1px solid var(--em-200);
}
.btn-preview:hover {
  background: var(--em-100);
  border-color: var(--em-400);
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .preview-modal { max-width: 100%; height: 95vh; border-radius: var(--r-lg); }
}
