/* ========================================
   Crew Portal - Modern Design System
   ======================================== */

:root {
  /* Brand Palette */
  --brand: #2E0F59;
  --brand-dark: #19063A;
  --accent: #7C3AED;
  --accent-light: #C084FC;
  --accent-dark: #5B21B6;
  --accent-gradient: linear-gradient(135deg, #3B0764 0%, #7C3AED 50%, #C084FC 100%);

  /* Backgrounds & Surfaces */
  --bg: #F5F3FF;
  --bg-soft: #ECE4FF;
  --main-bg: var(--bg-soft);
  --main-bg-solid: var(--bg);
  --surface: #FFFFFF;
  --surface-soft: rgba(255, 255, 255, 0.9);
  --card-bg: var(--surface);
  --card-border: rgba(124, 58, 237, 0.16);
  --glass-bg: rgba(255, 255, 255, 0.82);
  --glass-border: rgba(124, 58, 237, 0.18);

  /* Sidebar */
  --sidebar-bg: linear-gradient(180deg, #22084b 0%, #3b0f68 55%, #6025a4 100%);
  --sidebar-bg-solid: #22084b;
  --sidebar-text: #F4F0FF;
  --sidebar-hover: rgba(192, 132, 252, 0.18);
  --sidebar-active: rgba(124, 58, 237, 0.28);

  /* Typography */
  --text-primary: #1E1033;
  --text-secondary: #433360;
  --text-muted: #7D6C99;

  /* Status Colors */
  --success: #22C55E;
  --success-light: #4ADE80;
  --danger: #F87171;
  --danger-light: #FCA5A5;
  --warning: #FACC15;
  --warning-light: #FDE047;
  --info: var(--accent);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(24, 6, 58, 0.08);
  --shadow-sm: 0 2px 6px rgba(24, 6, 58, 0.1);
  --shadow-md: 0 8px 16px rgba(24, 6, 58, 0.16);
  --shadow-lg: 0 12px 28px rgba(24, 6, 58, 0.18);
  --shadow-xl: 0 20px 36px rgba(24, 6, 58, 0.2);
  --shadow-2xl: 0 32px 52px rgba(24, 6, 58, 0.24);
  --shadow-glow: 0 12px 32px rgba(124, 58, 237, 0.38);

  /* Border Radius */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;
  --radius-pill: 20px;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Typography */
  --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-title: "Poppins", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", monospace;
}

.material-symbols-rounded {
  font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

.hidden {
  display: none !important;
}

body.admin-loading .admin-main {
  opacity: 0.6;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.admin-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ========================================
   Modern Sidebar
   ======================================== */
.admin-sidebar {
  width: 280px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-xl);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.sidebar-header {
  padding: 2rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

.sidebar-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 1.5rem;
  right: 1.5rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.logo-img {
  width: clamp(120px, 24vw, 180px);
  height: auto;
  display: block;
}

.subtitle {
  font-size: 0.8125rem;
  opacity: 0.6;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  margin: 0.25rem 0;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  transition: all var(--transition-base);
  cursor: pointer;
  border-radius: var(--radius-md);
  position: relative;
  font-weight: 500;
  font-size: 0.9375rem;
}

.nav-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--accent-light);
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  transition: height var(--transition-base);
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #FFFFFF;
  transform: translateX(2px);
}

.nav-item:hover::before {
  height: 60%;
}

.nav-item.active {
  background: var(--sidebar-active);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.28);
}

.nav-item.active::before {
  height: 70%;
}

.nav-icon {
  font-size: 1.25rem;
  color: inherit;
}

.nav-icon.material-symbols-rounded {
  font-size: 1.6rem;
}

.sidebar-footer {
  padding: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.back-link {
  color: rgba(255, 255, 255, 0.75);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition-base);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.back-link:hover {
  color: var(--accent-light);
  transform: translateX(-2px);
}

/* ========================================
   Main Content
   ======================================== */
.admin-main {
  flex: 1;
  margin-left: 280px;
  padding: 2.5rem;
  min-height: 100vh;
  position: relative;
  background: var(--main-bg);
}

.content-section {
  display: none;
}

.content-section.active {
  display: block;
  animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-header h2 {
  font-size: 2rem;
  font-family: var(--font-title);
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* ========================================
   Modern Stats Grid
   ======================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-base);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(124, 58, 237, 0.32);
}

.stat-card:hover::before {
  transform: scaleX(1);
}

.stat-icon {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  background: rgba(124, 58, 237, 0.18);
  color: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.25);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 0.5rem;
}

#top-disc,
#top-riasec {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  color: #1f2937;
}

#last-submission {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

.profile-card-value {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  color: #1f2937;
}

.profile-card-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  margin-top: 0.5rem;
}

/* ========================================
   Charts
   ======================================== */
.charts-grid,
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.chart-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--card-border);
  position: relative;
  overflow: hidden;
}

.chart-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(124, 58, 237, 0.12), transparent 60%);
  pointer-events: none;
}

.chart-card h3 {
  margin-bottom: 1.25rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.chart-card.full-width {
  grid-column: 1 / -1;
}

.trend-insights {
  display: grid;
  gap: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.65;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.trend-insights__item {
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.14);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.trend-insights__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(124, 58, 237, 0.18);
  color: var(--accent);
  font-size: 1.35rem;
  flex-shrink: 0;
}

.trend-insights__content strong {
  display: block;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

.trend-insights__content p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.mini-table th,
.mini-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(124, 58, 237, 0.14);
}

.mini-table th {
  font-weight: 700;
  color: var(--text-primary);
}

.mini-table td:last-child {
  text-align: right;
  font-weight: 600;
  color: var(--text-primary);
}

.mini-table tbody tr:last-child td {
  border-bottom: none;
}

.mini-table tbody tr:nth-child(even) td {
  background: rgba(124, 58, 237, 0.04);
}

.status-control {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(124, 58, 237, 0.08);
  border-radius: var(--radius-md);
  border: 1px solid rgba(124, 58, 237, 0.18);
}

.status-control__label {
  font-weight: 600;
  color: var(--text-primary);
}

.status-control__select {
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(124, 58, 237, 0.25);
  background: #FFFFFF;
  color: var(--text-primary);
  font-weight: 600;
  outline: none;
  transition: border var(--transition-fast), box-shadow var(--transition-fast);
}

.status-control__select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
}

.status-control__hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pipeline-summary {
  display: grid;
  gap: 0.75rem;
}

.pipeline-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: var(--text-primary);
}

.pipeline-summary__bar {
  position: relative;
  height: 10px;
  border-radius: var(--radius-full);
  background: rgba(124, 58, 237, 0.12);
  overflow: hidden;
  margin-top: 0.35rem;
}

.pipeline-summary__bar-fill {
  position: absolute;
  inset: 0;
  background: var(--accent-gradient);
  transform-origin: left;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-md);
}

.insight-panel {
  padding: var(--space-md);
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(124, 58, 237, 0.16);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.insight-panel h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.insight-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.insight-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.insight-list li strong {
  color: var(--text-primary);
}

canvas {
  width: 100% !important;
  height: auto !important;
}

/* ========================================
   Results Table
   ======================================== */
.results-table-container {
  margin-top: 1.5rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.results-table thead {
  background: rgba(236, 228, 255, 0.85);
  backdrop-filter: blur(6px);
}

.results-table th {
  text-align: left;
  padding: 1rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(124, 58, 237, 0.14);
}

.results-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(203, 196, 230, 0.55);
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.results-table tbody tr {
  transition: all var(--transition-fast);
}

.results-table tbody tr:hover {
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.08) 0%, transparent 100%);
  transform: scale(1.001);
}

.disc-badge-small {
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  color: #FFFFFF;
  box-shadow: var(--shadow-sm);
  letter-spacing: 0.025em;
}

.disc-badge-small.disc-D { 
  background: linear-gradient(135deg, #EF4444 0%, #F87171 100%);
}
.disc-badge-small.disc-I { 
  background: linear-gradient(135deg, #F59E0B 0%, #FBBF24 100%);
  color: #1E293B;
}
.disc-badge-small.disc-S { 
  background: linear-gradient(135deg, #10B981 0%, #34D399 100%);
}
.disc-badge-small.disc-C { 
  background: linear-gradient(135deg, #3B82F6 0%, #60A5FA 100%);
}

.disc-badge-small.disc-default {
  background: rgba(148, 163, 184, 0.25);
  color: var(--text-primary);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-badge--yes {
  background: rgba(34, 197, 94, 0.18);
  color: #15803d;
}

.status-badge--no {
  background: rgba(239, 68, 68, 0.18);
  color: #b91c1c;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-pill--pending {
  background: rgba(124, 58, 237, 0.14);
  color: #5B21B6;
}

.status-pill--contacted {
  background: rgba(14, 165, 233, 0.18);
  color: #0369A1;
}

.status-pill--enrolled {
  background: rgba(34, 197, 94, 0.2);
  color: #166534;
}

.status-pill--rejected {
  background: rgba(239, 68, 68, 0.18);
  color: #B91C1C;
}

.priority-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: rgba(148, 163, 184, 0.15);
  color: #374151;
}

.priority-pill--low {
  background: rgba(34, 197, 94, 0.14);
  color: #15803d;
}

.priority-pill--medium {
  background: rgba(250, 204, 21, 0.18);
  color: #B45309;
}

.priority-pill--high {
  background: rgba(239, 68, 68, 0.16);
  color: #B91C1C;
}

.priority-pill--urgent {
  background: rgba(249, 115, 22, 0.16);
  color: #C2410C;
}

.priority-dot {
  display: inline-block;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  vertical-align: middle;
}

.priority-dot--low {
  background: #22C55E;
}

.priority-dot--medium {
  background: #FACC15;
}

.priority-dot--high {
  background: #EF4444;
}

.priority-dot--urgent {
  background: #F97316;
  animation: pulse 1.5s infinite;
}

.priority-summary {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.priority-summary li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--main-bg);
  border-radius: var(--radius-md);
  border: 1px solid rgba(124, 58, 237, 0.14);
  padding: 0.75rem 1rem;
  box-shadow: var(--shadow-xs);
}

.priority-summary__label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.priority-summary__value {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.priority-summary__percent {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.priority-summary__empty {
  text-align: center;
  color: var(--text-muted);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(124, 58, 237, 0.2);
  background: rgba(124, 58, 237, 0.05);
}

.status-fields-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.18);
  border-radius: var(--radius-lg);
}

.field-group {
  display: flex;
  flex-direction: column;
}

.field-group label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.field-group select {
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: #FFFFFF;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  outline: none;
  transition: border var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='10' viewBox='0 0 16 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.6667 1.33325L8.00008 7.99992L1.33341 1.33325' stroke='%2366748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 0.75rem;
}

.field-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}

.field-description {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  font-style: italic;
}

.pipeline-select,
.priority-select {
  cursor: pointer;
}

@media (max-width: 768px) {
  .status-fields-row {
    grid-template-columns: 1fr;
  }
}

.student-notes-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid #e5e7eb;
}

.notes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.notes-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
}

.notes-count {
  font-size: 0.85rem;
  color: #6b7280;
  background: #f3f4f6;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-weight: 500;
}

.notes-history {
  background: #f9fafb;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 1.25rem;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.12);
}

.notes-history--loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: #6b7280;
  font-size: 0.9rem;
}

.notes-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(124, 58, 237, 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.notes-error {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.1);
  padding: 1rem;
  border-radius: var(--radius-md);
  text-align: center;
}

.no-notes {
  text-align: center;
  padding: 2rem;
  color: #9ca3af;
}

.no-notes .material-symbols-rounded {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

.notes-list {
  display: flex;
  flex-direction: column;
}

.note-item {
  padding: 1rem 0;
}

.note-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.note-author-info {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.author-avatar,
.current-user-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #7C3AED 0%, #C084FC 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
}

.author-name {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: #111827;
}

.note-time {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  color: #6b7280;
}

.note-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.2rem;
}

.note-action-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.12);
  color: #5b21b6;
}

.note-content {
  font-size: 0.9rem;
  color: #374151;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.note-divider {
  height: 1px;
  background: #e5e7eb;
  margin-top: 1rem;
}

.delete-note-btn {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.35rem;
  transition: all var(--transition-fast);
}

.delete-note-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.add-note-form {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.note-input-form {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.note-textarea {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  transition: border var(--transition-fast), box-shadow var(--transition-fast);
}

.note-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.note-form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  gap: 0.75rem;
}

.char-count {
  font-size: 0.75rem;
  color: #9ca3af;
}

.add-note-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.add-note-btn:hover:not(:disabled) {
  background: #6d28d9;
}

.add-note-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.note-action-select {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.6);
  font-weight: 600;
  font-size: 0.85rem;
  color: #111827;
  background: #fff;
  transition: border var(--transition-fast), box-shadow var(--transition-fast);
}

.note-action-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.student-notes-wrapper .material-symbols-rounded {
  font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

.student-notes-wrapper {
  width: 100%;
}

.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.activity-list__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.activity-list__item:last-child {
  border-bottom: none;
}

.activity-list__empty {
  color: var(--text-muted);
  text-align: center;
  padding: 1rem 0;
  font-size: 0.9rem;
}

.activity-rank {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.12);
  color: #5b21b6;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.activity-name {
  font-weight: 600;
  color: var(--text-primary);
}

.activity-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.modal-access-section {
  padding: 1.5rem;
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: var(--radius-lg);
  background: rgba(124, 58, 237, 0.04);
  margin-bottom: 2rem;
}

.hbdi-inline-card {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
  margin-bottom: 2rem;
}

.hbdi-inline-card--empty {
  background: rgba(148, 163, 184, 0.08);
  border-style: dashed;
  color: var(--text-muted);
}

.hbdi-inline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.hbdi-inline-majors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.hbdi-inline-major {
  padding: 0.85rem;
  border-radius: var(--radius-md);
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.15);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.hbdi-inline-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.hbdi-inline-card button[data-action="open-hbdi"] {
  border: none;
  padding: 0.5rem 0.85rem;
  background: transparent;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.hbdi-inline-card button[data-action="open-hbdi"]:hover {
  text-decoration: underline;
}

.modal-access-section--disabled {
  background: rgba(148, 163, 184, 0.15);
  border-color: rgba(148, 163, 184, 0.4);
}

.modal-access-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal-access-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.modal-access-info p {
  margin: 0;
  font-weight: 500;
  color: var(--text-primary);
}

.modal-access-info small {
  display: block;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.modal-access-pill {
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
}

.modal-access-pill--granted {
  background: rgba(34, 197, 94, 0.15);
  color: #15803d;
}

.modal-access-pill--pending {
  background: rgba(248, 113, 113, 0.18);
  color: #b91c1c;
}

.notes-history::-webkit-scrollbar {
  width: 6px;
}

.notes-history::-webkit-scrollbar-thumb {
  background: rgba(124, 58, 237, 0.3);
  border-radius: var(--radius-full);
}

.notes-history::-webkit-scrollbar-track {
  background: transparent;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

.majors-cell {
  max-width: 220px;
}

.major-tag {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12) 0%, rgba(192, 132, 252, 0.12) 100%);
  color: var(--accent-dark);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  margin: 0.125rem;
  border: 1px solid rgba(124, 58, 237, 0.22);
  transition: all var(--transition-fast);
}

.major-tag.major-tag--empty {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.2);
  color: var(--text-muted);
}

.major-tag:hover {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.24) 0%, rgba(192, 132, 252, 0.24) 100%);
  transform: translateY(-1px);
}

.hbdi-access-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.hbdi-access-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.hbdi-access-pill--granted {
  background: rgba(34, 197, 94, 0.18);
  color: #15803d;
}

.hbdi-access-pill--pending {
  background: rgba(248, 113, 113, 0.22);
  color: #b91c1c;
}

.hbdi-access-toggle {
  border: none;
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
  color: #ffffff;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.45rem 1.25rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  box-shadow: 0 8px 20px rgba(55, 11, 98, 0.25);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
}

.hbdi-access-toggle:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(55, 11, 98, 0.32);
}

.hbdi-access-toggle:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(55, 11, 98, 0.25);
}

.hbdi-access-toggle:disabled {
  background: rgba(124, 58, 237, 0.15);
  color: rgba(255, 255, 255, 0.7);
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.7;
}

.hbdi-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.hbdi-score-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.hbdi-score-pill {
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.08);
  color: var(--text-primary);
}

.hbdi-score-pill.q-a {
  background: rgba(59, 130, 246, 0.2);
  color: #1d4ed8;
}

.hbdi-score-pill.q-b {
  background: rgba(16, 185, 129, 0.2);
  color: #047857;
}

.hbdi-score-pill.q-c {
  background: rgba(245, 158, 11, 0.2);
  color: #b45309;
}

.hbdi-score-pill.q-d {
  background: rgba(139, 92, 246, 0.2);
  color: #6d28d9;
}

.hbdi-dominant {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.14);
  color: #1d4ed8;
}

.hbdi-modal-section {
  margin-bottom: 1.5rem;
}

.hbdi-modal-section .modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  padding: 1rem;
  background: var(--main-bg);
  border-radius: var(--radius-md);
}


.view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  background: var(--accent-gradient);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.view-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.view-btn:active {
  transform: translateY(0);
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.view-btn .material-symbols-rounded {
  font-size: 1rem;
  margin-inline-end: 0.35rem;
}

.view-btn--danger {
  background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
}

.view-btn--danger:hover {
  box-shadow: 0 12px 26px rgba(220, 38, 38, 0.32);
}

/* ========================================
   Modern Search & Filters
   ======================================== */
.search-input,
.filter-select {
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-family: inherit;
  background: var(--card-bg);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
}

.search-input:focus,
.filter-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(94, 178, 232, 0.25);
}

.filter-select {
  cursor: pointer;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  appearance: none;
}

/* ========================================
   Modern Buttons
   ======================================== */
.btn-primary,
.btn-secondary {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-base);
  letter-spacing: -0.01em;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(120deg, #8b5cf6 0%, #7c3aed 100%);
  color: #FFFFFF;
  box-shadow: 0 18px 40px rgba(79, 70, 229, 0.35);
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn-primary:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--card-bg);
  color: var(--text-primary);
  border: 1.5px solid var(--card-border);
  box-shadow: var(--shadow-sm);
}

.btn-primary .material-symbols-rounded,
.btn-secondary .material-symbols-rounded {
  font-size: 1.25rem;
  margin-right: 0.4rem;
}

.btn-secondary .material-symbols-rounded {
  color: var(--text-muted);
}

.btn-secondary:hover {
  background: rgba(236, 242, 250, 0.85);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1rem;
}

/* ========================================
   Export Cards
   ======================================== */
.export-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 2.25rem;
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
}

.export-info h3 {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
}

.export-info p {
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.export-stats {
  display: flex;
  gap: 1.25rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.export-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.preview-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-md);
  padding: 1.75rem;
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.preview-table th,
.preview-table td {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  font-size: 0.9rem;
}

.preview-table th {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* ========================================
   Modal
   ======================================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 2rem;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2xl);
  max-width: 840px;
  width: 100%;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-detail {
  animation: scaleIn 0.25s ease-out;
}

.modal-header {
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.modal-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: none;
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  cursor: pointer;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  transform: scale(1.05);
  background: rgba(239, 68, 68, 0.2);
}

.modal-body {
  padding: 2rem;
  overflow-y: auto;
}

.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: var(--radius-full);
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.6);
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.modal-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.modal-card {
  padding: 1.25rem;
  border-radius: var(--radius-md);
  background: var(--main-bg);
  border: 1px solid rgba(94, 178, 232, 0.2);
  box-shadow: var(--shadow-xs);
  transition: transform var(--transition-base);
}

.modal-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.modal-card__index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(124, 58, 237, 0.16);
  color: var(--accent-dark);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.modal-metric {
  text-align: center;
  padding: 1rem;
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.modal-metric__value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-dark);
}

.modal-metric__label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
}

.modal-info-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: var(--shadow-xs);
}

.modal-info-list strong {
  color: var(--text-primary);
  font-size: 0.9rem;
}

.modal-info-list span {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1024px) {
  .admin-sidebar {
    width: 240px;
  }
  
  .admin-main {
    margin-left: 240px;
    padding: 2rem;
  }
  
  .charts-grid,
  .analytics-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

@media (max-width: 768px) {
  .admin-sidebar {
    width: 72px;
  }
  
  .nav-label {
    display: none;
  }
  
  .logo-img {
    width: clamp(110px, 28vw, 150px);
  }
  
  .subtitle {
    display: none;
  }
  
  .admin-main {
    margin-left: 72px;
    padding: 1.5rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .section-header h2 {
    font-size: 1.75rem;
  }
  
  .header-actions {
    width: 100%;
  }
  
  .search-input {
    width: 100%;
  }
  
  .export-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 2rem;
  }
  
  .results-table-container {
    overflow-x: scroll;
  }
  
  .chart-card {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .admin-sidebar {
    position: fixed;
    bottom: 0;
    top: auto;
    height: auto;
    width: 100%;
    flex-direction: row;
    padding: 0.75rem;
    border-right: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .sidebar-header,
  .sidebar-footer {
    display: none;
  }
  
  .sidebar-nav {
    display: flex;
    flex-direction: row;
    width: 100%;
    padding: 0;
    justify-content: space-around;
    gap: 0;
  }
  
  .nav-item {
    flex-direction: column;
    padding: 0.75rem 0.5rem;
    border-left: none;
    border-top: 3px solid transparent;
    min-width: 72px;
    margin: 0;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
  }
  
  .nav-item::before {
    display: none;
  }
  
  .nav-item.active {
    border-top-color: var(--accent-light);
    background: var(--sidebar-active);
  }
  
  .admin-main {
    margin-left: 0;
    margin-bottom: 80px;
    padding: 1.25rem;
  }
  
  .section-header h2 {
    font-size: 1.5rem;
  }
  
  .stat-card {
    padding: 1.5rem;
  }
  
  .stat-icon {
    width: 64px;
    height: 64px;
    font-size: 2.25rem;
  }
  
  .stat-value {
    font-size: 1.875rem;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
  padding: var(--space-lg);
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(124, 58, 237, 0.14);
  position: relative;
}

.portal-title {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  font-weight: 500;
  font-family: var(--font-title);
  color: var(--text-primary);
}

.portal-subtitle {
  margin-top: 0.25rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  position: relative;
}

.btn-small {
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  border-radius: var(--radius-md);
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-pill);
  background: rgba(124, 58, 237, 0.14);
  color: var(--accent);
  border: 1px solid rgba(124, 58, 237, 0.22);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.profile-chip:hover {
  background: rgba(124, 58, 237, 0.22);
  border-color: rgba(124, 58, 237, 0.35);
}

.profile-chip__name {
  font-weight: 600;
}

.profile-chip__caret {
  font-size: 1.1rem;
}

.profile-menu {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  width: 220px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(124, 58, 237, 0.2);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  z-index: 20;
}

.profile-menu.hidden {
  display: none;
}

.profile-menu__info {
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-md);
  background: rgba(124, 58, 237, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  color: var(--text-primary);
}

.profile-menu__info span {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.profile-menu__link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.profile-menu__link:hover {
  background: rgba(124, 58, 237, 0.12);
}

.profile-menu__link--danger {
  color: #ef4444;
}

.section-description {
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.questions-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr);
  gap: var(--space-lg);
}

.questions-table-card,
.users-table-card,
.user-form-card,
.profile-card,
.options-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(124, 58, 237, 0.16);
  box-shadow: var(--shadow-sm);
  padding: var(--space-lg);
}

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

.questions-table th,
.questions-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(124, 58, 237, 0.14);
  text-align: left;
  vertical-align: top;
}

.questions-table tbody tr:last-child td {
  border-bottom: none;
}

.questions-table button {
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(124, 58, 237, 0.14);
  color: var(--accent);
  border: 1px solid rgba(124, 58, 237, 0.2);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.questions-table button:hover {
  background: rgba(124, 58, 237, 0.22);
}

.options-card h3 {
  margin-bottom: 0.75rem;
}

.options-group {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: var(--space-md);
}

.option-row {
  display: grid;
  grid-template-columns: 48px repeat(3, 1fr);
  gap: 0.5rem;
  align-items: center;
}

.option-row .option-value {
  font-weight: 700;
  color: var(--accent);
  text-align: center;
}

.option-row label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.option-row input {
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(124, 58, 237, 0.2);
  background: var(--main-bg);
  color: var(--text-primary);
}

.options-card .btn-primary {
  align-self: flex-start;
}

.major-settings {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.major-override-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.major-override-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.major-override-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.major-override-card__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.major-override-card__header h4 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.major-override-card__header p {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.major-override-card__inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.major-override-card__inputs label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.major-override-card__inputs input {
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(124, 58, 237, 0.22);
  background: var(--main-bg);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.major-override-card__inputs input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.18);
}

.major-override-reset {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(124, 58, 237, 0.28);
  background: rgba(124, 58, 237, 0.08);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.major-override-reset:hover {
  background: rgba(124, 58, 237, 0.16);
}

.major-override-reset .material-symbols-rounded {
  font-size: 1rem;
}

.user-management-grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
}

.user-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.user-form .form-group,
.profile-form .form-group,
.modal-body .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.user-form label,
.profile-form label,
.modal-body label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.user-form input,
.profile-form input,
.profile-form textarea,
.modal-body input,
.modal-body textarea,
.modal-body select {
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(124, 58, 237, 0.2);
  background: var(--main-bg);
  color: var(--text-primary);
  font-size: 0.95rem;
}

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

.users-table th,
.users-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(124, 58, 237, 0.14);
  text-align: left;
}

.users-table tbody tr:last-child td {
  border-bottom: none;
}

.users-table .action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.users-table .action-btn:hover {
  background: rgba(239, 68, 68, 0.2);
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-lg);
}

.profile-card h3 {
  margin-bottom: 0.75rem;
}

.profile-card p {
  margin-bottom: 0.45rem;
}

.profile-card span {
  font-weight: 600;
}

.profile-form button {
  align-self: flex-start;
  margin-top: 0.85rem;
}

.profile-status {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  min-height: 1.2rem;
}

.profile-status[data-variant="success"] {
  color: #22c55e;
}

.profile-status[data-variant="error"] {
  color: #ef4444;
}

.admin-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  min-width: 220px;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  background: rgba(124, 58, 237, 0.95);
  color: #fff;
  box-shadow: var(--shadow-xl);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 100;
}

.admin-toast.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.admin-toast--error {
  background: rgba(220, 38, 38, 0.95);
}

.admin-toast--info {
  background: rgba(59, 130, 246, 0.95);
}

.modal-large {
  width: min(720px, 95vw);
}

.modal-body .form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.help-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

@media (max-width: 960px) {
  .questions-layout,
  .user-management-grid {
    grid-template-columns: 1fr;
  }

  .admin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }

  .header-right {
    align-self: stretch;
    justify-content: space-between;
  }
}

.login-screen {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(124, 58, 237, 0.25), transparent 55%), var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl) var(--space-xl);
  z-index: 1000;
}

.login-card {
  width: min(420px, 100%);
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(124, 58, 237, 0.14);
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  text-align: center;
}

.login-logo img {
  width: clamp(64px, 18vw, 96px);
  height: auto;
  border-radius: 22px;
  object-fit: contain;
  box-shadow: var(--shadow-md);
}

.login-logo h1 {
  font-size: 1.5rem;
  font-family: var(--font-title);
  font-weight: 500;
  color: var(--text-primary);
}

.login-logo p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.login-title {
  font-size: 1.75rem;
  font-weight: 500;
  font-family: var(--font-title);
  color: var(--text-primary);
  text-align: center;
}

.login-subtitle {
  color: var(--text-secondary);
  text-align: center;
  font-size: 1rem;
  line-height: 1.5;
}

.login-method-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: var(--radius-lg);
  background: rgba(124, 58, 237, 0.05);
  padding: 0.25rem;
  gap: 0.25rem;
}

.login-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.login-toggle-btn .material-symbols-rounded {
  font-size: 1.15rem;
}

.login-toggle-btn.is-active {
  background: #1f1233;
  color: var(--accent-light);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.login-form--credentials {
  margin-top: var(--space-lg);
}

.login-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.login-form label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.login-error {
  margin: 0;
  color: var(--danger);
  font-weight: 600;
  font-size: 0.95rem;
  background: rgba(248, 113, 113, 0.12);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(248, 113, 113, 0.35);
  text-align: center;
}

.login-help {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0.5rem 0 0;
}

.site-footer {
  margin-top: auto;
  padding: 2rem 1.5rem;
  background: linear-gradient(145deg, #0f071c 0%, #1b0c34 100%);
  color: #f6f1ff;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -12px 32px rgba(6, 1, 14, 0.65);
  display: flex;
  justify-content: center;
  text-align: center;
}

.site-footer__content {
  width: min(1024px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.site-footer__copy {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
  color: #f6f1ff;
}

.site-footer__copy a {
  color: #d8c6ff;
  text-decoration: none;
  font-weight: 700;
}

.site-footer__copy a:hover,
.site-footer__copy a:focus-visible {
  text-decoration: underline;
}

.site-footer__social {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.site-footer__social-link {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.18);
  border: 1px solid rgba(139, 92, 246, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.site-footer__social-link:hover,
.site-footer__social-link:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  background: rgba(139, 92, 246, 0.28);
}

.site-footer__social-link img {
  width: 18px;
  height: 18px;
  display: block;
}

.login-form input {
  width: 100%;
  padding: 0.95rem 1.05rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(124, 58, 237, 0.28);
  background: rgba(17, 24, 39, 0.08);
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.login-form input::placeholder {
  color: rgba(148, 163, 184, 0.9);
}

.login-form input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(124, 58, 237, 0.12);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}

.form-group--floating {
  position: relative;
}

@media (max-width: 640px) {
  .login-card {
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
  }
}

@media (max-width: 640px) {
  .logo-img {
    width: clamp(110px, 32vw, 160px);
  }
}

[data-theme="dark"] .highlight-card {
  background: linear-gradient(135deg, rgba(112, 26, 173, 0.45) 0%, rgba(76, 29, 149, 0.4) 100%);
  border-color: rgba(168, 132, 255, 0.28);
}

[data-theme="dark"] .highlight-value {
  color: #C084FC;
}

[data-theme="dark"] .callback-toggle__track {
  background: rgba(124, 58, 237, 0.35);
}

[data-theme="dark"] .callback-toggle input:checked + .callback-toggle__track {
  background: linear-gradient(135deg, #7C3AED 0%, #C084FC 100%);
}
