/* ============================================
   TINUBU SUPPORT NETWORK — KANO ORGANOGRAM
   Color palette: Kano State flag-inspired
   Green = APC identity, Gold = leadership, 
   Dark navy = authority, White = clarity
   ============================================ */

:root,
[data-theme='light'] {
  --color-bg: #f4f6f9;
  --color-surface: #ffffff;
  --color-surface-2: #f8fafc;
  --color-surface-offset: #eef1f6;
  --color-surface-dynamic: #e3e8f0;
  --color-divider: #dde2ec;
  --color-border: #c8d0e0;

  --color-text: #0f1923;
  --color-text-muted: #5a6882;
  --color-text-faint: #9aa3b5;
  --color-text-inverse: #ffffff;

  /* APC Green — primary accent */
  --color-primary: #006338;
  --color-primary-hover: #004e2c;
  --color-primary-active: #003820;
  --color-primary-highlight: #d0eadb;
  --color-primary-light: #e8f5ee;

  /* Gold — leadership accent */
  --color-gold: #c9900a;
  --color-gold-light: #fff3d0;

  /* Senatorial zone colors */
  --color-central: #006494;
  --color-north: #437a22;
  --color-south: #964219;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(15,25,35,0.08);
  --shadow-md: 0 4px 16px rgba(15,25,35,0.10);
  --shadow-lg: 0 12px 40px rgba(15,25,35,0.14);

  --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --text-xs: clamp(0.7rem, 0.65rem + 0.2vw, 0.8rem);
  --text-sm: clamp(0.8rem, 0.75rem + 0.25vw, 0.9rem);
  --text-base: clamp(0.9rem, 0.85rem + 0.25vw, 1rem);
  --text-lg: clamp(1rem, 0.9rem + 0.5vw, 1.25rem);
  --text-xl: clamp(1.3rem, 1rem + 1vw, 1.75rem);
  --text-2xl: clamp(1.8rem, 1.2rem + 2vw, 2.5rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  --header-h: 60px;
  --stats-h: 52px;
  --content-max: 1280px;
}

[data-theme='dark'] {
  --color-bg: #0b0f16;
  --color-surface: #131922;
  --color-surface-2: #182130;
  --color-surface-offset: #1a2538;
  --color-surface-dynamic: #1f2d42;
  --color-divider: #243347;
  --color-border: #2e3f58;
  --color-text: #d8e4f0;
  --color-text-muted: #7a93b0;
  --color-text-faint: #3f5470;
  --color-text-inverse: #0b0f16;
  --color-primary: #00a85a;
  --color-primary-hover: #009050;
  --color-primary-active: #007840;
  --color-primary-highlight: #0f2e1e;
  --color-primary-light: #0a1f14;
  --color-gold: #f0a823;
  --color-gold-light: #2a1f00;
  --color-central: #4fa0d0;
  --color-north: #7dca5a;
  --color-south: #d47840;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0b0f16;
    --color-surface: #131922;
    --color-surface-2: #182130;
    --color-surface-offset: #1a2538;
    --color-surface-dynamic: #1f2d42;
    --color-divider: #243347;
    --color-border: #2e3f58;
    --color-text: #d8e4f0;
    --color-text-muted: #7a93b0;
    --color-text-faint: #3f5470;
    --color-text-inverse: #0b0f16;
    --color-primary: #00a85a;
    --color-primary-hover: #009050;
    --color-primary-active: #007840;
    --color-primary-highlight: #0f2e1e;
    --color-primary-light: #0a1f14;
    --color-gold: #f0a823;
    --color-gold-light: #2a1f00;
    --color-central: #4fa0d0;
    --color-north: #7dca5a;
    --color-south: #d47840;
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100dvh;
  line-height: 1.6;
}
button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
h1,h2,h3,h4 { line-height: 1.2; text-wrap: balance; }

/* ============================================
   HEADER
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-divider);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  height: 100%;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.logo-lockup {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}
.logo-svg { width: 36px; height: 36px; flex-shrink: 0; }
.logo-text { display: flex; flex-direction: column; gap: 1px; }
.logo-name {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
  line-height: 1;
}
.logo-sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1;
}
.header-nav {
  display: flex;
  gap: var(--space-1);
  margin-left: auto;
}
.nav-btn {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  transition: all var(--transition);
}
.nav-btn:hover { color: var(--color-text); background: var(--color-surface-offset); }
.nav-btn.active {
  background: var(--color-primary);
  color: white;
}
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: all var(--transition);
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--color-surface-offset); color: var(--color-text); }

/* ============================================
   STATS BAR
   ============================================ */
.stats-bar {
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-divider);
}
.stats-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-3) var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-6);
  overflow-x: auto;
  scrollbar-width: none;
}
.stats-inner::-webkit-scrollbar { display: none; }
.stat-chip { display: flex; flex-direction: column; align-items: center; gap: 2px; flex-shrink: 0; }
.stat-num {
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--color-text);
  line-height: 1;
  letter-spacing: -0.03em;
}
.stat-num.accent { color: var(--color-primary); }
.stat-label { font-size: var(--text-xs); color: var(--color-text-muted); font-weight: 500; }
.stat-divider { width: 1px; height: 28px; background: var(--color-divider); flex-shrink: 0; }

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-6);
}
.view { display: none; }
.view.active { display: block; }
.hidden { display: none !important; }

/* ============================================
   BREADCRUMB & SEARCH
   ============================================ */
.breadcrumb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
  gap: var(--space-3);
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.crumb {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  transition: all var(--transition);
  border: 1px solid transparent;
}
.crumb:hover { color: var(--color-text); background: var(--color-surface-offset); }
.crumb.active { color: var(--color-primary); font-weight: 600; background: var(--color-primary-light); border-color: var(--color-primary-highlight); }
.crumb-sep { color: var(--color-text-faint); font-size: var(--text-xs); }
.search-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-4);
  min-width: 220px;
}
.search-wrap svg { color: var(--color-text-muted); flex-shrink: 0; }
.search-input {
  border: none;
  background: none;
  outline: none;
  font-size: var(--text-sm);
  color: var(--color-text);
  width: 100%;
}
.search-input::placeholder { color: var(--color-text-faint); }

/* ============================================
   APEX CARD
   ============================================ */
.org-apex {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-2);
}
.apex-card {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-active));
  color: white;
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-10);
  max-width: 680px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.apex-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}
.apex-card::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -30px;
  width: 250px; height: 250px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}
.apex-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.35);
  color: white;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
}
.apex-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  margin-bottom: var(--space-2);
}
.apex-sub {
  font-size: var(--text-sm);
  opacity: 0.8;
  margin-bottom: var(--space-6);
}
.apex-roles {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
  margin-bottom: var(--space-4);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}
.apex-roles.open { max-height: 500px; }
.apex-role-pill {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: white;
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.expand-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-full);
  transition: all var(--transition);
}
.expand-btn:hover { background: rgba(255,255,255,0.25); }

/* Connector lines */
.connector-line-v {
  width: 2px;
  height: 40px;
  background: linear-gradient(to bottom, var(--color-primary), var(--color-divider));
  margin: 0 auto;
}

/* ============================================
   SENATORIAL ZONES
   ============================================ */
.senatorial-row { text-align: center; margin-bottom: var(--space-2); }
.senatorial-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}
.senatorial-zones {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.senatorial-card {
  background: var(--color-surface);
  border: 2px solid;
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-6);
  text-align: center;
  min-width: 160px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.senatorial-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.sen-name { font-size: var(--text-sm); font-weight: 700; }
.sen-count { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: var(--space-1); }

/* ============================================
   LGA GRID
   ============================================ */
.lga-section { margin-top: var(--space-6); }
.section-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  text-transform: uppercase;
  margin-bottom: var(--space-4);
  text-align: center;
}
.lga-filter-row {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}
.filter-btn {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  transition: all var(--transition);
}
.filter-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.filter-btn.active { background: var(--color-primary); color: white; border-color: var(--color-primary); }
.lga-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
}
.lga-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.lga-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
}
.lga-card.central::before { background: var(--color-central); }
.lga-card.north::before { background: var(--color-north); }
.lga-card.south::before { background: var(--color-south); }
.lga-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.lga-card-name {
  font-size: var(--text-sm);
  font-weight: 700;
  margin-bottom: var(--space-2);
  color: var(--color-text);
}
.lga-card-stats {
  display: flex;
  gap: var(--space-4);
}
.lga-stat { display: flex; flex-direction: column; gap: 1px; }
.lga-stat-num { font-size: var(--text-sm); font-weight: 700; color: var(--color-primary); }
.lga-stat-label { font-size: var(--text-xs); color: var(--color-text-muted); }
.lga-zone-tag {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-2);
  color: white;
}
.lga-zone-tag.central { background: var(--color-central); }
.lga-zone-tag.north { background: var(--color-north); }
.lga-zone-tag.south { background: var(--color-south); }

.lga-card.filtered-out {
  opacity: 0;
  pointer-events: none;
  height: 0;
  padding: 0;
  margin: 0;
  border: none;
  overflow: hidden;
}

/* ============================================
   LGA DETAIL VIEW
   ============================================ */
.level-header {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6) var(--space-8);
  margin-bottom: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}
.level-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
}
.level-meta { display: flex; gap: var(--space-5); flex-wrap: wrap; }
.meta-item { display: flex; flex-direction: column; gap: 2px; }
.meta-num { font-size: var(--text-lg); font-weight: 800; color: var(--color-primary); letter-spacing: -0.02em; }
.meta-label { font-size: var(--text-xs); color: var(--color-text-muted); font-weight: 500; }

/* LGA org chart */
.lga-org-chart {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}
.lga-coord-box {
  background: var(--color-primary);
  color: white;
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-6);
  text-align: center;
  max-width: 360px;
  margin: 0 auto var(--space-4);
}
.lga-coord-title { font-size: var(--text-sm); font-weight: 700; }
.lga-coord-sub { font-size: var(--text-xs); opacity: 0.8; margin-top: var(--space-1); }
.lga-sub-roles {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--space-4);
}
.sub-role-card {
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  text-align: center;
  min-width: 140px;
}
.sub-role-title { font-size: var(--text-xs); font-weight: 600; color: var(--color-text); }
.sub-role-sub { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; }

/* Ward grid */
.ward-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-3);
}
.ward-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  transition: all var(--transition);
}
.ward-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.ward-name { font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--space-2); }
.ward-pu-count {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.ward-pu-count span { color: var(--color-primary); font-weight: 700; }

/* ============================================
   WARD DETAIL VIEW
   ============================================ */
.ward-org-chart {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}
.ward-lead-box {
  background: var(--color-gold);
  color: white;
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-6);
  text-align: center;
  max-width: 300px;
  margin: 0 auto var(--space-4);
}
.ward-lead-title { font-size: var(--text-sm); font-weight: 700; }
.ward-deputies {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--space-4);
}
.deputy-card {
  background: var(--color-gold-light);
  border: 1px solid var(--color-gold);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  text-align: center;
  min-width: 130px;
}
.deputy-title { font-size: var(--text-xs); font-weight: 600; color: var(--color-gold); }

/* PU grid */
.pu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-2);
}
.pu-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.pu-card:hover { border-color: var(--color-gold); box-shadow: var(--shadow-sm); }
.pu-num { font-size: var(--text-xs); color: var(--color-text-faint); font-weight: 600; }
.pu-name { font-size: var(--text-xs); font-weight: 600; color: var(--color-text); }
.pu-agents { font-size: var(--text-xs); color: var(--color-text-muted); }

/* ============================================
   PU DETAIL VIEW
   ============================================ */
.pu-detail {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  max-width: 600px;
  margin: 0 auto;
}
.pu-role-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-divider);
}
.pu-role-row:last-child { border-bottom: none; }
.pu-role-name { font-size: var(--text-sm); font-weight: 600; }
.pu-role-desc { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; }
.pu-role-count {
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: 700;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

/* ============================================
   MISSION & STRUCTURE VIEWS
   ============================================ */
.content-section { max-width: 900px; margin: 0 auto; }
.section-hero { text-align: center; margin-bottom: var(--space-12); }
.section-eyebrow {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: var(--color-primary-light);
  border: 1px solid var(--color-primary-highlight);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
}
.section-heading {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  margin-bottom: var(--space-5);
}
.section-body {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 70ch;
  margin: 0 auto;
  line-height: 1.8;
}
.section-body em { font-style: italic; color: var(--color-text); }

.principles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-12);
}
.principle-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: all var(--transition);
}
.principle-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.principle-icon { font-size: 1.8rem; margin-bottom: var(--space-3); }
.principle-card h3 { font-size: var(--text-sm); font-weight: 700; margin-bottom: var(--space-2); }
.principle-card p { font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.7; }

.hierarchy-explainer {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
}
.hierarchy-explainer h3 { font-size: var(--text-lg); font-weight: 700; margin-bottom: var(--space-6); }
.hierarchy-steps { display: flex; flex-direction: column; gap: var(--space-6); }
.h-step { display: flex; gap: var(--space-5); align-items: flex-start; }
.h-step-num {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--color-primary);
  opacity: 0.3;
  line-height: 1;
  flex-shrink: 0;
  min-width: 32px;
}
.h-step-content strong { font-size: var(--text-sm); font-weight: 700; display: block; margin-bottom: var(--space-2); }
.h-step-content p { font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.7; }

/* Helps grid */
.helps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-12);
}
.help-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: all var(--transition);
}
.help-card:hover { box-shadow: var(--shadow-md); border-color: var(--color-primary); transform: translateY(-2px); }
.help-icon { font-size: 1.6rem; margin-bottom: var(--space-3); }
.help-card h3 { font-size: var(--text-sm); font-weight: 700; margin-bottom: var(--space-2); }
.help-card p { font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.7; }

/* Relationship diagram */
.relationship-diagram {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
}
.relationship-diagram h3 { font-size: var(--text-lg); font-weight: 700; margin-bottom: var(--space-6); }
.rel-diagram {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-4);
  align-items: center;
  margin-bottom: var(--space-5);
}
.rel-box {
  background: var(--color-surface-offset);
  border: 2px solid;
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}
.rel-box.tsn { border-color: var(--color-primary); }
.rel-box.apc { border-color: var(--color-gold); }
.rel-box strong { font-size: var(--text-sm); font-weight: 700; display: block; margin-bottom: var(--space-3); }
.rel-box ul { list-style: none; display: flex; flex-direction: column; gap: var(--space-2); }
.rel-box li { font-size: var(--text-xs); color: var(--color-text-muted); padding-left: var(--space-4); position: relative; }
.rel-box li::before { content: '•'; position: absolute; left: 0; color: var(--color-primary); }
.rel-box.apc li::before { color: var(--color-gold); }
.rel-arrows { display: flex; flex-direction: column; gap: var(--space-3); align-items: center; }
.rel-arrow {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
  text-align: center;
  max-width: 160px;
}
.rel-note {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-style: italic;
  text-align: center;
  border-top: 1px solid var(--color-divider);
  padding-top: var(--space-4);
  margin-top: var(--space-4);
  max-width: 100%;
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  backdrop-filter: blur(4px);
}
.modal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  max-width: 540px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
}
.modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--color-surface-offset);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--color-surface-dynamic); color: var(--color-text); }
.modal-title { font-size: var(--text-lg); font-weight: 700; margin-bottom: var(--space-2); }
.modal-badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 2px var(--space-3);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-5);
  color: white;
}
.modal-stat-row {
  display: flex;
  gap: var(--space-6);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-divider);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}
.m-stat { display: flex; flex-direction: column; gap: 2px; }
.m-stat-num { font-size: var(--text-xl); font-weight: 800; color: var(--color-primary); letter-spacing: -0.03em; }
.m-stat-label { font-size: var(--text-xs); color: var(--color-text-muted); }
.modal-roles-title { font-size: var(--text-sm); font-weight: 700; margin-bottom: var(--space-3); }
.modal-roles { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-5); }
.modal-role-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-offset);
  border-radius: var(--radius-md);
}
.role-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-primary); flex-shrink: 0; }
.modal-role-text { font-size: var(--text-sm); font-weight: 500; }
.modal-cta {
  background: var(--color-primary);
  color: white;
  width: 100%;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  text-align: center;
  transition: all var(--transition);
}
.modal-cta:hover { background: var(--color-primary-hover); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .header-inner { padding: 0 var(--space-4); gap: var(--space-3); }
  .logo-sub { display: none; }
  .nav-btn { padding: var(--space-2) var(--space-3); font-size: var(--text-xs); }
  .main-content { padding: var(--space-4); }
  .apex-card { padding: var(--space-6); }
  .apex-title { font-size: var(--text-xl); }
  .rel-diagram { grid-template-columns: 1fr; }
  .rel-arrows { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: var(--space-2); }
  .rel-arrow { font-size: var(--text-xs); max-width: none; }
  .lga-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* ============================================
   WARD LEADERS
   ============================================ */
.ward-leaders-section {
  margin-bottom: var(--space-6);
}

.ward-leaders-heading {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border);
}

.ward-leaders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
}

.leader-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  transition: border-color var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

.leader-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-south);
  opacity: 0.6;
}

/* Different accent per role */
.leader-card:nth-child(1)::before { background: var(--color-south); opacity: 1; }
.leader-card:nth-child(2)::before { background: var(--color-gold); opacity: 0.85; }
.leader-card:nth-child(n+3)::before { background: var(--color-text-muted); opacity: 0.5; }

.leader-card:hover {
  border-color: var(--color-primary-highlight);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.leader-role-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 100px;
  margin-bottom: var(--space-2);
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.leader-card:nth-child(2) .leader-role-badge {
  background: rgba(var(--color-gold-rgb, 201,163,79), 0.15);
  color: var(--color-gold);
}

.leader-card:nth-child(n+3) .leader-role-badge {
  background: var(--color-surface);
  color: var(--color-text-muted);
}

.leader-name {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-2);
  line-height: 1.3;
}

.leader-phone {
  display: block;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.leader-phone:hover { text-decoration: underline; }

.leader-phone.no-phone {
  color: var(--color-text-muted);
  font-style: italic;
}

@media (max-width: 768px) {
  .ward-leaders-grid { grid-template-columns: 1fr 1fr; }
}

/* Ward Lead Box — named person */
.ward-lead-name {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
  margin-top: var(--space-2);
}
.ward-lead-phone {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;
  margin-top: var(--space-1);
}
.ward-lead-phone:hover { text-decoration: underline; }

/* Named deputy cards */
.deputy-card.named-deputy {
  border-color: var(--color-primary-highlight);
}
.deputy-name {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text);
  margin-top: var(--space-2);
  line-height: 1.3;
}
.deputy-phone {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;
  margin-top: 2px;
}
.deputy-phone:hover { text-decoration: underline; }

.ward-extra-leaders {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

/* ============================================
   ELECTION RESULTS MODULE
   ============================================ */
.results-container {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--space-4) var(--space-4) var(--space-8);
}

/* Breadcrumb */
.res-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}
.res-crumb {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color var(--transition);
}
.res-crumb:hover { color: var(--color-primary); }
.res-crumb.active {
  color: var(--color-text);
  cursor: default;
  font-weight: 700;
}
.res-sep {
  color: var(--color-text-muted);
  opacity: 0.5;
  font-size: var(--text-sm);
}

/* Summary card */
.res-summary-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-6);
}
.res-summary-header h3 {
  font-family: 'Instrument Serif', serif;
  font-size: var(--text-2xl);
  color: var(--color-text);
  margin: 0 0 var(--space-2);
}
.res-reporting {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}
.res-total-votes {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}
.res-winner-badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  color: white;
  padding: 3px 12px;
  border-radius: 100px;
  margin-top: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.res-bars {
  margin-top: var(--space-4);
}
.res-no-data {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-style: italic;
  padding: var(--space-4) 0;
}

/* Party rows */
.res-party-row {
  display: grid;
  grid-template-columns: 140px 1fr 50px;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}
.res-party-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.res-party-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.res-party-name {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  min-width: 40px;
}
.res-party-votes {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}
.res-bar-wrap {
  height: 20px;
  background: var(--color-surface);
  border-radius: 10px;
  overflow: hidden;
}
.res-bar {
  height: 100%;
  border-radius: 10px;
  transition: width 0.6s ease;
  min-width: 2px;
}
.res-pct {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Section labels */
.res-section-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

/* Zone cards */
.res-zone-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.res-zone-card {
  background: var(--color-surface-2);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition);
  text-align: center;
}
.res-zone-card:hover {
  transform: translateY(-2px);
}
.res-zone-central { border-color: var(--color-central); }
.res-zone-central:hover { border-color: var(--color-central); background: rgba(0,100,148,0.05); }
.res-zone-north { border-color: var(--color-north); }
.res-zone-north:hover { border-color: var(--color-north); background: rgba(67,122,34,0.05); }
.res-zone-south { border-color: var(--color-south); }
.res-zone-south:hover { border-color: var(--color-south); background: rgba(150,66,25,0.05); }

.res-zone-name {
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--color-text);
  margin-bottom: var(--space-1);
}
.res-zone-stat {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.res-zone-votes {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-top: var(--space-1);
}
.res-zone-leader {
  font-size: var(--text-xs);
  font-weight: 700;
  margin-top: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* LGA / Ward grids */
.res-lga-grid, .res-ward-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.res-lga-card, .res-ward-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  position: relative;
}
.res-lga-card:hover, .res-ward-card:hover {
  border-color: var(--color-primary-highlight);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.res-lga-name, .res-ward-name {
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--color-text);
  margin-bottom: 2px;
}
.res-lga-stat, .res-ward-stat {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.res-lga-votes, .res-ward-votes {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text);
  margin-top: 2px;
}
.res-lga-votes.dim, .res-ward-votes.dim { color: var(--color-text-muted); }
.res-mini-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  color: white;
  padding: 1px 7px;
  border-radius: 100px;
  margin-top: var(--space-2);
  letter-spacing: 0.05em;
}

/* PU grid */
.res-pu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.res-pu-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.res-pu-card:hover {
  border-color: var(--color-primary-highlight);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.res-pu-card.filled {
  border-left: 3px solid var(--color-primary);
}
.res-pu-num {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.res-pu-name {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text);
  margin: 2px 0;
  line-height: 1.3;
}
.res-pu-status {
  font-size: 11px;
  margin-top: var(--space-1);
}
.res-pu-status.done {
  color: var(--color-primary);
  font-weight: 600;
}
.res-pu-status.pending {
  color: var(--color-text-muted);
  font-style: italic;
}

/* PU Entry Form */
.res-form-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  max-width: 480px;
  margin: 0 auto;
}
.res-form-title {
  font-family: 'Instrument Serif', serif;
  font-size: var(--text-xl);
  color: var(--color-text);
  margin: 0 0 var(--space-1);
}
.res-form-pu {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 2px;
}
.res-form-location {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
}
.res-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.res-input-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.res-input-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  min-width: 80px;
}
.res-input {
  width: 120px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--text-base);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  transition: border-color var(--transition);
}
.res-input:focus {
  outline: none;
  border-color: var(--color-primary);
}
.res-form-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
  flex-wrap: wrap;
}
.res-save-btn {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
  transition: opacity var(--transition);
}
.res-save-btn:hover { opacity: 0.9; }
.res-clear-btn, .res-back-btn {
  padding: var(--space-3) var(--space-4);
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition);
}
.res-clear-btn:hover, .res-back-btn:hover { border-color: var(--color-text-muted); }

/* Mobile */
@media (max-width: 768px) {
  .res-zone-grid { grid-template-columns: 1fr; }
  .res-lga-grid, .res-ward-grid { grid-template-columns: 1fr 1fr; }
  .res-pu-grid { grid-template-columns: 1fr; }
  .res-party-row { grid-template-columns: 100px 1fr 42px; gap: var(--space-2); }
  .res-summary-card { padding: var(--space-4); }
  .res-form-card { padding: var(--space-4); }
}
@media (max-width: 480px) {
  .res-lga-grid, .res-ward-grid { grid-template-columns: 1fr; }
}

/* ============================================
   RESULTS AUTH / LOGIN
   ============================================ */
.res-auth-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
  flex-wrap: wrap;
}
.res-auth-bar.authed {
  background: rgba(26, 74, 26, 0.08);
  border: 1px solid rgba(26, 74, 26, 0.2);
  color: var(--color-text);
}
.res-auth-bar.locked {
  background: rgba(150, 66, 25, 0.06);
  border: 1px solid rgba(150, 66, 25, 0.15);
  color: var(--color-text-muted);
}
.res-auth-icon { font-size: 16px; }
.res-logout-btn {
  margin-left: auto;
  padding: 2px 12px;
  font-size: var(--text-xs);
  font-weight: 600;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: border-color var(--transition);
}
.res-logout-btn:hover { border-color: var(--color-text-muted); }
.res-login-link {
  background: none;
  border: none;
  color: var(--color-primary);
  font-weight: 700;
  font-size: var(--text-sm);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

/* Login card */
.res-login-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  max-width: 380px;
  margin: var(--space-6) auto;
  text-align: center;
}
.res-login-icon {
  font-size: 40px;
  margin-bottom: var(--space-3);
}
.res-login-title {
  font-family: 'Instrument Serif', serif;
  font-size: var(--text-xl);
  color: var(--color-text);
  margin: 0 0 var(--space-1);
}
.res-login-sub {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-primary);
  margin: 0 0 var(--space-3);
}
.res-login-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-5);
  line-height: 1.5;
}
.res-pin-group {
  margin-bottom: var(--space-4);
}
.res-pin-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--text-xl);
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.3em;
  transition: border-color var(--transition);
}
.res-pin-input:focus {
  outline: none;
  border-color: var(--color-primary);
}
.res-login-error {
  color: #e00034;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-3);
}
.res-login-error.hidden { display: none; }

/* Agent badge on form */
.res-form-agent-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}

/* Readonly PU cards */
.res-pu-card.readonly {
  cursor: default;
  opacity: 0.8;
}
.res-pu-card.readonly:hover {
  border-color: var(--color-border);
  box-shadow: none;
}

/* ---- CONTACT CARDS ---- */
.res-contact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary);
  border-radius: 10px;
  margin-bottom: 12px;
}
.res-contact-role {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  white-space: nowrap;
  min-width: 120px;
}
.res-contact-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  flex: 1;
}
.res-contact-tba {
  color: var(--color-text-faint);
  font-weight: 400;
  font-style: italic;
}
.res-contact-phone {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  background: var(--color-primary-light);
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  transition: background 0.15s;
}
.res-contact-phone:hover {
  background: var(--color-primary-highlight);
}

/* Multiple agents row (PU level) */
.res-agents-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.res-agents-row .res-contact-card {
  flex: 1;
  min-width: 220px;
  margin-bottom: 0;
  border-left-color: var(--color-gold);
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.res-agents-row .res-contact-role {
  color: var(--color-gold);
}

@media (max-width: 600px) {
  .res-contact-card {
    flex-wrap: wrap;
    gap: 6px;
  }
  .res-contact-role {
    min-width: unset;
    width: 100%;
  }
}

/* ---- SYNC STATUS BAR ---- */
.sync-status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
  transition: all 0.3s ease;
}
.sync-status-bar .sync-icon {
  font-size: 10px;
  line-height: 1;
}
.sync-status-bar .sync-text {
  color: var(--color-text-muted);
}
.sync-online {
  background: var(--color-primary-light);
}
.sync-online .sync-text {
  color: var(--color-primary);
}
.sync-offline {
  background: var(--color-surface-offset);
}
.sync-connecting {
  background: #fff8e1;
}
[data-theme='dark'] .sync-connecting {
  background: rgba(255,193,7,0.1);
}
.sync-syncing {
  background: #e3f2fd;
}
[data-theme='dark'] .sync-syncing {
  background: rgba(33,150,243,0.1);
}
.sync-error {
  background: #fce4ec;
}
[data-theme='dark'] .sync-error {
  background: rgba(244,67,54,0.1);
}

/* ---- SAVE TOAST ---- */
.sync-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--color-primary);
  color: #fff;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 9999;
  white-space: nowrap;
}
.sync-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
