:root {
  /* PRIMARY PALETTE — Rich Indigo-Teal */
  --primary: #004d64;
  --primary-container: #006684;
  --secondary: #006a6a;
  --secondary-container: #9deeed;
  --on-secondary-container: #0b6e6e;
  --tertiary: #3a4664;
  --surface: #f7f9fc;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #f2f4f6;
  --surface-container: #eceef1;
  --surface-container-high: #e6e8eb;
  --surface-container-highest: #e0e3e5;
  --on-surface: #181c1e;
  --outline: #70787e;
  --outline-variant: #bfc8cd;
  --primary-fixed: #bee9ff;
  --on-primary-fixed: #001f2a;
  --error: #ba1a1a;
  --error-container: #ffdad6;

  /* STATUS BADGE COLORS (Light) */
  --status-pending-bg: #fff8e1;
  --status-pending-text: #ff8f00;
  --status-submitted-bg: #e3f2fd;
  --status-submitted-text: #1565c0;
  --status-ai-bg: var(--primary-fixed);
  --status-ai-text: var(--on-primary-fixed);
  --status-graded-bg: #e8f5e9;
  --status-graded-text: #2e7d32;
  --status-urgent-bg: var(--error-container);
  --status-urgent-text: var(--error);

  /* PREMIUM GRADIENTS */
  --signature-gradient: linear-gradient(135deg, #004d64 0%, #006684 50%, #008a8a 100%);
  --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --warm-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --aurora-gradient: linear-gradient(135deg, #004d64 0%, #006a6a 30%, #3a4664 60%, #006684 100%);
  --mesh-gradient: radial-gradient(at 40% 20%, hsla(190, 100%, 20%, 0.08) 0px, transparent 50%),
                   radial-gradient(at 80% 0%, hsla(180, 100%, 21%, 0.06) 0px, transparent 50%),
                   radial-gradient(at 0% 50%, hsla(220, 28%, 30%, 0.05) 0px, transparent 50%);

  /* GLASSMORPHISM */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-shadow: 0 8px 32px rgba(0, 77, 100, 0.08);
  --glass-blur: 16px;

  /* GLOW EFFECTS */
  --glow-primary: 0 0 20px rgba(0, 77, 100, 0.15), 0 0 60px rgba(0, 77, 100, 0.05);
  --glow-secondary: 0 0 20px rgba(0, 106, 106, 0.15), 0 0 60px rgba(0, 106, 106, 0.05);
  --glow-accent: 0 0 20px rgba(102, 126, 234, 0.2);

  /* PREMIUM SHADOWS */
  --shadow-xs: 0 2px 4px rgba(0, 30, 45, 0.03), 0 1px 2px rgba(0, 30, 45, 0.04);
  --shadow-sm: 0 6px 12px rgba(0, 30, 45, 0.03), 0 4px 6px rgba(0, 30, 45, 0.04);
  --shadow-md: 0 12px 24px rgba(0, 30, 45, 0.04), 0 8px 12px rgba(0, 30, 45, 0.02);
  --shadow-lg: 0 24px 48px rgba(0, 30, 45, 0.05), 0 12px 24px rgba(0, 30, 45, 0.03);
  --shadow-xl: 0 32px 64px rgba(0, 30, 45, 0.06), 0 16px 32px rgba(0, 30, 45, 0.04);
  --shadow-2xl: 0 48px 96px rgba(0, 30, 45, 0.08), 0 24px 48px rgba(0, 30, 45, 0.05);

  /* TRANSITIONS */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);

  /* BORDER RADIUS */
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-2xl: 1.5rem;
  --radius-3xl: 2rem;
}

html[data-theme="dark"] {
  /* DARK MODE COLORS */
  --primary: #87d0f2;
  --primary-container: #004d64;
  --secondary: #84d4d3;
  --secondary-container: #004f4f;
  --on-secondary-container: #9deeed;
  --tertiary: #bac6ea;
  --surface: #0f1214;
  --surface-container-lowest: #0a0d0f;
  --surface-container-low: #181c1e;
  --surface-container: #1e2326;
  --surface-container-high: #252b2e;
  --surface-container-highest: #2d3336;
  --on-surface: #e2e4e6;
  --outline: #8a9298;
  --outline-variant: #3f484d;
  --primary-fixed: #001f2a;
  --on-primary-fixed: #bee9ff;
  --error: #ffb4ab;
  --error-container: #93000a;

  /* STATUS BADGE COLORS (Dark) */
  --status-pending-bg: rgba(255, 143, 0, 0.2);
  --status-pending-text: #ffd54f;
  --status-submitted-bg: rgba(21, 101, 192, 0.2);
  --status-submitted-text: #90caf9;
  --status-ai-bg: var(--primary-fixed);
  --status-ai-text: var(--on-primary-fixed);
  --status-graded-bg: rgba(46, 125, 50, 0.2);
  --status-graded-text: #a5d6a7;
  --status-urgent-bg: var(--error-container);
  --status-urgent-text: var(--error);

  /* DARK GRADIENTS */
  --signature-gradient: linear-gradient(135deg, #006684 0%, #87d0f2 100%);
  --accent-gradient: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
  --aurora-gradient: linear-gradient(135deg, #004d64 0%, #006a6a 30%, #3a4664 60%, #87d0f2 100%);
  --mesh-gradient: radial-gradient(at 40% 20%, hsla(190, 100%, 40%, 0.06) 0px, transparent 50%),
                   radial-gradient(at 80% 0%, hsla(180, 100%, 41%, 0.04) 0px, transparent 50%),
                   radial-gradient(at 0% 50%, hsla(220, 28%, 60%, 0.04) 0px, transparent 50%);

  /* DARK GLASS */
  --glass-bg: rgba(15, 18, 20, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

  /* DARK GLOWS */
  --glow-primary: 0 0 20px rgba(135, 208, 242, 0.1), 0 0 60px rgba(135, 208, 242, 0.05);
  --glow-secondary: 0 0 20px rgba(132, 212, 211, 0.1), 0 0 60px rgba(132, 212, 211, 0.05);
  --glow-accent: 0 0 20px rgba(167, 139, 250, 0.15);

  /* DARK SHADOWS */
  --shadow-xs: 0 2px 4px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 6px 12px rgba(0, 0, 0, 0.4), 0 4px 6px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 12px 24px rgba(0, 0, 0, 0.5), 0 8px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.6), 0 12px 24px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 32px 64px rgba(0, 0, 0, 0.7), 0 16px 32px rgba(0, 0, 0, 0.5);
  --shadow-2xl: 0 48px 96px rgba(0, 0, 0, 0.8), 0 24px 48px rgba(0, 0, 0, 0.6);
}

/* ========================================
   BASE RESET & FONTS
   ======================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Lexend", sans-serif;
  background-color: var(--surface);
  background-image: var(--mesh-gradient);
  color: var(--on-surface);
  transition: background-color 0.5s var(--ease-smooth), color 0.3s var(--ease-smooth);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Manrope", sans-serif;
  font-weight: 800; /* Bolder headers */
  color: var(--on-surface);
  letter-spacing: -0.025em; /* Tighter letter spacing for a modern look */
  line-height: 1.15;
}

h1 { letter-spacing: -0.04em; font-size: clamp(2.5rem, 5vw, 4.5rem); }
h2 { font-size: clamp(2rem, 4vw, 3.25rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

::selection {
  background: var(--primary);
  color: #fff;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--outline-variant);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--outline);
}

/* ========================================
   POINTER & TRANSITIONS
   ======================================== */
.cursor-pointer { cursor: pointer; }
.transition-colors { transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1), fill 0.2s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.2s cubic-bezier(0.4, 0, 0.2, 1); }
.hover\:text-error:hover { color: var(--error); }

/* ========================================
   TYPOGRAPHY UTILITIES
   ======================================== */
.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--secondary) !important; }
.text-tertiary { color: var(--tertiary) !important; }
.text-error { color: var(--error) !important; }
.text-muted { color: var(--outline) !important; }
.text-white { color: #ffffff !important; }
.text-center { text-align: center; }

.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.tracking-widest { letter-spacing: 0.1em; }
.uppercase { text-transform: uppercase; }
.italic { font-style: italic; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }

/* ========================================
   BACKGROUND UTILITIES
   ======================================== */
.bg-surface { background-color: var(--surface) !important; }
.bg-lowest { background-color: var(--surface-container-lowest) !important; }
.bg-low { background-color: var(--surface-container-low) !important; }
.bg-container { background-color: var(--surface-container) !important; }
.bg-high { background-color: var(--surface-container-high) !important; }
.bg-highest { background-color: var(--surface-container-highest) !important; }
.bg-primary { background-color: var(--primary) !important; }
.bg-primary-container { background-color: var(--primary-container) !important; }
.bg-secondary-container { background-color: var(--secondary-container) !important; }
.bg-error-container { background-color: var(--error-container) !important; }
.bg-gradient { background: var(--signature-gradient) !important; }
.bg-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
}

/* ========================================
   LAYOUT UTILITIES
   ======================================== */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-10 { gap: 2.5rem; }
.gap-12 { gap: 3rem; }
.gap-16 { gap: 4rem; }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

.w-full { width: 100%; }
.w-1\/2 { width: 50%; }
.w-1\/3 { width: 33.333333%; }
.w-2\/3 { width: 66.666667%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-7xl { max-width: 80rem; margin-inline: auto; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }

/* ========================================
   POSITIONING & Z-INDEX
   ======================================== */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.top-4 { top: 1rem; }
.top-8 { top: 2rem; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.right-4 { right: 1rem; }
.right-8 { right: 2rem; }
.z-0 { z-index: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-50 { z-index: 50; }

/* ========================================
   SPACING UTILITIES
   ======================================== */
.m-auto { margin: auto; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mt-auto { margin-top: auto; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mb-12 { margin-bottom: 3rem; }
.mr-2 { margin-right: 0.5rem; }
.ml-2 { margin-left: 0.5rem; }
.p-0 { padding: 0; }
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.p-10 { padding: 2.5rem; }
.p-12 { padding: 3rem; }
.p-16 { padding: 4rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }

/* ========================================
   BORDER RADIUS
   ======================================== */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-3xl { border-radius: var(--radius-3xl); }
.rounded-full { border-radius: 9999px; }

/* ========================================
   SHADOW UTILITIES
   ======================================== */
.shadow-ambient {
  box-shadow: var(--shadow-md);
}

.shadow-hover {
  box-shadow: var(--shadow-lg);
}

.shadow-glow-primary {
  box-shadow: var(--glow-primary);
}

.shadow-glow-secondary {
  box-shadow: var(--glow-secondary);
}

/* ========================================
   MAIN CONTENT AREA — FIXED PADDING BUG
   ======================================== */
.main-content {
  margin-left: 240px;
  padding-top: 88px; /* navbar(64px) + breathing room(24px) */
  padding-right: 2.5rem;
  padding-bottom: 3rem;
  padding-left: 2.5rem;
  min-height: 100vh;
  position: relative;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */
@media (max-width: 1024px) {
  .main-content {
    margin-left: 0;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid-cols-4,
  .grid-cols-3,
  .grid-cols-2 { grid-template-columns: 1fr; }
  .main-content {
    padding-top: 80px;
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
