/* ── Resource Portal brand fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

:root {
  /* ── Resource Portal brand palette ── */
  --navy: #201C3F;
  --raspberry: #BF3F62;
  --raspberry-deep: #A8255D;
  --indigo: #4C59A1;
  --sky: #1A7EFB;
  --mist: #F3F6FE;
  --slate: #535353;
  /* Semantic tokens mapped to the brand palette */
  --blue: #201C3F;        /* Portal Navy — primary/anchor, headings, active states */
  --blue-light: #4C59A1;  /* Indigo — gradient partner */
  --accent: #2ecc71;
  --accent-orange: #e67e22;
  --accent-red: #e74c3c;
  --bg: #F3F6FE;
  --card: #ffffff;
  --text: #201C3F;
  --text-light: #6E6E80;
  --border: #e7e8ef;
  --nav-bg: #ffffff;
  --table-header: #f6f7fc;
  --table-row-hover: #f7f9ff;
  --table-row-border: #eef0f6;
  --input-bg: #ffffff;
  --detail-item-bg: #f6f7fc;
  --pipeline-col-bg: #f6f7fc;
  --shadow-color: rgba(32,28,63,0.08);
  --overlay-bg: rgba(32,28,63,0.5);
}

/* ── Dark Mode (Resource Portal navy) ── */
html.dark-mode {
  --blue: #8b93de;        /* periwinkle indigo — visible accent on navy */
  --blue-light: #4C59A1;
  --accent: #34d399;
  --accent-orange: #f59e0b;
  --accent-red: #f87171;
  --bg: #17152b;          /* deep Portal Navy */
  --card: #221f3e;
  --text: #e9e8f5;
  --text-light: #a6a3c6;
  --border: #332f52;
  --nav-bg: #221f3e;
  --table-header: #221f3e;
  --table-row-hover: #2b2750;
  --table-row-border: #332f52;
  --input-bg: #221f3e;
  --detail-item-bg: #221f3e;
  --pipeline-col-bg: #221f3e;
  --shadow-color: rgba(0,0,0,0.35);
  --overlay-bg: rgba(15,13,30,0.7);
}
html.dark-mode .header { background: linear-gradient(135deg, #17152b 0%, #2c2856 55%, #3a2f63 100%); }
html.dark-mode .nav { background: var(--nav-bg); border-bottom-color: var(--border); }
html.dark-mode .nav a:hover, html.dark-mode .nav-dropdown-toggle:hover { background: #334155; }
html.dark-mode .nav-dropdown-menu { background: var(--card); border-color: var(--border); }
html.dark-mode .nav-dropdown-menu a:hover { background: #334155; }
html.dark-mode .nav-dropdown-menu a.active { background: #1e3a5f; color: var(--blue); }
html.dark-mode .nav-submenu-menu { background: var(--card); border-color: var(--border); }
html.dark-mode .nav-submenu-menu a:hover { background: #334155; }
html.dark-mode thead th { background: var(--table-header); }
html.dark-mode tbody td { border-bottom-color: var(--table-row-border); }
html.dark-mode tbody tr:hover { background: var(--table-row-hover); }
html.dark-mode .search-bar input, html.dark-mode .filters select, html.dark-mode .filters input { background: var(--input-bg); color: var(--text); border-color: var(--border); }
html.dark-mode .search-bar input:focus, html.dark-mode .filters select:focus, html.dark-mode .filters input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(74,158,255,0.15); }
html.dark-mode .detail-item { background: var(--detail-item-bg); }
html.dark-mode .detail-item.highlight { background: #0f2a1f; border-left-color: var(--accent); }
html.dark-mode .detail-item.warn { background: #2a1f0f; border-left-color: var(--accent-orange); }
html.dark-mode .pipeline-col { background: var(--pipeline-col-bg); }
html.dark-mode .pipeline-card { background: var(--card); }
html.dark-mode .back-btn { background: var(--card); border-color: var(--border); color: var(--text); }
html.dark-mode .back-btn:hover { background: #334155; }
html.dark-mode .enrichment-checklist { background: #1e293b; border-color: var(--border); }
html.dark-mode .check-box { background: #334155; border-color: #475569; }
html.dark-mode .enrich-modal { background: var(--card); color: var(--text); }
html.dark-mode .bulk-action-bar { background: var(--card); border-top-color: var(--blue); }
html.dark-mode .pagination-btn { background: var(--card); border-color: var(--border); color: var(--blue); }
html.dark-mode .pagination-btn:hover { background: var(--blue); color: #fff; }
html.dark-mode .pagination-btn.disabled { background: var(--card); color: var(--text-light); }
html.dark-mode .page-number { background: var(--card); border-color: var(--border); }
html.dark-mode .school-table th { background: var(--table-header); }
html.dark-mode .school-table td { border-bottom-color: var(--table-row-border); }
html.dark-mode .school-table tbody tr:hover { background: var(--table-row-hover); }
html.dark-mode .school-table tbody tr.elop-row { background: #0f2a1f; }
html.dark-mode .school-table tbody tr.elop-row:hover { background: #1a3a2a; }
html.dark-mode .badge-green { background: #064e3b; color: #6ee7b7; }
html.dark-mode .badge-yellow { background: #422006; color: #fcd34d; }
html.dark-mode .badge-red { background: #450a0a; color: #fca5a5; }
html.dark-mode .badge-blue { background: #0c2d48; color: #93c5fd; }
html.dark-mode .badge-gray { background: #334155; color: #cbd5e1; }
html.dark-mode .badge-orange { background: #431407; color: #fdba74; }
html.dark-mode .badge-purple { background: #2e1065; color: #c4b5fd; }
html.dark-mode .badge-teal { background: #042f2e; color: #5eead4; }
html.dark-mode .badge-amber { background: #422006; color: #fcd34d; }
html.dark-mode .badge-indigo { background: #1e1b4b; color: #a5b4fc; }
html.dark-mode .district-card { background: var(--card); border-top-color: var(--border); }
html.dark-mode .district-card.enriched { border-top-color: var(--accent); }
html.dark-mode .district-card.fully-enriched { border-top-color: var(--blue); }
html.dark-mode .district-card .contact { border-top-color: var(--table-row-border); }
html.dark-mode .county-card { background: var(--card); }
html.dark-mode .progress-bar-track { background: #334155; }
html.dark-mode .recent-item:hover { background: var(--table-row-hover); }
html.dark-mode .recent-item { border-bottom-color: var(--table-row-border); }
html.dark-mode .mini-stat-row { border-bottom-color: var(--table-row-border); }
html.dark-mode .detail-section { border-bottom-color: var(--table-row-border); }
html.dark-mode .detail-section .info-row { border-bottom-color: #1e293b; }
html.dark-mode .district-logo { background: #334155; border-color: var(--border); }
html.dark-mode .school-logo { background: #334155; border-color: var(--border); }
html.dark-mode .enrich-stat { background: #334155; }
html.dark-mode .enrich-queued-badge { background: #422006; color: #fcd34d; }
html.dark-mode .pipeline-card .district-tag { background: #1e3a5f; color: var(--blue); }
html.dark-mode .stat-card { box-shadow: 0 1px 3px var(--shadow-color); }
html.dark-mode .card { box-shadow: 0 1px 3px var(--shadow-color); }
html.dark-mode .district-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
html.dark-mode .county-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
html.dark-mode footer { border-top-color: var(--border); color: var(--text-light); }
html.dark-mode footer a { color: var(--text-light); }
html.dark-mode a { color: var(--blue); }
/* ── Dark Mode Toggle Button ── */
.theme-toggle { background: none; border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; cursor: pointer; font-size: 16px; line-height: 1; transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
.theme-toggle:hover { background: rgba(0,0,0,0.05); }
html.dark-mode .theme-toggle:hover { background: rgba(255,255,255,0.1); }
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family: 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); }
button, input, select, textarea { font-family: inherit; }
a { color: var(--sky); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.header { background: linear-gradient(135deg, var(--navy) 0%, #2c2856 55%, #3a2f63 100%); color: white; padding: 24px 32px; display: flex; align-items: center; justify-content: space-between; }
.header h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.header .subtitle { font-size: 13px; opacity: 0.8; margin-top: 2px; }
.header .logo { font-size: 14px; background: rgba(255,255,255,0.15); padding: 6px 14px; border-radius: 6px; }

/* Navigation */
.nav { background: white; border-bottom: 1px solid var(--border); display: flex; padding: 0 32px; gap: 0; overflow: visible; flex-wrap: wrap; position: relative; z-index: 1100; }
.nav a { background: none; border: none; padding: 14px 20px; font-size: 13px; font-weight: 500; color: var(--text-light); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; transition: all 0.2s; text-decoration: none; display: block; }
.nav a:hover { color: var(--text); background: #f8f9fa; text-decoration: none; }
.nav a.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
.nav-dropdown { position: relative; }
.nav-dropdown:first-of-type { margin-left: auto; }
.nav-dropdown-toggle { padding: 14px 20px; font-size: 13px; font-weight: 500; color: var(--text-light); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; transition: all 0.2s; text-decoration: none; display: block; background: none; }
.nav-dropdown-toggle:hover { color: var(--text); background: #f8f9fa; text-decoration: none; }
.nav-dropdown-toggle.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
.nav-dropdown-menu { display: none; position: absolute; top: 100%; left: 0; background: white; border: 1px solid var(--border); border-radius: 0 0 8px 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); min-width: 180px; z-index: 1000; }
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a { padding: 10px 20px; font-size: 13px; font-weight: 500; color: var(--text-light); text-decoration: none; display: block; border-bottom: none; white-space: nowrap; }
.nav-dropdown-menu a:hover { color: var(--text); background: #f8f9fa; }
.nav-dropdown-menu a.active { color: var(--blue); font-weight: 600; background: #eff6ff; border-bottom: none; }
/* Nested submenu within a dropdown — hover flyout */
.nav-submenu { position: relative; }
.nav-submenu-toggle { padding: 10px 20px; font-size: 13px; font-weight: 500; color: var(--text-light); text-decoration: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: default; white-space: nowrap; user-select: none; }
.nav-submenu-toggle:hover, .nav-submenu:hover .nav-submenu-toggle { color: var(--text); background: #f8f9fa; }
.nav-submenu-toggle.active { color: var(--blue); font-weight: 600; background: #eff6ff; }
.nav-submenu-menu { display: none; position: absolute; top: 0; left: 100%; background: white; border: 1px solid var(--border); border-radius: 0 8px 8px 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); min-width: 180px; z-index: 1001; }
.nav-submenu:hover > .nav-submenu-menu { display: block; }
.nav-submenu-menu a { padding: 10px 20px; font-size: 13px; font-weight: 500; color: var(--text-light); text-decoration: none; display: block; border-bottom: none; white-space: nowrap; }
.nav-submenu-menu a:hover { color: var(--text); background: #f8f9fa; }
.nav-submenu-menu a.active { color: var(--blue); font-weight: 600; background: #eff6ff; }
.nav-dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* Breadcrumbs */
.breadcrumbs { font-size: 13px; color: var(--text-light); margin-bottom: 16px; display: flex; align-items: center; flex-wrap: wrap; gap: 0; }
.breadcrumbs a { color: var(--blue); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumb-sep { margin: 0 8px; color: #bdc3c7; font-size: 12px; }
.breadcrumb-current { color: var(--text); font-weight: 500; }

/* Content */
.content { max-width: 1400px; margin: 0 auto; padding: 24px 32px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--card); border-radius: 10px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border-left: 4px solid var(--blue); }
.stat-card.green { border-left-color: var(--accent); }
.stat-card.orange { border-left-color: var(--accent-orange); }
.stat-card.amber { border-left-color: #f0ad4e; }
.stat-card.red { border-left-color: var(--accent-red); }
.stat-card .number { font-size: 32px; font-weight: 700; color: var(--blue); }
.stat-card.green .number { color: var(--accent); }
.stat-card.orange .number { color: var(--accent-orange); }
.stat-card.amber .number { color: #f0ad4e; }
.stat-card.red .number { color: var(--accent-red); }
.stat-card .label { font-size: 12px; color: var(--text-light); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; }

/* Cards */
.card { background: var(--card); border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin-bottom: 20px; overflow: hidden; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-header h3 { font-size: 15px; font-weight: 600; }
.card-body { padding: 20px; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th { background: #f8f9fa; padding: 10px 14px; text-align: left; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-light); border-bottom: 2px solid var(--border); position: sticky; top: 0; }
tbody td { padding: 10px 14px; border-bottom: 1px solid #f0f0f0; }
tbody tr:hover { background: #f8fbff; }
tbody tr:hover td { background: transparent; }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.badge-green { background: #d5f5e3; color: #1e8449; }
.badge-yellow { background: #fef9e7; color: #9a7d0a; }
.badge-red { background: #fdedec; color: #922b21; }
.badge-blue { background: #d6eaf8; color: #1a5276; }
.badge-gray { background: #eaecee; color: #5d6d7e; }
.badge-orange { background: #fdebd0; color: #935116; }
.badge-purple { background: #ede9fe; color: #5b21b6; }
.badge-teal { background: #ccfbf1; color: #0f766e; }
.badge-amber { background: #fff3cd; color: #856404; }
.badge-indigo { background: #e0e7ff; color: #3730a3; }
.priority-high { background: var(--accent-red); color: white; padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 700; }
.priority-medium { background: var(--accent-orange); color: white; padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 700; }
.priority-low { background: #3498db; color: white; padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 700; }

/* District Grid */
.district-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.district-card { background: var(--card); border-radius: 10px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border-top: 4px solid var(--border); transition: transform 0.2s, box-shadow 0.2s; cursor: pointer; text-decoration: none; color: inherit; display: block; }
.district-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); text-decoration: none; }
.district-card.enriched { border-top-color: var(--accent); }
.district-card.fully-enriched { border-top-color: var(--blue); }
.district-card.baseline { border-top-color: var(--border); }
.district-card h4 { font-size: 15px; margin-bottom: 8px; }
.district-card .meta { font-size: 12px; color: var(--text-light); display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.district-card .contact { font-size: 13px; margin-top: 8px; padding-top: 8px; border-top: 1px solid #f0f0f0; }
.district-card .contact strong { color: var(--blue); }

/* Detail page */
.back-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border: 1px solid var(--border); border-radius: 8px; background: white; font-size: 13px; font-weight: 500; cursor: pointer; margin-bottom: 16px; color: var(--text); transition: all 0.2s; text-decoration: none; }
.back-btn:hover { background: #f8f9fa; border-color: var(--blue); color: var(--blue); text-decoration: none; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.detail-item { padding: 12px 16px; background: #f8f9fa; border-radius: 8px; border-left: 3px solid var(--blue); }
.detail-item .di-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-light); margin-bottom: 2px; }
.detail-item .di-value { font-size: 14px; font-weight: 500; }
.detail-item .di-value a { color: var(--blue); }
.detail-item.highlight { border-left-color: var(--accent); background: #f0fdf4; }
.detail-item.warn { border-left-color: var(--accent-orange); background: #fffbf0; }
.detail-panel { background: var(--card); border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.detail-header { padding: 24px; border-bottom: 1px solid var(--border); }
.detail-header h2 { font-size: 20px; margin-bottom: 4px; }

/* District & School Logos */
.district-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--border);
  padding: 4px;
  flex-shrink: 0;
}
.district-logo-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue), #1a5276);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  flex-shrink: 0;
}
.school-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #eee;
  padding: 2px;
}
.detail-header .detail-meta { color: var(--text-light); font-size: 13px; }
.detail-sections { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 24px; }
.detail-section { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid #f0f0f0; }
.detail-section:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.detail-section h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-light); margin-bottom: 12px; }
.detail-section .info-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; border-bottom: 1px solid #f8f8f8; }
.detail-section .info-row .label { color: var(--text-light); min-width: 140px; }

/* Search and Filters */
.search-bar { position: relative; margin-bottom: 20px; }
.search-bar input { width: 100%; padding: 12px 16px 12px 42px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: white; }
.search-bar input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,51,102,0.1); }
.search-bar svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-light); }
.filters { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.filters select, .filters input { padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: white; }
.filters select:focus, .filters input:focus { outline: none; border-color: var(--blue); }
.filters .filter-label { font-size: 12px; color: var(--text-light); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

/* Pipeline */
.pipeline { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; }
.pipeline-col { min-width: 260px; flex: 1; background: #f8f9fa; border-radius: 10px; padding: 14px; }
.pipeline-col h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-light); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.pipeline-col h4 .count { background: var(--border); color: var(--text); padding: 2px 8px; border-radius: 10px; font-size: 11px; }
.pipeline-card { background: white; border-radius: 8px; padding: 12px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.pipeline-card .name { font-weight: 600; font-size: 13px; }
.pipeline-card .role { font-size: 11px; color: var(--text-light); }
.pipeline-card .district-tag { font-size: 10px; background: #eaf2f8; color: var(--blue); padding: 2px 6px; border-radius: 4px; margin-top: 6px; display: inline-block; }

/* Enrich Button */
.enrich-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 16px; background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%); color: white; border: none; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.enrich-btn:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,51,102,0.3); }
.enrich-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.enrich-btn svg { animation: none; }
.enrich-btn:disabled svg { animation: spin 1s linear infinite; }

/* Enrich Overlay */
.enrich-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 9999; backdrop-filter: blur(2px); }
.enrich-modal { background: white; border-radius: 12px; padding: 32px; max-width: 520px; width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,0.2); text-align: center; }
.enrich-modal h3 { font-size: 18px; margin-bottom: 16px; color: var(--blue); }
.enrich-spinner { margin-bottom: 16px; }
.enrich-spinner svg { animation: spin 1.5s linear infinite; }
.enrich-status { font-size: 13px; color: var(--text-light); line-height: 2; }

/* Enrich Results Grid */
.enrich-results-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.enrich-stat { background: #f8f9fa; border-radius: 8px; padding: 12px; text-align: center; }
.enrich-stat-num { font-size: 22px; font-weight: 700; color: var(--blue); }
.enrich-stat-label { font-size: 10px; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Enrich Action Buttons (district detail page) */
.enrich-action-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; background: linear-gradient(135deg, #0066cc 0%, #0088ff 100%); color: white; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.enrich-action-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,102,204,0.35); }
.enrich-action-btn:active { transform: translateY(0); }
.enrich-action-btn .enrich-icon { font-size: 15px; }
.enrich-action-btn.further { background: linear-gradient(135deg, #e67e22 0%, #f39c12 100%); }
.enrich-action-btn.further:hover { box-shadow: 0 4px 12px rgba(230,126,34,0.35); }
.enrich-action-btn.subtle { background: transparent; color: var(--text-light); border: 1px solid var(--border); font-weight: 500; font-size: 12px; padding: 6px 14px; }
.enrich-action-btn.subtle:hover { background: #f8f9fa; color: var(--text); box-shadow: none; transform: none; }

/* Enrichment Queued Badge */
.enrich-queued-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px; background: #fff3cd; color: #856404; border-radius: 8px; font-size: 13px; font-weight: 600; }
.pulse-dot { width: 8px; height: 8px; background: #ffc107; border-radius: 50%; animation: pulse-glow 1.5s ease-in-out infinite; }
.pulse-dot-sm { display: inline-block; width: 6px; height: 6px; background: #e6a817; border-radius: 50%; animation: pulse-glow 1.5s ease-in-out infinite; margin-right: 4px; vertical-align: middle; }
@keyframes pulse-glow { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255,193,7,0.7); } 50% { opacity: 0.6; box-shadow: 0 0 0 6px rgba(255,193,7,0); } }

/* Toast Notification */
.enrich-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px); background: #1a1a2e; color: white; padding: 14px 24px; border-radius: 10px; font-size: 13px; z-index: 10000; box-shadow: 0 8px 24px rgba(0,0,0,0.25); transition: transform 0.3s ease, opacity 0.3s ease; opacity: 0; max-width: 500px; text-align: center; }
.enrich-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* Enrichment Queue Card */
.enrichment-queue-card { border-left: 3px solid #ffc107; margin-bottom: 16px; }
.enrichment-queue-card .card-header h3 { font-size: 14px; color: #856404; }
.queue-item { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.queue-item:last-child { border-bottom: none; }
.queue-item-name { font-weight: 600; font-size: 13px; color: var(--blue); }
.queue-item-name:hover { text-decoration: underline; }
.queue-item-meta { font-size: 12px; color: var(--text-light); margin-top: 3px; }
.queue-item-type { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.queue-badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.queue-badge.new { background: #e3f2fd; color: #1565c0; }
.queue-badge.further { background: #fff3e0; color: #e65100; }
.queue-time { font-size: 11px; color: var(--text-light); }
.queue-dismiss-btn { background: none; border: none; color: #bbb; font-size: 14px; cursor: pointer; padding: 2px 6px; border-radius: 4px; line-height: 1; }
.queue-dismiss-btn:hover { background: #fee; color: var(--accent-red); }

/* Bulk Selection Mode */
.bulk-mode-btn { background: none; border: 1px solid var(--border); color: var(--text-light); padding: 6px 14px; border-radius: 6px; font-size: 12px; cursor: pointer; white-space: nowrap; transition: all 0.2s; }
.bulk-mode-btn:hover { background: #f0f4ff; color: var(--blue); border-color: var(--blue); }
.bulk-mode-btn.active { background: var(--blue); color: white; border-color: var(--blue); }

.bulk-checkbox-label { position: absolute; top: 12px; left: 12px; z-index: 2; }
.bulk-checkbox { width: 18px; height: 18px; cursor: pointer; accent-color: var(--blue); }

.district-card-wrapper { position: relative; }
.district-card-wrapper.selected .district-card { outline: 2px solid var(--blue); outline-offset: -2px; background: #f0f4ff; }
.district-grid.bulk-mode .district-card { padding-left: 40px; }

.bulk-action-bar { position: fixed; bottom: 0; left: 0; right: 0; background: white; border-top: 2px solid var(--blue); box-shadow: 0 -4px 20px rgba(0,0,0,0.12); z-index: 1000; padding: 12px 32px; animation: slideUp 0.25s ease; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.bulk-bar-inner { display: flex; align-items: center; justify-content: space-between; max-width: 1400px; margin: 0 auto; }
.bulk-bar-left { display: flex; align-items: center; gap: 16px; }
.bulk-bar-right { display: flex; align-items: center; gap: 10px; }
.bulk-select-all-label { font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.bulk-count { font-size: 13px; font-weight: 600; color: var(--blue); }
.bulk-bar-btn { padding: 8px 20px; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.bulk-bar-btn.enrich { background: linear-gradient(135deg, #0066cc 0%, #0088ff 100%); color: white; }
.bulk-bar-btn.enrich:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,102,204,0.35); }
.bulk-bar-btn.enrich:disabled { opacity: 0.6; transform: none; cursor: wait; }
.bulk-bar-btn.cancel { background: #f0f0f0; color: var(--text-light); }
.bulk-bar-btn.cancel:hover { background: #e0e0e0; }
.badge-amber { background: #fff3cd; color: #856404; }

/* County Cards Grid */
.county-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.county-card { display: block; background: var(--card); border-radius: 10px; padding: 16px 18px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); border-left: 4px solid var(--border); transition: transform 0.15s, box-shadow 0.15s; text-decoration: none; color: inherit; }
.county-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); text-decoration: none; }
.county-card.has-enriched { border-left-color: #3498db; }
.county-card.fully-done { border-left-color: var(--accent); }
.county-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.county-card-header h4 { font-size: 15px; font-weight: 600; color: var(--text); }
.county-card-coe { font-size: 11px; color: var(--text-light); margin-bottom: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.county-card-stats { display: flex; gap: 12px; font-size: 12px; color: var(--text-light); margin-bottom: 10px; }
.county-card-stats span { white-space: nowrap; }
.county-card-progress-label { font-size: 11px; color: var(--text-light); margin-top: 6px; }

/* Progress Bars */
.progress-bar-track { background: #eaecee; border-radius: 6px; height: 6px; overflow: hidden; width: 100%; }
.progress-bar-fill { height: 100%; border-radius: 6px; background: #3498db; transition: width 0.4s ease; min-width: 0; }
.progress-bar-fill.complete { background: var(--accent); }
.progress-bar-fill.partial { background: #3498db; }

/* Recently Enriched */
.recent-item { display: block; padding: 12px 20px; border-bottom: 1px solid #f0f0f0; text-decoration: none; color: inherit; transition: background 0.15s; }
.recent-item:hover { background: #f8fbff; text-decoration: none; }
.recent-item:last-child { border-bottom: none; }
.recent-item-name { font-size: 13px; font-weight: 600; color: var(--blue); margin-bottom: 2px; }
.recent-item-meta { font-size: 11px; color: var(--text-light); }
.recent-item-contact { font-size: 11px; color: var(--text); margin-top: 2px; }

/* Mini Stat Rows */
.mini-stat-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #f4f4f4; font-size: 13px; }
.mini-stat-row:last-child { border-bottom: none; }
.mini-stat-row span { color: var(--text-light); }
.mini-stat-row strong { color: var(--text); }

/* Pagination */
.pagination-container { margin-top: 32px; display: flex; flex-direction: column; gap: 20px; align-items: center; }
.pagination-controls { display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; }
.pagination-btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 14px; border: 1px solid var(--border); border-radius: 6px; background: white; color: var(--blue); font-size: 13px; font-weight: 500; text-decoration: none; cursor: pointer; transition: all 0.2s; }
.pagination-btn:hover { background: var(--blue); color: white; border-color: var(--blue); }
.pagination-btn.disabled { color: var(--text-light); border-color: var(--border); cursor: not-allowed; background: #f8f9fa; }
.pagination-btn.disabled:hover { background: #f8f9fa; color: var(--text-light); border-color: var(--border); }
.pagination-info { font-size: 13px; color: var(--text); font-weight: 500; padding: 0 8px; }
.pagination-page-numbers { display: flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: wrap; }
.page-number { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: white; color: var(--blue); font-size: 13px; font-weight: 500; text-decoration: none; cursor: pointer; transition: all 0.2s; }
.page-number:hover { background: var(--blue); color: white; border-color: var(--blue); }
.page-number.active { background: var(--blue); color: white; border-color: var(--blue); cursor: default; }
.page-number.active:hover { background: var(--blue); color: white; border-color: var(--blue); }

/* School Table */
.school-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.school-table th { background: #f8f9fa; padding: 10px 12px; text-align: left; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-light); border-bottom: 2px solid var(--border); white-space: nowrap; }
.school-table td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
.school-table tbody tr:hover { background: #f8faff; }
.school-table tbody tr.elop-row { background: #f0faf4; }
.school-table tbody tr.elop-row:hover { background: #e0f5ec; }
.school-table a { color: var(--blue); font-size: 12px; }

/* Enrichment Progress Checklist */
.enrichment-checklist { margin: 0 24px 20px; padding: 16px 20px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; }
.checklist-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.checklist-header h4 { margin: 0; font-size: 13px; font-weight: 600; color: var(--text); }
.checklist-score { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 12px; }
.checklist-score.high { background: #d1fae5; color: #065f46; }
.checklist-score.mid { background: #fef3c7; color: #92400e; }
.checklist-score.low { background: #fee2e2; color: #991b1b; }
.checklist-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 16px; }
.check-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #94a3b8; padding: 4px 0; cursor: default; }
.check-item.done { color: var(--text); }
.check-box { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; min-width: 18px; border-radius: 4px; border: 1.5px solid #cbd5e1; font-size: 11px; font-weight: 700; color: transparent; background: white; }
.check-item.done .check-box { background: #10b981; border-color: #10b981; color: white; }
.check-detail { font-size: 10px; color: #64748b; margin-left: auto; }

/* District Card Progress Bar */
.card-progress { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(0,0,0,0.06); }
.card-progress-track { flex: 1; height: 6px; background: #e9ecef; border-radius: 3px; overflow: hidden; }
.card-progress-fill { height: 100%; border-radius: 3px; transition: width 0.3s ease; }
.card-progress-fill.high { background: linear-gradient(90deg, #34d399, #10b981); }
.card-progress-fill.mid { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.card-progress-fill.low { background: linear-gradient(90deg, #f87171, #ef4444); }
.card-progress-label { font-size: 11px; font-weight: 600; color: var(--text-light); min-width: 32px; text-align: right; }

/* Responsive */
@media (max-width: 768px) {
  .detail-sections, .detail-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 16px; }
  .header { padding: 16px; }
  .nav { padding: 0 16px; }
  .filters { flex-direction: column; }
  .enrich-results-grid { grid-template-columns: repeat(2, 1fr); }
  .county-grid { grid-template-columns: 1fr; }
}

/* ─── Composite Score Badges ─────────────────────────────────── */
.score-badge { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; line-height: 1.4; }
.score-badge.score-hot { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.score-badge.score-warm { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.score-badge.score-cool { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.score-badge.score-cold { background: #f9fafb; color: #6b7280; border: 1px solid #e5e7eb; }

/* Score breakdown horizontal bars */
.score-breakdown-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 14px;
}
.score-breakdown-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.score-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.score-bar-label {
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  min-width: 90px;
  flex-shrink: 0;
}
.score-bar-track {
  flex: 1;
  height: 10px;
  border-radius: 5px;
  background: #f1f5f9;
  overflow: hidden;
}
.score-bar-fill {
  height: 100%;
  border-radius: 5px;
  background: #10b981;
  transition: width 0.4s ease;
}
.score-bar-value {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  min-width: 40px;
  text-align: right;
  flex-shrink: 0;
}

/* Legacy score bar (5-dimension stacked) — kept for overview page */
.score-bar-container { display: flex; gap: 2px; height: 6px; border-radius: 3px; overflow: hidden; background: #f1f5f9; }
.score-bar-segment { height: 100%; transition: width 0.3s ease; }
.score-bar-segment.scale { background: #3b82f6; }
.score-bar-segment.service { background: #8b5cf6; }
.score-bar-segment.readiness { background: #10b981; }
.score-bar-segment.engagement { background: #f59e0b; }
.score-bar-segment.data { background: #06b6d4; }

/* ─── Outreach Tasks ─────────────────────────────────────────── */
.task-card { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; gap: 12px; transition: background 0.15s; }
.task-card:hover { background: #f8fafc; }
.task-card:last-child { border-bottom: none; }
.task-priority-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.task-priority-dot.urgent { background: #dc2626; }
.task-priority-dot.high { background: #f59e0b; }
.task-priority-dot.medium { background: #3b82f6; }
.task-priority-dot.low { background: #9ca3af; }
.task-content { flex: 1; min-width: 0; }
.task-title { font-weight: 600; font-size: 13px; margin-bottom: 3px; }
.task-meta { font-size: 12px; color: var(--text-light); }
.task-actions { display: flex; gap: 6px; flex-shrink: 0; }
.task-btn { padding: 4px 10px; border-radius: 5px; font-size: 11px; border: 1px solid var(--border); background: white; cursor: pointer; transition: all 0.15s; }
.task-btn:hover { background: #f1f5f9; }
.task-btn.complete { color: #059669; border-color: #a7f3d0; }
.task-btn.complete:hover { background: #ecfdf5; }
.task-btn.dismiss { color: #6b7280; }
.task-btn.dismiss:hover { background: #f9fafb; }

/* Task filter pills */
.task-filters { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.task-filter-pill { padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 500; border: 1px solid var(--border); background: white; cursor: pointer; transition: all 0.15s; text-decoration: none; color: var(--text); }
.task-filter-pill:hover { background: #f1f5f9; text-decoration: none; }
.task-filter-pill.active { background: var(--blue); color: white; border-color: var(--blue); }
.task-filter-pill .count { font-weight: 700; margin-left: 4px; }

/* Priority label */
.priority-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; padding: 2px 6px; border-radius: 3px; }
.priority-label.urgent { background: #fef2f2; color: #dc2626; }
.priority-label.high { background: #fffbeb; color: #d97706; }
.priority-label.medium { background: #eff6ff; color: #2563eb; }
.priority-label.low { background: #f9fafb; color: #6b7280; }

/* ═══ Overview Page ═══ */
.page-header { margin-bottom: 24px; }
.page-header h1 { margin: 0 0 4px 0; font-size: 22px; color: var(--blue); }
.page-header p { margin: 0; font-size: 13px; color: var(--text-light); }

.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-number { font-size: 28px; font-weight: 700; color: var(--blue); }
.stat-label { font-size: 11px; color: var(--text-light); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.5px; }
.pulse-stat .stat-number { color: #f59e0b; }
.link-card { display: flex; align-items: center; justify-content: center; }
.link-card a { color: var(--blue); text-decoration: none; font-weight: 600; font-size: 13px; }
.link-card a:hover { text-decoration: underline; }

/* Enrichment progress bar */
.enrichment-progress-container { background: var(--card); border-radius: 10px; padding: 16px 20px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.progress-header h3 { margin: 0; font-size: 14px; }
.progress-label { font-size: 12px; color: var(--text-light); }
.progress-bar-fill { height: 100%; background: var(--accent); border-radius: 6px; transition: width 0.5s; }

/* Two-column layout */
.two-column-grid { display: grid; grid-template-columns: 1fr 380px; gap: 20px; }
.left-column, .right-column { display: flex; flex-direction: column; gap: 20px; }

/* Recommendations */
.top-recommendations-card .card-header, .top-leads-card .card-header, .pipeline-summary-card .card-header,
.enrichment-queue-card .card-header, .recently-enriched-card .card-header, .recent-gens-card .card-header, .quick-actions-card .card-header {
  display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.card-header h3 { margin: 0; font-size: 15px; }
.card-link { font-size: 12px; color: var(--blue); text-decoration: none; font-weight: 500; }
.card-link:hover { text-decoration: underline; }

.recommendations-list { padding: 0; }
.recommendations-list .task-card { display: flex; flex-direction: column; gap: 6px; padding: 12px 18px; border-bottom: 1px solid #f3f4f6; }
.recommendations-list .task-card:last-child { border-bottom: none; }
.task-header { display: flex; align-items: flex-start; gap: 10px; }
.task-priority-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.task-info { flex: 1; min-width: 0; }
.task-info h4 { margin: 0; font-size: 13px; font-weight: 600; }
.task-district { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.task-district a { color: var(--blue); text-decoration: none; }
.task-contact { color: var(--text-light); }
.task-type-badge { font-size: 10px; padding: 2px 8px; background: #f1f5f9; color: #64748b; border-radius: 10px; white-space: nowrap; flex-shrink: 0; }
.task-description { font-size: 12px; color: var(--text-light); margin: 0; padding-left: 18px; }
.task-actions { display: flex; gap: 6px; padding-left: 18px; }
.task-actions .btn { font-size: 11px; }

/* Overview buttons */
.btn { padding: 6px 14px; border-radius: 6px; font-size: 12px; font-weight: 500; border: 1px solid var(--border); cursor: pointer; transition: all 0.15s; text-decoration: none; }
.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn-primary { background: var(--blue); color: white; border-color: var(--blue); }
.btn-primary:hover { opacity: 0.9; }
.btn-secondary { background: white; color: var(--text); }
.btn-secondary:hover { background: #f1f5f9; }

/* Leads list */
.leads-list { padding: 0; }
.lead-item { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid #f3f4f6; }
.lead-item:last-child { border-bottom: none; }
.lead-name { flex: 1; font-weight: 500; font-size: 13px; }
.lead-name a { color: var(--blue); text-decoration: none; }
.lead-contact { font-size: 12px; color: var(--text-light); flex: 1; }
.lead-contact a { color: var(--blue); text-decoration: none; font-size: 11px; }
.lead-score { font-size: 12px; font-weight: 600; color: var(--blue); white-space: nowrap; }

/* Pipeline summary */
.pipeline-stages { padding: 8px 18px; }
.pipeline-stage { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.pipeline-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.pipeline-name { flex: 1; font-size: 13px; }
.pipeline-count { font-weight: 600; font-size: 13px; color: var(--blue); }
.pipeline-total { padding: 10px 18px; border-top: 1px solid var(--border); font-size: 13px; }

/* Queue items */
.queue-items { padding: 0; }
.queue-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 18px; border-bottom: 1px solid #f3f4f6; }
.queue-item:last-child { border-bottom: none; }
.queue-item-info a { color: var(--blue); text-decoration: none; font-weight: 500; font-size: 13px; }
.queue-status { font-size: 11px; color: var(--text-light); margin-left: 8px; }

/* Enriched / Gens lists */
.enriched-list, .gens-list { padding: 0; }
.enriched-item, .gen-item { padding: 8px 18px; border-bottom: 1px solid #f3f4f6; }
.enriched-item:last-child, .gen-item:last-child { border-bottom: none; }
.enriched-item a { color: var(--blue); text-decoration: none; font-weight: 500; font-size: 13px; }
.enriched-date, .gen-date { font-size: 11px; color: var(--text-light); margin-left: 8px; }
.gen-title { font-weight: 500; font-size: 13px; }
.gen-meta { font-size: 12px; color: var(--text-light); margin-top: 2px; display: flex; gap: 8px; }

/* Quick actions grid */
.actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px 18px; }
.action-link { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px; background: var(--bg); text-decoration: none; color: var(--text); font-size: 13px; font-weight: 500; transition: background 0.15s; }
.action-link:hover { background: #e2e8f0; }
.action-icon { font-size: 18px; }

/* Empty state */
.empty-state { padding: 24px 18px; text-align: center; }
.empty-state p { color: var(--text-light); font-size: 13px; margin: 0; }

/* Pipeline select on district detail */
.pipeline-select { padding: 4px 8px; border: 1px solid var(--border); border-radius: 5px; font-size: 11px; background: white; cursor: pointer; transition: border-color 0.3s; }
.pipeline-select:focus { outline: none; border-color: var(--blue); }

/* Counties page */
.county-page-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }

/* CSS variables for task priorities */
:root {
  --urgent: #dc2626;
  --high: #f59e0b;
  --medium: #3b82f6;
  --low: #9ca3af;
}

@media (max-width: 960px) {
  .two-column-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
}

/* ─── Contacts Page ─────────────────────────────── */
.contacts-filters { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 16px 20px; margin-bottom: 16px; }
.contacts-filters .filter-row { display: flex; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.contacts-filters .filter-group { flex: 1; min-width: 160px; }
.contacts-filters .filter-group label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--text-light); margin-bottom: 4px; letter-spacing: 0.5px; }
.contacts-filters .filter-group select,
.contacts-filters .filter-group input { width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: #fff; color: var(--text); }
.contacts-filters .filter-group select:focus,
.contacts-filters .filter-group input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 2px rgba(0,51,102,0.1); }
.filter-actions { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.filter-count { margin-left: auto; font-size: 13px; color: var(--text-light); font-weight: 500; }

.contacts-table-wrapper { overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: 8px; }
.contacts-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.contacts-table thead th { background: #f8f9fa; padding: 10px 12px; text-align: left; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-light); border-bottom: 2px solid var(--border); white-space: nowrap; }
.contacts-table thead th.sortable { cursor: pointer; user-select: none; }
.contacts-table thead th.sortable:hover { color: var(--blue); }
.sort-icon { font-size: 10px; opacity: 0.4; }
.contacts-table tbody td { padding: 8px 12px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.contacts-table tbody tr:hover { background: #f8fafc; }
.contacts-table .contact-name { font-weight: 500; white-space: nowrap; }
.contacts-table .nowrap { white-space: nowrap; }
.contacts-table .muted { color: #ccc; }
.contacts-table .empty-state { text-align: center; padding: 40px; color: var(--text-light); font-style: italic; }

.badge { display: inline-block; padding: 1px 5px; border-radius: 4px; font-size: 10px; font-weight: 700; margin-right: 3px; vertical-align: middle; }
.badge-verified { background: #d1fae5; color: #065f46; }
.badge-inferred { background: #fef3c7; color: #92400e; }
.badge-primary-target { background: #fef3c7; color: #b45309; font-size: 12px; }

.role-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 500; }
.role-badge.role-superintendent { background: #ede9fe; color: #5b21b6; }
.role-badge.role-administrator { background: #e0e7ff; color: #3730a3; }
.role-badge.role-elop_coordinator { background: #d1fae5; color: #065f46; }
.role-badge.role-district_leadership { background: #dbeafe; color: #1e40af; }
.role-badge.role-site_coordinator { background: #fef3c7; color: #92400e; }
.role-badge.role-department_staff { background: #f3f4f6; color: #374151; }
.role-badge.role-principal { background: #fce7f3; color: #9d174d; }
.role-badge.role-assistant_principal { background: #fce7f3; color: #be185d; }
.role-badge.role-program_manager { background: #ccfbf1; color: #0f766e; }

.pipeline-select-sm { padding: 4px 6px; font-size: 11px; border: 1px solid var(--border); border-radius: 4px; background: #fff; min-width: 100px; }

.pagination-controls { padding: 16px 0; text-align: center; }
.pagination { display: inline-flex; gap: 4px; }
.pagination button { padding: 6px 12px; border: 1px solid var(--border); border-radius: 4px; background: #fff; cursor: pointer; font-size: 13px; color: var(--text); }
.pagination button:hover { background: #f0f0f0; }
.pagination button.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ─── Sales Funnel Progress Bar ─── */
.funnel-steps { display:flex; gap:2px; margin-bottom:12px; overflow-x:auto; padding-bottom:4px; }
.funnel-step { flex:1; text-align:center; min-width:50px; position:relative; }
.funnel-step .step-dot { width:18px; height:18px; border-radius:50%; border:2px solid #e5e7eb; margin:0 auto 4px; background:white; transition:all 0.3s; }
.funnel-step.completed .step-dot { background:var(--stage-color); border-color:var(--stage-color); }
.funnel-step.active .step-dot { box-shadow:0 0 0 3px rgba(99,102,241,0.25); transform:scale(1.25); }
.funnel-step .step-label { font-size:9px; color:#9ca3af; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:70px; margin:0 auto; }
.funnel-step.completed .step-label { color:#6b7280; }
.funnel-step.active .step-label { font-weight:600; color:#111827; }
.funnel-step::after { content:''; position:absolute; top:9px; left:calc(50% + 12px); right:calc(-50% + 12px); height:2px; background:#e5e7eb; z-index:0; }
.funnel-step:last-child::after { display:none; }
.funnel-step.completed::after { background:var(--stage-color); }
.funnel-bar { height:6px; background:#f3f4f6; border-radius:3px; overflow:hidden; }
.funnel-fill { height:100%; border-radius:3px; transition:width 0.5s ease; }

/* ─── Stage Task Groups ─── */
.stage-task-group { margin-bottom:0; }
.stage-task-group:last-child { margin-bottom:0; }
.stage-header { padding:8px 12px; background:#f9fafb; display:flex; justify-content:space-between; align-items:center; font-weight:600; font-size:13px; border-bottom:1px solid #f3f4f6; }
.task-row { display:flex; align-items:center; gap:8px; padding:8px 12px 8px 24px; border-bottom:1px solid #f3f4f6; font-size:13px; transition:background 0.2s; }
.task-row:hover { background:#fafbfc; }
.task-row.completed .task-title { text-decoration:line-through; color:#9ca3af; }
.task-row input[type="checkbox"] { width:16px; height:16px; cursor:pointer; flex-shrink:0; }
.task-row .task-title { line-height:1.4; }
.task-row .task-btn.dismiss { width:20px; height:20px; border-radius:50%; border:1px solid #e5e7eb; background:white; color:#9ca3af; cursor:pointer; font-size:10px; line-height:1; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.task-row .task-btn.dismiss:hover { background:#fef2f2; color:#dc2626; border-color:#fca5a5; }

/* ─── Strategic Plans (LCAP/SPSA) ─── */
.strategic-plan-card { border:1px solid #e5e7eb; border-radius:8px; padding:12px 14px; background:#fafbfc; transition:box-shadow 0.2s; }
.strategic-plan-card:hover { box-shadow:0 2px 8px rgba(0,0,0,0.06); }
.sp-badge { display:inline-block; font-size:10px; font-weight:700; padding:2px 8px; border-radius:4px; margin-left:8px; vertical-align:middle; text-transform:uppercase; letter-spacing:0.5px; }
.sp-badge-lcap { background:#dbeafe; color:#1e40af; }
.sp-badge-spsa { background:#d1fae5; color:#065f46; }

/* ═══════════════════════════════════════════════════════════════
   DISTRICT DETAIL PAGE — AESTHETIC REDESIGN
   ═══════════════════════════════════════════════════════════════ */

/* ─── Hero Header ─── */
.detail-panel {
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  overflow: hidden;
}
.detail-header {
  padding: 32px 32px 24px;
  border-bottom: none;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #f0fdf4 100%);
  position: relative;
}
html.dark-mode .detail-header {
  background: linear-gradient(135deg, #1e293b 0%, #1e1b4b33 50%, #0f2a1f33 100%);
}
.detail-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 32px;
  right: 32px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}
.detail-header h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
  color: var(--text);
}
.detail-header .detail-meta {
  color: var(--text-light);
  font-size: 13px;
  margin-top: 8px;
  line-height: 1.6;
  letter-spacing: 0.1px;
}

/* ─── District Logo ─── */
.district-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 14px;
  background: #fff;
  border: 2px solid #e2e8f0;
  padding: 6px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}
.district-logo:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.district-logo-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 14px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 1px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(99,102,241,0.25);
}

/* ─── Badge Styling (header) ─── */
.detail-header .badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 0.3px;
  transition: transform 0.15s;
}
.detail-header .badge:hover {
  transform: translateY(-1px);
}

/* ─── Enrichment Checklist Redesign ─── */
.enrichment-checklist {
  margin: 0 32px 24px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  transition: box-shadow 0.2s;
}
.enrichment-checklist:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.checklist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}
.checklist-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.2px;
}
.checklist-score {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}
.checklist-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 20px;
}
.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #94a3b8;
  padding: 6px 8px;
  cursor: default;
  border-radius: 8px;
  transition: background 0.15s;
}
.check-item:hover {
  background: rgba(0,0,0,0.02);
}
.check-item.done {
  color: var(--text);
}
.check-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 6px;
  border: 2px solid #cbd5e1;
  font-size: 11px;
  font-weight: 700;
  color: transparent;
  background: white;
  transition: all 0.2s;
}
.check-item.done .check-box {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: #10b981;
  color: white;
  box-shadow: 0 2px 4px rgba(16,185,129,0.25);
}

/* ─── Cards — Elevated Style ─── */
.detail-panel .card,
.detail-panel > div > .card {
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  border: 1px solid rgba(0,0,0,0.04);
  transition: box-shadow 0.25s, transform 0.25s;
  overflow: hidden;
}
.detail-panel .card:hover,
.detail-panel > div > .card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
}
.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(248,250,252,0.8) 0%, rgba(248,250,252,0) 100%);
}
html.dark-mode .card-header {
  background: linear-gradient(180deg, rgba(30,41,59,0.8) 0%, rgba(30,41,59,0) 100%);
}
.card-header h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.1px;
}
.card-body {
  padding: 24px;
}

/* ─── Leadership & ELP Contact Sections ─── */
.detail-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 28px 32px;
}
.detail-section {
  margin-bottom: 0;
  padding: 20px;
  border-bottom: none;
  background: linear-gradient(135deg, #fafbfc 0%, #f8fafc 100%);
  border-radius: 14px;
  border: 1px solid #e8ecf1;
  transition: box-shadow 0.2s, transform 0.2s;
}
html.dark-mode .detail-section {
  background: linear-gradient(135deg, #1e293b 0%, #1a2332 100%);
  border-color: var(--border);
}
.detail-section:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
  transform: translateY(-1px);
}
.detail-section:last-child {
  margin-bottom: 0;
  padding-bottom: 20px;
  border-bottom: 1px solid #e8ecf1;
}
html.dark-mode .detail-section:last-child {
  border-bottom-color: var(--border);
}
.detail-section h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-light);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 8px;
}
html.dark-mode .detail-section h4 {
  border-bottom-color: var(--border);
}
.detail-section .info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 4px;
  font-size: 13px;
  border-bottom: 1px solid rgba(0,0,0,0.03);
  transition: background 0.15s;
  gap: 12px;
  border-radius: 4px;
}
.detail-section .info-row:hover {
  background: rgba(0,0,0,0.015);
}
.detail-section .info-row:last-child {
  border-bottom: none;
}
.detail-section .info-row .label {
  color: var(--text-light);
  min-width: 120px;
  max-width: 160px;
  font-weight: 500;
  flex-shrink: 0;
}
.detail-section .info-row > span:last-child {
  text-align: right;
  word-break: break-word;
  min-width: 0;
}

/* ─── Score Breakdown Bars ─── */
.score-bar-track {
  flex: 1;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #f1f5f9, #e2e8f0);
  overflow: hidden;
}
.score-bar-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #10b981, #059669);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.score-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.25), transparent);
  border-radius: 6px 6px 0 0;
}
.score-bar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 0;
}
.score-bar-label {
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  min-width: 100px;
  flex-shrink: 0;
}
.score-bar-value {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  min-width: 48px;
  text-align: right;
  flex-shrink: 0;
}

/* ─── Funnel Steps ─── */
.funnel-steps {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 4px 0 12px;
  overflow-x: auto;
}
.funnel-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
  position: relative;
}
.funnel-step .step-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  background: white;
  z-index: 1;
  transition: all 0.3s;
}
.funnel-step.completed .step-dot {
  background: var(--stage-color, #10b981);
  border-color: var(--stage-color, #10b981);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.15);
}
.funnel-step.active .step-dot {
  background: var(--stage-color, #3b82f6);
  border-color: var(--stage-color, #3b82f6);
  box-shadow: 0 0 0 4px rgba(59,130,246,0.2);
  transform: scale(1.15);
}
.funnel-step .step-label {
  font-size: 10px;
  color: #9ca3af;
  margin-top: 6px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
  transition: color 0.2s;
}
.funnel-step.active .step-label {
  color: var(--text);
  font-weight: 600;
}
.funnel-step.completed .step-label {
  color: #6b7280;
}
.funnel-step::before {
  content: '';
  position: absolute;
  top: 7px;
  left: -50%;
  right: 50%;
  height: 2px;
  background: #e5e7eb;
  z-index: 0;
}
.funnel-step:first-child::before {
  display: none;
}
.funnel-step.completed::before {
  background: var(--stage-color, #10b981);
}
.funnel-bar {
  height: 6px;
  border-radius: 3px;
  background: #f1f5f9;
  overflow: hidden;
  margin-top: 4px;
}
.funnel-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.funnel-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: rgba(255,255,255,0.3);
}

/* ─── Feature Card ─── */
.detail-panel > div > .card[style*="border-left: 4px"] {
  border-radius: 14px;
  overflow: hidden;
}

/* ─── Section Spacing ─── */
.detail-panel > div[style*="padding: 0 24px"] {
  padding: 0 32px 24px !important;
}

/* ─── Detail Item Grid (CDE Record etc) ─── */
.detail-item {
  padding: 14px 18px;
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border-radius: 10px;
  border-left: 3px solid var(--blue);
  transition: transform 0.15s, box-shadow 0.15s;
}
.detail-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.detail-item .di-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-light);
  margin-bottom: 4px;
  font-weight: 600;
}
.detail-item .di-value {
  font-size: 14px;
  font-weight: 600;
}
.detail-item.highlight {
  border-left-color: var(--accent);
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
}
.detail-item.warn {
  border-left-color: var(--accent-orange);
  background: linear-gradient(135deg, #fffbf0, #fef9ef);
}

/* ─── School Table Improvements ─── */
.school-table {
  border-collapse: separate;
  border-spacing: 0;
}
.school-table th {
  padding: 12px 14px;
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  border-bottom: 2px solid #e2e8f0;
}
.school-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  transition: background 0.15s;
}
.school-table tbody tr {
  transition: background 0.15s;
}
.school-table tbody tr:hover {
  background: #f0f5ff;
}
.school-table tbody tr.elop-row {
  background: linear-gradient(90deg, #f0fdf4, #fafffe);
}
.school-table tbody tr.elop-row:hover {
  background: linear-gradient(90deg, #dcfce7, #ecfdf5);
}

/* ─── Priority Labels ─── */
.priority-high {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  box-shadow: 0 1px 3px rgba(239,68,68,0.3);
}

/* ─── Enrich Action Buttons ─── */
.enrich-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 2px 8px rgba(0,51,102,0.2);
}
.enrich-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,51,102,0.3);
}
.enrich-action-btn.subtle {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  color: #475569;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.enrich-action-btn.subtle:hover {
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.enrich-action-btn.further {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  box-shadow: 0 2px 8px rgba(99,102,241,0.25);
}
.enrich-action-btn.further:hover {
  box-shadow: 0 4px 16px rgba(99,102,241,0.35);
}

/* ─── Queued Badge Animation ─── */
.enrich-queued-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #d97706;
  padding: 6px 14px;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-radius: 10px;
  border: 1px solid #fde68a;
}
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  animation: pulse-glow 1.5s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(245,158,11,0.4); }
  50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(245,158,11,0); }
}

/* ─── Breadcrumbs ─── */
.breadcrumbs {
  padding: 12px 0;
  font-size: 13px;
}
.breadcrumbs a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}
.breadcrumbs a:hover {
  color: var(--blue-light);
  text-decoration: underline;
}
.breadcrumb-sep {
  margin: 0 8px;
  color: #cbd5e1;
}
.breadcrumb-current {
  color: var(--text);
  font-weight: 600;
}

/* ─── Smooth Scroll ─── */
html {
  scroll-behavior: smooth;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .detail-header { padding: 20px; }
  .detail-sections { padding: 20px; gap: 16px; }
  .enrichment-checklist { margin: 0 16px 16px; padding: 16px; }
  .checklist-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-panel > div[style*="padding: 0 24px"] { padding: 0 16px 16px !important; }
}

/* ═══════════════════════════════════════════════════════════
   Resource Portal brand overrides — District Intelligence
   Palette: Navy #201C3F · Raspberry #BF3F62 · Indigo #4C59A1 · Sky #1A7EFB
   ═══════════════════════════════════════════════════════════ */

/* Poppins everywhere */
body, .header h1, .nav a, .card, .btn, input, select, textarea, button, h1, h2, h3, h4, h5 {
  font-family: 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Raspberry is the call-to-action color */
.btn-primary { background: var(--raspberry); color: #fff; border-color: var(--raspberry); }
.btn-primary:hover { background: var(--raspberry-deep); border-color: var(--raspberry-deep); opacity: 1; }
.enrich-btn { background: linear-gradient(135deg, var(--raspberry) 0%, var(--raspberry-deep) 100%); }
.enrich-btn:hover { box-shadow: 0 2px 10px rgba(191,63,98,0.35); }
.enrich-action-btn { background: linear-gradient(135deg, var(--raspberry) 0%, var(--raspberry-deep) 100%); }
.enrich-action-btn:hover { box-shadow: 0 4px 14px rgba(191,63,98,0.35); }
.bulk-bar-btn.enrich { background: linear-gradient(135deg, var(--raspberry) 0%, var(--raspberry-deep) 100%); }
.bulk-bar-btn.enrich:hover { box-shadow: 0 4px 14px rgba(191,63,98,0.35); }

/* Pill-shaped buttons echo the rounded logo geometry */
.btn, .btn-primary, .btn-secondary, .back-btn, .enrich-btn, .enrich-action-btn,
.bulk-bar-btn, .bulk-mode-btn, .pagination-btn, .theme-toggle {
  border-radius: 999px;
}

/* Sky-blue links, raspberry-forward accents */
a:hover { color: var(--raspberry); }
.nav a.active { color: var(--raspberry); border-bottom-color: var(--raspberry); }
.nav-dropdown-toggle.active { color: var(--raspberry); border-bottom-color: var(--raspberry); }
.district-card.fully-enriched { border-top-color: var(--raspberry); }
.header .logo { background: rgba(255,255,255,0.14); }

/* Focus rings in brand navy */
.search-bar input:focus, .filters select:focus, .filters input:focus,
input:focus, select:focus, textarea:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(76,89,161,0.15);
}

html.dark-mode a:hover { color: #e77a97; }
html.dark-mode .nav a.active, html.dark-mode .nav-dropdown-toggle.active { color: #e77a97; border-bottom-color: #e77a97; }

/* ═══════════════════════════════════════════════════════════════════════════
   DISTRICT DETAIL — RESOURCE PORTAL BRAND SYSTEM
   Source: https://resource-portal-brand-guide.vercel.app/
   Poppins only · Navy #201C3F · Raspberry #BF3F62 · Indigo #4C59A1
   Sky #1A7EFB · Mist #F3F6FE · Slate #535353 · 16px cards · pill buttons
   Loaded last so it wins over the older ad-hoc detail-page styles above.
   ══════════════════════════════════════════════════════════════════════════ */

.dd-panel {
  --rp-r:      4px;    /* card radius — crisp (overrides the guide's 16px by request) */
  --rp-r-sm:   3px;
  --rp-r-xs:   2px;
  --rp-line:   rgba(32, 28, 63, 0.09);
  --rp-line-2: rgba(32, 28, 63, 0.05);
  --rp-shadow:   0 1px 2px rgba(32,28,63,.04), 0 10px 28px -14px rgba(32,28,63,.16);
  --rp-shadow-h: 0 2px 4px rgba(32,28,63,.05), 0 18px 44px -18px rgba(32,28,63,.24);
  border-radius: var(--rp-r);
  box-shadow: var(--rp-shadow);
  border: 1px solid var(--rp-line-2);
  overflow: visible;                 /* let the sticky tab bar work */
}
/* Flip-safe surfaces. --mist is a fixed brand hex and does NOT change in dark
   mode, so surfaces must use these tokens, never var(--mist) directly. */
.dd-panel {
  --rp-surface:   #F3F6FE;              /* Mist */
  --rp-surface-2: #E9EEFB;              /* Mist, one step down */
  --rp-ink-muted: var(--text-light);
}
html.dark-mode .dd-panel {
  --rp-line:      rgba(255,255,255,.10);
  --rp-line-2:    rgba(255,255,255,.06);
  --rp-surface:   #2A2650;
  --rp-surface-2: #322D5C;
}

/* ─── Type scale (brand guide) ─── */
.dd-panel h2 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.dd-panel h3 { font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; }
.dd-panel h4 { font-weight: 600; letter-spacing: 0.02em; }
.dd-panel p,
.dd-panel li { line-height: 1.6; }

/* ─── Cards ─── */
.dd-panel .card,
.dd-panel > div > .card {
  background: var(--card);
  border: 1px solid var(--rp-line);
  border-radius: var(--rp-r);
  box-shadow: var(--rp-shadow);
  margin-bottom: 0;
  overflow: hidden;
  transition: box-shadow .22s ease, transform .22s ease;
}
.dd-panel .card:hover,
.dd-panel > div > .card:hover {
  box-shadow: var(--rp-shadow-h);
  transform: none;
}
/* Retire the 4px left rails — the accent now lives in the header tint. */
.dd-panel .card[style*="border-left"] { border-left-width: 1px !important; border-left-color: var(--rp-line) !important; }

.dd-panel .card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--rp-line-2);
  background: transparent;
}
.dd-panel .card-header h3 { font-size: 15px; font-weight: 600; color: var(--text); margin: 0; }
.dd-panel .card-body { padding: 20px; }

/* ─── Section blocks ─── */
.dd-panel .detail-section h4 {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .08em; color: var(--slate); margin-bottom: 12px;
}
html.dark-mode .dd-panel .detail-section h4 { color: var(--text-light); }
.dd-panel .info-row { font-size: 13px; line-height: 1.6; }

/* ─── Pill badges (brand: fully rounded) ─── */
.dd-panel .badge { border-radius: 3px; padding: 3px 11px; font-weight: 600; letter-spacing: .01em; }

/* ═══ OVERVIEW TAB — two-column brand grid ═══ */
#dtab-overview.active {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  padding: 4px 24px 28px;
  align-items: start;
}
#dtab-overview > div { padding: 0 !important; margin: 0 !important; }
#dtab-overview > .ov-full { grid-column: 1 / -1; }
#dtab-overview > .detail-sections { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 1024px) {
  #dtab-overview.active { grid-template-columns: 1fr; padding: 4px 16px 24px; }
  #dtab-overview > .detail-sections { grid-template-columns: 1fr; }
}

/* Overview card chrome: a soft Mist header with a brand accent tile */
.ov-card > .card-header {
  background: linear-gradient(180deg, var(--rp-surface) 0%, transparent 100%);
  display: flex; align-items: center; gap: 10px;
}
html.dark-mode .ov-card > .card-header { background: linear-gradient(180deg, rgba(76,89,161,.16) 0%, transparent 100%); }
.ov-tile {
  width: 30px; height: 30px; border-radius: 3px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; line-height: 1;
  background: linear-gradient(135deg, var(--navy) 0%, var(--indigo) 100%);
  color: #fff; box-shadow: 0 3px 10px -3px rgba(32,28,63,.45);
}
.ov-tile.rasp { background: linear-gradient(135deg, var(--raspberry) 0%, var(--raspberry-deep) 100%);
                box-shadow: 0 3px 10px -3px rgba(191,63,98,.5); }
.ov-tile.sky  { background: linear-gradient(135deg, var(--sky) 0%, var(--indigo) 100%);
                box-shadow: 0 3px 10px -3px rgba(26,126,251,.45); }

/* Link chips (Key URLs) */
.ov-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 3px;
  font-size: 12px; font-weight: 500; text-decoration: none;
  background: var(--rp-surface); color: var(--navy);
  border: 1px solid var(--rp-line);
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}
.ov-chip:hover {
  background: var(--navy); color: #fff; border-color: var(--navy);
  transform: translateY(-1px);
}
html.dark-mode .ov-chip { background: rgba(76,89,161,.18); color: var(--text); }
html.dark-mode .ov-chip:hover { background: var(--indigo); color: #fff; }

/* ─── All tabs — brand type scale ────────────────────────────────────────
   Poppins only. Weights limited to the guide's set: 300/400/500/600/700/800.
   Display 800 @ -2% tracking · H2 700 · Card title (H3) 600 · Body 400 @ 1.6
   Sizes below are the house scale; the guide fixes weight/leading/tracking.  */

.dtab-panel,
.dtab-panel input,
.dtab-panel select,
.dtab-panel button,
.dtab-panel textarea {
  font-family: 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Body — 13px / Regular / 1.6 */
.dtab-panel       { font-size: 13px; font-weight: 400; line-height: 1.6; }
.dtab-panel p,
.dtab-panel li,
.dtab-panel .card-body { font-size: 13px; font-weight: 400; line-height: 1.6; }

/* Card title (H3) — SemiBold 600 */
.dtab-panel .card-header h3 {
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35;
}
/* Meta text riding inside a card title stays Regular */
.dtab-panel .card-header h3 span:not(.ov-tile):not(.score-badge) { font-weight: 400; }

/* Section label (H4) — SemiBold, uppercase micro-label */
.dtab-panel .detail-section h4 {
  font-size: 11px; font-weight: 600; line-height: 1.4;
  text-transform: uppercase; letter-spacing: 0.08em;
}

/* Key/value rows — label Medium, value Regular */
.dtab-panel .info-row               { font-size: 13px; font-weight: 400; line-height: 1.6; }
.dtab-panel .info-row .label        { font-size: 13px; font-weight: 500; }
.dtab-panel .info-row strong        { font-weight: 600; }

/* Badges & chips — SemiBold micro */
.dtab-panel .badge {
  font-size: 11px; font-weight: 600; line-height: 1.5; letter-spacing: 0.01em;
}
.dtab-panel .priority-high {
  font-size: 10px; font-weight: 700; line-height: 1.5;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.dtab-panel .ov-chip { font-size: 12px; font-weight: 500; line-height: 1.5; }

/* Buttons — Medium/SemiBold, never below 12px */
.dtab-panel .enrich-action-btn        { font-size: 13px; font-weight: 600; line-height: 1.4; }
.dtab-panel .enrich-action-btn.subtle { font-size: 12px; font-weight: 500; }

/* Composite Score module */
.dtab-panel .score-badge           { font-size: 16px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
.dtab-panel .score-summary         { font-size: 13px; font-weight: 400; line-height: 1.6; }
.dtab-panel .score-summary strong  { font-weight: 600; }
.dtab-panel .score-breakdown-header {
  font-size: 11px; font-weight: 600; line-height: 1.4;
  text-transform: uppercase; letter-spacing: 0.1em;
}
.dtab-panel .score-bar-label       { font-size: 13px; font-weight: 500; line-height: 1.5; }
.dtab-panel .score-bar-value       { font-size: 13px; font-weight: 600; line-height: 1.5;
                                        font-variant-numeric: tabular-nums; }
.dtab-panel .score-info-btn        { font-size: 12px; font-weight: 400; line-height: 1; }

/* Numeric display — ExtraBold at display tracking */
.dtab-panel .ov-stat-value {
  font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.dtab-panel .ov-stat-label {
  font-size: 11px; font-weight: 500; line-height: 1.5;
  letter-spacing: 0.02em; color: var(--text-light); margin-top: 2px;
}
/* Feature-card pillar titles are "feature labels" — SemiBold per the guide */
.dtab-panel .ov-pillar-title { font-size: 12px; font-weight: 600; line-height: 1.4; }


/* ─── Crisp corners (user directive: cards must not read as rounded) ──────────
   One scale for the whole district page: cards 4 · blocks 3 · tiles/meters 2 ·
   badges 3. Overrides the brand guide's 16px card radius by explicit request. */
.dd-panel,
.dd-panel .card,
.dd-panel > div > .card,
.dd-panel > div > .card[style*="border-left"],
.dd-panel .enrichment-checklist,
.dd-panel .district-logo,
.dd-panel .district-logo-placeholder { border-radius: 4px; }

.dd-panel .detail-item,
.dd-panel .detail-section,
.dd-panel .score-summary        { border-radius: 3px; }

.dd-panel .badge,
.dd-panel .detail-header .badge,
.dd-panel .ov-chip,
.dd-panel .ov-tile,
.dd-panel .score-badge          { border-radius: 3px; }

.dd-panel .card-progress-track,
.dd-panel .card-progress-fill,
.dd-panel .score-bar-track,
.dd-panel .score-bar-fill       { border-radius: 2px; }

/* Meter cap (pseudo-element — not reached by the selectors above). */
.dd-panel .score-bar-fill::after { border-radius: 2px 2px 0 0; }

/* Tab bar sits flush against the header — no stray corner rounding. */
.dd-panel .dtabs                { border-radius: 0; }
