/* ══════════════════════════════════════════════════
   PANEL NADVOK
   Sistema de diseño tomado de la tienda A.N.D:
   mismos tokens de color, radios, sombras y tipografía.
   Sin frameworks.
   ══════════════════════════════════════════════════ */

@font-face {
    font-family: 'Zalando Sans SemiExpanded';
    font-style: normal;
    font-weight: 200 900;
    font-display: swap;
    src: url('../fonts/zalando-sans-semiexpanded-latin-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                   U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
                   U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Zalando Sans SemiExpanded';
    font-style: normal;
    font-weight: 200 900;
    font-display: swap;
    src: url('../fonts/zalando-sans-semiexpanded-latin-ext-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
                   U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
                   U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --ink:          #0d0f14;
    --ink-2:        #1b1f28;
    --surface:      #ffffff;
    --surface-2:    #fafbfc;
    --canvas:       #f3f4f6;
    --line:         #e4e7ec;
    --line-2:       #d3d8e0;
    --body:         #12151c;
    --muted:        #6a7280;
    --muted-2:      #8b93a1;

    --accent:       #ff5a1f;
    --accent-ink:   #d94512;
    --accent-soft:  #fff0e9;

    --ok:      #0f8a4d;  --ok-soft:     #e6f6ed;
    --info:    #1f5fd0;  --info-soft:   #e9f0fe;
    --warn:    #a86a10;  --warn-soft:   #fdf3e2;
    --danger:  #c4342f;  --danger-soft: #fdecec;
    --wa:      #25d366;

    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --pill: 9999px;

    --shadow-card:  0 1px 2px rgb(16 20 30 / .06), 0 1px 3px rgb(16 20 30 / .05);
    --shadow-pop:   0 4px 12px rgb(16 20 30 / .08), 0 2px 4px rgb(16 20 30 / .04);
    --shadow-float: 0 18px 45px rgb(16 20 30 / .16), 0 4px 12px rgb(16 20 30 / .08);

    --font-sans: 'Zalando Sans SemiExpanded', -apple-system, BlinkMacSystemFont,
                 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --nav-w: 238px;
}

/* La tienda A.N.D no tiene modo oscuro, pero un panel de trabajo sí lo
   necesita. Mismos tonos, invertidos sobre un lienzo frío. */
html[data-tema="oscuro"] {
    --ink:          #f3f4f6;
    --ink-2:        #e4e7ec;
    --surface:      #14171d;
    --surface-2:    #191d25;
    --canvas:       #0e1116;
    --line:         #262b35;
    --line-2:       #373d4a;
    --body:         #eceef2;
    --muted:        #939bab;
    --muted-2:      #737b8a;

    --accent:       #ff7a45;
    --accent-ink:   #ff9068;
    --accent-soft:  rgba(255, 122, 69, 0.14);

    --ok:      #34c77b;  --ok-soft:     rgba(52, 199, 123, 0.14);
    --info:    #6b9bf5;  --info-soft:   rgba(107, 155, 245, 0.14);
    --warn:    #dda54a;  --warn-soft:   rgba(221, 165, 74, 0.14);
    --danger:  #ea6a5e;  --danger-soft: rgba(234, 106, 94, 0.14);

    --shadow-card:  0 1px 2px rgb(0 0 0 / .4);
    --shadow-pop:   0 4px 12px rgb(0 0 0 / .45);
    --shadow-float: 0 18px 45px rgb(0 0 0 / .6), 0 4px 12px rgb(0 0 0 / .4);
}

body {
    background: var(--canvas);
    color: var(--body);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

.num, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Un <svg> sin ancho ni alto mide 300x150. Todo icono en linea
   arranca con un tamano razonable y las reglas de cada contexto
   lo ajustan despues. */
.ico { width: 15px; height: 15px; flex-shrink: 0; vertical-align: -2px; }

.oculto-visual {
    position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ══ ESTRUCTURA ════════════════════════════════ */

.app { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100vh; }
.app > * { min-width: 0; }
.tarjeta, .cifra { min-width: 0; }

.nav {
    background: var(--surface);
    border-right: 1px solid var(--line);
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.nav-marca { display: flex; align-items: center; gap: 10px; padding: 2px 8px; }
.nav-marca img { width: 27px; height: 27px; object-fit: contain; }
.nav-marca b { font-size: 15.5px; font-weight: 800; letter-spacing: -0.03em; display: block; line-height: 1.2; color: var(--ink); }
.nav-marca span { font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-2); display: block; font-weight: 600; }

.nav-lista { list-style: none; display: flex; flex-direction: column; gap: 1px; }

.nav-lista a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 11px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 14.5px;
    font-weight: 550;
}

.nav-lista a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }

.nav-lista a.activo {
    background: var(--accent-soft);
    color: var(--accent-ink);
    font-weight: 700;
}

.nav-lista a svg { width: 17px; height: 17px; flex-shrink: 0; stroke-width: 1.7; }

.nav-lista a .badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 19px;
    height: 19px;
    border-radius: var(--pill);
    display: grid;
    place-items: center;
    padding: 0 5px;
    font-variant-numeric: tabular-nums;
}

.nav-lista a .badge[hidden] { display: none; }

.nav-pie { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }

.nav-usuario {
    display: flex; align-items: center; gap: 9px;
    padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2);
}

.nav-avatar {
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--ink); color: var(--surface);
    display: grid; place-items: center;
    font-size: 11.5px; font-weight: 800; flex-shrink: 0;
}

.nav-usuario div { min-width: 0; }
.nav-usuario b { display: block; font-size: 13px; font-weight: 650; line-height: 1.25; color: var(--ink); }
.nav-usuario span { display: block; font-size: 11.5px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.contenido { padding: 30px 36px 90px; max-width: 1280px; }

/* ══ ENCABEZADO ════════════════════════════════ */

.encabezado { display: flex; align-items: flex-end; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.encabezado h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; color: var(--ink); }
.encabezado .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.encabezado .acciones { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.migaja {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--muted);
    background: none; border: none; cursor: pointer; font-family: inherit;
    padding: 2px 0; margin-bottom: 6px;
}

.migaja:hover { color: var(--accent-ink); }
.migaja svg { width: 13px; height: 13px; stroke-width: 2.2; }

/* Rótulo pequeño en mayúsculas, como los "MARCAS" / "DESTACADOS" de A.N.D */
.rotulo-seccion {
    font-size: 11px; font-weight: 700; letter-spacing: 0.16em;
    text-transform: uppercase; color: var(--muted-2);
}

/* ══ CINTA DE DEMO ═════════════════════════════ */

.cinta-demo {
    display: flex; align-items: center; gap: 10px;
    background: var(--warn-soft);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: 13px;
    color: var(--ink-2);
    margin-bottom: 20px;
}

.cinta-demo b {
    color: var(--warn); font-weight: 800; text-transform: uppercase;
    font-size: 10px; letter-spacing: 0.14em; flex-shrink: 0;
}

.cinta-demo .descartar { margin-left: auto; flex-shrink: 0; }

.aviso-destructivo {
    background: var(--danger-soft);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 13.5px;
    color: var(--ink-2);
}

.aviso-destructivo ul { margin: 6px 0 0; padding-left: 18px; }
.aviso-destructivo li { margin-top: 2px; }
.aviso-destructivo b { color: var(--danger); }

/* ══ INDICADORES ═══════════════════════════════ */

.cifras { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 13px; margin-bottom: 24px; }

.cifra {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 15px 17px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-shadow: var(--shadow-card);
}

.cifra .rotulo { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-2); font-weight: 700; }
.cifra .valor {
    font-size: 26px; font-weight: 800; letter-spacing: -0.04em;
    line-height: 1.15; margin-top: 4px; color: var(--ink);
    /* Sin tabular-nums: los dígitos de ancho fijo son para columnas
       de tabla, no para una cifra grande suelta. */
    font-family: var(--font-sans); font-variant-numeric: normal;
}
.cifra .valor.chico { font-size: 17px; letter-spacing: -0.02em; }
.cifra .nota { font-size: 12.5px; color: var(--muted-2); margin-top: 1px; }
.cifra.es-crit .valor { color: var(--danger); }
.cifra.es-warn .valor { color: var(--warn); }
.cifra.es-ok   .valor { color: var(--ok); }

/* ══ TARJETAS ══════════════════════════════════ */

.tarjeta {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.tarjeta > header {
    padding: 13px 18px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 10px;
}

.tarjeta > header h2 { font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); }

.tarjeta > header .cuenta {
    font-size: 11.5px; color: var(--muted); font-weight: 700;
    background: var(--canvas); border-radius: var(--pill); padding: 1px 9px;
    font-variant-numeric: tabular-nums;
}

.tarjeta > header .a-la-derecha { margin-left: auto; }
.tarjeta > .cuerpo { padding: 18px; }

.rejilla { display: grid; gap: 16px; align-items: start; }
.rejilla.k2 { grid-template-columns: repeat(auto-fit, minmax(370px, 1fr)); }
.pila { display: flex; flex-direction: column; gap: 16px; }

/* ══ TABLAS ════════════════════════════════════ */

.tabla-marco { overflow-x: auto; }

table { border-collapse: collapse; width: 100%; }

thead th {
    text-align: left;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted-2);
    font-weight: 700;
    padding: 9px 18px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

tbody td { padding: 12px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
tbody tr.clic { cursor: pointer; }
tbody tr.clic:hover { background: var(--accent-soft); }
tbody tr[hidden] { display: none; }

td.der, th.der { text-align: right; }
td.angosto, th.angosto { width: 1%; white-space: nowrap; }
td .principal { font-weight: 650; color: var(--ink); }
td > .num { white-space: nowrap; }
td .pill + .pill { margin-left: 4px; }
td .secundario { display: block; font-size: 12.5px; color: var(--muted-2); margin-top: 1px; }

.accion-fila { opacity: 0; transition: opacity .12s ease; }
tbody tr:hover .accion-fila,
tbody tr:focus-within .accion-fila { opacity: 1; }

@media (hover: none) { .accion-fila { opacity: 1; } }

/* ══ PÍLDORAS ══════════════════════════════════ */

.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 10px;
    border-radius: var(--pill);
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
    background: var(--canvas);
    color: var(--muted);
}

.pill.ok   { background: var(--ok-soft);     color: var(--ok); }
.pill.warn { background: var(--warn-soft);   color: var(--warn); }
.pill.crit { background: var(--danger-soft); color: var(--danger); }
.pill.info { background: var(--info-soft);   color: var(--info); }
.pill.marca { background: var(--accent-soft); color: var(--accent-ink); }

.punto { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.punto.ok { background: var(--ok); }
.punto.warn { background: var(--warn); }
.punto.crit { background: var(--danger); }

/* ══ BOTONES ═══════════════════════════════════
   Pastilla completa, como los de la tienda.
   ══════════════════════════════════════════════ */

.btn {
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: var(--pill);
    border: 1px solid var(--line-2);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: nowrap;
    transition: background .14s ease, border-color .14s ease, transform .06s ease;
}

.btn:hover { background: var(--canvas); border-color: var(--muted-2); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; stroke-width: 2; }

.btn.primario { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.btn.primario:hover { background: var(--ink-2); border-color: var(--ink-2); }

.btn.marca { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.marca:hover { background: var(--accent-ink); border-color: var(--accent-ink); }

.btn.peligro { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.peligro:hover { filter: brightness(0.92); }
.btn.borrar { color: var(--danger); border-color: transparent; background: transparent; }
.btn.borrar:hover { background: var(--danger-soft); border-color: transparent; }

/* ── SELECCIÓN MASIVA (clientes) ─────────────── */

.barra-seleccion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--accent-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    margin-bottom: 14px;
    font-weight: 700;
    color: var(--ink-2);
}

.barra-seleccion .acciones { display: flex; gap: 8px; flex-shrink: 0; }

.tabla-marco tbody tr.fila-sel { background: var(--accent-soft); }

.tabla-marco .sel-cliente { accent-color: var(--accent); width: 15px; height: 15px; }
.tabla-marco thead th:first-child,
.tabla-marco tbody td:first-child { width: 40px; text-align: center; }

.btn.wa { background: var(--wa); border-color: var(--wa); color: #06301a; }
.btn.wa:hover { filter: brightness(0.95); }

.btn.chico { font-size: 12.5px; padding: 5px 12px; }
.btn.plano { border-color: transparent; background: transparent; color: var(--muted); }
.btn.plano:hover { background: var(--canvas); color: var(--ink); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ══ FILTROS Y BUSCADOR ════════════════════════ */

.barra { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filtros { display: flex; gap: 5px; flex-wrap: wrap; }

.filtro {
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: var(--pill);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.filtro:hover { border-color: var(--line-2); color: var(--ink); }
.filtro[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.filtro .conteo { font-size: 11.5px; opacity: .65; font-variant-numeric: tabular-nums; font-weight: 700; }

.caja-buscar { position: relative; display: flex; align-items: center; }
.caja-buscar > svg { position: absolute; left: 12px; width: 15px; height: 15px; color: var(--muted-2); pointer-events: none; stroke-width: 2; }

.buscador {
    font-family: inherit;
    font-size: 14px;
    padding: 8px 14px 8px 34px;
    border-radius: var(--pill);
    border: 1px solid var(--line-2);
    background: var(--surface);
    color: var(--body);
    min-width: 240px;
}

.buscador::placeholder { color: var(--muted-2); }
.buscador:focus { border-color: var(--accent); }

.tecla {
    position: absolute; right: 11px;
    font-size: 11px; font-weight: 700; color: var(--muted-2);
    border: 1px solid var(--line); border-radius: var(--radius-xs);
    padding: 0 6px; background: var(--canvas);
    pointer-events: none;
}

.buscador:focus ~ .tecla, .buscador:not(:placeholder-shown) ~ .tecla { display: none; }

/* ══ ESQUELETO DE CARGA ════════════════════════ */

.esqueleto {
    background: linear-gradient(90deg, var(--canvas) 25%, var(--line) 37%, var(--canvas) 63%);
    background-size: 400% 100%;
    animation: brillo 1.3s ease infinite;
    border-radius: var(--radius-xs);
    height: 12px;
}

@keyframes brillo { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.esqueleto-fila { display: flex; gap: 18px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.esqueleto-fila > * { flex: 1; }
.esqueleto-fila > *:first-child { flex: 2.4; }

/* ══ ESTADO VACÍO ══════════════════════════════ */

.vacio { padding: 40px 22px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.vacio > svg { width: 24px; height: 24px; color: var(--muted-2); stroke-width: 1.6; margin-bottom: 7px; }
.vacio b { color: var(--ink); font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.vacio p { color: var(--muted-2); font-size: 13.5px; max-width: 46ch; }
.vacio .btn { margin-top: 12px; }

/* ══ FORMULARIO / MODAL ════════════════════════ */

.velo {
    position: fixed;
    inset: 0;
    background: rgb(13 15 20 / .55);
    display: grid;
    place-items: center;
    padding: 20px;
    z-index: 60;
    animation: aparece .14s ease;
}

@keyframes aparece { from { opacity: 0; } }

.modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    width: min(560px, 100%);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-float);
    animation: sube-modal .18s ease;
}

@keyframes sube-modal { from { opacity: 0; transform: translateY(10px); } }

.modal > header { padding: 17px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal > header h2 { font-size: 18px; font-weight: 800; letter-spacing: -0.03em; color: var(--ink); }
.modal > header .cerrar { margin-left: auto; }
.modal form { display: contents; }
.modal .cuerpo { padding: 22px 24px; display: grid; gap: 15px; overflow-y: auto; }
.modal form > footer { padding: 15px 24px; border-top: 1px solid var(--line); display: flex; gap: 9px; justify-content: flex-end; }

.campo { display: flex; flex-direction: column; gap: 5px; }
.campo label { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; }

.campo input, .campo select, .campo textarea {
    font-family: inherit;
    font-size: 14.5px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-2);
    background: var(--surface);
    color: var(--body);
    width: 100%;
}

.campo input:focus, .campo select:focus, .campo textarea:focus { border-color: var(--accent); }
.campo textarea { resize: vertical; min-height: 66px; }
.campo .ayuda { font-size: 12px; color: var(--muted-2); text-transform: none; letter-spacing: 0; font-weight: 400; }

.campo.interruptor { flex-direction: row; align-items: center; gap: 9px; }
.campo.interruptor input { width: auto; accent-color: var(--accent); }
.campo.interruptor label { font-size: 14px; color: var(--body); font-weight: 500; text-transform: none; letter-spacing: 0; }

.pareja { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ══ COTIZADOR ═══════════════════════════════ */

.cotizador { grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); }

.fila-opciones { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }

.opcion {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 14px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: var(--ink-2);
    transition: border-color .15s, background .15s, color .15s;
}

.opcion b { font-size: 13.5px; color: var(--ink); }
.opcion span { font-size: 12px; color: var(--muted-2); }

.opcion:hover { border-color: var(--muted-2); }

.opcion.sel {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.opcion.sel b, .opcion.sel span { color: var(--accent-ink); }

.opcion.extra {
    flex-direction: row;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
}

.opcion.extra input { width: auto; accent-color: var(--accent); flex-shrink: 0; }
.opcion.extra .nombre { flex: 1; min-width: 0; overflow-wrap: break-word; font-size: 13px; color: var(--ink-2); }
.opcion.extra .monto { flex-shrink: 0; font-size: 12.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; }

.opcion.extra.sel { border-color: var(--accent); background: var(--accent-soft); }
.opcion.extra.sel .nombre { color: var(--accent-ink); }

.fila-opciones.extras { grid-template-columns: 1fr; }

.grupo-extra {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted-2);
    margin: 16px 0 2px;
}

.fila-opciones.monedas { grid-template-columns: repeat(auto-fit, minmax(56px, 1fr)); }
.fila-opciones.monedas .opcion { flex-direction: row; justify-content: center; font-weight: 700; }

.desglose { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.desglose .conceptos { display: flex; flex-direction: column; }

.desglose .renglon {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 6px 0 9px;
    border-bottom: 1px solid var(--line);
    font-size: 13.5px;
    min-width: 0;
}

.desglose .renglon span:first-child { min-width: 0; }

.desglose .totales {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 2px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.fila-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 13.5px;
    color: var(--muted);
}

.fila-total.desc { color: var(--ok); }

.desglose .gran-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--canvas);
    font-weight: 800;
    font-size: 15px;
    color: var(--ink);
}

.desglose .gran-total .num { font-size: 19px; }

.cot-nota { font-size: 12px; color: var(--muted-2); margin-top: 12px; line-height: 1.5; }

.mensaje-cot {
    background: var(--ok-soft);
    border-radius: 12px 12px 12px 3px;
    padding: 13px 15px;
    font-size: 13.5px;
    color: var(--ink-2);
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ══ AVISO FLOTANTE ════════════════════════════ */

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--ink);
    color: var(--surface);
    padding: 10px 12px 10px 20px;
    border-radius: var(--pill);
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: var(--shadow-float);
    z-index: 90;
    display: flex;
    align-items: center;
    gap: 14px;
    animation: sube .2s ease;
}

.toast button {
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 3px 10px;
    border-radius: var(--pill);
}

.toast button:hover { background: rgb(255 255 255 / .12); }

@keyframes sube { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ══ LOGIN ═════════════════════════════════════ */

.pantalla-login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }

.caja-login {
    width: min(400px, 100%);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    padding: 34px 32px;
    box-shadow: var(--shadow-pop);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.caja-login .marca { display: flex; align-items: center; gap: 11px; }
.caja-login .marca img { width: 32px; height: 32px; object-fit: contain; }
.caja-login h1 { font-size: 21px; font-weight: 800; letter-spacing: -0.03em; color: var(--ink); }

.caja-login .login-explica { font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.caja-login .login-explica b { color: var(--ink-2); }

.caja-login .login-mensaje {
    font-size: 13.5px;
    color: var(--ok);
    background: var(--ok-soft);
    border-radius: var(--radius-md);
    padding: 10px 13px;
    line-height: 1.5;
}

/* ══ INGRESOS ══════════════════════════════════ */

.ingresos-cabecera {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 1.4fr;
    gap: 24px;
    padding: 22px 22px 18px;
    border-bottom: 1px solid var(--line);
    align-items: start;
}

.ingresos-total .rotulo,
.ingresos-mes .rotulo {
    font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--muted-2); font-weight: 700; display: block;
}

.ingresos-total .hero {
    display: block;
    font-size: clamp(32px, 4.2vw, 44px);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1.05;
    color: var(--ink);
    margin: 6px 0 4px;
}

.ingresos-total .nota,
.ingresos-mes .nota { font-size: 12.5px; color: var(--muted-2); }

.ingresos-mes { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.ingresos-mes .valor-mes {
    display: block;
    font-size: 24px; font-weight: 800; letter-spacing: -0.035em;
    color: var(--ink); margin: 6px 0 3px;
}

.ingresos-mes .delta {
    display: flex; flex-direction: column; gap: 1px;
    font-size: 13.5px; font-weight: 700; color: var(--muted);
}

.ingresos-mes .delta.sube { color: var(--ok); }
.ingresos-mes .delta.baja { color: var(--danger); }
.ingresos-mes .delta .nota { font-weight: 400; }

.grafico-cabecera {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 22px 4px;
}

.grafico-cabecera h3 {
    font-size: 11px; font-weight: 700; letter-spacing: 0.14em;
    text-transform: uppercase; color: var(--muted-2);
}

.grafico-cabecera .btn { margin-left: auto; }

.grafico { position: relative; padding: 0 12px 12px; }
.grafico svg { display: block; overflow: visible; }
.grafico .zona { cursor: default; }
.grafico .zona:hover { fill: var(--surface-2); }

.grafico-globo {
    position: absolute;
    top: 4px;
    transform: translateX(-50%);
    background: var(--ink);
    color: var(--surface);
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    line-height: 1.45;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: var(--shadow-pop);
    z-index: 5;
}

.grafico-globo b { display: block; font-weight: 700; }
.grafico-globo span { display: block; font-variant-numeric: tabular-nums; }
.grafico-globo .detalle { opacity: .7; font-size: 11.5px; }

/* ══ CALENDARIO ════════════════════════════════ */

.agenda-doble { grid-template-columns: minmax(360px, 1.1fr) minmax(370px, 1fr); }

.cal-encabezado {
    display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px;
    margin-bottom: 6px;
}

.cal-encabezado span {
    text-align: center; font-size: 10px; font-weight: 700;
    letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2);
}

.cal-rejilla { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }

.cal-celda {
    min-height: 66px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 5px 6px;
    display: flex; flex-direction: column; gap: 2px;
    cursor: pointer;
    background: var(--surface);
    transition: border-color .12s ease, background .12s ease;
}

.cal-celda:hover { border-color: var(--accent); background: var(--accent-soft); }
.cal-celda.vacia { border: none; background: none; cursor: default; min-height: 0; }
.cal-celda.vacia:hover { background: none; }

.cal-celda.hoy { border-color: var(--ink); border-width: 1.5px; }
.cal-celda.hoy .cal-numero { color: var(--ink); font-weight: 800; }

.cal-numero { font-size: 11.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }

.cal-evento {
    font-size: 10.5px;
    line-height: 1.3;
    background: var(--accent-soft);
    color: var(--accent-ink);
    border-radius: 4px;
    padding: 1px 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.cal-evento.apagado { background: var(--canvas); color: var(--muted-2); }
.cal-hora { font-variant-numeric: tabular-nums; opacity: .75; margin-right: 2px; }
.cal-mas { font-size: 10px; color: var(--muted-2); font-weight: 600; padding-left: 4px; }

/* ══ DETALLE DE ERROR ═══════════════════════════ */

.wa-url {
    display: block;
    font-family: var(--font-mono);
    font-size: 11.5px;
    line-height: 1.5;
    background: var(--canvas);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    color: var(--ink-2);
    word-break: break-all;
    user-select: all;
}

/* ══ RESPONSIVE ════════════════════════════════ */

@media (max-width: 900px) {
    .app { grid-template-columns: 1fr; }

    .nav {
        position: sticky; top: 0; z-index: 40;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--line);
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 10px 14px;
    }

    .nav-marca span { display: none; }
    .nav-lista { flex-direction: row; gap: 3px; overflow-x: auto; flex: 1; scrollbar-width: none; }
    .nav-lista::-webkit-scrollbar { display: none; }
    .nav-lista a { white-space: nowrap; padding: 6px 12px; }
    .nav-lista a svg { display: none; }
    .nav-pie { margin-top: 0; flex-direction: row; align-items: center; }
    .nav-usuario { background: none; padding: 0; }
    .nav-usuario div { display: none; }
    .contenido { padding: 20px 16px 70px; max-width: 100%; }
    .cifras { grid-template-columns: repeat(auto-fit, minmax(142px, 1fr)); gap: 10px; }
    .cifra .valor { font-size: 21px; }
    .cinta-demo { align-items: flex-start; }
    .encabezado h1 { font-size: 25px; }
    .encabezado .acciones { margin-left: 0; width: 100%; }
    .caja-buscar { flex: 1; }
    .buscador { min-width: 0; width: 100%; }
    .pareja { grid-template-columns: 1fr; }
    .rejilla.k2 { grid-template-columns: 1fr; }
    .agenda-doble { grid-template-columns: 1fr; }
    .ingresos-cabecera { grid-template-columns: 1fr; gap: 18px; padding: 18px 16px 16px; }
    .ingresos-mes { grid-template-columns: 1fr 1fr; gap: 14px; }
    .grafico-cabecera { padding: 12px 16px 4px; }
    .cal-celda { min-height: 54px; padding: 4px; }
    .cal-evento { font-size: 9.5px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
