/* ============================================================
   YCC Student Management System — Design System
   Palette: Deep Navy + Electric Cyan + Vivid Violet + Neon Lime
   Typography: Plus Jakarta Sans
   ============================================================ */

/* --- CSS Variables --- */
:root {
  --bg-base:       #0D0F1A;
  --bg-surface:    #131629;
  --bg-card:       rgba(255,255,255,0.04);
  --bg-card-hover: rgba(255,255,255,0.07);
  --border:        rgba(255,255,255,0.08);
  --border-bright: rgba(255,255,255,0.15);

  --cyan:    #00E5FF;
  --cyan-dim: rgba(0,229,255,0.15);
  --violet:  #7C3AED;
  --violet-dim: rgba(124,58,237,0.2);
  --lime:    #AAFF00;
  --lime-dim: rgba(170,255,0,0.15);
  --orange:  #FF6B35;
  --orange-dim: rgba(255,107,53,0.15);
  --pink:    #FF3CAC;
  --pink-dim: rgba(255,60,172,0.15);

  --text-primary:   #F0F4FF;
  --text-secondary: #8892B0;
  --text-muted:     #4A5568;

  --sidebar-w: 260px;
  --topbar-h:  68px;
  --radius:    14px;
  --radius-sm: 8px;
  --radius-lg: 20px;

  --shadow-glow-cyan:   0 0 30px rgba(0,229,255,0.2);
  --shadow-glow-violet: 0 0 30px rgba(124,58,237,0.3);
  --shadow-card:        0 4px 24px rgba(0,0,0,0.4);

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

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 14px;
  line-height: 1.6;
}

/* --- Background Elements --- */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 32px 32px;
}

.orb {
  position: fixed; border-radius: 50%; filter: blur(80px);
  pointer-events: none; z-index: 0; opacity: 0.35;
  animation: orbFloat 12s ease-in-out infinite;
}
.orb-1 { width: 500px; height: 500px; background: var(--violet); top: -150px; left: -100px; animation-delay: 0s; }
.orb-2 { width: 400px; height: 400px; background: var(--cyan); bottom: -100px; right: -80px; animation-delay: -4s; }
.orb-3 { width: 300px; height: 300px; background: var(--pink); top: 50%; left: 50%; transform: translate(-50%,-50%); animation-delay: -8s; opacity: 0.15; }

@keyframes orbFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.05); }
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: rgba(13,15,26,0.85);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 100;
  transition: width var(--transition-slow), transform var(--transition-slow);
}

.sidebar.collapsed { width: 72px; }
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .user-info { display: none; }
.sidebar.collapsed .logo { justify-content: center; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 12px; }
.sidebar.collapsed .user-card { justify-content: center; }

/* Sidebar Header */
.sidebar-header {
  padding: 20px 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  min-height: 72px;
}

.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }

.logo-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: white;
  box-shadow: var(--shadow-glow-cyan);
}
.logo-icon svg { width: 22px; height: 22px; }

.logo-title {
  display: block; font-size: 18px; font-weight: 800;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; letter-spacing: 1px;
}
.logo-sub { display: block; font-size: 10px; color: var(--text-muted); letter-spacing: 0.5px; margin-top: -2px; }

.sidebar-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--text-secondary); padding: 6px; border-radius: 6px;
  transition: color var(--transition), background var(--transition);
  flex-shrink: 0;
}
.sidebar-toggle:hover { color: var(--cyan); background: var(--cyan-dim); }
.sidebar-toggle svg { width: 18px; height: 18px; display: block; }

/* Sidebar Nav */
.sidebar-nav {
  flex: 1; overflow-y: auto; padding: 12px 10px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}

.nav-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--text-muted); text-transform: uppercase;
  padding: 12px 8px 6px; margin-top: 4px;
}

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

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

.nav-item.active {
  color: var(--cyan);
  background: var(--cyan-dim);
}

.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}

.nav-icon { width: 20px; height: 20px; flex-shrink: 0; }
.nav-icon svg { width: 100%; height: 100%; display: block; }

.nav-glow {
  position: absolute; inset: 0; border-radius: var(--radius-sm);
  background: radial-gradient(circle at 30% 50%, var(--cyan-dim), transparent 70%);
  opacity: 0; transition: opacity var(--transition);
}
.nav-item.active .nav-glow { opacity: 1; }

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

.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: var(--radius-sm);
  background: var(--bg-card);
  position: relative;
}

.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
  color: white;
}

.user-name { display: block; font-size: 13px; font-weight: 600; }
.user-role { display: block; font-size: 11px; color: var(--text-muted); }

.user-status {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--lime); margin-left: auto; flex-shrink: 0;
  box-shadow: 0 0 8px var(--lime);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

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

.sidebar.collapsed ~ .main-content { margin-left: 72px; }

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  background: rgba(13,15,26,0.7);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  gap: 16px;
}

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

.mobile-menu-btn {
  display: none; background: none; border: none; cursor: pointer;
  color: var(--text-secondary); padding: 6px;
}
.mobile-menu-btn svg { width: 20px; height: 20px; }

.page-breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 700; color: var(--text-primary);
}
.breadcrumb-icon { font-size: 16px; }

.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 280px;
}
.search-bar:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-dim);
}
.search-bar svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.search-bar input {
  background: none; border: none; outline: none;
  color: var(--text-primary); font-size: 13px; width: 100%;
  font-family: inherit;
}
.search-bar input::placeholder { color: var(--text-muted); }

.icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--bg-card); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-secondary);
  transition: all var(--transition); position: relative;
}
.icon-btn:hover { color: var(--cyan); border-color: var(--cyan); background: var(--cyan-dim); }
.icon-btn svg { width: 18px; height: 18px; }

.notif-badge {
  position: absolute; top: -4px; right: -4px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--orange); color: white;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-base);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 10px;
  background: linear-gradient(135deg, var(--cyan), #0099CC);
  color: #0D0F1A; font-weight: 700; font-size: 13px;
  border: none; cursor: pointer;
  transition: all var(--transition);
  font-family: inherit; white-space: nowrap;
  box-shadow: 0 4px 15px rgba(0,229,255,0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,229,255,0.45);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary svg { width: 16px; height: 16px; }
.btn-primary.btn-sm { padding: 7px 14px; font-size: 12px; }

.btn-outline {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 10px;
  background: transparent; color: var(--text-primary);
  border: 1px solid var(--border-bright); font-weight: 600;
  font-size: 13px; cursor: pointer;
  transition: all var(--transition); font-family: inherit;
}
.btn-outline:hover { border-color: var(--cyan); color: var(--cyan); background: var(--cyan-dim); }
.btn-outline.btn-sm { padding: 7px 14px; font-size: 12px; }

.btn-danger {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 10px;
  background: linear-gradient(135deg, #FF4444, #CC0000);
  color: white; font-weight: 700; font-size: 13px;
  border: none; cursor: pointer;
  transition: all var(--transition); font-family: inherit;
}
.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(255,68,68,0.4); }

/* ============================================================
   PAGES
   ============================================================ */
.page {
  display: none; padding: 28px;
  animation: pageIn 0.35s cubic-bezier(0.4,0,0.2,1);
}
.page.active { display: block; }

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

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

.page-heading {
  font-size: 26px; font-weight: 800; letter-spacing: -0.5px;
  color: var(--text-primary); line-height: 1.2;
}
.wave { display: inline-block; animation: wave 2s ease-in-out infinite; }
@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(20deg); }
  75% { transform: rotate(-10deg); }
}

.page-sub { color: var(--text-secondary); font-size: 13.5px; margin-top: 4px; }

.date-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 10px;
  background: var(--bg-card); border: 1px solid var(--border);
  font-size: 13px; color: var(--text-secondary); white-space: nowrap;
}
.date-chip svg { width: 15px; height: 15px; }

/* ============================================================
   GLASS CARDS
   ============================================================ */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  backdrop-filter: blur(10px);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.glass-card:hover { border-color: var(--border-bright); }

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.card-header h3 { font-size: 15px; font-weight: 700; }

.see-all {
  font-size: 12px; color: var(--cyan); text-decoration: none; font-weight: 600;
  transition: opacity var(--transition);
}
.see-all:hover { opacity: 0.7; }

.chip {
  padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 600;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer;
  transition: all var(--transition);
}
.chip.active, .chip:hover { background: var(--cyan-dim); border-color: var(--cyan); color: var(--cyan); }

.live-badge {
  padding: 3px 10px; border-radius: 20px;
  background: rgba(170,255,0,0.15); border: 1px solid var(--lime);
  color: var(--lime); font-size: 10px; font-weight: 700; letter-spacing: 1px;
  animation: pulse 2s ease-in-out infinite;
}

/* ============================================================
   DASHBOARD — STATS GRID
   ============================================================ */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 24px;
}

.stat-card {
  border-radius: var(--radius-lg); padding: 22px;
  position: relative; overflow: hidden;
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: default;
}
.stat-card:hover { transform: translateY(-3px); }

.stat-cyan  { background: linear-gradient(135deg, rgba(0,229,255,0.12), rgba(0,229,255,0.04)); border-color: rgba(0,229,255,0.25); }
.stat-violet{ background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(124,58,237,0.04)); border-color: rgba(124,58,237,0.3); }
.stat-lime  { background: linear-gradient(135deg, rgba(170,255,0,0.12), rgba(170,255,0,0.04)); border-color: rgba(170,255,0,0.25); }
.stat-orange{ background: linear-gradient(135deg, rgba(255,107,53,0.12), rgba(255,107,53,0.04)); border-color: rgba(255,107,53,0.25); }

.stat-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.stat-cyan  .stat-icon { background: var(--cyan-dim); color: var(--cyan); }
.stat-violet .stat-icon { background: var(--violet-dim); color: #A78BFA; }
.stat-lime  .stat-icon { background: var(--lime-dim); color: var(--lime); }
.stat-orange .stat-icon { background: var(--orange-dim); color: var(--orange); }
.stat-icon svg { width: 22px; height: 22px; }

.stat-value {
  font-size: 32px; font-weight: 800; letter-spacing: -1px;
  line-height: 1;
}
.stat-cyan   .stat-value { color: var(--cyan); }
.stat-violet .stat-value { color: #A78BFA; }
.stat-lime   .stat-value { color: var(--lime); }
.stat-orange .stat-value { color: var(--orange); }

.stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; font-weight: 500; }

.stat-trend {
  font-size: 11px; font-weight: 600; margin-top: 10px;
  padding: 3px 8px; border-radius: 20px; display: inline-block;
}
.stat-trend.up { background: rgba(170,255,0,0.12); color: var(--lime); }
.stat-trend.down { background: rgba(255,68,68,0.12); color: #FF6B6B; }

.stat-bg-shape {
  position: absolute; right: -20px; bottom: -20px;
  width: 100px; height: 100px; border-radius: 50%;
  opacity: 0.06;
}
.stat-cyan   .stat-bg-shape { background: var(--cyan); }
.stat-violet .stat-bg-shape { background: var(--violet); }
.stat-lime   .stat-bg-shape { background: var(--lime); }
.stat-orange .stat-bg-shape { background: var(--orange); }

/* ============================================================
   DASHBOARD ROWS
   ============================================================ */
.dashboard-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 20px; margin-bottom: 20px;
}

.chart-card { grid-column: span 1; }

.chart-container {
  height: 200px; position: relative;
}

/* Activity List */
.activity-list { display: flex; flex-direction: column; gap: 12px; }

.activity-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.02);
  transition: background var(--transition);
}
.activity-item:hover { background: var(--bg-card-hover); }

.activity-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px;
}
.dot-cyan   { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.dot-violet { background: #A78BFA; box-shadow: 0 0 6px #A78BFA; }
.dot-lime   { background: var(--lime); box-shadow: 0 0 6px var(--lime); }
.dot-orange { background: var(--orange); box-shadow: 0 0 6px var(--orange); }

.activity-text { font-size: 12.5px; color: var(--text-secondary); flex: 1; }
.activity-text strong { color: var(--text-primary); font-weight: 600; }
.activity-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* Course Bars */
.course-bars { display: flex; flex-direction: column; gap: 14px; }

.course-bar-item { display: flex; flex-direction: column; gap: 6px; }
.course-bar-header { display: flex; justify-content: space-between; align-items: center; }
.course-bar-name { font-size: 13px; font-weight: 600; }
.course-bar-count { font-size: 12px; color: var(--text-muted); }

.course-bar-track {
  height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden;
}
.course-bar-fill {
  height: 100%; border-radius: 3px;
  transition: width 1s cubic-bezier(0.4,0,0.2,1);
}

/* Schedule List */
.schedule-list { display: flex; flex-direction: column; gap: 10px; }

.schedule-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.02);
  border-left: 3px solid transparent;
  transition: background var(--transition);
}
.schedule-item:hover { background: var(--bg-card-hover); }
.schedule-item.current { border-left-color: var(--cyan); background: var(--cyan-dim); }

.schedule-time { font-size: 11px; color: var(--text-muted); min-width: 80px; font-weight: 600; }
.schedule-info { flex: 1; }
.schedule-course { font-size: 13px; font-weight: 600; }
.schedule-room { font-size: 11px; color: var(--text-muted); }
.schedule-tag {
  padding: 3px 8px; border-radius: 20px; font-size: 10px; font-weight: 700;
}

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

.search-inline {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 14px; flex: 1; min-width: 200px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-inline:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-dim); }
.search-inline svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.search-inline input {
  background: none; border: none; outline: none;
  color: var(--text-primary); font-size: 13px; width: 100%; font-family: inherit;
}
.search-inline input::placeholder { color: var(--text-muted); }

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

.select-input {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 14px;
  color: var(--text-primary); font-size: 13px; font-family: inherit;
  cursor: pointer; outline: none;
  transition: border-color var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%238892B0' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
  padding-right: 34px;
}
.select-input:focus { border-color: var(--cyan); }
.select-input option { background: var(--bg-surface); }

.view-toggle { display: flex; gap: 4px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 4px; }
.view-btn {
  width: 32px; height: 32px; border-radius: 7px; border: none;
  background: none; color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.view-btn svg { width: 16px; height: 16px; }
.view-btn.active { background: var(--cyan-dim); color: var(--cyan); }

/* ============================================================
   DATA TABLE
   ============================================================ */
.students-table-wrap {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; overflow-x: auto;
  margin-bottom: 16px;
}

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

.data-table thead tr {
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}

.data-table th {
  padding: 13px 16px; text-align: left;
  font-size: 11px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--text-muted);
  white-space: nowrap;
}

.data-table td {
  padding: 13px 16px; font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background var(--transition);
}
.data-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.data-table tbody tr:last-child td { border-bottom: none; }

.data-table input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--cyan); cursor: pointer;
}

/* Student cell */
.student-cell { display: flex; align-items: center; gap: 10px; }
.student-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.student-name { font-weight: 600; font-size: 13px; }
.student-email { font-size: 11px; color: var(--text-muted); }

/* Status badge */
.badge {
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; display: inline-block;
}
.badge-active   { background: rgba(170,255,0,0.12); color: var(--lime); border: 1px solid rgba(170,255,0,0.3); }
.badge-inactive { background: rgba(255,68,68,0.1); color: #FF6B6B; border: 1px solid rgba(255,68,68,0.2); }
.badge-cyan     { background: var(--cyan-dim); color: var(--cyan); border: 1px solid rgba(0,229,255,0.3); }
.badge-violet   { background: var(--violet-dim); color: #A78BFA; border: 1px solid rgba(124,58,237,0.3); }
.badge-lime     { background: var(--lime-dim); color: var(--lime); border: 1px solid rgba(170,255,0,0.3); }
.badge-orange   { background: var(--orange-dim); color: var(--orange); border: 1px solid rgba(255,107,53,0.3); }
.badge-pink     { background: var(--pink-dim); color: var(--pink); border: 1px solid rgba(255,60,172,0.3); }

/* Attendance bar in table */
.att-bar { display: flex; align-items: center; gap: 8px; }
.att-track { flex: 1; height: 5px; background: rgba(255,255,255,0.06); border-radius: 3px; min-width: 60px; }
.att-fill { height: 100%; border-radius: 3px; }
.att-pct { font-size: 12px; font-weight: 600; min-width: 32px; }

/* Action buttons */
.action-btns { display: flex; gap: 6px; }
.action-btn {
  width: 30px; height: 30px; border-radius: 7px; border: none;
  background: var(--bg-card); color: var(--text-muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.action-btn:hover { background: var(--cyan-dim); color: var(--cyan); }
.action-btn.delete:hover { background: rgba(255,68,68,0.1); color: #FF6B6B; }
.action-btn svg { width: 14px; height: 14px; }

/* ============================================================
   STUDENTS GRID VIEW
   ============================================================ */
.students-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px; margin-bottom: 16px;
}

.student-grid-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px; text-align: center;
  transition: all var(--transition); cursor: pointer;
}
.student-grid-card:hover { border-color: var(--cyan); transform: translateY(-3px); box-shadow: var(--shadow-glow-cyan); }

.grid-avatar {
  width: 60px; height: 60px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 22px; margin: 0 auto 12px;
}
.grid-name { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.grid-course { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.grid-stats { display: flex; justify-content: center; gap: 16px; }
.grid-stat { text-align: center; }
.grid-stat-val { font-size: 15px; font-weight: 700; }
.grid-stat-lbl { font-size: 10px; color: var(--text-muted); }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.page-btn {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text-secondary);
  cursor: pointer; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); font-family: inherit;
}
.page-btn:hover { border-color: var(--cyan); color: var(--cyan); background: var(--cyan-dim); }
.page-btn.active { background: var(--cyan); color: #0D0F1A; border-color: var(--cyan); }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ============================================================
   COURSES GRID
   ============================================================ */
.courses-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.course-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px; position: relative; overflow: hidden;
  transition: all var(--transition);
}
.course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); }

.course-card-accent {
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
}

.course-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.course-card-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.course-card-icon svg { width: 24px; height: 24px; }

.course-card-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.course-card-desc { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 16px; }

.course-card-meta { display: flex; gap: 16px; margin-bottom: 16px; }
.course-meta-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.course-meta-item svg { width: 14px; height: 14px; }

.course-progress-wrap { margin-bottom: 14px; }
.course-progress-header { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.course-progress-track { height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; }
.course-progress-fill { height: 100%; border-radius: 3px; transition: width 1s ease; }

.course-card-footer { display: flex; align-items: center; justify-content: space-between; }
.course-instructor { display: flex; align-items: center; gap: 8px; }
.instructor-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.instructor-name { font-size: 12px; color: var(--text-secondary); }

/* ============================================================
   ATTENDANCE
   ============================================================ */
.attendance-controls {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px; flex-wrap: wrap;
}

.date-input {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 14px;
  color: var(--text-primary); font-size: 13px; font-family: inherit;
  outline: none; transition: border-color var(--transition);
  color-scheme: dark;
}
.date-input:focus { border-color: var(--cyan); }

.attendance-summary {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 20px;
}

.att-summary-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; text-align: center;
}
.att-summary-num { font-size: 28px; font-weight: 800; }
.att-summary-lbl { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.attendance-list { display: flex; flex-direction: column; gap: 8px; }

.attendance-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 16px;
  transition: background var(--transition);
}
.attendance-row:hover { background: var(--bg-card-hover); }

.att-student { display: flex; align-items: center; gap: 10px; flex: 1; }
.att-name { font-size: 13px; font-weight: 600; }
.att-course { font-size: 11px; color: var(--text-muted); }

.att-buttons { display: flex; gap: 6px; }
.att-btn {
  padding: 5px 14px; border-radius: 7px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--border); background: none; color: var(--text-muted);
  cursor: pointer; transition: all var(--transition); font-family: inherit;
}
.att-btn.present.active { background: rgba(170,255,0,0.15); border-color: var(--lime); color: var(--lime); }
.att-btn.absent.active  { background: rgba(255,68,68,0.1); border-color: #FF6B6B; color: #FF6B6B; }
.att-btn.late.active    { background: var(--orange-dim); border-color: var(--orange); color: var(--orange); }
.att-btn:hover { border-color: var(--border-bright); color: var(--text-primary); }

/* ============================================================
   GRADES
   ============================================================ */
.grades-filters { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }

.grades-overview {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 12px; margin-bottom: 20px;
}

.grade-overview-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; text-align: center;
  transition: all var(--transition);
}
.grade-overview-card:hover { border-color: var(--border-bright); }
.grade-letter { font-size: 28px; font-weight: 800; }
.grade-range  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.grade-count  { font-size: 18px; font-weight: 700; margin-top: 8px; }
.grade-count-lbl { font-size: 10px; color: var(--text-muted); }

.grade-cell { font-weight: 700; }
.grade-A { color: var(--lime); }
.grade-B { color: var(--cyan); }
.grade-C { color: var(--orange); }
.grade-D { color: #FF6B6B; }
.grade-F { color: #FF4444; }

/* ============================================================
   TIMETABLE
   ============================================================ */
.timetable-wrap { overflow-x: auto; }

.timetable {
  display: grid;
  grid-template-columns: 80px repeat(5, 1fr);
  gap: 4px; min-width: 700px;
}

.tt-header {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px;
  text-align: center; font-size: 12px; font-weight: 700;
  color: var(--text-secondary);
}

.tt-time {
  background: rgba(255,255,255,0.02); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px;
  text-align: center; font-size: 11px; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
}

.tt-cell {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px; min-height: 70px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.tt-cell:hover { border-color: var(--border-bright); }

.tt-class {
  width: 100%; border-radius: 8px; padding: 8px 10px;
  cursor: pointer; transition: all var(--transition);
}
.tt-class:hover { filter: brightness(1.2); }
.tt-class-name { font-size: 12px; font-weight: 700; }
.tt-class-room { font-size: 10px; opacity: 0.7; margin-top: 2px; }

/* ============================================================
   SETTINGS
   ============================================================ */
.settings-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.settings-card {
  display: flex; flex-direction: column; gap: 10px;
  transition: all var(--transition);
}
.settings-card:hover { border-color: var(--border-bright); transform: translateY(-2px); }

.settings-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.settings-icon svg { width: 24px; height: 24px; }
.settings-icon.cyan   { background: var(--cyan-dim); color: var(--cyan); }
.settings-icon.violet { background: var(--violet-dim); color: #A78BFA; }
.settings-icon.lime   { background: var(--lime-dim); color: var(--lime); }
.settings-icon.orange { background: var(--orange-dim); color: var(--orange); }

.settings-card h3 { font-size: 15px; font-weight: 700; }
.settings-card p  { font-size: 13px; color: var(--text-secondary); flex: 1; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease; }

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

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg); width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.4,0,0.2,1);
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.modal-lg { max-width: 720px; }
.modal-sm { max-width: 400px; }

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

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

.modal-close {
  width: 32px; height: 32px; border-radius: 8px; border: none;
  background: var(--bg-card); color: var(--text-muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover { background: rgba(255,68,68,0.1); color: #FF6B6B; }
.modal-close svg { width: 16px; height: 16px; }

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

/* Forms */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px;
  color: var(--text-primary); font-size: 13px; font-family: inherit;
  outline: none; transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-dim);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group select option { background: var(--bg-surface); }

/* Toggle */
.toggle-group { display: flex; align-items: center; gap: 10px; }
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; border-radius: 24px;
  background: rgba(255,255,255,0.1); cursor: pointer;
  transition: background var(--transition);
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; border-radius: 50%;
  background: white; left: 3px; top: 3px;
  transition: transform var(--transition);
}
.toggle input:checked + .toggle-slider { background: var(--cyan); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ============================================================
   TOAST
   ============================================================ */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 300;
  display: flex; flex-direction: column; gap: 10px;
}

.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-radius: var(--radius);
  background: var(--bg-surface); border: 1px solid var(--border-bright);
  box-shadow: var(--shadow-card); min-width: 280px;
  animation: toastIn 0.3s cubic-bezier(0.4,0,0.2,1);
  font-size: 13px; font-weight: 500;
}
.toast.success { border-left: 3px solid var(--lime); }
.toast.error   { border-left: 3px solid #FF6B6B; }
.toast.info    { border-left: 3px solid var(--cyan); }

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

.toast-icon { font-size: 18px; }
.toast-msg  { flex: 1; }
.toast-close {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 16px; padding: 0 4px;
}

/* ============================================================
   STUDENT DETAIL MODAL
   ============================================================ */
.student-detail-header {
  display: flex; align-items: center; gap: 20px; margin-bottom: 24px;
  padding-bottom: 20px; border-bottom: 1px solid var(--border);
}
.detail-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800; flex-shrink: 0;
}
.detail-name { font-size: 20px; font-weight: 800; }
.detail-id   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.detail-badges { display: flex; gap: 8px; margin-top: 8px; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.detail-item label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.detail-item span  { display: block; font-size: 14px; font-weight: 600; margin-top: 3px; }

.detail-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.detail-stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; text-align: center;
}
.detail-stat-val { font-size: 24px; font-weight: 800; }
.detail-stat-lbl { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ============================================================
   UTILITY
   ============================================================ */
.hidden { display: none !important; }

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

@media (max-width: 900px) {
  .dashboard-row { grid-template-columns: 1fr; }
  .attendance-summary { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar {
    transform: translateX(-260px); width: 260px !important;
    transition: transform var(--transition-slow);
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; }
  .mobile-menu-btn { display: flex; }
  .search-bar { width: 180px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page { padding: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .grades-overview { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .search-bar { display: none; }
}

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