/* ==========================================================================
   Start Química Frete Comercial - Identidade Visual Oficial (start.testes.eti.br)
   Tipografia: Montserrat + Bricolage Grotesque
   Paleta: Azul Real Start (#003ca6), Azul Meia-Noite (#002766), Amarelo Ouro (#f5c800)
   ========================================================================== */

:root {
  /* Marca Start Química */
  --start-blue: #003ca6;
  --start-dark: #002766;
  --start-blue-hover: #003087;
  --start-blue-soft: #edf4fc;
  --start-blue-line: #cde0f7;

  /* Amarelo Ouro Institucional */
  --start-gold: #f5c800;
  --start-gold-hover: #e0b400;
  --start-gold-soft: #fff9e6;
  --start-gold-text: #855f00;

  /* Neutros e Superfícies */
  --ink: #1e293b;
  --gray: #64748b;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --bg-page: #f8fafc;
  --surface: #ffffff;

  /* Semânticos (AA) */
  --ok: #10b981;
  --ok-bg: #ecfdf5;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --warn: #f59e0b;
  --warn-bg: #fffbeb;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --err: #ef4444;
  --err-bg: #fef2f2;

  /* Aliases do App Comercial */
  --primary: var(--start-blue);
  --primary-dark: var(--start-dark);
  --primary-light: #1a5ac4;
  --accent: var(--start-gold);
  --accent-light: #fde047;
  --border: var(--start-blue-line);
  --text-main: var(--ink);
  --text-muted: var(--gray);

  /* Elevação e Raios */
  --r: 11px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0, 39, 102, .06), 0 12px 28px -14px rgba(0, 39, 102, .22);
  --shadow-sm: 0 1px 3px rgba(0, 39, 102, .05);
  --shadow-md: 0 4px 14px rgba(0, 39, 102, .09);
  --shadow-lg: 0 12px 30px -6px rgba(0, 39, 102, .18);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  padding-bottom: 90px;
  min-height: 100vh;
}

h1, h2, h3, h4, .brand, .kpi strong, .result-main-value, .tn-brand .tag {
  font-family: "Bricolage Grotesque", "Montserrat", sans-serif;
}

a {
  color: var(--start-blue);
  text-decoration: none;
}

/* ==========================================================================
   Topbar & Navegação Desktop (Estilo Corporativo Start Química)
   ========================================================================== */
.topnav {
  background: linear-gradient(95deg, var(--start-dark), var(--start-blue));
  color: #dbeafe;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 10px rgba(0, 39, 102, 0.25);
}

.tn-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
}

.tn-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
  padding: 8px 0;
  flex: none;
}

.tn-brand .logo {
  height: 32px;
  width: auto;
  display: block;
  object-fit: contain;
}

.tn-brand .tag {
  font-family: "Bricolage Grotesque", "Montserrat", sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  letter-spacing: .01em;
  white-space: nowrap;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 18px;
}

.tn-bt {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #bfdbfe;
  font: 600 13px "Montserrat", sans-serif;
  padding: 16px 12px;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}

.tn-bt:hover {
  color: #ffffff;
}

.tn-bt.on {
  color: #ffffff;
  border-bottom-color: var(--start-gold);
}

.tn-dir {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.tn-user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f1f5f9;
  font-size: 12px;
}

.tn-user .av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--start-gold);
  color: var(--start-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  flex: none;
}

.tn-user .nm {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.tn-user .nm small {
  display: block;
  color: #93c5fd;
  font-size: 10.5px;
  font-weight: 400;
}

.tn-user a.sair {
  color: #93c5fd;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 6px;
  transition: color .14s, background .14s;
}

.tn-user a.sair:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.tn-user .svgi {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Status de Conexão Online/Offline */
.network-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
}

.network-badge.online {
  color: #86efac;
}

.network-badge.offline {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.35);
}

.network-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.network-badge.online .network-dot {
  background: var(--start-gold);
  box-shadow: 0 0 8px var(--start-gold);
}

.network-badge.offline .network-dot {
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}

/* ==========================================================================
   Layout Principal & Cards
   ========================================================================== */
.main-content {
  max-width: 880px;
  margin: 0 auto;
  padding: 22px 16px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
  margin-bottom: 20px;
}

.card-header-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--start-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Formulário de Cotação */
.form-group {
  margin-bottom: 16px;
  position: relative;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.form-label-hint {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: normal;
  margin-left: 4px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix {
  position: absolute;
  left: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray);
  pointer-events: none;
}

.input-suffix {
  position: absolute;
  right: 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray);
  pointer-events: none;
}

.form-input {
  width: 100%;
  height: 50px;
  padding: 12px 14px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  background: #ffffff;
  border: 1.5px solid var(--start-blue-line);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  outline: none;
}

.form-input:focus {
  border-color: var(--start-blue);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 60, 166, 0.15);
}

.form-input.has-prefix {
  padding-left: 42px;
}

.form-input.has-suffix {
  padding-right: 48px;
}

/* Autocomplete de Cidades */
.autocomplete-container {
  position: relative;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--start-blue-line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 260px;
  overflow-y: auto;
  z-index: 100;
  margin-top: 4px;
  display: none;
}

.autocomplete-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.15s ease;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover, .autocomplete-item.active {
  background: var(--start-blue-soft);
}

.autocomplete-city-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--start-blue);
}

.autocomplete-city-details {
  font-size: 0.78rem;
  color: var(--muted);
}

.badge-leadtime {
  background: var(--start-blue-soft);
  color: var(--start-blue);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

/* ==========================================================================
   Card de Resultado de Frete (Hero Card Start Química)
   ========================================================================== */
.result-hero-card {
  background: linear-gradient(135deg, var(--start-dark) 0%, var(--start-blue) 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}

.result-hero-card::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -30px;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(245, 200, 0, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.result-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 200, 0, 0.2);
  border: 1px solid rgba(245, 200, 0, 0.5);
  color: #fde047;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.result-main-value {
  font-size: 2.7rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
  margin-bottom: 4px;
}

.result-tax-note {
  font-size: 0.8rem;
  color: #bfdbfe;
  margin-bottom: 16px;
}

.result-rule-box {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.82rem;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Grid Comparativo de Regras */
.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.comp-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
  position: relative;
  transition: all 0.2s ease;
}

.comp-card.is-winner {
  border-color: var(--start-blue);
  background: var(--start-blue-soft);
}

.comp-winner-badge {
  position: absolute;
  top: -8px;
  right: 8px;
  background: var(--start-blue);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.comp-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}

.comp-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--start-dark);
}

.comp-sub {
  font-size: 0.7rem;
  color: var(--gray);
  margin-top: 2px;
}

/* ==========================================================================
   Botões de Ação
   ========================================================================== */
.btn-whatsapp {
  width: 100%;
  height: 50px;
  background: #10b981;
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: all 0.2s ease;
  text-decoration: none;
  margin-top: 12px;
}

.btn-whatsapp:hover {
  background: #059669;
}

.btn-whatsapp:active {
  transform: scale(0.98);
}

.actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.btn-secondary {
  height: 44px;
  background: #ffffff;
  border: 1.5px solid var(--start-blue-line);
  color: var(--start-blue);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--start-blue-soft);
  border-color: var(--start-blue);
}

/* ==========================================================================
   Barra de Navegação Inferior (Mobile Tabs)
   ========================================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 66px;
  background: #ffffff;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 40;
  box-shadow: 0 -2px 12px rgba(0, 39, 102, 0.08);
}

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  gap: 3px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-tab svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}

.nav-tab.active {
  color: var(--start-blue);
}

.nav-tab.active svg {
  stroke: var(--start-blue);
}

/* Accordion de Viabilidade / Margem do Operador */
.accordion-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--start-dark);
}

.accordion-content {
  display: none;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.accordion-content.open {
  display: block;
}

.operator-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.82rem;
  border-bottom: 1px dashed var(--line);
}

.operator-metric-row:last-child {
  border-bottom: none;
}

.operator-metric-label {
  color: var(--muted);
}

.operator-metric-value {
  font-weight: 700;
  color: var(--ink);
}

/* Toast Notificações */
.toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  pointer-events: none;
}

.toast {
  background: rgba(0, 39, 102, 0.95);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateY(10px);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Banner de Instalação PWA */
.pwa-banner {
  background: linear-gradient(90deg, var(--start-dark), var(--start-blue));
  color: #ffffff;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  display: none;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.pwa-banner-text {
  font-size: 0.82rem;
  font-weight: 500;
}

.pwa-banner-btn {
  background: var(--start-gold);
  color: var(--start-dark);
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

/* ==========================================================================
   Tabelas e KPIs
   ========================================================================== */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

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

th {
  background: var(--start-blue-soft);
  color: var(--start-blue);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .02em;
  font-weight: 700;
}

td.num, th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

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

tr:hover td {
  background: #f8fafc;
}

.badge {
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  display: inline-block;
}

.badge-info {
  background: var(--start-blue-soft);
  color: var(--start-blue);
}

.badge-success {
  background: var(--ok-bg);
  color: var(--ok);
}

.badge-warning {
  background: var(--warn-bg);
  color: var(--warn);
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.kpi span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
  font-weight: 600;
}

.kpi strong {
  display: block;
  font-size: 24px;
  margin-top: 6px;
  color: var(--start-dark);
}

.kpi.accent {
  border-left: 4px solid var(--start-gold);
}

/* Responsividade Desktop */
@media (min-width: 860px) {
  body {
    padding-bottom: 30px;
  }

  .main-content {
    max-width: 1040px;
    padding: 24px;
  }

  .bottom-nav {
    display: none;
  }

  .desktop-nav {
    display: flex;
  }

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

  .calc-destino-grid {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 14px;
    align-items: flex-start;
  }

  .calc-form-grid .full-col {
    grid-column: span 2;
  }
}

@media (max-width: 859px) {
  .desktop-nav {
    display: none;
  }

  .calc-destino-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* ==========================================================================
   Relação Frete vs Carga (Ratio Badge & Card)
   ========================================================================== */
.result-ratio-card {
  background: rgba(245, 200, 0, 0.16);
  border: 1px solid rgba(245, 200, 0, 0.45);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  backdrop-filter: blur(4px);
}

.result-ratio-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #fde047;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.result-ratio-content {
  font-size: 0.88rem;
  color: #ffffff;
  line-height: 1.35;
}

.result-ratio-badge {
  display: inline-block;
  background: var(--start-gold);
  color: var(--start-dark);
  font-weight: 800;
  padding: 1px 8px;
  border-radius: 6px;
  font-size: 0.92rem;
  margin: 0 3px;
}

/* Botão de PDF e Grid de Ações Principais */
.actions-primary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.btn-pdf {
  height: 50px;
  background: var(--start-blue);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-md);
  font-size: 0.98rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 60, 166, 0.3);
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-pdf:hover {
  background: var(--start-blue-hover);
  box-shadow: 0 6px 18px rgba(0, 60, 166, 0.45);
}

.btn-pdf:active {
  transform: scale(0.98);
}

/* ==========================================================================
   Modal de Cotação em PDF & Layout A4 Start Química
   ========================================================================== */
.pdf-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 39, 102, 0.65);
  backdrop-filter: blur(5px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}

.pdf-modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 45px rgba(0, 39, 102, 0.35);
  width: 100%;
  max-width: 820px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.pdf-modal-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  flex: none;
}

.pdf-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pdf-modal-body {
  padding: 20px;
  overflow-y: auto;
  background: #e2e8f0;
  display: flex;
  justify-content: center;
}

/* Folha A4 Corporativa Start Química */
.pdf-document-sheet {
  background: #ffffff;
  width: 100%;
  max-width: 720px;
  padding: 32px 36px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  font-family: "Montserrat", sans-serif;
  color: #1e293b;
  box-sizing: border-box;
}

.pdf-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.pdf-sheet-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pdf-sheet-logo {
  height: 52px;
  width: auto;
  object-fit: contain;
}

.pdf-sheet-brand-name {
  font-family: "Bricolage Grotesque", "Montserrat", sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--start-blue);
  line-height: 1.1;
}

.pdf-sheet-brand-desc {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--start-dark);
}

.pdf-sheet-brand-meta {
  font-size: 0.68rem;
  color: var(--muted);
}

.pdf-sheet-doc-meta {
  text-align: right;
  font-size: 0.72rem;
  color: var(--muted);
}

.pdf-doc-badge {
  display: inline-block;
  background: var(--start-blue);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.pdf-meta-line {
  line-height: 1.4;
}

.pdf-divider-gold {
  height: 3px;
  background: linear-gradient(90deg, var(--start-gold) 0%, var(--start-blue) 100%);
  margin: 12px 0 16px 0;
  border-radius: 2px;
}

.pdf-section-header {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--start-blue);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1.5px solid var(--start-blue-line);
  padding-bottom: 4px;
  margin-bottom: 10px;
}

.pdf-grid-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pdf-info-box {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
}

.pdf-info-label {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 2px;
}

.pdf-info-val {
  display: block;
  font-size: 0.9rem;
  color: var(--start-dark);
}

.pdf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-top: 4px;
}

.pdf-table th {
  background: #f1f5f9;
  color: var(--start-dark);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.68rem;
  padding: 8px 10px;
  border-bottom: 1.5px solid var(--start-blue-line);
}

.pdf-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  color: #334155;
}

.pdf-table-sub {
  font-size: 0.68rem;
  color: var(--muted);
}

.pdf-table-total-row td {
  background: var(--start-blue-soft);
  border-top: 2px solid var(--start-blue);
  border-bottom: none;
  padding: 10px;
}

.pdf-tag-included {
  background: #ecfdf5;
  color: #059669;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #a7f3d0;
}

.pdf-total-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--start-blue);
}

/* Relação Frete vs Mercadoria */
.pdf-ratio-container {
  margin-top: 14px;
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  border-radius: 8px;
  padding: 10px 14px;
}

.pdf-ratio-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #92400e;
  margin-bottom: 3px;
}

.pdf-ratio-desc {
  font-size: 0.82rem;
  color: #78350f;
  line-height: 1.35;
}

.pdf-ratio-badge {
  background: var(--start-gold);
  color: var(--start-dark);
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 0.85rem;
}

/* Termos e Condições */
.pdf-conditions-box {
  margin-top: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 14px;
}

.pdf-conditions-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--start-dark);
  margin-bottom: 4px;
}

.pdf-conditions-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.66rem;
  color: #64748b;
  line-height: 1.45;
}

.pdf-sheet-footer {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.68rem;
  color: var(--muted);
}

.pdf-sheet-footer-line {
  font-weight: 600;
  line-height: 1.35;
}

.pdf-sheet-footer-hash {
  margin-top: 4px;
  font-size: 0.6rem;
  color: #94a3b8;
}

/* Regras de Impressão Direta */
@media print {
  body * {
    visibility: hidden;
  }
  #pdf-modal, #pdf-modal * {
    visibility: visible;
  }
  #pdf-modal {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    background: #ffffff !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: 99999 !important;
  }
  .pdf-modal-header, .no-print, .topnav, .bottom-nav, .toast-container {
    display: none !important;
  }
  .pdf-modal-dialog {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
  }
  .pdf-modal-body {
    padding: 0 !important;
    background: #ffffff !important;
    max-height: none !important;
    overflow: visible !important;
  }
  .pdf-document-sheet {
    box-shadow: none !important;
    border: none !important;
    padding: 10mm 15mm !important;
    max-width: 100% !important;
    width: 100% !important;
  }
}

