/* Monitor — The Traveler Club
 * Identidade visual oficial TTC: preto couro, ouro, prata.
 * Bricolage Grotesque (display) + Inter (corpo).
 * "Precisos. Discretos. Diretos. Confiantes. Consultivos."
 */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,600;12..96,700;12..96,800&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Estrutura — Preto Couro */
  --bg: #0F0F0F;            /* fundo principal (mais escuro que surface) */
  --surface: #1A1A1A;       /* preto couro oficial TTC */
  --surface-elev: #232323;  /* card elevado */
  --border: #2A2A2A;
  --border-strong: #3A3A3A;

  /* Voz — Prata */
  --text: #E8E8E8;          /* prata clara, texto principal */
  --text-muted: #A0A0A0;
  --text-subtle: #6A6A6A;

  /* Acento — Ouro */
  --accent: #C5973A;            /* ouro oficial TTC */
  --accent-soft: rgba(197, 151, 58, 0.10);
  --accent-glow: rgba(197, 151, 58, 0.28);

  /* Status — mantidos por contraste, ajustados pra fundo escuro */
  --success: #10b981;
  --success-soft: rgba(16, 185, 129, 0.12);
  --warning: #C5973A;          /* warning = ouro (idem accent) */
  --warning-soft: rgba(197, 151, 58, 0.10);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, 0.12);

  --radius: 12px;
  --radius-sm: 6px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.5), 0 1px 2px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 28px -4px rgba(0, 0, 0, 0.6), 0 4px 12px -4px rgba(0, 0, 0, 0.5);

  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Bricolage Grotesque', var(--font-sans);
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Top bar ===== */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(8px);
}

.topbar-brand {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
}

/* Logo TTC — monogram tipográfico em vez de gradient */
.topbar-brand .logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--surface-elev);
  border: 1px solid var(--accent);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
}
.topbar-brand .logo-mark::before {
  content: "TTC";
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent) 30%, #E8E8E8 30.01%, #E8E8E8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  letter-spacing: 0.04em;
}

.nav {
  display: flex;
  gap: 4px;
  align-items: center;
}

.nav-item {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.nav-meta {
  font-size: 12px;
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

/* ===== Layout ===== */
.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.page-header {
  margin-bottom: 24px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
  color: var(--text);
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
}

/* ===== Stats ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}

.stat::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(197, 151, 58, 0.06) 100%);
  pointer-events: none;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  margin: 0 0 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.stat-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
}
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* ===== Card / sections ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.card-body {
  padding: 0;
}

/* ===== Filters ===== */
.filters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.input, .select {
  font-family: inherit;
  font-size: 13px;
  padding: 7px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  min-width: 120px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}

.btn:hover {
  background: var(--bg);
  border-color: var(--text-muted);
}

.btn.btn-primary {
  background: var(--accent);
  color: #1A1A1A;
  border-color: var(--accent);
  font-weight: 600;
}

.btn.btn-primary:hover {
  background: #d4a648;
  border-color: #d4a648;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { color: var(--text); background: var(--bg); }

/* ===== Tables ===== */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:hover {
  background: var(--bg);
}

tbody tr:last-child td {
  border-bottom: none;
}

td.num, th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

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

/* ===== Badge ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.badge.badge-cash { background: var(--info-soft); color: #1d4ed8; }
.badge.badge-award { background: #fef3c7; color: #92400e; }
.badge.badge-success { background: var(--success-soft); color: #065f46; }
.badge.badge-warning { background: var(--warning-soft); color: #92400e; }
.badge.badge-danger { background: var(--danger-soft); color: #991b1b; }
.badge.badge-muted { background: var(--bg); color: var(--text-muted); }
.badge.badge-tier1 { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; }
.badge.badge-tier2 { background: var(--bg); color: var(--text-muted); }

/* ===== Empty states ===== */
.empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
  font-size: 14px;
}

.empty-title {
  font-size: 16px;
  color: var(--text);
  font-weight: 600;
  margin: 0 0 4px;
}

/* ===== Loading ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg) 0%, #f1f5f9 50%, var(--bg) 100%);
  background-size: 200% 100%;
  animation: skel 1.4s ease infinite;
  border-radius: var(--radius-sm);
  height: 12px;
  margin: 6px 0;
}

@keyframes skel {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== Helpers ===== */
.flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.items-center { align-items: center; }
.text-muted { color: var(--text-muted); }
.text-subtle { color: var(--text-subtle); }
.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }
.font-mono { font-family: var(--font-mono); }
.tabular { font-variant-numeric: tabular-nums; }

/* ===== Responsive ===== */
@media (max-width: 720px) {
  .topbar { padding: 0 16px; }
  .container { padding: 20px 16px 48px; }
  .page-title { font-size: 22px; }
  .nav-item { padding: 6px 10px; font-size: 13px; }
  .nav-meta { display: none; }
}

/* ============================================================================
 * Search-style layout (inspirado em seats.aero)
 * Sticky search bar, filter chips, dense table, fare pills
 * ============================================================================ */

.search-shell {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 60px;
  z-index: 40;
  box-shadow: var(--shadow-sm);
}

.search-bar {
  max-width: 1320px;
  margin: 0 auto;
  padding: 18px 24px 14px;
  display: grid;
  grid-template-columns: 1fr 40px 1fr 200px 200px auto;
  gap: 12px;
  align-items: end;
}

.search-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.search-field label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  font-weight: 600;
}

.search-field .input,
.search-field .select {
  height: 38px;
  font-size: 14px;
  padding: 8px 12px;
}

.swap-btn {
  height: 38px;
  width: 40px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 16px;
  transition: all 0.15s;
}
.swap-btn:hover { color: var(--accent); border-color: var(--accent); }

.btn-search {
  height: 38px;
  padding: 0 24px;
  font-weight: 600;
  border: 0;
  background: var(--info);
  color: white;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}
.btn-search:hover { background: #2563eb; }

/* ===== Live progress bar ===== */
.live-bar {
  max-width: 1320px;
  margin: 0 auto;
  padding: 10px 24px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.live-pill {
  background: var(--info);
  color: white;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.4);
}
.live-pill .bolt { font-size: 13px; }

.progress-track {
  flex: 1;
  height: 6px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
  border-radius: 999px;
  transition: width 0.4s ease;
}
.progress-meta {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 80px;
  text-align: right;
}

/* ===== Filter chips row ===== */
.filter-chips {
  max-width: 1320px;
  margin: 0 auto;
  padding: 12px 24px 16px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.chip .caret { font-size: 9px; color: var(--text-subtle); }

.chip-spacer { flex: 1; }

.btn-alert {
  border: 1px solid var(--accent);
  color: var(--accent);
  background: var(--surface);
  padding: 6px 14px;
  font-weight: 600;
  font-size: 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-alert:hover { background: var(--accent-soft); }

/* ===== Search results table (cabine columns) ===== */
.results-bar {
  max-width: 1320px;
  margin: 0 auto;
  padding: 16px 24px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.results-bar .left {
  display: flex; align-items: center; gap: 16px;
  font-size: 13px; color: var(--text-muted);
}

.results-table {
  max-width: 1320px;
  margin: 0 auto 32px;
  padding: 0 24px;
}

.results-table table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 13.5px;
}

.results-table thead th {
  background: var(--bg);
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  font-weight: 600;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.results-table tbody td {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.results-table tbody tr:hover { background: var(--accent-soft); }

/* Cabin cells side-by-side */
.cabin-cell {
  text-align: center;
  min-width: 110px;
}

.fare-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.fare-pill.cash {
  background: var(--info);
  color: white;
  box-shadow: 0 1px 4px rgba(59, 130, 246, 0.3);
}
.fare-pill.award {
  background: var(--accent);
  color: white;
  box-shadow: 0 1px 4px rgba(249, 115, 22, 0.3);
}
.fare-pill.na {
  background: var(--bg);
  color: var(--text-subtle);
  border: 1px dashed var(--border-strong);
  font-weight: 500;
}

.flight-numbers {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.flight-numbers .fn {
  background: var(--bg);
  padding: 1px 7px;
  border-radius: 4px;
  font-weight: 600;
  color: var(--text);
}

.carrier-cell { display: flex; align-items: center; gap: 8px; }
.carrier-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #e0b04d);
  color: #1A1A1A;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.airport-link {
  font-weight: 600;
  color: var(--info);
}

.duration-cell { font-variant-numeric: tabular-nums; color: var(--text); }

.time-cell { font-variant-numeric: tabular-nums; }
.time-cell .date { font-size: 11px; color: var(--text-muted); display: block; margin-top: 2px; }

/* Stops badge */
.stops-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg);
  color: var(--text-muted);
  margin-left: 8px;
}
.stops-pill.direct {
  background: var(--success-soft);
  color: var(--success);
}

@media (max-width: 1024px) {
  .search-bar {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .search-bar .swap-btn { display: none; }
  .btn-search { grid-column: span 2; height: 42px; }
}

@media (max-width: 720px) {
  .search-shell { top: 56px; }
  .live-bar { padding: 8px 16px; }
  .filter-chips { padding: 10px 16px; }
  .results-bar, .results-table { padding-left: 16px; padding-right: 16px; }
}

/* ============================================================================
 * Filter chip popovers
 * ============================================================================ */
.chip-wrap { position: relative; display: inline-block; }

.chip-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 240px;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 10px;
  z-index: 60;
  display: none;
}
.chip-popover.open { display: block; }

.chip-popover-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--text-subtle);
  padding: 4px 8px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.popover-options {
  max-height: 280px;
  overflow-y: auto;
}

.popover-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  user-select: none;
}
.popover-option:hover { background: var(--bg); }
.popover-option input { margin: 0; cursor: pointer; }
.popover-option .opt-meta { margin-left: auto; color: var(--text-subtle); font-size: 11px; }

.popover-actions {
  display: flex;
  gap: 6px;
  padding: 8px 4px 4px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
}
.popover-actions .btn { flex: 1; padding: 6px 10px; font-size: 12px; }

.chip-count {
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 4px;
}

.range-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
}
.range-input input[type=number] { width: 60px; padding: 4px 8px; font-size: 13px; }

/* ============================================================================
 * FX widget no topbar (Bacen PTAX)
 * ============================================================================ */
.fx-host {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12px;
  margin-right: 14px;
  transition: border-color 0.15s;
  cursor: help;
}
.fx-host:hover { border-color: var(--accent); }
.fx-host:empty { display: none; }
.fx-host .fx-pair {
  color: var(--text-subtle);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.fx-host .fx-rate {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--text);
}
.fx-host .fx-meta {
  color: var(--text-subtle);
  font-size: 10px;
}

/* ============================================================================
 * Travel-tech search bar (origem ⇄ destino com autocomplete)
 * ============================================================================ */
.tt-search {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 14px;
  display: grid;
  grid-template-columns: 1.1fr 36px 1.1fr 1fr 0.9fr 0.9fr;
  gap: 8px;
  align-items: end;
  position: sticky;
  top: 76px;
  z-index: 30;
  margin-bottom: 18px;
}

.tt-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; position: relative; }
.tt-field label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  font-weight: 700;
}

.tt-field .input,
.tt-field .select {
  height: 40px;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid transparent;
}
.tt-field .input:focus,
.tt-field .select:focus {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.tt-field .input.airport-input {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tt-swap {
  height: 40px;
  width: 36px;
  align-self: end;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.18s cubic-bezier(.22,1,.36,1);
  margin-bottom: 0;
}
.tt-swap:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: rotate(180deg);
}

.tt-actions {
  display: flex; gap: 8px; align-items: end;
}

@media (max-width: 1024px) {
  .tt-search {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .tt-swap { display: none; }
}

/* ============================================================================
 * Airport autocomplete popover
 * ============================================================================ */
.airport-input-wrap {
  position: relative;
  width: 100%;
}
.airport-input-wrap .input { width: 100%; }

.airport-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 60;
  display: none;
  max-height: 360px;
  overflow-y: auto;
  padding: 6px;
}
.airport-popover.open { display: block; }

.airport-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.1s;
}
.airport-row:hover,
.airport-row.active {
  background: var(--accent-soft);
}
.airport-row .ap-iata {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
  padding: 4px 9px;
  border-radius: 6px;
  letter-spacing: 0.04em;
}
.airport-row.active .ap-iata,
.airport-row:hover .ap-iata {
  background: var(--accent);
  color: white;
}
.airport-row .ap-info {
  display: flex; flex-direction: column; gap: 1px; min-width: 0;
}
.airport-row .ap-city {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.airport-row .ap-meta {
  font-size: 11px;
  color: var(--text-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.airport-row .ap-tag {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 6px;
  border-radius: 999px;
}
.airport-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ============================================================================
 * Quick filter chips (presets de data, escalas, etc.)
 * ============================================================================ */
.tt-quick {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  margin: -6px 0 18px;
}
.tt-quick-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  font-weight: 600;
  margin-right: 4px;
}
.tt-chip {
  padding: 5px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.12s ease;
  white-space: nowrap;
}
.tt-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.tt-chip.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 1px 4px var(--accent-glow);
}

/* ============================================================================
 * Auto-update indicator (top-right of search bar)
 * ============================================================================ */
.tt-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--info-soft);
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.tt-live .pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--info);
  box-shadow: 0 0 0 0 rgba(59,130,246,0.5);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(59,130,246,0.45); }
  70% { box-shadow: 0 0 0 6px rgba(59,130,246,0); }
  100% { box-shadow: 0 0 0 0 rgba(59,130,246,0); }
}

/* ============================================================================
 * Result rows — denser, prettier, with carrier avatar
 * ============================================================================ */
.flight-row td {
  vertical-align: middle;
  padding: 14px 16px;
}

.carrier-block {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.carrier-block .ca-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #e0b04d);
  color: #1A1A1A;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  font-family: var(--font-mono);
  flex-shrink: 0;
  letter-spacing: 0.04em;
}
.carrier-block .ca-name {
  display: flex; flex-direction: column; min-width: 0;
}
.carrier-block .ca-airline {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
}
.carrier-block .ca-fns {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.route-block .ro-pair {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.route-block .ro-pair .ro-arrow {
  color: var(--text-subtle);
  margin: 0 6px;
  font-weight: 400;
}
.route-block .ro-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.route-block .ro-direct { color: var(--success); font-weight: 600; }

.date-block {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}
.date-block .dow {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* Cabin pills (mais elegantes) */
.cabin-stack {
  display: flex; flex-direction: column; gap: 4px;
}
.cabin-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
}
.cabin-tag {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--bg);
  color: var(--text-muted);
  min-width: 38px;
  text-align: center;
}
.cabin-tag.Y { background: #ecfdf5; color: #065f46; }
.cabin-tag.W { background: #eff6ff; color: #1e40af; }
.cabin-tag.J { background: #fef3c7; color: #92400e; }
.cabin-tag.F { background: #fae8ff; color: #86198f; }

.fare-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.fare-chip .fc-prog {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.fare-chip .fc-amount {
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.fare-chip .fc-tax {
  font-size: 10px;
  color: var(--text-subtle);
  font-variant-numeric: tabular-nums;
}
.fare-chip.cash {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-color: #bfdbfe;
}
.fare-chip.cash .fc-amount { color: #1d4ed8; font-weight: 700; }
.fare-chip.award {
  background: var(--accent-soft);
  border-color: #fed7aa;
}
.fare-chip.award .fc-amount { color: #c2410c; font-weight: 700; }

/* ============================================================================
 * Empty state with svg icon
 * ============================================================================ */
.empty-rich {
  text-align: center;
  padding: 48px 24px 56px;
  color: var(--text-muted);
}
.empty-rich svg {
  width: 56px; height: 56px; margin-bottom: 12px;
  opacity: 0.5;
}
.empty-rich .empty-title {
  font-size: 15px;
  color: var(--text);
  font-weight: 600;
  margin: 0 0 4px;
}
.empty-rich .empty-sub {
  font-size: 13px;
  color: var(--text-muted);
}

/* ============================================================================
 * Top results bar (filtros count + reload state)
 * ============================================================================ */
.tt-results-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-muted);
  gap: 8px;
  flex-wrap: wrap;
}
.tt-results-count strong {
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.tt-loading-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--info);
  animation: pulse 1s infinite;
  margin-right: 8px;
  vertical-align: middle;
}

/* Better skeleton for table loading */
.skel-rows tr td {
  border-bottom: 1px solid var(--border);
  padding: 14px 16px;
}
.skel-line {
  height: 10px;
  background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
  background-size: 200% 100%;
  animation: skel 1.4s ease infinite;
  border-radius: 4px;
}

/* Badge variants for deal signals */
.deal-signal {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-right: 4px;
}
.deal-signal.min { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #78350f; }
.deal-signal.p10 { background: #dbeafe; color: #1e3a8a; }
.deal-signal.strong { background: var(--danger); color: white; }
.deal-signal.delta-strong { color: var(--danger); font-weight: 800; }
.deal-signal.delta-good { color: #c2410c; font-weight: 700; }
.deal-signal.delta-mild { color: #92400e; }

.delta-num {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 13px;
}
.delta-num.strong { color: var(--danger); }
.delta-num.good { color: var(--accent); }
.delta-num.mild { color: #92400e; }
.delta-num.up { color: var(--text-muted); font-weight: 500; }

/* Sticky-friendly */
.tt-section { margin-bottom: 18px; }

/* Mobile tweaks */
@media (max-width: 720px) {
  .tt-search {
    grid-template-columns: 1fr 1fr;
    top: 56px;
    padding: 12px;
  }
  .tt-quick { overflow-x: auto; flex-wrap: nowrap; }
}
