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

/* =========================================================
   DESIGN TOKENS
   ========================================================= */
:root {
  /* Brand Palette */
  --primary-50:  #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-800: #1e40af;
  --primary-900: #1e3a8a;

  /* Semantic Colors */
  --primary-color:  #2563eb;
  --primary-hover:  #1d4ed8;
  --primary-light:  #eff6ff;
  --secondary-color:#06b6d4;
  --accent-color:   #8b5cf6;

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

  /* Surface */
  --bg-color:      #f1f5f9;
  --bg-subtle:     #e2e8f0;
  --card-bg:       rgba(255, 255, 255, 0.98);
  --card-border:   rgba(226, 232, 240, 0.9);
  --nav-bg:        rgba(255, 255, 255, 0.97);

  /* Text */
  --text-main:     #0f172a;
  --text-secondary:#334155;
  --text-muted:    #64748b;
  --text-subtle:   #94a3b8;

  /* Border */
  --border-color:  #e2e8f0;
  --border-strong: #cbd5e1;

  /* Status */
  --error-color:   #dc2626;
  --error-bg:      #fef2f2;
  --error-border:  rgba(220, 38, 38, 0.2);
  --success-color: #059669;
  --success-bg:    #ecfdf5;
  --success-border:rgba(5, 150, 105, 0.2);
  --warning-color: #d97706;
  --warning-bg:    #fffbeb;
  --warning-border:rgba(217, 119, 6, 0.2);
  --info-color:    #0284c7;
  --info-bg:       #f0f9ff;

  /* Shadows */
  --shadow-xs:   0 1px 2px 0 rgba(0,0,0,.05);
  --shadow-sm:   0 1px 3px 0 rgba(0,0,0,.08), 0 1px 2px -1px rgba(0,0,0,.08);
  --shadow-md:   0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.07);
  --shadow-lg:   0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.05);
  --shadow-xl:   0 20px 25px -5px rgba(0,0,0,.08), 0 8px 10px -6px rgba(0,0,0,.04);
  --shadow-hover:0 20px 40px -8px rgba(37,99,235,.18), 0 8px 16px -4px rgba(37,99,235,.10);

  /* Radii */
  --radius-xs:  0.25rem;
  --radius-sm:  0.375rem;
  --radius-md:  0.625rem;
  --radius-lg:  1rem;
  --radius-xl:  1.5rem;
  --radius-2xl: 2rem;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(.4,0,.2,1);
  --transition-base: 200ms cubic-bezier(.4,0,.2,1);
  --transition-slow: 300ms cubic-bezier(.4,0,.2,1);
}

/* Dark Mode */
[data-theme="dark"] {
  --primary-color:  #60a5fa;
  --primary-hover:  #93c5fd;
  --primary-light:  rgba(96,165,250,.12);
  --secondary-color:#22d3ee;
  --accent-color:   #a78bfa;

  --bg-color:       #070c18;
  --bg-subtle:      #0d1526;
  --card-bg:        rgba(13,20,40,.9);
  --card-border:    rgba(30,41,59,.8);
  --nav-bg:         rgba(7,12,24,.95);

  --text-main:      #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted:     #94a3b8;
  --text-subtle:    #64748b;

  --border-color:   #1e293b;
  --border-strong:  #334155;

  --error-color:    #f87171;
  --error-bg:       rgba(248,113,113,.10);
  --error-border:   rgba(248,113,113,.20);
  --success-color:  #34d399;
  --success-bg:     rgba(52,211,153,.10);
  --success-border: rgba(52,211,153,.20);
  --warning-color:  #fbbf24;
  --warning-bg:     rgba(251,191,36,.10);
  --warning-border: rgba(251,191,36,.20);
  --info-color:     #38bdf8;
  --info-bg:        rgba(56,189,248,.10);

  --shadow-xs:   0 1px 2px 0 rgba(0,0,0,.4);
  --shadow-sm:   0 1px 3px 0 rgba(0,0,0,.5), 0 1px 2px -1px rgba(0,0,0,.4);
  --shadow-md:   0 4px 6px -1px rgba(0,0,0,.4), 0 2px 4px -2px rgba(0,0,0,.35);
  --shadow-lg:   0 10px 15px -3px rgba(0,0,0,.5), 0 4px 6px -4px rgba(0,0,0,.35);
  --shadow-xl:   0 20px 25px -5px rgba(0,0,0,.5), 0 8px 10px -6px rgba(0,0,0,.3);
  --shadow-hover:0 20px 40px -8px rgba(96,165,250,.15), 0 8px 16px -4px rgba(96,165,250,.08);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 15px;
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

/* Background pattern for light mode */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(37,99,235,.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(6,182,212,.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

[data-theme="dark"] body::before {
  background-image:
    radial-gradient(circle at 20% 20%, rgba(96,165,250,.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(34,211,238,.03) 0%, transparent 50%);
}

main {
  position: relative;
  z-index: 1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--text-main);
}

h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

a { color: var(--primary-color); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--primary-hover); }

/* =========================================================
   HEADER & NAVIGATION
   ========================================================= */
header {
  background-color: var(--nav-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--card-border);
  box-shadow: var(--shadow-sm);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background-color var(--transition-slow), border-color var(--transition-slow);
}

/* Gradient accent line at top of header */
header::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-600) 0%, var(--secondary-color) 50%, var(--accent-color) 100%);
}

.nav-container {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 2rem;
}

.logo {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  letter-spacing: -0.04em;
  transition: all var(--transition-base);
}

.logo:hover {
  color: var(--primary-hover);
  gap: 0.75rem;
}

.logo svg {
  flex-shrink: 0;
}

.logo-badge {
  font-size: 0.6rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-600), var(--accent-color));
  color: white;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
  margin-left: 4px;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--primary-color);
  background-color: var(--primary-light);
}

.nav-links a.active {
  color: var(--primary-color);
  background-color: var(--primary-light);
  font-weight: 600;
}

/* User greeting pill */
.user-greeting {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 0.3rem 0.75rem;
  border-radius: 2rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-base);
}

.user-greeting:hover {
  border-color: var(--primary-color);
  background-color: var(--primary-light);
  color: var(--primary-color);
}

/* Notification bell */
.nav-notification {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  color: var(--text-muted);
}

.nav-notification:hover {
  background-color: var(--primary-light);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.nav-notification-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: var(--error-color);
  color: white;
  font-size: 9px;
  font-weight: 800;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--nav-bg);
  animation: pulse 2s infinite;
}

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

/* Theme Toggle */
.theme-toggle {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.theme-toggle:hover {
  background-color: var(--primary-light);
  color: var(--primary-color);
  border-color: var(--primary-color);
  transform: rotate(20deg);
}

/* Hamburger */
.hamburger {
  display: none;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  z-index: 1001;
  transition: all var(--transition-fast);
}

.hamburger:hover {
  background: var(--primary-light);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* =========================================================
   LAYOUT
   ========================================================= */
main {
  flex: 1;
  width: 100%;
  max-width: 1320px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  transition: opacity var(--transition-slow);
}

/* Page Header Pattern */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-header-text h1 {
  margin-bottom: 0.25rem;
}

.page-header-text p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

/* Section Header */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

/* =========================================================
   CARDS
   ========================================================= */
.card {
  background-color: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--card-border);
  transition: transform var(--transition-base), box-shadow var(--transition-base), background-color var(--transition-slow);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Top accent line on cards */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  opacity: 0;
  transition: opacity var(--transition-base);
}

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

.card:hover::before {
  opacity: 1;
}

.card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

/* Featured / Elevated Card */
.card-featured {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  color: white;
  border: none;
}

.card-featured::before { display: none; }
.card-featured h1,
.card-featured h2,
.card-featured h3,
.card-featured p { color: white; }

/* =========================================================
   STAT BOXES
   ========================================================= */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-box {
  padding: 1.5rem 1.25rem;
  border-radius: var(--radius-lg);
  text-align: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  position: relative;
  overflow: hidden;
}

.stat-box::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-base);
}

.stat-box:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-box:hover::after { transform: scaleX(1); }

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary-color);
  line-height: 1;
  margin-bottom: 0.35rem;
  letter-spacing: -0.03em;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.575rem 1.15rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-family: inherit;
  line-height: 1.4;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

/* Shimmer effect */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.2) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform .5s ease;
}

.btn:hover::after {
  transform: translateX(100%);
}

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.75rem 1.75rem;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(37,99,235,.35);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37,99,235,.45);
  color: white;
}

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

.btn-primary:disabled {
  background: var(--gray-300);
  color: var(--gray-500);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

[data-theme="dark"] .btn-primary {
  box-shadow: 0 4px 12px rgba(96,165,250,.25);
}

.btn-outline {
  background-color: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
}

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

.btn-danger {
  background-color: var(--error-bg);
  color: var(--error-color);
  border-color: var(--error-border);
}

.btn-danger:hover {
  background-color: var(--error-color);
  color: white;
  transform: translateY(-1px);
  border-color: var(--error-color);
}

.btn-success {
  background-color: var(--success-bg);
  color: var(--success-color);
  border-color: var(--success-border);
}

.btn-success:hover {
  background-color: var(--success-color);
  color: white;
  transform: translateY(-1px);
}

.btn-block {
  width: 100%;
  display: flex;
  padding: 0.8rem;
}

/* =========================================================
   FORMS
   ========================================================= */
.form-group {
  margin-bottom: 1.35rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.95rem;
  background-color: var(--card-bg);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.925rem;
  color: var(--text-main);
  transition: all var(--transition-fast);
  line-height: 1.5;
}

[data-theme="dark"] .form-control {
  background-color: rgba(255,255,255,.04);
}

.form-control:focus {
  outline: none;
  background-color: var(--card-bg);
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

[data-theme="dark"] .form-control:focus {
  box-shadow: 0 0 0 3px rgba(96,165,250,.15);
}

.form-control:disabled, .form-control[disabled] {
  background-color: var(--bg-subtle);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.8;
}

.form-control::placeholder {
  color: var(--text-subtle);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 1.1rem;
  padding-right: 2.5rem;
  cursor: pointer;
}

select[multiple] {
  background-image: none;
  padding: 0.5rem;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* Form help text */
.form-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* =========================================================
   AUTH PAGES
   ========================================================= */
.auth-container {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  background-color: var(--card-bg);
  backdrop-filter: blur(20px);
  padding: 3rem 2.5rem;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--card-border);
  transition: all var(--transition-slow);
  position: relative;
  overflow: hidden;
}

.auth-page-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background-color: var(--bg-color);
}

.auth-side-image {
  flex: 1;
  display: none;
  background: linear-gradient(135deg, var(--primary-900), var(--primary-600));
  position: relative;
  overflow: hidden;
}

.auth-side-image::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.auth-side-image-content {
  position: absolute;
  bottom: 4rem;
  left: 4rem;
  right: 4rem;
  color: white;
  z-index: 2;
}

.auth-side-image-content h2 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.auth-side-image-content p {
  font-size: 1.1rem;
  color: var(--primary-100);
  line-height: 1.6;
}

.auth-side-form {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background-color: var(--bg-color);
}

@media (min-width: 992px) {
  .auth-side-image {
    display: block;
  }
}

.auth-container::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header h1 {
  font-size: 1.6rem;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.auth-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.auth-footer a {
  color: var(--primary-color);
  font-weight: 600;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* =========================================================
   ALERTS
   ========================================================= */
.alert {
  padding: 0.875rem 1.125rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  font-weight: 500;
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  border: 1px solid;
  animation: slideDown 0.25s ease;
}

.alert svg { flex-shrink: 0; margin-top: 1px; }

.alert-error {
  background-color: var(--error-bg);
  color: var(--error-color);
  border-color: var(--error-border);
}

.alert-success {
  background-color: var(--success-bg);
  color: var(--success-color);
  border-color: var(--success-border);
}

.alert-warning {
  background-color: var(--warning-bg);
  color: var(--warning-color);
  border-color: var(--warning-border);
}

.alert-info {
  background-color: var(--info-bg);
  color: var(--info-color);
  border-color: rgba(2,132,199,.2);
}

/* =========================================================
   BADGES
   ========================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.65rem;
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
}

.badge-pending  { background: var(--warning-bg); color: var(--warning-color); border-color: var(--warning-border); }
.badge-accepted { background: var(--success-bg); color: var(--success-color); border-color: var(--success-border); }
.badge-rejected { background: var(--error-bg);   color: var(--error-color);   border-color: var(--error-border); }
.badge-minor, .badge-major { background: var(--primary-light); color: var(--primary-color); border-color: rgba(37,99,235,.2); }
.badge-info     { background: var(--info-bg); color: var(--info-color); }

/* =========================================================
   TABLES
   ========================================================= */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  background-color: var(--card-bg);
  margin-top: 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

thead {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
}

th {
  padding: 0.85rem 1.1rem;
  font-weight: 700;
  color: white;
  font-size: 0.775rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: none;
  white-space: nowrap;
}

td {
  padding: 0.875rem 1.1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: background-color var(--transition-fast);
}

tbody tr:nth-child(even) td {
  background-color: rgba(0,0,0,.015);
}

[data-theme="dark"] tbody tr:nth-child(even) td {
  background-color: rgba(255,255,255,.015);
}

tbody tr:hover td {
  background-color: var(--primary-light) !important;
  color: var(--text-main);
}

/* =========================================================
   SEARCH & FILTERS
   ========================================================= */
.search-container {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 220px;
}

.filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-radius: 2rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 1.5px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.filter-pill:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: var(--primary-light);
}

.filter-pill.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(37,99,235,.3);
}

/* =========================================================
   TIMELINE
   ========================================================= */
.timeline {
  position: relative;
  padding-left: 1.5rem;
  margin-top: 1rem;
  border-left: 2px solid var(--border-color);
}

.timeline-item {
  position: relative;
  margin-bottom: 1.25rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.65rem;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border: 2px solid var(--bg-color);
  box-shadow: 0 0 0 2px var(--primary-color);
}

.timeline-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.timeline-content {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* =========================================================
   FOOTER
   ========================================================= */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border-color);
  background-color: var(--card-bg);
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: auto;
}

footer a {
  color: var(--primary-color);
  font-weight: 600;
}

/* =========================================================
   UTILITIES
   ========================================================= */
.text-muted { color: var(--text-muted) !important; }
.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-error   { color: var(--error-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-sm { font-size: 0.85rem !important; }
.text-xs { font-size: 0.75rem !important; }
.font-bold { font-weight: 700 !important; }
.font-semibold { font-weight: 600 !important; }

.divider {
  height: 1px;
  background: var(--border-color);
  margin: 1.5rem 0;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-state svg {
  opacity: .35;
  margin-bottom: 1rem;
}

.empty-state h3 {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

/* =========================================================
   ANIMATIONS
   ========================================================= */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

.animate-fade-in { animation: fadeIn .3s ease; }
.animate-scale-in { animation: scaleIn .25s ease; }

/* Page enter */
main { animation: fadeIn .3s ease; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1024px) {
  .nav-container { padding: 0.7rem 1.25rem; }
}

@media (max-width: 768px) {
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }

  header { padding: 0; }
  .nav-container { padding: 0.65rem 1rem; }

  .hamburger { display: flex; align-items: center; justify-content: center; }

  .nav-links {
    position: fixed;
    top: 57px; left: 0; right: 0; bottom: 0;
    background-color: var(--nav-bg);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 1.5rem 1.25rem;
    gap: 0.25rem;
    align-items: stretch;
    display: none;
    border-top: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    overflow-y: auto;
    z-index: 999;
  }

  .nav-links.active {
    display: flex;
    animation: slideDown .2s ease;
  }

  .nav-links a {
    font-size: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
  }

  .auth-container {
    margin: 1.25rem 1rem;
    padding: 1.75rem 1.25rem;
    border-radius: var(--radius-lg);
  }

  .stats-container { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid  { grid-template-columns: 1fr; }

  .section-header  { flex-direction: column; align-items: flex-start; }
  .search-container { flex-direction: column; width: 100%; }
  .search-input    { width: 100%; }
  .filter-bar      { width: 100%; }

  main { margin: 1.25rem auto; padding: 0 1rem; }
}

@media (max-width: 480px) {
  .stats-container { grid-template-columns: 1fr; }
  .auth-container  { margin: 1rem 0.75rem; padding: 1.5rem 1rem; }
}

/* =========================================================
   MODALS & DIALOGS
   ========================================================= */
.modal {
  display: none;
  position: fixed;
  z-index: 1050;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow: auto;
  opacity: 0;
  animation: fadeIn var(--transition-base) forwards;
}

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

.modal-content {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  margin: 5vh auto;
  padding: 0;
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 650px;
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,0.1) inset;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  transform: translateY(20px);
  animation: slideUp var(--transition-base) forwards;
}

@keyframes slideUp {
  to { transform: translateY(0); }
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-subtle);
}

.modal-header h2, .modal-header h3 {
  margin: 0;
  color: var(--text-main);
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close {
  color: var(--text-muted);
  font-size: 1.75rem;
  line-height: 1;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--transition-fast);
  background: transparent;
  border: none;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  color: var(--error-color);
  background: var(--error-bg);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--card-bg);
}

@media (max-width: 640px) {
  .modal-content {
    margin: 0;
    width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
}
