/* Vai pra onde, presidente? — estilo do site */
:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --ink: #0f1b2d;
  --muted: #5d6b80;
  --line: #e2e6ee;
  --navy: #0b2545;
  --navy-2: #13406e;
  --gold: #d99a1e;
  --gold-soft: #fdf3dd;
  --green: #0f9d58;
  --green-soft: #e3f6ec;
  --gray-soft: #eceff4;
  --red: #c0392b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .06), 0 8px 24px rgba(15, 27, 45, .06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --surface: #121b2d;
    --surface-2: #1a2540;
    --ink: #e7ecf5;
    --muted: #93a1b8;
    --line: #23304b;
    --navy: #8fb4ff;
    --navy-2: #b9cfff;
    --gold: #f0b43c;
    --gold-soft: #3a2e12;
    --green: #34c77b;
    --green-soft: #12301f;
    --gray-soft: #1d2840;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; overflow-x: hidden; background: var(--bg); color: var(--ink);
  font: 16px/1.55 var(--font); font-feature-settings: "tnum" 1, "cv11" 1;
}
a { color: var(--navy-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 1rem; }
small, .muted { color: var(--muted); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* Cabeçalho */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--navy); color: #fff;
}
@media (prefers-color-scheme: dark) { .brand-mark { background: var(--gold); color: #1a1406; } }
.brand-mark svg { width: 20px; height: 20px; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a {
  color: var(--muted); font-weight: 600; font-size: .95rem; padding: 8px 12px; border-radius: 10px;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav a.active { color: var(--ink); background: var(--surface-2); }
.nav a.x-link { color: var(--ink); }
@media (max-width: 720px) {
  .site-header .wrap { padding-top: 10px; padding-bottom: 6px; }
  .nav { margin-left: 0; width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 6px; }
  .nav a { white-space: nowrap; padding: 6px 10px; }
}

main { padding: 28px 0 48px; }

/* Blocos */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.card + .card { margin-top: 16px; }
.grid > .card + .card, .grid > * { margin-top: 0; }
.grid > * { min-width: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.section { margin-top: 28px; }
.page-head { margin-bottom: 20px; }
.page-head p { color: var(--muted); max-width: 680px; }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }

/* Hero */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.hero p { color: var(--muted); max-width: 620px; margin: 0; font-size: 1.05rem; }
.live {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: .92rem; box-shadow: var(--shadow);
}
.live .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(15,157,88,.6); animation: pulse 2s infinite; }
.live .dot.off { background: var(--muted); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(15,157,88,.55); } 70% { box-shadow: 0 0 0 9px rgba(15,157,88,0); } 100% { box-shadow: 0 0 0 0 rgba(15,157,88,0); } }

/* Mapa */
.map { height: 460px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--surface-2); }
.map.sm { height: 300px; }
@media (max-width: 640px) { .map { height: 340px; } }
.plane-icon svg { filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.leaflet-popup-content { font: 14px/1.45 var(--font); }
.leaflet-popup-content strong { font-size: 15px; }

/* Números */
.stat .value { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat .label { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.stat .hint { color: var(--muted); font-size: .78rem; }

/* Status */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: .8rem; font-weight: 700; white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.flying { background: var(--green-soft); color: var(--green); }
.badge.ground { background: var(--surface-2); color: var(--navy-2); }
.badge.offline, .badge.unknown, .badge.partial { background: var(--gray-soft); color: var(--muted); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: .75rem; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.tag.presidential { background: var(--gold-soft); color: var(--gold); }

/* Listas */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; padding-top: 4px; }
.list .main { min-width: 0; }
.list .title { font-weight: 700; color: var(--ink); }
.list .sub { color: var(--muted); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; }
.list .side { text-align: right; flex-shrink: 0; font-size: .88rem; color: var(--muted); }
.ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: var(--surface-2); }
.ico.up { background: var(--green-soft); }
.ico.down { background: var(--surface-2); }
.row { display: flex; gap: 12px; align-items: center; min-width: 0; }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }

/* Frota */
.aircraft-card { display: flex; flex-direction: column; gap: 10px; color: var(--ink); transition: transform .15s ease, border-color .15s ease; }
.aircraft-card:hover { transform: translateY(-2px); border-color: var(--navy-2); text-decoration: none; }
.aircraft-card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.aircraft-card .name { font-size: 1.1rem; font-weight: 800; letter-spacing: -.01em; }
.aircraft-card .meta { color: var(--muted); font-size: .88rem; }
.aircraft-card.presidential { border-top: 3px solid var(--gold); }

/* Tabelas */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover td { background: var(--surface-2); }
.num { text-align: right; white-space: nowrap; }
.route { white-space: nowrap; }

/* Filtros */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.filters label { display: block; font-size: .8rem; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
select, .btn {
  font: inherit; font-size: .95rem; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
}
.btn { cursor: pointer; font-weight: 600; background: var(--navy); color: #fff; border-color: var(--navy); }
@media (prefers-color-scheme: dark) { .btn { color: #0b1220; } }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg a { padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: .9rem; color: var(--muted); }
.seg a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg a:hover { text-decoration: none; color: var(--ink); }

/* Paginação */
.pager { display: flex; justify-content: center; gap: 8px; align-items: center; margin-top: 16px; color: var(--muted); }

/* Detalhes */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.note { font-size: .85rem; color: var(--muted); }
.callout { background: var(--gold-soft); border-radius: var(--radius); padding: 16px 18px; color: var(--ink); }
.cta { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }

/* Barras simples */
.bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; min-width: 80px; }
.bar span { display: block; height: 100%; background: var(--navy-2); border-radius: 999px; }

/* Rodapé */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: .9rem; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer p { margin: 0 0 6px; max-width: 640px; }
