:root {
  --page-bg: #eef2f3;
  --card-bg: #ffffff;
  --card-soft: #f7fafb;
  --line: #d9e2e6;
  --text: #122127;
  --muted: #5d7078;
  --accent: #1e6a73;
  --accent-2: #d6792c;
  --accent-3: #244e7a;
  --shadow: 0 16px 40px rgba(12, 34, 42, 0.08);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(30, 106, 115, 0.06), transparent 220px),
    linear-gradient(180deg, #f8fbfc 0%, var(--page-bg) 100%);
  overflow-x: hidden;
  width: 100%;
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 74px;
  z-index: 30;
  background: rgba(245, 249, 250, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.app-header__inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-toggle-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.2s;
  position: absolute;
  left: 0;
}

.sidebar-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.app-header__brand {
  display: flex;
  align-items: center;
  gap: 20px;
}

.app-header__logo {
  height: 56px;
  width: auto;
  object-fit: contain;
}

.app-header__title {
  font-size: 1.3rem;
  font-weight: 700;
}

.layout-wrapper {
  display: flex;
  min-height: 100vh;
  padding-top: 74px;
}

.app-sidebar {
  width: 260px;
  background: var(--card-bg);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 74px;
  height: calc(100vh - 74px);
  z-index: 20;
  transition: margin-left 0.3s ease;
}

.app-sidebar.collapsed {
  margin-left: -260px;
}

.sidebar-nav {
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-nav__item {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 12px 16px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.sidebar-nav__item:hover {
  background: #eef5f7;
}

.sidebar-nav__item.active {
  background: var(--accent);
  color: #fff;
}

.app-shell {
  flex: 1;
  max-width: 1600px;
  margin: 0 auto;
  padding: 40px 30px;
  min-width: 0;
}

.hero-block,
.toolbar-card,
.tab-strip-card,
.municipality-header-card,
.metric-card,
.panel-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-block {
  padding: 26px 28px;
  border-radius: 28px;
  margin-bottom: 16px;
}

.hero-block__top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.hero-block__intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  flex: 1;
}

.hero-block__controls {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-top: 18px;
}

.hero-kicker,
.section-kicker {
  margin: 0 0 8px;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-title,
.section-title {
  margin: 0;
  line-height: 1.02;
}

.hero-title {
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  max-width: none;
  text-align: left;
}

.hero-description {
  margin: 14px 0 0;
  color: var(--muted);
  max-width: none;
}

.hero-city-picker {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hero-city-picker label {
  font-size: 0.82rem;
  color: var(--muted);
}

/* removido support-dropdown */

.toolbar-card {
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}

.toolbar-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.toolbar-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toolbar-field label {
  font-size: 0.8rem;
  color: var(--muted);
}

.toolbar-field select {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card-soft);
  color: var(--text);
  padding: 11px 12px;
}

.toolbar-field--compact {
  min-width: 280px;
}

.tab-strip-card {
  padding: 10px;
  border-radius: 20px;
  margin-bottom: 14px;
}

.tab-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
}

.municipality-tab-strip {
  padding: 6px 8px 20px 8px;
}

.tab-button {
  border: 1px solid var(--line);
  background: var(--card-soft);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 16px 16px 8px 8px;
  font-size: 0.92rem;
  line-height: 1.1;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: 140ms ease;
}

.municipality-tab-strip .tab-button {
  background: #ffffff;
  border-color: var(--line);
  color: var(--text);
}

.municipality-tab-strip .tab-button:hover {
  background: #f4f8f9;
  border-color: var(--accent);
  color: var(--accent);
}

.tab-button:hover {
  background: #eef5f7;
}

.tab-button.active {
  background: linear-gradient(180deg, #1e6a73 0%, #245b65 100%);
  color: #fff;
  border-color: #1e6a73;
}

.municipality-tab-strip .tab-button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow:
    0 4px 12px rgba(30, 106, 115, 0.24),
    0 1px 3px rgba(30, 106, 115, 0.12);
  transform: translateY(-1px);
  font-weight: 700;
}

.dataset-pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: #ecf5f6;
  color: var(--accent);
  font-size: 0.92rem;
  white-space: nowrap;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric-card {
  border-radius: 20px;
  padding: 18px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 10px;
}

.metric-card strong {
  display: block;
  font-size: 1.75rem;
  line-height: 1.1;
}

.overview-grid {
  display: block;
  margin-bottom: 16px;
}

.panel-card {
  border-radius: 24px;
  padding: 18px 18px 14px;
  margin-bottom: 16px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.panel-head {
  margin-bottom: 12px;
}

.panel-head h3 {
  margin: 0;
}

.panel-copy {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.7;
}

.source-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
}

.chart {
  min-height: 360px;
  width: 100%;
  max-width: 100%;
}

.chart-large {
  min-height: 500px;
}

.chart-map {
  min-height: 520px;
}

.analysis-panels {
  margin-top: 4px;
}

.utility-panel {
  display: none;
}

.utility-panel.active {
  display: block;
}

body.support-view .dashboard-only {
  display: none;
}

.analysis-panel {
  display: none;
}

.analysis-panel.active {
  display: block;
}

.analysis-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.chart-layout {
  display: flex;
  gap: 24px;
}

.chart-layout>.chart-meta {
  flex: 0 0 160px;
  margin-bottom: 0;
  padding-top: 10px;
}

.chart-layout>.chart {
  flex: 1;
  min-width: 0;
}

@media (max-width: 900px) {
  .chart-layout {
    flex-direction: column;
  }

  .chart-layout>.chart-meta {
    flex: none;
    width: 100%;
    margin-bottom: 14px;
    padding-top: 0;
  }
}

.chart-meta {
  margin-bottom: 14px;
}

.chart-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.chart-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chart-field--slider {
  margin-bottom: 4px;
}

.range-slider {
  position: relative;
  width: 100%;
  height: 36px;
  margin-top: 4px;
}

.range-slider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--line);
  border-radius: 4px;
  transform: translateY(-50%);
}

.active-track {
  position: absolute;
  top: 50%;
  height: 6px;
  background: var(--accent);
  opacity: 0.4;
  border-radius: 4px;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 1;
}

.range-slider input[type="range"] {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  transform: translateY(-50%);
  pointer-events: none;
  appearance: none;
  background: transparent;
  outline: none;
  margin: 0;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
  pointer-events: auto;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 2;
}

.range-slider input[type="range"]:active::-webkit-slider-thumb {
  z-index: 3;
}

.chart-field label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}

.chart-field select {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card-soft);
  color: var(--text);
  padding: 11px 12px;
  font: inherit;
  width: 100%;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.panel-card--wide {
  grid-column: span 1;
}

.document-section+.document-section {
  margin-top: 20px;
}

.document-sections {
  display: block;
}

.document-section__title {
  margin: 0 0 12px;
  font-size: 1rem;
}

.documents-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.document-card {
  background: var(--card-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}

.document-card a {
  color: var(--accent-3);
  text-decoration: none;
}

.document-meta {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.about-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  max-width: 860px;
  text-align: justify;
}

.about-copy+.about-copy {
  margin-top: 16px;
}

.utility-panel[data-utility-panel="quem-somos"] .about-copy {
  max-width: none;
  width: 100%;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.about-document {
  margin-top: 24px;
}

.about-document__frame {
  width: 100%;
  min-height: 900px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
}

.reference-group+.reference-group {
  margin-top: 24px;
}

.table-card {
  background: var(--card-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}

.table-card+.table-card {
  margin-top: 14px;
}

.table-card__title {
  margin: 0 0 12px;
}

.table-shell {
  overflow-x: auto;
}

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

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.92rem;
}

th {
  background: #f0f7f8;
}

/* Team Section Styles */
.team-group + .team-group {
  margin-top: 32px;
}

.team-group__title {
  margin: 0 0 12px;
  font-size: 1.15rem;
  color: var(--accent-3);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.team-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.team-card {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  background: var(--card-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  gap: 16px;
  transition: all 0.2s ease;
}

.team-card:hover {
  box-shadow: 0 8px 24px rgba(12, 34, 42, 0.06);
  transform: translateY(-2px);
  border-color: #c8e1e4;
}

.team-card__photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: #eef2f3;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
}

.team-card__info {
  display: flex;
  flex-direction: column;
}

.team-card__name {
  margin: 0 0 4px 0;
  font-size: 1.05rem;
  color: var(--text);
  font-weight: 700;
}

.team-card__role {
  margin: 0 0 8px 0;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.team-card__desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}


@media (max-width: 1200px) {

  .toolbar-row,
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .panel-card--wide {
    grid-column: span 1;
  }
}

@media (max-width: 820px) {

  .toolbar-row,
  .metrics-grid,
  .analysis-grid,
  .documents-grid,
  .chart-controls {
    grid-template-columns: 1fr;
  }

  .fixed-header__inner,
  .hero-block__top,
  .hero-block__controls {
    flex-direction: column;
    align-items: stretch;
  }

  .dataset-pill {
    white-space: normal;
  }

  .hero-city-picker {
    min-width: 0;
  }

  .support-dropdown__panel {
    left: 0;
    right: auto;
  }
}

/* Footer Styles */
.app-footer {
  background: var(--card-bg);
  border-top: 1px solid var(--line);
  padding: 40px 30px;
  margin-top: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.app-footer__content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 30px;
}

.app-footer__section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.app-footer__section.info-section {
  align-items: flex-end;
  text-align: right;
}

.app-footer__title {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.app-footer__logos {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.app-footer__logo-link {
  display: block;
  transition: transform 0.2s ease;
}

.app-footer__logo-link:hover {
  transform: translateY(-2px);
}

.app-footer__logo {
  height: 55px;
  width: auto;
  object-fit: contain;
}

.app-footer__logo.uerj-pr2-logo {
  height: 65px;
}

.app-footer__text {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.5;
}

.app-footer__text.sub-text {
  font-size: 0.85rem;
  color: var(--muted);
}

.app-footer__copyright {
  margin: 8px 0 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  opacity: 0.8;
}

@media (max-width: 768px) {
  .app-footer__content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .app-footer__section {
    align-items: center !important;
    text-align: center !important;
  }

  .app-footer__logos {
    justify-content: center;
  }
}