/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #1a1a1a;
  background: #f8f9fa;
}

a { color: #0056b3; text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

/* Disclaimer Banner */
.disclaimer-banner {
  background: #fff3cd;
  color: #664d03;
  border-bottom: 1px solid #ffecb5;
  padding: 0.5rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Navigation */
.main-nav {
  background: #1a2332;
  padding: 0.75rem 0;
  border-bottom: 3px solid #0056b3;
}
.main-nav .container { display: flex; align-items: center; justify-content: space-between; }
.nav-brand { color: #fff; font-weight: 700; font-size: 1.2rem; }
.nav-brand:hover { text-decoration: none; color: #ccc; }
.nav-links { list-style: none; display: flex; gap: 1.5rem; }
.nav-links a { color: #ccc; font-size: 0.95rem; }
.nav-links a:hover, .nav-links a.active { color: #fff; text-decoration: none; }

/* Page Header */
h1 { margin: 1.5rem 0 1rem; font-size: 1.75rem; color: #1a2332; }
h2 { margin: 1.5rem 0 0.75rem; font-size: 1.35rem; color: #1a2332; }
h3 { margin: 1rem 0 0.5rem; font-size: 1.1rem; color: #333; }

/* Data Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #dee2e6;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}
.data-table th {
  background: #1a2332;
  color: #fff;
  padding: 0.6rem 0.75rem;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}
.data-table th a { color: #fff; }
.data-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #dee2e6;
  vertical-align: top;
}
.data-table tr:nth-child(even) { background: #f8f9fa; }
.data-table tr:hover { background: #e9ecef; }

/* Sortable column headers */
.sortable { cursor: pointer; user-select: none; }
.sortable:hover { background: #2a3a4f; }
.sort-arrow { margin-left: 0.3rem; font-size: 0.75rem; }

/* Filter Bar */
.filter-bar {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}
.filter-group { display: flex; flex-direction: column; gap: 0.25rem; }
.filter-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.filter-group select,
.filter-group input {
  padding: 0.4rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
  background: #fff;
}
.filter-group select { min-width: 160px; }
.filter-group input[type="date"] { min-width: 140px; }
.filter-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.filter-tags label.tag-check {
  font-size: 0.85rem;
  font-weight: 400;
  text-transform: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
}
.filter-reset {
  background: #6c757d;
  color: #fff;
  border: none;
  padding: 0.4rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  align-self: flex-end;
}
.filter-reset:hover { background: #5a6268; }

/* Tag Pills */
.tag { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 10px; font-size: 0.75rem; font-weight: 600; color: #fff; margin: 0.1rem; }
.tag-heritage { background: #795548; }
.tag-integrity { background: #7b1fa2; }
.tag-planning { background: #1565c0; }
.tag-procurement { background: #e65100; }
.tag-taxes { background: #c62828; }

/* Vote Badges */
.vote { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.8rem; font-weight: 600; }
.vote-yes { background: #d4edda; color: #155724; }
.vote-no { background: #f8d7da; color: #721c24; }
.vote-abstain { background: #e2e3e5; color: #383d41; }
.vote-conflict { background: #fff3cd; color: #856404; }
.vote-absent { background: #d6d8db; color: #6c757d; }

/* Result Badge */
.result { font-weight: 700; }
.result-carried { color: #155724; }
.result-lost { color: #721c24; }

/* Money */
.money { font-family: "SF Mono", SFMono-Regular, Menlo, monospace; white-space: nowrap; }

/* Cards / Sections */
.card {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.card h2 { margin-top: 0; }

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 1rem;
  text-align: center;
}
.stat-value { font-size: 2rem; font-weight: 700; color: #1a2332; }
.stat-label { font-size: 0.85rem; color: #6c757d; margin-top: 0.25rem; }

/* Councillor List */
.councillor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.councillor-card {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 1rem;
  transition: box-shadow 0.15s;
}
.councillor-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.councillor-card h3 { margin: 0 0 0.5rem; }
.councillor-card .meta { font-size: 0.85rem; color: #6c757d; }

/* Motion Detail */
.motion-meta { color: #6c757d; font-size: 0.9rem; margin-bottom: 1rem; }
.motion-text {
  background: #f8f9fa;
  border-left: 4px solid #0056b3;
  padding: 1rem;
  margin: 1rem 0;
  white-space: pre-wrap;
  font-size: 0.9rem;
  line-height: 1.7;
}

/* Similarity Bar */
.similarity-bar-bg {
  background: #e9ecef;
  border-radius: 4px;
  height: 1.2rem;
  width: 100%;
  max-width: 200px;
  display: inline-block;
  vertical-align: middle;
}
.similarity-bar-fill {
  background: #0056b3;
  height: 100%;
  border-radius: 4px;
  min-width: 2px;
}

/* Footer */
.site-footer {
  margin-top: 3rem;
  padding: 1.5rem 0;
  border-top: 1px solid #dee2e6;
  text-align: center;
  font-size: 0.85rem;
  color: #6c757d;
}

/* Responsive */
@media (max-width: 768px) {
  .filter-bar { flex-direction: column; }
  .data-table { font-size: 0.8rem; }
  .data-table th, .data-table td { padding: 0.4rem; }
  .nav-links { gap: 1rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .councillor-grid { grid-template-columns: 1fr; }
  h1 { font-size: 1.4rem; }
}

/* Overflow wrapper for tables */
.table-wrap { overflow-x: auto; }

/* Download page */
.download-link {
  display: inline-block;
  background: #0056b3;
  color: #fff;
  padding: 0.6rem 1.25rem;
  border-radius: 4px;
  font-weight: 600;
  margin: 1rem 0;
}
.download-link:hover { background: #004494; text-decoration: none; color: #fff; }

/* Motion count */
.motion-count { color: #6c757d; font-size: 0.9rem; margin-bottom: 1rem; }
