@import url('tokens.css');
@import url('components.css');
@import url('layout.css');
@import url('responsive.css');

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #e7eef7 0%, #f7f9fc 52%, #eef3f8 100%);
  color: var(--text-primary);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.page {
  min-height: 100vh;
}

.hero {
  padding: 44px clamp(20px, 5vw, 72px) 34px;
  background:
    linear-gradient(135deg, rgba(0, 101, 168, 0.96), rgba(0, 78, 130, 0.88)),
    url("https://images.unsplash.com/photo-1551288049-bebda4e38f71?auto=format&fit=crop&w=1600&q=80");
  background-position: center;
  background-size: cover;
  color: #fff;
}

.hero-copy {
  max-width: 860px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
}

.brand-logo {
  display: block;
  width: 118px;
  height: auto;
  filter: drop-shadow(0 6px 12px rgba(15, 23, 42, 0.22));
}

.brand-row::before {
  content: "";
  width: 4px;
  height: 42px;
  border-radius: 999px;
  background: var(--funasa-red);
}

.eyebrow,
.badge {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-text {
  max-width: 710px;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.06rem;
  line-height: 1.55;
}

.data-carga {
  display: inline-flex;
  margin: 16px 0 0;
  padding: 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.34);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.88rem;
  font-weight: 800;
}

.convenios-data-carga {
  margin: 0 22px 18px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 700;
}

.shell {
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.tabs,
.subtabs {
  display: flex !important;
  gap: 0;
  margin: 0 0 32px;
  padding: 0;
  border: 0 !important;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.tabs > .tab,
.subtabs > .subtab {
  display: block !important;
  flex: 1 1 0;
  width: auto !important;
  min-height: 44px;
  border: 1px solid #d0d5dd !important;
  border-radius: 12px 12px 0 0 !important;
  background: #f0f4f8 !important;
  color: var(--text-primary) !important;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  line-height: 1.15;
  padding: 12px 24px !important;
  cursor: pointer;
  transition: all 0.2s ease !important;
}

.tabs > .tab:hover,
.subtabs > .subtab:hover {
  background: #e8edf3 !important;
}

.tabs > .tab:nth-child(1),
.subtabs > .subtab:nth-child(1) {
  border-top: 3px solid #0c5ea6 !important;
}

.tabs > .tab:nth-child(2),
.subtabs > .subtab:nth-child(2) {
  border-top: 3px solid #12b76a !important;
}

.subtabs > .subtab:nth-child(3) {
  border-top: 3px solid #f79009 !important;
}

.subtabs > .subtab:nth-child(4) {
  border-top: 3px solid #b91c1c !important;
}

.tabs > .tab:nth-child(1).tab-selected,
.subtabs > .subtab:nth-child(1).subtab-selected {
  border-top-color: #071d41 !important;
  background: #0c5ea6 !important;
  color: var(--text-inverse) !important;
  box-shadow: var(--shadow-md);
}

.tabs > .tab:nth-child(2).tab-selected,
.subtabs > .subtab:nth-child(2).subtab-selected {
  border-top-color: #12b76a !important;
  background: #12b76a !important;
  color: var(--text-inverse) !important;
  box-shadow: var(--shadow-md);
}

.subtabs > .subtab:nth-child(3).subtab-selected {
  border-top-color: #f79009 !important;
  background: #f79009 !important;
  color: var(--text-primary) !important;
  box-shadow: var(--shadow-md);
}

.subtabs > .subtab:nth-child(4).subtab-selected {
  border-top-color: #b91c1c !important;
  background: #b91c1c !important;
  color: var(--text-inverse) !important;
  box-shadow: var(--shadow-md);
}

.tabs > .tab:focus-visible,
.subtabs > .subtab:focus-visible {
  outline: 3px solid rgba(12, 94, 166, 0.22);
  outline-offset: 2px;
}

.filters,
.kpi-grid,
.charts-grid,
.analytics-section,
.preview-section,
.linked-items-section,
.table-section {
  margin-bottom: 22px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 0.8fr) minmax(260px, 1.2fr) 180px;
  gap: 18px;
  align-items: end;
  padding: 16px 18px 18px;
  border: 1px solid #cbdbe7;
  border-top: 3px solid var(--funasa-blue);
  border-radius: var(--radius-md);
  background: #f7fafc;
  box-shadow: 0 4px 14px rgba(12, 94, 166, 0.06);
}

.proposal-filters {
  grid-template-columns: minmax(160px, 0.7fr) minmax(240px, 1fr) minmax(260px, 1fr) minmax(320px, 1.2fr);
}

.convenios-filters {
  grid-template-columns: minmax(330px, 1.2fr) minmax(260px, 1fr) minmax(180px, 0.6fr);
}

.convenios-filters.compartilhados {
  grid-template-columns:
    minmax(150px, 0.65fr)
    minmax(320px, 1.25fr)
    minmax(230px, 1fr)
    minmax(130px, 0.55fr)
    minmax(230px, 1fr);
}

.convenios-datas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 0 22px 18px;
}

.convenios-datas p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 700;
}

.date-range {
  width: 100%;
}

.date-range .DateRangePicker,
.date-range .DateRangePickerInput {
  width: 100%;
}

.date-range .DateRangePickerInput {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
  align-items: center;
  min-height: 48px;
  overflow: hidden;
  border: 1px solid #aebfcd;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 2px 5px rgba(29, 41, 57, 0.06);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.date-range .DateRangePickerInput:hover {
  border-color: var(--funasa-blue);
  box-shadow: 0 3px 9px rgba(12, 94, 166, 0.1);
}

.date-range .DateRangePickerInput:focus-within {
  border-color: var(--funasa-blue);
  box-shadow: 0 0 0 3px rgba(12, 94, 166, 0.14);
}

.date-range .DateInput {
  width: 100%;
  background: var(--surface);
}

.date-range .DateInput_input {
  height: 46px;
  padding: 0 12px;
  border: 0;
  background: var(--surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 46px;
}

.date-range .DateInput_input__focused {
  border: 0;
  background: #f7fbfe;
}

.date-range .DateRangePickerInput_arrow {
  display: inline-flex;
  height: 46px;
  align-items: center;
  padding: 0 9px;
  border-right: 1px solid #dbe5ec;
  border-left: 1px solid #dbe5ec;
  background: #f2f7fa;
  color: var(--funasa-blue);
}

.date-range .DateRangePickerInput_arrow_svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.date-range .DateRangePickerInput_clearDates {
  margin: 0 7px 0 4px;
  color: #66788c;
}

.date-range .DateRangePickerInput_clearDates:hover {
  background: var(--funasa-red-soft);
  color: var(--funasa-red);
}

.date-range .DayPicker,
.date-range .DayPicker__withBorder {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.date-range .CalendarMonth_caption {
  color: var(--funasa-blue-dark);
  font-weight: 800;
}

.date-range .DayPicker_weekHeader {
  color: var(--text-secondary);
  font-weight: 700;
}

.date-range .CalendarDay__default:hover {
  border-color: #9cc5df;
  background: var(--funasa-blue-soft);
  color: var(--funasa-blue-dark);
}

.date-range .CalendarDay__selected_span,
.date-range .CalendarDay__hovered_span {
  border-color: #a9cee8;
  background: #dceef9;
  color: var(--funasa-blue-dark);
}

.date-range .CalendarDay__selected,
.date-range .CalendarDay__selected:hover {
  border-color: var(--funasa-blue-dark);
  background: var(--funasa-blue);
  color: var(--text-inverse);
}

.date-range .DayPickerNavigation_button__default {
  border-color: #c7d8e4;
  border-radius: var(--radius-sm);
  background: #f5f9fc;
}

.control > label {
  display: flex;
  min-height: 16px;
  align-items: center;
  gap: 7px;
  margin: 0 0 8px;
  color: #34495e;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: color 160ms ease;
}

.control > label::before {
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: var(--funasa-blue);
  content: "";
  transition: background 160ms ease, height 160ms ease;
}

.control:focus-within > label {
  color: var(--funasa-blue-dark);
}

.control:focus-within > label::before {
  height: 16px;
  background: var(--funasa-red);
}

.dash-dropdown .Select-control {
  min-height: 48px;
  border: 1px solid #aebfcd;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 2px 5px rgba(29, 41, 57, 0.06);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.dash-dropdown .Select-control:hover {
  border-color: var(--funasa-blue);
  box-shadow: 0 3px 9px rgba(12, 94, 166, 0.1);
}

.dash-dropdown.is-focused .Select-control,
.dash-dropdown .is-focused:not(.is-open) > .Select-control {
  border-color: var(--funasa-blue);
  box-shadow: 0 0 0 3px rgba(12, 94, 166, 0.14);
}

.dash-dropdown.is-open .Select-control {
  border-color: var(--funasa-blue);
  border-bottom-right-radius: var(--radius-md);
  border-bottom-left-radius: var(--radius-md);
}

.dash-dropdown .Select-placeholder,
.dash-dropdown .Select--single > .Select-control .Select-value {
  padding-left: 14px;
  color: #52647a;
  font-weight: 600;
  line-height: 46px;
}

.dash-dropdown .Select-input {
  height: 46px;
  padding-left: 12px;
}

.dash-dropdown .Select-input > input {
  padding: 13px 0 11px;
  color: var(--text-primary);
  font-family: inherit;
}

.dash-dropdown .Select-value-label {
  color: var(--text-primary) !important;
  font-weight: 600;
}

.dash-dropdown .Select-menu-outer {
  z-index: 1005;
  margin-top: 7px;
  overflow: hidden;
  border: 1px solid #b8ccd9;
  border-top: 3px solid var(--funasa-blue);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.dash-dropdown .Select-option {
  padding: 11px 13px;
  border-left: 3px solid transparent;
  color: var(--text-primary);
  font-size: 0.88rem;
}

.dash-dropdown .Select-option.is-focused {
  border-left-color: var(--funasa-blue);
  background: var(--funasa-blue-soft);
}

.dash-dropdown .Select-option.is-selected {
  border-left-color: var(--funasa-blue-dark);
  background: #d9ecf8;
  color: var(--funasa-blue-dark);
  font-weight: 700;
}

.dash-dropdown .Select-arrow-zone,
.dash-dropdown .Select-clear-zone {
  color: #52647a;
}

.dash-dropdown .Select-arrow-zone {
  width: 42px;
  border-left: 1px solid #dbe5ec;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: #f2f7fa;
}

.dash-dropdown .Select-arrow {
  border-top-color: var(--funasa-blue);
}

.dash-dropdown.is-open .Select-arrow {
  border-top-color: transparent;
  border-bottom-color: var(--funasa-blue);
}

.dash-dropdown .Select-clear-zone:hover {
  color: var(--funasa-red);
}

.dash-dropdown.Select--multi .Select-multi-value-wrapper {
  display: flex;
  min-height: 46px;
  align-items: center;
  overflow-x: auto;
  padding: 3px 2px 3px 8px;
  scrollbar-width: thin;
}

.dash-dropdown.Select--multi .Select-value {
  flex: 0 0 auto;
  margin: 2px 4px 2px 0;
  border: 1px solid #8fbedc;
  border-radius: var(--radius-sm);
  background: var(--funasa-blue-soft);
  color: var(--funasa-blue-dark);
}

.dash-dropdown.Select--multi .Select-value-icon {
  border-right-color: #a9cee8;
}

.dash-dropdown.Select--multi .Select-value-icon:hover {
  background: var(--funasa-red-soft);
  color: var(--funasa-red);
}

.dash-dropdown.is-disabled .Select-control {
  border-color: var(--border);
  background: var(--surface-muted);
  box-shadow: none;
}

button.dash-dropdown {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #aebfcd;
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  box-shadow: 0 2px 5px rgba(29, 41, 57, 0.06);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

button.dash-dropdown:hover,
button.dash-dropdown:focus,
button.dash-dropdown[data-state="open"] {
  border-color: var(--funasa-blue);
  box-shadow: 0 0 0 3px rgba(12, 94, 166, 0.14);
  outline: none;
}

button.dash-dropdown .dash-dropdown-grid-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 46px;
}

button.dash-dropdown .dash-dropdown-value {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 0.96rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button.dash-dropdown .dash-dropdown-placeholder {
  color: #697a92;
}

button.dash-dropdown svg {
  color: #52647a;
}

.dash-dropdown-content {
  display: flex;
  flex-direction: column;
  z-index: 1200;
  min-width: var(--radix-popover-trigger-width);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.dash-dropdown-search-container {
  position: sticky;
  top: 0;
  z-index: 1;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 38px;
  margin: 8px;
  padding: 0 9px;
  border: 1px solid #c7d4df;
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.dash-dropdown-search-container:focus-within {
  border-color: var(--funasa-blue);
  box-shadow: 0 0 0 3px rgba(12, 94, 166, 0.12);
}

.dash-dropdown-search-icon {
  color: var(--funasa-blue);
}

.dash-dropdown-search {
  width: 100%;
  min-width: 0;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  outline: none;
}

.dash-dropdown-actions {
  display: flex;
  gap: 4px;
  padding: 5px 8px 7px;
  border-bottom: 1px solid var(--border);
}

.dash-dropdown-action-button {
  padding: 5px 7px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--funasa-blue-dark);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.dash-dropdown-action-button:hover,
.dash-dropdown-action-button:focus-visible {
  background: var(--funasa-blue-soft);
  color: var(--funasa-blue-dark);
  outline: none;
}

.dash-dropdown-options {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.dash-dropdown-option {
  padding: 9px 11px;
  border-left: 3px solid transparent;
  border-bottom: 1px solid #edf1f5;
  color: var(--text-primary);
  font-size: 0.86rem;
  cursor: pointer;
}

.dash-dropdown-option:hover,
.dash-dropdown-option:focus-within {
  border-left-color: var(--funasa-blue);
  background: var(--funasa-blue-soft);
}

.dash-dropdown-option[aria-selected="true"] {
  border-left-color: var(--funasa-blue-dark);
  background: #dceef9;
  color: var(--funasa-blue-dark);
  font-weight: 700;
}

.dash-dropdown-option input {
  width: 15px;
  height: 15px;
  margin: 0 8px 0 0;
  accent-color: var(--funasa-blue);
}

.dash-dropdown-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #66788c;
  cursor: pointer;
}

.dash-dropdown-clear:hover,
.dash-dropdown-clear:focus-visible {
  color: var(--funasa-red);
  outline: none;
}

.text-input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #aebfcd;
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-primary);
  font: inherit;
  outline: none;
  box-shadow: 0 2px 5px rgba(29, 41, 57, 0.06);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.text-input:hover {
  border-color: var(--funasa-blue);
  box-shadow: 0 3px 9px rgba(12, 94, 166, 0.1);
}

.text-input:focus {
  border-color: var(--funasa-blue);
  box-shadow: 0 0 0 3px rgba(12, 94, 166, 0.14);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-height: 40px;
  padding-bottom: 2px;
  border-bottom: 2px solid #cbd7e6;
}

.segmented-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.segmented label {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 6px;
  color: #334155;
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: none;
}

.segmented input {
  margin-right: 6px;
  accent-color: var(--funasa-blue);
}

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

.kpi-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kpi-card,
.chart,
.table-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
}

.kpi-card {
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 20px;
  min-width: 0;
}

.kpi-label {
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.kpi-value {
  min-width: 0;
  color: var(--text-primary);
  font-size: clamp(1.45rem, 2.2vw, 2.35rem);
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-detail {
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

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

.chart {
  min-width: 0;
  overflow: hidden;
  padding: 8px;
}

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

.preview-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
}

.preview-title {
  display: grid;
  gap: 6px;
  padding: 18px 18px 10px;
}

.preview-title h3,
.preview-title p {
  margin: 0;
}

.preview-title h3 {
  font-size: 1.08rem;
}

.preview-title p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.4;
}

.preview-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0 18px 6px;
}

.preview-kpi-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(216, 225, 236, 0.9);
  border-radius: 8px;
  background: var(--surface-muted);
}

.preview-kpi-label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.preview-kpi-value {
  display: block;
  min-width: 0;
  margin-top: 6px;
  color: var(--text-primary);
  font-size: clamp(1rem, 1.35vw, 1.35rem);
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-kpi-detail {
  display: block;
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 0.76rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.chart-large {
  grid-column: 1 / -1;
}

.map-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  padding: 12px 0;
}

.map-metric-control {
  flex: 1;
  max-width: 760px;
}

.geo-instruction {
  margin: 0 0 8px;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.geo-primary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(340px, 0.75fr);
  gap: 16px;
  margin-bottom: 16px;
}

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

.municipio-detail {
  margin-top: 22px;
  padding-top: 4px;
  border-top: 1px solid rgba(100, 116, 139, 0.22);
}

.table-section {
  overflow: hidden;
}

.convenios-table-section {
  min-width: 0;
}

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

.linked-table-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
}

.linked-table-panel h3 {
  margin: 0;
  padding: 18px 18px 8px;
  font-size: 1.05rem;
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 22px 14px;
}

.action-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--funasa-blue);
  border-radius: 8px;
  background: var(--funasa-blue);
  color: #fff;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
}

.action-button:hover,
.action-button:focus {
  background: var(--funasa-blue-dark);
  outline: none;
}

.action-button-secondary {
  border-color: var(--funasa-blue-dark);
  background: #fff;
  color: var(--funasa-blue-dark);
}

.action-button-secondary:hover,
.action-button-secondary:focus {
  background: #e7f1f8;
  color: var(--funasa-blue-dark);
}

.report-note {
  margin: -8px 0 24px;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.proposal-summary {
  display: grid;
  gap: 8px;
  max-width: 100%;
}

.proposal-summary-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.proposal-summary-heading strong {
  color: var(--text-primary);
}

.proposal-summary-heading span,
.proposal-summary-alerts span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e7f1f8;
  color: var(--funasa-blue-dark);
  font-size: 0.76rem;
  font-weight: 800;
}

.proposal-summary-meta,
.proposal-summary-object {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.35;
}

.proposal-summary-object {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.proposal-summary-values,
.proposal-summary-alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.proposal-summary-values span {
  display: inline-flex;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid rgba(216, 225, 236, 0.9);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 700;
}

.proposal-summary-footnote {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 8px;
}

.section-title h2,
.section-title p {
  margin: 0;
}

.section-title h2 {
  font-size: 1.2rem;
}

.section-title p {
  color: var(--text-secondary);
}

.section-title-secondary {
  margin-top: 8px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}

@media (max-width: 1100px) {
    .hero,
    .filters,
    .convenios-filters.compartilhados,
    .charts-grid,
    .preview-grid,
    .geo-primary-grid {
        grid-template-columns: 1fr;
    }

  .chart-large {
    grid-column: auto;
    grid-row: auto;
  }

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

  .map-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .map-metric-control {
    max-width: none;
    width: 100%;
  }
}

@media (max-width: 680px) {
  .hero {
    padding: 32px 20px 26px;
  }

  .brand-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .shell {
    width: min(100% - 24px, 1440px);
    padding-top: 16px;
  }

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

  .filters {
    gap: 14px;
    padding: 14px;
  }

  .tabs {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 22px;
  }

  .tabs > .tab {
    min-height: 48px;
    border-radius: 8px !important;
    padding: 10px 8px !important;
  }

  .subtabs {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 22px;
  }

  .subtabs > .subtab {
    width: 100% !important;
    min-height: 48px;
    border-radius: 8px !important;
    padding: 10px 8px !important;
  }

  .segmented-four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 78px;
  }

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

  .preview-kpi-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .table-actions {
    justify-content: stretch;
    padding-inline: 14px;
  }

  .action-button {
    width: 100%;
  }
}
