/**
 * Interfaz y Menú Moderna Pro (v2) - Mobile First
 * Diseñado para ZFAppMyTienda
 */

:root {
    --v2-primary: #2563eb;
    --v2-primary-hover: #1d4ed8;
    --v2-primary-light: #eff6ff;
    --v2-primary-border: #bfdbfe;
    
    --v2-sidebar-bg: #0f172a;
    --v2-sidebar-border: #1e293b;
    --v2-sidebar-text: #94a3b8;
    --v2-sidebar-text-bright: #f8fafc;
    --v2-sidebar-hover: #1e293b;
    --v2-sidebar-active-bg: rgba(37, 99, 235, 0.16);
    --v2-sidebar-active-text: #60a5fa;
    --v2-sidebar-badge-bg: rgba(255, 255, 255, 0.08);

    --v2-header-bg: rgba(255, 255, 255, 0.95);
    --v2-header-border: #e2e8f0;
    --v2-header-text: #1e293b;
    
    --v2-sidebar-width: 260px;
    --v2-sidebar-collapsed-width: 70px;
    --v2-header-height: 58px;
    --v2-bottom-nav-height: 58px;

    --v2-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --v2-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --v2-shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   RESET & LAYOUT BASE V2
   ========================================================================== */
body.theme-v2 {
    background-color: #f8fafc;
    background-image: none !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #334155;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.v2-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
}

/* ==========================================================================
   HEADER SUPERIOR V2
   ========================================================================== */
.v2-header {
    height: var(--v2-header-height);
    background-color: var(--v2-header-bg);
    border-bottom: 1px solid var(--v2-header-border);
    position: fixed;
    top: 0;
    right: 0;
    left: var(--v2-sidebar-width);
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: var(--v2-shadow-sm);
    transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-collapsed .v2-header {
    left: var(--v2-sidebar-collapsed-width);
}

body.sidebar-hidden .v2-sidebar,
body.sidebar-hidden .v2-sidebar-overlay {
    display: none !important;
}

body.sidebar-hidden .v2-header,
body.sidebar-hidden.sidebar-collapsed .v2-header {
    left: 0;
}

.v2-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-inline-size: 0;
}

.v2-header-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--v2-header-text);
    min-inline-size: 0;
}

.v2-header-brand:hover {
    text-decoration: none;
    color: var(--v2-primary);
}

.v2-header-brand:hover .v2-header-title {
    color: var(--v2-primary);
}

.v2-header-brand:focus-visible,
.v2-header-action-home:focus-visible {
    outline: 2px solid var(--v2-primary);
    outline-offset: 2px;
    border-radius: 6px;
}

.v2-header-logo {
    display: block;
    height: 32px;
    max-width: 120px;
    object-fit: contain;
    flex-shrink: 0;
}

.v2-header-brand-icon {
    font-size: 24px;
    color: var(--v2-primary);
    flex-shrink: 0;
}

.v2-btn-toggle {
    background: transparent;
    border: none;
    outline: none;
    color: #475569;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    padding: 0;
}

.v2-btn-toggle:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.v2-btn-toggle .material-icons {
    font-size: 24px;
}

.v2-header-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.v2-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.v2-header-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    color: #475569;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.2s;
}

.v2-header-action:hover {
    background-color: #f1f5f9;
    color: var(--v2-primary);
    text-decoration: none;
}

.v2-header-action .material-icons {
    font-size: 20px;
}

.v2-header-action-home {
    background-color: var(--v2-primary-light);
    border: 1px solid var(--v2-primary-border);
    color: var(--v2-primary);
    font-weight: 600;
}

.v2-header-action-home:hover {
    background-color: var(--v2-primary);
    border-color: var(--v2-primary);
    color: #ffffff;
}

.v2-btn-switch-version {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.v2-btn-switch-version:hover {
    background-color: #e2e8f0;
    color: #0f172a;
    text-decoration: none;
}

.v2-user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #334155;
}

.v2-user-avatar {
    width: 26px;
    height: 26px;
    background: var(--v2-primary-light);
    color: var(--v2-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

/* ==========================================================================
   SIDEBAR LATERAL V2
   ========================================================================== */
.v2-sidebar {
    width: var(--v2-sidebar-width);
    background-color: var(--v2-sidebar-bg);
    color: var(--v2-sidebar-text);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.sidebar-collapsed .v2-sidebar {
    width: var(--v2-sidebar-collapsed-width);
}

.v2-sidebar-brand {
    height: var(--v2-header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--v2-sidebar-border);
    flex-shrink: 0;
}

.v2-brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #ffffff;
    overflow: hidden;
}

.v2-brand-link:hover {
    text-decoration: none;
    color: #ffffff;
}

.v2-brand-logo {
    height: 34px;
    max-width: 140px;
    object-fit: contain;
}

.v2-brand-name {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    letter-spacing: -0.2px;
}

.sidebar-collapsed .v2-brand-name {
    display: none;
}

/* Buscador en el sidebar */
.v2-sidebar-search {
    padding: 12px 14px;
    border-bottom: 1px solid var(--v2-sidebar-border);
    flex-shrink: 0;
}

.sidebar-collapsed .v2-sidebar-search {
    display: none;
}

.v2-search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.v2-search-box .material-icons {
    position: absolute;
    left: 10px;
    color: #64748b;
    font-size: 18px;
    pointer-events: none;
}

.v2-search-input {
    width: 100%;
    height: 36px;
    background-color: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 0 32px 0 34px;
    color: #f8fafc;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s, background-color 0.2s;
}

.v2-search-input::placeholder {
    color: #64748b;
}

.v2-search-input:focus {
    border-color: var(--v2-primary);
    background-color: #0f172a;
}

.v2-search-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    display: none;
    padding: 2px 4px;
    font-size: 12px;
    line-height: 1;
}

.v2-search-clear:hover {
    color: #f8fafc;
}

/* Contenedor del scroll de menú */
.v2-sidebar-menu {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 8px;
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}

.v2-sidebar-menu::-webkit-scrollbar {
    width: 5px;
}

.v2-sidebar-menu::-webkit-scrollbar-thumb {
    background-color: #334155;
    border-radius: 4px;
}

/* Grupos y Acordeones */
.v2-menu-group {
    margin-bottom: 6px;
}

.v2-group-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--v2-sidebar-text);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    text-align: left;
    outline: none;
}

.sidebar-collapsed .v2-group-header {
    justify-content: center;
    padding: 12px 0;
}

.v2-group-header:hover {
    background-color: var(--v2-sidebar-hover);
    color: var(--v2-sidebar-text-bright);
}

.v2-group-header-content {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.sidebar-collapsed .v2-group-header-content {
    justify-content: center;
    gap: 0;
}

.v2-group-icon {
    font-size: 20px;
    color: #64748b;
    flex-shrink: 0;
    transition: color 0.2s;
}

.v2-group-header:hover .v2-group-icon {
    color: var(--v2-sidebar-text-bright);
}

.v2-group-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-collapsed .v2-group-title {
    display: none;
}

.v2-group-chevron {
    font-size: 18px;
    color: #64748b;
    transition: transform 0.2s ease;
}

.sidebar-collapsed .v2-group-chevron {
    display: none;
}

.v2-menu-group.open .v2-group-chevron {
    transform: rotate(90deg);
}

.v2-menu-group.open .v2-group-header {
    color: var(--v2-sidebar-text-bright);
}

a.v2-group-header.v2-menu-link {
    padding: 10px 12px;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
}

.sidebar-collapsed a.v2-group-header.v2-menu-link {
    justify-content: center;
    padding: 12px 0;
}

a.v2-group-header.v2-menu-link.active {
    background-color: var(--v2-sidebar-active-bg);
    color: var(--v2-sidebar-active-text);
}

a.v2-group-header.v2-menu-link.active .v2-group-icon {
    color: var(--v2-sidebar-active-text);
}

/* Submenús */
.v2-group-items {
    list-style: none;
    margin: 4px 0 6px 0;
    padding: 0 0 0 8px;
    display: none;
}

.v2-menu-group.open .v2-group-items {
    display: block;
}

.sidebar-collapsed .v2-group-items {
    display: none !important;
}

.v2-menu-item {
    margin-bottom: 2px;
}

.v2-menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--v2-sidebar-text);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.15s ease;
}

.v2-menu-link:hover {
    background-color: var(--v2-sidebar-hover);
    color: #ffffff;
    text-decoration: none;
}

.v2-menu-link.active {
    background-color: var(--v2-sidebar-active-bg);
    color: var(--v2-sidebar-active-text);
    font-weight: 600;
}

.v2-menu-item-icon {
    font-size: 18px;
    color: #64748b;
    flex-shrink: 0;
}

.v2-menu-link:hover .v2-menu-item-icon,
.v2-menu-link.active .v2-menu-item-icon {
    color: var(--v2-sidebar-active-text);
}

.v2-menu-item-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Pie del Sidebar */
.v2-sidebar-footer {
    padding: 12px 14px;
    border-top: 1px solid var(--v2-sidebar-border);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: #0b1120;
}

.sidebar-collapsed .v2-sidebar-footer {
    padding: 12px 4px;
    align-items: center;
}

.v2-footer-action {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.82rem;
    transition: all 0.2s;
    background: transparent;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.sidebar-collapsed .v2-footer-action {
    justify-content: center;
    padding: 8px 0;
    width: 44px;
    height: 44px;
}

.v2-footer-action:hover {
    background-color: #1e293b;
    color: #ffffff;
    text-decoration: none;
}

.v2-footer-action .material-icons {
    font-size: 20px;
}

.sidebar-collapsed .v2-footer-action span {
    display: none;
}

/* ==========================================================================
   TOOLTIP FLOTANTE EN MODO COMPRIMIDO
   ========================================================================== */
#v2FloatingTooltip {
    position: fixed;
    z-index: 109999;
    background-color: #0f172a;
    color: #ffffff;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 0.84rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    border: 1px solid #334155;
    pointer-events: none;
    display: none;
    opacity: 0;
    transition: opacity 0.12s ease-out;
}

#v2FloatingTooltip::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent #0f172a transparent transparent;
}

/* ==========================================================================
   ÁREA DE CONTENIDO PRINCIPAL Y ANCHO COMPLETO PARA GRIDS
   ========================================================================== */
.v2-main-content {
    width: calc(100% - var(--v2-sidebar-width)) !important;
    max-width: calc(100% - var(--v2-sidebar-width)) !important;
    margin-left: var(--v2-sidebar-width) !important;
    margin-top: var(--v2-header-height) !important;
    box-sizing: border-box !important;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
    display: block;
}

.sidebar-collapsed .v2-main-content {
    width: calc(100% - var(--v2-sidebar-collapsed-width)) !important;
    max-width: calc(100% - var(--v2-sidebar-collapsed-width)) !important;
    margin-left: var(--v2-sidebar-collapsed-width) !important;
}

body.sidebar-hidden .v2-main-content,
body.sidebar-hidden.sidebar-collapsed .v2-main-content {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
}

.v2-content-body, #content {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 18px 24px !important;
}

#divLista {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    clear: both !important;
}

#divBotonera {
    float: right !important;
    margin-bottom: 12px !important;
}

#divBuscar {
    float: left !important;
    margin-bottom: 12px !important;
}

/* JQGRID AL 100% DE ANCHO */
.ui-jqgrid {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin-top: 10px !important;
    margin-bottom: 24px !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
    border: 1px solid #cbd5e1 !important;
    overflow: hidden !important;
    clear: both !important;
}

.ui-jqgrid .ui-jqgrid-view,
.ui-jqgrid .ui-jqgrid-hdiv,
.ui-jqgrid .ui-jqgrid-bdiv,
.ui-jqgrid .ui-jqgrid-pager {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.ui-jqgrid .ui-jqgrid-bdiv {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

.ui-jqgrid table.ui-jqgrid-htable,
.ui-jqgrid table.ui-jqgrid-btable {
    width: 100% !important;
    max-width: 100% !important;
}

.ui-jqgrid .ui-jqgrid-pager {
    background-color: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
    height: auto !important;
    padding: 6px 0 !important;
}

/* ==========================================================================
   ESTILOS Y CENTRADO DE FORMULARIOS Y DIÁLOGOS MODALES
   ========================================================================== */
.ui-widget-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(3px) !important;
    -webkit-backdrop-filter: blur(3px) !important;
    z-index: 1045 !important;
    opacity: 1 !important;
}

/* Si no hay diálogos modales abiertos en el body, ningún overlay debe bloquear la pantalla */
body:not(:has(.ui-dialog:not([style*="display: none"]):not([style*="display:none"]):not([aria-hidden="true"]))):not(:has(.ui-jqdialog:not([style*="display: none"]):not([style*="display:none"]):not([aria-hidden="true"]))) .ui-widget-overlay,
body:not(:has(.ui-dialog:not([style*="display: none"]):not([style*="display:none"]):not([aria-hidden="true"]))):not(:has(.ui-jqdialog:not([style*="display: none"]):not([style*="display:none"]):not([aria-hidden="true"]))) .jqgrid-overlay-modal,
body:not(:has(.ui-dialog:not([style*="display: none"]):not([style*="display:none"]):not([aria-hidden="true"]))):not(:has(.ui-jqdialog:not([style*="display: none"]):not([style*="display:none"]):not([aria-hidden="true"]))) .jqmOverlay {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Ocultar rigurosamente diálogos cerrados (previene que autoOpen: false se muestre) */
.ui-dialog[style*="display: none"],
div.ui-dialog[style*="display: none"] {
    display: none !important;
}

.ui-dialog:not(.ui-jqdialog) {
    position: fixed !important;
    z-index: 1050 !important;
    background: #ffffff !important;
    border-radius: 12px !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(0, 0, 0, 0.05) !important;
    padding: 0 !important;
    overflow: hidden !important;
    max-width: 96vw !important;
    box-sizing: border-box !important;
}

/* Subformularios modales que abren sobre otros diálogos (ej. Grabar Venta / Edición sobre Canasta) */
.ui-dialog:has(#wndEdicion),
.ui-dialog:has(#wndNew),
.ui-dialog:has(#wndNewCargoHabitacion),
div.ui-dialog.dialog-subformulario {
    z-index: 1070 !important;
}

/* Subformularios de segundo nivel que abren sobre #wndEdicion (ej. #wndNewOpcion para Nuevo Producto) */
.ui-dialog:has(#wndNewOpcion) {
    z-index: 1090 !important;
    border: 1px solid #93c5fd !important;
    box-shadow: 0 25px 60px -10px rgba(15, 23, 42, 0.45), 0 0 0 1px rgba(37, 99, 235, 0.15) !important;
}

/* Overlay intermedio para oscurecer el diálogo inferior cuando se abre un subformulario */
body:has(.ui-dialog:has(#wndEdicion):not([style*="display: none"]):not([style*="display:none"])) .ui-widget-overlay:last-of-type,
body:has(.ui-dialog:has(#wndNew):not([style*="display: none"]):not([style*="display:none"])) .ui-widget-overlay:last-of-type,
body:has(.ui-dialog:has(#wndNewCargoHabitacion):not([style*="display: none"]):not([style*="display:none"])) .ui-widget-overlay:last-of-type,
body:has(.dialog-subformulario:not([style*="display: none"]):not([style*="display:none"])) .ui-widget-overlay:last-of-type {
    z-index: 1065 !important;
}

body:has(.ui-dialog:has(#wndNewOpcion):not([style*="display: none"]):not([style*="display:none"])) .ui-widget-overlay:last-of-type {
    z-index: 1085 !important;
}

/* Encabezado (Header) de Diálogos y Formularios RESALTADO */
.ui-dialog:not(.ui-jqdialog) .ui-dialog-titlebar {
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%) !important;
    border: none !important;
    border-bottom: 2px solid #cbd5e1 !important;
    border-radius: 12px 12px 0 0 !important;
    padding: 12px 20px !important;
    position: relative !important;
    margin: 0 !important;
}

.ui-dialog:not(.ui-jqdialog) .ui-dialog-title {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    letter-spacing: -0.2px !important;
}

.ui-dialog:not(.ui-jqdialog) .ui-dialog-titlebar-close {
    position: absolute !important;
    right: 14px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer !important;
    width: 28px !important;
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 6px !important;
    color: #475569 !important;
    outline: none !important;
    box-shadow: none !important;
    transition: all 0.15s ease !important;
}

.ui-dialog:not(.ui-jqdialog) .ui-dialog-titlebar-close:focus,
.ui-dialog:not(.ui-jqdialog) .ui-dialog-titlebar-close:focus-visible,
.ui-dialog:not(.ui-jqdialog) .ui-dialog-titlebar-close:active {
    outline: none !important;
    outline-color: transparent !important;
    outline-style: none !important;
    outline-width: 0 !important;
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
}

.ui-dialog:not(.ui-jqdialog) .ui-dialog-titlebar-close:hover {
    background-color: #ef4444 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
    outline: none !important;
}

.ui-dialog:not(.ui-jqdialog) .ui-dialog-content {
    padding: 20px 24px !important;
    background: #ffffff !important;
    color: #334155 !important;
    font-size: 0.9rem !important;
    max-height: calc(100vh - 200px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

/* Pie (Footer) de Diálogos y Formularios RESALTADO */
.ui-dialog:not(.ui-jqdialog) .ui-dialog-buttonpane {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
    border: none !important;
    border-top: 2px solid #e2e8f0 !important;
    padding: 12px 20px !important;
    margin: 0 !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 12px !important;
    box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.03) !important;
}

.ui-dialog:not(.ui-jqdialog) .ui-dialog-buttonpane button,
.ui-dialog .ui-dialog-buttonpane .ui-button {
    margin: 0 !important;
    padding: 7px 20px !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    color: #334155 !important;
    cursor: pointer !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.15s ease !important;
}

.ui-dialog:not(.ui-jqdialog) .ui-dialog-buttonpane button:hover,
.ui-dialog .ui-dialog-buttonpane .ui-button:hover {
    background: #f1f5f9 !important;
    background-color: #f1f5f9 !important;
    background-image: none !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
}

/* ==========================================================================
   BOTÓN GUARDAR RESALTADO Y NÍTIDO (AZUL SÓLIDO PROFESIONAL)
   ========================================================================== */
#guardar,
input#guardar,
button#guardar,
.ui-dialog #guardar,
.ui-dialog input#guardar,
.ui-dialog button#guardar,
.ui-dialog .ui-button#guardar,
input[type="submit"]#guardar,
button[type="submit"]#guardar,
.zend_form input[type="submit"],
.zend_form button[type="submit"],
input[type="submit"],
.ui-dialog input[type="submit"] {
    background: #2563eb !important;
    background-color: #2563eb !important;
    background-image: none !important;
    color: #ffffff !important;
    border: 1px solid #1d4ed8 !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    padding: 8px 24px !important;
    border-radius: 6px !important;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3) !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    text-shadow: none !important;
    text-decoration: none !important;
}

#guardar:hover,
input#guardar:hover,
button#guardar:hover,
.ui-dialog #guardar:hover,
.ui-dialog input#guardar:hover,
.ui-dialog button#guardar:hover,
.ui-dialog .ui-button#guardar:hover,
input[type="submit"]#guardar:hover,
button[type="submit"]#guardar:hover,
.zend_form input[type="submit"]:hover,
.zend_form button[type="submit"]:hover,
input[type="submit"]:hover,
.ui-dialog input[type="submit"]:hover {
    background: #1d4ed8 !important;
    background-color: #1d4ed8 !important;
    background-image: none !important;
    color: #ffffff !important;
    border-color: #1e40af !important;
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.4) !important;
}

#guardar .ui-button-text,
.ui-button#guardar .ui-button-text,
.ui-dialog #guardar .ui-button-text {
    color: #ffffff !important;
    font-weight: 700 !important;
    padding: 0 !important;
    background: transparent !important;
}

/* Formularios dentro de diálogos y vistas */
.ui-dialog:not(.ui-jqdialog) form,
.ui-dialog:not(.ui-jqdialog) .zend_form {
    max-width: 100% !important;
    margin: 0 auto !important;
}

.ui-dialog:not(.ui-jqdialog) dt {
    font-weight: 600 !important;
    color: #1e293b !important;
    padding-bottom: 4px !important;
    margin-top: 10px !important;
    font-size: 0.88rem !important;
}

.ui-dialog:not(.ui-jqdialog) dd {
    margin: 0 0 10px 0 !important;
}

/* Ocultar filas de campos hidden en Zend_Form para evitar espacio en blanco superior */
.ui-dialog:not(.ui-jqdialog) dl.zend_form dt:has(+ dd > input[type="hidden"]:only-child),
.ui-dialog:not(.ui-jqdialog) dl.zend_form dd:has(> input[type="hidden"]:only-child) {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
}

/* Aprovechar mejor el espacio vertical en diálogos dentro de iframes (main_limpio) */
body.main-limpio-v2 .ui-dialog:not(.ui-jqdialog) .ui-dialog-content {
    padding: 14px 20px !important;
    max-height: calc(100vh - 130px) !important;
}

body.main-limpio-v2 .ui-dialog:not(.ui-jqdialog) dl.zend_form {
    margin: 0 !important;
    padding: 0 !important;
}

.ui-dialog:not(.ui-jqdialog) input[type="text"],
.ui-dialog:not(.ui-jqdialog) input[type="password"],
.ui-dialog:not(.ui-jqdialog) select,
.ui-dialog:not(.ui-jqdialog) textarea {
    height: 36px !important;
    padding: 6px 12px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    color: #0f172a !important;
    background-color: #ffffff !important;
    font-size: 0.88rem !important;
    box-sizing: border-box !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.ui-dialog:not(.ui-jqdialog) textarea {
    height: auto !important;
    min-height: 80px !important;
}

.ui-dialog:not(.ui-jqdialog) input[type="text"]:focus,
.ui-dialog:not(.ui-jqdialog) select:focus,
.ui-dialog:not(.ui-jqdialog) textarea:focus {
    border-color: var(--v2-primary) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

/* ==========================================================================
   DIÁLOGOS DE JQGRID (ui-jqdialog: Confirmación de Eliminación, Edición, etc.)
   ========================================================================== */
body.theme-v2 .ui-jqdialog,
body.theme-v2 div[id^="delmod"],
body.theme-v2 div[id^="editmod"],
.ui-jqdialog {
    position: fixed !important;
    z-index: 1080 !important;
    background: #ffffff !important;
    background-image: none !important;
    border-radius: 14px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.05) !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    font-family: inherit !important;
    height: auto !important;
    min-height: auto !important;
    max-height: 90vh !important;
}

/* Header / Barra de Título de ui-jqdialog */
body.theme-v2 .ui-jqdialog .ui-jqdialog-titlebar,
body.theme-v2 .ui-jqdialog .ui-widget-header,
.ui-jqdialog .ui-jqdialog-titlebar {
    background: #f8fafc !important;
    background-image: none !important;
    border: none !important;
    border-bottom: 1px solid #e2e8f0 !important;
    border-radius: 14px 14px 0 0 !important;
    padding: 12px 18px !important;
    position: relative !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: auto !important;
    box-sizing: border-box !important;
}

body.theme-v2 .ui-jqdialog .ui-jqdialog-title,
.ui-jqdialog .ui-jqdialog-title {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    letter-spacing: -0.2px !important;
    margin: 0 !important;
    float: none !important;
}

body.theme-v2 .ui-jqdialog .ui-jqdialog-titlebar-close,
.ui-jqdialog .ui-jqdialog-titlebar-close {
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: #ffffff !important;
    background-image: none !important;
    border: 1px solid #e2e8f0 !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer !important;
    width: 28px !important;
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 6px !important;
    color: #64748b !important;
    text-decoration: none !important;
    outline: none !important;
    box-shadow: none !important;
    transition: all 0.15s ease !important;
}

body.theme-v2 .ui-jqdialog .ui-jqdialog-titlebar-close:focus,
body.theme-v2 .ui-jqdialog .ui-jqdialog-titlebar-close:active,
.ui-jqdialog .ui-jqdialog-titlebar-close:focus,
.ui-jqdialog .ui-jqdialog-titlebar-close:active {
    outline: none !important;
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
}

body.theme-v2 .ui-jqdialog .ui-jqdialog-titlebar-close:hover,
.ui-jqdialog .ui-jqdialog-titlebar-close:hover {
    background-color: #fee2e2 !important;
    border-color: #fecaca !important;
    color: #ef4444 !important;
    outline: none !important;
}

body.theme-v2 .ui-jqdialog .ui-jqdialog-titlebar-close span.ui-icon,
.ui-jqdialog .ui-jqdialog-titlebar-close span.ui-icon {
    display: inline-block !important;
    background-image: none !important;
    position: relative !important;
    width: 14px !important;
    height: 14px !important;
    text-indent: 0 !important;
    margin: 0 !important;
}

body.theme-v2 .ui-jqdialog .ui-jqdialog-titlebar-close span.ui-icon::before,
.ui-jqdialog .ui-jqdialog-titlebar-close span.ui-icon::before {
    content: "✕" !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    display: block !important;
    line-height: 14px !important;
    text-align: center !important;
    color: inherit !important;
}

/* Contenido de ui-jqdialog */
body.theme-v2 .ui-jqdialog-content,
body.theme-v2 .ui-jqdialog .ui-jqdialog-content,
body.theme-v2 .ui-jqdialog .ui-widget-content,
.ui-jqdialog-content,
.ui-jqdialog .ui-jqdialog-content {
    padding: 20px 24px !important;
    background: #ffffff !important;
    background-image: none !important;
    color: #1e293b !important;
    font-size: 0.95rem !important;
    box-sizing: border-box !important;
    height: auto !important;
    overflow: visible !important;
}

.ui-jqdialog-content .DelTable {
    width: 100% !important;
    margin: 0 !important;
    border-collapse: collapse !important;
}

.ui-jqdialog-content .formdata,
.ui-jqdialog-content div[id^="DelTbl_"] {
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
}

body.theme-v2 .ui-jqdialog-content .delmsg,
.ui-jqdialog-content .delmsg {
    font-size: 1rem !important;
    color: #0f172a !important;
    font-weight: 600 !important;
    padding: 10px 0 16px 0 !important;
    white-space: normal !important;
    line-height: 1.5 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

body.theme-v2 .ui-jqdialog-content .delmsg::before,
.ui-jqdialog-content .delmsg::before {
    content: "⚠️";
    font-size: 1.35rem;
    flex-shrink: 0;
}

/* Tabla de Botones del Diálogo de Eliminación / Edición */
.ui-jqdialog-content .EditTable {
    width: 100% !important;
    margin-top: 12px !important;
    border-top: 1px solid #f1f5f9 !important;
    padding-top: 16px !important;
    border-collapse: collapse !important;
}

.ui-jqdialog-content .EditTable hr {
    display: none !important;
}

.ui-jqdialog-content td.DelButton,
.ui-jqdialog-content td.EditButton {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 6px 0 0 0 !important;
    border: none !important;
}

/* Estilos de botones fm-button dentro del diálogo */
body.theme-v2 .ui-jqdialog .fm-button,
.ui-jqdialog .fm-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 9px 22px !important;
    height: auto !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    outline: none !important;
}

/* Botón Acción Principal: Eliminar */
body.theme-v2 .ui-jqdialog #dData,
body.theme-v2 .ui-jqdialog .fm-button#dData,
body.theme-v2 .ui-widget-content .ui-state-default#dData,
.ui-jqdialog #dData {
    background: #ef4444 !important;
    background-color: #ef4444 !important;
    background-image: none !important;
    border: 1px solid #dc2626 !important;
    color: #ffffff !important;
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.35) !important;
}

body.theme-v2 .ui-jqdialog #dData:hover,
body.theme-v2 .ui-jqdialog .fm-button#dData:hover,
body.theme-v2 .ui-widget-content .ui-state-default#dData:hover,
.ui-jqdialog #dData:hover {
    background: #dc2626 !important;
    background-color: #dc2626 !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3) !important;
}

body.theme-v2 .ui-jqdialog #dData .ui-icon,
.ui-jqdialog #dData .ui-icon {
    display: none !important;
}

/* Botón Cancelar */
body.theme-v2 .ui-jqdialog #eData,
body.theme-v2 .ui-jqdialog .fm-button#eData,
body.theme-v2 .ui-widget-content .ui-state-default#eData,
.ui-jqdialog #eData {
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

body.theme-v2 .ui-jqdialog #eData:hover,
body.theme-v2 .ui-jqdialog .fm-button#eData:hover,
body.theme-v2 .ui-widget-content .ui-state-default#eData:hover,
.ui-jqdialog #eData:hover {
    background: #f1f5f9 !important;
    background-color: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
}

body.theme-v2 .ui-jqdialog #eData .ui-icon,
.ui-jqdialog #eData .ui-icon {
    display: none !important;
}

/* Ocultar iconos de tijeras/cancelar residuales de jQuery UI dentro del contenido */
body.theme-v2 .ui-jqdialog .DelTable .ui-icon,
.ui-jqdialog .DelTable .ui-icon {
    display: none !important;
}

/* ==========================================================================
   ALERTAS Y MENSAJES DE VALIDACIÓN SIEMPRE AL FRENTE (Z-INDEX)
   ========================================================================== */
/* pNotify notificaciones flotantes */
.ui-pnotify,
.ui-pnotify-modal,
div.ui-pnotify {
    z-index: 109999 !important;
}

/* jAlert popups de confirmación y error */
#popup_container {
    z-index: 109999 !important;
    border: 3px solid #2563eb !important;
    border-radius: 8px !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25) !important;
}

#popup_overlay {
    z-index: 109990 !important;
}

/* Diálogo de alertas nativo del sistema (MyAlert -> wndDialogo) */
.ui-dialog:has(#wndDialogo),
div.ui-dialog.dialog-alerta-top {
    z-index: 109995 !important;
}

/* Mensajes de validación de campos obligatorios en formularios */
label.error,
.errors,
.zend_form .errors,
form .error {
    color: #ef4444 !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    margin-top: 4px !important;
    display: block !important;
    position: relative !important;
    z-index: 1060 !important;
}

/* ==========================================================================
   DIÁLOGOS CON IFRAME (Items en Cotizaciones, Pedidos, Salidas, L.Precios, etc.)
   ========================================================================== */
.ui-dialog.dialog-con-iframe:not([style*="display: none"]),
.ui-dialog:has(#wndHijoIframeCustom):not([style*="display: none"]),
.ui-dialog:has(#wndHijoIframe):not([style*="display: none"]),
.ui-dialog:not(.gm-responsive-dialog):has(> .ui-dialog-content > iframe):not([style*="display: none"]) {
    width: 96vw !important;
    max-width: 1440px !important;
    height: calc(100vh - 40px) !important;
    max-height: calc(100vh - 40px) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    top: 20px !important;
    position: fixed !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    border-radius: 12px !important;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.08) !important;
    z-index: 1050 !important;
    overflow: hidden !important;
}

.ui-dialog:has(#wndHijoIframeCustom) .ui-dialog-content,
.ui-dialog:has(#wndHijoIframe) .ui-dialog-content,
.ui-dialog.dialog-con-iframe .ui-dialog-content,
.ui-dialog:not(.gm-responsive-dialog):has(> .ui-dialog-content > iframe) > .ui-dialog-content,
#wndHijoIframeCustom,
#wndHijoIframe {
    height: calc(100vh - 145px) !important;
    min-height: calc(100vh - 145px) !important;
    max-height: none !important;
    padding: 0 !important;
    overflow: hidden !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.ui-dialog:has(#wndHijoIframeCustom) > .ui-dialog-content > iframe,
.ui-dialog:has(#wndHijoIframe) > .ui-dialog-content > iframe,
.ui-dialog.dialog-con-iframe > .ui-dialog-content > iframe,
.ui-dialog:not(.gm-responsive-dialog) > .ui-dialog-content > iframe {
    width: 100% !important;
    height: 100% !important;
    min-height: calc(100vh - 145px) !important;
    display: block !important;
    border: none !important;
}

/* Soporte para el layout main_limpio dentro de los iframes */
body.main-limpio-v2 {
    background-color: #f8fafc !important;
    background-image: none !important;
    padding: 12px 18px !important;
    margin: 0 !important;
    overflow-x: hidden !important;
}

body.main-limpio-v2 #wrapper,
body.main-limpio-v2 #contentlimpio {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    background: transparent !important;
}

body.main-limpio-v2 #divLista {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

body.main-limpio-v2 .ui-jqgrid {
    width: 100% !important;
    max-width: 100% !important;
}

/* Tarjeta moderna para los datos del documento padre en vistas hijas (Salidas, Cotizaciones, etc.) */
body.main-limpio-v2 #divObjPadre {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 14px !important;
    box-sizing: border-box !important;
}

body.main-limpio-v2 #divObjPadre .container {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 10px 24px !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    padding: 12px 18px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    box-sizing: border-box !important;
}

body.main-limpio-v2 #divObjPadre .row {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 0 !important;
}

body.main-limpio-v2 #divObjPadre .cell {
    display: inline-block !important;
    width: auto !important;
    border: none !important;
    padding: 2px 4px !important;
    font-size: 0.9rem !important;
    color: #1e293b !important;
    background: transparent !important;
}

body.main-limpio-v2 #divObjPadre .cell:first-child {
    font-weight: 700 !important;
    color: #64748b !important;
    text-transform: uppercase !important;
    font-size: 0.78rem !important;
    letter-spacing: 0.5px !important;
}

/* ==========================================================================
   PANTALLA DE LOGIN MODERNA, PROFESIONAL Y FRESCA (V2)
   ========================================================================== */
.v2-login-page {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    position: relative;
    overflow: hidden;
    padding: 24px 16px;
    box-sizing: border-box;
}

.v2-login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.18) 0%, rgba(37, 99, 235, 0) 70%);
    top: -150px;
    right: -100px;
    border-radius: 50%;
    pointer-events: none;
}

.v2-login-page::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.15) 0%, rgba(14, 165, 233, 0) 70%);
    bottom: -150px;
    left: -100px;
    border-radius: 50%;
    pointer-events: none;
}

.v2-login-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1);
    padding: 36px 32px;
    box-sizing: border-box;
    transition: transform 0.3s ease;
}

.v2-login-header {
    text-align: center;
    margin-bottom: 28px;
}

.v2-login-logo {
    max-width: 140px;
    max-height: 85px;
    object-fit: contain;
    margin-bottom: 14px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.06));
}

.v2-login-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px 0;
    letter-spacing: -0.3px;
}

.v2-login-subtitle {
    font-size: 0.88rem;
    color: #64748b;
    margin: 0;
}

.v2-login-form .form-group {
    margin-bottom: 20px;
    position: relative;
}

.v2-login-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 7px;
}

.v2-login-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.v2-login-input-wrapper .material-icons.input-icon {
    position: absolute;
    left: 14px;
    color: #94a3b8;
    font-size: 20px;
    pointer-events: none;
    transition: color 0.2s ease;
}

.v2-login-input {
    width: 100% !important;
    height: 46px !important;
    padding: 10px 14px 10px 44px !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 10px !important;
    font-size: 0.95rem !important;
    color: #0f172a !important;
    background-color: #f8fafc !important;
    box-sizing: border-box !important;
    transition: all 0.2s ease !important;
}

.v2-login-input:focus {
    background-color: #ffffff !important;
    border-color: #2563eb !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12) !important;
    outline: none !important;
}

.v2-login-input-wrapper:focus-within .input-icon {
    color: #2563eb;
}

.v2-login-btn-toggle-pass {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.15s ease;
}

.v2-login-btn-toggle-pass:hover {
    color: #0f172a;
}

.v2-login-btn-submit {
    width: 100% !important;
    height: 48px !important;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.2px !important;
    cursor: pointer !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    transition: all 0.2s ease !important;
    margin-top: 26px !important;
    text-shadow: none !important;
}

.v2-login-btn-submit:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%) !important;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.45) !important;
    transform: translateY(-1px);
}

.v2-login-btn-submit:active {
    transform: translateY(0);
}

.v2-login-alert {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 20px;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.v2-login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.8rem;
    color: #94a3b8;
}
    background: #ffffff !important;
}

body.main-limpio-v2 #divLista {
    width: 100% !important;
    max-width: 100% !important;
}

body.main-limpio-v2 .ui-jqgrid {
    width: 100% !important;
    max-width: 100% !important;
}

/* ==========================================================================
   BOTTOM NAVIGATION BAR PARA MÓVILES (< 768px)
   ========================================================================== */
.v2-bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--v2-bottom-nav-height);
    background-color: #ffffff;
    border-top: 1px solid #e2e8f0;
    z-index: 1030;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
    justify-content: space-around;
    align-items: center;
    padding: 0 4px;
}

.v2-bottom-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    color: #64748b;
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 500;
    gap: 3px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s ease;
}

.v2-bottom-item:hover,
.v2-bottom-item.active {
    color: var(--v2-primary);
    text-decoration: none;
}

.v2-bottom-item .material-icons {
    font-size: 22px;
}

/* ==========================================================================
   OVERLAY PARA MÓVIL
   ========================================================================== */
.v2-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1035;
    opacity: 0;
    transition: opacity 0.25s ease;
}

/* ==========================================================================
   RESPONSIVE DESIGN (TABLETS Y MÓVILES)
   ========================================================================== */
@media (max-width: 991.98px) {
    .v2-sidebar {
        left: calc(-1 * var(--v2-sidebar-width));
        width: var(--v2-sidebar-width) !important;
    }

    .v2-header {
        left: 0 !important;
        padding: 0 14px;
    }

    .v2-main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    body.sidebar-mobile-open .v2-sidebar {
        transform: translateX(var(--v2-sidebar-width));
    }

    body.sidebar-mobile-open .v2-sidebar-overlay {
        display: block;
        opacity: 1;
    }

    .v2-header-title {
        font-size: 0.95rem;
    }
}

@media (max-width: 767.98px) {
    .v2-bottom-bar {
        display: flex;
    }

    .v2-main-content {
        padding-bottom: calc(var(--v2-bottom-nav-height) + 15px);
    }

    .v2-content-body {
        padding: 12px 10px;
    }

    .v2-header-title {
        max-width: 160px;
    }

    .v2-btn-switch-version span {
        display: none;
    }

    .v2-user-badge span {
        display: none;
    }

    body.sidebar-hidden .v2-header-logo {
        height: 26px;
        max-width: 72px;
    }

    body.sidebar-hidden .v2-header-title {
        max-width: 120px;
    }

    .v2-header-action-home {
        padding: 6px 9px;
    }
}

/* ==========================================================================
   TPV - VENTAS CONTROLES DE BÚSQUEDA Y CANASTA DE PRODUCTOS
   ========================================================================== */
#divDependencia {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-top: 4px !important;
    margin-bottom: 6px !important;
    box-sizing: border-box !important;
}

.tpv-top-filters {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

.tpv-search-bar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 12px !important;
    margin-top: 6px !important;
    margin-bottom: 8px !important;
    box-sizing: border-box !important;
}

.tpv-inputs-group {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: nowrap !important; /* Garantiza todo en la misma línea */
}

.tpv-inputs-group input[type="search"],
.tpv-inputs-group input[type="text"] {
    height: 34px !important;
    padding: 4px 10px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    font-size: 0.9rem !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
    outline: none !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.tpv-inputs-group input#txtBusqueda {
    width: 220px !important;
}

.tpv-inputs-group input#txtBusquedaCodigo {
    width: 130px !important;
}

.tpv-inputs-group input#txtBusquedaSerie {
    width: 140px !important;
}

.tpv-inputs-group input:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

.tpv-inputs-group #myButtonBuscar {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 34px !important;
    padding: 0 !important;
    border-radius: 6px !important;
    background: #2563eb !important;
    color: #ffffff !important;
    border: none !important;
    text-decoration: none !important;
    cursor: pointer !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    transition: background 0.15s ease !important;
}

.tpv-inputs-group #myButtonBuscar:hover {
    background: #1d4ed8 !important;
}

.tpv-inputs-group #myButtonBuscar .glyphicon {
    font-size: 14px !important;
    top: 0 !important;
}

/* Acciones a la extrema derecha */
.tpv-actions-group {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    margin-left: auto !important; /* Empuja todo al límite derecho */
}

#btnDespacharTodo,
.tpv-actions-group #btnDespacharTodo {
    display: inline-flex !important;
    align-items: center !important;
    height: 34px !important;
    padding: 0 16px !important;
    background: #f0fdf4 !important;
    color: #15803d !important;
    border: 1px solid #bbf7d0 !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 0.88rem !important;
    text-decoration: none !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    transition: all 0.15s ease !important;
}

#btnDespacharTodo:hover,
.tpv-actions-group #btnDespacharTodo:hover {
    background: #dcfce7 !important;
    border-color: #86efac !important;
    color: #166534 !important;
}

.tpv-btn-carrito {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    height: 34px !important;
    padding: 0 14px !important;
    background: #ffffff !important;
    color: #2563eb !important;
    border: 1px solid #bfdbfe !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    text-decoration: none !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    position: relative !important;
    transition: all 0.15s ease !important;
}

.tpv-btn-carrito:hover {
    background: #eff6ff !important;
    border-color: #93c5fd !important;
    color: #1d4ed8 !important;
}

.tpv-btn-carrito #canasta {
    font-size: 20px !important;
    color: inherit !important;
    vertical-align: middle !important;
    margin: 0 !important;
}

.tpv-btn-carrito #totalItems {
    position: static !important;
    margin: 0 0 0 4px !important;
    background-color: #ef4444 !important;
    color: #ffffff !important;
    font-size: 0.75rem !important;
    padding: 2px 7px !important;
    border-radius: 10px !important;
}

/* Modal Canasta de Productos (Ancho amplio y centrado simétricamente) */
.ui-dialog:has(#divCanasta) {
    max-width: 1400px !important;
    border-radius: 14px !important;
    z-index: 1050 !important;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.1) !important;
}

#divCanasta {
    background-color: #ffffff !important;
    text-align: left !important;
    padding: 14px 18px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    overflow-y: hidden !important;
    overflow-x: hidden !important;
}

#divCanasta #divBotonera {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    margin-bottom: 12px !important;
    padding: 8px 12px !important;
    background: #f8fafc !important;
    border-radius: 8px !important;
    border: 1px solid #e2e8f0 !important;
}

#divCanasta .titulo {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    margin-bottom: 10px !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: transparent !important;
    padding: 0 !important;
}

/* Control de Scroll y Footer en Grilla de Canasta de Ventas */
#gbox_listVenta {
    border-radius: 8px !important;
    overflow: hidden !important;
}

#gbox_listVenta .ui-jqgrid-bdiv {
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

#gbox_listVenta .ui-jqgrid-sdiv {
    display: block !important;
    visibility: visible !important;
    background-color: #f8fafc !important;
    border-top: 2px solid #cbd5e1 !important;
    font-weight: 700 !important;
}

#gbox_listVenta .ui-jqgrid-sdiv td {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    font-size: 0.92rem !important;
    color: #1e293b !important;
}

/* ==========================================================================
   PANEL DE INICIO V2 (MODERNA PRO) - BOTONES DE MENÚ (ESTILO ZFAPPSAC)
   ========================================================================== */
.v2-dashboard-wrapper {
    padding: 0 12px 48px 12px;
    margin-top: -8px;
    max-width: 1440px;
    margin-inline: auto;
}

/* Header de Bienvenida y Buscador */
.v2-dashboard-header {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 14px 20px;
    margin-bottom: 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
}

.v2-dashboard-title-area {
    display: flex;
    align-items: center;
    gap: 14px;
}

.v2-dashboard-logo-badge {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.1);
    flex-shrink: 0;
}

.v2-dashboard-logo-badge .material-icons {
    font-size: 26px;
}

.v2-dashboard-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.v2-dashboard-subtitle {
    margin: 3px 0 0 0;
    font-size: 0.85rem;
    color: #64748b;
}

/* Buscador Rápido */
.v2-dashboard-search-box {
    position: relative;
    width: 320px;
    max-width: 100%;
}

.v2-dashboard-search-box .material-icons {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 20px;
    pointer-events: none;
}

.v2-dashboard-search-input {
    width: 100%;
    height: 42px;
    padding: 0 36px 0 40px;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    font-size: 0.9rem;
    color: #1e293b;
    background-color: #f8fafc;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

.v2-dashboard-search-input:focus {
    border-color: #2563eb;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.v2-dashboard-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    display: none;
    line-height: 1;
}

.v2-dashboard-search-clear:hover {
    color: #334155;
}

/* Pills de Categorías */
.v2-dashboard-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.v2-dashboard-pill {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    user-select: none;
}

.v2-dashboard-pill:hover,
.v2-dashboard-pill.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.v2-dashboard-pill .pill-badge {
    background: rgba(0, 0, 0, 0.08);
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 0.74rem;
}

.v2-dashboard-pill.active .pill-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* Secciones de Categorías */
.v2-dashboard-section {
    margin-bottom: 26px;
}

.v2-dashboard-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1.5px solid #e2e8f0;
}

.v2-dashboard-section-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.v2-dashboard-section-icon .material-icons {
    font-size: 18px;
}

.v2-dashboard-section-title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.v2-dashboard-section-count {
    margin-left: auto;
    font-size: 0.76rem;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 12px;
}

/* Grid de Botones */
.v2-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

/* Tarjeta Botón Moderna Pro (hover-card-modern) */
.hover-card-modern {
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    border-radius: 14px !important;
}

.hover-card-modern:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px -4px rgba(15, 23, 42, 0.12), 0 4px 6px -2px rgba(15, 23, 42, 0.05) !important;
    border-color: #cbd5e1 !important;
}

.hover-card-modern:active {
    transform: translateY(-2px);
}

.v2-dashboard-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px 12px 16px 12px;
    text-decoration: none !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 142px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
    cursor: pointer;
}

/* Contenedor del Icono en la Tarjeta */
.v2-dashboard-icon-wrap {
    width: 68px;
    height: 68px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.v2-dashboard-card:hover .v2-dashboard-icon-wrap {
    transform: scale(1.08);
}

.v2-dashboard-icon-wrap .material-icons {
    font-size: 32px;
}

/* Título de la Opción */
.v2-dashboard-card-title {
    font-size: 0.90rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.25;
    margin: 0;
    transition: color 0.2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;
}

.v2-dashboard-card:hover .v2-dashboard-card-title {
    color: #2563eb;
}

/* Estado Vacío de Búsqueda */
.v2-dashboard-empty {
    background: #ffffff;
    border: 1.5px dashed #cbd5e1;
    border-radius: 16px;
    padding: 44px 20px;
    text-align: center;
    margin: 20px 0;
}

.v2-dashboard-empty-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.v2-dashboard-empty-icon .material-icons {
    font-size: 30px;
}

.v2-dashboard-empty h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 6px 0;
}

.v2-dashboard-empty p {
    color: #64748b;
    font-size: 0.88rem;
    margin: 0 0 14px 0;
}

/* Adaptabilidad Mobile First */
@media (max-width: 767px) {
    .v2-dashboard-wrapper {
        padding: 0 0 60px 0;
        margin-top: -10px;
        margin-inline: -14px;
    }

    .v2-dashboard-header {
        padding: 10px 12px;
        border-radius: 12px;
        margin-bottom: 14px;
        flex-wrap: nowrap;
        gap: 10px;
    }

    .v2-dashboard-title-area {
        gap: 0;
        flex-shrink: 0;
    }

    .v2-dashboard-title-area > div:not(.v2-dashboard-logo-badge) {
        display: none;
    }

    .v2-dashboard-logo-badge {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .v2-dashboard-logo-badge .material-icons {
        font-size: 22px;
    }

    .v2-dashboard-search-box {
        flex: 1 1 auto;
        min-inline-size: 0;
        width: auto;
    }

    .v2-dashboard-search-input {
        height: 40px;
    }
    
    .v2-dashboard-pills {
        margin-bottom: 16px;
        gap: 6px;
    }
    
    .v2-dashboard-pill {
        padding: 5px 10px;
        font-size: 0.78rem;
    }
    
    .v2-dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .v2-dashboard-card {
        min-height: 124px;
        padding: 14px 8px 12px 8px;
        border-radius: 12px;
    }
    
    .v2-dashboard-icon-wrap {
        width: 56px;
        height: 56px;
        border-radius: 14px;
        margin-bottom: 8px;
    }
    
    .v2-dashboard-icon-wrap .material-icons {
        font-size: 26px;
    }
    
    .v2-dashboard-card-title {
        font-size: 0.80rem;
    }
}

