/* ========================================================== */
/* VARIABLES GENERALES                                        */
/* ========================================================== */


/* ---------------------------------------------------------- */
/* Colores, sombras y valores reutilizables                    */
/* ---------------------------------------------------------- */

:root {

    --bg: #f4f6f8;

    --panel: #ffffff;

    --text: #17202a;

    --muted: #6b7280;

    --line: #e5e7eb;

    --primary: #e53935;

    --primary2: #b71c1c;

    --dark: #111827;

    --success: #15803d;

    --warn: #b45309;

    --shadow:
        0 12px 30px
        rgba(15, 23, 42, 0.08);

}


/* ========================================================== */
/* CONFIGURACIÓN GENERAL                                      */
/* ========================================================== */


/* ---------------------------------------------------------- */
/* Modelo de caja                                             */
/* ---------------------------------------------------------- */

* {

    box-sizing: border-box;

}


/* ---------------------------------------------------------- */
/* Cuerpo principal                                           */
/* ---------------------------------------------------------- */

body {

    margin: 0;

    font-family:
        Inter,
        system-ui,
        -apple-system,
        "Segoe UI",
        sans-serif;

    background:
        var(--bg);

    color:
        var(--text);

}


/* ---------------------------------------------------------- */
/* Tipografía de controles                                    */
/* ---------------------------------------------------------- */

button,
input,
select,
textarea {

    font: inherit;

}


/* ========================================================== */
/* ESTRUCTURA PRINCIPAL DEL PANEL                              */
/* ========================================================== */


/* ---------------------------------------------------------- */
/* Contenedor general                                         */
/* ---------------------------------------------------------- */

.app {

    min-height: 100vh;

    display: grid;

    grid-template-columns:
        260px
        1fr;

}


/* ---------------------------------------------------------- */
/* Contenido principal                                        */
/* ---------------------------------------------------------- */

.main {

    min-width: 0;

}


/* ---------------------------------------------------------- */
/* Área de contenido dinámico                                 */
/* ---------------------------------------------------------- */

#content {

    max-width: 1500px;

    margin: auto;

    padding: 26px;

}


/* ========================================================== */
/* MENÚ LATERAL                                               */
/* ========================================================== */


/* ---------------------------------------------------------- */
/* Barra lateral                                              */
/* ---------------------------------------------------------- */

.sidebar {

    position: sticky;

    top: 0;

    z-index: 20;

    width: 100%;

    height: 100vh;

    padding:
        20px
        14px;

    display: flex;

    flex-direction: column;

    background:
        var(--dark);

    color: #ffffff;

}


/* ---------------------------------------------------------- */
/* Identidad de la marca                                      */
/* ---------------------------------------------------------- */

.brand {

    display: flex;

    align-items: center;

    gap: 12px;

    padding:
        4px
        8px
        22px;

}


/* ---------------------------------------------------------- */
/* Símbolo de la marca                                        */
/* ---------------------------------------------------------- */

.brand-mark {

    width: 44px;

    height: 44px;

    border-radius: 13px;

    display: grid;

    place-items: center;

    background:
        linear-gradient(
            135deg,
            #ef4444,
            #f59e0b
        );

    color: #ffffff;

    font-weight: 900;

}


/* ---------------------------------------------------------- */
/* Texto secundario de la marca                               */
/* ---------------------------------------------------------- */

.brand span {

    display: block;

    margin-top: 2px;

    color: #9ca3af;

    font-size: 12px;

}


/* ---------------------------------------------------------- */
/* Navegación                                                 */
/* ---------------------------------------------------------- */

nav {

    display: grid;

    gap: 5px;

}


/* ---------------------------------------------------------- */
/* Botones del menú                                           */
/* ---------------------------------------------------------- */

nav button,
.sidebar-foot button {

    border: 0;

    border-radius: 10px;

    padding:
        12px
        14px;

    background: transparent;

    color: #cbd5e1;

    text-align: left;

    cursor: pointer;

    font-weight: 650;

}


/* ---------------------------------------------------------- */
/* Estado activo y efecto al pasar el cursor                  */
/* ---------------------------------------------------------- */

nav button:hover,
nav button.active {

    background: #263244;

    color: #ffffff;

}


/* ---------------------------------------------------------- */
/* Pie de la barra lateral                                    */
/* ---------------------------------------------------------- */

.sidebar-foot {

    margin-top: auto;

    padding-top: 15px;

    display: grid;

    gap: 8px;

    border-top:
        1px solid
        #374151;

}


/* ---------------------------------------------------------- */
/* Enlaces del pie lateral                                    */
/* ---------------------------------------------------------- */

.sidebar-foot a {

    padding:
        10px
        14px;

    color: #ffffff;

    text-decoration: none;

}


/* ========================================================== */
/* BARRA SUPERIOR                                             */
/* ========================================================== */


/* ---------------------------------------------------------- */
/* Contenedor superior                                        */
/* ---------------------------------------------------------- */

.topbar {

    position: sticky;

    top: 0;

    z-index: 10;

    height: 88px;

    padding:
        16px
        28px;

    display: flex;

    align-items: center;

    gap: 18px;

    background: #ffffff;

    border-bottom:
        1px solid
        var(--line);

}


/* ---------------------------------------------------------- */
/* Título de la sección                                       */
/* ---------------------------------------------------------- */

.topbar h1 {

    margin: 0;

    font-size: 22px;

}


/* ---------------------------------------------------------- */
/* Subtítulo de la sección                                    */
/* ---------------------------------------------------------- */

.topbar p {

    margin:
        3px
        0
        0;

    color:
        var(--muted);

    font-size: 13px;

}


/* ---------------------------------------------------------- */
/* Acciones superiores                                        */
/* ---------------------------------------------------------- */

.top-actions {

    margin-left: auto;

    display: flex;

    align-items: center;

    gap: 12px;

}


/* ---------------------------------------------------------- */
/* Estado de guardado                                         */
/* ---------------------------------------------------------- */

.save-state {

    color:
        var(--success);

    font-size: 12px;

}


/* ========================================================== */
/* BOTONES                                                    */
/* ========================================================== */


/* ---------------------------------------------------------- */
/* Botón general                                              */
/* ---------------------------------------------------------- */

.btn {

    border:
        1px solid
        var(--line);

    border-radius: 10px;

    padding:
        10px
        15px;

    background: #ffffff;

    cursor: pointer;

    font-weight: 700;

}


/* ---------------------------------------------------------- */
/* Efecto del botón                                           */
/* ---------------------------------------------------------- */

.btn:hover {

    transform:
        translateY(-1px);

}


/* ---------------------------------------------------------- */
/* Botón principal                                            */
/* ---------------------------------------------------------- */

.btn.primary {

    border-color:
        var(--primary);

    background:
        var(--primary);

    color: #ffffff;

}


/* ---------------------------------------------------------- */
/* Botón de peligro                                           */
/* ---------------------------------------------------------- */

.btn.danger {

    border-color: #fecaca;

    background: #fff7f7;

    color: #b91c1c;

}


/* ---------------------------------------------------------- */
/* Botón pequeño                                              */
/* ---------------------------------------------------------- */

.btn.small {

    padding:
        7px
        10px;

    font-size: 12px;

}


/* ---------------------------------------------------------- */
/* Botón con icono                                            */
/* ---------------------------------------------------------- */

.icon-btn {

    border: 0;

    background: transparent;

    font-size: 23px;

    cursor: pointer;

}


/* ========================================================== */
/* TARJETAS DEL DASHBOARD                                     */
/* ========================================================== */


/* ---------------------------------------------------------- */
/* Grilla de tarjetas                                         */
/* ---------------------------------------------------------- */

.cards {

    display: grid;

    grid-template-columns:
        repeat(
            4,
            minmax(0, 1fr)
        );

    gap: 16px;

}


/* ---------------------------------------------------------- */
/* Estilo compartido entre tarjetas y paneles                 */
/* ---------------------------------------------------------- */

.card,
.panel {

    border:
        1px solid
        var(--line);

    border-radius: 16px;

    background: #ffffff;

    box-shadow:
        var(--shadow);

}


/* ---------------------------------------------------------- */
/* Tarjeta individual                                         */
/* ---------------------------------------------------------- */

.card {

    padding: 20px;

}


/* ---------------------------------------------------------- */
/* Etiqueta de la tarjeta                                     */
/* ---------------------------------------------------------- */

.card .label {

    color:
        var(--muted);

    font-size: 13px;

}


/* ---------------------------------------------------------- */
/* Valor destacado                                            */
/* ---------------------------------------------------------- */

.card strong {

    display: block;

    margin-top: 8px;

    font-size: 29px;

}


/* ---------------------------------------------------------- */
/* Texto auxiliar                                             */
/* ---------------------------------------------------------- */

.card small {

    color:
        var(--muted);

}


/* ========================================================== */
/* PANELES Y ENCABEZADOS                                      */
/* ========================================================== */


/* ---------------------------------------------------------- */
/* Panel general                                              */
/* ---------------------------------------------------------- */

.panel {

    margin-top: 18px;

    overflow: hidden;

}


/* ---------------------------------------------------------- */
/* Cabecera del panel                                         */
/* ---------------------------------------------------------- */

.panel-head {

    padding:
        18px
        20px;

    display: flex;

    align-items: center;

    gap: 12px;

    border-bottom:
        1px solid
        var(--line);

}


/* ---------------------------------------------------------- */
/* Título del panel                                           */
/* ---------------------------------------------------------- */

.panel-head h2 {

    margin: 0;

    font-size: 17px;

}


/* ---------------------------------------------------------- */
/* Acciones del panel                                         */
/* ---------------------------------------------------------- */

.panel-head .actions {

    margin-left: auto;

    display: flex;

    flex-wrap: wrap;

    gap: 8px;

}


/* ========================================================== */
/* BARRA DE HERRAMIENTAS                                      */
/* ========================================================== */


/* ---------------------------------------------------------- */
/* Contenedor de filtros                                      */
/* ---------------------------------------------------------- */

.toolbar {

    padding:
        15px
        20px;

    display: flex;

    flex-wrap: wrap;

    gap: 10px;

    border-bottom:
        1px solid
        var(--line);

}


/* ---------------------------------------------------------- */
/* Campos de la barra                                         */
/* ---------------------------------------------------------- */

.toolbar input,
.toolbar select {

    min-width: 180px;

    padding:
        10px
        12px;

    border:
        1px solid
        var(--line);

    border-radius: 9px;

    background: #ffffff;

}


/* ========================================================== */
/* TABLAS                                                     */
/* ========================================================== */


/* ---------------------------------------------------------- */
/* Contenedor desplazable                                     */
/* ---------------------------------------------------------- */

.table-wrap {

    overflow: auto;

}


/* ---------------------------------------------------------- */
/* Tabla general                                              */
/* ---------------------------------------------------------- */

table {

    width: 100%;

    min-width: 850px;

    border-collapse: collapse;

}


/* ---------------------------------------------------------- */
/* Celdas                                                     */
/* ---------------------------------------------------------- */

th,
td {

    padding:
        13px
        15px;

    border-bottom:
        1px solid
        var(--line);

    text-align: left;

    font-size: 13px;

}


/* ---------------------------------------------------------- */
/* Encabezados                                                */
/* ---------------------------------------------------------- */

th {

    position: sticky;

    top: 0;

    background: #f9fafb;

    color: #4b5563;

}


/* ---------------------------------------------------------- */
/* Imágenes de productos                                      */
/* ---------------------------------------------------------- */

td img {

    width: 52px;

    height: 52px;

    border-radius: 10px;

    object-fit: cover;

    background: #f3f4f6;

}


/* ========================================================== */
/* ETIQUETAS DE ESTADO                                        */
/* ========================================================== */


/* ---------------------------------------------------------- */
/* Etiqueta general                                           */
/* ---------------------------------------------------------- */

.badge {

    padding:
        5px
        9px;

    display: inline-flex;

    align-items: center;

    border-radius: 999px;

    background: #eef2ff;

    color: #3730a3;

    font-size: 11px;

    font-weight: 800;

}


/* ---------------------------------------------------------- */
/* Estado activo                                              */
/* ---------------------------------------------------------- */

.badge.ok {

    background: #dcfce7;

    color: #166534;

}


/* ---------------------------------------------------------- */
/* Estado inactivo                                            */
/* ---------------------------------------------------------- */

.badge.off {

    background: #fee2e2;

    color: #991b1b;

}


/* ---------------------------------------------------------- */
/* Mensaje sin resultados                                     */
/* ---------------------------------------------------------- */

.empty {

    padding: 44px;

    color:
        var(--muted);

    text-align: center;

}


/* ========================================================== */
/* GRILLAS Y FORMULARIOS                                      */
/* ========================================================== */


/* ---------------------------------------------------------- */
/* Grilla de dos columnas                                     */
/* ---------------------------------------------------------- */

.grid2 {

    display: grid;

    grid-template-columns:
        1fr
        1fr;

    gap: 16px;

}


/* ---------------------------------------------------------- */
/* Grilla de formulario                                       */
/* ---------------------------------------------------------- */

.form-grid {

    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 14px;

}


/* ---------------------------------------------------------- */
/* Campo que ocupa todo el ancho                              */
/* ---------------------------------------------------------- */

.form-grid .full {

    grid-column:
        1 / -1;

}


/* ---------------------------------------------------------- */
/* Etiquetas de formularios                                   */
/* ---------------------------------------------------------- */

label {

    display: grid;

    gap: 6px;

    font-size: 13px;

    font-weight: 700;

}


/* ---------------------------------------------------------- */
/* Campos generales                                           */
/* ---------------------------------------------------------- */

input,
select,
textarea {

    width: 100%;

    padding:
        10px
        11px;

    border:
        1px solid
        #d1d5db;

    border-radius: 9px;

    background: #ffffff;

}


/* ---------------------------------------------------------- */
/* Campo de texto extenso                                     */
/* ---------------------------------------------------------- */

textarea {

    min-height: 90px;

    resize: vertical;

}


/* ---------------------------------------------------------- */
/* Fila de casillas                                           */
/* ---------------------------------------------------------- */

.check-row {

    display: flex;

    flex-wrap: wrap;

    gap: 16px;

}


/* ---------------------------------------------------------- */
/* Etiqueta de casilla                                        */
/* ---------------------------------------------------------- */

.check-row label {

    display: flex;

    align-items: center;

    gap: 7px;

}


/* ---------------------------------------------------------- */
/* Tamaño natural de casillas                                 */
/* ---------------------------------------------------------- */

.check-row input {

    width: auto;

}


/* ========================================================== */
/* VENTANAS MODALES                                           */
/* ========================================================== */


/* ---------------------------------------------------------- */
/* Fondo de la ventana modal                                  */
/* ---------------------------------------------------------- */

.modal {

    position: fixed;

    inset: 0;

    z-index: 100;

    padding: 20px;

    display: grid;

    place-items: center;

    background:
        rgba(15, 23, 42, 0.58);

}


/* ---------------------------------------------------------- */
/* Modal oculto                                               */
/* ---------------------------------------------------------- */

.modal.hidden {

    display: none;

}


/* ---------------------------------------------------------- */
/* Tarjeta interna del modal                                  */
/* ---------------------------------------------------------- */

.modal-card {

    width:
        min(760px, 100%);

    max-height: 92vh;

    overflow: auto;

    border-radius: 18px;

    background: #ffffff;

    box-shadow:
        0 24px 80px
        rgba(0, 0, 0, 0.25);

}


/* ---------------------------------------------------------- */
/* Encabezado del modal                                       */
/* ---------------------------------------------------------- */

.modal-card > header {

    padding: 20px;

    display: flex;

    border-bottom:
        1px solid
        var(--line);

}


/* ---------------------------------------------------------- */
/* Título del modal                                           */
/* ---------------------------------------------------------- */

.modal-card h2 {

    margin: 0;

}


/* ---------------------------------------------------------- */
/* Texto auxiliar del modal                                   */
/* ---------------------------------------------------------- */

.modal-card header p {

    margin:
        4px
        0
        0;

    color:
        var(--muted);

}


/* ---------------------------------------------------------- */
/* Cuerpo del modal                                           */
/* ---------------------------------------------------------- */

#modalBody {

    padding: 20px;

}


/* ---------------------------------------------------------- */
/* Pie del modal                                              */
/* ---------------------------------------------------------- */

.modal-card footer {

    padding:
        16px
        20px;

    display: flex;

    justify-content: flex-end;

    gap: 10px;

    border-top:
        1px solid
        var(--line);

}


/* ========================================================== */
/* NOTIFICACIONES                                             */
/* ========================================================== */


/* ---------------------------------------------------------- */
/* Mensaje emergente                                          */
/* ---------------------------------------------------------- */

.toast {

    position: fixed;

    right: 24px;

    bottom: 24px;

    z-index: 200;

    padding:
        13px
        17px;

    border-radius: 11px;

    background: #111827;

    color: #ffffff;

    opacity: 0;

    pointer-events: none;

    transform:
        translateY(15px);

    transition: 0.2s;

}


/* ---------------------------------------------------------- */
/* Notificación visible                                      */
/* ---------------------------------------------------------- */

.toast.show {

    opacity: 1;

    transform: none;

}


/* ========================================================== */
/* HORARIOS DE ATENCIÓN                                       */
/* ========================================================== */


/* ---------------------------------------------------------- */
/* Lista general de horarios                                  */
/* ---------------------------------------------------------- */

.schedule-list {

    display: grid;

    gap: 0;

}


/* ---------------------------------------------------------- */
/* Fila correspondiente a cada día                            */
/* ---------------------------------------------------------- */

.schedule-row {

    display: grid;

    grid-template-columns:
        140px
        110px
        minmax(140px, 1fr)
        minmax(140px, 1fr);

    align-items: center;

    gap: 16px;

    padding:
        14px
        0;

    border-bottom:
        1px solid
        var(--line);

}


/* ---------------------------------------------------------- */
/* Nombre del día                                             */
/* ---------------------------------------------------------- */

.schedule-row > strong {

    font-size: 14px;

}


/* ---------------------------------------------------------- */
/* Casilla de abierto                                         */
/* ---------------------------------------------------------- */

.schedule-row .inline-check {

    display: flex;

    align-items: center;

    gap: 8px;

}


/* La casilla no debe ocupar todo el ancho. */

.schedule-row .inline-check input {

    width: auto;

    margin: 0;

}


/* ---------------------------------------------------------- */
/* Campos Desde y Hasta                                       */
/* ---------------------------------------------------------- */

.schedule-row label {

    margin: 0;

}


/* ---------------------------------------------------------- */
/* Zona horaria                                               */
/* ---------------------------------------------------------- */

.timezone-field {

    max-width: 500px;

    margin-top: 22px;

}


/* ========================================================== */
/* CONFIGURACIÓN                                              */
/* ========================================================== */


/* ---------------------------------------------------------- */
/* Sección de configuración                                   */
/* ---------------------------------------------------------- */

.setting-section {

    padding: 20px;

}


/* ---------------------------------------------------------- */
/* Título de configuración                                    */
/* ---------------------------------------------------------- */

.setting-section h3 {

    margin-top: 0;

}


/* ========================================================== */
/* PANTALLA DE ACCESO                                         */
/* ========================================================== */


/* ---------------------------------------------------------- */
/* Fondo del login                                            */
/* ---------------------------------------------------------- */

.login-body {

    min-height: 100vh;

    padding: 20px;

    display: grid;

    place-items: center;

    background:
        linear-gradient(
            135deg,
            #111827,
            #3f1d1d
        );

}


/* ---------------------------------------------------------- */
/* Tarjeta del login                                          */
/* ---------------------------------------------------------- */

.login-card {

    width:
        min(420px, 100%);

    padding: 32px;

    border-radius: 20px;

    background: #ffffff;

    box-shadow:
        0 30px 90px
        rgba(0, 0, 0, 0.35);

    text-align: center;

}


/* ---------------------------------------------------------- */
/* Marca del login                                            */
/* ---------------------------------------------------------- */

.login-card .brand-mark {

    margin:
        0
        auto;

}


/* ---------------------------------------------------------- */
/* Formulario del login                                       */
/* ---------------------------------------------------------- */

.login-card form {

    margin:
        25px
        0;

    display: grid;

    gap: 14px;

    text-align: left;

}


/* ---------------------------------------------------------- */
/* Botón del login                                            */
/* ---------------------------------------------------------- */

.login-card .btn {

    width: 100%;

}


/* ---------------------------------------------------------- */
/* Textos auxiliares del login                                */
/* ---------------------------------------------------------- */

.login-card small,
.login-card p {

    color:
        var(--muted);

}


/* ---------------------------------------------------------- */
/* Mensaje de error                                           */
/* ---------------------------------------------------------- */

.error-text {

    min-height: 20px;

    color: #b91c1c !important;

}


/* ========================================================== */
/* COMPONENTES AUXILIARES                                     */
/* ========================================================== */


/* ---------------------------------------------------------- */
/* Aviso informativo                                          */
/* ---------------------------------------------------------- */

.notice {

    padding: 12px;

    border:
        1px solid
        #fed7aa;

    border-radius: 10px;

    background: #fff7ed;

    color: #9a3412;

    font-size: 13px;

}


/* ---------------------------------------------------------- */
/* Vista previa de imágenes                                   */
/* ---------------------------------------------------------- */

.preview-box {

    height: 140px;

    border:
        1px dashed
        #cbd5e1;

    border-radius: 12px;

    display: grid;

    place-items: center;

    overflow: hidden;

    background: #f8fafc;

}


/* ---------------------------------------------------------- */
/* Imagen de la vista previa                                  */
/* ---------------------------------------------------------- */

.preview-box img {

    width: 100%;

    height: 100%;

    object-fit: contain;

}


/* ---------------------------------------------------------- */
/* Lista estadística                                          */
/* ---------------------------------------------------------- */

.stat-list {

    padding:
        5px
        20px
        18px;

}


/* ---------------------------------------------------------- */
/* Fila estadística                                           */
/* ---------------------------------------------------------- */

.stat-list div {

    padding:
        11px
        0;

    display: flex;

    justify-content: space-between;

    border-bottom:
        1px solid
        var(--line);

}


/* ========================================================== */
/* ADAPTACIÓN PARA TABLETS                                    */
/* ========================================================== */


/* ---------------------------------------------------------- */
/* Pantallas de hasta 1000 píxeles                            */
/* ---------------------------------------------------------- */

@media (max-width: 1000px) {

    .cards {

        grid-template-columns:
            repeat(
                2,
                1fr
            );

    }


    .app {

        grid-template-columns:
            78px
            1fr;

    }


    .sidebar {

        padding:
            16px
            9px;

    }


    .brand > div:last-child,
    nav span {

        display: none;

    }


    .brand {

        justify-content: center;

    }


    .sidebar-foot a {

        font-size: 0;

    }


    .sidebar-foot a::after {

        content: "↗";

        font-size: 20px;

    }


    .grid2 {

        grid-template-columns:
            1fr;

    }

}


/* ---------------------------------------------------------- */
/* Horarios en tablets                                        */
/* ---------------------------------------------------------- */

@media (max-width: 900px) {

    .schedule-row {

        grid-template-columns:
            120px
            100px
            1fr
            1fr;

        gap: 10px;

    }

}


/* ========================================================== */
/* ADAPTACIÓN PARA CELULARES                                  */
/* ========================================================== */


/* ---------------------------------------------------------- */
/* Pantallas de hasta 700 píxeles                             */
/* ---------------------------------------------------------- */

@media (max-width: 700px) {

    .app {

        display: block;

    }


    .sidebar {

        position: fixed;

        left: -280px;

        width: 260px;

        transition: 0.25s;

    }


    .sidebar.open {

        left: 0;

    }


    .brand > div:last-child,
    nav span {

        display: block;

    }


    .topbar {

        height: auto;

        padding:
            13px
            15px;

    }


    .top-actions .save-state {

        display: none;

    }


    .top-actions #quickAdd {

        padding: 10px;

        font-size: 0;

    }


    .top-actions #quickAdd::after {

        content: "+";

        font-size: 18px;

    }


    #content {

        padding: 15px;

    }


    .cards {

        grid-template-columns:
            1fr
            1fr;

        gap: 10px;

    }


    .card {

        padding: 15px;

    }


    .form-grid {

        grid-template-columns:
            1fr;

    }


    .toolbar > * {

        flex:
            1 1 100%;

    }


    .schedule-row {

        grid-template-columns:
            1fr
            100px;

    }


    /* Los horarios ocupan una fila inferior. */

    .schedule-row label:not(.inline-check) {

        grid-column:
            span 1;

    }

}
/* ============================================================
   PANEL ADMINISTRADOR 1.1 - GESTIÓN AVANZADA DE PRODUCTOS
============================================================ */

.product-toolbar{
    align-items:center;
}

.bulk-actions{
    display:none;
    flex:1 1 100%;
    align-items:center;
    gap:8px;
    padding:12px;
    border:1px solid #ead9d9;
    border-radius:12px;
    background:#fff7f7;
}

.bulk-actions.active{
    display:flex;
    flex-wrap:wrap;
}

.bulk-actions span{
    margin-right:auto;
    font-weight:800;
}

.select-column{
    width:42px;
    text-align:center;
}

.select-column input{
    width:18px;
    height:18px;
    cursor:pointer;
}

.field-help{
    display:block;
    margin-top:6px;
    color:#6d6d6d;
    font-size:12px;
    line-height:1.35;
}

.row-actions{
    min-width:210px;
}

@media (max-width:760px){
    .bulk-actions{
        align-items:stretch;
    }

    .bulk-actions span{
        flex-basis:100%;
    }

    .bulk-actions .btn{
        flex:1 1 120px;
    }
}


/* ==========================================================
   PANEL ADMINISTRADOR 1.2
   MEJORAS DEL MÓDULO CATEGORÍAS
========================================================== */

.panel-description{

    margin-top:6px;

    color:var(--muted);

    font-size:14px;

}

.category-summary{

    margin-bottom:22px;

}

.category-toolbar{

    display:grid;

    grid-template-columns:minmax(240px,1fr) 220px;

    gap:14px;

    align-items:end;

    margin-bottom:18px;

}

.category-toolbar label{

    display:grid;

    gap:7px;

    color:var(--muted);

    font-size:13px;

    font-weight:700;

}

.category-toolbar input,
.category-toolbar select{

    width:100%;

}

.category-main-cell{

    display:flex;

    align-items:center;

    gap:12px;

    min-width:190px;

}

.category-main-cell .category-icon{

    display:grid;

    place-items:center;

    width:42px;

    height:42px;

    flex:0 0 42px;

    border-radius:13px;

    background:#fff3f0;

    font-size:24px;

}

.category-main-cell small{

    display:block;

    margin-top:3px;

    color:var(--muted);

}

.category-order-controls{

    display:inline-grid;

    grid-template-columns:30px 34px 30px;

    align-items:center;

    justify-items:center;

    gap:3px;

}

.icon-button{

    display:grid;

    place-items:center;

    width:30px;

    height:30px;

    border:1px solid var(--line);

    border-radius:9px;

    background:#ffffff;

    color:var(--text);

    cursor:pointer;

    font-weight:900;

    transition:
        transform .16s ease,
        border-color .16s ease,
        box-shadow .16s ease;

}

.icon-button:hover{

    transform:translateY(-1px);

    border-color:#d80012;

    box-shadow:0 5px 14px rgba(0,0,0,.08);

}

.status-toggle{

    min-width:96px;

    padding:8px 10px;

    border:1px solid #d7d7d7;

    border-radius:999px;

    background:#f2f2f2;

    color:#646464;

    cursor:pointer;

    font-size:12px;

    font-weight:800;

}

.status-toggle.is-active{

    border-color:#bde7ca;

    background:#eaf8ef;

    color:#18753a;

}

.table-secondary{

    margin-left:3px;

    color:var(--muted);

}

.form-help{

    margin:0;

    padding:13px 15px;

    border-radius:12px;

    background:#f7f7f8;

    color:var(--muted);

    font-size:13px;

    line-height:1.45;

}

.categories-table td{

    vertical-align:middle;

}

@media (max-width:900px){

    .category-toolbar{

        grid-template-columns:1fr;

    }

    .categories-table{

        min-width:900px;

    }

}



/* ==========================================================
   PANEL ADMINISTRADOR 1.3
   MÓDULO DE PROMOCIONES
========================================================== */

.promotion-summary{

    margin-bottom:22px;

}

.promotion-toolbar{

    display:grid;

    grid-template-columns:minmax(260px,1fr) 210px 240px;

    gap:14px;

    align-items:end;

    margin-bottom:14px;

}

.promotion-toolbar label{

    display:grid;

    gap:7px;

    color:var(--muted);

    font-size:13px;

    font-weight:700;

}

.promotion-toolbar input,
.promotion-toolbar select{

    width:100%;

}

.promotion-bulk-actions{

    margin-bottom:16px;

}

.promotion-thumbnail{

    width:76px;

    height:58px;

    object-fit:cover;

    border-radius:12px;

    border:1px solid var(--line);

    background:#f6f6f6;

}

.promotion-name-cell{

    display:grid;

    gap:5px;

    min-width:240px;

}

.promotion-name-cell small{

    max-width:360px;

    color:var(--muted);

    line-height:1.35;

}

.promotion-price{

    display:block;

    white-space:nowrap;

}

.promotion-list-price{

    display:block;

    margin-top:4px;

    color:var(--muted);

    text-decoration:line-through;

    white-space:nowrap;

}

.promotion-type-badge{

    display:inline-block;

    max-width:170px;

    padding:7px 10px;

    border-radius:10px;

    background:#fff2ef;

    color:#b11321;

    font-size:12px;

    font-weight:800;

    line-height:1.25;

}

.promotion-status-stack{

    display:grid;

    gap:7px;

}

.promotion-preview-box{

    min-height:190px;

}

.promotion-preview-box img{

    max-height:270px;

    object-fit:contain;

}

.promotion-configuration-panel{

    display:none;

    padding:18px;

    border:1px solid #ead8d4;

    border-radius:16px;

    background:#fffaf8;

}

.promotion-configuration-panel.is-visible{

    display:block;

}

.configuration-heading{

    display:grid;

    gap:4px;

    margin-bottom:16px;

}

.configuration-heading strong{

    font-size:16px;

}

.configuration-heading small{

    color:var(--muted);

}

.promotion-form-grid textarea{

    min-height:100px;

}

.promotions-table td{

    vertical-align:middle;

}

@media (max-width:1050px){

    .promotion-toolbar{

        grid-template-columns:1fr 1fr;

    }

    .promotion-toolbar .search-field{

        grid-column:1 / -1;

    }

    .promotions-table{

        min-width:1120px;

    }

}

@media (max-width:680px){

    .promotion-toolbar{

        grid-template-columns:1fr;

    }

    .promotion-toolbar .search-field{

        grid-column:auto;

    }

}



/* ==========================================================
   PANEL ADMINISTRADOR 1.4
   ADMINISTRADOR DE PORTADA
========================================================== */

.homepage-workspace{

    display:grid;

    grid-template-columns:minmax(0,1.08fr) minmax(360px,.92fr);

    gap:22px;

    align-items:start;

}

.homepage-editor-column{

    display:grid;

    gap:20px;

}

.homepage-editor-card{

    padding:20px;

    border:1px solid var(--line);

    border-radius:18px;

    background:#ffffff;

    box-shadow:0 10px 28px rgba(0,0,0,.04);

}

.homepage-card-heading{

    display:flex;

    justify-content:space-between;

    align-items:flex-start;

    gap:16px;

    margin-bottom:18px;

}

.homepage-card-heading h3{

    margin:0;

    font-size:18px;

}

.homepage-card-heading p{

    margin:5px 0 0;

    color:var(--muted);

    font-size:13px;

    line-height:1.4;

}

.homepage-slide-list{

    display:grid;

    grid-template-columns:repeat(auto-fit,minmax(165px,1fr));

    gap:10px;

    margin-bottom:18px;

}

.homepage-slide-item{

    display:flex;

    align-items:center;

    gap:10px;

    min-height:68px;

    padding:10px;

    border:1px solid var(--line);

    border-radius:14px;

    background:#fafafa;

    color:var(--text);

    text-align:left;

    cursor:pointer;

    transition:
        border-color .16s ease,
        transform .16s ease,
        box-shadow .16s ease;

}

.homepage-slide-item:hover{

    transform:translateY(-1px);

    border-color:#d80012;

}

.homepage-slide-item.is-active{

    border-color:#d80012;

    background:#fff3f1;

    box-shadow:0 7px 18px rgba(216,0,18,.08);

}

.homepage-slide-number{

    display:grid;

    place-items:center;

    width:34px;

    height:34px;

    flex:0 0 34px;

    border-radius:11px;

    background:#181818;

    color:#ffffff;

    font-weight:900;

}

.homepage-slide-item.is-active .homepage-slide-number{

    background:#d80012;

}

.homepage-slide-item-text{

    display:grid;

    gap:4px;

    min-width:0;

}

.homepage-slide-item-text strong{

    overflow:hidden;

    text-overflow:ellipsis;

    white-space:nowrap;

    font-size:13px;

}

.homepage-slide-item-text small{

    color:var(--muted);

}

.homepage-slide-editor{

    padding-top:18px;

    border-top:1px solid var(--line);

}

.homepage-slide-editor-heading{

    display:flex;

    justify-content:space-between;

    align-items:flex-start;

    gap:15px;

    margin-bottom:18px;

}

.homepage-slide-editor-heading > div:first-child{

    display:grid;

    gap:4px;

}

.homepage-slide-editor-heading small{

    color:var(--muted);

}

.homepage-slide-form textarea{

    min-height:92px;

}

.homepage-image-field{

    display:grid;

    grid-template-columns:minmax(0,1fr) 118px;

    gap:10px;

    align-items:end;

}

.homepage-file-button{

    display:grid !important;

    place-items:center;

    min-height:43px;

    padding:9px 12px;

    border:1px dashed #d80012;

    border-radius:11px;

    background:#fff4f2;

    color:#b11321 !important;

    cursor:pointer;

    font-size:12px !important;

    text-align:center;

}

.homepage-file-button input{

    display:none;

}

.homepage-slide-order-actions{

    display:flex;

    gap:10px;

    margin-top:16px;

}

.homepage-benefits-editor{

    display:grid;

    gap:10px;

}

.homepage-benefit-row{

    display:grid;

    grid-template-columns:38px 75px minmax(140px,.8fr) minmax(180px,1fr) 78px 34px;

    gap:9px;

    align-items:end;

    padding:12px;

    border:1px solid var(--line);

    border-radius:14px;

    background:#fafafa;

}

.homepage-benefit-row label{

    display:grid;

    gap:6px;

    color:var(--muted);

    font-size:11px;

    font-weight:800;

}

.homepage-benefit-number{

    display:grid;

    place-items:center;

    width:34px;

    height:34px;

    margin-bottom:4px;

    border-radius:10px;

    background:#181818;

    color:#ffffff;

    font-weight:900;

}

.homepage-benefit-visible{

    display:flex !important;

    align-items:center;

    justify-content:center;

    gap:6px !important;

    min-height:42px;

    color:var(--text) !important;

}

.homepage-preview-column{

    position:sticky;

    top:18px;

    min-width:0;

}

.homepage-preview-toolbar{

    display:flex;

    justify-content:space-between;

    align-items:center;

    gap:14px;

    padding:13px 14px;

    border:1px solid var(--line);

    border-bottom:0;

    border-radius:17px 17px 0 0;

    background:#ffffff;

}

.homepage-preview-toolbar > div:first-child{

    display:grid;

    gap:3px;

}

.homepage-preview-toolbar small{

    color:var(--muted);

    font-size:11px;

}

.preview-device-buttons{

    display:flex;

    gap:6px;

}

.preview-device-button{

    display:grid;

    place-items:center;

    width:34px;

    height:34px;

    border:1px solid var(--line);

    border-radius:9px;

    background:#f6f6f6;

    cursor:pointer;

}

.preview-device-button.is-active{

    border-color:#d80012;

    background:#fff0ee;

}

.homepage-preview-frame{

    display:flex;

    justify-content:center;

    min-height:690px;

    padding:12px;

    overflow:hidden;

    border:1px solid var(--line);

    border-radius:0 0 17px 17px;

    background:#272727;

}

.homepage-preview-frame iframe{

    width:100%;

    height:670px;

    border:0;

    border-radius:8px;

    background:#ffffff;

    transition:width .2s ease;

}

.homepage-preview-frame.tablet iframe{

    width:768px;

}

.homepage-preview-frame.mobile iframe{

    width:390px;

}

@media (max-width:1250px){

    .homepage-workspace{

        grid-template-columns:1fr;

    }

    .homepage-preview-column{

        position:static;

    }

}

@media (max-width:850px){

    .homepage-benefit-row{

        grid-template-columns:38px 70px 1fr 34px;

    }

    .homepage-benefit-row label:nth-of-type(3){

        grid-column:2 / 4;

    }

    .homepage-benefit-visible{

        grid-column:2 / 4;

        justify-content:flex-start;

    }

}

@media (max-width:620px){

    .homepage-image-field{

        grid-template-columns:1fr;

    }

    .homepage-benefit-row{

        grid-template-columns:34px 1fr 34px;

    }

    .homepage-benefit-row label{

        grid-column:2;

    }

    .homepage-benefit-visible{

        grid-column:2;

    }

    .homepage-preview-frame{

        padding:6px;

    }

}


/* ==========================================================
   PANEL ADMINISTRADOR 1.5
   BIBLIOTECA MULTIMEDIA
========================================================== */

.media-summary{

    margin-bottom:22px;

}

.media-toolbar{

    display:grid;

    grid-template-columns:minmax(250px,1fr) 210px 190px auto;

    gap:12px;

    align-items:end;

    margin-bottom:14px;

}

.media-toolbar label{

    display:grid;

    gap:7px;

    color:var(--muted);

    font-size:13px;

    font-weight:700;

}

.media-view-switch{

    display:flex;

    gap:7px;

    padding-bottom:2px;

}

.media-view-switch .icon-button.is-active{

    border-color:#d80012;

    background:#fff0ee;

    color:#b11321;

}

.media-upload-button{

    position:relative;

    overflow:hidden;

    cursor:pointer;

}

.media-upload-button input{

    position:absolute;

    inset:0;

    opacity:0;

    cursor:pointer;

}

.media-library-grid{

    display:grid;

    grid-template-columns:repeat(auto-fill,minmax(210px,1fr));

    gap:15px;

}

.media-library-grid.list{

    grid-template-columns:1fr;

}

.media-library-empty{

    grid-column:1 / -1;

}

.media-card{

    position:relative;

    display:grid;

    overflow:hidden;

    border:1px solid var(--line);

    border-radius:17px;

    background:#ffffff;

    box-shadow:0 8px 24px rgba(0,0,0,.04);

    transition:
        transform .16s ease,
        border-color .16s ease,
        box-shadow .16s ease;

}

.media-card:hover{

    transform:translateY(-2px);

    border-color:#d7b8b3;

    box-shadow:0 12px 28px rgba(0,0,0,.07);

}

.media-card.is-selected{

    border-color:#d80012;

    box-shadow:0 0 0 2px rgba(216,0,18,.08);

}

.media-select{

    position:absolute;

    z-index:2;

    top:10px;

    left:10px;

    display:grid;

    place-items:center;

    width:28px;

    height:28px;

    border-radius:9px;

    background:rgba(255,255,255,.94);

    box-shadow:0 3px 12px rgba(0,0,0,.12);

}

.media-preview-button{

    display:block;

    width:100%;

    height:160px;

    padding:0;

    overflow:hidden;

    border:0;

    background:#f2f2f2;

    cursor:zoom-in;

}

.media-preview-button img{

    width:100%;

    height:100%;

    object-fit:cover;

}

.media-card-content{

    display:grid;

    gap:6px;

    padding:13px 14px 10px;

}

.media-card-content strong{

    overflow:hidden;

    text-overflow:ellipsis;

    white-space:nowrap;

}

.media-card-content small{

    color:var(--muted);

    font-size:11px;

}

.media-tags{

    display:flex;

    flex-wrap:wrap;

    gap:5px;

    min-height:22px;

}

.media-tags span{

    padding:4px 7px;

    border-radius:999px;

    background:#f3f3f3;

    color:#666666;

    font-size:10px;

    font-weight:700;

}

.media-card-actions{

    padding:0 14px 14px;

}

.media-library-grid.list .media-card{

    grid-template-columns:150px minmax(0,1fr) auto;

    align-items:center;

}

.media-library-grid.list .media-preview-button{

    height:100px;

}

.media-library-grid.list .media-card-actions{

    padding:14px;

}

.media-lightbox{

    position:fixed;

    z-index:5000;

    inset:0;

    display:grid;

    place-items:center;

    padding:24px;

    background:rgba(0,0,0,.82);

}

.media-lightbox-dialog{

    position:relative;

    display:grid;

    gap:12px;

    width:min(900px,94vw);

    max-height:90vh;

    padding:16px;

    border-radius:18px;

    background:#ffffff;

}

.media-lightbox-dialog img{

    width:100%;

    max-height:72vh;

    object-fit:contain;

    border-radius:12px;

    background:#eeeeee;

}

.media-lightbox-dialog > div{

    display:grid;

    gap:4px;

}

.media-lightbox-dialog small{

    color:var(--muted);

}

.media-lightbox-close{

    position:absolute;

    z-index:2;

    top:9px;

    right:9px;

    display:grid;

    place-items:center;

    width:36px;

    height:36px;

    border:0;

    border-radius:50%;

    background:#111111;

    color:#ffffff;

    font-size:24px;

    cursor:pointer;

}

.media-picker{

    display:grid;

    gap:16px;

}

.media-picker-toolbar{

    display:grid;

    grid-template-columns:1fr 210px;

    gap:12px;

}

.media-picker-toolbar label{

    display:grid;

    gap:6px;

    color:var(--muted);

    font-size:12px;

    font-weight:700;

}

.media-picker-grid{

    display:grid;

    grid-template-columns:repeat(auto-fill,minmax(150px,1fr));

    gap:12px;

    max-height:56vh;

    overflow:auto;

    padding:2px;

}

.media-picker-card{

    display:grid;

    gap:8px;

    padding:8px;

    border:1px solid var(--line);

    border-radius:13px;

    background:#ffffff;

    text-align:left;

    cursor:pointer;

}

.media-picker-card:hover{

    border-color:#d80012;

    background:#fff8f7;

}

.media-picker-card img{

    width:100%;

    height:110px;

    object-fit:cover;

    border-radius:9px;

    background:#eeeeee;

}

.media-picker-card span{

    display:grid;

    gap:3px;

}

.media-picker-card strong{

    overflow:hidden;

    text-overflow:ellipsis;

    white-space:nowrap;

    font-size:12px;

}

.media-picker-card small{

    color:var(--muted);

    font-size:10px;

}

.media-picker-empty{

    grid-column:1 / -1;

}

.homepage-image-actions{

    display:grid;

    grid-template-columns:1fr 1fr;

    gap:8px;

}

.homepage-library-button{

    min-height:43px;

    padding:9px 10px;

    border:1px solid var(--line);

    border-radius:11px;

    background:#ffffff;

    color:var(--text);

    cursor:pointer;

    font-size:12px;

    font-weight:800;

}

@media (max-width:1000px){

    .media-toolbar{

        grid-template-columns:1fr 1fr;

    }

    .media-toolbar .search-field{

        grid-column:1 / -1;

    }

    .media-view-switch{

        justify-content:flex-end;

    }

}

@media (max-width:700px){

    .media-toolbar{

        grid-template-columns:1fr;

    }

    .media-toolbar .search-field{

        grid-column:auto;

    }

    .media-view-switch{

        justify-content:flex-start;

    }

    .media-library-grid.list .media-card{

        grid-template-columns:110px minmax(0,1fr);

    }

    .media-library-grid.list .media-card-actions{

        grid-column:1 / -1;

        padding-top:0;

    }

    .media-picker-toolbar{

        grid-template-columns:1fr;

    }

}


/* ==========================================================
   PANEL ADMINISTRADOR 1.6
   CONFIGURACIÓN GENERAL
========================================================== */

.general-settings-layout{

    display:grid;

    grid-template-columns:repeat(2,minmax(0,1fr));

    gap:20px;

}

.settings-card{

    padding:20px;

    border:1px solid var(--line);

    border-radius:18px;

    background:#ffffff;

    box-shadow:0 10px 28px rgba(0,0,0,.04);

}

.settings-card:nth-child(1),
.settings-card:nth-child(2),
.settings-card:nth-child(5),
.settings-card:nth-child(6),
.settings-card:nth-child(7){

    grid-column:1 / -1;

}

.settings-card-heading{

    display:flex;

    justify-content:space-between;

    align-items:flex-start;

    gap:16px;

    margin-bottom:18px;

}

.settings-card-heading > div:first-child{

    display:flex;

    gap:12px;

    align-items:flex-start;

}

.settings-card-heading h3{

    margin:0;

    font-size:18px;

}

.settings-card-heading p{

    margin:5px 0 0;

    color:var(--muted);

    font-size:13px;

    line-height:1.4;

}

.settings-icon{

    display:grid;

    place-items:center;

    width:42px;

    height:42px;

    flex:0 0 42px;

    border-radius:13px;

    background:#fff1ef;

    font-size:20px;

}

.payment-options-grid{

    display:grid;

    grid-template-columns:repeat(auto-fit,minmax(145px,1fr));

    gap:10px;

}

.payment-option{

    display:flex;

    align-items:center;

    gap:9px;

    min-height:58px;

    padding:11px 13px;

    border:1px solid var(--line);

    border-radius:14px;

    background:#fafafa;

    cursor:pointer;

}

.payment-option:has(input:checked){

    border-color:#d80012;

    background:#fff4f2;

}

.payment-option-icon{

    font-size:20px;

}

.settings-spacing-top{

    margin-top:18px;

}

.brand-assets-grid{

    display:grid;

    grid-template-columns:repeat(4,minmax(0,1fr));

    gap:14px;

}

.brand-asset-card{

    display:grid;

    gap:9px;

    padding:12px;

    border:1px solid var(--line);

    border-radius:15px;

    background:#fafafa;

}

.brand-asset-preview{

    display:grid;

    place-items:center;

    height:125px;

    overflow:hidden;

    border-radius:11px;

    background:#eeeeee;

    color:var(--muted);

    font-size:12px;

}

.brand-asset-preview img{

    width:100%;

    height:100%;

    object-fit:contain;

}

.brand-asset-card strong{

    font-size:13px;

}

.brand-asset-card input{

    min-width:0;

}

.appearance-grid{

    display:grid;

    grid-template-columns:repeat(4,minmax(0,1fr));

    gap:14px;

}

.color-setting{

    display:grid;

    gap:8px;

    color:var(--muted);

    font-size:12px;

    font-weight:800;

}

.color-setting > div{

    display:grid;

    grid-template-columns:54px 1fr;

    gap:8px;

    align-items:center;

}

.color-setting input[type="color"]{

    width:54px;

    height:42px;

    padding:3px;

    cursor:pointer;

}

.maintenance-settings-card{

    border-color:#e7b0b5;

    background:
        linear-gradient(180deg,#ffffff,#fff8f8);

}

@media (max-width:1050px){

    .general-settings-layout{

        grid-template-columns:1fr;

    }

    .settings-card{

        grid-column:1 !important;

    }

    .brand-assets-grid,
    .appearance-grid{

        grid-template-columns:repeat(2,minmax(0,1fr));

    }

}

@media (max-width:620px){

    .brand-assets-grid,
    .appearance-grid{

        grid-template-columns:1fr;

    }

    .payment-options-grid{

        grid-template-columns:1fr;

    }

}


/* ==========================================================
   ARQUITECTURA 2.0 - ETAPA 4
   VALIDACIONES CENTRALIZADAS
========================================================== */

.input-invalid{

    border-color:#d80012 !important;

    box-shadow:0 0 0 3px rgba(216,0,18,.10) !important;

}

.field-error{

    display:block;

    margin-top:6px;

    color:#c00010;

    font-size:12px;

    font-weight:800;

    line-height:1.35;

}



/* ==========================================================
   PANEL ADMINISTRADOR 1.7.0
   SEO Y MARKETING
========================================================== */

.seo-settings-layout{

    display:grid;

    grid-template-columns:minmax(0, 1.55fr) minmax(320px, .75fr);

    gap:24px;

    align-items:start;

}

.seo-editor-column,
.seo-preview-column{

    display:grid;

    gap:20px;

}

.seo-preview-column{

    position:sticky;

    top:20px;

}

.seo-settings-card{

    grid-column:auto !important;

}

.seo-field-meta{

    display:flex;

    justify-content:space-between;

    gap:16px;

    margin-top:7px;

}

.seo-field-meta small{

    color:#6b7280;

}

.seo-field-meta span{

    flex:0 0 auto;

    padding:3px 8px;

    border-radius:999px;

    background:#eef0f3;

    color:#4b5563;

    font-size:11px;

    font-weight:800;

}

.seo-field-meta span[data-status="good"]{

    background:#dcfce7;

    color:#15803d;

}

.seo-field-meta span[data-status="warning"]{

    background:#fef3c7;

    color:#a16207;

}

.seo-field-meta span[data-status="danger"]{

    background:#fee2e2;

    color:#b91c1c;

}

.seo-image-selector{

    display:grid;

    grid-template-columns:190px minmax(0, 1fr);

    gap:16px;

    align-items:center;

}

.seo-image-preview{

    min-height:112px;

    overflow:hidden;

    border:1px solid #dfe3e8;

    border-radius:14px;

    background:#f6f7f9;

}

.seo-image-preview img{

    display:block;

    width:100%;

    height:112px;

    object-fit:cover;

}

.seo-image-placeholder{

    min-height:112px;

    display:grid;

    place-content:center;

    gap:4px;

    text-align:center;

    color:#737b86;

}

.seo-image-placeholder span{

    font-size:28px;

}

.seo-image-actions{

    display:grid;

    gap:10px;

}

.seo-image-actions > div{

    display:flex;

    flex-wrap:wrap;

    gap:8px;

}

.danger-light{

    color:#b42318;

    border-color:#f0b9b5;

    background:#fff7f6;

}

.seo-toggle-list{

    display:grid;

    gap:12px;

}

.seo-toggle-row{

    position:relative;

    display:flex;

    justify-content:space-between;

    align-items:center;

    gap:20px;

    padding:16px;

    border:1px solid #e2e5e9;

    border-radius:14px;

    cursor:pointer;

}

.seo-toggle-row > span:first-child{

    display:grid;

    gap:4px;

}

.seo-toggle-row small{

    color:#69717c;

}

.seo-toggle-row input{

    position:absolute;

    opacity:0;

    pointer-events:none;

}

.seo-toggle-control{

    width:48px;

    height:28px;

    flex:0 0 48px;

    padding:3px;

    border-radius:999px;

    background:#cdd2d8;

    transition:.2s ease;

}

.seo-toggle-control::after{

    content:"";

    display:block;

    width:22px;

    height:22px;

    border-radius:50%;

    background:#ffffff;

    box-shadow:0 2px 5px rgba(0,0,0,.20);

    transition:.2s ease;

}

.seo-toggle-row input:checked + .seo-toggle-control{

    background:#25b864;

}

.seo-toggle-row input:checked + .seo-toggle-control::after{

    transform:translateX(20px);

}

.seo-score-header{

    display:flex;

    justify-content:space-between;

    align-items:center;

    gap:18px;

}

.seo-score-header > div{

    display:flex;

    align-items:center;

    gap:12px;

}

.seo-score-header h3,
.seo-score-header p{

    margin:0;

}

.seo-score-header p{

    margin-top:3px;

    color:#6c7480;

    font-size:13px;

}

.seo-score-value{

    font-size:28px;

}

.seo-score-bar{

    height:9px;

    margin:18px 0;

    overflow:hidden;

    border-radius:999px;

    background:#e9ecef;

}

.seo-score-bar span{

    display:block;

    width:0;

    height:100%;

    border-radius:inherit;

    background:linear-gradient(90deg, #eab308, #22c55e);

    transition:width .25s ease;

}

.seo-check-list{

    display:grid;

    gap:10px;

}

.seo-check-item{

    display:flex;

    align-items:flex-start;

    gap:10px;

    padding:10px;

    border-radius:12px;

    background:#f7f8fa;

}

.seo-check-item > span{

    display:grid;

    place-content:center;

    width:24px;

    height:24px;

    flex:0 0 24px;

    border-radius:50%;

    font-weight:900;

}

.seo-check-item div{

    display:grid;

    gap:2px;

}

.seo-check-item small{

    color:#69717c;

}

.seo-check-item.is-valid > span{

    color:#16753c;

    background:#dcfce7;

}

.seo-check-item.is-warning > span{

    color:#9a5b00;

    background:#fef3c7;

}

.google-result-preview{

    padding:18px;

    border:1px solid #e2e5e9;

    border-radius:14px;

    background:#ffffff;

    font-family:Arial, sans-serif;

}

.google-preview-url{

    margin-bottom:7px;

    color:#202124;

    font-size:13px;

}

.google-preview-title{

    margin-bottom:6px;

    color:#1a0dab;

    font-size:20px;

    line-height:1.25;

}

.google-preview-description{

    color:#4d5156;

    font-size:14px;

    line-height:1.45;

}

.whatsapp-link-preview{

    overflow:hidden;

    border:1px solid #d7ddd9;

    border-radius:14px;

    background:#f4f7f5;

}

.whatsapp-preview-image{

    min-height:170px;

    display:grid;

    place-content:center;

    overflow:hidden;

    background:#e8ece9;

    color:#707770;

    text-align:center;

}

.whatsapp-preview-image img{

    display:block;

    width:100%;

    height:170px;

    object-fit:cover;

}

.whatsapp-preview-content{

    display:grid;

    gap:5px;

    padding:14px;

}

.whatsapp-preview-content small{

    color:#66706a;

    text-transform:uppercase;

}

.whatsapp-preview-content strong{

    font-size:16px;

}

.whatsapp-preview-content p{

    margin:0;

    color:#59625d;

    font-size:13px;

    line-height:1.4;

}

@media (max-width:1100px){

    .seo-settings-layout{

        grid-template-columns:1fr;

    }

    .seo-preview-column{

        position:static;

        grid-template-columns:repeat(2, minmax(0, 1fr));

    }

    .seo-score-card{

        grid-column:1 / -1;

    }

}

@media (max-width:720px){

    .seo-preview-column{

        grid-template-columns:1fr;

    }

    .seo-score-card{

        grid-column:auto;

    }

    .seo-image-selector{

        grid-template-columns:1fr;

    }

    .seo-image-preview,
    .seo-image-preview img{

        min-height:160px;

        height:160px;

    }

    .seo-field-meta{

        align-items:flex-start;

        flex-direction:column;

        gap:6px;

    }

}



/* ==========================================================
   PANEL ADMINISTRADOR 1.7.1
   SEO POR CATEGORÍAS
========================================================== */

.category-editor{

    display:grid;

    gap:20px;

}

.category-editor-tabs{

    display:flex;

    gap:8px;

    padding:5px;

    border-radius:14px;

    background:#f0f2f5;

}

.category-editor-tab{

    flex:1;

    padding:11px 16px;

    border:0;

    border-radius:10px;

    background:transparent;

    color:#616975;

    font-weight:850;

    cursor:pointer;

}

.category-editor-tab.is-active{

    background:#ffffff;

    color:#15181c;

    box-shadow:0 3px 10px rgba(26,31,37,.08);

}

.category-editor-section{

    min-width:0;

}

.category-seo-layout{

    display:grid;

    grid-template-columns:minmax(0, 1.25fr) minmax(280px, .75fr);

    gap:20px;

    align-items:start;

}

.category-seo-preview{

    display:grid;

    gap:15px;

    position:sticky;

    top:0;

}

.category-seo-score,
.category-preview-card{

    padding:16px;

    border:1px solid #e0e4e8;

    border-radius:15px;

    background:#ffffff;

}

.category-seo-score > div:first-child{

    display:flex;

    justify-content:space-between;

    align-items:center;

    gap:15px;

}

.category-seo-score > div:first-child span{

    font-size:23px;

    font-weight:900;

}

.category-preview-card > small{

    display:block;

    margin-bottom:10px;

    color:#69717c;

    font-weight:800;

}

.category-seo-field-meta{

    display:flex;

    justify-content:space-between;

    gap:14px;

    margin-top:7px;

}

.category-seo-field-meta small{

    color:#6b7280;

}

.category-seo-field-meta strong{

    padding:3px 8px;

    border-radius:999px;

    background:#eef0f3;

    color:#4b5563;

    font-size:11px;

}

.category-seo-field-meta strong[data-status="good"]{

    background:#dcfce7;

    color:#15803d;

}

.category-seo-field-meta strong[data-status="warning"]{

    background:#fef3c7;

    color:#a16207;

}

.category-seo-field-meta strong[data-status="danger"]{

    background:#fee2e2;

    color:#b91c1c;

}

.category-seo-image-selector{

    display:grid;

    grid-template-columns:180px minmax(0, 1fr);

    gap:14px;

    align-items:center;

    margin-top:8px;

}

.category-seo-image-preview{

    min-height:105px;

    overflow:hidden;

    border:1px solid #dfe3e8;

    border-radius:13px;

    background:#f6f7f9;

}

.category-seo-image-preview img{

    display:block;

    width:100%;

    height:105px;

    object-fit:cover;

}

.category-seo-image-actions{

    display:grid;

    gap:9px;

}

.category-seo-image-actions > div{

    display:flex;

    flex-wrap:wrap;

    gap:8px;

}

.category-preview-card .whatsapp-preview-image{

    min-height:130px;

}

.category-preview-card .whatsapp-preview-image img{

    height:130px;

}

@media (max-width:900px){

    .category-seo-layout{

        grid-template-columns:1fr;

    }

    .category-seo-preview{

        position:static;

    }

}

@media (max-width:620px){

    .category-editor-tabs{

        flex-direction:column;

    }

    .category-seo-image-selector{

        grid-template-columns:1fr;

    }

    .category-seo-image-preview,
    .category-seo-image-preview img{

        min-height:150px;

        height:150px;

    }

    .category-seo-field-meta{

        align-items:flex-start;

        flex-direction:column;

        gap:5px;

    }

}



/* ==========================================================
   PANEL ADMINISTRADOR 1.7.2
   SEO POR PRODUCTOS
========================================================== */

.product-editor{

    display:grid;

    gap:20px;

}

.product-editor-tabs{

    display:flex;

    gap:8px;

    padding:5px;

    border-radius:14px;

    background:#f0f2f5;

}

.product-editor-tab{

    flex:1;

    padding:11px 16px;

    border:0;

    border-radius:10px;

    background:transparent;

    color:#616975;

    font-weight:850;

    cursor:pointer;

}

.product-editor-tab.is-active{

    background:#ffffff;

    color:#15181c;

    box-shadow:0 3px 10px rgba(26,31,37,.08);

}

.product-seo-layout{

    display:grid;

    grid-template-columns:minmax(0, 1.25fr) minmax(280px, .75fr);

    gap:20px;

    align-items:start;

}

.product-seo-preview{

    display:grid;

    gap:15px;

    position:sticky;

    top:0;

}

.product-seo-score,
.product-preview-card{

    padding:16px;

    border:1px solid #e0e4e8;

    border-radius:15px;

    background:#ffffff;

}

.product-seo-score > div:first-child{

    display:flex;

    justify-content:space-between;

    align-items:center;

    gap:15px;

}

.product-seo-score > div:first-child span{

    font-size:23px;

    font-weight:900;

}

.product-preview-card > small{

    display:block;

    margin-bottom:10px;

    color:#69717c;

    font-weight:800;

}

.product-seo-field-meta{

    display:flex;

    justify-content:space-between;

    gap:14px;

    margin-top:7px;

}

.product-seo-field-meta small{

    color:#6b7280;

}

.product-seo-field-meta strong{

    padding:3px 8px;

    border-radius:999px;

    background:#eef0f3;

    color:#4b5563;

    font-size:11px;

}

.product-seo-field-meta strong[data-status="good"]{

    background:#dcfce7;

    color:#15803d;

}

.product-seo-field-meta strong[data-status="warning"]{

    background:#fef3c7;

    color:#a16207;

}

.product-seo-field-meta strong[data-status="danger"]{

    background:#fee2e2;

    color:#b91c1c;

}

.product-seo-image-selector{

    display:grid;

    grid-template-columns:180px minmax(0, 1fr);

    gap:14px;

    align-items:center;

    margin-top:8px;

}

.product-seo-image-preview{

    min-height:105px;

    overflow:hidden;

    border:1px solid #dfe3e8;

    border-radius:13px;

    background:#f6f7f9;

}

.product-seo-image-preview img{

    display:block;

    width:100%;

    height:105px;

    object-fit:cover;

}

.product-seo-image-actions{

    display:grid;

    gap:9px;

}

.product-seo-image-actions > div{

    display:flex;

    flex-wrap:wrap;

    gap:8px;

}

@media (max-width:900px){

    .product-seo-layout{

        grid-template-columns:1fr;

    }

    .product-seo-preview{

        position:static;

    }

}

@media (max-width:620px){

    .product-editor-tabs{

        flex-direction:column;

    }

    .product-seo-image-selector{

        grid-template-columns:1fr;

    }

    .product-seo-image-preview,
    .product-seo-image-preview img{

        min-height:150px;

        height:150px;

    }

    .product-seo-field-meta{

        align-items:flex-start;

        flex-direction:column;

        gap:5px;

    }

}



/* ========================================================== */
/* ANALÍTICAS 1.1                                             */
/* ========================================================== */

.analytics-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: linear-gradient(135deg, #171717 0%, #2b2118 100%);
    color: #ffffff;
    box-shadow: var(--shadow);
}

.analytics-hero h2 { margin: 6px 0 8px; font-size: clamp(25px, 4vw, 38px); }
.analytics-hero p { margin: 0; color: rgba(255,255,255,.72); }
.analytics-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .16em; color: #f5b642; }
.analytics-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.analytics-notice { margin: 16px 0 0; padding: 12px 16px; border-radius: 12px; background: #fff8e8; border: 1px solid #f0dbad; color: #75520d; }
.analytics-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-top: 18px; }
.analytics-kpi { position: relative; overflow: hidden; }
.analytics-kpi-icon { display: inline-grid; place-items: center; width: 38px; height: 38px; margin-bottom: 12px; border-radius: 12px; background: #fff5dc; font-size: 19px; }
.analytics-kpi strong { font-size: 24px; }
.analytics-funnel-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 22px; }
.analytics-funnel-step { text-align: center; }
.analytics-funnel-step strong { display: block; font-size: 28px; }
.analytics-funnel-step span { display: block; margin: 5px 0 12px; color: var(--muted); }
.analytics-funnel-step div { height: 10px; min-width: 22%; margin: 0 auto; border-radius: 999px; background: linear-gradient(90deg, #f5b642, #e98228); }
.analytics-grid { align-items: stretch; }
.analytics-grid .panel { height: calc(100% - 18px); }
.analytics-ranking, .analytics-hours { padding: 8px 20px 20px; }
.analytics-ranking-row { display: grid; grid-template-columns: 32px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.analytics-ranking-row:last-child { border-bottom: 0; }
.analytics-rank { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #171717; color: #fff; font-weight: 800; }
.analytics-ranking-main strong { display: block; margin-bottom: 7px; font-size: 14px; }
.analytics-ranking-row small { color: var(--muted); text-align: right; }
.analytics-progress { height: 8px; overflow: hidden; border-radius: 999px; background: #f0eee9; }
.analytics-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f5b642, #e98228); }
.analytics-hour-row { display: grid; grid-template-columns: 55px minmax(0,1fr) 36px; align-items: center; gap: 12px; padding: 11px 0; }
.analytics-hour-row > span { color: var(--muted); font-size: 13px; }
.analytics-hour-row > strong { text-align: right; }
.analytics-empty { display: grid; place-items: center; min-height: 210px; text-align: center; color: var(--muted); }
.analytics-empty span { font-size: 42px; }
.analytics-status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 20px; }
.analytics-status-grid > div { position: relative; padding: 16px 16px 16px 38px; border: 1px solid var(--line); border-radius: 14px; }
.analytics-status-grid strong, .analytics-status-grid small { display: block; }
.analytics-status-grid small { margin-top: 5px; color: var(--muted); line-height: 1.45; }
.status-dot { position: absolute; top: 20px; left: 16px; width: 10px; height: 10px; border-radius: 50%; }
.status-green { background: #2da76f; box-shadow: 0 0 0 4px rgba(45,167,111,.13); }
.status-yellow { background: #e1a123; box-shadow: 0 0 0 4px rgba(225,161,35,.13); }
.status-red { background: #d95858; box-shadow: 0 0 0 4px rgba(217,88,88,.13); }

@media (max-width: 1200px) {
    .analytics-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .analytics-hero { align-items: flex-start; flex-direction: column; padding: 22px; }
    .analytics-actions { width: 100%; }
    .analytics-actions .btn { flex: 1; }
    .analytics-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .analytics-funnel-grid { grid-template-columns: repeat(2, 1fr); }
    .analytics-status-grid { grid-template-columns: 1fr; }
    .analytics-ranking-row { grid-template-columns: 30px minmax(0,1fr); }
    .analytics-ranking-row small { grid-column: 2; text-align: left; }
}

@media (max-width: 430px) {
    .analytics-kpis { grid-template-columns: 1fr; }
    .analytics-funnel-grid { grid-template-columns: 1fr; }
}


/* ========================================================== */
/* ANALÍTICAS 1.2 — INTELIGENCIA COMERCIAL                    */
/* ========================================================== */

.analytics-change { display:inline-flex; align-items:center; width:max-content; margin-top:9px; padding:4px 8px; border-radius:999px; font-size:11px; font-weight:900; }
.analytics-change.positive { background:#e7f7ef; color:#16734a; }
.analytics-change.negative { background:#ffeded; color:#b03535; }
.analytics-change.neutral { background:#f1f1f1; color:#686868; }
.analytics-kpi small { display:block; margin-top:7px; color:var(--muted); line-height:1.35; }
.analytics-funnel-smart .analytics-funnel-step { padding:18px; border:1px solid var(--line); border-radius:16px; background:#fff; }
.analytics-funnel-step small { display:block; min-height:32px; color:var(--muted); font-size:12px; }
.analytics-funnel-bar { width:100% !important; height:9px !important; min-width:0 !important; margin-top:14px !important; background:#f0eee9 !important; overflow:hidden; }
.analytics-funnel-bar i { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,#f5b642,#e98228); }
.analytics-products-panel { margin-top:18px; }
.analytics-product-table { min-width:850px; }
.analytics-product-table td { vertical-align:middle; }
.analytics-product-table td strong, .analytics-product-table td small { display:block; }
.analytics-product-table td small { margin-top:4px; color:var(--muted); }
.analytics-product-status { display:grid; place-items:center; width:34px; height:34px; border-radius:50%; font-size:15px; }
.analytics-status-green { background:#e8f8ef; }
.analytics-status-yellow { background:#fff6dd; }
.analytics-status-red { background:#ffebeb; }
.analytics-hour-row { grid-template-columns:55px minmax(0,1fr) 34px 65px; }
.analytics-hour-row small { color:var(--muted); text-align:right; font-size:11px; }
.analytics-recommendations { display:grid; gap:12px; padding:8px 20px 20px; }
.analytics-recommendation { display:grid; grid-template-columns:42px minmax(0,1fr); gap:12px; padding:15px; border:1px solid var(--line); border-left-width:4px; border-radius:14px; background:#fff; }
.analytics-recommendation > span { display:grid; place-items:center; width:38px; height:38px; border-radius:12px; background:#f6f4ef; font-size:19px; }
.analytics-recommendation strong { display:block; margin-bottom:5px; }
.analytics-recommendation p { margin:0; color:var(--muted); font-size:13px; line-height:1.5; }
.recommendation-green { border-left-color:#2da76f; }
.recommendation-yellow { border-left-color:#e1a123; }
.recommendation-red { border-left-color:#d95858; }

@media (max-width:760px) {
    .analytics-hour-row { grid-template-columns:50px minmax(0,1fr) 30px; }
    .analytics-hour-row small { grid-column:2 / 4; text-align:left; }
    .analytics-recommendation { grid-template-columns:36px minmax(0,1fr); padding:13px; }
    .analytics-recommendation > span { width:34px; height:34px; }
}

/* ========================================================== */
/* CONTROL CENTER V1 · CENTRO DE OPERACIONES                  */
/* ========================================================== */

.operations-view {
    position: relative;
    display: grid;
    gap: 22px;
}

.operations-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.operations-summary-card {
    min-height: 122px;
    padding: 18px;
    display: grid;
    align-content: center;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.operations-summary-title {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.operations-summary-card strong {
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1;
}

.operations-summary-card small {
    color: var(--muted);
}

.operations-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
}

.operations-toolbar h2,
.operations-toolbar p {
    margin: 0;
}

.operations-toolbar p {
    margin-top: 5px;
    color: var(--muted);
}

.operations-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.operations-board {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.operations-order-card {
    position: relative;
    overflow: hidden;
    padding: 20px;
    display: grid;
    gap: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.operations-order-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: #64748b;
}

.operations-order-card.is-new-customer::before {
    background: #f59e0b;
}

.operations-order-card.is-sent-to-kitchen::before {
    background: #16a34a;
}

.operations-order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.operations-order-header > div {
    display: grid;
    gap: 4px;
}

.operations-order-code {
    font-size: 18px;
    font-weight: 900;
}

.operations-order-time {
    color: var(--muted);
    font-size: 13px;
}

.operations-status-badge,
.operations-new-customer-badge {
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.operations-status-badge {
    color: #334155;
    background: #e2e8f0;
}

.status-new,
.status-waiting_payment {
    color: #92400e;
    background: #fef3c7;
}

.status-payment_confirmed,
.status-sent_to_kitchen {
    color: #166534;
    background: #dcfce7;
}

.status-cancelled {
    color: #991b1b;
    background: #fee2e2;
}

.operations-customer-block {
    display: grid;
    gap: 6px;
}

.operations-customer-block h3 {
    margin: 0;
    font-size: 21px;
}

.operations-customer-trust {
    color: #b45309;
    font-weight: 800;
}

.operations-new-customer-badge {
    color: #9a3412;
    background: #ffedd5;
}

.operations-order-metadata {
    margin: 0;
    display: grid;
    grid-template-columns: minmax(90px, .7fr) minmax(0, 1.8fr);
    gap: 8px 12px;
    font-size: 14px;
}

.operations-order-metadata dt {
    color: var(--muted);
    font-weight: 800;
}

.operations-order-metadata dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.operations-items-list {
    margin: 0;
    padding: 14px 14px 14px 34px;
    display: grid;
    gap: 7px;
    border-radius: 12px;
    background: #f8fafc;
}

.operations-payment-warning {
    padding: 13px 14px;
    display: grid;
    gap: 4px;
    border: 1px solid #fdba74;
    border-radius: 12px;
    color: #9a3412;
    background: #fff7ed;
}

.operations-payment-warning span {
    font-size: 13px;
}

.operations-order-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.operations-action-button {
    min-height: 42px;
    white-space: normal;
}

.operations-warning-button {
    color: #7c2d12;
    border-color: #fdba74;
    background: #ffedd5;
}

.operations-success-button {
    color: #ffffff;
    border-color: #15803d;
    background: #15803d;
}

.operations-danger-button {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fff1f2;
}

.operations-secondary-button {
    color: #334155;
    border-color: #cbd5e1;
    background: #f8fafc;
}

.operations-audit {
    padding-top: 4px;
    border-top: 1px solid var(--line);
}

.operations-audit summary {
    cursor: pointer;
    color: var(--muted);
    font-weight: 800;
}

.operations-audit ol {
    margin: 12px 0 0;
    padding-left: 22px;
    display: grid;
    gap: 10px;
}

.operations-audit li {
    padding-left: 4px;
}

.operations-audit li strong,
.operations-audit li span {
    display: block;
}

.operations-audit li span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 13px;
}

.operations-empty-state {
    grid-column: 1 / -1;
    padding: 46px 20px;
    text-align: center;
    color: var(--muted);
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    background: var(--panel);
}

.operations-new-order-alert {
    position: fixed;
    inset: 0;
    z-index: 1000;
    padding: 20px;
    display: grid;
    place-items: center;
    background: rgba(15, 23, 42, .72);
    backdrop-filter: blur(6px);
}

.operations-new-order-alert-card {
    width: min(100%, 520px);
    padding: 30px;
    display: grid;
    gap: 14px;
    border: 2px solid #f59e0b;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 30px 80px rgba(15, 23, 42, .35);
}

.operations-new-order-alert-card h2,
.operations-new-order-alert-card p {
    margin: 0;
}

.operations-alert-eyebrow {
    color: #b45309;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .08em;
}

.operations-alert-note {
    padding: 12px;
    color: #9a3412;
    border-radius: 10px;
    background: #fff7ed;
}

@media (max-width: 1100px) {
    .operations-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .operations-board {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .operations-summary-grid {
        grid-template-columns: 1fr 1fr;
    }

    .operations-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .operations-toolbar-actions,
    .operations-toolbar-actions .btn,
    .operations-order-actions,
    .operations-order-actions .btn {
        width: 100%;
    }

    .operations-order-header {
        align-items: stretch;
        flex-direction: column;
    }

    .operations-summary-card {
        min-height: 106px;
        padding: 14px;
    }
}

@media (max-width: 480px) {
    .operations-summary-grid {
        grid-template-columns: 1fr;
    }

    .operations-order-metadata {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .operations-order-metadata dd {
        margin-bottom: 8px;
    }
}

/* ==========================================================
   CONTROL CENTER V1.1 - DASHBOARD OPERATIVO
   ========================================================== */

.control-dashboard {
    display: grid;
    gap: 20px;
}

.control-dashboard-status {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border: 1px solid #dbe3ee;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

.control-dashboard-status-indicator {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #16a34a;
    box-shadow: 0 0 0 7px rgba(22, 163, 74, .12);
}

.control-dashboard-status.is-warning .control-dashboard-status-indicator {
    background: #f97316;
    box-shadow: 0 0 0 7px rgba(249, 115, 22, .14);
}

.control-dashboard-status.is-attention .control-dashboard-status-indicator {
    background: #eab308;
    box-shadow: 0 0 0 7px rgba(234, 179, 8, .14);
}

.control-dashboard-status.is-active .control-dashboard-status-indicator {
    background: #2563eb;
    box-shadow: 0 0 0 7px rgba(37, 99, 235, .12);
}

.control-dashboard-status strong,
.control-dashboard-status p {
    margin: 0;
}

.control-dashboard-status p {
    margin-top: 3px;
    color: #64748b;
}

.control-dashboard-kpis {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
}

.control-dashboard-kpi {
    min-width: 0;
    min-height: 124px;
    padding: 18px;
    text-align: left;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .04);
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.control-dashboard-kpi:hover,
.control-dashboard-kpi:focus-visible {
    border-color: #f59e0b;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .09);
    transform: translateY(-2px);
}

.control-dashboard-kpi.is-wide {
    grid-column: span 2;
    color: #ffffff;
    border-color: #111827;
    background: linear-gradient(135deg, #111827, #1f2937);
}

.control-dashboard-kpi span,
.control-dashboard-kpi small {
    display: block;
}

.control-dashboard-kpi span {
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .02em;
}

.control-dashboard-kpi.is-wide span,
.control-dashboard-kpi.is-wide small {
    color: #cbd5e1;
}

.control-dashboard-kpi strong {
    display: block;
    margin: 8px 0 5px;
    font-size: clamp(26px, 3vw, 38px);
    line-height: 1;
}

.control-dashboard-kpi small {
    color: #94a3b8;
}

.control-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr);
    gap: 18px;
}

.control-dashboard-panel {
    min-width: 0;
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}

.control-dashboard-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.control-dashboard-panel-header h2,
.control-dashboard-panel-header p {
    margin: 0;
}

.control-dashboard-eyebrow {
    display: block;
    margin-bottom: 4px;
    color: #d97706;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.control-dashboard-order-list {
    display: grid;
    gap: 10px;
}

.control-dashboard-order {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(180px, .8fr) minmax(120px, .55fr);
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px;
    text-align: left;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease;
}

.control-dashboard-order:hover,
.control-dashboard-order:focus-visible {
    border-color: #f59e0b;
    background: #fff7ed;
}

.control-dashboard-order > div {
    display: grid;
    gap: 3px;
}

.control-dashboard-order > div:last-child {
    justify-items: end;
    text-align: right;
}

.control-dashboard-order span,
.control-dashboard-order small {
    color: #64748b;
}

.control-dashboard-order-trust {
    color: #f59e0b;
    font-weight: 800;
}

.control-dashboard-order-trust small {
    display: block;
    color: #64748b;
    font-weight: 600;
}

.control-dashboard-order-status {
    color: #0f172a !important;
    font-weight: 800;
}

.control-dashboard-stars-list {
    display: grid;
    gap: 14px;
}

.control-dashboard-stars-row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) 32px;
    align-items: center;
    gap: 10px;
}

.control-dashboard-stars-row > span {
    color: #f59e0b;
    letter-spacing: 1px;
}

.control-dashboard-stars-track {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.control-dashboard-stars-track i {
    display: block;
    min-width: 3px;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #f59e0b, #fb923c);
}

.control-dashboard-definition-list {
    display: grid;
    gap: 2px;
    margin: 0;
}

.control-dashboard-definition-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #eef2f7;
}

.control-dashboard-definition-list > div:last-child {
    border-bottom: 0;
}

.control-dashboard-definition-list dt {
    color: #64748b;
}

.control-dashboard-definition-list dd {
    margin: 0;
    color: #0f172a;
    font-size: 18px;
    font-weight: 900;
}

.control-dashboard-shortcuts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.control-dashboard-shortcuts button {
    display: grid;
    gap: 5px;
    min-height: 96px;
    padding: 15px;
    text-align: left;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease;
}

.control-dashboard-shortcuts button:hover,
.control-dashboard-shortcuts button:focus-visible {
    border-color: #f59e0b;
    background: #fff7ed;
}

.control-dashboard-shortcuts span,
.control-dashboard-empty {
    color: #64748b;
}

@media (max-width: 1180px) {
    .control-dashboard-kpis {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .control-dashboard-kpi.is-wide {
        grid-column: span 2;
    }

    .control-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .control-dashboard-kpis {
        grid-template-columns: 1fr 1fr;
    }

    .control-dashboard-kpi.is-wide {
        grid-column: span 2;
    }

    .control-dashboard-panel-header {
        align-items: stretch;
        flex-direction: column;
    }

    .control-dashboard-order {
        grid-template-columns: 1fr;
    }

    .control-dashboard-order > div:last-child {
        justify-items: start;
        text-align: left;
    }
}

@media (max-width: 480px) {
    .control-dashboard-kpis,
    .control-dashboard-shortcuts {
        grid-template-columns: 1fr;
    }

    .control-dashboard-kpi.is-wide {
        grid-column: auto;
    }

    .control-dashboard-status,
    .control-dashboard-panel {
        padding: 16px;
    }
}

/* ========================================================== */
/* CONTROL CENTER V1.2 — MENÚ LATERAL RETRÁCTIL               */
/* ========================================================== */

:root {
    --sidebar-width-expanded: 260px;
    --sidebar-width-collapsed: 78px;
    --sidebar-transition-duration: 220ms;
}

.app,
.sidebar,
.brand,
.sidebar nav button,
.sidebar-foot,
.main {
    transition:
        grid-template-columns var(--sidebar-transition-duration) ease,
        width var(--sidebar-transition-duration) ease,
        padding var(--sidebar-transition-duration) ease,
        gap var(--sidebar-transition-duration) ease;
}

.app.sidebar-collapsed {
    grid-template-columns:
        var(--sidebar-width-collapsed)
        minmax(0, 1fr);
}

.app.sidebar-collapsed .sidebar {
    padding-inline: 9px;
}

.app.sidebar-collapsed .brand {
    justify-content: center;
    gap: 0;
    padding-inline: 0;
}

.app.sidebar-collapsed .brand > div:last-child,
.app.sidebar-collapsed .sidebar nav button > span,
.app.sidebar-collapsed .sidebar-foot a,
.app.sidebar-collapsed .sidebar-foot button {
    font-size: 0;
}

.app.sidebar-collapsed .sidebar nav button {
    min-height: 44px;
    padding-inline: 0;
    display: grid;
    place-items: center;
    text-align: center;
    font-size: 19px;
}

.app.sidebar-collapsed .sidebar nav button .nav-icon {
    display: inline;
    font-size: 19px;
}

.app.sidebar-collapsed .sidebar-foot a,
.app.sidebar-collapsed .sidebar-foot button {
    min-height: 42px;
    padding-inline: 0;
    display: grid;
    place-items: center;
    text-align: center;
}

.app.sidebar-collapsed .sidebar-foot a::after {
    content: "↗";
    font-size: 19px;
}

.app.sidebar-collapsed .sidebar-foot button::after {
    content: "⇥";
    font-size: 19px;
}

.sidebar-toggle {
    flex: 0 0 auto;
}

.sidebar-toggle > span {
    display: block;
    transition: transform var(--sidebar-transition-duration) ease;
}

.app.sidebar-collapsed .sidebar-toggle > span {
    transform: rotate(180deg);
}

@media (min-width: 701px) and (max-width: 1000px) {
    .app:not(.sidebar-collapsed) {
        grid-template-columns:
            var(--sidebar-width-expanded)
            minmax(0, 1fr);
    }

    .app:not(.sidebar-collapsed) .sidebar {
        padding: 20px 14px;
    }

    .app:not(.sidebar-collapsed) .brand > div:last-child,
    .app:not(.sidebar-collapsed) nav span {
        display: block;
    }

    .app:not(.sidebar-collapsed) .brand {
        justify-content: flex-start;
    }

    .app:not(.sidebar-collapsed) .sidebar-foot a {
        font-size: inherit;
    }

    .app:not(.sidebar-collapsed) .sidebar-foot a::after {
        content: none;
    }
}

@media (max-width: 700px) {
    .app.sidebar-collapsed {
        display: block;
    }

    .sidebar-toggle > span,
    .app.sidebar-collapsed .sidebar-toggle > span {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app,
    .sidebar,
    .brand,
    .sidebar nav button,
    .sidebar-foot,
    .main,
    .sidebar-toggle > span {
        transition: none;
    }
}


/* ========================================================== */
/* CONTROL CENTER V1.2.1 — CORRECCIÓN DEL MENÚ LATERAL        */
/* ========================================================== */

/*
 * La barra lateral se divide en tres zonas:
 * 1. Marca fija.
 * 2. Navegación desplazable.
 * 3. Acciones inferiores siempre visibles.
 */
.sidebar {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

.sidebar .brand {
    flex: 0 0 auto;
}

.sidebar #nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: #475569 transparent;
}

.sidebar #nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar #nav::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #475569;
}

.sidebar-foot {
    flex: 0 0 auto;
    margin-top: 12px;
    padding-top: 12px;
    padding-bottom: max(4px, env(safe-area-inset-bottom));
    background: var(--dark);
}

.sidebar-foot a,
.sidebar-foot button {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 9px;
}

/* Evita que las reglas antiguas de tablet oculten Usuarios y Backup. */
@media (min-width: 701px) {
    .sidebar #nav button {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
    }

    .app:not(.sidebar-collapsed) .sidebar #nav button > span,
    .app:not(.sidebar-collapsed) .sidebar-foot a,
    .app:not(.sidebar-collapsed) .sidebar-foot button {
        font-size: inherit;
        opacity: 1;
        visibility: visible;
    }

    .app.sidebar-collapsed .sidebar #nav button {
        display: grid;
    }
}

/* En móviles el pie también permanece accesible dentro del panel. */
@media (max-width: 700px) {
    .sidebar {
        height: 100dvh;
        padding-bottom: max(14px, env(safe-area-inset-bottom));
    }

    .sidebar #nav {
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }
}

/* ========================================================== */
/* CONTROL CENTER V1.2.2 — ESTRUCTURA ESTABLE DEL PANEL       */
/* ========================================================== */

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.app {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    grid-template-columns: var(--sidebar-width-expanded) minmax(0, 1fr);
}

.sidebar {
    position: relative;
    top: auto;
    height: 100%;
    min-height: 0;
    padding: 18px 14px 12px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
}

.sidebar .brand {
    min-width: 0;
    padding-bottom: 16px;
}

.sidebar #nav {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: 0 4px 8px 0;
}

.sidebar-foot {
    min-width: 0;
    margin-top: 0;
    padding: 12px 0 max(2px, env(safe-area-inset-bottom));
    background: var(--dark);
    border-top: 1px solid #374151;
}

.sidebar-foot a,
.sidebar-foot button {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #ffffff;
    opacity: 1;
    visibility: visible;
}

.sidebar-foot button:hover,
.sidebar-foot a:hover {
    background: #263244;
}

.main {
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
}

.topbar {
    width: 100%;
}

#content {
    min-width: 0;
}

.sidebar-toggle {
    position: relative;
    z-index: 2;
    pointer-events: auto;
    touch-action: manipulation;
}

.app.sidebar-collapsed {
    grid-template-columns: var(--sidebar-width-collapsed) minmax(0, 1fr);
}

.app.sidebar-collapsed .sidebar {
    padding-inline: 8px;
}

.app.sidebar-collapsed .brand > div:last-child,
.app.sidebar-collapsed #nav button > span,
.app.sidebar-collapsed .sidebar-foot a,
.app.sidebar-collapsed .sidebar-foot button {
    overflow: hidden;
    white-space: nowrap;
}

.app.sidebar-collapsed .sidebar-foot {
    justify-items: stretch;
}

.app.sidebar-collapsed .sidebar-foot a,
.app.sidebar-collapsed .sidebar-foot button {
    font-size: 0;
    justify-content: center;
    padding-inline: 0;
}

.app.sidebar-collapsed .sidebar-foot a::after {
    content: "↗";
    font-size: 20px;
}

.app.sidebar-collapsed .sidebar-foot button::after {
    content: "⇥";
    font-size: 20px;
}

@media (max-width: 760px) {
    html,
    body {
        overflow: auto;
    }

    .app,
    .app.sidebar-collapsed {
        display: block;
        height: auto;
        min-height: 100dvh;
        overflow: visible;
    }

    .main {
        height: auto;
        min-height: 100dvh;
        overflow: visible;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(290px, 88vw);
        height: 100dvh;
        transform: translateX(-105%);
        transition: transform 200ms ease;
        box-shadow: 14px 0 30px rgba(15, 23, 42, 0.28);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar #nav {
        -webkit-overflow-scrolling: touch;
    }
}

/* ========================================================== */
/* CONTROL CENTER V1.3 — MÓDULO CLIENTES                      */
/* ========================================================== */

.clients-module {
    display: grid;
    gap: 18px;
    padding-bottom: 28px;
}

.clients-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.clients-summary-card {
    min-height: 100px;
    padding: 18px;
    display: grid;
    align-content: center;
    gap: 6px;
    border: 1px solid #dbe3ec;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.clients-summary-card span {
    color: #64748b;
    font-weight: 700;
}

.clients-summary-card strong {
    color: #0f172a;
    font-size: 30px;
    line-height: 1;
}

.clients-summary-card.is-warning { border-left: 5px solid #f59e0b; }
.clients-summary-card.is-success { border-left: 5px solid #16a34a; }
.clients-summary-card.is-danger { border-left: 5px solid #dc2626; }

.clients-toolbar {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(190px, 260px);
    gap: 14px;
    align-items: end;
    padding: 16px;
    border: 1px solid #dbe3ec;
    border-radius: 16px;
    background: #ffffff;
}

.clients-search input,
.clients-filter select,
.client-notes-form textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
}

.clients-search input,
.clients-filter select {
    min-height: 46px;
    padding: 0 14px;
}

.clients-filter {
    display: grid;
    gap: 6px;
    color: #475569;
    font-weight: 700;
}

.clients-layout {
    display: grid;
    grid-template-columns: minmax(300px, 0.78fr) minmax(460px, 1.55fr);
    gap: 18px;
    align-items: start;
}

.clients-list,
.client-detail {
    min-width: 0;
}

.clients-list {
    display: grid;
    gap: 10px;
}

.client-row {
    width: 100%;
    padding: 15px;
    display: grid;
    gap: 8px;
    text-align: left;
    border: 1px solid #dbe3ec;
    border-radius: 14px;
    background: #ffffff;
    color: #0f172a;
    cursor: pointer;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.client-row:hover,
.client-row:focus-visible,
.client-row.is-selected {
    border-color: #f59e0b;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.client-row-heading {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}

.client-row-heading strong {
    font-size: 17px;
}

.client-row-phone,
.client-row-trust {
    color: #64748b;
}

.client-row-trust {
    color: #b45309;
    font-weight: 800;
}

.client-status,
.client-status-badge,
.delivery-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 9px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 12px;
    font-weight: 900;
}

.client-status-validated,
.client-status-badge[data-status="VALIDATED"],
.delivery-status-badge[data-delivery-status="APPROVED"] {
    background: #dcfce7;
    color: #166534;
}

.client-status-pending_validation,
.client-status-badge[data-status="PENDING_VALIDATION"],
.delivery-status-badge[data-delivery-status="PENDING"] {
    background: #fef3c7;
    color: #92400e;
}

.client-status-observed,
.client-status-badge[data-status="OBSERVED"] {
    background: #ffedd5;
    color: #9a3412;
}

.client-status-suspended,
.client-status-badge[data-status="SUSPENDED"],
.delivery-status-badge[data-delivery-status="REJECTED"] {
    background: #fee2e2;
    color: #991b1b;
}

.client-detail-card {
    overflow: hidden;
    border: 1px solid #dbe3ec;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.07);
}

.client-detail-header,
.client-section,
.client-audit {
    padding: 20px;
}

.client-detail-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid #e2e8f0;
}

.client-detail-header h2 {
    margin: 5px 0 4px;
    color: #0f172a;
}

.client-eyebrow {
    color: #b45309;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.client-trust-score {
    margin: 0;
    color: #b45309;
    font-weight: 800;
}

.client-data-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    background: #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.client-data-grid > div {
    min-width: 0;
    padding: 16px 20px;
    display: grid;
    gap: 5px;
    background: #ffffff;
}

.client-data-grid span,
.client-section p {
    color: #64748b;
}

.client-data-grid strong {
    overflow-wrap: anywhere;
}

.client-section {
    border-bottom: 1px solid #e2e8f0;
}

.client-section h3 {
    margin: 0 0 12px;
}

.client-section-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.client-notes-form {
    display: grid;
    gap: 10px;
}

.client-notes-form textarea {
    min-height: 110px;
    padding: 12px;
    resize: vertical;
}

.client-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.client-delivery-decision {
    flex: 1 1 100%;
    padding: 11px 13px;
    border-radius: 10px;
    background: #f8fafc;
    color: #334155;
    font-weight: 800;
}

.client-actions .btn {
    min-height: 42px;
    padding: 9px 14px;
    border: 0;
    border-radius: 10px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.client-actions .success { background: #15803d; color: #ffffff; }
.client-actions .warning { background: #ffedd5; color: #9a3412; }
.client-actions .danger { background: #fee2e2; color: #991b1b; }
.client-actions .secondary,
.client-notes-form .secondary { background: #e2e8f0; color: #0f172a; }

.client-audit summary {
    cursor: pointer;
    font-weight: 900;
}

.client-audit-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.client-audit-item {
    display: grid;
    gap: 3px;
    padding: 11px 12px;
    border-left: 3px solid #f59e0b;
    background: #f8fafc;
}

.client-audit-item span {
    color: #64748b;
}

.clients-empty,
.client-detail-placeholder {
    min-height: 180px;
    display: grid;
    place-items: center;
    padding: 24px;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    background: #ffffff;
    color: #64748b;
    text-align: center;
}

@media (max-width: 1100px) {
    .clients-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .clients-layout { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
    .clients-summary { grid-template-columns: 1fr 1fr; }
    .clients-toolbar { grid-template-columns: 1fr; }
    .client-data-grid { grid-template-columns: 1fr; }
    .client-detail-header { align-items: flex-start; flex-direction: column; }
}

/* =========================================================
   CONTROL CENTER V1.4 · MÓDULO COCINA
   ========================================================= */

.kitchen-view {
    display: grid;
    gap: 20px;
    min-width: 0;
}

.kitchen-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.kitchen-summary-card {
    display: grid;
    gap: 5px;
    padding: 18px;
    border: 1px solid #dbe3ec;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.kitchen-summary-card span,
.kitchen-summary-card small {
    color: #64748b;
}

.kitchen-summary-card strong {
    color: #0f172a;
    font-size: 32px;
}

.kitchen-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(280px, 1fr));
    gap: 16px;
    align-items: start;
}

.kitchen-column {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #dbe3ec;
    border-radius: 18px;
    background: #eef2f7;
}

.kitchen-column > header {
    position: relative;
    padding: 18px 56px 16px 18px;
    border-bottom: 1px solid #dbe3ec;
    background: #ffffff;
}

.kitchen-column h2 {
    margin: 0 0 4px;
    color: #0f172a;
    font-size: 20px;
}

.kitchen-column p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
}

.kitchen-column-counter {
    position: absolute;
    top: 18px;
    right: 18px;
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 999px;
    background: #0f172a;
    color: #ffffff;
    font-weight: 900;
}

.kitchen-column-list {
    display: grid;
    gap: 12px;
    min-height: 180px;
    padding: 12px;
}

.kitchen-ticket {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid #dbe3ec;
    border-left: 5px solid #22c55e;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .06);
}

.kitchen-ticket.priority-warning { border-left-color: #f59e0b; }
.kitchen-ticket.priority-critical { border-left-color: #dc2626; }

.kitchen-ticket > header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.kitchen-ticket > header > div {
    display: grid;
    gap: 3px;
}

.kitchen-ticket > header strong {
    color: #0f172a;
    font-size: 18px;
}

.kitchen-ticket > header span {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.kitchen-timer {
    min-width: 68px;
    padding: 7px 9px;
    border-radius: 9px;
    background: #0f172a;
    color: #ffffff;
    font-weight: 900;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.priority-warning .kitchen-timer { background: #b45309; }
.priority-critical .kitchen-timer { background: #b91c1c; }

.kitchen-items {
    display: grid;
    gap: 9px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.kitchen-items li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
    color: #0f172a;
}

.kitchen-notes {
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 13px;
    font-weight: 700;
}

.kitchen-actions {
    display: flex;
    gap: 10px;
}

.kitchen-button {
    width: 100%;
    min-height: 44px;
    border: 0;
    border-radius: 10px;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.kitchen-button-primary { background: #f59e0b; color: #111827; }
.kitchen-button-success { background: #15803d; color: #ffffff; }

.kitchen-ready-label {
    width: 100%;
    padding: 11px 12px;
    border-radius: 10px;
    background: #dcfce7;
    color: #166534;
    font-weight: 900;
    text-align: center;
}

.kitchen-empty {
    min-height: 120px;
    display: grid;
    place-items: center;
    padding: 18px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: rgba(255,255,255,.72);
    color: #64748b;
    text-align: center;
}

@media (max-width: 1180px) {
    .kitchen-board {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .kitchen-summary {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================
   CONTROL CENTER v1.4.1 — MÓDULOS EN PANTALLAS INDEPENDIENTES
   ========================================================== */

.sidebar #nav .sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 0;
    border-radius: 11px;
    color: inherit;
    font: inherit;
    font-weight: 800;
    line-height: 1.2;
    text-align: left;
    text-decoration: none;
    background: transparent;
    cursor: pointer;
}

.sidebar #nav .sidebar-link:hover,
.sidebar #nav .sidebar-link:focus-visible,
.sidebar #nav .sidebar-link.active {
    color: #ffffff;
    background: #2b3950;
    outline: none;
}

.sidebar #nav .sidebar-link .nav-icon {
    flex: 0 0 22px;
    width: 22px;
    text-align: center;
}

.module-top-actions .btn {
    text-decoration: none;
}

body[data-module] #content {
    min-width: 0;
    overflow: auto;
    overscroll-behavior: contain;
}

body[data-module="operaciones"] #content {
    background: #eef2f6;
}

body[data-module="clientes"] #content,
body[data-module="cocina"] #content {
    background: #f4f6f8;
}

.app.sidebar-collapsed .sidebar #nav .sidebar-link {
    justify-content: center;
    padding-inline: 8px;
}

.app.sidebar-collapsed .sidebar #nav .sidebar-link > span:last-child {
    display: none;
}

@media (max-width: 760px) {
    .sidebar #nav .sidebar-link {
        min-height: 46px;
    }

    .module-top-actions {
        margin-left: auto;
    }

    .module-top-actions .btn {
        padding: 9px 11px;
        font-size: 12px;
    }
}

/* ==========================================================
   CONTROL CENTER v1.5 — SEPARACIÓN OPERACIONES / PANEL WEB
   ========================================================== */

.sidebar-link-accent {
    margin-top: 10px;
    color: #fff7ed !important;
    background: #9a3412 !important;
}

.sidebar-link-accent:hover,
.sidebar-link-accent:focus-visible {
    background: #c2410c !important;
}

.sidebar-context-switch {
    flex: 0 0 auto;
    padding: 12px 14px 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
}

.sidebar-context-switch > span {
    display: block;
    margin: 0 4px 8px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.operations-sidebar #operationsNav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.operations-workspace #content {
    min-width: 0;
    overflow: auto;
    overscroll-behavior: contain;
    background: #eef2f6;
}

.operations-workspace[data-operations-view="clientes"] #content,
.operations-workspace[data-operations-view="cocina"] #content {
    background: #f4f6f8;
}

.panel-selector-page {
    min-height: 100vh;
    margin: 0;
    display: grid;
    place-items: center;
    padding: 28px;
    color: #0f172a;
    background: #eef2f6;
}

.panel-selector {
    width: min(980px, 100%);
}

.panel-selector-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 26px;
}

.panel-selector-header h1 {
    margin: 2px 0 6px;
    font-size: clamp(28px, 4vw, 42px);
}

.panel-selector-header p {
    margin: 0;
    color: #64748b;
}

.panel-selector-kicker {
    color: #ea580c !important;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.panel-selector-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.panel-selector-card {
    min-height: 280px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 30px;
    border: 1px solid #dbe2ea;
    border-radius: 24px;
    color: #0f172a;
    text-decoration: none;
    background: #ffffff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.09);
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.panel-selector-card:hover,
.panel-selector-card:focus-visible {
    transform: translateY(-4px);
    border-color: #fb923c;
    box-shadow: 0 24px 54px rgba(15, 23, 42, 0.14);
    outline: none;
}

.panel-selector-icon {
    font-size: 44px;
}

.panel-selector-card strong {
    display: block;
    margin-bottom: 10px;
    font-size: 25px;
}

.panel-selector-card p {
    margin: 0;
    color: #64748b;
    font-size: 16px;
    line-height: 1.55;
}

.panel-selector-action {
    margin-top: auto;
    color: #c2410c;
    font-weight: 900;
}

.panel-selector-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 22px;
}

.panel-selector-footer a,
.panel-selector-footer button {
    border: 0;
    color: #475569;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    background: transparent;
    cursor: pointer;
}

.web-dashboard-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
    padding: 24px;
    border: 1px solid #dbe2ea;
    border-radius: 18px;
    background: #ffffff;
}

.web-dashboard-welcome h2 {
    margin: 3px 0 8px;
}

.web-dashboard-welcome p {
    max-width: 720px;
    margin: 0;
    color: #64748b;
}

@media (max-width: 760px) {
    .panel-selector-page { padding: 18px; }
    .panel-selector-grid { grid-template-columns: 1fr; }
    .panel-selector-card { min-height: 230px; }
    .panel-selector-footer { flex-direction: column; }
    .web-dashboard-welcome { align-items: flex-start; flex-direction: column; }
    .module-top-actions .btn:first-child { display: none; }
}

/* ==========================================================
   CONTROL CENTER V1.7 — OPERACIONES COMPACTAS Y MODO PRUEBA
   ========================================================== */
body.operations-workspace {
    --operations-space: 14px;
    --operations-radius: 14px;
    font-size: 15px;
}

.operations-workspace .app {
    grid-template-columns: 232px minmax(0, 1fr);
}

.operations-workspace .sidebar {
    padding: 18px 14px 14px;
}

.operations-workspace .brand {
    margin-bottom: 14px;
}

.operations-workspace .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
}

.operations-workspace .sidebar #nav .sidebar-link {
    min-height: 46px;
    padding: 10px 12px;
    margin-bottom: 6px;
    border-radius: 11px;
    font-size: 14px;
}

.operations-workspace .sidebar-foot,
.operations-workspace .sidebar-context-switch {
    font-size: 13px;
}

.operations-workspace .topbar {
    min-height: 72px;
    padding: 12px 22px;
}

.operations-workspace .topbar h1 {
    font-size: clamp(21px, 2vw, 27px);
    line-height: 1.1;
}

.operations-workspace .topbar p {
    margin-top: 3px;
    font-size: 13px;
}

.operations-workspace .module-top-actions {
    gap: 8px;
}

.operations-workspace .module-top-actions .btn {
    min-height: 38px;
    padding: 8px 13px;
    font-size: 13px;
}

.operations-workspace #content {
    padding: 16px;
    background: #edf1f5;
}

.operations-view {
    gap: var(--operations-space);
}

.operations-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.operations-summary-card {
    min-height: 104px;
    padding: 16px;
    border-radius: var(--operations-radius);
    box-shadow: 0 8px 20px rgba(25, 37, 52, 0.06);
}

.operations-summary-title {
    font-size: 12px;
    letter-spacing: .04em;
}

.operations-summary-card strong {
    margin: 4px 0 0;
    font-size: 35px;
    line-height: 1;
}

.operations-summary-card small {
    font-size: 12px;
}

.operations-toolbar {
    padding: 14px 16px;
    border-radius: var(--operations-radius);
    gap: 12px;
}

.operations-toolbar h2 {
    font-size: 20px;
}

.operations-toolbar p {
    font-size: 13px;
}

.operations-toolbar-actions {
    gap: 8px;
    flex-wrap: wrap;
}

.operations-compact-control {
    min-height: 36px;
    padding: 7px 11px;
    border-radius: 10px;
    font-size: 12px;
}

.operations-demo-active {
    border-color: #e69a00 !important;
    background: #fff4d4 !important;
    color: #805000 !important;
}

.operations-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

.operations-order-card {
    padding: 16px;
    border-radius: var(--operations-radius);
    box-shadow: 0 8px 20px rgba(25, 37, 52, 0.06);
}

.operations-order-header {
    margin-bottom: 10px;
}

.operations-order-code {
    font-size: 20px;
}

.operations-order-time,
.operations-status-badge,
.operations-new-customer-badge {
    font-size: 11px;
}

.operations-customer-block {
    margin-bottom: 10px;
}

.operations-customer-block h3 {
    font-size: 18px;
}

.operations-customer-trust {
    font-size: 13px;
}

.operations-order-metadata {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 5px 8px;
    font-size: 13px;
}

.operations-items-list {
    margin: 10px 0;
    padding: 11px 12px 11px 30px;
    font-size: 13px;
}

.operations-payment-warning {
    padding: 11px 12px;
    margin: 10px 0;
    font-size: 12px;
}

.operations-order-actions {
    gap: 7px;
}

.operations-order-actions .btn {
    min-height: 35px;
    padding: 7px 10px;
    border-radius: 9px;
    font-size: 12px;
}

.operations-audit {
    margin-top: 10px;
    font-size: 12px;
}

.operations-new-order-alert-card {
    width: min(460px, calc(100vw - 32px));
    padding: 24px;
    border-radius: 18px;
}

.operations-new-order-alert-card h2 {
    font-size: 25px;
}

.operations-alert-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-top: 14px;
}

.operations-alert-actions .btn {
    min-height: 40px;
    padding: 8px 14px;
}

@media (max-width: 1280px) {
    .operations-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .operations-workspace .app {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .operations-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .operations-workspace .app {
        display: block;
    }

    .operations-workspace #content {
        padding: 10px;
    }

    .operations-workspace .topbar {
        padding: 10px 12px;
    }

    .operations-workspace .module-top-actions {
        display: none;
    }

    .operations-summary-grid,
    .operations-board {
        grid-template-columns: 1fr;
    }

    .operations-toolbar {
        align-items: stretch;
    }

    .operations-toolbar-actions {
        width: 100%;
    }

    .operations-toolbar-actions .btn {
        flex: 1 1 auto;
    }
}


/* ==========================================================
   CONTROL CENTER V1.8 — DENSIDAD OPERATIVA Y DELIVERY
   ========================================================== */
body.operations-workspace {
    --operations-space: 8px;
    --operations-radius: 10px;
    font-size: 13px;
}

.operations-workspace .app {
    grid-template-columns: 188px minmax(0, 1fr);
}

.operations-workspace .sidebar {
    padding: 10px 8px 8px;
}

.operations-workspace .brand {
    gap: 8px;
    margin-bottom: 8px;
}

.operations-workspace .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    font-size: 13px;
}

.operations-workspace .brand strong { font-size: 14px; }
.operations-workspace .brand span { font-size: 10px; }

.operations-workspace .sidebar #nav .sidebar-link,
.operations-workspace .sidebar-context-switch .sidebar-link,
.operations-workspace .sidebar-foot .sidebar-link {
    min-height: 36px;
    padding: 7px 8px;
    margin-bottom: 3px;
    border-radius: 8px;
    font-size: 12px;
}

.operations-workspace .sidebar .nav-icon {
    width: 20px;
    font-size: 13px;
}

.operations-workspace .sidebar-context-switch {
    padding-top: 8px;
    margin-top: 8px;
}

.operations-workspace .sidebar-context-switch > span {
    font-size: 9px;
}

.operations-workspace .sidebar-foot {
    gap: 3px;
    padding-top: 7px;
    font-size: 11px;
}

.operations-workspace .sidebar-foot > a,
.operations-workspace .sidebar-foot > button {
    min-height: 30px;
    padding: 6px 8px;
    font-size: 11px;
}

.operations-workspace .topbar {
    min-height: 56px;
    padding: 7px 12px;
}

.operations-workspace .topbar h1 {
    font-size: 19px;
}

.operations-workspace .topbar p {
    margin-top: 1px;
    font-size: 11px;
}

.operations-workspace .sidebar-toggle {
    width: 34px;
    height: 34px;
    min-width: 34px;
}

.operations-workspace .module-top-actions .btn {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 11px;
}

.operations-workspace #content {
    padding: 9px;
}

.operations-summary-grid {
    gap: 7px;
}

.operations-summary-card {
    min-height: 72px;
    padding: 9px 11px;
    border-radius: 10px;
}

.operations-summary-title { font-size: 10px; }
.operations-summary-card strong { margin-top: 2px; font-size: 25px; }
.operations-summary-card small { font-size: 10px; }

.operations-toolbar {
    padding: 8px 10px;
    border-radius: 10px;
    gap: 8px;
}

.operations-toolbar h2 { font-size: 16px; }
.operations-toolbar p { font-size: 11px; }
.operations-toolbar-actions { gap: 5px; }
.operations-compact-control {
    min-height: 29px;
    padding: 5px 8px;
    border-radius: 7px;
    font-size: 10px;
}

.operations-board {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.operations-order-card {
    padding: 10px;
    border-radius: 10px;
}

.operations-order-header { margin-bottom: 6px; }
.operations-order-code { font-size: 16px; }
.operations-order-time,
.operations-status-badge,
.operations-new-customer-badge { font-size: 9px; }
.operations-customer-block { margin-bottom: 6px; }
.operations-customer-block h3 { font-size: 14px; }
.operations-customer-trust { font-size: 10px; }
.operations-order-metadata {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 3px 6px;
    font-size: 10.5px;
}
.operations-items-list {
    margin: 6px 0;
    padding: 7px 8px 7px 22px;
    font-size: 10.5px;
}
.operations-payment-warning {
    padding: 7px 8px;
    margin: 6px 0;
    font-size: 10px;
}
.operations-order-actions { gap: 4px; }
.operations-order-actions .btn {
    min-height: 28px;
    padding: 5px 7px;
    border-radius: 7px;
    font-size: 9.5px;
}
.operations-audit { margin-top: 6px; font-size: 10px; }

/* Clientes y cocina también usan una escala operativa compacta. */
.operations-workspace .clients-view,
.operations-workspace .kitchen-view,
.operations-workspace .delivery-view { gap: 8px; }
.operations-workspace .clients-summary,
.operations-workspace .kitchen-summary,
.operations-workspace .delivery-summary {
    gap: 7px;
}
.operations-workspace .clients-summary-card,
.operations-workspace .kitchen-summary-card,
.operations-workspace .delivery-summary-card {
    min-height: 72px;
    padding: 10px;
    border-radius: 10px;
}
.operations-workspace .clients-summary-card strong,
.operations-workspace .kitchen-summary-card strong,
.operations-workspace .delivery-summary-card strong { font-size: 25px; }
.operations-workspace .kitchen-board,
.operations-workspace .delivery-board { gap: 8px; }
.operations-workspace .kitchen-column,
.operations-workspace .delivery-column { padding: 8px; border-radius: 10px; }
.operations-workspace .kitchen-column h2,
.operations-workspace .delivery-column h2 { font-size: 14px; }
.operations-workspace .kitchen-column p,
.operations-workspace .delivery-column p { font-size: 10px; }
.operations-workspace .kitchen-ticket,
.operations-workspace .delivery-ticket { padding: 9px; border-radius: 8px; }
.operations-workspace .kitchen-items,
.operations-workspace .delivery-details { font-size: 11px; }
.operations-workspace .kitchen-button,
.operations-workspace .delivery-button {
    min-height: 29px;
    padding: 5px 8px;
    font-size: 10px;
}

.delivery-view { display: grid; gap: 10px; }
.delivery-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.delivery-summary-card {
    border: 1px solid #dbe2ea;
    background: #fff;
}
.delivery-summary-card span,
.delivery-summary-card small { display: block; color: #64748b; }
.delivery-summary-card strong { display: block; margin: 2px 0; }
.delivery-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
}
.delivery-column {
    border: 1px solid #dbe2ea;
    background: #fff;
}
.delivery-column > header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 8px;
    align-items: center;
    margin-bottom: 8px;
}
.delivery-column h2,
.delivery-column p { margin: 0; }
.delivery-column p { color: #64748b; }
.delivery-column-counter {
    grid-row: 1 / span 2;
    grid-column: 2;
    min-width: 25px;
    padding: 3px 6px;
    border-radius: 999px;
    text-align: center;
    font-weight: 800;
    background: #eef2f6;
}
.delivery-column-list { display: grid; gap: 7px; }
.delivery-ticket {
    border: 1px solid #dbe2ea;
    border-left: 4px solid #f59e0b;
    background: #fff;
}
.delivery-ticket.is-on-route { border-left-color: #2563eb; }
.delivery-ticket.is-delivered { border-left-color: #15803d; opacity: .82; }
.delivery-ticket > header {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: start;
}
.delivery-ticket h3 { margin: 0; font-size: 13px; }
.delivery-ticket small { color: #64748b; }
.delivery-details { display: grid; gap: 3px; margin: 7px 0; }
.delivery-details strong { color: #475569; }
.delivery-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.delivery-button-primary { background: #2563eb; color: #fff; }
.delivery-button-success { background: #15803d; color: #fff; }
.delivery-button-secondary { background: #fff; color: #1f2937; border: 1px solid #cbd5e1; }
.delivery-empty {
    padding: 16px 8px;
    color: #64748b;
    text-align: center;
    font-size: 11px;
}

@media (max-width: 1500px) {
    .operations-board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
    .operations-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .delivery-board { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
    .operations-workspace .app { grid-template-columns: 176px minmax(0, 1fr); }
}
@media (max-width: 760px) {
    .operations-workspace .app { display: block; }
    .operations-summary-grid,
    .delivery-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .operations-board { grid-template-columns: 1fr; }
}

/* ==========================================================
   CONTROL CENTER v1.9 — SCROLL NATIVO Y MÓDULO CAJA
   ========================================================== */

/*
 * En el Centro de Operaciones se utiliza el desplazamiento nativo de la
 * página. Esto evita áreas de scroll anidadas que pueden bloquear la rueda
 * del mouse o el panel táctil.
 */
body.operations-workspace {
    min-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: auto;
}

body.operations-workspace .app {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
    align-items: stretch;
}

body.operations-workspace .sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    height: 100dvh;
}

body.operations-workspace .main {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
    overscroll-behavior: auto;
}

body.operations-workspace #content {
    overflow: visible;
    overscroll-behavior: auto;
    min-height: calc(100vh - 72px);
}

body.operations-workspace .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
}

.cash-module {
    display: grid;
    gap: 12px;
    padding: 14px;
}

.cash-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.cash-summary-card,
.cash-panel {
    border: 1px solid #dbe2ea;
    border-radius: 12px;
    background: #ffffff;
}

.cash-summary-card {
    padding: 12px;
}

.cash-summary-card span {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.cash-summary-card strong {
    display: block;
    margin-top: 4px;
    color: #111827;
    font-size: 22px;
}

.cash-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr);
    gap: 12px;
}

.cash-panel {
    padding: 14px;
}

.cash-panel h2 {
    margin: 0 0 10px;
    font-size: 17px;
}

.cash-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.cash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.cash-table th,
.cash-table td {
    padding: 9px 8px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    white-space: nowrap;
}

.cash-table th {
    color: #64748b;
    font-size: 11px;
    text-transform: uppercase;
}

.cash-empty {
    padding: 24px 12px;
    color: #64748b;
    text-align: center;
}

.cash-breakdown {
    display: grid;
    gap: 8px;
}

.cash-breakdown-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
}

.cash-breakdown-row:last-child {
    border-bottom: 0;
}

@media (max-width: 980px) {
    .cash-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cash-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    body.operations-workspace .sidebar {
        position: fixed;
    }

    body.operations-workspace .topbar {
        position: sticky;
    }

    .cash-module {
        padding: 10px;
    }
}

@media (max-width: 520px) {
    .cash-summary {
        grid-template-columns: 1fr;
    }
}


/* ==========================================================
   CONTROL CENTER V2.0 · COMANDERA UNIFICADA
   ========================================================== */
.unified-operations{font-size:14px;overflow-y:auto!important;}
.unified-operations .app{min-height:100dvh;height:auto;align-items:stretch;}
.unified-operations .main{min-width:0;overflow:visible;}
.unified-operations .topbar{position:sticky;top:0;z-index:30;min-height:58px;padding:8px 16px;}
.unified-operations .topbar h1{font-size:20px;margin:0;}
.unified-operations .topbar p{font-size:12px;margin:2px 0 0;}
.unified-operations .top-actions{gap:6px;flex-wrap:wrap;}
.unified-operations .top-actions .btn{min-height:34px;padding:7px 10px;font-size:12px;}
.unified-operations .sidebar{position:sticky;top:0;height:100dvh;}
.unified-operations .sidebar #operationsNav{overflow-y:auto;min-height:0;}
.unified-operations .sidebar-link{width:100%;border:0;text-align:left;background:transparent;cursor:pointer;}
.unified-content{padding:12px 14px 28px;overflow:visible!important;min-height:calc(100dvh - 58px);}
.is-hidden{display:none!important;}
.command-center{display:grid;gap:10px;}
.command-summary{display:grid;grid-template-columns:repeat(5,minmax(90px,1fr));gap:7px;}
.command-summary-item{background:#fff;border:1px solid #dfe5ec;border-radius:10px;padding:8px 10px;display:flex;align-items:center;justify-content:space-between;gap:8px;}
.command-summary-item span{font-size:11px;color:#64748b;font-weight:700;text-transform:uppercase;letter-spacing:.03em;}
.command-summary-item strong{font-size:21px;color:#111827;}
.command-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;background:#fff;border:1px solid #dfe5ec;border-radius:10px;padding:9px 12px;}
.command-toolbar h2{margin:0;font-size:16px;}.command-toolbar p{margin:2px 0 0;color:#64748b;font-size:12px;}
.command-filter-row{display:flex;gap:5px;flex-wrap:wrap;}.command-filter{padding:6px 9px!important;min-height:30px!important;font-size:11px!important;}.command-filter.active{background:#172033;color:#fff;border-color:#172033;}
.command-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;align-items:start;}
.command-card{background:#fff;border:1px solid #d8dee8;border-left:4px solid #94a3b8;border-radius:10px;overflow:hidden;min-width:0;}
.command-card.phase-incoming{border-left-color:#f59e0b}.command-card.phase-payment{border-left-color:#eab308}.command-card.phase-kitchen{border-left-color:#2563eb}.command-card.phase-ready{border-left-color:#16a34a}
.command-card-open{width:100%;display:block;border:0;background:transparent;text-align:left;padding:10px;color:inherit;cursor:pointer;}
.command-card-open:hover{background:#f8fafc}.command-card-open:focus-visible{outline:3px solid rgba(249,115,22,.35);outline-offset:-3px;}
.command-card header,.command-card-line,.command-card footer{display:flex;align-items:center;justify-content:space-between;gap:8px;}
.command-card header strong{font-size:14px}.command-card header span{font-size:10px;color:#64748b}.command-card-status{display:flex;align-items:center;justify-content:space-between;margin:7px 0 5px}.command-card-status span{font-size:10px;font-weight:800;text-transform:uppercase;color:#475569}.command-card-status b{font-size:9px;color:#b45309;background:#ffedd5;border-radius:999px;padding:3px 6px}.command-card h3{font-size:14px;margin:0 0 3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.command-stars{font-size:10px;color:#b45309;margin:0 0 7px}.command-card-line{font-size:11px;margin-bottom:6px}.command-card-line strong{font-size:15px;color:#e56a00}.command-card ul{margin:0;padding:6px 0 6px 16px;border-top:1px solid #eef2f7;border-bottom:1px solid #eef2f7;font-size:11px;min-height:48px}.command-card footer{padding-top:7px;font-size:10px}.command-card footer span{color:#64748b}.command-card footer b{color:#c2410c}
.operations-notification-region{position:fixed;top:12px;right:14px;z-index:1000;display:grid;gap:8px;width:min(390px,calc(100vw - 28px));pointer-events:none}.new-order-toast{pointer-events:auto;background:#111827;color:#fff;border:2px solid #f59e0b;border-radius:12px;padding:10px;display:grid;grid-template-columns:1fr auto auto;align-items:center;gap:8px;box-shadow:0 12px 28px rgba(15,23,42,.25)}.new-order-toast div{display:grid;gap:2px}.new-order-toast span{font-size:10px;color:#fbbf24;font-weight:900}.new-order-toast strong{font-size:13px}.new-order-toast small{font-size:11px;color:#cbd5e1}.new-order-toast button{border:0;border-radius:7px;padding:7px 9px;font-weight:800;cursor:pointer}.new-order-toast [data-notice-open]{background:#f59e0b;color:#111827}.new-order-toast [data-notice-close]{background:transparent;color:#fff;font-size:18px;padding:3px 6px}
.order-drawer-overlay{position:fixed;inset:0;z-index:900;background:rgba(15,23,42,.5);display:flex;justify-content:flex-end}.order-drawer{width:min(470px,100%);height:100%;background:#fff;overflow-y:auto;box-shadow:-12px 0 30px rgba(0,0,0,.2)}.drawer-open{overflow:hidden!important}.order-drawer-head{position:sticky;top:0;z-index:2;background:#fff;border-bottom:1px solid #e5e7eb;padding:12px 14px;display:flex;align-items:center;justify-content:space-between}.order-drawer-head span{font-size:10px;text-transform:uppercase;color:#64748b;font-weight:800}.order-drawer-head h2{font-size:20px;margin:2px 0 0}.order-drawer-head button{border:0;background:#111827;color:#fff;border-radius:50%;width:34px;height:34px;font-size:22px;cursor:pointer}.order-drawer-body{padding:12px 14px 24px;display:grid;gap:12px}.order-drawer-body section{border:1px solid #e5e7eb;border-radius:10px;padding:10px}.order-drawer-body h3{font-size:13px;margin:0 0 7px}.drawer-customer p{margin:3px 0;font-size:12px}.drawer-data{display:grid;grid-template-columns:90px 1fr;gap:6px;margin:0;border:1px solid #e5e7eb;border-radius:10px;padding:10px;font-size:12px}.drawer-data dt{font-weight:800;color:#64748b}.drawer-data dd{margin:0}.drawer-items{margin:0;padding-left:18px;font-size:12px}.drawer-note p{margin:0;font-size:12px}.drawer-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.drawer-actions h3{grid-column:1/-1}.drawer-action{width:100%;min-height:36px;font-size:12px}.drawer-action.success{background:#16803b;color:#fff;border-color:#16803b}.drawer-action.warning{background:#fff7ed;color:#9a3412;border-color:#fdba74}.drawer-action.danger{background:#fff1f2;color:#b91c1c;border-color:#fecdd3}.operations-audit{font-size:11px}.operations-audit ol{padding-left:20px}.operations-audit li{margin:6px 0}.operations-audit li span{display:block;color:#64748b}
.archive-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.archive-heading h2{font-size:18px;margin:0}.archive-heading p{font-size:12px;color:#64748b;margin:2px 0 0}.archive-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px}.archive-card{background:#fff;border:1px solid #dfe5ec;border-radius:10px;padding:10px}.archive-card header{display:flex;justify-content:space-between;gap:8px;font-size:11px}.archive-card h3{font-size:14px;margin:8px 0 4px}.archive-card p{font-size:11px;color:#64748b}.archive-card .btn{padding:6px 8px;min-height:30px;font-size:11px;margin-right:4px}.customer-compact-grid{display:grid;gap:7px}.customer-compact-card{display:grid;grid-template-columns:minmax(180px,1fr) 120px 90px 120px;align-items:center;gap:10px;background:#fff;border:1px solid #dfe5ec;border-radius:9px;padding:9px 11px}.customer-compact-card h3{font-size:13px;margin:0}.customer-compact-card p{font-size:11px;color:#64748b;margin:2px 0 0}.customer-compact-card strong{color:#b45309}.customer-compact-card span{font-size:12px}.cash-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:10px}.cash-summary article{background:#fff;border:1px solid #dfe5ec;border-radius:10px;padding:10px}.cash-summary span{font-size:11px;color:#64748b}.cash-summary strong{display:block;font-size:22px;margin-top:3px}.cash-list{display:grid;gap:5px}.cash-row{display:grid;grid-template-columns:100px minmax(150px,1fr) 130px 140px;gap:10px;background:#fff;border:1px solid #e5e7eb;border-radius:8px;padding:8px 10px;font-size:12px}
@media(max-width:1350px){.command-grid,.archive-grid{grid-template-columns:repeat(3,minmax(0,1fr));}}
@media(max-width:1050px){.command-grid,.archive-grid{grid-template-columns:repeat(2,minmax(0,1fr));}.command-summary{grid-template-columns:repeat(3,minmax(0,1fr));}.customer-compact-card{grid-template-columns:1fr 100px 80px}.customer-compact-card span:last-child{display:none}}
@media(max-width:760px){.unified-operations .topbar{position:sticky;padding:7px 9px}.operations-heading p{display:none}.unified-content{padding:8px}.command-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.command-toolbar{align-items:flex-start;flex-direction:column}.command-grid,.archive-grid{grid-template-columns:1fr}.cash-summary{grid-template-columns:1fr}.cash-row{grid-template-columns:80px 1fr}.cash-row span:nth-last-child(-n+2){display:none}.customer-compact-card{grid-template-columns:1fr auto}.customer-compact-card span{display:none}.drawer-actions{grid-template-columns:1fr}.top-actions .btn{padding:6px 7px!important}.operations-notification-region{top:8px;right:8px;width:calc(100vw - 16px)}}

/* =========================================================
   PROMOCOMBO CONTROL CENTER v3.5
   Validaciones de clientes y zona de entrega
   ========================================================= */
.validation-workspace {
    --validation-bg: #f1f3f5;
    --validation-card: #ffffff;
    --validation-border: #d7dde3;
    --validation-text: #202833;
    --validation-muted: #66717d;
    --validation-accent: #c96a18;
    display: grid;
    gap: 16px;
    padding: 20px;
    color: var(--validation-text);
    background: var(--validation-bg);
}
.validation-hero,
.validation-panel,
.validation-summary article {
    border: 1px solid var(--validation-border);
    border-radius: 16px;
    background: var(--validation-card);
    box-shadow: 0 8px 24px rgba(31, 40, 51, .06);
}
.validation-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
}
.validation-hero h2,
.validation-panel h3 { margin: 2px 0 0; }
.validation-hero p { margin: 6px 0 0; color: var(--validation-muted); }
.validation-eyebrow { color: var(--validation-accent); font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.validation-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.validation-summary article { padding: 14px 16px; }
.validation-summary span,
.validation-summary small { display: block; color: var(--validation-muted); }
.validation-summary strong { display: block; margin: 5px 0 2px; font-size: 28px; }
.validation-layout { display: grid; grid-template-columns: minmax(250px, .8fr) minmax(330px, 1fr) minmax(420px, 1.45fr); gap: 14px; align-items: start; }
.validation-panel { min-width: 0; overflow: hidden; }
.validation-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--validation-border); background: #f7f8f9; }
.validation-panel-head select { min-height: 36px; border: 1px solid var(--validation-border); border-radius: 9px; padding: 0 10px; background: #fff; }
.validation-request-list { display: grid; gap: 8px; max-height: 610px; padding: 12px; overflow: auto; }
.validation-request-card { display: grid; gap: 5px; width: 100%; padding: 12px; border: 1px solid var(--validation-border); border-radius: 12px; color: inherit; background: #fff; text-align: left; cursor: pointer; }
.validation-request-card:hover,
.validation-request-card.is-selected { border-color: #c98a52; background: #fff9f3; box-shadow: 0 5px 14px rgba(58, 42, 28, .08); }
.validation-request-card > span:not(.validation-request-status),
.validation-request-card small { color: var(--validation-muted); }
.validation-request-status { width: max-content; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.status-pending { color: #8a4b08; background: #fff0cc; }
.status-approved { color: #21613c; background: #dff1e5; }
.status-rejected { color: #8d2f2f; background: #f6dddd; }
.status-needs_correction { color: #31537d; background: #e1ebf7; }
.validation-detail-panel { padding-bottom: 14px; }
.validation-data-grid { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px 12px; margin: 0; padding: 16px; }
.validation-data-grid dt { color: var(--validation-muted); font-weight: 800; }
.validation-data-grid dd { margin: 0; overflow-wrap: anywhere; }
.validation-notes-label { display: block; padding: 0 16px 6px; font-weight: 800; }
.validation-detail-panel textarea { display: block; width: calc(100% - 32px); margin: 0 16px 12px; resize: vertical; border: 1px solid var(--validation-border); border-radius: 10px; padding: 10px; font: inherit; }
.validation-actions { display: grid; gap: 8px; padding: 0 16px; }
.validation-action-success { color: #fff !important; border-color: #2f8054 !important; background: #2f8054 !important; }
.validation-action-danger { color: #922f2f !important; border-color: #dca5a5 !important; background: #fff3f3 !important; }
.validation-security-note { display: block; padding: 10px 16px 0; color: var(--validation-muted); }
.validation-map-toolbar { display: flex; gap: 7px; flex-wrap: wrap; padding: 10px 12px; }
.validation-map-status { color: #2f8054; font-size: 11px; font-weight: 800; }
.delivery-zone-map { height: 520px; margin: 0 12px; border: 1px solid var(--validation-border); border-radius: 12px; overflow: hidden; background: #e7eaed; }
.delivery-zone-map.is-drawing-zone { cursor: crosshair; outline: 3px solid rgba(201, 106, 24, .22); }
.validation-map-help { margin: 10px 14px 14px; color: var(--validation-muted); font-size: 11px; }
.validation-empty-state,
.validation-map-error { display: grid; place-items: center; gap: 7px; min-height: 180px; padding: 24px; color: var(--validation-muted); text-align: center; }
.validation-empty-state strong,
.validation-map-error strong { color: var(--validation-text); }
@media (max-width: 1250px) {
    .validation-layout { grid-template-columns: minmax(250px, .8fr) minmax(380px, 1.2fr); }
    .validation-map-panel { grid-column: 1 / -1; }
    .delivery-zone-map { height: 450px; }
}
@media (max-width: 760px) {
    .validation-workspace { padding: 12px; }
    .validation-hero { align-items: stretch; flex-direction: column; }
    .validation-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .validation-layout { grid-template-columns: 1fr; }
    .validation-map-panel { grid-column: auto; }
    .delivery-zone-map { height: 390px; }
}

/* =========================================================
   V10.24 — MODELO DE PRECIOS: VENTA / LISTA
========================================================= */
.price-stack{display:grid;gap:3px;min-width:110px;align-content:center}
.price-stack .price-sale{font-size:.86rem;color:#101827;white-space:nowrap}
.price-stack .price-list{font-size:.67rem;color:#7a8493;white-space:nowrap}
.price-stack .price-warning{font-size:.65rem;color:#b45309;font-weight:800;white-space:nowrap}
.price-stack .price-discount{justify-self:start;padding:3px 7px;font-size:.58rem}


/* ==========================================================
   V10.28 — CIERRE SEGURO DEL MODAL DE PRODUCTOS
   ========================================================== */
#closeModal {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border: 2px solid #111 !important;
    border-radius: 12px;
    background: #ef3b36 !important;
    color: #fff !important;
    font-size: 30px;
    font-weight: 900;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
}

#closeModal:hover {
    transform: translateY(-1px);
    background: #d92c28 !important;
}

#closeModal:focus-visible {
    outline: 3px solid rgba(239, 59, 54, .3);
    outline-offset: 2px;
}


/* ==========================================================
   V10.30 — HISTORIAL Y ADMINISTRACIÓN DE IMÁGENES
   ========================================================== */
.product-image-history {
    margin-top: 10px;
    padding: 16px;
    border: 1px solid #d8dee8;
    border-radius: 14px;
    background: #f8fafc;
}

.product-image-history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.product-image-history-head > div {
    display: grid;
    gap: 4px;
}

.product-image-history-head small {
    color: #64748b;
}

.product-image-history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
}

.product-history-card {
    overflow: hidden;
    border: 1px solid #d9e0e9;
    border-radius: 12px;
    background: #fff;
}

.product-history-card.is-primary {
    border: 2px solid #16a34a;
}

.product-history-preview {
    width: 100%;
    height: 130px;
    padding: 0;
    border: 0;
    background: #eef2f7;
    cursor: pointer;
}

.product-history-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-history-info {
    display: grid;
    gap: 4px;
    padding: 10px;
}

.product-history-info small {
    color: #64748b;
}

.product-history-primary-badge,
.media-primary-badge {
    width: max-content;
    padding: 3px 8px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 11px;
    font-weight: 800;
}

.product-history-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 10px 10px;
}

.product-image-history-loading,
.product-image-history-empty {
    padding: 18px;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    color: #64748b;
    text-align: center;
    background: #fff;
}

.media-asset-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 800;
    color: #334155;
}

@media (max-width: 760px) {
    .product-image-history-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .product-image-history-grid {
        grid-template-columns: 1fr;
    }
}


/* ==========================================================
   V10.31 — EDITOR DE PRODUCTOS PROFESIONAL
   ========================================================== */

.modal:not(.hidden) .modal-card {
    width: min(1120px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    border-radius: 22px;
    border: 1px solid #dfe5ec;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
    overflow: hidden;
}

.modal:not(.hidden) .modal-head {
    padding: 24px 26px 20px;
    background:
        linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
    border-bottom: 1px solid #e8edf3;
}

.modal:not(.hidden) .modal-head h2 {
    margin: 0;
    font-size: 28px;
    letter-spacing: -.02em;
    color: #0f172a;
}

.modal:not(.hidden) .modal-head p {
    margin: 6px 0 0;
    max-width: 720px;
    color: #64748b;
    font-size: 15px;
}

.product-editor {
    padding: 22px 24px 26px;
    background: #f8fafc;
}

.product-editor-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 6px;
    margin-bottom: 22px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #eef2f7;
}

.product-editor-tab {
    min-height: 48px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #64748b;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: .18s ease;
}

.product-editor-tab:hover {
    color: #0f172a;
    background: rgba(255,255,255,.55);
}

.product-editor-tab.is-active {
    background: #ffffff;
    color: #0f172a;
    box-shadow:
        0 1px 3px rgba(15, 23, 42, .08),
        0 6px 16px rgba(15, 23, 42, .05);
}

.product-editor-section {
    display: none;
}

.product-editor-section.is-active {
    display: block;
}

.product-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    padding: 2px 2px 0;
}

.product-section-heading h3 {
    margin: 4px 0 4px;
    font-size: 22px;
    line-height: 1.15;
    color: #0f172a;
    letter-spacing: -.02em;
}

.product-section-heading p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

.product-section-kicker {
    font-size: 11px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: .1em;
    color: #ef3b36;
}

.product-form-grid {
    gap: 16px 18px;
}

.product-field {
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .02);
    color: #0f172a;
    font-size: 13px;
    font-weight: 800;
}

.product-field input,
.product-field select,
.product-field textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid #cfd8e3;
    border-radius: 10px;
    background: #fbfdff;
    color: #111827;
    font-size: 15px;
    font-weight: 600;
    outline: none;
    transition:
        border-color .16s ease,
        box-shadow .16s ease,
        background .16s ease;
}

.product-field textarea {
    min-height: 112px;
    resize: vertical;
}

.product-field input:focus,
.product-field select:focus,
.product-field textarea:focus {
    border-color: #ef3b36;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(239, 59, 54, .10);
}

.product-field .field-help {
    display: block;
    margin: 0;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.45;
}

.product-field-price {
    border-color: #d8e8dc;
    background:
        linear-gradient(180deg, #ffffff 0%, #fbfffc 100%);
}

.product-field-price input {
    font-size: 18px;
    font-weight: 900;
    color: #0f172a;
}

.product-upload-field input[type="file"] {
    padding: 8px;
    background: #f8fafc;
    cursor: pointer;
}

.product-upload-field input[type="file"]::file-selector-button {
    margin-right: 10px;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    font-weight: 800;
    cursor: pointer;
}

.product-main-image-panel {
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
}

.product-main-image-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.product-main-image-heading > div {
    display: grid;
    gap: 3px;
}

.product-main-image-heading strong {
    color: #0f172a;
    font-size: 15px;
}

.product-main-image-heading small {
    color: #64748b;
    font-size: 12px;
}

.product-main-image-panel .preview-box {
    min-height: 240px;
    padding: 14px;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    background:
        linear-gradient(45deg, #f8fafc 25%, transparent 25%),
        linear-gradient(-45deg, #f8fafc 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f8fafc 75%),
        linear-gradient(-45deg, transparent 75%, #f8fafc 75%);
    background-size: 24px 24px;
    background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}

.product-main-image-panel .preview-box img {
    max-height: 360px;
    object-fit: contain;
    border-radius: 10px;
}

.product-image-history {
    padding: 18px;
    border-radius: 16px;
    border: 1px solid #dde5ee;
    background:
        linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
}

.product-image-history-head {
    margin-bottom: 14px;
}

.product-image-history-head strong {
    font-size: 16px;
    color: #0f172a;
}

.product-image-history-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
}

.product-history-card {
    border-radius: 14px;
    border: 1px solid #dfe5ec;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .04);
    transition: transform .16s ease, box-shadow .16s ease;
}

.product-history-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, .08);
}

.product-history-card.is-primary {
    border: 2px solid #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, .08);
}

.product-history-preview {
    height: 150px;
    background: #f1f5f9;
}

.product-history-info {
    padding: 12px 12px 8px;
}

.product-history-info strong {
    color: #0f172a;
    font-size: 14px;
}

.product-history-actions {
    padding: 0 12px 12px;
}

.product-status-panel {
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
}

.product-status-heading {
    display: grid;
    gap: 3px;
    margin-bottom: 12px;
}

.product-status-heading strong {
    font-size: 15px;
    color: #0f172a;
}

.product-status-heading small {
    color: #64748b;
    font-size: 12px;
}

.product-status-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.product-status-grid label {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    border: 1px solid #dfe5ec;
    border-radius: 11px;
    background: #f8fafc;
    color: #334155;
    font-size: 13px;
    font-weight: 800;
}

.product-status-grid input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: #ef3b36;
}

.modal:not(.hidden) .modal-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    padding: 14px 24px;
    border-top: 1px solid #e2e8f0;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(10px);
}

.modal:not(.hidden) .modal-actions .btn.primary,
.modal:not(.hidden) .modal-actions button[type="submit"] {
    min-width: 150px;
    min-height: 48px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(239, 59, 54, .18);
}

#closeModal {
    position: absolute;
    top: 18px;
    right: 20px;
    z-index: 8;
}

@media (max-width: 900px) {
    .product-status-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .modal:not(.hidden) .modal-card {
        width: calc(100vw - 12px);
        max-height: calc(100vh - 12px);
        border-radius: 16px;
    }

    .product-editor {
        padding: 14px;
    }

    .product-editor-tabs {
        grid-template-columns: 1fr;
    }

    .product-status-grid {
        grid-template-columns: 1fr;
    }

    .product-image-history-grid {
        grid-template-columns: 1fr;
    }
}


/* ==========================================================
   V10.32 — CORRECCIÓN MODAL PRODUCTOS
   ========================================================== */

/* El overlay centra correctamente la ventana completa. */
#modal.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow: hidden;
}

#modal.modal.hidden {
    display: none;
}

/* La tarjeta es el marco del modal y controla el alto total. */
#modal .modal-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(1120px, calc(100vw - 32px));
    height: min(900px, calc(100vh - 32px));
    max-height: calc(100vh - 32px);
    margin: 0;
    overflow: hidden;
    border-radius: 22px;
    background: #fff;
}

/* Encabezado visible, sin desplazarse. */
#modal .modal-head {
    position: relative;
    flex: 0 0 auto;
    padding: 24px 88px 20px 26px;
    border-bottom: 1px solid #e8edf3;
    background: #fff;
    z-index: 4;
}

/* La X queda dentro de la tarjeta, arriba a la derecha. */
#modal #closeModal {
    position: absolute !important;
    top: 18px !important;
    right: 20px !important;
    z-index: 10;
    width: 46px;
    height: 46px;
    min-width: 46px;
    margin: 0;
}

/* Esta es la zona que DEBE desplazarse. */
#modal .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    background: #f8fafc;
}

/* Evita que el editor capture/rompa el alto disponible. */
#modal .product-editor {
    min-height: auto;
    height: auto;
    overflow: visible;
}

/* Acciones siempre accesibles abajo del modal. */
#modal .modal-actions {
    position: relative !important;
    bottom: auto !important;
    flex: 0 0 auto;
    z-index: 5;
    padding: 14px 24px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
    backdrop-filter: none;
}

/* Scroll más claro visualmente. */
#modal .modal-body::-webkit-scrollbar {
    width: 10px;
}

#modal .modal-body::-webkit-scrollbar-track {
    background: #f1f5f9;
}

#modal .modal-body::-webkit-scrollbar-thumb {
    background: #c4ccd6;
    border: 2px solid #f1f5f9;
    border-radius: 999px;
}

#modal .modal-body::-webkit-scrollbar-thumb:hover {
    background: #9ca8b6;
}

@media (max-width: 720px) {
    #modal.modal {
        padding: 6px;
    }

    #modal .modal-card {
        width: calc(100vw - 12px);
        height: calc(100vh - 12px);
        max-height: calc(100vh - 12px);
        border-radius: 16px;
    }

    #modal .modal-head {
        padding: 18px 72px 16px 18px;
    }

    #modal #closeModal {
        top: 12px !important;
        right: 12px !important;
        width: 42px;
        height: 42px;
        min-width: 42px;
    }

    #modal .modal-actions {
        padding: 10px 14px;
    }
}


/* ==========================================================
   V10.32B — MODAL SEGÚN ESTRUCTURA HTML REAL
   ========================================================== */

#modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow: hidden;
}

#modal.hidden {
    display: none !important;
}

#modal > .modal-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(1120px, calc(100vw - 32px));
    height: min(900px, calc(100vh - 32px));
    max-height: calc(100vh - 32px);
    margin: 0 auto;
    overflow: hidden !important;
    border-radius: 22px;
    background: #fff;
}

/* Encabezado REAL del modal */
#modal > .modal-card > header {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 82px 18px 24px;
    border-bottom: 1px solid #e5eaf0;
    background: #fff;
    z-index: 5;
}

#modal > .modal-card > header h2 {
    margin: 0;
    font-size: 28px;
    line-height: 1.15;
    color: #0f172a;
}

#modal > .modal-card > header p {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 15px;
}

/* X dentro del encabezado */
#modal #closeModal {
    position: absolute !important;
    top: 16px !important;
    right: 18px !important;
    width: 46px;
    height: 46px;
    min-width: 46px;
    margin: 0 !important;
    z-index: 10;
}

/* El formulario ocupa el espacio restante */
#modal #modalForm {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
}

/* Esta es la única zona desplazable */
#modal #modalBody {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    background: #f8fafc;
}

/* Evitar que estilos anteriores vuelvan a bloquear el editor */
#modal #modalBody .product-editor {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
}

/* Pie REAL del formulario */
#modal #modalForm > footer {
    position: relative !important;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 22px;
    margin: 0 !important;
    border-top: 1px solid #e2e8f0;
    background: #fff;
    z-index: 5;
}

/* Scroll visible y cómodo */
#modal #modalBody::-webkit-scrollbar {
    width: 10px;
}

#modal #modalBody::-webkit-scrollbar-track {
    background: #eef2f6;
}

#modal #modalBody::-webkit-scrollbar-thumb {
    background: #b9c3cf;
    border: 2px solid #eef2f6;
    border-radius: 999px;
}

#modal #modalBody::-webkit-scrollbar-thumb:hover {
    background: #94a1af;
}

@media (max-width: 720px) {
    #modal {
        padding: 6px;
    }

    #modal > .modal-card {
        width: calc(100vw - 12px);
        height: calc(100vh - 12px);
        max-height: calc(100vh - 12px);
        border-radius: 16px;
    }

    #modal > .modal-card > header {
        padding: 18px 68px 15px 18px;
    }

    #modal > .modal-card > header h2 {
        font-size: 23px;
    }

    #modal #closeModal {
        top: 11px !important;
        right: 11px !important;
        width: 42px;
        height: 42px;
        min-width: 42px;
    }

    #modal #modalForm > footer {
        padding: 10px 14px;
    }
}


/* ==========================================================
   V10.33 — VISTA PREVIA REAL DE PUBLICACIÓN
   ========================================================== */

.product-publication-preview {
    padding: 18px;
    border: 1px solid #dbe3ec;
    border-radius: 18px;
    background:
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.product-publication-preview-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.product-publication-preview-head > div:first-child {
    display: grid;
    gap: 4px;
}

.product-publication-preview-head strong {
    font-size: 18px;
    color: #0f172a;
}

.product-publication-preview-head small {
    color: #64748b;
    font-size: 12px;
}

.publication-preview-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid #dce3eb;
    border-radius: 10px;
    background: #eef2f7;
}

.publication-preview-tab {
    min-width: 72px;
    padding: 8px 12px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #64748b;
    font-weight: 800;
    cursor: pointer;
}

.publication-preview-tab.is-active {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .10);
}

.publication-preview-stage {
    display: flex;
    justify-content: center;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid #e1e7ee;
    background: #eef2f6;
    transition: .2s ease;
}

.publication-preview-stage.is-app .publication-device-frame {
    width: min(360px, 100%);
}

.publication-preview-stage.is-web .publication-device-frame {
    width: min(760px, 100%);
}

.publication-device-frame {
    overflow: hidden;
    border: 1px solid #d4dbe4;
    border-radius: 20px;
    background: #fff;
    box-shadow:
        0 18px 40px rgba(15, 23, 42, .12),
        0 2px 6px rgba(15, 23, 42, .06);
    transition: width .2s ease;
}

.publication-device-topbar {
    display: flex;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid #edf1f5;
    background: #fff;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
}

.publication-product-card {
    background: #fff;
}

.publication-preview-stage.is-web .publication-product-card {
    display: grid;
    grid-template-columns: minmax(280px, 44%) 1fr;
    min-height: 310px;
}

.publication-product-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f1f5f9;
}

.publication-preview-stage.is-web .publication-product-image-wrap {
    height: 100%;
    aspect-ratio: auto;
}

.publication-product-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.publication-image-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 6px;
    text-align: center;
    color: #94a3b8;
}

.publication-image-placeholder span {
    font-size: 34px;
}

.publication-image-placeholder small {
    font-weight: 700;
}

.publication-offer-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 9px;
    border-radius: 999px;
    background: #16a34a;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
}

.publication-product-body {
    position: relative;
    padding: 16px;
}

.publication-preview-stage.is-web .publication-product-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 28px;
}

.publication-category {
    display: block;
    margin-bottom: 5px;
    color: #ef3b36;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.publication-product-body h4 {
    margin: 0;
    color: #0f172a;
    font-size: 20px;
    line-height: 1.15;
}

.publication-preview-stage.is-web .publication-product-body h4 {
    font-size: 27px;
}

.publication-product-body p {
    margin: 8px 0 16px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}

.publication-preview-stage.is-web .publication-product-body p {
    font-size: 15px;
}

.publication-price-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.publication-price-row > div {
    display: grid;
    gap: 3px;
}

.publication-price-row strong {
    color: #0f172a;
    font-size: 21px;
    font-weight: 900;
}

.publication-preview-stage.is-web .publication-price-row strong {
    font-size: 26px;
}

.publication-price-row del {
    color: #94a3b8;
    font-size: 12px;
}

.publication-add-button {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: #ef3b36;
    color: #fff;
    font-size: 25px;
    line-height: 1;
    font-weight: 500;
    pointer-events: none;
}

.publication-unavailable {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,.80);
    color: #991b1b;
    font-weight: 900;
    font-size: 18px;
    backdrop-filter: blur(2px);
}

.publication-preview-stage.is-disabled .publication-product-card {
    filter: grayscale(.15);
}

.publication-preview-note {
    margin-top: 10px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.45;
    text-align: center;
}

@media (max-width: 720px) {
    .product-publication-preview-head {
        align-items: stretch;
        flex-direction: column;
    }

    .publication-preview-tabs {
        width: 100%;
    }

    .publication-preview-tab {
        flex: 1;
    }

    .publication-preview-stage {
        padding: 12px;
    }

    .publication-preview-stage.is-web .publication-product-card {
        display: block;
    }

    .publication-preview-stage.is-web .publication-product-image-wrap {
        aspect-ratio: 4 / 3;
        height: auto;
    }
}


/* ==========================================================
   V10.38 — MOBILE / TABLET OPERATIVO REAL
   Mantiene drawer lateral. NO barra inferior.
   ========================================================== */

button,
.btn,
.icon-btn,
.status-toggle,
input,
select,
textarea {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

button,
.btn,
.icon-btn,
.status-toggle {
    min-height: 44px;
}

input,
select,
textarea {
    font-size: 16px;
}

/* Fondo del drawer */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 890;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background: rgba(15, 23, 42, .48);
    backdrop-filter: blur(2px);
    transition:
        opacity .2s ease,
        visibility .2s ease;
}

.sidebar-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Tablet: mantenemos panel clásico hasta 900px */
@media (max-width: 900px) {

    html,
    body {
        overflow-x: hidden;
    }

    .app,
    .app.sidebar-collapsed {
        display: block !important;
        min-height: 100dvh;
        overflow: visible;
    }

    .main {
        width: 100%;
        min-width: 0;
        min-height: 100dvh;
    }

    /* DRAWER LATERAL */
    .sidebar {
        position: fixed !important;
        z-index: 900 !important;
        inset: 0 auto 0 0 !important;
        width: min(300px, 86vw) !important;
        height: 100dvh !important;
        padding: 16px 12px !important;
        transform: translateX(-105%) !important;
        transition: transform .2s ease !important;
        box-shadow: 18px 0 42px rgba(15,23,42,.26);
        overflow-y: auto !important;
        overflow-x: hidden !important;
        background: var(--dark) !important;
    }

    .sidebar.open {
        transform: translateX(0) !important;
    }

    .sidebar .brand {
        display: flex !important;
    }

    .sidebar #nav {
        display: grid !important;
        width: 100% !important;
        gap: 6px;
    }

    .sidebar #nav button,
    .sidebar .sidebar-link,
    .sidebar-foot a,
    .sidebar-foot button {
        width: 100% !important;
        min-height: 50px;
        display: flex !important;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        padding: 11px 13px !important;
        border-radius: 10px;
        text-align: left !important;
        font-size: 14px !important;
        white-space: normal !important;
    }

    .sidebar #nav button > span,
    .sidebar .sidebar-link > span {
        display: inline !important;
    }

    /* HEADER */
    .topbar {
        position: sticky;
        top: 0;
        z-index: 400;
        min-height: 72px;
        height: auto !important;
        display: grid !important;
        grid-template-columns: 48px minmax(0,1fr) auto;
        align-items: center;
        gap: 10px;
        padding: 10px 12px !important;
        background: rgba(255,255,255,.97);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid #e5e7eb;
    }

    .topbar > div:nth-of-type(1) {
        min-width: 0;
    }

    .topbar h1 {
        margin: 0;
        font-size: clamp(20px, 4.8vw, 28px);
        line-height: 1.12;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar p {
        margin-top: 3px;
        font-size: 12px;
        line-height: 1.25;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #menuBtn {
        width: 46px;
        min-width: 46px;
        height: 46px;
        padding: 0 !important;
        font-size: 27px;
        border-radius: 12px;
    }

    .top-actions {
        display: flex !important;
        align-items: center;
        gap: 6px;
    }

    .top-actions .save-state {
        display: none !important;
    }

    #quickAdd {
        width: 46px !important;
        min-width: 46px !important;
        height: 46px !important;
        padding: 0 !important;
        border-radius: 13px !important;
        font-size: 0 !important;
        display: grid;
        place-items: center;
    }

    #quickAdd::after {
        content: "+";
        font-size: 28px;
        line-height: 1;
        font-weight: 800;
    }

    #content {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 14px !important;
    }

    .panel {
        width: 100%;
        min-width: 0;
        padding: 16px !important;
        border-radius: 16px;
    }

    .panel-head {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .panel-head .actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }

    .panel-head .actions button,
    .panel-head .actions .btn {
        width: 100%;
        min-height: 48px;
    }

    .summary-grid {
        grid-template-columns: repeat(2,minmax(0,1fr)) !important;
        gap: 10px !important;
    }

    .summary-card {
        min-width: 0;
        padding: 13px !important;
        border: 1px solid #e2e8f0;
        border-radius: 13px;
        background: #fff;
    }

    .summary-card span {
        display: block;
        font-size: 12px;
        color: #64748b;
    }

    .summary-card strong {
        display: block;
        margin-top: 3px;
        font-size: 25px;
        line-height: 1;
    }

    .toolbar {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .toolbar label,
    .toolbar .search-field {
        width: 100%;
        min-width: 0;
    }

    .toolbar input,
    .toolbar select {
        width: 100%;
        min-height: 50px;
    }

    /* Modal/tablet */
    #modal {
        padding: 6px !important;
    }

    #modal > .modal-card {
        width: calc(100vw - 12px) !important;
        height: calc(100dvh - 12px) !important;
        max-height: calc(100dvh - 12px) !important;
        border-radius: 15px;
    }

    #modal #modalBody {
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }

    #modal #modalForm > footer button,
    #modal #modalForm > footer .btn {
        min-height: 50px;
    }

    .form-grid,
    .product-form-grid {
        grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    }
}

/* ==========================================================
   TELÉFONOS
   ========================================================== */
@media (max-width: 600px) {

    #content {
        padding: 10px !important;
    }

    .panel {
        padding: 12px !important;
    }

    .panel-head .actions {
        grid-template-columns: 1fr !important;
    }

    .summary-grid {
        grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    }

    /* CATEGORÍAS COMO TARJETAS */
    .categories-table,
    .categories-table tbody,
    .categories-table tr,
    .categories-table td {
        display: block;
        width: 100%;
    }

    .categories-table {
        min-width: 0 !important;
    }

    .categories-table thead {
        display: none;
    }

    .categories-table tbody {
        display: grid;
        gap: 12px;
    }

    .categories-table tr {
        padding: 12px;
        border: 1px solid #dfe5ec;
        border-radius: 15px;
        background: #fff;
        box-shadow: 0 4px 14px rgba(15,23,42,.06);
    }

    .categories-table td {
        padding: 9px 0 !important;
        border: 0 !important;
    }

    .categories-table td + td {
        border-top: 1px solid #eef2f6 !important;
    }

    /* Orden */
    .categories-table td:nth-child(1) {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: 8px;
    }

    .categories-table td:nth-child(1)::before {
        content: "Orden";
        font-size: 12px;
        font-weight: 800;
        color: #64748b;
    }

    /* Categoría */
    .categories-table td:nth-child(2) {
        padding-top: 12px !important;
        padding-bottom: 12px !important;
    }

    /* Productos */
    .categories-table td:nth-child(3)::before {
        content: "Productos";
        display: block;
        margin-bottom: 5px;
        font-size: 12px;
        font-weight: 800;
        color: #64748b;
    }

    /* Visible y Carrusel */
    .categories-table td:nth-child(4),
    .categories-table td:nth-child(5) {
        display: grid;
        grid-template-columns: 86px 1fr;
        align-items: center;
        gap: 10px;
    }

    .categories-table td:nth-child(4)::before {
        content: "Visible";
        font-size: 12px;
        font-weight: 800;
        color: #64748b;
    }

    .categories-table td:nth-child(5)::before {
        content: "Carrusel";
        font-size: 12px;
        font-weight: 800;
        color: #64748b;
    }

    .categories-table .status-toggle {
        width: 100% !important;
        min-height: 46px;
    }

    /* Acciones */
    .categories-table td:nth-child(6)::before {
        content: "Acciones";
        display: block;
        margin-bottom: 7px;
        font-size: 12px;
        font-weight: 800;
        color: #64748b;
    }

    .categories-table .row-actions {
        display: grid !important;
        grid-template-columns: repeat(2,minmax(0,1fr));
        gap: 8px;
    }

    .categories-table .row-actions button {
        width: 100%;
        min-height: 46px;
        padding: 8px !important;
    }

    .categories-table .row-actions button:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    /* Productos: preferimos scroll horizontal antes que romper la tabla */
    .table-wrap:not(:has(.categories-table)) {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
    }

    .table-wrap:not(:has(.categories-table)) table {
        min-width: 900px;
    }

    /* Formularios */
    .form-grid,
    .product-form-grid {
        grid-template-columns: 1fr !important;
    }

    .product-field,
    .full {
        grid-column: 1 / -1 !important;
    }

    .product-editor,
    .category-editor {
        padding: 10px !important;
    }

    .product-image-history-grid {
        grid-template-columns: 1fr !important;
    }

    .product-history-actions {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .product-history-actions button {
        width: 100%;
        min-height: 46px;
    }

    #modal > .modal-card > header {
        padding: 14px 64px 12px 14px !important;
    }

    #modal #closeModal {
        top: 9px !important;
        right: 9px !important;
        width: 44px;
        height: 44px;
        min-width: 44px;
    }

    #modal #modalForm > footer {
        display: grid !important;
        grid-template-columns: 1fr;
        padding: 10px;
    }

    #modal #modalForm > footer button,
    #modal #modalForm > footer .btn {
        width: 100%;
    }
}

@media (max-width: 390px) {
    .summary-grid {
        grid-template-columns: 1fr !important;
    }

    .categories-table .row-actions {
        grid-template-columns: 1fr;
    }
}


/* ==========================================================
   V10.39 — CATEGORÍAS MOBILE COMPACTAS
   Más información visible por pantalla sin perder touch.
   ========================================================== */

@media (max-width: 600px) {

    /* Cabecera aún más compacta */
    .topbar {
        min-height: 64px !important;
        padding: 8px 10px !important;
        grid-template-columns: 44px minmax(0,1fr) 44px !important;
        gap: 8px !important;
    }

    #menuBtn,
    #quickAdd {
        width: 42px !important;
        min-width: 42px !important;
        height: 42px !important;
        min-height: 42px !important;
        border-radius: 11px !important;
    }

    .topbar h1 {
        font-size: 21px !important;
    }

    .topbar p {
        font-size: 11px !important;
    }

    #content {
        padding: 8px !important;
    }

    .panel {
        padding: 10px !important;
        border-radius: 14px !important;
    }

    .panel-head {
        gap: 8px !important;
        margin-bottom: 10px !important;
    }

    .panel-head h2 {
        font-size: 20px !important;
    }

    .panel-head p {
        margin-top: 2px !important;
        font-size: 12px !important;
    }

    .panel-head .actions {
        grid-template-columns: 1fr 1fr !important;
        gap: 7px !important;
    }

    .panel-head .actions button,
    .panel-head .actions .btn {
        min-height: 44px !important;
        padding: 8px 10px !important;
        font-size: 13px !important;
    }

    .summary-grid {
        grid-template-columns: repeat(4,minmax(0,1fr)) !important;
        gap: 5px !important;
        margin: 8px 0 !important;
    }

    .summary-card {
        padding: 8px 5px !important;
        border-radius: 10px !important;
        text-align: center;
    }

    .summary-card span {
        font-size: 9px !important;
        line-height: 1.1;
    }

    .summary-card strong {
        margin-top: 2px !important;
        font-size: 18px !important;
    }

    .toolbar {
        gap: 7px !important;
        margin: 8px 0 10px !important;
    }

    .toolbar label {
        gap: 3px !important;
        font-size: 11px !important;
    }

    .toolbar input,
    .toolbar select {
        min-height: 43px !important;
        padding: 8px 11px !important;
        font-size: 14px !important;
    }

    /* TARJETAS MUCHO MÁS COMPACTAS */
    .categories-table tbody {
        gap: 8px !important;
    }

    .categories-table tr {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0 8px !important;
        padding: 9px 10px !important;
        border-radius: 13px !important;
    }

    .categories-table td {
        padding: 6px 0 !important;
        border-top: 0 !important;
        min-width: 0;
    }

    /* 1: Orden */
    .categories-table td:nth-child(1) {
        grid-column: 1 / -1;
        display: flex !important;
        align-items: center;
        justify-content: flex-end;
        gap: 6px !important;
        padding: 0 0 4px !important;
        border-bottom: 1px solid #eef2f6 !important;
    }

    .categories-table td:nth-child(1)::before {
        content: "Orden";
        margin-right: auto;
        font-size: 10px !important;
        color: #64748b;
        font-weight: 800;
    }

    .categories-table td:nth-child(1) .icon-button,
    .categories-table td:nth-child(1) button {
        width: 36px !important;
        min-width: 36px !important;
        height: 36px !important;
        min-height: 36px !important;
        padding: 0 !important;
        border-radius: 9px !important;
    }

    /* 2: Categoría ocupa izquierda */
    .categories-table td:nth-child(2) {
        grid-column: 1 / 2;
        padding: 7px 0 !important;
        align-self: center;
    }

    .categories-table td:nth-child(2) .category-cell {
        gap: 8px !important;
    }

    .categories-table td:nth-child(2) .category-icon {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        border-radius: 11px !important;
        font-size: 24px !important;
    }

    .categories-table td:nth-child(2) strong {
        font-size: 14px !important;
        line-height: 1.15;
    }

    .categories-table td:nth-child(2) small {
        font-size: 11px !important;
    }

    /* 3: Productos a la derecha */
    .categories-table td:nth-child(3) {
        grid-column: 2 / 3;
        display: flex !important;
        flex-direction: column;
        align-items: flex-end;
        justify-content: center;
        padding: 7px 0 !important;
        text-align: right;
    }

    .categories-table td:nth-child(3)::before {
        content: "Productos";
        margin-bottom: 2px;
        font-size: 10px !important;
        color: #64748b;
        font-weight: 800;
    }

    .categories-table td:nth-child(3) strong {
        font-size: 15px !important;
    }

    .categories-table td:nth-child(3) small {
        font-size: 10px !important;
    }

    /* 4 y 5: estado uno al lado del otro */
    .categories-table td:nth-child(4),
    .categories-table td:nth-child(5) {
        grid-column: auto;
        display: block !important;
        padding: 5px 0 !important;
    }

    .categories-table td:nth-child(4)::before,
    .categories-table td:nth-child(5)::before {
        display: block;
        margin-bottom: 3px;
        font-size: 10px !important;
        color: #64748b;
        font-weight: 800;
    }

    .categories-table .status-toggle {
        width: 100% !important;
        min-height: 39px !important;
        height: 39px !important;
        padding: 6px 8px !important;
        border-radius: 999px !important;
        font-size: 12px !important;
    }

    /* 6: acciones, tres botones en una fila */
    .categories-table td:nth-child(6) {
        grid-column: 1 / -1;
        padding-top: 6px !important;
        border-top: 1px solid #eef2f6 !important;
    }

    .categories-table td:nth-child(6)::before {
        display: none !important;
    }

    .categories-table .row-actions {
        display: grid !important;
        grid-template-columns: repeat(3,minmax(0,1fr)) !important;
        gap: 6px !important;
    }

    .categories-table .row-actions button {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 40px !important;
        height: 40px !important;
        padding: 5px 4px !important;
        border-radius: 9px !important;
        font-size: 11px !important;
        line-height: 1 !important;
    }

    .categories-table .row-actions button:last-child {
        grid-column: auto !important;
    }
}

/* Muy angostos: mantenemos las 3 acciones, pero con letra menor */
@media (max-width: 370px) {

    .categories-table .row-actions {
        gap: 4px !important;
    }

    .categories-table .row-actions button {
        font-size: 10px !important;
        padding-inline: 2px !important;
    }

    .summary-grid {
        grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    }
}


/* ==========================================================
   V10.40 — MOBILE DENSE LIST
   Categorías como filas administrativas compactas.
   ========================================================== */

.category-mobile-actions {
    display: none;
}

@media (max-width: 600px) {

    /* Reducimos casi todo el chrome superior */
    .topbar {
        min-height: 58px !important;
        padding: 6px 8px !important;
    }

    .topbar h1 {
        font-size: 19px !important;
    }

    .topbar p {
        display: none !important;
    }

    #menuBtn,
    #quickAdd {
        width: 40px !important;
        min-width: 40px !important;
        height: 40px !important;
        min-height: 40px !important;
    }

    #content {
        padding: 6px !important;
    }

    .panel {
        padding: 8px !important;
        border-radius: 12px !important;
    }

    /* Cabecera de categorías compacta */
    .panel-head {
        margin-bottom: 6px !important;
        gap: 6px !important;
    }

    .panel-head h2 {
        font-size: 18px !important;
    }

    .panel-head p {
        display: none !important;
    }

    .panel-head .actions {
        grid-template-columns: 1fr 1fr !important;
        gap: 5px !important;
    }

    .panel-head .actions button,
    .panel-head .actions .btn {
        min-height: 38px !important;
        height: 38px !important;
        font-size: 11px !important;
        padding: 4px 6px !important;
    }

    /* Ocultamos resúmenes grandes; la información está en las filas */
    .summary-grid {
        display: none !important;
    }

    /* Filtros en una sola fila compacta */
    .toolbar {
        display: grid !important;
        grid-template-columns: minmax(0, 1.5fr) minmax(105px, .8fr) !important;
        gap: 5px !important;
        margin: 6px 0 8px !important;
    }

    .toolbar label {
        margin: 0 !important;
        gap: 2px !important;
    }

    .toolbar label > span,
    .toolbar label > strong {
        display: none !important;
    }

    .toolbar input,
    .toolbar select {
        min-height: 38px !important;
        height: 38px !important;
        padding: 5px 8px !important;
        font-size: 12px !important;
        border-radius: 9px !important;
    }

    /* Una fila por categoría */
    .categories-table tbody {
        display: grid !important;
        gap: 4px !important;
    }

    .categories-table tr {
        position: relative;
        display: grid !important;
        grid-template-columns: 36px minmax(0,1fr) 46px 44px 44px 34px !important;
        align-items: center;
        gap: 5px !important;
        padding: 6px 7px !important;
        min-height: 58px !important;
        border: 1px solid #e1e7ee !important;
        border-radius: 10px !important;
        box-shadow: none !important;
        background: #fff !important;
    }

    .categories-table td {
        display: block !important;
        width: auto !important;
        padding: 0 !important;
        border: 0 !important;
        min-width: 0;
    }

    .categories-table td::before {
        display: none !important;
    }

    /* Orden: solo número; flechas se ocultan en la fila y quedan en acciones */
    .categories-table td:nth-child(1) {
        grid-column: 1 !important;
        display: grid !important;
        place-items: center;
        border: 0 !important;
        padding: 0 !important;
    }

    .categories-table td:nth-child(1) button {
        display: none !important;
    }

    .categories-table td:nth-child(1) {
        font-size: 12px !important;
        font-weight: 900 !important;
        color: #475569 !important;
    }

    /* Categoría */
    .categories-table td:nth-child(2) {
        grid-column: 2 !important;
        padding: 0 !important;
    }

    .categories-table .category-cell {
        display: grid !important;
        grid-template-columns: 34px minmax(0,1fr);
        align-items: center;
        gap: 6px !important;
    }

    .categories-table .category-icon {
        width: 34px !important;
        min-width: 34px !important;
        height: 34px !important;
        border-radius: 9px !important;
        font-size: 20px !important;
    }

    .categories-table .category-cell strong {
        display: block;
        font-size: 12px !important;
        line-height: 1.1 !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .categories-table .category-cell small {
        display: block;
        margin-top: 2px;
        font-size: 9px !important;
        line-height: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Productos: solo cantidad */
    .categories-table td:nth-child(3) {
        grid-column: 3 !important;
        text-align: center !important;
        font-size: 11px !important;
    }

    .categories-table td:nth-child(3) strong {
        display: block;
        font-size: 13px !important;
        line-height: 1 !important;
    }

    .categories-table td:nth-child(3) small {
        display: none !important;
    }

    /* Visible / carrusel: chips mínimos */
    .categories-table td:nth-child(4) {
        grid-column: 4 !important;
    }

    .categories-table td:nth-child(5) {
        grid-column: 5 !important;
    }

    .categories-table .status-toggle {
        width: 40px !important;
        min-width: 40px !important;
        height: 32px !important;
        min-height: 32px !important;
        padding: 0 !important;
        border-radius: 999px !important;
        font-size: 0 !important;
        display: grid !important;
        place-items: center;
    }

    .categories-table td:nth-child(4) .status-toggle::after {
        content: "V";
        font-size: 11px;
        font-weight: 900;
    }

    .categories-table td:nth-child(5) .status-toggle::after {
        content: "C";
        font-size: 11px;
        font-weight: 900;
    }

    .categories-table .status-toggle.off,
    .categories-table .status-toggle:not(.on) {
        opacity: .72;
    }

    /* Acciones: solo botón ⋮ en fila */
    .categories-table td:nth-child(6) {
        grid-column: 6 !important;
        padding: 0 !important;
        border: 0 !important;
    }

    .category-mobile-actions {
        display: grid !important;
        place-items: center;
        width: 32px !important;
        min-width: 32px !important;
        height: 34px !important;
        min-height: 34px !important;
        padding: 0 !important;
        border: 1px solid #dbe2ea;
        border-radius: 8px;
        background: #fff;
        color: #0f172a;
        font-size: 20px;
        line-height: 1;
    }

    .categories-table .row-actions {
        display: none !important;
        position: absolute;
        z-index: 50;
        top: calc(100% - 2px);
        right: 6px;
        width: min(260px, calc(100vw - 32px));
        grid-template-columns: repeat(2,minmax(0,1fr)) !important;
        gap: 5px !important;
        padding: 7px !important;
        border: 1px solid #dbe2ea;
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 12px 30px rgba(15,23,42,.18);
    }

    .categories-table tr.mobile-actions-open {
        z-index: 60;
    }

    .categories-table tr.mobile-actions-open .row-actions {
        display: grid !important;
    }

    .categories-table .row-actions button {
        min-height: 36px !important;
        height: 36px !important;
        font-size: 10px !important;
        padding: 3px 5px !important;
    }

    /* Add explicit order controls inside popover using existing hidden buttons from first cell */
    .categories-table tr.mobile-actions-open td:nth-child(1) button {
        display: none !important;
    }
}

@media (max-width: 390px) {
    .categories-table tr {
        grid-template-columns: 30px minmax(0,1fr) 40px 38px 38px 30px !important;
        gap: 3px !important;
        padding-inline: 5px !important;
    }

    .categories-table .category-icon {
        width: 30px !important;
        min-width: 30px !important;
        height: 30px !important;
        font-size: 18px !important;
    }

    .categories-table .status-toggle {
        width: 35px !important;
        min-width: 35px !important;
    }
}


/* ==========================================================
   V10.43 — EDITORES COMPACTOS + PREVIEW WEB/PWA
   ========================================================== */

#modal > .modal-card {
    width: min(1380px, calc(100vw - 28px)) !important;
    height: min(940px, calc(100dvh - 24px)) !important;
    max-height: calc(100dvh - 24px) !important;
    border-radius: 18px !important;
}

#modal > .modal-card > header {
    padding: 14px 72px 12px 18px !important;
}

#modal > .modal-card > header h2 {
    font-size: 25px !important;
}

#modal > .modal-card > header p {
    margin-top: 3px !important;
    font-size: 13px !important;
}

#modal #closeModal {
    top: 9px !important;
    right: 11px !important;
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
}

#modal #modalBody {
    padding: 13px 16px !important;
}

#modal #modalForm > footer {
    padding: 9px 16px !important;
}

#modal .promotion-form-grid {
    grid-template-columns:
        repeat(3, minmax(0, 1fr)) !important;
    gap: 11px 13px !important;
    align-items: start;
}

#modal .promotion-form-grid > .full {
    grid-column: 1 / -1 !important;
}

#modal .promotion-form-grid textarea {
    min-height: 78px !important;
}

#modal .promotion-preview-box {
    min-height: 0 !important;
    padding: 7px !important;
}

#modal .promotion-preview-box img {
    max-height: 220px !important;
    object-fit: contain;
}

#modal .product-publication-preview,
#modal .promotion-publication-preview {
    padding: 12px !important;
    border-radius: 14px !important;
}

#modal .product-publication-preview-head {
    margin-bottom: 9px !important;
}

#modal .publication-preview-stage {
    padding: 12px !important;
}

#modal .publication-preview-stage.is-app .publication-device-frame {
    width: min(320px, 100%);
}

#modal .publication-preview-stage.is-web .publication-device-frame {
    width: min(920px, 100%);
}

#modal .publication-preview-stage.is-web .publication-product-card {
    min-height: 250px;
}

@media (max-width: 1050px) {

    #modal .promotion-form-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;
    }

}

@media (max-width: 720px) {

    #modal > .modal-card {
        width: calc(100vw - 8px) !important;
        height: calc(100dvh - 8px) !important;
        max-height: calc(100dvh - 8px) !important;
        border-radius: 13px !important;
    }

    #modal #modalBody {
        padding: 9px !important;
    }

    #modal .promotion-form-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    #modal .promotion-form-grid > * {
        grid-column: 1 !important;
    }

    #modal .publication-preview-stage {
        padding: 7px !important;
    }

}


/* ==========================================================
   V10.44 — EDITORES PROFESIONALES COMPACTOS
   ========================================================== */

/* hidden siempre gana: corrige "No disponible" de la preview */
[hidden],
.publication-unavailable[hidden],
.publication-offer-badge[hidden],
.publication-preview-stage [hidden] {
    display: none !important;
}

/* Modal tipo aplicación de gestión */
#modal > .modal-card {
    width: min(1480px, calc(100vw - 20px)) !important;
    height: min(940px, calc(100dvh - 16px)) !important;
    max-height: calc(100dvh - 16px) !important;
    border: 1px solid #dbe2ea;
    border-radius: 16px !important;
    box-shadow:
        0 24px 70px rgba(15, 23, 42, .22),
        0 2px 8px rgba(15, 23, 42, .10) !important;
}

#modal > .modal-card > header {
    min-height: 62px;
    padding: 11px 70px 10px 18px !important;
}

#modal > .modal-card > header h2 {
    font-size: 23px !important;
    letter-spacing: -.02em;
}

#modal > .modal-card > header p {
    margin-top: 2px !important;
    font-size: 12px !important;
}

#modal #modalBody {
    padding: 10px 14px !important;
    background: #f5f7fa !important;
}

#modal #modalForm > footer {
    min-height: 58px;
    padding: 8px 14px !important;
}

#modal #modalForm > footer .btn,
#modal #modalForm > footer button {
    min-height: 40px;
    padding: 8px 18px;
}

/* Formularios sin "tarjetones" por cada input */
#modal .product-form-grid,
#modal .promotion-form-grid,
#modal .category-editor .form-grid {
    gap: 8px 10px !important;
}

#modal .product-form-grid {
    grid-template-columns:
        repeat(4, minmax(0, 1fr)) !important;
}

#modal .promotion-form-grid {
    grid-template-columns:
        repeat(4, minmax(0, 1fr)) !important;
}

#modal .category-editor [data-category-section="general"] .form-grid {
    grid-template-columns:
        repeat(4, minmax(0, 1fr)) !important;
}

/* Los campos dejan de parecer cards independientes */
#modal .product-field,
#modal .promotion-form-grid > label,
#modal .category-editor-section .form-grid > label {
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

#modal label {
    gap: 4px !important;
    font-size: 11px !important;
    font-weight: 800;
    color: #334155;
}

#modal input,
#modal select {
    min-height: 40px !important;
    height: 40px;
    padding: 7px 10px !important;
    border-radius: 9px !important;
    background: #fff;
    font-size: 13px !important;
}

#modal textarea {
    min-height: 64px !important;
    padding: 8px 10px !important;
    border-radius: 9px !important;
    font-size: 13px !important;
}

#modal .field-help,
#modal .form-help {
    margin-top: 1px !important;
    font-size: 9.5px !important;
    line-height: 1.25 !important;
    color: #758399 !important;
}

/* Encabezados de sección más tipo ERP */
#modal .product-section-heading,
#modal .configuration-heading {
    margin: 2px 0 8px !important;
}

#modal .product-section-heading h3 {
    margin: 1px 0 !important;
    font-size: 18px !important;
}

#modal .product-section-heading p {
    margin: 0 !important;
    font-size: 11px !important;
}

#modal .product-section-kicker {
    font-size: 9px !important;
    letter-spacing: .1em;
}

/* Tabs finos y profesionales */
#modal .product-editor-tabs,
#modal .category-editor-tabs {
    min-height: 44px;
    padding: 3px !important;
    margin-bottom: 9px !important;
    border-radius: 10px !important;
}

#modal .product-editor-tab,
#modal .category-editor-tab {
    min-height: 36px !important;
    padding: 6px 10px !important;
    font-size: 12px !important;
    border-radius: 8px !important;
}

/* Producto: campos extensos */
#modal .product-form-grid > .full,
#modal .promotion-form-grid > .full {
    grid-column: 1 / -1 !important;
}

/* Descripción ocupa 2 columnas en escritorio cuando es posible */
#modal .product-form-grid label:has(textarea[name="descripcion"]) {
    grid-column: span 2 !important;
}

/* Ruta + upload sin desperdiciar alto */
#modal label:has(input[name="imagen"]) {
    grid-column: span 2 !important;
}

#modal label:has(#productImageFile),
#modal label:has(#promotionImageFile) {
    grid-column: span 2 !important;
}

/* Estados en barra compacta */
#modal .product-status-panel {
    padding: 9px 11px !important;
    border-radius: 11px !important;
}

#modal .product-status-heading {
    margin-bottom: 6px !important;
}

#modal .product-status-heading strong {
    font-size: 12px !important;
}

#modal .product-status-heading small {
    font-size: 9px !important;
}

#modal .product-status-grid,
#modal .check-row {
    gap: 6px 12px !important;
}

#modal .check-row label {
    min-height: 30px !important;
    font-size: 11px !important;
}

/* Preview: protagonista, pero no gigante */
#modal .product-publication-preview,
#modal .promotion-publication-preview {
    margin-top: 4px;
    padding: 10px !important;
    border-radius: 12px !important;
}

#modal .product-publication-preview-head {
    align-items: center !important;
    margin-bottom: 7px !important;
}

#modal .product-publication-preview-head strong {
    font-size: 15px !important;
}

#modal .product-publication-preview-head small {
    font-size: 9.5px !important;
}

#modal .publication-preview-tab {
    min-width: 64px !important;
    min-height: 32px !important;
    padding: 5px 9px !important;
    font-size: 11px !important;
}

#modal .publication-preview-stage {
    min-height: 0 !important;
    padding: 8px !important;
    border-radius: 10px !important;
}

#modal .publication-preview-stage.is-app .publication-device-frame {
    width: min(285px, 100%) !important;
}

#modal .publication-preview-stage.is-web .publication-device-frame {
    width: min(760px, 100%) !important;
}

#modal .publication-device-topbar {
    padding: 6px 9px !important;
    font-size: 8px !important;
}

#modal .publication-product-image-wrap {
    aspect-ratio: 16 / 9 !important;
}

#modal .publication-product-body {
    padding: 9px !important;
}

#modal .publication-product-body h4 {
    font-size: 15px !important;
}

#modal .publication-product-body p {
    margin: 4px 0 7px !important;
    font-size: 10px !important;
}

#modal .publication-price-row strong {
    font-size: 16px !important;
}

#modal .publication-add-button {
    width: 31px !important;
    min-width: 31px !important;
    height: 31px !important;
    min-height: 31px !important;
    font-size: 19px !important;
}

#modal .publication-preview-note {
    margin-top: 5px !important;
    font-size: 8.5px !important;
}

/* Imagen vacía no reserva caja alta */
#modal .preview-box {
    min-height: 0 !important;
    padding: 5px !important;
}

#modal .preview-box img:not([src]),
#modal .preview-box img[style*="display: none"] {
    display: none !important;
}

#modal .promotion-preview-box {
    max-height: 160px !important;
}

/* Categorías: general casi entero en viewport */
#modal .category-editor {
    gap: 8px !important;
}

#modal .category-editor-section {
    padding: 8px !important;
}

#modal .category-editor-section [name="slug"] {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* SEO sigue completo pero más denso */
#modal .product-seo-layout,
#modal .category-seo-layout {
    gap: 10px !important;
}

#modal .product-seo-fields,
#modal .category-seo-fields,
#modal .category-seo-preview {
    padding: 10px !important;
    border-radius: 11px !important;
}

/* Desktop bajo: todo sigue visible sin inputs gigantes */
@media (max-height: 820px) and (min-width: 901px) {
    #modal > .modal-card {
        height: calc(100dvh - 8px) !important;
        max-height: calc(100dvh - 8px) !important;
    }

    #modal > .modal-card > header {
        min-height: 54px;
        padding-block: 8px !important;
    }

    #modal #modalForm > footer {
        min-height: 50px;
        padding-block: 5px !important;
    }

    #modal input,
    #modal select {
        min-height: 36px !important;
        height: 36px !important;
    }

    #modal textarea {
        min-height: 54px !important;
    }
}

@media (max-width: 1100px) {
    #modal .product-form-grid,
    #modal .promotion-form-grid,
    #modal .category-editor [data-category-section="general"] .form-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 720px) {
    #modal .product-form-grid,
    #modal .promotion-form-grid,
    #modal .category-editor [data-category-section="general"] .form-grid {
        grid-template-columns: 1fr !important;
    }

    #modal .product-form-grid > *,
    #modal .promotion-form-grid > *,
    #modal .category-editor [data-category-section="general"] .form-grid > * {
        grid-column: 1 !important;
    }

    #modal input,
    #modal select {
        min-height: 43px !important;
        height: 43px !important;
        font-size: 16px !important;
    }
}


/* ==========================================================
   V10.45 — PORTADA CENTRAL PROFESIONAL
   ========================================================== */

.homepage-admin-panel {
    --homepage-gap: 12px;
}

.homepage-panel-head {
    align-items: center;
    margin-bottom: 12px;
}

.homepage-panel-head .actions {
    gap: 8px;
}

.homepage-workspace {
    gap: 14px !important;
    align-items: start;
}

.homepage-editor-column {
    gap: 10px !important;
}

.homepage-editor-card {
    padding: 12px !important;
    border-radius: 12px !important;
    box-shadow: none !important;
}

.homepage-card-heading {
    margin-bottom: 8px !important;
}

.homepage-card-heading h3 {
    font-size: 16px !important;
    margin: 0 !important;
}

.homepage-card-heading p {
    font-size: 10px !important;
    margin-top: 2px !important;
}

.homepage-editor-card input,
.homepage-editor-card select {
    min-height: 38px !important;
    height: 38px !important;
    font-size: 12px !important;
}

.homepage-editor-card textarea {
    min-height: 62px !important;
    font-size: 12px !important;
}

.homepage-slide-list {
    gap: 6px !important;
    margin-bottom: 8px !important;
}

.homepage-slide-editor {
    padding: 10px !important;
    border-radius: 10px !important;
}

.homepage-image-field {
    padding: 7px !important;
    border-radius: 9px !important;
}

.homepage-preview-column {
    position: sticky;
    top: 82px;
}

.homepage-preview-toolbar {
    padding: 9px 10px !important;
}

.homepage-preview-toolbar strong {
    font-size: 13px;
}

.homepage-preview-toolbar small {
    font-size: 9px;
}

@media (max-width: 1050px) {
    .homepage-preview-column {
        position: static;
    }
}


/* ==========================================================
   V10.46 — PREVIEW INTERNO SEGURO DE PORTADA
   ========================================================== */

.homepage-preview-frame {
    background: #111318 !important;
}

#homepagePreviewIframe {
    width: 100%;
    min-height: 720px;
    border: 0;
    background: #f6f7f9;
}

.homepage-preview-toolbar::after {
    content: "Preview interno seguro · sin iframe externo";
    display: inline-flex;
    margin-left: auto;
    padding: 5px 8px;
    border-radius: 999px;
    background: #e3f7ea;
    color: #13743b;
    font-size: 9px;
    font-weight: 900;
}

@media (max-width: 1050px) {
    #homepagePreviewIframe {
        min-height: 620px;
    }
}

@media (max-width: 720px) {
    #homepagePreviewIframe {
        min-height: 560px;
    }

    .homepage-preview-toolbar::after {
        display: none;
    }
}


/* ==========================================================
   V10.47 — MULTIMEDIA CENTRAL
   ========================================================== */

.media-summary {
    grid-template-columns: repeat(5, minmax(0,1fr)) !important;
    gap: 8px !important;
}

.media-summary .summary-card {
    padding: 10px 11px !important;
}

.media-summary .summary-card span {
    font-size: 9px !important;
}

.media-summary .summary-card strong {
    font-size: 20px !important;
}

.media-toolbar {
    display: grid !important;
    grid-template-columns:
        minmax(220px,1.7fr)
        repeat(4,minmax(120px,.75fr))
        auto;
    gap: 7px !important;
    align-items: end;
}

.media-toolbar label > span {
    font-size: 9px !important;
    font-weight: 800;
    color: #64748b;
}

.media-toolbar input,
.media-toolbar select {
    min-height: 38px !important;
    height: 38px !important;
    font-size: 11px !important;
}

.media-library-grid.grid {
    grid-template-columns:
        repeat(auto-fill,minmax(205px,1fr)) !important;
    gap: 9px !important;
}

.media-card {
    overflow: hidden;
    border-radius: 12px !important;
    box-shadow: 0 4px 15px rgba(15,23,42,.05) !important;
}

.media-preview-button {
    aspect-ratio: 16 / 11 !important;
}

.media-preview-button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-card-content {
    padding: 8px 9px 6px !important;
    gap: 2px !important;
}

.media-card-content > strong {
    font-size: 11px !important;
}

.media-card-content > small {
    font-size: 9px !important;
}

.media-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 3px 0;
}

.media-primary-badge,
.media-in-use-badge,
.media-unused-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 3px 6px;
    border-radius: 999px;
    font-size: 7.5px;
    font-weight: 900;
}

.media-primary-badge {
    color: #087734;
    background: #daf6e3;
}

.media-in-use-badge {
    color: #195e87;
    background: #e2f2fb;
}

.media-unused-badge {
    color: #667085;
    background: #edf0f3;
}

.media-usage-text {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #4c6679 !important;
}

.media-card-actions {
    display: grid !important;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 4px !important;
    padding: 6px 8px 8px !important;
}

.media-card-actions .btn {
    min-height: 32px !important;
    height: 32px;
    padding: 4px !important;
    font-size: 9px !important;
}

.media-editor-layout {
    display: grid;
    grid-template-columns: minmax(230px,.7fr) minmax(0,1.3fr);
    gap: 14px;
}

.media-editor-preview img {
    width: 100%;
    max-height: 390px;
    object-fit: contain;
    border-radius: 11px;
    background: #eef2f6;
}

.media-editor-identifiers {
    padding: 7px 1px;
}

.media-editor-identifiers strong,
.media-editor-identifiers small {
    display: block;
}

.media-editor-identifiers strong {
    font-size: 11px;
}

.media-editor-identifiers small {
    margin-top: 2px;
    word-break: break-all;
    color: #718096;
    font-size: 8.5px;
}

.media-editor-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    align-content: start;
}

.media-editor-fields .full {
    grid-column: 1 / -1;
}

.media-editor-info {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 6px;
}

.media-editor-info span {
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    font-size: 9px;
}

.media-editor-info b {
    display: block;
    margin-bottom: 2px;
    color: #64748b;
    font-size: 7px;
    text-transform: uppercase;
}

@media (max-width: 1200px) {
    .media-toolbar {
        grid-template-columns: repeat(3,minmax(0,1fr));
    }

    .media-toolbar .search-field {
        grid-column: span 2;
    }

    .media-summary {
        grid-template-columns: repeat(3,minmax(0,1fr)) !important;
    }
}

@media (max-width: 720px) {
    .media-summary {
        grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    }

    .media-toolbar {
        grid-template-columns: 1fr 1fr !important;
    }

    .media-toolbar .search-field {
        grid-column: 1 / -1;
    }

    .media-library-grid.grid {
        grid-template-columns: repeat(2,minmax(0,1fr)) !important;
        gap: 6px !important;
    }

    .media-card-actions {
        grid-template-columns: 1fr !important;
    }

    .media-editor-layout {
        grid-template-columns: 1fr;
    }

    .media-editor-fields {
        grid-template-columns: 1fr;
    }

    .media-editor-fields .full {
        grid-column: 1;
    }

    .media-editor-info {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }
}


/* ==========================================================
   V10.48 — MULTIMEDIA COMPACTA + SELECTOR CENTRAL ÚNICO
   ========================================================== */

/* ---------- Cabecera de Multimedia ---------- */

.media-library-panel > .panel-head {
    margin-bottom: 7px !important;
    padding-bottom: 7px !important;
}

.media-library-panel > .panel-head h2 {
    margin: 0 !important;
}

.media-library-panel > .panel-head .panel-description {
    margin-top: 2px !important;
    font-size: 11px !important;
}

.media-library-panel .media-summary {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 7px !important;
    min-height: 0 !important;
    margin: 6px 0 8px !important;
    padding: 0 !important;
}

.media-library-panel .media-summary .summary-card {
    flex: 1 1 0;
    min-width: 0;
    min-height: 52px !important;
    height: 52px !important;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 10px !important;
    border-radius: 10px !important;
}

.media-library-panel .media-summary .summary-card span {
    font-size: 8.5px !important;
    line-height: 1.15;
}

.media-library-panel .media-summary .summary-card strong {
    font-size: 17px !important;
    line-height: 1;
    white-space: nowrap;
}

.media-library-panel .media-toolbar {
    margin: 0 0 8px !important;
    padding: 8px !important;
    border: 1px solid #e5e9ef;
    border-radius: 11px;
    background: #fafbfc;
}

.media-library-panel .media-bulk-actions {
    margin: 0 0 7px !important;
}

.media-library-panel .media-library-grid {
    margin-top: 0 !important;
}


/* ---------- Selector único de biblioteca ---------- */

body.central-media-picker-open {
    overflow: hidden !important;
}

.central-media-picker-overlay {
    position: fixed;
    z-index: 12000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 14px;
    background: rgba(15, 23, 42, .62);
    backdrop-filter: blur(3px);
}

.central-media-picker-dialog {
    width: min(1260px, calc(100vw - 28px));
    height: min(830px, calc(100dvh - 28px));
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid #dce3eb;
    border-radius: 18px;
    background: #f7f9fb;
    box-shadow:
        0 30px 90px rgba(15, 23, 42, .30),
        0 4px 16px rgba(15, 23, 42, .14);
}

.central-media-picker-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    padding: 13px 76px 12px 18px;
    border-bottom: 1px solid #e2e8f0;
    background: white;
}

.central-media-picker-kicker {
    display: block;
    margin-bottom: 2px;
    color: #ee3434;
    font-size: 8px;
    font-weight: 950;
    letter-spacing: .12em;
}

.central-media-picker-header h2 {
    margin: 0;
    color: #111827;
    font-size: 22px;
    letter-spacing: -.025em;
}

.central-media-picker-header p {
    margin: 3px 0 0;
    color: #687386;
    font-size: 10px;
}

.central-media-picker-close {
    position: absolute;
    top: 11px;
    right: 13px;
    width: 48px;
    min-width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 2px solid #161616;
    border-radius: 13px;
    background: #ef3737;
    color: white;
    box-shadow: 0 5px 12px rgba(0, 0, 0, .16);
    cursor: pointer;
    font-size: 31px;
    font-weight: 800;
    line-height: 1;
}

.central-media-picker-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1.7fr) repeat(3, minmax(145px, .75fr));
    gap: 8px;
    padding: 10px 14px 8px;
    background: white;
}

.central-media-picker-toolbar label {
    display: grid;
    gap: 4px;
    min-width: 0;
    color: #64748b;
    font-size: 9px;
    font-weight: 850;
}

.central-media-picker-toolbar input,
.central-media-picker-toolbar select {
    width: 100%;
    min-width: 0;
    height: 39px;
    padding: 7px 10px;
    border: 1px solid #dce2ea;
    border-radius: 9px;
    background: #fff;
    color: #111827;
    outline: none;
    font-size: 11px;
}

.central-media-picker-toolbar input:focus,
.central-media-picker-toolbar select:focus {
    border-color: #ed3737;
    box-shadow: 0 0 0 3px rgba(237, 55, 55, .08);
}

.central-media-picker-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 15px 8px;
    border-bottom: 1px solid #e4e8ee;
    background: white;
    color: #7a8494;
    font-size: 9px;
}

.central-media-picker-meta b {
    color: #13743b;
}

.central-media-picker-meta strong {
    color: #253044;
    font-size: 10px;
}

.central-media-picker-grid {
    min-height: 0;
    overflow: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    align-content: start;
    gap: 8px;
    padding: 10px 12px 14px;
}

.central-media-picker-card {
    min-width: 0;
    overflow: hidden;
    display: grid;
    grid-template-rows: 132px auto auto;
    padding: 0;
    border: 1px solid #e0e5eb;
    border-radius: 12px;
    background: white;
    color: #111827;
    text-align: left;
    cursor: pointer;
    transition:
        transform .12s ease,
        border-color .12s ease,
        box-shadow .12s ease;
}

.central-media-picker-card:hover {
    transform: translateY(-2px);
    border-color: #ef3d3d;
    box-shadow: 0 9px 22px rgba(15, 23, 42, .09);
}

.central-media-picker-image {
    position: relative;
    overflow: hidden;
    display: block;
    background: #eef1f4;
}

.central-media-picker-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.central-media-picker-badge {
    position: absolute;
    left: 7px;
    bottom: 7px;
    display: inline-flex;
    min-height: 21px;
    align-items: center;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 7px;
    font-weight: 950;
}

.central-media-picker-badge.primary {
    color: #087331;
    background: #dff7e7;
}

.central-media-picker-badge.used {
    color: #1d5f87;
    background: #e4f3fb;
}

.central-media-picker-badge.free {
    color: #555e6b;
    background: #edf0f3;
}

.central-media-picker-info {
    min-width: 0;
    display: grid;
    gap: 2px;
    padding: 8px 9px 6px;
}

.central-media-picker-info strong,
.central-media-picker-info small {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.central-media-picker-info strong {
    font-size: 11px;
}

.central-media-picker-info small {
    color: #6f7988;
    font-size: 8.5px;
}

.central-media-picker-info .code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: #405168;
}

.central-media-picker-info .usage {
    color: #286181;
}

.central-media-picker-select {
    min-height: 31px;
    display: grid;
    place-items: center;
    margin: 0 8px 8px;
    border-radius: 8px;
    background: #f1f4f7;
    color: #202937;
    font-size: 9px;
    font-weight: 850;
}

.central-media-picker-card:hover .central-media-picker-select {
    background: #ef3737;
    color: white;
}

.central-media-picker-empty {
    grid-column: 1 / -1;
    min-height: 220px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 5px;
    color: #687386;
    text-align: center;
}

.central-media-picker-empty strong {
    color: #273244;
    font-size: 13px;
}

.central-media-picker-empty small {
    font-size: 10px;
}

.central-media-picker-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-height: 54px;
    padding: 8px 13px;
    border-top: 1px solid #dfe5ec;
    background: white;
}

.central-media-picker-footer small {
    margin-right: auto;
    color: #788395;
    font-size: 8.5px;
}

.central-media-picker-footer .btn {
    min-height: 36px;
    padding: 6px 14px;
}


/* Selector sobre un modal existente sin perder datos */
.modal + .central-media-picker-overlay,
.central-media-picker-overlay {
    isolation: isolate;
}


@media (max-width: 1050px) {

    .media-library-panel .media-summary {
        flex-wrap: wrap !important;
    }

    .media-library-panel .media-summary .summary-card {
        flex: 1 1 calc(33.33% - 7px);
    }

    .central-media-picker-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .central-media-picker-toolbar .search {
        grid-column: 1 / -1;
    }

}


@media (max-width: 700px) {

    .media-library-panel .media-summary {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .media-library-panel .media-summary .summary-card {
        width: auto;
        min-height: 48px !important;
        height: 48px !important;
    }

    .central-media-picker-overlay {
        padding: 4px;
    }

    .central-media-picker-dialog {
        width: calc(100vw - 8px);
        height: calc(100dvh - 8px);
        border-radius: 13px;
    }

    .central-media-picker-header {
        min-height: 67px;
        padding: 10px 60px 9px 11px;
    }

    .central-media-picker-header h2 {
        font-size: 18px;
    }

    .central-media-picker-close {
        top: 8px;
        right: 8px;
        width: 44px;
        min-width: 44px;
        height: 44px;
    }

    .central-media-picker-toolbar {
        grid-template-columns: 1fr 1fr;
        padding: 8px;
    }

    .central-media-picker-toolbar .search {
        grid-column: 1 / -1;
    }

    .central-media-picker-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        padding: 7px;
    }

    .central-media-picker-card {
        grid-template-rows: 105px auto auto;
    }

    .central-media-picker-footer small {
        display: none;
    }

}

/* ==========================================================
   V10.51 — ANALÍTICAS REALES
   ========================================================== */
.analytics-page{display:grid;gap:10px}.analytics-hero{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 16px;border:1px solid #e1e6ec;border-radius:14px;background:#fff}.analytics-hero h2{margin:1px 0 2px;font-size:23px}.analytics-hero p{margin:0;color:#697586;font-size:11px}.analytics-eyebrow{color:#ef3838;font-size:8px;font-weight:950;letter-spacing:.12em}.analytics-controls{display:flex;align-items:end;gap:7px}.analytics-controls label{display:grid;gap:3px;min-width:130px;color:#697586;font-size:8px;font-weight:850}.analytics-controls select,.analytics-controls button{height:38px;min-height:38px!important}.analytics-controls select{padding:6px 9px;border:1px solid #dce2e9;border-radius:9px;background:#fff}.analytics-source-bar{display:flex;justify-content:space-between;gap:10px;padding:7px 10px;border:1px solid #dce7df;border-radius:10px;background:#f2faf5;color:#617168;font-size:9px}.analytics-source-bar b{color:#12763b}.analytics-content{display:grid;gap:10px}.analytics-kpis{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px}.analytics-kpi{padding:11px 12px;border:1px solid #e1e6ec;border-radius:12px;background:#fff}.analytics-kpi-top{min-height:24px;display:flex;align-items:center;justify-content:space-between}.analytics-kpi-icon{font-size:18px}.analytics-kpi-label{display:block;margin-top:4px;color:#687486;font-size:9px;font-weight:800}.analytics-kpi>strong{display:block;margin-top:2px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:20px}.analytics-kpi>small{display:block;margin-top:3px;color:#8a94a2;font-size:7.8px}.analytics-change{display:inline-flex;min-height:22px;align-items:center;padding:3px 6px;border-radius:999px;font-size:7.5px;font-weight:900}.analytics-change.positive{color:#087633;background:#def6e6}.analytics-change.negative{color:#b42318;background:#fde8e7}.analytics-change.neutral{color:#667085;background:#eef1f4}.analytics-layout-main{display:grid;grid-template-columns:minmax(0,1.8fr) minmax(280px,.7fr);gap:10px}.analytics-layout-secondary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.analytics-page .panel{margin:0!important;padding:12px!important;border-radius:12px!important}.analytics-page .panel-head{margin-bottom:8px!important}.analytics-page .panel-head h2{margin:0;font-size:14px!important}.analytics-page .panel-description{margin-top:2px!important;font-size:8.5px!important}.analytics-product-table{width:100%;border-collapse:collapse}.analytics-product-table th{padding:7px 6px;color:#687486;text-align:left;font-size:8px;border-bottom:1px solid #e6eaf0}.analytics-product-table td{padding:7px 6px;border-bottom:1px solid #eef1f4;font-size:9px}.analytics-product-table td strong,.analytics-product-table td small{display:block}.analytics-product-table td small{color:#8892a1;font-size:7.5px}.analytics-rank{display:grid;place-items:center;width:24px;height:24px;border-radius:7px;background:#f1f3f6}.analytics-mini-progress,.analytics-progress{overflow:hidden;height:7px;border-radius:999px;background:#edf0f3}.analytics-mini-progress span,.analytics-progress span{display:block;height:100%;border-radius:inherit;background:#ef3838}.analytics-distribution,.analytics-hours{display:grid;gap:8px}.analytics-distribution-row{display:grid;grid-template-columns:minmax(95px,.8fr) minmax(100px,1fr) 42px;align-items:center;gap:7px}.analytics-distribution-row strong,.analytics-distribution-row small{display:block}.analytics-distribution-row strong{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:9px}.analytics-distribution-row small{color:#87909e;font-size:7.5px}.analytics-distribution-row>b{text-align:right;font-size:8px}.analytics-hour-row{display:grid;grid-template-columns:42px minmax(80px,1fr) 24px 72px;align-items:center;gap:6px;font-size:8px}.analytics-hour-row>small{color:#87909e;text-align:right;font-size:7px}.analytics-integrity-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}.analytics-integrity-grid>div{padding:9px;border-radius:9px;background:#f7f9fb}.analytics-integrity-grid strong{font-size:9px}.analytics-integrity-grid p{margin:3px 0 0;color:#707b8a;font-size:8px}.analytics-empty,.analytics-loading{min-height:160px;display:grid;place-items:center;align-content:center;gap:4px;color:#768292;text-align:center}.analytics-loading{min-height:430px}.analytics-spinner{width:28px;height:28px;border:3px solid #e5e7eb;border-top-color:#ef3838;border-radius:50%;animation:analyticsSpin .8s linear infinite}@keyframes analyticsSpin{to{transform:rotate(360deg)}}.analytics-error{min-height:330px;display:grid;grid-template-columns:auto minmax(0,420px) auto;place-content:center;align-items:center;gap:14px;padding:30px}.analytics-error>span{font-size:32px}
@media(max-width:1250px){.analytics-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}.analytics-layout-main{grid-template-columns:1fr}}
@media(max-width:850px){.analytics-hero{align-items:stretch;flex-direction:column}.analytics-controls{display:grid;grid-template-columns:1fr 1fr 1fr}.analytics-layout-secondary{grid-template-columns:1fr}.analytics-integrity-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.analytics-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.analytics-controls{grid-template-columns:1fr 1fr}.analytics-controls label{grid-column:1/-1}.analytics-source-bar{flex-direction:column}.analytics-integrity-grid{grid-template-columns:1fr}}


/* ==========================================================
   V10.68 — SIDEBAR PWA TABLET
   ========================================================== */
@media (max-width: 1280px), (pointer: coarse), (hover: none) {

    html,
    body {
        overflow-x: hidden;
    }

    .app,
    .app.sidebar-collapsed {
        display: block !important;
        min-height: 100dvh;
        grid-template-columns: none !important;
    }

    .main {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 100dvh;
    }

    .sidebar {
        position: fixed !important;
        z-index: 1200 !important;
        inset: 0 auto 0 0 !important;
        left: 0 !important;
        width: min(320px, 86vw) !important;
        height: 100dvh !important;
        padding: 16px 12px !important;
        transform: translate3d(-106%,0,0) !important;
        transition: transform .2s ease !important;
        box-shadow: 18px 0 42px rgba(15,23,42,.30) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        background: var(--dark) !important;
        will-change: transform;
        -webkit-overflow-scrolling: touch;
    }

    body.sidebar-open .sidebar,
    .sidebar.open {
        transform: translate3d(0,0,0) !important;
    }

    .sidebar .brand {
        display: flex !important;
    }

    .sidebar .brand > div:last-child,
    .sidebar #nav span,
    .sidebar nav span {
        display: inline !important;
    }

    .sidebar #nav,
    .sidebar nav {
        display: grid !important;
        width: 100% !important;
        gap: 6px !important;
    }

    .sidebar #nav button,
    .sidebar nav button,
    .sidebar .sidebar-link,
    .sidebar-foot a,
    .sidebar-foot button {
        width: 100% !important;
        min-height: 50px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 10px !important;
        padding: 11px 13px !important;
        text-align: left !important;
        font-size: 14px !important;
    }

    .sidebar-backdrop {
        position: fixed !important;
        inset: 0 !important;
        z-index: 1190 !important;
    }

    .sidebar-backdrop.is-visible,
    body.sidebar-open .sidebar-backdrop {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    #menuBtn {
        position: relative !important;
        z-index: 1250 !important;
        width: 48px !important;
        min-width: 48px !important;
        height: 48px !important;
        min-height: 48px !important;
        display: grid !important;
        place-items: center !important;
        touch-action: manipulation !important;
        pointer-events: auto !important;
        user-select: none !important;
        -webkit-user-select: none !important;
    }

    #menuBtn > span {
        pointer-events: none !important;
    }
}

/* =========================================================
   ACCESO SEGURO — PRODUCCIÓN V10.125
========================================================= */
.login-card-secure{max-width:440px}.secure-bootstrap{display:grid;gap:14px;margin-top:18px}.secure-bootstrap[hidden],#totpField[hidden]{display:none!important}.secure-notice{display:grid;gap:5px;padding:13px 14px;border-radius:12px;background:#fff6e9;border:1px solid #f1d7a8;color:#573b18;text-align:left}.secure-notice strong{font-size:.92rem}.secure-notice span,.password-policy,.secure-login-footnote{font-size:.78rem;line-height:1.45;color:#6d6870}.password-policy{display:block;text-align:left}.secure-login-footnote{display:block;margin-top:22px}


/* ==========================================================
   PORTADA — CAMPAÑAS PROGRAMADAS V10.131
   ========================================================== */
.homepage-schedule-note{padding:10px 12px;border-radius:10px;background:#f7f7f8;color:#5b5b63;font-size:12px;line-height:1.45;border:1px solid #e7e7ea}
.homepage-slide-form select[multiple]{min-height:148px;padding:8px}
.homepage-slide-form input[type="datetime-local"]{min-height:42px}

/* ==========================================================
   PORTADA MULTICANAL — V10.131
   Publicaciones compartidas + presentación Web/App separada
   ========================================================== */
.homepage-workspace-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:0 0 16px}.homepage-workspace-tabs button{display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto auto;gap:2px 10px;align-items:center;text-align:left;border:1px solid #dfe4ea;background:#fff;border-radius:14px;padding:14px 16px;cursor:pointer;transition:.18s ease;min-height:74px}.homepage-workspace-tabs button>span{grid-row:1/3;font-size:24px}.homepage-workspace-tabs button strong{font-size:14px;color:#14213d}.homepage-workspace-tabs button small{font-size:11px;color:#667085}.homepage-workspace-tabs button:hover{transform:translateY(-1px);box-shadow:0 8px 20px rgba(15,23,42,.07)}.homepage-workspace-tabs button.is-active{border-color:#ff6a00;box-shadow:0 0 0 2px rgba(255,106,0,.12);background:#fffaf6}.homepage-mode-panel[hidden]{display:none!important}.homepage-publishing-guide{background:linear-gradient(135deg,#fffaf5,#fff)}.homepage-flow-strip{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:8px}.homepage-flow-strip span{display:flex;align-items:center;gap:7px;padding:8px 10px;border:1px solid #e9e9ec;border-radius:10px;background:#fff;font-size:12px;color:#344054}.homepage-flow-strip b{display:grid;place-items:center;width:20px;height:20px;border-radius:50%;background:#ff6a00;color:#fff;font-size:11px}.homepage-flow-strip i{font-style:normal;color:#98a2b3}.homepage-channel-selector{display:grid;grid-template-columns:1fr auto auto;gap:12px;align-items:center;padding:12px 14px;border:1px solid #dfe4ea;border-radius:12px;background:#f8fafc}.homepage-channel-selector>div{display:grid;gap:2px}.homepage-channel-selector small{font-weight:400;color:#667085;font-size:11px}.homepage-channel-selector label{display:flex;align-items:center;gap:7px;border:1px solid #e2e8f0;background:#fff;border-radius:10px;padding:9px 12px;font-weight:700;white-space:nowrap}.homepage-channel-note{margin-top:12px;padding:12px 14px;border-radius:11px;background:#f0f9ff;border:1px solid #bae6fd;color:#075985;font-size:12px;line-height:1.5}.homepage-app-preview{padding:2px}.homepage-phone-shell{max-width:390px;margin:0 auto;border:8px solid #111827;border-radius:28px;background:#f8fafc;overflow:hidden;box-shadow:0 16px 38px rgba(15,23,42,.15)}.homepage-phone-top{padding:14px 16px;background:#fff;font-weight:800;border-bottom:1px solid #e5e7eb;display:flex;justify-content:space-between}.homepage-phone-top span{font-size:11px;color:#64748b;font-weight:600}.homepage-phone-content{display:grid;gap:12px;padding:14px;max-height:640px;overflow:auto}.homepage-app-preview-card{overflow:hidden;border-radius:16px;background:#fff;border:1px solid #e5e7eb;box-shadow:0 6px 16px rgba(15,23,42,.06)}.homepage-app-preview-image{height:150px;background:#eef2f7;display:grid;place-items:center}.homepage-app-preview-image img{width:100%;height:100%;object-fit:cover}.homepage-app-preview-image span{font-size:32px}.homepage-app-preview-card>div:last-child{display:grid;gap:5px;padding:12px}.homepage-app-preview-card small{font-size:10px;color:#f05a00;font-weight:800}.homepage-app-preview-card strong{font-size:15px;color:#0f172a}.homepage-app-preview-card p{margin:0;font-size:12px;color:#64748b;line-height:1.45}.homepage-app-empty{display:grid;gap:8px;text-align:center;padding:44px 20px;color:#64748b}.homepage-app-empty strong{color:#0f172a}.homepage-slide-meta{display:flex!important;gap:6px;align-items:center;flex-wrap:wrap}.homepage-slide-meta b{font-size:10px;background:#f1f5f9;border-radius:999px;padding:2px 6px;color:#334155}.homepage-slide-meta span{font-size:10px;color:#64748b}@media(max-width:850px){.homepage-workspace-tabs{grid-template-columns:1fr}.homepage-channel-selector{grid-template-columns:1fr 1fr}.homepage-channel-selector>div{grid-column:1/-1}.homepage-flow-strip i{display:none}.homepage-flow-strip span{flex:1 1 45%}}

/* ==========================================================
   PORTADA V10.132 - PREVISUALIZACIÓN EN VIVO
   ========================================================== */
.homepage-app-preview-card.is-selected{outline:2px solid #ff6a00;outline-offset:1px}.homepage-app-preview-status{display:flex;align-items:center;justify-content:space-between;gap:8px}.homepage-app-preview-status em{font-style:normal;font-size:10px;font-weight:800;color:#475467;background:#f2f4f7;border-radius:999px;padding:3px 7px}.homepage-app-preview-card.is-selected .homepage-app-preview-status em{color:#9a3412;background:#fff1e8}

/* V10.133 — Portada App: controles operativos + preview fiel al Cliente */
.homepage-app-controls-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:8px 0 14px}.homepage-setting-switch{display:flex;gap:10px;align-items:flex-start;padding:12px;border:1px solid #e2e8f0;border-radius:12px;background:#fff;cursor:pointer}.homepage-setting-switch input{margin-top:3px}.homepage-setting-switch span{display:grid;gap:3px}.homepage-setting-switch strong{font-size:13px;color:#0f172a}.homepage-setting-switch small{font-size:11px;line-height:1.4;color:#64748b}.homepage-app-numeric-controls{margin-top:4px}.app-real-preview{position:relative;background:#f6f7f9;min-height:650px}.app-real-header{height:72px;background:#fff;display:flex;align-items:center;gap:9px;padding:10px 14px;border-bottom:1px solid #eee}.app-real-header .app-real-logo{width:45px;height:45px;border-radius:50%;display:grid;place-items:center;background:#fff2e9;color:#c2410c;font-weight:900;border:1px solid #fed7aa}.app-real-header>b{font-size:13px}.app-real-header>span{margin-left:auto;border:1px solid #fecaca;border-radius:999px;padding:7px 10px;color:#b91c1c;font-size:10px;font-weight:900}.app-real-categories{height:54px;background:#fff;display:flex;overflow:hidden;border-bottom:1px solid #eee}.app-real-categories b{min-width:78px;display:grid;place-items:center;font-size:11px;color:#222}.app-real-categories b.active{background:#ef3340;color:#111;clip-path:polygon(8% 0,92% 0,100% 100%,50% 86%,0 100%)}.app-real-title{display:grid;justify-items:center;line-height:.9;padding:28px 0 14px}.app-real-title small{font-family:Georgia,serif;font-style:italic;font-weight:800;font-size:18px}.app-real-title strong{font-size:42px;letter-spacing:-2px;color:#e30613}.app-real-carousel{position:relative;padding:8px 18px 34px;overflow:hidden}.app-real-card{height:190px;border-radius:22px;overflow:hidden;position:relative;background:#2a1210;box-shadow:0 15px 30px rgba(20,24,32,.22)}.app-real-card>img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.app-real-shade{position:absolute;inset:0;background:linear-gradient(90deg,rgba(20,5,4,.9),rgba(30,8,6,.55),rgba(20,5,4,.08))}.app-real-card-content{position:absolute;inset:0;padding:18px;display:flex;flex-direction:column;justify-content:flex-end;align-items:flex-start;color:#fff}.app-real-card-content small{color:#ffd05a;font-weight:900;font-size:10px}.app-real-card-content h4{font-size:20px;line-height:1.08;margin:5px 0 12px;max-width:76%}.app-real-card-content button{border:0;border-radius:10px;background:#ef1824;color:#fff;padding:9px 13px;font-weight:900;font-size:11px}.app-real-fallback{display:grid;place-items:center;background:#fff;border:1px dashed #cbd5e1;box-shadow:none;color:#475569}.app-real-fallback>div{display:grid;text-align:center;gap:6px;padding:20px}.app-real-fallback small{font-size:11px}.app-real-dots{position:absolute;left:0;right:0;bottom:13px;display:flex;justify-content:center;gap:5px}.app-real-dots i{width:6px;height:6px;border-radius:999px;background:#d1d4d9}.app-real-dots i.active{width:18px;background:#e30613}.app-real-products{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:8px 18px}.app-real-products i{height:115px;border-radius:16px;background:linear-gradient(135deg,#e5e7eb,#f8fafc);border:1px solid #e2e8f0}.app-real-nav{position:absolute;bottom:0;left:0;right:0;height:62px;background:#fff;border-top:1px solid #e5e7eb;display:grid;grid-template-columns:repeat(4,1fr)}.app-real-nav b{display:grid;place-items:center;align-content:center;color:#475569;font-size:15px}.app-real-nav b:first-child{color:#e30613}.app-real-nav small{display:block;font-size:8px;font-weight:600;margin-top:2px}@media(max-width:850px){.homepage-app-controls-grid{grid-template-columns:1fr}}


/* ========================================================== */
/* V10.158 · HORARIOS RESPONSIVE + TOUCH ANDROID              */
/* ========================================================== */
/*
 * Esta sección es la fuente visual definitiva del módulo
 * Horarios dentro del Panel Web. Evita depender de estilos de
 * otros módulos y prioriza interacción táctil en Chrome/PWA.
 */

.schedules-panel .panel-head {
    align-items: flex-start;
    gap: 16px;
}

.schedules-panel .panel-head .actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.schedule-sync-status {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 999px;
    background: #f2f4f7;
    color: #667085;
    font-size: 12px;
    font-weight: 800;
}

.schedule-sync-status.is-ok {
    background: #eaf8ef;
    color: #157a39;
}

.schedules-form {
    display: grid;
    gap: 18px;
}

.schedule-list {
    display: grid;
    gap: 10px;
}

.schedule-row {
    display: grid;
    grid-template-columns: minmax(150px, 1.1fr) minmax(120px, .72fr) minmax(145px, .9fr) minmax(145px, .9fr);
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 15px 16px;
    border: 1px solid #e0e5ec;
    border-radius: 16px;
    background: #fff;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.schedule-row.is-open {
    border-color: #bfe3ca;
    background: #fbfffc;
}

.schedule-row.is-closed {
    background: #f7f8fa;
}

.schedule-day {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.schedule-day strong {
    font-size: 15px;
}

.schedule-day span {
    color: #667085;
    font-size: 12px;
    font-weight: 700;
}

.schedule-row.is-open .schedule-day span {
    color: #188342;
}

.schedule-row label {
    min-width: 0;
    margin: 0;
}

.schedule-row > label:not(.schedule-open-toggle) {
    display: grid;
    gap: 6px;
    color: #667085;
    font-size: 12px;
    font-weight: 800;
}

.schedule-row input[type="time"],
.timezone-field select {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 0 11px;
    border: 1px solid #d6dce5;
    border-radius: 11px;
    background: #fff;
    color: #101828;
    font: inherit;
}

.schedule-row input[type="time"]:disabled {
    background: #f3f4f6;
    color: #7b8491;
    opacity: .82;
}

/* Toda esta superficie es tocable; no sólo el checkbox nativo. */
.schedule-open-toggle {
    position: relative;
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    gap: 10px !important;
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 8px 10px;
    border: 1px solid #d8dee7;
    border-radius: 12px;
    background: #fff;
    color: #344054;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.schedule-open-toggle:active {
    transform: translateY(1px);
}

.schedule-open-toggle:focus-within {
    outline: 3px solid rgba(47, 128, 237, .18);
    outline-offset: 2px;
}

.schedule-open-toggle input[type="checkbox"] {
    flex: 0 0 24px;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px;
    margin: 0 !important;
    padding: 0 !important;
    accent-color: #16883f;
    cursor: pointer;
    pointer-events: auto;
    touch-action: manipulation;
}

.schedule-open-toggle-text {
    pointer-events: none;
    font-size: 13px;
    font-weight: 850;
}

.schedule-row.is-open .schedule-open-toggle {
    border-color: #b9dfc5;
    background: #effaf2;
    color: #157a39;
}

.schedule-options-card {
    display: grid;
    grid-template-columns: minmax(240px, 360px) 1fr;
    gap: 18px;
    align-items: end;
    padding: 16px;
    border: 1px solid #e0e5ec;
    border-radius: 16px;
    background: #f8fafc;
}

.schedule-options-card .timezone-field {
    max-width: none;
    margin-top: 0;
}

.schedule-options-card p {
    margin: 0 0 4px;
    color: #667085;
    font-size: 13px;
    line-height: 1.45;
}

@media (max-width: 900px) {
    .schedule-row {
        grid-template-columns: minmax(0, 1fr) minmax(130px, .75fr);
    }

    .schedule-row > label:not(.schedule-open-toggle) {
        grid-column: span 1;
    }

    .schedule-options-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .schedules-panel {
        padding: 12px;
    }

    .schedules-panel .panel-head {
        display: grid;
        grid-template-columns: 1fr;
    }

    .schedules-panel .panel-head .actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .schedules-panel #saveHoursButton,
    .schedule-sync-status {
        width: 100%;
        justify-content: center;
    }

    .schedules-form.setting-section {
        padding: 8px 0 0;
    }

    .schedule-list {
        gap: 12px;
    }

    .schedule-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        padding: 14px;
    }

    .schedule-day {
        grid-template-columns: auto 1fr;
        align-items: baseline;
        gap: 7px;
    }

    .schedule-day strong {
        font-size: 16px;
    }

    .schedule-open-toggle {
        min-height: 52px;
    }

    .schedule-row > label:not(.schedule-open-toggle) {
        grid-column: 1;
        width: 100%;
    }

    .schedule-row input[type="time"] {
        min-height: 50px;
        font-size: 16px;
    }

    .schedule-options-card {
        padding: 14px;
    }

    .timezone-field select {
        min-height: 50px;
        font-size: 16px;
    }
}

@media (min-width: 480px) and (max-width: 700px) {
    .schedule-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .schedule-day,
    .schedule-open-toggle {
        grid-column: 1 / -1;
    }
}


/* ==========================================================
   V10.310 — BARRA LATERAL UNIFICADA
   Centro de Control Web = mismas proporciones que Operaciones
   ========================================================== */

:root {
    --sidebar-width-expanded: 196px;
    --sidebar-width-collapsed: 68px;
}

@media (min-width: 701px) {
    #appRoot.app:not(.sidebar-collapsed) {
        grid-template-columns: 196px minmax(0, 1fr) !important;
    }

    #appRoot.app:not(.sidebar-collapsed) > .sidebar {
        width: 196px !important;
        padding: 12px 10px 10px !important;
    }

    #appRoot .sidebar .brand {
        min-height: 44px !important;
        margin-bottom: 10px !important;
        padding: 0 4px !important;
        gap: 9px !important;
    }

    #appRoot .sidebar .brand-mark {
        width: 36px !important;
        height: 36px !important;
        flex: 0 0 36px !important;
        border-radius: 10px !important;
        font-size: 13px !important;
    }

    #appRoot .sidebar .brand strong {
        font-size: 13px !important;
        line-height: 1.2 !important;
    }

    #appRoot .sidebar .brand span {
        margin-top: 2px !important;
        font-size: 10px !important;
        color: #9fb0c8 !important;
    }

    #appRoot .sidebar #nav {
        gap: 4px !important;
        padding-right: 2px !important;
    }

    #appRoot .sidebar #nav button {
        min-height: 38px !important;
        padding: 8px 9px !important;
        gap: 9px !important;
        border-radius: 9px !important;
        font-size: 12px !important;
        font-weight: 700 !important;
        color: #dbe5f1 !important;
    }

    #appRoot .sidebar #nav button.active {
        background: #24324a !important;
        color: #fff !important;
        box-shadow: inset 3px 0 0 #f97316 !important;
    }

    #appRoot .sidebar #nav button .nav-icon {
        width: 20px !important;
        flex: 0 0 20px !important;
    }

    #appRoot .sidebar-foot {
        margin-top: 12px !important;
        padding-top: 7px !important;
        gap: 2px !important;
        border-top: 1px solid rgba(255,255,255,.1) !important;
    }

    #appRoot .sidebar-foot > a,
    #appRoot .sidebar-foot > button {
        min-height: 31px !important;
        padding: 6px 8px !important;
        border-radius: 7px !important;
        font-size: 10.5px !important;
        color: #cbd6e5 !important;
    }

    #appRoot.app.sidebar-collapsed {
        grid-template-columns: 68px minmax(0, 1fr) !important;
    }

    #appRoot.app.sidebar-collapsed > .sidebar {
        width: 68px !important;
        padding-inline: 8px !important;
    }
}

/* ==========================================================
   V10.337 — ORDEN MANUAL DE PUBLICACIÓN DE PRODUCTOS
   Alcance exclusivo: módulo Productos / Promociones.
   ========================================================== */
.product-order-button {
    white-space: nowrap;
    font-weight: 700;
}

.product-order-editor {
    display: grid;
    gap: 14px;
}

.product-order-category-field {
    max-width: 420px;
}

.product-order-help {
    margin: 0;
    color: var(--muted, #64748b);
    font-size: 13px;
}

.product-order-list {
    display: grid;
    gap: 8px;
    max-height: min(58vh, 620px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
}

.product-order-row {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
}

.product-order-position {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: #f1f5f9;
    font-weight: 800;
    color: #0f172a;
}

.product-order-info {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.product-order-info strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-order-info small {
    color: #64748b;
}

.product-order-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.product-order-actions > .btn {
    min-width: 38px;
    min-height: 38px;
    font-size: 18px;
    font-weight: 900;
}

.product-order-jump {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #64748b;
}

.product-order-jump input {
    width: 62px;
    min-height: 38px;
    text-align: center;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-weight: 800;
}

.product-order-empty {
    padding: 28px 16px;
    text-align: center;
    color: #64748b;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
}

@media (max-width: 720px) {
    .product-order-row {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .product-order-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}


/* =========================================================
   V10.393 — SELECTOR VISUAL DE ICONOS DE CATEGORÍA
   Mantiene el icono editable y suma opciones rápidas sin
   alterar el guardado central existente.
========================================================= */
#modal .category-icon-field {
    grid-column: 1 / -1;
}

#modal .category-icon-control {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}

#modal .category-icon-control > input {
    min-height: 48px;
    text-align: center;
    font-size: 25px;
}

#modal .category-icon-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

#modal .category-icon-preset {
    width: 42px;
    height: 42px;
    border: 1px solid #d8dee8;
    border-radius: 11px;
    background: #fff;
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

#modal .category-icon-preset:hover,
#modal .category-icon-preset:focus-visible {
    border-color: #a8b6c8;
    box-shadow: 0 0 0 3px rgba(74, 105, 145, .09);
    outline: none;
}

#modal .category-icon-preset.is-selected {
    border-color: #d91820;
    box-shadow: 0 0 0 3px rgba(217, 24, 32, .10);
    transform: translateY(-1px);
}

@media (max-width: 620px) {
    #modal .category-icon-control {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    #modal .category-icon-preset {
        width: 39px;
        height: 39px;
    }
}
