/* ══════════════════════════════════════════════════════════════
   MyCampaignPro Design System v4.0 — "Signal"
   Font: Rubik (single family, 400–900)
   Brand: Teal #05A9DC · Red #D80D35 · Navy #211D3E
   Bold. Bright. Unmistakable.
   ══════════════════════════════════════════════════════════════ */

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


/* ═══════════════════════════════════
   VARIABLES
   ═══════════════════════════════════ */

:root {
  /* ── Brand (extracted from logo) ── */
  --brand-teal: #05A9DC;
  --brand-teal-dark: #0490BE;
  --brand-teal-light: #E0F5FC;
  --brand-teal-mid: #6ECFEE;
  --brand-red: #D80D35;
  --brand-red-dark: #B80A2D;
  --brand-red-light: #FDEAEF;
  --brand-navy: #211D3E;
  --brand-navy-light: #3D3760;

  /* ── Semantic Data ── */
  --cash: #5B5FC7;
  --cash-light: #EDEDFA;
  --cash-mid: #8B8EDB;
  --raised: #00A86B;
  --raised-light: #E0F7EE;
  --raised-dark: #008A57;
  --spent: #E8590C;
  --spent-light: #FFF0E8;
  --spent-dark: #C44A0A;

  /* ── Party Colors ── */
  --republican: #E02020;
  --republican-light: #FDEAEA;
  --democrat: #2563EB;
  --democrat-light: #EBF0FD;
  --libertarian: #F59E0B;
  --libertarian-light: #FEF5E0;
  --nonpartisan: #64748B;

  /* ── Neutral Scale (high contrast) ── */
  --ink: #0A0A0B;
  --ink-secondary: #3A3A3F;
  --ink-tertiary: #6B6B73;
  --ink-muted: #9B9BA3;
  --surface: #FFFFFF;
  --surface-alt: #FAFAFA;
  --surface-inset: #F0F0F3;
  --border: #D4D4DB;
  --border-light: #EAEAEF;
  --border-bold: #0A0A0B;

  /* ── Status ── */
  --success: #00A86B;
  --success-light: #E0F7EE;
  --warning: #F59E0B;
  --warning-light: #FEF5E0;
  --danger: #E02020;
  --danger-light: #FDEAEA;
  --info: #5B5FC7;
  --info-light: #EDEDFA;

  /* ── Shadows (navy-tinted) ── */
  --shadow-sm: 0 1px 2px rgba(33,29,62,0.05);
  --shadow-md: 0 4px 12px rgba(33,29,62,0.07), 0 1px 3px rgba(33,29,62,0.04);
  --shadow-lg: 0 12px 40px rgba(33,29,62,0.10), 0 2px 6px rgba(33,29,62,0.03);
  --shadow-teal: 0 4px 20px rgba(5,169,220,0.18);

  /* ── Radii ── */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius: 14px;
  --radius-pill: 100px;
  --radius-bar: 100px;

  /* ── Font ── */
  --font: 'Rubik', -apple-system, BlinkMacSystemFont, sans-serif;

  /* ── Motion ── */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
}


/* ═══════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════ */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--surface);
  letter-spacing: -0.01em;
}


/* ═══════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════ */

h1, .h1 {
  font-family: var(--font);
  font-weight: 900;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--ink);
}

h2, .h2 {
  font-family: var(--font);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
}

h3, .h3 {
  font-family: var(--font);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--ink);
}

h4, .h4 {
  font-family: var(--font);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink);
}

.text-secondary { color: var(--ink-secondary); }
.text-muted { color: var(--ink-muted); }

/* Tabular numbers — use on any element displaying data */
.num, .data, [data-num] {
  font-variant-numeric: tabular-nums;
}

/* Label/badge text */
.label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}


/* ═══════════════════════════════════
   LAYOUT
   ═══════════════════════════════════ */

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px;
}

@media (max-width: 600px) {
  .container { padding: 20px 16px; }
}


/* ═══════════════════════════════════
   NAVIGATION — Dark Navy
   ═══════════════════════════════════ */

.site-nav {
  background: var(--brand-navy);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.site-nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 32px;
  height: 56px;
}

.site-nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.site-nav-logo img {
  height: 30px;
  width: auto;
}

.site-nav-brand-text {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: white;
}

.site-nav-brand-text span {
  color: var(--brand-teal);
}

.site-nav-links {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  list-style: none;
}

.site-nav-links::-webkit-scrollbar { display: none; }

.site-nav-link {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: all var(--duration-fast) var(--ease-out);
}

.site-nav-link:hover {
  background: rgba(255,255,255,0.08);
  color: white;
}

.site-nav-link.active {
  background: var(--brand-teal);
  color: white;
  font-weight: 600;
}

.site-nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.45);
}

.site-nav-right .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--raised);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}


/* ═══════════════════════════════════
   CARDS
   ═══════════════════════════════════ */

.card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 24px;
  transition: transform var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}

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

/* Card with accent top bar */
.card-accent {
  border-top: 3px solid var(--brand-teal);
}

.card-accent--red { border-top-color: var(--brand-red); }
.card-accent--cash { border-top-color: var(--cash); }
.card-accent--raised { border-top-color: var(--raised); }
.card-accent--spent { border-top-color: var(--spent); }

/* Card with left accent bar (finance style) */
.card-left-accent {
  border-left: 4px solid var(--cash);
  border-top: none;
}

.card-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 4px;
}

.card-subtitle {
  font-size: 13px;
  color: var(--ink-muted);
}


/* ═══════════════════════════════════
   STAT DISPLAYS
   ═══════════════════════════════════ */

.stat-value {
  font-family: var(--font);
  font-weight: 700;
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-top: 4px;
}


/* ═══════════════════════════════════
   TABLES
   ═══════════════════════════════════ */

.table-header th,
th {
  font-family: var(--font);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-secondary);
  padding: 10px 12px;
  text-align: left;
  border-bottom: 2px solid var(--border-bold);
  white-space: nowrap;
}

td {
  font-family: var(--font);
  font-size: 14px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--ink);
}

/* Numeric table cells */
td.num, td[data-num] {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

tr:hover td {
  background: var(--surface-alt);
}


/* ═══════════════════════════════════
   BADGES & PILLS
   ═══════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge--teal {
  background: var(--brand-teal-light);
  color: var(--brand-teal-dark);
}

.badge--red {
  background: var(--brand-red-light);
  color: var(--brand-red-dark);
}

.badge--success {
  background: var(--success-light);
  color: var(--raised-dark);
}

.badge--warning {
  background: var(--warning-light);
  color: #92400E;
}

.badge--danger {
  background: var(--danger-light);
  color: #991B1B;
}

.badge--cash {
  background: var(--cash-light);
  color: var(--cash);
}

.badge--rep {
  background: var(--republican-light);
  color: var(--republican);
}

.badge--dem {
  background: var(--democrat-light);
  color: var(--democrat);
}

.badge--lib {
  background: var(--libertarian-light);
  color: #92400E;
}

.badge--muted {
  background: var(--surface-inset);
  color: var(--ink-tertiary);
}


/* ═══════════════════════════════════
   BUTTONS
   ═══════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}

.btn:active { opacity: 0.8; }

.btn--primary {
  background: var(--brand-teal);
  color: white;
}

.btn--primary:hover {
  background: var(--brand-teal-dark);
}

.btn--red {
  background: var(--brand-red);
  color: white;
}

.btn--red:hover {
  background: var(--brand-red-dark);
}

.btn--navy {
  background: var(--brand-navy);
  color: white;
}

.btn--navy:hover {
  background: var(--brand-navy-light);
}

.btn--outline {
  background: var(--surface);
  color: var(--ink-secondary);
  border: 1px solid var(--border);
}

.btn--outline:hover {
  border-color: var(--brand-teal);
  color: var(--brand-teal);
}

.btn--ghost {
  background: none;
  color: var(--ink-secondary);
}

.btn--ghost:hover {
  background: var(--surface-inset);
}

.btn--sm {
  padding: 6px 14px;
  font-size: 12px;
}

.btn--pill {
  border-radius: var(--radius-pill);
}


/* ═══════════════════════════════════
   SEGMENTED CONTROLS
   ═══════════════════════════════════ */

.segmented {
  display: inline-flex;
  gap: 2px;
  background: var(--surface-inset);
  border-radius: var(--radius-md);
  padding: 3px;
}

.segmented--dark {
  background: var(--brand-navy-light);
}

.segmented__btn {
  padding: 7px 14px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  border: none;
  background: none;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  border-radius: 8px;
  white-space: nowrap;
}

.segmented__btn:active { opacity: 0.7; }

.segmented__btn.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

/* Teal active chip (for dark trays / nav) */
.segmented--dark .segmented__btn {
  color: rgba(255,255,255,0.45);
}

.segmented--dark .segmented__btn.active {
  background: var(--brand-teal);
  color: #fff;
  box-shadow: none;
}


/* ═══════════════════════════════════
   PROGRESS BARS
   ═══════════════════════════════════ */

.bar-track {
  width: 100%;
  height: 8px;
  background: var(--surface-inset);
  border-radius: var(--radius-bar);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: var(--radius-bar);
  transition: width 0.4s var(--ease-out);
}

.bar-fill--teal { background: var(--brand-teal); }
.bar-fill--red { background: var(--brand-red); }
.bar-fill--rep { background: var(--republican); }
.bar-fill--dem { background: var(--democrat); }
.bar-fill--lib { background: var(--libertarian); }
.bar-fill--raised { background: var(--raised); }
.bar-fill--spent { background: var(--spent); }
.bar-fill--cash { background: var(--cash); }


/* ═══════════════════════════════════
   TOASTS
   ═══════════════════════════════════ */

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--brand-navy);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  z-index: 9999;
  transition: transform var(--duration-slow) var(--ease-out);
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast--error { background: var(--danger); }
.toast--success { background: var(--success); }


/* ═══════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════ */

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

.fade-up {
  animation: fadeUp var(--duration-slow) var(--ease-out) both;
}

/* Stagger children: add delay increments via inline style or nth-child */
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 50ms; }
.stagger > *:nth-child(3) { animation-delay: 100ms; }
.stagger > *:nth-child(4) { animation-delay: 150ms; }
.stagger > *:nth-child(5) { animation-delay: 200ms; }
.stagger > *:nth-child(6) { animation-delay: 250ms; }


/* ═══════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════ */

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* ═══════════════════════════════════
   MOBILE
   ═══════════════════════════════════ */

@media (max-width: 600px) {
  h1, .h1 { font-size: 24px; }
  h2, .h2 { font-size: 18px; }
  h3, .h3 { font-size: 16px; }

  .site-nav { padding: 0 12px; }
  .site-nav-inner { gap: 8px; height: 48px; }
  .site-nav-logo img { height: 24px; }
  .site-nav-link { font-size: 12px; padding: 5px 10px; }

  .card { padding: 16px; }
}
