/* ==========================================================
   MKTS.AR - Estilos compartidos (criterio Google / Material)
   ========================================================== */

:root {
    --azul: #1a73e8;
    --azul-hover: #1765cc;
    --azul-oscuro: #174ea6;
    --azul-claro: #e8f0fe;
    --texto: #202124;
    --texto-2: #5f6368;
    --texto-3: #80868b;
    --borde: #dadce0;
    --fondo: #f8f9fa;
    --superficie: #ffffff;
    --rojo: #d93025;
    --rojo-claro: #fce8e6;
    --verde: #188038;
    --verde-claro: #e6f4ea;
    --amarillo: #b06000;
    --amarillo-claro: #fef7e0;
    --violeta: #9334e6;
    --violeta-claro: #f3e8fd;

    --sombra-1: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
    --sombra-2: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 2px 6px 2px rgba(60, 64, 67, 0.15);
    --sombra-3: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);

    --sobre-azul: #ffffff;
    --azul-tonal-hover: #d2e3fc;
    --sobre-rojo: #ffffff;
    --rojo-hover: #c5221f;
    --rojo-texto: #a50e0e;
    --verde-texto: #0d652d;
    --amarillo-texto: #7a4100;
    --superficie-2: #f1f3f4;
    --pista: #e8eaed;
    --capa-hover: rgba(60, 64, 67, 0.08);
    --hover-suave: rgba(60, 64, 67, 0.04);
    --capa-azul: rgba(26, 115, 232, 0.06);
    --capa-rojo: rgba(217, 48, 37, 0.06);
    --velo: rgba(32, 33, 36, 0.4);
    --snack-fondo: #323232;
    --snack-texto: #f1f3f4;
    --avatar: #9334e6;
    --avatar-2: #1a73e8;
    --fondo-acceso: #f0f4f9;
    --flecha-select: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%235f6368' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");

    --curva: cubic-bezier(0.2, 0, 0, 1);
    --radio: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


/* ---------- Modo oscuro ----------
   data-tema="oscuro" -> siempre oscuro
   data-tema="auto"   -> según el dispositivo
   sin data-tema      -> claro (ej: visor público de revistas) */

:root[data-tema="oscuro"] {
    color-scheme: dark;
    --azul: #8ab4f8;
    --azul-hover: #aecbfa;
    --azul-oscuro: #d2e3fc;
    --azul-claro: rgba(138, 180, 248, 0.16);
    --texto: #e8eaed;
    --texto-2: #9aa0a6;
    --texto-3: #80868b;
    --borde: #3c4043;
    --fondo: #202124;
    --superficie: #292a2d;
    --rojo: #f28b82;
    --rojo-claro: rgba(242, 139, 130, 0.16);
    --verde: #81c995;
    --verde-claro: rgba(129, 201, 149, 0.16);
    --amarillo: #fdd663;
    --amarillo-claro: rgba(253, 214, 99, 0.14);
    --violeta: #d7aefb;
    --violeta-claro: rgba(215, 174, 251, 0.16);

    --sombra-1: 0 1px 2px 0 rgba(0, 0, 0, 0.6), 0 1px 3px 1px rgba(0, 0, 0, 0.3);
    --sombra-2: 0 1px 2px 0 rgba(0, 0, 0, 0.6), 0 2px 6px 2px rgba(0, 0, 0, 0.3);
    --sombra-3: 0 1px 3px 0 rgba(0, 0, 0, 0.6), 0 4px 8px 3px rgba(0, 0, 0, 0.3);

    --sobre-azul: #202124;
    --azul-tonal-hover: rgba(138, 180, 248, 0.24);
    --sobre-rojo: #202124;
    --rojo-hover: #f6aea9;
    --rojo-texto: #f6aea9;
    --verde-texto: #a8dab5;
    --amarillo-texto: #fde293;
    --superficie-2: #35363a;
    --pista: #3c4043;
    --capa-hover: rgba(232, 234, 237, 0.08);
    --hover-suave: rgba(232, 234, 237, 0.05);
    --capa-azul: rgba(138, 180, 248, 0.08);
    --capa-rojo: rgba(242, 139, 130, 0.08);
    --velo: rgba(0, 0, 0, 0.6);
    --snack-fondo: #e8eaed;
    --snack-texto: #202124;
    --fondo-acceso: #131314;
    --flecha-select: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%239aa0a6' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
    :root[data-tema="auto"] {
        color-scheme: dark;
        --azul: #8ab4f8;
        --azul-hover: #aecbfa;
        --azul-oscuro: #d2e3fc;
        --azul-claro: rgba(138, 180, 248, 0.16);
        --texto: #e8eaed;
        --texto-2: #9aa0a6;
        --texto-3: #80868b;
        --borde: #3c4043;
        --fondo: #202124;
        --superficie: #292a2d;
        --rojo: #f28b82;
        --rojo-claro: rgba(242, 139, 130, 0.16);
        --verde: #81c995;
        --verde-claro: rgba(129, 201, 149, 0.16);
        --amarillo: #fdd663;
        --amarillo-claro: rgba(253, 214, 99, 0.14);
        --violeta: #d7aefb;
        --violeta-claro: rgba(215, 174, 251, 0.16);

        --sombra-1: 0 1px 2px 0 rgba(0, 0, 0, 0.6), 0 1px 3px 1px rgba(0, 0, 0, 0.3);
        --sombra-2: 0 1px 2px 0 rgba(0, 0, 0, 0.6), 0 2px 6px 2px rgba(0, 0, 0, 0.3);
        --sombra-3: 0 1px 3px 0 rgba(0, 0, 0, 0.6), 0 4px 8px 3px rgba(0, 0, 0, 0.3);

        --sobre-azul: #202124;
        --azul-tonal-hover: rgba(138, 180, 248, 0.24);
        --sobre-rojo: #202124;
        --rojo-hover: #f6aea9;
        --rojo-texto: #f6aea9;
        --verde-texto: #a8dab5;
        --amarillo-texto: #fde293;
        --superficie-2: #35363a;
        --pista: #3c4043;
        --capa-hover: rgba(232, 234, 237, 0.08);
        --hover-suave: rgba(232, 234, 237, 0.05);
        --capa-azul: rgba(138, 180, 248, 0.08);
        --capa-rojo: rgba(242, 139, 130, 0.08);
        --velo: rgba(0, 0, 0, 0.6);
        --snack-fondo: #e8eaed;
        --snack-texto: #202124;
        --fondo-acceso: #131314;
        --flecha-select: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%239aa0a6' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    }
}

body {
    background: var(--fondo);
    color: var(--texto);
    font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.2s var(--curva), color 0.2s var(--curva);
}

a {
    color: var(--azul);
    text-decoration: none;
}

.material-symbols-rounded {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    font-size: 20px;
    line-height: 1;
    vertical-align: middle;
    user-select: none;
}

/* ---------- Barra superior ---------- */

.appbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 64px;
    background: var(--superficie);
    border-bottom: 1px solid var(--borde);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 0 20px;
    transition: box-shadow 0.2s var(--curva);
}

.appbar.con-sombra {
    border-bottom-color: transparent;
    box-shadow: var(--sombra-1);
}

.marca {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--texto);
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.2px;
}

.marca-icono {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--azul);
    color: var(--sobre-azul);
    display: grid;
    place-items: center;
}

.marca-icono .material-symbols-rounded {
    font-size: 22px;
}

.marca b {
    color: var(--azul);
    font-weight: 500;
}

.appbar-acciones {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.marca {
    flex-shrink: 0;
}

/* Secciones de administración: en la barra (computadora) o en un menú (celular, ver Responsive) */
.appbar-acciones .boton-admin {
    display: none;
}

.menu.admin-links {
    position: static;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    padding: 0;
    background: none;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
}

.admin-links .btn-texto.activo {
    background: var(--azul-claro);
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--avatar);
    color: white;
    display: grid;
    place-items: center;
    font-weight: 500;
    font-size: 15px;
    margin-left: 8px;
    text-transform: uppercase;
}

a.avatar {
    color: white;
    outline: 4px solid transparent;
    transition: outline-color 0.2s var(--curva);
}

a.avatar:hover,
a.avatar.activo {
    outline-color: var(--capa-hover);
}

/* Menú desplegable (ej: apariencia en la barra superior) */
.menu-contenedor {
    position: relative;
}

.menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 200;
    min-width: 200px;
    padding: 8px 0;
    background: var(--superficie);
    border-radius: 8px;
    box-shadow: var(--sombra-2);
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95) translateY(-4px);
    transform-origin: top right;
    transition: opacity 0.15s var(--curva), transform 0.15s var(--curva), visibility 0.15s;
}

.menu.show {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: 44px;
    padding: 0 16px;
    border: none;
    background: transparent;
    color: var(--texto);
    font-family: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s var(--curva);
}

.menu-item:hover,
.menu-item:focus-visible {
    background: var(--capa-hover);
    outline: none;
}

.menu-item .material-symbols-rounded {
    color: var(--texto-2);
}

.menu-item span:not(.material-symbols-rounded) {
    flex: 1;
}

.menu-check {
    visibility: hidden;
}

.menu-item[aria-checked="true"] {
    color: var(--azul);
}

.menu-item[aria-checked="true"] .material-symbols-rounded {
    color: var(--azul);
}

.menu-item[aria-checked="true"] .menu-check {
    visibility: visible;
}

/* Botón de la barra de la página actual (ej: Soporte) */
.btn-icono.activo {
    background: var(--azul-claro);
    color: var(--azul);
}

/* Campana de notificaciones */
.boton-notif {
    position: relative;
}

.insignia {
    position: absolute;
    top: 3px;
    left: 22px;
    min-width: 8px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--rojo);
    color: var(--sobre-rojo);
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    border: 2px solid var(--superficie);
    pointer-events: none;
}

.insignia[hidden] {
    display: none;
}

.panel-notif {
    width: 380px;
    padding: 0;
    overflow: hidden;
}

.panel-notif-cabecera {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 52px;
    padding: 8px 8px 8px 16px;
    border-bottom: 1px solid var(--borde);
    font-size: 16px;
    font-weight: 500;
}

.panel-notif-cabecera .btn[hidden] {
    display: none;
}

.panel-notif-lista {
    max-height: min(480px, calc(100vh - 140px));
    overflow-y: auto;
}

.notif {
    border-bottom: 1px solid var(--borde);
}

.notif:last-of-type {
    border-bottom: none;
}

.notif-cabecera {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 14px 12px 14px 16px;
    border: none;
    background: transparent;
    color: var(--texto);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s var(--curva);
}

.notif-cabecera:hover {
    background: var(--hover-suave);
}

.notif-punto {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    margin-top: 6px;
    border-radius: 50%;
    background: transparent;
}

.notif.no-leida .notif-punto {
    background: var(--azul);
}

.notif-titulos {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notif-titulo {
    font-size: 14px;
    color: var(--texto-2);
}

.notif.no-leida .notif-titulo {
    color: var(--texto);
    font-weight: 500;
}

.notif-fecha {
    font-size: 12px;
    color: var(--texto-3);
}

.notif-flecha {
    color: var(--texto-2);
    transition: transform 0.2s var(--curva);
}

.notif.abierta .notif-flecha {
    transform: rotate(180deg);
}

.notif-cuerpo {
    display: none;
    padding: 0 16px 16px 36px;
}

.notif.abierta .notif-cuerpo {
    display: block;
    animation: desplegar 0.2s var(--curva);
}

@keyframes desplegar {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

.notif-cuerpo p {
    color: var(--texto);
    line-height: 1.6;
    margin-bottom: 12px;
    overflow-wrap: anywhere;
}

.notif-acciones {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notif-leida-texto {
    display: none;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--verde);
}

.notif-leida-texto .material-symbols-rounded {
    font-size: 18px;
}

.notif:not(.no-leida) .notif-leer {
    display: none;
}

.notif:not(.no-leida) .notif-leida-texto {
    display: inline-flex;
}

.panel-notif-vacio {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 40px 16px;
    color: var(--texto-2);
}

.panel-notif-vacio[hidden] {
    display: none;
}

.panel-notif-vacio .material-symbols-rounded {
    font-size: 36px;
    color: var(--texto-3);
}

@media (max-width: 640px) {
    .panel-notif {
        position: fixed;
        top: 60px;
        left: 8px;
        right: 8px;
        width: auto;
    }
}

/* Interruptor (on / off) */
.interruptor {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.interruptor input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    z-index: 1;
}

.interruptor span {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: var(--pista);
    transition: background-color 0.2s var(--curva);
}

.interruptor span::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--superficie);
    box-shadow: var(--sombra-1);
    transition: transform 0.2s var(--curva);
}

.interruptor input:checked + span {
    background: var(--azul);
}

.interruptor input:checked + span::after {
    transform: translateX(20px);
}

.interruptor input:focus-visible + span {
    outline: 2px solid var(--azul);
    outline-offset: 2px;
}

/* ---------- Layout ---------- */

.contenedor {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px 64px;
}

.encabezado {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.encabezado h1 {
    font-size: 28px;
    font-weight: 400;
    letter-spacing: 0;
}

.encabezado p {
    color: var(--texto-2);
    margin-top: 2px;
}

.encabezado-acciones {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.subtitulo {
    font-size: 16px;
    font-weight: 500;
    margin: 32px 0 12px;
}

/* ---------- Tarjetas ---------- */

.tarjeta {
    background: var(--superficie);
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    padding: 20px 24px;
}

.tarjeta-link {
    display: flex;
    flex-direction: column;
    color: var(--texto);
    transition: box-shadow 0.2s var(--curva), border-color 0.2s var(--curva), transform 0.2s var(--curva);
}

.tarjeta-link:hover {
    border-color: transparent;
    box-shadow: var(--sombra-2);
}

.tarjeta-link:active {
    transform: scale(0.99);
}

.grilla-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.grilla-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* Módulos del panel */
.modulo {
    min-height: 220px;
    padding: 24px;
}

.modulo-icono {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin-bottom: 20px;
    background: var(--azul-claro);
    color: var(--azul);
}

.modulo-icono .material-symbols-rounded {
    font-size: 26px;
}

.modulo-icono.violeta {
    background: var(--violeta-claro);
    color: var(--violeta);
}

.modulo-icono.verde {
    background: var(--verde-claro);
    color: var(--verde);
}

.modulo-icono.amarillo {
    background: var(--amarillo-claro);
    color: var(--amarillo);
}

.modulo h2 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.modulo p {
    color: var(--texto-2);
}

.modulo-pie {
    margin-top: auto;
    padding-top: 20px;
    color: var(--azul);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.modulo-pie .material-symbols-rounded {
    transition: transform 0.2s var(--curva);
}

.tarjeta-link:hover .modulo-pie .material-symbols-rounded {
    transform: translateX(4px);
}

.modulo.deshabilitado {
    cursor: default;
}

.modulo.deshabilitado:hover {
    box-shadow: none;
    border-color: var(--borde);
}

.modulo.deshabilitado .modulo-pie {
    color: var(--texto-3);
}

/* Estadísticas */
.stat {
    padding: 18px 20px;
}

.stat-cabecera {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--texto-2);
    font-weight: 500;
    margin-bottom: 8px;
}

.stat-valor {
    font-size: 32px;
    font-weight: 400;
    line-height: 1.2;
}

.stat-detalle {
    color: var(--texto-2);
    font-size: 13px;
}

/* Bloques de estadísticas por módulo (usuarios y resumen general) */
.est-bloques {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.est-bloque {
    border: 1px solid var(--borde);
    border-radius: 12px;
    padding: 14px 16px;
    background: var(--superficie);
    scroll-margin-top: 80px;
}

.est-bloque h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
}

.modulo-icono.mini {
    width: 32px;
    height: 32px;
    margin: 0;
    flex-shrink: 0;
}

.modulo-icono.mini .material-symbols-rounded {
    font-size: 18px;
}

.est-bloque dl {
    display: grid;
    gap: 8px;
    margin: 0;
}

.est-bloque dl > div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.est-bloque dt {
    color: var(--texto-2);
    font-size: 13px;
}

.est-bloque dd {
    margin: 0;
    text-align: right;
    font-weight: 500;
}

.est-bloque dd small {
    display: block;
    color: var(--texto-2);
    font-size: 12px;
    font-weight: 400;
}

.est-bloque:target {
    border-color: var(--azul);
    box-shadow: 0 0 0 3px var(--azul-claro);
}

/* Gráfico de barras diario */
.est-grafico {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 120px;
    margin-top: 12px;
}

.est-grafico span {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: flex-end;
    border-radius: 3px;
}

.est-grafico span:hover {
    background: var(--capa-hover);
}

.est-grafico i {
    display: block;
    width: 100%;
    background: var(--azul);
    border-radius: 3px 3px 0 0;
}

.est-grafico.verde i {
    background: var(--verde);
}

.est-grafico.violeta i {
    background: var(--violeta);
}

.est-grafico-eje {
    display: flex;
    justify-content: space-between;
    color: var(--texto-2);
    font-size: 12px;
    margin-top: 4px;
}

/* ---------- Barras de desplazamiento ----------
   Finas, redondeadas y sin flechas. En las ventanas (bordes muy redondeados) la barra empieza y termina
   antes de las esquinas, así queda dentro de la tarjeta. */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: var(--texto-3);
    border: 3px solid transparent;
    border-radius: 12px;
    background-clip: padding-box;
    min-height: 40px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--texto-2);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

.ventana-contenido::-webkit-scrollbar-track {
    margin: 22px 0;
}

/* Firefox (no tiene los selectores de arriba) */
@supports not selector(::-webkit-scrollbar) {
    * {
        scrollbar-width: thin;
        scrollbar-color: var(--texto-3) transparent;
    }
}

/* ---------- Pestañas ---------- */

.pestanas {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--borde);
    margin-bottom: 24px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;            /* en el celular se desliza con el dedo, sin barra visible */
}

.pestanas::-webkit-scrollbar {
    display: none;
}

.pestanas a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 48px;
    padding: 0 20px;
    color: var(--texto-2);
    font-weight: 500;
    white-space: nowrap;
    border-radius: 8px 8px 0 0;
    transition: background-color 0.15s var(--curva), color 0.15s var(--curva);
}

.pestanas a:hover {
    background: var(--hover-suave);
    color: var(--texto);
}

.pestanas a.activa {
    color: var(--azul);
}

.pestanas a.activa::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--azul);
}

.insignia-pestana {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--rojo);
    color: var(--sobre-rojo);
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}

/* ---------- Chips ---------- */

.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 24px;
    padding: 0 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    background: var(--fondo);
    color: var(--texto-2);
    border: 1px solid var(--borde);
    white-space: nowrap;
}

.chip .material-symbols-rounded {
    font-size: 16px;
}

.chip-azul {
    background: var(--azul-claro);
    color: var(--azul-oscuro);
    border-color: transparent;
}

.chip-verde {
    background: var(--verde-claro);
    color: var(--verde);
    border-color: transparent;
}

.chip-rojo {
    background: var(--rojo-claro);
    color: var(--rojo);
    border-color: transparent;
}

.chip-violeta {
    background: var(--violeta-claro);
    color: var(--violeta);
    border-color: transparent;
}

/* Botón "Continuar con Google" (según las pautas de marca de Google) */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--borde);
    border-radius: 22px;
    background: var(--superficie);
    color: var(--texto);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.15s var(--curva), box-shadow 0.15s var(--curva);
}

.btn-google:hover {
    background: var(--capa-hover);
    box-shadow: var(--sombra-1);
}

.btn-google svg {
    flex-shrink: 0;
}

/* Precio con promoción: regular tachado + oferta con su nombre */
.precio-promo {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px 6px;
    vertical-align: middle;
}

.precio-promo s {
    color: var(--texto-2);
}

.precio-promo strong {
    color: var(--rojo);
    font-weight: 500;
}

.chip-promo {
    background: var(--rojo-claro);
    color: var(--rojo);
    border-color: transparent;
    height: 24px;
    font-size: 12px;
}

.precio-hasta {
    color: var(--texto-2);
    font-size: 12px;
}

/* ---------- Botones ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 24px;
    border-radius: 20px;
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.1px;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s var(--curva), box-shadow 0.2s var(--curva), color 0.2s var(--curva);
    text-decoration: none;
}

.btn .material-symbols-rounded {
    margin-left: -6px;
    font-size: 18px;
}

.btn-lleno {
    background: var(--azul);
    color: var(--sobre-azul);
}

.btn-lleno:hover {
    background: var(--azul-hover);
    box-shadow: var(--sombra-1);
}

.btn-lleno:disabled {
    background: var(--borde);
    color: var(--texto-3);
    box-shadow: none;
    cursor: wait;
}

.btn-tonal {
    background: var(--azul-claro);
    color: var(--azul-oscuro);
}

.btn-tonal:hover {
    background: var(--azul-tonal-hover);
    box-shadow: var(--sombra-1);
}

.btn-contorno {
    background: transparent;
    color: var(--azul);
    border: 1px solid var(--borde);
}

.btn-contorno:hover {
    background: var(--capa-azul);
    border-color: var(--azul-tonal-hover);
}

.btn-texto {
    background: transparent;
    color: var(--azul);
    padding: 0 12px;
}

.btn-texto:hover {
    background: var(--capa-azul);
}

.btn-texto.peligro {
    color: var(--rojo);
}

.btn-texto.peligro:hover {
    background: var(--capa-rojo);
}

.btn-peligro {
    background: var(--rojo);
    color: var(--sobre-rojo);
}

.btn-peligro:hover {
    background: var(--rojo-hover);
    box-shadow: var(--sombra-1);
}

.btn-chico {
    height: 32px;
    padding: 0 14px;
    font-size: 13px;
}

.btn-chico .material-symbols-rounded {
    font-size: 18px;
    margin-left: -4px;
}

/* Botones segmentados (elegir una opción) */
.segmentado {
    display: inline-flex;
    border: 1px solid var(--borde);
    border-radius: 20px;
    overflow: hidden;
    max-width: 100%;
}

.segmentado button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 18px;
    border: none;
    border-right: 1px solid var(--borde);
    background: var(--superficie);
    color: var(--texto);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s var(--curva);
}

.segmentado button:last-child {
    border-right: none;
}

.segmentado button:hover {
    background: var(--hover-suave);
}

.segmentado button.activo {
    background: var(--azul-claro);
    color: var(--azul-oscuro);
}

.segmentado button .material-symbols-rounded {
    font-size: 18px;
}

@media (max-width: 480px) {
    .segmentado button {
        padding: 0 12px;
    }

    .segmentado button:not(.activo) .material-symbols-rounded {
        display: none;
    }
}

.btn-icono {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--texto-2);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    transition: background-color 0.2s var(--curva), color 0.2s var(--curva);
}

.btn-icono:hover {
    background: var(--capa-hover);
    color: var(--texto);
}

.btn-icono.peligro:hover {
    background: var(--capa-rojo);
    color: var(--rojo);
}

.btn-icono .material-symbols-rounded {
    font-size: 22px;
}

/* ---------- Avisos ---------- */

.aviso {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    white-space: pre-line;
}

.aviso .material-symbols-rounded {
    flex-shrink: 0;
}

.aviso a {
    font-weight: 500;
    color: inherit;
    text-decoration: underline;
}

.aviso-info {
    background: var(--azul-claro);
    color: var(--azul-oscuro);
}

.aviso-error {
    background: var(--rojo-claro);
    color: var(--rojo-texto);
}

.aviso-ok {
    background: var(--verde-claro);
    color: var(--verde-texto);
}

.aviso-alerta {
    background: var(--amarillo-claro);
    color: var(--amarillo-texto);
}

/* ---------- Formularios (campos con contorno) ---------- */

.campo {
    margin-bottom: 20px;
}

.campo > label,
.campo-titulo {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--texto);
}

.campo input[type="text"],
.campo input[type="url"],
.campo input[type="email"],
.campo input[type="password"],
.campo input[type="tel"],
.campo textarea {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--borde);
    border-radius: 8px;
    background: var(--superficie);
    color: var(--texto);
    font-family: inherit;
    font-size: 15px;
    transition: border-color 0.15s var(--curva), box-shadow 0.15s var(--curva);
}

.campo select {
    width: 100%;
    height: 48px;
    padding: 0 40px 0 14px;
    border: 1px solid var(--borde);
    border-radius: 8px;
    background: var(--superficie) var(--flecha-select) no-repeat right 10px center;
    color: var(--texto);
    font-family: inherit;
    font-size: 15px;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.15s var(--curva), box-shadow 0.15s var(--curva);
}

.campo select:hover {
    border-color: var(--texto);
}

.campo select:focus {
    outline: none;
    border-color: var(--azul);
    box-shadow: inset 0 0 0 1px var(--azul);
}

.campo .campo-extra {
    margin-top: 8px;
}

/* Celular: código de país + número */
.telefono {
    display: flex;
    gap: 8px;
}

.telefono select {
    width: 124px;
    flex-shrink: 0;
}

.campo .telefono .prefijo-otro {
    width: 84px;
    flex-shrink: 0;
}

.telefono input[type="tel"] {
    flex: 1;
    min-width: 0;
}

.campo textarea {
    height: auto;
    min-height: 160px;
    padding: 12px 14px;
    font-family: 'Roboto Mono', Consolas, monospace;
    font-size: 13px;
    resize: vertical;
}

.campo input:hover,
.campo textarea:hover {
    border-color: var(--texto);
}

.campo input:focus,
.campo textarea:focus {
    outline: none;
    border-color: var(--azul);
    box-shadow: inset 0 0 0 1px var(--azul);
}

.campo input[type="file"] {
    font-family: inherit;
    font-size: 13px;
    color: var(--texto-2);
}

.campo input[type="file"]::file-selector-button {
    height: 32px;
    padding: 0 16px;
    margin-right: 12px;
    border-radius: 16px;
    border: 1px solid var(--borde);
    background: var(--superficie);
    color: var(--azul);
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
}

.ayuda {
    font-size: 12px;
    color: var(--texto-2);
    margin-top: 6px;
    line-height: 1.5;
}

/* Opciones tipo radio */
.opciones {
    display: grid;
    gap: 8px;
}

.opcion {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 8px 14px;
    border: 1px solid var(--borde);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s var(--curva), border-color 0.15s var(--curva);
}

.opcion:hover {
    background: var(--hover-suave);
}

.opcion input {
    accent-color: var(--azul);
    width: 18px;
    height: 18px;
}

.opcion .material-symbols-rounded {
    color: var(--texto-2);
}

.opcion:has(input:checked) {
    border-color: var(--azul);
    background: var(--azul-claro);
}

.opcion:has(input:checked) .material-symbols-rounded {
    color: var(--azul);
}

.bloque-gris {
    background: var(--fondo);
    border-radius: 8px;
    padding: 14px;
    margin-top: 8px;
}

/* ---------- Diálogos ---------- */

.ventana {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--velo);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s var(--curva), visibility 0.2s;
}

.ventana.show {
    opacity: 1;
    visibility: visible;
}

.ventana-contenido {
    background: var(--superficie);
    border-radius: 28px;
    padding: 24px;
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: var(--sombra-3);
    transform: scale(0.96) translateY(8px);
    transition: transform 0.25s var(--curva);
}

.ventana.show .ventana-contenido {
    transform: none;
}

.ventana-contenido.ancha {
    max-width: 760px;
}

.ventana-contenido.chica {
    max-width: 400px;
}

.ventana-icono {
    color: var(--azul);
    text-align: center;
    margin-bottom: 12px;
}

.ventana-icono .material-symbols-rounded {
    font-size: 28px;
}

.ventana-icono.peligro {
    color: var(--rojo);
}

.ventana-titulo {
    font-size: 22px;
    font-weight: 400;
    margin-bottom: 4px;
}

.ventana-subtitulo {
    color: var(--texto-2);
    margin-bottom: 20px;
}

.ventana-acciones {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 24px;
    flex-wrap: wrap;
}

/* ---------- Tablas ---------- */

.tabla-envoltorio {
    background: var(--superficie);
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    overflow-x: auto;
}

.tabla {
    width: 100%;
    border-collapse: collapse;
}

.tabla th,
.tabla td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--borde);
    vertical-align: middle;
}

.tabla th {
    color: var(--texto-2);
    font-weight: 500;
    font-size: 12px;
    white-space: nowrap;
}

.tabla tbody tr {
    transition: background-color 0.15s var(--curva);
}

.tabla tbody tr:hover {
    background: var(--hover-suave);
}

.tabla tbody tr:last-child td {
    border-bottom: none;
}

.tabla .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.tabla .acciones {
    text-align: right;
    white-space: nowrap;
}

.mono {
    font-family: 'Roboto Mono', Consolas, monospace;
}

/* ---------- Estado vacío ---------- */

.vacio {
    text-align: center;
    padding: 56px 24px;
}

.vacio .material-symbols-rounded {
    font-size: 48px;
    color: var(--texto-3);
    margin-bottom: 12px;
}

.vacio h3 {
    font-size: 18px;
    font-weight: 400;
    margin-bottom: 4px;
}

.vacio p {
    color: var(--texto-2);
    margin-bottom: 20px;
}

/* ---------- Snackbar ---------- */

.snackbar {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 2000;
    transform: translate(-50%, 24px);
    background: var(--snack-fondo);
    color: var(--snack-texto);
    padding: 14px 20px;
    border-radius: 4px;
    box-shadow: var(--sombra-3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s var(--curva), transform 0.2s var(--curva), visibility 0.2s;
}

.snackbar.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
    .appbar-texto {
        display: none;
    }

    .admin-links > .btn-texto {
        width: 40px;
        padding: 0;
        border-radius: 50%;
    }

    .admin-links > .btn-texto .material-symbols-rounded {
        margin: 0;
        font-size: 22px;
    }
}

@media (max-width: 1024px) {
    .grilla-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grilla-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .contenedor {
        padding: 20px 16px 48px;
    }

    .grilla-3 {
        grid-template-columns: 1fr;
    }

    .encabezado h1 {
        font-size: 24px;
    }

    .encabezado-acciones,
    .encabezado-acciones .btn {
        width: 100%;
    }

    .ventana-contenido {
        padding: 20px;
        border-radius: 20px;
    }

    .appbar-texto {
        display: none;
    }
}

/* Celular: las secciones de administración pasan a un menú desplegable */
@media (max-width: 760px) {
    .appbar {
        padding: 0 8px 0 12px;
    }

    .appbar-acciones {
        gap: 0;
    }

    .appbar-acciones .boton-admin {
        display: grid;
    }

    .menu.admin-links {
        position: fixed;
        top: 60px;
        right: 8px;
        left: auto;
        display: block;
        min-width: 240px;
        padding: 8px 0;
        background: var(--superficie);
        box-shadow: var(--sombra-2);
        opacity: 0;
        visibility: hidden;
        transform: scale(0.95) translateY(-4px);
        transition: opacity 0.15s var(--curva), transform 0.15s var(--curva), visibility 0.15s;
    }

    .menu.admin-links.show {
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .admin-links > .btn-texto {
        display: flex;
        width: 100%;
        height: 44px;
        padding: 0 16px;
        gap: 12px;
        border-radius: 0;
        justify-content: flex-start;
        color: var(--texto);
        font-weight: 400;
    }

    .admin-links > .btn-texto .material-symbols-rounded {
        color: var(--texto-2);
    }

    .admin-links > .btn-texto.activo,
    .admin-links > .btn-texto.activo .material-symbols-rounded {
        color: var(--azul);
    }

    .admin-links .appbar-texto {
        display: inline;
    }
}

/* Celular angosto: la marca queda solo con el ícono */
@media (max-width: 400px) {
    .marca > span:last-child {
        display: none;
    }

    .avatar {
        margin-left: 4px;
    }
}
