:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-soft: #f9fbff;
  --text: #182235;
  --muted: #6a7488;
  --highlight: #1e7ba9;
  --line: #e7ecf5;
  --blue: #2563eb;
  --blue-soft: #eaf1ff;
  --cyan: #00a5c8;
  --pink: #ff5381;
  --green: #1bbf89;
  --orange: #f59e0b;
  --red: #ef4444;
  --purple: #7c3aed;
  --violete: #655499;
  --shadow: 0 18px 48px rgba(27, 39, 63, 0.09);
  --shadow-soft: 0 10px 30px rgba(27, 39, 63, 0.07);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --max: 1440px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.09), transparent 34rem),
    radial-gradient(circle at 85% 8%, rgba(255, 83, 129, 0.10), transparent 28rem),
    var(--bg);
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 28px;
  border: 1px solid rgba(231, 236, 245, 0.82);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-soft);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--pink));
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.10);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2.1rem, 4vw, 4.2rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

h1 span {
  display: block;
  color: var(--muted);
  font-weight: 700;
}

.subtitle {
  max-width: 720px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.65;
}

.actions {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.upload-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 12px;
  row-gap: 2px;
  min-width: 280px;
  padding: 16px;
  border: 1px dashed rgba(37, 99, 235, 0.38);
  border-radius: 20px;
  background: linear-gradient(135deg, #ffffff, #f8fbff);
  cursor: pointer;
  transition: 0.25s ease;
}

.upload-card:hover,
.upload-card.dragging {
  transform: translateY(-2px);
  border-color: var(--blue);
  box-shadow: var(--shadow-soft);
}

.upload-card input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.upload-icon {
  grid-row: span 2;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--pink));
  font-size: 1.35rem;
  font-weight: 900;
}

.upload-card strong {
  align-self: end;
  font-size: 0.98rem;
}

.upload-card small {
  color: var(--muted);
}

.ghost-button {
  min-height: 76px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(27, 39, 63, 0.05);
  cursor: pointer;
  transition: 0.2s ease;
}

.ghost-button:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.35);
}

.status-strip {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin: 18px 0;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.75);
  color: var(--muted);
}

.status-strip > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-strip strong {
  color: var(--text);
}

.dot {
  display: inline-flex;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 7px rgba(27, 191, 137, 0.12);
}

.section-nav {
  position: sticky;
  top: 12px;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  overflow: visible;
  margin: 16px 0 26px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,0.90);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
}

.section-nav a,
.section-nav-more summary {
  flex: 0 0 auto;
  padding: 11px 14px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 750;
  line-height: 1;
  transition: 0.2s ease;
}

.section-nav a:hover,
.section-nav-more summary:hover,
.section-nav-more[open] summary {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--pink));
}

.section-nav-more {
  position: relative;
  flex: 0 0 auto;
}

.section-nav-more summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.section-nav-more summary::-webkit-details-marker {
  display: none;
}

.section-nav-more summary span {
  font-size: 0.72rem;
  transition: transform 0.2s ease;
}

.section-nav-more[open] summary span {
  transform: rotate(180deg);
}

.section-nav-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  min-width: 245px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.98);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.section-nav-menu a {
  display: flex;
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  white-space: nowrap;
}

.section-nav-menu a + a {
  margin-top: 4px;
}

.section-block {
  margin-top: 24px;
  scroll-margin-top: 110px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 24px;
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -120px;
  top: -120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.13), transparent 65%);
  pointer-events: none;
}

.panel-inner {
  position: relative;
  z-index: 1;
  padding: 26px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.section-title h2 {
  font-size: clamp(1.5rem, 2.4vw, 2.25rem);
  letter-spacing: -0.04em;
}

.section-title p {
  max-width: 720px;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 0.82rem;
  font-weight: 850;
  white-space: nowrap;
}

.badge.pink {
  color: #d91d55;
  background: #fff0f5;
}

.badge.green {
  color: #087f5b;
  background: #eafaf4;
}

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

.kpi-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, #fff, #fbfcff);
}

.kpi-card small {
  display: block;
  min-height: 34px;
  color: var(--muted);
  font-weight: 760;
  line-height: 1.35;
  text-align: center;
}

.kpi-card strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.6rem, 2vw, 2rem);
  letter-spacing: -0.06em;
  text-align: center;
  color: var(--violete);
}

.kpi-card .mini-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  text-align: center;
}

.highlight-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  min-height: 100%;
}

.big-number {
    margin-top: 8px;
    font-size: clamp(3.2rem, 8vw, 7rem);
    line-height: 0.9;
    letter-spacing: -0.08em;
    color: var(--violete);
    font-weight: bold;
}

.progress-circle {
  --value: 0;
  --accent: var(--blue);
  position: relative;
  display: grid;
  width: clamp(150px, 17vw, 230px);
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background:
    conic-gradient(from -90deg, var(--accent) calc(var(--value) * 1%), #edf1f7 0);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.8), 0 20px 46px rgba(37, 99, 235, 0.13);
}

.progress-circle::before {
  content: "";
  position: absolute;
  inset: 13px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 1px 4px rgba(27, 39, 63, 0.08);
}

.progress-circle strong,
.progress-circle span {
  position: relative;
  z-index: 1;
}

.progress-circle strong {
  font-size: clamp(1.7rem, 3vw, 3rem);
  letter-spacing: -0.06em;
}

.progress-circle span {
  margin-top: -14px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.semi-progress {
  --value: 0;
  --accent: var(--violete);
  position: relative;
  width: min(100%, 380px);
  height: 192px;
  margin: 0 auto;
  overflow: hidden;
}

.semi-progress::before {
  content: "";
  position: absolute;
  width: 100%;
  aspect-ratio: 1;
  left: 0;
  bottom: -100%;
  border-radius: 50%;
  background:
    conic-gradient(from 270deg,
      var(--accent) calc(var(--value) * 1.8deg),
      #edf1f7 0 180deg,
      transparent 180deg 360deg);
  mask: radial-gradient(circle, transparent 57%, #000 58%);
  -webkit-mask: radial-gradient(circle, transparent 57%, #000 58%);
  filter: drop-shadow(0 16px 30px rgba(27, 39, 63, 0.10));
}

.semi-progress .semi-value {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  text-align: center;
}

.semi-value strong {
  display: block;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: -0.08em;
  color: var(--violete);
}

.semi-value span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.progress-list {
  display: grid;
  gap: 12px;
}

.progress-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(120px, 2fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.progress-row:last-child {
  border-bottom: 0;
}

.progress-row .name {
  color: var(--text);
  font-weight: 760;
  line-height: 1.35;
}

.progress-row .value {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.bar {
  position: relative;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f7;
}

.bar > i {
  display: block;
  width: calc(var(--value) * 1%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent, var(--blue)), var(--accent-2, var(--pink)));
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent, var(--blue)) 25%, transparent);
}

.raiox-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 24px;
}

.raiox-summary {
  display: grid;
  gap: 16px;
}

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

.raiox-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, #fff, #fbfcff);
}

.raiox-item h3 {
  min-height: 44px;
  font-size: 1rem;
  line-height: 1.35;
  color: var(--violete);
}

.raiox-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0 12px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 780;
}

.section-grid {
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  gap: 24px;
}

.total-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  min-height: 100%;
}

.total-panel .total {
  font-size: clamp(3rem, 7vw, 5.8rem);
  line-height: 0.92;
  letter-spacing: -0.08em;
}

.table-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
}

.table-wrap {
  max-height: 540px;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: #fbfcff;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

td:last-child,
th:last-child {
  text-align: right;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #fafcff;
}

.rank-pill {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  margin-right: 8px;
  border-radius: 10px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 0.8rem;
  font-weight: 900;
}

.muted-row {
  color: #9aa4b8;

}

body.dashboard-empty .section-nav {
  display: none;
}

body.dashboard-empty main .section-block:not(#resumo-geral) {
  display: none;
}

button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none !important;
}

.empty-dashboard-card {
  max-width: 820px;
  margin: 34px auto 0;
  text-align: center;
}

.empty-dashboard-card .panel-inner {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: clamp(32px, 5vw, 58px);
}

.empty-dashboard-card h2 {
  max-width: 660px;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.empty-dashboard-card p {
  max-width: 660px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.empty-hero-icon {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border-radius: 24px;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--pink));
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.22);
  font-size: 2rem;
  font-weight: 900;
}

.primary-upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  margin-top: 6px;
  padding: 0 22px;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--pink));
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.20);
  font-weight: 900;
  cursor: pointer;
  transition: 0.2s ease;
}

.primary-upload-button:hover {
  transform: translateY(-2px);
}

.empty-state {
  padding: 26px;
  border: 1px dashed var(--line);
  border-radius: 22px;
  color: var(--muted);
  background: #fff;
  text-align: center;
}

.footer-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

@media (max-width: 1120px) {
  .topbar,
  .hero-grid,
  .raiox-grid,
  .section-grid {
    grid-template-columns: 1fr;
  }

  .highlight-card {
    grid-template-columns: 1fr;
  }

  .progress-circle {
    justify-self: center;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(calc(100% - 20px), var(--max));
    padding-top: 10px;
  }

  .topbar,
  .panel-inner {
    padding: 20px;
  }

  .actions,
  .upload-card,
  .ghost-button {
    width: 100%;
  }

  .ghost-button {
    min-height: 54px;
  }

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

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

  .progress-row {
    grid-template-columns: 1fr;
  }

  table {
    min-width: 680px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .actions,
  .section-nav {
    display: none;
  }

  .page-shell {
    width: 100%;
    padding: 0;
  }

  .panel,
  .topbar,
  .status-strip {
    box-shadow: none;
    break-inside: avoid;
  }

  .section-block {
    break-inside: avoid;
  }
}


/* ===== Título de destaque e Leitura rápida / Raio X executivo ===== */
.muted {
  font-weight: bold;
}
small.info {
    color: var(--muted);
}

.featured-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 28px 0 6px;
}

.featured-title span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.35), rgba(255, 83, 129, 0.35), transparent);
}

.featured-title h3 {
  position: relative;
  margin: 0;
  padding: 10px 18px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--pink));
  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.22);
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.kpi-card-muted {
  opacity: 0.62;
  background: #f8fafc;
}

.quick-read-panel::after {
  background: radial-gradient(circle, rgba(255, 83, 129, 0.13), transparent 65%);
}

.quick-progress-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid rgba(27, 191, 137, 0.18);
  border-radius: 26px;
  background: radial-gradient(circle at 18% 10%, rgba(27, 191, 137, 0.13), transparent 30%), linear-gradient(135deg, #ffffff, #f4fffb);
}

.quick-progress-copy {
  position: relative;
  z-index: 1;
}

.quick-progress-copy strong {
  display: block;
  margin-top: 12px;
  font-size: clamp(2.8rem, 6vw, 5.2rem);
  line-height: 0.9;
  letter-spacing: -0.08em;
  color: var(--violete);
}

.quick-progress-copy p {
  max-width: 420px;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.55;
}

.quick-progress-ring {
  --value: 0;
  --accent: var(--green);
  position: relative;
  display: grid;
  width: clamp(126px, 14vw, 172px);
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(from -90deg, var(--accent) calc(var(--value) * 1%), #e8edf5 0);
  box-shadow: 0 20px 40px rgba(27, 191, 137, 0.16);
}

.quick-progress-ring::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: inherit;
  background: #fff;
  box-shadow: inset 0 1px 5px rgba(27, 39, 63, 0.08);
}

.quick-progress-ring strong,
.quick-progress-ring span {
  position: relative;
  z-index: 1;
}

.quick-progress-ring strong {
  font-size: clamp(1.35rem, 2.4vw, 2.1rem);
  letter-spacing: -0.06em;
}

.quick-progress-ring span {
  display: block;
  margin-top: -18px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.quick-progress-track {
  grid-column: 1 / -1;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf5;
}

.quick-progress-track > i {
  display: block;
  width: calc(var(--value) * 1%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
  box-shadow: 0 10px 22px rgba(27, 191, 137, 0.24);
}

.quick-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  margin-top: 18px;
}

.quick-kpi-card {
  min-height: 136px;
}

.quick-kpi-card.accent-card {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--pink));
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.22);
}

.quick-kpi-card.accent-card small,
.quick-kpi-card.accent-card .mini-note {
  color: rgb(255 233 116);
}
strong.white {
    color: #FFF;
}

.quick-detail-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin: 24px 0 14px;
}

.quick-detail-title h3 {
  margin-top: 8px;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.quick-detail-title small {
  max-width: 260px;
  color: var(--muted);
  line-height: 1.45;
  text-align: right;
}

.quick-table-card {
  border-radius: 22px;
}

.quick-raiox-table {
  min-width: 1180px;
}

.quick-raiox-table th,
.quick-raiox-table td {
  padding: 12px 13px;
  font-size: 0.88rem;
}

.quick-raiox-table th:first-child,
.quick-raiox-table td:first-child {
  min-width: 260px;
}

.quick-raiox-table td:not(:first-child),
.quick-raiox-table th:not(:first-child) {
  text-align: center;
  white-space: nowrap;
}

.quick-raiox-table tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 2;
  border-top: 3px solid rgba(37, 99, 235, 0.28);
  border-bottom: 0;
  background: #f8fbff;
  font-weight: 900;
}

.quick-raiox-table .total-row td:first-child {
  color: var(--blue);
}

@media (max-width: 1120px) {
  .quick-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 720px) {
  .quick-progress-hero,
  .quick-kpi-grid {
    grid-template-columns: 1fr !important;
  }

  .quick-progress-ring {
    justify-self: center;
  }

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

  .quick-detail-title small {
    max-width: none;
    text-align: left;
  }
}

/* ===== Seções por espécie sem progress-circle ===== */
.species-panel::after {
  background: radial-gradient(circle, rgba(37, 99, 235, 0.10), transparent 65%);
}

.species-overview {
  display: grid;
  grid-template-columns: 1.12fr repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 22px;
}

.multas-overview {
  grid-template-columns: 1.12fr repeat(1, minmax(0, 1fr));
}

.overview-card {
  min-height: 132px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff, #fbfcff);
  box-shadow: 0 10px 26px rgba(27, 39, 63, 0.045);
  text-align: center;
}

.overview-card small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.overview-card strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.9rem, 3vw, 3.25rem);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.overview-card span {
  display: -webkit-box;
  margin-top: 10px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 720;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.overview-card.accent {
  color: #fff;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.26), transparent 32%),
    linear-gradient(135deg, var(--overview-accent, var(--blue)), var(--overview-accent-2, var(--pink)));
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.18);
}

.overview-card.accent.pink-accent {
  text-align: center;
  --overview-accent: var(--pink);
  --overview-accent-2: var(--blue);
}

.overview-card.accent small,
.overview-card.accent span {
  color: rgba(255, 255, 255, 0.86);
}

.section-content-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.48fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.featured-progress-list {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff, #fbfcff);
}

.section-table-card {
  margin-top: 0;
}

.section-kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
  margin: 0 0 22px;
}

.compact-kpi-card {
  min-height: 112px;
}

.compact-kpi-card strong {
  font-size: clamp(1.55rem, 2.2vw, 2.25rem);
}

@media (max-width: 1120px) {
  .species-overview,
  .multas-overview,
  .section-content-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .species-overview,
  .multas-overview,
  .section-content-grid {
    grid-template-columns: 1fr;
  }

  .overview-card {
    min-height: auto;
  }
}

/* ===== Exportação PDF Premium ===== */
.premium-pdf-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 190px;
  color: #fff;
  background:
    radial-gradient(circle at 18% 18%, rgba(255,255,255,0.22), transparent 32%),
    linear-gradient(135deg, var(--blue), var(--pink));
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.20);
  font-weight: 900;
}

.premium-pdf-button span {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 1.05rem;
}

.premium-pdf-report,
.pdf-cover {
  display: none;
}

/* ===== Tela branca de carregamento da exportação ===== */
.pdf-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: none;
  place-items: center;
  background: #ffffff;
  color: #172033;
}

body.pdf-loading-active {
  overflow: hidden;
}

body.pdf-loading-active .pdf-loading-overlay {
  display: grid;
}

.pdf-loading-box {
  display: grid;
  justify-items: center;
  gap: 14px;
  max-width: 420px;
  padding: 34px;
  text-align: center;
}

.pdf-loading-spinner {
  width: 56px;
  height: 56px;
  border: 5px solid #e8edf5;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: pdfSpin 0.85s linear infinite;
}

.pdf-loading-box strong {
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}

.pdf-loading-box small {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

@keyframes pdfSpin {
  to { transform: rotate(360deg); }
}

/* ===== Palco isolado para captura página a página ===== */
.pdf-render-stage {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 2147483000;
  width: 297mm;
  min-width: 297mm;
  height: 210mm;
  min-height: 210mm;
  overflow: visible;
  pointer-events: none;
  background: #ffffff;
}

body.pdf-loading-active .pdf-render-stage {
  display: block;
}

.pdf-render-stage,
.pdf-render-stage * {
  box-sizing: border-box;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

.pdf-render-stage .premium-pdf-report {
  display: block !important;
  width: 297mm !important;
  min-width: 297mm !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #ffffff !important;
  color: #172033 !important;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.pdf-render-stage .pdf-page {
  position: relative;
  display: flex !important;
  flex-direction: column;
  width: 297mm !important;
  min-width: 297mm !important;
  max-width: 297mm !important;
  height: 210mm !important;
  min-height: 210mm !important;
  max-height: 210mm !important;
  margin: 0 !important;
  padding: 11mm 12mm !important;
  overflow: hidden !important;
  background:
    radial-gradient(circle at 6% 4%, rgba(37, 99, 235, 0.08), transparent 42mm),
    radial-gradient(circle at 94% 2%, rgba(255, 83, 129, 0.10), transparent 38mm),
    linear-gradient(135deg, #ffffff, #f7faff 72%, #fff8fb) !important;
  box-shadow: none !important;
}

.pdf-render-stage .pdf-page::before {
  content: "";
  position: absolute;
  inset: 5mm;
  border: 1px solid #dbe4f2;
  border-radius: 8mm;
  pointer-events: none;
}

.pdf-render-stage .pdf-page > * {
  position: relative;
  z-index: 1;
}

.pdf-render-stage .pdf-cover-page {
  justify-content: space-between;
  padding: 14mm !important;
  background:
    radial-gradient(circle at 15% 18%, rgba(37, 99, 235, 0.20), transparent 48mm),
    radial-gradient(circle at 88% 10%, rgba(255, 83, 129, 0.20), transparent 46mm),
    linear-gradient(135deg, #ffffff, #f6f9ff 58%, #fff4f8) !important;
}

.pdf-render-stage .pdf-cover-top,
.pdf-render-stage .pdf-cover-footer,
.pdf-render-stage .pdf-report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8mm;
}

.pdf-render-stage .pdf-cover-top,
.pdf-render-stage .pdf-cover-footer {
  color: #627087;
  font-size: 9pt;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pdf-render-stage .pdf-cover-top strong {
  color: #172033;
}

.pdf-render-stage .pdf-cover-content {
  max-width: 184mm;
}

.pdf-render-stage .pdf-kicker,
.pdf-render-stage .pdf-report-header span {
  display: inline-flex;
  padding: 2.2mm 4mm;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #ff5381);
  font-size: 8pt;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pdf-render-stage .pdf-cover-content h1 {
  margin: 7mm 0 0;
  color: #141d30;
  font-size: 42pt;
  line-height: 0.88;
  letter-spacing: -0.07em;
}

.pdf-render-stage .pdf-cover-content p {
  max-width: 150mm;
  margin-top: 7mm;
  color: #5f6b80;
  font-size: 13pt;
  line-height: 1.42;
}

.pdf-render-stage .pdf-cover-metrics,
.pdf-render-stage .pdf-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4mm;
}

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

.pdf-render-stage .pdf-kpi-grid-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pdf-render-stage .pdf-kpi-grid-auto {
  grid-template-columns: repeat(auto-fit, minmax(34mm, 1fr));
}

.pdf-render-stage .pdf-overview-grid {
  display: grid;
  gap: 4mm;
  margin-bottom: 5mm;
}

.pdf-render-stage .pdf-overview-grid-two {
  grid-template-columns: 1.12fr minmax(0, 1fr);
}

.pdf-render-stage .pdf-overview-grid-three {
  grid-template-columns: 1.12fr repeat(2, minmax(0, 1fr));
}

.pdf-render-stage .pdf-metric-card,
.pdf-render-stage .pdf-kpi-card,
.pdf-render-stage .pdf-highlight-box,
.pdf-render-stage .pdf-progress-box {
  min-height: 28mm;
  padding: 5mm;
  border: 1px solid #dbe4f2;
  border-radius: 6mm;
  background: rgba(255, 255, 255, 0.86);
  break-inside: avoid;
  page-break-inside: avoid;
}

.pdf-render-stage .pdf-kpi-card.accent,
.pdf-render-stage .pdf-highlight-box {
  color: #ffffff;
  border-color: transparent;
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.25), transparent 35%),
    linear-gradient(135deg, #2563eb, #ff5381) !important;
}

.pdf-render-stage .pdf-metric-card small,
.pdf-render-stage .pdf-kpi-card small,
.pdf-render-stage .pdf-highlight-box small,
.pdf-render-stage .pdf-progress-box small,
.pdf-render-stage .pdf-progress-hero-report small {
  display: block;
  color: #6a7488;
  font-size: 7.2pt;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pdf-render-stage .pdf-kpi-card.accent small,
.pdf-render-stage .pdf-kpi-card.accent span,
.pdf-render-stage .pdf-highlight-box small,
.pdf-render-stage .pdf-highlight-box span {
  color: rgba(255, 255, 255, 0.84) !important;
}

.pdf-render-stage .pdf-metric-card strong,
.pdf-render-stage .pdf-kpi-card strong,
.pdf-render-stage .pdf-highlight-box strong,
.pdf-render-stage .pdf-progress-box strong,
.pdf-render-stage .pdf-progress-hero-report strong {
  display: block;
  margin-top: 2.4mm;
  color: inherit;
  font-size: 22pt;
  line-height: 0.95;
  letter-spacing: -0.065em;
}

.pdf-render-stage .pdf-metric-card span,
.pdf-render-stage .pdf-kpi-card span,
.pdf-render-stage .pdf-highlight-box span,
.pdf-render-stage .pdf-progress-box span,
.pdf-render-stage .pdf-progress-hero-report span {
  display: block;
  margin-top: 2.6mm;
  color: #6a7488;
  font-size: 8pt;
  line-height: 1.32;
  font-weight: 720;
}

.pdf-render-stage .pdf-cover-footer {
  padding-top: 4mm;
  border-top: 1px solid #dbe4f2;
  text-transform: none;
  letter-spacing: 0;
}

.pdf-render-stage .pdf-report-header {
  flex: 0 0 auto;
  margin-bottom: 6mm;
  padding-bottom: 4mm;
  border-bottom: 1px solid #dbe4f2;
  break-inside: avoid;
  page-break-inside: avoid;
}

.pdf-render-stage .pdf-report-header h1 {
  margin: 3mm 0 0;
  color: #172033;
  font-size: 24pt;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.pdf-render-stage .pdf-report-meta {
  text-align: right;
  color: #627087;
  font-size: 8pt;
  font-weight: 850;
}

.pdf-render-stage .pdf-report-meta strong,
.pdf-render-stage .pdf-report-meta small {
  display: block;
}

.pdf-render-stage .pdf-report-meta strong {
  color: #172033;
  font-size: 9.2pt;
}

.pdf-render-stage .pdf-two-column {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 4mm;
}

.pdf-render-stage .pdf-section-block {
  margin-top: 5mm;
}

.pdf-render-stage .pdf-section-block h2 {
  margin: 0 0 3mm;
  color: #172033;
  font-size: 13pt;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.pdf-render-stage .pdf-progress-box,
.pdf-render-stage .pdf-progress-hero-report {
  display: grid;
  grid-template-columns: 1fr;
  align-content: center;
  gap: 4mm;
}

.pdf-render-stage .pdf-progress-hero-report {
  min-height: 34mm;
  margin-bottom: 5mm;
  padding: 5mm;
  border: 1px solid rgba(27, 191, 137, 0.20);
  border-radius: 7mm;
  background: linear-gradient(135deg, #ffffff, #f3fffa) !important;
}

.pdf-render-stage .pdf-progress-bar {
  height: 3.2mm;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf5;
}

.pdf-render-stage .pdf-progress-bar i {
  display: block;
  width: calc(var(--value) * 1%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1bbf89, #2563eb);
}

.pdf-render-stage .pdf-table-continuation-note {
  margin: -2mm 0 3mm;
  padding: 2.2mm 3.2mm;
  border: 1px solid #dbe4f2;
  border-radius: 999px;
  color: #5f6b80;
  background: rgba(255, 255, 255, 0.78);
  font-size: 7.5pt;
  font-weight: 750;
}

.pdf-render-stage .pdf-report-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  overflow: hidden;
  border: 1px solid #dbe4f2;
  border-radius: 4mm;
  background: #ffffff;
}

.pdf-render-stage .pdf-report-table thead {
  display: table-header-group;
}

.pdf-render-stage .pdf-report-table th,
.pdf-render-stage .pdf-report-table td {
  padding: 2.2mm 2.4mm !important;
  border: 0;
  border-bottom: 1px solid #e7ecf5;
  color: #172033;
  font-size: 7.4pt !important;
  line-height: 1.2 !important;
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
  word-break: normal;
}

.pdf-render-stage .pdf-report-table th {
  position: static !important;
  color: #516075;
  background: #f2f6fc !important;
  font-size: 6.8pt !important;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pdf-render-stage .pdf-report-table td:not(:first-child),
.pdf-render-stage .pdf-report-table th:not(:first-child) {
  text-align: right;
}

.pdf-render-stage .pdf-report-table tbody tr:last-child td {
  border-bottom: 0;
}

.pdf-render-stage .pdf-raiox-report-table th,
.pdf-render-stage .pdf-raiox-report-table td {
  padding: 1.55mm 1.25mm !important;
  font-size: 5.9pt !important;
  line-height: 1.12 !important;
}

.pdf-render-stage .pdf-raiox-report-table th:first-child,
.pdf-render-stage .pdf-raiox-report-table td:first-child {
  width: 26% !important;
}

.pdf-render-stage .pdf-raiox-report-table thead th:not(:first-child),
.pdf-render-stage .pdf-raiox-report-table tbody td:not(:first-child),
.pdf-render-stage .pdf-raiox-report-table tfoot td:not(:first-child) {
  text-align: center;
}

.pdf-render-stage .pdf-raiox-report-table td,
.pdf-render-stage .pdf-raiox-report-table th {
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-render-stage .pdf-compact-table th,
.pdf-render-stage .pdf-compact-table td {
  font-size: 7.1pt !important;
}

.pdf-render-stage .pdf-table-page .pdf-report-table th,
.pdf-render-stage .pdf-table-page .pdf-report-table td {
  padding-top: 1.9mm !important;
  padding-bottom: 1.9mm !important;
}

.pdf-render-stage .pdf-table-page .pdf-compact-table th,
.pdf-render-stage .pdf-table-page .pdf-compact-table td {
  font-size: 6.9pt !important;
}

.pdf-render-stage .pdf-table-page .pdf-summary-remaining-table {
  height: auto !important;
  align-self: flex-start !important;
}

.pdf-render-stage .pdf-table-page .pdf-summary-remaining-table th,
.pdf-render-stage .pdf-table-page .pdf-summary-remaining-table td {
  height: auto !important;
  min-height: 0 !important;
  padding: 1.45mm 2mm !important;
  font-size: 6.7pt !important;
  line-height: 1.08 !important;
}

.pdf-render-stage .pdf-empty-note {
  padding: 6mm;
  border: 1px dashed #dbe4f2;
  border-radius: 5mm;
  color: #6a7488;
  background: #ffffff;
  font-size: 9pt;
  text-align: center;
}

/* ===== Bordas mais visíveis no PDF / Impressão ===== */

body.pdf-report-mode {
  --pdf-border: #aeb8c8;
  --pdf-border-strong: #8f9bad;
}

/* Cards do relatório PDF */
body.pdf-report-mode .pdf-kpi-card,
body.pdf-report-mode .pdf-metric-card,
body.pdf-report-mode .pdf-highlight-box,
body.pdf-report-mode .pdf-progress-box,
body.pdf-report-mode .pdf-progress-hero-report,
body.pdf-report-mode .pdf-section-block,
body.pdf-report-mode .pdf-cover-metrics .pdf-metric-card {
  border: 1px solid var(--pdf-border-strong) !important;
}

/* Linhas das tabelas no PDF */
body.pdf-report-mode .pdf-report-table,
body.pdf-report-mode .pdf-report-table th,
body.pdf-report-mode .pdf-report-table td {
  border-color: var(--pdf-border) !important;
}

/* Cabeçalho das tabelas um pouco mais marcado */
body.pdf-report-mode .pdf-report-table th {
  border-bottom: 1px solid var(--pdf-border-strong) !important;
}

/* Linhas horizontais, se houver */
body.pdf-report-mode hr,
body.pdf-report-mode .pdf-divider {
  border: 0 !important;
  border-top: 1px solid var(--pdf-border-strong) !important;
  background: transparent !important;
}

/* Caso algum card use sombra clara no lugar de borda */
body.pdf-report-mode .pdf-kpi-card,
body.pdf-report-mode .pdf-metric-card {
  box-shadow: none !important;
}

/* ===== Pendências em Espécie ===== */
.pending-species-panel::after {
  background: radial-gradient(circle, rgba(255, 83, 129, 0.12), transparent 65%);
}

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

.pending-status-grid {
  margin: 0 0 22px;
}

.pending-table-card .table-wrap {
  max-height: 620px;
}

.pending-species-table {
  min-width: 1480px;
}

.pending-species-table th,
.pending-species-table td {
  text-align: left !important;
  font-size: 0.82rem;
  line-height: 1.35;
}

.pending-species-table th:nth-child(1),
.pending-species-table td:nth-child(1),
.pending-species-table th:nth-child(2),
.pending-species-table td:nth-child(2),
.pending-species-table th:nth-child(5),
.pending-species-table td:nth-child(5),
.pending-species-table th:nth-child(6),
.pending-species-table td:nth-child(6),
.pending-species-table th:nth-child(9),
.pending-species-table td:nth-child(9) {
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 900;
  text-align: center;
}

.status-pill.status-pendente {
  color: #a85100;
  background: #fff7e6;
}

.status-pill.status-postergada {
  color: #b42318;
  background: #fff1f0;
}

.status-pill.status-programado {
  color: #1d4ed8;
  background: #eaf1ff;
}

.status-pill.status-default {
  color: var(--muted);
  background: #f4f6fb;
}

@media (max-width: 1120px) {
  .pending-overview {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .pending-overview {
    grid-template-columns: 1fr;
  }
}

/* ===== PDF: tabela larga de Pendências em Espécie ===== */
.pdf-render-stage .pdf-pending-page .pdf-overview-grid {
  margin-bottom: 4mm;
}

.pdf-render-stage .pdf-pending-page .pdf-section-block {
  margin-top: 3mm;
}

.pdf-render-stage .pdf-pending-report-table {
  table-layout: fixed !important;
}

.pdf-render-stage .pdf-pending-report-table th,
.pdf-render-stage .pdf-pending-report-table td {
  padding: 1.25mm 1mm !important;
  font-size: 4.85pt !important;
  line-height: 1.08 !important;
  text-align: left !important;
  vertical-align: top !important;
  overflow-wrap: anywhere;
  word-break: normal;
}

.pdf-render-stage .pdf-pending-report-table th {
  font-size: 4.55pt !important;
  letter-spacing: 0.02em !important;
}

.pdf-render-stage .pdf-table-page .pdf-pending-report-table th,
.pdf-render-stage .pdf-table-page .pdf-pending-report-table td {
  padding-top: 1.15mm !important;
  padding-bottom: 1.15mm !important;
  font-size: 4.75pt !important;
  line-height: 1.06 !important;
}

.pdf-render-stage .pdf-pending-report-table td:nth-child(1),
.pdf-render-stage .pdf-pending-report-table td:nth-child(2),
.pdf-render-stage .pdf-pending-report-table td:nth-child(5),
.pdf-render-stage .pdf-pending-report-table td:nth-child(6),
.pdf-render-stage .pdf-pending-report-table td:nth-child(9) {
  white-space: nowrap;
}

/* ===== Ações por tabela / Exportação individual ===== */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.table-toolbar > span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.table-export-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 999px;
  color: var(--blue);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(27, 39, 63, 0.06);
  cursor: pointer;
  transition: 0.2s ease;
}

.table-export-button:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 12px 22px rgba(37, 99, 235, 0.10);
}

.table-export-button img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.table-export-button strong {
  font-size: 0.82rem;
  font-weight: 900;
}

.quick-raiox-table th:first-child,
.quick-raiox-table td:first-child {
  min-width: 54px;
  text-align: center !important;
  white-space: nowrap;
}

.quick-raiox-table th:nth-child(2),
.quick-raiox-table td:nth-child(2) {
  min-width: 260px;
  text-align: left !important;
}

.quick-raiox-table td:not(:nth-child(2)),
.quick-raiox-table th:not(:nth-child(2)) {
  text-align: center;
  white-space: nowrap;
}

/* ===== Modal de seleção de seções para PDF ===== */
.pdf-selection-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.pdf-selection-modal.is-open {
  display: flex;
}

body.pdf-selection-active {
  overflow: hidden;
}

.pdf-selection-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 24, 40, 0.46);
  backdrop-filter: blur(10px);
}

.pdf-selection-panel {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: min(86vh, 780px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(231, 236, 245, 0.95);
  border-radius: 30px;
  background:
    radial-gradient(circle at 10% 0%, rgba(37, 99, 235, 0.10), transparent 34%),
    radial-gradient(circle at 92% 0%, rgba(255, 83, 129, 0.12), transparent 32%),
    #ffffff;
  box-shadow: 0 28px 80px rgba(16, 24, 40, 0.24);
}

.pdf-selection-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 24px 18px;
  border-bottom: 1px solid var(--line);
}

.pdf-selection-header h2 {
  margin-top: 10px;
  font-size: clamp(1.45rem, 3vw, 2.3rem);
  letter-spacing: -0.05em;
}

.pdf-selection-header p {
  max-width: 580px;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.pdf-modal-close {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #ffffff;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.pdf-selection-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
}

.pdf-selection-toolbar button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: #fff;
  font-weight: 850;
  cursor: pointer;
}

.pdf-selection-toolbar small {
  margin-left: auto;
  color: var(--muted);
  font-weight: 800;
}

.pdf-section-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 24px;
  overflow: auto;
}

.pdf-section-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 11px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  cursor: pointer;
  transition: 0.2s ease;
}

.pdf-section-option:hover {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: var(--shadow-soft);
}

.pdf-section-option input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--blue);
}

.pdf-section-option strong,
.pdf-section-option small {
  display: block;
}

.pdf-section-option strong {
  font-size: 0.95rem;
  line-height: 1.28;
}

.pdf-section-option small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.pdf-selection-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 18px 24px 24px;
  border-top: 1px solid var(--line);
}

.pdf-selection-footer .ghost-button {
  min-height: 50px;
}

.pdf-cancel-button {
  min-width: 132px;
}

.pdf-confirm-button {
  min-width: 170px;
}

@media (max-width: 720px) {
  .table-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .table-export-button {
    width: 100%;
  }

  .pdf-section-options {
    grid-template-columns: 1fr;
  }

  .pdf-selection-toolbar small {
    width: 100%;
    margin-left: 0;
  }

  .pdf-selection-footer {
    flex-direction: column-reverse;
  }
}

/* ===== Ajustes de colunas numeradas ===== */
.pdf-render-stage .pdf-numbered-table th:first-child,
.pdf-render-stage .pdf-numbered-table td:first-child {
  text-align: center !important;
  white-space: nowrap;
}

.pdf-render-stage .pdf-summary-remaining-table th:first-child,
.pdf-render-stage .pdf-summary-remaining-table td:first-child {
  width: 8% !important;
}

.pending-species-table {
  min-width: 1560px;
}

.pending-species-table th:nth-child(1),
.pending-species-table td:nth-child(1),
.pending-species-table th:nth-child(2),
.pending-species-table td:nth-child(2),
.pending-species-table th:nth-child(3),
.pending-species-table td:nth-child(3),
.pending-species-table th:nth-child(6),
.pending-species-table td:nth-child(6),
.pending-species-table th:nth-child(7),
.pending-species-table td:nth-child(7),
.pending-species-table th:nth-child(10),
.pending-species-table td:nth-child(10) {
  white-space: nowrap;
}

.pdf-render-stage .pdf-pending-report-table td:nth-child(1),
.pdf-render-stage .pdf-pending-report-table td:nth-child(2),
.pdf-render-stage .pdf-pending-report-table td:nth-child(3),
.pdf-render-stage .pdf-pending-report-table td:nth-child(6),
.pdf-render-stage .pdf-pending-report-table td:nth-child(7),
.pdf-render-stage .pdf-pending-report-table td:nth-child(10) {
  white-space: nowrap;
}

/* ===== Just in Time e Peformance ===== */
.just-in-time-panel::after {
  background: radial-gradient(circle, rgba(27, 191, 137, 0.12), transparent 65%);
}

.performance-panel::after {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.12), transparent 65%);
}

.just-in-time-overview {
  grid-template-columns: 1.15fr repeat(4, minmax(0, 1fr));
}

.just-in-time-overview .on-time-card strong {
  color: var(--green);
}

.just-in-time-overview .late-card strong {
  color: var(--red);
}

.just-in-time-delay-list {
  margin-bottom: 22px;
}

.just-in-time-table-card .table-wrap,
.performance-table-card .table-wrap {
  max-height: 620px;
}

.just-in-time-table {
  min-width: 1420px;
}

.just-in-time-table th,
.just-in-time-table td,
.performance-table th,
.performance-table td {
  text-align: left !important;
}

.just-in-time-table th:nth-child(1),
.just-in-time-table td:nth-child(1),
.just-in-time-table th:nth-child(2),
.just-in-time-table td:nth-child(2),
.just-in-time-table th:nth-child(5),
.just-in-time-table td:nth-child(5),
.just-in-time-table th:nth-child(6),
.just-in-time-table td:nth-child(6),
.just-in-time-table th:nth-child(7),
.just-in-time-table td:nth-child(7),
.just-in-time-table th:nth-child(8),
.just-in-time-table td:nth-child(8),
.just-in-time-table th:nth-child(9),
.just-in-time-table td:nth-child(9),
.just-in-time-table th:nth-child(10),
.just-in-time-table td:nth-child(10),
.performance-table th,
.performance-table td {
  white-space: nowrap;
}

.just-in-time-table th:nth-child(4),
.just-in-time-table td:nth-child(4) {
  min-width: 360px;
}

.deadline-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 900;
  text-align: center;
}

.deadline-pill.deadline-ok {
  color: #087f5b;
  background: #eafaf4;
}

.deadline-pill.deadline-late {
  color: #b42318;
  background: #fff1f0;
}

.deadline-pill.deadline-missing {
  color: #a85100;
  background: #fff7e6;
}

.deadline-pill.deadline-default {
  color: var(--muted);
  background: #f4f6fb;
}

.performance-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0 24px;
  align-items: stretch;
}

.performance-podium-card {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(180deg, #ffffff, #fbfcff);
  box-shadow: var(--shadow-soft);
}

.performance-podium-card::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  right: -64px;
  top: -64px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.18), transparent 68%);
  pointer-events: none;
}

.performance-podium-card.performance-rank-1 {
  color: #fff;
  border-color: transparent;
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.24), transparent 35%),
    linear-gradient(135deg, var(--blue), var(--pink));
  transform: translateY(-8px);
}

.performance-podium-card.performance-rank-1 small,
.performance-podium-card.performance-rank-1 span,
.performance-podium-card.performance-rank-1 em {
  color: rgba(255, 255, 255, 0.88);
}

.performance-podium-card .podium-medal {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 28px rgba(27, 39, 63, 0.10);
  font-size: 1.7rem;
}

.performance-podium-card small {
  display: block;
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.performance-podium-card strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.65rem, 3vw, 2.7rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.performance-podium-card span,
.performance-podium-card em {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-style: normal;
  font-weight: 780;
}

.performance-podium-card .bar {
  margin-top: 16px;
}

.performance-list-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.44fr);
  gap: 22px;
  align-items: start;
}

.performance-side-list {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff, #fbfcff);
}

.performance-side-list .badge {
  margin-bottom: 12px;
}

.performance-table {
  min-width: 760px;
}

.performance-table th:nth-child(3),
.performance-table td:nth-child(3),
.performance-table th:nth-child(4),
.performance-table td:nth-child(4) {
  text-align: right !important;
}

.performance-top-row {
  background: #fffaf2;
}

@media (max-width: 1120px) {
  .just-in-time-overview,
  .performance-podium,
  .performance-list-layout {
    grid-template-columns: 1fr 1fr;
  }

  .performance-podium-card.performance-rank-1 {
    transform: none;
  }
}

@media (max-width: 720px) {
  .just-in-time-overview,
  .performance-podium,
  .performance-list-layout {
    grid-template-columns: 1fr;
  }
}

/* ===== PDF: Just in Time e Peformance ===== */
.pdf-render-stage .pdf-overview-grid-five {
  grid-template-columns: 1.15fr repeat(4, minmax(0, 1fr));
}

.pdf-render-stage .pdf-just-in-time-page .pdf-overview-grid {
  margin-bottom: 4mm;
}

.pdf-render-stage .pdf-just-in-time-page .pdf-progress-hero-report {
  min-height: 28mm;
  margin-bottom: 4mm;
}

.pdf-render-stage .pdf-just-in-time-page .pdf-section-block {
  margin-top: 3mm;
}

.pdf-render-stage .pdf-just-in-time-table th,
.pdf-render-stage .pdf-just-in-time-table td {
  padding: 1.25mm 1mm !important;
  font-size: 5pt !important;
  line-height: 1.08 !important;
  text-align: left !important;
  vertical-align: top !important;
}

.pdf-render-stage .pdf-just-in-time-table th:first-child,
.pdf-render-stage .pdf-just-in-time-table td:first-child,
.pdf-render-stage .pdf-just-in-time-table th:nth-child(10),
.pdf-render-stage .pdf-just-in-time-table td:nth-child(10) {
  text-align: center !important;
}

.pdf-render-stage .pdf-just-in-time-table td:nth-child(2),
.pdf-render-stage .pdf-just-in-time-table td:nth-child(5),
.pdf-render-stage .pdf-just-in-time-table td:nth-child(6),
.pdf-render-stage .pdf-just-in-time-table td:nth-child(7),
.pdf-render-stage .pdf-just-in-time-table td:nth-child(8),
.pdf-render-stage .pdf-just-in-time-table td:nth-child(9),
.pdf-render-stage .pdf-just-in-time-table td:nth-child(10) {
  white-space: nowrap;
}

.pdf-render-stage .pdf-performance-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4mm;
  margin-bottom: 6mm;
}

.pdf-render-stage .pdf-performance-podium-card {
  min-height: 50mm;
  padding: 6mm;
  border: 1px solid #dbe4f2;
  border-radius: 7mm;
  background: rgba(255, 255, 255, 0.9);
}

.pdf-render-stage .pdf-performance-podium-card.pdf-rank-1 {
  color: #ffffff;
  border-color: transparent;
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.25), transparent 35%),
    linear-gradient(135deg, #2563eb, #ff5381) !important;
}

.pdf-render-stage .pdf-performance-podium-card small {
  display: block;
  color: #6a7488;
  font-size: 7.2pt;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pdf-render-stage .pdf-performance-podium-card.pdf-rank-1 small,
.pdf-render-stage .pdf-performance-podium-card.pdf-rank-1 span,
.pdf-render-stage .pdf-performance-podium-card.pdf-rank-1 em {
  color: rgba(255, 255, 255, 0.88) !important;
}

.pdf-render-stage .pdf-performance-podium-card strong {
  display: block;
  margin-top: 3mm;
  font-size: 24pt;
  line-height: 0.95;
  letter-spacing: -0.065em;
}

.pdf-render-stage .pdf-performance-podium-card span,
.pdf-render-stage .pdf-performance-podium-card em {
  display: block;
  margin-top: 3mm;
  color: #6a7488;
  font-size: 8pt;
  line-height: 1.32;
  font-style: normal;
  font-weight: 720;
}

.pdf-render-stage .pdf-performance-table th,
.pdf-render-stage .pdf-performance-table td {
  font-size: 7.2pt !important;
  line-height: 1.12 !important;
}

/* ===== Correção PDF: rodapé fixo e continuação compacta do Just in Time ===== */
.pdf-render-stage .pdf-page {
  padding-bottom: 15mm !important;
}

.pdf-render-stage .pdf-cover-page {
  padding-bottom: 16mm !important;
}

.pdf-render-stage .pdf-page-footer {
  position: absolute;
  left: 12mm;
  right: 12mm;
  bottom: 6.2mm;
  z-index: 2;
  padding-top: 1.8mm;
  border-top: 1px solid #dbe4f2;
  color: #627087;
  font-size: 7pt;
  font-weight: 850;
  line-height: 1;
  text-align: center;
  letter-spacing: 0.02em;
}

.pdf-render-stage .pdf-cell-content {
  display: block;
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.pdf-render-stage .pdf-cell-content.pdf-nowrap {
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pdf-render-stage .pdf-jit-service-cell {
  display: -webkit-box;
  max-height: 10.4pt;
  overflow: hidden;
  line-height: 1.04;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.pdf-render-stage .pdf-table-page.pdf-just-in-time-page .pdf-report-header {
  margin-bottom: 4mm;
  padding-bottom: 3mm;
}

.pdf-render-stage .pdf-table-page.pdf-just-in-time-page .pdf-table-continuation-note {
  margin: -1.5mm 0 2.2mm;
  padding: 1.6mm 2.8mm;
  font-size: 6.8pt;
  line-height: 1.05;
}

.pdf-render-stage .pdf-table-page.pdf-just-in-time-page .pdf-section-block {
  margin-top: 0;
}

.pdf-render-stage .pdf-table-page.pdf-just-in-time-page .pdf-just-in-time-table th,
.pdf-render-stage .pdf-table-page.pdf-just-in-time-page .pdf-just-in-time-table td {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 0.72mm 0.78mm !important;
  font-size: 4.35pt !important;
  line-height: 1.02 !important;
  vertical-align: top !important;
}

.pdf-render-stage .pdf-table-page.pdf-just-in-time-page .pdf-just-in-time-table th {
  font-size: 4.15pt !important;
  letter-spacing: 0.01em !important;
}

.pdf-render-stage .pdf-table-page.pdf-just-in-time-page .pdf-jit-service-cell {
  max-height: 9pt;
  line-height: 1.02;
}


/* ===== Fluxo unificado: OPE Executados + OPE Pendentes ===== */
.unified-actions {
  max-width: 760px;
}

.process-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 190px;
  color: #fff;
  background:
    radial-gradient(circle at 18% 18%, rgba(255,255,255,0.22), transparent 32%),
    linear-gradient(135deg, var(--green), var(--blue));
  box-shadow: 0 16px 34px rgba(27, 191, 137, 0.18);
  font-weight: 900;
}

.process-button span,
#downloadWorkbookButton span {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 1.05rem;
}

#downloadWorkbookButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 170px;
  font-weight: 900;
}

.team-selection-panel {
  display: grid;
  gap: 16px;
  margin: 18px 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
}

.team-selection-panel[hidden] {
  display: none !important;
}

.team-selection-panel h2 {
  margin-top: 10px;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  letter-spacing: -0.04em;
}

.team-selection-panel p {
  max-width: 860px;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.team-selection-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.team-selection-actions button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: #fff;
  font-weight: 850;
  cursor: pointer;
}

.team-selection-actions strong {
  color: var(--muted);
  font-size: 0.88rem;
}

.team-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.team-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
  cursor: pointer;
  transition: 0.2s ease;
}

.team-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.35);
}

.team-chip input {
  accent-color: var(--blue);
}

.team-chip:has(input:checked) {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--blue), var(--pink));
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.16);
}

.team-empty-note {
  width: 100%;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: #fff;
}

@media (max-width: 720px) {
  .unified-actions,
  .process-button,
  #downloadWorkbookButton {
    width: 100%;
  }
}

/* ===== Progresso por Localidade ===== */
.localidade-progress-panel::after {
  background: radial-gradient(circle, rgba(37, 99, 235, 0.12), transparent 65%);
}

.localidade-overview {
  grid-template-columns: 1.12fr repeat(4, minmax(0, 1fr));
}

.localidade-overview .critical-localidade-card strong {
  color: var(--pink);
}

.localidade-insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin: 20px 0 22px;
  align-items: start;
}

.localidade-progress-list-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff, #fbfcff);
  box-shadow: 0 10px 26px rgba(27, 39, 63, 0.045);
}

.localidade-progress-list-card .badge {
  margin-bottom: 12px;
}

.attention-list-card {
  background: linear-gradient(180deg, #fff, #fff8fb);
}

.localidade-table-card .table-wrap {
  max-height: 640px;
}

.localidade-progress-table {
  min-width: 1180px;
}

.localidade-progress-table th,
.localidade-progress-table td {
  text-align: left !important;
}

.localidade-progress-table th:nth-child(1),
.localidade-progress-table td:nth-child(1),
.localidade-progress-table th:nth-child(n+3),
.localidade-progress-table td:nth-child(n+3) {
  white-space: nowrap;
  text-align: center !important;
}

.localidade-progress-table th:nth-child(2),
.localidade-progress-table td:nth-child(2) {
  min-width: 260px;
}

.localidade-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 900;
  text-align: center;
}

.localidade-status-advanced {
  color: #087f5b;
  background: #eafaf4;
}

.localidade-status-progress {
  color: #175cd3;
  background: #eef4ff;
}

.localidade-status-attention {
  color: #a85100;
  background: #fff7e6;
}

.localidade-status-critical {
  color: #b42318;
  background: #fff1f0;
}

.localidade-status-default {
  color: var(--muted);
  background: #f4f6fb;
}

@media (max-width: 1120px) {
  .localidade-overview,
  .localidade-insight-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .localidade-overview,
  .localidade-insight-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== PDF: Progresso por Localidade ===== */
.pdf-render-stage .pdf-localidade-page .pdf-overview-grid {
  margin-bottom: 4mm;
}

.pdf-render-stage .pdf-localidade-page .pdf-progress-hero-report {
  min-height: 28mm;
  margin-bottom: 4mm;
}

.pdf-render-stage .pdf-localidade-page .pdf-section-block {
  margin-top: 3mm;
}

.pdf-render-stage .pdf-localidade-table th,
.pdf-render-stage .pdf-localidade-table td {
  padding: 1.35mm 1mm !important;
  font-size: 5.7pt !important;
  line-height: 1.1 !important;
  text-align: center !important;
  vertical-align: top !important;
}

.pdf-render-stage .pdf-localidade-table th:nth-child(2),
.pdf-render-stage .pdf-localidade-table td:nth-child(2) {
  text-align: left !important;
  width: 24%;
}

.pdf-render-stage .pdf-localidade-table td:not(:nth-child(2)) {
  white-space: nowrap;
}

