/* MarcaFly · estilos base. Paleta tomada del logo: cian → azul → violeta sobre azul noche. */
:root {
  --navy: #0f1b3d;
  --ink: #1c2541;
  --muted: #66708a;
  --line: #e4e7f0;
  --bg: #f5f6fb;
  --card: #ffffff;
  --cyan: #22d3ee;
  --blue: #3b5bfd;
  --violet: #7c3aed;
  --pink: #ec4899;
  --grad: linear-gradient(120deg, var(--cyan) 0%, var(--blue) 45%, var(--violet) 100%);
  --ok: #0f9d6b;
  --warn: #c27803;
  --bad: #d93b4c;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 27, 61, .06), 0 4px 16px rgba(15, 27, 61, .05);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--navy); line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
code { background: #eef0f7; padding: 1px 6px; border-radius: 6px; font-size: .85em; }
.muted { color: var(--muted); }
.small, small { font-size: .85rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; }

/* Estructura */
.shell { display: flex; min-height: 100vh; background: linear-gradient(to right, var(--navy) 250px, transparent 250px); }
.sidebar { width: 250px; flex-shrink: 0; background: var(--navy); color: #c9d1ea; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 16px; color: #fff; font-size: 1.35rem; font-weight: 700; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 10px; padding: 3px; }
.brand img.custom { width: auto; max-width: 64px; }
.brand .custom-name { font-size: 1.1rem; line-height: 1.2; }
.brand b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sidebar nav { display: flex; flex-direction: column; padding: 6px 10px; gap: 2px; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; color: #c9d1ea; padding: 9px 12px; border-radius: 9px; font-size: .94rem; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .06); text-decoration: none; color: #fff; }
.sidebar nav a.active { background: color-mix(in srgb, var(--violet) 30%, transparent); color: #fff; box-shadow: inset 3px 0 0 var(--cyan); }
.sidebar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.nav-sep { margin: 14px 12px 4px; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: #8390b5; }
.pill { margin-left: auto; background: var(--pink); color: #fff; border-radius: 99px; font-size: .75rem; padding: 0 8px; font-weight: 600; }
.sidebar-foot { margin-top: auto; padding: 16px 20px; font-size: .8rem; font-style: italic; color: #8390b5; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 10px 28px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.topbar .spacer { flex: 1; }
.ctx { display: flex; flex-direction: column; }
.ctx label { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ctx select { border: 0; padding: 0; font-weight: 600; background: transparent; color: var(--navy); font-size: .95rem; }
.user { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.menu-btn { display: none; border: 0; background: none; font-size: 1.4rem; cursor: pointer; }
.content { padding: 26px 28px 60px; max-width: 1280px; width: 100%; }
.banner { padding: 10px 28px; font-size: .92rem; }
.banner.warn { background: #fff7e6; color: #7a4b00; border-bottom: 1px solid #f5dfae; }

/* Componentes */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin-bottom: 2px; }
.page-head p { margin: 0; }
.section-title { margin: 26px 0 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow { max-width: 520px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head.pad { padding: 18px 22px 6px; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.two-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.grid.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; color: var(--ink); position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--grad); }
.kpi:hover { text-decoration: none; }
.kpi span { color: var(--muted); font-size: .85rem; }
.kpi strong { font-size: 1.9rem; color: var(--navy); line-height: 1.2; }
.kpi strong.sm { font-size: 1rem; padding-top: 6px; }
.kpi.alert strong { color: var(--pink); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--navy); padding: 9px 16px; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; border-color: #c9cee0; }
.btn.primary { background: var(--grad); color: #fff; border: 0; box-shadow: 0 4px 14px rgba(59, 91, 253, .25); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 11px; font-size: .85rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 180px; }
.badge { font-size: .78rem; border-radius: 99px; padding: 3px 10px; font-weight: 600; }
.badge.plan { background: var(--grad); color: #fff; }
.badge.muted { background: #eef0f7; color: var(--muted); }
.tag { font-size: .72rem; border-radius: 6px; padding: 2px 7px; background: #eef0f7; color: var(--muted); font-weight: 600; vertical-align: middle; }
.tag.warn { background: #fde8f2; color: #b0246a; }

/* Formularios */
.form { display: flex; flex-direction: column; gap: 14px; }
.form.inline { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: .9rem; color: var(--navy); }
label small { font-weight: 400; color: var(--muted); }
.label { font-weight: 600; font-size: .9rem; color: var(--navy); display: block; margin-bottom: 6px; }
input, select, textarea { font: inherit; font-weight: 400; color: var(--ink); border: 1px solid #d5d9e6; border-radius: 9px; padding: 9px 11px; background: #fff; width: 100%; }
.form.inline input, .form.inline select, .row input { width: auto; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(59, 91, 253, .35); border-color: var(--blue); }
textarea { resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
legend { font-weight: 600; font-size: .9rem; color: var(--navy); margin-bottom: 6px; }
.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; color: var(--ink); }
.check input { width: auto; }
.radios { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.radio { flex-direction: row; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; align-items: flex-start; }
.radio input { width: auto; margin-top: 4px; }
.radio span { display: flex; flex-direction: column; }
.radio small { font-weight: 400; color: var(--muted); }
.radio.disabled { opacity: .5; cursor: not-allowed; }
.radio:has(input:checked) { border-color: var(--blue); background: #f3f5ff; }

/* Mensajes */
.flash { padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; font-size: .93rem; border: 1px solid transparent; }
.flash.success { background: #e7f7f0; color: #0b6b49; border-color: #bfe9d6; }
.flash.error { background: #fdecee; color: #a3202f; border-color: #f5c6cc; }
.flash.info { background: #edf1ff; color: #2a3f9e; border-color: #cfd8ff; }
.empty { text-align: center; padding: 50px 20px; }
.empty.sm { padding: 26px 16px; }

/* Tablas y listas */
.tabla-wrap { overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tabla th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfe; }
.tabla td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla select { width: auto; padding: 5px 8px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.list li:last-child { border-bottom: 0; }
.list.compact li { flex-direction: column; align-items: flex-start; gap: 0; padding: 8px 0; }
.filters { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.chip { padding: 6px 13px; border-radius: 99px; background: #fff; border: 1px solid var(--line); color: var(--ink); font-size: .88rem; }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip:hover { text-decoration: none; }

/* Estados */
.status { font-size: .78rem; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: #eef0f7; color: var(--muted); white-space: nowrap; }
.status.big { font-size: .9rem; padding: 6px 14px; }
.s-completada, .s-aprobada { background: #e7f7f0; color: var(--ok); }
.s-en_proceso, .s-planificando, .s-sintetizando, .s-reservada { background: #edf1ff; color: var(--blue); }
.s-en_cola, .s-pendiente { background: #fff4e0; color: var(--warn); }
.s-fallida, .s-rechazada, .s-cancelada { background: #fdecee; color: var(--bad); }
.ev { font-size: .76rem; font-weight: 600; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.ev-confirmado { background: #e7f7f0; color: var(--ok); }
.ev-requiere_verificacion { background: #fff4e0; color: var(--warn); }
.ev-estimacion { background: #f1ebff; color: var(--violet); }
.ev-no_disponible { background: #eef0f7; color: var(--muted); }
.legend { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 12px; }

/* Medidores */
.meter { margin-bottom: 14px; }
.meter-top { display: flex; justify-content: space-between; font-size: .88rem; margin-bottom: 5px; gap: 8px; }
.bar { height: 8px; background: #eef0f7; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--grad); border-radius: 99px; }
.bar i.hot { background: linear-gradient(90deg, var(--violet), var(--pink)); }

/* Investigaciones */
.steps { display: flex; list-style: none; padding: 0; margin: 0 0 14px; gap: 6px; flex-wrap: wrap; counter-reset: s; }
.steps li { flex: 1; min-width: 130px; font-size: .84rem; padding: 8px 12px; border-radius: 9px; background: #fff; border: 1px solid var(--line); color: var(--muted); counter-increment: s; }
.steps li::before { content: counter(s) ". "; font-weight: 700; }
.steps li.done { background: #e7f7f0; color: var(--ok); border-color: #bfe9d6; }
.steps li.now { background: var(--grad); color: #fff; border: 0; }
.md h3, .md h4, .md h5, .md h6 { margin: 1.1em 0 .4em; }
.md p { margin: .4em 0; }
.md ul, .md ol { padding-left: 1.3em; }
.report { border-top: 3px solid transparent; border-image: var(--grad) 1; border-image-slice: 1; }
.task summary { display: flex; justify-content: space-between; cursor: pointer; list-style: none; gap: 12px; }
.task summary::-webkit-details-marker { display: none; }
.task[open] summary { margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.lead { font-size: 1.02rem; color: var(--navy); }
.sources { font-size: .86rem; padding-left: 1.2em; }

/* Agentes */
.depts { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.dept { margin: 0; }
.dept.locked { opacity: .6; }
.letter { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--grad); color: #fff; font-size: .8rem; margin-right: 8px; vertical-align: 1px; }
.agent { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 10px; color: var(--ink); }
.agent:hover { border-color: var(--blue); text-decoration: none; }
.agent small { color: var(--muted); }
.agent .meta { font-size: .78rem; color: var(--violet); margin-top: 4px; }

/* Aprobaciones y planes */
.approval.sensitive { border-left: 4px solid var(--pink); }
.details { background: #f6f7fb; border-radius: 8px; padding: 10px; font-size: .82rem; overflow-x: auto; white-space: pre-wrap; }
.plan-card.current { border: 2px solid var(--blue); }
.price { font-size: 1.6rem; font-weight: 700; color: var(--navy); margin: 8px 0 2px; }
.price small { font-size: .9rem; color: var(--muted); font-weight: 400; }
.checks { padding-left: 1.1em; font-size: .9rem; }
.checks li { margin: 3px 0; }

/* Acceso */
.auth-body { background: radial-gradient(circle at 10% 10%, rgba(34, 211, 238, .18), transparent 40%), radial-gradient(circle at 90% 90%, rgba(124, 58, 237, .18), transparent 45%), var(--bg); }
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px 16px; }
.auth-card { width: 100%; max-width: 430px; background: #fff; border-radius: 18px; padding: 30px 32px; box-shadow: 0 10px 40px rgba(15, 27, 61, .1); }
.auth-logo { mix-blend-mode: multiply; display: block; width: 260px; max-width: 100%; margin: 0 auto 10px; }
.auth-title { text-align: center; font-size: 1.3rem; }
.auth-foot { max-width: 430px; text-align: center; color: var(--muted); font-style: italic; font-size: .9rem; margin-top: 22px; }

@media (max-width: 1000px) {
  .grid.kpis { grid-template-columns: repeat(2, 1fr); }
  .grid.two, .grid.three, .grid.two-1 { grid-template-columns: 1fr; }
  .radios { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { background: none; }
  .sidebar { position: fixed; left: -260px; z-index: 20; transition: left .2s; }
  .sidebar.open { left: 0; }
  .menu-btn { display: block; }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
  .grid.kpis { grid-template-columns: 1fr 1fr; }
}

/* Marca de la empresa */
.brand-preview { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; height: 150px; margin: 6px 0 4px; }
.brand-preview .pv-side { width: 38%; background: var(--pv-menu, var(--navy)); padding: 12px; display: flex; flex-direction: column; gap: 7px; }
.brand-preview .pv-logo { display: flex; align-items: center; gap: 6px; color: #fff; font-weight: 700; font-size: .8rem; min-height: 26px; }
.brand-preview .pv-logo img { max-height: 26px; max-width: 46px; background: #fff; border-radius: 5px; padding: 2px; }
.brand-preview .pv-item { height: 8px; border-radius: 4px; background: rgba(255,255,255,.18); }
.brand-preview .pv-item.on { background: rgba(255,255,255,.5); }
.brand-preview .pv-main { flex: 1; padding: 14px; background: var(--bg); display: flex; flex-direction: column; gap: 10px; }
.brand-preview .pv-btn { align-self: flex-start; padding: 6px 14px; border-radius: 8px; color: #fff; font-size: .78rem; font-weight: 600; background: linear-gradient(120deg, var(--pv-a, var(--cyan)), var(--pv-b, var(--violet))); }
.brand-preview .pv-bar { height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--pv-a, var(--cyan)), var(--pv-b, var(--violet))); width: 70%; }
.brand-preview .pv-card { flex: 1; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.colors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.colors input[type=color] { height: 42px; padding: 3px; cursor: pointer; }
.logo-now { display: flex; align-items: center; gap: 12px; }
.logo-now img { max-height: 48px; max-width: 140px; border: 1px solid var(--line); border-radius: 8px; padding: 4px; background: #fff; }
.mods { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0; }
.onboard { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.onboard a { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 12px; color: var(--ink); }
.onboard a:hover { border-color: var(--blue); text-decoration: none; }
.onboard .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff; font-weight: 700; flex-shrink: 0; font-size: .85rem; }
.onboard .done .n { background: var(--ok); }
.onboard small { display: block; color: var(--muted); }
@media (max-width: 1000px) { .onboard { grid-template-columns: 1fr; } }

/* ───────────── Tableros y gráficos (estándar para todos los módulos) ───────────── */
.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.dash > .card { margin: 0; }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.chart-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.chart-title h2 { margin: 0; font-size: 1.02rem; }
.chart-title span { color: var(--muted); font-size: .82rem; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .gl { stroke: #edf0f6; stroke-width: 1; }
.chart .base { stroke: #cfd4e2; stroke-width: 1; }
.chart text.axis, .donut text.axis { fill: var(--muted); font-size: 11px; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .pt circle { fill: var(--blue); stroke: #fff; stroke-width: 2; opacity: 0; }
.chart .pt .cross { stroke: #c3c9da; stroke-dasharray: 3 3; opacity: 0; }
.chart .pt:hover circle, .chart .pt:hover .cross { opacity: 1; }
.chart .bar { transition: opacity .15s; }
.chart rect.hit:hover { fill: rgba(15, 27, 61, .04); }
.kpi .kpi-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.kpi small { color: var(--muted); }
.kpi .spark { width: 100%; height: 36px; margin-top: 8px; display: block; }
.delta { font-size: .8rem; font-weight: 700; padding: 2px 7px; border-radius: 99px; }
.delta.up { background: #e7f7f0; color: var(--ok); }
.delta.down { background: #fdecee; color: var(--bad); }
.delta.flat { background: #eef0f7; color: var(--muted); }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { width: 170px; height: 170px; flex-shrink: 0; }
.donut .seg { cursor: pointer; transition: stroke-width .15s; }
.donut .seg:hover { stroke-width: 28; }
.donut-total { font-size: 28px; font-weight: 700; fill: var(--navy); }
.legend-list { list-style: none; padding: 0; margin: 0; flex: 1; min-width: 170px; }
.legend-list li { display: grid; grid-template-columns: 12px 1fr auto 44px; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.legend-list li:last-child { border-bottom: 0; }
.legend-list i { width: 12px; height: 12px; border-radius: 4px; }
.legend-list small { color: var(--muted); text-align: right; }
.hbars { list-style: none; margin: 0; padding: 0; }
.hbars li { display: grid; grid-template-columns: minmax(90px, 34%) 1fr minmax(56px, auto); align-items: center; gap: 10px; padding: 6px 0; font-size: .9rem; cursor: default; }
.hb-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-track { height: 12px; background: #eef0f7; border-radius: 99px; overflow: hidden; }
.hb-track i { display: block; height: 100%; border-radius: 99px; background: var(--grad); }
.hb-val { white-space: nowrap; text-align: right; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; }
.hbars li:hover .hb-track i { filter: brightness(1.08); }
.gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.gauge { text-align: center; display: flex; flex-direction: column; align-items: center; }
.gauge-svg { width: 100%; max-width: 150px; height: auto; }
.gauge-pct { font-size: 20px; font-weight: 700; fill: var(--navy); }
.gauge b { font-size: .88rem; color: var(--navy); margin-top: -4px; }
.gauge small { color: var(--muted); }
.gauge.hot .gauge-pct { fill: var(--bad); }
.empty-chart { opacity: .8; }
.viz-tip { position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; opacity: 0; transition: opacity .1s;
  background: var(--navy); color: #fff; font-size: .82rem; padding: 6px 10px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.18); white-space: nowrap; }
.perf { width: 100%; border-collapse: collapse; font-size: .9rem; }
.perf td { padding: 8px 6px; border-bottom: 1px solid var(--line); }
.perf .rate { width: 40%; }
@media (max-width: 1100px) { .span-3, .span-4, .span-5 { grid-column: span 6; } .span-6, .span-7, .span-8 { grid-column: span 12; } }
@media (max-width: 700px) { .dash > * { grid-column: span 12 !important; } }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 18px 0 4px; }

/* ---------- Ayudas y tips (app/Core/Help.php) ---------- */
.help-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 99px; border: 1px solid var(--line); background: #fff; color: var(--navy); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; margin-right: 6px; }
.help-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--blue); stroke-width: 2; stroke-linecap: round; }
.help-btn:hover { border-color: var(--blue); }
.help-dot { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; border-radius: 50%; background: color-mix(in srgb, var(--blue) 14%, #fff); color: var(--blue); font: 700 11px/1 system-ui, sans-serif; font-style: normal; cursor: help; vertical-align: middle; margin-left: 4px; flex: none; }
.help-dot:hover, .help-dot:focus, .help-dot.open { background: var(--blue); color: #fff; outline: none; }
.help-pop { display: none; position: fixed; z-index: 90; width: 260px; padding: 10px 12px; border-radius: 10px; background: var(--navy); color: #fff; font-family: inherit; font-size: .84rem; font-weight: 400; line-height: 1.45; font-style: normal; text-align: left; box-shadow: 0 10px 30px rgba(15, 23, 42, .25); white-space: normal; letter-spacing: 0; text-transform: none; }
.help-pop b { display: block; margin-bottom: 3px; font-weight: 700; }
.help-dot:hover .help-pop, .help-dot:focus .help-pop, .help-dot.open .help-pop { display: block; }
.help-text { display: flex; gap: 6px; align-items: flex-start; color: var(--muted); font-size: .84rem; line-height: 1.4; margin-top: 2px; font-weight: 400; }
.help-text svg { width: 15px; height: 15px; flex: none; margin-top: 1px; fill: none; stroke: var(--blue); stroke-width: 2; stroke-linecap: round; }
.help-tip { display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin: 0 0 18px; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--cyan) 35%, var(--line)); background: color-mix(in srgb, var(--cyan) 8%, #fff); }
.help-tip > div { flex: 1; }
.help-tip b { color: var(--navy); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.help-tip p { margin: 2px 0 0; color: var(--ink); }
.help-tip-ico { width: 34px; height: 34px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; flex: none; }
.help-tip-ico svg { width: 19px; height: 19px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.help-tip-next { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 12px; font: inherit; font-size: .84rem; cursor: pointer; color: var(--navy); }
.help-tip-close { border: 0; background: none; font-size: 1.3rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 6px; }
.help-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 100vw); z-index: 80; background: #fff; border-left: 1px solid var(--line); box-shadow: -14px 0 40px rgba(15, 23, 42, .14); padding: 20px 24px 28px; overflow-y: auto; display: flex; flex-direction: column; }
.help-panel[hidden] { display: none; }
.help-head { display: flex; justify-content: space-between; align-items: center; }
.help-kicker { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.help-close { border: 0; background: none; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--muted); }
.help-panel h2 { margin: 8px 0 6px; font-size: 1.3rem; }
.help-panel h3 { margin: 18px 0 6px; font-size: .95rem; color: var(--navy); }
.help-panel p, .help-panel li { color: var(--ink); line-height: 1.5; }
.help-panel ol, .help-panel ul { padding-left: 20px; margin: 0; }
.help-panel li { margin-bottom: 6px; }
.help-panel details { border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; margin-bottom: 8px; }
.help-panel summary { cursor: pointer; font-weight: 600; color: var(--navy); }
.help-panel details p { margin: 8px 0 0; color: var(--muted); }
.help-tips li::marker { color: var(--blue); }
.help-pref { margin: 10px 0 4px; padding: 12px 14px; border-radius: 12px; background: var(--bg, #f4f6fb); display: flex; align-items: center; gap: 14px; }
.help-pref > div { flex: 1; display: flex; flex-direction: column; }
.help-pref small { color: var(--muted); }
.switch { width: 46px; height: 26px; border-radius: 99px; border: 0; background: #cbd5e1; position: relative; cursor: pointer; flex: none; padding: 0; }
.switch span { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: left .15s; }
.switch.on { background: var(--grad); }
.switch.on span { left: 23px; }
@media (max-width: 760px) { .help-btn { padding: 7px 10px; font-size: 0; gap: 0; } .help-btn svg { width: 20px; height: 20px; } .help-tip { flex-wrap: wrap; } }
.help-pref-card { margin-bottom: 18px; }
label:has(> .help-field) { position: relative; }
.help-field { position: absolute; top: 0; right: 0; margin: 0; }
@media (max-width: 760px) { .help-tip > div { flex-basis: calc(100% - 52px); } .help-tip-next { margin-left: 48px; } }

/* ---------- Imágenes de marca ---------- */
.brand picture { display: contents; }
.brand img.custom { width: auto; height: 44px; max-width: 170px; background: transparent; padding: 0; border-radius: 6px; }
.top-icon { display: none; }
.top-icon img { width: 34px; height: 34px; object-fit: contain; border-radius: 8px; }
@media (max-width: 1000px) { .top-icon { display: inline-flex; } }
.auth-logo.custom { mix-blend-mode: normal; width: auto; height: 80px; max-width: 280px; object-fit: contain; }
.auth-photo { display: none; }
@media (min-width: 1000px) {
  .auth-body.with-photo { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
  .with-photo .auth-photo { display: block; position: relative; overflow: hidden; }
  .with-photo .auth-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .with-photo .auth-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, color-mix(in srgb, var(--cyan) 25%, transparent), color-mix(in srgb, var(--violet) 30%, transparent)); }
}
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-top: 10px; }
.img-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #fff; }
.img-card h3 { margin: 0; font-size: 1rem; display: flex; align-items: center; gap: 6px; }
.img-card .uso { color: var(--muted); font-size: .88rem; margin: -4px 0 0; }
.img-prev { border-radius: 10px; border: 1px dashed var(--line); display: grid; place-items: center; overflow: hidden; max-height: 190px;
  background-color: #fff; background-image: linear-gradient(45deg, #eef1f7 25%, transparent 25%), linear-gradient(-45deg, #eef1f7 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #eef1f7 75%), linear-gradient(-45deg, transparent 75%, #eef1f7 75%);
  background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
.img-prev img { max-width: 100%; max-height: 190px; object-fit: contain; display: block; }
.img-prev.cover img { width: 100%; height: 100%; object-fit: cover; }
.img-prev .ph { color: var(--muted); font-size: .85rem; text-align: center; padding: 12px; }
.img-specs { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: .84rem; margin: 0; }
.img-specs dt { color: var(--muted); }
.img-specs dd { margin: 0; color: var(--ink); }
.img-result { font-size: .84rem; border-radius: 8px; padding: 7px 10px; background: color-mix(in srgb, #10b981 10%, #fff); color: #065f46; }
.img-result.inherit { background: var(--bg); color: var(--muted); }
.img-check { font-size: .84rem; min-height: 1.2em; }
.img-check.bad { color: #b91c1c; }
.img-check.warn { color: #92400e; }
.img-check.ok { color: #065f46; }
.img-card .row { gap: 8px; flex-wrap: wrap; }
.img-card input[type=file] { font-size: .85rem; max-width: 100%; }
.fav-prev { display: flex; align-items: flex-end; gap: 14px; padding: 14px; }
.fav-prev figure { margin: 0; text-align: center; font-size: .72rem; color: var(--muted); }
.fav-prev figure img { display: block; margin: 0 auto 4px; }
.tab-mock { display: flex; align-items: center; gap: 8px; background: #e8ebf3; border-radius: 10px 10px 0 0; padding: 7px 12px; font-size: .8rem; width: 190px; color: var(--ink); }
.tab-mock img { width: 16px; height: 16px; }
.share-mock { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; font-size: .8rem; }
.share-mock div { padding: 6px 10px; color: var(--muted); }
.img-prev.on-menu { background: var(--navy); border-style: solid; padding: 14px; }
.img-prev.on-menu img { max-height: 150px; }
.img-result small { display: block; color: inherit; opacity: .8; margin-top: 2px; }

/* Asistente de instalación */
.auth-card.wiz { max-width: 680px; }
.wiz h2 { font-size: 1rem; margin: 18px 0 8px; }
.wiz-steps { display: flex; list-style: none; padding: 0; margin: 4px 0 10px; gap: 4px; }
.wiz-steps li { flex: 1; text-align: center; font-size: .74rem; color: var(--muted); }
.wiz-steps a { color: inherit; text-decoration: none; display: block; }
.wiz-steps span { display: grid; place-items: center; width: 30px; height: 30px; margin: 0 auto 4px; border-radius: 50%; background: #eef0f7; font-weight: 700; font-size: .85rem; color: var(--muted); }
.wiz-steps em { font-style: normal; display: block; line-height: 1.2; }
.wiz-steps li.done span { background: #e7f7f0; color: var(--ok); }
.wiz-steps li.now span { background: var(--grad); color: #fff; box-shadow: 0 4px 12px rgba(59, 91, 253, .3); }
.wiz-steps li.now { color: var(--navy); font-weight: 600; }
.wiz-bar { height: 4px; border-radius: 4px; background: #eef0f7; margin-bottom: 20px; overflow: hidden; }
.wiz-bar i { display: block; height: 100%; background: var(--grad); transition: width .3s; }
.wiz-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; }
.wiz-nav .btn.primary { min-width: 160px; }
.wiz-need, .wiz-list { padding-left: 1.2em; margin: 6px 0; line-height: 1.6; }
.wiz-req { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: .86rem; }
.wiz-req li { display: flex; gap: 8px; align-items: flex-start; }
.wiz-req span { flex: none; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: .7rem; font-weight: 700; color: #fff; background: var(--ok); margin-top: 1px; }
.wiz-req li.bad { color: #a3202f; font-weight: 600; }
.wiz-req li.bad span { background: #e5484d; }
.wiz-more { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.wiz-more summary { cursor: pointer; font-size: .88rem; color: var(--navy); font-weight: 600; }
.wiz-more[open] summary { margin-bottom: 10px; }
.wiz-ai { grid-template-columns: repeat(3, 1fr); }
.wiz-key { display: flex; flex-direction: column; gap: 14px; }
.wiz-key[hidden], .wiz-model[hidden] { display: none; }
.wiz-sum { display: grid; grid-template-columns: 170px 1fr; gap: 10px 14px; margin: 0 0 8px; padding: 16px; border-radius: 12px; background: #f6f7fb; font-size: .92rem; }
.wiz-sum dt { color: var(--muted); }
.wiz-sum dd { margin: 0; color: var(--navy); }
.tag.ok { background: #e7f7f0; color: var(--ok); }
.pw-meter { display: flex; flex-direction: column; gap: 5px; margin-top: -6px; font-size: .82rem; color: var(--muted); }
.pw-meter i { height: 5px; border-radius: 5px; background: #eef0f7; position: relative; overflow: hidden; }
.pw-meter i::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 0; transition: width .25s, background .25s; }
.pw-meter.s0 i::after { width: 8%; background: #e5484d; }
.pw-meter.s1 i::after { width: 30%; background: #f5a524; }
.pw-meter.s2 i::after { width: 55%; background: #f5a524; }
.pw-meter.s3 i::after { width: 80%; background: var(--ok); }
.pw-meter.s4 i::after { width: 100%; background: var(--ok); }
.wiz-copy { display: flex; gap: 8px; align-items: center; background: #0f1b3d; color: #e6ebff; border-radius: 10px; padding: 10px 10px 10px 14px; margin: 6px 0 12px; }
.wiz-copy code { flex: 1; font-size: .8rem; word-break: break-all; background: none; color: #e6ebff; padding: 0; }
.wiz-done { text-align: center; }
.wiz-ok { width: 60px; height: 60px; margin: 6px auto 10px; border-radius: 50%; display: grid; place-items: center; font-size: 1.8rem; color: #fff; background: var(--grad); box-shadow: 0 8px 24px rgba(59, 91, 253, .3); }
.wiz-foot { margin-top: 14px; text-align: center; }
@media (max-width: 640px) {
  .wiz-steps em { display: none; }
  .wiz-req, .wiz-ai { grid-template-columns: 1fr; }
  .wiz-sum { grid-template-columns: 1fr; gap: 2px; }
  .wiz-sum dd { margin-bottom: 8px; }
}
.wiz .auth-logo { width: 190px; }
.wiz form > .auth-title { order: -1; margin-bottom: 0; }

/* Módulo de superadministrador */
.super-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: -6px 0 20px; padding-bottom: 0; border-bottom: 1px solid var(--line); }
.super-badge { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #fff; background: linear-gradient(120deg, #f59e0b, #db2777); padding: 5px 10px; border-radius: 99px; margin-bottom: 8px; }
.super-badge svg, .nav-super svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.super-tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.super-tabs a { padding: 9px 13px; font-size: .9rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.super-tabs a:hover { color: var(--navy); text-decoration: none; }
.super-tabs a.on { color: var(--navy); font-weight: 600; border-bottom-color: var(--blue); }
.card.filters { flex-direction: column; align-items: stretch; gap: 12px; }
.card.filters .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.card.filters .row input { flex: 1; min-width: 220px; }
.card-head .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip b { margin-left: 3px; opacity: .7; }
.sub-st, .pay-st { display: inline-block; font-size: .76rem; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: #eef0f7; color: var(--muted); white-space: nowrap; }
.sub-activa, .pay-st.st-aprobado { background: #e7f7f0; color: #0b6b49; }
.sub-prueba, .pay-st.st-pendiente { background: #edf1ff; color: #2a3f9e; }
.sub-vencida, .sub-suspendida, .pay-st.st-rechazado { background: #fdecee; color: #a3202f; }
.sub-cancelada, .pay-st.st-anulado { background: #eef0f7; color: var(--muted); }
td.neg { color: #a3202f; font-weight: 600; }
td.right { text-align: right; }
.ghost-btn { display: inline-flex; align-items: center; gap: 6px; }
.ghost-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.ghost-bar { display: flex; align-items: center; gap: 14px; padding: 10px 28px; background: linear-gradient(90deg, #2e1065, #6d28d9); color: #fff; font-size: .9rem; position: sticky; top: 0; z-index: 30; }
.ghost-bar small { display: block; opacity: .85; font-size: .8rem; }
.ghost-bar > div { flex: 1; }
.ghost-bar .btn { background: #fff; color: #2e1065; border: 0; font-weight: 600; white-space: nowrap; }
.ghost-ico { flex: none; width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .16); display: grid; place-items: center; animation: ghost-float 3s ease-in-out infinite; }
.ghost-ico svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
@keyframes ghost-float { 50% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .ghost-ico { animation: none; } }
.gw-pick { grid-template-columns: repeat(3, 1fr); }
.copy-field { display: flex; gap: 8px; }
.copy-field input { flex: 1; font-family: ui-monospace, monospace; font-size: .82rem; background: #f6f7fb; }
.pay-note { display: flex; gap: 8px; align-items: flex-start; }
.pay-note svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--ok); stroke-width: 2; margin-top: 2px; }
.pay-result { max-width: 560px; margin: 30px auto; text-align: center; padding: 34px; }
.pay-ico { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; font-size: 1.9rem; font-weight: 700; color: #fff; background: #a3abbd; }
.pay-result.st-aprobado .pay-ico { background: var(--ok); }
.pay-result.st-pendiente .pay-ico { background: var(--blue); }
.pay-result.st-rechazado .pay-ico { background: #e5484d; }
.pay-sum { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; text-align: left; background: #f6f7fb; border-radius: 12px; padding: 14px 18px; margin: 18px 0; }
.pay-sum dt { color: var(--muted); }
.pay-sum dd { margin: 0; font-weight: 600; }
.row.center { justify-content: center; }
@media (max-width: 900px) { .gw-pick { grid-template-columns: 1fr; } .ghost-bar { flex-wrap: wrap; padding: 10px 16px; } }
