/* =====================================================
   PLANES DE GOBIERNO — SISTEMA DE DISEÑO EDITORIAL
   ===================================================== */

:root {
  --bg:           #f9f9f8;
  --surface:      #ffffff;
  --border:       #e8e8e6;
  --border-soft:  #f0f0ee;
  --text:         #111111;
  --text-2:       #444444;
  --muted:        #777777;
  --muted-light:  #aaaaaa;
  --primary:      #b5121b;
  --primary-dark: #8f0e15;
  --primary-soft: rgba(181,18,27,0.07);
  --shadow-sm:    0 1px 4px rgba(0,0,0,0.06);
  --shadow:       0 2px 12px rgba(0,0,0,0.08);
  --shadow-md:    0 4px 24px rgba(0,0,0,0.10);
  --radius:       12px;
  --radius-sm:    8px;
  --radius-lg:    18px;
  --container:    1100px;
}

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

html { scroll-behavior: smooth; font-size: 15px; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; border: none; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.container {
  width: min(var(--container), calc(100% - 48px));
  margin: 0 auto;
}

/* ─── TOPBAR ────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand-mark {
  height: 34px;
  width: auto;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-title { font-family: 'Sora', sans-serif; font-size: 13px; font-weight: 700; color: var(--text); }
.brand-subtitle { font-size: 11px; color: var(--muted); }

.topnav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.topnav a {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s, background 0.15s;
}

.topnav a:hover { color: var(--text); background: var(--border-soft); }
.topnav a.active { color: var(--primary); background: var(--primary-soft); font-weight: 600; }

/* Menú items ocultos visualmente — las rutas siguen funcionando */
.topnav a[href="heatmap.html"],
.topnav a[href="/convertir.html"],
.topnav a[href="validacion.html"] { display: none !important; }

/* ─── BREADCRUMB ────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.breadcrumb a { color: var(--muted); transition: color 0.15s; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--muted-light); }
.breadcrumb .current { color: var(--text-2); font-weight: 500; }

/* ─── PAGE STRUCTURE ────────────────────────────────── */
.page-wrap {
  padding: 28px 0 80px;
}

.page-intro {
  max-width: 680px;
  padding: 36px 0 32px;
}

.page-intro h1 {
  font-family: 'Sora', sans-serif;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 10px;
}

.page-intro p {
  font-size: 15px;
  color: var(--muted);
  margin: 0;
  line-height: 1.65;
}

/* ─── BUTTONS ───────────────────────────────────────── */
.btn-primary, .btn-secondary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  min-height: 46px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14.5px;
  transition: 0.18s ease;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 16px rgba(181,18,27,0.22);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 22px rgba(181,18,27,0.28);
  transform: translateY(-1px);
}

.btn-secondary {
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  border-color: #ccc;
  box-shadow: var(--shadow);
}

.btn-ghost {
  background: none;
  color: var(--muted);
  font-size: 13px;
  padding: 0 14px;
  min-height: 36px;
}

.btn-ghost:hover { color: var(--primary); background: var(--primary-soft); }

/* ─── CARDS ─────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card-sm {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.card-flat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}

/* ─── CANDIDATE CARDS (SELECTOR) ───────────────────── */
.candidate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.candidate-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.15s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.candidate-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.candidate-card-top {
  display: flex;
  align-items: flex-start;
  gap: 0;
}

.candidate-color-strip {
  width: 5px;
  min-height: 100%;
  flex-shrink: 0;
  align-self: stretch;
}

.candidate-card-content {
  padding: 20px;
  flex: 1;
}

.candidate-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.candidate-card-name {
  font-family: 'Sora', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 3px;
  line-height: 1.25;
}

.candidate-card-party {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 12px;
}

.candidate-card-summary {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
  margin: 0 0 16px;
}

.candidate-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}

.candidate-card-action {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

/* ─── SCORE SYSTEM ──────────────────────────────────── */
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  border-radius: 7px;
  padding: 4px 10px;
  font-size: 13.5px;
  line-height: 1;
}

.score-badge.sm { font-size: 12px; padding: 3px 8px; border-radius: 5px; }
.score-badge.lg { font-size: 2.2rem; padding: 10px 18px; border-radius: 12px; font-family: 'Sora', sans-serif; }
.score-badge.xl { font-size: 3rem; padding: 12px 22px; border-radius: 14px; font-family: 'Sora', sans-serif; font-weight: 900; }

.score-excellent { background: #dcfce7; color: #15803d; }
.score-solid     { background: #dbeafe; color: #1d4ed8; }
.score-medium    { background: #fef3c7; color: #92400e; }
.score-weak      { background: #ffedd5; color: #c2410c; }
.score-very-weak { background: #fee2e2; color: #b91c1c; }
.score-none      { background: #f4f4f4; color: var(--muted); }

.level-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
}

.level-tag.score-excellent { background: #dcfce7; color: #15803d; }
.level-tag.score-solid     { background: #dbeafe; color: #1d4ed8; }
.level-tag.score-medium    { background: #fef3c7; color: #92400e; }
.level-tag.score-weak      { background: #ffedd5; color: #c2410c; }
.level-tag.score-very-weak { background: #fee2e2; color: #b91c1c; }
.level-tag.score-none      { background: #f4f4f4; color: var(--muted); }

.score-bar-track {
  height: 7px;
  background: var(--border-soft);
  border-radius: 99px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.5s ease;
}

/* ─── TAGS ──────────────────────────────────────────── */
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 500;
}

.tag-default  { background: var(--bg); border: 1px solid var(--border); color: var(--text-2); }
.tag-strength { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.tag-weakness { background: #fff1f2; color: #9f1239; border: 1px solid #fecdd3; }
.tag-gap      { background: #fefce8; color: #854d0e; border: 1px solid #fde68a; }
.tag-note     { background: #f0f9ff; color: #0369a1; border: 1px solid #bae6fd; }

/* ─── CRITERIA BARS ─────────────────────────────────── */
.criteria-bars { display: flex; flex-direction: column; gap: 9px; }

.criteria-row {
  display: grid;
  grid-template-columns: 110px 1fr 38px;
  gap: 10px;
  align-items: center;
}

.criteria-label { font-size: 13px; color: var(--muted); }
.criteria-val   { font-size: 12px; font-weight: 700; color: var(--text-2); text-align: right; }

.criteria-track {
  height: 7px;
  background: var(--border-soft);
  border-radius: 99px;
  overflow: hidden;
}

.criteria-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.4s ease;
}

.c-full  { background: #16a34a; }
.c-half  { background: #2563eb; }
.c-zero  { background: #e2e8f0; width: 3px !important; }

/* ─── BLOCK CARDS ───────────────────────────────────── */
.block-nav-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.15s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.block-nav-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.block-nav-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.block-nav-card-name {
  font-family: 'Sora', sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  margin: 0;
}

.block-nav-card-summary {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 12px;
}

.block-nav-mini-bars { display: flex; flex-direction: column; gap: 4px; }
.block-nav-mini-bar-row { display: grid; grid-template-columns: 1fr 36px; gap: 8px; align-items: center; }
.block-nav-mini-bar-track { height: 4px; background: var(--border-soft); border-radius: 99px; overflow: hidden; }
.block-nav-mini-bar-fill { height: 100%; border-radius: 99px; }

/* ─── VARIABLE ROWS ─────────────────────────────────── */
.var-list { display: flex; flex-direction: column; gap: 6px; }

.var-list-item {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.var-list-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.var-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.var-list-name { font-weight: 600; font-size: 14px; }

.var-list-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.correction-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 99px;
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #fde68a;
}

/* ─── SECTIONS (ACCORDION) ──────────────────────────── */
.section-accordion { display: flex; flex-direction: column; gap: 2px; }

.section-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: white;
}

.section-toggle {
  width: 100%;
  text-align: left;
  padding: 13px 16px;
  background: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background 0.15s;
}

.section-toggle:hover { background: var(--bg); }
.section-toggle.open { background: var(--primary-soft); }

.section-toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.section-toggle.open .section-toggle-label { color: var(--primary); }

.section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--border-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.section-toggle.open .section-num {
  background: var(--primary);
  color: white;
}

.section-chevron {
  color: var(--muted-light);
  font-size: 12px;
  transition: transform 0.2s;
}

.section-toggle.open .section-chevron { transform: rotate(180deg); }

.section-body {
  display: none;
  padding: 14px 16px 16px 48px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-2);
  border-top: 1px solid var(--border);
}

.section-body.open { display: block; }

/* ─── CRITERIA TABLE ────────────────────────────────── */
.criteria-table-wrap {
  overflow-x: auto;
}

.criteria-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.criteria-table th {
  padding: 9px 14px;
  text-align: left;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  white-space: nowrap;
}

.criteria-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}

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

.criteria-score-cell {
  font-weight: 800;
  font-size: 1rem;
  text-align: center;
}

.criteria-note { font-size: 12.5px; color: var(--muted); }

.formula-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-family: 'Sora', monospace;
  font-size: 14px;
  color: var(--text);
  text-align: center;
  margin-top: 16px;
}

/* ─── SOURCES ───────────────────────────────────────── */
.sources-list { display: flex; flex-direction: column; gap: 10px; }

.source-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.source-type-badge {
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  margin-top: 1px;
}

.source-type-official  { background: #dbeafe; color: #1d4ed8; }
.source-type-academic  { background: #f3e8ff; color: #7c3aed; }
.source-type-press     { background: #fef9c3; color: #854d0e; }
.source-type-report    { background: #dcfce7; color: #15803d; }
.source-type-other     { background: #f4f4f4; color: #555; }

.source-title { font-weight: 600; margin-bottom: 3px; }
.source-note  { color: var(--muted); line-height: 1.5; }
.source-url   { display: inline-flex; align-items: center; gap: 4px; color: var(--primary); margin-top: 4px; font-size: 12px; }

/* ─── CORRECTIONS MODULE ────────────────────────────── */
.corrections-module {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 18px 20px;
}

.corrections-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-weight: 700;
  font-size: 13.5px;
  color: #92400e;
}

.corrections-list { display: flex; flex-direction: column; gap: 7px; }

.correction-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: #78350f;
  line-height: 1.55;
}

.correction-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d97706;
  flex-shrink: 0;
  margin-top: 6px;
}

/* ─── QUICK READS (strength/weakness/gap) ───────────── */
.quick-reads-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.quick-read-card {
  border-radius: var(--radius);
  padding: 16px;
}

.quick-read-card.strength { background: #f0fdf4; border: 1px solid #bbf7d0; }
.quick-read-card.weakness { background: #fff1f2; border: 1px solid #fecdd3; }
.quick-read-card.gap      { background: #fefce8; border: 1px solid #fde68a; }

.quick-read-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.quick-read-card.strength .quick-read-label { color: #15803d; }
.quick-read-card.weakness .quick-read-label { color: #be123c; }
.quick-read-card.gap      .quick-read-label { color: #92400e; }

.quick-read-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.quick-read-list li {
  font-size: 13px;
  line-height: 1.5;
  padding-left: 14px;
  position: relative;
}

.quick-read-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.quick-read-card.strength .quick-read-list li { color: #166534; }
.quick-read-card.strength .quick-read-list li::before { background: #16a34a; }
.quick-read-card.weakness .quick-read-list li { color: #9f1239; }
.quick-read-card.weakness .quick-read-list li::before { background: #e11d48; }
.quick-read-card.gap      .quick-read-list li { color: #854d0e; }
.quick-read-card.gap      .quick-read-list li::before { background: #d97706; }

/* ─── KPI GRID ──────────────────────────────────────── */
.kpi-row {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: white;
}

.kpi-item {
  flex: 1;
  padding: 16px 20px;
  border-right: 1px solid var(--border);
}

.kpi-item:last-child { border-right: none; }

.kpi-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 6px;
}

.kpi-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.kpi-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* ─── CANDIDATE HEADER ──────────────────────────────── */
.cand-header {
  display: grid;
  grid-template-columns: 6px 1fr auto;
  gap: 20px;
  align-items: start;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.cand-color-strip {
  align-self: stretch;
  border-radius: 99px;
}

.cand-name {
  font-family: 'Sora', sans-serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 5px;
  line-height: 1.1;
}

.cand-party { font-size: 14px; color: var(--muted); margin: 0 0 12px; }

.cand-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.cand-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 4px 11px;
  font-size: 12.5px;
  color: var(--text-2);
}

.cand-summary {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.7;
  margin: 0;
}

.cand-score-side {
  text-align: right;
  flex-shrink: 0;
}

.cand-score-num {
  font-family: 'Sora', sans-serif;
  font-size: 3.2rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 6px;
}

.cand-score-label { font-size: 12px; color: var(--muted); }

/* ─── SECTION TITLES ────────────────────────────────── */
.section-title {
  font-family: 'Sora', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  color: var(--text);
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 10px;
  display: block;
}

/* ─── HELPERS ───────────────────────────────────────── */
.separator { height: 1px; background: var(--border-soft); margin: 20px 0; }
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}

.empty-state-icon { font-size: 2rem; opacity: 0.3; margin-bottom: 12px; }

.loading-msg {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ─── MODAL ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
}

.modal-box {
  background: white;
  border-radius: var(--radius-lg);
  padding: 36px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 16px;
  color: var(--muted);
  transition: background 0.15s;
}

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

.modal-title {
  font-family: 'Sora', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}

.modal-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-bottom: 26px;
}

.modal-list-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-2);
}

.modal-list-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 7px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ─── BLOCK DETAIL ──────────────────────────────────── */
.block-header {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  display: grid;
  grid-template-columns: 5px 1fr auto;
  gap: 18px;
  align-items: start;
  box-shadow: var(--shadow-sm);
}

.block-color-strip { border-radius: 99px; align-self: stretch; }
.block-name { font-family: 'Sora', sans-serif; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; margin: 0 0 8px; }
.block-summary { font-size: 14px; color: var(--text-2); line-height: 1.7; margin: 0; }

/* ─── VARIABLE HEADER ───────────────────────────────── */
.var-header {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  box-shadow: var(--shadow-sm);
}

.var-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.var-title {
  font-family: 'Sora', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 6px;
}

.var-block-tag { font-size: 12.5px; color: var(--muted); }

/* ─── CORRECTION NOTE ───────────────────────────────── */
.correction-note-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #78350f;
  line-height: 1.55;
}

.correction-note-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }

/* ─── FILTER BAR ────────────────────────────────────── */
.filter-bar { display: flex; gap: 6px; flex-wrap: wrap; }

.filter-chip {
  padding: 5px 13px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: white;
  color: var(--muted);
  cursor: pointer;
  transition: 0.15s;
}

.filter-chip:hover, .filter-chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ─── BLOCKS GRID (CANDIDATO) ───────────────────────── */
.blocks-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

/* ─── METHODOLOGY PAGE ──────────────────────────────── */
.method-section {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 16px;
}

.method-section-title {
  font-family: 'Sora', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}

.criteria-explain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.criteria-explain-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.criteria-explain-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: white;
  border-radius: 7px;
  font-weight: 800;
  font-size: 12px;
  margin-bottom: 8px;
}

.criteria-explain-name { font-weight: 700; font-size: 13.5px; margin-bottom: 4px; }
.criteria-explain-desc { font-size: 12.5px; color: var(--muted); line-height: 1.55; }

.scale-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scale-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
}

/* ─── COMPARISON TABLE ──────────────────────────────── */
.comp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.comp-table th {
  padding: 9px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
}
.comp-table th:hover { color: var(--primary); }
.comp-table td { padding: 11px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.comp-table tr:last-child td { border-bottom: none; }
.comp-table tr:hover td { background: #fafaf9; }

/* ─── HEATMAP ───────────────────────────────────────── */
.heatmap-table { border-collapse: collapse; font-size: 12px; min-width: 100%; }
.heatmap-table th { padding: 9px 12px; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); background: var(--bg); border-bottom: 1px solid var(--border); white-space: nowrap; }
.heatmap-table td { padding: 7px 12px; border-bottom: 1px solid rgba(0,0,0,0.03); }
.heatmap-cell { text-align: center; font-weight: 700; border-radius: 5px; cursor: pointer; font-size: 12.5px; transition: opacity 0.15s; }
.heatmap-cell:hover { opacity: 0.8; }

/* ─── RESPONSIVE ────────────────────────────────────── */
@media (max-width: 900px) {
  .cand-header { grid-template-columns: 5px 1fr; }
  .cand-score-side { grid-column: 2; margin-top: -8px; text-align: left; }
  .quick-reads-grid { grid-template-columns: 1fr; }
  .blocks-nav-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .container { width: calc(100% - 32px); }
  .topnav { display: none; }
  .candidate-grid { grid-template-columns: 1fr; }
  .blocks-nav-grid { grid-template-columns: 1fr; }
  .kpi-row { flex-direction: column; }
  .kpi-item { border-right: none; border-bottom: 1px solid var(--border); }
  .kpi-item:last-child { border-bottom: none; }
  .criteria-row { grid-template-columns: 90px 1fr 30px; }
}
