/* ============================================
   PERFIL SOCIOECONÔMICO — Craíbas
   Estilos específicos da página (complementam styles.css)
   ============================================ */

/* ===== PAGE HERO LIMPO (sem fundo verde) ===== */
.page-hero {
  position: relative;
  background: white;
  color: var(--text);
  padding: 130px 0 50px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.page-hero::after {
  content: '';
  position: absolute;
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(232,212,185,0.10), transparent 70%);
  top: -180px; right: -140px;
  pointer-events: none;
}
.page-hero-inner { position: relative; z-index: 2; }
.page-hero-breadcrumb {
  display: flex; gap: 8px; align-items: center;
  font-size: 13px; color: var(--text-muted);
  margin-bottom: 18px; font-weight: 500;
  flex-wrap: wrap;
}
.page-hero-breadcrumb a { color: var(--primary); transition: var(--transition); font-weight: 600; }
.page-hero-breadcrumb a:hover { color: var(--accent); }
.page-hero-breadcrumb i { font-size: 10px; color: var(--text-light); }

.page-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.4vw, 4.2rem);
  font-weight: 700;
  /* Line-height ajustado para acentos ascendentes não serem cortados */
  line-height: 1.2;
  padding-top: 0.1em;
  letter-spacing: -0.01em;
  color: var(--primary-dark);
  margin-bottom: 18px;
}
.page-hero-title span { color: var(--primary-light); }

.page-hero-lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 760px;
  line-height: 1.7;
  margin-bottom: 36px;
}

/* Hero anchor stats — light theme */
.hero-anchor-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.anchor-stat {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text);
  font: inherit;
  position: relative;
  overflow: hidden;
}
.anchor-stat::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transition: transform 0.3s ease;
  transform-origin: top;
}
.anchor-stat:hover {
  transform: translateY(-4px);
  background: white;
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}
.anchor-stat:hover::before { transform: scaleY(1); }
.anchor-stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(232,212,185,0.15);
  color: var(--accent-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: 6px;
}
.anchor-stat-value {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1;
}
.anchor-stat-value small { font-size: 60%; font-weight: 600; color: var(--text-muted); margin-left: 4px; }
.anchor-stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  font-weight: 600;
}

/* ===== TABS NAV (sticky) ===== */
.tabs-nav-wrap {
  position: sticky;
  top: 96px;
  z-index: 50;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0,54,45,0.06);
}
.tabs-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs-nav::-webkit-scrollbar { display: none; }
.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 18px 24px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  border-bottom: 3px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
  background: transparent;
}
.tab-btn i { font-size: 16px; color: var(--primary); }
.tab-btn:hover { color: var(--primary); background: var(--bg-soft); }
.tab-btn.active {
  color: var(--primary-dark);
  border-bottom-color: var(--accent);
  background: var(--bg-soft);
}
.tab-btn.active i { color: var(--accent); }

/* ===== TAB PANELS ===== */
.tab-panel {
  display: none;
  padding: 60px 0;
  animation: fadeUp 0.5s ease-out;
}
.tab-panel.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-head {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 48px;
}

/* ===== KPI CARDS GRID ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}
.kpi-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}
.kpi-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.kpi-card:hover::before { transform: scaleX(1); }
.kpi-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: 14px;
  box-shadow: 0 4px 12px rgba(0,54,45,0.25);
}
.kpi-card.accent .kpi-icon { background: linear-gradient(135deg, var(--accent) 0%, #F0E2CD 100%); box-shadow: 0 4px 12px rgba(232,212,185,0.3); }
.kpi-card.blue .kpi-icon { background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--secondary) 100%); box-shadow: 0 4px 12px rgba(158,186,242,0.35); }
.kpi-card.dark .kpi-icon { background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%); }

.kpi-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.kpi-value small { font-size: 60%; font-weight: 600; color: var(--text-muted); margin-left: 4px; }
.kpi-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 4px;
}
.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  margin-top: 8px;
  padding: 3px 8px;
  border-radius: 100px;
}
.kpi-trend.up { background: rgba(70, 179, 88, 0.15); color: #2e7d3e; }
.kpi-trend.down { background: rgba(220, 80, 80, 0.15); color: #b03b3b; }
.kpi-trend.neutral { background: var(--bg-muted); color: var(--text-muted); }

/* ===== CHART CARDS ===== */
.chart-grid {
  display: grid;
  gap: 24px;
  margin-bottom: 32px;
}
.chart-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.chart-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

.chart-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.chart-card.featured {
  background: linear-gradient(135deg, #ffffff 0%, #f6faf7 100%);
  border-color: var(--bg-muted);
}
.chart-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  gap: 16px;
}
.chart-card-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.2;
  margin-bottom: 4px;
}
.chart-card-sub {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--accent);
  font-weight: 600;
}
.chart-card-badge {
  font-size: 11px;
  background: var(--bg-muted);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 100px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.chart-canvas-wrap {
  position: relative;
  flex-grow: 1;
  min-height: 260px;
}
.chart-canvas-wrap canvas { max-height: 320px; }
.chart-card-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

/* Featured tall chart (pyramid) */
.chart-card.tall .chart-canvas-wrap { min-height: 420px; }
.chart-card.tall canvas { max-height: 480px; }

/* ===== INFOGRAPHIC HEALTH GRID ===== */
.health-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.health-tile {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.health-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}
.health-tile-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--bg-muted) 0%, #E4DECF 100%);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  margin: 0 auto 12px;
  transition: var(--transition);
}
.health-tile:hover .health-tile-icon {
  background: var(--accent);
  color: var(--primary-dark);
  transform: scale(1.05) rotate(-4deg);
}
.health-tile-num {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1;
}
.health-tile-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 6px;
  line-height: 1.3;
}

/* ===== ACTIVITY GALLERY (Economia) ===== */
.activity-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}
.activity-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  height: 320px;
  background: var(--primary-dark);
  transition: var(--transition);
}
.activity-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }

.activity-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.activity-card:hover .activity-img { transform: scale(1.06); }

.activity-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(13,58,23,0.55) 60%, rgba(13,58,23,0.95) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px;
  color: white;
}
.activity-tag {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--accent);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  border-radius: 100px;
  margin-bottom: 12px;
}
.activity-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.1;
}
.activity-desc {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  line-height: 1.5;
  margin-bottom: 12px;
}
.activity-key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===== ACCORDION ===== */
.accordion-section {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.accordion-trigger {
  width: 100%;
  text-align: left;
  padding: 22px 28px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 19px;
  font-weight: 700;
  color: var(--primary-dark);
  font-family: var(--font-display);
  transition: var(--transition);
}
.accordion-trigger:hover { background: var(--bg-soft); }
.accordion-trigger .left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.accordion-trigger .left i:first-child {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--bg-muted);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.accordion-chevron {
  font-size: 14px;
  color: var(--text-muted);
  transition: transform 0.3s ease;
}
.accordion-section.open .accordion-chevron { transform: rotate(180deg); }
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
}
.accordion-section.open .accordion-content { max-height: 2000px; }
.accordion-inner {
  padding: 0 28px 28px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.8;
}

/* Data table inside accordion */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13px;
}
.data-table th, .data-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  background: var(--bg-soft);
  color: var(--primary-dark);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1px;
}
.data-table tbody tr:hover { background: var(--bg-soft); }
.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ===== HIGHLIGHT BANNER ===== */
.highlight-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: center;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}
.highlight-banner::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(232,212,185,0.18), transparent 60%);
  top: -150px; right: -100px;
}
.highlight-banner.warn { background: linear-gradient(135deg, #b94e3a 0%, #8a3525 100%); }
.highlight-banner-icon {
  width: 64px; height: 64px;
  border-radius: 16px;
  background: rgba(255,255,255,0.15);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  position: relative;
}
.highlight-banner-content { position: relative; }
.highlight-banner-content h3 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 4px;
}
.highlight-banner-content p {
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  margin: 0;
  line-height: 1.6;
}
.highlight-banner-num {
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  text-align: right;
  position: relative;
}
.highlight-banner-num small {
  display: block;
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  margin-top: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

/* ===== TWO COLUMN INFO ===== */
.info-cols {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
.info-text-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}
.info-text-card h3 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 14px;
}
.info-text-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 12px;
}
.info-bullets {
  list-style: none;
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
/* display:block + ícone absoluto: <strong> flui inline com o texto.
   (Com flex, cada <strong> virava um item/coluna e quebrava a frase.) */
.info-bullets li {
  display: block;
  position: relative;
  padding-left: 26px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
}
.info-bullets i {
  position: absolute;
  left: 0;
  top: 4px;
  color: var(--primary-light);
  font-size: 14px;
}

/* ===== IDHM GAUGE ===== */
.idhm-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
}
.idhm-gauge {
  position: relative;
  max-width: 280px;
  margin: 0 auto 16px;
}
.idhm-gauge canvas { max-height: 180px; }
.idhm-center {
  position: absolute;
  top: 56%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.idhm-center strong {
  display: block;
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1;
}
.idhm-center span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--text-muted);
  font-weight: 700;
  margin-top: 4px;
}
.idhm-classification {
  display: inline-block;
  padding: 6px 16px;
  background: var(--accent);
  color: var(--primary-dark);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}
.idhm-compare {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.idhm-compare-item span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
  font-weight: 600;
}
.idhm-compare-item strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--primary);
  margin-top: 2px;
}
.idhm-compare-item.highlight strong { color: var(--accent); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13,58,23,0.75);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 200;
  animation: modalFade 0.3s ease;
}
.modal-overlay.open { display: flex; }
@keyframes modalFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal {
  background: white;
  border-radius: var(--radius-lg);
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: modalSlide 0.4s ease-out;
}
@keyframes modalSlide {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-close {
  position: absolute;
  top: 20px; right: 20px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-muted);
  color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  z-index: 5;
  transition: var(--transition);
}
.modal-close:hover { background: var(--accent); transform: rotate(90deg); }
.modal-img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}
.modal-body { padding: 36px; }
.modal-body h2 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 12px;
}
.modal-body p {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 14px;
}
.modal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}
.modal-stat {
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
}
.modal-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--primary);
}
.modal-stat span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 600;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-anchor-stats { grid-template-columns: repeat(2, 1fr); }
  .health-grid { grid-template-columns: repeat(3, 1fr); }
  .chart-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .activity-grid { grid-template-columns: repeat(2, 1fr); }
  .info-cols { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .page-hero { padding: 130px 0 48px; }
  .tabs-nav-wrap { top: 84px; }
  .tab-btn { padding: 14px 16px; font-size: 12px; }
  .tab-btn span { display: none; }
  .tab-btn i { font-size: 18px; }
  .kpi-grid, .chart-grid.cols-2, .chart-grid.cols-3, .activity-grid { grid-template-columns: 1fr; }
  .health-grid { grid-template-columns: repeat(2, 1fr); }
  .highlight-banner { grid-template-columns: 1fr; text-align: center; padding: 28px 24px; }
  .highlight-banner-num { text-align: center; }
  .modal-body { padding: 24px; }
  .modal-stats { grid-template-columns: 1fr; }
}
