/* =====================================================================
   Kipu v4 · panel e ingreso con «cuerdas de color» (igual que la web)
   Fondo «lana» lila suave en vez de blanco, menú en tinta y un color por grupo del menú:
   coral = Ventas, sol = Gestión, menta = Administración, añil = Plataforma.
   Sin movimientos al pasar el cursor: solo cambian colores. Se carga al final y gana a kipu.css.
   ===================================================================== */
html:root, html:root[data-theme="light"] {
    color-scheme: light;
    --coral: oklch(64.5% .215 16); --coral-d: oklch(55% .2 16); --sol: oklch(82% .165 75); --sol-d: oklch(50% .13 65);
    --menta: oklch(71% .15 168); --menta-d: oklch(50% .12 168); --anil: oklch(57% .2 282);
    --bg: oklch(96.2% .016 285); --bg-2: oklch(93.5% .02 285); --surface: #fff; --surface-2: oklch(98% .008 285); --surface-3: oklch(94.5% .016 285);
    --ink: oklch(22% .075 280); --text-2: oklch(37% .045 280); --muted: oklch(50% .035 280); --line: oklch(90% .02 285); --line-2: oklch(83% .03 285);
    --acc: var(--coral); --acc-2: var(--coral-d); --acc-soft: color-mix(in oklab, var(--coral) 10%, transparent); --on-acc: #fff;
    --ok: var(--menta-d); --ok-soft: color-mix(in oklab, var(--menta) 16%, transparent); --warn: var(--sol-d); --warn-soft: color-mix(in oklab, var(--sol) 22%, transparent);
    --err: var(--coral-d); --err-soft: color-mix(in oklab, var(--coral) 12%, transparent);
    --shadow: 0 1px 2px oklch(22% .075 280 / .05), 0 12px 30px -18px oklch(22% .075 280 / .25); --shadow-lg: 0 30px 70px -30px oklch(22% .075 280 / .4);
    --side-bg: oklch(22% .075 280); --side-ink: #fff; --side-muted: oklch(72% .03 280); --side-line: rgba(255, 255, 255, .08);
    --font-d: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif; --font: 'Geist', 'Segoe UI', system-ui, sans-serif; --font-m: 'Geist Mono', Consolas, monospace;
    --r: 18px; --r-sm: 12px;
}
html:root[data-theme="dark"] {
    color-scheme: dark;
    --coral: oklch(70% .19 16); --coral-d: oklch(64% .2 16); --sol: oklch(83% .15 75); --sol-d: oklch(80% .14 75);
    --menta: oklch(76% .14 168); --menta-d: oklch(74% .13 168); --anil: oklch(70% .15 282);
    --bg: oklch(17% .04 280); --bg-2: oklch(19% .045 280); --surface: oklch(21.5% .05 280); --surface-2: oklch(24% .05 280); --surface-3: oklch(27% .055 280);
    --ink: oklch(96% .01 285); --text-2: oklch(84% .02 285); --muted: oklch(68% .03 285); --line: oklch(30% .05 280); --line-2: oklch(37% .055 280);
    --acc: var(--coral); --acc-2: var(--coral-d); --acc-soft: color-mix(in oklab, var(--coral) 16%, transparent); --on-acc: #fff;
    --ok: var(--menta-d); --ok-soft: color-mix(in oklab, var(--menta) 16%, transparent); --warn: var(--sol-d); --warn-soft: color-mix(in oklab, var(--sol) 16%, transparent);
    --err: var(--coral); --err-soft: color-mix(in oklab, var(--coral) 16%, transparent);
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 18px 40px -20px rgba(0, 0, 0, .7); --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, .9);
    --side-bg: oklch(14% .035 280); --side-ink: #fff; --side-muted: oklch(68% .03 280); --side-line: rgba(255, 255, 255, .06);
    --font-d: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif; --font: 'Geist', 'Segoe UI', system-ui, sans-serif; --font-m: 'Geist Mono', Consolas, monospace;
    --r: 18px; --r-sm: 12px;
}
body { font-family: var(--font); }
h1, h2, h3 { font-family: var(--font-d); letter-spacing: -.025em; }
:focus-visible { outline: 3px solid var(--sol); outline-offset: 2px; }
::selection { background: color-mix(in oklab, var(--sol) 45%, transparent); }

/* fondo «lana» liso: sin trama, sin luces ni animación */
body.app, html:root[data-theme="dark"] body.app { background: var(--bg); }
body.app .shell, html:root[data-theme="dark"] body.app .shell { background: transparent; }
.main { background-image: none; }
.k-fx-app { display: none; }
html:has(body.app) { scrollbar-color: var(--line-2) transparent; }
body.app ::-webkit-scrollbar-thumb { background: var(--line-2) padding-box; }
body.app ::-webkit-scrollbar-thumb:hover { background: var(--muted) padding-box; }

/* ------------------------------------------------------------------ menú lateral en tinta, cada grupo con su cuerda */
.side { background: var(--side-bg); }
.side .brand img { filter: none; transition: none; }
.side .brand:hover img { transform: none; }
.brand b { font-family: var(--font-d); }
.nav-group { --tone: var(--coral); }
.nav-group[data-tone="sol"] { --tone: var(--sol); }
.nav-group[data-tone="menta"] { --tone: var(--menta); }
.nav-group[data-tone="anil"] { --tone: oklch(72% .15 282); }
.nav-label { display: flex; align-items: center; gap: 8px; color: var(--side-muted); letter-spacing: .02em; text-transform: none; }
.nav-label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--tone); }
.side nav a { transition: background-color .15s, color .15s; border-radius: 12px; }
.side nav a:hover { transform: none; background: rgba(255, 255, 255, .06); color: #fff; }
.side nav a .i { color: var(--side-muted); }
.side nav a:hover .i { color: var(--tone); }
.side nav a[aria-current="page"] { background: color-mix(in oklab, var(--tone) 18%, transparent); color: #fff; }
.side nav a[aria-current="page"] .i { color: var(--tone); }
.side nav a[aria-current="page"]::before { content: ""; position: absolute; left: -8px; top: 22%; bottom: 22%; width: 3px; border-radius: 3px; background: var(--tone); box-shadow: none; }
.side .btn { border-radius: 999px; }
.side .btn-primary { border-color: var(--coral); background: var(--coral); color: #fff; }
.side .btn-primary:hover { border-color: var(--coral-d); background: var(--coral-d); }
.avatar { background: var(--sol); color: oklch(22% .075 280); }
.side .theme button[aria-pressed="true"] { background: rgba(255, 255, 255, .12); color: var(--sol); }

/* ------------------------------------------------------------------ títulos, botones y tarjetas */
.topbar { background: color-mix(in oklab, var(--bg) 90%, transparent); }
.page-title h1 { font-weight: 700; font-size: 1.6rem; letter-spacing: -.03em; }
.btn { border-radius: var(--r-sm); transition: border-color .15s, background-color .15s, color .15s, box-shadow .15s; }
.btn:active { transform: none; }
.btn:hover { border-color: var(--ink); }
.btn-primary { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.btn-primary:hover { border-color: var(--coral); background: var(--coral); color: #fff; }
html:root[data-theme="dark"] .btn-primary { border-color: var(--coral); background: var(--coral); color: #fff; }
html:root[data-theme="dark"] .btn-primary:hover { border-color: var(--coral-d); background: var(--coral-d); }
.btn-ghost:hover { border-color: transparent; background: var(--surface-3); }
.panel, .kpi, .qa, .plan { border-color: var(--line); border-radius: var(--r); box-shadow: 0 1px 0 var(--line); }
.panel::after, .kpi::after, .plan::after { display: none; }
.panel-head h2 .i { color: var(--coral); }
.qa:hover, .plan:hover, .prod:hover { transform: none; }
.qa:hover > .i { transform: none; }
.qa:hover { border-color: var(--ink); box-shadow: 0 1px 0 var(--line); }
.prod:hover { border-color: var(--coral); }
/* tarjetas de cifras: cada una con un nudo de color */
.kpi { position: relative; }
.kpi:not(.hero)::before { content: ""; position: absolute; top: 16px; right: 16px; width: 10px; height: 10px; border-radius: 50%; background: var(--coral); }
.kpi:not(.hero):nth-child(4n+2)::before { background: var(--sol); }
.kpi:not(.hero):nth-child(4n+3)::before { background: var(--menta); }
.kpi:not(.hero):nth-child(4n)::before { background: var(--anil); }
.kpi.hero { border-color: oklch(22% .075 280); background: oklch(22% .075 280); color: #fff; }
.kpi.hero::after { display: block; content: ""; position: absolute; left: 16px; right: 16px; bottom: 0; top: auto; inset-inline: 16px; height: 3px; opacity: 1; border-radius: 3px 3px 0 0; background: linear-gradient(90deg, var(--coral) 0 33%, var(--sol) 33% 66%, var(--menta) 66%); }
html:root[data-theme="dark"] .kpi.hero { border-color: var(--surface-3); background: var(--surface-3); }
.chip.on { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.tabbar a[aria-current="page"] { color: var(--coral); }
input:focus, select:focus, textarea:focus { border-color: var(--anil) !important; box-shadow: 0 0 0 4px color-mix(in oklab, var(--anil) 18%, transparent) !important; }

/* ------------------------------------------------------------------ ingreso, registro y recuperar */
.auth, html:root[data-theme="dark"] .auth { background: var(--bg); }
.auth-wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-card { width: min(460px, calc(100% - 32px)); margin: 40px auto; padding: 36px 34px; align-content: start; align-self: center; border-radius: 26px; background: var(--surface); box-shadow: 0 0 0 1px var(--line), 0 40px 80px -50px oklch(22% .075 280 / .45); box-sizing: border-box; }
.auth-logo { width: 52px; height: 52px; border-radius: 14px; animation: none; filter: none; }
.auth-card h1 { font-size: 2.3rem; font-weight: 800; letter-spacing: -.04em; }
.auth-card .btn-lg { min-height: 52px; border-radius: 999px; }
.auth-card .btn-primary { border-color: var(--coral); background: var(--coral); color: #fff; }
.auth-card .btn-primary:hover { border-color: var(--coral-d); background: var(--coral-d); }
.auth-card input:not([type="checkbox"]):not([type="radio"]), .auth-card select { min-height: 48px; border-radius: 12px; }
.auth-alt a, .auth-card a:not(.btn) { color: var(--coral-d); font-weight: 600; }
html:root[data-theme="dark"] .auth-alt a, html:root[data-theme="dark"] .auth-card a:not(.btn) { color: var(--coral); }
.auth-note { color: var(--muted); }
.auth-note .i { color: var(--menta-d); }
.auth-art { background: oklch(22% .075 280); border-left: 0; }
.auth-art::before { display: none; }
.auth-art .k-fx { display: none; }
.auth-art p { font-size: clamp(2rem, 3.2vw, 2.8rem); font-weight: 800; letter-spacing: -.04em; text-transform: lowercase; }
.auth-art p span { color: oklch(80% .03 280); text-transform: none; letter-spacing: 0; font-weight: 500; }
.auth-art .kipu-art { top: 10%; width: min(460px, 82%); }
.auth-back { display: inline-flex; align-items: center; gap: 8px; justify-self: start; color: var(--muted) !important; font-size: .9rem; font-weight: 500 !important; text-decoration: none; }
.auth-back:hover { color: var(--ink) !important; }
@media (max-width: 900px) {
    .auth-wrap { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 100vh; }
    .auth-art { display: block; order: -1; height: 150px; padding: 0; }
    .auth-art p { display: none; }
    .auth-art .kipu-art { top: -6px; width: min(420px, 100%); }
    .auth-card { margin: -40px auto 32px; position: relative; z-index: 1; padding: 28px 22px; }
    .auth-card h1 { font-size: 2rem; }
}

/* gráfico del inicio: proformas en coral, boletas en menta */
.bar-p { background: var(--coral); }
.bar-b { background: var(--menta-d); }
.dot-p { background: var(--coral); }
.dot-b { background: var(--menta-d); }

/* pasos de «Revisa tu correo» */
.auth-steps { display: grid; gap: 10px; margin: 4px 0 8px; padding: 0; list-style: none; counter-reset: s; }
.auth-steps li { position: relative; padding: 12px 14px 12px 50px; border-radius: 14px; background: var(--surface-2); color: var(--text-2); line-height: 1.5; counter-increment: s; }
.auth-steps li::before { content: counter(s); position: absolute; left: 12px; top: 11px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--coral); color: #fff; font: 700 .85rem var(--font-m); }
.auth-steps li:nth-child(2)::before { background: var(--sol); color: oklch(22% .075 280); }
.auth-steps li:nth-child(3)::before { background: var(--menta-d); }
.auth-steps b { color: var(--ink); }

/* plan elegido desde la tienda */
.kp-plans .plan.picked { box-shadow: 0 0 0 3px var(--coral); }
