/* ============================================================
   FIDS — 3 temas: classic / atual / moderno
   Design pra TVs 16:9 (1920x1080). Sem scroll. Tipografia grande.
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; }
body { font-family: 'Inter', system-ui, sans-serif; }

.loading, .error {
  display: flex; align-items: center; justify-content: center;
  width: 100vw; height: 100vh; flex-direction: column; gap: 16px;
  color: #999;
}
.error h1 { font-size: 48px; color: #f44; }
.error p { font-size: 18px; }
.error .hint { color: #666; }

.board {
  width: 100vw; height: 100vh; min-width: 1280px;
  display: flex; flex-direction: column;
  text-transform: uppercase;
}
/* Mobile: deixa scroll horizontal pra board manter proporcao de TV */
body { overflow-x: auto; }
html, body { min-width: 1280px; }

/* ============================================================
   THEME: CLASSIC (split-flap board, escuro, monoespacial, amarelo/verde)
   ============================================================ */

body.theme-classic { background: #000; color: #ffd700; }

.theme-classic {
  font-family: 'JetBrains Mono', monospace;
  background: #0a0a0a;
}

.theme-classic .hdr {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  padding: 1.5vh 2vw;
  background: linear-gradient(180deg, #000, #1a1a1a);
  border-bottom: 1px solid #ffd700;
  height: 12vh;
}
.theme-classic .hdr-l { text-align: left; }
.theme-classic .hdr-c { text-align: center; }
.theme-classic .hdr-r { text-align: right; }
.theme-classic .hdr-icao {
  font-size: 6vh; font-weight: 700;
  line-height: 1;
  display: inline-flex; gap: 0.4vh;
}
.theme-classic .hdr-name {
  font-size: 1.5vh; color: #aaa; margin-top: 0.8vh;
  text-transform: uppercase; letter-spacing: 0.2vh;
}
.theme-classic .hdr-time {
  font-size: 7vh; font-weight: 700;
  line-height: 1;
  display: inline-flex; gap: 0.4vh;
}
.theme-classic .hdr-date {
  font-size: 1.3vh; color: #888; margin-top: 0.8vh;
  text-transform: uppercase; letter-spacing: 0.2vh;
}
.theme-classic .powered {
  font-size: 1.2vh; color: #666;
  text-transform: uppercase; letter-spacing: 0.25vh;
}
.theme-classic .brand {
  font-size: 3.2vh; font-weight: 700;
  color: #ffd700; letter-spacing: 0.4vh; margin-top: 0.4vh;
}

/* Layout normal (lado a lado) — fallback caso alternancia desligue */
.theme-classic .content {
  flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 1.5vw;
  padding: 1.5vh 2vw; overflow: hidden;
  height: calc(100vh - 9vh);
}
/* Single: 1 painel por vez (alternancia 15s) */
.theme-classic .content.single {
  grid-template-columns: 1fr;
}
.theme-classic .content.single section.panel {
  display: none;
  opacity: 0;
  transition: opacity 300ms ease-out;
}
.theme-classic .content.single.show-arr section[data-panel="arrivals"],
.theme-classic .content.single.show-dep section[data-panel="departures"] {
  display: flex;
  opacity: 1;
}
.theme-classic .content.single.switching section.panel { opacity: 0; }

.theme-classic .panel {
  display: flex; flex-direction: column; min-height: 0;
}
.theme-classic .panel-head {
  display: flex; align-items: center; gap: 1vw;
  padding: 1.2vh 1.5vw;
  background: #111;
  border: 1px solid #ffd700;
  margin-bottom: 1.5vh;
  flex-shrink: 0;
}
.theme-classic .panel-title {
  font-size: 3.5vh; font-weight: 700; color: #ffd700;
  letter-spacing: 0.6vh;
}
.theme-classic .dot { font-size: 3vh; }
.theme-classic .dot-arr { color: #4ade80; }
.theme-classic .dot-dep { color: #4ade80; }

.theme-classic .flap {
  width: 100%; border-collapse: collapse; flex: 1;
  table-layout: fixed;
}
.theme-classic .flap thead th {
  font-size: 1.6vh; font-weight: 700;
  color: #888; padding: 1vh 0.5vw;
  text-align: left; letter-spacing: 0.25vh;
  border-bottom: 1px solid #333;
}
.theme-classic .flap tbody td {
  font-size: 4.5vh; font-weight: 500;
  color: #fff; padding: 0 0.5vw;
  border-bottom: 1px solid #1a1a1a;
  background: #0d0d0d;
  vertical-align: middle;
}
.theme-classic .flap tbody tr:nth-child(even) td { background: #111; }
/* Larguras das colunas (6): Previsto | Real | Matricula | Origem/Destino | Patio | Situacao */
.theme-classic .flap th:nth-child(1), .theme-classic .flap td:nth-child(1) { width: 13%; }
.theme-classic .flap th:nth-child(2), .theme-classic .flap td:nth-child(2) { width: 13%; }
.theme-classic .flap th:nth-child(3), .theme-classic .flap td:nth-child(3) { width: 18%; }
.theme-classic .flap th:nth-child(4), .theme-classic .flap td:nth-child(4) { width: 13%; }
.theme-classic .flap th:nth-child(5), .theme-classic .flap td:nth-child(5) { width: 16%; }
.theme-classic .flap th:nth-child(6), .theme-classic .flap td:nth-child(6) { width: 27%; }

/* Altura fixa em pixels — sempre identica em chegadas e partidas
   independente do conteudo. 80px = ~7.4vh em 1080p. */
.theme-classic .flap tbody tr { height: 80px; }
.theme-classic .flap tbody td { height: 80px; min-height: 80px; max-height: 80px; }

/* Empty rows (preenchimento quando ha menos de ROWS_PER_PANEL items) —
   mantem o tamanho visual mas sem conteudo */
.theme-classic .flap tbody tr.r-empty td {
  background: #0d0d0d;
  border-bottom: 1px solid #1a1a1a;
}
.theme-classic .flap tbody tr.r-empty:nth-child(even) td { background: #111; }

.theme-classic .hr { color: #ffd700; font-weight: 700; }
.theme-classic .t-real { display: inline-block; }
.theme-classic .t-old {
  display: inline-block; margin-left: 10px;
  text-decoration: line-through; color: #555; font-size: 16px;
}
.theme-classic .reg { color: #fff; font-weight: 700; letter-spacing: 2px; }
.theme-classic .ico { color: #ffd700; font-weight: 700; letter-spacing: 2px; }
.theme-classic .gate { color: #aaa; }
.theme-classic .st { font-weight: 700; letter-spacing: 2px; }
.theme-classic .r-pousou .st, .theme-classic .r-decolou .st { color: #4ade80; }
.theme-classic .r-aproximando .st, .theme-classic .r-decolando .st { color: #fbbf24; animation: blink 1.5s infinite; }
.theme-classic .r-atrasado .st { color: #f87171; }
.theme-classic .r-agendado .st { color: #60a5fa; }
@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0.3; } }

.theme-classic .empty {
  text-align: center; padding: 60px 20px;
  color: #555; font-size: 18px; letter-spacing: 4px;
}

/* ── Flap-char tiles (estilo Solari split-flap) ─────────────────── */
.theme-classic .flap-char {
  display: inline-block;
  position: relative;
  min-width: 0.65em;
  padding: 0 0.08em;
  margin: 0 0.015em;
  text-align: center;
  color: #ffd700;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  /* Gradiente suave top->bottom, sem transicao no meio. A linha do
     split eh adicionada via ::after, garantindo espessura uniforme. */
  background: linear-gradient(180deg, #222 0%, #0a0a0a 100%);
  border: 1px solid #000;
  border-radius: 2px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 1px 0 rgba(0, 0, 0, 0.8),
    0 2px 3px rgba(0, 0, 0, 0.6);
  text-shadow:
    0 0 4px rgba(255, 215, 0, 0.3),
    0 1px 0 rgba(0, 0, 0, 0.8);
}

/* Linha horizontal no meio do tile (split entre flaps) — 1px solido,
   edge-to-edge, perfeitamente centrado via translateY(-50%). */
.theme-classic .flap-char::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: 1px;
  background: #000;
  pointer-events: none;
  transform: translateY(-50%);
  z-index: 2;
}

/* Animacao de flap: gira pra baixo (negativo) e volta — simulacao do
   flip mecanico Solari. Usado em entrada de novo char e via .flipping
   trigger pelo JS. */
.theme-classic .flap-char {
  perspective: 200px;
  transform-style: preserve-3d;
  animation: flap-enter 320ms ease-out;
  animation-fill-mode: backwards;
}
@keyframes flap-enter {
  0%   { transform: rotateX(-90deg); opacity: 0.3; }
  60%  { transform: rotateX(20deg); opacity: 1; }
  100% { transform: rotateX(0deg); opacity: 1; }
}

.theme-classic .flap-char.flap-tick {
  animation: flap-tick 380ms ease-in;
}
@keyframes flap-tick {
  0%   { transform: rotateX(0deg); }
  45%  { transform: rotateX(-90deg); opacity: 0.4; }
  55%  { transform: rotateX(85deg); opacity: 0.4; }
  100% { transform: rotateX(0deg); opacity: 1; }
}

.theme-classic .flap-blank {
  background: linear-gradient(180deg, #0a0a0a 0%, #000 50%, #0a0a0a 100%);
  color: transparent;
}

.theme-classic .flap-sep {
  min-width: 0.35em;
  padding: 0.05em 0.05em;
  font-weight: 700;
}

/* Status com cores diferentes — tile mantem fundo escuro, char colore */
.theme-classic .r-pousou .st .flap-char,
.theme-classic .r-decolou .st .flap-char {
  color: #4ade80;
  text-shadow: 0 0 4px rgba(74, 222, 128, 0.4), 0 1px 0 rgba(0, 0, 0, 0.8);
}
.theme-classic .r-aproximando .st .flap-char,
.theme-classic .r-decolando .st .flap-char {
  color: #fbbf24;
  text-shadow: 0 0 4px rgba(251, 191, 36, 0.4), 0 1px 0 rgba(0, 0, 0, 0.8);
  animation: flap-blink 1.5s infinite;
}
.theme-classic .r-atrasado .st .flap-char {
  color: #f87171;
  text-shadow: 0 0 4px rgba(248, 113, 113, 0.4), 0 1px 0 rgba(0, 0, 0, 0.8);
}
.theme-classic .r-agendado .st .flap-char {
  color: #60a5fa;
  text-shadow: 0 0 4px rgba(96, 165, 250, 0.4), 0 1px 0 rgba(0, 0, 0, 0.8);
}
@keyframes flap-blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0.4; } }

/* Spacing diferente nos tiles dentro de celulas — mais apertado */
.theme-classic .flap td .flap-char { margin: 0 0.02em; padding: 0.02em 0.08em; }

/* Coluna REAL: verde (vs PREVISTO em amarelo). */
.theme-classic .flap td.hr-real .flap-char {
  color: #4ade80;
  text-shadow: 0 0 4px rgba(74, 222, 128, 0.4), 0 1px 0 rgba(0, 0, 0, 0.8);
}
/* Mas o dash mantem cor amarela padrao (= identico ao patio vazio) */
.theme-classic .flap td.hr-real .flap-char.flap-dash {
  color: #ffd700;
  text-shadow: 0 0 4px rgba(255, 215, 0, 0.3), 0 1px 0 rgba(0, 0, 0, 0.8);
}

/* Previne quebra de linha — chars de uma celula sempre numa linha so */
.theme-classic .flap td.hr,
.theme-classic .flap td.reg,
.theme-classic .flap td.ico,
.theme-classic .flap td.gate,
.theme-classic .flap td.st,
.theme-classic .hdr-icao,
.theme-classic .hdr-time {
  white-space: nowrap;
}

/* ============================================================
   THEME: ATUAL (claro, premium, aeroportos modernos)
   Mesma estrutura do classic: 6 colunas, alternancia 15s, row 80px
   ============================================================ */

body.theme-atual { background: #f1f5f9; color: #0f172a; }

.theme-atual {
  font-family: 'Inter', sans-serif;
  background: #f1f5f9;
}

.theme-atual .hdr {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  padding: 1.5vh 2vw;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  height: 12vh;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.theme-atual .hdr-l { text-align: left; }
.theme-atual .hdr-c { text-align: center; }
.theme-atual .hdr-r { text-align: right; }
.theme-atual .hdr-icao {
  font-size: 6vh; font-weight: 800; color: #0f172a;
  letter-spacing: 0.4vh; line-height: 1;
}
.theme-atual .hdr-name {
  font-size: 1.5vh; color: #64748b; margin-top: 0.8vh;
  font-weight: 500;
}
.theme-atual .hdr-time {
  font-size: 7vh; font-weight: 700; color: #0ea5e9;
  font-feature-settings: "tnum"; line-height: 1;
  letter-spacing: 0.2vh;
}
.theme-atual .hdr-date {
  font-size: 1.3vh; color: #64748b; margin-top: 0.8vh;
}
.theme-atual .powered {
  font-size: 1.2vh; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 0.25vh;
}
.theme-atual .brand {
  font-size: 3.2vh; font-weight: 800;
  color: #0ea5e9; letter-spacing: 0.4vh; margin-top: 0.4vh;
}

.theme-atual .content {
  flex: 1; display: grid; grid-template-columns: 1fr; gap: 0;
  padding: 1.5vh 2vw; overflow: hidden;
  height: calc(100vh - 12vh);
}
.theme-atual .content.single { grid-template-columns: 1fr; }
.theme-atual .content.single section.panel {
  display: none; opacity: 0; transition: opacity 300ms ease-out;
}
.theme-atual .content.single.show-arr section[data-panel="arrivals"],
.theme-atual .content.single.show-dep section[data-panel="departures"] {
  display: flex; opacity: 1;
}
.theme-atual .content.single.switching section.panel { opacity: 0; }

.theme-atual .panel {
  display: flex; flex-direction: column; min-height: 0;
  background: #fff; border-radius: 16px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}
.theme-atual .panel-head {
  display: flex; align-items: center; gap: 1vw;
  padding: 1.5vh 1.5vw;
  background: linear-gradient(180deg, #f8fafc, #fff);
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.theme-atual .panel-title {
  font-size: 3.2vh; font-weight: 800; color: #0f172a;
  letter-spacing: 0.5vh;
}
.theme-atual .dot { font-size: 2.4vh; line-height: 1; }
.theme-atual .dot-arr, .theme-atual .dot-dep { color: #16a34a; }

.theme-atual .grid { width: 100%; border-collapse: collapse; flex: 1; table-layout: fixed; }
.theme-atual .grid thead th {
  font-size: 1.4vh; font-weight: 700;
  color: #94a3b8; padding: 1.2vh 0.8vw;
  text-align: left; letter-spacing: 0.2vh;
  text-transform: uppercase;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
/* Larguras das colunas (6) — mesma proporcao do classic */
.theme-atual .grid th:nth-child(1), .theme-atual .grid td:nth-child(1) { width: 13%; }
.theme-atual .grid th:nth-child(2), .theme-atual .grid td:nth-child(2) { width: 13%; }
.theme-atual .grid th:nth-child(3), .theme-atual .grid td:nth-child(3) { width: 18%; }
.theme-atual .grid th:nth-child(4), .theme-atual .grid td:nth-child(4) { width: 13%; }
.theme-atual .grid th:nth-child(5), .theme-atual .grid td:nth-child(5) { width: 16%; }
.theme-atual .grid th:nth-child(6), .theme-atual .grid td:nth-child(6) { width: 27%; }

.theme-atual .grid tbody tr { height: 80px; }
.theme-atual .grid tbody td {
  font-size: 4vh; font-weight: 500;
  color: #0f172a; padding: 0 0.8vw;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  height: 80px; min-height: 80px; max-height: 80px;
}
.theme-atual .grid tbody tr.r-empty td {
  background: #fafbfd;
  border-bottom: 1px solid #f1f5f9;
}

.theme-atual .t {
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  font-feature-settings: "tnum"; color: #0f172a;
}
.theme-atual .hr-real { color: #16a34a; }
.theme-atual .hr-real .dash { color: #cbd5e1; font-weight: 700; }
.theme-atual .reg {
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  letter-spacing: 1px;
}
.theme-atual .ico {
  font-family: 'JetBrains Mono', monospace; font-weight: 600; color: #475569;
}
.theme-atual .gate {
  color: #64748b; font-family: 'JetBrains Mono', monospace; font-weight: 600;
  text-transform: uppercase;
}

.theme-atual .chip {
  display: inline-block; font-size: 2vh; font-weight: 700;
  padding: 0.8vh 1.6vh; border-radius: 999px;
  letter-spacing: 0.05vh;
}
.theme-atual .chip-pousou, .theme-atual .chip-decolou {
  background: #dcfce7; color: #166534;
}
.theme-atual .chip-aproximando, .theme-atual .chip-decolando {
  background: #fef3c7; color: #92400e; animation: pulse 1.5s infinite;
}
.theme-atual .chip-atrasado {
  background: #fee2e2; color: #991b1b;
}
.theme-atual .chip-agendado {
  background: #dbeafe; color: #1e40af;
}
@keyframes pulse { 0%, 50% { opacity: 1; } 75% { opacity: 0.6; } 100% { opacity: 1; } }

.theme-atual .empty {
  text-align: center; padding: 50px 20px;
  color: #94a3b8; font-size: 2vh;
}

/* ============================================================
   THEME: MODERNO (dark glassmorphism, gradient bg, neon accents)
   Mesma estrutura do classic — colunas, alternancia 15s, row 80px
   ============================================================ */

body.theme-moderno { background: #0a0e1a; color: #e2e8f0; }

.theme-moderno {
  font-family: 'Space Grotesk', sans-serif;
  background: #0a0e1a;
  position: relative;
}
.theme-moderno .bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 20% 20%, rgba(14, 165, 233, 0.18), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(168, 85, 247, 0.14), transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(34, 197, 94, 0.06), transparent 60%);
  z-index: 0;
}
.theme-moderno > *:not(.bg) { position: relative; z-index: 1; }

.theme-moderno .hdr {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  padding: 1.5vh 2vw;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  height: 12vh;
  backdrop-filter: blur(12px);
  background: rgba(10, 14, 26, 0.6);
}
.theme-moderno .hdr-l { text-align: left; }
.theme-moderno .hdr-c { text-align: center; }
.theme-moderno .hdr-r { text-align: right; }
.theme-moderno .hdr-icao {
  font-size: 6vh; font-weight: 700;
  background: linear-gradient(135deg, #fff, #94a3b8);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.4vh; line-height: 1;
}
.theme-moderno .hdr-name {
  font-size: 1.5vh; color: #94a3b8; margin-top: 0.8vh;
  font-weight: 500;
}
.theme-moderno .hdr-time {
  font-size: 7vh; font-weight: 600;
  font-feature-settings: "tnum";
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}
.theme-moderno .hdr-date {
  font-size: 1.3vh; color: #94a3b8; margin-top: 0.8vh;
}
.theme-moderno .powered {
  font-size: 1.2vh; color: #64748b;
  letter-spacing: 0.25vh; text-transform: uppercase;
}
.theme-moderno .brand {
  font-size: 3.2vh; font-weight: 700;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.4vh; margin-top: 0.4vh;
}

.theme-moderno .content {
  flex: 1; display: grid; grid-template-columns: 1fr; gap: 0;
  padding: 1.5vh 2vw; overflow: hidden;
  height: calc(100vh - 12vh);
}
.theme-moderno .content.single { grid-template-columns: 1fr; }
.theme-moderno .content.single section.panel {
  display: none; opacity: 0; transition: opacity 300ms ease-out;
}
.theme-moderno .content.single.show-arr section[data-panel="arrivals"],
.theme-moderno .content.single.show-dep section[data-panel="departures"] {
  display: flex; opacity: 1;
}
.theme-moderno .content.single.switching section.panel { opacity: 0; }

.theme-moderno .panel {
  display: flex; flex-direction: column; min-height: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 18px;
  overflow: hidden;
}
.theme-moderno .panel-head {
  display: flex; align-items: center; gap: 1vw;
  padding: 1.5vh 1.5vw;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.6), transparent);
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  flex-shrink: 0;
}
.theme-moderno .panel-title {
  font-size: 3.2vh; font-weight: 700; color: #f1f5f9;
  letter-spacing: 0.5vh;
}
.theme-moderno .dot { font-size: 2.4vh; line-height: 1; color: #4ade80; }

.theme-moderno .grid { width: 100%; border-collapse: collapse; flex: 1; table-layout: fixed; }
.theme-moderno .grid thead th {
  font-size: 1.4vh; font-weight: 700;
  color: #64748b; padding: 1.2vh 0.8vw;
  text-align: left; letter-spacing: 0.2vh;
  text-transform: uppercase;
  background: rgba(15, 23, 42, 0.4);
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}
.theme-moderno .grid th:nth-child(1), .theme-moderno .grid td:nth-child(1) { width: 13%; }
.theme-moderno .grid th:nth-child(2), .theme-moderno .grid td:nth-child(2) { width: 13%; }
.theme-moderno .grid th:nth-child(3), .theme-moderno .grid td:nth-child(3) { width: 18%; }
.theme-moderno .grid th:nth-child(4), .theme-moderno .grid td:nth-child(4) { width: 13%; }
.theme-moderno .grid th:nth-child(5), .theme-moderno .grid td:nth-child(5) { width: 16%; }
.theme-moderno .grid th:nth-child(6), .theme-moderno .grid td:nth-child(6) { width: 27%; }

.theme-moderno .grid tbody tr { height: 80px; }
.theme-moderno .grid tbody td {
  font-size: 4vh; font-weight: 500;
  color: #f1f5f9; padding: 0 0.8vw;
  border-bottom: 1px solid rgba(148, 163, 184, 0.06);
  vertical-align: middle;
  height: 80px; min-height: 80px; max-height: 80px;
}
.theme-moderno .grid tbody tr.r-empty td {
  background: rgba(15, 23, 42, 0.2);
  border-bottom: 1px solid rgba(148, 163, 184, 0.04);
}

.theme-moderno .t {
  font-family: 'JetBrains Mono', monospace; font-weight: 600;
  font-feature-settings: "tnum"; color: #f1f5f9;
}
.theme-moderno .hr-real {
  background: linear-gradient(135deg, #4ade80, #22d3ee);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.theme-moderno .hr-real .dash {
  color: rgba(148, 163, 184, 0.3); font-weight: 700;
  -webkit-text-fill-color: rgba(148, 163, 184, 0.3);
}
.theme-moderno .reg {
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  letter-spacing: 1px; color: #f1f5f9;
}
.theme-moderno .ico {
  font-family: 'JetBrains Mono', monospace; font-weight: 600; color: #94a3b8;
}
.theme-moderno .gate {
  color: #94a3b8; font-family: 'JetBrains Mono', monospace; font-weight: 600;
  text-transform: uppercase;
}

.theme-moderno .chip {
  display: inline-block; font-size: 1.9vh; font-weight: 700;
  padding: 0.8vh 1.6vh; border-radius: 999px;
  letter-spacing: 0.05vh;
  border: 1px solid transparent;
}
.theme-moderno .chip-pousou, .theme-moderno .chip-decolou {
  background: rgba(74, 222, 128, 0.12);
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.3);
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.15);
}
.theme-moderno .chip-aproximando, .theme-moderno .chip-decolando {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
  animation: mod-glow 1.5s infinite;
}
.theme-moderno .chip-atrasado {
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.3);
}
.theme-moderno .chip-agendado {
  background: rgba(96, 165, 250, 0.12);
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.3);
}
@keyframes mod-glow {
  0%, 100% { box-shadow: 0 0 12px rgba(251, 191, 36, 0.2); }
  50% { box-shadow: 0 0 24px rgba(251, 191, 36, 0.5); }
}

.theme-moderno .empty {
  text-align: center; padding: 50px 20px;
  color: #475569; font-size: 2vh;
}

/* ─────────────────────────────────────────────────────────────────── */
/* INCOMING TAKEOVER — substitui board normal quando aeronave em final */
/* approach. Layout identico nas 3 skins (clean fundo claro pra TV).    */
/* ─────────────────────────────────────────────────────────────────── */

body.mode-incoming {
  background: #f8fafc !important;
  color: #0f172a;
}

.incoming-board {
  display: grid;
  grid-template-columns: 60% 40%;
  height: 100vh;
  width: 100vw;
  font-family: 'Inter', sans-serif;
}

/* MAPA SIDE */
.incoming-map-side {
  position: relative;
  background: #e2e8f0;
}
#incoming-map { height: 100%; width: 100%; }

.incoming-overlay {
  position: absolute;
  top: 28px;
  left: 28px;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 16px 28px;
  background: #16a34a;
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(22, 163, 74, 0.35);
}
.incoming-overlay.danger {
  background: #dc2626;
  box-shadow: 0 12px 40px rgba(220, 38, 38, 0.4);
}
.incoming-blink {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  animation: incoming-blink 1s infinite;
}
.incoming-label {
  font-size: 1.6vw;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
@keyframes incoming-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.25; }
}

.incoming-cycle {
  position: absolute;
  top: 28px;
  right: 28px;
  z-index: 1000;
  padding: 10px 18px;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  border-radius: 10px;
  font-size: 1.1vw;
  font-weight: 700;
}

/* PAINEL DIREITO */
.incoming-panel {
  background: #fff;
  border-left: 4px solid #16a34a;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0 4vw;
  gap: 2.5vw;
  text-align: center;
}

.incoming-reg-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 6vw;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 0.95;
  color: #0f172a;
}
.incoming-model {
  font-size: 1.4vw;
  color: #64748b;
  margin-top: 0.6vw;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.incoming-divider {
  width: 64px;
  height: 3px;
  background: #16a34a;
  border-radius: 2px;
}

.incoming-eta-block {
  display: flex;
  align-items: baseline;
  gap: 16px;
  color: #16a34a;
}
.incoming-eta-num {
  font-size: 13vw;
  font-weight: 900;
  line-height: 0.85;
  letter-spacing: -0.02em;
}
.incoming-eta-unit {
  font-size: 2vw;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.incoming-eta-label {
  font-size: 0.9vw;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 700;
  margin-top: -0.5vw;
}

.incoming-route {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.2vw;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 1vw;
}
.incoming-arrow {
  color: #16a34a;
}

.incoming-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  background: #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
  box-shadow: 0 4px 16px rgba(15, 23, 42, .06);
}
.incoming-stat {
  background: #fff;
  padding: 1.2vw 0.5vw;
  text-align: center;
}
.incoming-stat-label {
  font-size: 0.75vw;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 700;
  margin-bottom: 0.4vw;
}
.incoming-stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2vw;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}
.incoming-stat-u {
  font-size: 0.95vw;
  color: #94a3b8;
  margin-left: 0.3vw;
  font-weight: 600;
}

.incoming-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1vw;
  background: #f1f5f9;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 1vw 1.5vw;
  width: 100%;
}
.incoming-vs.descending {
  background: #fef3c7;
  border-color: #fde68a;
}
.incoming-vs-arrow {
  font-size: 2vw;
  color: #64748b;
  font-weight: 800;
}
.incoming-vs.descending .incoming-vs-arrow { color: #d97706; }
.incoming-vs-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.8vw;
  font-weight: 800;
  color: #0f172a;
}
.incoming-vs.descending .incoming-vs-text { color: #92400e; }
.incoming-vs-label {
  font-size: 0.8vw;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 700;
}
.incoming-vs.descending .incoming-vs-label { color: #92400e; }

/* Markers no mapa */
.incoming-aero-icon {
  background: #16a34a;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 5px solid #fff;
  box-shadow: 0 4px 16px rgba(22, 163, 74, 0.5);
}

/* Hide leaflet defaults */
body.mode-incoming .leaflet-control-attribution { display: none; }
