:root {
  --navy: #1a2744;
  --navy-light: #2a3f5f;
  --accent: #c0392b;
  --accent-gold: #d4a017;
  --bg: #f5f6f8;
  --card-bg: #fff;
  --text: #2c3e50;
  --text-light: #7f8c8d;
  --border: #e0e4e8;
  --green: #27ae60;
  --red: #e74c3c;
  --verified-bg: #eafaf1;
  --verified-border: #27ae60;
  --flagged-bg: #fef5e7;
  --flagged-border: #f39c12;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 14px;
}

header {
  background: var(--navy);
  color: #fff;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 48px;
}

header h1 { font-size: 1.1rem; font-weight: 700; white-space: nowrap; }
header h1 a { color: #fff; text-decoration: none; }

nav { display: flex; gap: 0.2rem; overflow-x: auto; }

.nav-link {
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  padding: 0.35rem 0.6rem;
  border-radius: 5px;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.15s;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.1); }
.nav-link.active { color: #fff; background: rgba(255,255,255,0.15); }

main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.25rem;
  min-height: calc(100vh - 48px - 50px);
}

footer {
  text-align: center;
  padding: 1rem;
  color: var(--text-light);
  font-size: 0.75rem;
  border-top: 1px solid var(--border);
}
footer a { color: var(--navy-light); }

.loading { text-align: center; padding: 3rem; color: var(--text-light); }

.subtitle { color: var(--text-light); font-size: 0.85rem; margin-bottom: 1.25rem; }

/* Stat cards */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid var(--border);
}

.stat-card .label {
  font-size: 0.7rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.15rem;
}

.stat-card .value { font-size: 1.4rem; font-weight: 700; color: var(--navy); }
.stat-card .sub { font-size: 0.75rem; color: var(--text-light); margin-top: 0.1rem; }

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 1.25rem;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}

.card h2 { font-size: 1rem; margin-bottom: 0.75rem; color: var(--navy); }
.card h3 { font-size: 0.9rem; margin-bottom: 0.5rem; color: var(--navy-light); }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }

th {
  text-align: left;
  padding: 0.45rem 0.5rem;
  border-bottom: 2px solid var(--border);
  color: var(--text-light);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  position: sticky;
  top: 48px;
  background: var(--card-bg);
  z-index: 10;
}

td { padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--border); }
tr:hover td { background: #f8f9fa; }
tr:last-child td { border-bottom: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; font-family: "SF Mono", "Consolas", monospace; }
.positive { color: var(--red); }
.negative { color: var(--green); }

/* Bar chart */
.bar-row { display: flex; align-items: center; margin-bottom: 0.4rem; font-size: 0.8rem; cursor: pointer; }
.bar-row:hover .bar-label { color: var(--accent); }
.bar-label { width: 200px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; height: 20px; background: #eef0f3; border-radius: 3px; overflow: hidden; margin: 0 0.5rem; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--navy), var(--navy-light)); border-radius: 3px; transition: width 0.5s ease; }
.bar-value { width: 90px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; flex-shrink: 0; }

/* Filters */
.filters { display: flex; gap: 0.6rem; margin-bottom: 1rem; flex-wrap: wrap; align-items: flex-end; }
.filter-group { display: flex; flex-direction: column; gap: 0.2rem; }
.filter-group label { font-size: 0.7rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.4px; }

input, select {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.8rem;
  background: #fff;
  color: var(--text);
}
input:focus, select:focus { outline: none; border-color: var(--navy-light); }

.btn {
  padding: 0.4rem 1rem;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s;
}
.btn:hover { background: var(--navy-light); }
.btn-sm { padding: 0.25rem 0.6rem; font-size: 0.75rem; }

.btn-pdf {
  background: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.btn-pdf:hover { background: #a93226; }

/* Dept navigation */
.dept-back { display: inline-block; margin-bottom: 0.75rem; color: var(--navy-light); text-decoration: none; font-size: 0.8rem; }
.dept-back:hover { color: var(--navy); }
.dept-header { margin-bottom: 1.25rem; }
.dept-header h2 { font-size: 1.3rem; color: var(--navy); margin-bottom: 0.2rem; }
.dept-header .mission { color: var(--text-light); font-size: 0.85rem; }

/* Narratives */
.narrative { background: #f8f9fa; border-left: 3px solid var(--navy-light); padding: 0.75rem; margin-bottom: 0.5rem; border-radius: 0 5px 5px 0; }
.narrative .meta { font-size: 0.7rem; color: var(--text-light); margin-bottom: 0.25rem; text-transform: uppercase; }
.narrative .content { font-size: 0.8rem; line-height: 1.5; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* === VERIFICATION-SPECIFIC STYLES === */

/* Checklist */
.checklist-dept {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
.checklist-dept:hover { background: #f8f9fa; }
.checklist-dept:last-child { border-bottom: none; }

.checklist-dept .dept-name { flex: 1; font-weight: 500; }
.checklist-dept .dept-counts { color: var(--text-light); font-size: 0.75rem; display: flex; gap: 0.75rem; }
.checklist-dept .dept-counts span { white-space: nowrap; }

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid var(--border);
  background: #fff;
}
.status-dot.verified { background: var(--green); border-color: var(--green); }
.status-dot.flagged { background: var(--accent-gold); border-color: var(--accent-gold); }

.pdf-link { font-size: 0.75rem; color: var(--accent); text-decoration: none; flex-shrink: 0; }
.pdf-link:hover { text-decoration: underline; }

/* Collapsible sections */
.section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 0.6rem 0;
  user-select: none;
}
.section-toggle h2 { margin: 0; display: flex; align-items: center; gap: 0.5rem; }
.section-toggle .count { font-size: 0.75rem; color: var(--text-light); font-weight: 400; }
.section-toggle .arrow { transition: transform 0.2s; font-size: 0.7rem; color: var(--text-light); }
.section-toggle .arrow.open { transform: rotate(90deg); }
.section-content { display: none; padding-top: 0.5rem; }
.section-content.open { display: block; }

/* Verify toolbar */
.verify-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.verify-toolbar .btn-verify {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--green);
  background: #fff;
  color: var(--green);
  border-radius: 5px;
  font-size: 0.75rem;
  cursor: pointer;
  font-weight: 600;
}
.verify-toolbar .btn-verify:hover { background: var(--verified-bg); }
.verify-toolbar .btn-verify.active { background: var(--green); color: #fff; }

.verify-toolbar .btn-flag {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--accent-gold);
  background: #fff;
  color: #b7950b;
  border-radius: 5px;
  font-size: 0.75rem;
  cursor: pointer;
  font-weight: 600;
}
.verify-toolbar .btn-flag:hover { background: var(--flagged-bg); }
.verify-toolbar .btn-flag.active { background: var(--accent-gold); color: #fff; }

/* Progress bar */
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}
.progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 3px;
  transition: width 0.3s;
}

.progress-text { font-size: 0.75rem; color: var(--text-light); margin-bottom: 1rem; }

/* Table font for verification */
.verify-table td { font-family: "SF Mono", "Consolas", monospace; font-size: 0.75rem; }
.verify-table th { font-size: 0.65rem; }

@media (max-width: 768px) {
  .header-inner { flex-direction: column; height: auto; padding: 0.5rem 0; gap: 0.35rem; }
  nav { width: 100%; justify-content: center; flex-wrap: wrap; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .bar-label { width: 120px; font-size: 0.7rem; }
  .bar-value { width: 70px; font-size: 0.75rem; }
  .filters { flex-direction: column; }
  .checklist-dept .dept-counts { display: none; }
}
