/* AireXtremo — estilos propios sobre Bootstrap 5.3 */
:root {
  --ax-ink: #0B1220;
  --ax-navy: #0E1A33;
  --ax-blue: #1F6FEB;
  --ax-blue-2: #2E8BFF;
  --ax-sky: #62B6FF;
  --ax-bg: #F3F6FB;
  --ax-line: #E3E9F2;
  --ax-muted: #64748B;
  --ax-radius: 14px;
  --bs-primary: #1F6FEB;
  --bs-primary-rgb: 31, 111, 235;
  --bs-link-color: #1F6FEB;
  --bs-link-color-rgb: 31, 111, 235;
  --bs-body-bg: #F3F6FB;
  --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-border-color: #E3E9F2;
}
body { background: var(--ax-bg); color: #0F172A; }
.btn-primary { --bs-btn-bg: var(--ax-blue); --bs-btn-border-color: var(--ax-blue); --bs-btn-hover-bg: #195ed0; --bs-btn-hover-border-color: #195ed0; --bs-btn-active-bg: #1552b8; }
.btn-outline-primary { --bs-btn-color: var(--ax-blue); --bs-btn-border-color: var(--ax-blue); --bs-btn-hover-bg: var(--ax-blue); --bs-btn-hover-border-color: var(--ax-blue); }
.btn { border-radius: 10px; font-weight: 600; }
.btn-lg { border-radius: 14px; min-height: 52px; }
.form-control, .form-select { border-radius: 10px; min-height: 44px; }
textarea.form-control { min-height: 80px; }
.form-label { font-weight: 600; font-size: .875rem; color: #334155; margin-bottom: .3rem; }
.card { border: 1px solid var(--ax-line); border-radius: var(--ax-radius); box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.card-header { background: transparent; border-bottom: 1px solid var(--ax-line); font-weight: 700; }
.table { --bs-table-bg: transparent; font-size: .92rem; }
.table thead th { color: var(--ax-muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; border-bottom-width: 1px; white-space: nowrap; }
.table-hover tbody tr { cursor: default; }
.text-muted { color: var(--ax-muted) !important; }
.label-sec { font-size: .75rem; font-weight: 700; color: var(--ax-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: .4rem; }
.req::after { content: " *"; color: #DC2626; }

/* ---------- Estados ---------- */
.badge-estado { font-size: .72rem; font-weight: 700; padding: .32em .7em; border-radius: 99px; white-space: nowrap; display: inline-block; }
.st-programado { background: #EEF2F7; color: #475569; }
.st-asignado, .st-reprogramado { background: #E0EDFF; color: #1D4ED8; }
.st-en_proceso { background: #FEF3C7; color: #92400E; }
.st-pendiente_repuesto { background: #FFE4E6; color: #9F1239; }
.st-pendiente_aprobacion { background: #EDE9FE; color: #5B21B6; }
.st-ejecutado { background: #CCFBF1; color: #115E59; }
.st-cerrado { background: #DCFCE7; color: #166534; }
.st-cancelado { background: #F1F5F9; color: #94A3B8; text-decoration: line-through; }
.st-atrasado { background: #FEE2E2; color: #B91C1C; }
.pri-urgente { color: #B91C1C; } .pri-alta { color: #C2410C; } .pri-media { color: #1D4ED8; } .pri-baja { color: #64748B; }

/* ---------- Layout escritorio ---------- */
.layout-app { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 236px; background: var(--ax-ink); color: #C8D5EA; flex-direction: column; padding: 16px 12px; z-index: 1030; }
.side-brand img { height: 40px; margin: 2px 6px 18px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-link { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: #C8D5EA; text-decoration: none; font-size: .93rem; }
.side-link i { font-size: 1.1rem; width: 20px; text-align: center; }
.side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-link.active { background: var(--ax-blue); color: #fff; }
.side-group { font-size: .68rem; letter-spacing: .1em; color: #6B7FA3; margin: 16px 12px 4px; }
.side-foot { margin-top: auto; font-size: .72rem; color: #4B5E80; padding: 0 12px; }
.sidebar-off { background: var(--ax-ink); color: #C8D5EA; max-width: 280px; }
.main-wrap { min-height: 100vh; }
@media (min-width: 992px) { .main-wrap { margin-left: 236px; } }
.topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: 10px; padding: 10px 20px; background: rgba(243, 246, 251, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--ax-line); }
.topbar-title { font-weight: 700; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-icon { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; font-size: 1.25rem; color: #334155; background: transparent; border: 0; padding: 0; }
.btn-icon:hover { background: #E6ECF5; }
.btn-user { display: inline-flex; align-items: center; gap: 8px; background: transparent; border: 0; font-weight: 600; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ax-navy); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; }
.badge-dot { position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: #DC2626; border: 2px solid #fff; }
.content-area { padding: 20px; max-width: 1400px; }
@media (max-width: 575px) { .content-area { padding: 14px 12px; } .topbar { padding: 8px 12px; } }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { font-size: 1.4rem; margin: 0; font-weight: 700; }
.net-status { font-size: .78rem; background: #FEF3C7; color: #92400E; padding: 4px 10px; border-radius: 99px; }

/* KPI */
.kpi { background: #fff; border: 1px solid var(--ax-line); border-radius: var(--ax-radius); padding: 14px 16px; height: 100%; display: block; color: inherit; text-decoration: none; }
a.kpi:hover { border-color: #BCD0F0; }
.kpi small { color: var(--ax-muted); font-size: .8rem; }
.kpi b { display: block; font-size: 1.7rem; line-height: 1.2; margin-top: 2px; }
.kpi.bad b { color: #DC2626; } .kpi.warn b { color: #D97706; } .kpi.ok b { color: #16A34A; }
.alert-row { display: flex; gap: 10px; padding: 10px 12px; border-radius: 12px; font-size: .9rem; margin-bottom: 8px; text-decoration: none; }
.alert-row i { font-size: 1.15rem; }
.alert-row.red { background: #FEF2F2; color: #991B1B; } .alert-row.amber { background: #FFFBEB; color: #92400E; } .alert-row.blue { background: #EFF6FF; color: #1E40AF; } .alert-row.violet { background: #F5F3FF; color: #5B21B6; }
.bar-row { display: flex; align-items: center; gap: 8px; font-size: .88rem; margin: 6px 0; }
.bar-row span:first-child { width: 120px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row em { height: 10px; background: var(--ax-blue); border-radius: 6px; display: block; min-width: 4px; }

/* Ficha */
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 20px; }
.dl-grid div small { display: block; color: var(--ax-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; }
.dl-grid div span { font-weight: 500; word-break: break-word; }
.nav-tabs .nav-link { font-weight: 600; color: #475569; }
.nav-tabs .nav-link.active { color: var(--ax-blue); }
.timeline { border-left: 2px solid var(--ax-line); padding-left: 16px; margin-left: 6px; }
.timeline .tl-item { position: relative; padding-bottom: 14px; }
.timeline .tl-item::before { content: ""; position: absolute; left: -22px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--ax-blue); border: 2px solid #fff; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.photo-grid a, .photo-grid .ph { position: relative; display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #DCE5F2; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; }
.photo-grid em { position: absolute; left: 4px; bottom: 4px; font-style: normal; font-size: .65rem; font-weight: 700; color: #fff; background: rgba(15, 23, 42, .72); padding: 2px 6px; border-radius: 6px; max-width: calc(100% - 8px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Login ---------- */
.layout-auth { min-height: 100vh; background: radial-gradient(circle at 50% 0%, #10264d 0%, var(--ax-ink) 60%); display: flex; align-items: center; justify-content: center; padding: 20px 16px; }
.auth-box { width: 100%; max-width: 400px; }
.auth-logo { text-align: center; margin-bottom: 18px; }
.auth-logo img { max-width: 260px; width: 80%; }
.auth-card { background: #fff; border-radius: 18px; padding: 24px 22px; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
.auth-foot { text-align: center; color: #7F93B5; font-size: .8rem; margin-top: 14px; }

/* ---------- Técnico (móvil) ---------- */
.layout-tec { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
.layout-tec.no-nav { padding-bottom: 20px; }
.tec-top { background: linear-gradient(135deg, var(--ax-ink), var(--ax-navy)); color: #fff; padding: calc(10px + env(safe-area-inset-top)) 16px 14px; position: sticky; top: 0; z-index: 1020; }
.tec-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 34px; }
.tec-logo { height: 30px; }
.tec-back { color: #fff; text-decoration: none; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tec-top h1 { font-size: 1.2rem; margin: 10px 0 2px; font-weight: 700; }
.tec-top small { color: #9FB3D1; }
.sync-pill { font-size: .72rem; padding: 3px 9px; border-radius: 99px; background: rgba(22, 163, 74, .2); color: #86EFAC; white-space: nowrap; }
.sync-pill.off { background: rgba(217, 119, 6, .25); color: #FCD34D; }
.sync-pill.busy { background: rgba(98, 182, 255, .2); color: #BFE0FF; }
.tec-content { padding: 14px; max-width: 720px; margin: 0 auto; }
.tec-nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: #fff; border-top: 1px solid var(--ax-line); padding-bottom: env(safe-area-inset-bottom); z-index: 1030; }
.tec-nav a { flex: 1; text-align: center; padding: 8px 0 10px; font-size: .7rem; color: var(--ax-muted); text-decoration: none; position: relative; }
.tec-nav a i { display: block; font-size: 1.35rem; }
.tec-nav a.on { color: var(--ax-blue); font-weight: 700; }
.tec-nav .badge-dot { top: 6px; right: calc(50% - 16px); }
.tabs-scroll { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 2px; scrollbar-width: none; }
.tabs-scroll a { flex: none; padding: 8px 13px; border-radius: 99px; background: #fff; border: 1px solid var(--ax-line); font-size: .85rem; font-weight: 600; color: #334155; text-decoration: none; }
.tabs-scroll a.on { background: var(--ax-blue); color: #fff; border-color: var(--ax-blue); }
.tabs-scroll a b { background: rgba(0, 0, 0, .1); padding: 0 7px; border-radius: 99px; margin-left: 4px; font-size: .78rem; }
.svc-card { display: block; background: #fff; border: 1px solid var(--ax-line); border-left: 5px solid var(--ax-blue); border-radius: var(--ax-radius); padding: 13px 14px; margin-bottom: 10px; color: inherit; text-decoration: none; }
.svc-card.late { border-left-color: #DC2626; } .svc-card.prog { border-left-color: #D97706; } .svc-card.done { border-left-color: #16A34A; opacity: .85; }
.svc-card .t { font-weight: 700; font-size: 1rem; }
.svc-card .m { color: var(--ax-muted); font-size: .86rem; margin-top: 4px; line-height: 1.5; }
.svc-card .m i { width: 18px; display: inline-block; }
.empty-state { text-align: center; color: var(--ax-muted); padding: 36px 12px; }
.empty-state i { font-size: 2.4rem; display: block; margin-bottom: 8px; color: #B6C6DE; }
.steps { display: flex; gap: 4px; margin-top: 12px; }
.steps button { flex: 1; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .2); border: 0; padding: 0; }
.steps button.done { background: var(--ax-sky); } .steps button.cur { background: #fff; }
.step-pane { display: none; } .step-pane.on { display: block; }
.ck-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--ax-line); }
.ck-row:last-child { border-bottom: 0; }
.ck-row .lbl { flex: 1; font-size: .93rem; }
.seg { display: inline-flex; border: 1px solid var(--ax-line); border-radius: 10px; overflow: hidden; flex: none; }
.seg button { border: 0; background: #fff; padding: 8px 11px; font-size: .8rem; font-weight: 600; color: var(--ax-muted); min-width: 44px; }
.seg button + button { border-left: 1px solid var(--ax-line); }
.seg button.on-si, .seg button.on-ok { background: #16A34A; color: #fff; }
.seg button.on-no, .seg button.on-falla { background: #DC2626; color: #fff; }
.seg button.on-na { background: #64748B; color: #fff; }
.ck-num { width: 110px; flex: none; }
.eq-head { font-weight: 700; padding: 8px 0 4px; border-bottom: 2px solid var(--ax-line); margin-top: 6px; }
.sig-box { position: relative; border: 2px dashed #B6C6DE; border-radius: 14px; background: #fff; touch-action: none; }
.sig-box canvas { width: 100%; height: 190px; display: block; border-radius: 12px; }
.sig-box .hint { position: absolute; left: 12px; bottom: 8px; font-size: .78rem; color: var(--ax-muted); pointer-events: none; }
.val-list { list-style: none; padding: 0; margin: 0; }
.val-list li { display: flex; gap: 8px; padding: 5px 0; font-size: .92rem; }
.val-list .bi-check-circle-fill { color: #16A34A; } .val-list .bi-x-circle-fill { color: #DC2626; }
.ph-pending::after { content: "\F293"; font-family: bootstrap-icons; position: absolute; top: 4px; right: 6px; color: #FCD34D; text-shadow: 0 0 3px #000; }
.ph-del { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(15, 23, 42, .7); color: #fff; display: flex; align-items: center; justify-content: center; }
.sticky-actions { position: sticky; bottom: calc(68px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--ax-bg) 30%); padding: 14px 0 4px; }
.no-nav .sticky-actions { bottom: 0; }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: 9px 0; border-bottom: 1px solid var(--ax-line); display: flex; gap: 8px; align-items: center; }
.list-plain li:last-child { border-bottom: 0; }
.fc { --fc-border-color: var(--ax-line); --fc-button-bg-color: #fff; --fc-button-text-color: #334155; --fc-button-border-color: var(--ax-line); --fc-button-active-bg-color: var(--ax-blue); --fc-button-active-border-color: var(--ax-blue); --fc-today-bg-color: #EEF5FF; font-size: .88rem; }
.fc .fc-button-primary:not(:disabled).fc-button-active { color: #fff; }
.fc .fc-toolbar-title { font-size: 1.15rem; }
@media (max-width: 575px) { .fc .fc-toolbar { flex-direction: column; gap: 8px; } }
@media print { .sidebar, .topbar, .tec-nav, .btn { display: none !important; } .main-wrap { margin: 0; } }
