/* ==========================================================================
   FHR.Travel — Dashboard Operacional
   Paleta validada (dataviz skill): superfícies/status/rampa sequencial do
   dark mode. Ver comentário de cada bloco de cores para a origem do valor.
   ========================================================================== */

:root {
  /* Superfícies (skill: dark chart surface / page plane) */
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-alt: #222221;
  --surface-raised: #262625;
  --border: rgba(255, 255, 255, 0.10);
  --gridline: #2c2c2a;

  /* Tinta (skill: primary/secondary/muted ink) */
  --text: #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted: #898781;

  /* Acento (skill: categorical slot 1 dark / sequential step 400) */
  --accent: #3987e5;
  --accent-strong: #2a78d6;

  /* Rampa ordinal (funil) — skill: sequential steps 200/300/400/500/600, dark-safe */
  --funnel-1: #9ec5f4;
  --funnel-2: #6da7ec;
  --funnel-3: #3987e5;
  --funnel-4: #256abf;
  --funnel-5: #184f95;

  /* Status (skill: paleta fixa, nunca "temada") */
  --good: #0ca30c;
  --good-bg: rgba(12, 163, 12, 0.16);
  --warning: #fab219;
  --warning-bg: rgba(250, 178, 25, 0.16);
  --serious: #ec835a;
  --serious-bg: rgba(236, 131, 90, 0.16);
  --critical: #d03b3b;
  --critical-bg: rgba(208, 59, 59, 0.16);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 18px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.28);

  /* Produtos — Aéreo (azul) e Hotel (âmbar) */
  --product-air: #3987e5;
  --product-air-bg: rgba(57, 135, 229, 0.14);
  --product-hotel: #d4a82a;
  --product-hotel-bg: rgba(212, 168, 42, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--page);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------------------- */
/* Topbar                                                                  */
/* ---------------------------------------------------------------------- */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar__title h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.topbar__title-sep {
  color: var(--text-muted);
  font-weight: 400;
}

.topbar__subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
}

.topbar__controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.date-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
}

.chip {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-family: inherit;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.chip.chip--active {
  background: var(--accent);
  color: #ffffff;
}

.date-filter {
  background: transparent;
  border: none;
  color: var(--text);
  border-radius: 999px;
  padding: 6px 10px 6px 4px;
  font-size: 12.5px;
  font-family: inherit;
  color-scheme: dark;
}

.date-filter::-webkit-calendar-picker-indicator {
  filter: invert(0.8);
  cursor: pointer;
  opacity: 0.8;
}

.status-pill {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}

.status-pill--ok {
  background: var(--good-bg);
  color: var(--good);
}

.status-pill--error {
  background: var(--critical-bg);
  color: var(--critical);
}

.status-pill--unknown {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.status-pill--frozen {
  background: rgba(57, 135, 229, 0.16);
  color: var(--accent);
}

.status-pill--warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.topbar__user {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.btn-refresh:hover {
  opacity: 0.88;
}

.btn-refresh:active {
  transform: scale(0.97);
}

.btn-refresh__icon {
  display: inline-block;
  transition: transform 0.4s ease;
}

.btn-refresh.is-spinning .btn-refresh__icon {
  animation: spin 0.6s linear;
}

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

/* ---------------------------------------------------------------------- */
/* Layout geral                                                           */
/* ---------------------------------------------------------------------- */

.dashboard {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px 32px 40px;
  max-width: 1600px;
  margin: 0 auto;
}

.row-2col {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  align-items: stretch;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px 24px;
}

.panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

.panel__head h2 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.panel__subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.panel__subtitle-inline {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--text-muted);
  font-size: 12px;
}

.badge {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.badge--good { background: var(--good-bg); color: var(--good); }
.badge--warning { background: var(--warning-bg); color: var(--warning); }
.badge--risk { background: var(--serious-bg); color: var(--serious); }
.badge--critical { background: var(--critical-bg); color: var(--critical); }

/* ---------------------------------------------------------------------- */
/* KPI row (stat tiles)                                                    */
/* ---------------------------------------------------------------------- */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.kpi-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px 20px 16px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.kpi-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
}

.kpi-tile::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--text-muted);
  opacity: 0.5;
}

.kpi-tile[data-tone="success"]::before { background: var(--good); opacity: 0.9; }
.kpi-tile[data-tone="warning"]::before { background: var(--warning); opacity: 0.9; }
.kpi-tile[data-tone="critical"]::before { background: var(--critical); opacity: 0.9; }

.kpi-tile__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.kpi-tile__icon {
  font-size: 15px;
  line-height: 1;
}

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

.kpi-tile__value {
  font-size: 34px;
  font-weight: 700;
  font-variant-numeric: proportional-nums;
  line-height: 1.1;
  margin-bottom: 6px;
}

.kpi-tile__delta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
  min-height: 16px;
  margin-bottom: 10px;
}

.kpi-tile__delta .delta-arrow {
  font-size: 10px;
}

.kpi-tile__delta[data-direction="up"] { color: var(--good); }
.kpi-tile__delta[data-direction="down"] { color: var(--critical); }
.kpi-tile__delta[data-direction="flat"] { color: var(--text-muted); }

.kpi-tile__sparkline {
  width: 100%;
  height: 32px;
  display: block;
  margin-bottom: 12px;
}

.spark-area {
  fill: var(--accent);
  fill-opacity: 0.10;
  stroke: none;
}

.spark-line {
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.spark-dot {
  fill: var(--accent);
  stroke: var(--surface);
  stroke-width: 2;
}

.kpi-tile__foot {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 10px;
  border-top: 1px solid var(--gridline);
}

.kpi-tile__foot strong {
  color: var(--text-secondary);
  font-weight: 600;
}

/* ---------------------------------------------------------------------- */
/* Funil de conversão                                                      */
/* ---------------------------------------------------------------------- */

.funnel {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
}

.funnel-stage {
  flex: 1 1 0;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 4px 14px;
  position: relative;
}

.funnel-stage__bar {
  width: 100%;
  height: 10px;
  border-radius: 6px;
  margin: 10px 0 12px;
  position: relative;
  background: var(--gridline);
}

.funnel-stage__bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease;
}

.funnel-stage__label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.funnel-stage__value {
  font-size: 26px;
  font-weight: 700;
  margin-top: 4px;
  font-variant-numeric: proportional-nums;
}

.funnel-stage__arrow {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 6px;
  color: var(--text-muted);
  min-width: 56px;
}

.funnel-stage__arrow-glyph {
  font-size: 16px;
}

.funnel-stage__arrow-pct {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.funnel-stage__arrow-loss {
  font-size: 10.5px;
  color: var(--critical);
}

/* ---------------------------------------------------------------------- */
/* Top 10 City Pairs                                                       */
/* ---------------------------------------------------------------------- */

.city-pairs-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 24px;
}

.city-pair-row {
  display: grid;
  grid-template-columns: 22px 90px 1fr 44px;
  align-items: center;
  gap: 10px;
}

.city-pair-row__rank {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: right;
}

.city-pair-row__route {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.city-pair-row__track {
  height: 16px;
  background: var(--gridline);
  border-radius: 6px;
  overflow: hidden;
}

.city-pair-row__fill {
  height: 100%;
  min-width: 3px;
  background: var(--accent);
  border-radius: 6px 4px 4px 6px;
  transition: width 0.5s ease;
}

.city-pair-row__value {
  font-size: 13px;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: proportional-nums;
}

/* ---------------------------------------------------------------------- */
/* Fornecedores                                                            */
/* ---------------------------------------------------------------------- */

.providers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.provider-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.provider-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.provider-card__name {
  font-weight: 600;
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-card__meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.provider-card__meta strong {
  color: var(--text-secondary);
}

.meter-track {
  height: 6px;
  border-radius: 999px;
  background: var(--gridline);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* ---------------------------------------------------------------------- */
/* Business KPIs — regras de negócio configuráveis por fornecedor          */
/* ---------------------------------------------------------------------- */

.business-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.business-metric-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-left: 3px solid var(--text-muted);
}

.business-metric-card[data-tone="warning"] { border-left-color: var(--warning); }
.business-metric-card[data-tone="risk"] { border-left-color: var(--serious); }
.business-metric-card[data-tone="critical"] { border-left-color: var(--critical); }
.business-metric-card[data-tone="healthy"] { border-left-color: var(--good); }

.business-metric-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.business-metric-card__provider {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.business-metric-card__name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-top: 2px;
}

.business-metric-card__progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.business-metric-card__progress-row .meter-track {
  flex: 1;
  height: 10px;
}

.business-metric-card__progress-value {
  font-size: 15px;
  font-weight: 700;
  min-width: 48px;
  text-align: right;
  font-variant-numeric: proportional-nums;
}

.business-metric-card__stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
}

.business-metric-card__stats strong {
  color: var(--text);
  font-variant-numeric: proportional-nums;
}

.business-metric-card__message {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.business-metric-card__footer {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--text-muted);
  padding-top: 8px;
  border-top: 1px solid var(--gridline);
}

/* ---------------------------------------------------------------------- */
/* Saúde das Filas SQS — multi-fila                                        */
/* ---------------------------------------------------------------------- */

.queue-env-filter {
  display: flex;
  gap: 4px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
}

.queues-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.queue-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-muted);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s ease;
}

.queue-card--healthy    { border-left-color: var(--good); }
.queue-card--warning    { border-left-color: var(--warning); }
.queue-card--critical   { border-left-color: var(--critical); }
.queue-card--unavailable {
  border-left-color: var(--critical);
  opacity: 0.7;
}

.queue-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.queue-card__name {
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-card__tags {
  display: flex;
  gap: 6px;
}

.queue-card__tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--text-muted);
}

.queue-card__metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}

.queue-card__metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.queue-card__metric-label {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.queue-card__metric-value {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: proportional-nums;
  line-height: 1.2;
}

.queue-card__alerts {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.queue-card__alert {
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  background: var(--warning-bg);
  color: var(--warning);
}

.queue-card--critical .queue-card__alert,
.queue-card--unavailable .queue-card__alert {
  background: var(--critical-bg);
  color: var(--critical);
}

.queue-card__updated {
  font-size: 11px;
  color: var(--text-muted);
  padding-top: 6px;
  border-top: 1px solid var(--gridline);
}

/* ---------------------------------------------------------------------- */
/* Erros por etapa (barra horizontal)                                      */
/* ---------------------------------------------------------------------- */

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 90px 1fr 40px;
  align-items: center;
  gap: 10px;
}

.bar-row__label {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.bar-row__track {
  height: 20px;
  background: var(--gridline);
  border-radius: 6px;
  overflow: hidden;
}

.bar-row__fill {
  height: 100%;
  min-width: 3px;
  background: var(--critical);
  border-radius: 6px 4px 4px 6px;
  transition: width 0.5s ease;
}

.bar-row__value {
  font-size: 13px;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: proportional-nums;
}

/* ---------------------------------------------------------------------- */
/* Stat hero (erros de pesquisa)                                           */
/* ---------------------------------------------------------------------- */

.stat-hero {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  justify-content: center;
}

.stat-hero__value {
  font-size: 48px;
  font-weight: 700;
  font-variant-numeric: proportional-nums;
  color: var(--critical);
  line-height: 1;
}

.stat-hero__caption {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ---------------------------------------------------------------------- */
/* L2B                                                                      */
/* ---------------------------------------------------------------------- */

.l2b-body {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}

.l2b-value {
  font-size: 52px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.l2b-unit {
  font-size: 26px;
  color: var(--text-muted);
  font-weight: 600;
}

.l2b-breakdown {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-muted);
}

.l2b-breakdown strong {
  color: var(--text);
}

/* ---------------------------------------------------------------------- */
/* Timeline — últimas falhas                                               */
/* ---------------------------------------------------------------------- */

.timeline {
  display: flex;
  flex-direction: column;
  max-height: 340px;
  overflow-y: auto;
}

.timeline-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--gridline);
}

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

.timeline-item__icon {
  font-size: 15px;
  text-align: center;
}

.timeline-item__body {
  min-width: 0;
}

.timeline-item__message {
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-item__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 3px;
}

.timeline-item__tag {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-alt);
  font-weight: 600;
}

.timeline-item__priority {
  align-self: center;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
  height: fit-content;
}

.timeline-item__priority--alta { background: var(--critical-bg); color: var(--critical); }
.timeline-item__priority--media { background: var(--warning-bg); color: var(--warning); }
.timeline-item__priority--baixa { background: rgba(255, 255, 255, 0.06); color: var(--text-muted); }

.timeline-item--alta {
  background: linear-gradient(90deg, rgba(208, 59, 59, 0.08), transparent 60%);
}

/* ---------------------------------------------------------------------- */
/* Estados: skeleton, vazio, erro                                          */
/* ---------------------------------------------------------------------- */

.empty-state {
  color: var(--text-muted);
  font-size: 13px;
  padding: 8px 0;
}

.dashboard.is-loading .kpi-tile__value,
.dashboard.is-loading .funnel-stage__value,
.dashboard.is-loading .stat-hero__value,
.dashboard.is-loading .l2b-value {
  color: transparent !important;
  background: linear-gradient(90deg, var(--surface-alt) 25%, var(--surface-raised) 37%, var(--surface-alt) 63%);
  background-size: 400% 100%;
  animation: shimmer-bg 1.4s ease infinite;
  border-radius: 6px;
  display: inline-block;
  min-width: 64px;
}

@keyframes shimmer-bg {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

[title] {
  cursor: help;
}

/* ---------------------------------------------------------------------- */
/* Footer                                                                   */
/* ---------------------------------------------------------------------- */

.footer {
  text-align: center;
  padding: 18px;
  color: var(--text-muted);
  font-size: 11.5px;
}

/* ---------------------------------------------------------------------- */
/* Responsividade                                                          */
/* ---------------------------------------------------------------------- */

/* Notebook (~1280-1440px) */
@media (max-width: 1440px) {
  .kpi-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Tablet */
@media (max-width: 900px) {
  .topbar {
    padding: 16px 18px;
  }

  .dashboard {
    padding: 20px 18px 32px;
  }

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

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

  .funnel {
    flex-direction: column;
  }

  .funnel-stage__arrow {
    flex-direction: row;
    min-width: 0;
    padding: 4px 0;
  }

  .funnel-stage__arrow-glyph {
    transform: rotate(90deg);
  }

  .l2b-body {
    gap: 18px;
  }
}

@media (max-width: 560px) {
  .kpi-row {
    grid-template-columns: 1fr;
  }

  .bar-row {
    grid-template-columns: 74px 1fr 34px;
  }

  .city-pairs-list {
    grid-template-columns: 1fr;
  }

  .city-pair-row {
    grid-template-columns: 18px 74px 1fr 34px;
  }

  .topbar__controls {
    width: 100%;
    justify-content: space-between;
  }

  .product-nav__header {
    flex-direction: column;
    gap: 2px;
    padding: 12px 16px 10px;
  }

  .product-tabs {
    padding: 0 8px;
  }

  .product-tab {
    padding: 12px 14px;
    font-size: 13px;
  }
}

/* ========================================================================== */
/* Product Nav — container da barra de navegação por produto                  */
/* ========================================================================== */

.product-nav {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.product-nav__header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 24px 12px;
  border-bottom: 1px solid var(--gridline);
}

.product-nav__title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.product-nav__subtitle {
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.65;
}

/* ========================================================================== */
/* Product Tabs — barra de abas com indicador de linha inferior                */
/* ========================================================================== */

.product-tabs {
  display: flex;
  align-items: stretch;
  padding: 0 16px;
  /* linha base que as abas ativas sobrepõem com -1px */
  border-bottom: 1px solid var(--gridline);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.product-tabs::-webkit-scrollbar {
  display: none;
}

.product-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  /* borda lateral e topo zerados; bottom reserva a área do indicador */
  border: none;
  border-bottom: 2px solid transparent;
  /* sobe 1px para que a border-bottom ativa sobreponha a linha da nav */
  margin-bottom: -1px;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  padding: 14px 22px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
  outline: none;
}

.product-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.product-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
  border-radius: 4px;
}

.product-tab__icon {
  font-size: 15px;
  line-height: 1;
  transition: transform 0.18s ease;
}

.product-tab--active .product-tab__icon {
  transform: scale(1.15);
}

.product-tab__text {
  /* sem estilos adicionais — herda do .product-tab */
}

/* Estado ativo — indicador de linha + cor por produto */
.product-tab--active {
  font-weight: 700;
}

.product-tab--active[data-product="all"] {
  color: var(--text);
  border-bottom-color: var(--text-secondary);
}

.product-tab--active[data-product="air"] {
  color: var(--product-air);
  border-bottom-color: var(--product-air);
}

.product-tab--active[data-product="hotel"] {
  color: var(--product-hotel);
  border-bottom-color: var(--product-hotel);
}

/* ========================================================================== */
/* Product Panes                                                               */
/* ========================================================================== */

.product-pane {
  display: contents; /* herda o layout flex-col do .dashboard */
}

.product-pane[hidden] {
  display: none;
}

/* Animação de entrada ao trocar de aba */
@keyframes pane-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.product-pane--entering > * {
  animation: pane-fade-in 0.22s ease both;
}

/* ========================================================================== */
/* Pane Status Bar — loading / loaded / empty / error                         */
/* ========================================================================== */

.pane-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--text-muted);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  min-height: 40px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.pane-status:empty {
  display: none;
}

/* Loading */
.pane-status[data-state="loading"] {
  background: var(--surface-alt);
  border-color: var(--border);
  color: var(--text-muted);
}

/* Loaded */
.pane-status[data-state="loaded"] {
  background: var(--good-bg);
  border-color: rgba(12, 163, 12, 0.25);
  color: var(--good);
}

/* Empty */
.pane-status[data-state="empty"] {
  background: var(--surface-alt);
  border-color: var(--border);
  color: var(--text-muted);
}

/* Error */
.pane-status[data-state="error"] {
  background: var(--critical-bg);
  border-color: rgba(208, 59, 59, 0.3);
  color: var(--critical);
}

/* Dot indicator (loaded/empty/error) */
.pane-status__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pane-status__dot--ok    { background: var(--good); }
.pane-status__dot--empty { background: var(--text-muted); }
.pane-status__dot--error { background: var(--critical); }

/* Spinner (loading state) */
@keyframes pane-spin {
  to { transform: rotate(360deg); }
}

.pane-status__spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: var(--text-muted);
  border-radius: 50%;
  animation: pane-spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* Retry button inside error status */
.pane-status__retry {
  margin-left: 8px;
  background: transparent;
  border: 1px solid var(--critical);
  color: var(--critical);
  font-size: 11.5px;
  font-family: inherit;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  white-space: nowrap;
}

.pane-status__retry:hover {
  background: var(--critical-bg);
}

/* ========================================================================== */
/* Tab loading state — spinner inline no botão de aba                         */
/* ========================================================================== */

@keyframes tab-spin {
  to { transform: rotate(360deg); }
}

.product-tab--loading .product-tab__icon {
  display: inline-block;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: currentColor;
  border-radius: 50%;
  width: 14px;
  height: 14px;
  font-size: 0; /* oculta o emoji durante o spin */
  animation: tab-spin 0.6s linear infinite;
  transform: none; /* cancela o scale do estado ativo */
}

/* aria-disabled: visual muted para abas bloqueadas durante transição */
.product-tab[aria-disabled="true"] {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

/* ========================================================================== */
/* Product Header — barra de identidade do produto                            */
/* ========================================================================== */

.product-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.product-header--air  { background: var(--product-air-bg);   border-color: var(--product-air);   }
.product-header--hotel { background: var(--product-hotel-bg); border-color: var(--product-hotel); }

.product-label {
  font-size: 15px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.product-label--air   { background: var(--product-air);   color: #fff; }
.product-label--hotel { background: var(--product-hotel); color: #000; }

.product-header__desc {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ========================================================================== */
/* Product Badge — mini pill nos cards                                        */
/* ========================================================================== */

.product-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
  margin-left: auto;
}

.product-badge--air   { background: var(--product-air-bg);   color: var(--product-air);   }
.product-badge--hotel { background: var(--product-hotel-bg); color: var(--product-hotel); }

/* ========================================================================== */
/* KPI tile product accent — barra superior colorida por produto              */
/* ========================================================================== */

.kpi-tile--air::before   { background: var(--product-air);   opacity: 1; }
.kpi-tile--hotel::before { background: var(--product-hotel); opacity: 1; }

/* ========================================================================== */
/* Payment Breakdown                                                          */
/* ========================================================================== */

.panel--payment-breakdown {
  margin-top: 0; /* gap já vem do .dashboard */
}

.payment-breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pay-type-row {
  display: grid;
  grid-template-columns: 24px 1fr 1fr 56px 48px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.pay-type-row__icon {
  font-size: 14px;
  text-align: center;
}

.pay-type-row__label {
  font-weight: 500;
  color: var(--text-secondary);
}

.pay-type-row__track {
  height: 10px;
  background: var(--gridline);
  border-radius: 6px;
  overflow: hidden;
}

.pay-type-row__fill {
  height: 100%;
  min-width: 2px;
  background: var(--accent);
  border-radius: 6px;
  transition: width 0.4s ease;
}

.pay-type-row__value {
  font-weight: 700;
  text-align: right;
  font-variant-numeric: proportional-nums;
}

.pay-type-row__pct {
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
}

.text-muted {
  color: var(--text-muted);
  font-size: 11.5px;
}
