/* ==========================================================================
   Sistema de Puntos — estilos
   Tema oscuro por defecto; el claro se activa con <html data-theme="light">.
   ========================================================================== */

:root,
[data-theme="dark"] {
    color-scheme: dark;
    --bg: #090c13;
    --glow-1: rgba(139, 92, 246, 0.20);
    --glow-2: rgba(34, 211, 238, 0.10);
    --superficie: rgba(20, 26, 40, 0.72);
    --superficie-solida: #141a28;
    --superficie-2: #1a2132;
    --superficie-3: #222a3e;
    --borde: rgba(148, 163, 184, 0.12);
    --borde-fuerte: rgba(148, 163, 184, 0.24);
    --texto: #e9edf5;
    --suave: #9aa5bc;
    --tenue: #66728c;
    --acento: #8b5cf6;
    --acento-suave: rgba(139, 92, 246, 0.16);
    --acento-texto: #c4b5fd;
    --cian: #22d3ee;
    --grad: linear-gradient(135deg, #8b5cf6 0%, #6366f1 45%, #22d3ee 100%);
    --ok: #34d399;
    --ok-suave: rgba(52, 211, 153, 0.14);
    --error: #f87171;
    --error-suave: rgba(248, 113, 113, 0.14);
    --aviso: #fbbf24;
    --aviso-suave: rgba(251, 191, 36, 0.14);
    --header-bg: rgba(9, 12, 19, 0.72);
    --input-bg: rgba(10, 14, 23, 0.7);
    --sombra: 0 18px 40px -20px rgba(0, 0, 0, 0.75);
    --sombra-acento: 0 12px 32px -12px rgba(139, 92, 246, 0.65);
    --sec-bg: rgba(139, 92, 246, 0.16);
    --sec-bg-hover: rgba(139, 92, 246, 0.28);
    --sec-borde: rgba(167, 139, 250, 0.45);
    --sec-texto: #e4dcff;
    --fan-bg: #262f45;
    --fan-bg-hover: #303a55;
    --fan-borde: rgba(148, 163, 184, 0.32);
    --flecha-select: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23c4b5fd' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

[data-theme="light"] {
    color-scheme: light;
    --bg: #f4f5fb;
    --glow-1: rgba(124, 58, 237, 0.10);
    --glow-2: rgba(8, 145, 178, 0.08);
    --superficie: rgba(255, 255, 255, 0.86);
    --superficie-solida: #ffffff;
    --superficie-2: #f1f3f9;
    --superficie-3: #e7eaf3;
    --borde: rgba(15, 23, 42, 0.08);
    --borde-fuerte: rgba(15, 23, 42, 0.16);
    --texto: #0f172a;
    --suave: #526079;
    --tenue: #8792a8;
    --acento: #7c3aed;
    --acento-suave: rgba(124, 58, 237, 0.10);
    --acento-texto: #6d28d9;
    --cian: #0891b2;
    --grad: linear-gradient(135deg, #7c3aed 0%, #4f46e5 45%, #0891b2 100%);
    --ok: #059669;
    --ok-suave: #e3f6ee;
    --error: #dc2626;
    --error-suave: #fdecec;
    --aviso: #b45309;
    --aviso-suave: #fff3d6;
    --header-bg: rgba(255, 255, 255, 0.78);
    --input-bg: #ffffff;
    --sombra: 0 18px 40px -24px rgba(15, 23, 42, 0.30);
    --sombra-acento: 0 12px 30px -12px rgba(124, 58, 237, 0.50);
    --sec-bg: rgba(124, 58, 237, 0.08);
    --sec-bg-hover: rgba(124, 58, 237, 0.16);
    --sec-borde: rgba(124, 58, 237, 0.38);
    --sec-texto: #5b21b6;
    --fan-bg: #eceff7;
    --fan-bg-hover: #e1e5f0;
    --fan-borde: rgba(15, 23, 42, 0.14);
    --flecha-select: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236d28d9' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: var(--texto);
    background:
        radial-gradient(1100px 620px at 8% -12%, var(--glow-1), transparent 62%),
        radial-gradient(900px 520px at 102% -4%, var(--glow-2), transparent 60%),
        var(--bg);
    background-attachment: fixed;
    transition: background-color .35s ease, color .35s ease;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--acento-texto); text-decoration: none; transition: color .2s; }
a:hover { color: var(--texto); }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(1.6rem, 2.4vw, 2rem); font-weight: 800; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .75rem; }
small { color: var(--suave); }
code { background: var(--superficie-2); padding: .1rem .4rem; border-radius: 6px; font-size: .88em; }

.icono { flex-shrink: 0; vertical-align: middle; }
.texto-gradiente {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.suave { color: var(--suave); }
.centrado { text-align: center; }
.oculto { display: none !important; }

::selection { background: var(--acento); color: #fff; }

/* ---------- Encabezado ---------- */
.app-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--header-bg);
    backdrop-filter: saturate(160%) blur(16px);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
    border-bottom: 1px solid var(--borde);
}
.app-header-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: .7rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.marca {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--texto);
    letter-spacing: -0.02em;
    margin-right: auto;
}
.marca:hover { color: var(--texto); }
.marca-icono {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--grad);
    color: #fff;
    box-shadow: var(--sombra-acento);
    transition: transform .35s cubic-bezier(.3, 1.5, .5, 1);
}
.marca:hover .marca-icono { transform: rotate(-12deg) scale(1.06); }
.marca-logo { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; }

.nav { display: flex; align-items: center; gap: .25rem; }
.nav a, .nav .nav-boton {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .5rem .8rem;
    border-radius: 10px;
    color: var(--suave);
    font-weight: 600;
    font-size: .92rem;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: background .2s, color .2s;
}
.nav a:hover, .nav .nav-boton:hover { background: var(--superficie-2); color: var(--texto); }
.nav a.activo { background: var(--acento-suave); color: var(--acento-texto); }
.nav form { display: inline; margin: 0; }
.nav .btn { margin-left: .25rem; }

.boton-icono {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    border: 1px solid var(--borde);
    background: var(--superficie-2);
    color: var(--texto);
    cursor: pointer;
    transition: transform .2s, background .2s, border-color .2s;
}
.boton-icono:hover { border-color: var(--borde-fuerte); transform: translateY(-1px); }
.boton-icono .icono { transition: transform .5s cubic-bezier(.3, 1.4, .5, 1); }
.boton-icono:active .icono { transform: rotate(90deg) scale(.85); }

[data-theme="dark"] .icono-luna,
[data-theme="light"] .icono-sol { display: none; }

.nav-toggle { display: none; }

/* ---------- Contenedores ---------- */
.contenedor {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
    flex: 1;
}
.contenedor.angosto { max-width: 560px; }

.encabezado-pagina {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.6rem;
}
.encabezado-pagina p { margin: .35rem 0 0; color: var(--suave); }
.acciones { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

.card {
    position: relative;
    background: var(--superficie);
    border: 1px solid var(--borde);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--sombra);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform .25s ease, border-color .25s ease, background-color .35s ease;
}
.card + .card { margin-top: 1.25rem; }
.card-titulo { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1.1rem; }
.card-titulo h2 { display: flex; align-items: center; gap: .55rem; }
.card-hover:hover { transform: translateY(-4px); border-color: var(--borde-fuerte); }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.25rem; margin-top: 1.25rem; }
.grid-2 > .card + .card { margin-top: 0; }
.grid-principal { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.25rem; margin-top: 1.25rem; }
.grid-principal > .card + .card { margin-top: 0; }
.layout-lateral { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 1.25rem; align-items: start; }
.layout-lateral > .card { position: sticky; top: 24px; margin-top: 0; }

/* ---------- Botones ---------- */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .7rem 1.2rem;
    border-radius: 12px;
    border: 1px solid transparent;
    font: inherit;
    font-weight: 700;
    font-size: .93rem;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    overflow: hidden;
    white-space: nowrap;
    transition: transform .18s ease, box-shadow .25s ease, background-color .2s, border-color .2s, color .2s, filter .2s;
}
.btn:active { transform: translateY(0) scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-primario { background: var(--grad); color: #fff; box-shadow: var(--sombra-acento); }
.btn-primario:hover { color: #fff; transform: translateY(-2px); filter: brightness(1.08); box-shadow: 0 16px 36px -12px rgba(139, 92, 246, .75); }
.btn-primario::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, .35) 50%, transparent 80%);
    transform: translateX(-120%);
    transition: transform .7s ease;
}
.btn-primario:hover::after { transform: translateX(120%); }

.btn-secundario { background: var(--sec-bg); color: var(--sec-texto); border-color: var(--sec-borde); }
.btn-secundario:hover { color: var(--sec-texto); background: var(--sec-bg-hover); transform: translateY(-2px); }

.btn-fantasma { background: var(--fan-bg); color: var(--texto); border-color: var(--fan-borde); }
.btn-fantasma:hover { background: var(--fan-bg-hover); color: var(--texto); border-color: var(--sec-borde); }

.btn-peligro-fuerte { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; box-shadow: 0 12px 28px -12px rgba(239, 68, 68, .7); }
.btn-peligro-fuerte:hover { color: #fff; transform: translateY(-2px); filter: brightness(1.08); }

.btn-peligro { background: var(--error-suave); color: var(--error); border-color: transparent; }
.btn-peligro:hover { background: var(--error); color: #fff; transform: translateY(-2px); }

.btn-chico { padding: .45rem .75rem; font-size: .84rem; border-radius: 10px; }
.btn-grande { padding: .95rem 1.6rem; font-size: 1.02rem; border-radius: 14px; }
.btn-bloque { width: 100%; }

.btn.cargando { pointer-events: none; opacity: .8; }
.btn.cargando::before {
    content: "";
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-right-color: transparent;
    animation: girar .7s linear infinite;
}

/* ---------- Formularios ---------- */
.campo { margin-bottom: 1rem; }
.campos-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
label { display: block; margin-bottom: .4rem; font-weight: 600; font-size: .88rem; color: var(--suave); }

input:not([type=checkbox]):not([type=radio]):not([type=file]),
select,
textarea {
    width: 100%;
    padding: .75rem .9rem;
    border-radius: 12px;
    border: 1px solid var(--borde-fuerte);
    background: var(--input-bg);
    color: var(--texto);
    font: inherit;
    transition: border-color .2s, box-shadow .2s, background-color .35s;
}
input::placeholder { color: var(--tenue); }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--acento);
    box-shadow: 0 0 0 4px var(--acento-suave);
}
/* Casilleros con forma de perilla (interruptor): todos los checkbox de la web. */
input[type=checkbox] {
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    flex: none;
    width: 40px;
    height: 22px;
    margin: 0;
    border-radius: 999px;
    background: var(--superficie-3);
    border: 1px solid var(--borde-fuerte);
    cursor: pointer;
    vertical-align: middle;
    transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
input[type=checkbox]::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
    transition: transform .22s cubic-bezier(.3, 1.4, .5, 1);
}
input[type=checkbox]:checked { background: linear-gradient(135deg, var(--acento), #6366f1); border-color: transparent; }
input[type=checkbox]:checked::before { transform: translateX(18px); }
input[type=checkbox]:hover:not(:disabled) { border-color: var(--acento); }
input[type=checkbox]:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--acento-suave); }
input[type=checkbox]:disabled { opacity: .45; cursor: not-allowed; }

.check { display: flex; align-items: center; gap: .6rem; font-weight: 500; color: var(--texto); cursor: pointer; margin: .4rem 0 1rem; }
.ayuda { display: block; color: var(--tenue); font-size: .82rem; margin-top: .35rem; }
.error-campo { display: block; color: var(--error); font-size: .82rem; margin-top: .3rem; }
.input-icono { position: relative; }
.input-icono .icono { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--tenue); pointer-events: none; }
.input-icono input { padding-left: 2.6rem !important; }

/* Zona para elegir imagen */
.zona-imagen {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    min-height: 150px;
    padding: 1rem;
    border: 2px dashed var(--borde-fuerte);
    border-radius: 16px;
    background: var(--superficie-2);
    color: var(--suave);
    text-align: center;
    cursor: pointer;
    overflow: hidden;
    transition: border-color .2s, background-color .2s;
}
.zona-imagen:hover, .zona-imagen.arrastrando { border-color: var(--acento); background: var(--acento-suave); color: var(--texto); }
.zona-imagen input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.zona-imagen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.zona-imagen.con-imagen .zona-texto { opacity: 0; }
.zona-texto { display: flex; flex-direction: column; align-items: center; gap: .3rem; transition: opacity .2s; }

/* ---------- Avisos ---------- */
.alerta {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    padding: .9rem 1.1rem;
    border-radius: 14px;
    margin-bottom: 1.25rem;
    border: 1px solid transparent;
    font-size: .93rem;
}
.alerta .icono { margin-top: .1rem; }
.alerta ul { margin: 0; padding-left: 1.1rem; }
.alerta.ok { background: var(--ok-suave); color: var(--ok); }
.alerta.error { background: var(--error-suave); color: var(--error); }
.alerta.aviso { background: var(--aviso-suave); color: var(--aviso); }
.alerta.info { background: var(--acento-suave); color: var(--acento-texto); }
.alerta a { color: inherit; font-weight: 700; text-decoration: underline; }
.validation-summary-valid { display: none !important; }

.toasts {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 60;
    display: grid;
    gap: .6rem;
    width: min(380px, calc(100vw - 40px));
}
.toast {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    padding: .95rem 1rem;
    border-radius: 16px;
    background: var(--superficie-solida);
    border: 1px solid var(--borde-fuerte);
    box-shadow: var(--sombra);
    animation: entrarToast .45s cubic-bezier(.2, 1.2, .4, 1) both;
}
.toast .toast-icono { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.toast.ok .toast-icono { background: var(--ok-suave); color: var(--ok); }
.toast.error .toast-icono { background: var(--error-suave); color: var(--error); }
.toast p { margin: .2rem 0 0; flex: 1; font-size: .92rem; }
.toast button { background: none; border: none; color: var(--tenue); cursor: pointer; padding: .2rem; }
.toast.saliendo { animation: salirToast .3s ease forwards; }

/* ---------- Badges, avatar ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .25rem .65rem;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .01em;
    background: var(--superficie-3);
    color: var(--suave);
    white-space: nowrap;
}
.badge.ok { background: var(--ok-suave); color: var(--ok); }
.badge.error { background: var(--error-suave); color: var(--error); }
.badge.aviso { background: var(--aviso-suave); color: var(--aviso); }
.badge.acento { background: var(--acento-suave); color: var(--acento-texto); }
.badge .punto { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge .punto.latido { animation: latido 1.6s ease-in-out infinite; }

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    font-weight: 800;
    font-size: .82rem;
    color: #fff;
    background: var(--grad);
}
.avatar.grande { width: 60px; height: 60px; border-radius: 18px; font-size: 1.2rem; }
.persona { display: flex; align-items: center; gap: .75rem; }
.persona strong { display: block; color: var(--texto); }
.persona small { display: block; }

/* ---------- Estadísticas ---------- */
.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.grid-stats .card { margin-top: 0; }
.stat { padding: 1.25rem 1.3rem; overflow: hidden; }
.stat::after {
    content: "";
    position: absolute;
    width: 120px;
    height: 120px;
    right: -40px;
    top: -40px;
    border-radius: 50%;
    background: var(--grad);
    opacity: .08;
    transition: transform .5s ease, opacity .3s;
}
.stat:hover::after { transform: scale(1.5); opacity: .14; }
.stat-icono {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    margin-bottom: .9rem;
    background: var(--acento-suave);
    color: var(--acento-texto);
}
.stat-etiqueta { display: block; color: var(--suave); font-size: .85rem; font-weight: 600; }
.stat-valor { display: block; font-size: 1.9rem; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

.saldo {
    background: var(--grad);
    color: #fff;
    border: none;
    overflow: hidden;
}
.saldo::before {
    content: "";
    position: absolute;
    inset: -40% -10% auto auto;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    animation: flotar 9s ease-in-out infinite;
}
.saldo .stat-etiqueta { color: rgba(255, 255, 255, .85); }
.saldo .stat-valor { font-size: 2.8rem; color: #fff; }

/* ---------- Tablas ---------- */
.tabla-wrap { overflow-x: auto; border: 1px solid var(--borde); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .8rem 1rem; border-bottom: 1px solid var(--borde); vertical-align: middle; }
th {
    background: var(--superficie-2);
    color: var(--tenue);
    font-size: .74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}
tbody tr { transition: background-color .15s; }
tbody tr:hover { background: var(--acento-suave); }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.acciones { text-align: right; white-space: nowrap; }
.positivo { color: var(--ok); font-weight: 700; }
.negativo { color: var(--error); font-weight: 700; }

/* ---------- Estados vacíos ---------- */
.vacio { text-align: center; padding: 2.5rem 1rem; color: var(--suave); }
.vacio-icono {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 20px;
    display: grid;
    place-items: center;
    background: var(--acento-suave);
    color: var(--acento-texto);
    animation: flotar 5s ease-in-out infinite;
}
.vacio h3 { color: var(--texto); margin-bottom: .4rem; }

/* ---------- Buscador ---------- */
.buscador { display: flex; gap: .6rem; margin-bottom: 1.25rem; }
.buscador .input-icono { flex: 1; }

/* ---------- Premios ---------- */
.premios-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.1rem; }
.premio { padding: 0; overflow: hidden; display: flex; flex-direction: column; margin-top: 0 !important; }
.premio.inactivo { opacity: .55; }
.premio-img {
    position: relative;
    aspect-ratio: 4 / 3;
    background: var(--superficie-2);
    display: grid;
    place-items: center;
    color: var(--tenue);
    overflow: hidden;
}
.premio-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.premio:hover .premio-img img { transform: scale(1.07); }
.premio-img .badge { position: absolute; top: .7rem; left: .7rem; backdrop-filter: blur(8px); }
.premio-img .cambiar-imagen {
    position: absolute;
    right: .7rem;
    bottom: .7rem;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .25s, transform .25s;
}
.premio:hover .cambiar-imagen, .cambiar-imagen:focus-within { opacity: 1; transform: none; }
.cambiar-imagen input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.premio-cuerpo { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.premio-cuerpo p { margin: 0; color: var(--suave); font-size: .86rem; }
.premio-puntos { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }
.premio-acciones { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: auto; padding-top: .7rem; }
.premio-acciones form { margin: 0; }
details.editar-premio summary { list-style: none; }
details.editar-premio summary::-webkit-details-marker { display: none; }
details.editar-premio[open] { flex-basis: 100%; }
details.editar-premio .formulario-editar { margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--borde); }

/* Opciones de canje (tarjetas seleccionables) */
.opciones-premio { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.opcion { position: relative; display: block; margin: 0; cursor: pointer; color: var(--texto); }
.opcion input { position: absolute; opacity: 0; pointer-events: none; }
.opcion-contenido {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--borde-fuerte);
    background: var(--superficie-2);
    transition: transform .2s, border-color .2s, box-shadow .2s;
}
.opcion:hover .opcion-contenido { transform: translateY(-3px); }
.opcion input:checked + .opcion-contenido { border-color: var(--acento); box-shadow: 0 0 0 3px var(--acento-suave), var(--sombra-acento); }
.opcion input:disabled + .opcion-contenido { opacity: .4; cursor: not-allowed; transform: none; }
.opcion-img { aspect-ratio: 4 / 3; display: grid; place-items: center; background: var(--superficie-3); color: var(--tenue); }
.opcion-img img { width: 100%; height: 100%; object-fit: cover; }
.opcion-texto { padding: .6rem .7rem; font-size: .85rem; }
.opcion-texto strong { display: block; }
.opcion-texto span { color: var(--acento-texto); font-weight: 700; }

/* ---------- QR ---------- */
.qr-box { text-align: center; }
.qr-marco {
    display: inline-block;
    padding: 14px;
    margin: .5rem 0 1rem;
    border-radius: 20px;
    background: #fff;
    box-shadow: var(--sombra);
    position: relative;
}
.qr-marco::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 22px;
    padding: 2px;
    background: var(--grad);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: girarColor 6s linear infinite;
}
.qr-marco img { display: block; width: 190px; height: 190px; }
.enlace-copiable { display: inline-block; max-width: 100%; overflow-wrap: anywhere; font-size: .85rem; }

/* ---------- Portada ---------- */
.hero { position: relative; text-align: center; padding: 3.5rem 0 3rem; }
.hero-burbuja {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: .5;
    z-index: -1;
    animation: flotar 12s ease-in-out infinite;
}
.hero-burbuja.b1 { width: 340px; height: 340px; background: #8b5cf6; top: -60px; left: 5%; }
.hero-burbuja.b2 { width: 280px; height: 280px; background: #22d3ee; top: 60px; right: 6%; animation-delay: -4s; opacity: .3; }
.hero-chip {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem .9rem .4rem .45rem;
    border-radius: 999px;
    border: 1px solid var(--borde-fuerte);
    background: var(--superficie);
    color: var(--suave);
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: 1.4rem;
}
.hero-chip .badge { background: var(--grad); color: #fff; }
.hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.9rem); letter-spacing: -0.04em; max-width: 880px; margin: 0 auto 1.2rem; }
.hero .bajada { max-width: 620px; margin: 0 auto 2rem; color: var(--suave); font-size: 1.12rem; }
.hero .acciones { justify-content: center; }
.hero-nota { margin-top: 1rem; color: var(--tenue); font-size: .85rem; }

.vista-previa { max-width: 760px; margin: 3.5rem auto 0; padding: 1.2rem; text-align: left; animation: flotar 7s ease-in-out infinite; }
.vista-previa .fila-previa {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .8rem .9rem;
    border-radius: 14px;
    background: var(--superficie-2);
}
.vista-previa .fila-previa + .fila-previa { margin-top: .6rem; }

.seccion { padding: 3.5rem 0 1rem; }
.seccion-titulo { text-align: center; max-width: 640px; margin: 0 auto 2.2rem; }
.seccion-titulo h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; letter-spacing: -0.03em; margin-bottom: .6rem; }
.seccion-titulo p { color: var(--suave); }

.grid-beneficios { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.1rem; }
.grid-beneficios .card { margin-top: 0; }
.beneficio-icono {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--grad);
    color: #fff;
    margin-bottom: 1rem;
    box-shadow: var(--sombra-acento);
}
.beneficio p { color: var(--suave); margin: .45rem 0 0; font-size: .93rem; }

.grid-planes { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.1rem; align-items: stretch; }
.grid-planes .card { margin-top: 0; display: flex; flex-direction: column; }
.plan-destacado { border-color: transparent; }
.plan-destacado::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 21px;
    padding: 1.5px;
    background: var(--grad);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}
.plan-etiqueta { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--grad); color: #fff; }
.plan-actual { outline: 2px solid var(--ok); outline-offset: 2px; }
.precio { font-size: 2.2rem; font-weight: 800; letter-spacing: -0.03em; margin: .6rem 0 .2rem; }
.precio span { font-size: .9rem; color: var(--suave); font-weight: 600; }
.plan p { color: var(--suave); flex: 1; }
.plan .btn { margin-top: 1rem; }

.cta-final { text-align: center; padding: 2.5rem 1.5rem; margin-top: 3rem; overflow: hidden; }
.cta-final h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; margin-bottom: .6rem; }

/* ---------- Autenticación ---------- */
.auth { min-height: calc(100vh - 220px); display: grid; place-items: center; padding: 1rem 0; }
.auth-card { width: min(470px, 100%); padding: 2rem; }
.auth-card h1 { margin-bottom: .35rem; }
.auth-card .bajada { color: var(--suave); margin-bottom: 1.5rem; }
.auth-pie { margin: 1.2rem 0 0; text-align: center; color: var(--suave); font-size: .92rem; }

.resultado-icono {
    width: 76px;
    height: 76px;
    margin: 0 auto 1.2rem;
    border-radius: 24px;
    display: grid;
    place-items: center;
    background: var(--grad);
    color: #fff;
    box-shadow: var(--sombra-acento);
    animation: aparecerPop .6s cubic-bezier(.3, 1.6, .5, 1) both;
}
.resultado-icono.espera { background: var(--aviso-suave); color: var(--aviso); box-shadow: none; }

/* ---------- Pie ---------- */
.app-footer { border-top: 1px solid var(--borde); color: var(--tenue); font-size: .84rem; }
.app-footer .app-header-inner { justify-content: space-between; padding-top: 1.1rem; padding-bottom: 1.1rem; }

/* ---------- Animaciones ---------- */
@keyframes subir { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes flotar { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes girar { to { transform: rotate(360deg); } }
@keyframes girarColor { to { filter: hue-rotate(360deg); } }
@keyframes latido { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.75); } }
@keyframes entrarToast { from { opacity: 0; transform: translateX(30px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes salirToast { to { opacity: 0; transform: translateX(30px) scale(.96); } }
@keyframes aparecerPop { from { opacity: 0; transform: scale(.5) rotate(-10deg); } to { opacity: 1; transform: none; } }

.animar > * { animation: subir .55s cubic-bezier(.2, .7, .2, 1) both; }
.animar > *:nth-child(2) { animation-delay: .06s; }
.animar > *:nth-child(3) { animation-delay: .12s; }
.animar > *:nth-child(4) { animation-delay: .18s; }
.animar > *:nth-child(5) { animation-delay: .24s; }
.animar > *:nth-child(n+6) { animation-delay: .3s; }

.escalonado > * { animation: subir .5s cubic-bezier(.2, .7, .2, 1) both; }
.escalonado > *:nth-child(1) { animation-delay: .08s; }
.escalonado > *:nth-child(2) { animation-delay: .14s; }
.escalonado > *:nth-child(3) { animation-delay: .2s; }
.escalonado > *:nth-child(4) { animation-delay: .26s; }
.escalonado > *:nth-child(5) { animation-delay: .32s; }
.escalonado > *:nth-child(6) { animation-delay: .38s; }
.escalonado > *:nth-child(n+7) { animation-delay: .44s; }

/* Aparición al hacer scroll (la clase la agrega site.js) */
.revelar { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.revelar.visible { opacity: 1; transform: none; }

/* ---------- Menú lateral (usuarios logueados) ---------- */
body.con-menu { flex-direction: row; }
.menu-lateral {
    position: sticky;
    top: 0;
    width: 260px;
    height: 100vh;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.1rem .9rem;
    background: var(--header-bg);
    backdrop-filter: saturate(160%) blur(16px);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
    border-right: 1px solid var(--borde);
    z-index: 45;
    overflow-y: auto;
}
.menu-lateral .marca { margin: 0 0 .3rem; padding: .3rem .4rem; }
.marca-texto { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.marca-texto strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px; }
.marca-texto small { font-weight: 500; font-size: .74rem; color: var(--tenue); }
.menu-secciones { display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.menu-titulo {
    margin: .9rem .7rem .35rem;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--tenue);
}
.menu-secciones a {
    position: relative;
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .6rem .75rem;
    border-radius: 11px;
    color: var(--suave);
    font-weight: 600;
    font-size: .92rem;
    transition: background .2s, color .2s, transform .2s;
}
.menu-secciones a:hover { background: var(--superficie-2); color: var(--texto); transform: translateX(2px); }
.menu-secciones a.activo { background: var(--acento-suave); color: var(--acento-texto); }
.menu-secciones a.activo::before {
    content: "";
    position: absolute;
    left: -.9rem;
    top: 20%;
    bottom: 20%;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--grad);
}
.menu-secciones a.bloqueado { opacity: .55; }
.menu-secciones a .candado { margin-left: auto; color: var(--tenue); }
.menu-pie { display: flex; flex-direction: column; gap: .7rem; padding-top: .8rem; border-top: 1px solid var(--borde); }
.plan-chip { display: block; }
.plan-chip .badge { width: 100%; justify-content: center; padding: .45rem .6rem; }
.menu-acciones { display: flex; gap: .5rem; }
.menu-acciones form { margin: 0; }
.app-principal { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.barra-movil {
    display: none;
    position: sticky;
    top: 0;
    z-index: 40;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .6rem 1rem;
    background: var(--header-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--borde);
}
.barra-movil .marca { margin: 0; font-size: .95rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.barra-movil .marca-icono { width: 28px; height: 28px; border-radius: 8px; }
.menu-fondo { display: none; }

/* ---------- Controles segmentados ---------- */
.segmentado {
    display: inline-flex;
    flex-wrap: wrap;
    gap: .25rem;
    padding: .25rem;
    border-radius: 12px;
    background: var(--superficie-2);
    border: 1px solid var(--borde);
}
.segmentado a, .segmentado-radio label span {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .45rem .8rem;
    border-radius: 9px;
    font-size: .86rem;
    font-weight: 600;
    color: var(--suave);
    cursor: pointer;
    transition: background .2s, color .2s;
}
.segmentado a:hover, .segmentado-radio label span:hover { color: var(--texto); }
.segmentado a.activo, .segmentado-radio input:checked + span { background: var(--superficie-solida); color: var(--texto); box-shadow: 0 2px 8px -2px rgba(0, 0, 0, .3); }
.segmentado-radio { display: flex; width: 100%; }
.segmentado-radio label { flex: 1; margin: 0; }
.segmentado-radio label span { width: 100%; justify-content: center; }
.segmentado-radio input { position: absolute; opacity: 0; pointer-events: none; }

/* ---------- Barras horizontales ---------- */
.barra-fila + .barra-fila { margin-top: .85rem; }
.barra-texto { display: flex; justify-content: space-between; gap: 1rem; font-size: .9rem; margin-bottom: .35rem; }
.barra-texto strong small { font-weight: 500; }
.barra { height: 8px; border-radius: 99px; background: var(--superficie-3); overflow: hidden; }
.barra span { display: block; height: 100%; border-radius: 99px; background: var(--grad); animation: crecer .9s cubic-bezier(.2, .7, .2, 1) both; transform-origin: left; }
@keyframes crecer { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- Gráficos ---------- */
.grafico { position: relative; height: 260px; }
.grafico-chico { height: 220px; }

/* ---------- Lista de destinatarios ---------- */
.lista-check { max-height: 460px; overflow-y: auto; display: flex; flex-direction: column; gap: .3rem; margin: 0 -.4rem; padding: 0 .4rem; }
.check-fila {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin: 0;
    padding: .5rem .6rem;
    border-radius: 12px;
    cursor: pointer;
    color: var(--texto);
    font-weight: 500;
    transition: background .15s;
}
.check-fila:hover { background: var(--superficie-2); }
.check-fila small { display: block; color: var(--tenue); font-size: .8rem; }
.check-fila .avatar { width: 32px; height: 32px; border-radius: 10px; font-size: .74rem; }
textarea { resize: vertical; min-height: 120px; line-height: 1.55; }

/* ---------- Contador de copias ---------- */
.zona-archivos { min-height: 170px; }
.lista-archivos { display: flex; flex-direction: column; gap: .5rem; margin-top: 1rem; }
.lista-archivos:empty { display: none; }
.archivo-fila {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .65rem .85rem;
    border-radius: 12px;
    background: var(--superficie-2);
    border: 1px solid var(--borde);
    animation: subir .35s ease both;
}
.archivo-fila strong { display: block; overflow-wrap: anywhere; }
.archivo-fila small { color: var(--suave); }
.archivo-fila.con-error small { color: var(--error); }
.fila-manual { display: flex; gap: .6rem; margin-top: 1rem; flex-wrap: wrap; }
.fila-manual input { flex: 1; min-width: 160px; }
.resumen-copias { position: sticky; top: 24px; }
.total-grande {
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: .6rem;
    font-variant-numeric: tabular-nums;
}
.detalle-calculo { margin: 0 0 1.2rem; display: grid; gap: .45rem; }
.detalle-calculo div { display: flex; justify-content: space-between; gap: 1rem; font-size: .9rem; }
.detalle-calculo dt { color: var(--suave); }
.detalle-calculo dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
details.precios-copias summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
details.precios-copias summary::-webkit-details-marker { display: none; }
details.precios-copias summary h2 { display: flex; align-items: center; gap: .55rem; }
details.precios-copias .ayuda { margin: 0; }
.layout-lateral > div > .card + .card { margin-top: 1.25rem; }

/* ---------- Ranking ---------- */
.podio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: end; max-width: 820px; margin: 0 auto; }
.podio-lugar {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    text-align: center;
    padding: 1.2rem .8rem 0;
}
.podio-lugar strong { font-size: .98rem; }
.podio-monto { font-weight: 800; font-size: 1.15rem; }
.podio-premio { max-width: 100%; white-space: normal; text-align: center; justify-content: center; }
.podio-medalla {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
    color: #fff;
    margin-bottom: .2rem;
    box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .6);
}
.lugar-1 .podio-medalla { background: linear-gradient(135deg, #fde047, #f59e0b); width: 54px; height: 54px; font-size: 1.15rem; animation: aparecerPop .7s .2s cubic-bezier(.3, 1.6, .5, 1) both; }
.lugar-2 .podio-medalla { background: linear-gradient(135deg, #e2e8f0, #94a3b8); }
.lugar-3 .podio-medalla { background: linear-gradient(135deg, #fdba74, #c2410c); }
.lugar-1 .avatar { box-shadow: 0 0 0 3px #fbbf24, var(--sombra-acento); }
.podio-base {
    width: 100%;
    margin-top: .8rem;
    border-radius: 16px 16px 0 0;
    background: var(--superficie);
    border: 1px solid var(--borde);
    border-bottom: none;
}
.lugar-1 .podio-base { height: 110px; background: linear-gradient(180deg, rgba(251, 191, 36, .25), var(--superficie)); }
.lugar-2 .podio-base { height: 80px; }
.lugar-3 .podio-base { height: 55px; }
.puesto {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: inline-grid;
    place-items: center;
    font-weight: 800;
    font-size: .82rem;
    background: var(--superficie-3);
}
.puesto-1 { background: linear-gradient(135deg, #fde047, #f59e0b); color: #1f1300; }
.puesto-2 { background: linear-gradient(135deg, #e2e8f0, #94a3b8); color: #0f172a; }
.puesto-3 { background: linear-gradient(135deg, #fdba74, #c2410c); color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .barra-movil { display: flex; }
    .menu-lateral {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        background: var(--superficie-solida);
        transform: translateX(-105%);
        transition: transform .3s cubic-bezier(.2, .7, .2, 1);
        box-shadow: var(--sombra);
    }
    .menu-lateral.abierto { transform: none; }
    .menu-lateral.abierto ~ .menu-fondo {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 44;
        background: rgba(0, 0, 0, .45);
        animation: aparecerFondo .25s ease both;
    }
    @keyframes aparecerFondo { from { opacity: 0; } to { opacity: 1; } }
}

@media (max-width: 640px) {
    .podio { gap: .5rem; }
    .podio-lugar strong { font-size: .85rem; }
    .podio-premio { display: none; }
    .total-grande { font-size: 2.1rem; }
}

/* ---------- Responsive general ---------- */
@media (max-width: 900px) {
    .grid-principal { grid-template-columns: 1fr; }
    .layout-lateral { grid-template-columns: 1fr; }
    .layout-lateral > .card { position: static; order: -1; }
    .nav-toggle { display: inline-grid; }
    .nav {
        position: absolute;
        top: calc(100% + 8px);
        right: 1rem;
        left: 1rem;
        flex-direction: column;
        align-items: stretch;
        padding: .6rem;
        border-radius: 18px;
        background: var(--superficie-solida);
        border: 1px solid var(--borde-fuerte);
        box-shadow: var(--sombra);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px) scale(.98);
        transition: opacity .2s, transform .2s, visibility .2s;
    }
    .nav.abierto { opacity: 1; visibility: visible; transform: none; }
    .nav a, .nav .nav-boton { padding: .75rem .9rem; width: 100%; }
    .nav .btn { margin: .3rem 0 0; }
}

@media (max-width: 640px) {
    .contenedor { padding-top: 1.4rem; }
    .card { padding: 1.2rem; border-radius: 18px; }
    .campos-2 { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
    .hero { padding-top: 2rem; }
    td.acciones { white-space: normal; }
    .buscador { flex-direction: column; }
    .saldo .stat-valor { font-size: 2.2rem; }
    .ocultar-movil { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
    .revelar { opacity: 1; transform: none; }
}

@media print {
    .app-header, .app-footer, .toasts, .btn, .nav { display: none !important; }
    body { background: #fff; color: #000; }
    .card { box-shadow: none; border-color: #ddd; }
}

/* ===== Marca PuntoToon ===== */
.marca-isotipo { width: 36px; height: 36px; flex: none; transition: transform .35s cubic-bezier(.34,1.56,.64,1); }
.marca:hover .marca-isotipo { transform: rotate(-10deg) scale(1.08); }
.marca-nombre { font-family: "Fredoka", "Plus Jakarta Sans", system-ui, sans-serif; font-weight: 700; font-size: 1.3rem; letter-spacing: -.01em; }
.marca-texto small.marca-nombre { font-size: .78rem; font-weight: 600; }

/* ===== Portal de clientes ===== */
.auth-logo { width: 64px; height: 64px; display: block; margin: 0 0 1rem; animation: aparecerPop .6s cubic-bezier(.3, 1.6, .5, 1) both; }
.resultado-icono.error { background: var(--error-suave); color: var(--error); box-shadow: none; }
.btn-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: inherit; text-decoration: underline; cursor: pointer; }
.peligro-texto { color: var(--error); }
.peligro-texto:hover { background: var(--error-suave); color: var(--error); }

.comercio-logo { width: 46px; height: 46px; flex: none; border-radius: 14px; object-fit: cover; background: var(--superficie-2); }
.comercio-logo.grande { width: 64px; height: 64px; border-radius: 18px; }
.comercio-inicial { display: grid; place-items: center; background: var(--grad); color: #fff; font-family: "Fredoka", "Plus Jakarta Sans", sans-serif; font-weight: 700; font-size: 1.3rem; }
.comercio-logo.grande.comercio-inicial { font-size: 1.7rem; }

.grid-adhesiones { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.1rem; }
.adhesion { display: flex; flex-direction: column; gap: 1rem; }
.adhesion-cabecera { display: flex; align-items: center; gap: .8rem; }
.adhesion-nombre { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.adhesion-nombre strong { font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adhesion-nombre small { color: var(--tenue); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adhesion-puntos { display: flex; align-items: baseline; gap: .45rem; }
.adhesion-puntos span { font-family: "Fredoka", "Plus Jakarta Sans", sans-serif; font-weight: 700; font-size: 2.6rem; line-height: 1; }
.adhesion-puntos small { color: var(--suave); font-weight: 600; }
.adhesion-progreso { display: flex; flex-direction: column; gap: .45rem; }
.adhesion-progreso small { color: var(--suave); }
.adhesion-ok { display: flex; align-items: center; gap: .4rem; margin: 0; color: var(--ok); font-weight: 600; font-size: .9rem; }
.adhesion-acciones { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: auto; padding-top: .9rem; border-top: 1px solid var(--borde); }

.sugerencias { margin-bottom: 1.25rem; border-color: var(--acento); }
.lista-sugerencias { display: flex; flex-direction: column; gap: .6rem; margin-top: .8rem; }
.sugerencia { display: flex; align-items: center; gap: .8rem; padding: .6rem .8rem; border-radius: 14px; background: var(--superficie-2); }
.sugerencia strong { flex: 1; }

.grid-comercios { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.1rem; }
.comercio-tarjeta { display: flex; flex-direction: column; align-items: flex-start; gap: .45rem; position: relative; }
.comercio-tarjeta h3 { margin: .5rem 0 0; }
.comercio-tarjeta form, .comercio-tarjeta > .btn { margin-top: auto; width: 100%; padding-top: .6rem; }
.comercio-dato { display: flex; align-items: center; gap: .35rem; margin: 0; font-size: .88rem; }
.comercio-estado { position: absolute; top: 1rem; right: 1rem; }

/* Ventana de confirmación */
.modal { width: min(440px, calc(100% - 32px)); padding: 1.8rem; border: 1px solid var(--borde); border-radius: 22px; background: var(--superficie-solida); color: var(--texto); box-shadow: var(--sombra); }
.modal[open] { animation: notifEntrar .25s cubic-bezier(.2, .9, .3, 1.2) both; }
.modal::backdrop { background: rgba(5, 8, 15, .65); backdrop-filter: blur(4px); }
.modal h2 { margin: 0 0 1rem; font-size: 1.25rem; }
.modal-icono { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 1rem; border-radius: 18px; background: var(--error-suave); color: var(--error); }
.modal .check { margin: .4rem 0 1.2rem; }
.modal-acciones { display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; }
.modal-acciones .btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
[hidden] { display: none !important; }

/* Menú superior del cliente */
.nav a.nav-icono { display: inline-flex; align-items: center; gap: .4rem; }
.badge-app { display: inline-flex; align-items: center; gap: .25rem; margin-left: .4rem; padding: .1rem .45rem; border-radius: 99px; font-size: .68rem; font-weight: 700; background: var(--acento-suave); color: var(--acento-texto); vertical-align: middle; }

.bloque-clientes { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2rem; padding: 2.2rem; }
.bloque-clientes h2 { margin: .8rem 0 .5rem; }
.bloque-clientes-logo { width: 170px; height: 170px; animation: flotar 5s ease-in-out infinite; filter: drop-shadow(0 20px 40px rgba(99, 102, 241, .35)); }
@keyframes flotar { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-10px) rotate(3deg); } }
.lista-beneficios-cliente { list-style: none; padding: 0; margin: 1rem 0 1.4rem; display: grid; gap: .45rem; }
.lista-beneficios-cliente li { display: flex; align-items: center; gap: .5rem; }
.lista-beneficios-cliente svg { color: var(--ok); }
@media (max-width: 720px) {
    .bloque-clientes { grid-template-columns: 1fr; padding: 1.5rem; }
    .bloque-clientes-logo { width: 110px; height: 110px; order: -1; }
}

.vincular-app { margin-bottom: 1.25rem; }
.vincular-app summary { display: flex; align-items: center; gap: .5rem; cursor: pointer; font-weight: 600; color: var(--acento-texto); list-style: none; }
.vincular-app summary::-webkit-details-marker { display: none; }


/* ===== Combos (select), manito y detalles ===== */
button, select, summary, label.check, .segmentado label, input[type=checkbox], input[type=radio],
input[type=file], input[type=file]::file-selector-button, [role=button], a.btn { cursor: pointer; }
button:disabled, select:disabled { cursor: not-allowed; }

select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.6rem !important;
    background-image: var(--flecha-select);
    background-repeat: no-repeat;
    background-position: right .9rem center;
    background-size: 16px;
    font-weight: 600;
}
select:hover { border-color: var(--sec-borde); }
select option, select optgroup {
    background-color: var(--superficie-solida);
    color: var(--texto);
    font-weight: 500;
    padding: .5rem;
}
select option:checked { background-color: var(--acento); color: #fff; }
.encabezado-pagina select { width: auto; min-width: 190px; }

.tenue { color: var(--tenue); }
.celda-email { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.celda-email a { color: var(--suave); }
.celda-email a:hover { color: var(--acento-texto); }

/* ===== Ventana de confirmación ===== */
.modal-texto { margin: -.4rem 0 1.4rem; color: var(--suave); line-height: 1.55; }
.modal-icono.envio, .modal-icono.aviso { background: var(--acento-suave); color: var(--acento-texto); }
.modal-icono.aviso { background: var(--aviso-suave); color: var(--aviso); }
.modal-acciones .btn { min-width: 120px; }

/* ===== Contador de copias: opciones y precios lado a lado ===== */
.copias-config { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin-top: 1.25rem; align-items: stretch; }
.copias-config > .card { margin-top: 0; }
.copias-config .segmentado { width: 100%; }
.copias-config .segmentado label { flex: 1; text-align: center; }
.lista-precios { display: flex; flex-direction: column; gap: .55rem; }
.fila-precio { display: grid; grid-template-columns: minmax(0, 1fr) 120px; align-items: center; gap: .75rem; }
.fila-precio label { margin: 0; color: var(--texto); font-weight: 500; }
.fila-precio input { padding: .5rem .7rem !important; text-align: right; font-variant-numeric: tabular-nums; }
.lista-precios .btn { margin-top: .6rem; }
@media (max-width: 1250px) { .copias-config { grid-template-columns: 1fr; } }

/* ===== Ranking: top 10 a lo ancho y premios abajo ===== */
.ranking-cuerpo { display: flex; flex-direction: column; gap: 1.25rem; margin-top: 1.5rem; }
.ranking-cuerpo > .card { margin-top: 0; }
.ranking-premios { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.ranking-felicitar { padding: 1.2rem; border-radius: 16px; background: var(--superficie-2); border: 1px solid var(--borde); }
@media (max-width: 800px) { .ranking-premios { grid-template-columns: 1fr; } }

/* ===== Importar y borrar datos ===== */
.zona-archivo-db { min-height: 130px; margin-bottom: 1rem; }
.zona-archivo-db.con-archivo { border-color: var(--ok); background: var(--ok-suave); }
.zona-archivo-db.con-archivo strong { color: var(--ok); }
.pasos-importar { margin: .8rem 0 1.1rem; padding-left: 1.2rem; color: var(--suave); display: grid; gap: .3rem; }
.pasos-importar code { background: var(--superficie-3); padding: .1rem .4rem; border-radius: 6px; color: var(--texto); }
.resumen-importacion { margin-bottom: 1.25rem; border-color: var(--ok); }
.resumen-importacion .stat-valor small { font-size: .8rem; color: var(--suave); font-weight: 600; }
.lista-avisos { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .5rem; }
.lista-avisos li { display: flex; gap: .5rem; align-items: flex-start; color: var(--suave); font-size: .9rem; }
.lista-avisos svg { flex: none; color: var(--aviso); margin-top: .15rem; }
.zona-peligro { margin-top: 1.25rem; border-color: rgba(248, 113, 113, .35); }
.zona-peligro h2 { color: var(--error); }
.enlace-datos { display: flex; align-items: center; gap: 1rem; margin-top: 1.25rem; color: var(--texto); }
.enlace-datos > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.enlace-datos small { color: var(--suave); }
.btn:focus-visible, select:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }
.modal .btn:focus { outline: none; }
.modal .btn:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }

/* =====================================================================
   Notificaciones
   ===================================================================== */
.menu-cabecera { display: flex; align-items: center; gap: .4rem; }
.menu-cabecera .marca { flex: 1; min-width: 0; margin: 0; }
.menu-cabecera .marca-texto strong { max-width: 130px; }
.barra-movil-acciones { display: flex; align-items: center; gap: .4rem; }

.notif { position: relative; flex: none; }
.notif-boton { position: relative; }
.notif-boton .icono { transform-origin: 50% 10%; }
.notif-boton:has(.notif-contador:not([hidden])) .icono { animation: campana 2.4s ease-in-out infinite; }
@keyframes campana {
    0%, 70%, 100% { transform: rotate(0); }
    75% { transform: rotate(14deg); } 80% { transform: rotate(-12deg); }
    85% { transform: rotate(8deg); } 90% { transform: rotate(-5deg); }
}
.notif-contador {
    position: absolute; top: -5px; right: -6px;
    min-width: 19px; height: 19px; padding: 0 5px;
    display: grid; place-items: center;
    border-radius: 99px; background: linear-gradient(135deg, #f43f5e, #e11d48); color: #fff;
    font-size: .68rem; font-weight: 800; line-height: 1;
    border: 2px solid var(--superficie-solida);
    box-shadow: 0 4px 10px -2px rgba(244, 63, 94, .6);
}
.notif-panel { display: none; }
.notif-panel.notif-flotante:not([hidden]) {
    display: flex; flex-direction: column;
    position: fixed; z-index: 70;
    max-height: min(560px, calc(100vh - 90px));
    background: var(--superficie-solida);
    border: 1px solid var(--borde-fuerte);
    border-radius: 20px;
    box-shadow: var(--sombra), 0 30px 60px -20px rgba(0, 0, 0, .55);
    overflow: hidden;
    animation: notifEntrar .22s cubic-bezier(.2, .9, .3, 1.2) both;
}
@keyframes notifEntrar { from { opacity: 0; transform: translateY(-8px) scale(.97); } to { opacity: 1; transform: none; } }
.notif-cabecera { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.1rem .8rem; border-bottom: 1px solid var(--borde); }
.notif-cabecera strong { font-size: 1rem; }
.notif-cabecera .btn-link { font-size: .8rem; font-weight: 600; color: var(--acento-texto); text-decoration: none; }
.notif-cabecera .btn-link:hover { text-decoration: underline; }
.notif-lista { overflow-y: auto; flex: 1; padding: .35rem; }
.notif-ver-todas { display: flex; align-items: center; justify-content: center; gap: .4rem; padding: .85rem; border-top: 1px solid var(--borde); font-weight: 700; font-size: .88rem; color: var(--acento-texto); }
.notif-ver-todas:hover { background: var(--superficie-2); }

.notif-item {
    position: relative; display: flex; gap: .8rem; align-items: flex-start;
    padding: .75rem .8rem; border-radius: 14px; color: var(--texto);
    transition: background .15s;
}
.notif-item:hover { background: var(--superficie-2); color: var(--texto); }
.notif-item.no-leida { background: var(--acento-suave); }
.notif-item.no-leida:hover { background: var(--sec-bg-hover); }
.notif-icono { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--superficie-3); color: var(--acento-texto); }
.notif-logo { object-fit: cover; padding: 0; }
.notif-icono.tipo-pedido { background: rgba(56, 189, 248, .15); color: #38bdf8; }
.notif-icono.tipo-compra, .notif-icono.tipo-adhesion, .notif-icono.tipo-vinculo { background: var(--ok-suave); color: var(--ok); }
.notif-icono.tipo-canje, .notif-icono.tipo-promocion { background: var(--acento-suave); color: var(--acento-texto); }
.notif-icono.tipo-regalo, .notif-icono.tipo-ranking { background: var(--aviso-suave); color: var(--aviso); }
.notif-icono.tipo-baja { background: var(--error-suave); color: var(--error); }
.notif-texto { display: flex; flex-direction: column; gap: .15rem; min-width: 0; flex: 1; }
.notif-texto strong { font-size: .9rem; line-height: 1.3; }
.notif-texto > span { font-size: .84rem; color: var(--suave); line-height: 1.4; }
.notif-texto small { font-size: .74rem; color: var(--tenue); }
.notif-punto { width: 9px; height: 9px; flex: none; margin-top: .4rem; border-radius: 50%; background: var(--grad); box-shadow: 0 0 0 3px var(--acento-suave); }
.notif-vacio { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 2.2rem 1rem; color: var(--tenue); text-align: center; }
.notif-vacio p { margin: 0; }
.notif-cargando { display: flex; justify-content: center; gap: .35rem; padding: 2rem; }
.notif-cargando span { width: 8px; height: 8px; border-radius: 50%; background: var(--acento); animation: puntos 1s infinite ease-in-out; }
.notif-cargando span:nth-child(2) { animation-delay: .15s; }
.notif-cargando span:nth-child(3) { animation-delay: .3s; }
@keyframes puntos { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }
.notif-pagina { padding: .6rem; }
.notif-dia { margin: .9rem .8rem .4rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--tenue); }
.notif-pagina .notif-dia:first-child { margin-top: .4rem; }
.notif-toast { color: var(--texto); }
.notif-toast:hover { color: var(--texto); border-color: var(--sec-borde); }
.notif-toast .toast-icono { background: var(--acento-suave); color: var(--acento-texto); }

/* =====================================================================
   Chips, stepper, regalo
   ===================================================================== */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .35rem .8rem; border-radius: 99px;
    border: 1px solid var(--fan-borde); background: var(--fan-bg); color: var(--suave);
    font: inherit; font-size: .82rem; font-weight: 600; transition: all .15s;
}
.chip:hover { color: var(--texto); border-color: var(--sec-borde); }
.chip.activo { background: var(--acento-suave); color: var(--acento-texto); border-color: var(--sec-borde); }
.chip-chico { padding: .1rem .5rem; font-size: .72rem; }
.regalo-rapidos { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .5rem; }
.modal-icono.regalo { background: var(--aviso-suave); color: var(--aviso); }
.modal .campo { margin-bottom: 1rem; }

.stepper { display: inline-flex; align-items: center; gap: .3rem; }
.stepper form { margin: 0; }
.stepper input { width: 64px !important; flex: none; text-align: center; padding: .4rem .3rem !important; font-weight: 700; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper .btn { width: 34px; height: 34px; padding: 0; justify-content: center; }

.stat-icono.aviso { background: var(--aviso-suave); color: var(--aviso); }
.stat-icono.error { background: var(--error-suave); color: var(--error); }
.stat-icono.ok { background: var(--ok-suave); color: var(--ok); }
.contador-mini { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: .3rem; border-radius: 99px; background: var(--aviso); color: #111; font-size: .7rem; font-weight: 800; }
.badge.info { background: rgba(56, 189, 248, .15); color: #38bdf8; }
.barra-filtros { display: flex; flex-direction: column; gap: .8rem; margin-bottom: 1.1rem; }
.barra-filtros .buscador { margin: 0; }

/* =====================================================================
   Productos (comercio)
   ===================================================================== */
.productos-lista { display: flex; flex-direction: column; gap: .7rem; }
.producto-fila { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto; align-items: center; gap: 1rem; padding: .8rem 1rem; margin: 0; }
/* "no-publicado" y no "oculto": la clase global .oculto hace display:none y el producto desaparecía. */
.producto-fila.no-publicado { opacity: .6; }
.producto-foto { position: relative; width: 64px; height: 64px; border-radius: 14px; overflow: hidden; display: grid; place-items: center; background: var(--superficie-2); color: var(--tenue); cursor: pointer; margin: 0; }
.producto-foto img { width: 100%; height: 100%; object-fit: cover; }
.producto-foto input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.producto-foto:hover::after { content: "Cambiar"; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .55); color: #fff; font-size: .72rem; font-weight: 700; pointer-events: none; }
.producto-info { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.producto-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.producto-info small { display: flex; gap: .3rem; flex-wrap: wrap; }
.producto-precio { font-family: "Fredoka", "Plus Jakarta Sans", sans-serif; font-weight: 700; font-size: 1.15rem; }
.producto-stock { display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.producto-stock-etiqueta { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--tenue); font-weight: 700; }
.producto-stock-estado { font-size: .74rem; font-weight: 700; }
.stock-ok .producto-stock-estado { color: var(--ok); }
.stock-bajo .producto-stock-estado { color: var(--aviso); }
.stock-sin .producto-stock-estado { color: var(--error); }
.stock-sin .stepper input { border-color: var(--error) !important; }
.stock-bajo .stepper input { border-color: var(--aviso) !important; }
.producto-acciones { display: flex; gap: .35rem; }
.producto-acciones form { margin: 0; }
@media (max-width: 760px) {
    .producto-fila { grid-template-columns: 56px minmax(0, 1fr); }
    .producto-stock, .producto-acciones { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; }
}

/* =====================================================================
   Pedidos (comercio y cliente)
   ===================================================================== */
.pedidos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.1rem; align-items: start; }
.pedido { display: flex; flex-direction: column; gap: .9rem; margin: 0; }
.pedido.resaltado { border-color: var(--acento); box-shadow: 0 0 0 3px var(--acento-suave), var(--sombra); }
.pedido-cabecera { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; }
.pedido-cabecera > div:first-child { display: flex; flex-direction: column; }
.pedido-numero { font-family: "Fredoka", "Plus Jakarta Sans", sans-serif; font-size: 1.2rem; }
.pedido-cabecera small, .pedido-comercio small { color: var(--tenue); font-size: .8rem; }
.pedido-comercio { display: flex !important; flex-direction: row !important; align-items: center; gap: .7rem; }
.pedido-comercio > div { display: flex; flex-direction: column; }
.pedido-cliente { display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem; border-radius: 14px; background: var(--superficie-2); color: var(--texto); }
.pedido-cliente:hover { color: var(--texto); background: var(--superficie-3); }
.pedido-cliente > span:last-child { display: flex; flex-direction: column; }
.pedido-cliente small { color: var(--tenue); }
.pedido-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; font-size: .9rem; }
.pedido-items li { display: flex; justify-content: space-between; gap: 1rem; }
.pedido-items li > span:last-child { font-variant-numeric: tabular-nums; color: var(--suave); white-space: nowrap; }
.pedido-total { padding-top: .5rem; margin-top: .2rem; border-top: 1px dashed var(--borde-fuerte); font-weight: 800; }
.pedido-total > span:last-child { color: var(--texto) !important; font-size: 1.05rem; }
.pedido-nota, .pedido-respuesta { display: flex; gap: .4rem; align-items: flex-start; margin: 0; font-size: .86rem; color: var(--suave); }
.pedido-nota { padding: .55rem .7rem; border-radius: 12px; background: var(--aviso-suave); color: var(--texto); }
.pedido-acciones { display: flex; flex-direction: column; gap: .6rem; margin: 0; padding-top: .8rem; border-top: 1px solid var(--borde); }
.pedido-acciones .check { margin: 0; font-size: .86rem; }
.pedido-botones { display: flex; flex-wrap: wrap; gap: .45rem; }

.progreso-pedido { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); }
.progreso-pedido li { position: relative; display: flex; flex-direction: column; align-items: center; gap: .35rem; text-align: center; }
.progreso-pedido li::before { content: ""; position: absolute; top: 7px; left: -50%; right: 50%; height: 3px; background: var(--superficie-3); }
.progreso-pedido li:first-child::before { display: none; }
.progreso-pedido li span { position: relative; z-index: 1; width: 17px; height: 17px; border-radius: 50%; background: var(--superficie-3); border: 3px solid var(--superficie-solida); }
.progreso-pedido li small { font-size: .7rem; color: var(--tenue); font-weight: 600; }
.progreso-pedido li.hecho span, .progreso-pedido li.actual span { background: var(--acento); }
.progreso-pedido li.hecho::before, .progreso-pedido li.actual::before { background: var(--grad); }
.progreso-pedido li.actual span { box-shadow: 0 0 0 4px var(--acento-suave); animation: latir 1.8s infinite; }
.progreso-pedido li.actual small, .progreso-pedido li.hecho small { color: var(--texto); }
@keyframes latir { 50% { box-shadow: 0 0 0 7px transparent; } }

/* =====================================================================
   Tienda (cliente)
   ===================================================================== */
.tiendas-selector { display: flex; gap: .6rem; overflow-x: auto; padding-bottom: .4rem; margin-bottom: 1.2rem; }
.tienda-chip { display: flex; align-items: center; gap: .55rem; flex: none; padding: .45rem .9rem .45rem .45rem; border-radius: 99px; border: 1px solid var(--borde-fuerte); background: var(--superficie); color: var(--texto); font-weight: 600; }
.tienda-chip img, .tienda-chip .comercio-inicial { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; font-size: .9rem; }
.tienda-chip small { padding: .05rem .45rem; border-radius: 99px; background: var(--superficie-3); color: var(--suave); font-size: .72rem; }
.tienda-chip.activo { border-color: var(--acento); background: var(--acento-suave); color: var(--acento-texto); }

.tienda { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.25rem; align-items: start; }
.tienda-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; }
.tienda-producto { display: flex; flex-direction: column; padding: 0; overflow: hidden; margin: 0; transition: border-color .2s, transform .2s, box-shadow .2s; }
.tienda-producto:hover { transform: translateY(-3px); }
.tienda-producto.elegido { border-color: var(--acento); box-shadow: 0 0 0 3px var(--acento-suave); }
.tienda-producto.agotado { opacity: .55; }
.tienda-foto { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; background: var(--superficie-2); color: var(--tenue); }
.tienda-foto img { width: 100%; height: 100%; object-fit: cover; }
.tienda-foto .badge { position: absolute; top: .6rem; left: .6rem; backdrop-filter: blur(6px); }
.tienda-cuerpo { display: flex; flex-direction: column; gap: .3rem; padding: .9rem 1rem 1rem; flex: 1; }
.tienda-cuerpo h3 { margin: 0; font-size: 1rem; line-height: 1.3; }
.tienda-cuerpo p { margin: 0; font-size: .84rem; color: var(--suave); }
.tienda-cat { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--acento-texto); }
.tienda-pie { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; padding-top: .6rem; flex-wrap: wrap; }
.tienda-precio { font-family: "Fredoka", "Plus Jakarta Sans", sans-serif; font-size: 1.25rem; font-weight: 700; }
.tienda-pie .stepper input { width: 46px !important; }
.tienda-pie .stepper .btn { width: 30px; height: 30px; }

.carrito { position: sticky; top: 24px; margin: 0; }
.carrito-comercio { margin: -.4rem 0 .8rem; color: var(--suave); font-size: .9rem; }
.carrito-lista { list-style: none; margin: 0 0 .8rem; padding: 0; display: flex; flex-direction: column; gap: .45rem; max-height: 280px; overflow-y: auto; font-size: .9rem; }
.carrito-lista li { display: flex; justify-content: space-between; gap: .8rem; }
.carrito-lista li > span:last-child { white-space: nowrap; color: var(--suave); }
.carrito-vacio { color: var(--tenue); justify-content: center !important; padding: 1rem 0; }
.carrito-total { display: flex; justify-content: space-between; align-items: baseline; padding: .8rem 0; margin-bottom: .8rem; border-top: 1px dashed var(--borde-fuerte); border-bottom: 1px dashed var(--borde-fuerte); }
.carrito-total strong { font-family: "Fredoka", "Plus Jakarta Sans", sans-serif; font-size: 1.6rem; }
.carrito textarea { resize: vertical; }
.carrito .btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
@media (max-width: 1000px) {
    .tienda { grid-template-columns: 1fr; }
    .carrito { position: sticky; bottom: 0; top: auto; z-index: 20; border-radius: 20px 20px 0 0; }
    .carrito-lista { max-height: 120px; }
}

/* En las grillas, las tarjetas no llevan el margen de ".card + .card" (si no, todas menos la primera quedan corridas). */
.grid-comercios > .card, .grid-adhesiones > .card, .pedidos-grid > .card, .tienda-grid > .card,
.productos-lista > .card, .premios-grid > .card, .grid-planes > .card { margin-top: 0; }
.grid-comercios { align-items: stretch; }
.comercio-tarjeta { height: 100%; }

/* =====================================================================
   Barra superior fija del comercio (cuenta siempre visible)
   ===================================================================== */
.con-menu { --alto-barra: 64px; }
.barra-movil { display: none !important; }
.barra-superior {
    position: sticky; top: 0; z-index: 40;
    height: var(--alto-barra);
    display: flex; align-items: center; gap: .9rem;
    padding: 0 1.4rem;
    background: var(--header-bg);
    backdrop-filter: saturate(160%) blur(16px);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
    border-bottom: 1px solid var(--borde);
}
.boton-menu, .marca-barra { display: none; }
.barra-titulo { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.barra-titulo small { font-size: .72rem; color: var(--tenue); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra-titulo strong { font-size: 1.02rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra-cuenta { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.barra-cuenta form { margin: 0; }
.boton-barra, .barra-plan {
    height: 40px; display: inline-flex; align-items: center; gap: .45rem;
    padding: 0 .85rem; border-radius: 12px;
    border: 1px solid var(--borde); background: var(--superficie-2);
    color: var(--texto); font: inherit; font-size: .88rem; font-weight: 600;
    transition: border-color .2s, background .2s, transform .2s;
}
.boton-barra:hover, .barra-plan:hover { color: var(--texto); border-color: var(--borde-fuerte); transform: translateY(-1px); }
.boton-barra.activo { border-color: var(--sec-borde); background: var(--acento-suave); color: var(--acento-texto); }
.barra-plan.plan-activo { background: var(--ok-suave); border-color: rgba(52, 211, 153, .35); color: var(--ok); }
.barra-plan.plan-prueba { background: var(--acento-suave); border-color: var(--sec-borde); color: var(--acento-texto); }
.boton-salir:hover { border-color: rgba(248, 113, 113, .5); color: var(--error); background: var(--error-suave); }
.barra-separador { width: 1px; height: 26px; background: var(--borde-fuerte); margin: 0 .2rem; }
.barra-usuario { display: flex; align-items: center; gap: .5rem; max-width: 170px; font-size: .88rem; font-weight: 600; }
.barra-usuario .barra-texto { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar.chico { width: 34px; height: 34px; border-radius: 11px; font-size: .78rem; flex: none; }
.solo-movil { display: none !important; }
.menu-pie-plan { display: block; padding-top: .8rem; border-top: 1px solid var(--borde); }
.menu-pie-plan .badge { width: 100%; justify-content: center; padding: .45rem .6rem; }

/* Los paneles "pegajosos" quedan debajo de la barra. */
.con-menu .layout-lateral > .card, .con-menu .resumen-copias { top: calc(var(--alto-barra) + 20px); }

@media (max-width: 1350px) {
    .barra-usuario .barra-texto { display: none; }
}
@media (max-width: 1100px) {
    .barra-superior { padding: 0 .9rem; gap: .6rem; }
    .boton-menu { display: inline-grid; }
    .barra-titulo { display: none; }
    .marca-barra { display: flex; align-items: center; gap: .55rem; margin: 0; min-width: 0; flex: 1; font-weight: 700; color: var(--texto); }
    .marca-barra img { width: 30px; height: 30px; border-radius: 9px; object-fit: cover; flex: none; }
    .marca-barra span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .boton-barra .barra-texto { display: none; }
    .boton-barra { width: 40px; padding: 0; justify-content: center; }
    .menu-lateral { padding-top: 1.1rem; }
}
@media (max-width: 640px) {
    .con-menu { --alto-barra: 58px; }
    .barra-cuenta { gap: .35rem; }
    .barra-plan .barra-texto, .barra-separador, .barra-usuario { display: none; }
    .barra-plan { width: 40px; padding: 0; justify-content: center; }
    .solo-movil { display: flex !important; }
    span.solo-movil { display: block !important; }
}
@media (max-width: 400px) {
    .barra-cuenta .boton-barra[href="/Configuracion"] { display: none; }
}

/* =====================================================================
   Portada: elegir comercio o cliente
   ===================================================================== */
.portada[data-audiencia=""] [data-para], .portada[data-audiencia=""] .selector-audiencia { display: none; }
.portada[data-audiencia="comercio"] [data-para="cliente"],
.portada[data-audiencia="cliente"] [data-para="comercio"],
.portada[data-audiencia="comercio"] .eleccion,
.portada[data-audiencia="cliente"] .eleccion { display: none; }
.portada[data-audiencia="todo"] .selector-audiencia { display: none; }

.eleccion { position: relative; text-align: center; padding: 4rem 0 3rem; min-height: calc(100vh - 220px); display: flex; flex-direction: column; justify-content: center; }
.eleccion-logo { width: 84px; height: 84px; margin: 0 auto 1.2rem; animation: flotar 5s ease-in-out infinite; filter: drop-shadow(0 18px 36px rgba(99, 102, 241, .35)); }
.eleccion h1 { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -0.03em; margin-bottom: .8rem; }
.eleccion h1 .texto-gradiente, .eleccion h1 { font-family: "Fredoka", "Plus Jakarta Sans", sans-serif; }
.eleccion .bajada { max-width: 560px; margin: 0 auto 2.2rem; color: var(--suave); font-size: 1.12rem; }
.eleccion-opciones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; max-width: 820px; margin: 0 auto 1.5rem; width: 100%; }
.eleccion-opcion {
    display: flex; flex-direction: column; align-items: flex-start; gap: .55rem; text-align: left;
    padding: 1.8rem; margin: 0; font: inherit; color: var(--texto); cursor: pointer;
    transition: transform .25s cubic-bezier(.2, .8, .3, 1.2), border-color .2s, box-shadow .25s;
}
.eleccion-opcion:hover { transform: translateY(-6px); border-color: var(--acento); box-shadow: 0 0 0 4px var(--acento-suave), var(--sombra-acento); }
.eleccion-opcion strong { font-size: 1.35rem; font-family: "Fredoka", "Plus Jakarta Sans", sans-serif; }
.eleccion-opcion > span:not(.eleccion-icono):not(.eleccion-ir) { color: var(--suave); line-height: 1.5; }
.eleccion-icono { width: 60px; height: 60px; display: grid; place-items: center; border-radius: 18px; background: var(--grad); color: #fff; margin-bottom: .4rem; box-shadow: var(--sombra-acento); }
.eleccion-icono.cliente { background: linear-gradient(135deg, #f59e0b, #ec4899); box-shadow: 0 12px 32px -12px rgba(236, 72, 153, .6); }
.eleccion-ir { display: inline-flex; align-items: center; gap: .35rem; margin-top: auto; padding-top: .6rem; color: var(--acento-texto); font-weight: 700; font-size: .92rem; }
.eleccion-opcion:hover .eleccion-ir svg { transform: translateX(4px); }
.eleccion-ir svg { transition: transform .2s; }

.selector-audiencia {
    position: sticky; top: 76px; z-index: 30;
    display: flex; align-items: center; justify-content: center; gap: .8rem; flex-wrap: wrap;
    width: fit-content; max-width: 100%; margin: 1.2rem auto 0; padding: .4rem .5rem .4rem 1rem;
    border-radius: 99px; border: 1px solid var(--borde-fuerte);
    background: var(--header-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--sombra);
}
.selector-audiencia > span { font-size: .85rem; color: var(--suave); font-weight: 600; }
.selector-audiencia .segmentado { margin: 0; }
.selector-audiencia .segmentado button {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .45rem 1rem; border: 0; border-radius: 10px; background: transparent;
    color: var(--suave); font: inherit; font-size: .88rem; font-weight: 700; cursor: pointer;
}
.selector-audiencia .segmentado button.activo { background: var(--grad); color: #fff; box-shadow: var(--sombra-acento); }
.hero-cliente .hero-chip .badge { background: var(--acento-suave); }
.precio-pesos { margin: -.3rem 0 .8rem; font-size: .82rem; color: var(--tenue); }
.pasos-cliente { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; }
.pasos-cliente > li { margin: 0 !important; display: flex; flex-direction: column; gap: .5rem; }
.pasos-cliente p { color: var(--suave); margin: 0; }
.paso-numero { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--grad); color: #fff; font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 1.2rem; margin-bottom: .3rem; }
@media (max-width: 760px) {
    .eleccion { min-height: auto; padding-top: 2.5rem; }
    .eleccion-opciones, .pasos-cliente { grid-template-columns: 1fr; }
    .selector-audiencia { top: 70px; padding: .35rem; }
    .selector-audiencia > span { display: none; }
}

/* =====================================================================
   Ver / ocultar contraseña
   ===================================================================== */
.input-clave { position: relative; }
.input-clave input { padding-right: 3rem !important; }
.boton-clave {
    position: absolute; right: .35rem; top: 50%; transform: translateY(-50%);
    width: 36px; height: 36px; display: grid; place-items: center;
    border: 0; border-radius: 10px; background: transparent; color: var(--tenue); cursor: pointer;
}
.boton-clave:hover { color: var(--texto); background: var(--superficie-3); }
.boton-clave:focus-visible { outline: 2px solid var(--acento); }

/* =====================================================================
   Clientes: tabla, ficha, compra y canje
   ===================================================================== */
td.col-acciones { display: table-cell; width: 1%; white-space: nowrap; text-align: right; }
td.col-acciones > * { vertical-align: middle; }
td.col-acciones > * + * { margin-left: .35rem; }
.celda-email { max-width: 210px; }

.encabezado-cliente { display: flex; align-items: center; gap: 1rem; flex-wrap: nowrap; }
.encabezado-cliente .persona { flex: 1; min-width: 0; }
.encabezado-cliente h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.datos-cliente { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin: .35rem 0 0 !important; font-size: .9rem; }
.datos-cliente span { display: inline-flex; align-items: center; gap: .3rem; }
.boton-volver { flex: none; }
@media (max-width: 760px) {
    .encabezado-cliente { flex-wrap: wrap; }
    .encabezado-cliente .persona { order: 2; flex-basis: 100%; }
    .encabezado-cliente > .btn:last-child { order: 1; margin-left: auto; }
    .boton-volver span { display: none; }
}

.operaciones-cliente { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 1.25rem; align-items: start; }
.operaciones-cliente > .card { margin-top: 0; }
@media (max-width: 1000px) { .operaciones-cliente { grid-template-columns: 1fr; } }
.check.deshabilitado { opacity: .5; cursor: not-allowed; }

.canje .card-titulo { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.buscar-premio { margin-bottom: .8rem; }
.lista-premios-canje { display: flex; flex-direction: column; gap: .45rem; max-height: 360px; overflow-y: auto; padding-right: .2rem; margin-bottom: 1rem; }
.premio-canje { display: flex; align-items: center; gap: .75rem; padding: .5rem .6rem; border-radius: 14px; border: 1px solid var(--borde); background: var(--superficie-2); transition: border-color .15s, background .15s; }
.premio-canje.elegido { border-color: var(--acento); background: var(--acento-suave); }
.premio-canje.no-alcanza:not(.elegido) { opacity: .55; }
.premio-canje-img { width: 44px; height: 44px; flex: none; border-radius: 11px; overflow: hidden; display: grid; place-items: center; background: var(--superficie-3); color: var(--tenue); }
.premio-canje-img img { width: 100%; height: 100%; object-fit: cover; }
.premio-canje-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.premio-canje-texto strong { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.premio-canje-texto small { color: var(--acento-texto); font-weight: 700; }
.premio-canje .stepper input { width: 46px !important; }
.premio-canje .stepper .btn { width: 30px; height: 30px; }
.resumen-canje { padding-top: .9rem; border-top: 1px solid var(--borde); }
.canje-totales { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: .4rem 0 .7rem; }
.canje-totales > div { display: flex; flex-direction: column; padding: .7rem .8rem; border-radius: 14px; background: var(--superficie-2); }
.canje-totales span { font-size: .78rem; color: var(--tenue); font-weight: 600; }
.canje-totales strong { font-family: "Fredoka", "Plus Jakarta Sans", sans-serif; font-size: 1.35rem; }
.canje-totales strong.negativo { color: var(--error); }
.canje-aviso { display: flex; align-items: center; gap: .4rem; margin: 0 0 .7rem; color: var(--error); font-weight: 600; font-size: .88rem; }
.resumen-canje .btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* Copias: cliente encontrado por DNI */
.cliente-encontrado { display: flex; align-items: center; gap: .65rem; margin-top: .55rem; padding: .55rem .7rem; border-radius: 12px; background: var(--ok-suave); border: 1px solid rgba(52, 211, 153, .3); animation: notifEntrar .2s ease both; }
.cliente-encontrado .avatar { width: 34px; height: 34px; border-radius: 10px; font-size: .78rem; }
.cliente-encontrado > span:last-child { display: flex; flex-direction: column; }
.cliente-encontrado small { color: var(--suave); }
.cliente-encontrado.no { display: block; background: var(--aviso-suave); border-color: rgba(251, 191, 36, .3); font-size: .86rem; color: var(--texto); }
.eleccion-opciones > .card, .pasos-cliente > .card, .operaciones-cliente > .card { margin-top: 0; }

/* ---------- Barra superior (v2): plan a la izquierda; usuario, campanita, tema y salir a la derecha ---------- */
.barra-superior .barra-plan { gap: .5rem; font-size: .85rem; }
.barra-superior .barra-plan .punto { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.barra-cuenta { gap: .55rem; }
.barra-usuario { padding-right: .35rem; margin-right: .15rem; border-right: 1px solid var(--borde-fuerte); height: 34px; }
.barra-usuario .barra-texto { display: inline !important; }
.menu-lateral .menu-secciones:not(.menu-cuenta) { flex: 1; }
.menu-cuenta { flex: none !important; padding-top: .6rem; border-top: 1px solid var(--borde); }
@media (max-width: 900px) {
    .barra-usuario .barra-texto { display: none !important; }
    .barra-usuario { border-right: 0; padding-right: 0; margin-right: 0; }
}
@media (max-width: 640px) {
    .barra-usuario { display: flex !important; }
    .barra-superior .barra-plan { width: auto !important; padding: 0 .7rem !important; }
    .barra-superior .barra-plan span:last-child { display: inline !important; }
}
@media (max-width: 440px) {
    .barra-usuario { display: none !important; }
    .barra-superior .barra-plan { font-size: .78rem; }
}

/* ---------- Números de las tarjetas: siempre en una línea (site.js achica la letra si no entra) ---------- */
.stat-valor { display: block; white-space: nowrap; overflow: hidden; max-width: 100%; }

/* ---------- Combo propio (reemplaza la lista nativa del navegador, que en algunos no respeta el modo oscuro) ---------- */
.combo { position: relative; width: 100%; }
.encabezado-pagina .combo, .acciones .combo { width: auto; min-width: 200px; }
.combo > select { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; opacity: 0; pointer-events: none; }
.combo-boton {
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: .6rem;
    padding: .75rem .9rem; border-radius: 12px; border: 1px solid var(--borde-fuerte);
    background: var(--input-bg); color: var(--texto); font: inherit; font-weight: 600; text-align: left;
    cursor: pointer; transition: border-color .2s, box-shadow .2s;
}
.combo-boton:hover { border-color: var(--sec-borde); }
.combo-boton:focus-visible, .combo.abierto .combo-boton { outline: none; border-color: var(--acento); box-shadow: 0 0 0 4px var(--acento-suave); }
.combo-boton:disabled { opacity: .5; cursor: not-allowed; }
.combo-boton > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-boton svg { flex: none; color: var(--acento-texto); transition: transform .2s; }
.combo.abierto .combo-boton svg { transform: rotate(180deg); }
.combo-lista {
    position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60;
    max-height: 290px; overflow-y: auto; margin: 0; padding: .35rem; list-style: none;
    background: var(--superficie-solida); border: 1px solid var(--borde-fuerte); border-radius: 14px;
    box-shadow: var(--sombra), 0 24px 50px -20px rgba(0, 0, 0, .55);
    animation: notifEntrar .16s ease both;
}
.combo.arriba .combo-lista { top: auto; bottom: calc(100% + 6px); }
.combo-lista li {
    display: flex; align-items: center; justify-content: space-between; gap: .6rem;
    padding: .6rem .75rem; border-radius: 10px; cursor: pointer; color: var(--texto); font-weight: 500;
}
.combo-lista li:hover, .combo-lista li.foco { background: var(--superficie-2); }
.combo-lista li[aria-selected="true"] { background: var(--acento-suave); color: var(--acento-texto); font-weight: 700; }
.combo-lista li[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.combo-lista li svg { flex: none; }

/* Lista nativa (celulares): colores fijos para que siempre se lean. */
select option { background-color: #141a28; color: #e9edf5; }
select option:checked { background-color: #6d28d9; color: #ffffff; }
[data-theme="light"] select option { background-color: #ffffff; color: #0f172a; }
[data-theme="light"] select option:checked { background-color: #ede9fe; color: #4c1d95; }

/* ===== Legales, Google, admin ===== */
.enlaces-legales { display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.enlaces-legales a { color: var(--tenue); font-size: .82rem; }
.enlaces-legales a:hover { color: var(--acento-texto); }
.menu-legales { padding: .7rem .7rem 0; gap: .2rem .7rem; }
.menu-legales a { font-size: .72rem; }
.pie-simple { justify-content: center; padding: 1.5rem 1rem 2rem; }
.legal { max-width: 820px; margin: 0 auto; line-height: 1.7; }
.legal h1 { margin-bottom: .3rem; }
.legal h2 { font-size: 1.12rem; margin: 1.6rem 0 .5rem; }
.legal ul { padding-left: 1.2rem; display: grid; gap: .35rem; }
.legal li span { display: block; }
.nota-legal { padding: .8rem 1rem; border-radius: 12px; background: var(--superficie-2); font-size: .88rem; color: var(--suave); }

.form-google { margin: 0 0 .2rem; }
.btn-google { background: #ffffff; color: #1f2937; border: 1px solid #d1d5db; font-weight: 700; gap: .6rem; }
.btn-google:hover { background: #f3f4f6; color: #111827; transform: translateY(-2px); }
.google-letra { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #1f2937; color: #fff; font-size: .8rem; font-weight: 800; }
.separador-o { display: flex; align-items: center; gap: .8rem; margin: 1.1rem 0; color: var(--tenue); font-size: .8rem; }
.separador-o::before, .separador-o::after { content: ""; flex: 1; height: 1px; background: var(--borde-fuerte); }
.opciones-tipo { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.opcion-tipo { margin: 0; cursor: pointer; }
.opcion-tipo input { position: absolute; opacity: 0; pointer-events: none; }
.opcion-tipo > span { display: flex; flex-direction: column; gap: .2rem; height: 100%; padding: .9rem; border-radius: 14px; border: 1px solid var(--borde-fuerte); background: var(--superficie-2); color: var(--texto); transition: border-color .15s, background .15s; }
.opcion-tipo > span svg { color: var(--acento-texto); }
.opcion-tipo small { color: var(--suave); font-weight: 500; }
.opcion-tipo input:checked + span { border-color: var(--acento); background: var(--acento-suave); box-shadow: 0 0 0 3px var(--acento-suave); }
.opcion-tipo input:focus-visible + span { outline: 2px solid var(--acento); }
.form-factura { display: flex; gap: .35rem; align-items: center; margin: 0; }
.form-factura input { width: 120px !important; padding: .4rem .55rem !important; font-size: .82rem; }
@media (max-width: 520px) { .opciones-tipo { grid-template-columns: 1fr; } }

/* =====================================================================
   Importar desde Excel y ajuste masivo de precios
   ===================================================================== */
/* Pila de tarjetas con separación fija (no depende de ".card + .card"). */
.pila-tarjetas { display: grid; gap: 1.25rem; margin-top: 1.25rem; }
.pila-tarjetas > .card { margin-top: 0; }
.importar-dos-columnas { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.importar-dos-columnas .pasos-importar { margin-bottom: 0; }
@media (max-width: 760px) { .importar-dos-columnas { grid-template-columns: 1fr; } }

/* Aumentar o bajar precios (Productos) */
details.ajuste-precios { margin-bottom: 1.1rem; }
details.ajuste-precios summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .4rem 1rem; }
details.ajuste-precios summary::-webkit-details-marker { display: none; }
details.ajuste-precios summary::after { content: "▾"; color: var(--tenue); transition: transform .2s; margin-left: auto; }
details.ajuste-precios[open] summary::after { transform: rotate(180deg); }
.ajuste-titulo { display: flex; align-items: center; gap: .55rem; font-weight: 700; font-size: 1.05rem; }
details.ajuste-precios form { margin-top: 1.1rem; }
details.ajuste-precios [hidden] { display: none !important; }
.ajuste-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .9rem; }
.ajuste-campos .campo { margin: 0; }
.ajuste-pie { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--borde); }
.ajuste-seleccion { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.ajuste-seleccion strong { margin-right: .4rem; }
.input-sufijo { position: relative; }
.input-sufijo input { padding-right: 2.4rem !important; }
.input-sufijo span { position: absolute; right: .9rem; top: 50%; transform: translateY(-50%); color: var(--tenue); font-weight: 700; pointer-events: none; }
.producto-costo { color: var(--tenue); font-size: .78rem; }
.producto-check { display: none; align-items: center; justify-content: center; margin: 0; cursor: pointer; }

body.marcando-productos .producto-check { display: flex; }
body.marcando-productos .producto-fila { grid-template-columns: 40px 64px minmax(0, 1fr) auto auto; }
@media (max-width: 760px) {
    body.marcando-productos .producto-fila { grid-template-columns: 40px 56px minmax(0, 1fr); }
}

/* Casilleros: todos del mismo tamaño (no se achican cuando el texto ocupa dos líneas) y alineados con la primera línea. */
.check { align-items: flex-start; line-height: 1.5; }
.check > input[type=checkbox] { flex: 0 0 40px; margin: calc((1.5em - 22px) / 2) 0 0; }
.check > input[type=radio] { flex: 0 0 18px; width: 18px; height: 18px; margin: calc((1.5em - 18px) / 2) 0 0; }

/* Un combo abierto queda por encima de las tarjetas que vienen después (cada tarjeta es su propia capa). */
.card:focus-within { z-index: 5; }
.card:has(.combo.abierto) { z-index: 50; }

/* =====================================================================
   Mini tutorial de bienvenida (wwwroot/js/tutorial.js)
   ===================================================================== */
.tour { position: fixed; inset: 0; z-index: 100; }
.tour.sin-foco { background: rgba(5, 8, 15, .62); backdrop-filter: blur(3px); animation: tourAparecer .25s ease both; }
.tour-foco {
    position: fixed; border-radius: 14px; pointer-events: none;
    box-shadow: 0 0 0 4px var(--acento), 0 0 0 9999px rgba(5, 8, 15, .62);
    transition: left .3s ease, top .3s ease, width .3s ease, height .3s ease;
}
.tour.sin-foco .tour-foco { display: none; }
.tour-tarjeta {
    position: fixed; width: min(360px, calc(100vw - 32px));
    padding: 1.4rem 1.4rem 1.1rem; border-radius: 22px;
    background: var(--superficie-solida); color: var(--texto); border: 1px solid var(--borde-fuerte);
    box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .55);
    transition: left .3s ease, top .3s ease;
    animation: notifEntrar .3s cubic-bezier(.2, .9, .3, 1.2) both;
}
.tour-tarjeta.centrada { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); transition: none; animation: none; }
.tour-icono { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 18px; margin-bottom: .8rem; color: #fff; background: linear-gradient(135deg, var(--acento), #22d3ee); }
.tour-paso { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--acento-texto); }
.tour-tarjeta h2 { margin: .25rem 0 .45rem; font-size: 1.2rem; }
.tour-texto { margin: 0; color: var(--suave); line-height: 1.55; }
.tour-puntos { display: flex; gap: .35rem; margin: 1rem 0 .9rem; }
.tour-puntos span { width: 8px; height: 8px; border-radius: 99px; background: var(--superficie-3); transition: width .25s, background .25s; }
.tour-puntos span.activo { width: 22px; background: var(--acento); }
.tour-acciones { display: flex; align-items: center; gap: .45rem; }
.tour-espacio { flex: 1; }
@keyframes tourAparecer { from { opacity: 0; } to { opacity: 1; } }

/* =====================================================================
   Calculadora de puntos (Premios)
   ===================================================================== */
details.calculadora-puntos { margin-bottom: 1.1rem; }
details.calculadora-puntos summary { list-style: none; cursor: pointer; display: flex; align-items: center; flex-wrap: wrap; gap: .4rem 1rem; }
details.calculadora-puntos summary::-webkit-details-marker { display: none; }
details.calculadora-puntos summary::after { content: "▾"; color: var(--tenue); transition: transform .2s; margin-left: auto; }
details.calculadora-puntos[open] summary::after { transform: rotate(180deg); }
details.calculadora-puntos [hidden] { display: none !important; }
.calculadora-cuerpo { margin-top: 1rem; }
.calculadora-intro { margin: 0 0 1rem; line-height: 1.55; }
.calculadora-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .9rem; align-items: start; }
.calculadora-campos label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calculadora-campos .campo { margin: 0; }
.input-prefijo { position: relative; }
.input-prefijo input { padding-left: 2rem !important; }
.input-prefijo span { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--tenue); font-weight: 700; pointer-events: none; }
.calculadora-opciones { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .8rem; margin-top: 1.1rem; }
.calc-opcion { display: flex; flex-direction: column; gap: .5rem; padding: 1rem; border-radius: 16px; background: var(--superficie-2); border: 1px solid var(--borde); }
.calc-opcion.destacada { border-color: var(--acento); box-shadow: 0 0 0 3px var(--acento-suave); }
.calc-opcion-cabecera { display: flex; align-items: center; gap: .4rem; }
.calc-opcion-cabecera .badge { margin-left: auto; }
.calc-puntos { font-family: "Fredoka", "Plus Jakarta Sans", sans-serif; font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.calc-opcion ul { list-style: none; padding: 0; margin: 0 0 .3rem; display: grid; gap: .3rem; font-size: .82rem; color: var(--suave); }
.calc-opcion li.ok { color: var(--ok); font-weight: 600; }
.calc-opcion li.error { color: var(--error); font-weight: 700; }
.calc-opcion .btn { margin-top: auto; }
.calculadora-nota { margin-top: 1rem; line-height: 1.5; }
[data-abrir-calculadora] { display: inline-flex; align-items: center; gap: .3rem; margin-top: .4rem; text-decoration: none; color: var(--acento-texto); font-size: .82rem; }
.resaltado-campo { border-color: var(--acento) !important; box-shadow: 0 0 0 4px var(--acento-suave) !important; transition: box-shadow .3s; }
