/* 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 { 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; }
