@charset "UTF-8";

/* Slides 5 (Produção e Qualidade) e 6 (Carteira e Território) — usam os tokens de dashboard.css */

.prod-aviso {
  flex: 0 0 auto;
  padding: 6px 12px;
  color: var(--ink-strong);
  border: 1px solid var(--warning);
  border-radius: 8px;
  background: var(--warning-soft);
  font-size: 0.7188rem;
  font-weight: 600;
  line-height: 1.35;
}
.prod-aviso[hidden] { display: none; }

/* Slide 5: 40 % gráficos em cima, 60 % tabelas embaixo (flex-basis 0 + min-height 0 mantêm a proporção exata) */
.grid-two--prod-main { flex: 4 1 0; min-height: 0; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.grid-two--prod-attn { flex: 6 1 0; min-height: 0; }
.grid-two--prod-main > .panel-card:last-child .panel-heading { min-height: 0; margin-bottom: 8px; }

.segmented-control--compact button { min-width: auto; padding: 5px 9px; }
.panel-heading--with-controls .panel-heading-actions { flex-wrap: wrap; justify-content: flex-end; }
.panel-heading p { font-style: normal; }

/* Trajetória dos produtores */
/* Os três blocos dividem toda a altura do painel */
.traj-list { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.traj-list > .traj-row { flex: 1 1 0; min-height: 0; }
.traj-empty { margin: auto; color: var(--muted); font-size: 0.75rem; text-align: center; }
.traj-row {
  width: 100%;
  padding: 4px 10px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 10px;
  background: var(--surface-soft);
  text-align: left;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.traj-row:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.traj-row:focus-visible { outline: 3px solid rgba(79, 201, 176, 0.35); outline-offset: 2px; }
.traj-row strong { font-size: 1.25rem; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.traj-row span { display: flex; flex-direction: column; font-size: 0.7812rem; font-weight: 700; }
.traj-row span i { margin-top: 0; color: var(--muted); font-size: 0.6875rem; font-style: normal; font-weight: 500; }
.traj-row em { color: var(--muted); font-size: 0.6875rem; font-style: normal; font-weight: 700; white-space: nowrap; }
.traj-row--up { border-left-color: var(--green-600); }
.traj-row--up strong { color: var(--green-700); }
.traj-row--flat { border-left-color: var(--warning); }
.traj-row--flat strong { color: var(--warning); }
.traj-row--down { border-left-color: var(--danger); }
.traj-row--down strong { color: var(--danger); }
.traj-row[disabled] { opacity: 0.55; cursor: default; }

.table-card .table-scroll { flex: 1; min-height: 0; }
/* Mesma altura de linha das tabelas da tela 1 (lá a linha é ditada pelo badge de status, ~15px) */
.grid-two--prod-attn .data-table tbody td { line-height: 15px; }
.data-table td.num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table td.neg { color: var(--danger); font-weight: 700; }
.data-table td.pos { color: var(--green-700); font-weight: 700; }
#modalListaProdutores .modal-card { max-width: 1040px; width: 94%; }
#modalListaProdutores .modal-body { padding: 14px 20px; }
#modalListaProdutores .table-scroll { flex: none; max-height: 52vh; overflow: auto; }
#modalListaProdutores .modal-header-right { display: flex; align-items: center; gap: 10px; }

/* Carteira e território */
.grid-territory {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.75fr);
  gap: 10px;
}
.territory-side { min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.territory-side .panel-card { flex: 1; min-height: 0; }

.map-panel { min-height: 0; }
.map-wrap { position: relative; flex: 1; min-height: 0; }
#mapaTerritorio {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: var(--surface-soft);
}
#mapaTerritorio.leaflet-container { font-family: inherit; background: var(--surface-soft); }
.map-empty {
  position: absolute; inset: 0; z-index: 500;
  display: grid; place-items: center;
  color: var(--muted); font-size: 0.7812rem; font-weight: 600;
  background: var(--surface-soft); border-radius: 8px;
}
.map-empty[hidden], .map-ficha[hidden] { display: none; }

.map-ficha {
  position: absolute; top: 10px; right: 10px; z-index: 500;
  width: 248px; max-width: calc(100% - 20px);
  padding: 12px 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(4px);
}
.map-ficha .fc-fechar {
  position: absolute; top: 6px; right: 8px;
  color: var(--muted); border: 0; background: none; font-size: 1.125rem; line-height: 1; cursor: pointer;
}
.map-ficha .fc-nome { padding-right: 18px; color: var(--ink-strong); font-size: 0.8125rem; font-weight: 800; line-height: 1.25; }
.map-ficha .fc-loc { margin-top: 2px; color: var(--muted); font-size: 0.7188rem; }
.map-ficha .fc-lista { margin-top: 8px; display: grid; gap: 4px; }
.map-ficha .fc-item { display: flex; justify-content: space-between; gap: 10px; font-size: 0.7rem; }
.map-ficha .fc-item span { color: var(--muted); }
.map-ficha .fc-item b { max-width: 62%; text-align: right; font-weight: 700; }
.map-ficha .fc-prod { margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.map-ficha .fc-prod span { display: block; color: var(--muted); font-size: 0.6562rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.map-ficha .fc-prod b { color: var(--green-700); font-size: 1.25rem; font-weight: 800; }
.map-ficha .fc-prod small { color: var(--muted); font-size: 0.6875rem; font-weight: 600; }
.map-ficha .fc-aprox { margin-top: 8px; padding: 4px 8px; color: var(--warning); border-radius: 6px; background: var(--warning-soft); font-size: 0.6562rem; font-weight: 700; }

.map-legend {
  flex: 0 0 auto;
  margin-top: 8px;
  display: flex; flex-wrap: wrap; gap: 4px 14px;
  color: var(--muted); font-size: 0.6875rem; font-weight: 600;
}
.map-legend .lg { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.map-legend .lg.off { opacity: 0.35; }
.map-legend .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.map-legend .lg-nota { margin-left: auto; cursor: default; }
.map-legend .lg-toggle { padding-right: 12px; border-right: 1px solid var(--line); font-weight: 700; color: var(--ink); }
.map-legend .dot-anel { background: transparent; border: 2px solid var(--muted); box-sizing: border-box; }

/* Escala da bolha de produção (área ∝ litros/dia) */
.map-escala {
  position: absolute; left: 10px; bottom: 10px; z-index: 500;
  padding: 8px 12px 6px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow-soft);
}
.map-escala[hidden] { display: none; }
.map-escala .me-titulo { font-size: 0.6562rem; font-weight: 800; }
.map-escala .me-linha { margin-top: 6px; display: flex; align-items: flex-end; gap: 12px; }
.map-escala .me-item { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.map-escala .me-item i { display: block; border: 1.5px solid var(--green-700); border-radius: 50%; background: color-mix(in srgb, var(--green-700) 20%, transparent); }
.map-escala .me-item span { color: var(--muted); font-size: 0.625rem; font-weight: 700; }
.map-escala .me-nota { margin-top: 4px; color: var(--muted); font-size: 0.5938rem; font-style: italic; }

.leaflet-tooltip.map-tip { color: var(--ink); border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow-soft); font-weight: 700; }
.leaflet-tooltip.map-tip::before { display: none; }

/* Sigla da UF no centro do estado (malha IBGE); escondida no zoom do Brasil inteiro */
.leaflet-tooltip.uf-rotulo { padding: 0; border: 0; background: transparent; box-shadow: none; color: var(--green-700); font-size: 0.625rem; font-weight: 700; letter-spacing: .04em; opacity: .55 !important; pointer-events: none; }
.leaflet-tooltip.uf-rotulo::before { display: none; }
#mapaTerritorio.sem-rotulo-uf .uf-rotulo { display: none; }

@media (max-width: 1024px) {
  .grid-two--prod-main, .grid-territory { display: flex !important; flex-direction: column !important; gap: 22px !important; }
  .grid-two--prod-main > .panel-card:last-child { align-self: stretch; }
  .grid-two--prod-attn { flex: none; }
  .territory-side { flex-direction: column; gap: 22px; }
  .territory-side .panel-card { min-height: 280px; }
  .map-panel { min-height: 0; }
  .map-wrap { flex: none; height: 440px; }
  .map-ficha { top: auto; bottom: 10px; right: 10px; left: 10px; width: auto; max-width: none; }
  .traj-row { grid-template-columns: 60px minmax(0, 1fr); }
  .traj-row em { display: none; }
}

/* Slide 7: Safra de Forrageiras */
/* Barra de filtros da tela 7: chips em pílula (ícone, rótulo e valor na mesma linha, como no resumo executivo do Semear).
   O seletor segue sendo o dropdown padrão dos filtros (.filter-control): ao abrir, mostra a caixa de seleção com pesquisa. */
.safra-toolbar { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.safra-toolbar .safra-filtro {
  height: 40px;
  min-width: 0;
  max-width: none;
  flex: 0 0 auto;
  padding: 0 16px;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.safra-toolbar .safra-filtro:hover { background: var(--surface); }
.safra-toolbar .safra-filtro .safra-ico {
  flex: 0 0 auto;
  margin: 0;
  color: var(--green-600);
  font-size: 1.25rem;
  letter-spacing: normal;
  text-transform: none;
  line-height: 1;
}
.safra-toolbar .safra-filtro .safra-rot {
  margin: 0;
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
  line-height: 1;
}
.safra-toolbar .safra-filtro .select-display-value,
.safra-toolbar .safra-filtro > strong {
  color: var(--ink-strong);
  font-size: 0.8125rem;
  font-weight: 800;
  line-height: 1.15;
}
.safra-toolbar .safra-filtro .select-display-value { max-width: 240px; padding-right: 20px; background-size: 14px; }
.safra-toolbar .safra-filtro--info { cursor: default; }
.safra-toolbar .safra-filtro--info:hover { border-color: var(--line); background: var(--surface); }
.safra-toolbar-nota { flex: 1 1 0; min-width: 0; color: var(--muted); font-size: 0.7188rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.safra-toolbar-espaco { flex: 0 0 0; }
/* Botão "Gerar PDF": pílula da mesma altura dos chips, ícone em círculo e legenda curta; gira enquanto monta o relatório */
.safra-btn-pdf {
  position: relative;
  height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 18px 0 5px;
  color: #fff;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--green-600, #0f7a55), var(--green-800, #014945));
  box-shadow: 0 4px 12px rgba(1, 73, 69, 0.22);
  font-family: inherit;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}
.safra-btn-pdf:hover { transform: translateY(-1px); box-shadow: 0 7px 16px rgba(1, 73, 69, 0.28); filter: brightness(1.06); }
.safra-btn-pdf:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(1, 73, 69, 0.22); }
.safra-btn-pdf:focus-visible { outline: 3px solid rgba(15, 122, 85, 0.35); outline-offset: 2px; }
.safra-btn-pdf-ico {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  font-size: 1.125rem;
}
.safra-btn-pdf-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.safra-btn-pdf-txt b { font-size: 0.7812rem; font-weight: 800; }
.safra-btn-pdf-txt small { font-size: 0.625rem; font-weight: 600; opacity: 0.8; }
.safra-btn-pdf-giro { display: none; }
.safra-btn-pdf.gerando { cursor: progress; filter: saturate(0.7); transform: none; }
.safra-btn-pdf.gerando .safra-btn-pdf-ico { color: transparent; }
.safra-btn-pdf.gerando .safra-btn-pdf-giro {
  display: block;
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: safra-giro 700ms linear infinite;
}
@keyframes safra-giro { to { transform: rotate(360deg); } }
.grid-safra {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}
.grid-safra > .panel-card { min-height: 0; }
.safra-rodape { flex: 0 0 auto; color: var(--muted); font-size: 0.6875rem; line-height: 1.35; }

@media (max-width: 1024px) {
  .grid-safra { display: flex !important; flex-direction: column !important; gap: 22px !important; }
  .grid-safra > .panel-card { min-height: 260px; }
}

/* Slide 7 — estilo de gráficos do HTML do Semear, com os tokens do BI */
.btn-pill {
  padding: 5px 12px;
  color: var(--green-700);
  border: 1px solid var(--green-600);
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: 0.7188rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-pill:hover { background: var(--green-100); }

.safra-sistema { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(150px, 0.9fr) minmax(0, 1.1fr); align-items: center; gap: 16px; }
.safra-donut { position: relative; height: 100%; min-height: 0; }
.safra-donut canvas { position: absolute; inset: 0; }
.safra-donut-centro { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.safra-donut-centro strong { color: var(--ink-strong); font-size: 1.625rem; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.safra-donut-centro span { color: var(--muted); font-size: 0.6875rem; font-weight: 600; }
.safra-legenda { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.safra-legenda li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.safra-legenda li:last-child { border-bottom: 0; }
.safra-legenda i { width: 12px; height: 12px; border-radius: 50%; }
.safra-legenda span { display: flex; flex-direction: column; min-width: 0; font-size: 0.8125rem; }
.safra-legenda small { color: var(--muted); font-size: 0.6875rem; font-weight: 500; }
.safra-legenda strong { color: var(--ink-strong); font-size: 1.25rem; font-weight: 800; }

.safra-destaque {
  flex: 0 0 auto;
  margin-top: 8px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  border-radius: 10px;
  background: var(--green-100);
  font-size: 0.75rem;
}
.safra-destaque > .material-symbols-rounded { color: var(--green-600); font-size: 1.25rem; }
.safra-destaque strong { color: var(--green-700); font-size: 1.125rem; font-weight: 800; }
.safra-destaque span { display: flex; flex-direction: column; }
.safra-destaque small { color: var(--muted); font-size: 0.6562rem; }

.safra-cob { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 12px; }
.safra-cob-lado { display: flex; align-items: center; gap: 12px; }
.safra-cob-lado + .safra-cob-lado { padding-left: 16px; border-left: 1px solid var(--line); }
.safra-cob-lado strong { font-size: clamp(38px, 5vw, 60px); font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.safra-cob-lado--com strong { color: #0f7a55; }
.safra-cob-lado--sem strong { color: #4f93d6; }
.safra-cob-lado span { color: var(--ink); font-size: 0.8125rem; font-weight: 600; line-height: 1.25; }
.safra-cob-lado small { display: block; margin-top: 2px; color: var(--muted); font-size: 0.6875rem; font-weight: 500; }
.safra-barra { flex: 0 0 auto; height: 43px; display: flex; overflow: hidden; border-radius: 8px; }
.safra-barra i { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 0.75rem; font-style: normal; font-weight: 800; transition: width 300ms ease; }
.safra-barra .com { background: #0f7a55; }
.safra-barra .sem { background: #4f93d6; }
/* Mais de uma safra: o histórico (colunas 100 % por safra) substitui os percentuais grandes e a barra */
.safra-cob-hist { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.safra-cob-hist .chart-box { flex: 1; min-height: 0; }
.safra-cob-hist-legenda { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--ink); font-size: 0.7188rem; font-weight: 600; }
.safra-cob-hist-legenda span { display: inline-flex; align-items: center; gap: 6px; }
.safra-cob-hist-legenda i { width: 10px; height: 10px; border-radius: 3px; }
.safra-cob-hist-legenda .com { background: #0f7a55; }
.safra-cob-hist-legenda .sem { background: #4f93d6; }
.safra-cob[hidden], .safra-barra[hidden], .safra-cob-hist[hidden] { display: none; }

.safra-custo-duplo { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 44px; }
.safra-custo-duplo > div + div { position: relative; }
.safra-custo-duplo > div + div::before { content: ''; position: absolute; left: -22px; top: 6px; bottom: 6px; border-left: 1px solid var(--line-soft); }
.safra-custo-duplo > div { min-height: 0; display: flex; flex-direction: column; }
.safra-custo-duplo .chart-box { flex: 1; min-height: 0; }
.safra-mini { margin: 0 0 2px; color: var(--muted); font-size: 0.6875rem; }
.safra-mini b { color: var(--ink-strong); font-size: 0.75rem; }
.safra-custo-duplo[hidden], #safraCustoCompBox[hidden] { display: none; }
#safraCustoCompBox { flex: 1; min-height: 0; }

@media (max-width: 1024px) {
  .safra-sistema { grid-template-columns: 1fr; }
  .safra-donut { height: 220px; }
  .safra-custo-duplo { grid-template-columns: 1fr; }
}

/* Sistema de plantio: rosca ocupa toda a altura do painel; destaque conservacionista só à direita */
.safra-sistema { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; }
.safra-sistema-lado { min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.safra-sistema-lado .safra-destaque { margin-top: 0; }
@media (max-width: 1024px) { .safra-sistema { grid-template-columns: 1fr; } }

/* Composição do custo por etapa: barras horizontais empilhadas (uma por sistema de plantio) */
.safra-comp { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 4px 4px 0; }
.safra-comp[hidden] { display: none; }
.safra-comp-legenda { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 0.7188rem; font-weight: 600; }
.safra-comp-legenda span { display: inline-flex; align-items: center; gap: 6px; }
.safra-comp-legenda i { width: 12px; height: 12px; border-radius: 3px; }
.safra-comp-linhas { display: flex; flex-direction: column; gap: 12px; }
.safra-comp-linha { display: grid; grid-template-columns: minmax(110px, 0.9fr) minmax(0, 3fr) auto; align-items: center; gap: 14px; }
.safra-comp-nome { display: flex; align-items: center; gap: 8px; min-width: 0; }
.safra-comp-nome i { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; }
.safra-comp-nome span { display: flex; flex-direction: column; min-width: 0; font-size: 0.8125rem; line-height: 1.15; }
.safra-comp-nome b { color: var(--ink-strong); font-weight: 800; }
.safra-comp-nome small { color: var(--muted); font-size: 0.6875rem; font-weight: 500; }
.safra-comp-trilho { height: 30px; min-width: 0; }
.safra-comp-barra { height: 100%; display: flex; gap: 1px; overflow: hidden; border-radius: 8px; transition: width 300ms ease; }
.safra-comp-seg { display: flex; align-items: center; justify-content: center; min-width: 0; font-size: 0.75rem; font-weight: 800; }
.safra-comp-total { min-width: 92px; color: var(--ink-strong); font-size: 1.125rem; font-weight: 800; text-align: right; white-space: nowrap; }
.safra-comp-nota { margin: 0; color: var(--muted); font-size: 0.6875rem; }

/* ── Gerar PDF da tela 7: relatório próprio (js/safra-relatorio.js) em A4 paisagem ──────────────────────
   Na tela o relatório não aparece; na impressão só ele é impresso. Cores fixas (claras) mesmo no tema escuro. */
@page {
  size: A4 landscape;
  margin: 9mm 10mm 11mm;
  @bottom-left { content: "Labor Rural · Safra de Forrageiras"; color: #7a8b87; font: 600 7.5pt "Open Sans", Arial, sans-serif; }
  @bottom-right { content: "Página " counter(page) " de " counter(pages); color: #7a8b87; font: 600 7.5pt "Open Sans", Arial, sans-serif; }
}
#safraRelatorio { display: none; }
@media print {
  html:has(body.imprimindo-relatorio) { height: auto !important; overflow: visible !important; background: #fff !important; }
  body.imprimindo-relatorio { display: block !important; height: auto !important; min-height: 0 !important; overflow: visible !important; background: #fff !important; }
  body.imprimindo-relatorio > *:not(#safraRelatorio) { display: none !important; }
  body.imprimindo-relatorio #safraRelatorio { display: block; }
}
.rel { color: #16302c; font-family: "Open Sans", Arial, sans-serif; font-size: 9pt; line-height: 1.35; }
.rel * { box-sizing: border-box; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.rel-pagina { break-after: page; }
.rel-pagina:last-child { break-after: auto; }
.rel h3 { margin: 0; color: #014945; font-size: 10.5pt; font-weight: 800; }
.rel-sub { margin: 1px 0 6px; color: #5d6f6b; font-size: 7.8pt; }

/* Cabeçalho de cada página */
.rel-cab { display: flex; align-items: center; gap: 12px; padding-bottom: 7px; margin-bottom: 8px; border-bottom: 2.5px solid #0f7a55; }
.rel-logo { height: 13mm; width: auto; }
.rel-cab-texto { flex: 1; min-width: 0; padding-left: 12px; border-left: 1px solid #dfe7e4; }
.rel-cab-texto h1 { margin: 0; color: #014945; font-size: 17pt; font-weight: 800; letter-spacing: -0.01em; line-height: 1.1; }
.rel-cab-texto p { margin: 2px 0 0; color: #5d6f6b; font-size: 8.5pt; font-weight: 600; }
.rel-cab-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; color: #5d6f6b; font-size: 7.5pt; font-weight: 600; text-align: right; }

/* Filtros aplicados */
.rel-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.rel-chips span { display: inline-flex; align-items: baseline; gap: 5px; padding: 3px 9px; border: 1px solid #cfe2da; border-radius: 999px; background: #f2f8f5; font-size: 8pt; font-weight: 700; }
.rel-chips b { color: #0f7a55; font-size: 6.8pt; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.rel-chips .rel-chip-largo { flex: 1 1 260px; font-weight: 600; }

/* Indicadores-chave */
.rel-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-bottom: 9px; }
.rel-kpi { display: flex; flex-direction: column; gap: 1px; padding: 7px 10px; border: 1px solid #dfe7e4; border-left: 4px solid #4f93d6; border-radius: 6px; background: #fff; }
.rel-kpi.verde { border-left-color: #0f7a55; background: #f2f8f5; }
.rel-kpi span { color: #5d6f6b; font-size: 6.8pt; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.rel-kpi strong { color: #014945; font-size: 15pt; font-weight: 800; line-height: 1.15; white-space: nowrap; }
.rel-kpi strong em { color: #5d6f6b; font-size: 8pt; font-style: normal; font-weight: 700; }
.rel-kpi small { color: #5d6f6b; font-size: 7pt; }

/* Cartões de gráfico */
.rel-grade3 { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 8px; margin-bottom: 9px; }
.rel-grade2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 8px; margin-bottom: 9px; }
.rel-card { min-width: 0; overflow: hidden; padding: 8px 10px; border: 1px solid #dfe7e4; border-radius: 7px; break-inside: avoid; }
.rel-graf { display: block; width: 100%; height: auto; }
.rel-sistema { display: grid; grid-template-columns: 33mm minmax(0, 1fr); align-items: center; gap: 6px; }
.rel-donut { width: 33mm; height: 33mm; }
.rel-sistema .rel-tab { font-size: 7.4pt; }
.rel-sistema .rel-tab td:first-child { white-space: nowrap; }
.rel-dot { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 2px; vertical-align: 0; }
.rel-leg { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px 12px; margin-top: 4px; color: #16302c; font-size: 7.5pt; font-weight: 600; }
.rel-leg span { display: inline-flex; align-items: center; gap: 5px; }
.rel-leg i { width: 9px; height: 9px; border-radius: 2px; }
.rel-cob { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 8px; padding-top: 10px; }
.rel-cob-num { display: flex; align-items: center; gap: 8px; }
.rel-cob-num + .rel-cob-num { padding-left: 10px; border-left: 1px solid #dfe7e4; }
.rel-cob-num strong { font-size: 22pt; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.rel-cob-num strong.verde { color: #0f7a55; }
.rel-cob-num strong.azul { color: #4f93d6; }
.rel-cob-num span { font-size: 7.4pt; font-weight: 700; line-height: 1.2; }
.rel-cob-num small { display: block; margin-top: 2px; color: #5d6f6b; font-size: 7pt; font-weight: 500; }
.rel-barra { grid-column: 1 / -1; height: 14px; display: flex; overflow: hidden; border-radius: 4px; }
.rel-barra i { display: block; height: 100%; }
.rel-nota { grid-column: 1 / -1; margin: 0; color: #5d6f6b; font-size: 7.2pt; }

/* Tabelas */
.rel-bloco { margin-bottom: 9px; break-inside: avoid; }
.rel-bloco h3 { margin-bottom: 5px; }
.rel-tab { width: 100%; border-collapse: collapse; font-size: 8pt; font-variant-numeric: tabular-nums; }
.rel-tab th { padding: 5px 7px; color: #fff; background: #014945; font-size: 7.2pt; font-weight: 800; text-align: left; white-space: nowrap; }
.rel-tab th:first-child { border-top-left-radius: 5px; }
.rel-tab th:last-child { border-top-right-radius: 5px; }
.rel-tab td { padding: 4px 7px; border-bottom: 1px solid #e6edea; }
.rel-tab tbody tr:nth-child(even) td { background: #f6f9f8; }
.rel-tab .n { text-align: right; white-space: nowrap; }
.rel-tab td small { display: block; color: #7a8b87; font-size: 6.6pt; }
.rel-tab tfoot td { border-top: 1.5px solid #014945; border-bottom: 0; background: #eef5f2; font-weight: 800; }
.rel-tab-compacta th { color: #5d6f6b; background: transparent; border-bottom: 1.5px solid #014945; }
.rel-tab-compacta th, .rel-tab-compacta td { padding: 4px 4px; }
.rel-tab-lista { font-size: 7.4pt; }
.rel-tab-lista thead { display: table-header-group; } /* repete o cabeçalho em cada página */
.rel-tab-lista tr { break-inside: avoid; }
.rel-tab-lista td { padding: 3px 6px; }
.rel-tab .vazio { padding: 14px; color: #5d6f6b; text-align: center; }

/* Notas */
.rel-notas { padding: 7px 10px; border-radius: 6px; background: #f6f9f8; break-inside: avoid; }
.rel-notas h4 { margin: 0 0 3px; color: #014945; font-size: 8pt; font-weight: 800; }
.rel-notas ul { margin: 0; padding-left: 14px; color: #3d504c; font-size: 7.3pt; }

/* Tela 7: conteúdo gráfico dos painéis some em tela cheia, dando lugar à tabela de detalhe por fazenda (mesmo padrão das telas 3–5). */
.panel-card.is-fullscreen .safra-vista-grafico {
  display: none !important;
}

/* Notebook (1025–1600px de largura): piso de fonte no mapa, na legenda e na safra */
@media (min-width: 1025px) and (max-width: 1600px) {
  .map-ficha .fc-prod span,
  .map-ficha .fc-aprox,
  .map-escala .me-titulo,
  .safra-destaque small { font-size: 0.6875rem; }
  .map-escala .me-item span,
  .leaflet-tooltip.uf-rotulo,
  .safra-btn-pdf-txt small { font-size: 0.6562rem; }
  .map-escala .me-nota { font-size: 0.625rem; }
}
