/* ===================================================================
   YCHST Sanga Portal — Premium Design System v2
   Glassmorphism · Micro-animations · College Colors: Blue/White/Red
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;0,14..32,800;1,14..32,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Root Design Tokens ─────────────────────────────────────────── */
:root {
  /* Primary — Light Blue */
  --color-primary:        #0277BD;
  --color-primary-light:  #0288D1;
  --color-primary-hover:  #01579B;
  --color-primary-pale:   #E1F5FE;

  /* Accent — Red */
  --color-accent:         #C62828;
  --color-accent-light:   #EF5350;
  --color-accent-pale:    #FFEBEE;

  /* Semantic */
  --color-secondary:      #0288D1;
  --color-secondary-hover:#0277BD;
  --color-danger:         #C62828;
  --color-warning:        #F59E0B;
  --color-success:        #2E7D32;
  --color-info:           #0277BD;

  /* Backgrounds */
  --bg-page:    #EEF6FF;
  --bg-card:    #FFFFFF;
  --bg-sidebar: #012a56;
  --bg-navbar:  rgba(255,255,255,0.92);

  /* Text */
  --text-primary:    #0D1B2A;
  --text-secondary:  #455A64;
  --text-muted:      #90A4AE;
  --text-on-primary: #FFFFFF;

  /* Borders */
  --border-color: #C5DCF8;
  --border-hover: #90CAF9;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  /* Shadows */
  --shadow-sm:  0 1px 3px 0 rgb(2 119 189 / 0.08), 0 1px 2px -1px rgb(2 119 189 / 0.06);
  --shadow-md:  0 4px 12px -2px rgb(2 119 189 / 0.12), 0 2px 6px -2px rgb(2 119 189 / 0.08);
  --shadow-lg:  0 10px 24px -4px rgb(2 119 189 / 0.14), 0 4px 8px -4px rgb(2 119 189 / 0.08);
  --shadow-xl:  0 20px 40px -8px rgb(2 119 189 / 0.18), 0 8px 16px -6px rgb(2 119 189 / 0.12);
  --shadow-glow: 0 0 20px rgba(2, 136, 209, 0.25);

  --sidebar-width:     260px;
  --sidebar-collapsed: 72px;
  --navbar-height:     64px;
  --transition:        220ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode tokens */
[data-theme="dark"] {
  --bg-page:     #071626;
  --bg-card:     #0C1F35;
  --bg-sidebar:  #040F1E;
  --bg-navbar:   rgba(12, 31, 53, 0.95);
  --text-primary:   #E3F2FD;
  --text-secondary: #90CAF9;
  --text-muted:     #4E7A9B;
  --border-color:   #1A3A5C;
  --border-hover:   #1976D2;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--transition), color var(--transition);
}

/* ── Entrance Animations ────────────────────────────────────────── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(100%); }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(2, 136, 209, 0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(2, 136, 209, 0); }
}
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-6px); }
}
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── Staggered card animations ──────────────────────────────────── */
.stat-card:nth-child(1) { animation: fadeSlideUp 0.5s ease both; animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation: fadeSlideUp 0.5s ease both; animation-delay: 0.10s; }
.stat-card:nth-child(3) { animation: fadeSlideUp 0.5s ease both; animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation: fadeSlideUp 0.5s ease both; animation-delay: 0.20s; }
.stat-card:nth-child(5) { animation: fadeSlideUp 0.5s ease both; animation-delay: 0.25s; }
.stat-card:nth-child(6) { animation: fadeSlideUp 0.5s ease both; animation-delay: 0.30s; }

.card { animation: fadeSlideUp 0.45s ease both; }

/* ── Sidebar ────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 40;
  transition: width var(--transition);
  overflow: hidden;
  box-shadow: 4px 0 30px rgba(1, 42, 86, 0.35);
}

.sidebar.collapsed { width: var(--sidebar-collapsed); }

.sidebar-logo {
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  gap: 12px;
  flex-shrink: 0;
}

.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: var(--color-secondary);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 18px;
}

.sidebar-logo-text {
  font-size: 15px; font-weight: 700;
  color: #fff; white-space: nowrap;
  opacity: 1; transition: opacity var(--transition);
  letter-spacing: -0.2px;
}

.sidebar.collapsed .sidebar-logo-text { opacity: 0; pointer-events: none; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 8px 40px; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }

.sidebar-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  color: rgba(255,255,255,0.28); text-transform: uppercase;
  padding: 14px 12px 5px; white-space: nowrap;
  transition: opacity var(--transition);
}
.sidebar.collapsed .sidebar-section-label { opacity: 0; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.60); text-decoration: none;
  font-size: 13.5px; font-weight: 500;
  transition: background var(--transition), color var(--transition), transform var(--transition);
  white-space: nowrap; margin-bottom: 2px; position: relative;
  border: 1px solid transparent;
}
.nav-item:hover {
  background: rgba(255,255,255,0.09);
  color: #fff; transform: translateX(2px);
}
.nav-item.active {
  background: linear-gradient(90deg, rgba(2,136,209,0.28) 0%, rgba(2,136,209,0.08) 100%);
  color: #fff;
  border-left: 3px solid #4FC3F7;
  border-color: transparent;
  border-left-color: #4FC3F7;
  box-shadow: 0 2px 12px rgba(79, 195, 247, 0.15);
}
.nav-item .nav-icon {
  width: 20px; height: 20px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.nav-item .nav-label { opacity: 1; transition: opacity var(--transition); }
.sidebar.collapsed .nav-label { opacity: 0; pointer-events: none; }

/* Tooltip for collapsed sidebar */
.nav-item .nav-tooltip {
  display: none; position: absolute;
  left: calc(var(--sidebar-collapsed) + 8px);
  background: #1E293B; color: #fff;
  padding: 6px 14px; border-radius: var(--radius-sm);
  font-size: 13px; white-space: nowrap;
  z-index: 100; pointer-events: none; box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,0.08);
}
.sidebar.collapsed .nav-item:hover .nav-tooltip { display: block; }

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

/* ── Navbar ─────────────────────────────────────────────────────── */
.navbar {
  position: fixed; top: 0;
  left: var(--sidebar-width); right: 0;
  height: var(--navbar-height);
  background: var(--bg-navbar);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; z-index: 30;
  transition: left var(--transition), background var(--transition);
  box-shadow: 0 1px 0 rgba(2,119,189,0.06), 0 4px 16px rgba(2,119,189,0.04);
}
.sidebar.collapsed ~ .main-wrap .navbar { left: var(--sidebar-collapsed); }

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

.hamburger-btn {
  width: 36px; height: 36px; border: none;
  background: transparent; border-radius: var(--radius-sm);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); transition: background var(--transition), color var(--transition);
}
.hamburger-btn:hover { background: var(--color-primary-pale); color: var(--color-primary); }

.page-title {
  font-size: 15px; font-weight: 700;
  color: var(--text-primary); letter-spacing: -0.2px;
}

/* Notification Bell */
.notif-btn {
  position: relative; width: 36px; height: 36px; border: none;
  background: transparent; border-radius: var(--radius-sm);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); transition: background var(--transition), color var(--transition);
}
.notif-btn:hover { background: var(--color-primary-pale); color: var(--color-primary); }

.notif-badge {
  position: absolute; top: 4px; right: 4px;
  min-width: 18px; height: 18px;
  background: var(--color-danger); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  line-height: 1; padding: 0 3px;
  animation: pulseGlow 2s infinite;
}

/* Role Badge */
.role-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 999px;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.role-badge.blue    { background: #DBEAFE; color: #1D4ED8; }
.role-badge.teal    { background: #CCFBF1; color: #0F766E; }
.role-badge.indigo  { background: #EDE9FE; color: #6D28D9; }
.role-badge.red     { background: #FEE2E2; color: #B91C1C; }
.role-badge.amber   { background: #FEF3C7; color: #B45309; }
.role-badge.emerald { background: #D1FAE5; color: #065F46; }
.role-badge.violet  { background: #F5F3FF; color: #7C3AED; }
.role-badge.gray    { background: #F1F5F9; color: #334155; }
.role-badge.black   { background: #1E293B; color: #F1F5F9; }

/* Profile Avatar */
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 700;
  cursor: pointer; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(2, 119, 189, 0.35);
  border: 2px solid rgba(255,255,255,0.8);
}

/* Profile Dropdown */
.profile-dropdown { position: relative; }

.dropdown-menu {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 230px; background: var(--bg-card);
  border: 1px solid var(--border-color); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl); padding: 8px; z-index: 100;
  display: none; animation: dropIn 180ms ease;
}
.dropdown-menu.open { display: block; }

.dropdown-header {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border-color); margin-bottom: 6px;
}
.dropdown-name  { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.dropdown-email { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.dropdown-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: var(--radius-sm); font-size: 13px; color: var(--text-secondary);
  text-decoration: none; transition: background var(--transition), color var(--transition);
  cursor: pointer; border: none; background: none; width: 100%; text-align: left;
}
.dropdown-item:hover { background: var(--color-primary-pale); color: var(--color-primary); }
.dropdown-item.danger { color: var(--color-danger); }
.dropdown-item.danger:hover { background: #FEE2E2; }
.dropdown-divider { border: none; border-top: 1px solid var(--border-color); margin: 6px 0; }

/* ── Main Content ───────────────────────────────────────────────── */
.main-wrap {
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition);
  min-height: 100vh; display: flex; flex-direction: column;
}
.sidebar.collapsed ~ .main-wrap { margin-left: var(--sidebar-collapsed); }

.main-content {
  padding: 24px;
  padding-top: calc(var(--navbar-height) + 24px);
  flex: 1; max-width: 1440px; width: 100%;
}

/* ── Cards ──────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
  overflow: hidden;
}
.card:hover { box-shadow: var(--shadow-md); }

.card-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(180deg, rgba(2,119,189,0.025) 0%, transparent 100%);
}
.card-title { font-size: 15px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.2px; }
.card-body { padding: 20px; }
.card-footer { padding: 14px 22px; border-top: 1px solid var(--border-color); }

/* ── Stat Cards ─────────────────────────────────────────────────── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px; display: flex; align-items: flex-start; gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  opacity: 0; transition: opacity var(--transition);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--border-hover); }
.stat-card:hover::before { opacity: 1; }

.stat-icon {
  width: 52px; height: 52px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
  transition: transform var(--transition);
}
.stat-card:hover .stat-icon { transform: scale(1.08); }

.stat-icon.blue    { background: rgba(2,119,189,0.10);   color: var(--color-primary);    border: 1px solid rgba(2,119,189,0.18); }
.stat-icon.teal    { background: rgba(13,148,136,0.10);  color: #0D9488;                 border: 1px solid rgba(13,148,136,0.18); }
.stat-icon.amber   { background: rgba(217,119,6,0.10);   color: #D97706;                 border: 1px solid rgba(217,119,6,0.18); }
.stat-icon.red     { background: rgba(198,40,40,0.10);   color: var(--color-danger);     border: 1px solid rgba(198,40,40,0.18); }
.stat-icon.green   { background: rgba(21,128,61,0.10);   color: #15803D;                 border: 1px solid rgba(21,128,61,0.18); }
.stat-icon.violet  { background: rgba(124,58,237,0.10);  color: #7C3AED;                 border: 1px solid rgba(124,58,237,0.18); }
.stat-icon.purple  { background: rgba(124,58,237,0.10);  color: #7C3AED;                 border: 1px solid rgba(124,58,237,0.18); }

.stat-info { flex: 1; min-width: 0; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.stat-value { font-size: 26px; font-weight: 800; color: var(--text-primary); line-height: 1.2; margin-top: 4px; letter-spacing: -0.5px; }
.stat-trend {
  font-size: 12px; font-weight: 500; margin-top: 6px;
  display: flex; align-items: center; gap: 4px;
  color: var(--text-muted);
}
.stat-trend.up { color: var(--color-success); }
.stat-trend.down { color: var(--color-danger); }

/* ── Skeleton shimmer loader ────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--border-color) 25%, rgba(255,255,255,0.6) 50%, var(--border-color) 75%);
  background-size: 400px 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition); text-decoration: none;
  white-space: nowrap; line-height: 1.4; letter-spacing: 0.01em;
  position: relative; overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.15);
  opacity: 0; transition: opacity var(--transition);
}
.btn:hover::after { opacity: 1; }
.btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: #fff; border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(2,119,189,0.30);
}
.btn-primary:hover { box-shadow: 0 4px 16px rgba(2,119,189,0.40); transform: translateY(-1px); }

.btn-secondary {
  background: linear-gradient(135deg, var(--color-secondary) 0%, #0296e0 100%);
  color: #fff; border-color: var(--color-secondary);
  box-shadow: 0 2px 8px rgba(2,136,209,0.25);
}
.btn-secondary:hover { box-shadow: 0 4px 16px rgba(2,136,209,0.35); transform: translateY(-1px); }

.btn-outline {
  background: transparent; color: var(--text-primary); border-color: var(--border-color);
}
.btn-outline:hover { background: var(--color-primary-pale); border-color: var(--color-primary-light); color: var(--color-primary); }

.btn-danger {
  background: linear-gradient(135deg, #C62828 0%, #EF5350 100%);
  color: #fff; border-color: var(--color-danger);
  box-shadow: 0 2px 8px rgba(198,40,40,0.25);
}
.btn-danger:hover { box-shadow: 0 4px 16px rgba(198,40,40,0.35); transform: translateY(-1px); }

.btn-success {
  background: linear-gradient(135deg, #2E7D32 0%, #43A047 100%);
  color: #fff; border-color: #2E7D32;
  box-shadow: 0 2px 8px rgba(46,125,50,0.25);
}
.btn-success:hover { box-shadow: 0 4px 16px rgba(46,125,50,0.35); transform: translateY(-1px); }

.btn-ghost { background: transparent; color: var(--text-secondary); border-color: transparent; }
.btn-ghost:hover { background: var(--color-primary-pale); color: var(--color-primary); }

.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.btn-lg { padding: 13px 26px; font-size: 15px; }
.btn-icon { padding: 8px; }

/* ── Form Elements ──────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-primary); margin-bottom: 6px; letter-spacing: 0.01em;
}
.form-label .required { color: var(--color-danger); margin-left: 2px; }

.form-control {
  display: block; width: 100%; padding: 10px 14px;
  font-size: 14px; font-family: inherit; color: var(--text-primary);
  background: var(--bg-card); border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  outline: none;
}
.form-control:hover { border-color: var(--border-hover); }
.form-control:focus {
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(2,136,209,0.12);
  background: var(--bg-card);
}
.form-control.error { border-color: var(--color-danger); box-shadow: 0 0 0 3px rgba(198,40,40,0.1); }
.form-hint  { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.form-error { font-size: 12px; color: var(--color-danger); margin-top: 5px; font-weight: 500; }

/* ── Tables ─────────────────────────────────────────────────────── */
.table-container {
  overflow-x: auto; border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  -webkit-overflow-scrolling: touch;
}

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

thead th {
  background: linear-gradient(180deg, #E8F4FD 0%, #D6EDFB 100%);
  padding: 11px 14px; text-align: left; font-size: 11px; font-weight: 700;
  color: #01579B; text-transform: uppercase; letter-spacing: 0.07em;
  border-bottom: 2px solid var(--border-color); white-space: nowrap;
}
[data-theme="dark"] thead th { background: #132640; color: #7EC8E3; }

tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:nth-child(even) { background: rgba(2,119,189,0.018); }
tbody tr:hover { background: rgba(2,119,189,0.055); }

tbody td { padding: 12px 14px; color: var(--text-primary); vertical-align: middle; }

/* ── Status Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.03em;
}
.badge-success  { background: #D1FAE5; color: #065F46; }
.badge-danger   { background: #FEE2E2; color: #991B1B; }
.badge-warning  { background: #FEF3C7; color: #92400E; }
.badge-info     { background: #DBEAFE; color: #1E40AF; }
.badge-neutral  { background: #F1F5F9; color: #475569; }
.badge-violet   { background: #F5F3FF; color: #6D28D9; }
.badge-primary  { background: var(--color-primary-pale); color: var(--color-primary-hover); }

/* ── Alerts / Message Banners ───────────────────────────────────── */
.alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius-md);
  font-size: 14px; margin-bottom: 16px; line-height: 1.5;
}
.alert-success { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }
.alert-error   { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.alert-warning { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.alert-info    { background: #DBEAFE; color: #1E40AF; border: 1px solid #BFDBFE; }

/* ── Toast Notifications ────────────────────────────────────────── */
.toast-container {
  position: fixed; top: 80px; right: 24px;
  z-index: 9999; display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  padding: 14px 18px; min-width: 300px; max-width: 420px;
  display: flex; align-items: flex-start; gap: 12px;
  pointer-events: all; animation: slideIn 280ms ease;
  backdrop-filter: blur(8px);
}
.toast.removing { animation: slideOut 260ms ease forwards; }

.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-body { flex: 1; }
.toast-title   { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.toast-message { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* ── Quick Actions ──────────────────────────────────────────────── */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 12px; margin-bottom: 24px;
}

.quick-action-btn {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 24px 16px; background: var(--bg-card);
  border: 1px solid var(--border-color); border-radius: var(--radius-lg);
  text-decoration: none; color: var(--text-primary);
  transition: all var(--transition); cursor: pointer;
  text-align: center; position: relative; overflow: hidden;
}
.quick-action-btn::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
  transform: translateY(-100%); transition: transform var(--transition);
}
.quick-action-btn:hover {
  border-color: var(--color-primary-light);
  transform: translateY(-5px); box-shadow: var(--shadow-lg);
  color: var(--color-primary);
}
.quick-action-btn:hover::before { transform: translateY(0); }
.quick-action-icon {
  font-size: 28px; width: 58px; height: 58px; border-radius: 50%;
  background: rgba(2,119,189,0.07);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); color: var(--color-primary);
}
.quick-action-btn:hover .quick-action-icon {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: #fff; transform: scale(1.12); box-shadow: var(--shadow-glow);
}
.quick-action-label { font-size: 12.5px; font-weight: 700; line-height: 1.3; }

/* ── Welcome Banner ─────────────────────────────────────────────── */
.welcome-banner {
  background: linear-gradient(135deg, #012a56 0%, #0277BD 50%, #0288D1 100%);
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
  border-radius: var(--radius-xl); padding: 28px 32px;
  color: #fff; margin-bottom: 28px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; position: relative; overflow: hidden;
  border-bottom: 4px solid #C62828;
  box-shadow: 0 8px 32px rgba(1,42,86,0.25);
}
.welcome-banner::after {
  content: '';
  position: absolute; width: 320px; height: 320px; border-radius: 50%;
  background: rgba(255,255,255,0.05);
  right: -60px; top: -100px; pointer-events: none;
}
.welcome-banner::before {
  content: '';
  position: absolute; width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,255,255,0.04);
  left: -40px; bottom: -80px; pointer-events: none;
}
.welcome-title   { font-size: 22px; font-weight: 800; margin-bottom: 6px; letter-spacing: -0.3px; }
.welcome-subtitle { font-size: 14px; opacity: 0.82; font-weight: 400; }

/* ── Auth Layout ────────────────────────────────────────────────── */
.auth-layout {
  display: flex; min-height: 100vh; background: var(--bg-page);
}

.auth-hero {
  flex: 1; display: flex; flex-direction: column;
  justify-content: center; padding: 60px;
  position: relative; overflow: hidden; color: white;
}
.auth-hero-logo {
  display: flex; align-items: center; gap: 14px; margin-bottom: 48px;
}
.auth-hero-logo-icon {
  width: 52px; height: 52px; background: rgba(255,255,255,0.15);
  border-radius: var(--radius-md); display: flex;
  align-items: center; justify-content: center; font-size: 26px;
  border: 1px solid rgba(255,255,255,0.2); backdrop-filter: blur(8px);
}
.auth-hero-logo-text { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.auth-hero h1 { font-size: 42px; font-weight: 800; line-height: 1.15; margin-bottom: 16px; letter-spacing: -1px; }
.auth-hero p  { font-size: 16px; opacity: 0.78; line-height: 1.7; max-width: 420px; }
.auth-features { margin-top: 44px; display: flex; flex-direction: column; gap: 16px; }
.auth-feature {
  display: flex; align-items: center; gap: 14px;
  font-size: 15px; opacity: 0.9; font-weight: 500;
}
.auth-feature-icon {
  width: 38px; height: 38px; background: rgba(255,255,255,0.12);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0; border: 1px solid rgba(255,255,255,0.15);
}

.auth-panel {
  width: 100%; max-width: 500px; background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  padding: 52px 48px; overflow-y: auto;
  border-left: 1px solid var(--border-color);
  box-shadow: -8px 0 40px rgba(1,42,86,0.12);
}

.auth-form-title    { font-size: 26px; font-weight: 800; color: var(--text-primary); margin-bottom: 6px; letter-spacing: -0.5px; }
.auth-form-subtitle { font-size: 14px; color: var(--text-muted); margin-bottom: 32px; }

/* Input with icon */
.input-group { position: relative; }
.input-group .input-icon {
  position: absolute; left: 13px; top: 50%;
  transform: translateY(-50%); color: var(--text-muted);
  font-size: 16px; pointer-events: none;
  transition: color var(--transition);
}
.input-group:focus-within .input-icon { color: var(--color-primary); }
.input-group .form-control { padding-left: 42px; }

.password-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  padding: 0; display: flex; align-items: center; justify-content: center;
  transition: color var(--transition);
}
.password-toggle:hover { color: var(--color-primary); }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .auth-layout { flex-direction: column; }
  .auth-hero { padding: 40px; min-height: auto; }
  .auth-panel { max-width: 100%; border-left: none; border-top: 1px solid var(--border-color); }
  .grid-cols-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh;
    width: var(--sidebar-width) !important;
    transform: translateX(-100%);
    transition: transform 280ms cubic-bezier(0.4,0,0.2,1);
    z-index: 50; will-change: transform;
    box-shadow: 4px 0 30px rgba(1,51,104,0.4);
  }
  .sidebar.mobile-open { transform: translateX(0); }
  #sidebar-close-btn { display: flex !important; }
  .sidebar.collapsed { width: var(--sidebar-width) !important; }
  .sidebar.collapsed .sidebar-logo-text,
  .sidebar.collapsed .nav-label,
  .sidebar.collapsed .sidebar-section-label { opacity: 1; pointer-events: auto; }
  .sidebar.collapsed .nav-tooltip { display: none !important; }

  .sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(1,42,86,0.6); backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px); z-index: 45;
    display: none; opacity: 0; transition: opacity 280ms ease;
  }
  .sidebar-overlay.active { display: block; opacity: 1; }

  .navbar { left: 0 !important; right: 0; }
  .main-wrap { margin-left: 0 !important; }
  .main-content { padding: 14px; padding-top: calc(var(--navbar-height) + 14px); }
  .hamburger-btn { display: flex; }
  .stat-card { padding: 16px; }
  .stat-value { font-size: 22px; }
  .welcome-banner { flex-direction: column; align-items: flex-start; gap: 14px; padding: 22px; }
  .welcome-title { font-size: 18px; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-2, .grid-cols-3 { grid-template-columns: 1fr; }
  .grid-stats { grid-template-columns: repeat(2, 1fr); }
  .auth-hero { display: none; }
  .auth-panel { padding: 32px 24px; max-width: 100%; }
  .page-title {
    font-size: 14px; max-width: 160px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 480px) {
  .grid-stats { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .notif-dropdown { width: 94vw; right: -8px; }
  .dropdown-menu { width: 200px; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .sidebar { width: var(--sidebar-collapsed); }
  .sidebar .sidebar-logo-text,
  .sidebar .nav-label,
  .sidebar .sidebar-section-label { opacity: 0; pointer-events: none; }
  .sidebar .nav-item:hover .nav-tooltip { display: block; }
  .sidebar.mobile-open { width: var(--sidebar-width); }
  .sidebar.mobile-open .sidebar-logo-text,
  .sidebar.mobile-open .nav-label,
  .sidebar.mobile-open .sidebar-section-label { opacity: 1; pointer-events: auto; }
  .main-wrap { margin-left: var(--sidebar-collapsed); }
  .navbar { left: var(--sidebar-collapsed); }
}

/* ── Utilities ──────────────────────────────────────────────────── */
.text-primary   { color: var(--color-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-success   { color: var(--color-success) !important; }
.text-danger    { color: var(--color-danger) !important; }
.text-warning   { color: var(--color-warning) !important; }
.font-mono      { font-family: 'JetBrains Mono', monospace; }

.grid-stats  { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 16px; margin-bottom: 24px; }
.grid-cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-cols-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

.responsive-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); gap: 20px; }
@media (max-width: 640px) { .responsive-grid { grid-template-columns: 1fr; gap: 16px; } }

@media (max-width: 900px) {
  .grid-cols-2, .grid-cols-3 { grid-template-columns: 1fr; }
  .grid-stats { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 480px) { .grid-stats { grid-template-columns: 1fr; } }

.mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }
.mb-8  { margin-bottom: 32px; }
.mt-4  { margin-top: 16px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.flex  { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-gap     { display: flex; align-items: center; gap: 12px; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-end  { justify-content: flex-end; }
.font-medium  { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold    { font-weight: 700; }
.text-xs      { font-size: 12px; }
.text-sm      { font-size: 13px; }
.text-center  { text-align: center; }
.w-full       { width: 100%; }
.small        { font-size: 12px; }
.p-6          { padding: 24px; }
.hidden       { display: none !important; }

.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.6s linear infinite; display: inline-block;
}

/* ── Empty State ────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 52px 24px; color: var(--text-muted); }
.empty-state-icon  { font-size: 52px; margin-bottom: 14px; opacity: 0.5; }
.empty-state-title { font-size: 16px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state-desc  { font-size: 14px; }

/* ── Notification Dropdown ──────────────────────────────────────── */
.notif-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 340px; background: var(--bg-card);
  border: 1px solid var(--border-color); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl); z-index: 100; display: none;
  animation: dropIn 180ms ease;
  backdrop-filter: blur(12px);
}
.notif-dropdown.open { display: block; }

.notif-dropdown-header {
  padding: 14px 18px 10px; border-bottom: 1px solid var(--border-color);
  display: flex; justify-content: space-between; align-items: center;
}
.notif-dropdown-title { font-size: 14px; font-weight: 700; }
.notif-item {
  display: flex; gap: 12px; padding: 12px 18px;
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition); cursor: pointer;
  text-decoration: none; color: var(--text-primary);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--color-primary-pale); }
.notif-item.unread { background: rgba(2,119,189,0.04); }
.notif-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-primary-light); flex-shrink: 0; margin-top: 5px;
}
.notif-text { font-size: 13px; line-height: 1.5; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.notif-footer { padding: 10px 18px; text-align: center; border-top: 1px solid var(--border-color); }
.notif-footer a { font-size: 13px; color: var(--color-primary-light); text-decoration: none; font-weight: 600; }

/* ── Grade Colors ───────────────────────────────────────────────── */
.grade-a { color: #065F46; font-weight: 700; }
.grade-b { color: #1D4ED8; font-weight: 700; }
.grade-c { color: #92400E; font-weight: 700; }
.grade-d { color: #B45309; font-weight: 700; }
.grade-f { color: #991B1B; font-weight: 700; }

/* ── Progress Bar ───────────────────────────────────────────────── */
.progress-track {
  width: 100%; height: 8px; background: var(--border-color);
  border-radius: 999px; overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  transition: width 800ms ease;
}

/* ── Step Tracker ───────────────────────────────────────────────── */
.step-tracker {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 40px; background: var(--bg-card);
  padding: 24px; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border-color);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.step-item { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 70px; flex-shrink: 0; }
.step-number {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-page); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; transition: all 0.3s ease;
  border: 2px solid var(--border-color);
}
.step-item.active .step-number {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: white; border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(2,119,189,0.18);
}
.step-item.completed .step-number {
  background: linear-gradient(135deg, #2E7D32 0%, #43A047 100%);
  color: white; border-color: #2E7D32;
}
.step-label { font-size: 11px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.step-item.active .step-label { color: var(--color-primary); }
.step-divider { flex: 1; height: 2px; background: var(--border-color); margin: 0 12px; transform: translateY(-10px); min-width: 20px; }
@media (max-width: 640px) {
  .step-tracker { padding: 16px; margin-bottom: 24px; }
  .step-label { display: none; }
  .step-item { min-width: 40px; }
  .step-divider { margin: 0 8px; }
}

/* ── OTP Input ──────────────────────────────────────────────────── */
.otp-inputs { display: flex; gap: 10px; justify-content: center; margin: 20px 0; }
.otp-digit {
  width: 52px; height: 60px; border: 2px solid var(--border-color);
  border-radius: var(--radius-md); font-size: 24px;
  font-family: 'JetBrains Mono', monospace; font-weight: 600;
  text-align: center; color: var(--text-primary); background: var(--bg-card);
  transition: border-color var(--transition), box-shadow var(--transition); outline: none;
}
.otp-digit:focus { border-color: var(--color-primary-light); box-shadow: 0 0 0 3px rgba(2,136,209,0.14); }

/* ── Scrollbar ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-page); }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Report Watermarks ──────────────────────────────────────────── */
.report-watermark-container {
  position: relative; z-index: 1; min-height: 60vh;
}
.report-watermark-container::before {
  content: ""; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 80%; max-width: 500px; height: 80%; max-height: 500px;
  background-image: url("../img/logo.png");
  background-repeat: no-repeat; background-position: center; background-size: contain;
  opacity: 0.08; z-index: -1; pointer-events: none;
}

/* ── Payment Status Badge ───────────────────────────────────────── */
.payment-status-completed { background: #D1FAE5; color: #065F46; border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 700; }
.payment-status-pending   { background: #FEF3C7; color: #92400E; border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 700; }
.payment-status-failed    { background: #FEE2E2; color: #991B1B; border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 700; }

/* ── Print Styles ───────────────────────────────────────────────── */
@media print {
  @page { margin: 1cm; size: A4; }

  body { background: #fff !important; color: #000 !important; padding: 0 !important; margin: 0 !important; font-size: 11pt; }
  .sidebar, .navbar, .sidebar-overlay, .hamburger-btn, .notif-btn, .profile-dropdown,
  .sidebar-footer, .dropdown-menu, .toast-container, .no-print, #sidebar-toggle-btn,
  #theme-toggle-btn, .btn:not(.print-visible), .footer, .custom-sidebar,
  .custom-topbar, .mobile-toggle { display: none !important; }

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

  .card { border: 1px solid #eee !important; box-shadow: none !important; break-inside: avoid; animation: none !important; }
  .card-header, .card-footer { background: #fafafa !important; border-color: #eee !important; }
  .stat-card { animation: none !important; }

  table { width: 100% !important; border-collapse: collapse !important; }
  thead th { background-color: #f0f0f0 !important; color: #000 !important; border: 1px solid #ddd !important; }
  tbody td { border: 1px solid #ddd !important; }
  .receipt-container, .course-form, .report-container { width: 100% !important; padding: 0 !important; }
  .report-watermark-container::before { opacity: 0.1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .badge { border: 1px solid #ccc !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { text-decoration: none !important; color: #000 !important; }
  a::after { content: none !important; }
}
