/* ============================================================
   Wahyu Beny Mukti — Light Theme Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* ---------- CSS VARIABLES ---------- */
:root {
  --bg:          #f0f4ff;
  --bg-card:     #ffffff;
  --bg-hover:    #f8faff;
  --sidebar-bg:  #ffffff;
  --sidebar-w:   260px;
  --topbar-h:    64px;

  --primary:      #4f46e5;
  --primary-dark: #3730a3;
  --primary-soft: #eef2ff;
  --secondary:    #7c3aed;

  --indigo:   #4f46e5;
  --violet:   #7c3aed;
  --cyan:     #0891b2;
  --emerald:  #059669;
  --amber:    #d97706;
  --red:      #dc2626;
  --pink:     #db2777;
  --teal:     #0d9488;

  --text-h:  #1e1b4b;
  --text:    #374151;
  --text-sm: #6b7280;
  --text-xs: #9ca3af;

  --border:       #e5e7eb;
  --border-focus: #4f46e5;

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08),0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08),0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08),0 4px 6px -4px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1),0 8px 10px -6px rgba(0,0,0,0.04);

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;
  --radius-2xl: 28px;

  --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 4px; }
::-webkit-scrollbar-thumb { background: #818cf8; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #4f46e5; }

/* Firefox scrollbar support */
* {
  scrollbar-width: thin;
  scrollbar-color: #818cf8 #f1f5f9;
}

/* ---------- LAYOUT ---------- */
.layout { display: flex; min-height: 100vh; }

.main-wrap,
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
  overflow-x: hidden;
  box-sizing: border-box;
}

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

/* Top accent line */
.sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #4f46e5, #7c3aed, #06b6d4);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 20px 18px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.logo-mark {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(79,70,229,0.35);
  flex-shrink: 0;
}
.logo-mark svg { width: 20px; height: 20px; }

.logo-text { font-size: 17px; font-weight: 800; color: var(--text-h); letter-spacing: -0.3px; }
.logo-sub  { font-size: 10px; color: var(--text-xs); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }

/* User card in sidebar */
.sidebar-user {
  padding: 14px 16px;
  margin: 12px 12px 0;
  background: var(--bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-ava {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: white;
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border: 2px solid rgba(79,70,229,0.2);
}

.user-ava.green { background: linear-gradient(135deg, #059669, #0d9488); border-color: rgba(5,150,105,0.2); }

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 700; color: var(--text-h); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-xs); }

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

.nav-label {
  font-size: 10px; font-weight: 700;
  color: var(--text-xs);
  text-transform: uppercase; letter-spacing: 0.8px;
  padding: 10px 12px 5px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-sm);
  text-decoration: none;
  font-size: 13.5px; font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
  position: relative;
}

.nav-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: transparent;
  flex-shrink: 0;
  transition: var(--transition);
}
.nav-icon svg { width: 16px; height: 16px; }

.nav-link:hover {
  color: var(--primary);
  background: var(--primary-soft);
}
.nav-link:hover .nav-icon { background: rgba(79,70,229,0.1); color: var(--primary); }

.nav-link.active {
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 600;
}
.nav-link.active .nav-icon {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: white;
  box-shadow: 0 3px 8px rgba(79,70,229,0.3);
}
.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
  left: -12px;
}

.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: white;
  font-size: 10px; font-weight: 700;
  padding: 1px 7px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
}
.nav-badge.green { background: var(--emerald); }

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

.logout-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
  color: var(--text-sm);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}
.logout-btn:hover { background: #fef2f2; color: var(--red); border-color: #fecaca; }
.logout-btn svg { width: 15px; height: 15px; }

.sidebar-close-btn {
  display: none;
  position: absolute;
  top: 16px; right: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  color: var(--text-sm);
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position: sticky;
  top: 0; z-index: 50;
  height: var(--topbar-h);
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  box-shadow: var(--shadow-xs);
}

.menu-btn {
  display: none;
  align-items: center; justify-content: center;
  background: none; border: none;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--text-sm);
  cursor: pointer;
  transition: var(--transition);
}
.menu-btn:hover { background: var(--bg); color: var(--text-h); }
.menu-btn svg { width: 20px; height: 20px; display: block; }

.topbar-title {
  flex: 1;
  font-size: 16px; font-weight: 700;
  color: var(--text-h);
}

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

.tb-badge-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sm);
}

.tb-badge-group .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  flex-shrink: 0;
}
.tb-badge-group .dot.dosen { background: var(--primary); }

.tb-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: white;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(79,70,229,0.25);
  cursor: pointer;
}
.tb-avatar.green { background: linear-gradient(135deg, #059669, #0d9488); border-color: rgba(5,150,105,0.25); }

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-content { flex: 1; padding: 28px 28px 48px; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title-group {}
.page-title {
  font-size: 24px; font-weight: 800;
  color: var(--text-h);
  letter-spacing: -0.4px;
  line-height: 1.2;
}
.page-subtitle { font-size: 13.5px; color: var(--text-sm); margin-top: 4px; }

.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ============================================================
   STATS CARDS
   ============================================================ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent-color, #4f46e5);
  opacity: 0.6;
}

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

.stat-icon.indigo { background: #eef2ff; color: var(--indigo); }
.stat-icon.cyan   { background: #ecfeff; color: var(--cyan); }
.stat-icon.amber  { background: #fffbeb; color: var(--amber); }
.stat-icon.green  { background: #ecfdf5; color: var(--emerald); }
.stat-icon.violet { background: #f5f3ff; color: var(--violet); }
.stat-icon.red    { background: #fef2f2; color: var(--red); }

.stat-val { font-size: 28px; font-weight: 800; color: var(--text-h); line-height: 1; letter-spacing: -1px; }
.stat-lbl { font-size: 12px; color: var(--text-sm); margin-top: 3px; font-weight: 500; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

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

.card-title {
  font-size: 14px; font-weight: 700;
  color: var(--text-h);
  display: flex; align-items: center; gap: 8px;
}
.card-title svg { width: 16px; height: 16px; color: var(--primary); }

.card-body { padding: 20px; }

/* ============================================================
   GRID LAYOUTS
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.grid-materi { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }

/* ============================================================
   MATA KULIAH CARD
   ============================================================ */
.mk-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.mk-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.mk-banner { height: 7px; }
.mk-body { padding: 18px; flex: 1; }
.mk-kode {
  display: inline-flex;
  font-size: 11px; font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  color: white;
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}
.mk-name { font-size: 15px; font-weight: 700; color: var(--text-h); margin-bottom: 4px; line-height: 1.3; }
.mk-meta { font-size: 11.5px; color: var(--text-xs); margin-bottom: 10px; }
.mk-desc {
  font-size: 12.5px; color: var(--text-sm); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 12px;
}
.mk-stats { display: flex; gap: 14px; }
.mk-stat { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-sm); }
.mk-stat svg { width: 12px; height: 12px; }

.mk-footer {
  padding: 11px 18px;
  border-top: 1px solid var(--border);
  background: #fafbff;
  display: flex; gap: 8px;
}

/* ============================================================
   MATERI CARD
   ============================================================ */
.materi-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.materi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: rgba(79,70,229,0.3); }

.materi-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.icon-pdf    { background: #fef2f2; border: 1px solid #fecaca; }
.icon-ppt    { background: #fffbeb; border: 1px solid #fde68a; }
.icon-jurnal { background: #eef2ff; border: 1px solid #c7d2fe; }
.icon-video  { background: #ecfdf5; border: 1px solid #a7f3d0; }
.icon-link   { background: #ecfeff; border: 1px solid #a5f3fc; }
.icon-doc    { background: #f5f3ff; border: 1px solid #ddd6fe; }

.materi-title { font-size: 13.5px; font-weight: 700; color: var(--text-h); line-height: 1.4; }
.materi-desc  { font-size: 12px; color: var(--text-sm); line-height: 1.5; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.materi-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 8px; border-top: 1px solid var(--border);
  font-size: 11px; color: var(--text-xs);
}

/* ============================================================
   TUGAS CARD
   ============================================================ */
.tugas-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
}
.tugas-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.tugas-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
}

.tugas-left-bar {
  width: 4px; height: 52px;
  border-radius: 99px;
  flex-shrink: 0;
}

.tugas-info { flex: 1; min-width: 0; }
.tugas-title { font-size: 14.5px; font-weight: 700; color: var(--text-h); margin-bottom: 5px; }
.tugas-meta { display: flex; gap: 14px; flex-wrap: wrap; }
.tugas-meta-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-sm); }
.tugas-meta-item svg { width: 13px; height: 13px; }

.tugas-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }

.tugas-foot {
  padding: 11px 20px;
  border-top: 1px solid var(--border);
  background: #fafbff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ============================================================
   PENGUMPULAN CARD
   ============================================================ */
.kumpul-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
}
.kumpul-card:hover { box-shadow: var(--shadow-md); }

.kumpul-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
}

.kumpul-ava {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: white;
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.kumpul-ava.graded { background: linear-gradient(135deg, #059669, #0d9488); }

.kumpul-info { flex: 1; min-width: 0; }
.kumpul-name { font-size: 14px; font-weight: 700; color: var(--text-h); }
.kumpul-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 3px; }
.kumpul-meta-item { font-size: 11.5px; color: var(--text-sm); }

.kumpul-nilai {
  display: flex; align-items: center; gap: 5px;
  font-size: 22px; font-weight: 800;
  color: var(--emerald);
}

.kumpul-foot {
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  background: #fafbff;
  display: flex; gap: 8px;
  flex-wrap: wrap;
}

.drive-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--primary-soft);
  border: 1px solid rgba(79,70,229,0.2);
  transition: var(--transition);
}
.drive-link:hover { background: var(--primary); color: white; border-color: var(--primary); }
.drive-link svg { width: 14px; height: 14px; }

/* ============================================================
   BADGES & TAGS
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  white-space: nowrap;
}
.badge svg { width: 11px; height: 11px; }

.badge-indigo  { background: #eef2ff; color: #4f46e5; border: 1px solid #c7d2fe; }
.badge-green   { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.badge-red     { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.badge-amber   { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.badge-gray    { background: #f9fafb; color: #6b7280; border: 1px solid #e5e7eb; }
.badge-violet  { background: #f5f3ff; color: #7c3aed; border: 1px solid #ddd6fe; }
.badge-cyan    { background: #ecfeff; color: #0891b2; border: 1px solid #a5f3fc; }

.tag {
  display: inline-block;
  font-size: 10.5px; font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid rgba(79,70,229,0.15);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 17px;
  border-radius: var(--radius-md);
  font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  line-height: 1;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(79,70,229,0.35);
}
.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 14px rgba(79,70,229,0.45);
  transform: translateY(-1px);
}

.btn-secondary { background: white; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg); border-color: #d1d5db; }

.btn-ghost { background: transparent; color: var(--text-sm); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-danger { background: #fef2f2; color: var(--red); border-color: #fecaca; }
.btn-danger:hover { background: var(--red); color: white; border-color: var(--red); }

.btn-success { background: #ecfdf5; color: var(--emerald); border-color: #a7f3d0; }
.btn-success:hover { background: var(--emerald); color: white; border-color: var(--emerald); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-xs { padding: 4px 9px; font-size: 11px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: white;
  color: var(--text-sm);
  cursor: pointer;
  transition: var(--transition);
}
.icon-btn:hover { background: var(--bg); color: var(--text-h); }
.icon-btn.danger:hover { background: #fef2f2; color: var(--red); border-color: #fecaca; }
.icon-btn svg { width: 14px; height: 14px; }

/* ============================================================
   TOOLBAR / FILTERS
   ============================================================ */
.toolbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px; flex-wrap: wrap;
}

.search-input-wrap {
  display: flex; align-items: center; gap: 8px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 9px 13px;
  flex: 1; min-width: 180px;
  transition: var(--transition);
}
.search-input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}
.search-input-wrap svg { width: 15px; height: 15px; color: var(--text-xs); flex-shrink: 0; }
.search-input-wrap input {
  flex: 1; border: none; outline: none;
  font-size: 13.5px; color: var(--text);
  background: transparent; font-family: inherit;
}
.search-input-wrap input::placeholder { color: var(--text-xs); }

.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-pill {
  padding: 6px 13px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: white;
  color: var(--text-sm);
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  font-family: inherit;
}
.filter-pill:hover { background: var(--primary-soft); border-color: rgba(79,70,229,0.3); color: var(--primary); }
.filter-pill.active { background: var(--primary); border-color: var(--primary); color: white; box-shadow: 0 2px 8px rgba(79,70,229,0.25); }

.select-filter {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 9px 13px;
  font-size: 13px; font-family: inherit;
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}
.select-filter:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex;
  gap: 3px;
  background: var(--bg);
  padding: 4px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  width: fit-content;
  margin-bottom: 20px;
}

.tab {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-sm);
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  font-family: inherit;
}
.tab.active {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.tab:not(.active):hover { color: var(--text-h); background: rgba(255,255,255,0.5); }

.tab-count {
  background: rgba(79,70,229,0.12);
  color: var(--primary);
  font-size: 11px; font-weight: 700;
  padding: 1px 7px;
  border-radius: 99px;
}
.tab.active .tab-count { background: rgba(79,70,229,0.12); }

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

label {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.required { color: var(--red); margin-left: 2px; }

input[type=text], input[type=email], input[type=password],
input[type=number], input[type=url], input[type=datetime-local],
input[type=date], select, textarea {
  width: 100%;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 13px;
  font-size: 13.5px; font-family: inherit;
  color: var(--text);
  outline: none;
  transition: var(--transition);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}
input::placeholder, textarea::placeholder { color: var(--text-xs); }
textarea { resize: vertical; min-height: 80px; }
select { cursor: pointer; }

.form-hint { font-size: 11.5px; color: var(--text-xs); margin-top: 5px; }

.color-picker { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.color-swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: var(--transition);
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { border-color: white; box-shadow: 0 0 0 2px currentColor; transform: scale(1.1); }

/* File upload area */
.file-drop {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg);
}
.file-drop:hover, .file-drop.drag-over {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.file-drop-icon {
  width: 48px; height: 48px;
  background: var(--primary-soft);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  color: var(--primary);
}
.file-drop-icon svg { width: 22px; height: 22px; }
.file-drop p { font-size: 13.5px; color: var(--text-sm); }
.file-drop .pick-link { color: var(--primary); font-weight: 600; text-decoration: underline; cursor: pointer; }
.file-drop .hint { font-size: 11.5px; color: var(--text-xs); display: block; margin-top: 5px; }

.file-selected {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-md);
  margin-top: 8px;
}
.file-selected-icon { font-size: 22px; }
.file-selected-name { flex: 1; font-size: 13px; font-weight: 600; color: var(--text-h); }
.file-selected-size { font-size: 11px; color: var(--text-sm); }
.file-remove-btn {
  background: none; border: none;
  color: var(--red); cursor: pointer;
  padding: 4px; border-radius: 50%;
  transition: var(--transition);
}
.file-remove-btn:hover { background: #fef2f2; }
.file-remove-btn svg { width: 14px; height: 14px; display: block; }

/* Google Drive input */
.gdrive-input-wrap {
  display: flex; align-items: center; gap: 10px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  transition: var(--transition);
}
.gdrive-input-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.12); }
.gdrive-icon { font-size: 20px; flex-shrink: 0; }
.gdrive-input-wrap input { flex: 1; border: none; outline: none; font-size: 13.5px; color: var(--text); font-family: inherit; padding: 0; background: transparent; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,15,30,0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 200;
  padding: 16px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: white;
  border-radius: var(--radius-xl);
  width: 100%; max-width: 500px;
  max-height: 92vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(0,0,0,0.05);
  animation: modalIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}
.modal-lg { max-width: 620px; }
.modal-sm { max-width: 400px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.93) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal-header-left { display: flex; align-items: center; gap: 12px; }
.modal-header-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.modal-header-icon svg { width: 18px; height: 18px; }
.modal-header h3 { font-size: 16px; font-weight: 700; color: var(--text-h); }

.modal-close {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-sm);
  cursor: pointer; padding: 6px;
  display: flex; transition: var(--transition);
}
.modal-close:hover { background: #fef2f2; color: var(--red); border-color: #fecaca; }
.modal-close svg { width: 15px; height: 15px; display: block; }

.modal-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
  flex-shrink: 0;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  padding: 11px 16px;
  background: var(--bg);
  color: var(--text-sm);
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }
td { padding: 12px 16px; color: var(--text); vertical-align: middle; }
td:last-child { text-align: right; }

/* ============================================================
   ALERT / COUNTDOWN
   ============================================================ */
.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  font-size: 13px; font-weight: 500;
  margin-bottom: 14px;
  border: 1px solid;
}
.alert svg { width: 16px; height: 16px; flex-shrink: 0; }
.alert-red    { background: #fef2f2; color: var(--red);    border-color: #fecaca; }
.alert-amber  { background: #fffbeb; color: var(--amber);  border-color: #fde68a; }
.alert-green  { background: #ecfdf5; color: var(--emerald); border-color: #a7f3d0; }
.alert-indigo { background: #eef2ff; color: var(--indigo); border-color: #c7d2fe; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 56px 20px;
  gap: 12px;
}
.empty-state svg { width: 56px; height: 56px; color: #d1d5db; margin-bottom: 4px; }
.empty-state h3 { font-size: 17px; font-weight: 700; color: var(--text-h); }
.empty-state p { font-size: 13.5px; color: var(--text-sm); max-width: 280px; }

/* ============================================================
   TOAST
   ============================================================ */
#toastContainer {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 999;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
}

.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 18px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  min-width: 270px; max-width: 360px;
  font-size: 13.5px;
  animation: toastIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(80px) scale(0.85); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
.toast.hide { animation: toastOut 0.25s ease forwards; }
@keyframes toastOut {
  to { opacity: 0; transform: translateX(60px) scale(0.9); }
}
.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-msg { flex: 1; font-weight: 600; color: var(--text-h); }
.toast-sub { font-size: 12px; color: var(--text-sm); font-weight: 400; margin-top: 2px; }
.toast.success { border-color: #a7f3d0; }
.toast.error   { border-color: #fecaca; }
.toast.info    { border-color: #c7d2fe; }

/* ============================================================
   OVERLAY
   ============================================================ */
#overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(3px);
  z-index: 90;
}
#overlay.open { display: block; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
}
.login-left {
  flex: 1;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #0891b2 100%);
  padding: 48px;
  display: flex; flex-direction: column; justify-content: center;
  color: white;
  position: relative;
  overflow: hidden;
}
.login-left::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.login-left-content { position: relative; z-index: 1; }
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 48px; }
.login-logo-mark {
  width: 46px; height: 46px;
  background: rgba(255,255,255,0.2);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
}
.login-logo-mark svg { width: 24px; height: 24px; }
.login-logo-text { font-size: 22px; font-weight: 800; letter-spacing: -0.3px; }
.login-tagline { font-size: 32px; font-weight: 800; line-height: 1.25; letter-spacing: -0.5px; margin-bottom: 16px; }
.login-desc { font-size: 15px; opacity: 0.8; line-height: 1.7; max-width: 380px; }
.login-features { margin-top: 36px; display: flex; flex-direction: column; gap: 14px; }
.login-feature { display: flex; align-items: center; gap: 12px; font-size: 14px; opacity: 0.9; }
.login-feature-icon {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.15);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  backdrop-filter: blur(4px);
}
.login-feature-icon svg { width: 18px; height: 18px; }

.login-right {
  width: 460px;
  display: flex; align-items: center; justify-content: center;
  padding: 48px 40px;
  background: white;
}
.login-form-wrap { width: 100%; max-width: 360px; }
.login-title { font-size: 26px; font-weight: 800; color: var(--text-h); margin-bottom: 6px; letter-spacing: -0.4px; }
.login-subtitle { font-size: 14px; color: var(--text-sm); margin-bottom: 32px; }

.demo-accounts {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 24px;
}
.demo-title { font-size: 11px; font-weight: 700; color: var(--text-sm); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.demo-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.demo-row:last-child { border-bottom: none; padding-bottom: 0; }
.demo-role { display: flex; align-items: center; gap: 7px; font-weight: 600; color: var(--text-h); }
.demo-dot { width: 7px; height: 7px; border-radius: 50%; }
.demo-cred { color: var(--text-sm); font-family: monospace; font-size: 11.5px; }
.demo-fill-btn {
  background: var(--primary-soft);
  border: 1px solid rgba(79,70,229,0.2);
  color: var(--primary);
  border-radius: 6px;
  font-size: 11px; font-weight: 600;
  padding: 3px 9px;
  cursor: pointer;
  transition: var(--transition);
}
.demo-fill-btn:hover { background: var(--primary); color: white; }

.login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--red);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
.login-error.show { display: block; }

/* ============================================================
   OVERLAY SPINNER
   ============================================================ */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   PROGRESS BAR (nilai)
   ============================================================ */
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 4px;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
  transition: width 0.5s ease;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-260px); width: 260px; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-xl); }
  .main-wrap { margin-left: 0; }
  .menu-btn { display: flex; }
  .sidebar-close-btn { display: block; }
  #overlay.open { display: block; }
  .login-left { display: none; }
  .login-right { width: 100%; padding: 32px 24px; }
  .page-content { padding: 18px 16px 40px; }
  .topbar { padding: 0 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .page-title { font-size: 20px; }
  .page-header { gap: 12px; }
  .grid-materi { grid-template-columns: 1fr; }
  .grid-auto  { grid-template-columns: 1fr; }
  .tugas-card-head { flex-wrap: wrap; }
  .tugas-badges { flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
}
