/* ============================================================
   FUNDUPTION - Design System & Global Styles
   Font: Clash Display (headings) + DM Sans (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Syne:wght@600;700;800&display=swap');

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  /* Core Palette */
  --indigo-900: #1a1040;
  --indigo-800: #231454;
  --indigo-700: #2e1a6e;
  --indigo-600: #3d22a0;
  --indigo-500: #4f30c8;
  --indigo-400: #6b4fe0;
  --indigo-300: #9a82ef;
  --indigo-100: #ede9ff;
  --indigo-50:  #f5f3ff;

  --emerald-600: #059669;
  --emerald-500: #10b981;
  --emerald-400: #34d399;
  --emerald-100: #d1fae5;

  --gold-600: #d97706;
  --gold-500: #f59e0b;
  --gold-400: #fbbf24;
  --gold-100: #fef3c7;

  --rose-600: #e11d48;
  --rose-500: #f43f5e;
  --rose-100: #ffe4e6;

  --charcoal: #1a1a2e;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50:  #f8fafc;
  --white: #ffffff;

  /* Semantic */
  --primary: var(--indigo-500);
  --primary-dark: var(--indigo-700);
  --primary-light: var(--indigo-100);
  --secondary: var(--emerald-500);
  --accent: var(--gold-500);
  --danger: var(--rose-500);
  --text-primary: var(--charcoal);
  --text-secondary: var(--slate-600);
  --text-muted: var(--slate-400);
  --bg-primary: var(--white);
  --bg-secondary: var(--slate-50);
  --bg-tertiary: var(--slate-100);
  --border: var(--slate-200);
  --border-strong: var(--slate-300);

  /* Typography */
  --font-heading: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* Radii */
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 16px rgba(79,48,200,0.08), 0 1px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 28px rgba(79,48,200,0.12), 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 16px 48px rgba(79,48,200,0.16), 0 4px 16px rgba(0,0,0,0.10);
  --shadow-xl: 0 32px 80px rgba(79,48,200,0.20);
  --shadow-card: 0 2px 12px rgba(0,0,0,0.06), 0 0 1px rgba(0,0,0,0.08);

  /* Transitions */
  --transition: 220ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-index */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 500;
  --z-toast: 800;
  --z-nav: 300;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-secondary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.display-1 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
.display-2 { font-size: clamp(2rem, 5vw, 3.5rem); }
h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

.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-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.container-sm { max-width: 720px; }
.container-lg { max-width: 1400px; }

.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
.grid-3 { grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.grid-4 { grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* ============================================================
   PUBLIC NAVIGATION
   ============================================================ */
.public-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  padding: 0 var(--space-6);
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
}

.public-nav.scrolled {
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--indigo-600);
  letter-spacing: -0.04em;
}

.nav-logo .logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--indigo-500), var(--indigo-700));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-links a {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  color: var(--slate-700);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--indigo-600);
  background: var(--indigo-50);
}

.nav-links a.active {
  color: var(--indigo-600);
  background: var(--indigo-50);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 22px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-body);
  transition: var(--transition-spring);
  cursor: pointer;
  border: none;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.15);
  opacity: 0;
  transition: var(--transition);
}
.btn:hover::before { opacity: 1; }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--indigo-500), var(--indigo-700));
  color: white;
  box-shadow: 0 4px 16px rgba(79,48,200,0.35);
}
.btn-primary:hover {
  box-shadow: 0 8px 24px rgba(79,48,200,0.45);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--indigo-600);
  border: 2px solid var(--indigo-200);
}
.btn-secondary:hover {
  background: var(--indigo-50);
  border-color: var(--indigo-400);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--border-strong);
}
.btn-outline:hover { border-color: var(--indigo-400); color: var(--indigo-600); }

.btn-success {
  background: linear-gradient(135deg, var(--emerald-500), var(--emerald-600));
  color: white;
  box-shadow: 0 4px 16px rgba(16,185,129,0.3);
}
.btn-success:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(16,185,129,0.4); }

.btn-danger {
  background: linear-gradient(135deg, var(--rose-500), var(--rose-600));
  color: white;
  box-shadow: 0 4px 16px rgba(244,63,94,0.3);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  color: white;
  box-shadow: 0 4px 16px rgba(245,158,11,0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 16px;
}
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-tertiary); }

.btn-sm { padding: 7px 16px; font-size: 0.82rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-xl { padding: 18px 40px; font-size: 1.05rem; }
.btn-icon { padding: 10px; width: 40px; height: 40px; border-radius: var(--radius); }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--indigo-200);
}

.card-body { padding: var(--space-6); }
.card-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

/* Startup Card */
.startup-card {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: var(--transition-slow);
  display: flex;
  flex-direction: column;
}

.startup-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--indigo-200);
}

.startup-card-header {
  padding: var(--space-5);
  background: linear-gradient(135deg, var(--indigo-900), var(--indigo-700));
  position: relative;
  overflow: hidden;
}

.startup-card-header::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}

.startup-card-logo {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
  overflow: hidden;
}

.startup-card-body { padding: var(--space-5); flex: 1; }
.startup-card-footer { padding: var(--space-4) var(--space-5); border-top: 1px solid var(--border); }

/* Stat Card */
.stat-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-card .stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: var(--space-4);
}

.stat-card .stat-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: var(--space-1);
  font-weight: 500;
}

.stat-card .stat-change {
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: var(--space-2);
}
.stat-change.up { color: var(--emerald-500); }
.stat-change.down { color: var(--rose-500); }

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--slate-700);
  letter-spacing: 0.02em;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: var(--transition);
  outline: none;
  -webkit-appearance: none;
}

.form-input::placeholder { color: var(--slate-400); }

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--indigo-400);
  box-shadow: 0 0 0 3px rgba(79,48,200,0.12);
}

.form-input.error { border-color: var(--rose-500); box-shadow: 0 0 0 3px rgba(244,63,94,0.12); }

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

.input-group {
  position: relative;
}
.input-group .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate-400);
  font-size: 0.95rem;
  pointer-events: none;
}
.input-group .form-input { padding-left: 42px; }
.input-group .input-suffix {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate-500);
  font-size: 0.85rem;
  font-weight: 600;
  pointer-events: none;
}

.form-hint { font-size: 0.8rem; color: var(--text-muted); }
.form-error { font-size: 0.8rem; color: var(--rose-500); font-weight: 500; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.form-section {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.form-section-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.form-section-title i { color: var(--indigo-500); }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-primary { background: var(--indigo-100); color: var(--indigo-700); }
.badge-success { background: var(--emerald-100); color: var(--emerald-600); }
.badge-warning { background: var(--gold-100); color: var(--gold-600); }
.badge-danger  { background: var(--rose-100); color: var(--rose-600); }
.badge-neutral { background: var(--slate-100); color: var(--slate-600); }

.stage-badge {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stage-pre-seed { background: #fff3e0; color: #e65100; }
.stage-seed     { background: var(--indigo-100); color: var(--indigo-700); }
.stage-series-a { background: var(--emerald-100); color: var(--emerald-600); }
.stage-series-b { background: #e3f2fd; color: #1565c0; }
.stage-series-c { background: #f3e5f5; color: #6a1b9a; }
.stage-growth   { background: var(--gold-100); color: var(--gold-600); }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-container { margin: var(--space-3) 0; }
.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-2);
  font-size: 0.82rem;
}
.progress-track {
  height: 8px;
  background: var(--slate-100);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--indigo-500), var(--emerald-500));
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.progress-bar::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: -100%;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 2s infinite;
}
@keyframes shimmer {
  100% { left: 200%; }
}

/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */
.dashboard-wrapper {
  min-height: 100vh;
  background: var(--bg-secondary);
  padding-bottom: 80px; /* bottom nav height */
}

.dashboard-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  height: 64px;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  box-shadow: var(--shadow-sm);
}

.dashboard-logo {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--indigo-600);
  letter-spacing: -0.04em;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.dashboard-header-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.dashboard-content {
  padding-top: calc(64px + var(--space-6));
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  height: 72px;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: var(--space-2);
  color: var(--slate-400);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: var(--transition);
  border: none;
  background: none;
  cursor: pointer;
  position: relative;
  text-decoration: none;
}

.bottom-nav-item i {
  font-size: 1.2rem;
  transition: var(--transition);
}

.bottom-nav-item.active {
  color: var(--indigo-600);
}

.bottom-nav-item.active i {
  transform: translateY(-2px);
}

.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background: var(--indigo-500);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.bottom-nav-item:hover { color: var(--indigo-500); }

.nav-badge {
  position: absolute;
  top: 4px;
  left: 50%;
  margin-left: 6px;
  min-width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  background: var(--rose-500);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid white;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(26,16,64,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(20px);
  transition: var(--transition-spring);
}

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

.modal-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body { padding: var(--space-6); }
.modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-width: 300px;
  max-width: 400px;
  border-left: 4px solid var(--indigo-500);
  animation: slideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: all;
}
.toast.success { border-left-color: var(--emerald-500); }
.toast.error   { border-left-color: var(--rose-500); }
.toast.warning { border-left-color: var(--gold-500); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);   opacity: 1; }
}

@keyframes fadeOut {
  to { transform: translateX(120%); opacity: 0; }
}

.toast-icon { font-size: 1.1rem; margin-top: 1px; flex-shrink: 0; }
.toast.success .toast-icon { color: var(--emerald-500); }
.toast.error   .toast-icon { color: var(--rose-500); }
.toast.warning .toast-icon { color: var(--gold-500); }
.toast-info    .toast-icon { color: var(--indigo-500); }

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--indigo-900) 0%, var(--indigo-700) 50%, var(--indigo-800) 100%);
  position: relative;
  overflow: hidden;
  padding: var(--space-16) 0;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: 
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(79,48,200,0.4), transparent),
    radial-gradient(circle at 80% 80%, rgba(16,185,129,0.2), transparent 50%),
    radial-gradient(circle at 20% 20%, rgba(245,158,11,0.15), transparent 40%);
  pointer-events: none;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.hero-content { position: relative; z-index: 1; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-full);
  padding: 6px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: var(--space-6);
}

.hero h1 {
  color: white;
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-6);
}

.hero h1 .highlight {
  background: linear-gradient(135deg, var(--gold-400), var(--emerald-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.75);
  max-width: 520px;
  line-height: 1.7;
  margin-bottom: var(--space-10);
}

.hero-stats {
  display: flex;
  gap: var(--space-8);
  margin-top: var(--space-12);
  padding-top: var(--space-8);
  border-top: 1px solid rgba(255,255,255,0.12);
}

.hero-stat-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: white;
  letter-spacing: -0.03em;
}

.hero-stat-label {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.55);
  font-weight: 500;
  margin-top: 2px;
}

/* ============================================================
   SECTION STYLES
   ============================================================ */
.section { padding: var(--space-20) 0; }
.section-sm { padding: var(--space-12) 0; }

.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--indigo-600);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-3);
}
.section-eyebrow::before, .section-eyebrow::after {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--indigo-400);
  border-radius: var(--radius-full);
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  margin-bottom: var(--space-4);
  color: var(--text-primary);
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.table-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-primary);
}

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

th {
  padding: var(--space-3) var(--space-5);
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

td {
  padding: var(--space-4) var(--space-5);
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-secondary); }

/* ============================================================
   AVATAR
   ============================================================ */
.avatar {
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
}
.avatar-sm  { width: 32px; height: 32px; font-size: 0.8rem; }
.avatar-md  { width: 44px; height: 44px; font-size: 1rem; }
.avatar-lg  { width: 64px; height: 64px; font-size: 1.4rem; }
.avatar-xl  { width: 96px; height: 96px; font-size: 2rem; }

.avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--indigo-400), var(--indigo-600));
  color: white;
  font-weight: 700;
  font-family: var(--font-heading);
}

/* ============================================================
   MESSAGES UI
   ============================================================ */
.messages-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0;
  height: calc(100vh - 64px - 72px - 48px);
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.messages-sidebar {
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.messages-sidebar-header {
  padding: var(--space-5);
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  position: sticky;
  top: 0;
}

.message-thread-item {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}
.message-thread-item:hover { background: var(--indigo-50); }
.message-thread-item.active { background: var(--indigo-50); border-right: 3px solid var(--indigo-500); }
.message-thread-item.unread .thread-name { font-weight: 700; color: var(--text-primary); }

.chat-area {
  display: flex;
  flex-direction: column;
}

.chat-header {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.message-bubble {
  max-width: 68%;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  line-height: 1.5;
}

.message-bubble.sent {
  background: linear-gradient(135deg, var(--indigo-500), var(--indigo-600));
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: var(--radius-sm);
}

.message-bubble.received {
  background: var(--bg-secondary);
  color: var(--text-primary);
  align-self: flex-start;
  border: 1px solid var(--border);
  border-bottom-left-radius: var(--radius-sm);
}

.chat-input-area {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--space-3);
  align-items: flex-end;
  background: var(--bg-primary);
}

/* ============================================================
   NOTIFICATIONS
   ============================================================ */
.notification-item {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  transition: var(--transition);
  cursor: pointer;
}
.notification-item:hover { background: var(--bg-secondary); }
.notification-item.unread { background: var(--indigo-50); }
.notification-item.unread::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--indigo-500);
}
.notification-item { position: relative; }

/* ============================================================
   PAGE TRANSITIONS
   ============================================================ */
.page-enter {
  animation: pageEnter 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes pageEnter {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.stagger-enter > * {
  animation: staggerIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.stagger-enter > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-enter > *:nth-child(2) { animation-delay: 0.10s; }
.stagger-enter > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-enter > *:nth-child(4) { animation-delay: 0.20s; }
.stagger-enter > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-enter > *:nth-child(6) { animation-delay: 0.30s; }

@keyframes staggerIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   MISC UTILITIES
   ============================================================ */
.divider { height: 1px; background: var(--border); margin: var(--space-5) 0; }
.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }
.overflow-hidden { overflow: hidden; }
.w-full { width: 100%; }

.page-title-bar {
  margin-bottom: var(--space-6);
}
.page-title-bar h1 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.page-title-bar p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: var(--space-1);
}

.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-6);
  color: var(--text-muted);
}
.empty-state i {
  font-size: 3rem;
  margin-bottom: var(--space-4);
  opacity: 0.4;
}
.empty-state h3 {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   FOOTER
   ============================================================ */
.public-footer {
  background: var(--indigo-900);
  color: rgba(255,255,255,0.7);
  padding: var(--space-16) 0 var(--space-8);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-12);
  margin-bottom: var(--space-12);
}

.footer-brand p {
  font-size: 0.9rem;
  line-height: 1.7;
  margin-top: var(--space-4);
  max-width: 300px;
  color: rgba(255,255,255,0.55);
}

.footer-links h5 {
  color: white;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-4);
}

.footer-links a {
  display: block;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.55);
  padding: 4px 0;
  transition: var(--transition);
}
.footer-links a:hover { color: rgba(255,255,255,0.9); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.83rem;
  color: rgba(255,255,255,0.4);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-8); }
  .messages-layout { grid-template-columns: 1fr; }
  .messages-sidebar { display: none; }
  .hero-stats { gap: var(--space-6); }
  .hero h1 { font-size: 2.5rem; }
  .dashboard-content { padding-left: var(--space-4); padding-right: var(--space-4); }
  .container { padding: 0 var(--space-4); }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .bottom-nav-item span { display: none; }
  .bottom-nav { height: 60px; }
  .dashboard-wrapper { padding-bottom: 60px; }
}
