/* ============================================================
   SD Academy — Premium Design System & Micro-Animations
   ============================================================ */

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

/* ── Skip Link (Accessibility) ──────────────────────────────── */
.skip-link {
  position: absolute !important;
  top: -100px !important;
  left: 16px !important;
  background: #2563eb !important;
  color: #ffffff !important;
  padding: 10px 20px !important;
  border-radius: 0 0 8px 8px !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  z-index: 9999 !important;
  transition: top 0.2s ease !important;
}
.skip-link:focus {
  top: 0 !important;
}

/* ── Custom Properties & Advanced Tokens ───────────────────── */
:root {
  /* Brand Gradients & Colors */
  --navy-900: #141933;
  --navy-800: #1e2545;
  --navy-700: #2d3561;
  --navy-600: #3a4080;
  --navy-500: #4a5298;

  --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #8b5cf6 100%);
  --navy-gradient: linear-gradient(135deg, #1e2545 0%, #2d3561 50%, #3a4080 100%);
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.4);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);

  /* Accents */
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-400: #60a5fa;
  --blue-100: #dbeafe;
  --blue-50:  #eff6ff;

  /* Semantic */
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --info: #3b82f6;
  --info-light: #dbeafe;

  /* Neutrals */
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Backgrounds */
  --bg-page: #eef1f8;
  --bg-card: #ffffff;
  --bg-sidebar: var(--navy-700);

  /* Typography */
  --font-body: 'Inter', sans-serif;
  --font-display: 'Outfit', sans-serif;

  /* Spacing */
  --sidebar-width: 230px;
  --topbar-height: 64px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 14px rgba(45,53,97,.08), 0 2px 6px rgba(0,0,0,.04);
  --shadow-lg: 0 12px 36px rgba(45,53,97,.12), 0 4px 12px rgba(0,0,0,.06);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.35);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transitions & Timing */
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --duration: 250ms;
}

/* Brand Logo Image Styling */
.brand-logo-img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 50%;
  background: #ffffff;
  padding: 2px;
  box-shadow: 0 4px 12px rgba(20, 25, 51, 0.15);
  transition: transform 0.3s var(--ease-bounce);
  flex-shrink: 0;
}

.logo:hover .brand-logo-img,
.auth-logo:hover .brand-logo-img {
  transform: scale(1.1) rotate(4deg);
}


/* ── Reset & Core Styles ────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--gray-800);
  background: var(--bg-page);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
input, button, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }
h1,h2,h3,h4,h5,h6 { font-family: var(--font-display); font-weight: 700; line-height: 1.3; }

/* ── Layout Shell ───────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--navy-gradient);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.15);
  transition: transform var(--duration) var(--ease-smooth);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(0, 0, 0, 0.1);
}

.sidebar-brand .avatar {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  transition: transform 0.3s var(--ease-bounce);
}

.sidebar-brand:hover .avatar {
  transform: scale(1.08) rotate(3deg);
}

.sidebar-brand .brand-info .brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  letter-spacing: 0.3px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  color: rgba(255,255,255,.7);
  font-weight: 500;
  font-size: 13.5px;
  border-radius: var(--radius-sm);
  transition: all var(--duration) var(--ease-smooth);
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--blue-400);
  border-radius: 0 4px 4px 0;
  transform: scaleY(0);
  transition: transform var(--duration) var(--ease-bounce);
}

.nav-item:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
  transform: translateX(4px);
}

.nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.nav-item.active::before {
  transform: scaleY(1);
}

.nav-item .nav-icon {
  width: 20px; height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: transform 0.3s var(--ease-bounce);
}

.nav-item:hover .nav-icon {
  transform: scale(1.2);
}

/* ── Main Content Area ──────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--duration) var(--ease-smooth);
}

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  background: rgba(238, 241, 248, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.topbar-search {
  flex: 1;
  max-width: 400px;
  position: relative;
}

.topbar-search input {
  width: 100%;
  height: 40px;
  background: #ffffff;
  border: 1.5px solid var(--gray-200);
  border-radius: 30px;
  padding: 0 16px 0 42px;
  font-size: 13px;
  color: var(--gray-700);
  outline: none;
  transition: all var(--duration) var(--ease-smooth);
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.topbar-search input:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 4px rgba(59,130,246,0.15);
  background: #ffffff;
}

.topbar-search .search-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 15px;
  pointer-events: none;
  transition: color 0.2s;
}

.topbar-search input:focus + .search-icon {
  color: var(--blue-500);
}

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

.topbar-home-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--gray-600);
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(255,255,255,0.6);
  transition: all var(--duration) var(--ease-smooth);
}
.topbar-home-link:hover {
  color: var(--blue-600);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.topbar-bell {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #ffffff;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-600);
  font-size: 18px;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: all var(--duration) var(--ease-bounce);
  cursor: pointer;
}
.topbar-bell:hover {
  transform: scale(1.1) rotate(10deg);
  color: var(--blue-600);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}
.topbar-bell .badge {
  position: absolute;
  top: 4px; right: 4px;
  width: 9px; height: 9px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid #ffffff;
  animation: pulse-ring 2s infinite;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 10px 4px 4px;
  border-radius: 30px;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--gray-200);
  transition: all var(--duration) var(--ease-smooth);
}
.topbar-user:hover {
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  border-color: var(--blue-300);
}

.topbar-user .user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800);
}

.topbar-user .user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-500));
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 2px 6px rgba(45, 53, 97, 0.3);
}

/* ── Page Content ───────────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: 24px 32px 40px;
}

/* ── Glass & Standard Cards ─────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 24px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  transition: transform var(--duration) var(--ease-smooth), box-shadow var(--duration) var(--ease-smooth), border-color var(--duration);
  position: relative;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(148, 163, 184, 0.4);
}

.card-interactive:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), 0 0 15px rgba(59, 130, 246, 0.1);
  border-color: var(--blue-300);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-all-link {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--blue-600);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--duration) var(--ease-bounce);
}
.view-all-link:hover {
  color: var(--blue-500);
  transform: translateX(3px);
}

/* ── Dynamic Interactive Buttons ────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--duration) var(--ease-bounce);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 120%; height: 120%;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  transition: transform 0.5s, opacity 0.3s;
}

.btn:active::after {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  transition: 0s;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37,99,235,.3);
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(37,99,235,.45);
  transform: translateY(-2px);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-outline {
  background: transparent;
  color: var(--blue-600);
  border: 1.5px solid var(--blue-600);
}
.btn-outline:hover {
  background: var(--blue-50);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.btn-ghost {
  background: var(--gray-100);
  color: var(--gray-700);
}
.btn-ghost:hover {
  background: var(--gray-200);
  color: var(--gray-900);
  transform: translateY(-1px);
}

.btn-sm {
  height: 32px;
  padding: 0 14px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  height: 46px;
  padding: 0 30px;
  font-size: 15px;
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 30px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.2s var(--ease-bounce);
}

.badge:hover {
  transform: scale(1.05);
}

.badge-success   { background: var(--success-light);  color: #065f46; }
.badge-warning   { background: var(--warning-light);  color: #92400e; }
.badge-danger    { background: var(--danger-light);   color: #991b1b; }
.badge-info      { background: var(--info-light);     color: #1e40af; }
.badge-gray      { background: var(--gray-100);       color: var(--gray-600); }
.badge-purple    { background: #f3e8ff;               color: #6b21a8; }
.badge-navy      { background: rgba(45,53,97,.1);     color: var(--navy-700); }

/* ── Animated Progress Bar ──────────────────────────────────── */
.progress-bar-wrap {
  height: 8px;
  background: var(--gray-200);
  border-radius: 30px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 30px;
  background: var(--accent-gradient);
  transition: width 1s cubic-bezier(0.65, 0, 0.35, 1);
  position: relative;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
  animation: shimmer 2s infinite;
}

.progress-bar-fill.success { background: linear-gradient(135deg, #10b981, #059669); }
.progress-bar-fill.warning { background: linear-gradient(135deg, #f59e0b, #d97706); }
.progress-bar-fill.danger  { background: linear-gradient(135deg, #ef4444, #dc2626); }

/* ── Circular Progress ──────────────────────────────────────── */
.circular-progress {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.circular-progress svg { transform: rotate(-90deg); }

.circular-progress .cp-track  { fill: none; stroke: var(--gray-200); }
.circular-progress .cp-fill   {
  fill: none;
  stroke: url(#blue-gradient);
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.65, 0, 0.35, 1);
}
.circular-progress .cp-label  {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--gray-900);
}

/* ── Divider & Utilities ────────────────────────────────────── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gray-200), transparent);
  margin: 18px 0;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.text-sm  { font-size: 12px; }
.text-xs  { font-size: 11px; }
.text-muted { color: var(--gray-500); }
.text-bold { font-weight: 700; }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.w-full { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ── Keyframe Animations ────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.animate-fade-up  { animation: fadeInUp 0.5s var(--ease-smooth) both; }
.animate-fade-in  { animation: fadeIn 0.4s var(--ease-smooth) both; }
.animate-scale-up { animation: scaleUp 0.4s var(--ease-bounce) both; }
.animate-float    { animation: floatSlow 4s ease-in-out infinite; }

/* Stagger Animations */
.stagger > *:nth-child(1) { animation-delay: .05s; }
.stagger > *:nth-child(2) { animation-delay: .10s; }
.stagger > *:nth-child(3) { animation-delay: .15s; }
.stagger > *:nth-child(4) { animation-delay: .20s; }
.stagger > *:nth-child(5) { animation-delay: .25s; }
.stagger > *:nth-child(6) { animation-delay: .30s; }

/* ── Modal Overlay ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity var(--duration) var(--ease-smooth);
}

.modal-overlay.open {
  opacity: 1; pointer-events: all;
}

.modal {
  background: #ffffff;
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%; max-width: 480px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  transform: scale(.9) translateY(20px);
  transition: transform 0.35s var(--ease-bounce);
  border: 1px solid rgba(255,255,255,0.8);
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

/* ── Notification Toast Container ──────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 14px 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border-left: 4px solid var(--blue-500);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gray-800);
  animation: toastIn 0.4s var(--ease-bounce) forwards;
  transition: all 0.3s;
}

.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
.toast.info    { border-left-color: var(--info); }

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

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

/* ── Nav SVG Icons ──────────────────────────────────────────── */
.nav-icon-svg {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-icon-svg svg {
  width: 18px; height: 18px;
  stroke: currentColor;
  fill: none;
}

/* ── Sidebar brand row ──────────────────────────────────────── */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  color: #ffffff;
  letter-spacing: 0.3px;
}

.brand-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  margin-top: 2px;
}

/* ── Sidebar footer row ─────────────────────────────────────── */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* ── Toast label (replaces emoji) ───────────────────────────── */
.toast-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.75;
  flex-shrink: 0;
}

