/* ============================================================
   RUPS Tracker — PESTalytix LLC
   Single-page restricted use pesticide tracker
   Brand: #031f33 (dark navy)
   ============================================================ */

:root {
  --brand: #031f33;
  --brand-light: #0a3a5c;
  --brand-lighter: #e8f0f5;
  --brand-accent: #1a7ab5;
  --text-primary: #1a1a2e;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --bg: #f7f9fb;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --border-light: #edf2f7;
  --success: #2f855a;
  --success-bg: #f0fff4;
  --warning: #c05621;
  --danger: #c53030;
  --danger-bg: #fff5f5;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(3, 31, 51, 0.06);
  --shadow-md: 0 4px 12px rgba(3, 31, 51, 0.08);
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Cascadia Code", "Consolas", monospace;
  --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.6;
  font-size: 15px;
}

/* ---- NAV ---- */
.site-nav {
  background: var(--brand);
  color: #fff;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(3, 31, 51, 0.2);
}
.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}
.nav-brand-icon {
  width: 26px;
  height: 26px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.nav-brand-text {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.nav-brand-text span {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
  margin-left: 5px;
  font-size: 12px;
}
.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
}
.nav-links a {
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 5px;
  transition: all var(--transition);
}
.nav-links a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* ---- HERO ---- */
.site-hero {
  background: var(--brand);
  color: #fff;
  padding: 3rem 2rem;
  text-align: center;
}
.hero-inner {
  max-width: 680px;
  margin: 0 auto;
}
.hero-inner h1 {
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0;
}
.hero-inner p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  line-height: 1.5;
  margin-top: 0.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
/* Hero CTAs */
.hero-ctas {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 1rem;
}
.hero-btn {
  display: inline-flex;
  align-items: center;
  padding: 9px 22px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
  font-family: var(--font-body);
}
.hero-btn.primary {
  background: #fff;
  color: var(--brand);
}
.hero-btn.primary:hover {
  background: #e8f0f5;
}
.hero-btn.secondary {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.hero-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

#hero-search-input::placeholder {
  color: rgba(255,255,255,0.5);
}

.hero-update {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 0.5rem;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--font-mono);
}
.hero-update-divider {
  opacity: 0.4;
  margin: 0 2px;
}
.hero-update .dot {
  width: 6px;
  height: 6px;
  background: #68d391;
  border-radius: 50%;
  display: inline-block;
}

/* ---- MAIN ---- */
.main-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}
.section {
  margin-top: 2rem;
}
.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.85rem;
}
.section-header h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}
.section-header .badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--brand-lighter);
  color: var(--brand-light);
}

/* ---- TRUST STRIP ---- */
.trust-strip {
  margin-top: 1.25rem;
  text-align: center;
}
.trust-items {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.trust-item {
  white-space: nowrap;
}
.trust-divider {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}

/* Section notes */
.section-note {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.85rem;
}
.section-note a {
  color: var(--brand-accent);
  text-decoration: none;
}
.section-note a:hover {
  text-decoration: underline;
}

/* ---- KPI CARDS ---- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: -2rem;
  position: relative;
  z-index: 10;
}
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.35rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
  text-align: center;
}
.kpi-card:hover { box-shadow: var(--shadow-md); }
.kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.kpi-value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: -0.02em;
}
.kpi-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---- REASON BREAKDOWN ---- */
.reason-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}
.reason-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}
.reason-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.reason-icon.groundwater { background: #ebf8ff; color: #2b6cb0; }
.reason-icon.neonicotinoid { background: #fefcbf; color: #975a16; }
.reason-icon.herbicide { background: #f0fff4; color: #276749; }
.reason-icon.other { background: #faf5ff; color: #6b46c1; }
.reason-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.reason-count { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }

/* ---- CHANGELOG ---- */
.changes-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.change-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  font-size: 13px;
}
.change-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
}
.change-badge.added { background: var(--success-bg); color: var(--success); }
.change-badge.removed { background: var(--danger-bg); color: var(--danger); }
.change-source {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  flex-shrink: 0;
}
.change-source.epa { background: #ebf8ff; color: #2b6cb0; }
.change-source.mdar { background: #faf5ff; color: #6b46c1; }
.change-text {
  color: var(--text-secondary);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.change-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.no-changes {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 13px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ---- TABLE ---- */
.table-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.table-tabs {
  display: flex;
  gap: 3px;
  background: var(--border-light);
  padding: 3px;
  border-radius: 8px;
}
.table-tab {
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: all var(--transition);
  font-family: var(--font-body);
}
.table-tab:hover { color: var(--text-primary); }
.table-tab.active {
  background: var(--bg-card);
  color: var(--brand);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}
.search-box {
  position: relative;
  flex: 0 1 300px;
}
.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}
.search-box input {
  width: 100%;
  padding: 7px 12px 7px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-card);
  transition: border-color var(--transition);
}
.search-box input:focus {
  outline: none;
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(26, 122, 181, 0.1);
}
.search-box input::placeholder { color: var(--text-muted); }
.table-meta {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.data-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead {
  background: var(--brand);
  color: #fff;
}
.data-table thead th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.data-table thead th:hover { background: var(--brand-light); }
.data-table thead th .sort-arrow {
  margin-left: 4px;
  font-size: 10px;
  opacity: 0.4;
}
.data-table thead th.sorted .sort-arrow { opacity: 1; }
.data-table tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}
.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody td {
  padding: 9px 14px;
  color: var(--text-secondary);
  vertical-align: top;
}
.data-table tbody td:first-child {
  color: var(--text-primary);
  font-weight: 500;
}
.source-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.source-badge.epa { background: #ebf8ff; color: #2b6cb0; }
.source-badge.ma { background: #faf5ff; color: #6b46c1; }

/* Pagination */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid var(--border-light);
  background: #fafbfc;
  font-size: 12px;
  color: var(--text-muted);
}
.pagination-info { font-family: var(--font-mono); }
.pagination-buttons {
  display: flex;
  gap: 4px;
}
.pagination-buttons button {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  border-radius: 5px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all var(--transition);
}
.pagination-buttons button:hover:not(:disabled) {
  border-color: var(--brand-accent);
  color: var(--brand);
}
.pagination-buttons button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination-buttons button.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* ---- DOWNLOADS ---- */
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.download-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: all var(--transition);
}
.download-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--brand-accent);
}
.download-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--danger-bg);
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  font-family: var(--font-mono);
}
.download-info h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.download-info p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ---- FOOTER ---- */
.site-footer {
  background: var(--brand);
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  padding: 1.5rem 2rem;
  font-size: 12px;
  margin-top: 3rem;
}
.site-footer a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
}
.site-footer a:hover { color: #fff; }
.footer-disclaimer {
  max-width: 680px;
  margin: 6px auto 0;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  line-height: 1.4;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .table-controls { flex-direction: column; align-items: stretch; }
  .search-box { flex: 1 1 100%; }
  .nav-links { display: none; }
}
@media (max-width: 600px) {
  body { font-size: 14px; }
  .site-hero { padding: 1.5rem 1rem 3rem; }
  .hero-inner h1 { font-size: 1.375rem; }
  .main-container { padding: 0 1rem 3rem; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi-value { font-size: 22px; }
  .reason-grid { grid-template-columns: 1fr; }
  .download-grid { grid-template-columns: 1fr; }
  .data-table { font-size: 12px; }
  .data-table thead th, .data-table tbody td { padding: 7px 8px; }
  .change-item { flex-wrap: wrap; }
  .change-date { width: 100%; margin-top: 2px; }
}

/* Scroll-to-top */
.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  z-index: 50;
}
.scroll-top.visible { opacity: 1; pointer-events: all; }

/* ---- FAQ SECTION ---- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
}
.faq-item h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 0.4rem 0;
  color: var(--text-primary);
}
.faq-item p {
  font-size: 13.5px;
  line-height: 1.6;
  margin: 0;
  color: var(--text-secondary);
}

/* ---- SCREEN READER ONLY ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}