/* Sistema Aviación · estilos (móvil primero, claro/oscuro) */
:root {
  --bg: #f3f5f8; --surface: #ffffff; --surface2: #eef1f5; --line: #dde2ea;
  --text: #0B1F3A; --muted: #4A5A6E; --band: #0B1F3A; --band-text: #e8eef8;
  --accent: #C9A227; --accent-ink: #1a1200; --primary: #1C4479; --brand: #0B1F3A; --primary-ink: #fff;
  --ok: #18804a; --ok-bg: #e3f5ea; --warn: #a86400; --warn-bg: #fff2d6; --bad: #c0352b; --bad-bg: #fde6e3; --info: #2459a8; --info-bg: #e3edfb;
  --radius: 14px; --shadow: 0 1px 2px rgba(15, 35, 65, .06), 0 4px 14px rgba(15, 35, 65, .06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --font-title: "Montserrat", "Inter", system-ui, sans-serif;
  --tabbar-h: 64px;
  --sello-h: 0px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1422; --surface: #13203a; --surface2: #1a2a47; --line: #263a5c;
    --text: #e6edf7; --muted: #94a5bf; --band: #081120; --band-text: #e6edf7; --brand: #e6edf7;
    --primary: #4d8ef0; --ok: #4cc583; --ok-bg: #12321f; --warn: #f2b443; --warn-bg: #3a2b0c; --bad: #ff7a6e; --bad-bg: #3d1714; --info: #79a9f5; --info-bg: #142a4d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1422; --surface: #13203a; --surface2: #1a2a47; --line: #263a5c;
  --text: #e6edf7; --muted: #94a5bf; --band: #081120; --band-text: #e6edf7; --brand: #e6edf7;
  --primary: #4d8ef0; --ok: #4cc583; --ok-bg: #12321f; --warn: #f2b443; --warn-bg: #3a2b0c; --bad: #ff7a6e; --bad-bg: #3d1714; --info: #79a9f5; --info-bg: #142a4d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  color-scheme: dark;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 var(--font); -webkit-tap-highlight-color: transparent; }
a { color: var(--primary); text-decoration: none; }
h1 { font-size: 1.45rem; margin: 0; line-height: 1.2; font-family: var(--font-title); font-weight: 700; letter-spacing: -.01em; }
h2 { font-family: var(--font-title); font-weight: 600; font-size: 1.1rem; margin: 1.6rem 0 .6rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
h2 small, h1 small { color: var(--muted); font-weight: 400; font-size: .85rem; }
h3 { font-size: .98rem; margin: 1.1rem 0 .5rem; }
.h1b { margin-top: 2rem; }
p { margin: .4rem 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.lead { font-size: 1.1rem; font-weight: 500; margin: 0 0 .6rem; }
.ico { width: 22px; height: 22px; flex: none; }
.bad-t { color: var(--bad); }
.ok-t { color: var(--ok); }

/* ── Barra superior ── */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: .6rem; padding: .5rem max(12px, env(safe-area-inset-right, 0px)) .5rem max(12px, env(safe-area-inset-left, 0px)); background: var(--band); color: var(--band-text); }
.brand { display: flex; align-items: center; gap: .5rem; color: var(--band-text); font-weight: 600; }
.brand span { display: none; }
.logo { width: 32px; height: 32px; flex: none; color: #fff; --logo-bg: var(--band); }
.wordmark { font-family: var(--font-title); font-weight: 500; letter-spacing: -.01em; }
.wordmark b { font-weight: 700; }
.top-org { flex: 1; min-width: 0; }
.org-btn { background: none; border: 0; color: var(--band-text); font: inherit; font-weight: 600; text-align: left; padding: 0; cursor: pointer; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.org-btn small { display: block; font-weight: 400; opacity: .7; font-size: .75rem; }
.top-actions { display: flex; align-items: center; gap: .4rem; }
.icon-btn { position: relative; color: var(--band-text); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; }
.icon-btn .count { position: absolute; top: 2px; right: 0; background: var(--accent); color: var(--accent-ink); font-size: .7rem; border-radius: 9px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; }
.sync { font: inherit; font-size: .75rem; border-radius: 20px; padding: .25rem .6rem; border: 0; background: rgba(255, 255, 255, .12); color: var(--band-text); cursor: pointer; display: inline-flex; align-items: center; gap: .3rem; }
.sync .ico { width: 16px; height: 16px; }
.sync.ok { color: #7fe0a6; }
.sync.off, .sync.pend { background: var(--accent); color: var(--accent-ink); }
.sync.demo { background: rgba(201, 162, 39, .2); color: var(--accent); }
.banner { padding: .6rem 1rem; font-size: .9rem; }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.bad { background: var(--bad-bg); color: var(--bad); }

/* ── Estructura ── */
.layout { display: block; }
#main { padding: 1rem; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-bottom: calc(var(--tabbar-h) + 1.5rem + env(safe-area-inset-bottom) + var(--sello-h)); max-width: 1100px; margin: 0 auto; }
.sidenav { display: none; }
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: calc(env(safe-area-inset-bottom) + var(--sello-h)); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .5rem 0 .45rem; color: var(--muted); font-size: .7rem; min-height: var(--tabbar-h); justify-content: center; }
.tabbar a.on { color: var(--primary); font-weight: 600; }
@media (min-width: 900px) {
  .brand span { display: inline; }
  .layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 56px); }
  .sidenav { display: flex; flex-direction: column; gap: 2px; padding: 1rem .6rem; border-right: 1px solid var(--line); background: var(--surface); position: sticky; top: 56px; height: calc(100vh - 56px); }
  .sidenav a { display: flex; align-items: center; gap: .7rem; padding: .65rem .8rem; border-radius: 10px; color: var(--text); }
  .sidenav a.on { background: var(--info-bg); color: var(--primary); font-weight: 600; }
  .tabbar { display: none; }
  #main { padding: 1.5rem 2rem 3rem; width: 100%; }
}

/* ── Encabezado de página ── */
.page-head { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; flex-wrap: wrap; }
.page-head .back { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.ph-t { flex: 1; min-width: 0; }
.ph-t p { margin: .15rem 0 0; font-size: .9rem; }
.ph-a { display: flex; gap: .5rem; align-items: center; }

/* ── Tarjetas y mosaicos ── */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; margin-bottom: 1rem; }
.card > h3:first-child { margin-top: 0; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1rem; }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: .8rem .9rem; display: flex; flex-direction: column; gap: .15rem; color: var(--text); border-left: 4px solid transparent; min-width: 0; }
.tile span { color: var(--muted); font-size: .8rem; display: flex; align-items: center; gap: .3rem; }
.tile span .ico { width: 16px; height: 16px; }
.tile b { font-size: 1.35rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile small { color: var(--muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; }
.tile.wide { grid-column: 1 / -1; }
.tile.ok { border-left-color: var(--ok); } .tile.warn { border-left-color: var(--accent); } .tile.bad { border-left-color: var(--bad); }
.tile.bad b { color: var(--bad); }
.ac-block h2 a { color: var(--text); }

/* ── Listas ── */
.list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 1rem; }
.row { display: flex; align-items: center; gap: .75rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); color: var(--text); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; font: inherit; text-align: left; cursor: pointer; }
.list > .row:last-child { border-bottom: 0; }
.row > div:first-of-type { flex: 1; min-width: 0; }
.row b { display: block; font-weight: 500; }
.row small { display: block; color: var(--muted); font-size: .82rem; }
.row.off { opacity: .55; }
.r-end { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; flex: none; }
.menu .row .ico { color: var(--muted); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--info-bg); color: var(--info); display: grid; place-items: center; font-weight: 600; font-size: .85rem; flex: none; }
.row.audit .diff { margin-top: .3rem; font-size: .78rem; }
.row.audit code { font-family: var(--mono); background: var(--surface2); padding: 0 .3rem; border-radius: 4px; }
.doc-row { align-items: flex-start; cursor: default; }
.kvline { display: flex; justify-content: space-between; padding: .25rem 0; border-bottom: 1px dashed var(--line); font-size: .92rem; }

/* ── Alertas y estados ── */
.alerts { padding: .3rem 0; }
.alert-row { display: flex; align-items: center; gap: .6rem; padding: .6rem 1rem; color: var(--text); font-size: .93rem; }
.alert-row.bad .ico { color: var(--bad); } .alert-row.warn .ico { color: var(--warn); } .alert-row.info .ico { color: var(--info); }
.alerts .more { display: block; padding: .4rem 1rem .6rem; font-size: .9rem; }
.badge { display: inline-block; font-size: .74rem; font-weight: 600; padding: .18rem .55rem; border-radius: 20px; background: var(--surface2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); } .badge.info { background: var(--info-bg); color: var(--info); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--accent); } .dot.bad { background: var(--bad); }
.empty { text-align: center; padding: 1.2rem .5rem; color: var(--muted); }
.empty .btn { margin-top: .8rem; }

/* ── Contadores ── */
.counters { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.counter { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: .8rem .9rem; }
.c-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .85rem; }
.c-big { font-size: 1.3rem; font-weight: 600; margin: .2rem 0 .4rem; }
.counter.bad .c-big { color: var(--bad); } .counter.warn .c-big { color: var(--warn); }
.bar { height: 8px; border-radius: 4px; background: var(--surface2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ok); }
.counter.warn .bar i { background: var(--accent); } .counter.bad .bar i { background: var(--bad); }
.c-sub { color: var(--muted); font-size: .78rem; margin-top: .35rem; }

/* ── Botones ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 500; font-size: .95rem; padding: .6rem 1rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; min-height: 44px; text-align: center; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.danger { color: var(--bad); border-color: var(--bad); background: var(--surface); }
.btn.primary.danger { background: var(--bad); color: #fff; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.small { font-size: .82rem; padding: .3rem .7rem; min-height: 34px; }
.btn.big { min-height: 52px; font-size: 1rem; padding: .7rem 1.2rem; }
.btn.huge { width: 100%; min-height: 62px; font-size: 1.12rem; font-weight: 600; margin-bottom: .6rem; border-radius: 14px; }
.btn .ico { width: 20px; height: 20px; }
.row-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: .4rem 0 1rem; }
.row-actions:empty { display: none; }
.link { display: inline-block; margin-top: .6rem; font-size: .9rem; }
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar select { width: auto; }
.tabs { display: flex; gap: .3rem; overflow-x: auto; margin: -.2rem -1rem 1rem; padding: 0 1rem; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { white-space: nowrap; padding: .45rem .85rem; border-radius: 20px; color: var(--muted); background: var(--surface); font-size: .88rem; box-shadow: var(--shadow); }
.tabs a.on { background: var(--band); color: var(--band-text); }

/* ── Formularios ── */
.form { display: flex; flex-direction: column; gap: .2rem; }
.fld { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .6rem; min-width: 0; }
.fld > span { font-size: .84rem; color: var(--muted); font-weight: 500; }
.fld small { color: var(--muted); font-size: .78rem; }
input, select, textarea { font: inherit; font-size: 16px; width: 100%; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); min-height: 46px; }
textarea { resize: vertical; min-height: auto; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: transparent; }
input:disabled, select:disabled, textarea:disabled { background: var(--surface2); }
.big-num { font-family: var(--mono); font-size: 1.6rem; font-weight: 600; min-height: 60px; letter-spacing: .02em; }
.grid2, .grid3, .grid4 { display: grid; gap: 0 .6rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 600px) { .grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.grid2 > .btn { align-self: center; }
.chk { display: flex; align-items: center; gap: .5rem; padding: .35rem 0; cursor: pointer; }
.chk input { width: 22px; height: 22px; min-height: 0; flex: none; accent-color: var(--primary); }
.chk.big { font-weight: 500; }
.checks { border: 1px solid var(--line); border-radius: 10px; padding: .4rem .8rem .6rem; margin: 0 0 .7rem; }
.checks legend { font-size: .84rem; color: var(--muted); padding: 0 .3rem; }
.iv-row { border: 1px solid var(--line); border-radius: 10px; padding: .7rem .7rem .2rem; margin-bottom: .6rem; }
.grid-part { display: grid; grid-template-columns: 1fr 70px 100px 40px; gap: .4rem; margin-bottom: .4rem; }
.grid-part .btn { min-height: 46px; padding: 0; }
details { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; margin: .4rem 0 .8rem; }
details summary { cursor: pointer; font-weight: 500; }
details[open] summary { margin-bottom: .6rem; }
.hint-box { background: var(--info-bg); color: var(--info); border-radius: 10px; padding: .6rem .8rem; font-size: .9rem; margin-bottom: .7rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.opt { display: flex; gap: .6rem; align-items: center; padding: .6rem; border: 1px solid var(--line); border-radius: 10px; margin-bottom: .4rem; cursor: pointer; }
.opt input { width: 20px; min-height: 0; }
.opt small { display: block; color: var(--muted); }

/* ── Tablas ── */
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { padding: .45rem .3rem; border-bottom: 1px solid var(--line); text-align: right; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl td small { display: block; color: var(--muted); font-size: .76rem; }
.econ-t tr.tot td { border-top: 2px solid var(--line); font-weight: 600; }
.econ-t tr.big td { font-size: 1.1rem; border-bottom: 0; padding-top: .7rem; }
.econ-t tr.pos td:last-child { color: var(--ok); } .econ-t tr.neg td:last-child { color: var(--bad); }
.tbl td.up { color: var(--bad); } .tbl td.down { color: var(--ok); }
.q-price { display: flex; flex-direction: column; margin-bottom: .6rem; }
.q-price small { color: var(--muted); }
.q-price b { font-size: 2rem; font-weight: 700; }
.quote-grid { display: grid; gap: 0 1rem; }
@media (min-width: 900px) { .quote-grid { grid-template-columns: 1.2fr 1fr; align-items: start; } .quote-res { position: sticky; top: 72px; } }

/* ── Datos clave ── */
.kv { display: grid; grid-template-columns: auto 1fr; gap: .35rem .9rem; margin: 0; font-size: .93rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; }

/* ── Piloto ── */
.next-flight { border-top: 5px solid var(--accent); }
.nf-top { display: flex; justify-content: space-between; align-items: center; }
.nf-top b { font-family: var(--mono); }
.nf-route { font-size: 1.6rem; font-weight: 700; margin: .4rem 0 .8rem; letter-spacing: .01em; }
.nf-info { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; margin-bottom: 1rem; }
.nf-info > div { background: var(--surface2); border-radius: 10px; padding: .5rem; text-align: center; }
.nf-info span { display: block; font-size: .7rem; color: var(--muted); }
.nf-info b { font-size: 1rem; }
.nf-info .warn b { color: var(--warn); } .nf-info .bad b { color: var(--bad); }
.steps { display: flex; list-style: none; padding: 0; margin: 0 0 1rem; gap: 3px; counter-reset: s; }
.steps li { flex: 1; font-size: .62rem; text-align: center; color: var(--muted); padding-top: 9px; position: relative; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps li::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px; border-radius: 3px; background: var(--line); }
.steps li.done::before { background: var(--ok); } .steps li.on::before { background: var(--accent); }
.steps li.on { color: var(--text); font-weight: 600; }
@media (min-width: 600px) { .steps li { font-size: .78rem; } }
.wa-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .4rem; }
.wa-item { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.wa-name { font-weight: 500; margin-bottom: .4rem; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: .3rem; }
.seg button { font: inherit; font-size: .88rem; min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.seg button.on.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.seg button.on.obs { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.seg button.on.disc { background: var(--bad); border-color: var(--bad); color: #fff; }
.wa-note { margin-top: .5rem; }
.in-air { text-align: center; padding: 2rem 1rem; }
.air-ico .ico { width: 64px; height: 64px; color: var(--primary); }
.air-route { font-size: 1.8rem; font-weight: 700; margin: .5rem 0; }
.done-card { text-align: center; }
.big-check { width: 56px; height: 56px; color: var(--ok); }
.big-hours { font-size: 2.6rem; font-weight: 700; margin: .2rem 0 1rem; }
.done-card .kv { text-align: left; }
.leg-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }

/* ── Fotos ── */
.photos { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.ph { width: 72px; height: 72px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface2); padding: 0; cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph.noimg::after { content: "sin señal"; font-size: .65rem; }
.ph.add { flex-direction: column; font-size: .65rem; gap: 2px; text-align: center; border-style: dashed; }
.ph.add span { padding: 0 3px; line-height: 1.1; }
.ph.pdf { flex-direction: column; gap: 2px; font-size: .6rem; text-align: center; color: var(--text); }
.ph.pdf span { padding: 0 4px; line-height: 1.1; max-height: 2.2em; overflow: hidden; word-break: break-all; }
.doc-file { display: flex; flex-direction: column; gap: .4rem; padding: .7rem; margin-bottom: .8rem; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface2); }
.doc-file .btn { align-self: flex-start; }
.doc-file small.warn { color: var(--warn, #b26b00); font-weight: 600; }
.doc-file small.ok { color: var(--ok, #2e7d32); }
.fld.auto input, .fld.auto select { box-shadow: 0 0 0 2px var(--accent) inset; }
.mdocs { display: grid; gap: .6rem; }
.mdoc > b { display: block; font-size: .85rem; margin-bottom: .25rem; }
.photo-full { width: 100%; border-radius: 10px; }

/* ── Línea de tiempo ── */
.timeline { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: .3rem 0; margin-bottom: 1rem; }
.tl { display: flex; gap: .7rem; align-items: center; padding: .55rem 1rem; color: var(--text); }
.tl .ico { color: var(--muted); }
.tl b { font-weight: 500; display: block; font-size: .93rem; }
.tl small { color: var(--muted); font-size: .8rem; }

/* ── Ingreso ── */
.gate { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.2rem; background: linear-gradient(160deg, var(--band) 0%, #1C3D6E 100%); }
.gate-card { background: var(--surface); border-radius: 20px; padding: 1.6rem 1.3rem; width: 100%; max-width: 440px; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
.gate-card .logo { width: 56px; height: 56px; color: var(--brand); --logo-bg: var(--surface); }
.gate-card h1.wordmark { font-size: 1.7rem; margin-bottom: 0; }
.gate-tag { margin: 0 0 1rem; font-size: .72rem; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); }
.gate-card h1 { margin: .5rem 0 .6rem; }
.gate-foot { color: rgba(255, 255, 255, .5); font-size: .75rem; }
.role-pick { display: flex; flex-direction: column; gap: .5rem; margin: .6rem 0 1rem; }
.role { display: flex; gap: .8rem; align-items: center; text-align: left; font: inherit; padding: .8rem; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.role:hover { border-color: var(--primary); }
.role .ico { width: 30px; height: 30px; color: var(--primary); }
.role small { display: block; color: var(--muted); font-size: .8rem; }
.invite { white-space: pre-wrap; background: var(--surface2); padding: .8rem; border-radius: 10px; font: .88rem/1.45 var(--font); }

/* ── Modal y avisos ── */
.modal-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(5, 12, 25, .55); display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--surface); width: 100%; max-width: 520px; max-height: 92vh; display: flex; flex-direction: column; border-radius: 18px 18px 0 0; padding: 1.1rem 1rem calc(1rem + env(safe-area-inset-bottom) + var(--sello-h)); }
.modal.wide { max-width: 860px; }
.modal h3 { margin: 0 0 .7rem; font-size: 1.1rem; }
.modal-body { overflow-y: auto; flex: 1; }
.modal-actions { display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; padding-top: .8rem; }
.modal-actions .btn { flex: 1; }
@media (min-width: 600px) { .modal-wrap { align-items: center; } .modal { border-radius: 18px; } .modal-actions .btn { flex: none; } }
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom) + var(--sello-h)); z-index: 60; display: flex; flex-direction: column; gap: .4rem; width: max-content; max-width: 92vw; }
.toast { background: var(--band); color: var(--band-text); padding: .65rem 1rem; border-radius: 12px; font-size: .92rem; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); transition: opacity .4s, transform .4s; }
.toast.ok { background: var(--ok); color: #fff; } .toast.bad { background: var(--bad); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ── Impresión (informe) ── */
@media print {
  .topbar, .tabbar, .sidenav, .banner, .page-head .back, .ph-a, .toolbar, .row-actions { display: none !important; }
  body { background: #fff; color: #000; }
  #main { padding: 0; }
  .card, .tile, .list { box-shadow: none; border: 1px solid #ccc; }
}

/* El plan gratis de Netlify pone su sello fijo abajo a la derecha: se le deja una franja para que no tape botones */
html.con-sello { --sello-h: 64px; }

/* Tablero AVIATES */
.aviates { padding: .3rem .9rem .7rem; }
.av-row { display: grid; grid-template-columns: 2.2rem 1fr auto; gap: .7rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.av-row:last-of-type { border-bottom: 0; }
.av-row small { display: block; color: var(--muted); font-size: .78rem; line-height: 1.3; }
.av-l { width: 2.2rem; height: 2.2rem; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 1.1rem; color: #fff; background: var(--muted); }
.av-row.ok .av-l { background: var(--ok); } .av-row.warn .av-l { background: var(--accent); } .av-row.bad .av-l { background: var(--bad); }
.av-row.na { opacity: .55; }
.av-st { font-size: .78rem; color: var(--muted); white-space: nowrap; display: flex; align-items: center; gap: .3rem; }

/* Armado de piernas */
.legplan { border: 1px solid var(--line); border-radius: 12px; padding: .8rem; margin: .4rem 0 .8rem; background: var(--surface2); }
.legplan h3 { margin-top: 0; }
.lp-stops { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin: .5rem 0; }
.lp-chip { font-family: var(--mono, monospace); font-weight: 700; padding: .25rem .55rem; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); }
.lp-arrow { color: var(--muted); }
.lp-sug { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .5rem; }
.lp-sug small { color: var(--muted); font-weight: 400; }
.lp-add { display: flex; gap: .5rem; margin-bottom: .6rem; }
.lp-add input { flex: 1; min-width: 0; }
#lp-plan { overflow-x: auto; }
.lp-t { font-size: .8rem; }
.lp-t th, .lp-t td { padding: .35rem .2rem; }
.lp-t th { font-size: .72rem; color: var(--muted); font-weight: 600; }
.lp-t td small { display: block; color: var(--muted); font-size: .7rem; }
.legplan { padding: .7rem .6rem; }
.lp-cost { margin-top: .6rem; }

/* Cobro */
.cobro-h { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.cobro-h h3 { margin: 0; }
.cobro-card h4 { margin: .6rem 0 .3rem; font-size: .85rem; }
.warn-t { color: var(--warn); }
/* waypoints */
.lp-chip.paso { font-weight: 400; border-style: dashed; color: var(--muted); }
.lp-go.wp { border-style: dashed; }
.sec-h { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: 1.1rem 0 .5rem; }
.sec-h h3 { margin: 0; }
.rpts { display: grid; gap: .45rem; margin: .4rem 0; }
.rpt { display: grid; grid-template-columns: 3.4rem 1fr 5.2rem 2.3rem; gap: .4rem; align-items: center; position: relative; }
.rpt-n { font-size: .8rem; color: var(--muted); text-align: right; }
.rpt-k { text-transform: uppercase; }
.rpt-h { position: absolute; right: 2.6rem; bottom: -.95rem; font-size: .7rem; color: var(--muted); }
.rpt-x { padding: .3rem .55rem; }
.rtot { margin: .5rem 0 .2rem; }
.lp-leg { display: flex; align-items: center; gap: .35rem; width: 100%; }
.lp-n { min-width: 1.4rem; font-size: .8rem; color: var(--muted); text-align: right; }
/* aviso de versión nueva y novedades */
.upd-bar { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom) + var(--sello-h)); z-index: 60; display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .6rem .8rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.news p { margin: 0 0 .8rem; line-height: 1.4; }
/* combustible por ala */
.fuelw .fw-alas { margin: 0; gap: .5rem; }
.fuelw .fw-alas label { display: grid; gap: .2rem; }
.fuelw .fw-chk { display: inline-flex; gap: .3rem; align-items: center; }
/* presupuesto: costos internos plegados */
.q-int { margin-top: .8rem; border-top: 1px solid var(--line); padding-top: .6rem; }
.q-int summary { cursor: pointer; font-weight: 600; }
.q-int summary small { font-weight: 400; color: var(--muted); }
.bal-l .neg { color: var(--bad); } .bal-l .pos { color: var(--ok); }
.bal-l .row:last-child b { font-weight: 700; }
.toolbar input[type=month] { font: inherit; min-height: 40px; padding: 0 .5rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); }
.h2-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.leg-full h3 { margin-top: 1.2rem; } .leg-full h3:first-child { margin-top: 0; }
.pf-item { border-top: 1px solid var(--line); padding: .5rem 0; } .pf-item p { margin: .2rem 0; }
.pf-photos { margin-top: .4rem; }
.fl-row .row { padding: 0; box-shadow: none; background: none; }
/* Ayuda y soporte */
.banner.info { background: var(--info-bg); color: var(--info); }
.view-b { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.view-b .btn { flex: none; }
details.faq { border-top: 1px solid var(--line); padding: .55rem 0; }
details.faq:first-child { border-top: 0; }
details.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: .5rem; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; }
details.faq[open] summary::after { content: "–"; }
details.faq p { margin: .4rem 0 0; color: var(--muted); }
#faqList { margin: .4rem 0 .8rem; }
.row.ticket { align-items: flex-start; }
.t-reply { display: flex; gap: .4rem; margin: .45rem 0 0; padding: .5rem .6rem; border-radius: 10px; background: var(--info-bg); color: var(--text); font-size: .9rem; }
.t-reply .ico { flex: none; color: var(--info); width: 18px; height: 18px; }

/* Cómo empezar (cuentas nuevas) */
.guide .guide-h { display: flex; justify-content: space-between; align-items: baseline; }
.guide .row { gap: 10px; }
.guide .row.off b { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.guide .row svg { color: var(--ok, #1E8E5A); flex: none; }
.guide .step-dot { width: 16px; height: 16px; border: 2px solid var(--accent); border-radius: 50%; flex: none; }
.guide > .btn { margin-top: 8px; }
.banner .btn.small { margin-left: 6px; vertical-align: middle; }

/* Foto de perfil del avión */
.ac-pic { display: inline-grid; place-items: center; flex: none; overflow: hidden; border-radius: 10px; background: var(--surface2); border: 1px solid var(--line); color: var(--muted); vertical-align: middle; }
.ac-pic.sm { width: 44px; height: 44px; }
.ac-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ac-pic svg { width: 22px; height: 22px; }
.ac-row { gap: 12px; }
.ac-row > div:first-of-type { flex: 1; min-width: 0; }
.ac-block h2 a { display: inline-flex; align-items: center; gap: 10px; }
.ac-block h2 .ac-pic.sm { width: 36px; height: 36px; border-radius: 8px; }
.ac-hero { position: relative; border-radius: 14px; overflow: hidden; margin: 0 0 16px; background: var(--surface2); border: 1px solid var(--line); }
.ac-hero img { display: block; width: 100%; height: clamp(160px, 32vw, 280px); object-fit: cover; }
.ac-hero-a { position: absolute; right: 10px; bottom: 10px; }
.ac-hero-a .btn { background: rgba(255,255,255,.92); }
.ac-hero.none { display: grid; justify-items: center; gap: 8px; padding: 22px 16px; text-align: center; color: var(--muted); border-style: dashed; }
.ac-hero.none > svg { width: 34px; height: 34px; }
.ac-hero.noimg img, .ac-pic.noimg img { visibility: hidden; }
/* Avisos de dónde está el avión (en vuelo, aterrizado, base) */
.pills { display: inline-flex; flex-wrap: wrap; gap: .3rem; vertical-align: middle; }
.ac-block h2 .pills { margin-left: .4rem; font-weight: 400; }
.alert-row .pills { margin-left: .2rem; }
.alert-row.live .ico { color: var(--warn); }
.r-end .pills { justify-content: flex-end; }
.ac-where { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .2rem 0 .8rem; }
.nf-top + .pills { margin: .3rem 0 .2rem; }
.gate-first { background: var(--warn-bg, #fdf3d7); border-radius: 10px; padding: .6rem .8rem; margin: .2rem 0 .6rem; }
