/* Alpha Sierra Air — base compartida (Gestión, Tripulación, Cliente) */
:root {
  --navy: #1F3A5F; --navy-2: #17304F; --navy-3: #0F2238;
  --steel: #A7B8C6; --slate: #6F8291; --ink: #1B2733; --mut: #5E6E7C; --line: #E1E7EC; --line-2: #EDF1F4;
  --bg: #F3F5F7; --card: #FFFFFF; --soft: #F7F9FA;
  --blue: #2F6FD0; --green: #1E8A5A; --amber: #B7791F; --orange: #C8641E; --red: #C2382F; --violet: #6A4FC2; --teal: #157A86; --grey: #7B8794;
  --r: 10px; --sh: 0 1px 2px rgba(16, 34, 56, .06), 0 4px 16px rgba(16, 34, 56, .05);
  --f-h: 'Archivo', 'Inter', system-ui, sans-serif; --f-b: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.45 var(--f-b); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
body.noscroll { overflow: hidden; }
h1, h2, h3, h4 { font-family: var(--f-h); margin: 0; letter-spacing: -.01em; color: var(--navy-3); }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
.tnum { font-variant-numeric: tabular-nums; }
.mut { color: var(--mut); }
.small { font-size: 12px; }
.ic { width: 18px; height: 18px; flex: none; }
.row { display: flex; align-items: center; gap: 8px; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.gap { gap: 10px; }
.sp { flex: 1; }
.hide { display: none !important; }

/* botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 8px; font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; text-decoration: none; }
.btn:hover { background: var(--soft); border-color: #cfd8df; }
.btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn.primary:hover { background: var(--navy-2); }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.danger { color: var(--red); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(31, 58, 95, .06); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn .ic { width: 16px; height: 16px; }

/* formularios */
label.f, div.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--mut); }
.inp, select.inp, textarea.inp { width: 100%; border: 1px solid #d3dbe2; background: #fff; border-radius: 8px; padding: 8px 10px; font-size: 14px; color: var(--ink); font-weight: 400; }
.inp:focus { outline: 2px solid rgba(47, 111, 208, .25); border-color: var(--blue); }
textarea.inp { resize: vertical; min-height: 70px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: #EEF2F5; color: var(--grey); }
.badge.blue { background: #E7F0FC; color: var(--blue); } .badge.green { background: #E3F4EC; color: var(--green); }
.badge.amber { background: #FBF1DE; color: var(--amber); } .badge.orange { background: #FCEBDD; color: var(--orange); }
.badge.red { background: #FBE6E4; color: var(--red); } .badge.violet { background: #EEEAFB; color: var(--violet); }
.badge.teal { background: #E0F2F3; color: var(--teal); } .badge.navy { background: var(--navy); color: #fff; }

/* tarjetas */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); }
.card > .hd { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.card > .hd h3 { font-size: 15px; }
.card > .bd { padding: 14px 16px; }
.empty { padding: 28px 16px; text-align: center; color: var(--mut); }

/* tablas */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--mut); font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--soft); position: sticky; top: 0; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: #F6F9FC; }
.tbl .r { text-align: right; } .tbl tfoot td { font-weight: 700; background: var(--soft); }
.tblw { overflow-x: auto; }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(12, 26, 44, .45); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; z-index: 60; overflow-y: auto; animation: fade .15s; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 520px; padding: 22px; position: relative; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal.wide { max-width: 980px; }
.modal h3 { font-size: 18px; margin-bottom: 14px; padding-right: 30px; }
.modal .x { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border: 0; background: var(--soft); border-radius: 8px; font-size: 20px; line-height: 1; cursor: pointer; color: var(--mut); }
.modal .foot { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-2); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* toasts */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 90; pointer-events: none; }
.toast { background: var(--navy-3); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 500; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); transition: opacity .4s, transform .4s; max-width: 90vw; }
.toast.ok { background: var(--green); } .toast.err { background: var(--red); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* comprobantes */
.rcpt { width: 64px; height: 80px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line); background: #fff; flex: none; }
.rcpt.demo { display: flex; flex-direction: column; justify-content: space-between; padding: 6px; font-size: 8px; line-height: 1.2; background: repeating-linear-gradient(180deg, #fff 0 9px, #f2f4f6 9px 10px); color: #334; }
.rcpt.demo b { font-size: 8.5px; } .rcpt.demo span { font-weight: 700; font-size: 10px; } .rcpt.demo i { color: #889; font-style: normal; }
.rcpt.none { display: flex; align-items: center; justify-content: center; text-align: center; font-size: 10px; color: var(--red); background: #FDF3F2; border-style: dashed; border-color: #f0b8b3; padding: 4px; }
.rcpt-big { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; border-radius: 8px; }

/* bitácora */
.log { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 84%; padding: 8px 12px; border-radius: 12px; background: var(--soft); border: 1px solid var(--line-2); }
.msg.me { align-self: flex-end; background: #E9F0FA; border-color: #d5e2f4; }
.msg.sys { align-self: center; background: transparent; border: 0; color: var(--mut); font-size: 12px; text-align: center; padding: 2px; }
.msg .w { font-size: 11px; font-weight: 700; color: var(--navy); margin-bottom: 2px; display: flex; gap: 6px; align-items: center; }
.msg .w time { font-weight: 500; color: var(--mut); }
.msg.pre { border-left: 3px solid var(--violet); } .msg.pay { border-left: 3px solid var(--orange); } .msg.exp { border-left: 3px solid var(--teal); }

.demo-bar { background: var(--navy-3); color: #cfd9e3; font-size: 12px; padding: 6px 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.demo-bar a { color: #fff; font-weight: 600; text-decoration: none; }
.demo-bar a:hover { text-decoration: underline; }
.demo-bar .sp { flex: 1; }
.demo-bar button { background: transparent; border: 1px solid rgba(255, 255, 255, .25); color: #fff; border-radius: 6px; padding: 2px 8px; font-size: 11.5px; cursor: pointer; }

@media (max-width: 720px) { .grid2, .grid3, .grid4 { grid-template-columns: 1fr; } .modal { padding: 18px 16px; } }
@media print { .demo-bar, .no-print { display: none !important; } }
.msg.rmk { border-left: 3px solid var(--red); }
.rcpt.meter { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: radial-gradient(circle at 50% 40%, #3a3f45, #16191c); border-color: #222; color: #cfd6dc; }
.rcpt.meter span { font-size: 7px; letter-spacing: .2em; }
.rcpt.meter b { font: 700 11px ui-monospace, monospace; background: #050607; color: #f2f2f2; padding: 3px 4px; border-radius: 2px; letter-spacing: .06em; }
.rcpt.meter b i { font-style: normal; background: #f2f2f2; color: #111; margin-left: 2px; padding: 0 2px; }
.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; margin-right: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }
.note .ic { width: 15px; height: 15px; vertical-align: -3px; }
.note { background: #FFF8EA; border: 1px solid #F1DFB8; color: #7A5715; border-radius: 8px; padding: 8px 12px; font-size: 12.5px; }
.note.blue { background: #EEF4FD; border-color: #D3E2F7; color: #284E84; }
.note.red { background: #FDF0EF; border-color: #F3CBC7; color: #8E2A22; }

/* ---------- acceso (las tres apps) ---------- */
body.authing { overflow: hidden; }
.auth { position: fixed; inset: 0; z-index: 200; background: linear-gradient(160deg, #F3F6F9 0%, #E3EAF1 100%); overflow-y: auto; display: flex; justify-content: center; align-items: flex-start; padding: 7vh 16px 40px; }
.auth-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 40px rgba(15, 34, 56, .1); padding: 28px 24px; display: flex; flex-direction: column; gap: 14px; }
.auth-card .logo { width: 100%; color: var(--slate, #5B6B7B); margin-bottom: 4px; }
.auth-card h1 { font-size: 22px; margin: 0; }
.auth-card p { margin: 0; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; }
.auth-card .btn.big { width: 100%; justify-content: center; }
.auth-card .hint { display: block; font-size: 12px; color: var(--mut); font-weight: 400; margin-top: 4px; }
.auth-card .inp.code { font: 700 20px var(--f-h); letter-spacing: .12em; text-align: center; text-transform: uppercase; }
.auth-card .ck { border: 0; padding: 4px 0; display: flex; gap: 10px; align-items: center; font-size: 14px; cursor: pointer; }
.auth-or { display: flex; align-items: center; gap: 10px; color: #8A97A6; font-size: 13px; margin: 14px 0 4px; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: #E3E8EE; }
.auth-err { color: #B42318; background: #FEF3F2; border: 1px solid #FECDCA; border-radius: 8px; padding: 9px 12px; font-size: 14px; }
.auth-err[hidden] { display: none; }
.linkbtn { background: none; border: 0; color: var(--navy); font-weight: 600; font-size: 14px; cursor: pointer; padding: 4px; text-decoration: underline; text-underline-offset: 3px; }
.auth .qr { width: 210px; margin: 0 auto; } .auth .qr svg { width: 100%; height: auto; display: block; }
.auth .secret { font: 600 14px ui-monospace, Menlo, monospace; word-break: break-all; }
.auth pre.rec { font: 600 16px ui-monospace, Menlo, monospace; background: #F3F6F9; border: 1px solid var(--line); border-radius: 10px; padding: 14px; text-align: center; line-height: 1.7; margin: 0; user-select: all; }
.auth-load { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 20px 0; }
.btn.loading { opacity: .6; pointer-events: none; }
.av { display: inline-grid; place-items: center; border-radius: 50%; background: #DCE5EE; color: var(--navy); font-weight: 700; overflow: hidden; flex: none; } .av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av.lg { width: 34px; height: 34px; font-size: 12px; } .av.xl { width: 72px; height: 72px; font-size: 22px; } .av.me { width: 34px; height: 34px; border: 2px solid rgba(255,255,255,.5); }

/* ---------- encuesta de satisfacción (portal y /encuesta) ---------- */
.svy { display: flex; flex-direction: column; gap: 16px; }
.svq > b { display: block; font-size: 15px; color: var(--ink); margin-bottom: 10px; line-height: 1.35; }
.svq .opt { color: var(--mut); font-weight: 400; }
.npsrow { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; }
.npsrow button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 10px 0; font: 700 14px var(--f-b); color: var(--ink); cursor: pointer; min-width: 0; }
.npsrow button.on.detractor { background: #FDECEA; border-color: var(--red); color: var(--red); }
.npsrow button.on.pasivo { background: #FDF3E1; border-color: var(--amber); color: var(--amber); }
.npsrow button.on.promotor { background: #E6F4EC; border-color: var(--green); color: var(--green); }
.npslbl { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--mut); margin-top: 4px; }
.asp { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.asp > div:first-child { flex: 1 1 170px; }
.asp span { font-size: 14px; } .asp small { display: block; font-size: 12px; color: var(--mut); }
.stars { display: flex; align-items: center; gap: 2px; flex: none; }
.stars button { background: none; border: 0; font-size: 24px; line-height: 1; color: #D3DAE1; cursor: pointer; padding: 2px; }
.stars button.on { color: #E3A008; }
.stars button.na { font-size: 11px; color: var(--mut); border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px; margin-left: 4px; }
.stars button.na.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.svy-err { color: #B42318; background: #FEF3F2; border: 1px solid #FECDCA; border-radius: 8px; padding: 9px 12px; font-size: 14px; margin: 0; }
.svy-err[hidden] { display: none; }
.svy .ck { border: 0; padding: 2px 0; }
.svpage { min-height: 100vh; display: flex; justify-content: center; padding: 24px 14px 40px; background: var(--bg); }
.svcard { width: 100%; max-width: 520px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px 20px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 8px 30px rgba(15, 34, 56, .08); align-self: flex-start; }
.svcard .logo { width: 220px; color: var(--slate, #5B6B7B); margin-bottom: 8px; }
.svcard h1 { font-size: 21px; margin: 0; } .svcard p { margin: 0; }
@media (max-width: 420px) { .npsrow { gap: 3px; } .npsrow button { padding: 9px 0; font-size: 13px; border-radius: 6px; } .svcard { padding: 20px 14px; } .svpage { padding: 12px 10px 32px; } }
.note.green { background: #EAF6EF; border-color: #BFE3CD; color: #1B5E3A; }

/* iOS amplía la página al enfocar campos de menos de 16 px y la deja desplazada: en pantallas chicas, 16 px. */
@media (max-width: 760px) { input.inp, select.inp, textarea.inp, .auth input, .auth select { font-size: 16px; } }

/* búsqueda mundial de aeropuertos */
#apr.aptres { margin-top: 8px; max-height: 340px; overflow-y: auto; }
.apthit { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line, #E3E8EE); padding: 9px 4px; font: inherit; color: inherit; cursor: pointer; }
button.apthit:hover { background: #F4F7FA; }

/* campo de aeropuerto con filtro */
.apin { min-width: 0; text-overflow: ellipsis; }
.apdrop { position: fixed; z-index: 200; background: #fff; border: 1px solid #d3dbe2; border-radius: 10px; box-shadow: 0 12px 32px rgba(12, 26, 44, .18); overflow-y: auto; padding: 4px; }
.apopt { padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; line-height: 1.35; }
.apopt.on, .apopt:hover { background: #EEF3F8; }
select[data-apx][hidden] { display: none !important; }
@media (min-width: 900px) { .apopt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 7px 10px; } }
/* búsqueda de aeropuerto en el teléfono: pantalla completa */
.apsheet { position: fixed; inset: 0; z-index: 300; background: #fff; display: flex; flex-direction: column; }
.aps-top { display: flex; gap: 10px; align-items: center; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; border-bottom: 1px solid #E3E8EE; }
.aps-top .inp { flex: 1; font-size: 16px; }
.aps-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: env(safe-area-inset-bottom); }
.aps-h { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #8A97A6; padding: 12px 16px 4px; }
.aps-row { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid #EEF2F5; padding: 12px 16px; font: inherit; font-size: 15px; color: inherit; line-height: 1.35; }
.aps-row .small { display: block; margin-top: 2px; }
.aps-row:active { background: #EEF3F8; }
.apin[readonly] { cursor: pointer; background: #fff; }

/* «Con tecnología de Wilco»: la marca de la plataforma, discreta; la principal sigue siendo Alpha Sierra */
.powered { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 11px; color: #8A96A3; }
.powered img { height: 14px; width: auto; display: block; }
.powered.side { justify-content: flex-start; margin: 8px 12px 2px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .07); color: #6F849A; }
.powered.side img { height: 12px; opacity: .85; }
/* Demo: un botón por rol en la pantalla de entrada */
.demo-roles { display: grid; gap: 10px; }
.demo-roles .btn { flex-direction: column; align-items: flex-start; text-align: left; gap: 2px; height: auto; padding: 12px 16px; }
.demo-roles .btn span { font-weight: 500; font-size: 12.5px; opacity: .75; }
.demo-roles .btn { width: 100%; box-sizing: border-box; white-space: normal; }
/* Logo de Wilco en la demo: alto fijo, color de marca */
svg.wilco.logo { width: auto; height: 46px; max-width: 100%; color: #0F2238; align-self: flex-start; }
#brandLogo svg.wilco.logo { height: 30px; color: #fff; }
svg.wilco.mark { color: #fff; }
