/* Dados Eleitorais — estilos */

/* Light (default) */
:root,
[data-theme="light"] {
  --bg: #f5f5f0;
  --bg-elevated: #fff;
  --bg-card: #fff;
  --text: #1a1a1a;
  --text-muted: #5c5c52;
  --accent: #a67c00;
  --accent-hover: #8a6800;
  --border: #ddd;
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --radius: 8px;
  --space: 1rem;
  --max-width: 960px;
}

[data-theme="light"] .table tbody tr:hover,
:root .table tbody tr:hover {
  background: rgba(0, 0, 0, 0.03);
}

/* Dark */
[data-theme="dark"] {
  --bg: #0f0f0f;
  --bg-elevated: #1a1a1a;
  --bg-card: #222;
  --text: #e8e6e3;
  --text-muted: #9b9892;
  --accent: #c9a227;
  --accent-hover: #ddb82a;
  --border: #333;
}

[data-theme="dark"] .table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space);
}

/* Header */
.site-header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: var(--space) 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text);
  text-decoration: none;
}

.logo:hover {
  color: var(--accent);
}

.site-header nav a {
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 1.5rem;
}

.site-header nav a:hover {
  color: var(--accent);
}

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  margin-left: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.theme-toggle svg {
  width: 1.125rem;
  height: 1.125rem;
}

/* Default (light): show moon icon = "switch to dark" */
.theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
}

/* Main */
.main {
  flex: 1;
  padding: 2rem 0;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 1.5rem;
}

/* Filtros */
.filtros {
  margin-bottom: 1.5rem;
}

.filtros-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space);
  align-items: end;
}

.filtros label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.filtros label span {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.filtros input,
.filtros select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
}

.filtros input:focus,
.filtros select:focus {
  outline: none;
  border-color: var(--accent);
}

.filtros-actions {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: background 0.15s, color 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

/* Table */
.resultado-info {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.table td.num {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.politico-nome {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.link {
  color: var(--accent);
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.pagination-info {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Detail page */
.breadcrumb {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.detalhe-header {
  margin-bottom: 2rem;
}

.detalhe-meta {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 1rem;
}

.numero-urna {
  margin: 0.25rem 0 0;
  font-size: 0.9375rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

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

.card h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--text-muted);
}

.card h2 .badge {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent);
}

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

.dl-grid dt {
  color: var(--text-muted);
  font-weight: 500;
}

.dl-grid dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

.metricas-grid {
  grid-template-columns: auto 1fr;
  gap: 0.5rem 2rem;
}

/* Cards de métricas (sobreposição) */
.metricas-cards {
  margin-bottom: 1.5rem;
}

.metricas-cards-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
}

.metricas-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.metric-card-sigla {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.metric-card-value {
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  color: var(--text);
}

.metric-card-desc {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.metric-detail {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.metric-detail-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.metric-detail-placeholder {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.metric-detail-body {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.metric-detail-body p {
  margin: 0 0 0.35rem;
}

.metric-detail-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
}

.sobreposicao-form .filtros-grid {
  align-items: end;
}

.sobreposicao-form select {
  min-width: 0;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 1.1rem) 50%, calc(100% - 0.75rem) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.sobreposicao-form select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Pivot table (drill-down município → zona → seção) */
.table-pivot .pivot-toggle-col {
  width: 2.5rem;
  padding: 0.35rem 0.5rem;
  vertical-align: middle;
}

.pivot-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  transition: color 0.15s, background 0.15s;
}

.pivot-toggle:hover {
  color: var(--accent);
  background: var(--bg-card);
}

.pivot-toggle::before {
  content: "▶";
}

.pivot-toggle[aria-expanded="true"]::before {
  content: "▼";
}

.pivot-row.pivot-child {
  display: none;
}

.pivot-row.pivot-child.pivot-show {
  display: table-row;
}

.pivot-row.pivot-municipio {
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .pivot-row.pivot-municipio {
  background: rgba(255, 255, 255, 0.03);
}

.pivot-row.pivot-zona.pivot-show {
  background: rgba(0, 0, 0, 0.01);
}

[data-theme="dark"] .pivot-row.pivot-zona.pivot-show {
  background: rgba(255, 255, 255, 0.02);
}

.pivot-indent-1 { padding-left: 1.5rem; }
.pivot-indent-2 { padding-left: 2.5rem; }

.table-pivot .pivot-secao td {
  font-size: 0.9375rem;
}

/* Slots de seleção (sobreposição) */
.slots-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  min-width: 0;
}

@media (max-width: 520px) {
  .slots-grid {
    grid-template-columns: 1fr;
  }
}

.slot {
  min-width: 0;
}

.slot-label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.slot-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.slot-btn:hover {
  border-color: var(--accent);
  background: var(--bg-elevated);
}

.slot-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-btn:not([data-selected]) .slot-text {
  color: var(--text-muted);
}

.slot-arrow {
  flex-shrink: 0;
  margin-left: 0.5rem;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
}

/* Dashboard home */
.page-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.page-hero-text h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0 0 0.4rem;
}

.page-hero-text p {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 52ch;
  margin: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid;
}

.badge-green {
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] .badge-green {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.6);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.kpi-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  transform: translateY(-1px);
}

.kpi-card-accent {
  border-top: 3px solid var(--accent);
}

.kpi-card-green {
  border-top: 3px solid #16a34a;
}

.kpi-card-amber {
  border-top: 3px solid #d97706;
}

.kpi-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.kpi-value {
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.08em;
  line-height: 1;
  color: var(--text);
  margin-bottom: 0.4rem;
  font-variant-numeric: tabular-nums;
}

.kpi-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.kpi-icon {
  position: absolute;
  right: 1.25rem;
  top: 1.25rem;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.kpi-icon-accent {
  background: rgba(166, 124, 0, 0.08);
  color: var(--accent);
}

.kpi-icon-green {
  background: rgba(22, 163, 74, 0.08);
  color: #15803d;
}

.kpi-icon-amber {
  background: rgba(217, 119, 6, 0.08);
  color: #b45309;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  margin-bottom: 1.5rem;
}

.chart-card.no-margin-bottom {
  margin-bottom: 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 1rem;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title::before {
  content: "";
  display: block;
  width: 3px;
  height: 18px;
  background: var(--accent);
  border-radius: 2px;
}

.section-link {
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.section-link:hover {
  text-decoration: underline;
}

.dashboard-text-muted {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 140px;
}

.bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  justify-content: flex-end;
}

.bar-link {
  display: block;
  width: 100%;
  text-decoration: none;
}

.bar {
  width: 100%;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  position: relative;
  transition: filter 0.15s;
}

.bar.highlight {
  background: #16a34a;
}

.bar-tooltip {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.45rem;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

.bar-wrap:hover .bar {
  filter: brightness(1.12);
}

.bar-wrap:hover .bar-tooltip {
  opacity: 1;
}

.bar-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 720px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.02);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

[data-theme="dark"] .ranking-item {
  background: rgba(255, 255, 255, 0.03);
}

.ranking-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .ranking-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.ranking-item-static {
  cursor: default;
}

.ranking-pos {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 16px;
}

.ranking-name {
  font-size: 0.82rem;
  font-weight: 500;
  min-width: 80px;
}

.ranking-bar-wrap {
  flex: 1;
  height: 6px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 999px;
  overflow: hidden;
}

[data-theme="dark"] .ranking-bar-wrap {
  background: rgba(255, 255, 255, 0.06);
}

.ranking-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

.ranking-val {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}

.dashboard-divider {
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 640px) {
  .quick-actions {
    grid-template-columns: 1fr;
  }
}

.qa-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
  cursor: pointer;
}

.qa-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  transform: translateY(-2px);
  border-color: var(--accent);
}

.qa-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(166, 124, 0, 0.08);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.qa-title {
  font-size: 0.92rem;
  font-weight: 700;
}

.qa-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.qa-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Tabs (dashboard cargos por ano) */
.tabs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tabs-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tab-button {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.tab-button:hover {
  border-color: var(--accent);
  color: var(--text);
}

.tab-button.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.tab-panel {
  margin-top: 0.25rem;
}

.tab-panel[hidden] {
  display: none;
}

/* Modal */
body.modal-open {
  overflow: hidden;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.modal-overlay[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 480px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.modal-close {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.modal-close:hover {
  color: var(--text);
  background: var(--bg-card);
}

.modal-body {
  padding: 1rem 1.25rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.modal-search {
  width: 100%;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
}

.modal-search:focus {
  outline: none;
  border-color: var(--accent);
}

.modal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  max-height: 50vh;
}

.modal-list-item {
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}

.modal-list-item:hover {
  background: var(--bg-card);
}

.modal-list-label {
  font-size: 0.9375rem;
}

.historico-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.historico-list li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}

.historico-list li:last-child {
  border-bottom: none;
}

.historico-list li.atual {
  color: var(--text-muted);
}

.historico-list a {
  color: var(--accent);
  text-decoration: none;
}

.historico-list a:hover {
  text-decoration: underline;
}

.back-link {
  margin-top: 2rem;
}

.back-link a {
  color: var(--text-muted);
  text-decoration: none;
}

.back-link a:hover {
  color: var(--accent);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space) 0;
  margin-top: auto;
}

.site-footer p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}
