/* Common styles for all election views */
:root{
  --ap-brand:#7430FF;
  --ap-text:#1a1a1a;
  --ap-muted:#666666;
  --ap-bg-soft:#f8f8ff;
  --ap-border-soft:rgba(116,48,255,.12);
}

/* Base typography */
.ap-elec, .ap-elec-map{
  font-family:'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size:14px;
  color:var(--ap-text);
}

/* Base */
.ap-muted{ color:var(--ap-muted); font-size:12px; }
.ap-r{ text-align:right !important; }

/* Header and titles */
.ap-elec__header{ display:flex; justify-content:space-between; gap:12px; align-items:flex-start; position:relative; z-index:1; }
.ap-elec__title, .ap-elec-map__title{ font-size:22px; font-weight:900; color:var(--ap-brand); }
.ap-elec__meta, .ap-elec-map__meta{ font-size:13px; color:var(--ap-muted); margin-top:8px; opacity:.8; }

/* Chips */
.ap-elec__chip, .ap-elec-map__chip{ font-size:11px; padding:10px 18px; border-radius:999px; background:linear-gradient(135deg, var(--ap-brand) 0%, #a855f7 100%); color:#fff; white-space:nowrap; font-weight:700; box-shadow:0 4px 16px rgba(116,48,255,.2); letter-spacing:.4px; }

/* Cards */
.ap-elec__card{ border:none; border-radius:24px; padding:32px; background:#fff; box-shadow:0 4px 16px rgba(116,48,255,.08); position:relative; }

/* Map container to match card aesthetics */
.ap-elec-map{ border:none; border-radius:24px; background:#fff; box-shadow:0 4px 16px rgba(116,48,255,.08); }

/* Tables */
.ap-elec__table{ width:100%; border-collapse:separate; border-spacing:0 8px; min-width:520px; table-layout:fixed; }
.ap-elec__table th{ text-align:left; font-size:10px; color:var(--ap-brand); padding:0 14px 16px; border-bottom:none; text-transform:uppercase; letter-spacing:1.2px; font-weight:700; vertical-align:middle; opacity:.85; }
.ap-elec__table th:nth-child(1){ width:auto; }
.ap-elec__table th:nth-child(2){ width:110px; text-align:right; }
.ap-elec__table th:nth-child(3){ width:80px; text-align:right; }
.ap-elec__table th:nth-child(4){ width:70px; text-align:right; }
.ap-elec__table tbody tr{ background:var(--ap-bg-soft); }
.ap-elec__table tbody tr:hover{ background:#fff; }
.ap-elec__table td{ padding:16px 14px; border-bottom:none; vertical-align:middle; }
.ap-win{ background:#fff; border-left:4px solid var(--ap-brand); }

/* Party row */
.ap-row{ display:flex; gap:10px; align-items:center; min-width:220px; }
.ap-logo{ width:40px; height:40px; border-radius:12px; object-fit:contain; background:#fff; border:2px solid var(--ap-border-soft); box-shadow:0 2px 6px rgba(0,0,0,.08); }
.ap-logo:hover{ border-color:var(--ap-brand); }
.ap-fallback{ width:40px; height:40px; border-radius:12px; display:flex; align-items:center; justify-content:center; color:#fff; font-weight:900; font-size:13px; box-shadow:0 2px 6px rgba(0,0,0,.1); }
.ap-name{ display:flex; flex-direction:column; line-height:1.15; }
.ap-siglas{ font-weight:800; }
.ap-fullname{ font-size:11px; color:var(--ap-muted); max-width:260px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* Hemiciclo */
.ap-elec__hemiciclo{ margin-top:24px; padding:24px; background:var(--ap-bg-soft); border-radius:20px; border:2px solid var(--ap-border-soft); }
.ap-elec__hemiciclo svg{ width:100%; height:auto; max-width:350px; margin:0 auto; display:block; }
.ap-elec__hemiciclo path{ cursor:pointer; }
.ap-elec__hemicicloLegend{ display:flex; flex-wrap:wrap; gap:16px; justify-content:center; margin-top:16px; }
.ap-elec__legendItem{ display:flex; align-items:center; gap:8px; font-size:13px; }
.ap-elec__legendColor{ width:16px; height:16px; border-radius:4px; }
.ap-elec__legendLabel{ font-weight:600; }
.ap-elec__legendSeats{ color:var(--ap-muted); }

/* Progress */
.ap-elec__progress{ margin-top:24px; position:relative; z-index:1; }
.ap-elec__progressBar{ height:8px; border-radius:999px; background:rgba(116,48,255,.08); overflow:hidden; position:relative; }
.ap-elec__progressBar span{ display:block; height:100%; width:0%; background:linear-gradient(90deg, var(--ap-brand) 0%, #a855f7 50%, var(--ap-brand) 100%); background-size:200% 100%; }
.ap-elec__progressText{ margin-top:6px; font-size:12px; color:var(--ap-muted); }

/* Map legend and dots */
.ap-leg{ display:flex; align-items:center; gap:8px; font-size:12px; color:#111; }
.ap-dot{ width:12px; height:12px; border-radius:3px; border:1px solid rgba(0,0,0,.15); }
.ap-dot2{ width:10px; height:10px; border-radius:2px; border:1px solid rgba(0,0,0,.15); display:inline-block; margin-right:6px; vertical-align:middle; }

/* Map search controls aligned with common form styles */
.ap-elec-map__search input{ padding:12px 18px; border:2px solid var(--ap-border-soft); border-radius:14px; background:#fff; font-size:14px; }
.ap-elec-map__search input:focus{ outline:none; border-color:var(--ap-brand); box-shadow:0 0 0 3px rgba(116,48,255,.1); }
.ap-elec-map__search button{ padding:12px 18px; border:2px solid var(--ap-border-soft); border-radius:14px; background:var(--ap-brand); color:#fff; font-size:14px; font-weight:700; cursor:pointer; }
.ap-elec-map__search button:hover{ filter:brightness(1.05); }

.logo{
    width: 100%;
    display: flex;
    justify-content: center;

}
.logo img{
    width: 120px;
}