:root {
  --navy: #1c2f6b;
  --navy-700: #16265a;
  --navy-900: #0f1c44;
  --blue: #2a4bd0;
  --ink: #16181d;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f4f6fb;
  --card: #ffffff;
  --ok: #0f9d58;
  --warn: #b45309;
  --warn-bg: #fff4e2;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(16, 24, 64, .06), 0 8px 24px rgba(16, 24, 64, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: linear-gradient(120deg, var(--navy-900), var(--navy));
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand img { height: 44px; display: block; } /* logo branco, sem fundo, direto no header azul */
.brand .titles { line-height: 1.1; }
.brand .titles strong { font-size: 15px; display: block; letter-spacing: .3px; }
.brand .titles span { font-size: 12px; opacity: .8; }
.topbar .nav a { color: #dbe4ff; font-size: 14px; font-weight: 600; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 30px 16px 60px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}
.card h2 { margin: 0 0 4px; font-size: 18px; }
.card .hint { color: var(--muted); font-size: 13px; margin: 0 0 16px; }

.field { margin-bottom: 16px; position: relative; }
.field > label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; }
input[type=text], input[type=number], input[type=password] {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
  color: var(--ink);
}
input:focus { outline: 2px solid #c7d2fe; border-color: var(--blue); }

.seg { display: inline-flex; background: #eef1f8; border-radius: 10px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg button {
  border: 0; background: transparent; padding: 9px 16px; border-radius: 8px;
  font-size: 14px; font-weight: 600; color: #4b5563; cursor: pointer;
}
.seg button.active { background: #fff; color: var(--navy); box-shadow: 0 1px 2px rgba(0,0,0,.1); }

.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > .field { flex: 1; min-width: 220px; }

.btn {
  background: var(--navy); color: #fff; border: 0; border-radius: 10px;
  padding: 12px 22px; font-size: 15px; font-weight: 700; cursor: pointer;
}
.btn:hover { background: var(--navy-700); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: #eef1f8; color: var(--navy); }
.btn.small { padding: 8px 14px; font-size: 13px; }
.btn.danger { background: #fdecec; color: #b91c1c; }

/* Autocomplete */
.ac { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin-top: 4px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
  max-height: 280px; overflow-y: auto; }
.ac .item { padding: 10px 12px; cursor: pointer; border-bottom: 1px solid #f1f3f9; }
.ac .item:last-child { border-bottom: 0; }
.ac .item:hover, .ac .item.hl { background: #f5f8ff; }
.ac .item .city { font-weight: 600; font-size: 14px; }
.ac .item .sub { font-size: 12px; color: var(--muted); }
.ac .empty { padding: 12px; color: var(--muted); font-size: 13px; }

/* Resultado */
.result-total { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.result-total .big { font-size: 40px; font-weight: 800; color: var(--navy); letter-spacing: -1px; }
.result-total .per { color: var(--muted); font-size: 14px; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.badge.val { background: #e7f6ee; color: var(--ok); }
.badge.est { background: #eef1f8; color: var(--navy); }

.breakdown { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 18px 0; }
.tile { background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.tile .k { font-size: 12px; color: var(--muted); }
.tile .v { font-size: 18px; font-weight: 700; margin-top: 2px; }
.tile.fuel .v { color: #1d4ed8; }
.tile.prog .v { color: #7c3aed; }
.tile.maint .v { color: #b45309; }
.tile.total .v { color: var(--navy); }

.meta { display: flex; gap: 22px; flex-wrap: wrap; color: #374151; font-size: 14px; margin-top: 4px; }
.meta b { color: var(--ink); }

.alert { background: var(--warn-bg); border: 1px solid #f3d9a8; color: #7c4a00;
  padding: 10px 12px; border-radius: 10px; font-size: 13px; margin-top: 10px; }

.save-row { display: flex; gap: 10px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.save-row input { flex: 1; min-width: 200px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: #eef1f8; color: var(--navy); }

.exchange-line { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.exchange-line b { color: var(--ink); }

/* Abas */
.tabs {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
  display: flex;
  gap: 4px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.tabs .tab {
  border: 0; background: transparent; cursor: pointer;
  padding: 15px 20px; font-size: 15px; font-weight: 700; color: var(--muted);
  border-bottom: 3px solid transparent;
}
.tabs .tab:hover { color: var(--navy); }
.tabs .tab.active { color: var(--navy); border-bottom-color: var(--navy); }

/* Cabeçalho do comparativo */
.comp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin: 6px 0 16px; }
.comp-title { margin: 0; font-size: 22px; color: var(--navy); }
.comp-sub { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.exchange-chip { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 12px; color: var(--muted); box-shadow: var(--shadow); }
.exchange-chip b { color: var(--ink); }

.comp-scroll { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); background: #fff; }

/* Tabela comparativa estilo planilha, modernizada */
table.comp { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12.5px; }
table.comp th, table.comp td { padding: 7px 8px; text-align: right; white-space: nowrap; }
table.comp .corner, table.comp .dest { text-align: left; }
table.comp thead .blk { text-align: center; color: #fff; font-size: 15px; font-weight: 800; letter-spacing: .3px; padding: 16px 12px; text-shadow: 0 1px 4px rgba(0,0,0,.45); }
table.comp thead .blk small { display: block; font-weight: 600; opacity: .95; font-size: 11px; }

/* Marca d'água: foto da aeronave atrás da barra de título (degradê por cima
   mantém o texto legível). Se o arquivo não existir, fica a cor sólida. */
table.comp thead .blk.ac0 {
  background-color: #a8423f;
  background-image: linear-gradient(rgba(150,52,49,.62), rgba(110,34,32,.82)), url("/brand/sr22.jpeg");
  background-size: cover; background-position: center 40%; background-repeat: no-repeat;
}
table.comp thead .blk.ac1 {
  background-color: #1f3a6b;
  background-image: linear-gradient(rgba(22,42,88,.60), rgba(15,28,60,.82)), url("/brand/cj1.jpg");
  background-size: cover; background-position: center 42%; background-repeat: no-repeat;
}
table.comp thead .sub th { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: #fff; font-weight: 700; }
table.comp .corner { background: var(--navy-900); color: #fff; vertical-align: bottom; border-top-left-radius: var(--radius); }
table.comp .corner small { display: block; font-weight: 500; opacity: .8; font-size: 11px; }

/* blocos por aeronave */
table.comp .ac0 { background: #a8423f; }          /* Cirrus — rosé/terracota (header) */
table.comp .ac1 { background: #1f3a6b; }          /* CJ1 — azul (header) */
table.comp tbody td.ac0 { background: #fbf1f0; color: #7a2f2d; }
table.comp tbody td.ac1 { background: #eef3fb; color: #1c355f; }
table.comp tbody td.tot { font-weight: 800; }
table.comp tbody td.ac0.tot { color: #8a2a27; }
table.comp tbody td.ac1.tot { color: #16305c; }
table.comp tbody td.best { position: relative; }
table.comp tbody td.best::after { content: "✓"; position: absolute; left: 8px; color: var(--ok); font-weight: 800; }

table.comp tbody .grouprow td { background: #eef1f8; font-weight: 800; color: var(--navy); text-transform: uppercase; letter-spacing: .5px; font-size: 12px; text-align: left; }
table.comp tbody .datarow:hover td { filter: brightness(.98); }
table.comp tbody .datarow td { border-top: 1px solid #eef0f4; }
table.comp .dest b { font-size: 14px; }
table.comp .dest small { display: block; color: var(--muted); font-weight: 500; font-size: 11px; }
table.comp .valdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-left: 4px; vertical-align: middle; }

.comp-legend { color: var(--muted); font-size: 12px; margin-top: 12px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.lg-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.lg-dot.est { background: #cbd2e0; }
.lg-dot.val { background: var(--ok); }
.lg-best { color: var(--ok); font-weight: 800; }

/* Bloco azul-marinho de adicionar voo (admin) */
.navy-add { background: linear-gradient(125deg, var(--navy-900), var(--navy)); border: 0; color: #fff; }
.navy-add h2 { color: #fff; }
.navy-add .hint { color: #c7d2fe; }
.navy-add label { color: #dbe4ff; }
.navy-add input { background: #fff; border-color: transparent; }
.navy-add .btn { background: #fff; color: var(--navy); }
.navy-add .btn:hover { background: #eef1f8; }
.navy-add .err { color: #ffd7d7; }

/* Bloco de simular temático pela aeronave: foto de marca d'água BEM sutil
   (degradê forte por cima) + cor de fundo — vermelho (Cirrus) ou azul (CJ1). */
.navy-add.cirrus, .navy-add.cj1 { background-size: cover; background-position: center; transition: background-color .35s ease; }
.navy-add.cirrus {
  background-color: #8a2f2c;
  background-image: linear-gradient(rgba(132,44,41,.90), rgba(96,28,26,.94)), url("/brand/sr22.jpeg");
}
.navy-add.cj1 {
  background-color: #182a5e;
  background-image: linear-gradient(rgba(24,42,86,.90), rgba(14,26,58,.94)), url("/brand/cj1.jpg");
}

/* Botão remover dentro da célula de destino da tabela colorida */
table.comp .dest .rm { border: 0; background: transparent; color: #b91c1c; cursor: pointer; font-size: 11px; font-weight: 700; padding: 2px 4px; margin-top: 2px; }
table.comp .dest .rm:hover { text-decoration: underline; }

/* Tabela "Comparar aeronaves" (aba Simular): colunas coloridas por aeronave */
table.cmp { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
table.cmp th, table.cmp td { padding: 11px 14px; text-align: right; white-space: nowrap; }
table.cmp .lbl, table.cmp .corner { text-align: left; color: #4b5563; font-weight: 600; }
table.cmp thead .corner { background: var(--navy-900); color: #fff; }
table.cmp thead .blk { color: #fff; font-weight: 800; padding: 15px 14px; text-shadow: 0 1px 4px rgba(0,0,0,.45); background-size: cover; background-position: center; }
table.cmp thead .blk small { display: block; font-weight: 600; font-size: 11px; opacity: .95; }
table.cmp thead .blk.ac0 { background-color: #a8423f; background-image: linear-gradient(rgba(150,52,49,.66), rgba(110,34,32,.82)), url("/brand/sr22.jpeg"); }
table.cmp thead .blk.ac1 { background-color: #1f3a6b; background-image: linear-gradient(rgba(22,42,88,.62), rgba(15,28,60,.82)), url("/brand/cj1.jpg"); }
table.cmp td.ac0 { background: #fbf1f0; color: #7a2f2d; font-variant-numeric: tabular-nums; }
table.cmp td.ac1 { background: #eef3fb; color: #1c355f; font-variant-numeric: tabular-nums; }
table.cmp tbody td { border-top: 1px solid #eef0f4; }
table.cmp .totalrow td { font-weight: 800; font-size: 16px; border-top: 2px solid #dfe4ee; }
table.cmp .totalrow td.ac0 { color: #8a2a27; }
table.cmp .totalrow td.ac1 { color: #16305c; }
table.cmp .win { display: inline-block; background: #e7f6ee; color: var(--ok); font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 999px; margin-left: 6px; }
table.cmp small.muted { font-weight: 600; }

/* Card de aeronave no admin: cabeçalho colorido (Cirrus vermelho / CJ azul)
   com marca d'água discreta; campos ficam no corpo branco embaixo. */
.ac-card { padding: 0; overflow: hidden; }
.ac-card-head { padding: 16px 22px; color: #fff; background-size: cover; background-position: center; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.ac-hour { text-align: right; flex-shrink: 0; }
.ac-hour-v { font-size: 24px; font-weight: 800; line-height: 1; text-shadow: 0 1px 4px rgba(0,0,0,.45); }
.ac-hour-k { font-size: 10.5px; opacity: .9; margin-top: 3px; text-shadow: 0 1px 3px rgba(0,0,0,.4); letter-spacing: .2px; }
.ac-card-head h2 { margin: 0; color: #fff; font-size: 18px; text-shadow: 0 1px 4px rgba(0,0,0,.4); }
.ac-card-head .sub { margin-top: 3px; font-size: 12px; color: rgba(255,255,255,.9); text-shadow: 0 1px 3px rgba(0,0,0,.4); }
.ac-card-head.cirrus { background-color: #a8423f; background-image: linear-gradient(rgba(140,45,42,.78), rgba(108,33,31,.9)), url("/brand/sr22.jpeg"); }
.ac-card-head.cj1 { background-color: #1f3a6b; background-image: linear-gradient(rgba(24,42,86,.78), rgba(14,26,58,.9)), url("/brand/cj1.jpg"); }
.ac-card-body { padding: 20px 22px; }
.ac-card-body .hint { margin-top: 0; }

/* Bloco de sócios: carrossel infinito, logos coloridos e bem espaçados,
   deslizando suavemente. Pausa ao passar o mouse. */
/* Faixa dos sócios como uma "orelha" flutuante: cantos arredondados (a ponta
   direita mais aberta, lembrando a asa da águia), sombra leve e um respiro nas
   laterais. Delicada, não uma barra reta. */
.partners {
  max-width: 620px;               /* ~50% da largura: aba compacta e centralizada */
  margin: 0 auto 20px;            /* respiro maior antes do conteúdo */
  background: linear-gradient(#ffffff, #f2f5fc);
  border: 1px solid var(--line);
  border-top: none;               /* encostada no header = "pendurada" */
  border-radius: 0 0 22px 22px;   /* fundo arredondado = aba pra baixo */
  box-shadow: 0 6px 14px rgba(16, 24, 64, .10);
  padding: 6px 0 8px;             /* ~50% mais baixa */
  overflow: hidden;
  position: relative;
}
/* degradê nas pontas: reforça a sensação de "corre pra sempre" e suaviza a orelha */
.partners::before, .partners::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 32px; z-index: 2; pointer-events: none;
}
.partners::before { left: 0; background: linear-gradient(90deg, #fff, rgba(255,255,255,0)); }
.partners::after { right: 0; background: linear-gradient(270deg, #f5f7fc, rgba(245,247,252,0)); }
.partners:hover .partners-track { animation-play-state: paused; }
.partners-track {
  display: flex;
  align-items: center;
  gap: 48px;
  width: max-content;
  animation: partners-marquee 40s linear infinite;
  will-change: transform;
}
.p-logo { display: flex; align-items: center; flex: 0 0 auto; }
.p-logo img { height: 20px; width: auto; display: block; opacity: .95; }
.p-logo.eng img { height: 28px; } /* engebel tem ícone+texto empilhados — sobe pra igualar o porte */
.p-logo.vit img { height: 17px; } /* Vitral Sul é largo — reduz ~15% pra emparelhar */
@keyframes partners-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (max-width: 680px) { .partners { max-width: none; margin: 0 16px 6px; } .partners-track { gap: 34px; } .p-logo img { height: 17px; } .p-logo.eng img { height: 24px; } }

/* Bloco de exibição (checkboxes) no card da aeronave */
.disp { margin: 6px 0 14px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; padding: 12px 14px; }
.disp-title { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 800; margin-bottom: 9px; }
.disp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 20px; }
.disp-opt { display: flex; align-items: center; gap: 9px; font-size: 13px; color: #374151; cursor: pointer; }
.disp-opt input { width: 17px; height: 17px; accent-color: var(--navy); flex: 0 0 auto; }

/* Comparativo mobile: cartões estilo app, um por rota, dois aviões lado a lado */
.cmob { display: flex; flex-direction: column; gap: 11px; }
.cmob-group { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--navy); margin: 10px 2px 0; }
.cmob-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.cmob-dest { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.cmob-dest b { font-size: 15px; }
.cmob-dest span { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.cmob-acs { display: grid; grid-template-columns: 1fr 1fr; }
.cmob-ac { padding: 12px 14px; }
.cmob-ac.ac0 { background: #fdf3f2; }
.cmob-ac.ac1 { background: #eff3fb; }
.cmob-ac:first-child { border-right: 1px solid var(--line); }
.cmob-acname { font-size: 12px; font-weight: 700; }
.cmob-ac.ac0 .cmob-acname { color: #a8423f; }
.cmob-ac.ac1 .cmob-acname { color: #1f3a6b; }
.cmob-badge { display: inline-block; background: #e7f6ee; color: var(--ok); font-size: 9px; font-weight: 800; padding: 1px 6px; border-radius: 999px; margin-left: 5px; }
.cmob-total { font-size: 22px; font-weight: 800; margin: 4px 0 8px; letter-spacing: -.5px; }
.cmob-ac.ac0 .cmob-total { color: #8a2a27; }
.cmob-ac.ac1 .cmob-total { color: #16305c; }
.cmob-lines { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: #4b5563; }
.cmob-lines b { color: var(--ink); font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .comp-scroll { box-shadow: none; background: transparent; border-radius: 0; overflow: visible; }
  .comp-head { margin-bottom: 10px; }
  .disp-grid { grid-template-columns: 1fr; }
}

/* Tela de login dos sócios (página principal) */
.login-screen {
  position: fixed; inset: 0; z-index: 100;
  background: linear-gradient(140deg, var(--navy-900), var(--navy));
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-box {
  width: 100%; max-width: 360px; text-align: center; color: #fff;
}
.login-logo { height: 58px; margin-bottom: 22px; }
.login-title { font-size: 20px; font-weight: 800; letter-spacing: .3px; }
.login-sub { color: #c7d2fe; font-size: 13px; margin: 4px 0 22px; }
.login-box input {
  width: 100%; padding: 13px 14px; border: 0; border-radius: 12px; font-size: 16px;
  background: #fff; color: var(--ink); margin-bottom: 12px;
}
.login-box .btn { width: 100%; background: #fff; color: var(--navy); padding: 13px; font-size: 16px; }
.login-box .btn:hover { background: #eef1f8; }
.login-box .err { color: #ffd7d7; margin-top: 10px; }

.muted { color: var(--muted); }
.center { text-align: center; }
.small { font-size: 13px; }
.hidden { display: none !important; }
.err { color: #b91c1c; font-size: 13px; margin-top: 8px; }

@media (max-width: 520px) {
  .result-total .big { font-size: 32px; }
  .brand .titles { display: none; }
}
