.pdf-export-btn {
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.pdf-export-btn.is-visible {
  display: inline-flex;
}

.pdf-export-btn:hover {
  background: var(--navy-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.pdf-export-btn:disabled {
  opacity: .6;
  cursor: wait;
  transform: none;
}

.pdf-export-btn svg {
  width: 14px;
  height: 14px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 900px) {
  .pdf-export-btn,
  .pdf-export-btn.is-visible {
    display: none !important;
  }
}

.pdf-export-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(13, 32, 80, .45);
  backdrop-filter: blur(6px);
  z-index: 1200;
}

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

.pdf-export-dialog {
  width: min(460px, 100%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(13, 32, 80, .22);
  padding: 28px;
}

.pdf-export-dialog h3 {
  color: var(--navy);
  font-size: 22px;
  line-height: 1.2;
  margin-bottom: 10px;
}

.pdf-export-dialog p {
  color: var(--text-body);
  font-size: 14px;
  line-height: 1.6;
}

.pdf-export-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.pdf-export-action {
  min-width: 96px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.pdf-export-action.secondary {
  background: #fff;
  color: var(--navy);
}

.pdf-export-action.secondary:hover {
  border-color: var(--navy);
}

.pdf-export-action.primary {
  background: var(--blue-cta);
  color: #fff;
  border-color: var(--blue-cta);
}

.pdf-export-action.primary:hover {
  background: var(--blue-cta-hov);
  border-color: var(--blue-cta-hov);
}

.pdf-export-progress {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(13, 32, 80, .5);
  backdrop-filter: blur(6px);
  z-index: 1250;
}

.pdf-export-progress.is-open {
  display: flex;
}

.pdf-export-progress-card {
  width: min(460px, 100%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(13, 32, 80, .22);
  padding: 28px;
}

.pdf-export-progress-card h3 {
  color: var(--navy);
  font-size: 22px;
  line-height: 1.2;
  margin-bottom: 10px;
}

.pdf-export-progress-card p {
  color: var(--text-body);
  font-size: 14px;
  line-height: 1.6;
}

.pdf-export-progress-bar {
  width: 100%;
  height: 10px;
  background: var(--bg-section);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 18px;
}

.pdf-export-progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--navy), var(--blue-cta));
  transition: width .24s ease;
}

.pdf-export-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-light);
  font-weight: 600;
}

.pdf-kpi-fit {
  white-space: nowrap;
  letter-spacing: 0;
}

.pdf-print-root {
  background: var(--bg-section);
  padding: 18px;
}

.pdf-print-root #dashboard-screen {
  display: block !important;
  max-width: none;
  padding: 0;
}

.pdf-print-root .toolbar,
.pdf-print-root .filter-bar,
.pdf-print-root .search-box,
.pdf-print-root .pag,
.pdf-print-root .pdf-export-btn {
  display: none !important;
}

.pdf-print-root .table-card {
  break-before: page;
}

.pdf-print-root .pdf-table-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  padding: 22px 24px;
  box-shadow: none;
}

.pdf-print-root .pdf-table-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.pdf-print-root .pdf-table-head h3 {
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.pdf-print-root .pdf-table-head span {
  color: var(--text-light);
  font-size: 11px;
  font-weight: 600;
}

.pdf-print-root .pdf-table-wrap {
  overflow: visible;
}

.pdf-print-root .pdf-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 11px;
}

.pdf-print-root .pdf-table col.data {
  width: 8%;
}

.pdf-print-root .pdf-table col.usuario {
  width: 16%;
}

.pdf-print-root .pdf-table col.estabelecimento {
  width: 28%;
}

.pdf-print-root .pdf-table col.classificacao {
  width: 20%;
}

.pdf-print-root .pdf-table col.operacao {
  width: 12%;
}

.pdf-print-root .pdf-table col.valor {
  width: 16%;
}

.pdf-print-root .pdf-table thead {
  display: table-header-group;
}

.pdf-print-root .pdf-table th,
.pdf-print-root .pdf-table td {
  border-bottom: 1px solid var(--border-light);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.pdf-print-root .pdf-table th {
  background: var(--bg-section);
  color: var(--navy);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.pdf-print-root .pdf-table td {
  color: var(--text-heading);
  word-break: break-word;
}

.pdf-print-root .pdf-table td:last-child,
.pdf-print-root .pdf-table th:last-child {
  text-align: right;
}

.pdf-print-root .pdf-table .badge {
  white-space: nowrap;
}

.pdf-print-root .insight-banner,
.pdf-print-root .kpi,
.pdf-print-root .eco-card,
.pdf-print-root .chart-card,
.pdf-print-root .score-card,
.pdf-print-root .table-card,
.pdf-print-root .pdf-table-card {
  break-inside: avoid;
  page-break-inside: avoid;
}

.pdf-print-root .chart-wrap,
.pdf-print-root .chart-wrap img {
  width: 100%;
}

.pdf-print-root .charts-grid {
  align-items: start;
}

.pdf-print-root .chart-card {
  overflow: hidden;
}

.pdf-print-root .chart-wrap img {
  height: auto;
  display: block;
}

.pdf-print-root .chart-wrap {
  position: static;
  height: auto !important;
  min-height: 0 !important;
  overflow: hidden;
}

.pdf-print-root #status-container {
  display: block !important;
}

.pdf-print-root #status-container .chart-wrap {
  flex: initial !important;
  height: auto !important;
  min-height: 0 !important;
}

.pdf-print-root .class-cta-card {
  overflow: hidden;
}

.pdf-print-root .class-benefits {
  min-height: 0;
}

.pdf-print-root .pdf-cta-active .class-benefits {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.pdf-print-root .pdf-cta-active .pdf-class-benefit {
  break-inside: avoid;
  page-break-inside: avoid;
}

.pdf-print-root .pdf-cta-active #cta-pag {
  display: none !important;
}

.pdf-print-root .pdf-cta-active .class-cta-btn {
  display: none !important;
}

.pdf-print-root .pdf-cta-active .charts-grid {
  break-inside: avoid;
  page-break-inside: avoid;
  align-items: start;
}

.pdf-print-root .pdf-cta-active .charts-grid.pdf-cta-grid {
  display: block !important;
}

.pdf-print-root .pdf-cta-active .charts-grid.pdf-cta-grid > .chart-card {
  width: 100% !important;
}

.pdf-print-root .pdf-compact-paper {
  width: 100%;
}

.pdf-print-root .pdf-cta-active #class-container,
.pdf-print-root .pdf-cta-active #status-container,
.pdf-print-root .pdf-cta-active #status-container .chart-wrap,
.pdf-print-root .pdf-cta-active #status-container .chart-wrap img {
  break-inside: avoid;
  page-break-inside: avoid;
}

.pdf-print-root .pdf-cta-active #status-container {
  max-width: 100%;
  display: block !important;
  align-self: start !important;
  height: auto !important;
}

.pdf-print-root .pdf-cta-active #status-container.pdf-status-compact {
  align-self: start;
}

.pdf-print-root .pdf-cta-active #status-container.pdf-status-compact .chart-wrap {
  max-height: 138mm !important;
  height: 138mm !important;
  min-height: 138mm !important;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto !important;
}

.pdf-print-root .pdf-cta-active #status-container .chart-wrap .pdf-status-image {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 128mm;
  object-fit: contain;
  margin: 0 auto;
  display: block;
}

@media print {
  .pdf-print-root .pdf-compact-paper #status-container {
    margin-top: 0 !important;
  }

  .pdf-print-root .pdf-compact-paper .charts-grid.pdf-cta-grid {
    display: block !important;
  }

  .pdf-print-root .pdf-compact-paper .charts-grid.pdf-cta-grid > .chart-card + .chart-card {
    margin-top: 4mm;
  }
}

@page {
  size: A4 landscape;
  margin: 10mm;
}

@media print {
  html,
  body {
    background: #fff !important;
  }

  body {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .pdf-print-root {
    padding: 0;
    background: #fff;
  }

  .pdf-print-root .insight-banner {
    margin-top: 0;
  }
}

/* Tipografia ToodoPay para modais e versao impressa do PDF */
.pdf-export-btn,
.pdf-export-dialog,
.pdf-export-progress-card,
.pdf-print-root {
  font-family: var(--font-sans, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif);
  letter-spacing: 0;
}

.pdf-export-dialog h3,
.pdf-export-progress-card h3 {
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.22;
  font-weight: 600;
  letter-spacing: 0;
}

.pdf-export-dialog p,
.pdf-export-progress-card p {
  font-size: 14px;
  line-height: 1.65;
  font-weight: 300;
}

.pdf-export-btn,
.pdf-export-action {
  font-weight: 600;
  letter-spacing: 0;
}

.pdf-print-root h1,
.pdf-print-root h2,
.pdf-print-root h3,
.pdf-print-root h4,
.pdf-print-root strong {
  font-weight: 600;
  letter-spacing: 0;
}

.pdf-print-root p,
.pdf-print-root small,
.pdf-print-root td,
.pdf-print-root span {
  font-weight: 300;
  line-height: 1.55;
}

.pdf-print-root .pdf-table-head h3,
.pdf-print-root .pdf-table th {
  font-weight: 600;
  letter-spacing: 0;
}
