/* css/speas-ui.css */
/* Finanzas scoped dark-theme readability override v3.3.22 */

/* Speas proveedores provider modal and cards final v3.3.34 */
body.speas-app.module-proveedores-active #modal-proveedor .btn-close,
body.speas-app.module-proveedores-active #modal-acceso-b2b .btn-close,
body.speas-app.module-proveedores-active #modal-confirmar-proveedor .btn-close,
body.speas-app.module-proveedores-active #modal-copiar-datos .btn-close {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    border-radius: 13px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

body.speas-app.module-proveedores-active #modal-proveedor .btn-close i,
body.speas-app.module-proveedores-active #modal-acceso-b2b .btn-close i,
body.speas-app.module-proveedores-active #modal-confirmar-proveedor .btn-close i,
body.speas-app.module-proveedores-active #modal-copiar-datos .btn-close i {
    font-size: 22px !important;
    line-height: 1 !important;
}

body.speas-app.module-proveedores-active #tabla-proveedores-body td:nth-child(3) .status-badge {
    background: #e8fff8 !important;
    color: #057a6f !important;
    border: 1px solid #a9f1df !important;
    opacity: 1 !important;
    font-weight: 900 !important;
    letter-spacing: 0 !important;
}

body.speas-app.module-proveedores-active #module-content .table-module-container .btn-icon[title="Exportar Excel"] {
    min-width: 46px !important;
}

@media (min-width: 769px) {
    body.speas-app.module-proveedores-active #modal-proveedor #lista-dir-erp tr {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.15fr) 42px !important;
        align-items: center !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor #lista-dir-erp tr > td:last-child {
        justify-self: end !important;
        width: 42px !important;
    }
}

@media (max-width: 768px) {
    body.speas-app.module-proveedores-active #module-content .table-module-container > .table-toolbar {
        grid-template-columns: minmax(0, 1fr) 46px !important;
        gap: 8px !important;
    }

    body.speas-app.module-proveedores-active #module-content .table-module-container .filter-actions {
        width: 46px !important;
        min-width: 46px !important;
    }

    body.speas-app.module-proveedores-active #module-content .table-module-container .filter-actions .btn-icon {
        width: 46px !important;
        height: 46px !important;
        min-width: 46px !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .btn-close {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor #lista-dir-erp tr {
        grid-template-columns: minmax(0, 1fr) 44px !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor #lista-dir-erp tr > td:last-child {
        grid-column: 2 !important;
        grid-row: 1 !important;
        align-self: start !important;
        justify-self: end !important;
        width: 44px !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor #lista-dir-erp tr > td:not(:last-child) {
        grid-column: 1 / -1 !important;
    }
}

/* Speas proveedores mobile/tablet final polish v3.3.33 */
@media (max-width: 768px) {
    html body.speas-app.module-proveedores-active #module-content .table-module-container {
        width: min(100%, 390px) !important;
        max-width: calc(100vw - 24px) !important;
        margin-inline: auto !important;
    }

    html body.speas-app.module-proveedores-active #module-content .table-module-container > .table-toolbar {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 42px 42px !important;
        gap: 8px !important;
        align-items: center !important;
    }

    html body.speas-app.module-proveedores-active #module-content .table-module-container > .table-toolbar .search-box,
    html body.speas-app.module-proveedores-active #module-content .table-module-container > .table-toolbar .search-box input {
        width: 100% !important;
        min-width: 0 !important;
    }

    html body.speas-app.module-proveedores-active #module-content .table-module-container > .table-responsive {
        overflow: visible !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    html body.speas-app.module-proveedores-active #module-content .table-module-container > .table-responsive > table.premium-table,
    html body.speas-app.module-proveedores-active #module-content .table-module-container > .table-responsive > table.premium-table tbody,
    html body.speas-app.module-proveedores-active #module-content .table-module-container > .table-responsive > table.premium-table tr,
    html body.speas-app.module-proveedores-active #module-content .table-module-container > .table-responsive > table.premium-table td {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    html body.speas-app.module-proveedores-active #module-content .table-module-container > .table-responsive > table.premium-table thead {
        display: none !important;
    }

    html body.speas-app.module-proveedores-active #module-content .table-module-container > .table-responsive > table.premium-table tbody#tabla-proveedores-body {
        display: grid !important;
        gap: 12px !important;
    }

    html body.speas-app.module-proveedores-active #module-content .table-module-container > .table-responsive > table.premium-table tbody#tabla-proveedores-body > tr {
        padding: 14px !important;
        border-radius: 18px !important;
        background: #ffffff !important;
        color: #172033 !important;
        border: 1px solid #dbe7f5 !important;
        box-shadow: 0 16px 34px rgba(15, 23, 42, 0.07) !important;
        overflow: hidden !important;
    }

    html body.speas-app.module-proveedores-active #module-content .table-module-container > .table-responsive > table.premium-table tbody#tabla-proveedores-body > tr > td {
        display: grid !important;
        grid-template-columns: 92px minmax(0, 1fr) !important;
        gap: 8px !important;
        align-items: center !important;
        padding: 8px 0 !important;
        border: 0 !important;
        border-bottom: 1px solid #edf3fb !important;
        background: transparent !important;
        color: #172033 !important;
        font-size: 12px !important;
        line-height: 1.25 !important;
        text-align: left !important;
        overflow: hidden !important;
    }

    html body.speas-app.module-proveedores-active #module-content .table-module-container > .table-responsive > table.premium-table tbody#tabla-proveedores-body > tr > td,
    html body.speas-app.module-proveedores-active #module-content .table-module-container > .table-responsive > table.premium-table tbody#tabla-proveedores-body > tr > td * {
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
        white-space: normal !important;
    }

    html body.speas-app.module-proveedores-active #module-content .table-module-container > .table-responsive > table.premium-table tbody#tabla-proveedores-body > tr > td:last-child {
        display: block !important;
        border-bottom: 0 !important;
    }

    html body.speas-app.module-proveedores-active #module-content .table-module-container > .table-responsive > table.premium-table tbody#tabla-proveedores-body > tr > td::before {
        display: block !important;
        color: #64748b !important;
        font-size: 10px !important;
        font-weight: 900 !important;
        line-height: 1.2 !important;
        text-transform: uppercase !important;
    }

    html body.speas-app.module-proveedores-active #modal-proveedor tbody#lista-tel-erp tr,
    html body.speas-app.module-proveedores-active #modal-proveedor tbody#lista-correo-erp tr {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 44px !important;
        gap: 10px !important;
        align-items: start !important;
        padding: 12px !important;
        border-radius: 16px !important;
        background: #f8fbff !important;
        border: 1px solid #dbe7f5 !important;
    }

    html body.speas-app.module-proveedores-active #modal-proveedor tbody#lista-tel-erp tr > td,
    html body.speas-app.module-proveedores-active #modal-proveedor tbody#lista-correo-erp tr > td {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
    }

    html body.speas-app.module-proveedores-active #modal-proveedor tbody#lista-tel-erp tr > td:last-child,
    html body.speas-app.module-proveedores-active #modal-proveedor tbody#lista-correo-erp tr > td:last-child {
        grid-column: 2 !important;
        grid-row: 1 !important;
        justify-self: end !important;
    }

    html body.speas-app.module-proveedores-active #modal-proveedor tbody#lista-tel-erp .erp-principal-cell,
    html body.speas-app.module-proveedores-active #modal-proveedor tbody#lista-correo-erp .erp-principal-cell {
        grid-column: 1 / -1 !important;
    }

    html body.speas-app.module-proveedores-active #modal-proveedor .erp-principal-check {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        min-height: 42px !important;
        padding: 9px 12px !important;
        border-radius: 12px !important;
        border: 1px solid #d2dfef !important;
        background: #ffffff !important;
        color: #334155 !important;
        font-size: 12px !important;
        font-weight: 800 !important;
    }

    html body.speas-app.module-proveedores-active #modal-proveedor .erp-principal-check input[type="checkbox"] {
        order: 2 !important;
        width: 20px !important;
        height: 20px !important;
        margin: 0 !important;
        accent-color: #2563eb !important;
    }
}

@media (min-width: 769px) and (max-width: 1180px) {
    html body.speas-app.module-proveedores-active #modal-proveedor tbody#lista-tel-erp tr {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) 130px 42px !important;
        gap: 12px !important;
        align-items: center !important;
    }

    html body.speas-app.module-proveedores-active #modal-proveedor tbody#lista-correo-erp tr {
        display: grid !important;
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr) 130px 42px !important;
        gap: 12px !important;
        align-items: center !important;
    }

    html body.speas-app.module-proveedores-active #modal-proveedor .erp-principal-check {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        width: 100% !important;
        min-height: 40px !important;
        padding: 8px 10px !important;
        border-radius: 12px !important;
        border: 1px solid #d2dfef !important;
        background: #ffffff !important;
        color: #334155 !important;
        font-size: 12px !important;
        font-weight: 800 !important;
    }
}

/* Themed notifications final priority v3.3.24 */

/* Themed notifications and toasts v3.3.24 */
body.speas-app {
    --speas-toast-success: #16a34a;
    --speas-toast-success-soft: #ecfdf5;
    --speas-toast-warning: #d97706;
    --speas-toast-warning-soft: #fffbeb;
    --speas-toast-error: #dc2626;
    --speas-toast-error-soft: #fef2f2;
    --speas-toast-info: #2563eb;
    --speas-toast-info-soft: #eff6ff;
}

body.speas-app .mini-notif,
body.speas-app .toast {
    border: 1px solid var(--speas-border, #d8e1ee) !important;
    border-left: 5px solid var(--speas-toast-info) !important;
    background: var(--speas-surface, #ffffff) !important;
    color: var(--speas-text, #111827) !important;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16) !important;
}

body.speas-app .mini-notif {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    min-height: 62px;
    min-width: 220px;
    max-width: min(360px, calc(100vw - 32px));
    padding: 14px 18px;
    border-radius: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: speasToastIn 0.25s ease forwards;
}

body.speas-app .mini-notif.is-leaving {
    animation: speasToastOut 0.25s ease forwards;
}

body.speas-app .mini-notif i {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px !important;
    flex: 0 0 auto;
}

body.speas-app .toast-title {
    color: var(--speas-text, #111827) !important;
}

body.speas-app .toast-msg {
    color: var(--speas-muted, #64748b) !important;
}

body.speas-app .mini-notif.success,
body.speas-app .toast.success {
    border-left-color: var(--speas-toast-success) !important;
    background: linear-gradient(135deg, var(--speas-toast-success-soft), var(--speas-surface, #ffffff)) !important;
}

body.speas-app .mini-notif.warning,
body.speas-app .toast.warning {
    border-left-color: var(--speas-toast-warning) !important;
    background: linear-gradient(135deg, var(--speas-toast-warning-soft), var(--speas-surface, #ffffff)) !important;
}

body.speas-app .mini-notif.error,
body.speas-app .toast.error {
    border-left-color: var(--speas-toast-error) !important;
    background: linear-gradient(135deg, var(--speas-toast-error-soft), var(--speas-surface, #ffffff)) !important;
}

body.speas-app .mini-notif.info,
body.speas-app .toast.info {
    border-left-color: var(--speas-toast-info) !important;
    background: linear-gradient(135deg, var(--speas-toast-info-soft), var(--speas-surface, #ffffff)) !important;
}

body.speas-app .mini-notif.success i,
body.speas-app .toast.success i {
    color: var(--speas-toast-success) !important;
    background: var(--speas-toast-success-soft);
}

body.speas-app .mini-notif.warning i,
body.speas-app .toast.warning i {
    color: var(--speas-toast-warning) !important;
    background: var(--speas-toast-warning-soft);
}

body.speas-app .mini-notif.error i,
body.speas-app .toast.error i {
    color: var(--speas-toast-error) !important;
    background: var(--speas-toast-error-soft);
}

body.speas-app .mini-notif.info i,
body.speas-app .toast.info i {
    color: var(--speas-toast-info) !important;
    background: var(--speas-toast-info-soft);
}

@keyframes speasToastIn {
    from { transform: translateX(110%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes speasToastOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(110%); opacity: 0; }
}

@media (max-width: 640px) {
    body.speas-app .mini-notif,
    body.speas-app #toast-container {
        top: 12px;
        right: 12px;
        left: 12px;
    }

    body.speas-app .mini-notif,
    body.speas-app .toast {
        width: auto;
        min-width: 0;
    }
}

/* Ubicacion: frontend/css/speas-ui.css */

:root {
    --speas-bg: #eceff3;
    --speas-surface: #ffffff;
    --speas-surface-2: #f6f7f9;
    --speas-elevated: #ffffff;
    --speas-sidebar: #f8f9fb;
    --speas-sidebar-2: #ffffff;
    --speas-text: #14171d;
    --speas-muted: #6c7280;
    --speas-border: #d9dee7;
    --speas-border-strong: #bbc2ce;
    --speas-accent: #161a22;
    --speas-accent-2: #5d6673;
    --speas-danger: #dc2626;
    --speas-success: #16a34a;
    --speas-warning: #d97706;
    --speas-radius: 14px;
    --speas-radius-sm: 10px;
    --speas-shadow: 0 14px 40px rgba(15, 23, 42, 0.10);
    --speas-shadow-sm: 0 6px 18px rgba(15, 23, 42, 0.08);
    --speas-input-h: 38px;
    --speas-topbar-h: 58px;
    --speas-font: Inter, "Segoe UI", Arial, sans-serif;
}

* {
    letter-spacing: 0;
}

body.speas-app {
    background:
        radial-gradient(circle at 24% 12%, rgba(255, 255, 255, 0.88), transparent 30%),
        linear-gradient(180deg, var(--speas-bg), color-mix(in srgb, var(--speas-bg) 88%, var(--speas-surface-2)));
    color: var(--speas-text);
    font-family: var(--speas-font);
}

body.speas-app .home,
body.speas-app .contenedor-modulo {
    background: var(--speas-bg);
    color: var(--speas-text);
}

body.speas-app .home {
    padding: 16px 22px 22px;
    overflow-y: auto;
    transition: left 0.22s ease, width 0.22s ease;
}

body.speas-app .header-text {
    min-height: var(--speas-topbar-h);
    margin-bottom: 12px;
    padding: 0 12px 0 16px;
    border: 1px solid color-mix(in srgb, var(--speas-border) 82%, transparent);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 18px 42px rgba(17, 24, 39, 0.08);
    backdrop-filter: blur(18px);
}

body.speas-app .home .text,
body.speas-app #titulo-modulo {
    color: var(--speas-text);
    font-size: 22px;
    font-weight: 700;
}

body.speas-app .sidebar {
    background:
        radial-gradient(circle at 34% 0%, rgba(255, 255, 255, 0.95), transparent 32%),
        linear-gradient(180deg, var(--speas-sidebar-2) 0%, var(--speas-sidebar) 100%);
    box-shadow: 10px 0 34px rgba(17, 24, 39, 0.08);
    border-right: 1px solid rgba(17, 24, 39, 0.08);
    padding-top: 14px;
    transition: left 0.22s ease, width 0.22s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

@media (prefers-reduced-motion: reduce) {
    body.speas-app .home,
    body.speas-app .sidebar {
        transition: none !important;
    }
}

body.speas-app .sidebar header {
    margin-bottom: 14px;
    padding: 0 12px 0 10px;
}

body.speas-app .sidebar .image-text {
    min-height: 54px;
}

body.speas-app .bottom-content {
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.025), transparent);
    border-top-color: rgba(17, 24, 39, 0.08);
    padding-top: 12px;
}

body.speas-app .sidebar li {
    height: 48px;
    margin-top: 5px;
    padding: 0 10px;
}

body.speas-app .sidebar li a {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

body.speas-app .sidebar li a::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0;
    background: linear-gradient(90deg, rgba(17, 24, 39, 0.08), rgba(17, 24, 39, 0.035));
    transition: opacity 0.22s ease;
}

body.speas-app .sidebar li a:hover,
body.speas-app .sidebar li.active a {
    background: #151922;
    box-shadow: 0 14px 28px rgba(17, 24, 39, 0.14);
}

body.speas-app .sidebar li a:hover::before,
body.speas-app .sidebar li.active a::before {
    opacity: 1;
}

body.speas-app .sidebar li a:hover .icon,
body.speas-app .sidebar li a:hover .text,
body.speas-app .sidebar li.active .icon,
body.speas-app .sidebar li.active .text {
    color: #ffffff;
}

body.speas-app .sidebar li .icon,
body.speas-app .sidebar li .text {
    color: #626975;
}

body.speas-app .sidebar .text {
    position: relative;
    z-index: 1;
    font-size: 14px;
    font-weight: 680;
}

body.speas-app .sidebar li .icon {
    position: relative;
    z-index: 1;
    font-size: 21px;
    transition: transform 0.22s ease, color 0.22s ease;
}

body.speas-app .sidebar li a:hover .icon,
body.speas-app .sidebar li.active .icon {
    transform: translateX(2px) scale(1.04);
}

body.speas-app .sidebar .image .logo-icon,
body.speas-app .sidebar .toggle {
    color: var(--speas-accent-2);
}

body.speas-app .sidebar .image .logo-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #151922;
    box-shadow: 0 14px 24px rgba(17, 24, 39, 0.18);
    color: #ffffff;
    font-size: 30px;
}

body.speas-app .sidebar .image img.logo-icon {
    display: block;
    object-fit: contain;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: 0 10px 22px rgba(37, 104, 201, 0.20);
}

body.speas-app .image-text .name {
    font-size: 20px;
    font-weight: 820;
    letter-spacing: 0;
    color: #151922;
}

body.speas-app .image-text .profession {
    color: #7a828e;
    font-size: 12px;
}

body.speas-app .sidebar .toggle {
    background: #151922;
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.28);
}

body.speas-app .profile-card,
body.speas-app .logout-box {
    border-radius: 14px;
}

body.speas-app .profile-card {
    background: #ffffff;
    border: 1px solid rgba(17, 24, 39, 0.08);
    box-shadow: 0 14px 28px rgba(17, 24, 39, 0.08);
}

body.speas-app .profile-card:hover {
    background: #f1f3f6;
}

body.speas-app .logout-box:hover {
    background: rgba(17, 24, 39, 0.06);
}

body.speas-app .profile-info .name {
    color: #151922;
}

body.speas-app .profile-info .role,
body.speas-app .logout-box .icon,
body.speas-app .logout-box .text {
    color: #626975;
}

.speas-top-search {
    width: min(340px, 28vw);
    height: 38px;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 10px;
    border: 1px solid var(--speas-border);
    border-radius: 12px;
    background: var(--speas-surface-2);
    color: var(--speas-muted);
}

.speas-top-search i {
    font-size: 18px;
}

.speas-top-search input {
    width: 100%;
    min-height: 0;
    height: 32px;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--speas-text);
    font-size: 13px;
}

.speas-top-search input:focus {
    box-shadow: none;
}

.speas-top-search span {
    flex: 0 0 auto;
    padding: 2px 6px;
    border-radius: 7px;
    background: #ffffff;
    border: 1px solid var(--speas-border);
    color: #8a919d;
    font-size: 11px;
    font-weight: 700;
}

.speas-top-search + .speas-shell-actions {
    margin-left: 0;
}

.speas-shell-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.speas-theme-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 34px;
    padding: 3px;
    border: 1px solid var(--speas-border);
    border-radius: 999px;
    background: color-mix(in srgb, var(--speas-surface) 86%, transparent);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(12px);
}

.speas-theme-btn {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--speas-muted);
    background: transparent;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.speas-theme-btn:hover {
    transform: translateY(-1px);
    color: var(--speas-text);
}

.speas-theme-btn.active {
    color: #ffffff;
    background: var(--speas-accent);
}

body.speas-app .mobile-toggle {
    color: var(--speas-text);
}

body.speas-app .contenedor-modulo > h1,
body.speas-app .contenedor-modulo > p {
    margin-left: 2px;
}

body.speas-app .module-header,
body.speas-app .page-header,
body.speas-app .header-section,
body.speas-app .card,
body.speas-app .kpi-card,
body.speas-app .panel,
body.speas-app .table-container,
body.speas-app .filters-card,
body.speas-app .summary-card,
body.speas-app .analytics-container,
body.speas-app .facturas-container,
body.speas-app .inventory-container,
body.speas-app .crm-container {
    background: var(--speas-surface);
    color: var(--speas-text);
    border-color: var(--speas-border);
    border-radius: var(--speas-radius);
    box-shadow: var(--speas-shadow-sm);
}

body.speas-app table {
    border-collapse: collapse;
    color: var(--speas-text);
}

body.speas-app th {
    background: var(--speas-surface-2);
    color: var(--speas-muted);
    font-size: 12px;
    font-weight: 700;
    height: 42px;
}

body.speas-app td {
    color: var(--speas-text);
    font-size: 13px;
    border-color: var(--speas-border);
}

body.speas-app input,
body.speas-app select,
body.speas-app textarea {
    min-height: var(--speas-input-h);
    border-radius: var(--speas-radius-sm);
    border-color: var(--speas-border);
    background: var(--speas-surface);
    color: var(--speas-text);
}

body.speas-app input:focus,
body.speas-app select:focus,
body.speas-app textarea:focus {
    outline: none;
    border-color: var(--speas-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--speas-accent) 18%, transparent);
}

body.speas-app button,
body.speas-app .btn,
body.speas-app .btn-primary,
body.speas-app .btn-secondary {
    border-radius: var(--speas-radius-sm);
}


.speas-loader-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--speas-bg) 72%, rgba(var(--speas-accent-rgb), 0.28));
    backdrop-filter: blur(14px) saturate(1.25);
}

.speas-loader-overlay.active { display: flex; }

.speas-loader-panel {
    width: min(380px, calc(100vw - 32px));
    min-height: auto;
    padding: 28px;
    display: grid;
    grid-template-rows: none;
    gap: 18px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--speas-border);
    border-radius: 20px;
    background: var(--speas-surface);
    color: var(--speas-text);
    box-shadow: var(--speas-shadow);
}

.speas-loader-brand { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.speas-loader-brand .speas-logo-mark {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 14px;
    background: color-mix(in srgb, var(--speas-text) 88%, var(--speas-accent));
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
    opacity: 1;
    visibility: visible;
    text-indent: 0;
    font-size: 24px;
    line-height: 52px;
    text-align: center;
}
.speas-loader-brand .speas-logo-image,
.speas-logo-image {
    display: block;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 14px;
    object-fit: contain;
    box-shadow: 0 12px 24px rgba(37, 104, 201, 0.20);
}
.speas-loader-bars { flex: 1; display: grid; gap: 6px; }
.speas-loader-bars span,
.speas-loader-skeleton span {
    display: block;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--speas-surface-2), color-mix(in srgb, var(--speas-accent) 16%, var(--speas-surface-2)), var(--speas-surface-2));
    background-size: 220% 100%;
    animation: speasShimmer 1.15s ease-in-out infinite;
}
.speas-loader-bars span:nth-child(1) { width: 86%; }
.speas-loader-bars span:nth-child(2) { width: 64%; animation-delay: 0.1s; }
.speas-loader-bars span:nth-child(3) { width: 76%; animation-delay: 0.18s; }
.speas-loader-track { height: 4px; overflow: hidden; border-radius: 999px; background: var(--speas-surface-2); }
.speas-loader-track span {
    display: block;
    width: 44%;
    height: 100%;
    border-radius: inherit;
    background: var(--speas-accent);
    animation: speasProgress 1.05s ease-in-out infinite;
}
.speas-loader-skeleton { display: grid; gap: 8px; margin-top: 2px; }
.speas-loader-skeleton span:nth-child(1) { width: 92%; }
.speas-loader-skeleton span:nth-child(2) { width: 70%; animation-delay: 0.12s; }
.speas-loader-skeleton span:nth-child(3) { width: 82%; animation-delay: 0.22s; }
.speas-loader-copy { padding: 0; text-align: left; }
.speas-loader-title { color: var(--speas-text); font-size: 16px; font-weight: 700; letter-spacing: -0.2px; }
.speas-loader-message { color: var(--speas-muted); font-size: 12.5px; line-height: 1.5; }
@keyframes speasShimmer { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }
@keyframes speasProgress { 0% { transform: translateX(-110%); } 100% { transform: translateX(240%); } }

@media (max-width: 768px) {
    .speas-top-search {
        display: none;
    }

    body.speas-app .home {
        padding: 14px;
    }

    .speas-shell-actions {
        gap: 6px;
    }

    .speas-theme-switch {
        height: 32px;
    }
}

/* Speas enterprise redesign v4 */
:root {
    --speas-bg: #f3f5f8;
    --speas-surface: #ffffff;
    --speas-surface-2: #f7f9fb;
    --speas-elevated: #ffffff;
    --speas-sidebar: #ffffff;
    --speas-sidebar-2: #f8fafc;
    --speas-text: #111827;
    --speas-muted: #667085;
    --speas-border: #dce3ec;
    --speas-border-strong: #b9c3d0;
    --speas-accent: #0f766e;
    --speas-accent-2: #2563eb;
    --speas-danger: #dc2626;
    --speas-success: #059669;
    --speas-warning: #b45309;
    --speas-radius: 8px;
    --speas-radius-sm: 6px;
    --speas-shadow: 0 18px 42px rgba(15, 23, 42, 0.10);
    --speas-shadow-sm: 0 8px 22px rgba(15, 23, 42, 0.07);
    --speas-input-h: 34px;
    --speas-topbar-h: 52px;
}

html {
    font-size: 14px;
}

body.speas-app {
    background: var(--speas-bg);
}

body.speas-app .header-text {
    min-height: var(--speas-topbar-h);
    border-radius: var(--speas-radius);
    background: color-mix(in srgb, var(--speas-surface) 94%, transparent);
    box-shadow: var(--speas-shadow-sm);
}

body.speas-app #titulo-modulo,
body.speas-app .home .text {
    font-size: 18px;
    font-weight: 760;
}

body.speas-app .sidebar {
    background: linear-gradient(180deg, var(--speas-sidebar-2), var(--speas-sidebar));
    border-right: 1px solid var(--speas-border);
    box-shadow: 8px 0 28px rgba(15, 23, 42, 0.06);
}

body.speas-app .sidebar li {
    height: 42px;
    margin-top: 4px;
}

body.speas-app .sidebar li a {
    border-radius: var(--speas-radius-sm);
}

body.speas-app .sidebar li .text {
    font-size: 13px;
    font-weight: 680;
}

body.speas-app .sidebar li .icon {
    font-size: 19px;
}

body.speas-app .sidebar li a:hover,
body.speas-app .sidebar li.active a {
    background: #111827;
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.13);
}

.speas-logo-mark {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: #111827;
    color: #ffffff;
    font-size: 18px;
    font-weight: 850;
    letter-spacing: 0;
    line-height: 1;
    box-shadow: 0 12px 24px rgba(17, 24, 39, 0.18);
    position: relative;
    overflow: hidden;
}

.speas-logo-mark::after {
    content: "";
    position: absolute;
    left: 7px;
    right: 7px;
    top: 8px;
    height: 3px;
    border-radius: 999px;
    background: var(--speas-accent);
}

body.speas-app .sidebar .image .logo-icon {
    background: #111827;
    color: #ffffff;
    font-family: var(--speas-font);
    font-size: 18px;
}

body.speas-app .image-text .name {
    color: var(--speas-text);
    font-size: 18px;
    text-transform: none;
}

body.speas-app .image-text .profession {
    color: var(--speas-muted);
    font-size: 11px;
}

body.speas-app .sidebar .toggle {
    width: 24px;
    height: 24px;
    background: var(--speas-accent);
    box-shadow: 0 8px 18px color-mix(in srgb, var(--speas-accent) 28%, transparent);
}

.speas-top-search {
    height: 34px;
    border-radius: var(--speas-radius-sm);
}

.speas-top-search span {
    border-radius: 5px;
    background: var(--speas-surface);
    color: var(--speas-muted);
}

.speas-theme-switch {
    height: 32px;
    border-radius: var(--speas-radius-sm);
}

.speas-theme-btn {
    width: 26px;
    height: 26px;
    border-radius: 5px;
}

.speas-theme-btn.active {
    background: var(--speas-accent);
}

body.speas-app .contenedor-modulo {
    padding: 0;
}

body.speas-app .contenedor-modulo h1,
body.speas-app .contenedor-modulo h2,
body.speas-app .contenedor-modulo h3 {
    color: var(--speas-text);
    letter-spacing: 0;
}

body.speas-app .contenedor-modulo h1 {
    font-size: 22px;
}

body.speas-app .contenedor-modulo h2 {
    font-size: 18px;
}

body.speas-app .contenedor-modulo h3 {
    font-size: 15px;
}

body.speas-app .module-header,
body.speas-app .page-header,
body.speas-app .header-section,
body.speas-app .card,
body.speas-app .kpi-card,
body.speas-app .panel,
body.speas-app .table-container,
body.speas-app .filters-card,
body.speas-app .summary-card,
body.speas-app .analytics-container,
body.speas-app .facturas-container,
body.speas-app .inventory-container,
body.speas-app .crm-container,
body.speas-app .modal-content,
body.speas-app .modal-box,
body.speas-app .form-container,
body.speas-app .section-card {
    border-radius: var(--speas-radius);
    border: 1px solid var(--speas-border);
    background: var(--speas-surface);
    box-shadow: var(--speas-shadow-sm);
}

body.speas-app table {
    width: 100%;
    background: var(--speas-surface);
}

body.speas-app th {
    height: 36px;
    padding: 8px 10px;
    background: var(--speas-surface-2);
    color: var(--speas-muted);
    border-color: var(--speas-border);
    font-size: 11px;
    text-transform: uppercase;
}

body.speas-app td {
    padding: 8px 10px;
    font-size: 12.5px;
}

body.speas-app tbody tr {
    transition: background 0.16s ease, transform 0.16s ease;
}

body.speas-app tbody tr:hover {
    background: color-mix(in srgb, var(--speas-accent) 7%, var(--speas-surface));
}

body.speas-app input,
body.speas-app select,
body.speas-app textarea {
    min-height: var(--speas-input-h);
    border-radius: var(--speas-radius-sm);
    border: 1px solid var(--speas-border);
    background: var(--speas-surface);
    color: var(--speas-text);
    font-size: 13px;
}

body.speas-app textarea {
    min-height: 82px;
}

body.speas-app button,
body.speas-app .btn,
body.speas-app .btn-primary,
body.speas-app .btn-secondary,
body.speas-app .action-btn {
    min-height: 32px;
    border-radius: var(--speas-radius-sm);
    font-size: 12.5px;
    font-weight: 700;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

body.speas-app button:hover,
body.speas-app .btn:hover,
body.speas-app .action-btn:hover {
    transform: translateY(-1px);
}

body.speas-app .btn-primary,
body.speas-app button[type="submit"] {
    background: var(--speas-accent);
    border-color: var(--speas-accent);
    color: #ffffff;
}

body.speas-app .badge,
body.speas-app .status-badge,
body.speas-app .tag,
body.speas-app .chip {
    border-radius: 5px;
    font-weight: 750;
    letter-spacing: 0;
}

body.speas-app [style*="#6366f1"],
body.speas-app [style*="#4f46e5"],
body.speas-app [style*="#695CFE"],
body.speas-app [style*="#695cfe"] {
    border-color: var(--speas-accent) !important;
}

body.speas-app [style*="color:#6366f1"],
body.speas-app [style*="color: #6366f1"],
body.speas-app [style*="color:#695CFE"],
body.speas-app [style*="color: #695CFE"],
body.speas-app [style*="color:#695cfe"],
body.speas-app [style*="color: #695cfe"],
body.speas-app [style*="color:#4f46e5"],
body.speas-app [style*="color: #4f46e5"] {
    color: var(--speas-accent) !important;
}

body.speas-app [style*="background:#6366f1"],
body.speas-app [style*="background: #6366f1"],
body.speas-app [style*="background:#695CFE"],
body.speas-app [style*="background: #695CFE"],
body.speas-app [style*="background:#695cfe"],
body.speas-app [style*="background: #695cfe"],
body.speas-app [style*="background:#4f46e5"],
body.speas-app [style*="background: #4f46e5"] {
    background: var(--speas-accent) !important;
    color: #ffffff !important;
}

@media (max-width: 768px) {
    html {
        font-size: 13px;
    }

    body.speas-app .home {
        padding: 10px;
    }

    body.speas-app .header-text {
        padding: 0 8px;
    }

    body.speas-app #titulo-modulo {
        font-size: 16px;
    }
}

/* Speas visual polish v5 */
:root {
    --speas-bg: #eef2f6;
    --speas-surface: #ffffff;
    --speas-surface-2: #f8fafc;
    --speas-elevated: #ffffff;
    --speas-sidebar: #ffffff;
    --speas-sidebar-2: #f9fbfd;
    --speas-text: #0f172a;
    --speas-muted: #64748b;
    --speas-border: #d8e0ea;
    --speas-border-strong: #afbccb;
    --speas-accent: #0f766e;
    --speas-accent-2: #1d4ed8;
    --speas-accent-soft: #e6f7f4;
    --speas-danger: #dc2626;
    --speas-success: #059669;
    --speas-warning: #b45309;
    --speas-radius: 10px;
    --speas-radius-sm: 7px;
    --speas-shadow: 0 18px 46px rgba(15, 23, 42, 0.12);
    --speas-shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.08);
    --speas-input-h: 36px;
    --speas-topbar-h: 54px;
}

body.speas-app {
    background:
        linear-gradient(180deg, var(--speas-bg), color-mix(in srgb, var(--speas-bg) 82%, #ffffff));
    font-size: 13px;
}

body.speas-app .home {
    padding: 12px 16px 16px;
}

body.speas-app .header-text {
    min-height: var(--speas-topbar-h);
    padding: 0 10px 0 14px;
    border-radius: var(--speas-radius);
    border: 1px solid var(--speas-border);
    background: color-mix(in srgb, var(--speas-surface) 96%, transparent);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
}

body.speas-app #titulo-modulo,
body.speas-app .home .text {
    font-size: 17px;
    font-weight: 800;
}

body.speas-app .sidebar {
    background: linear-gradient(180deg, var(--speas-sidebar-2), var(--speas-sidebar));
    border-right: 1px solid var(--speas-border);
    box-shadow: 8px 0 30px rgba(15, 23, 42, 0.08);
}

body.speas-app .sidebar li {
    height: 40px;
    margin-top: 3px;
    padding: 0 9px;
}

body.speas-app .sidebar li a {
    border-radius: 8px;
}

body.speas-app .sidebar li .icon {
    font-size: 18px;
}

body.speas-app .sidebar.close:not(:hover):not(.mobile-active) .menu {
    padding: 0 12px 20px !important;
    scrollbar-width: none !important;
}

body.speas-app .sidebar.close:not(:hover):not(.mobile-active) li {
    padding: 0 !important;
    justify-content: center !important;
}

body.speas-app .sidebar.close:not(:hover):not(.mobile-active) li a {
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    margin: 0 auto !important;
    justify-content: center !important;
}

body.speas-app .sidebar.close:not(:hover):not(.mobile-active) li .icon {
    width: 50px !important;
    min-width: 0 !important;
    flex: 0 0 50px !important;
}

body.speas-app .sidebar.close:not(:hover):not(.mobile-active) .menu::-webkit-scrollbar {
    width: 0 !important;
    display: none !important;
}

body.speas-app .sidebar.close:not(:hover):not(.mobile-active) li .text {
    display: none !important;
}

body.speas-app .sidebar li .text {
    font-size: 12.8px;
    font-weight: 720;
}

body.speas-app .sidebar li a:hover,
body.speas-app .sidebar li.active a {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.16);
}

.speas-logo-mark {
    background: linear-gradient(145deg, #0f172a, #172033);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.speas-logo-mark::after {
    background: #5eead4;
}

body.speas-app .profile-card {
    border-radius: 12px;
    background: var(--speas-surface);
    border: 1px solid var(--speas-border);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.speas-top-search {
    width: min(360px, 30vw);
    height: 34px;
    border-radius: 8px;
    background: var(--speas-surface-2);
}

.speas-theme-switch {
    border-radius: 8px;
    background: var(--speas-surface);
}

.speas-theme-btn {
    border-radius: 6px;
}

body.speas-app .module-header,
body.speas-app .page-header,
body.speas-app .header-section,
body.speas-app .card,
body.speas-app .kpi-card,
body.speas-app .panel,
body.speas-app .table-container,
body.speas-app .filters-card,
body.speas-app .summary-card,
body.speas-app .analytics-container,
body.speas-app .facturas-container,
body.speas-app .inventory-container,
body.speas-app .crm-container,
body.speas-app .modal-content,
body.speas-app .modal-box,
body.speas-app .form-container,
body.speas-app .section-card {
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
}

body.speas-app th {
    height: 34px;
    font-size: 11px;
}

body.speas-app td {
    padding: 7px 9px;
    font-size: 12.5px;
}

body.speas-app button,
body.speas-app .btn,
body.speas-app .btn-primary,
body.speas-app .btn-secondary,
body.speas-app .action-btn {
    min-height: 32px;
    border-radius: 7px;
}

@media (min-width: 1600px) {
    body.speas-app .home {
        max-width: 1780px;
        margin: 0 auto;
        width: 100%;
    }
}

/* Speas desktop login composition v10 */

/* Speas wide login composition v11 */

/* Speas dark modules compatibility v12 */

/* Speas dark module residue fixes v13 */

/* Speas POS product cards dark contrast v14 */

/* Speas POS checkout dark contrast v15 */

/* Speas calendar reservation detail dark contrast v16 */

/* Speas despacho web dark contrast v17 */

@media (max-width: 768px) {

    body.speas-app .header-text {
        min-height: 50px;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        padding: 8px 10px;
    }

    body.speas-app .mobile-toggle {
        margin-right: 0;
    }

    body.speas-app .home .header-text > .text {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 18px;
        line-height: 1.2;
    }

    body.speas-app .speas-shell-actions {
        justify-self: end;
        min-width: max-content;
    }

    .speas-theme-switch {
        padding: 2px;
        flex: 0 0 auto;
    }
}

/* Speas dark/module compatibility v7 */

@media (max-width: 768px) {
    body.speas-app .contenedor-modulo {
        padding: 0;
    }

    body.speas-app .table-module-container {
        border-radius: 12px !important;
        padding: 10px !important;
    }

    body.speas-app .module-header {
        gap: 10px !important;
        margin-bottom: 14px !important;
    }

    body.speas-app .header-titles h2 {
        font-size: 20px !important;
        line-height: 1.18 !important;
    }

    body.speas-app .header-titles p {
        font-size: 13px !important;
    }

    body.speas-app .header-actions,
    body.speas-app .table-toolbar,
    body.speas-app .search-box,
    body.speas-app .filter-actions {
        width: 100% !important;
        max-width: none !important;
    }

    body.speas-app .header-actions,
    body.speas-app .filter-actions {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    body.speas-app .table-responsive {
        position: relative;
        border-radius: 10px !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    body.speas-app .premium-table {
        min-width: 760px !important;
    }

    body.speas-app .premium-table th,
    body.speas-app .premium-table td {
        padding: 12px 10px !important;
        font-size: 12px !important;
        white-space: nowrap;
    }
}

/* Speas mobile login polish v8 */

@media (max-width: 768px) {
    body.speas-app .sidebar.mobile-active,
    body.speas-app .sidebar.mobile-active.close {
        width: min(82vw, 300px) !important;
        padding: 14px 10px !important;
        background: var(--speas-sidebar) !important;
        border-right: 1px solid var(--speas-border) !important;
        box-shadow: 18px 0 50px rgba(24, 34, 31, 0.18) !important;
    }

    body.speas-app .sidebar.mobile-active header {
        min-height: 54px;
        padding: 0 6px 12px;
        border-bottom: 1px solid var(--speas-border);
    }

    body.speas-app .sidebar.mobile-active .image-text {
        gap: 10px;
    }

    body.speas-app .sidebar.mobile-active .speas-logo-mark {
        width: 38px;
        height: 38px;
        border-radius: 10px;
        box-shadow: 0 12px 28px rgba(20, 184, 166, 0.20);
    }

    body.speas-app .sidebar.mobile-active .logo-text .name {
        color: var(--speas-text) !important;
        font-size: 18px;
        font-weight: 850;
    }

    body.speas-app .sidebar.mobile-active .logo-text .profession {
        color: var(--speas-muted) !important;
        font-size: 11px;
        letter-spacing: 0.01em;
    }

    body.speas-app .sidebar.mobile-active .menu-links {
        padding: 10px 0 0 !important;
    }

    body.speas-app .sidebar.mobile-active .menu-bar {
        justify-content: flex-start;
    }

    body.speas-app .sidebar.mobile-active .menu {
        min-height: 0;
        flex: 0 1 auto !important;
        padding-bottom: 8px !important;
    }

    body.speas-app .sidebar.mobile-active li {
        height: auto;
        margin: 4px 0;
    }

    body.speas-app .sidebar.mobile-active li a {
        min-height: 42px;
        padding: 0 12px !important;
        border-radius: 8px;
        gap: 12px;
        color: var(--speas-muted);
    }

    body.speas-app .sidebar.mobile-active li .icon {
        width: 34px !important;
        min-width: 34px !important;
        height: 34px;
        color: var(--speas-muted) !important;
        font-size: 19px;
    }

    body.speas-app .sidebar.mobile-active li .text {
        color: var(--speas-muted) !important;
        font-size: 13.5px;
        font-weight: 720;
    }

    body.speas-app .sidebar.mobile-active li a:hover,
    body.speas-app .sidebar.mobile-active li.active a {
        background: var(--speas-accent-soft) !important;
        border: 1px solid color-mix(in srgb, var(--speas-accent) 24%, var(--speas-border));
        box-shadow: inset 3px 0 0 var(--speas-accent);
    }

    body.speas-app .sidebar.mobile-active li a:hover .icon,
    body.speas-app .sidebar.mobile-active li.active .icon,
    body.speas-app .sidebar.mobile-active li a:hover .text,
    body.speas-app .sidebar.mobile-active li.active .text {
        color: var(--speas-accent) !important;
    }

    body.speas-app .sidebar.mobile-active .bottom-content {
        flex: 0 0 auto;
        border-top: 1px solid var(--speas-border);
        padding-top: 10px;
    }

    body.speas-app .sidebar.mobile-active .profile-card {
        margin: 0 0 8px !important;
        padding: 10px !important;
        border-radius: 10px;
        background: var(--speas-surface) !important;
        border: 1px solid var(--speas-border) !important;
    }

    body.speas-app .sidebar.mobile-active .profile-info .name {
        color: var(--speas-text) !important;
        font-weight: 780;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.speas-app .sidebar.mobile-active .profile-info .role {
        color: var(--speas-muted) !important;
    }

    body.speas-app .sidebar.mobile-active .logout-box {
        margin: 0 !important;
    }

    body.speas-app .sidebar.mobile-active .logout-box a {
        min-height: 40px;
        padding: 0 12px !important;
        border-radius: 8px;
    }
}

/* Speas terceros dark contrast v18 */

/* Speas historial modal positioning and mail polish v19 */
body.speas-app #modal-detalle-venta.modal-overlay,
body.speas-app #modal-envio-correo.modal-overlay,
body.speas-app #modal-envio-whatsapp.modal-overlay {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 24px !important;
    z-index: 10020 !important;
}

body.speas-app #modal-detalle-venta.modal-overlay.active,
body.speas-app #modal-envio-correo.modal-overlay.active,
body.speas-app #modal-envio-whatsapp.modal-overlay.active {
    display: flex !important;
}

body.speas-app #modal-detalle-venta .modal-content,
body.speas-app #modal-envio-correo .modal-content,
body.speas-app #modal-envio-whatsapp .modal-content {
    margin: 0 !important;
    transform: none !important;
    width: min(92vw, 560px) !important;
    max-height: min(82dvh, 720px) !important;
    border-radius: 14px !important;
}

body.speas-app #modal-envio-correo .modal-content {
    max-width: 460px !important;
    padding: 0 !important;
    overflow: hidden !important;
}

body.speas-app #modal-envio-correo .modal-header {
    margin: 0 !important;
    padding: 20px 22px !important;
    border-bottom: 1px solid #dbe3ee !important;
}

body.speas-app #modal-envio-correo .modal-header h3 {
    color: #172033 !important;
    font-size: 18px !important;
    font-weight: 850 !important;
}

body.speas-app #modal-envio-correo .modal-header h3 i {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #e6f7f4;
    color: #0f766e;
}

body.speas-app #modal-envio-correo .modal-body {
    padding: 22px !important;
}

body.speas-app #modal-envio-correo .modal-body p {
    margin: 0 0 12px !important;
    color: #64748b !important;
    font-weight: 650;
}

body.speas-app #modal-envio-correo .modal-body > div[style*="position: relative"] {
    margin-bottom: 22px !important;
}

body.speas-app #modal-envio-correo .modal-body input[type="email"] {
    min-height: 48px !important;
    border-radius: 10px !important;
    border: 1px solid #cbd5e1 !important;
    background: #f8fafc !important;
    color: #172033 !important;
    font-size: 15px !important;
}

body.speas-app #modal-envio-correo .modal-body input[type="email"]:focus {
    border-color: #14b8a6 !important;
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.14) !important;
}

body.speas-app #modal-envio-correo .modal-body .btn-secondary,
body.speas-app #modal-envio-correo .modal-body .btn-primary {
    min-height: 42px;
    border-radius: 10px !important;
    padding: 0 18px !important;
    font-weight: 800 !important;
}

@media (max-width: 640px) {
    body.speas-app #modal-detalle-venta.modal-overlay,
    body.speas-app #modal-envio-correo.modal-overlay,
    body.speas-app #modal-envio-whatsapp.modal-overlay {
        padding: 14px !important;
    }

    body.speas-app #modal-envio-correo .modal-body > div:last-child {
        flex-direction: column !important;
    }

    body.speas-app #modal-envio-correo .modal-body .btn-secondary,
    body.speas-app #modal-envio-correo .modal-body .btn-primary {
        width: 100%;
        justify-content: center;
    }
}

/* Speas flujo de caja dark contrast v20 */

/* Speas caja chica dark contrast and modal polish v22 */

/* Speas inventario dark contrast and modal polish v23 */

/* Speas proveedores dark responsive polish v24 */

/* Historial ventas: compact vertical rhythm between header, filters and table. */
body.speas-app .contenedor-modulo > .table-module-container.fade-in:has(#historial-search) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-content: start !important;
    gap: 10px !important;
    row-gap: 10px !important;
    padding: 10px !important;
    background: #ffffff !important;
}

body.speas-app .contenedor-modulo > .table-module-container.fade-in:has(#historial-search) > .module-header,
body.speas-app .contenedor-modulo > .table-module-container.fade-in:has(#historial-search) > .table-toolbar,
body.speas-app .contenedor-modulo > .table-module-container.fade-in:has(#historial-search) > .table-responsive,
body.speas-app .contenedor-modulo > .table-module-container.fade-in:has(#historial-search) > #historial-paginacion {
    margin: 0 !important;
    transform: none !important;
}

body.speas-app .contenedor-modulo > .table-module-container.fade-in:has(#historial-search) > .module-header {
    min-height: 64px !important;
    height: auto !important;
    padding: 12px 18px !important;
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
}

body.speas-app .contenedor-modulo > .table-module-container.fade-in:has(#historial-search) > .module-header .header-titles h2 {
    margin: 0 0 3px !important;
    line-height: 1.15 !important;
}

body.speas-app .contenedor-modulo > .table-module-container.fade-in:has(#historial-search) > .module-header .header-titles p {
    margin: 0 !important;
    line-height: 1.25 !important;
}

body.speas-app .contenedor-modulo > .table-module-container.fade-in:has(#historial-search) > .table-toolbar {
    min-height: 48px !important;
    height: auto !important;
    padding: 5px 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
}

body.speas-app .contenedor-modulo > .table-module-container.fade-in:has(#historial-search) .search-box {
    position: relative !important;
    width: min(100%, 520px) !important;
    max-width: 520px !important;
    height: 38px !important;
    min-height: 38px !important;
}

body.speas-app .contenedor-modulo > .table-module-container.fade-in:has(#historial-search) .search-box i {
    position: absolute !important;
    left: 14px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 20px !important;
    height: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 20px !important;
    line-height: 1 !important;
    pointer-events: none !important;
}

body.speas-app .contenedor-modulo > .table-module-container.fade-in:has(#historial-search) #historial-search {
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 14px 0 46px !important;
    line-height: 38px !important;
}

body.speas-app .contenedor-modulo > .table-module-container.fade-in:has(#historial-search) .refresh-history-btn {
    width: 44px !important;
    min-width: 44px !important;
    height: 38px !important;
    min-height: 38px !important;
}

body.speas-app .contenedor-modulo > .table-module-container.fade-in:has(#historial-search) > .table-responsive {
    margin-top: 0 !important;
}

body.speas-app .contenedor-modulo > .table-module-container.fade-in:has(#historial-search) .premium-table th {
    height: 40px !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}

@media (max-width: 768px) {
    body.speas-app #module-content .table-module-container {
        gap: 14px !important;
    }

    body.speas-app #module-content .table-module-container .module-header {
        padding: 16px !important;
        border-radius: 14px !important;
        align-items: stretch !important;
    }

    body.speas-app #module-content .table-module-container .module-header h2 {
        font-size: 22px !important;
        line-height: 1.15 !important;
    }

    body.speas-app #module-content .table-module-container .module-header p {
        font-size: 14px !important;
        line-height: 1.35 !important;
    }

    body.speas-app #module-content .table-module-container .module-header > div:last-child {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    body.speas-app #module-content .table-module-container .module-header .btn-secondary,
    body.speas-app #module-content .table-module-container .module-header .btn-primary {
        width: 100% !important;
        min-height: 48px !important;
        justify-content: center !important;
        padding: 0 12px !important;
        white-space: normal !important;
        text-align: center !important;
    }

    body.speas-app #module-content .table-module-container .table-toolbar {
        padding: 16px !important;
        border-radius: 14px !important;
        align-items: stretch !important;
    }

    body.speas-app #module-content .table-module-container .filter-actions {
        justify-content: flex-start !important;
    }

    body.speas-app #module-content .table-module-container .table-responsive {
        border-radius: 14px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    body.speas-app #module-content .table-module-container .premium-table {
        min-width: 760px !important;
    }

    body.speas-app #module-content .table-module-container .premium-table th,
    body.speas-app #module-content .table-module-container .premium-table td {
        padding: 14px 16px !important;
        white-space: nowrap !important;
    }

    body.speas-app #module-content .table-module-container .pagination {
        justify-content: space-between !important;
        padding: 12px 4px !important;
    }

    body.speas-app #modal-proveedor.modal-overlay {
        align-items: stretch !important;
        justify-content: flex-end !important;
    }

    body.speas-app #modal-proveedor .modal-content {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
    }

    body.speas-app #modal-proveedor .modal-header {
        padding: 18px 20px !important;
    }

    body.speas-app #modal-proveedor .modal-body {
        padding: 18px 20px 26px !important;
    }

    body.speas-app #modal-proveedor .row-grid {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    body.speas-app #modal-proveedor .premium-table tr {
        display: grid !important;
        grid-template-columns: 1fr 44px !important;
        gap: 10px !important;
        padding: 14px !important;
    }

    body.speas-app #modal-proveedor .premium-table td {
        display: block !important;
        padding: 0 !important;
    }

    body.speas-app #modal-proveedor .premium-table td:not(:last-child) {
        grid-column: 1 / 2 !important;
    }

    body.speas-app #modal-proveedor .premium-table td:last-child {
        position: static !important;
        grid-column: 2 / 3 !important;
        grid-row: 1 / span 4 !important;
        align-self: start !important;
    }

    body.speas-app #modal-proveedor .premium-table input,
    body.speas-app #modal-proveedor .premium-table select {
        min-height: 46px !important;
        border: 1px solid #607187 !important;
        border-radius: 12px !important;
        padding: 0 14px !important;
    }

    body.speas-app #modal-proveedor .modal-footer {
        padding: 14px 20px !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    body.speas-app #modal-proveedor .modal-footer .btn-cancel,
    body.speas-app #modal-proveedor .modal-footer .btn-primary {
        width: 100% !important;
    }
}

@media (max-width: 768px) {
    body.speas-app .table-module-container:has(#tabla-proveedores-body) .table-responsive > .premium-table {
        min-width: 720px !important;
        width: 100% !important;
        border-collapse: collapse !important;
        border-spacing: 0 !important;
    }

    body.speas-app .table-module-container:has(#tabla-proveedores-body) .table-responsive > .premium-table thead {
        display: table-header-group !important;
    }

    body.speas-app .table-module-container:has(#tabla-proveedores-body) #tabla-proveedores-body tr {
        display: table-row !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: #303b48 !important;
    }

    body.speas-app .table-module-container:has(#tabla-proveedores-body) #tabla-proveedores-body td {
        display: table-cell !important;
        grid-template-columns: none !important;
        align-items: center !important;
        gap: 10px !important;
        padding: 13px 14px !important;
        border-bottom: 1px solid #53657a !important;
        white-space: nowrap !important;
        min-width: 0 !important;
    }

    body.speas-app .table-module-container:has(#tabla-proveedores-body) #tabla-proveedores-body td:nth-child(3) .status-badge {
        justify-self: auto !important;
        min-width: 86px !important;
        max-width: 100% !important;
        text-align: center !important;
        background: rgba(94, 234, 212, 0.14) !important;
        color: #ccfbf1 !important;
        border: 1px solid rgba(94, 234, 212, 0.32) !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    body.speas-app .table-module-container:has(#tabla-proveedores-body) #tabla-proveedores-body td:nth-child(5) {
        grid-template-columns: none !important;
        justify-content: initial !important;
        text-align: center !important;
    }

    body.speas-app .table-module-container:has(#tabla-proveedores-body) #tabla-proveedores-body td:nth-child(5) small {
        margin-left: 4px !important;
        color: #cbd5e1 !important;
        font-size: 11px !important;
    }

    body.speas-app .table-module-container:has(#tabla-proveedores-body) #tabla-proveedores-body td::before {
        color: #9fb0c4 !important;
        font-size: 11px !important;
        font-weight: 900 !important;
        letter-spacing: 0.06em !important;
        text-transform: uppercase !important;
    }

    body.speas-app .table-module-container:has(#tabla-proveedores-body) #tabla-proveedores-body td:nth-child(1)::before,
    body.speas-app .table-module-container:has(#tabla-proveedores-body) #tabla-proveedores-body td:nth-child(2)::before,
    body.speas-app .table-module-container:has(#tabla-proveedores-body) #tabla-proveedores-body td:nth-child(3)::before,
    body.speas-app .table-module-container:has(#tabla-proveedores-body) #tabla-proveedores-body td:nth-child(4)::before,
    body.speas-app .table-module-container:has(#tabla-proveedores-body) #tabla-proveedores-body td:nth-child(5)::before,
    body.speas-app .table-module-container:has(#tabla-proveedores-body) #tabla-proveedores-body td:nth-child(6)::before,
    body.speas-app .table-module-container:has(#tabla-proveedores-body) #tabla-proveedores-body td:nth-child(7)::before {
        content: none !important;
        display: none !important;
    }

    body.speas-app .table-module-container:has(#tabla-proveedores-body) #tabla-proveedores-body td::after,
    body.speas-app .table-module-container:has(#tabla-proveedores-body) #tabla-proveedores-body tr::before,
    body.speas-app .table-module-container:has(#tabla-proveedores-body) #tabla-proveedores-body tr::after {
        content: none !important;
        display: none !important;
    }

    body.speas-app .table-module-container:has(#tabla-proveedores-body) #tabla-proveedores-body .action-buttons {
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
    }

    body.speas-app .table-module-container:has(#tabla-proveedores-body) #tabla-proveedores-body .client-contact {
        display: grid !important;
        gap: 4px !important;
        min-width: 0 !important;
    }
}

/* Speas ordenes compra dark responsive polish v27 */

@media (max-width: 768px) {
    body.speas-app .modulo-container:has(#tabla-oc-interna) {
        padding: 14px !important;
        border-radius: 14px !important;
        overflow: hidden !important;
    }

    body.speas-app .modulo-container:has(#tabla-oc-interna) .header-acciones {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 14px !important;
        align-items: stretch !important;
    }

    body.speas-app .modulo-container:has(#tabla-oc-interna) .header-acciones h2 {
        font-size: 21px !important;
        line-height: 1.18 !important;
        min-width: 0 !important;
        overflow-wrap: anywhere !important;
    }

    body.speas-app .modulo-container:has(#tabla-oc-interna) .header-acciones > div {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        align-items: stretch !important;
    }

    body.speas-app .modulo-container:has(#tabla-oc-interna) #filtro-sede-oc {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        min-height: 48px !important;
    }

    body.speas-app .modulo-container:has(#tabla-oc-interna) .btn-excel,
    body.speas-app .modulo-container:has(#tabla-oc-interna) .btn-primary {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 52px !important;
        padding: 0 10px !important;
        justify-content: center !important;
        white-space: normal !important;
        text-align: center !important;
        line-height: 1.15 !important;
        overflow: hidden !important;
    }

    body.speas-app .modulo-container:has(#tabla-oc-interna) .table-responsive {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    body.speas-app .modulo-container:has(#tabla-oc-interna) .table-custom {
        min-width: 780px !important;
    }

    body.speas-app .modulo-container:has(#tabla-oc-interna) .pagination {
        align-items: center !important;
        gap: 12px !important;
    }

    body.speas-app #modal-crear-oc .modal-content {
        width: min(94vw, 560px) !important;
        max-height: 92vh !important;
    }

    body.speas-app #modal-crear-oc .modal-header {
        padding: 18px 20px !important;
    }

    body.speas-app #modal-crear-oc .modal-body {
        padding: 18px 20px !important;
    }

    body.speas-app #modal-crear-oc .form-grid {
        grid-template-columns: 1fr !important;
        gap: 18px !important;
    }

    body.speas-app #modal-crear-oc .input-group,
    body.speas-app #modal-crear-oc .input-group[style*="grid-column"] {
        grid-column: auto !important;
    }

    body.speas-app #modal-crear-oc .input-group input,
    body.speas-app #modal-crear-oc .input-group select,
    body.speas-app #modal-crear-oc .input-group textarea {
        min-height: 52px !important;
        font-size: 15px !important;
    }
}

/* Speas ordenes compra mobile modal viewport fix v28 */
@media (max-width: 768px) {
    body.speas-app #modal-crear-oc.modal-overlay:not(.hidden) {
        align-items: flex-start !important;
        justify-content: center !important;
        padding: 14px 12px calc(16px + env(safe-area-inset-bottom, 0px)) !important;
        overflow-y: auto !important;
    }

    body.speas-app #modal-crear-oc .modal-content {
        width: min(94vw, 560px) !important;
        max-height: calc(100dvh - 30px) !important;
        margin: 0 auto !important;
        border-radius: 16px !important;
        overflow: hidden !important;
    }

    body.speas-app #modal-crear-oc .modal-header {
        flex: 0 0 auto !important;
        min-height: 58px !important;
        padding: 14px 18px !important;
        gap: 10px !important;
    }

    body.speas-app #modal-crear-oc .modal-header h3 {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        min-width: 0 !important;
        margin: 0 !important;
        font-size: 16px !important;
        line-height: 1.25 !important;
        overflow: visible !important;
    }

    body.speas-app #modal-crear-oc .modal-header > i {
        flex: 0 0 auto !important;
        width: 38px !important;
        height: 38px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 12px !important;
        background: #344151 !important;
        border: 1px solid #53657a !important;
    }

    body.speas-app #modal-crear-oc .modal-body {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        padding-top: 18px !important;
    }
}

/* Speas ordenes compra mobile full viewport modal fix v29 */
@media (max-width: 768px) {
    body.speas-modal-open {
        overflow: hidden !important;
        touch-action: pan-x pan-y pinch-zoom !important;
    }

    body.speas-app #modal-crear-oc.modal-overlay {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        z-index: 9999 !important;
        box-sizing: border-box !important;
        background: rgba(8, 13, 22, 0.78) !important;
        backdrop-filter: blur(8px) !important;
        overflow: hidden !important;
    }

    body.speas-app #modal-crear-oc.modal-overlay:not(.hidden) {
        display: flex !important;
        align-items: stretch !important;
        justify-content: center !important;
        padding: 10px 12px 12px !important;
    }

    body.speas-app #modal-crear-oc .modal-content {
        width: min(94vw, 560px) !important;
        height: calc(100dvh - 22px) !important;
        max-height: calc(100dvh - 22px) !important;
        min-height: 0 !important;
        margin: 0 auto !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        border-radius: 16px !important;
    }

    body.speas-app #modal-crear-oc .modal-header {
        position: relative !important;
        flex: 0 0 auto !important;
        min-height: 64px !important;
        padding: 14px 16px !important;
        background: #2e3a48 !important;
        border-bottom: 1px solid #526276 !important;
    }

    body.speas-app #modal-crear-oc .modal-header h3 {
        flex: 1 1 auto !important;
        font-size: clamp(15px, 4vw, 18px) !important;
        white-space: normal !important;
        word-break: normal !important;
    }

    body.speas-app #modal-crear-oc .modal-header > i:last-child {
        flex: 0 0 44px !important;
        width: 44px !important;
        height: 44px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 14px !important;
        background: #344151 !important;
        border: 1px solid #53657a !important;
        font-size: 24px !important;
    }

    body.speas-app #modal-crear-oc .modal-body {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;
        padding: 18px 16px max(22px, env(safe-area-inset-bottom, 0px)) !important;
        background: #2e3a48 !important;
    }

    body.speas-app #modal-crear-oc .form-actions {
        position: static !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        margin: 18px 0 0 !important;
        padding: 0 0 max(10px, env(safe-area-inset-bottom, 0px)) !important;
        background: transparent !important;
        border-top: 0 !important;
    }

    body.speas-app #modal-crear-oc .form-actions .btn-outline,
    body.speas-app #modal-crear-oc .form-actions .btn-primary {
        width: 100% !important;
        min-height: 48px !important;
    }
}

/* Speas ordenes compra mobile form scroll refinement v30 */
@media (max-width: 768px) {
    body.speas-app #modal-crear-oc .modal-body {
        padding-bottom: max(22px, env(safe-area-inset-bottom, 0px)) !important;
    }

    body.speas-app #modal-crear-oc .form-actions {
        position: static !important;
        margin-top: 20px !important;
    }
}

/* Speas facturas dark responsive polish v31 */

/* Speas facturas dark modal refinements v32 */

@media (max-width: 768px) {
    body.speas-app #toast-container {
        top: 82px !important;
        left: 16px !important;
        right: 16px !important;
        width: auto !important;
        gap: 8px !important;
        z-index: 9997 !important;
    }

    body.speas-app .toast {
        min-width: 0 !important;
        width: 100% !important;
        padding: 10px 12px !important;
        border-radius: 12px !important;
        gap: 10px !important;
        transform: translateY(-140%) !important;
    }

    body.speas-app .toast.show {
        transform: translateY(0) !important;
    }

    body.speas-app .toast-title {
        font-size: 12px !important;
        margin: 0 !important;
    }

    body.speas-app .toast-msg {
        font-size: 12px !important;
        line-height: 1.25 !important;
    }
}

/* Speas facturas mobile modal scroll without bottom blocker v33 */

/* Speas facturas mobile modal spacing and provider accounts dark fix v34 */

/* Speas caja chica compact movement type badge v35 */
body.speas-app .caja-chica-container #tabla-chica-body td:nth-child(2) {
    width: 112px !important;
}

body.speas-app .caja-chica-container #tabla-chica-body td:nth-child(2) .badge {
    width: auto !important;
    min-width: 82px !important;
    max-width: 96px !important;
    min-height: 28px !important;
    height: 28px !important;
    padding: 0 9px !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    font-size: 12px !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
}

body.speas-app .caja-chica-container #tabla-chica-body td:nth-child(2) .badge i {
    font-size: 12px !important;
    line-height: 1 !important;
    margin: 0 !important;
}

@media (max-width: 768px) {
    body.speas-app .caja-chica-container #tabla-chica-body td:nth-child(2) {
        width: 94px !important;
    }

    body.speas-app .caja-chica-container #tabla-chica-body td:nth-child(2) .badge {
        min-width: 74px !important;
        max-width: 84px !important;
        height: 26px !important;
        min-height: 26px !important;
        padding: 0 7px !important;
        font-size: 11px !important;
        border-radius: 7px !important;
    }

    body.speas-app .caja-chica-container #tabla-chica-body td:nth-child(2) .badge i {
        font-size: 11px !important;
    }
}

/* Speas inventario desktop tablet tv modal footer fix v36 */
body.speas-app #modal-producto.modal-overlay.active {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    align-items: stretch !important;
    justify-content: flex-end !important;
    overflow: hidden !important;
}

body.speas-app #modal-producto .modal-content.slide-in-right {
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    width: min(46vw, 780px) !important;
    min-width: 640px !important;
    max-width: calc(100vw - var(--sidebar-w, 96px) - 24px) !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
}

body.speas-app #modal-producto .modal-header {
    flex: 0 0 auto !important;
    min-height: 96px !important;
    padding: 24px 38px !important;
}

body.speas-app #modal-producto .modal-body {
    min-height: 0 !important;
    height: auto !important;
    overflow-y: auto !important;
    padding: 28px 38px 32px !important;
    overscroll-behavior: contain !important;
}

body.speas-app #modal-producto .modal-footer {
    position: static !important;
    flex: 0 0 auto !important;
    min-height: 86px !important;
    margin: 0 !important;
    padding: 16px 38px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 14px !important;
    z-index: 2 !important;
}

@media (min-width: 1600px) {
    body.speas-app #modal-producto .modal-content.slide-in-right {
        width: min(42vw, 860px) !important;
    }
}

@media (min-width: 721px) and (max-width: 1180px) {
    body.speas-app #modal-producto .modal-content.slide-in-right {
        width: min(78vw, 760px) !important;
        min-width: 0 !important;
        max-width: calc(100vw - 24px) !important;
    }

    body.speas-app #modal-producto .modal-header {
        min-height: 88px !important;
        padding: 22px 30px !important;
    }

    body.speas-app #modal-producto .modal-body {
        padding: 24px 30px 30px !important;
    }

    body.speas-app #modal-producto .modal-footer {
        min-height: 82px !important;
        padding: 14px 30px !important;
    }
}

@media (max-width: 720px) {
    body.speas-app #modal-producto.modal-overlay.active {
        justify-content: center !important;
        align-items: flex-start !important;
        height: 100dvh !important;
        padding: 12px 10px max(12px, env(safe-area-inset-bottom)) !important;
        overflow-y: auto !important;
    }

    body.speas-app #modal-producto .modal-content.slide-in-right {
        width: min(100%, 560px) !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: calc(100dvh - 24px - env(safe-area-inset-bottom)) !important;
        max-height: calc(100dvh - 24px - env(safe-area-inset-bottom)) !important;
        border-radius: 22px !important;
    }

    body.speas-app #modal-producto .modal-header {
        min-height: 82px !important;
        padding: 18px 22px !important;
    }

    body.speas-app #modal-producto .modal-body {
        padding: 20px 22px 24px !important;
    }

    body.speas-app #modal-producto .modal-footer {
        min-height: auto !important;
        padding: 14px 22px max(16px, env(safe-area-inset-bottom)) !important;
    }
}

@media (min-width: 721px) {
    body.speas-app #modal-producto.modal-overlay.active {
        top: -78px !important;
        left: calc(-1 * var(--sidebar-w, 96px)) !important;
        width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
    }

    body.speas-app #modal-producto .modal-content.slide-in-right {
        height: 100dvh !important;
        max-height: 100dvh !important;
    }
}

@media (min-width: 721px) {
    body.speas-app #modal-producto .modal-content.slide-in-right {
        width: min(46vw, 780px) !important;
    }
}

@media (min-width: 1600px) {
    body.speas-app #modal-producto .modal-content.slide-in-right {
        width: min(42vw, 860px) !important;
        min-width: 760px !important;
    }
}

@media (min-width: 721px) and (max-width: 1180px) {
    body.speas-app #modal-producto .modal-content.slide-in-right {
        width: min(78vw, 760px) !important;
        min-width: 0 !important;
    }
}

/* Speas inventario dark modal scrollbar v37 */

/* Speas inventario kardex dark modal spacing and scrollbars v38 */
body.speas-app #modal-kardex.modal-overlay.active {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    padding: clamp(30px, 4dvh, 48px) clamp(18px, 3.5vw, 48px) !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

body.speas-app #modal-kardex .modal-content.center-modal {
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    width: min(88vw, 1380px) !important;
    max-width: calc(100vw - 96px) !important;
    height: auto !important;
    max-height: calc(100dvh - clamp(60px, 8dvh, 96px)) !important;
    margin: 0 !important;
    overflow: hidden !important;
    border-radius: 14px !important;
}

body.speas-app #modal-kardex .modal-header {
    flex: 0 0 auto !important;
    min-height: 90px !important;
    padding: 24px 32px !important;
}

body.speas-app #modal-kardex .modal-body {
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    overflow: hidden !important;
    padding: 24px 32px 20px !important;
}

body.speas-app #modal-kardex .kardex-filters {
    flex: 0 0 auto !important;
    margin-bottom: 0 !important;
}

body.speas-app #modal-kardex .modal-body > div:nth-child(2) {
    flex: 1 1 auto !important;
    min-height: 260px !important;
    max-height: none !important;
    overflow: auto !important;
    padding-bottom: 0 !important;
    overscroll-behavior: contain !important;
}

body.speas-app #modal-kardex .pagination-container {
    flex: 0 0 auto !important;
    margin-top: 2px !important;
}

@media (min-width: 721px) {
    body.speas-app #modal-kardex.modal-overlay.active {
        top: -78px !important;
        left: calc(-1 * var(--sidebar-w, 96px)) !important;
        width: 100vw !important;
        height: 100dvh !important;
    }
}

@media (max-width: 720px) {
    body.speas-app #modal-kardex.modal-overlay.active {
        padding: 12px 10px max(12px, env(safe-area-inset-bottom)) !important;
        align-items: flex-start !important;
        overflow-y: auto !important;
    }

    body.speas-app #modal-kardex .modal-content.center-modal {
        width: 100% !important;
        max-width: 100% !important;
        max-height: calc(100dvh - 24px - env(safe-area-inset-bottom)) !important;
        border-radius: 20px !important;
    }

    body.speas-app #modal-kardex .modal-header {
        min-height: 78px !important;
        padding: 18px 20px !important;
    }

    body.speas-app #modal-kardex .modal-body {
        padding: 18px 14px 16px !important;
    }
}

/* Speas inventario table spacing polish v39 */
body.speas-app .table-module-container:has(#tabla-productos-body) .table-responsive {
    padding: 0 10px 8px !important;
}

body.speas-app .table-module-container:has(#tabla-productos-body) .premium-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

body.speas-app .table-module-container:has(#tabla-productos-body) .premium-table thead th {
    padding: 16px 22px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

body.speas-app .table-module-container:has(#tabla-productos-body) .premium-table tbody td {
    padding: 14px 22px !important;
    line-height: 1.35 !important;
}

body.speas-app .table-module-container:has(#tabla-productos-body) .premium-table thead th:first-child,
body.speas-app .table-module-container:has(#tabla-productos-body) .premium-table tbody td:first-child {
    padding-left: 28px !important;
}

body.speas-app .table-module-container:has(#tabla-productos-body) .premium-table thead th:last-child,
body.speas-app .table-module-container:has(#tabla-productos-body) .premium-table tbody td:last-child {
    padding-right: 28px !important;
}

body.speas-app .table-module-container:has(#tabla-productos-body) .premium-table tbody tr {
    min-height: 68px !important;
}

body.speas-app .table-module-container:has(#tabla-productos-body) #tabla-productos-body td:nth-child(2) span,
body.speas-app .table-module-container:has(#tabla-productos-body) #tabla-productos-body td:nth-child(3) span,
body.speas-app .table-module-container:has(#tabla-productos-body) #tabla-productos-body .badge-cat,
body.speas-app .table-module-container:has(#tabla-productos-body) #tabla-productos-body .badge-type,
body.speas-app .table-module-container:has(#tabla-productos-body) #tabla-productos-body .status-badge,
body.speas-app .table-module-container:has(#tabla-productos-body) #tabla-productos-body .badge {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 26px !important;
    padding: 4px 9px !important;
    border-radius: 8px !important;
    line-height: 1.15 !important;
    box-sizing: border-box !important;
}

@media (max-width: 768px) {
    body.speas-app .table-module-container:has(#tabla-productos-body) .table-responsive {
        padding: 0 6px 8px !important;
    }

    body.speas-app .table-module-container:has(#tabla-productos-body) .premium-table thead th,
    body.speas-app .table-module-container:has(#tabla-productos-body) .premium-table tbody td {
        padding: 13px 16px !important;
    }

    body.speas-app .table-module-container:has(#tabla-productos-body) .premium-table thead th:first-child,
    body.speas-app .table-module-container:has(#tabla-productos-body) .premium-table tbody td:first-child {
        padding-left: 18px !important;
    }
}

/* Speas inventario header spacing polish v40 */
body.speas-app .table-module-container:has(#tabla-productos-body) {
    gap: 18px !important;
}

body.speas-app .table-module-container:has(#tabla-productos-body) > .module-header {
    padding: 22px 28px 18px !important;
    margin: 0 !important;
    align-items: center !important;
    border-radius: 12px 12px 0 0 !important;
    box-sizing: border-box !important;
}

body.speas-app .table-module-container:has(#tabla-productos-body) > .module-header .header-titles {
    min-width: 260px !important;
}

body.speas-app .table-module-container:has(#tabla-productos-body) > .module-header h2 {
    margin: 0 0 8px !important;
    line-height: 1.18 !important;
}

body.speas-app .table-module-container:has(#tabla-productos-body) > .module-header p {
    margin: 0 !important;
    line-height: 1.35 !important;
}

body.speas-app .table-module-container:has(#tabla-productos-body) > .tabs-container {
    padding: 16px 28px 18px !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-sizing: border-box !important;
}

body.speas-app .table-module-container:has(#tabla-productos-body) > .table-toolbar {
    margin: 0 28px !important;
    padding: 18px 20px !important;
    box-sizing: border-box !important;
}

body.speas-app .table-module-container:has(#tabla-productos-body) > .table-responsive {
    margin: 8px 28px 0 !important;
    width: auto !important;
}

body.speas-app .table-module-container:has(#tabla-productos-body) > .pagination {
    margin: 0 28px !important;
}

@media (max-width: 768px) {
    body.speas-app .table-module-container:has(#tabla-productos-body) > .module-header {
        padding: 18px 18px 16px !important;
        gap: 14px !important;
    }

    body.speas-app .table-module-container:has(#tabla-productos-body) > .tabs-container {
        padding: 14px 18px 16px !important;
    }

    body.speas-app .table-module-container:has(#tabla-productos-body) > .table-toolbar,
    body.speas-app .table-module-container:has(#tabla-productos-body) > .table-responsive,
    body.speas-app .table-module-container:has(#tabla-productos-body) > .pagination {
        margin-left: 18px !important;
        margin-right: 18px !important;
    }
}

/* Speas caja chica spacing polish v41 */
body.speas-app .caja-chica-container {
    max-width: min(100%, 1480px) !important;
    padding: 24px 28px 64px !important;
    box-sizing: border-box !important;
}

body.speas-app .caja-chica-container > .module-header {
    padding: 22px 28px 18px !important;
    margin: 0 0 28px !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
}

body.speas-app .caja-chica-container > .module-header h2 {
    margin: 0 0 8px !important;
    line-height: 1.18 !important;
}

body.speas-app .caja-chica-container > .module-header p {
    margin: 0 !important;
    line-height: 1.35 !important;
}

body.speas-app .caja-chica-container > .saldo-card-container {
    margin: 0 0 32px !important;
    gap: 24px !important;
}

body.speas-app .caja-chica-container .saldo-card {
    padding: 38px 42px !important;
}

body.speas-app .caja-chica-container .actions-grid .btn-action {
    padding: 30px 24px !important;
}

body.speas-app .caja-chica-container > .table-container {
    padding: 32px 34px 34px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

body.speas-app .caja-chica-container .table-header-flex {
    padding: 0 4px !important;
    margin-bottom: 20px !important;
}

body.speas-app .caja-chica-container .table-responsive {
    padding: 0 8px 8px !important;
    box-sizing: border-box !important;
}

body.speas-app .caja-chica-container .premium-table th {
    padding: 16px 24px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

body.speas-app .caja-chica-container .premium-table td {
    padding: 14px 24px !important;
    line-height: 1.35 !important;
}

body.speas-app .caja-chica-container .premium-table th:first-child,
body.speas-app .caja-chica-container .premium-table td:first-child {
    padding-left: 28px !important;
}

body.speas-app .caja-chica-container .premium-table th:last-child,
body.speas-app .caja-chica-container .premium-table td:last-child {
    padding-right: 28px !important;
}

@media (max-width: 980px) {
    body.speas-app .caja-chica-container {
        padding: 18px 18px 56px !important;
    }

    body.speas-app .caja-chica-container > .module-header {
        padding: 18px 18px 16px !important;
        gap: 14px !important;
    }

    body.speas-app .caja-chica-container > .saldo-card-container {
        gap: 18px !important;
    }

    body.speas-app .caja-chica-container .saldo-card,
    body.speas-app .caja-chica-container > .table-container {
        padding: 24px 20px !important;
    }
}

/* Speas flujo caja spacing polish v42 */
body.speas-app .caja-container {
    max-width: min(100%, 1680px) !important;
    padding: 24px 28px 64px !important;
    box-sizing: border-box !important;
}

body.speas-app .caja-container > .module-header {
    padding: 22px 28px 18px !important;
    margin: 0 0 28px !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
}

body.speas-app .caja-container > .module-header .header-titles {
    min-width: 260px !important;
}

body.speas-app .caja-container > .module-header h2 {
    margin: 0 0 8px !important;
    line-height: 1.18 !important;
}

body.speas-app .caja-container > .module-header p {
    margin: 0 !important;
    line-height: 1.35 !important;
}

body.speas-app .caja-container .kpi-grid-temporal {
    gap: 24px !important;
    margin: 0 0 32px !important;
}

body.speas-app .caja-container .kpi-card {
    padding: 26px 30px !important;
    min-height: 150px !important;
    box-sizing: border-box !important;
}

body.speas-app .caja-container .card-header-flex {
    margin-bottom: 20px !important;
}

body.speas-app .caja-container .amount-big {
    margin: 0 !important;
    line-height: 1.15 !important;
}

body.speas-app .caja-container .desglose-container {
    padding: 28px !important;
    margin: 0 0 32px !important;
    border-radius: 18px !important;
    box-sizing: border-box !important;
}

body.speas-app .caja-container .desglose-header {
    margin: 0 0 24px !important;
    gap: 18px !important;
}

body.speas-app .caja-container .desglose-title h3 {
    margin: 0 0 4px !important;
    line-height: 1.2 !important;
}

body.speas-app .caja-container .desglose-title small {
    display: block !important;
    line-height: 1.3 !important;
}

body.speas-app .caja-container .cards-methods-grid {
    gap: 18px !important;
}

body.speas-app .caja-container .method-card-detail {
    min-height: 82px !important;
    padding: 18px 20px !important;
    box-sizing: border-box !important;
}

body.speas-app .caja-container .method-card-detail .icon-box {
    flex: 0 0 48px !important;
}

body.speas-app .caja-container .table-module-container {
    padding: 32px 34px 34px !important;
    margin: 0 !important;
    border-radius: 18px !important;
    box-sizing: border-box !important;
}

body.speas-app .caja-container .table-responsive {
    padding: 0 8px 8px !important;
    box-sizing: border-box !important;
}

body.speas-app .caja-container .premium-table th {
    padding: 16px 24px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

body.speas-app .caja-container .premium-table td {
    padding: 16px 24px !important;
    line-height: 1.35 !important;
}

body.speas-app .caja-container .premium-table th:first-child,
body.speas-app .caja-container .premium-table td:first-child {
    padding-left: 28px !important;
}

body.speas-app .caja-container .premium-table th:last-child,
body.speas-app .caja-container .premium-table td:last-child {
    padding-right: 28px !important;
}

body.speas-app .caja-container #caja-paginacion {
    margin: 22px 8px 0 !important;
}

@media (max-width: 980px) {
    body.speas-app .caja-container {
        padding: 18px 18px 56px !important;
    }

    body.speas-app .caja-container > .module-header {
        padding: 18px 18px 16px !important;
        gap: 14px !important;
    }

    body.speas-app .caja-container .kpi-grid-temporal {
        gap: 18px !important;
        margin-bottom: 24px !important;
    }

    body.speas-app .caja-container .kpi-card,
    body.speas-app .caja-container .desglose-container,
    body.speas-app .caja-container .table-module-container {
        padding: 22px 20px !important;
    }
}

@media (max-width: 600px) {
    body.speas-app .caja-container {
        padding: 14px 14px 48px !important;
    }

    body.speas-app .caja-container > .module-header,
    body.speas-app .caja-container .kpi-card,
    body.speas-app .caja-container .desglose-container,
    body.speas-app .caja-container .table-module-container {
        padding: 18px 16px !important;
    }

    body.speas-app .caja-container .cards-methods-grid {
        grid-template-columns: 1fr !important;
    }

    body.speas-app .caja-container .method-card-detail {
        flex-direction: row !important;
        text-align: left !important;
    }

    body.speas-app .caja-container .premium-table th,
    body.speas-app .caja-container .premium-table td {
        padding: 14px 16px !important;
    }
}

/* Speas historial despacho calendario spacing polish v43 */
body.speas-app .table-module-container:has(#tabla-historial-body) {
    max-width: min(100%, 1680px) !important;
    padding: 24px 28px 64px !important;
    box-sizing: border-box !important;
}

body.speas-app .table-module-container:has(#tabla-historial-body) > .module-header {
    padding: 22px 28px 18px !important;
    margin: 0 0 28px !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
}

body.speas-app .table-module-container:has(#tabla-historial-body) > .module-header h2,
body.speas-app .calendar-module-container > .module-header h2,
body.speas-app .despacho-container .despacho-title h2 {
    margin: 0 0 8px !important;
    line-height: 1.18 !important;
}

body.speas-app .table-module-container:has(#tabla-historial-body) > .module-header p,
body.speas-app .calendar-module-container > .module-header p,
body.speas-app .despacho-container .despacho-title p {
    margin: 0 !important;
    line-height: 1.35 !important;
}

body.speas-app .table-module-container:has(#tabla-historial-body) > .table-toolbar {
    margin: 0 0 26px !important;
    padding: 18px 20px !important;
    border-radius: 14px !important;
    box-sizing: border-box !important;
}

body.speas-app .table-module-container:has(#tabla-historial-body) > .table-responsive {
    padding: 0 8px 8px !important;
    border-radius: 14px !important;
    box-sizing: border-box !important;
}

body.speas-app .table-module-container:has(#tabla-historial-body) .premium-table th {
    padding: 16px 24px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

body.speas-app .table-module-container:has(#tabla-historial-body) .premium-table td {
    padding: 16px 24px !important;
    line-height: 1.35 !important;
}

body.speas-app .table-module-container:has(#tabla-historial-body) .premium-table th:first-child,
body.speas-app .table-module-container:has(#tabla-historial-body) .premium-table td:first-child {
    padding-left: 28px !important;
}

body.speas-app .table-module-container:has(#tabla-historial-body) .premium-table th:last-child,
body.speas-app .table-module-container:has(#tabla-historial-body) .premium-table td:last-child {
    padding-right: 28px !important;
}

body.speas-app .table-module-container:has(#tabla-historial-body) #historial-paginacion {
    margin: 22px 8px 0 !important;
}

body.speas-app .despacho-container {
    max-width: min(100%, 1680px) !important;
    padding: 24px 28px 64px !important;
    box-sizing: border-box !important;
}

body.speas-app .despacho-container .despacho-header {
    padding: 22px 28px 18px !important;
    margin: 0 0 24px !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
}

body.speas-app .despacho-container .despacho-tabs {
    padding: 0 0 18px !important;
    margin: 0 0 26px !important;
    gap: 12px !important;
}

body.speas-app .despacho-container .despacho-actions {
    padding: 18px 20px !important;
    margin: 0 0 24px !important;
    border-radius: 14px !important;
    box-sizing: border-box !important;
}

body.speas-app .despacho-container .table-responsive {
    padding: 0 8px 8px !important;
    border-radius: 14px !important;
    box-sizing: border-box !important;
}

body.speas-app .despacho-container .despacho-table th {
    padding: 16px 24px !important;
    line-height: 1.2 !important;
}

body.speas-app .despacho-container .despacho-table td {
    padding: 16px 24px !important;
    line-height: 1.35 !important;
}

body.speas-app .despacho-container .despacho-table th:first-child,
body.speas-app .despacho-container .despacho-table td:first-child {
    padding-left: 28px !important;
}

body.speas-app .despacho-container .despacho-table th:last-child,
body.speas-app .despacho-container .despacho-table td:last-child {
    padding-right: 28px !important;
}

body.speas-app .calendar-module-container {
    max-width: min(100%, 1680px) !important;
    height: auto !important;
    min-height: calc(100vh - 130px) !important;
    padding: 24px 28px 64px !important;
    gap: 26px !important;
    box-sizing: border-box !important;
}

body.speas-app .calendar-module-container > .module-header {
    padding: 22px 28px 18px !important;
    margin: 0 !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
}

body.speas-app .calendar-module-container .calendar-wrapper {
    margin: 0 !important;
    border-radius: 18px !important;
    min-height: 680px !important;
    box-sizing: border-box !important;
}

body.speas-app .calendar-module-container .calendar-sidebar {
    padding: 34px 30px !important;
    gap: 18px !important;
    box-sizing: border-box !important;
}

body.speas-app .calendar-module-container .calendar-main-area {
    padding: 26px !important;
    box-sizing: border-box !important;
}

body.speas-app .calendar-module-container .fc-toolbar {
    gap: 18px !important;
}

body.speas-app .calendar-module-container .fc-toolbar-title {
    line-height: 1.2 !important;
}

body.speas-app .calendar-module-container .fc-scrollgrid th,
body.speas-app .calendar-module-container .fc-scrollgrid td {
    padding-left: 10px !important;
    padding-right: 10px !important;
}

@media (max-width: 980px) {
    body.speas-app .table-module-container:has(#tabla-historial-body),
    body.speas-app .despacho-container,
    body.speas-app .calendar-module-container {
        padding: 18px 18px 56px !important;
    }

    body.speas-app .table-module-container:has(#tabla-historial-body) > .module-header,
    body.speas-app .despacho-container .despacho-header,
    body.speas-app .calendar-module-container > .module-header {
        padding: 18px 18px 16px !important;
        gap: 14px !important;
    }

    body.speas-app .despacho-container .despacho-actions,
    body.speas-app .table-module-container:has(#tabla-historial-body) > .table-toolbar {
        padding: 16px !important;
    }

    body.speas-app .calendar-module-container .calendar-wrapper {
        min-height: 620px !important;
    }
}

@media (max-width: 768px) {
    body.speas-app .calendar-module-container .calendar-wrapper {
        flex-direction: column !important;
        min-height: auto !important;
    }

    body.speas-app .calendar-module-container .calendar-sidebar {
        width: 100% !important;
        padding: 20px !important;
        border-right: 0 !important;
        border-bottom: 1px solid #5b6b80 !important;
    }

    body.speas-app .calendar-module-container .calendar-main-area {
        min-height: 620px !important;
        padding: 18px !important;
    }
}

@media (max-width: 600px) {
    body.speas-app .table-module-container:has(#tabla-historial-body),
    body.speas-app .despacho-container,
    body.speas-app .calendar-module-container {
        padding: 14px 14px 48px !important;
    }

    body.speas-app .table-module-container:has(#tabla-historial-body) > .module-header,
    body.speas-app .table-module-container:has(#tabla-historial-body) > .table-toolbar,
    body.speas-app .despacho-container .despacho-header,
    body.speas-app .despacho-container .despacho-actions,
    body.speas-app .calendar-module-container > .module-header {
        padding: 18px 16px !important;
    }

    body.speas-app .table-module-container:has(#tabla-historial-body) .premium-table th,
    body.speas-app .table-module-container:has(#tabla-historial-body) .premium-table td,
    body.speas-app .despacho-container .despacho-table th,
    body.speas-app .despacho-container .despacho-table td {
        padding: 14px 16px !important;
    }
}

/* Speas proveedores dark spacing and centered modals v44 */
body.speas-app .table-module-container:has(#tabla-proveedores-body) {
    max-width: min(100%, 1680px) !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 24px 28px 34px !important;
    gap: 24px !important;
    min-height: 0 !important;
    box-sizing: border-box !important;
}

body.speas-app .table-module-container:has(#tabla-proveedores-body) > .module-header {
    padding: 22px 28px 18px !important;
    margin: 0 !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
}

body.speas-app .table-module-container:has(#tabla-proveedores-body) > .module-header h2 {
    margin: 0 0 8px !important;
    line-height: 1.18 !important;
}

body.speas-app .table-module-container:has(#tabla-proveedores-body) > .module-header p {
    margin: 0 !important;
    line-height: 1.35 !important;
}

body.speas-app .table-module-container:has(#tabla-proveedores-body) > .table-toolbar {
    padding: 18px 20px !important;
    margin: 0 !important;
    border-radius: 14px !important;
    box-sizing: border-box !important;
}

body.speas-app .table-module-container:has(#tabla-proveedores-body) > .table-responsive {
    padding: 0 8px 8px !important;
    border-radius: 14px !important;
    box-sizing: border-box !important;
    min-height: 0 !important;
}

body.speas-app .table-module-container:has(#tabla-proveedores-body) .premium-table th {
    padding: 16px 24px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

body.speas-app .table-module-container:has(#tabla-proveedores-body) .premium-table td {
    padding: 16px 24px !important;
    line-height: 1.35 !important;
}

body.speas-app .table-module-container:has(#tabla-proveedores-body) .premium-table th:first-child,
body.speas-app .table-module-container:has(#tabla-proveedores-body) .premium-table td:first-child {
    padding-left: 28px !important;
}

body.speas-app .table-module-container:has(#tabla-proveedores-body) .premium-table th:last-child,
body.speas-app .table-module-container:has(#tabla-proveedores-body) .premium-table td:last-child {
    padding-right: 28px !important;
}

body.speas-app .table-module-container:has(#tabla-proveedores-body) > .pagination {
    margin: 0 !important;
    padding: 10px 8px 0 !important;
    min-height: 0 !important;
}

body.speas-app #modal-proveedor.modal-overlay {
    align-items: center !important;
    justify-content: center !important;
    padding: 48px 32px !important;
    box-sizing: border-box !important;
}

body.speas-app #modal-proveedor.modal-overlay.active,
body.speas-app #modal-proveedor.modal-overlay:not(.hidden) {
    display: flex !important;
}

body.speas-app #modal-proveedor .modal-content {
    width: min(1040px, calc(100vw - 96px)) !important;
    max-width: min(1040px, calc(100vw - 96px)) !important;
    height: auto !important;
    max-height: calc(100dvh - 96px) !important;
    margin: auto !important;
    border-radius: 18px !important;
    overflow: hidden !important;
    transform: none !important;
    box-shadow: 0 26px 70px rgba(3, 10, 20, 0.36) !important;
}

body.speas-app #modal-proveedor .modal-header {
    min-height: 78px !important;
    padding: 22px 38px !important;
    box-sizing: border-box !important;
}

body.speas-app #modal-proveedor .modal-body {
    max-height: calc(100dvh - 252px) !important;
    padding: 30px 38px 26px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

body.speas-app #modal-proveedor .modal-footer {
    position: sticky !important;
    bottom: 0 !important;
    padding: 22px 38px !important;
    gap: 14px !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}

body.speas-app #modal-proveedor .row-grid {
    gap: 18px !important;
}

body.speas-app #modal-proveedor .form-subtitle {
    margin: 28px 0 18px !important;
    padding-bottom: 8px !important;
    line-height: 1.2 !important;
}

body.speas-app #modal-proveedor .premium-table {
    margin: 0 0 26px !important;
    border-radius: 12px !important;
    overflow: hidden !important;
}

body.speas-app #modal-proveedor .premium-table td {
    padding: 10px 12px !important;
}

body.speas-app #modal-acceso-b2b,
body.speas-app #modal-confirmar-proveedor,
body.speas-app #modal-copiar-datos {
    align-items: center !important;
    justify-content: center !important;
    padding: 32px !important;
    box-sizing: border-box !important;
}

body.speas-app #modal-acceso-b2b .modal-content,
body.speas-app #modal-confirmar-proveedor .modal-content,
body.speas-app #modal-copiar-datos .modal-content {
    transform: none !important;
    margin: auto !important;
    border-radius: 18px !important;
}

@media (min-width: 1400px) {
    body.speas-app #modal-proveedor .modal-content {
        width: min(1120px, calc(100vw - 140px)) !important;
        max-width: min(1120px, calc(100vw - 140px)) !important;
    }
}

@media (max-width: 980px) {
    body.speas-app .table-module-container:has(#tabla-proveedores-body) {
        padding: 18px 18px 34px !important;
    }

    body.speas-app .table-module-container:has(#tabla-proveedores-body) > .module-header,
    body.speas-app .table-module-container:has(#tabla-proveedores-body) > .table-toolbar {
        padding: 18px 18px 16px !important;
        gap: 14px !important;
    }

    body.speas-app #modal-proveedor.modal-overlay {
        padding: 34px 24px !important;
    }

    body.speas-app #modal-proveedor .modal-content {
        width: min(920px, calc(100vw - 48px)) !important;
        max-width: min(920px, calc(100vw - 48px)) !important;
        max-height: calc(100dvh - 68px) !important;
    }
}

@media (max-width: 600px) {
    body.speas-app .table-module-container:has(#tabla-proveedores-body) {
        padding: 14px 14px 34px !important;
    }

    body.speas-app #modal-proveedor.modal-overlay {
        padding: 14px !important;
    }

    body.speas-app #modal-proveedor .modal-content {
        width: calc(100vw - 28px) !important;
        max-width: calc(100vw - 28px) !important;
        max-height: calc(100dvh - 28px) !important;
        border-radius: 16px !important;
    }

    body.speas-app #modal-proveedor .modal-header,
    body.speas-app #modal-proveedor .modal-body,
    body.speas-app #modal-proveedor .modal-footer {
        padding-left: 18px !important;
        padding-right: 18px !important;
    }
}

/* Speas proveedores viewport modal and scrollbar polish v45 */
body.speas-app #modal-proveedor.modal-overlay,
body.speas-app #modal-acceso-b2b,
body.speas-app #modal-confirmar-proveedor,
body.speas-app #modal-copiar-datos {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    z-index: 12000 !important;
    align-items: center !important;
    justify-content: center !important;
    overflow-y: auto !important;
    background: rgba(8, 15, 26, 0.72) !important;
    backdrop-filter: blur(12px) saturate(120%) !important;
}

body.speas-app #modal-proveedor.modal-overlay {
    padding: 48px 32px !important;
}

body.speas-app #modal-acceso-b2b,
body.speas-app #modal-confirmar-proveedor,
body.speas-app #modal-copiar-datos {
    padding: 32px !important;
}

body.speas-app #modal-proveedor .modal-content {
    max-height: calc(100dvh - 96px) !important;
}

body.speas-app #modal-acceso-b2b .modal-content,
body.speas-app #modal-confirmar-proveedor .modal-content,
body.speas-app #modal-copiar-datos .modal-content {
    max-height: calc(100dvh - 64px) !important;
}

body.speas-app #modal-proveedor .modal-body,
body.speas-app #copy-modal-content {
    scrollbar-width: thin !important;
    scrollbar-color: #5eead4 #1f2a36 !important;
}

body.speas-app .table-module-container:has(#tabla-proveedores-body) > .table-responsive {
    height: auto !important;
    max-height: none !important;
}

body.speas-app .table-module-container:has(#tabla-proveedores-body) > .table-responsive > .premium-table {
    margin: 0 !important;
}

@media (min-width: 1800px) {
    body.speas-app .table-module-container:has(#tabla-proveedores-body) {
        max-width: min(100%, 1760px) !important;
    }
}

@media (max-width: 980px) {
    body.speas-app #modal-proveedor.modal-overlay {
        padding: 34px 24px !important;
    }

    body.speas-app #modal-proveedor .modal-content {
        max-height: calc(100dvh - 68px) !important;
    }
}

@media (max-width: 600px) {
    body.speas-app #modal-proveedor.modal-overlay,
    body.speas-app #modal-acceso-b2b,
    body.speas-app #modal-confirmar-proveedor,
    body.speas-app #modal-copiar-datos {
        padding: 14px !important;
    }

    body.speas-app #modal-proveedor .modal-content,
    body.speas-app #modal-acceso-b2b .modal-content,
    body.speas-app #modal-confirmar-proveedor .modal-content,
    body.speas-app #modal-copiar-datos .modal-content {
        max-height: calc(100dvh - 28px) !important;
    }
}

/* Speas proveedores true viewport centering v46 */
body.speas-app #modal-proveedor.modal-overlay,
body.speas-app #modal-acceso-b2b,
body.speas-app #modal-confirmar-proveedor,
body.speas-app #modal-copiar-datos {
    left: -96px !important;
    top: -78px !important;
    right: auto !important;
    bottom: auto !important;
}

@media (max-width: 600px) {
    body.speas-app #modal-proveedor.modal-overlay,
    body.speas-app #modal-acceso-b2b,
    body.speas-app #modal-confirmar-proveedor,
    body.speas-app #modal-copiar-datos {
        left: -16px !important;
        top: -74px !important;
    }
}

/* Speas proveedores side editor and category contrast v47 */
body.speas-app #modal-proveedor.modal-overlay {
    align-items: stretch !important;
    justify-content: flex-end !important;
    padding: 0 !important;
}

body.speas-app #modal-proveedor .modal-content.slide-in-right,
body.speas-app #modal-proveedor .modal-content {
    width: min(48vw, 920px) !important;
    min-width: 720px !important;
    max-width: calc(100vw - var(--sidebar-w, 96px) - 24px) !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    border-radius: 18px 0 0 18px !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    overflow: hidden !important;
    transform: none !important;
}

body.speas-app #modal-proveedor .modal-header {
    min-height: 96px !important;
    padding: 24px 38px !important;
}

body.speas-app #modal-proveedor .modal-body {
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    padding: 28px 38px 32px !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
}

body.speas-app #modal-proveedor .modal-footer {
    position: static !important;
    min-height: 86px !important;
    padding: 16px 38px !important;
    align-items: center !important;
    justify-content: flex-end !important;
}

@media (min-width: 1600px) {
    body.speas-app #modal-proveedor .modal-content.slide-in-right,
    body.speas-app #modal-proveedor .modal-content {
        width: min(44vw, 980px) !important;
    }
}

@media (min-width: 721px) and (max-width: 1180px) {
    body.speas-app #modal-proveedor .modal-content.slide-in-right,
    body.speas-app #modal-proveedor .modal-content {
        width: min(82vw, 820px) !important;
        min-width: 0 !important;
        max-width: calc(100vw - 24px) !important;
    }
}

@media (max-width: 720px) {
    body.speas-app #modal-proveedor.modal-overlay {
        align-items: stretch !important;
        justify-content: flex-end !important;
        padding: 0 !important;
    }

    body.speas-app #modal-proveedor .modal-content.slide-in-right,
    body.speas-app #modal-proveedor .modal-content {
        width: 100vw !important;
        min-width: 0 !important;
        max-width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
    }

    body.speas-app #modal-proveedor .modal-header,
    body.speas-app #modal-proveedor .modal-body,
    body.speas-app #modal-proveedor .modal-footer {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
}

/* Speas proveedores nested inputs dark borders v48 */

/* Speas proveedores bank account field layout v49 */
body.speas-app #modal-proveedor #lista-banco-erp tr {
    display: grid !important;
    grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
    gap: 12px !important;
    align-items: center !important;
    padding: 16px !important;
}

body.speas-app #modal-proveedor #lista-banco-erp td {
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    padding: 0 !important;
}

body.speas-app #modal-proveedor #lista-banco-erp td:nth-child(1) {
    grid-column: span 2 !important;
}

body.speas-app #modal-proveedor #lista-banco-erp td:nth-child(2) {
    grid-column: span 5 !important;
}

body.speas-app #modal-proveedor #lista-banco-erp td:nth-child(3) {
    grid-column: span 4 !important;
}

body.speas-app #modal-proveedor #lista-banco-erp td:nth-child(4) {
    grid-column: span 6 !important;
}

body.speas-app #modal-proveedor #lista-banco-erp td:nth-child(5) {
    grid-column: span 5 !important;
}

body.speas-app #modal-proveedor #lista-banco-erp td:nth-child(6) {
    grid-column: span 1 !important;
    display: flex !important;
    justify-content: center !important;
}

body.speas-app #modal-proveedor #lista-banco-erp [data-f="cuenta"],
body.speas-app #modal-proveedor #lista-banco-erp [data-f="cci"] {
    min-width: 0 !important;
    width: 100% !important;
    font-size: 14px !important;
}

@media (max-width: 900px) {
    body.speas-app #modal-proveedor #lista-banco-erp td:nth-child(1),
    body.speas-app #modal-proveedor #lista-banco-erp td:nth-child(2),
    body.speas-app #modal-proveedor #lista-banco-erp td:nth-child(3),
    body.speas-app #modal-proveedor #lista-banco-erp td:nth-child(4),
    body.speas-app #modal-proveedor #lista-banco-erp td:nth-child(5) {
        grid-column: span 12 !important;
    }

    body.speas-app #modal-proveedor #lista-banco-erp td:nth-child(6) {
        grid-column: span 12 !important;
        justify-content: flex-end !important;
    }
}

/* Speas ordenes compra side panel and dark scroll polish v50 */
body.speas-app .modulo-container:has(#tabla-oc-interna) {
    padding: 30px 32px 28px !important;
}

body.speas-app .modulo-container:has(#tabla-oc-interna) .header-acciones {
    margin: 0 0 28px !important;
    padding: 16px 0 4px !important;
    gap: 22px !important;
}

body.speas-app .modulo-container:has(#tabla-oc-interna) .header-acciones h2 {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.25 !important;
}

body.speas-app .modulo-container:has(#tabla-oc-interna) .table-responsive {
    margin-top: 0 !important;
}

body.speas-app #modal-crear-oc.modal-overlay {
    align-items: stretch !important;
    justify-content: flex-end !important;
    padding: 0 !important;
}

body.speas-app #modal-crear-oc.modal-overlay:not(.hidden) {
    display: flex !important;
}

body.speas-app #modal-crear-oc .modal-content {
    width: min(52vw, 1000px) !important;
    min-width: 820px !important;
    max-width: calc(100vw - var(--sidebar-w, 96px) - 24px) !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    border-radius: 18px 0 0 18px !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    overflow: hidden !important;
    transform: none !important;
}

body.speas-app #modal-crear-oc .modal-header {
    min-height: 84px !important;
    padding: 24px 32px !important;
}

body.speas-app #modal-crear-oc .modal-body {
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    padding: 28px 32px 34px !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    scrollbar-width: thin !important;
    scrollbar-color: #5eead4 #263240 !important;
}

body.speas-app #modal-crear-oc .form-grid {
    gap: 22px 24px !important;
}

body.speas-app #modal-crear-oc .form-actions {
    display: flex !important;
    justify-content: flex-end !important;
    gap: 12px !important;
    padding-top: 6px !important;
}

@media (min-width: 1600px) {
    body.speas-app #modal-crear-oc .modal-content {
        width: min(46vw, 1040px) !important;
    }
}

@media (min-width: 721px) and (max-width: 1180px) {
    body.speas-app #modal-crear-oc .modal-content {
        width: min(84vw, 860px) !important;
        min-width: 0 !important;
        max-width: calc(100vw - 24px) !important;
    }
}

@media (max-width: 720px) {
    body.speas-app .modulo-container:has(#tabla-oc-interna) {
        padding: 18px 16px 20px !important;
    }

    body.speas-app .modulo-container:has(#tabla-oc-interna) .header-acciones {
        padding-top: 8px !important;
    }

    body.speas-app #modal-crear-oc.modal-overlay:not(.hidden) {
        align-items: stretch !important;
        justify-content: flex-end !important;
        padding: 0 !important;
    }

    body.speas-app #modal-crear-oc .modal-content {
        width: 100vw !important;
        min-width: 0 !important;
        max-width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
    }

    body.speas-app #modal-crear-oc .modal-header,
    body.speas-app #modal-crear-oc .modal-body {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
}

/* Speas global dark viewport scrollbar v52 */

/* Speas clientes dark spacing and side modal polish v53 */
body.speas-app .table-module-container:has(#tabla-clientes-body) {
    padding: 26px 32px 30px !important;
}

body.speas-app .table-module-container:has(#tabla-clientes-body) > .module-header {
    padding: 22px 26px !important;
    margin-bottom: 24px !important;
    border-radius: 14px !important;
    gap: 16px !important;
}

body.speas-app .table-module-container:has(#tabla-clientes-body) > .module-header .header-titles {
    min-width: 260px !important;
}

body.speas-app .table-module-container:has(#tabla-clientes-body) > .module-header h2 {
    margin: 0 0 8px !important;
    line-height: 1.18 !important;
}

body.speas-app .table-module-container:has(#tabla-clientes-body) > .module-header p {
    margin: 0 !important;
    line-height: 1.45 !important;
}

body.speas-app .table-module-container:has(#tabla-clientes-body) > .table-toolbar {
    padding: 20px !important;
    margin-bottom: 24px !important;
    border-radius: 14px !important;
}

body.speas-app .table-module-container:has(#tabla-clientes-body) > .table-toolbar .search-box {
    min-height: 50px !important;
}

body.speas-app .table-module-container:has(#tabla-clientes-body) > .table-responsive {
    border-radius: 14px !important;
    overflow: auto !important;
}

body.speas-app .table-module-container:has(#tabla-clientes-body) .premium-table th,
body.speas-app .table-module-container:has(#tabla-clientes-body) .premium-table td {
    padding: 16px 20px !important;
    vertical-align: middle !important;
}

body.speas-app .table-module-container:has(#tabla-clientes-body) .premium-table th:first-child,
body.speas-app .table-module-container:has(#tabla-clientes-body) .premium-table td:first-child {
    padding-left: 24px !important;
}

body.speas-app .table-module-container:has(#tabla-clientes-body) .premium-table th:last-child,
body.speas-app .table-module-container:has(#tabla-clientes-body) .premium-table td:last-child {
    padding-right: 24px !important;
}

body.speas-app .table-module-container:has(#tabla-clientes-body) > .pagination {
    padding: 20px 0 0 !important;
}

body.speas-app .table-module-container:has(#tabla-clientes-body) .kid-info {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    min-width: 118px !important;
    padding: 8px 12px !important;
    border-radius: 10px !important;
}

body.speas-app .table-module-container:has(#tabla-clientes-body) .kid-icon {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

body.speas-app .table-module-container:has(#tabla-clientes-body) .kid-name,
body.speas-app .table-module-container:has(#tabla-clientes-body) .client-contact span {
    line-height: 1.35 !important;
}

body.speas-app .table-module-container:has(#tabla-clientes-body) .badge-cat {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 30px !important;
    padding: 7px 14px !important;
    border-radius: 999px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    letter-spacing: 0 !important;
}

body.speas-app #modal-cliente.modal-overlay {
    align-items: stretch !important;
    justify-content: flex-end !important;
    padding: 0 !important;
}

body.speas-app #modal-cliente.modal-overlay.active {
    display: flex !important;
}

body.speas-app #modal-cliente .modal-content.slide-in-right {
    width: min(46vw, 920px) !important;
    min-width: 620px !important;
    max-width: calc(100vw - 32px) !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 18px 0 0 18px !important;
    display: grid !important;
    grid-template-rows: auto 1fr auto !important;
    overflow: hidden !important;
}

body.speas-app #modal-cliente .modal-header {
    padding: 28px 38px !important;
}

body.speas-app #modal-cliente .modal-body {
    padding: 28px 38px 34px !important;
    overflow: auto !important;
}

body.speas-app #modal-cliente .modal-footer {
    padding: 22px 38px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 14px !important;
}

body.speas-app #modal-cliente .row-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px !important;
}

body.speas-app #modal-cliente .input-group {
    margin-bottom: 18px !important;
}

body.speas-app #modal-cliente .input-group input,
body.speas-app #modal-cliente .input-group select {
    min-height: 54px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

body.speas-app #modal-cliente .form-subtitle {
    margin: 24px 0 18px !important;
    padding-bottom: 10px !important;
    line-height: 1.2 !important;
    letter-spacing: 0.02em !important;
}

@media (min-width: 1600px) {
    body.speas-app #modal-cliente .modal-content.slide-in-right {
        width: min(44vw, 980px) !important;
    }
}

@media (min-width: 721px) and (max-width: 1180px) {
    body.speas-app #modal-cliente .modal-content.slide-in-right {
        width: min(84vw, 900px) !important;
        min-width: 0 !important;
        max-width: calc(100vw - 24px) !important;
    }

    body.speas-app .table-module-container:has(#tabla-clientes-body) {
        padding: 22px 24px 28px !important;
    }
}

@media (max-width: 720px) {
    body.speas-app .table-module-container:has(#tabla-clientes-body) {
        padding: 18px 16px 22px !important;
    }

    body.speas-app .table-module-container:has(#tabla-clientes-body) > .module-header {
        padding: 18px !important;
        align-items: stretch !important;
    }

    body.speas-app .table-module-container:has(#tabla-clientes-body) > .module-header .btn-primary {
        width: 100% !important;
    }

    body.speas-app .table-module-container:has(#tabla-clientes-body) > .table-toolbar {
        display: grid !important;
        grid-template-columns: 1fr auto !important;
        padding: 16px !important;
    }

    body.speas-app .table-module-container:has(#tabla-clientes-body) > .table-responsive {
        max-width: 100% !important;
    }

    body.speas-app .table-module-container:has(#tabla-clientes-body) .premium-table {
        min-width: 760px !important;
    }

    body.speas-app .table-module-container:has(#tabla-clientes-body) .premium-table th,
    body.speas-app .table-module-container:has(#tabla-clientes-body) .premium-table td {
        padding: 14px 16px !important;
    }

    body.speas-app #modal-cliente.modal-overlay.active {
        align-items: stretch !important;
        justify-content: flex-end !important;
        padding: 0 !important;
    }

    body.speas-app #modal-cliente .modal-content.slide-in-right {
        width: 100vw !important;
        min-width: 0 !important;
        max-width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
    }

    body.speas-app #modal-cliente .modal-header,
    body.speas-app #modal-cliente .modal-body,
    body.speas-app #modal-cliente .modal-footer {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    body.speas-app #modal-cliente .row-grid {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    body.speas-app #modal-cliente .modal-footer {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }
}

/* Speas clientes fixed viewport modal scroll v54 */
body.speas-app #modal-cliente.modal-overlay,
body.speas-app #modal-cliente.modal-overlay.active {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    overflow: hidden !important;
    align-items: stretch !important;
    justify-content: flex-end !important;
    z-index: 10000 !important;
    overscroll-behavior: contain !important;
}

body.speas-app #modal-cliente .modal-content.slide-in-right,
body.speas-app #modal-cliente.modal-overlay.active .modal-content.slide-in-right {
    position: relative !important;
    top: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    left: auto !important;
    align-self: stretch !important;
    margin: 0 !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    transform: none !important;
    overflow: hidden !important;
}

body.speas-app #modal-cliente .modal-header,
body.speas-app #modal-cliente .modal-footer {
    flex: 0 0 auto !important;
    position: relative !important;
    z-index: 2 !important;
}

body.speas-app #modal-cliente .modal-body {
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    scrollbar-gutter: stable !important;
}

@media (min-width: 721px) {
    body.speas-app #modal-cliente .modal-content.slide-in-right,
    body.speas-app #modal-cliente.modal-overlay.active .modal-content.slide-in-right {
        border-radius: 18px 0 0 18px !important;
    }
}

@media (max-width: 720px) {
    body.speas-app #modal-cliente .modal-content.slide-in-right,
    body.speas-app #modal-cliente.modal-overlay.active .modal-content.slide-in-right {
        border-radius: 0 !important;
    }
}

/* Speas clientes modal safe gutter and responsive form v55 */
body.speas-app #modal-cliente.modal-overlay,
body.speas-app #modal-cliente.modal-overlay.active {
    width: 100% !important;
    max-width: 100% !important;
}

body.speas-app #modal-cliente .modal-content.slide-in-right,
body.speas-app #modal-cliente.modal-overlay.active .modal-content.slide-in-right {
    box-sizing: border-box !important;
    max-width: calc(100dvw - 28px) !important;
    margin-right: 0 !important;
}

body.speas-app #modal-cliente .modal-body {
    box-sizing: border-box !important;
    padding-right: max(46px, calc(38px + env(safe-area-inset-right))) !important;
}

body.speas-app #modal-cliente #form-cliente,
body.speas-app #modal-cliente .input-group,
body.speas-app #modal-cliente .row-grid {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

body.speas-app #modal-cliente .input-group input,
body.speas-app #modal-cliente .input-group select {
    max-width: 100% !important;
}

@media (min-width: 981px) and (max-width: 1180px) {
    body.speas-app #modal-cliente .modal-content.slide-in-right,
    body.speas-app #modal-cliente.modal-overlay.active .modal-content.slide-in-right {
        width: min(88vw, 900px) !important;
        max-width: calc(100dvw - 28px) !important;
    }
}

@media (min-width: 721px) and (max-width: 980px) {
    body.speas-app #modal-cliente .modal-content.slide-in-right,
    body.speas-app #modal-cliente.modal-overlay.active .modal-content.slide-in-right {
        width: min(90vw, 760px) !important;
        min-width: 0 !important;
        max-width: calc(100dvw - 28px) !important;
        border-radius: 18px 0 0 18px !important;
    }

    body.speas-app #modal-cliente .modal-header,
    body.speas-app #modal-cliente .modal-footer {
        padding-left: 30px !important;
        padding-right: 34px !important;
    }

    body.speas-app #modal-cliente .modal-body {
        padding-left: 30px !important;
        padding-right: 48px !important;
    }

    body.speas-app #modal-cliente .row-grid {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }
}

@media (max-width: 720px) {
    body.speas-app #modal-cliente .modal-content.slide-in-right,
    body.speas-app #modal-cliente.modal-overlay.active .modal-content.slide-in-right {
        max-width: 100dvw !important;
    }

    body.speas-app #modal-cliente .modal-body {
        padding-right: max(28px, calc(20px + env(safe-area-inset-right))) !important;
    }
}

/* Speas admin dark modules spacing pass v56 */

body.speas-app .crm-container,
body.speas-app .analytics-container,
body.speas-app .control-container,
body.speas-app .config-container,
body.speas-app .profile-container-premium {
    box-sizing: border-box;
    width: 100%;
}

body.speas-app .crm-container,
body.speas-app .analytics-container,
body.speas-app .control-container {
    padding: clamp(18px, 2vw, 32px) !important;
    gap: 22px !important;
}

body.speas-app .config-container,
body.speas-app .profile-container-premium {
    padding: clamp(18px, 2.2vw, 34px) !important;
}

body.speas-app .crm-container .module-header,
body.speas-app .analytics-container .module-header,
body.speas-app .control-container .control-header,
body.speas-app .config-container .module-header {
    padding: clamp(20px, 1.8vw, 30px) !important;
    margin: 0 0 22px !important;
    border: 1px solid var(--speas-border) !important;
    border-radius: 18px !important;
}

body.speas-app .crm-container .header-left,
body.speas-app .analytics-container .title-wrapper,
body.speas-app .control-container .control-header,
body.speas-app .config-container .module-header > div {
    min-width: 0;
}

body.speas-app .crm-container h2,
body.speas-app .analytics-container h2,
body.speas-app .control-container h2,
body.speas-app .config-container h2,
body.speas-app .profile-container-premium h2,
body.speas-app .profile-container-premium h3 {
    color: var(--speas-text) !important;
    text-shadow: none !important;
}

body.speas-app .crm-container p,
body.speas-app .analytics-container p,
body.speas-app .control-container p,
body.speas-app .config-container p,
body.speas-app .profile-container-premium p {
    color: var(--speas-muted) !important;
}

/* CRM / Leads */
body.speas-app .crm-container .header-actions {
    gap: 14px !important;
    flex-wrap: wrap !important;
}

body.speas-app .crm-container .table-responsive {
    min-height: 360px;
    border: 1px solid var(--speas-border) !important;
    border-radius: 18px !important;
    overflow: auto !important;
}

body.speas-app .crm-container .crm-table th,
body.speas-app .crm-container .crm-table td {
    padding: 14px 16px !important;
    border-color: var(--speas-border) !important;
}

body.speas-app .crm-container .crm-table th {
    white-space: nowrap;
}

/* Analitica */
body.speas-app .analytics-container .summary-cards-grid,
body.speas-app .analytics-container .charts-grid {
    gap: clamp(18px, 1.7vw, 28px) !important;
}

body.speas-app .analytics-container .toolbar-container,
body.speas-app .analytics-container .chart-card,
body.speas-app .analytics-container .table-responsive-modern {
    box-sizing: border-box !important;
    max-width: 100% !important;
    border-radius: 18px !important;
    padding: clamp(18px, 1.6vw, 26px) !important;
    border: 1px solid var(--speas-border) !important;
}

body.speas-app .analytics-container .table-responsive-modern {
    overflow: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

body.speas-app .analytics-container .premium-table {
    min-width: 780px !important;
}

body.speas-app .analytics-container .modern-input,
body.speas-app .analytics-container .modern-select {
    box-sizing: border-box !important;
    max-width: 100% !important;
}

body.speas-app .analytics-container canvas {
    display: block !important;
    max-width: 100% !important;
}

body.speas-app .analytics-container .pnl-pill {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 96px !important;
    padding: 7px 12px !important;
    border-radius: 9px !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
}

body.speas-app .analytics-container .pnl-pill.pnl-positive {
    background: #dcfce7 !important;
    border: 1px solid #bbf7d0 !important;
    color: #166534 !important;
}

body.speas-app .analytics-container .pnl-pill.pnl-negative {
    background: #fee2e2 !important;
    border: 1px solid #fecaca !important;
    color: #b91c1c !important;
}

/* Auditoria */
body.speas-app .control-container .control-actions,
body.speas-app .control-container .audit-filters,
body.speas-app .control-container .audit-pagination {
    gap: 14px !important;
    flex-wrap: wrap !important;
}

body.speas-app .control-container .audit-panel {
    padding: clamp(18px, 1.8vw, 28px) !important;
    border-radius: 18px !important;
    border: 1px solid var(--speas-border) !important;
}

body.speas-app .control-container .audit-filters {
    padding: 18px !important;
    border-radius: 16px !important;
}

body.speas-app .control-container .table-wrap-control {
    border-radius: 16px !important;
    overflow: auto !important;
    border: 1px solid var(--speas-border) !important;
}

body.speas-app .control-container .table-wrap-control th,
body.speas-app .control-container .table-wrap-control td {
    padding: 13px 14px !important;
}

/* Configuracion */
body.speas-app .config-container {
    max-width: min(1380px, 100%) !important;
}

body.speas-app .config-container .grid-layout {
    gap: 26px !important;
}

body.speas-app .config-container .card-block,
body.speas-app .config-container .full-width-card,
body.speas-app .config-container .sedes-list-card,
body.speas-app .config-container .sede-form-card {
    padding: clamp(22px, 1.8vw, 32px) !important;
    border-radius: 18px !important;
    border: 1px solid var(--speas-border) !important;
}

body.speas-app .config-container .selected-row {
    box-shadow: inset 4px 0 0 #4de1d2 !important;
}

body.speas-app .config-container .salon-section-toolbar {
    align-items: center !important;
    gap: 18px !important;
    margin-bottom: 18px !important;
}

body.speas-app .config-container .salon-sede-selector {
    width: min(360px, 100%) !important;
    min-width: 260px !important;
    margin-bottom: 0 !important;
}

body.speas-app .config-container .salon-sede-selector select {
    min-height: 48px !important;
    padding-right: 46px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    cursor: pointer !important;
}

body.speas-app .config-container .salon-sede-arrow {
    position: absolute !important;
    right: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: #64748b !important;
    font-size: 1.35rem !important;
    pointer-events: none !important;
    transition: color 0.18s ease, transform 0.18s ease !important;
}

body.speas-app .config-container .salon-sede-selector:focus-within .salon-sede-arrow {
    color: #14b8a6 !important;
    transform: translateY(-50%) rotate(180deg) !important;
}

body.speas-app .config-container .is-panel-focus {
    animation: speasPanelFocus 1.15s ease-out 1;
}

@keyframes speasPanelFocus {
    0% { box-shadow: 0 0 0 0 rgba(77, 225, 210, 0.45); }
    55% { box-shadow: 0 0 0 8px rgba(77, 225, 210, 0.18); }
    100% { box-shadow: 0 0 0 0 rgba(77, 225, 210, 0); }
}

/* Perfil */
body.speas-app .profile-container-premium {
    max-width: min(1500px, 100%) !important;
    grid-template-columns: minmax(300px, 370px) minmax(0, 1fr) !important;
}

body.speas-app .profile-sidebar-card,
body.speas-app .profile-content-card {
    border: 1px solid var(--speas-border) !important;
    border-radius: 20px !important;
}

@media (max-width: 1180px) {
    body.speas-app .crm-container .module-header,
    body.speas-app .analytics-container .module-header,
    body.speas-app .control-container .control-header,
    body.speas-app .config-container .module-header {
        align-items: flex-start !important;
    }

    body.speas-app .analytics-container .filters-wrapper,
    body.speas-app .analytics-container .actions-wrapper,
    body.speas-app .control-container .audit-filters {
        width: 100% !important;
    }

    body.speas-app .profile-container-premium {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 780px) {
    body.speas-app .crm-container,
    body.speas-app .analytics-container,
    body.speas-app .control-container,
    body.speas-app .config-container,
    body.speas-app .profile-container-premium {
        padding: 16px !important;
    }

    body.speas-app .crm-container .module-header,
    body.speas-app .analytics-container .module-header,
    body.speas-app .control-container .control-header,
    body.speas-app .config-container .module-header {
        padding: 18px !important;
    }

    body.speas-app .crm-container .header-actions,
    body.speas-app .analytics-container .toolbar-container,
    body.speas-app .analytics-container .filters-wrapper,
    body.speas-app .analytics-container .actions-wrapper,
    body.speas-app .config-container .form-row,
    body.speas-app .profile-container-premium .form-grid-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        width: 100% !important;
    }

    body.speas-app .crm-container .search-box,
    body.speas-app .analytics-container .modern-input,
    body.speas-app .analytics-container .modern-select,
    body.speas-app .config-container .search-box-simple {
        width: 100% !important;
        min-width: 0 !important;
    }

    body.speas-app .config-container .salon-section-toolbar {
        align-items: stretch !important;
    }

    body.speas-app .config-container .salon-sede-selector {
        width: 100% !important;
        min-width: 0 !important;
    }

    body.speas-app .analytics-container .charts-grid {
        grid-template-columns: 1fr !important;
    }

    body.speas-app .analytics-container .chart-body {
        height: 360px !important;
    }

    body.speas-app .config-container .grid-layout {
        grid-template-columns: 1fr !important;
        grid-template-areas: "photo" "info" "security" !important;
    }
}

/* Speas enterprise density v62 */
@media (min-width: 769px) {
    :root {
        --sidebar-width: 232px;
        --sidebar-close-width: 70px;
        --speas-input-h: 32px;
        --speas-topbar-h: 46px;
    }

    html {
        font-size: 13px;
    }

    body.speas-app {
        font-size: 12px !important;
    }

    body.speas-app .home {
        padding: 9px 14px 14px !important;
    }

    body.speas-app .header-text {
        min-height: var(--speas-topbar-h) !important;
        margin-bottom: 8px !important;
        padding: 0 10px 0 12px !important;
        border-radius: 10px !important;
    }

    body.speas-app #titulo-modulo,
    body.speas-app .home .text {
        font-size: 16px !important;
        line-height: 1.15 !important;
    }

    body.speas-app .speas-top-search {
        width: min(300px, 24vw) !important;
        height: 32px !important;
    }

    body.speas-app .speas-top-search input {
        font-size: 12px !important;
        height: 30px !important;
    }

    body.speas-app .speas-theme-switch {
        height: 32px !important;
    }

    body.speas-app .speas-theme-btn {
        width: 30px !important;
        height: 28px !important;
    }

    body.speas-app .sidebar {
        padding-top: 9px !important;
    }

    body.speas-app .sidebar header {
        margin-bottom: 8px !important;
    }

    body.speas-app .sidebar .image-text {
        min-height: 46px !important;
    }

    body.speas-app .sidebar .image .logo-icon {
        width: 36px !important;
        height: 36px !important;
        border-radius: 10px !important;
        font-size: 25px !important;
    }

    body.speas-app .sidebar li {
        height: 36px !important;
        margin-top: 3px !important;
    }

    body.speas-app .sidebar li .icon {
        font-size: 17px !important;
    }

    body.speas-app .sidebar li .text {
        font-size: 12px !important;
    }

    body.speas-app .sidebar.close:not(:hover):not(.mobile-active) .menu {
        padding: 0 10px 16px !important;
    }

    body.speas-app .sidebar.close:not(:hover):not(.mobile-active) li a {
        width: 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
    }

    body.speas-app .sidebar.close:not(:hover):not(.mobile-active) li .icon {
        width: 44px !important;
        flex-basis: 44px !important;
    }

    body.speas-app .profile-img {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
    }

    body.speas-app .profile-card {
        padding: 9px 11px !important;
        margin-bottom: 8px !important;
    }

    body.speas-app .contenedor-modulo {
        font-size: 12px !important;
    }

    body.speas-app :is(input, select, textarea, button) {
        font-size: 12px;
    }

    body.speas-app :is(.btn, .btn-primary, .btn-secondary, .btn-excel, .action-btn, .cat-btn, .meta-pill, .status-pill) {
        min-height: 30px !important;
        padding-top: 6px !important;
        padding-bottom: 6px !important;
        font-size: 11.5px !important;
    }

    body.speas-app :is(.module-header, .control-header, .catalog-title-bar, .section-toolbar, .header-acciones, .toolbar-container) h1,
    body.speas-app :is(.module-header, .control-header, .catalog-title-bar, .section-toolbar, .header-acciones, .toolbar-container) h2,
    body.speas-app :is(.module-header, .control-header, .catalog-title-bar, .section-toolbar, .header-acciones, .toolbar-container) h3 {
        font-size: 16px !important;
        line-height: 1.2 !important;
    }

    body.speas-app :is(.module-header, .control-header, .catalog-title-bar, .section-toolbar, .header-acciones, .toolbar-container) p {
        font-size: 12px !important;
        line-height: 1.35 !important;
    }

    body.speas-app :is(table, .table-custom, .premium-table, .simple-table, .data-table) th,
    body.speas-app :is(table, .table-custom, .premium-table, .simple-table, .data-table) td {
        padding: 8px 10px !important;
        font-size: 12px !important;
        line-height: 1.28 !important;
    }

    body.speas-app :is(.status-badge, .status-pill, .badge, .chip, .role-tag, .method-badge) {
        font-size: 10.5px !important;
        padding: 4px 8px !important;
        min-height: 0 !important;
    }

    body.speas-app .pos-container {
        height: calc(100vh - 64px) !important;
        gap: 18px !important;
        padding-bottom: 6px !important;
    }

    body.speas-app .pos-catalog {
        padding: 18px !important;
        border-radius: 14px !important;
    }

    body.speas-app .catalog-header {
        gap: 11px !important;
        margin-bottom: 14px !important;
    }

    body.speas-app .catalog-title-bar h2 {
        font-size: 17px !important;
    }

    body.speas-app .catalog-title-bar p {
        font-size: 12px !important;
    }

    body.speas-app .search-bar input {
        min-height: 38px !important;
        padding: 9px 14px 9px 42px !important;
        border-radius: 10px !important;
        font-size: 12px !important;
    }

    body.speas-app .search-bar i {
        left: 14px !important;
        font-size: 17px !important;
    }

    body.speas-app .category-tabs {
        gap: 7px !important;
        padding-bottom: 4px !important;
    }

    body.speas-app .cat-btn {
        padding-left: 14px !important;
        padding-right: 14px !important;
        border-radius: 8px !important;
    }

    body.speas-app .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)) !important;
        gap: 14px !important;
        padding: 4px 8px 28px 4px !important;
    }

    body.speas-app .product-card {
        min-height: 122px !important;
        padding: 12px !important;
        gap: 8px !important;
        border-radius: 13px !important;
    }

    body.speas-app .product-icon {
        width: 38px !important;
        height: 38px !important;
        border-radius: 11px !important;
    }

    body.speas-app .product-icon i {
        font-size: 19px !important;
    }

    body.speas-app .product-name {
        font-size: 12.5px !important;
        line-height: 1.2 !important;
        height: 2.45em !important;
        margin-bottom: 5px !important;
    }

    body.speas-app .product-price {
        font-size: 15.5px !important;
        line-height: 1.1 !important;
    }

    body.speas-app .badge-stock {
        font-size: 10px !important;
        padding: 2px 7px !important;
    }

    body.speas-app .pos-ticket {
        width: 330px !important;
        border-radius: 14px !important;
    }

    body.speas-app .ticket-header {
        padding: 14px 16px !important;
        border-radius: 14px 14px 0 0 !important;
    }

    body.speas-app .ticket-icon {
        width: 30px !important;
        height: 30px !important;
        border-radius: 10px !important;
    }

    body.speas-app .ticket-header h3 {
        font-size: 14px !important;
    }

    body.speas-app .ticket-subtitle {
        font-size: 10.5px !important;
    }

    body.speas-app .ticket-items {
        padding: 16px !important;
    }

    body.speas-app .cart-item {
        margin-bottom: 11px !important;
        padding-bottom: 11px !important;
    }

    body.speas-app .item-info h4 {
        font-size: 12.5px !important;
    }

    body.speas-app .item-info p,
    body.speas-app .summary-row {
        font-size: 11.5px !important;
    }

    body.speas-app .qty-btn {
        width: 23px !important;
        height: 23px !important;
    }

    body.speas-app .item-total {
        font-size: 13px !important;
    }

    body.speas-app .ticket-footer {
        padding: 16px !important;
        border-radius: 0 0 14px 14px !important;
    }

    body.speas-app .summary-row.total {
        font-size: 16px !important;
        margin-top: 10px !important;
        padding-top: 10px !important;
    }

    body.speas-app .btn-checkout {
        padding: 11px !important;
        margin-top: 12px !important;
        border-radius: 10px !important;
        font-size: 12.5px !important;
    }
}

@media (min-width: 1440px) {
    body.speas-app .home {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    body.speas-app .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    }
}

/* Speas shell edge alignment v63 */
@media (min-width: 769px) {
    body.speas-app .home,
    body.speas-app .sidebar.close ~ .home {
        position: fixed !important;
        left: var(--sidebar-close-width) !important;
        right: 0 !important;
        width: auto !important;
        max-width: none !important;
        box-sizing: border-box !important;
    }

    /* El menú compacto se expande al pasar el puntero. El contenido debe viajar
       con él; si conserva el desplazamiento compacto, los primeros 160 px del
       módulo quedan debajo del menú y aparentan pertenecer a otra pantalla. */
    body.speas-app .sidebar.close:hover ~ .home {
        left: var(--sidebar-width) !important;
    }

    body.speas-app .header-text,
    body.speas-app .contenedor-modulo {
        max-width: none !important;
    }
}

/* Speas global compact density v64 */
@media (min-width: 1024px) {
    :root {
        --sidebar-close-width: 64px;
        --speas-input-h: 30px;
        --speas-topbar-h: 40px;
        --speas-radius: 11px;
        --speas-radius-sm: 8px;
    }

    html {
        font-size: 12px;
    }

    body.speas-app {
        font-size: 11px !important;
    }

    body.speas-app .home {
        padding: 7px 11px 11px !important;
    }

    body.speas-app .header-text {
        min-height: 40px !important;
        margin-bottom: 7px !important;
        padding: 0 8px 0 10px !important;
        border-radius: 9px !important;
    }

    body.speas-app #titulo-modulo,
    body.speas-app .home .text {
        font-size: 14.5px !important;
        line-height: 1.1 !important;
    }

    body.speas-app .speas-top-search {
        width: min(270px, 22vw) !important;
        height: 29px !important;
        gap: 6px !important;
        padding: 0 8px !important;
        border-radius: 9px !important;
    }

    body.speas-app .speas-top-search i {
        font-size: 15px !important;
    }

    body.speas-app .speas-top-search input {
        height: 27px !important;
        font-size: 10.8px !important;
    }

    body.speas-app .speas-top-search span {
        padding: 1px 5px !important;
        font-size: 9.5px !important;
    }

    body.speas-app .speas-theme-switch {
        height: 29px !important;
        gap: 2px !important;
    }

    body.speas-app .speas-theme-btn {
        width: 26px !important;
        height: 25px !important;
    }

    body.speas-app .sidebar {
        padding-top: 7px !important;
    }

    body.speas-app .sidebar header {
        margin-bottom: 6px !important;
        padding-left: 7px !important;
        padding-right: 7px !important;
    }

    body.speas-app .sidebar .image-text {
        min-height: 40px !important;
    }

    body.speas-app .sidebar .image .logo-icon {
        width: 32px !important;
        height: 32px !important;
        border-radius: 9px !important;
        font-size: 22px !important;
    }

    body.speas-app .sidebar li {
        height: 32px !important;
        margin-top: 2px !important;
        padding-left: 7px !important;
        padding-right: 7px !important;
    }

    body.speas-app .sidebar li .icon {
        font-size: 15.5px !important;
    }

    body.speas-app .sidebar li .text {
        font-size: 11px !important;
    }

    body.speas-app .sidebar.close:not(:hover):not(.mobile-active) .menu {
        padding: 0 8px 12px !important;
    }

    body.speas-app .sidebar.close:not(:hover):not(.mobile-active) li a {
        width: 40px !important;
        min-width: 40px !important;
        max-width: 40px !important;
    }

    body.speas-app .sidebar.close:not(:hover):not(.mobile-active) li .icon {
        width: 40px !important;
        flex-basis: 40px !important;
    }

    body.speas-app .profile-img {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
    }

    body.speas-app .profile-card {
        padding: 7px 8px !important;
        margin-bottom: 7px !important;
        border-radius: 10px !important;
    }

    body.speas-app .contenedor-modulo {
        font-size: 11px !important;
    }

    body.speas-app :is(.module-header, .page-header, .control-header, .catalog-title-bar, .section-toolbar, .toolbar-container, .header-acciones, .dashboard-hero, .dashboard-card, .card, .panel, .kpi-card, .metric-card, .summary-card, .table-container, .filters-card) {
        border-radius: 11px !important;
    }

    body.speas-app :is(.module-header, .page-header, .control-header, .section-toolbar, .toolbar-container, .header-acciones, .dashboard-hero) {
        padding: 12px 14px !important;
        margin-bottom: 10px !important;
    }

    body.speas-app :is(.card, .panel, .kpi-card, .metric-card, .summary-card, .table-container, .filters-card) {
        padding: 12px !important;
    }

    body.speas-app :is(.module-header, .page-header, .control-header, .catalog-title-bar, .section-toolbar, .toolbar-container, .header-acciones) h1,
    body.speas-app :is(.module-header, .page-header, .control-header, .catalog-title-bar, .section-toolbar, .toolbar-container, .header-acciones) h2,
    body.speas-app :is(.module-header, .page-header, .control-header, .catalog-title-bar, .section-toolbar, .toolbar-container, .header-acciones) h3,
    body.speas-app .contenedor-modulo h1,
    body.speas-app .contenedor-modulo h2 {
        font-size: 14.5px !important;
        line-height: 1.15 !important;
    }

    body.speas-app .contenedor-modulo h3 {
        font-size: 13px !important;
        line-height: 1.15 !important;
    }

    body.speas-app :is(.module-header, .page-header, .control-header, .catalog-title-bar, .section-toolbar, .toolbar-container, .header-acciones) p,
    body.speas-app .contenedor-modulo p,
    body.speas-app .muted-line {
        font-size: 10.8px !important;
        line-height: 1.3 !important;
    }

    body.speas-app :is(input, select, textarea) {
        min-height: 30px !important;
        padding-top: 6px !important;
        padding-bottom: 6px !important;
        font-size: 11px !important;
        border-radius: 8px !important;
    }

    body.speas-app textarea {
        min-height: 70px !important;
    }

    body.speas-app :is(button, .btn, .btn-primary, .btn-secondary, .btn-excel, .action-btn, .cat-btn, .meta-pill, .status-pill, .tab-btn, .filter-btn) {
        min-height: 28px !important;
        padding: 5px 10px !important;
        font-size: 10.8px !important;
        border-radius: 8px !important;
    }

    body.speas-app :is(table, .table-custom, .premium-table, .simple-table, .data-table) th,
    body.speas-app :is(table, .table-custom, .premium-table, .simple-table, .data-table) td {
        padding: 6px 8px !important;
        font-size: 11px !important;
        line-height: 1.22 !important;
    }

    body.speas-app :is(.status-badge, .status-pill, .badge, .chip, .role-tag, .method-badge) {
        font-size: 9.8px !important;
        padding: 3px 7px !important;
        border-radius: 7px !important;
    }

    body.speas-app :is(.stats-grid, .kpi-grid, .metrics-grid, .dashboard-grid, .charts-grid, .cards-grid, .quick-actions-grid) {
        gap: 10px !important;
    }

    body.speas-app :is(.pagination, .pagination-controls, .table-footer) {
        gap: 7px !important;
        font-size: 10.8px !important;
    }

    body.speas-app :is(.pagination button, .pagination-controls button) {
        width: 28px !important;
        height: 28px !important;
        min-height: 28px !important;
    }

    body.speas-app .modal-content,
    body.speas-app .side-modal,
    body.speas-app .drawer-modal {
        font-size: 11px !important;
    }

    body.speas-app .modal-header {
        padding: 12px 16px !important;
    }

    body.speas-app .modal-body {
        padding: 14px 16px !important;
    }

    body.speas-app .modal-footer {
        padding: 12px 16px !important;
    }

    body.speas-app .pos-container {
        height: calc(100vh - 54px) !important;
        gap: 14px !important;
    }

    body.speas-app .pos-catalog {
        padding: 14px !important;
        border-radius: 12px !important;
    }

    body.speas-app .catalog-header {
        gap: 9px !important;
        margin-bottom: 11px !important;
    }

    body.speas-app .search-bar input {
        min-height: 32px !important;
        padding: 7px 12px 7px 36px !important;
        font-size: 11px !important;
    }

    body.speas-app .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)) !important;
        gap: 11px !important;
        padding: 3px 6px 22px 3px !important;
    }

    body.speas-app .product-card {
        min-height: 104px !important;
        padding: 10px !important;
        gap: 6px !important;
        border-radius: 11px !important;
    }

    body.speas-app .product-icon {
        width: 32px !important;
        height: 32px !important;
        border-radius: 9px !important;
    }

    body.speas-app .product-icon i {
        font-size: 16px !important;
    }

    body.speas-app .product-name {
        font-size: 11px !important;
        height: 2.35em !important;
        margin-bottom: 3px !important;
    }

    body.speas-app .product-price {
        font-size: 13.5px !important;
    }

    body.speas-app .badge-stock {
        font-size: 9px !important;
        padding: 2px 6px !important;
    }

    body.speas-app .pos-ticket {
        width: 292px !important;
        border-radius: 12px !important;
    }

    body.speas-app .ticket-header,
    body.speas-app .ticket-items,
    body.speas-app .ticket-footer {
        padding: 12px !important;
    }

    body.speas-app .ticket-icon {
        width: 27px !important;
        height: 27px !important;
        border-radius: 8px !important;
    }

    body.speas-app .ticket-header h3 {
        font-size: 12.5px !important;
    }

    body.speas-app .ticket-subtitle {
        font-size: 9.5px !important;
    }

    body.speas-app .summary-row.total {
        font-size: 14px !important;
    }

    body.speas-app .btn-checkout {
        padding: 9px !important;
        font-size: 11px !important;
    }
}

/* Speas normal/soft clarity and density v65 */

@media (min-width: 1024px) {
    html {
        font-size: 11.2px;
    }

    body.speas-app {
        font-size: 10.5px !important;
    }

    body.speas-app .home {
        padding: 6px 9px 9px !important;
    }

    body.speas-app .header-text {
        min-height: 36px !important;
        margin-bottom: 6px !important;
        padding: 0 7px 0 9px !important;
    }

    body.speas-app #titulo-modulo,
    body.speas-app .home .text {
        font-size: 13.6px !important;
    }

    body.speas-app .contenedor-modulo {
        font-size: 10.5px !important;
    }

    body.speas-app :is(.module-header, .page-header, .control-header, .section-toolbar, .toolbar-container, .header-acciones, .dashboard-hero) {
        padding: 10px 12px !important;
        margin-bottom: 8px !important;
    }

    body.speas-app :is(.card, .panel, .kpi-card, .metric-card, .summary-card, .table-container, .filters-card) {
        padding: 10px !important;
    }

    body.speas-app :is(.module-header, .page-header, .control-header, .catalog-title-bar, .section-toolbar, .toolbar-container, .header-acciones) h1,
    body.speas-app :is(.module-header, .page-header, .control-header, .catalog-title-bar, .section-toolbar, .toolbar-container, .header-acciones) h2,
    body.speas-app :is(.module-header, .page-header, .control-header, .catalog-title-bar, .section-toolbar, .toolbar-container, .header-acciones) h3,
    body.speas-app .contenedor-modulo h1,
    body.speas-app .contenedor-modulo h2 {
        font-size: 13.8px !important;
    }

    body.speas-app :is(input, select, textarea) {
        min-height: 28px !important;
        padding-top: 5px !important;
        padding-bottom: 5px !important;
        font-size: 10.5px !important;
    }

    body.speas-app :is(button, .btn, .btn-primary, .btn-secondary, .btn-excel, .action-btn, .cat-btn, .meta-pill, .status-pill, .tab-btn, .filter-btn) {
        min-height: 26px !important;
        padding: 4px 9px !important;
        font-size: 10.3px !important;
    }

    body.speas-app :is(table, .table-custom, .premium-table, .simple-table, .data-table) th,
    body.speas-app :is(table, .table-custom, .premium-table, .simple-table, .data-table) td {
        padding: 5px 7px !important;
        font-size: 10.4px !important;
    }

    body.speas-app .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)) !important;
        gap: 10px !important;
    }

    body.speas-app .product-card {
        min-height: 94px !important;
        padding: 9px !important;
    }

    body.speas-app .pos-ticket {
        width: 270px !important;
    }

    body.speas-app .modal-header,
    body.speas-app .modal-body,
    body.speas-app .modal-footer {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }
}

/* Speas normal/soft module hardening v66 */

@media (min-width: 1024px) {
    body.speas-app :is(.saldo-card, .cash-balance-card, .balance-main-card) {
        padding: 14px !important;
    }

    body.speas-app :is(.saldo-card, .cash-balance-card, .balance-main-card) :is(h1, h2, .amount, .balance-amount) {
        font-size: 16px !important;
    }

    body.speas-app :is(.fc-button) {
        padding: 4px 8px !important;
        font-size: 10.2px !important;
    }

    body.speas-app :is(.fc-col-header-cell, .fc-daygrid-day-frame) {
        padding: 4px !important;
    }
}

/* Speas global density and light theme viewport hardening v67 */
body.speas-app {
    overflow-x: hidden !important;
}

body.speas-app .home {
    box-sizing: border-box !important;
    max-width: calc(100vw - var(--sidebar-close-width, 80px)) !important;
}

body.speas-app .sidebar:not(.close) ~ .home {
    max-width: calc(100vw - var(--sidebar-width, 260px)) !important;
}

body.speas-app .contenedor-modulo,
body.speas-app .contenedor-modulo > * {
    box-sizing: border-box !important;
}

body.speas-app .contenedor-modulo {
    width: 100% !important;
    max-width: none !important;
    margin-right: 0 !important;
}

body.speas-app :is(.table-responsive, .table-scroll, .table-responsive-kardex, .products-wrapper, .category-tabs, .tabs-wrapper, .modal-body, .drawer-body, .sidebar .menu) {
    scrollbar-width: thin !important;
}

body.speas-app :is(.table-responsive, .table-scroll, .table-responsive-kardex, .products-wrapper, .category-tabs, .tabs-wrapper, .modal-body, .drawer-body, .sidebar .menu)::-webkit-scrollbar {
    display: block !important;
    width: 10px !important;
    height: 10px !important;
}

@media (min-width: 1600px) {
    body.speas-app .home {
        padding-right: 10px !important;
    }

    body.speas-app .contenedor-modulo > :is(.module-container, .dashboard-container, .analytics-container, .crm-container, .config-container, .profile-container, .caja-container, .caja-chica-container, .pos-container, .table-module-container, .dashboard-shell, .home-dashboard) {
        width: 100% !important;
        max-width: none !important;
    }
}

@media (max-width: 768px) {
    body.speas-app .home {
        max-width: 100vw !important;
    }
}

/* Speas light theme solid white correction v68 */

/* Speas normal theme clean white correction v69 */

/* Speas global density 80 percent v70 */
@media (min-width: 1024px) {
    :root {
        --sidebar-close-width: 72px;
        --speas-input-h: 32px;
        --speas-topbar-h: 44px;
        --speas-radius: 12px;
        --speas-radius-sm: 9px;
    }

    html {
        font-size: 12.8px;
    }

    body.speas-app {
        font-size: 11.8px !important;
    }

    body.speas-app .home {
        padding: 8px 13px 13px !important;
    }

    body.speas-app .header-text {
        min-height: 44px !important;
        margin-bottom: 8px !important;
        padding: 0 10px 0 12px !important;
        border-radius: 10px !important;
    }

    body.speas-app #titulo-modulo,
    body.speas-app .home .text {
        font-size: 15.6px !important;
        line-height: 1.12 !important;
    }

    body.speas-app .speas-top-search {
        width: min(292px, 23vw) !important;
        height: 32px !important;
        gap: 7px !important;
        padding: 0 9px !important;
        border-radius: 10px !important;
    }

    body.speas-app .speas-top-search i {
        font-size: 16px !important;
    }

    body.speas-app .speas-top-search input {
        height: 29px !important;
        font-size: 11.6px !important;
    }

    body.speas-app .speas-top-search span {
        padding: 1px 5px !important;
        font-size: 10px !important;
    }

    body.speas-app .speas-theme-switch {
        height: 31px !important;
        gap: 3px !important;
    }

    body.speas-app .speas-theme-btn {
        width: 27px !important;
        height: 26px !important;
    }

    body.speas-app .sidebar header {
        margin-bottom: 7px !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    body.speas-app .sidebar .image-text {
        min-height: 43px !important;
    }

    body.speas-app .sidebar .image .logo-icon {
        width: 35px !important;
        height: 35px !important;
        border-radius: 10px !important;
        font-size: 24px !important;
    }

    body.speas-app .sidebar li {
        height: 35px !important;
        margin-top: 3px !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    body.speas-app .sidebar li .icon {
        font-size: 16.8px !important;
    }

    body.speas-app .sidebar li .text {
        font-size: 11.8px !important;
    }

    body.speas-app .sidebar.close:not(:hover):not(.mobile-active) .menu {
        padding: 0 9px 13px !important;
    }

    body.speas-app .sidebar.close:not(:hover):not(.mobile-active) li a {
        width: 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
    }

    body.speas-app .sidebar.close:not(:hover):not(.mobile-active) li .icon {
        width: 44px !important;
        flex-basis: 44px !important;
    }

    body.speas-app .profile-img {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
    }

    body.speas-app .profile-card {
        padding: 8px 9px !important;
        margin-bottom: 8px !important;
        border-radius: 11px !important;
    }

    body.speas-app .contenedor-modulo {
        font-size: 11.8px !important;
    }

    body.speas-app :is(.module-header, .page-header, .control-header, .section-toolbar, .toolbar-container, .header-acciones, .dashboard-hero) {
        padding: 13px 15px !important;
        margin-bottom: 11px !important;
    }

    body.speas-app :is(.card, .panel, .kpi-card, .metric-card, .summary-card, .table-container, .filters-card) {
        padding: 13px !important;
    }

    body.speas-app :is(input, select, textarea, .form-control, .form-select, .search-input, .search-box) {
        min-height: 32px !important;
        font-size: 11.8px !important;
    }

    body.speas-app :is(button, .btn, .action-btn, .icon-btn, .cat-btn, .tab-btn, .filter-btn, .export-btn) {
        min-height: 32px !important;
        font-size: 11.5px !important;
    }

    body.speas-app :is(th, .table-head, .table-header) {
        font-size: 11.2px !important;
        height: 35px !important;
    }

    body.speas-app :is(td, .table-row) {
        font-size: 11.6px !important;
    }

    body.speas-app :is(.product-card, .pos-product-card) {
        min-height: 154px !important;
        padding: 15px !important;
    }
}

/* Speas normal theme pure white blue correction v71 */

/* Speas normal theme pure white final module override v72 */

/* Speas normal theme blue accent cleanup v73 */

/* Speas flujo caja KPI compact spacing v74 */
body.speas-app .caja-container .kpi-grid-temporal .kpi-card {
    justify-content: flex-start !important;
    gap: 16px !important;
    min-height: 118px !important;
    padding: 24px 28px !important;
}

body.speas-app .caja-container .kpi-grid-temporal .kpi-card .card-header-flex {
    margin-bottom: 0 !important;
}

body.speas-app .caja-container .kpi-grid-temporal .kpi-card .amount-big {
    margin: 0 !important;
    line-height: 1.08 !important;
}

@media (max-width: 900px) {
    body.speas-app .caja-container .kpi-grid-temporal .kpi-card {
        min-height: 104px !important;
        padding: 20px 22px !important;
        gap: 12px !important;
    }
}

/* Speas global 90 density at 100 percent v75 */
@media (min-width: 1024px) {
    html {
        font-size: 13.2px;
    }

    body.speas-app {
        font-size: 12.2px !important;
    }

    body.speas-app .home {
        padding: 7px 12px 12px !important;
        overflow-x: hidden !important;
    }

    body.speas-app #contenedor-dinamico,
    body.speas-app .contenedor-modulo,
    body.speas-app .module-content {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: clip;
    }

    body.speas-app .header-text {
        min-height: 42px !important;
        margin-bottom: 8px !important;
        padding: 0 9px 0 11px !important;
        border-radius: 10px !important;
    }

    body.speas-app #titulo-modulo,
    body.speas-app .home .text {
        font-size: 15px !important;
        line-height: 1.1 !important;
    }

    body.speas-app .speas-top-search {
        height: 30px !important;
        width: min(286px, 22vw) !important;
        padding: 0 8px !important;
        border-radius: 9px !important;
    }

    body.speas-app .speas-top-search input {
        height: 27px !important;
        font-size: 11.2px !important;
    }

    body.speas-app :is(
        .module-header,
        .page-header,
        .control-header,
        .section-toolbar,
        .toolbar-container,
        .header-acciones,
        .dashboard-hero,
        .hero-panel,
        .filter-panel,
        .filters-panel,
        .filter-section,
        .filters-section,
        .table-toolbar,
        .module-toolbar
    ) {
        padding: 11px 14px !important;
        margin-bottom: 10px !important;
        gap: 9px !important;
    }

    body.speas-app :is(
        .module-header h1,
        .module-header h2,
        .page-header h1,
        .page-header h2,
        .header-titles h1,
        .header-titles h2,
        .section-title,
        .panel-title
    ) {
        font-size: 17px !important;
        line-height: 1.15 !important;
        margin-bottom: 3px !important;
    }

    body.speas-app :is(
        .header-titles p,
        .module-header p,
        .page-header p,
        .section-subtitle,
        .panel-subtitle
    ) {
        font-size: 11.6px !important;
        line-height: 1.25 !important;
    }

    body.speas-app :is(
        .card,
        .panel,
        .kpi-card,
        .metric-card,
        .summary-card,
        .table-container,
        .table-module-container,
        .filters-card,
        .content-card,
        .section-card,
        .crud-card,
        .premium-card,
        .dashboard-card
    ) {
        padding: 11px 12px !important;
        border-radius: 12px !important;
    }

    body.speas-app :is(
        .table-responsive,
        .table-scroll,
        .premium-table-container,
        .table-wrapper,
        .table-card
    ) {
        border-radius: 10px !important;
    }

    body.speas-app :is(
        table,
        .premium-table,
        .data-table,
        .crm-table,
        .simple-table,
        .table-custom
    ) {
        font-size: 11.4px !important;
    }

    body.speas-app :is(
        th,
        .premium-table th,
        .data-table th,
        .crm-table th,
        .simple-table th,
        .table-custom th
    ) {
        height: 31px !important;
        padding: 9px 11px !important;
        font-size: 10.8px !important;
        line-height: 1.15 !important;
    }

    body.speas-app :is(
        td,
        .premium-table td,
        .data-table td,
        .crm-table td,
        .simple-table td,
        .table-custom td
    ) {
        padding: 9px 11px !important;
        font-size: 11.2px !important;
        line-height: 1.22 !important;
    }

    body.speas-app :is(
        input,
        select,
        textarea,
        .form-control,
        .form-select,
        .search-input,
        .search-box input
    ) {
        min-height: 31px !important;
        font-size: 11.4px !important;
        border-radius: 9px !important;
    }

    body.speas-app :is(
        button,
        .btn,
        .btn-primary,
        .btn-secondary,
        .action-btn,
        .cat-btn,
        .tab-btn,
        .filter-btn,
        .export-btn
    ) {
        min-height: 31px !important;
        padding: 7px 11px !important;
        font-size: 11.2px !important;
        border-radius: 9px !important;
    }

    body.speas-app :is(.btn-icon, .icon-btn, .action-icon, .premium-table .btn-icon) {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        min-height: 30px !important;
        padding: 0 !important;
    }

    body.speas-app :is(.badge, .status-badge, .pill, .chip, .badge-pago, .estado-badge) {
        padding: 3px 7px !important;
        font-size: 10px !important;
        line-height: 1.1 !important;
        border-radius: 8px !important;
    }

    body.speas-app :is(.modal-content, .modal-box, .drawer-panel, .side-modal, .modal-panel) {
        font-size: 12px !important;
    }

    body.speas-app :is(.modal-header, .drawer-header, .modal-footer, .drawer-footer) {
        padding: 13px 16px !important;
    }

    body.speas-app :is(.modal-body, .drawer-body) {
        padding: 14px 16px !important;
    }

    body.speas-app .pos-catalog .product-card,
    body.speas-app :is(.product-card, .pos-product-card) {
        min-height: 145px !important;
        padding: 13px !important;
    }

    body.speas-app .caja-container .kpi-grid-temporal .kpi-card {
        min-height: 106px !important;
        padding: 19px 23px !important;
        gap: 10px !important;
    }
}

@media (min-width: 1600px) {
    body.speas-app :is(.premium-table th, .data-table th, .crm-table th, .simple-table th) {
        padding-top: 8px !important;
        padding-bottom: 8px !important;
    }

    body.speas-app :is(.premium-table td, .data-table td, .crm-table td, .simple-table td) {
        padding-top: 8px !important;
        padding-bottom: 8px !important;
    }
}

@media (max-width: 1023px) {
    body.speas-app :is(.premium-table th, .data-table th, .crm-table th, .simple-table th) {
        padding: 9px 10px !important;
    }

    body.speas-app :is(.premium-table td, .data-table td, .crm-table td, .simple-table td) {
        padding: 9px 10px !important;
    }
}

/* Speas per-module density adapters v76 */
@media (min-width: 1024px) {
    body.speas-app :is(
        .analytics-container,
        .caja-chica-container,
        .calendar-module-container,
        .config-container,
        .control-container,
        .crm-container,
        .despacho-container,
        .modulo-container,
        .module-container,
        .pos-container,
        .profile-container-premium,
        .table-module-container,
        .terceros-container
    ) {
        padding: 10px 12px !important;
        gap: 10px !important;
    }

    body.speas-app :is(
        .analytics-container,
        .caja-chica-container,
        .calendar-module-container,
        .config-container,
        .control-container,
        .crm-container,
        .despacho-container,
        .modulo-container,
        .module-container,
        .pos-container,
        .profile-container-premium,
        .table-module-container,
        .terceros-container
    ) :is(
        .module-header,
        .module-header-tabs,
        .despacho-header,
        .control-header,
        .catalog-header,
        .header-acciones
    ) {
        padding: 11px 14px !important;
        margin-bottom: 10px !important;
        min-height: auto !important;
        gap: 9px !important;
    }

    body.speas-app :is(
        .analytics-container,
        .caja-chica-container,
        .calendar-module-container,
        .config-container,
        .control-container,
        .crm-container,
        .despacho-container,
        .modulo-container,
        .module-container,
        .pos-container,
        .profile-container-premium,
        .table-module-container,
        .terceros-container
    ) :is(h1, h2, .catalog-title-bar h2, .despacho-title h2, .control-header h2, .header-left h2, .header-titles h2) {
        font-size: 16.6px !important;
        line-height: 1.14 !important;
        margin-bottom: 3px !important;
    }

    body.speas-app :is(
        .analytics-container,
        .caja-chica-container,
        .calendar-module-container,
        .config-container,
        .control-container,
        .crm-container,
        .despacho-container,
        .modulo-container,
        .module-container,
        .pos-container,
        .profile-container-premium,
        .table-module-container,
        .terceros-container
    ) :is(p, small, .catalog-title-bar p, .despacho-title p, .header-left p, .header-titles p) {
        font-size: 11.4px !important;
        line-height: 1.24 !important;
    }

    body.speas-app :is(
        .analytics-container,
        .caja-chica-container,
        .calendar-module-container,
        .config-container,
        .control-container,
        .crm-container,
        .despacho-container,
        .modulo-container,
        .module-container,
        .pos-container,
        .profile-container-premium,
        .table-module-container,
        .terceros-container
    ) :is(
        .table-toolbar,
        .tabs-wrapper,
        .tabs-terceros,
        .category-tabs,
        .filter-actions,
        .header-actions,
        .despacho-actions,
        .control-actions,
        .catalog-meta
    ) {
        gap: 8px !important;
        margin-bottom: 9px !important;
        padding: 9px 11px !important;
    }

    body.speas-app :is(
        .analytics-container,
        .caja-chica-container,
        .calendar-module-container,
        .config-container,
        .control-container,
        .crm-container,
        .despacho-container,
        .modulo-container,
        .module-container,
        .pos-container,
        .profile-container-premium,
        .table-module-container,
        .terceros-container
    ) :is(
        .summary-cards-grid,
        .kpi-dashboard-grid,
        .kpi-grid-temporal,
        .kpi-resumen-bar,
        .actions-grid,
        .grid-layout,
        .quick-actions-grid,
        .content-grid,
        .validation-wrapper,
        .charts-grid,
        .profile-grid,
        .pos-layout
    ) {
        gap: 12px !important;
        margin-bottom: 12px !important;
    }

    body.speas-app :is(
        .analytics-container,
        .caja-chica-container,
        .calendar-module-container,
        .config-container,
        .control-container,
        .crm-container,
        .despacho-container,
        .modulo-container,
        .module-container,
        .pos-container,
        .profile-container-premium,
        .table-module-container,
        .terceros-container
    ) :is(
        .kpi-card,
        .kpi-card-modern,
        .saldo-card,
        .btn-action,
        .scanner-card,
        .chart-card,
        .card-block,
        .full-width-card,
        .profile-sidebar-card,
        .profile-form-card,
        .panel-card,
        .table-responsive,
        .calendar-wrapper,
        .calendar-sidebar,
        .calendar-main,
        .pos-catalog,
        .cart-panel,
        .order-panel
    ) {
        padding: 13px 14px !important;
        border-radius: 12px !important;
        min-height: auto !important;
    }

    body.speas-app :is(
        .analytics-container,
        .caja-chica-container,
        .calendar-module-container,
        .config-container,
        .control-container,
        .crm-container,
        .despacho-container,
        .modulo-container,
        .module-container,
        .pos-container,
        .profile-container-premium,
        .table-module-container,
        .terceros-container
    ) :is(input, select, textarea, .search-box input, .search-bar input, .date-filter, .input-group-lg input) {
        height: auto !important;
        min-height: 31px !important;
        padding: 7px 11px !important;
        font-size: 11.4px !important;
    }

    body.speas-app :is(
        .analytics-container,
        .caja-chica-container,
        .calendar-module-container,
        .config-container,
        .control-container,
        .crm-container,
        .despacho-container,
        .modulo-container,
        .module-container,
        .pos-container,
        .profile-container-premium,
        .table-module-container,
        .terceros-container
    ) :is(
        .premium-table th,
        .crm-table thead th,
        .despacho-table th,
        .table-custom th,
        .table-wrap-control th
    ) {
        padding: 8px 10px !important;
        font-size: 10.7px !important;
        height: 30px !important;
    }

    body.speas-app :is(
        .analytics-container,
        .caja-chica-container,
        .calendar-module-container,
        .config-container,
        .control-container,
        .crm-container,
        .despacho-container,
        .modulo-container,
        .module-container,
        .pos-container,
        .profile-container-premium,
        .table-module-container,
        .terceros-container
    ) :is(
        .premium-table td,
        .crm-table td,
        .despacho-table td,
        .table-custom td,
        .table-wrap-control td
    ) {
        padding: 8px 10px !important;
        font-size: 11.1px !important;
        line-height: 1.2 !important;
    }

    body.speas-app :is(
        .analytics-container,
        .caja-chica-container,
        .calendar-module-container,
        .config-container,
        .control-container,
        .crm-container,
        .despacho-container,
        .modulo-container,
        .module-container,
        .pos-container,
        .profile-container-premium,
        .table-module-container,
        .terceros-container
    ) :is(.modal-header, .modal-body, .modal-footer) {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    body.speas-app :is(
        .analytics-container,
        .caja-chica-container,
        .calendar-module-container,
        .config-container,
        .control-container,
        .crm-container,
        .despacho-container,
        .modulo-container,
        .module-container,
        .pos-container,
        .profile-container-premium,
        .table-module-container,
        .terceros-container
    ) :is(.modal-header) {
        padding-top: 13px !important;
        padding-bottom: 13px !important;
    }

    body.speas-app :is(
        .analytics-container,
        .caja-chica-container,
        .calendar-module-container,
        .config-container,
        .control-container,
        .crm-container,
        .despacho-container,
        .modulo-container,
        .module-container,
        .pos-container,
        .profile-container-premium,
        .table-module-container,
        .terceros-container
    ) :is(.modal-body) {
        padding-top: 14px !important;
        padding-bottom: 14px !important;
    }

    body.speas-app :is(
        .analytics-container,
        .caja-chica-container,
        .calendar-module-container,
        .config-container,
        .control-container,
        .crm-container,
        .despacho-container,
        .modulo-container,
        .module-container,
        .pos-container,
        .profile-container-premium,
        .table-module-container,
        .terceros-container
    ) :is(.modal-footer) {
        padding-top: 12px !important;
        padding-bottom: 12px !important;
    }
}

@media (min-width: 1024px) and (max-width: 1366px) {
    body.speas-app :is(
        .analytics-container,
        .caja-chica-container,
        .calendar-module-container,
        .config-container,
        .control-container,
        .crm-container,
        .despacho-container,
        .modulo-container,
        .module-container,
        .pos-container,
        .profile-container-premium,
        .table-module-container,
        .terceros-container
    ) {
        padding: 9px 10px !important;
    }
}

/* Speas per-module CSS density coverage v77 */
@media (min-width: 1024px) {
    body.speas-app :is(
        .dashboard-container,
        .dashboard-shell,
        .home-dashboard,
        .speas-home,
        .analytics-container,
        .calendar-module-container,
        .caja-container,
        .caja-chica-container,
        .config-container,
        .control-container,
        .crm-container,
        .despacho-container,
        .modulo-container,
        .module-container,
        .pos-container,
        .pos-shell,
        .profile-container,
        .profile-container-premium,
        .table-module-container,
        .terceros-container,
        .ventas-module
    ) {
        padding-block: 9px !important;
        padding-inline: 12px !important;
        row-gap: 10px !important;
        column-gap: 10px !important;
    }

    body.speas-app :is(
        .dashboard-container,
        .dashboard-shell,
        .home-dashboard,
        .speas-home,
        .analytics-container,
        .calendar-module-container,
        .caja-container,
        .caja-chica-container,
        .config-container,
        .control-container,
        .crm-container,
        .despacho-container,
        .modulo-container,
        .module-container,
        .pos-container,
        .pos-shell,
        .profile-container,
        .profile-container-premium,
        .table-module-container,
        .terceros-container,
        .ventas-module
    ) :is(
        .module-header,
        .module-header-tabs,
        .catalog-header,
        .despacho-header,
        .control-header,
        .crm-header,
        .header-acciones,
        .toolbar-container,
        .table-toolbar,
        .filters-wrapper,
        .filter-actions,
        .tabs-wrapper,
        .tabs-container,
        .tabs-terceros,
        .category-tabs
    ) {
        padding: 9px 12px !important;
        margin-block: 0 9px !important;
        min-height: 0 !important;
        gap: 8px !important;
    }

    body.speas-app :is(
        .dashboard-container,
        .dashboard-shell,
        .home-dashboard,
        .speas-home,
        .analytics-container,
        .calendar-module-container,
        .caja-container,
        .caja-chica-container,
        .config-container,
        .control-container,
        .crm-container,
        .despacho-container,
        .modulo-container,
        .module-container,
        .pos-container,
        .pos-shell,
        .profile-container,
        .profile-container-premium,
        .table-module-container,
        .terceros-container,
        .ventas-module
    ) :is(
        .kpi-dashboard-grid,
        .summary-cards-grid,
        .dashboard-cards-container,
        .kpi-grid-temporal,
        .kpi-resumen-bar,
        .cards-methods-grid,
        .saldo-card-container,
        .actions-grid,
        .content-grid,
        .grid-layout,
        .grid-row,
        .row-grid,
        .quick-grid,
        .shortcuts-grid,
        .speas-grid-main,
        .speas-workspace-grid,
        .validation-wrapper,
        .gestion-grid,
        .charts-grid,
        .profile-grid,
        .form-grid,
        .form-grid-row,
        .flow-selector-container,
        .credit-summary-card
    ) {
        gap: 10px !important;
        margin-bottom: 10px !important;
    }

    body.speas-app :is(
        .dashboard-container,
        .dashboard-shell,
        .home-dashboard,
        .speas-home,
        .analytics-container,
        .calendar-module-container,
        .caja-container,
        .caja-chica-container,
        .config-container,
        .control-container,
        .crm-container,
        .despacho-container,
        .modulo-container,
        .module-container,
        .pos-container,
        .pos-shell,
        .profile-container,
        .profile-container-premium,
        .table-module-container,
        .terceros-container,
        .ventas-module
    ) :is(
        .kpi-card,
        .kpi-card-modern,
        .card-resumen,
        .saldo-card,
        .saldo-card.en-cero,
        .saldo-caja-container,
        .cash-balance-card,
        .balance-main-card,
        .scanner-card,
        .history-card,
        .chart-card,
        .chart-card-ranking,
        .speas-panel,
        .speas-panel-card,
        .quick-action-card,
        .shortcut-card,
        .profile-sidebar-card,
        .profile-content-card,
        .profile-form-card,
        .panel-card,
        .full-width-card,
        .audit-panel,
        .salones-card,
        .flow-card,
        .simulation-wrapper,
        .credit-summary-card,
        .table-container,
        .table-responsive,
        .table-responsive-kardex,
        .table-scroll,
        .table-mini-wrapper,
        .calendar-wrapper,
        .calendar-sidebar,
        .calendar-main,
        .pos-catalog,
        .cart-panel,
        .order-panel
    ) {
        padding: 12px 13px !important;
        border-radius: 11px !important;
        min-height: 0 !important;
    }

    body.speas-app :is(
        .dashboard-container,
        .dashboard-shell,
        .home-dashboard,
        .speas-home,
        .analytics-container,
        .calendar-module-container,
        .caja-container,
        .caja-chica-container,
        .config-container,
        .control-container,
        .crm-container,
        .despacho-container,
        .modulo-container,
        .module-container,
        .pos-container,
        .pos-shell,
        .profile-container,
        .profile-container-premium,
        .table-module-container,
        .terceros-container,
        .ventas-module
    ) :is(h1, h2, h3, .module-header h2, .catalog-title-bar h2, .despacho-title h2, .control-header h2, .header-left h2, .header-titles h2, .card-header h3) {
        font-size: clamp(14px, 0.95vw, 16.5px) !important;
        line-height: 1.14 !important;
        margin-bottom: 3px !important;
    }

    body.speas-app :is(
        .dashboard-container,
        .dashboard-shell,
        .home-dashboard,
        .speas-home,
        .analytics-container,
        .calendar-module-container,
        .caja-container,
        .caja-chica-container,
        .config-container,
        .control-container,
        .crm-container,
        .despacho-container,
        .modulo-container,
        .module-container,
        .pos-container,
        .pos-shell,
        .profile-container,
        .profile-container-premium,
        .table-module-container,
        .terceros-container,
        .ventas-module
    ) :is(p, small, label, .module-header p, .catalog-title-bar p, .despacho-title p, .header-left p, .header-titles p, .card-header p) {
        font-size: 11.2px !important;
        line-height: 1.24 !important;
    }

    body.speas-app :is(
        .dashboard-container,
        .dashboard-shell,
        .home-dashboard,
        .speas-home,
        .analytics-container,
        .calendar-module-container,
        .caja-container,
        .caja-chica-container,
        .config-container,
        .control-container,
        .crm-container,
        .despacho-container,
        .modulo-container,
        .module-container,
        .pos-container,
        .pos-shell,
        .profile-container,
        .profile-container-premium,
        .table-module-container,
        .terceros-container,
        .ventas-module
    ) :is(input, select, textarea, .form-control, .form-select, .search-input, .search-box, .input-wrapper input, .input-wrapper select, .input-wrapper textarea) {
        min-height: 31px !important;
        padding: 7px 10px !important;
        font-size: 11.3px !important;
        line-height: 1.18 !important;
    }

    body.speas-app :is(
        .dashboard-container,
        .dashboard-shell,
        .home-dashboard,
        .speas-home,
        .analytics-container,
        .calendar-module-container,
        .caja-container,
        .caja-chica-container,
        .config-container,
        .control-container,
        .crm-container,
        .despacho-container,
        .modulo-container,
        .module-container,
        .pos-container,
        .pos-shell,
        .profile-container,
        .profile-container-premium,
        .table-module-container,
        .terceros-container,
        .ventas-module
    ) :is(button, .btn, .action-btn, .btn-action, .tab-btn, .cat-btn, .filter-btn, .export-btn, .primary-action, .btn-primary, .btn-success) {
        min-height: 31px !important;
        padding: 7px 11px !important;
        font-size: 11.1px !important;
    }

    body.speas-app :is(
        .dashboard-container,
        .dashboard-shell,
        .home-dashboard,
        .speas-home,
        .analytics-container,
        .calendar-module-container,
        .caja-container,
        .caja-chica-container,
        .config-container,
        .control-container,
        .crm-container,
        .despacho-container,
        .modulo-container,
        .module-container,
        .pos-container,
        .pos-shell,
        .profile-container,
        .profile-container-premium,
        .table-module-container,
        .terceros-container,
        .ventas-module
    ) :is(.btn-icon, .icon-btn, .action-icon, .premium-table .btn-icon) {
        width: 29px !important;
        height: 29px !important;
        min-height: 29px !important;
        padding: 0 !important;
    }

    body.speas-app :is(.premium-table, .data-table, .crm-table, .despacho-table, .table-custom, .simple-table, .kardex-table, .cash-table, .audit-table) {
        font-size: 11.2px !important;
    }

    body.speas-app :is(.premium-table th, .data-table th, .crm-table th, .despacho-table th, .table-custom th, .simple-table th, .kardex-table th, .cash-table th, .audit-table th) {
        height: 30px !important;
        padding: 8px 10px !important;
        font-size: 10.6px !important;
        line-height: 1.15 !important;
    }

    body.speas-app :is(.premium-table td, .data-table td, .crm-table td, .despacho-table td, .table-custom td, .simple-table td, .kardex-table td, .cash-table td, .audit-table td) {
        padding: 8px 10px !important;
        font-size: 11.1px !important;
        line-height: 1.2 !important;
    }

    body.speas-app :is(.modal-content, .modal-box, .modal-content-custom, .drawer-panel, .side-modal, .modal-panel) {
        font-size: 11.8px !important;
    }

    body.speas-app :is(.modal-header, .drawer-header, .modal-footer, .drawer-footer) {
        padding: 12px 15px !important;
    }

    body.speas-app :is(.modal-body, .drawer-body) {
        padding: 13px 15px !important;
    }
}

@media (min-width: 1367px) {
    body.speas-app :is(.product-card, .pos-product-card) {
        min-height: 142px !important;
        padding: 12px !important;
    }

    body.speas-app :is(.kpi-card, .kpi-card-modern) :is(h3, .amount, .balance-amount) {
        font-size: clamp(16px, 1.1vw, 18px) !important;
        margin-top: 6px !important;
    }
}

@media (min-width: 1024px) and (max-width: 1366px) {
    body.speas-app :is(
        .dashboard-container,
        .dashboard-shell,
        .home-dashboard,
        .speas-home,
        .analytics-container,
        .calendar-module-container,
        .caja-container,
        .caja-chica-container,
        .config-container,
        .control-container,
        .crm-container,
        .despacho-container,
        .modulo-container,
        .module-container,
        .pos-container,
        .pos-shell,
        .profile-container,
        .profile-container-premium,
        .table-module-container,
        .terceros-container,
        .ventas-module
    ) {
        padding-block: 8px !important;
        padding-inline: 10px !important;
    }

    body.speas-app :is(.kpi-card, .kpi-card-modern, .summary-card, .product-card, .pos-product-card) {
        padding: 11px !important;
    }
}

/* Historial and inventory search: align icon with placeholder and keep focus on the field only. */
body.speas-app :is(
    .contenedor-modulo > .table-module-container.fade-in:has(#historial-search),
    .table-module-container:has(#buscador-productos)
) .search-box {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    width: min(100%, 520px) !important;
    max-width: 520px !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    outline: 0 !important;
    overflow: visible !important;
}

body.speas-app :is(
    .contenedor-modulo > .table-module-container.fade-in:has(#historial-search),
    .table-module-container:has(#buscador-productos)
) .search-box:focus,
body.speas-app :is(
    .contenedor-modulo > .table-module-container.fade-in:has(#historial-search),
    .table-module-container:has(#buscador-productos)
) .search-box:focus-within {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
}

body.speas-app :is(
    .contenedor-modulo > .table-module-container.fade-in:has(#historial-search),
    .table-module-container:has(#buscador-productos)
) .search-box i {
    position: absolute !important;
    left: 14px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 2 !important;
    width: 18px !important;
    height: 18px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    line-height: 1 !important;
    font-size: 18px !important;
    pointer-events: none !important;
    color: #64748b !important;
}

body.speas-app :is(#historial-search, #buscador-productos) {
    display: block !important;
    width: 100% !important;
    height: 38px !important;
    min-height: 38px !important;
    line-height: 38px !important;
    padding: 0 14px 0 46px !important;
    margin: 0 !important;
    border: 1px solid #cbdcf0 !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    color: #0f172a !important;
    box-shadow: none !important;
    outline: 0 !important;
    vertical-align: middle !important;
}

body.speas-app :is(#historial-search, #buscador-productos)::placeholder {
    color: #73829a !important;
    opacity: 1 !important;
}

body.speas-app :is(#historial-search, #buscador-productos):focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.16) !important;
    outline: 0 !important;
}

@media (max-width: 768px) {
    body.speas-app :is(
        .contenedor-modulo > .table-module-container.fade-in:has(#historial-search),
        .table-module-container:has(#buscador-productos)
    ) .search-box {
        width: 100% !important;
        max-width: none !important;
    }
}

/* Inventario: compact spacing between category tabs, search filters and table. */
body.speas-app .table-module-container:has(#tabla-productos-body) {
    gap: 8px !important;
}

body.speas-app .table-module-container:has(#tabla-productos-body) > .tabs-container {
    margin: 0 !important;
    padding: 8px 12px 9px !important;
    min-height: 0 !important;
    border-bottom: 1px solid rgba(203, 220, 240, 0.72) !important;
}

body.speas-app .table-module-container:has(#tabla-productos-body) > .table-toolbar {
    min-height: 46px !important;
    height: auto !important;
    margin: 8px 12px 8px !important;
    padding: 10px 14px !important;
    border-radius: 14px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

body.speas-app .table-module-container:has(#tabla-productos-body) > .table-responsive {
    margin: 0 12px !important;
    padding-top: 0 !important;
}

body.speas-app .table-module-container:has(#tabla-productos-body) .premium-table thead th {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

@media (min-width: 1200px) {
    body.speas-app .table-module-container:has(#tabla-productos-body) > .table-toolbar {
        margin-top: 6px !important;
        margin-bottom: 8px !important;
    }
}

@media (max-width: 768px) {
    body.speas-app .table-module-container:has(#tabla-productos-body) > .tabs-container {
        padding: 7px 8px 8px !important;
    }

    body.speas-app .table-module-container:has(#tabla-productos-body) > .table-toolbar {
        margin: 6px 8px 8px !important;
        padding: 10px !important;
    }

    body.speas-app .table-module-container:has(#tabla-productos-body) > .table-responsive {
        margin: 0 8px !important;
    }
}

/* Proveedores: compact search area and align the input icon with the placeholder. */
body.speas-app .table-module-container:has(#tabla-proveedores-body) {
    gap: 10px !important;
    padding-top: 16px !important;
}

body.speas-app .table-module-container:has(#tabla-proveedores-body) > .module-header {
    margin: 0 12px 8px !important;
    padding: 16px 22px !important;
    min-height: 0 !important;
}

body.speas-app .table-module-container:has(#tabla-proveedores-body) > .table-toolbar {
    min-height: 46px !important;
    height: auto !important;
    margin: 4px 12px 8px !important;
    padding: 10px 14px !important;
    border-radius: 14px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

body.speas-app .table-module-container:has(#tabla-proveedores-body) > .table-responsive {
    margin: 0 12px !important;
    padding: 0 !important;
}

body.speas-app .table-module-container:has(#tabla-proveedores-body) > .pagination {
    margin: 8px 12px 0 !important;
    padding: 0 !important;
}

body.speas-app .table-module-container:has(#buscador-proveedores) .search-box {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    width: min(100%, 420px) !important;
    max-width: 420px !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    outline: 0 !important;
    overflow: visible !important;
}

body.speas-app .table-module-container:has(#buscador-proveedores) .search-box:focus,
body.speas-app .table-module-container:has(#buscador-proveedores) .search-box:focus-within {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
}

body.speas-app .table-module-container:has(#buscador-proveedores) .search-box i {
    position: absolute !important;
    left: 14px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 2 !important;
    width: 18px !important;
    height: 18px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    line-height: 1 !important;
    font-size: 18px !important;
    pointer-events: none !important;
    color: #64748b !important;
}

body.speas-app #buscador-proveedores {
    display: block !important;
    width: 100% !important;
    height: 38px !important;
    min-height: 38px !important;
    line-height: 38px !important;
    padding: 0 14px 0 46px !important;
    margin: 0 !important;
    border: 1px solid #cbdcf0 !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    color: #0f172a !important;
    box-shadow: none !important;
    outline: 0 !important;
    vertical-align: middle !important;
}

body.speas-app #buscador-proveedores::placeholder {
    color: #73829a !important;
    opacity: 1 !important;
}

body.speas-app #buscador-proveedores:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.16) !important;
}

@media (max-width: 768px) {
    body.speas-app .table-module-container:has(#tabla-proveedores-body) {
        gap: 8px !important;
        padding-top: 10px !important;
    }

    body.speas-app .table-module-container:has(#tabla-proveedores-body) > .module-header,
    body.speas-app .table-module-container:has(#tabla-proveedores-body) > .table-toolbar,
    body.speas-app .table-module-container:has(#tabla-proveedores-body) > .table-responsive,
    body.speas-app .table-module-container:has(#tabla-proveedores-body) > .pagination {
        margin-left: 8px !important;
        margin-right: 8px !important;
    }

    body.speas-app .table-module-container:has(#buscador-proveedores) .search-box {
        width: 100% !important;
        max-width: none !important;
    }
}

/* Ordenes de compra: give table rows a little breathing room without losing density. */
body.speas-app .modulo-container:has(#tabla-oc-interna) .table-custom th {
    padding-top: 11px !important;
    padding-bottom: 11px !important;
    line-height: 1.25 !important;
}

body.speas-app .modulo-container:has(#tabla-oc-interna) #tabla-oc-interna td {
    padding-top: 11px !important;
    padding-bottom: 11px !important;
    line-height: 1.35 !important;
    vertical-align: middle !important;
}

body.speas-app .modulo-container:has(#tabla-oc-interna) #tabla-oc-interna tr {
    min-height: 46px !important;
}

body.speas-app .modulo-container:has(#tabla-oc-interna) #tabla-oc-interna .status-badge,
body.speas-app .modulo-container:has(#tabla-oc-interna) #tabla-oc-interna .status {
    line-height: 1.15 !important;
    padding-top: 5px !important;
    padding-bottom: 5px !important;
}

@media (max-width: 768px) {
    body.speas-app .modulo-container:has(#tabla-oc-interna) .table-custom th,
    body.speas-app .modulo-container:has(#tabla-oc-interna) #tabla-oc-interna td {
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   MODALES — Premium responsivo al tema v3.3.18
   ═══════════════════════════════════════════════════════════════ */

.speas-modal-overlay,
.modal-overlay {
    backdrop-filter: blur(10px) saturate(1.2) !important;
}

/* ═══════════════════════════════════════════════════════════════
   LOGIN — Insight cards del panel de acceso v3.4.3
   ═══════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   LOGIN — Override final blindado v3.3.19
   El archivo tiene bloques duplicados de versiones anteriores que
   pintaban el panel de claro/negro. Estas reglas van al final con
   !important para garantizar que siempre ganen en la cascada.
   ═══════════════════════════════════════════════════════════════ */

@keyframes speasLogoGlow {
    0%, 100% { box-shadow: 0 0 0 1px rgba(255,255,255,0.15) inset, 0 8px 24px rgba(59, 130, 246, 0.45); }
    50%       { box-shadow: 0 0 0 1px rgba(255,255,255,0.20) inset, 0 8px 34px rgba(99, 102, 241, 0.65); }
}

/* Insight cards y signal-grid — acentos azul/indigo, no rosa */

/* Finanzas scoped dark-theme readability override v3.3.22 final layer */

/* Themed notifications true final priority v3.3.24 */
body.speas-app .mini-notif,
body.speas-app .toast {
    border: 1px solid var(--speas-border, #d8e1ee) !important;
    border-left-width: 5px !important;
    background: var(--speas-surface, #ffffff) !important;
    color: var(--speas-text, #111827) !important;
    border-radius: 12px !important;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16) !important;
}

body.speas-app .mini-notif.success,
body.speas-app .toast.success {
    border-left-color: var(--speas-toast-success, #16a34a) !important;
    background: linear-gradient(135deg, var(--speas-toast-success-soft, #ecfdf5), var(--speas-surface, #ffffff)) !important;
}

body.speas-app .mini-notif.warning,
body.speas-app .toast.warning {
    border-left-color: var(--speas-toast-warning, #d97706) !important;
    background: linear-gradient(135deg, var(--speas-toast-warning-soft, #fffbeb), var(--speas-surface, #ffffff)) !important;
}

body.speas-app .mini-notif.error,
body.speas-app .toast.error {
    border-left-color: var(--speas-toast-error, #dc2626) !important;
    background: linear-gradient(135deg, var(--speas-toast-error-soft, #fef2f2), var(--speas-surface, #ffffff)) !important;
}

body.speas-app .mini-notif.info,
body.speas-app .toast.info {
    border-left-color: var(--speas-toast-info, #2563eb) !important;
    background: linear-gradient(135deg, var(--speas-toast-info-soft, #eff6ff), var(--speas-surface, #ffffff)) !important;
}

/* Sidebar active and hover separation v3.3.25 */

/* Speas flujo caja final responsive priority v3.3.26 */
@media (max-width: 640px) {
    html body.speas-app #contenedor-dinamico .caja-container {
        max-width: 430px !important;
        padding: 12px 12px 44px !important;
    }

    html body.speas-app #contenedor-dinamico .caja-container .header-actions {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        gap: 8px !important;
        width: 100% !important;
    }

    html body.speas-app #contenedor-dinamico .caja-container .period-tabs {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        width: 100% !important;
        overflow: visible !important;
        white-space: normal !important;
        gap: 3px !important;
    }

    html body.speas-app #contenedor-dinamico .caja-container .cards-methods-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    html body.speas-app #contenedor-dinamico .caja-container .method-card-detail {
        flex-direction: column !important;
        min-height: 108px !important;
        padding: 12px 8px !important;
        gap: 8px !important;
        justify-content: center !important;
        text-align: center !important;
    }

    html body.speas-app #contenedor-dinamico .caja-container .method-card-detail .icon-box {
        width: 38px !important;
        height: 38px !important;
        flex: 0 0 38px !important;
        font-size: 18px !important;
        margin: 0 auto !important;
    }

    html body.speas-app #contenedor-dinamico .caja-container .method-card-detail .method-info span {
        font-size: 11px !important;
        line-height: 1.15 !important;
    }

    html body.speas-app #contenedor-dinamico .caja-container .method-card-detail .method-info h3 {
        font-size: 14px !important;
        line-height: 1.1 !important;
    }

    html body.speas-app #contenedor-dinamico .caja-container .table-responsive {
        overflow: visible !important;
        padding: 0 !important;
    }

    html body.speas-app #contenedor-dinamico .caja-container .premium-table,
    html body.speas-app #contenedor-dinamico .caja-container .premium-table thead,
    html body.speas-app #contenedor-dinamico .caja-container .premium-table tbody,
    html body.speas-app #contenedor-dinamico .caja-container .premium-table tr,
    html body.speas-app #contenedor-dinamico .caja-container .premium-table th,
    html body.speas-app #contenedor-dinamico .caja-container .premium-table td {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    html body.speas-app #contenedor-dinamico .caja-container .premium-table thead {
        display: none !important;
    }

    html body.speas-app #contenedor-dinamico .caja-container .premium-table tbody {
        display: grid !important;
        gap: 12px !important;
    }

    html body.speas-app #contenedor-dinamico .caja-container .premium-table tr {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0 !important;
        padding: 12px !important;
        border: 1px solid var(--speas-border, #dbe6f2) !important;
        border-radius: 14px !important;
        background: var(--speas-surface, #ffffff) !important;
        box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06) !important;
    }

    html body.speas-app #contenedor-dinamico .caja-container .premium-table td {
        display: grid !important;
        grid-template-columns: 78px minmax(0, 1fr) !important;
        gap: 9px !important;
        align-items: start !important;
        padding: 8px 0 !important;
        border-bottom: 1px solid var(--speas-border, #edf2f7) !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        font-size: 12px !important;
        line-height: 1.25 !important;
    }

    html body.speas-app #contenedor-dinamico .caja-container .premium-table td:last-child {
        border-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    html body.speas-app #contenedor-dinamico .caja-container .premium-table td::before {
        color: var(--speas-muted, #64748b) !important;
        content: "" !important;
        font-size: 10px !important;
        font-weight: 800 !important;
        letter-spacing: 0.04em !important;
        text-transform: uppercase !important;
    }

    html body.speas-app #contenedor-dinamico .caja-container .premium-table td:nth-child(1)::before { content: "Hora" !important; }
    html body.speas-app #contenedor-dinamico .caja-container .premium-table td:nth-child(2)::before { content: "Tipo" !important; }
    html body.speas-app #contenedor-dinamico .caja-container .premium-table td:nth-child(3)::before { content: "Origen" !important; }
    html body.speas-app #contenedor-dinamico .caja-container .premium-table td:nth-child(4)::before { content: "Metodo" !important; }
    html body.speas-app #contenedor-dinamico .caja-container .premium-table td:nth-child(5)::before { content: "Monto" !important; }
    html body.speas-app #contenedor-dinamico .caja-container .premium-table td:nth-child(6)::before { content: "Usuario" !important; }

    html body.speas-app #contenedor-dinamico .caja-container .premium-table td .caja-fecha-cell,
    html body.speas-app #contenedor-dinamico .caja-container .premium-table td .caja-monto-value {
        grid-column: 2 !important;
        min-width: 0 !important;
    }

    html body.speas-app #contenedor-dinamico .caja-container .premium-table td .caja-monto-value small {
        display: inline !important;
        margin-left: 4px !important;
    }
}

@media (max-width: 360px) {
    html body.speas-app #contenedor-dinamico .caja-container .cards-methods-grid,
    html body.speas-app #contenedor-dinamico .caja-container .kpi-grid-temporal,
    html body.speas-app #contenedor-dinamico .caja-container .header-actions {
        grid-template-columns: 1fr !important;
    }

    html body.speas-app #contenedor-dinamico .caja-container .btn-success {
        width: 100% !important;
    }
}

/* Speas caja chica final responsive and modal priority v3.3.27 */
body.speas-app.speas-modal-open {
    overflow: hidden !important;
}

body.speas-app #contenedor-dinamico .caja-chica-container {
    max-width: min(100%, 1780px) !important;
}

body.speas-app #contenedor-dinamico .caja-chica-container .saldo-card-container {
    display: grid !important;
    grid-template-columns: minmax(280px, 1.45fr) repeat(2, minmax(220px, 0.72fr)) !important;
    align-items: stretch !important;
}

body.speas-app #contenedor-dinamico .caja-chica-container .actions-grid {
    display: contents !important;
}

body.speas-app #contenedor-dinamico .caja-chica-container .saldo-card,
body.speas-app #contenedor-dinamico .caja-chica-container .btn-action {
    border-radius: 16px !important;
    min-height: 166px !important;
}

body.speas-app #contenedor-dinamico .caja-chica-container .saldo-card {
    background: var(--speas-surface, #ffffff) !important;
    color: var(--speas-text, #111827) !important;
    border: 1px solid var(--speas-border, #dbe6f2) !important;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.05) !important;
}

body.speas-app #contenedor-dinamico .caja-chica-container .saldo-info h1,
body.speas-app #contenedor-dinamico .caja-chica-container .saldo-info span {
    color: var(--speas-text, #111827) !important;
}

body.speas-app #contenedor-dinamico .caja-chica-container .saldo-info span {
    color: var(--speas-muted, #64748b) !important;
}

body.speas-app #modal-chica.modal-overlay,
body.speas-app #modal-success.modal-overlay,
body.speas-app #modal-error.modal-overlay {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    z-index: 999999 !important;
    align-items: center !important;
    justify-content: center !important;
    padding: clamp(12px, 2vw, 24px) !important;
    background: color-mix(in srgb, var(--speas-bg, #0f172a) 58%, rgba(15, 23, 42, 0.68)) !important;
    backdrop-filter: blur(10px) !important;
    overflow: hidden !important;
}

body.speas-app #modal-chica .modal-content.center-modal,
body.speas-app #modal-success .modal-content,
body.speas-app #modal-error .modal-content {
    display: grid !important;
    align-items: stretch !important;
    text-align: left !important;
    width: min(94vw, 520px) !important;
    max-width: 520px !important;
    max-height: calc(100dvh - 32px) !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    border-radius: 20px !important;
    background: var(--speas-surface, #ffffff) !important;
    color: var(--speas-text, #111827) !important;
    border: 1px solid var(--speas-border, #dbe6f2) !important;
    box-shadow: 0 28px 82px rgba(15, 23, 42, 0.22) !important;
}

body.speas-app #modal-chica .modal-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 14px !important;
    margin: 0 !important;
    padding: 20px 22px !important;
    border-bottom: 1px solid var(--speas-border, #dbe6f2) !important;
}

body.speas-app #modal-chica .modal-header h3 {
    color: var(--speas-text, #111827) !important;
    font-size: clamp(18px, 1.15vw, 21px) !important;
    line-height: 1.2 !important;
    margin: 0 !important;
}

body.speas-app #modal-chica .modal-body {
    min-height: 0 !important;
    overflow-y: auto !important;
    padding: 22px !important;
    overscroll-behavior: contain !important;
}

body.speas-app #modal-chica #form-chica {
    display: grid !important;
    gap: 16px !important;
}

body.speas-app #modal-chica #tipo-badge-container {
    margin: 0 !important;
    text-align: left !important;
}

body.speas-app #modal-chica .input-group {
    margin: 0 !important;
}

body.speas-app #modal-chica .input-group label {
    color: var(--speas-muted, #64748b) !important;
}

body.speas-app #modal-chica .input-group input,
body.speas-app #modal-chica .input-group select,
body.speas-app #modal-chica .input-group textarea {
    min-height: 48px !important;
    border-color: var(--speas-border, #dbe6f2) !important;
    background: var(--speas-surface, #ffffff) !important;
    color: var(--speas-text, #111827) !important;
    box-shadow: none !important;
}

body.speas-app #modal-chica.tipo-ingreso .input-group input:focus,
body.speas-app #modal-chica.tipo-ingreso .input-group select:focus,
body.speas-app #modal-chica.tipo-ingreso .input-group textarea:focus {
    border-color: #22c55e !important;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12) !important;
}

body.speas-app #modal-chica.tipo-gasto .input-group input:focus,
body.speas-app #modal-chica.tipo-gasto .input-group select:focus,
body.speas-app #modal-chica.tipo-gasto .input-group textarea:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12) !important;
}

body.speas-app #modal-chica .badge-lg {
    width: auto !important;
    min-height: 40px !important;
    padding: 9px 15px !important;
    box-shadow: none !important;
}

body.speas-app #modal-chica .modal-footer {
    display: grid !important;
    grid-template-columns: minmax(120px, 0.45fr) minmax(160px, 1fr) !important;
    gap: 10px !important;
    margin: 4px 0 0 !important;
    padding: 0 !important;
}

body.speas-app #modal-chica .btn-cancel,
body.speas-app #modal-chica .btn-primary {
    width: 100% !important;
    min-height: 50px !important;
    margin: 0 !important;
    border-radius: 14px !important;
    box-shadow: none !important;
}

body.speas-app #modal-chica.tipo-ingreso .btn-primary {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%) !important;
    color: #ffffff !important;
}

body.speas-app #modal-chica.tipo-gasto .btn-primary {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%) !important;
    color: #ffffff !important;
}

body.speas-app #modal-success .modal-content,
body.speas-app #modal-error .modal-content {
    justify-items: center !important;
    text-align: center !important;
    gap: 12px !important;
    padding: 28px 24px !important;
}

body.speas-app #modal-success .modal-content i,
body.speas-app #modal-error .modal-content i {
    font-size: 58px !important;
    margin: 0 !important;
}

body.speas-app #modal-success .modal-content h3,
body.speas-app #modal-error .modal-content h3 {
    margin: 0 !important;
    color: var(--speas-text, #111827) !important;
    font-size: 18px !important;
    line-height: 1.35 !important;
    white-space: pre-line !important;
}

@media (min-width: 1181px) and (max-width: 1500px) {
    body.speas-app #contenedor-dinamico .caja-chica-container .saldo-card-container {
        grid-template-columns: minmax(260px, 1.1fr) repeat(2, minmax(190px, 0.75fr)) !important;
    }

    body.speas-app #contenedor-dinamico .caja-chica-container .saldo-card,
    body.speas-app #contenedor-dinamico .caja-chica-container .btn-action {
        min-height: 150px !important;
    }
}

@media (min-width: 721px) and (max-width: 1180px) {
    body.speas-app #contenedor-dinamico .caja-chica-container {
        max-width: 760px !important;
        padding: 14px !important;
    }

    body.speas-app #contenedor-dinamico .caja-chica-container .saldo-card-container {
        grid-template-columns: 1fr 1fr !important;
    }

    body.speas-app #contenedor-dinamico .caja-chica-container .saldo-card {
        grid-column: 1 / -1 !important;
        min-height: 132px !important;
    }

    body.speas-app #contenedor-dinamico .caja-chica-container .btn-action {
        min-height: 142px !important;
    }
}

@media (max-width: 720px) {
    body.speas-app #contenedor-dinamico .caja-chica-container {
        max-width: 430px !important;
        padding: 12px 12px 48px !important;
    }

    body.speas-app #contenedor-dinamico .caja-chica-container .saldo-card-container {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    body.speas-app #contenedor-dinamico .caja-chica-container .saldo-card {
        min-height: 156px !important;
        display: grid !important;
        justify-items: center !important;
        text-align: center !important;
    }

    body.speas-app #contenedor-dinamico .caja-chica-container .btn-action {
        min-height: 92px !important;
        display: grid !important;
        grid-template-columns: 52px minmax(0, 1fr) !important;
        grid-template-rows: auto auto !important;
        text-align: left !important;
        column-gap: 14px !important;
        row-gap: 2px !important;
        padding: 16px 18px !important;
    }

    body.speas-app #contenedor-dinamico .caja-chica-container .btn-action .icon-circle {
        grid-row: 1 / 3 !important;
        width: 46px !important;
        height: 46px !important;
        font-size: 28px !important;
    }

    body.speas-app #contenedor-dinamico .caja-chica-container .table-responsive {
        overflow: visible !important;
    }

    body.speas-app #contenedor-dinamico .caja-chica-container .premium-table,
    body.speas-app #contenedor-dinamico .caja-chica-container .premium-table thead,
    body.speas-app #contenedor-dinamico .caja-chica-container .premium-table tbody,
    body.speas-app #contenedor-dinamico .caja-chica-container .premium-table tr,
    body.speas-app #contenedor-dinamico .caja-chica-container .premium-table th,
    body.speas-app #contenedor-dinamico .caja-chica-container .premium-table td {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    body.speas-app #contenedor-dinamico .caja-chica-container .premium-table thead {
        display: none !important;
    }

    body.speas-app #contenedor-dinamico .caja-chica-container .premium-table tbody {
        display: grid !important;
        gap: 10px !important;
    }

    body.speas-app #contenedor-dinamico .caja-chica-container .premium-table tr {
        display: grid !important;
        padding: 12px !important;
        border: 1px solid var(--speas-border, #dbe6f2) !important;
        border-radius: 14px !important;
        background: var(--speas-surface, #ffffff) !important;
        box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05) !important;
    }

    body.speas-app #contenedor-dinamico .caja-chica-container .premium-table td {
        display: grid !important;
        grid-template-columns: 82px minmax(0, 1fr) !important;
        gap: 8px !important;
        align-items: start !important;
        padding: 8px 0 !important;
        border-bottom: 1px solid var(--speas-border, #edf2f7) !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        font-size: 12px !important;
        line-height: 1.28 !important;
    }

    body.speas-app #contenedor-dinamico .caja-chica-container .premium-table td:last-child {
        border-bottom: 0 !important;
    }

    body.speas-app #contenedor-dinamico .caja-chica-container .premium-table td::before {
        color: var(--speas-muted, #64748b) !important;
        font-size: 10px !important;
        font-weight: 900 !important;
        letter-spacing: 0.04em !important;
        text-transform: uppercase !important;
    }

    body.speas-app #contenedor-dinamico .caja-chica-container .premium-table td:nth-child(1)::before { content: "Fecha" !important; }
    body.speas-app #contenedor-dinamico .caja-chica-container .premium-table td:nth-child(2)::before { content: "Tipo" !important; }
    body.speas-app #contenedor-dinamico .caja-chica-container .premium-table td:nth-child(3)::before { content: "Categoria" !important; }
    body.speas-app #contenedor-dinamico .caja-chica-container .premium-table td:nth-child(4)::before { content: "Detalle" !important; }
    body.speas-app #contenedor-dinamico .caja-chica-container .premium-table td:nth-child(5)::before { content: "Monto" !important; }
    body.speas-app #contenedor-dinamico .caja-chica-container .premium-table td:nth-child(6)::before { content: "Responsable" !important; }

    body.speas-app #modal-chica .modal-content.center-modal {
        width: min(94vw, 390px) !important;
        max-height: calc(100dvh - 24px) !important;
    }

    body.speas-app #modal-chica .modal-header {
        padding: 16px 18px !important;
    }

    body.speas-app #modal-chica .modal-body {
        padding: 18px !important;
    }

    body.speas-app #modal-chica .modal-footer {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 360px) {
    body.speas-app #contenedor-dinamico .caja-chica-container .table-header-flex {
        grid-template-columns: 1fr !important;
    }
}

/* Speas caja chica dark contrast and close fix v3.3.29 */
body.speas-app #modal-chica .btn-close,
body.speas-app #modal-chica .modal-header .btn-close {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    flex: 0 0 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 12px !important;
    padding: 0 !important;
}

body.speas-app #modal-chica .btn-close i,
body.speas-app #modal-chica .btn-close .bx {
    font-size: 20px !important;
    line-height: 1 !important;
    margin: 0 !important;
}

body.speas-app #contenedor-dinamico .caja-chica-container .chica-category-chip {
    display: inline-flex !important;
    align-items: center !important;
    width: fit-content !important;
    max-width: 100% !important;
    min-height: 28px !important;
    padding: 5px 10px !important;
    border-radius: 8px !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    font-weight: 800 !important;
}

@media (max-width: 720px) {
    body.speas-app #modal-chica .btn-close,
    body.speas-app #modal-chica .modal-header .btn-close {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        flex: 0 0 38px !important;
        border-radius: 11px !important;
    }

    body.speas-app #modal-chica .btn-close i,
    body.speas-app #modal-chica .btn-close .bx {
        font-size: 18px !important;
    }
}

/* Speas inventario final modal and filters priority v3.3.30 */
body.speas-app #contenedor-dinamico .table-module-container .filter-actions {
    align-items: center !important;
}

body.speas-app #contenedor-dinamico .table-module-container .filter-actions .btn-excel-inventario,
body.speas-app #modal-kardex .btn-excel-inventario {
    min-width: 96px !important;
    height: 42px !important;
    padding-inline: 16px !important;
    justify-content: center !important;
    gap: 8px !important;
    background: #f0fdf4 !important;
    color: #166534 !important;
    border: 1px solid #bbf7d0 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
}

body.speas-app #contenedor-dinamico .table-module-container .filter-actions .btn-excel-inventario i,
body.speas-app #modal-kardex .btn-excel-inventario i {
    color: currentColor !important;
}

body.speas-app #modal-kardex.modal-overlay.active,
body.speas-app #modal-producto.modal-overlay.active {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    margin: 0 !important;
    transform: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: clamp(14px, 2.2vw, 34px) !important;
    overflow: hidden !important;
    background: rgba(15, 23, 42, 0.48) !important;
    backdrop-filter: blur(4px);
}

body.speas-app #modal-kardex .modal-content.center-modal {
    position: relative !important;
    inset: auto !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    width: min(1480px, calc(100vw - clamp(28px, 4vw, 72px))) !important;
    max-width: 1480px !important;
    height: min(850px, calc(100dvh - clamp(28px, 4vw, 72px))) !important;
    max-height: calc(100dvh - clamp(28px, 4vw, 72px)) !important;
    min-width: 0 !important;
    margin: auto !important;
    transform: none !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

body.speas-app #modal-kardex .kardex-filters {
    display: grid !important;
    grid-template-columns: minmax(190px, 0.9fr) minmax(220px, 1fr) minmax(260px, 1.15fr) minmax(104px, auto) !important;
    gap: 12px !important;
    align-items: center !important;
    padding: 14px !important;
    margin: 0 !important;
    background: #f8fafc !important;
    border: 1px solid #dbe7f5 !important;
    border-radius: 12px !important;
}

body.speas-app #modal-kardex .kardex-filters > input,
body.speas-app #modal-kardex .kardex-filters > select,
body.speas-app #modal-kardex .kardex-filters > button {
    width: 100% !important;
    min-width: 0 !important;
    height: 42px !important;
    margin: 0 !important;
}

body.speas-app #modal-kardex .table-responsive-kardex {
    min-height: 0 !important;
    max-height: none !important;
    flex: 1 1 auto !important;
    overflow: auto !important;
}

body.speas-app #modal-producto .modal-content.slide-in-right {
    position: relative !important;
    inset: auto !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    width: min(920px, calc(100vw - clamp(28px, 5vw, 96px))) !important;
    max-width: 920px !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: min(840px, calc(100dvh - clamp(28px, 5vw, 96px))) !important;
    margin: auto !important;
    transform: none !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22) !important;
}

body.speas-app #modal-producto .modal-header {
    min-height: 68px !important;
    padding: 20px 28px !important;
}

body.speas-app #modal-producto .modal-body {
    min-height: 0 !important;
    overflow: auto !important;
    padding: 26px 34px 24px !important;
}

body.speas-app #modal-producto #form-producto {
    max-width: 760px !important;
    margin: 0 auto !important;
}

body.speas-app #modal-producto .form-subtitle {
    margin: 24px 0 16px !important;
    padding-bottom: 9px !important;
    border-bottom: 1px solid var(--border-color, #e2e8f0) !important;
}

body.speas-app #modal-producto .form-subtitle:first-of-type {
    margin-top: 0 !important;
}

body.speas-app #modal-producto .row-grid {
    gap: 18px !important;
    margin-bottom: 18px !important;
}

body.speas-app #modal-producto .input-group {
    margin-top: 0 !important;
    margin-bottom: 18px !important;
}

body.speas-app #modal-producto .input-group input,
body.speas-app #modal-producto .input-group select {
    height: 46px !important;
    border-radius: 10px !important;
    padding-inline: 14px !important;
}

body.speas-app #modal-producto #group-sede {
    padding: 14px !important;
    margin: 0 0 18px !important;
    background: #f8fafc !important;
    border: 1px solid #dbe7f5 !important;
    border-radius: 12px !important;
}

body.speas-app #modal-producto #prod-sede {
    background: #fff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
}

body.speas-app #modal-producto .modal-footer {
    position: static !important;
    min-height: auto !important;
    padding: 18px 28px !important;
    border-top: 1px solid var(--border-color, #e2e8f0) !important;
}

@media (min-width: 1440px) {
    body.speas-app #contenedor-dinamico .table-module-container .filter-bar {
        grid-template-columns: minmax(320px, 1fr) auto !important;
    }

    body.speas-app #contenedor-dinamico .table-module-container .filter-actions {
        display: grid !important;
        grid-template-columns: minmax(190px, 220px) minmax(190px, 220px) minmax(104px, auto) !important;
        gap: 12px !important;
    }
}

@media (min-width: 769px) and (max-width: 1180px) {
    body.speas-app #modal-kardex .modal-content.center-modal {
        width: min(760px, calc(100vw - 44px)) !important;
        height: min(780px, calc(100dvh - 44px)) !important;
        max-width: calc(100vw - 44px) !important;
        max-height: calc(100dvh - 44px) !important;
    }

    body.speas-app #modal-kardex .kardex-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body.speas-app #modal-producto .modal-content.slide-in-right {
        width: min(700px, calc(100vw - 44px)) !important;
        max-height: calc(100dvh - 44px) !important;
    }
}

@media (max-width: 768px) {
    body.speas-app #modal-kardex.modal-overlay.active,
    body.speas-app #modal-producto.modal-overlay.active {
        align-items: center !important;
        justify-content: center !important;
        padding: 14px !important;
    }

    body.speas-app #modal-kardex .modal-content.center-modal {
        width: calc(100vw - 28px) !important;
        max-width: calc(100vw - 28px) !important;
        height: min(760px, calc(100dvh - 28px)) !important;
        max-height: calc(100dvh - 28px) !important;
        border-radius: 16px !important;
    }

    body.speas-app #modal-kardex .modal-header,
    body.speas-app #modal-producto .modal-header {
        min-height: 64px !important;
        padding: 16px 18px !important;
    }

    body.speas-app #modal-kardex .modal-body,
    body.speas-app #modal-producto .modal-body {
        padding: 18px !important;
    }

    body.speas-app #modal-kardex .kardex-filters {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        padding: 10px !important;
    }

    body.speas-app #modal-producto .modal-content.slide-in-right {
        width: calc(100vw - 28px) !important;
        max-width: calc(100vw - 28px) !important;
        height: min(760px, calc(100dvh - 28px)) !important;
        max-height: calc(100dvh - 28px) !important;
        border-radius: 16px !important;
    }

    body.speas-app #modal-producto .row-grid {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
        margin-bottom: 0 !important;
    }

    body.speas-app #modal-producto .input-group {
        margin-bottom: 16px !important;
    }

    body.speas-app #modal-producto .modal-footer {
        padding: 14px 18px max(16px, env(safe-area-inset-bottom)) !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }
}

/* Speas inventario stock modal centered viewport v3.3.31 */
body.speas-app #modal-stock.modal-overlay.active {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 24px !important;
    overflow: hidden !important;
    background: rgba(15, 23, 42, 0.48) !important;
    backdrop-filter: blur(8px) !important;
    z-index: 9999 !important;
}

body.speas-app #modal-stock .modal-content.center-modal {
    width: min(520px, calc(100vw - 48px)) !important;
    max-width: calc(100vw - 48px) !important;
    height: auto !important;
    max-height: min(720px, calc(100dvh - 48px)) !important;
    margin: 0 !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    border-radius: 18px !important;
    overflow: hidden !important;
    transform: none !important;
}

body.speas-app #modal-stock .modal-header {
    min-height: 70px !important;
    padding: 18px 24px !important;
}

body.speas-app #modal-stock .modal-header h3 {
    font-size: 18px !important;
    line-height: 1.2 !important;
}

body.speas-app #modal-stock .btn-close {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    border-radius: 10px !important;
}

body.speas-app #modal-stock .btn-close i {
    font-size: 18px !important;
}

body.speas-app #modal-stock .modal-body {
    min-height: 0 !important;
    overflow-y: auto !important;
    padding: 18px 24px 24px !important;
}

body.speas-app #modal-stock #form-stock {
    display: grid !important;
    gap: 16px !important;
}

body.speas-app #modal-stock #form-stock > div[style*="background: #f8fafc"] {
    margin-bottom: 0 !important;
}

body.speas-app #modal-stock .stock-tabs {
    margin-bottom: 0 !important;
}

body.speas-app #modal-stock .row-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 12px !important;
}

body.speas-app #modal-stock .input-group {
    margin: 0 !important;
}

body.speas-app #modal-stock .input-group input,
body.speas-app #modal-stock .input-group select {
    height: 44px !important;
    min-height: 44px !important;
    font-size: 14px !important;
}

body.speas-app #modal-stock .modal-footer {
    padding: 6px 0 0 !important;
    margin: 0 !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 12px !important;
}

body.speas-app #modal-stock .modal-footer .btn-cancel,
body.speas-app #modal-stock .modal-footer .btn-primary {
    height: 44px !important;
    min-height: 44px !important;
    border-radius: 12px !important;
    padding: 0 20px !important;
    margin: 0 !important;
    white-space: nowrap !important;
}

@media (min-width: 769px) and (max-width: 1180px) {
    body.speas-app #modal-stock.modal-overlay.active {
        padding: 32px !important;
    }

    body.speas-app #modal-stock .modal-content.center-modal {
        width: min(560px, calc(100vw - 64px)) !important;
        max-width: calc(100vw - 64px) !important;
        max-height: calc(100dvh - 64px) !important;
    }
}

@media (max-width: 768px) {
    body.speas-app #modal-stock.modal-overlay.active {
        align-items: center !important;
        justify-content: center !important;
        padding: 14px !important;
    }

    body.speas-app #modal-stock .modal-content.center-modal {
        width: calc(100vw - 28px) !important;
        max-width: calc(100vw - 28px) !important;
        max-height: min(680px, calc(100dvh - 28px)) !important;
        border-radius: 18px !important;
    }

    body.speas-app #modal-stock .modal-header {
        min-height: 64px !important;
        padding: 16px 18px !important;
    }

    body.speas-app #modal-stock .modal-body {
        padding: 16px 18px 18px !important;
    }

    body.speas-app #modal-stock #form-stock {
        gap: 14px !important;
    }

    body.speas-app #modal-stock #form-stock > div[style*="background: #f8fafc"] {
        display: grid !important;
        grid-template-columns: 1fr auto !important;
        gap: 12px !important;
        align-items: center !important;
        padding: 12px !important;
    }

    body.speas-app #modal-stock .stock-tabs {
        gap: 6px !important;
        padding: 4px !important;
    }

    body.speas-app #modal-stock .stock-tab {
        min-height: 40px !important;
        padding: 8px 6px !important;
        font-size: 11px !important;
    }

    body.speas-app #modal-stock .row-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    body.speas-app #modal-stock .modal-footer {
        display: grid !important;
        grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.35fr) !important;
        gap: 10px !important;
        padding-top: 4px !important;
    }

    body.speas-app #modal-stock .modal-footer .btn-cancel,
    body.speas-app #modal-stock .modal-footer .btn-primary {
        width: 100% !important;
        padding: 0 10px !important;
        font-size: 12px !important;
    }
}

/* Speas proveedores final mobile and tablet priority v3.3.32 */
@media (max-width: 1024px) {
    body.speas-app.module-proveedores-active #module-content .table-module-container {
        max-width: min(100%, 760px) !important;
        margin-inline: auto !important;
    }

    body.speas-app.module-proveedores-active #module-content .table-module-container > .table-toolbar {
        display: grid !important;
        grid-template-columns: 1fr auto auto !important;
        gap: 10px !important;
        align-items: center !important;
        padding: 12px !important;
        border-radius: 16px !important;
        background: #ffffff !important;
        border: 1px solid #dbe7f5 !important;
        box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05) !important;
    }

    body.speas-app.module-proveedores-active #module-content .table-module-container .filter-actions {
        display: contents !important;
    }

    body.speas-app.module-proveedores-active #module-content .table-module-container .btn-icon {
        width: auto !important;
        min-width: 44px !important;
        height: 44px !important;
        padding: 0 12px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 7px !important;
        border-radius: 12px !important;
        background: #f8fbff !important;
        border: 1px solid #d7e4f4 !important;
        color: #284469 !important;
        box-shadow: none !important;
    }

    body.speas-app.module-proveedores-active #module-content .table-module-container .btn-icon[title="Filtros"]::after {
        content: "Filtro";
        font-size: 12px;
        font-weight: 800;
    }

    body.speas-app.module-proveedores-active #module-content .table-module-container .btn-icon[title="Exportar Excel"]::after {
        content: "Excel";
        font-size: 12px;
        font-weight: 800;
    }

    body.speas-app.module-proveedores-active #modal-proveedor.modal-overlay.active .modal-content.slide-in-right {
        width: min(780px, calc(100vw - 56px)) !important;
        max-width: calc(100vw - 56px) !important;
        height: min(840px, calc(100dvh - 56px)) !important;
        max-height: calc(100dvh - 56px) !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .modal-body {
        padding: 20px 24px !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .premium-table,
    body.speas-app.module-proveedores-active #modal-proveedor .premium-table tbody {
        display: grid !important;
        width: 100% !important;
        gap: 12px !important;
        border: 0 !important;
        background: transparent !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .premium-table tr {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) auto !important;
        gap: 12px !important;
        align-items: center !important;
        padding: 14px !important;
        border-radius: 16px !important;
        border: 1px solid #dbe7f5 !important;
        background: #f8fbff !important;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04) !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor #lista-dir-erp tr,
    body.speas-app.module-proveedores-active #modal-proveedor #lista-banco-erp tr {
        grid-template-columns: repeat(3, minmax(0, 1fr)) auto !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .premium-table td {
        display: block !important;
        width: 100% !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .premium-table td[style*="width:30px"],
    body.speas-app.module-proveedores-active #modal-proveedor .premium-table td[style*="width: 4%"] {
        width: auto !important;
        justify-self: end !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .premium-table input,
    body.speas-app.module-proveedores-active #modal-proveedor .premium-table select {
        width: 100% !important;
        min-height: 42px !important;
        border: 1px solid #d2dfef !important;
        border-radius: 11px !important;
        background: #ffffff !important;
        color: #0f172a !important;
        padding: 9px 12px !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .premium-table button {
        width: 38px !important;
        height: 38px !important;
        border-radius: 11px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: #ffe8ec !important;
        color: #ef4444 !important;
        border: 1px solid #ffd1d8 !important;
    }
}

@media (max-width: 768px) {
    body.speas-app.module-proveedores-active #module-content .table-module-container {
        width: min(100%, 390px) !important;
        padding: 0 10px 28px !important;
    }

    body.speas-app.module-proveedores-active #module-content .table-module-container > .module-header {
        margin-top: 0 !important;
        padding: 16px !important;
        border-radius: 16px !important;
    }

    body.speas-app.module-proveedores-active #module-content .table-module-container > .table-toolbar {
        grid-template-columns: 1fr 44px 44px !important;
        gap: 8px !important;
    }

    body.speas-app.module-proveedores-active #module-content .table-module-container .btn-icon::after {
        content: none !important;
    }

    body.speas-app.module-proveedores-active #module-content .table-module-container > .table-responsive {
        overflow: visible !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    body.speas-app.module-proveedores-active #module-content .table-module-container > .table-responsive > table.premium-table,
    body.speas-app.module-proveedores-active #module-content .table-module-container > .table-responsive > table.premium-table tbody,
    body.speas-app.module-proveedores-active #module-content .table-module-container > .table-responsive > table.premium-table tr,
    body.speas-app.module-proveedores-active #module-content .table-module-container > .table-responsive > table.premium-table td {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    body.speas-app.module-proveedores-active #module-content .table-module-container > .table-responsive > table.premium-table thead {
        display: none !important;
    }

    body.speas-app.module-proveedores-active #module-content .table-module-container > .table-responsive > table.premium-table tbody {
        display: grid !important;
        gap: 12px !important;
    }

    body.speas-app.module-proveedores-active #module-content .table-module-container > .table-responsive > table.premium-table tr {
        padding: 14px !important;
        border-radius: 17px !important;
        background: #ffffff !important;
        border: 1px solid #dbe7f5 !important;
        box-shadow: 0 16px 34px rgba(15, 23, 42, 0.07) !important;
    }

    body.speas-app.module-proveedores-active #module-content .table-module-container > .table-responsive > table.premium-table td {
        display: grid !important;
        grid-template-columns: 92px minmax(0, 1fr) !important;
        align-items: center !important;
        gap: 10px !important;
        padding: 8px 0 !important;
        border: 0 !important;
        border-bottom: 1px solid #edf3fb !important;
        background: transparent !important;
        color: #172033 !important;
        font-size: 12px !important;
        text-align: left !important;
    }

    body.speas-app.module-proveedores-active #module-content .table-module-container > .table-responsive > table.premium-table td:last-child {
        border-bottom: 0 !important;
        display: block !important;
    }

    body.speas-app.module-proveedores-active #module-content .table-module-container > .table-responsive > table.premium-table td::before {
        display: block !important;
        color: #64748b !important;
        font-size: 10px !important;
        font-weight: 900 !important;
        line-height: 1.2 !important;
        text-transform: uppercase !important;
    }

    body.speas-app.module-proveedores-active #module-content .table-module-container .client-contact {
        align-items: flex-start !important;
    }

    body.speas-app.module-proveedores-active #module-content .table-module-container .status-badge {
        width: fit-content !important;
        max-width: 100% !important;
    }

    body.speas-app.module-proveedores-active #module-content .table-module-container .action-buttons {
        display: flex !important;
        justify-content: flex-start !important;
        gap: 9px !important;
        margin-top: 4px !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor.modal-overlay.active {
        padding: 10px !important;
        align-items: center !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor.modal-overlay.active .modal-content.slide-in-right {
        width: calc(100vw - 20px) !important;
        max-width: calc(100vw - 20px) !important;
        height: calc(100dvh - 20px) !important;
        max-height: calc(100dvh - 20px) !important;
        border-radius: 20px !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .modal-header {
        min-height: 62px !important;
        padding: 16px 18px !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .modal-header h3 {
        font-size: 15px !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .btn-close {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        border-radius: 12px !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .modal-body {
        padding: 16px !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .form-subtitle {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        margin: 18px 0 12px !important;
        font-size: 13px !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .premium-table tr,
    body.speas-app.module-proveedores-active #modal-proveedor #lista-dir-erp tr,
    body.speas-app.module-proveedores-active #modal-proveedor #lista-banco-erp tr {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        padding: 13px !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .premium-table td[style*="width:30px"],
    body.speas-app.module-proveedores-active #modal-proveedor .premium-table td[style*="width: 4%"],
    body.speas-app.module-proveedores-active #modal-proveedor .premium-table td:last-child {
        position: static !important;
        justify-self: stretch !important;
        width: 100% !important;
        text-align: right !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .premium-table td:last-child button {
        margin-left: auto !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .modal-footer {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        padding: 12px 16px max(14px, env(safe-area-inset-bottom)) !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .modal-footer .btn-cancel {
        order: 1 !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .modal-footer .btn-primary {
        order: 2 !important;
    }
}

/* Speas proveedores final cascade lock v3.3.33 */
@media (max-width: 768px) {
    html body.speas-app.module-proveedores-active #module-content .table-module-container > .table-responsive > table.premium-table tbody#tabla-proveedores-body > tr {
        background: #ffffff !important;
        background-color: #ffffff !important;
        color: #172033 !important;
        border-color: #dbe7f5 !important;
    }

    html body.speas-app.module-proveedores-active #module-content .table-module-container > .table-responsive > table.premium-table tbody#tabla-proveedores-body > tr > td,
    html body.speas-app.module-proveedores-active #module-content .table-module-container > .table-responsive > table.premium-table tbody#tabla-proveedores-body > tr > td * {
        color: #172033 !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
        white-space: normal !important;
    }
}

/* Speas proveedores modal/cards absolute final v3.3.34 */
body.speas-app.module-proveedores-active #modal-proveedor .btn-close {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    border-radius: 13px !important;
}

body.speas-app.module-proveedores-active #modal-proveedor .btn-close i {
    font-size: 22px !important;
    line-height: 1 !important;
}

body.speas-app.module-proveedores-active #tabla-proveedores-body td:nth-child(3) .status-badge {
    display: inline-flex !important;
    width: fit-content !important;
    max-width: 100% !important;
    align-items: center !important;
    justify-content: center !important;
    background: #e8fff8 !important;
    color: #057a6f !important;
    border: 1px solid #a9f1df !important;
    opacity: 1 !important;
    font-weight: 900 !important;
}

body.speas-app.module-proveedores-active #module-content .table-module-container > .table-toolbar {
    grid-template-columns: minmax(0, 1fr) auto !important;
}

body.speas-app.module-proveedores-active #module-content .table-module-container .filter-actions {
    display: flex !important;
    justify-content: flex-end !important;
}

@media (min-width: 769px) {
    body.speas-app.module-proveedores-active #modal-proveedor #lista-dir-erp tr {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.15fr) 42px !important;
        align-items: center !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor #lista-dir-erp tr > td:last-child {
        justify-self: end !important;
        width: 42px !important;
    }
}

@media (max-width: 768px) {
    body.speas-app.module-proveedores-active #module-content .table-module-container > .table-toolbar {
        grid-template-columns: minmax(0, 1fr) 46px !important;
        gap: 8px !important;
    }

    body.speas-app.module-proveedores-active #module-content .table-module-container .filter-actions,
    body.speas-app.module-proveedores-active #module-content .table-module-container .filter-actions .btn-icon {
        width: 46px !important;
        min-width: 46px !important;
        height: 46px !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .btn-close {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor #lista-dir-erp tr {
        grid-template-columns: minmax(0, 1fr) 44px !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor #lista-dir-erp tr > td:last-child {
        grid-column: 2 !important;
        grid-row: 1 !important;
        align-self: start !important;
        justify-self: end !important;
        width: 44px !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor #lista-dir-erp tr > td:not(:last-child) {
        grid-column: 1 / -1 !important;
    }
}

/* Speas proveedores modal/card polish final v3.3.35 */
body.speas-app #modal-proveedor .btn-close,
body.speas-app.module-proveedores-active #modal-proveedor .btn-close {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 12px !important;
}

body.speas-app #modal-proveedor .btn-close i,
body.speas-app.module-proveedores-active #modal-proveedor .btn-close i {
    font-size: 24px !important;
    line-height: 1 !important;
}

body.speas-app #module-content .table-module-container .filter-actions,
body.speas-app.module-proveedores-active #module-content .table-module-container .filter-actions {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    width: auto !important;
    min-width: 46px !important;
}

body.speas-app #module-content .table-module-container .filter-actions .btn-icon,
body.speas-app.module-proveedores-active #module-content .table-module-container .filter-actions .btn-icon {
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
}

@media (min-width: 769px) {
    body.speas-app #modal-proveedor #lista-dir-erp tr,
    body.speas-app.module-proveedores-active #modal-proveedor #lista-dir-erp tr {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.15fr) 42px !important;
        align-items: center !important;
        gap: 10px !important;
    }

    body.speas-app #modal-proveedor #lista-dir-erp tr > td,
    body.speas-app.module-proveedores-active #modal-proveedor #lista-dir-erp tr > td {
        display: block !important;
        width: auto !important;
        min-width: 0 !important;
        grid-column: auto !important;
        grid-row: auto !important;
        padding: 0 !important;
    }

    body.speas-app #modal-proveedor #lista-dir-erp tr > td:last-child,
    body.speas-app.module-proveedores-active #modal-proveedor #lista-dir-erp tr > td:last-child {
        width: 42px !important;
        min-width: 42px !important;
        justify-self: end !important;
        align-self: center !important;
    }
}

@media (max-width: 768px) {
    body.speas-app #modal-proveedor .btn-close,
    body.speas-app.module-proveedores-active #modal-proveedor .btn-close {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        min-height: 42px !important;
    }

    body.speas-app #module-content .table-module-container .filter-actions,
    body.speas-app.module-proveedores-active #module-content .table-module-container .filter-actions {
        display: flex !important;
        width: 46px !important;
        min-width: 46px !important;
        justify-content: flex-end !important;
    }

    body.speas-app #module-content .table-module-container > .table-responsive > .premium-table td:nth-child(3),
    body.speas-app.module-proveedores-active #module-content .table-module-container > .table-responsive > .premium-table td:nth-child(3) {
        display: grid !important;
        grid-template-columns: 96px minmax(0, 1fr) !important;
        align-items: center !important;
        gap: 10px !important;
        color: #172033 !important;
        min-height: 34px !important;
    }

    body.speas-app #module-content .table-module-container > .table-responsive > .premium-table td:nth-child(3) .badge,
    body.speas-app #module-content .table-module-container > .table-responsive > .premium-table td:nth-child(3) .status-badge,
    body.speas-app #module-content .table-module-container > .table-responsive > .premium-table td:nth-child(3) span,
    body.speas-app.module-proveedores-active #module-content .table-module-container > .table-responsive > .premium-table td:nth-child(3) .badge,
    body.speas-app.module-proveedores-active #module-content .table-module-container > .table-responsive > .premium-table td:nth-child(3) .status-badge,
    body.speas-app.module-proveedores-active #module-content .table-module-container > .table-responsive > .premium-table td:nth-child(3) span {
        justify-self: start !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        background: #e8fff8 !important;
        border: 1px solid #a9f1df !important;
        color: #057a6f !important;
        opacity: 1 !important;
    }
}

/* Proveedores final toolbar/category priority v3.3.36 */
body.speas-app.module-proveedores-active .table-toolbar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

body.speas-app.module-proveedores-active .table-toolbar .search-box {
    flex: 1 1 540px !important;
    max-width: 620px !important;
    min-width: 260px !important;
    height: 46px !important;
    box-sizing: border-box !important;
}

body.speas-app.module-proveedores-active .table-toolbar .filter-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    margin-left: auto !important;
    min-width: max-content !important;
}

body.speas-app.module-proveedores-active .table-toolbar .btn-export-excel {
    width: auto !important;
    min-width: 104px !important;
    height: 46px !important;
    padding: 0 16px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    white-space: nowrap !important;
}

body.speas-app.module-proveedores-active .table-toolbar .btn-export-excel .excel-label {
    display: inline-block !important;
    color: inherit !important;
    -webkit-text-fill-color: currentColor !important;
    font-weight: 800 !important;
    font-size: 13px !important;
}

html body.speas-app.module-proveedores-active #tabla-proveedores-body > tr > td:nth-child(3) > span.status-badge {
    background: #e4fff8 !important;
    background-color: #e4fff8 !important;
    border: 1px solid #86e8d3 !important;
    color: #075f59 !important;
    -webkit-text-fill-color: #075f59 !important;
    opacity: 1 !important;
    filter: none !important;
    text-shadow: none !important;
    font-weight: 900 !important;
}

@media (max-width: 768px) {
    body.speas-app.module-proveedores-active .table-toolbar {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 48px !important;
        gap: 10px !important;
        align-items: center !important;
        padding: 12px !important;
        border-radius: 14px !important;
    }

    body.speas-app.module-proveedores-active .table-toolbar .search-box {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 48px !important;
    }

    body.speas-app.module-proveedores-active .table-toolbar .filter-actions {
        width: 48px !important;
        min-width: 48px !important;
        margin-left: 0 !important;
        justify-content: center !important;
    }

    body.speas-app.module-proveedores-active .table-toolbar .btn-export-excel {
        width: 48px !important;
        min-width: 48px !important;
        height: 48px !important;
        padding: 0 !important;
        border-radius: 12px !important;
    }

    body.speas-app.module-proveedores-active .table-toolbar .btn-export-excel .excel-label {
        display: none !important;
    }

    body.speas-app.module-proveedores-active #tabla-proveedores-body > tr > td:nth-child(3) > span.status-badge {
        min-width: 86px !important;
        padding: 6px 12px !important;
        font-size: 12px !important;
    }
}

/* Proveedores category ultra-specific final override v3.3.36 */
html body.speas-app.module-proveedores-active #module-content .table-module-container > .table-responsive > table.premium-table tbody#tabla-proveedores-body > tr > td:nth-child(3) > span.status-badge,
html body.speas-app.module-proveedores-active .table-module-container > .table-responsive > table.premium-table tbody#tabla-proveedores-body > tr > td:nth-child(3) > span.status-badge {
    background: #e4fff8 !important;
    background-color: #e4fff8 !important;
    border: 1px solid #86e8d3 !important;
    color: #075f59 !important;
    -webkit-text-fill-color: #075f59 !important;
    opacity: 1 !important;
    filter: none !important;
    text-shadow: none !important;
    font-weight: 900 !important;
}

/* Proveedores final theme polish v3.3.37 */
html body.speas-app.module-proveedores-active .table-toolbar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 18px !important;
    width: 100% !important;
    padding: 22px 18px !important;
    box-sizing: border-box !important;
}

html body.speas-app.module-proveedores-active .table-toolbar .search-box {
    flex: 0 1 540px !important;
    width: min(540px, 48vw) !important;
    max-width: 540px !important;
    min-width: 280px !important;
    min-height: 46px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

html body.speas-app.module-proveedores-active .table-toolbar .filter-actions {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
    margin-left: auto !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
}

html body.speas-app.module-proveedores-active .table-toolbar .btn-export-excel {
    width: auto !important;
    min-width: 112px !important;
    max-width: 132px !important;
    height: 46px !important;
    padding: 0 18px !important;
    border-radius: 12px !important;
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    white-space: nowrap !important;
}

html body.speas-app.module-proveedores-active .table-toolbar .btn-export-excel .excel-label {
    display: inline-block !important;
    font-weight: 800 !important;
    font-size: 13px !important;
    line-height: 1 !important;
    color: inherit !important;
    -webkit-text-fill-color: currentColor !important;
}

html body.speas-app.module-proveedores-active #module-content .table-module-container > .table-responsive > table.premium-table tbody#tabla-proveedores-body > tr > td:nth-child(3) > span.status-badge,
html body.speas-app.module-proveedores-active .table-module-container > .table-responsive > table.premium-table tbody#tabla-proveedores-body > tr > td:nth-child(3) > span.status-badge,
html body.speas-app.module-proveedores-active #tabla-proveedores-body > tr > td:nth-child(3) > span.status-badge {
    min-width: 82px !important;
    max-width: 120px !important;
    padding: 5px 10px !important;
    border-radius: 8px !important;
    background: #e4fff8 !important;
    background-color: #e4fff8 !important;
    border: 1px solid #69d8c6 !important;
    color: #075f59 !important;
    -webkit-text-fill-color: #075f59 !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    line-height: 1.1 !important;
    letter-spacing: 0 !important;
    text-shadow: none !important;
    opacity: 1 !important;
    filter: none !important;
    box-shadow: none !important;
}

html body.speas-app.module-proveedores-active #modal-proveedor .modal-body,
html body.speas-app.module-proveedores-active #modal-proveedor .modal-content {
    scrollbar-width: thin !important;
    scrollbar-color: #94a3b8 #f8fafc !important;
}

@media (max-width: 768px) {
    html body.speas-app.module-proveedores-active .table-toolbar {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 48px !important;
        gap: 10px !important;
        padding: 12px !important;
    }

    html body.speas-app.module-proveedores-active .table-toolbar .search-box {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        min-height: 48px !important;
    }

    html body.speas-app.module-proveedores-active .table-toolbar .filter-actions,
    html body.speas-app.module-proveedores-active .table-toolbar .btn-export-excel {
        width: 48px !important;
        min-width: 48px !important;
        max-width: 48px !important;
        height: 48px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    html body.speas-app.module-proveedores-active .table-toolbar .btn-export-excel .excel-label {
        display: none !important;
    }
}

/* ==========================================================================
   Área táctil mínima en dispositivos de dedo
   --------------------------------------------------------------------------
   El sistema de densidad reduce --speas-input-h a 32px (>=769px) y 30px
   (>=1024px), pensado para mouse. Pero una tablet en horizontal (~1024-1180px,
   el caso de las sedes) entra en esos breakpoints por ancho y termina con
   inputs y botones por debajo del mínimo táctil de 44px.

   `pointer: coarse` distingue el dispositivo de entrada del tamaño de pantalla,
   que es la pregunta correcta: el desktop con mouse conserva su densidad.
   ========================================================================== */
@media (pointer: coarse) {
    :root {
        --speas-input-h: 44px;
    }
}

/* Shell responsive final v3.5.7
   En movil el menu es un cajon superpuesto: no reserva ancho. Se declaran
   todas las variantes del hermano para que una hoja de modulo cargada en
   caliente o un cambio de viewport no conserve los 72 px del desktop. */
@media (max-width: 768px) {
    html body.speas-app .home,
    html body.speas-app .sidebar.close ~ .home,
    html body.speas-app .sidebar.close:hover ~ .home,
    html body.speas-app .sidebar.mobile-active ~ .home {
        position: fixed !important;
        inset: 0 0 0 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: auto !important;
        max-width: none !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }
}

/* css/speas-tokens.css */
/* Ubicacion: frontend/css/speas-tokens.css */
/* Capa estable de tokens compartidos para verde, azul, rosa y grafito. */

:root {
    --speas-bg: #eef2f6;
    --speas-surface: #ffffff;
    --speas-surface-2: #f7f9fc;
    --speas-elevated: #ffffff;
    --speas-sidebar: #f8fafc;
    --speas-sidebar-2: #ffffff;
    --speas-text: #172033;
    --speas-muted: #64748b;
    --speas-border: #d9e2ef;
    --speas-border-strong: #b8c5d6;
    --speas-accent: #0f766e;
    --speas-accent-2: #2563eb;
    --speas-danger: #dc2626;
    --speas-success: #16a34a;
    --speas-warning: #d97706;
    --speas-info: #2563eb;
    --speas-radius: 8px;
    --speas-radius-sm: 6px;
    --speas-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
    --speas-shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.06);
    --speas-focus-ring: 0 0 0 3px rgba(15, 118, 110, 0.16);
    --speas-table-head: #f1f5f9;
    --speas-row-hover: #f8fafc;
    --primary-color: var(--speas-accent);
    --primary-dark: #115e59;
    --dark-color: var(--speas-text);
    --text-color-main: var(--speas-text);
    --text-color-secondary: var(--speas-muted);
    --border-color: var(--speas-border);
    --card-bg: var(--speas-surface);
    --body-bg: var(--speas-bg);
}

body.speas-app,
body.speas-app :is(.home, #contenedor-dinamico, #module-content, .contenedor-modulo, .module-content, .module-page, .module-shell, .main-content) {
    background: var(--speas-bg) !important;
    color: var(--speas-text) !important;
}

body.speas-app :is(.card, .panel, .table-container, .filters-card, .summary-card, .module-header, .page-header, .header-section, .kpi-card) {
    background: var(--speas-surface) !important;
    border-color: var(--speas-border) !important;
    color: var(--speas-text) !important;
}

body.speas-app :is(input, select, textarea, .form-control, .form-select, .search-input, .finance-select, .finance-date-input) {
    background: var(--speas-elevated) !important;
    border-color: var(--speas-border) !important;
    color: var(--speas-text) !important;
}

body.speas-app :is(input, select, textarea, .form-control, .form-select, .search-input, .finance-select, .finance-date-input):focus {
    border-color: var(--speas-accent) !important;
    box-shadow: var(--speas-focus-ring) !important;
    outline: none !important;
}

body.speas-app :is(.speas-theme-switch, .finance-tab-shell) {
    background: color-mix(in srgb, var(--speas-surface) 92%, var(--speas-surface-2)) !important;
    border-color: var(--speas-border) !important;
}

body.speas-app .speas-theme-btn.active,
body.speas-app [data-speas-theme-option].active {
    background: var(--speas-accent) !important;
    border-color: var(--speas-accent) !important;
    color: #ffffff !important;
}

body.speas-app .finance-inbox-container :is(
    .finance-header,
    .finance-panel,
    .finance-tab-shell,
    .finance-view-heading,
    .finance-kpi,
    .finance-list-column,
    .finance-upload-card,
    .finance-report-panel,
    .finance-report-kpis div,
    .finance-ops-summary div,
    .finance-process-item,
    .finance-report-item,
    .finance-support-category-card,
    .finance-support-import-item,
    .finance-coverage-alert
) {
    background: var(--speas-surface) !important;
    border-color: var(--speas-border) !important;
    color: var(--speas-text) !important;
    box-shadow: var(--speas-shadow-sm) !important;
}

body.speas-app .finance-inbox-container .finance-tab-panel {
    background: var(--speas-surface-2) !important;
    border-color: var(--speas-border) !important;
}

body.speas-app .finance-inbox-container :is(h2, h3, h4, h5, strong, label, th, .finance-kpi strong, .finance-ops-summary strong, .finance-report-kpis strong) {
    color: var(--speas-text) !important;
}

body.speas-app .finance-inbox-container :is(p, small, span, td, .finance-panel-title span, .finance-view-heading p, .finance-table td small) {
    color: var(--speas-muted) !important;
}

body.speas-app .finance-inbox-container :is(.finance-select, .finance-date-input, input, textarea) {
    background: var(--speas-elevated) !important;
    border-color: var(--speas-border) !important;
    color: var(--speas-text) !important;
}

body.speas-app .finance-inbox-container .finance-tab {
    background: transparent !important;
    border-color: transparent !important;
    color: var(--speas-muted) !important;
}

body.speas-app .finance-inbox-container .finance-tab:is(.is-active, :hover) {
    background: color-mix(in srgb, var(--speas-accent) 12%, var(--speas-surface)) !important;
    border-color: color-mix(in srgb, var(--speas-accent) 28%, var(--speas-border)) !important;
    color: var(--speas-accent) !important;
}

body.speas-app .finance-inbox-container :is(.finance-primary-btn, .finance-mini-btn.primary) {
    background: var(--speas-accent) !important;
    border-color: var(--speas-accent) !important;
    color: #ffffff !important;
}

body.speas-app .finance-inbox-container :is(.finance-secondary-btn, .finance-icon-btn, .finance-mini-btn) {
    background: var(--speas-surface-2) !important;
    border-color: var(--speas-border) !important;
    color: var(--speas-accent) !important;
}

body.speas-app .finance-inbox-container :is(table, .finance-table) {
    background: var(--speas-surface) !important;
    color: var(--speas-text) !important;
}

body.speas-app .finance-inbox-container :is(thead, th) {
    background: var(--speas-table-head) !important;
    color: var(--speas-text) !important;
}

body.speas-app .finance-inbox-container tr:hover td {
    background: var(--speas-row-hover) !important;
}

/* Inicio: la paleta llega a todos los indicadores desde una sola capa final. */
html[data-speas-theme] body.speas-app .speas-home :is(
    .kpi-icon-wrapper,
    .shortcut-item i,
    .empty-state-widget i,
    .date-widget i
) {
    background: var(--speas-accent-soft) !important;
    color: var(--speas-accent) !important;
    border-color: color-mix(in srgb, var(--speas-accent) 20%, var(--speas-border)) !important;
}

html[data-speas-theme] body.speas-app .speas-home :is(
    .speas-eyebrow,
    .status-badge:not(.neutral)
) {
    background: var(--speas-accent-soft) !important;
    border-color: color-mix(in srgb, var(--speas-accent) 24%, var(--speas-border)) !important;
    color: var(--speas-accent) !important;
}

html[data-speas-theme] body.speas-app .speas-home .widget-header > i {
    color: var(--speas-accent) !important;
}

html:root:root[data-speas-theme] body.speas-app .speas-home .speas-primary-action {
    background: var(--speas-accent) !important;
    background-image: none !important;
    border-color: var(--speas-accent) !important;
    color: #ffffff !important;
    box-shadow: 0 8px 18px color-mix(in srgb, var(--speas-accent) 22%, transparent) !important;
}

html:root:root[data-speas-theme] body.speas-app .speas-home .speas-primary-action:hover {
    background: color-mix(in srgb, var(--speas-accent) 86%, #000000) !important;
    background-image: none !important;
}

html:root:root[data-speas-theme] body.speas-app .speas-home .btn-text {
    color: var(--speas-accent) !important;
}

html:root:root[data-speas-theme] body.speas-app #contenedor-dinamico .speas-home .status-badge.neutral {
    background: var(--speas-surface) !important;
    border-color: var(--speas-border) !important;
    color: var(--speas-muted) !important;
}

@media (min-width: 769px) {
    body.speas-app .speas-top-search + .speas-shell-actions {
        margin-left: 12px !important;
    }
}

@media (max-width: 768px) {
    body.speas-app .speas-shell-actions {
        margin-left: auto !important;
    }
}

/* Speas proveedores mobile/tablet final priority v1.1.1 */
@media (max-width: 1024px) {
    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) {
        max-width: min(100%, 760px) !important;
        margin-inline: auto !important;
    }

    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) > .table-toolbar {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto auto !important;
        gap: 10px !important;
        align-items: center !important;
        padding: 12px !important;
        border-radius: 16px !important;
        background: #ffffff !important;
        border: 1px solid #dbe7f5 !important;
        box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05) !important;
    }

    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) .filter-actions {
        display: contents !important;
    }

    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) .btn-icon {
        width: auto !important;
        min-width: 44px !important;
        height: 44px !important;
        padding: 0 12px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 7px !important;
        border-radius: 12px !important;
        background: #f8fbff !important;
        border: 1px solid #d7e4f4 !important;
        color: #284469 !important;
        box-shadow: none !important;
    }

    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) .btn-icon[title="Filtros"]::after {
        content: "Filtro";
        font-size: 12px;
        font-weight: 800;
    }

    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) .btn-icon[title="Exportar Excel"]::after {
        content: "Excel";
        font-size: 12px;
        font-weight: 800;
    }

    body.speas-app.module-proveedores-active #modal-proveedor.modal-overlay.active .modal-content.slide-in-right,
    body.speas-app.module-proveedores-active #modal-proveedor.modal-overlay.active .modal-content {
        width: min(780px, calc(100vw - 56px)) !important;
        max-width: calc(100vw - 56px) !important;
        height: min(840px, calc(100dvh - 56px)) !important;
        max-height: calc(100dvh - 56px) !important;
        border-radius: 22px !important;
        overflow: hidden !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .modal-body {
        padding: 20px 24px !important;
        overflow-y: auto !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .premium-table,
    body.speas-app.module-proveedores-active #modal-proveedor .premium-table tbody {
        display: grid !important;
        width: 100% !important;
        gap: 12px !important;
        border: 0 !important;
        background: transparent !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .premium-table tr {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) auto !important;
        gap: 12px !important;
        align-items: center !important;
        padding: 14px !important;
        border-radius: 16px !important;
        border: 1px solid #dbe7f5 !important;
        background: #f8fbff !important;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04) !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor #lista-dir-erp tr,
    body.speas-app.module-proveedores-active #modal-proveedor #lista-banco-erp tr {
        grid-template-columns: repeat(3, minmax(0, 1fr)) auto !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .premium-table td {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .premium-table td[style*="width:30px"],
    body.speas-app.module-proveedores-active #modal-proveedor .premium-table td[style*="width: 4%"] {
        width: auto !important;
        justify-self: end !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .premium-table input,
    body.speas-app.module-proveedores-active #modal-proveedor .premium-table select {
        width: 100% !important;
        min-height: 42px !important;
        border: 1px solid #d2dfef !important;
        border-radius: 11px !important;
        background: #ffffff !important;
        color: #0f172a !important;
        padding: 9px 12px !important;
        box-sizing: border-box !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .premium-table button {
        width: 38px !important;
        height: 38px !important;
        border-radius: 11px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: #ffe8ec !important;
        color: #ef4444 !important;
        border: 1px solid #ffd1d8 !important;
    }
}

@media (max-width: 768px) {
    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) {
        width: min(100%, 390px) !important;
        padding: 0 10px 28px !important;
    }

    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) > .module-header {
        margin-top: 0 !important;
        padding: 16px !important;
        border-radius: 16px !important;
    }

    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) > .module-header > div:last-child {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) > .module-header button {
        min-height: 46px !important;
        justify-content: center !important;
        white-space: normal !important;
        text-align: center !important;
    }

    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) > .table-toolbar {
        grid-template-columns: 1fr 44px 44px !important;
        gap: 8px !important;
    }

    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) .btn-icon {
        min-width: 44px !important;
        padding: 0 !important;
    }

    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) .btn-icon::after {
        content: none !important;
    }

    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) > .table-responsive {
        overflow: visible !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) > .table-responsive > table.premium-table,
    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) > .table-responsive > table.premium-table tbody,
    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) > .table-responsive > table.premium-table tr,
    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) > .table-responsive > table.premium-table td {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) > .table-responsive > table.premium-table thead {
        display: none !important;
    }

    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) > .table-responsive > table.premium-table tbody {
        display: grid !important;
        gap: 12px !important;
    }

    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) > .table-responsive > table.premium-table tr {
        padding: 14px !important;
        border-radius: 17px !important;
        background: #ffffff !important;
        color: #172033 !important;
        border: 1px solid #dbe7f5 !important;
        box-shadow: 0 16px 34px rgba(15, 23, 42, 0.07) !important;
    }

    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) > .table-responsive > table.premium-table td {
        display: grid !important;
        grid-template-columns: 92px minmax(0, 1fr) !important;
        align-items: center !important;
        gap: 10px !important;
        padding: 8px 0 !important;
        border: 0 !important;
        border-bottom: 1px solid #edf3fb !important;
        background: transparent !important;
        color: #172033 !important;
        font-size: 12px !important;
        line-height: 1.35 !important;
        text-align: left !important;
    }

    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) > .table-responsive > table.premium-table td:last-child {
        border-bottom: 0 !important;
        display: block !important;
    }

    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) > .table-responsive > table.premium-table td::before {
        display: block !important;
        color: #64748b !important;
        font-size: 10px !important;
        font-weight: 900 !important;
        line-height: 1.2 !important;
        text-transform: uppercase !important;
    }

    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) #tabla-proveedores-body td:nth-child(1)::before { content: "RUC" !important; }
    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) #tabla-proveedores-body td:nth-child(2)::before { content: "Razon social" !important; }
    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) #tabla-proveedores-body td:nth-child(3)::before { content: "Categoria" !important; }
    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) #tabla-proveedores-body td:nth-child(4)::before { content: "Contacto" !important; }
    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) #tabla-proveedores-body td:nth-child(5)::before { content: "Credito" !important; }
    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) #tabla-proveedores-body td:nth-child(6)::before { content: "Estado" !important; }
    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) #tabla-proveedores-body td:nth-child(7)::before { content: "Acciones" !important; }

    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) .client-contact {
        align-items: flex-start !important;
    }

    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) .status-badge {
        width: fit-content !important;
        max-width: 100% !important;
    }

    body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) .action-buttons {
        display: flex !important;
        justify-content: flex-start !important;
        gap: 9px !important;
        margin-top: 4px !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor.modal-overlay.active {
        padding: 10px !important;
        align-items: center !important;
        justify-content: center !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor.modal-overlay.active .modal-content.slide-in-right,
    body.speas-app.module-proveedores-active #modal-proveedor.modal-overlay.active .modal-content {
        width: calc(100vw - 20px) !important;
        max-width: calc(100vw - 20px) !important;
        height: calc(100dvh - 20px) !important;
        max-height: calc(100dvh - 20px) !important;
        border-radius: 20px !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .modal-header {
        min-height: 62px !important;
        padding: 16px 18px !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .modal-header h3 {
        font-size: 15px !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .btn-close {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        border-radius: 12px !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .modal-body {
        padding: 16px !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .row-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .form-subtitle {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        margin: 18px 0 12px !important;
        font-size: 13px !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .premium-table tr,
    body.speas-app.module-proveedores-active #modal-proveedor #lista-dir-erp tr,
    body.speas-app.module-proveedores-active #modal-proveedor #lista-tel-erp tr,
    body.speas-app.module-proveedores-active #modal-proveedor #lista-correo-erp tr,
    body.speas-app.module-proveedores-active #modal-proveedor #lista-banco-erp tr {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        padding: 13px !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .premium-table td[style*="width:30px"],
    body.speas-app.module-proveedores-active #modal-proveedor .premium-table td[style*="width: 4%"],
    body.speas-app.module-proveedores-active #modal-proveedor .premium-table td:last-child {
        position: static !important;
        justify-self: stretch !important;
        width: 100% !important;
        text-align: right !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .premium-table td:last-child button {
        margin-left: auto !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .modal-footer {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        padding: 12px 16px max(14px, env(safe-area-inset-bottom)) !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .modal-footer .btn-cancel {
        order: 1 !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor .modal-footer .btn-primary {
        order: 2 !important;
    }
}

/* Speas proveedores direct mobile overrides v1.1.2 */
@media (max-width: 768px) {
    body.speas-app.module-proveedores-active #tabla-proveedores-body {
        display: grid !important;
        gap: 12px !important;
        width: 100% !important;
    }

    body.speas-app.module-proveedores-active #tabla-proveedores-body tr {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        padding: 14px !important;
        border-radius: 17px !important;
        background: #ffffff !important;
        color: #172033 !important;
        border: 1px solid #dbe7f5 !important;
        box-shadow: 0 16px 34px rgba(15, 23, 42, 0.07) !important;
        box-sizing: border-box !important;
    }

    body.speas-app.module-proveedores-active #tabla-proveedores-body td {
        display: grid !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        grid-template-columns: 92px minmax(0, 1fr) !important;
        align-items: center !important;
        gap: 10px !important;
        padding: 8px 0 !important;
        border: 0 !important;
        border-bottom: 1px solid #edf3fb !important;
        background: transparent !important;
        color: #172033 !important;
        font-size: 12px !important;
        line-height: 1.35 !important;
        text-align: left !important;
        box-sizing: border-box !important;
    }

    body.speas-app.module-proveedores-active #tabla-proveedores-body td:last-child {
        display: block !important;
        border-bottom: 0 !important;
    }

    body.speas-app.module-proveedores-active #tabla-proveedores-body td::before {
        display: block !important;
        color: #64748b !important;
        font-size: 10px !important;
        font-weight: 900 !important;
        line-height: 1.2 !important;
        text-transform: uppercase !important;
    }

    body.speas-app.module-proveedores-active #tabla-proveedores-body td:nth-child(1)::before { content: "RUC" !important; }
    body.speas-app.module-proveedores-active #tabla-proveedores-body td:nth-child(2)::before { content: "Razon social" !important; }
    body.speas-app.module-proveedores-active #tabla-proveedores-body td:nth-child(3)::before { content: "Categoria" !important; }
    body.speas-app.module-proveedores-active #tabla-proveedores-body td:nth-child(4)::before { content: "Contacto" !important; }
    body.speas-app.module-proveedores-active #tabla-proveedores-body td:nth-child(5)::before { content: "Credito" !important; }
    body.speas-app.module-proveedores-active #tabla-proveedores-body td:nth-child(6)::before { content: "Estado" !important; }
    body.speas-app.module-proveedores-active #tabla-proveedores-body td:nth-child(7)::before { content: "Acciones" !important; }

    body.speas-app.module-proveedores-active #tabla-proveedores-body td,
    body.speas-app.module-proveedores-active #tabla-proveedores-body td * {
        color: #172033 !important;
    }

    body.speas-app.module-proveedores-active #tabla-proveedores-body td:nth-child(3) .status-badge,
    body.speas-app.module-proveedores-active #tabla-proveedores-body td:nth-child(6) .status-badge {
        color: #1d4ed8 !important;
    }

    body.speas-app.module-proveedores-active #tabla-proveedores-body .action-buttons {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: flex-start !important;
        gap: 9px !important;
        margin-top: 4px !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor tbody#lista-dir-erp tr,
    body.speas-app.module-proveedores-active #modal-proveedor tbody#lista-tel-erp tr,
    body.speas-app.module-proveedores-active #modal-proveedor tbody#lista-correo-erp tr,
    body.speas-app.module-proveedores-active #modal-proveedor tbody#lista-banco-erp tr {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        padding: 13px !important;
    }

    body.speas-app.module-proveedores-active #modal-proveedor tbody#lista-dir-erp td,
    body.speas-app.module-proveedores-active #modal-proveedor tbody#lista-tel-erp td,
    body.speas-app.module-proveedores-active #modal-proveedor tbody#lista-correo-erp td,
    body.speas-app.module-proveedores-active #modal-proveedor tbody#lista-banco-erp td {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        padding: 0 !important;
        border: 0 !important;
    }
}

/* Speas proveedores table layout breaker v1.1.3 */
@media (max-width: 768px) {
    html body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) table.premium-table,
    html body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) table.premium-table tbody#tabla-proveedores-body {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
        background: transparent !important;
    }

    html body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) table.premium-table thead {
        display: none !important;
    }

    html body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) table.premium-table tbody#tabla-proveedores-body {
        display: grid !important;
        gap: 12px !important;
    }

    html body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) table.premium-table tbody#tabla-proveedores-body > tr {
        display: grid !important;
        grid-template-columns: 1fr !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        padding: 14px !important;
        border-radius: 17px !important;
        background: #ffffff !important;
        color: #172033 !important;
        border: 1px solid #dbe7f5 !important;
        box-shadow: 0 16px 34px rgba(15, 23, 42, 0.07) !important;
        box-sizing: border-box !important;
    }

    html body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) table.premium-table tbody#tabla-proveedores-body > tr > td {
        display: grid !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        grid-template-columns: 92px minmax(0, 1fr) !important;
        align-items: center !important;
        gap: 10px !important;
        padding: 8px 0 !important;
        border: 0 !important;
        border-bottom: 1px solid #edf3fb !important;
        background: transparent !important;
        color: #172033 !important;
        font-size: 12px !important;
        line-height: 1.35 !important;
        text-align: left !important;
        box-sizing: border-box !important;
    }

    html body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) table.premium-table tbody#tabla-proveedores-body > tr > td:last-child {
        display: block !important;
        border-bottom: 0 !important;
    }

    html body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) table.premium-table tbody#tabla-proveedores-body > tr > td::before {
        display: block !important;
        color: #64748b !important;
        font-size: 10px !important;
        font-weight: 900 !important;
        line-height: 1.2 !important;
        text-transform: uppercase !important;
    }
}

/* Speas proveedores mobile cards and modal fields v1.1.4 */
@media (max-width: 768px) {
    html body.speas-app.module-proveedores-active #module-content .table-module-container {
        width: min(100%, 390px) !important;
        margin-inline: auto !important;
        padding-inline: 10px !important;
    }

    html body.speas-app.module-proveedores-active #module-content .table-module-container > .table-toolbar {
        grid-template-columns: minmax(0, 1fr) 44px 44px !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 10px !important;
    }

    html body.speas-app.module-proveedores-active #module-content .table-module-container .search-box {
        min-width: 0 !important;
        width: 100% !important;
    }

    html body.speas-app.module-proveedores-active #module-content .table-module-container .search-box input {
        min-width: 0 !important;
        width: 100% !important;
        text-overflow: ellipsis !important;
    }

    html body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) table.premium-table tbody#tabla-proveedores-body {
        gap: 14px !important;
    }

    html body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) table.premium-table tbody#tabla-proveedores-body > tr {
        padding: 14px 12px !important;
        border-radius: 18px !important;
    }

    html body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) table.premium-table tbody#tabla-proveedores-body > tr > td {
        grid-template-columns: 92px minmax(0, 1fr) !important;
        gap: 8px !important;
        min-height: 32px !important;
        overflow: hidden !important;
    }

    html body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) table.premium-table tbody#tabla-proveedores-body > tr > td,
    html body.speas-app.module-proveedores-active .table-module-container:has(#tabla-proveedores-body) table.premium-table tbody#tabla-proveedores-body > tr > td > * {
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
        white-space: normal !important;
    }

    html body.speas-app.module-proveedores-active #tabla-proveedores-body .status-badge {
        display: inline-flex !important;
        width: fit-content !important;
        max-width: 100% !important;
        min-height: 26px !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 5px 10px !important;
        line-height: 1.15 !important;
        overflow-wrap: normal !important;
        word-break: normal !important;
    }

    html body.speas-app.module-proveedores-active #tabla-proveedores-body .client-contact {
        min-width: 0 !important;
        max-width: 100% !important;
        gap: 4px !important;
    }

    html body.speas-app.module-proveedores-active #tabla-proveedores-body .client-contact span {
        display: inline-flex !important;
        min-width: 0 !important;
        max-width: 100% !important;
        align-items: center !important;
        gap: 4px !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
    }

    html body.speas-app.module-proveedores-active #modal-proveedor .modal-body {
        padding: 16px 14px !important;
    }

    html body.speas-app.module-proveedores-active #modal-proveedor tbody#lista-tel-erp tr,
    html body.speas-app.module-proveedores-active #modal-proveedor tbody#lista-correo-erp tr {
        display: grid !important;
        grid-template-columns: 1fr 44px !important;
        gap: 10px !important;
        align-items: start !important;
        padding: 12px !important;
        border-radius: 16px !important;
        background: #f8fbff !important;
        border: 1px solid #dbe7f5 !important;
    }

    html body.speas-app.module-proveedores-active #modal-proveedor tbody#lista-tel-erp tr > td,
    html body.speas-app.module-proveedores-active #modal-proveedor tbody#lista-correo-erp tr > td {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
    }

    html body.speas-app.module-proveedores-active #modal-proveedor tbody#lista-tel-erp tr > td:last-child,
    html body.speas-app.module-proveedores-active #modal-proveedor tbody#lista-correo-erp tr > td:last-child {
        grid-column: 2 !important;
        grid-row: 1 !important;
        align-self: start !important;
        justify-self: end !important;
    }

    html body.speas-app.module-proveedores-active #modal-proveedor tbody#lista-tel-erp .erp-principal-cell,
    html body.speas-app.module-proveedores-active #modal-proveedor tbody#lista-correo-erp .erp-principal-cell {
        grid-column: 1 / -1 !important;
        width: 100% !important;
    }

    html body.speas-app.module-proveedores-active #modal-proveedor .erp-principal-check {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
        width: 100% !important;
        min-height: 42px !important;
        padding: 9px 12px !important;
        border-radius: 12px !important;
        border: 1px solid #d2dfef !important;
        background: #ffffff !important;
        color: #334155 !important;
        font-size: 12px !important;
        font-weight: 800 !important;
        text-align: left !important;
        cursor: pointer !important;
    }

    html body.speas-app.module-proveedores-active #modal-proveedor .erp-principal-check input[type="checkbox"] {
        order: 2 !important;
        width: 20px !important;
        height: 20px !important;
        margin: 0 !important;
        accent-color: #2563eb !important;
    }

    html body.speas-app.module-proveedores-active #modal-proveedor .premium-table input,
    html body.speas-app.module-proveedores-active #modal-proveedor .premium-table select {
        min-height: 42px !important;
        border-radius: 12px !important;
        padding-inline: 12px !important;
    }
}

@media (min-width: 769px) and (max-width: 1180px) {
    html body.speas-app.module-proveedores-active #modal-proveedor tbody#lista-tel-erp tr,
    html body.speas-app.module-proveedores-active #modal-proveedor tbody#lista-correo-erp tr {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) 130px 42px !important;
        gap: 12px !important;
        align-items: center !important;
    }

    html body.speas-app.module-proveedores-active #modal-proveedor tbody#lista-correo-erp tr {
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr) 130px 42px !important;
    }

    html body.speas-app.module-proveedores-active #modal-proveedor .erp-principal-check {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        width: 100% !important;
        min-height: 40px !important;
        padding: 8px 10px !important;
        border-radius: 12px !important;
        border: 1px solid #d2dfef !important;
        background: #ffffff !important;
        color: #334155 !important;
        font-size: 12px !important;
        font-weight: 800 !important;
        cursor: pointer !important;
    }

    html body.speas-app.module-proveedores-active #modal-proveedor .erp-principal-check input[type="checkbox"] {
        width: 18px !important;
        height: 18px !important;
        margin: 0 !important;
        accent-color: #2563eb !important;
    }
}

/* Speas proveedores dark card final priority v1.1.5 */
@media (max-width: 768px) {
}

/* css/login.css */
:root {
    --auth-accent: #0f9488;
    --auth-accent-strong: #0b746c;
    --auth-accent-soft: color-mix(in srgb, var(--auth-accent) 12%, transparent);
    --auth-hero-start: #062f31;
    --auth-hero-end: #0a6963;
    --auth-hero-glow: #22c6b7;
    --auth-surface: color-mix(in srgb, var(--speas-surface, #ffffff) 96%, transparent);
    --auth-surface-soft: var(--speas-surface-2, #f5f8fc);
    --auth-line: var(--speas-border, #d8e3ef);
    --auth-text: var(--speas-text, #111827);
    --auth-muted: var(--speas-muted, #627189);
    --auth-danger: var(--speas-danger, #c2413b);
    --auth-success: var(--speas-success, #15803d);
    --auth-card-shadow: 0 28px 80px rgba(35, 48, 69, 0.14), 0 8px 24px rgba(35, 48, 69, 0.08);
}

.speas-auth-page[data-login-portal="contable"] {
    --auth-accent: #6968e4;
    --auth-accent-strong: #4f4fc2;
    --auth-hero-start: #151743;
    --auth-hero-end: #4542a4;
    --auth-hero-glow: #9897ff;
}

.speas-auth-page[data-login-portal="proveedores"] {
    --auth-accent: #2f76e8;
    --auth-accent-strong: #2359bd;
    --auth-hero-start: #082650;
    --auth-hero-end: #145eb0;
    --auth-hero-glow: #65a7ff;
}

.speas-auth-page[data-login-portal="recuperacion"] {
    --auth-accent: #0f766e;
    --auth-accent-strong: #0b5f59;
    --auth-hero-start: #0b3031;
    --auth-hero-end: #176a65;
    --auth-hero-glow: #56d8ca;
}

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

html { min-width: 320px; height: 100%; }

body.speas-auth-page {
    width: 100%;
    min-width: 320px;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    overflow: hidden;
    background: var(--auth-surface-soft);
    color: var(--auth-text);
    font-family: "Nunito", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden], .hidden, .speas-auth-page [hidden] { display: none; }

.auth-window, .auth-workspace { width: 100%; height: 100%; min-height: 0; }
.auth-window { overflow: hidden; }

.auth-workspace {
    display: grid;
    grid-template-columns: minmax(500px, 1.08fr) minmax(460px, 0.92fr);
}

.auth-sidebar {
    position: relative;
    isolation: isolate;
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    gap: clamp(18px, 2.4vh, 28px);
    overflow: hidden;
    padding: clamp(30px, 4vw, 58px) clamp(34px, 5.2vw, 78px);
    background:
        radial-gradient(circle at 82% 14%, color-mix(in srgb, var(--auth-hero-glow) 34%, transparent), transparent 34%),
        radial-gradient(circle at 12% 92%, rgba(255, 255, 255, 0.12), transparent 30%),
        linear-gradient(142deg, var(--auth-hero-start), var(--auth-hero-end));
    color: #ffffff;
}

.auth-sidebar::before, .auth-sidebar::after {
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.auth-sidebar::before {
    width: min(62vw, 720px);
    height: min(62vw, 720px);
    top: -42%;
    right: -36%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 72px rgba(255, 255, 255, 0.025), 0 0 0 145px rgba(255, 255, 255, 0.018);
}

.auth-sidebar::after {
    width: 260px;
    height: 260px;
    bottom: -170px;
    left: -90px;
    background: color-mix(in srgb, var(--auth-hero-glow) 28%, transparent);
    filter: blur(18px);
}

.auth-brand-row {
    position: relative;
    z-index: 3;
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.auth-brand { display: flex; min-width: 0; align-items: center; gap: 13px; }

.auth-brand-mark {
    display: grid;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 15px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.1));
    color: #ffffff;
    font-size: 21px;
    font-weight: 900;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 14px 30px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(12px);
}

.auth-brand-copy { min-width: 0; }
.auth-brand-copy strong, .auth-brand-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-brand-copy strong { color: #ffffff; font-size: 17px; font-weight: 850; }
.auth-brand-copy span { margin-top: 1px; color: rgba(255, 255, 255, 0.66); font-size: 11px; font-weight: 650; }

.auth-theme-slot { display: flex; flex: 0 0 auto; justify-content: flex-end; }

.auth-theme-slot .speas-theme-switch {
    position: static;
    display: inline-flex;
    padding: 3px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(5, 17, 28, 0.18);
    box-shadow: none;
    backdrop-filter: blur(12px);
}

.auth-theme-slot .speas-theme-btn {
    width: 31px;
    height: 30px;
    min-width: 31px;
    min-height: 30px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: rgba(255, 255, 255, 0.68);
    cursor: pointer;
}

.auth-theme-slot .speas-theme-btn:hover, .auth-theme-slot .speas-theme-btn.active {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.auth-intro {
    position: relative;
    z-index: 2;
    display: grid;
    max-width: 610px;
    gap: 11px;
}

.auth-eyebrow {
    width: max-content;
    max-width: 100%;
    padding: 6px 10px;
    border: 1px solid color-mix(in srgb, var(--auth-accent) 30%, var(--auth-line));
    border-radius: 999px;
    background: var(--auth-accent-soft);
    color: var(--auth-accent-strong);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.auth-sidebar .auth-eyebrow { border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.11); color: rgba(255,255,255,.88); }

.auth-intro h1 {
    max-width: 14ch;
    margin: 0;
    color: #ffffff;
    font-size: clamp(34px, 4.3vw, 64px);
    font-weight: 880;
    letter-spacing: -0.055em;
    line-height: .98;
    text-wrap: balance;
}

.auth-intro p { max-width: 55ch; margin: 0; color: rgba(255,255,255,.7); font-size: clamp(13px,1.15vw,16px); line-height: 1.55; }
.auth-sidebar-details { position: relative; z-index: 2; }

.auth-finder-list, .auth-trust-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.auth-finder-list { grid-template-columns: repeat(2, minmax(0,1fr)); }

.auth-finder-list li, .auth-trust-list li {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
    color: rgba(255,255,255,.68);
    font-size: 12px;
    font-weight: 700;
}

.auth-finder-list li {
    min-height: 42px;
    padding: 8px 11px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 12px;
    background: rgba(8,20,34,.12);
    backdrop-filter: blur(8px);
}

.auth-finder-list li.is-active { border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.14); color: #fff; }
.auth-finder-list i, .auth-trust-list i { flex: 0 0 auto; color: color-mix(in srgb,var(--auth-hero-glow) 72%,#fff); font-size: 17px; }

.auth-visual-stage {
    position: relative;
    z-index: 1;
    min-height: 168px;
    flex: 1 1 190px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 26px;
    background: linear-gradient(rgba(255,255,255,.045) 1px,transparent 1px), linear-gradient(90deg,rgba(255,255,255,.045) 1px,transparent 1px), rgba(6,18,32,.12);
    background-size: 28px 28px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.auth-orbit { position: absolute; top: 50%; left: 50%; border: 1px solid rgba(255,255,255,.17); border-radius: 50%; transform: translate(-50%,-50%); }
.auth-orbit-one { width: 150px; height: 150px; animation: auth-breathe 4.6s ease-in-out infinite; }
.auth-orbit-two { width: 236px; height: 236px; border-style: dashed; animation: auth-rotate 24s linear infinite; }

.auth-core {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    width: 70px;
    height: 70px;
    place-items: center;
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 24px;
    background: linear-gradient(145deg,rgba(255,255,255,.26),rgba(255,255,255,.09));
    color: #fff;
    font-size: 30px;
    box-shadow: 0 22px 50px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.3);
    transform: translate(-50%,-50%) rotate(-8deg);
    backdrop-filter: blur(10px);
}

.auth-insight-card {
    position: absolute;
    display: flex;
    min-width: 205px;
    align-items: center;
    gap: 10px;
    padding: 11px 13px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 15px;
    background: rgba(7,20,34,.42);
    color: #fff;
    box-shadow: 0 18px 42px rgba(0,0,0,.17);
    backdrop-filter: blur(16px);
}

.auth-insight-card.is-primary { top: 18px; right: 20px; animation: auth-float 5s ease-in-out infinite; }
.auth-insight-card.is-secondary { bottom: 18px; left: 20px; animation: auth-float 5s ease-in-out 1.2s infinite reverse; }
.auth-insight-icon { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 10px; background: rgba(255,255,255,.13); color: color-mix(in srgb,var(--auth-hero-glow) 72%,#fff); font-size: 18px; }
.auth-insight-card small, .auth-insight-card strong { display: block; }
.auth-insight-card small { color: rgba(255,255,255,.58); font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.auth-insight-card strong { margin-top: 2px; font-size: 12px; font-weight: 800; white-space: nowrap; }

.auth-live-dot {
    width: 8px;
    height: 8px;
    margin-left: auto;
    border: 2px solid rgba(255,255,255,.45);
    border-radius: 50%;
    background: #5ee6a8;
    animation: auth-pulse 2s ease-out infinite;
}

.auth-sidebar-footer {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,.14);
}

.auth-sidebar-footer .auth-trust-list { display: flex; flex-wrap: wrap; gap: 9px 15px; }
.auth-sidebar-footer p { max-width: 250px; margin: 0; color: rgba(255,255,255,.5); font-size: 10px; line-height: 1.4; text-align: right; }

.auth-main {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    align-items: center;
    justify-items: center;
    padding: clamp(26px,5vw,76px);
    background: radial-gradient(circle at 86% 12%,var(--auth-accent-soft),transparent 32%), radial-gradient(circle at 14% 86%,color-mix(in srgb,var(--auth-accent) 7%,transparent),transparent 30%), var(--auth-surface-soft);
}

.auth-main::before { position: absolute; width: 190px; height: 190px; top: 7%; right: 7%; border: 1px solid color-mix(in srgb,var(--auth-accent) 13%,transparent); border-radius: 50%; box-shadow: 0 0 0 48px color-mix(in srgb,var(--auth-accent) 2.5%,transparent); content: ""; pointer-events: none; }

.auth-card {
    position: relative;
    z-index: 1;
    display: grid;
    width: min(480px,100%);
    max-height: 100%;
    gap: clamp(15px,2.1vh,22px);
    padding: clamp(24px,3.6vw,44px);
    overflow: hidden;
    border: 1px solid color-mix(in srgb,var(--auth-line) 88%,transparent);
    border-radius: clamp(22px,2vw,30px);
    background: var(--auth-surface);
    box-shadow: var(--auth-card-shadow);
    backdrop-filter: blur(22px) saturate(125%);
    animation: auth-card-in 520ms cubic-bezier(.22,1,.36,1) both;
}

.auth-card::before { position: absolute; width: 86px; height: 4px; top: 0; left: 50%; border-radius: 0 0 999px 999px; background: linear-gradient(90deg,transparent,var(--auth-accent),transparent); content: ""; transform: translateX(-50%); }
.auth-card-header { display: grid; gap: 7px; }
.auth-card-header h2, .auth-card-header h3 { margin: 0; color: var(--auth-text); font-size: clamp(27px,3vw,36px); font-weight: 880; letter-spacing: -.045em; line-height: 1.06; }
.auth-card-header p { margin: 0; color: var(--auth-muted); font-size: 13px; line-height: 1.45; }
.auth-form, .auth-form-section { display: grid; gap: 14px; }
.auth-field { display: grid; gap: 6px; }
.auth-field > label, .auth-field-label { color: var(--auth-text); font-size: 11px; font-weight: 820; }
.auth-input { position: relative; display: flex; min-width: 0; align-items: center; }
.auth-input > i { position: absolute; left: 14px; z-index: 1; color: var(--auth-muted); font-size: 18px; pointer-events: none; }

.auth-input input, .auth-input select, .auth-textarea {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 10px 13px 10px 43px;
    border: 1px solid var(--auth-line);
    border-radius: 13px;
    outline: 0;
    background: var(--auth-surface-soft);
    color: var(--auth-text);
    font-size: 13px;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease, transform 160ms ease;
}

.auth-input input.has-action { padding-right: 46px; }
.auth-input input::placeholder, .auth-textarea::placeholder { color: color-mix(in srgb,var(--auth-muted) 76%,transparent); }
.auth-input input:focus, .auth-input select:focus, .auth-textarea:focus { border-color: var(--auth-accent); background: var(--auth-surface); box-shadow: 0 0 0 4px var(--auth-accent-soft); transform: translateY(-1px); }
.auth-input input:read-only { opacity: .72; cursor: not-allowed; }

.auth-input-action { position: absolute; right: 5px; display: grid; width: 38px; height: 38px; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--auth-muted); cursor: pointer; }
.auth-input-action:hover { background: var(--auth-accent-soft); color: var(--auth-accent); }
.auth-actions-row { display: flex; min-height: 18px; align-items: center; justify-content: flex-end; gap: 12px; }

.auth-link, .auth-footer a, .auth-quiet-button { border: 0; padding: 0; background: transparent; color: var(--auth-accent-strong); font-size: 11px; font-weight: 800; text-decoration: none; cursor: pointer; }
.auth-link:hover, .auth-footer a:hover, .auth-quiet-button:hover { text-decoration: underline; }

.auth-primary, .auth-secondary, .auth-inline-button { display: inline-flex; min-height: 47px; align-items: center; justify-content: center; gap: 9px; border-radius: 13px; font-weight: 850; cursor: pointer; transition: transform 150ms ease,box-shadow 150ms ease,filter 150ms ease; }

.auth-primary { position: relative; width: 100%; overflow: hidden; padding: 10px 16px; border: 1px solid color-mix(in srgb,var(--auth-accent-strong) 72%,transparent); background: linear-gradient(135deg,color-mix(in srgb,var(--auth-accent) 92%,#fff),var(--auth-accent-strong)); color: #fff; box-shadow: 0 12px 24px color-mix(in srgb,var(--auth-accent) 24%,transparent); }
.auth-primary::before { position: absolute; width: 44%; height: 180%; top: -40%; left: -55%; background: linear-gradient(90deg,transparent,rgba(255,255,255,.2),transparent); content: ""; transform: rotate(18deg); transition: left 520ms ease; }
.auth-primary:hover::before { left: 120%; }
.auth-secondary, .auth-inline-button { padding: 9px 14px; border: 1px solid var(--auth-line); background: var(--auth-surface); color: var(--auth-text); }
.auth-inline-button { min-height: 43px; font-size: 11px; white-space: nowrap; }
.auth-primary:hover, .auth-secondary:hover, .auth-inline-button:hover { filter: brightness(1.035); transform: translateY(-1px); }
.auth-primary:disabled, .auth-secondary:disabled, .auth-inline-button:disabled { opacity: .58; cursor: wait; filter: none; transform: none; }

.auth-spinner { display: none; width: 17px; height: 17px; flex: 0 0 17px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: auth-spin 700ms linear infinite; }
.auth-primary.loading .auth-spinner, .auth-primary[aria-busy="true"] .auth-spinner { display: inline-block; }
.auth-primary.loading > i, .auth-primary[aria-busy="true"] > i { display: none; }

.auth-message { display: none; min-height: 42px; align-items: flex-start; gap: 9px; padding: 10px 12px; border: 1px solid var(--auth-line); border-radius: 11px; background: var(--auth-surface-soft); color: var(--auth-muted); font-size: 12px; line-height: 1.4; }
.auth-message.show, .auth-message.is-visible { display: flex; }
.auth-message.error { border-color: color-mix(in srgb,var(--auth-danger) 34%,var(--auth-line)); background: color-mix(in srgb,var(--auth-danger) 9%,var(--auth-surface)); color: var(--auth-danger); }
.auth-message.info, .auth-message.success { border-color: color-mix(in srgb,var(--auth-accent) 30%,var(--auth-line)); background: var(--auth-accent-soft); color: var(--auth-accent-strong); }

.auth-divider { display: flex; align-items: center; gap: 10px; color: var(--auth-muted); font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.auth-divider::before, .auth-divider::after { height: 1px; flex: 1; background: var(--auth-line); content: ""; }
.auth-register-box { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--auth-line); border-radius: 13px; background: var(--auth-surface-soft); text-align: center; }
.auth-register-box p { margin: 0; color: var(--auth-muted); font-size: 11px; }
.auth-register-box .auth-secondary { min-height: 42px; }

.auth-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 7px; color: var(--auth-muted); font-size: 10px; text-align: center; }
.auth-security-note { display: flex; align-items: flex-start; gap: 8px; padding-top: 13px; border-top: 1px solid var(--auth-line); color: var(--auth-muted); font-size: 10px; line-height: 1.4; }
.auth-security-note i { flex: 0 0 auto; color: var(--auth-accent); font-size: 16px; }
.auth-security-note p { margin: 0; }
.auth-mfa { display: none; }
.auth-mfa.show { display: grid; animation: auth-reveal 180ms ease-out; }

body.speas-auth-page.is-leaving .auth-window { opacity: 0; transform: scale(.992); transition: opacity 180ms ease,transform 180ms ease; }
body.speas-auth-page[data-modal-open="true"] { overflow: hidden; }

.auth-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.auth-modal { position: fixed; z-index: 12000; inset: 0; display: grid; overflow-y: auto; padding: 24px; place-items: center; background: rgba(15,23,42,.62); backdrop-filter: blur(8px); }
.auth-modal[hidden], .auth-modal.hidden { display: none; }
.auth-modal-card { width: min(660px,100%); max-height: min(860px,calc(100dvh - 48px)); overflow-y: auto; border: 1px solid var(--auth-line); border-radius: 22px; background: var(--auth-surface); color: var(--auth-text); box-shadow: 0 32px 100px rgba(15,23,42,.36); }
.auth-modal-card.is-compact { width: min(500px,100%); }
.auth-modal-header { position: sticky; z-index: 2; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 20px; border-bottom: 1px solid var(--auth-line); background: color-mix(in srgb,var(--auth-surface) 94%,transparent); backdrop-filter: blur(14px); }
.auth-modal-header h3 { margin: 0; font-size: 18px; font-weight: 850; }
.auth-modal-close { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border: 1px solid var(--auth-line); border-radius: 11px; background: var(--auth-surface-soft); color: var(--auth-muted); cursor: pointer; }
.auth-modal-close:hover { color: var(--auth-danger); }
.auth-modal-body { display: grid; gap: 17px; padding: 20px; }
.auth-modal-intro, .auth-section-note { margin: 0; color: var(--auth-muted); font-size: 12px; line-height: 1.5; }
.auth-section-title { margin: 2px 0 -4px; color: var(--auth-accent-strong); font-size: 11px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.auth-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.auth-form-grid .is-wide { grid-column: 1 / -1; }
.auth-inline-field { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; }
.auth-otp-box { display: grid; gap: 9px; padding: 12px; border: 1px solid var(--auth-line); border-radius: 12px; background: var(--auth-surface-soft); }

.auth-toast-container { position: fixed; z-index: 13000; top: 18px; right: 18px; display: grid; width: min(380px,calc(100vw - 36px)); gap: 10px; }
.auth-toast { display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px; border: 1px solid var(--auth-line); border-radius: 13px; background: var(--auth-surface); color: var(--auth-text); font-size: 12px; line-height: 1.4; box-shadow: 0 14px 34px rgba(15,23,42,.17); animation: auth-toast-in 180ms ease-out; }
.auth-toast.success { border-left: 4px solid var(--auth-success); }
.auth-toast.error { border-left: 4px solid var(--auth-danger); }
.auth-toast.success i { color: var(--auth-success); }
.auth-toast.error i { color: var(--auth-danger); }
.auth-toast.is-leaving { opacity: 0; transform: translateX(16px); transition: opacity 180ms ease,transform 180ms ease; }

:is(.auth-primary,.auth-secondary,.auth-inline-button,.auth-input-action,.auth-modal-close,.auth-link,.auth-footer a,.auth-quiet-button,.speas-theme-btn):focus-visible,
.auth-input input:focus-visible, .auth-input select:focus-visible { outline: 2px solid var(--auth-accent); outline-offset: 2px; }

@keyframes auth-spin { to { transform: rotate(360deg); } }
@keyframes auth-reveal { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes auth-toast-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }
@keyframes auth-card-in { from { transform: translateY(18px) scale(.985); } to { transform: translateY(0) scale(1); } }
@keyframes auth-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes auth-breathe { 0%,100% { opacity: .56; transform: translate(-50%,-50%) scale(.96); } 50% { opacity: 1; transform: translate(-50%,-50%) scale(1.04); } }
@keyframes auth-rotate { from { transform: translate(-50%,-50%) rotate(0); } to { transform: translate(-50%,-50%) rotate(360deg); } }
@keyframes auth-pulse { 0% { box-shadow: 0 0 0 0 rgba(94,230,168,.55); } 70%,100% { box-shadow: 0 0 0 8px rgba(94,230,168,0); } }

@media (max-width: 1100px) {
    .auth-workspace { grid-template-columns: minmax(420px,.95fr) minmax(420px,1.05fr); }
    .auth-sidebar { padding-inline: clamp(30px,4vw,52px); }
    .auth-intro h1 { font-size: clamp(34px,4.8vw,50px); }
    .auth-sidebar-footer p { display: none; }
}

@media (max-width: 820px) {
    .auth-workspace { grid-template-columns: 1fr; grid-template-rows: auto minmax(0,1fr); }
    .auth-sidebar { gap: 12px; padding: 18px clamp(18px,6vw,38px) 16px; border-radius: 0 0 26px 26px; box-shadow: 0 14px 40px color-mix(in srgb,var(--auth-hero-start) 24%,transparent); }
    .auth-sidebar::before { width: 420px; height: 420px; top: -270px; right: -170px; }
    .auth-brand-mark { width: 40px; height: 40px; flex-basis: 40px; border-radius: 13px; font-size: 19px; }
    .auth-intro { gap: 6px; }
    .auth-intro .auth-eyebrow, .auth-sidebar-details, .auth-visual-stage, .auth-sidebar-footer { display: none; }
    .auth-intro h1 { max-width: 20ch; font-size: clamp(22px,6.2vw,31px); line-height: 1.03; }
    .auth-intro p { max-width: 68ch; font-size: 12px; line-height: 1.4; }
    .auth-main { align-items: center; padding: clamp(12px,3.8vh,28px) clamp(14px,6vw,38px); }
    .auth-card { width: min(500px,100%); gap: clamp(11px,2vh,17px); padding: clamp(18px,4.8vw,28px); border-radius: 22px; }
    .auth-card-header h2, .auth-card-header h3 { font-size: clamp(24px,6.5vw,30px); }
    body.speas-auth-page:has(.auth-input input:focus) .auth-main { overflow-y: auto; }
}

@media (max-width: 520px) {
    .auth-sidebar { padding: 14px 16px 13px; }
    .auth-brand { gap: 10px; }
    .auth-brand-copy strong { font-size: 15px; }
    .auth-brand-copy span { font-size: 10px; }
    .auth-theme-slot .speas-theme-btn { width: 28px; min-width: 28px; height: 28px; min-height: 28px; }
    .auth-intro h1 { font-size: clamp(20px,6.5vw,26px); }
    .auth-intro p { font-size: 11px; }
    .auth-main { padding: 12px; }
    .auth-card { padding: 18px; }
    .auth-form-grid { grid-template-columns: 1fr; }
    .auth-form-grid .is-wide { grid-column: auto; }
    .auth-inline-field { grid-template-columns: 1fr; }
    .auth-inline-button { width: 100%; }
    .auth-modal { padding: 8px; place-items: end center; }
    .auth-modal-card, .auth-modal-card.is-compact { max-height: calc(100dvh - 16px); border-radius: 19px; }
    .auth-toast-container { top: 10px; right: 10px; width: calc(100vw - 20px); }
}

@media (max-width: 820px) and (max-height: 740px) {
    .auth-sidebar { gap: 7px; padding-top: 10px; padding-bottom: 9px; border-radius: 0 0 20px 20px; }
    .auth-brand-mark { width: 35px; height: 35px; flex-basis: 35px; border-radius: 11px; font-size: 17px; }
    .auth-intro p { display: none; }
    .auth-intro h1 { font-size: clamp(18px,5.8vw,23px); }
    .auth-main { padding: 8px 11px; }
    .auth-card { gap: 9px; padding: 14px 16px; border-radius: 18px; }
    .auth-card-header { gap: 4px; }
    .auth-card-header h2, .auth-card-header h3 { font-size: 22px; }
    .auth-card-header p { font-size: 11px; }
    .auth-form, .auth-form-section { gap: 9px; }
    .auth-field { gap: 4px; }
    .auth-input input, .auth-input select, .auth-textarea { min-height: 42px; padding-top: 7px; padding-bottom: 7px; }
    .auth-primary, .auth-secondary { min-height: 42px; }
    .auth-security-note, .auth-footer { display: none; }
    .auth-divider { gap: 7px; }
    .auth-register-box { padding: 8px; }
    .auth-register-box p { display: none; }
    .auth-register-box .auth-secondary { min-height: 38px; }
}

@media (min-width: 821px) and (max-height: 760px) {
    .auth-sidebar { gap: 14px; padding-top: 24px; padding-bottom: 24px; }
    .auth-intro h1 { font-size: clamp(32px,4vw,48px); }
    .auth-intro p { font-size: 12px; }
    .auth-visual-stage { min-height: 128px; flex-basis: 140px; }
    .auth-sidebar-footer { display: none; }
    .auth-main { padding-block: 18px; }
    .auth-card { gap: 12px; padding-block: 24px; }
    .auth-security-note { padding-top: 10px; }
}

@media (min-width: 1800px) {
    .auth-workspace { grid-template-columns: minmax(740px,1.12fr) minmax(620px,.88fr); }
    .auth-card { width: min(520px,100%); }
    .auth-intro h1 { font-size: clamp(56px,4vw,72px); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto; animation-duration: .01ms; animation-iteration-count: 1; transition-duration: .01ms; }
}

/* SPEAS v6 — acceso claro, corporativo y compartido entre portales. */
body.speas-auth-page {
    --auth-brand-panel: #fbfcfe;
    --auth-brand-panel-soft: #f4f7fb;
    --auth-brand-grid: color-mix(in srgb, var(--auth-accent) 7%, transparent);
}

body.speas-auth-page .auth-sidebar {
    border-right: 1px solid var(--auth-line);
    background:
        radial-gradient(circle at 84% 9%, color-mix(in srgb, var(--auth-accent) 10%, transparent), transparent 27%),
        radial-gradient(circle at 5% 95%, color-mix(in srgb, var(--auth-accent) 6%, transparent), transparent 23%),
        linear-gradient(var(--auth-brand-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--auth-brand-grid) 1px, transparent 1px),
        var(--auth-brand-panel);
    background-size: auto, auto, 34px 34px, 34px 34px, auto;
    color: var(--auth-text);
}

body.speas-auth-page .auth-sidebar::before {
    width: 360px;
    height: 360px;
    top: -190px;
    right: -120px;
    border: 1px solid color-mix(in srgb, var(--auth-accent) 13%, transparent);
    background: color-mix(in srgb, var(--auth-accent) 3.5%, transparent);
    box-shadow: 0 0 0 54px color-mix(in srgb, var(--auth-accent) 2%, transparent);
}

body.speas-auth-page .auth-sidebar::after {
    width: 240px;
    height: 110px;
    bottom: -54px;
    left: -62px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--auth-accent) 9%, transparent);
    filter: blur(2px);
    transform: rotate(-16deg);
}

body.speas-auth-page .auth-brand-mark {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    overflow: hidden;
    border: 0;
    border-radius: 15px;
    background: transparent;
    box-shadow: 0 12px 28px color-mix(in srgb, var(--auth-accent) 21%, transparent);
    backdrop-filter: none;
}

body.speas-auth-page .auth-brand-mark img { width: 100%; height: 100%; display: block; }
body.speas-auth-page .auth-brand-copy strong { color: var(--auth-text); font-size: 18px; letter-spacing: .05em; }
body.speas-auth-page .auth-brand-copy span { color: var(--auth-muted); font-size: 10px; letter-spacing: .025em; }
body.speas-auth-page .auth-sidebar .auth-eyebrow { border-color: color-mix(in srgb,var(--auth-accent) 24%,var(--auth-line)); background: var(--auth-accent-soft); color: var(--auth-accent-strong); }
body.speas-auth-page .auth-intro h1 { max-width: 15ch; color: var(--auth-text); font-size: clamp(35px,3.8vw,58px); line-height: 1.01; }
body.speas-auth-page .auth-intro p { color: var(--auth-muted); }

body.speas-auth-page .auth-visual-stage {
    min-height: 205px;
    border-color: var(--auth-line);
    background:
        linear-gradient(color-mix(in srgb,var(--auth-accent) 7%,transparent) 1px, transparent 1px),
        linear-gradient(90deg,color-mix(in srgb,var(--auth-accent) 7%,transparent) 1px,transparent 1px),
        color-mix(in srgb,var(--auth-surface) 96%,var(--auth-accent-soft));
    background-size: 28px 28px;
    box-shadow: inset 0 1px 0 #fff, 0 18px 45px rgba(38,52,74,.06);
}

body.speas-auth-page .auth-orbit { border-color: color-mix(in srgb,var(--auth-accent) 23%,transparent); }
body.speas-auth-page .auth-core { display: none; }
body.speas-auth-page .auth-insight-card {
    min-width: 196px;
    border-color: color-mix(in srgb,var(--auth-accent) 16%,var(--auth-line));
    background: color-mix(in srgb,var(--auth-surface) 95%,transparent);
    color: var(--auth-text);
    box-shadow: 0 14px 34px rgba(38,52,74,.11);
}
body.speas-auth-page .auth-insight-icon { background: var(--auth-accent-soft); color: var(--auth-accent); }
body.speas-auth-page .auth-insight-card small { color: var(--auth-muted); }
body.speas-auth-page .auth-insight-card strong { color: var(--auth-text); }
body.speas-auth-page .auth-live-dot { border-color: #fff; }
body.speas-auth-page .auth-finder-list li {
    border-color: var(--auth-line);
    background: color-mix(in srgb,var(--auth-surface) 93%,transparent);
    color: var(--auth-muted);
    box-shadow: 0 7px 18px rgba(38,52,74,.035);
}
body.speas-auth-page .auth-finder-list li.is-active { border-color: color-mix(in srgb,var(--auth-accent) 26%,var(--auth-line)); background: var(--auth-accent-soft); color: var(--auth-accent-strong); }
body.speas-auth-page .auth-finder-list i, body.speas-auth-page .auth-trust-list i { color: var(--auth-accent); }
body.speas-auth-page .auth-trust-list li { color: var(--auth-muted); }
body.speas-auth-page .auth-sidebar-footer { border-top-color: var(--auth-line); }
body.speas-auth-page .auth-sidebar-footer p { color: var(--auth-muted); }
body.speas-auth-page .auth-main { background: radial-gradient(circle at 88% 10%,var(--auth-accent-soft),transparent 31%), radial-gradient(circle at 14% 88%,color-mix(in srgb,var(--auth-accent) 5%,transparent),transparent 30%), #f4f7fb; }

/* Asistente vectorial SPEAS: ligero, reactivo y sin librerías de animación. */
.speas-assistant {
    --assistant-eye-x: 0px;
    --assistant-eye-y: 0px;
    position: absolute;
    z-index: 3;
    top: 50%;
    left: 50%;
    width: 122px;
    height: 145px;
    transform: translate(-50%,-42%);
    pointer-events: none;
}

.speas-assistant-unit { position: absolute; width: 92px; height: 116px; left: 15px; bottom: 7px; animation: speas-assistant-walk 1.2s ease-in-out infinite; }
.speas-assistant-shadow { position: absolute; width: 72px; height: 12px; left: 25px; bottom: 1px; border-radius: 50%; background: rgba(44,57,78,.12); filter: blur(3px); animation: speas-assistant-shadow 1.2s ease-in-out infinite; }
.speas-assistant-antenna { position: absolute; z-index: 0; width: 3px; height: 15px; top: -10px; left: 45px; border-radius: 4px; background: #5d6b7e; }
.speas-assistant-antenna i { position: absolute; width: 8px; height: 8px; top: -5px; left: -2.5px; border-radius: 50%; background: var(--auth-accent); box-shadow: 0 0 0 4px var(--auth-accent-soft); animation: auth-pulse 2s ease-out infinite; }
.speas-assistant-head { position: absolute; z-index: 4; width: 78px; height: 58px; top: 3px; left: 7px; border: 1px solid #cbd6e3; border-radius: 24px 24px 20px 20px; background: linear-gradient(150deg,#fff,#edf3f9); box-shadow: 0 10px 23px rgba(46,59,79,.15), inset 0 1px 0 #fff; }
.speas-assistant-face { position: absolute; inset: 9px 10px 10px; border-radius: 16px; background: linear-gradient(145deg,#182838,#263b4e); box-shadow: inset 0 1px 2px rgba(255,255,255,.12); }
.speas-assistant-ear { position: absolute; z-index: -1; width: 10px; height: 25px; top: 17px; border: 1px solid #c5d2df; background: #e7eef6; }
.speas-assistant-ear.is-left { left: -7px; border-radius: 8px 2px 2px 8px; }
.speas-assistant-ear.is-right { right: -7px; border-radius: 2px 8px 8px 2px; }
.speas-assistant-eye { position: absolute; width: 15px; height: 12px; top: 10px; border-radius: 8px; background: #eafcff; box-shadow: 0 0 10px color-mix(in srgb,var(--auth-accent) 46%,transparent); }
.speas-assistant-eye.is-left { left: 9px; }
.speas-assistant-eye.is-right { right: 9px; }
.speas-assistant-eye i { position: absolute; width: 5px; height: 5px; top: 3.5px; left: 5px; border-radius: 50%; background: var(--auth-accent); transform: translate(var(--assistant-eye-x),var(--assistant-eye-y)); transition: transform 80ms linear; }
.speas-assistant-mouth { position: absolute; width: 18px; height: 6px; bottom: 6px; left: 20px; border-bottom: 2px solid #8bdacb; border-radius: 0 0 14px 14px; }
.speas-assistant-body { position: absolute; z-index: 2; width: 55px; height: 52px; top: 57px; left: 18px; border: 1px solid #c9d5e1; border-radius: 18px 18px 16px 16px; background: linear-gradient(145deg,#fff,#e9f0f7); box-shadow: 0 12px 24px rgba(46,59,79,.14); }
.speas-assistant-body img { position: absolute; width: 25px; height: 25px; top: 11px; left: 14px; border-radius: 8px; }
.speas-assistant-status { position: absolute; width: 6px; height: 6px; right: 6px; bottom: 7px; border-radius: 50%; background: #3bc48d; box-shadow: 0 0 0 3px #dff8ee; }
.speas-assistant-arm { position: absolute; z-index: 3; width: 13px; height: 48px; top: 57px; transform-origin: 50% 7px; transition: top 240ms ease, left 240ms ease, right 240ms ease, transform 260ms ease; }
.speas-assistant-arm::before { position: absolute; width: 10px; height: 32px; top: 0; left: 1px; border: 1px solid #c7d4e0; border-radius: 10px; background: linear-gradient(#f8fbff,#dfe8f1); content: ""; }
.speas-assistant-arm i { position: absolute; width: 13px; height: 13px; bottom: 2px; left: 0; border: 1px solid #bdcbd9; border-radius: 50%; background: #f6faff; }
.speas-assistant-arm.is-left { left: 10px; transform: rotate(11deg); }
.speas-assistant-arm.is-right { right: 10px; transform: rotate(-11deg); }
.speas-assistant-leg { position: absolute; z-index: 1; width: 17px; height: 30px; top: 98px; transform-origin: 50% 2px; }
.speas-assistant-leg::before { position: absolute; width: 12px; height: 23px; top: 0; left: 2px; border-radius: 8px; background: #dce6f0; border: 1px solid #c5d2df; content: ""; }
.speas-assistant-leg i { position: absolute; width: 21px; height: 9px; bottom: 0; border-radius: 8px 8px 6px 6px; background: #64748b; }
.speas-assistant-leg.is-left { left: 24px; animation: speas-assistant-leg-left 1.2s ease-in-out infinite; }
.speas-assistant-leg.is-right { right: 24px; animation: speas-assistant-leg-right 1.2s ease-in-out infinite; }
.speas-assistant-bubble { position: absolute; z-index: 7; min-width: 190px; max-width: 230px; left: 82px; top: -23px; padding: 9px 12px; border: 1px solid var(--auth-line); border-radius: 13px 13px 13px 5px; background: rgba(255,255,255,.96); color: var(--auth-text); font-size: 10px; font-weight: 800; line-height: 1.35; box-shadow: 0 12px 28px rgba(38,52,74,.11); }
.speas-assistant-bubble::before { position: absolute; width: 9px; height: 9px; left: -5px; bottom: 7px; border-left: 1px solid var(--auth-line); border-bottom: 1px solid var(--auth-line); background: #fff; content: ""; transform: rotate(45deg); }
.speas-assistant-bubble span { display: block; }
.speas-assistant-bubble span.is-changing { animation: speas-assistant-copy 420ms ease-out; }

body.assistant-is-shy .speas-assistant-arm.is-left { left: 22px; top: 32px; transform: rotate(-23deg); }
body.assistant-is-shy .speas-assistant-arm.is-right { right: 22px; top: 32px; transform: rotate(23deg); }
body.assistant-is-shy .speas-assistant-arm i { background: var(--auth-accent-soft); }
body.assistant-is-shy .speas-assistant-eye i { opacity: 0; }
body.assistant-is-shy .speas-assistant-mouth { width: 12px; left: 23px; border-radius: 50%; }
body[data-assistant-state="busy"] .speas-assistant-status { background: #f59e0b; box-shadow: 0 0 0 3px #fff1c9; animation: auth-pulse 1.1s ease-out infinite; }
body[data-assistant-state="success"] .speas-assistant-unit { animation: speas-assistant-success 620ms ease-out 2; }

.speas-assistant-mini { display: none; position: relative; width: 40px; height: 34px; flex: 0 0 40px; border: 1px solid rgba(255,255,255,.27); border-radius: 13px; background: rgba(255,255,255,.14); box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }
.speas-assistant-mini-face { position: absolute; inset: 6px 5px; border-radius: 8px; background: #203447; }
.speas-assistant-mini-face i { position: absolute; width: 7px; height: 7px; top: 7px; border-radius: 50%; background: #dffaf6; }
.speas-assistant-mini-face i.is-left { left: 6px; }
.speas-assistant-mini-face i.is-right { right: 6px; }
.speas-assistant-mini-hand { position: absolute; z-index: 2; width: 9px; height: 13px; top: 13px; border: 1px solid #c4d1dd; border-radius: 7px; background: #f4f8fc; opacity: 0; transition: transform 220ms ease,opacity 180ms ease; }
.speas-assistant-mini-hand.is-left { left: 7px; }
.speas-assistant-mini-hand.is-right { right: 7px; }
body.assistant-is-shy .speas-assistant-mini-hand { opacity: 1; transform: translateY(-3px); }

@keyframes speas-assistant-walk { 0%,100% { transform: translateY(0) rotate(-.7deg); } 50% { transform: translateY(-3px) rotate(.7deg); } }
@keyframes speas-assistant-shadow { 0%,100% { opacity: .55; transform: scaleX(1); } 50% { opacity: .35; transform: scaleX(.82); } }
@keyframes speas-assistant-leg-left { 0%,100% { transform: rotate(8deg); } 50% { transform: rotate(-8deg); } }
@keyframes speas-assistant-leg-right { 0%,100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
@keyframes speas-assistant-copy { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@keyframes speas-assistant-success { 0%,100% { transform: translateY(0); } 45% { transform: translateY(-10px); } }

/* ERP: pulso operativo y guía humana. El resto de portales conserva su escena. */
body[data-login-portal="erp"] .auth-visual-stage {
    min-height: 230px;
    background:
        linear-gradient(color-mix(in srgb,var(--auth-accent) 6%,transparent) 1px,transparent 1px),
        linear-gradient(90deg,color-mix(in srgb,var(--auth-accent) 6%,transparent) 1px,transparent 1px),
        radial-gradient(circle at 10% 94%,color-mix(in srgb,var(--auth-accent) 12%,transparent),transparent 34%),
        color-mix(in srgb,var(--auth-surface) 97%,var(--auth-accent-soft));
    background-size: 28px 28px,28px 28px,auto,auto;
}

.auth-operation-board {
    position: absolute;
    z-index: 2;
    width: min(56%, 365px);
    max-height: calc(100% - 30px);
    top: 50%;
    right: clamp(15px,2.4vw,28px);
    display: grid;
    gap: 10px;
    padding: 15px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb,var(--auth-accent) 13%,var(--auth-line));
    border-radius: 20px;
    background: color-mix(in srgb,var(--auth-surface) 97%,transparent);
    box-shadow: 0 22px 55px rgba(38,52,74,.1),inset 0 1px 0 #fff;
    transform: translateY(-50%);
    backdrop-filter: blur(16px);
}

.auth-operation-board-head,.auth-operation-board-head > span,.auth-operation-metric > span {
    display: flex;
    align-items: center;
}

.auth-operation-board-head { justify-content: space-between; gap: 12px; }
.auth-operation-board-head > span:first-child { display: grid; gap: 1px; }
.auth-operation-board-head small { color: var(--auth-muted); font-size: 8px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.auth-operation-board-head strong { color: var(--auth-text); font-size: 14px; font-weight: 900; }
.auth-operation-online { gap: 5px; padding: 4px 8px; border-radius: 999px; background: #eaf8f2; color: #13745a; font-size: 8px; font-weight: 900; }
.auth-operation-online i { width: 6px; height: 6px; border-radius: 50%; background: #2fb985; box-shadow: 0 0 0 3px rgba(47,185,133,.12); }

.auth-operation-metric { display: grid; gap: 7px; padding: 10px 11px; border: 1px solid var(--auth-line); border-radius: 13px; background: var(--auth-surface-soft); }
.auth-operation-metric > span { justify-content: space-between; gap: 12px; color: var(--auth-muted); font-size: 9px; }
.auth-operation-metric > span strong { font-weight: 800; }
.auth-operation-metric > span b { color: var(--auth-accent-strong); font-size: 10px; }
.auth-operation-metric > i { height: 5px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb,var(--auth-line) 72%,#fff); }
.auth-operation-metric > i em { display: block; width: 84%; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--auth-accent),color-mix(in srgb,var(--auth-accent) 70%,#62c9b2)); animation: auth-operation-progress 900ms cubic-bezier(.22,1,.36,1) both; }

.auth-operation-events { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.auth-operation-events li { display: flex; min-width: 0; align-items: center; gap: 8px; padding: 7px 8px; border: 1px solid color-mix(in srgb,var(--auth-line) 78%,transparent); border-radius: 11px; background: color-mix(in srgb,var(--auth-surface) 96%,transparent); }
.auth-operation-events > li > i { display: grid; width: 22px; height: 22px; flex: 0 0 22px; place-items: center; border-radius: 50%; background: var(--auth-accent-soft); color: var(--auth-accent); font-size: 14px; font-weight: 900; }
.auth-operation-events span { display: grid; min-width: 0; gap: 1px; }
.auth-operation-events strong,.auth-operation-events small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-operation-events strong { color: var(--auth-text); font-size: 9px; font-weight: 850; }
.auth-operation-events small { color: var(--auth-muted); font-size: 7.5px; }

.speas-assistant-person {
    width: min(43%,210px);
    height: calc(100% - 14px);
    top: auto;
    bottom: 0;
    left: 3%;
    transform: none;
}

.speas-person-figure { position: absolute; z-index: 3; inset: 12px 0 0; transform-origin: 50% 100%; animation: speas-person-breathe 4.8s ease-in-out infinite; }
.speas-person-figure > img { width: 100%; height: 100%; display: block; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 16px 18px rgba(36,52,72,.12)); }
.speas-person-shadow { position: absolute; z-index: 1; width: 58%; height: 10px; left: 21%; bottom: 5px; border-radius: 50%; background: rgba(48,63,83,.12); filter: blur(5px); }
.speas-person-status { position: absolute; z-index: 6; left: 6px; bottom: 10px; display: flex; align-items: center; gap: 5px; padding: 5px 8px; border: 1px solid color-mix(in srgb,var(--auth-accent) 18%,var(--auth-line)); border-radius: 999px; background: rgba(255,255,255,.94); color: var(--auth-muted); font-size: 7.5px; font-weight: 850; box-shadow: 0 8px 20px rgba(38,52,74,.09); }
.speas-person-status i { width: 6px; height: 6px; border-radius: 50%; background: #32b985; box-shadow: 0 0 0 3px rgba(50,185,133,.12); }
.speas-person-privacy { position: absolute; z-index: 8; width: 92px; top: 31%; left: 50%; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 6px 7px; border: 1px solid color-mix(in srgb,var(--auth-accent) 30%,var(--auth-line)); border-radius: 9px; background: rgba(255,255,255,.97); color: var(--auth-accent-strong); font-size: 7px; box-shadow: 0 8px 20px rgba(24,39,58,.14); opacity: 0; transform: translate(-50%,8px) scale(.92); transition: opacity 180ms ease,transform 220ms cubic-bezier(.22,1,.36,1); }
.speas-person-privacy i { font-size: 10px; }
.speas-person-privacy b { white-space: nowrap; }

.speas-assistant-person .speas-assistant-bubble { min-width: 155px; max-width: 185px; top: 11px; left: 72%; border-radius: 13px 13px 13px 5px; }
body.assistant-is-shy .speas-assistant-person .speas-person-privacy { opacity: 1; transform: translate(-50%,0) scale(1); }
body.assistant-is-shy .speas-assistant-person .speas-person-figure { animation-play-state: paused; }
body[data-assistant-state="busy"] .speas-assistant-person .speas-person-status i { background: #eaa21f; box-shadow: 0 0 0 3px rgba(234,162,31,.15); animation: auth-pulse 1.1s ease-out infinite; }
body[data-assistant-state="success"] .speas-assistant-person .speas-person-figure { animation: speas-person-success 620ms ease-out 2; }

.speas-assistant-mini-person { overflow: hidden; border-color: color-mix(in srgb,var(--auth-accent) 25%,var(--auth-line)); background: #fff; box-shadow: 0 8px 18px rgba(22,48,68,.12); }
.speas-assistant-mini-person img { position: absolute; width: 43px; height: 65px; top: -2px; left: 50%; object-fit: contain; object-position: center top; transform: translateX(-50%); }
.speas-assistant-mini-person > i { position: absolute; z-index: 2; width: 7px; height: 7px; right: 3px; bottom: 3px; border: 2px solid #fff; border-radius: 50%; background: #32b985; }

@keyframes auth-operation-progress { from { width: 0; } to { width: 84%; } }
@keyframes speas-person-breathe { 0%,100% { transform: translateY(0) rotate(-.3deg); } 50% { transform: translateY(-3px) rotate(.3deg); } }
@keyframes speas-person-success { 0%,100% { transform: translateY(0); } 45% { transform: translateY(-8px); } }

@media (max-width: 1100px) and (min-width: 821px) {
    .speas-assistant { transform: translate(-55%,-40%) scale(.9); }
    .speas-assistant-bubble { min-width: 158px; max-width: 174px; left: 72px; font-size: 9px; }
    body.speas-auth-page .auth-insight-card { min-width: 170px; }
    .speas-assistant-person { width: 41%; left: 1%; transform: none; }
    .speas-assistant-person .speas-assistant-bubble { min-width: 126px; max-width: 138px; left: 4px; }
    .auth-operation-board { width: 57%; right: 12px; padding: 12px; }
}

@media (max-width: 820px) {
    /* En móvil conservamos el encabezado compacto que ya funcionaba bien. */
    body.speas-auth-page .auth-sidebar {
        border-right: 0;
        border-bottom: 1px solid rgba(255,255,255,.16);
        background:
            radial-gradient(circle at 88% -15%,color-mix(in srgb,var(--auth-hero-glow) 33%,transparent),transparent 45%),
            linear-gradient(142deg,var(--auth-hero-start),var(--auth-hero-end));
        color: #fff;
    }
    body.speas-auth-page .auth-sidebar::before { border-color: rgba(255,255,255,.11); background: transparent; box-shadow: 0 0 0 54px rgba(255,255,255,.025); }
    body.speas-auth-page .auth-brand-copy strong, body.speas-auth-page .auth-intro h1 { color: #fff; }
    body.speas-auth-page .auth-brand-copy span, body.speas-auth-page .auth-intro p { color: rgba(255,255,255,.7); }
    body.speas-auth-page .auth-brand-mark { width: 40px; height: 40px; flex-basis: 40px; border-radius: 13px; box-shadow: 0 10px 24px rgba(0,0,0,.16); }
    .speas-assistant-mini { display: block; margin-left: auto; animation: speas-assistant-walk 1.5s ease-in-out infinite; }
}

@media (prefers-reduced-motion: reduce) {
    .speas-assistant-unit, .speas-assistant-shadow, .speas-assistant-leg, .speas-assistant-mini { animation: none !important; }
    .speas-assistant-bubble span { animation: none !important; }
    .speas-person-figure,.auth-operation-metric > i em { animation: none !important; }
}

@media (min-width: 821px) and (max-height: 760px) {
    body[data-login-portal="erp"] .auth-visual-stage { min-height: 145px; }
    .auth-operation-board { gap: 6px; padding: 10px; }
    .auth-operation-metric { padding: 7px 9px; }
    .auth-operation-events { gap: 4px; }
    .auth-operation-events li { padding: 5px 7px; }
    .auth-operation-events li:nth-child(3) { display: none; }
    .speas-assistant-person .speas-assistant-bubble { top: 2px; padding: 6px 8px; }
    .speas-person-status { display: none; }
}

/* Pasos de enrolamiento MFA dentro del mismo lenguaje del acceso. */
.paso { display: none; }
.paso.show { display: grid; animation: auth-reveal 180ms ease-out; }
.auth-callout { margin: 0; padding: 10px 12px; border-left: 3px solid var(--auth-accent); border-radius: 0 10px 10px 0; background: var(--auth-accent-soft); color: var(--auth-muted); font-size: 11px; line-height: 1.45; }
.auth-secret-wrap { display: grid; gap: 6px; }
.auth-secret-wrap > span { color: var(--auth-text); font-size: 11px; font-weight: 820; }
.auth-secret { margin: 0; padding: 11px 12px; border: 1px solid var(--auth-line); border-radius: 12px; background: var(--auth-surface-soft); color: var(--auth-text); font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px; font-weight: 700; letter-spacing: .1em; line-height: 1.65; overflow-wrap: anywhere; }
.auth-copy { width: 100%; min-height: 40px; }
.auth-steps { display: grid; gap: 5px; margin: 0; padding-left: 18px; color: var(--auth-muted); font-size: 10px; line-height: 1.45; }
.auth-steps strong { color: var(--auth-text); }
body[data-login-portal="mfa"] .auth-card { overflow-y: auto; }
body[data-login-portal="mfa"] #paso-2 { gap: 10px; }

@media (max-width: 820px) and (max-height: 740px) {
    body[data-login-portal="mfa"] .auth-main { align-items: stretch; overflow-y: auto; }
    body[data-login-portal="mfa"] .auth-card { max-height: none; }
}

/* css/input-preferences.css */
/* Important declarations in this layer take precedence over legacy module
   declarations without an ID-specific override for every modal and field. */
@layer speas-input-accessibility {
    @media (max-width: 1024px), (pointer: coarse) {
        input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
        textarea, select, [contenteditable="true"] {
            font-size: max(16px, 1rem) !important;
        }
    }
}

/* css/login-scene.css */
body.speas-auth-page.speas-cinematic {
    --auth-text:#edf5ff; --auth-muted:#b9cbe0; --auth-line:rgba(208,226,255,.24);
    --auth-surface:rgba(15,31,56,.76); --auth-surface-soft:rgba(18,37,64,.85);
    --auth-accent:#8ed9ff; --auth-accent-strong:#b5e9ff;
    min-height:100dvh; height:auto; overflow:auto; background:#0a2138; color:#edf5ff;
}
body.speas-auth-page.speas-cinematic::before { content:""; position:fixed; inset:0; background:linear-gradient(90deg,rgba(4,18,36,.12),rgba(4,18,36,.28)),url('/assets/speas-landscape-20261008.webp') center/cover no-repeat; pointer-events:none; }
body.speas-auth-page.speas-cinematic .auth-window { position:relative; width:100%; max-width:none; min-height:100dvh; height:auto; margin:0; padding:clamp(20px,4vw,72px); border:0; border-radius:0; background:transparent; box-shadow:none; overflow:visible; }
body.speas-auth-page.speas-cinematic .auth-workspace { width:min(1480px,100%); margin:auto; min-height:calc(100dvh - 100px); height:auto; display:grid; grid-template-columns:minmax(0,1.3fr) minmax(340px,.8fr); gap:clamp(24px,5vw,100px); background:transparent; border:0; overflow:visible; }
body.speas-auth-page.speas-cinematic .auth-sidebar { display:flex; flex-direction:column; justify-content:space-between; min-height:620px; padding:0; background:transparent; border:0; border-radius:0; box-shadow:none; backdrop-filter:none; -webkit-backdrop-filter:none; overflow:visible; }
body.speas-auth-page.speas-cinematic .auth-sidebar::before,body.speas-auth-page.speas-cinematic .auth-sidebar::after { display:none; }
body.speas-auth-page.speas-cinematic .auth-brand-copy strong,body.speas-auth-page.speas-cinematic .auth-brand-copy span { color:#fff; }
body.speas-auth-page.speas-cinematic .auth-brand-mark { background:rgba(255,255,255,.9); }
body.speas-auth-page.speas-cinematic .scene-copy { padding:50px 0; text-shadow:0 3px 24px rgba(0,15,30,.5); }
body.speas-auth-page.speas-cinematic .scene-kicker { font-size:11px; font-weight:800; letter-spacing:.22em; color:#e6f2ff; }
body.speas-auth-page.speas-cinematic .scene-word { display:block; margin:12px 0; font-size:clamp(78px,10.6vw,170px); line-height:1.05; letter-spacing:-.055em; font-weight:900; color:#f8e5d2; text-shadow:0 2px 0 #b9b8dc,0 5px 0 #6886ac,0 12px 30px rgba(9,28,53,.55); animation:speas-scene-float 4s ease-in-out 1; }
body.speas-auth-page.speas-cinematic .scene-copy h1 { max-width:580px; margin:26px 0 12px; font-size:clamp(26px,3.1vw,48px); line-height:1.12; color:#fff; }
body.speas-auth-page.speas-cinematic .scene-copy p { max-width:450px; color:#e5edf8; line-height:1.7; font-size:15px; }
body.speas-auth-page.speas-cinematic .scene-footer { display:flex; justify-content:space-between; flex-wrap:wrap; gap:12px; color:#d9e7f7; font-size:12px; }
body.speas-auth-page.speas-cinematic .auth-main { display:flex; align-items:center; padding:0; background:transparent; }
body.speas-auth-page.speas-cinematic .auth-card { width:100%; max-width:480px; padding:clamp(24px,3vw,44px); border:1px solid rgba(220,235,255,.35); border-radius:28px; background:linear-gradient(145deg,rgba(38,58,85,.83),rgba(12,29,52,.89)); box-shadow:0 32px 80px rgba(3,14,31,.4),inset 0 1px 0 rgba(255,255,255,.2); backdrop-filter:blur(18px); -webkit-backdrop-filter:blur(18px); }
body.speas-auth-page.speas-cinematic .auth-card h2 { color:#f5f9ff; font-size:clamp(25px,2.4vw,34px); }
body.speas-auth-page.speas-cinematic .auth-card label { color:#e3edfa; }
body.speas-auth-page.speas-cinematic .auth-eyebrow { background:rgba(103,183,246,.14); color:#b9e7ff; border-color:rgba(144,208,255,.4); }
body.speas-auth-page.speas-cinematic .auth-input input,body.speas-auth-page.speas-cinematic #mfa_code { color:#f5f9ff; background:rgba(9,25,46,.65); border-color:rgba(184,210,242,.35); font-size:16px; }
body.speas-auth-page.speas-cinematic input::placeholder { color:#a4b7ce; }
body.speas-auth-page.speas-cinematic .auth-input i,body.speas-auth-page.speas-cinematic .auth-input-action { color:#c8dcef; }
body.speas-auth-page.speas-cinematic .auth-primary { background:linear-gradient(110deg,#2377e8,#6650d8); color:#fff; border:1px solid rgba(170,195,255,.4); box-shadow:0 8px 24px rgba(20,66,160,.35); }
body.speas-auth-page.speas-cinematic .auth-link,body.speas-auth-page.speas-cinematic .auth-footer a { color:#c2e9ff; }
body.speas-auth-page.speas-cinematic .auth-security-note,body.speas-auth-page.speas-cinematic .auth-footer { color:#b9cbe0; border-color:rgba(208,226,255,.2); }
@keyframes speas-scene-float {0%,100%{transform:translateY(0) rotate(-1deg)}50%{transform:translateY(-10px) rotate(0deg)}}
@media(max-width:900px){body.speas-auth-page.speas-cinematic .auth-workspace{grid-template-columns:minmax(0,1fr);gap:24px;max-width:520px;min-height:0}body.speas-auth-page.speas-cinematic .auth-sidebar{min-height:0;gap:16px}body.speas-auth-page.speas-cinematic .scene-copy{padding:12px 0}body.speas-auth-page.speas-cinematic .scene-word{font-size:clamp(76px,18vw,112px);margin:8px 0}body.speas-auth-page.speas-cinematic .scene-copy h1{font-size:26px;margin:10px 0}body.speas-auth-page.speas-cinematic .scene-copy p{display:none}body.speas-auth-page.speas-cinematic .scene-footer{align-items:center}body.speas-auth-page.speas-cinematic .auth-card{max-width:none}body.speas-auth-page.speas-cinematic .auth-brand-copy span{display:none}body.speas-auth-page.speas-cinematic::before{background-position:38% center}body.speas-auth-page.speas-cinematic .auth-window{padding:24px 20px 40px}}
@media(prefers-reduced-motion:reduce){body.speas-auth-page.speas-cinematic .scene-word{animation:none}}

/* Silver identity: finite staggered 3D assembly, then a quiet static brand. */
body.speas-auth-page.speas-cinematic .scene-word { display:flex; gap:.065em; perspective:1000px; width:max-content; max-width:100%; font-size:clamp(72px,9.5vw,148px); letter-spacing:0; animation:none; text-shadow:none; line-height:1.2; }
body.speas-auth-page.speas-cinematic .scene-word span { display:block; color:#e3e9f0; background:linear-gradient(125deg,#fff 5%,#d4dce6 28%,#8e9fb4 43%,#f7fbff 53%,#bac8d9 76%,#edf3fa); background-size:220% 100%; background-clip:text; -webkit-background-clip:text; -webkit-text-fill-color:transparent; filter:drop-shadow(0 3px 0 #52667e) drop-shadow(0 12px 18px rgba(0,15,35,.45)); transform-origin:50% 85%; animation:speas-letter-assemble 1.7s cubic-bezier(.16,1,.3,1) both,speas-silver-light 2.2s ease-in-out both; animation-delay:calc(var(--letter)*.13s),1.8s; }
body.speas-auth-page.speas-cinematic .scene-company { display:block; color:#e6edf5; font-size:clamp(14px,1.5vw,22px); font-weight:700; letter-spacing:.3em; margin:12px 0 32px; text-shadow:0 2px 12px #10243c; animation:speas-company-reveal 1s ease-out 1s both; }
body.speas-auth-page.speas-cinematic .auth-input input { background:#edf3fa!important; color:#142a43!important; -webkit-text-fill-color:#142a43; border-color:#c2d0e1; padding-left:46px; }
body.speas-auth-page.speas-cinematic .auth-input input::placeholder { color:#52677f; -webkit-text-fill-color:#52677f; }
body.speas-auth-page.speas-cinematic .auth-input input:autofill { box-shadow:0 0 0 100px #edf3fa inset!important; -webkit-text-fill-color:#142a43!important; }
body.speas-auth-page.speas-cinematic .auth-input input:-webkit-autofill { -webkit-box-shadow:0 0 0 100px #edf3fa inset!important; -webkit-text-fill-color:#142a43!important; }
body.speas-auth-page.speas-cinematic .auth-input > i { color:#284c70!important; font-size:22px; z-index:2; pointer-events:none; }
body.speas-auth-page.speas-cinematic .auth-input-action { color:#284c70!important; width:44px; height:44px; }
body.speas-auth-page.speas-cinematic .auth-input-action i { color:inherit!important; font-size:22px; }
body.speas-auth-page.speas-cinematic .auth-input-action:focus-visible { outline:2px solid #1764a8; outline-offset:-4px; border-radius:8px; }
body.speas-auth-page.speas-cinematic .auth-security-note > i { color:#99d8ef; font-size:20px; }
@keyframes speas-letter-assemble { 0% { opacity:0; transform:translate3d(0,38px,-160px) rotateX(65deg) rotateY(-22deg); } 65% { opacity:1; transform:translate3d(0,-4px,0) rotateX(-5deg) rotateY(2deg); } 100% { opacity:1; transform:none; } }
@keyframes speas-silver-light { from { background-position:100% 50%; } to { background-position:0% 50%; } }
@keyframes speas-company-reveal { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
@media(max-width:900px) { body.speas-auth-page.speas-cinematic .scene-word { font-size:clamp(66px,15.5vw,100px); gap:.065em; } body.speas-auth-page.speas-cinematic .scene-company { margin:8px 0 20px; letter-spacing:.24em; } }
@media(prefers-reduced-motion:reduce) { body.speas-auth-page.speas-cinematic .scene-word span,body.speas-auth-page.speas-cinematic .scene-company { animation:none; opacity:1; transform:none; } }

/* css/login-brand.css */
/* Brand layer: existing authentication, fields and MFA remain untouched. */
body.speas-auth-page[data-business]{--brand-accent:#7d64d0;--brand-glow:rgba(88,59,142,.28)}
body.speas-auth-page[data-business=infinity]{--brand-accent:#e72f21;--brand-glow:rgba(230,42,27,.2)}
body.speas-auth-page[data-business=supernova] .scene-copy h1,body.speas-auth-page[data-business=supernova] .scene-company,body.speas-auth-page[data-business=supernova] .scene-copy p{font-family:Montserrat,Arial,sans-serif}
body.speas-auth-page[data-business] .scene-business{display:flex;align-items:center;gap:26px;margin:16px 0 24px;min-height:110px}
body.speas-auth-page[data-business] .scene-business svg{display:block;width:180px;height:110px;flex-shrink:0;overflow:hidden}
body.speas-auth-page[data-business] .scene-business img{display:block;width:112px;height:112px;object-fit:contain;flex-shrink:0}
body.speas-auth-page[data-business] .scene-business .scene-company{font-size:13px;line-height:1.7;letter-spacing:.18em;margin:0;padding-left:24px;border-left:1px solid #ffffff38;animation:none}
body.speas-auth-page[data-business] .scene-business small{display:block;font-size:10px;letter-spacing:.15em;color:#c3c6d4;font-weight:500;margin-top:5px}
body.speas-auth-page[data-business=supernova] .auth-primary{background:linear-gradient(115deg,#47388b,#583b8e)!important;border-color:#9d8cca!important}
body.speas-auth-page[data-business=infinity]::before{background-image:linear-gradient(90deg,rgba(13,12,18,.5),rgba(9,10,15,.86)),url('/assets/speas-landscape-20261008.webp');filter:saturate(.45)}
body.speas-auth-page[data-business=infinity] .auth-card{background:linear-gradient(135deg,rgba(37,34,40,.93),rgba(14,16,22,.94));border-color:#ffffff30;box-shadow:0 32px 80px #0006,inset 0 1px 0 #fff2}
body.speas-auth-page[data-business=infinity] .auth-primary{background:linear-gradient(115deg,#b9231e,#e23525)!important;border-color:#ff756866!important;box-shadow:0 8px 28px #b9231e30}
body.speas-auth-page[data-business=infinity] .auth-eyebrow{background:#e62c1f15;color:#ffc5bc;border-color:#e62c1f50}
body.speas-auth-page[data-business] .scene-copy{position:relative}
body.speas-auth-page[data-business] .scene-copy:after{content:'';position:absolute;z-index:-1;width:90%;height:70%;top:10%;left:-12%;background:radial-gradient(ellipse,var(--brand-glow),transparent 70%);pointer-events:none;animation:brand-arrival 3.6s ease-out both}
@keyframes brand-arrival{from{opacity:0;transform:translateY(25px) scale(.85)}to{opacity:1;transform:none}}
@media(max-width:900px){body.speas-auth-page[data-business] .scene-business{margin:8px 0 12px;gap:20px;min-height:90px}body.speas-auth-page[data-business] .scene-business svg{width:150px;height:92px}body.speas-auth-page[data-business] .scene-business img{width:88px;height:88px}body.speas-auth-page[data-business] .scene-business .scene-company{padding-left:16px;font-size:11px;letter-spacing:.1em}body.speas-auth-page[data-business] .scene-copy h1{font-size:24px}}
@media(max-width:360px){body.speas-auth-page[data-business] .scene-business{gap:12px}body.speas-auth-page[data-business] .scene-business svg{width:130px;height:82px}body.speas-auth-page[data-business] .scene-business .scene-company{font-size:10px;padding-left:12px}}
@media(prefers-reduced-motion:reduce){body.speas-auth-page[data-business] .scene-copy:after{animation:none}}

/* css/login-viewport.css */
/* Full viewport coverage, including changing mobile browser chrome.
   Content may grow vertically so short screens and the keyboard never clip forms. */
html{min-height:100%;}
body.speas-auth-page[data-business]{min-height:100vh;min-height:100dvh;height:auto;margin:0;overflow-y:auto;}
body.speas-auth-page[data-business] .auth-window{box-sizing:border-box;min-height:100vh;min-height:100dvh;height:auto;}
body.speas-auth-page[data-business]::before{position:fixed;inset:0;width:100%;height:100%;background-size:cover;background-repeat:no-repeat;}

/* Use the available CSS viewport, including OS display scaling. Do not zoom the
   page or lock its height: browser zoom, error messages and keyboards must reflow. */
@media (min-width:901px) {
 body.speas-auth-page.speas-cinematic[data-business] { --auth-viewport-pad:clamp(16px,4dvh,64px); }
 body.speas-auth-page.speas-cinematic[data-business] .auth-window { padding:var(--auth-viewport-pad) clamp(24px,4vw,72px); }
 body.speas-auth-page.speas-cinematic[data-business] .auth-workspace { min-height:calc(100dvh - 2 * var(--auth-viewport-pad)); align-items:stretch; }
 body.speas-auth-page.speas-cinematic[data-business] .auth-sidebar { min-height:0; gap:clamp(12px,2dvh,24px); }
 body.speas-auth-page.speas-cinematic[data-business] .scene-copy { padding:clamp(8px,2dvh,30px) 0; }
 body.speas-auth-page.speas-cinematic[data-business] .scene-word { font-size:clamp(64px,min(9.5vw,15dvh),148px); }
 body.speas-auth-page.speas-cinematic[data-business] .scene-business { min-height:0; margin:12px 0 16px; }
 body.speas-auth-page.speas-cinematic[data-business] .scene-business svg { height:clamp(64px,11dvh,110px); width:clamp(105px,18dvh,180px); }
 body.speas-auth-page.speas-cinematic[data-business] .scene-business img { width:clamp(64px,11dvh,112px); height:clamp(64px,11dvh,112px); }
 body.speas-auth-page.speas-cinematic[data-business] .scene-copy h1 { font-size:clamp(26px,min(3.1vw,5dvh),48px); margin:clamp(12px,2dvh,26px) 0 12px; }
 body.speas-auth-page.speas-cinematic[data-business] .auth-card { padding:clamp(24px,4dvh,44px); }
}

/* css/speas-design-system.css */
:root,
html[data-speas-theme="verde"] {
    --speas-bg: #f5faf8;
    --speas-surface: #ffffff;
    --speas-surface-2: #eff8f4;
    --speas-elevated: #ffffff;
    --speas-sidebar: #f2f9f6;
    --speas-sidebar-2: #edf7f2;
    --speas-text: #18221f;
    --speas-muted: #63736d;
    --speas-border: #dce9e4;
    --speas-border-strong: #bfd5cc;
    --speas-accent: #12805c;
    --speas-accent-2: #27a979;
    --speas-accent-soft: #e7f7f0;
    --speas-accent-rgb: 18, 128, 92;
    --speas-table-head: #edf7f3;
    --speas-row-hover: #f4fbf8;
    --speas-focus-ring: 0 0 0 4px rgba(18, 128, 92, 0.15);
    --speas-browser-chrome: #f5faf8;
    --primary-color: var(--speas-accent);
    --primary-dark: #0b6346;
    --dark-color: var(--speas-text);
    --text-color-main: var(--speas-text);
    --text-color-secondary: var(--speas-muted);
    --border-color: var(--speas-border);
    --card-bg: var(--speas-surface);
    --body-bg: var(--speas-bg);
}

html[data-speas-theme="azul"] {
    --speas-bg: #f5f8fd;
    --speas-surface: #ffffff;
    --speas-surface-2: #eef4fd;
    --speas-elevated: #ffffff;
    --speas-sidebar: #f2f6fd;
    --speas-sidebar-2: #edf3fc;
    --speas-text: #182235;
    --speas-muted: #65728a;
    --speas-border: #dce5f2;
    --speas-border-strong: #bfcee2;
    --speas-accent: #2764d8;
    --speas-accent-2: #4d82e6;
    --speas-accent-soft: #eaf1ff;
    --speas-accent-rgb: 39, 100, 216;
    --speas-table-head: #edf3fc;
    --speas-row-hover: #f5f8fe;
    --speas-focus-ring: 0 0 0 4px rgba(39, 100, 216, 0.15);
    --speas-browser-chrome: #f5f8fd;
    --primary-color: var(--speas-accent);
    --primary-dark: #1d4ead;
    --dark-color: var(--speas-text);
    --text-color-main: var(--speas-text);
    --text-color-secondary: var(--speas-muted);
    --border-color: var(--speas-border);
    --card-bg: var(--speas-surface);
    --body-bg: var(--speas-bg);
}

html[data-speas-theme="rosa"] {
    --speas-bg: #fff9fb;
    --speas-surface: #ffffff;
    --speas-surface-2: #fff3f7;
    --speas-elevated: #ffffff;
    --speas-sidebar: #fff4f8;
    --speas-sidebar-2: #ffeff5;
    --speas-text: #39232f;
    --speas-muted: #7e6874;
    --speas-border: #eedde5;
    --speas-border-strong: #dbbdca;
    --speas-accent: #be507f;
    --speas-accent-2: #d97ca5;
    --speas-accent-soft: #fff0f5;
    --speas-accent-rgb: 190, 80, 127;
    --speas-table-head: #fff3f7;
    --speas-row-hover: #fff9fb;
    --speas-focus-ring: 0 0 0 4px rgba(190, 80, 127, 0.14);
    --speas-browser-chrome: #fff9fb;
    --primary-color: var(--speas-accent);
    --primary-dark: #98345f;
    --dark-color: var(--speas-text);
    --text-color-main: var(--speas-text);
    --text-color-secondary: var(--speas-muted);
    --border-color: var(--speas-border);
    --card-bg: var(--speas-surface);
    --body-bg: var(--speas-bg);
}

html[data-speas-theme="grafito"] {
    --speas-bg: #f9fafb;
    --speas-surface: #ffffff;
    --speas-surface-2: #f3f5f7;
    --speas-elevated: #ffffff;
    --speas-sidebar: #f5f6f8;
    --speas-sidebar-2: #eff1f4;
    --speas-text: #20242b;
    --speas-muted: #68707c;
    --speas-border: #dfe3e8;
    --speas-border-strong: #c6ccd4;
    --speas-accent: #68717e;
    --speas-accent-2: #8c95a1;
    --speas-accent-soft: #f0f2f5;
    --speas-accent-rgb: 104, 113, 126;
    --speas-table-head: #f3f5f7;
    --speas-row-hover: #fafbfc;
    --speas-focus-ring: 0 0 0 4px rgba(104, 113, 126, 0.14);
    --speas-browser-chrome: #f9fafb;
    --primary-color: var(--speas-accent);
    --primary-dark: #3e4651;
    --dark-color: var(--speas-text);
    --text-color-main: var(--speas-text);
    --text-color-secondary: var(--speas-muted);
    --border-color: var(--speas-border);
    --card-bg: var(--speas-surface);
    --body-bg: var(--speas-bg);
}

html:root:root[data-speas-theme="verde"] {
    --speas-bg: #f5faf8 !important;
    --speas-surface: #ffffff !important;
    --speas-surface-2: #eff8f4 !important;
    --speas-elevated: #ffffff !important;
    --speas-sidebar: #f2f9f6 !important;
    --speas-sidebar-2: #edf7f2 !important;
    --speas-text: #18221f !important;
    --speas-muted: #63736d !important;
    --speas-border: #dce9e4 !important;
    --speas-border-strong: #bfd5cc !important;
    --speas-accent: #12805c !important;
    --speas-accent-2: #27a979 !important;
    --speas-accent-soft: #e7f7f0 !important;
    --speas-accent-rgb: 18, 128, 92 !important;
    --speas-table-head: #edf7f3 !important;
    --speas-row-hover: #f4fbf8 !important;
    --speas-browser-chrome: #f5faf8 !important;
    --primary-color: #12805c !important;
}

html:root:root[data-speas-theme="azul"] {
    --speas-bg: #f5f8fd !important;
    --speas-surface: #ffffff !important;
    --speas-surface-2: #eef4fd !important;
    --speas-elevated: #ffffff !important;
    --speas-sidebar: #f2f6fd !important;
    --speas-sidebar-2: #edf3fc !important;
    --speas-text: #182235 !important;
    --speas-muted: #65728a !important;
    --speas-border: #dce5f2 !important;
    --speas-border-strong: #bfcee2 !important;
    --speas-accent: #2764d8 !important;
    --speas-accent-2: #4d82e6 !important;
    --speas-accent-soft: #eaf1ff !important;
    --speas-accent-rgb: 39, 100, 216 !important;
    --speas-table-head: #edf3fc !important;
    --speas-row-hover: #f5f8fe !important;
    --speas-browser-chrome: #f5f8fd !important;
    --primary-color: #2764d8 !important;
}

html:root:root[data-speas-theme="rosa"] {
    --speas-bg: #fff9fb !important;
    --speas-surface: #ffffff !important;
    --speas-surface-2: #fff3f7 !important;
    --speas-elevated: #ffffff !important;
    --speas-sidebar: #fff4f8 !important;
    --speas-sidebar-2: #ffeff5 !important;
    --speas-text: #39232f !important;
    --speas-muted: #7e6874 !important;
    --speas-border: #eedde5 !important;
    --speas-border-strong: #dbbdca !important;
    --speas-accent: #be507f !important;
    --speas-accent-2: #d97ca5 !important;
    --speas-accent-soft: #fff0f5 !important;
    --speas-accent-rgb: 190, 80, 127 !important;
    --speas-table-head: #fff3f7 !important;
    --speas-row-hover: #fff9fb !important;
    --speas-browser-chrome: #fff9fb !important;
    --primary-color: #be507f !important;
}

html:root:root[data-speas-theme="grafito"] {
    --speas-bg: #f9fafb !important;
    --speas-surface: #ffffff !important;
    --speas-surface-2: #f3f5f7 !important;
    --speas-elevated: #ffffff !important;
    --speas-sidebar: #f5f6f8 !important;
    --speas-sidebar-2: #eff1f4 !important;
    --speas-text: #20242b !important;
    --speas-muted: #68707c !important;
    --speas-border: #dfe3e8 !important;
    --speas-border-strong: #c6ccd4 !important;
    --speas-accent: #68717e !important;
    --speas-accent-2: #8c95a1 !important;
    --speas-accent-soft: #f0f2f5 !important;
    --speas-accent-rgb: 104, 113, 126 !important;
    --speas-table-head: #f3f5f7 !important;
    --speas-row-hover: #fafbfc !important;
    --speas-browser-chrome: #f9fafb !important;
    --primary-color: #68717e !important;
}

html:root:root[data-speas-theme="verde"] body.speas-auth-page {
    --auth-accent: #12805c !important;
    --auth-accent-strong: #0b6346 !important;
    --auth-hero-start: #07392c !important;
    --auth-hero-end: #117657 !important;
    --auth-hero-glow: #55d5a8 !important;
}

html:root:root[data-speas-theme="azul"] body.speas-auth-page {
    --auth-accent: #2764d8 !important;
    --auth-accent-strong: #1d4ead !important;
    --auth-hero-start: #102a5a !important;
    --auth-hero-end: #245fc0 !important;
    --auth-hero-glow: #77a8ff !important;
}

html:root:root[data-speas-theme="rosa"] body.speas-auth-page {
    --auth-accent: #be467b !important;
    --auth-accent-strong: #98345f !important;
    --auth-hero-start: #51213a !important;
    --auth-hero-end: #a43a6b !important;
    --auth-hero-glow: #ff9bc6 !important;
}

html:root:root[data-speas-theme="grafito"] body.speas-auth-page {
    --auth-accent: #525b68 !important;
    --auth-accent-strong: #3e4651 !important;
    --auth-hero-start: #262b32 !important;
    --auth-hero-end: #505966 !important;
    --auth-hero-glow: #aeb7c3 !important;
}

/* Los accesos públicos conservan una identidad fija por portal. Los temas solo
   se seleccionan dentro de la aplicación autenticada. */
html:root:root body.speas-auth-page[data-login-portal="erp"] {
    --auth-accent: #147f76 !important;
    --auth-accent-strong: #0d645e !important;
    --auth-hero-start: #073b3b !important;
    --auth-hero-end: #0d746c !important;
    --auth-hero-glow: #62d7c3 !important;
}

html:root:root body.speas-auth-page[data-login-portal="contable"],
html:root:root body.speas-auth-page[data-login-portal="mfa"] {
    --auth-accent: #5b5acb !important;
    --auth-accent-strong: #4544a8 !important;
    --auth-hero-start: #1c204f !important;
    --auth-hero-end: #514eb0 !important;
    --auth-hero-glow: #a2a2ff !important;
}

html:root:root body.speas-auth-page[data-login-portal="proveedores"] {
    --auth-accent: #2e6ccf !important;
    --auth-accent-strong: #2354a5 !important;
    --auth-hero-start: #0b315e !important;
    --auth-hero-end: #2368b7 !important;
    --auth-hero-glow: #79b5ff !important;
}

html {
    color-scheme: light;
    background: var(--speas-bg);
}

body.speas-app {
    background: var(--speas-bg) !important;
    color: var(--speas-text) !important;
}

body.speas-app:not(.portal-proveedores) {
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

body.speas-app :is(.sidebar, nav.sidebar),
body.portal-proveedores.speas-app .sidebar {
    background: var(--speas-sidebar) !important;
    border-color: var(--speas-border) !important;
    color: var(--speas-text) !important;
}

/* La hoja heredada declara el fondo del menu con un selector muy especifico y
   !important. Esta regla conserva el tinte pastel de cada paleta sin volver a
   introducir variantes oscuras. */
html:root:root[data-speas-theme] body.speas-app.speas-app :is(.sidebar.sidebar, nav.sidebar.sidebar),
html:root:root[data-speas-theme] body.portal-proveedores.speas-app.speas-app .sidebar.sidebar {
    background: var(--speas-sidebar) !important;
    background-color: var(--speas-sidebar) !important;
    border-color: var(--speas-border) !important;
    color: var(--speas-text) !important;
}

html:root:root[data-speas-theme] body.speas-app.speas-app .sidebar.sidebar :is(.menu-bar, header, .sidebar-header, .bottom-content, .profile-card, .logout-box) {
    background: var(--speas-sidebar-2) !important;
    background-color: var(--speas-sidebar-2) !important;
    color: var(--speas-text) !important;
}

body.speas-app .sidebar :is(.menu-bar, header, .sidebar-header, .bottom-content, .profile-card, .logout-box) {
    background: var(--speas-sidebar-2) !important;
    color: var(--speas-text) !important;
}

body.speas-app .sidebar :is(a, .nav-link, .nav-text, .text, .name, .profession, .proveedor-info) {
    color: var(--speas-muted) !important;
}

body.speas-app .sidebar :is(li.active a, a.active, a:hover, .nav-links li.active, .nav-links li:hover) {
    background: var(--speas-accent-soft) !important;
    color: var(--speas-accent) !important;
}

body.speas-app .sidebar :is(li.active a, a.active, a:hover, .nav-links li.active, .nav-links li:hover) :is(i, span) {
    color: var(--speas-accent) !important;
}

body.speas-app :is(.home, .main-content) {
    background: var(--speas-bg) !important;
    color: var(--speas-text) !important;
}

body.speas-app .home {
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

body.speas-app :is(.header-text, .topbar) {
    flex: 0 0 auto !important;
    background: rgba(255, 255, 255, 0.94) !important;
    border-color: var(--speas-border) !important;
    color: var(--speas-text) !important;
    backdrop-filter: blur(18px) saturate(130%);
}

body.speas-app :is(#contenedor-dinamico, .content-wrapper) {
    min-width: 0 !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y pinch-zoom;
    scrollbar-gutter: stable;
}

/* Durante una navegacion asincrona se conserva el DOM anterior solo para poder
   recuperarlo si falla la descarga. La especificidad reforzada evita que un
   CSS heredado reactive visibility mientras se intercambian las hojas. */
html:root:root body.speas-app.speas-module-loading #contenedor-dinamico#contenedor-dinamico > *,
html:root:root body.portal-proveedores.speas-module-loading .content-wrapper.content-wrapper > * {
    visibility: hidden !important;
}

html:root:root body.speas-app.speas-module-loading #contenedor-dinamico#contenedor-dinamico {
    opacity: 0 !important;
    transition: none !important;
}

/* La paleta calculada se congela inline desde dashboard.js mientras dura la
   navegación. Aquí se cancela cualquier transición heredada para que esa
   declaración se aplique de forma atómica. */
html:root:root[data-speas-theme] body.speas-app.speas-module-loading,
html:root:root[data-speas-theme] body.speas-app.speas-module-loading .home {
    transition: none !important;
}

body.portal-proveedores.speas-app .main-content {
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

body.portal-proveedores.speas-app .content-wrapper {
    flex: 1 1 auto !important;
}

body.speas-app :is(.card, .panel, .module-header, .page-header, .header-section, .kpi-card, .summary-card, .filters-card) {
    background: var(--speas-surface) !important;
    border-color: var(--speas-border) !important;
    color: var(--speas-text) !important;
    box-shadow: 0 12px 34px rgba(20, 35, 55, 0.055) !important;
}

body.speas-app :is(input, select, textarea, .form-control, .form-select) {
    background: #ffffff !important;
    border-color: var(--speas-border) !important;
    color: var(--speas-text) !important;
}

body.speas-app :is(input, select, textarea, .form-control, .form-select):focus {
    border-color: var(--speas-accent) !important;
    box-shadow: var(--speas-focus-ring) !important;
    outline: none !important;
}

body.speas-app :is(.btn-primary, .primary-btn, .finance-primary-btn, .btn-save, .btn-guardar) {
    background: var(--speas-accent) !important;
    border-color: var(--speas-accent) !important;
    color: #ffffff !important;
}

body.speas-app :is(button, .btn, [role="button"], a) {
    transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease,
        box-shadow 180ms ease, transform 180ms ease !important;
}

body.speas-app :is(button, .btn, [role="button"]):not(:disabled):active {
    transform: translateY(1px) scale(0.99);
}

.speas-theme-switch {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    flex: 0 0 auto !important;
    padding: 4px !important;
    overflow: visible !important;
    background: #ffffff !important;
    border: 1px solid var(--speas-border) !important;
    border-radius: 14px !important;
    box-shadow: 0 7px 22px rgba(20, 35, 55, 0.08) !important;
}

.speas-theme-switch .speas-theme-cycle {
    width: auto !important;
    min-width: 104px !important;
    height: 40px !important;
    padding: 0 14px !important;
    flex: 0 0 auto !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    border: 0 !important;
    border-radius: 11px !important;
    background: var(--speas-accent-soft) !important;
    color: var(--speas-accent) !important;
    cursor: pointer;
    white-space: nowrap !important;
}

.speas-theme-cycle i {
    font-size: 19px !important;
    flex: 0 0 auto !important;
}

.speas-theme-name {
    font-size: 12px;
    font-weight: 700;
    line-height: 1 !important;
}

.speas-theme-dot {
    flex: 0 0 auto !important;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--speas-accent);
    box-shadow: 0 0 0 3px rgba(var(--speas-accent-rgb), 0.13);
}

body.speas-app .speas-top-search + .speas-shell-actions {
    margin-left: 14px !important;
    margin-right: 2px !important;
    flex: 0 0 auto !important;
}

body.speas-app :is(.speas-table-scroll, .table-responsive, .table-container, .table-wrapper, .table-scroll, .finance-table-wrap, .responsive-table) {
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y pinch-zoom;
    scrollbar-width: thin;
    scrollbar-color: var(--speas-border-strong) transparent;
}

body.speas-app table {
    width: 100% !important;
    background: #ffffff !important;
    color: var(--speas-text) !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

body.speas-app table thead,
body.speas-app table thead tr {
    background: var(--speas-table-head) !important;
}

body.speas-app table th {
    color: var(--speas-text) !important;
    border-color: var(--speas-border) !important;
}

body.speas-app table td {
    color: var(--speas-text) !important;
    background: #ffffff !important;
    border-color: var(--speas-border) !important;
}

body.speas-app table tbody tr:hover td {
    background: var(--speas-row-hover) !important;
}

body.speas-app :is(.modal-overlay, .finance-modal, .rend-modal, .g-modal, .auth-modal, .c-modal, .dispatch-dialog-layer, .pos-dialog-layer) {
    box-sizing: border-box !important;
    padding: clamp(12px, 3vw, 32px) !important;
    overflow: hidden !important;
    overscroll-behavior: contain;
    background: rgba(24, 34, 53, 0.42) !important;
    backdrop-filter: blur(10px) saturate(115%) !important;
}

body.speas-app :is(.modal-content, .finance-modal-card, .rend-modal-box, .g-modal > div, .auth-modal > div, .c-modal > div),
body.speas-app [id^="modal-"][style*="position: fixed"] > div {
    box-sizing: border-box !important;
    width: min(100%, 760px) !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100dvh - clamp(24px, 6vw, 64px)) !important;
    margin: auto !important;
    background: #ffffff !important;
    color: var(--speas-text) !important;
    border: 1px solid var(--speas-border) !important;
    border-radius: 22px !important;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.2) !important;
    overflow: auto !important;
}

body.speas-app :is(.modal-content, .finance-modal-card, .rend-modal-box):has(> :is(.modal-body, form.modal-body, .finance-modal-body, .rend-modal-body)) {
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

body.speas-app :is(.modal-header, .modal-footer, .finance-modal-header, .finance-modal-actions, .rend-modal-head, .rend-modal-foot) {
    flex: 0 0 auto !important;
    background: #ffffff !important;
    color: var(--speas-text) !important;
    border-color: var(--speas-border) !important;
}

body.speas-app :is(.modal-body, form.modal-body, .finance-modal-body, .rend-modal-body) {
    flex: 0 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

body.speas-app :is(.modal-header, .finance-modal-header, .rend-modal-head) :is(h1, h2, h3, h4, i, button) {
    color: var(--speas-text) !important;
}

body.speas-app :is(.modal-header, .finance-modal-header, .rend-modal-head) :is(.btn-close, .close-modal, [aria-label*="Cerrar"], [title*="Cerrar"]) {
    background: var(--speas-surface-2) !important;
    color: var(--speas-muted) !important;
    border: 1px solid var(--speas-border) !important;
    border-radius: 12px !important;
}

@keyframes speas-design-enter {
    from { opacity: 0; }
    to { opacity: 1; }
}

body.speas-app :is(#contenedor-dinamico, .content-wrapper) > * {
    animation: speas-design-enter 260ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

@media (max-width: 1024px) {
    html:root:root,
    html:root:root body.speas-app.speas-app,
    html:root:root body.speas-app.speas-app .home,
    html:root:root body.speas-app.speas-app #contenedor-dinamico#contenedor-dinamico,
    html:root:root body.speas-app.speas-app .content-wrapper.content-wrapper {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    html:root:root body.speas-app.speas-app #contenedor-dinamico#contenedor-dinamico > *,
    html:root:root body.speas-app.speas-app .content-wrapper.content-wrapper > * {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow-y: visible !important;
    }

    body.speas-app :is(#contenedor-dinamico, .content-wrapper) :is(.module-container, .module-content, .module-page, .module-shell, .dashboard-container, .finance-inbox-container, .consola-module-root) {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
    }

    html body.speas-app #contenedor-dinamico table,
    html body.speas-app .content-wrapper table {
        display: table !important;
        width: 100% !important;
    }

    html body.speas-app #contenedor-dinamico table thead,
    html body.speas-app .content-wrapper table thead {
        display: table-header-group !important;
    }

    html body.speas-app #contenedor-dinamico table tbody,
    html body.speas-app .content-wrapper table tbody {
        display: table-row-group !important;
    }

    html body.speas-app #contenedor-dinamico table tr,
    html body.speas-app .content-wrapper table tr {
        display: table-row !important;
    }

    html body.speas-app #contenedor-dinamico table :is(th, td),
    html body.speas-app .content-wrapper table :is(th, td) {
        display: table-cell !important;
        width: auto !important;
        max-width: none !important;
        position: static !important;
        text-align: left !important;
    }

    html body.speas-app #contenedor-dinamico table td::before,
    html body.speas-app .content-wrapper table td::before {
        content: none !important;
        display: none !important;
    }

    html body.speas-app :is(#contenedor-dinamico, .content-wrapper) table:has(tr > :nth-child(3)) {
        min-width: 580px !important;
    }

    html body.speas-app :is(#contenedor-dinamico, .content-wrapper) table:has(tr > :nth-child(4)) {
        min-width: 720px !important;
    }

    html body.speas-app :is(#contenedor-dinamico, .content-wrapper) table:has(tr > :nth-child(7)) {
        min-width: 980px !important;
    }

    html:root:root body.speas-app.speas-app #contenedor-dinamico#contenedor-dinamico .speas-table-scroll.speas-table-scroll,
    html:root:root body.speas-app.speas-app .content-wrapper.content-wrapper .speas-table-scroll.speas-table-scroll {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
    }

    html:root:root body.speas-app.speas-app #contenedor-dinamico#contenedor-dinamico .speas-table-scroll.speas-table-scroll table,
    html:root:root body.speas-app.speas-app .content-wrapper.content-wrapper .speas-table-scroll.speas-table-scroll table {
        display: table !important;
    }

    html:root:root body.speas-app.speas-app #contenedor-dinamico#contenedor-dinamico .speas-table-scroll.speas-table-scroll table thead,
    html:root:root body.speas-app.speas-app .content-wrapper.content-wrapper .speas-table-scroll.speas-table-scroll table thead {
        display: table-header-group !important;
    }

    html:root:root body.speas-app.speas-app #contenedor-dinamico#contenedor-dinamico .speas-table-scroll.speas-table-scroll table tbody,
    html:root:root body.speas-app.speas-app .content-wrapper.content-wrapper .speas-table-scroll.speas-table-scroll table tbody {
        display: table-row-group !important;
    }

    html:root:root body.speas-app.speas-app #contenedor-dinamico#contenedor-dinamico .speas-table-scroll.speas-table-scroll table tr,
    html:root:root body.speas-app.speas-app .content-wrapper.content-wrapper .speas-table-scroll.speas-table-scroll table tr {
        display: table-row !important;
    }

    html:root:root body.speas-app.speas-app #contenedor-dinamico#contenedor-dinamico .speas-table-scroll.speas-table-scroll table :is(th, td),
    html:root:root body.speas-app.speas-app .content-wrapper.content-wrapper .speas-table-scroll.speas-table-scroll table :is(th, td) {
        display: table-cell !important;
        width: auto !important;
        max-width: none !important;
        position: static !important;
    }
}

@media (max-width: 768px) {
    .speas-theme-name {
        display: none;
    }

    .speas-theme-switch .speas-theme-cycle {
        width: 42px !important;
        min-width: 42px !important;
        padding: 0 8px !important;
    }

    body.speas-app .speas-top-search + .speas-shell-actions {
        margin-left: auto !important;
        margin-right: 0 !important;
    }

    body.speas-app :is(#contenedor-dinamico, .content-wrapper) {
        scrollbar-gutter: auto;
    }

    body.speas-app :is(.modal-overlay, .finance-modal, .rend-modal, .g-modal, .auth-modal, .c-modal, .dispatch-dialog-layer, .pos-dialog-layer) {
        padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom)) !important;
        align-items: center !important;
    }

    body.speas-app :is(.modal-content, .finance-modal-card, .rend-modal-box, .g-modal > div, .auth-modal > div, .c-modal > div),
    body.speas-app [id^="modal-"][style*="position: fixed"] > div {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
        border-radius: 20px !important;
    }

    body.speas-app :is(.modal-header, .modal-footer, .finance-modal-header, .finance-modal-actions, .rend-modal-head, .rend-modal-foot) {
        min-height: 0 !important;
        padding: 15px 17px !important;
    }

    body.speas-app :is(.modal-body, form.modal-body, .finance-modal-body, .rend-modal-body) {
        padding: 17px !important;
    }
}

html:root:root body.speas-app.speas-app #contenedor-dinamico#contenedor-dinamico .modal-overlay > .modal-content,
html:root:root body.speas-app.speas-app .content-wrapper.content-wrapper .modal-overlay > .modal-content,
html:root:root body.speas-app.speas-app #contenedor-dinamico#contenedor-dinamico :is(.finance-modal-card, .rend-modal-box) {
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100dvh - 24px) !important;
    overflow: auto !important;
}

html:root:root body.speas-app.speas-app #contenedor-dinamico#contenedor-dinamico .modal-overlay > .modal-content:has(> .modal-body),
html:root:root body.speas-app.speas-app .content-wrapper.content-wrapper .modal-overlay > .modal-content:has(> .modal-body) {
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

@media (min-width: 1920px) {
    body.speas-app :is(#contenedor-dinamico, .content-wrapper) > * {
        width: min(100%, 1800px) !important;
        margin-inline: auto !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.speas-app *,
    body.speas-app *::before,
    body.speas-app *::after {
        scroll-behavior: auto !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
    }
}

/* Normalizacion transversal de los modulos ERP heredados. Inicio, Ventas y
   Finanzas se excluyen deliberadamente de este barrido. */
html:root:root[data-speas-theme] body.speas-app[data-speas-module]:not([data-speas-module="inicio"]):not([data-speas-module="ventas"]):not([data-speas-module="finanzas"]) {
    --module-accent: var(--speas-accent);
    --module-accent-soft: var(--speas-accent-soft);
    --primary: var(--speas-accent);
    --primary-color: var(--speas-accent);
    --accent-color: var(--speas-accent);
    --text-main: var(--speas-text);
    --text-muted: var(--speas-muted);
    --border-color: var(--speas-border);
    --card-bg: var(--speas-surface);
}

html:root:root[data-speas-theme] body.speas-app[data-speas-module]:not([data-speas-module="inicio"]):not([data-speas-module="ventas"]):not([data-speas-module="finanzas"]) #contenedor-dinamico :is(
    .icon-header,
    .section-icon,
    .module-icon,
    .card-icon,
    .stat-icon,
    .metric-icon,
    .kpi-icon,
    .empty-icon,
    .icon-box,
    .icon-circle,
    .codigos-icon,
    .saldo-icon,
    .dispatch-dialog-icon,
    .historial-email-icon
) {
    background: var(--speas-accent-soft) !important;
    border-color: color-mix(in srgb, var(--speas-accent) 24%, var(--speas-border)) !important;
    color: var(--speas-accent) !important;
}

html:root:root[data-speas-theme] body.speas-app[data-speas-module]:not([data-speas-module="inicio"]):not([data-speas-module="ventas"]):not([data-speas-module="finanzas"]) #contenedor-dinamico :is(
    .btn-primary,
    .primary-btn,
    .btn-prime.primary,
    .btn-save,
    .btn-guardar,
    .btn-filter,
    .btn-refresh,
    .tab-btn.active,
    .tab-button.active,
    [role="tab"][aria-selected="true"]
) {
    background: var(--speas-accent) !important;
    border-color: var(--speas-accent) !important;
    color: #ffffff !important;
    box-shadow: 0 10px 24px color-mix(in srgb, var(--speas-accent) 18%, transparent) !important;
}

html:root:root[data-speas-theme] body.speas-app[data-speas-module]:not([data-speas-module="inicio"]):not([data-speas-module="ventas"]):not([data-speas-module="finanzas"]) #contenedor-dinamico :is(
    .module-header,
    .header-section,
    .toolbar-container,
    .filters-bar,
    .content-card,
    .table-card,
    .chart-card,
    .module-card,
    .panel
) {
    background-color: var(--speas-surface) !important;
    border-color: var(--speas-border) !important;
    color: var(--speas-text) !important;
}

html:root:root[data-speas-theme] body.speas-app[data-speas-module]:not([data-speas-module="inicio"]):not([data-speas-module="ventas"]):not([data-speas-module="finanzas"]) #contenedor-dinamico :is(h1, h2, h3, h4, label, .title, .module-title) {
    color: var(--speas-text) !important;
}

html:root:root[data-speas-theme] body.speas-app[data-speas-module]:not([data-speas-module="inicio"]):not([data-speas-module="ventas"]):not([data-speas-module="finanzas"]) #contenedor-dinamico :is(.subtitle, .muted, small, .helper-text) {
    color: var(--speas-muted) !important;
}

/* Portales de dialogo: la regla vive fuera del contenedor porque muchos modulos
   mueven el modal a document.body. */
html:root:root[data-speas-theme] body.speas-app[data-speas-module]:not([data-speas-module="inicio"]):not([data-speas-module="ventas"]):not([data-speas-module="finanzas"]) :is(
    .modal-overlay,
    .modal-custom,
    .rend-modal,
    .dispatch-dialog-layer,
    .g-modal,
    .c-modal
) {
    position: fixed !important;
    inset: 0 !important;
    z-index: 10020 !important;
    width: 100vw !important;
    height: 100dvh !important;
    align-items: center !important;
    justify-content: center !important;
    place-items: center !important;
    padding: clamp(12px, 3vw, 30px) !important;
    overflow: hidden !important;
    background: rgba(24, 34, 53, 0.42) !important;
}

html:root:root[data-speas-theme] body.speas-app[data-speas-module]:not([data-speas-module="inicio"]):not([data-speas-module="ventas"]):not([data-speas-module="finanzas"]) :is(
    .modal-overlay.hidden,
    .modal-custom.hidden,
    .rend-modal[hidden],
    .dispatch-dialog-layer[hidden],
    .g-modal[hidden],
    .c-modal[hidden]
) {
    display: none !important;
}

html:root:root[data-speas-theme] body.speas-app[data-speas-module]:not([data-speas-module="inicio"]):not([data-speas-module="ventas"]):not([data-speas-module="finanzas"]) :is(
    .modal-content,
    .modal-panel,
    .rend-modal-box,
    .g-modal > div,
    .c-modal > div
) {
    position: relative !important;
    inset: auto !important;
    width: min(100%, 680px) !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100dvh - clamp(24px, 6vw, 60px)) !important;
    margin: auto !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    background: var(--speas-surface) !important;
    color: var(--speas-text) !important;
    border: 1px solid var(--speas-border) !important;
    border-radius: 20px !important;
    box-shadow: 0 28px 76px rgba(15, 23, 42, 0.22) !important;
    overflow: hidden !important;
}

html:root:root[data-speas-theme] body.speas-app[data-speas-module]:not([data-speas-module="inicio"]):not([data-speas-module="ventas"]):not([data-speas-module="finanzas"]) :is(
    .modal-header,
    .rend-modal-head,
    .modal-footer,
    .rend-modal-foot,
    .modal-content > .form-actions
) {
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 16px 20px !important;
    background: var(--speas-surface) !important;
    border-color: var(--speas-border) !important;
}

html:root:root[data-speas-theme] body.speas-app[data-speas-module]:not([data-speas-module="inicio"]):not([data-speas-module="ventas"]):not([data-speas-module="finanzas"]) :is(
    .modal-body,
    .rend-modal-body,
    .modal-content > form
) {
    flex: 0 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 18px 20px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    background: var(--speas-surface) !important;
    color: var(--speas-text) !important;
}

html:root:root[data-speas-theme] body.speas-app[data-speas-module]:not([data-speas-module="inicio"]):not([data-speas-module="ventas"]):not([data-speas-module="finanzas"]) :is(.modal-content, .rend-modal-box) :is(input, select, textarea) {
    background: var(--speas-surface) !important;
    border-color: var(--speas-border) !important;
    color: var(--speas-text) !important;
}

html:root:root[data-speas-theme] body.speas-app[data-speas-module="ordenes_compra"] #modal-crear-oc .modal-content {
    width: min(100%, 840px) !important;
}

html:root:root[data-speas-theme] body.speas-app[data-speas-module="ordenes_compra"] #modal-recepcion-oc .modal-content {
    width: min(100%, 720px) !important;
}

html:root:root[data-speas-theme] body.speas-app[data-speas-module="inventario"] #modal-kardex .modal-content {
    width: min(100%, 1180px) !important;
}

/* Formularios que la hoja historica convertia en cajones laterales. Se
   presentan como dialogos centrados y con desplazamiento interno coherente. */
html:root:root[data-speas-theme] body.speas-app.speas-app :is(
    #modal-crear-oc.modal-overlay,
    #modal-recepcion-oc.modal-overlay,
    #modal-anular-oc.modal-overlay,
    #modal-cliente.modal-overlay,
    #modal-producto.modal-overlay,
    #modal-proveedor.modal-overlay,
    #modal-factura.modal-overlay,
    #modal-detalles-ver.modal-overlay
) {
    align-items: center !important;
    justify-content: center !important;
    place-items: center !important;
    padding: clamp(12px, 3vw, 30px) !important;
}

html:root:root[data-speas-theme] body.speas-app.speas-app :is(
    #modal-crear-oc,
    #modal-recepcion-oc,
    #modal-anular-oc,
    #modal-cliente,
    #modal-producto,
    #modal-proveedor,
    #modal-factura,
    #modal-detalles-ver
) > .modal-content {
    position: relative !important;
    inset: auto !important;
    width: min(100%, 840px) !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100dvh - clamp(24px, 6vw, 60px)) !important;
    margin: auto !important;
    transform: none !important;
}

html:root:root[data-speas-theme] body.speas-app.speas-app #modal-cliente > .modal-content {
    width: min(100%, 760px) !important;
}

html:root:root[data-speas-theme] body.speas-app.speas-app :is(
    #modal-crear-oc,
    #modal-recepcion-oc,
    #modal-anular-oc,
    #modal-cliente,
    #modal-producto,
    #modal-proveedor,
    #modal-factura,
    #modal-detalles-ver
) :is(.modal-header, .modal-body, .modal-footer, .modal-content > form) {
    background: var(--speas-surface) !important;
    background-color: var(--speas-surface) !important;
    border-color: var(--speas-border) !important;
    color: var(--speas-text) !important;
}

/* Rendiciones porta el dialogo fuera de #rend-modulo; se restauran aqui sus
   tokens y su espaciado para que no pierda el boton principal ni los margenes. */
html:root:root[data-speas-theme] body.speas-app[data-speas-module="rendiciones"] .rend-modal {
    --r-border: var(--speas-border);
    --r-muted: var(--speas-muted);
    --r-surface: var(--speas-surface);
    --r-accent: var(--speas-accent);
}

html:root:root[data-speas-theme] body.speas-app[data-speas-module="rendiciones"] .rend-modal-box > h3 {
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 16px 20px !important;
    color: var(--speas-text) !important;
    border-bottom: 1px solid var(--speas-border) !important;
}

html:root:root[data-speas-theme] body.speas-app[data-speas-module="rendiciones"] .rend-modal-box > .rend-form-grid {
    padding: 18px 20px !important;
}

html:root:root[data-speas-theme] body.speas-app[data-speas-module="rendiciones"] .rend-modal-box > .rend-modal-foot {
    margin: 0 !important;
    padding: 16px 20px !important;
    border-top: 1px solid var(--speas-border) !important;
}

html:root:root[data-speas-theme] body.speas-app[data-speas-module="rendiciones"] .rend-modal .rend-btn-primary {
    background: var(--speas-accent) !important;
    border-color: var(--speas-accent) !important;
    color: #ffffff !important;
}

html:root:root[data-speas-theme] body.speas-app.speas-app :is(
    #modal-crear-oc,
    #modal-recepcion-oc,
    #modal-anular-oc,
    #modal-cliente,
    #modal-producto,
    #modal-proveedor,
    #modal-factura,
    #modal-detalles-ver
) :is(.modal-header, .modal-body, .modal-footer) :is(h2, h3, h4, label, p, span:not(.status-badge)) {
    color: var(--speas-text) !important;
}

@media (max-width: 720px) {
    html:root:root[data-speas-theme] body.speas-app[data-speas-module]:not([data-speas-module="inicio"]):not([data-speas-module="ventas"]):not([data-speas-module="finanzas"]) :is(
        .modal-overlay,
        .modal-custom,
        .rend-modal,
        .dispatch-dialog-layer,
        .g-modal,
        .c-modal
    ) {
        align-items: flex-end !important;
        place-items: end center !important;
        padding: 0 !important;
    }

    html:root:root[data-speas-theme] body.speas-app[data-speas-module]:not([data-speas-module="inicio"]):not([data-speas-module="ventas"]):not([data-speas-module="finanzas"]) :is(
        .modal-content,
        .modal-panel,
        .rend-modal-box,
        .g-modal > div,
        .c-modal > div
    ) {
        width: 100% !important;
        max-width: none !important;
        max-height: 92dvh !important;
        border-radius: 20px 20px 0 0 !important;
    }

    html:root:root[data-speas-theme] body.speas-app.speas-app :is(
        #modal-crear-oc.modal-overlay,
        #modal-recepcion-oc.modal-overlay,
        #modal-anular-oc.modal-overlay,
        #modal-cliente.modal-overlay,
        #modal-producto.modal-overlay,
        #modal-proveedor.modal-overlay,
        #modal-factura.modal-overlay,
        #modal-detalles-ver.modal-overlay
    ) {
        align-items: flex-end !important;
        justify-content: center !important;
        place-items: end center !important;
        padding: 0 !important;
    }

    html:root:root[data-speas-theme] body.speas-app.speas-app :is(
        #modal-crear-oc,
        #modal-recepcion-oc,
        #modal-anular-oc,
        #modal-cliente,
        #modal-producto,
        #modal-proveedor,
        #modal-factura,
        #modal-detalles-ver
    ) > .modal-content {
        width: 100% !important;
        max-width: none !important;
        max-height: 92dvh !important;
        border-radius: 20px 20px 0 0 !important;
    }
}

/* Ventas POS: bloqueo de scroll del contenedor mientras hay una capa abierta.
   Vive aqui y no en ventas.css porque la regla de arriba pone
   `overflow-y: auto !important` sobre este mismo contenedor: desde la hoja del
   modulo no hay especificidad que gane a un !important. Antes esto se hacia con
   `content.style.setProperty('overflow-y','hidden','important')` desde ventas.js,
   que obligaba a guardar el valor previo Y su prioridad para devolverlos, y ese
   guardado se pierde en cuanto dos capas se abren y se cierran en distinto orden. */
html:root:root body.speas-app #contenedor-dinamico#contenedor-dinamico.pos-scroll-lock {
    overflow-y: hidden !important;
}

/* Ventas POS: aislamiento final frente a la capa heredada y temas SPEAS. */
html:root:root[data-speas-theme] body.speas-app .pos-shell {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    color: var(--speas-text) !important;
    transform: none !important;
}

html:root:root[data-speas-theme] body.speas-app .pos-shell :is(
    .pos-toolbar,
    .pos-catalog,
    .pos-ticket,
    .pos-form-section
),
html:root:root[data-speas-theme] body.speas-app .pos-dialog {
    background-color: var(--speas-surface) !important;
    border-color: var(--speas-border) !important;
    color: var(--speas-text) !important;
}

html:root:root[data-speas-theme] body.speas-app.speas-app .pos-workspace .pos-ticket {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    border-radius: 20px !important;
}

html:root:root body.speas-app.speas-app .header-text.header-text .speas-theme-switch .speas-theme-cycle {
    width: auto !important;
    min-width: 104px !important;
    height: 31px !important;
    min-height: 31px !important;
    padding: 0 14px !important;
    border-radius: 9px !important;
}

@media (max-width: 768px) {
    html:root:root body.speas-app.speas-app .header-text.header-text .speas-theme-switch .speas-theme-cycle {
        width: 42px !important;
        min-width: 42px !important;
        padding: 0 8px !important;
    }

    .speas-theme-switch .speas-theme-dot {
        display: none !important;
    }
}

html:root:root[data-speas-theme] body.speas-app .pos-shell .pos-toolbar {
    background:
        radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--speas-accent) 10%, transparent), transparent 34%),
        var(--speas-surface) !important;
}

html:root:root[data-speas-theme] body.speas-app .pos-shell .pos-product-card {
    min-height: 126px !important;
    padding: 15px !important;
    background: var(--speas-surface) !important;
    border-color: var(--speas-border) !important;
    color: var(--speas-text) !important;
}

html:root:root[data-speas-theme] body.speas-app .pos-shell .pos-product-card:hover {
    background: color-mix(in srgb, var(--speas-accent) 2.5%, var(--speas-surface)) !important;
    border-color: color-mix(in srgb, var(--speas-accent) 38%, var(--speas-border)) !important;
}

html:root:root[data-speas-theme] body.speas-app .pos-shell .pos-ticket-footer,
html:root:root[data-speas-theme] body.speas-app .pos-dialog-body,
html:root:root[data-speas-theme] body.speas-app .pos-search-wrap kbd,
html:root:root[data-speas-theme] body.speas-app .pos-results-count {
    background: var(--speas-surface-2) !important;
    border-color: var(--speas-border) !important;
    color: var(--speas-muted) !important;
}

html:root:root[data-speas-theme] body.speas-app .pos-search-wrap {
    background: var(--speas-surface) !important;
    border-color: var(--speas-border) !important;
}

html:root:root[data-speas-theme] body.speas-app .pos-search-wrap:focus-within {
    border-color: var(--speas-accent) !important;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--speas-accent) 13%, transparent), 0 12px 28px rgba(24, 34, 53, 0.06) !important;
}

html:root:root[data-speas-theme] body.speas-app .pos-search-wrap input {
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 12px !important;
    background: transparent !important;
    border: 0 !important;
    color: var(--speas-text) !important;
    box-shadow: none !important;
}

html:root:root[data-speas-theme] body.speas-app .pos-search-icon,
html:root:root[data-speas-theme] body.speas-app :is(.pos-product-icon, .pos-product-add, .pos-ticket-icon, .pos-empty-cart i),
html:root:root[data-speas-theme] body.speas-app .pos-form-section > header > i {
    background: var(--speas-accent-soft) !important;
    color: var(--speas-accent) !important;
}

html:root:root[data-speas-theme] body.speas-app :is(.pos-primary, .pos-floating-cart) {
    min-height: 43px !important;
    background: var(--speas-accent) !important;
    border-color: var(--speas-accent) !important;
    color: #ffffff !important;
}

html:root:root[data-speas-theme] body.speas-app :is(.pos-primary, .pos-floating-cart):hover {
    background: color-mix(in srgb, var(--speas-accent) 82%, #172033) !important;
}

html:root:root[data-speas-theme] body.speas-app :is(
    .pos-secondary,
    .pos-category-btn,
    .pos-icon-button,
    .pos-qty-button
) {
    min-height: 34px !important;
    border-color: var(--speas-border) !important;
}

html:root:root[data-speas-theme] body.speas-app .pos-category-btn.is-active,
html:root:root[data-speas-theme] body.speas-app :is(.pos-segmented, .pos-payment-grid, .pos-print-grid) input:checked + span {
    background: var(--speas-accent-soft) !important;
    border-color: var(--speas-accent) !important;
    color: var(--speas-accent) !important;
}

html:root:root[data-speas-theme] body.speas-app .pos-dialog-layer {
    background: rgba(24, 34, 53, 0.4) !important;
}

html:root:root[data-speas-theme] body.speas-app .pos-total-card {
    background: linear-gradient(120deg, var(--speas-accent-soft), var(--speas-surface)) !important;
    border-color: var(--speas-border) !important;
    color: var(--speas-text) !important;
}

html:root:root[data-speas-theme] body.speas-app .pos-dialog-layer :is(
    .pos-field input,
    .pos-field select,
    .pos-suffix-input input
) {
    height: 42px !important;
    min-height: 42px !important;
    background: var(--speas-surface) !important;
    border-color: var(--speas-border) !important;
    color: var(--speas-text) !important;
    box-shadow: none !important;
}

html:root:root[data-speas-theme] body.speas-app .pos-dialog-layer :is(
    .pos-field input,
    .pos-field select,
    .pos-suffix-input input
):focus {
    border-color: var(--speas-accent) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--speas-accent) 13%, transparent) !important;
}

@media (max-width: 760px) {
    html:root:root[data-speas-theme] body.speas-app .pos-shell .pos-product-card {
        min-height: 112px !important;
        padding: 12px !important;
    }

    html:root:root[data-speas-theme] body.speas-app .pos-dialog-layer {
        align-items: end !important;
        padding: 0 !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    html:root:root[data-speas-theme] body.speas-app .pos-shell *,
    html:root:root[data-speas-theme] body.speas-app .pos-shell *::before,
    html:root:root[data-speas-theme] body.speas-app .pos-shell *::after,
    html:root:root[data-speas-theme] body.speas-app .pos-dialog-layer *,
    html:root:root[data-speas-theme] body.speas-app .pos-dialog-layer *::before,
    html:root:root[data-speas-theme] body.speas-app .pos-dialog-layer *::after {
        animation-duration: 1ms !important;
        animation-delay: 0ms !important;
        transition-duration: 1ms !important;
    }
}

/* Modales en movil: panel inferior, como la orden de venta del POS.
   En un telefono todos los dialogos del ERP -los de cada modulo, los que
   arman dashboard.js y notifications.js y los que llevan estilo en linea-
   suben desde abajo, a todo el ancho, con las esquinas de arriba redondeadas,
   el fondo desenfocado y el pie por encima de la barra del sistema. Las reglas
   por identificador de speas-ui.css y del CSS de cada modulo (que carga
   despues) centran su modal, asi que este bloque necesita mas especificidad
   que dos identificadores: la dan los :not(#_s) repetidos. No toca `display`:
   abrir y cerrar sigue siendo cosa de cada modulo. */
@media (max-width: 640px) {
    html:root:root body.speas-app.speas-app:not(#_s):not(#_s):not(#_s):not(#_s) :is(
        .modal-overlay,
        .modal-custom,
        .rend-modal,
        .dispatch-dialog-layer,
        .finance-modal,
        .modulos-modal-overlay,
        .pos-dialog-layer,
        .calendar-detail-overlay,
        .erp-bank-review-overlay,
        .custom-confirm-overlay,
        .custom-alert-overlay,
        #modal-eliminar-usuario
    ) {
        place-items: end center !important;
        align-items: flex-end !important;
        /* stretch y no center: en las capas que son grid, center encoge la
           columna al ancho del contenido y la hoja no llega a los bordes. */
        justify-content: stretch !important;
        align-content: end !important;
        padding: max(18px, env(safe-area-inset-top, 0px)) 0 0 !important;
        background: rgba(24, 34, 53, 0.42) !important;
        backdrop-filter: blur(7px) !important;
        -webkit-backdrop-filter: blur(7px) !important;
        overflow: hidden !important;
    }

    html:root:root body.speas-app.speas-app:not(#_s):not(#_s):not(#_s):not(#_s) :is(
        .modal-overlay,
        .modal-custom,
        .rend-modal,
        .dispatch-dialog-layer,
        .finance-modal,
        .modulos-modal-overlay,
        .pos-dialog-layer,
        .calendar-detail-overlay,
        .erp-bank-review-overlay,
        .custom-confirm-overlay,
        .custom-alert-overlay,
        #modal-eliminar-usuario
    ) > :is(
        .modal-content,
        .modal-panel,
        .rend-modal-box,
        .finance-modal-card,
        .modulos-modal-card,
        .pos-dialog,
        .dispatch-dialog,
        .calendar-detail-card,
        .erp-bank-review-dialog,
        .confirm-box,
        .alert-box,
        [role="alertdialog"],
        [role="dialog"]
    ),
    html:root:root body.speas-app.speas-app:not(#_s):not(#_s):not(#_s):not(#_s) #modal-eliminar-usuario > div {
        position: relative !important;
        inset: auto !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: calc(100dvh - max(18px, env(safe-area-inset-top, 0px))) !important;
        margin: auto 0 0 !important;
        border-bottom: 0 !important;
        border-radius: 22px 22px 0 0 !important;
        box-shadow: 0 -18px 48px rgba(15, 23, 42, 0.22) !important;
        transform: none !important;
        animation: speas-hoja-sube 180ms ease-out both !important;
    }

    /* Los que no tienen cuerpo propio que desplace, desplazan la hoja entera. */
    html:root:root body.speas-app.speas-app:not(#_s):not(#_s):not(#_s):not(#_s) :is(
        .rend-modal,
        .dispatch-dialog-layer,
        .finance-modal,
        .modulos-modal-overlay,
        .calendar-detail-overlay,
        .erp-bank-review-overlay,
        .custom-confirm-overlay,
        .custom-alert-overlay,
        #modal-eliminar-usuario
    ) > :is(
        .rend-modal-box,
        .finance-modal-card,
        .modulos-modal-card,
        .dispatch-dialog,
        .calendar-detail-card,
        .erp-bank-review-dialog,
        .confirm-box,
        .alert-box,
        [role="alertdialog"],
        [role="dialog"]
    ),
    html:root:root body.speas-app.speas-app:not(#_s):not(#_s):not(#_s):not(#_s) #modal-eliminar-usuario > div {
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* El pie queda por encima del indicador de inicio del telefono. */
    html:root:root body.speas-app.speas-app:not(#_s):not(#_s):not(#_s):not(#_s) :is(.modal-content, .modal-panel, .pos-dialog) > :is(.modal-footer, .pos-dialog-footer):last-child,
    html:root:root body.speas-app.speas-app:not(#_s):not(#_s):not(#_s):not(#_s) .modal-content > form > .modal-footer:last-child {
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
    }

    html:root:root body.speas-app.speas-app:not(#_s):not(#_s):not(#_s):not(#_s) :is(.modal-content, .modal-panel) > :is(.modal-body, form):last-child {
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* Una columna 1fr no baja del ancho minimo de su contenido: la tabla de
       lineas de la orden de compra la estiraba a 720 px y la hoja se cortaba
       por la derecha. Con min-width 0 la tabla desplaza dentro de su caja. */
    html:root:root body.speas-app.speas-app:not(#_s):not(#_s):not(#_s):not(#_s) :is(.modal-content, .modal-panel, .rend-modal-box, .finance-modal-card) :is(.form-grid, .form-row, .rend-form-grid) > * {
        min-width: 0 !important;
    }

    /* Botones del pie faciles de tocar, como el POS. Solo la altura: el
       reparto (fila o columna) lo decide cada modulo. */
    html:root:root body.speas-app.speas-app:not(#_s):not(#_s):not(#_s):not(#_s) :is(.modal-footer, .rend-modal-foot, .finance-modal-actions, .modulos-modal-actions, .dispatch-dialog-actions, .confirm-actions, .historial-dialog-actions) > :is(button, a) {
        min-height: 44px !important;
    }
}

@keyframes speas-hoja-sube {
    from { translate: 0 24px; opacity: 0; }
    to { translate: 0 0; opacity: 1; }
}

@media (max-width: 640px) and (prefers-reduced-motion: reduce) {
    html:root:root body.speas-app.speas-app:not(#_s):not(#_s):not(#_s):not(#_s) :is(.modal-content, .modal-panel, .rend-modal-box, .finance-modal-card, .modulos-modal-card, .pos-dialog, .dispatch-dialog, .calendar-detail-card, .erp-bank-review-dialog, .confirm-box, .alert-box) {
        animation: none !important;
    }
}
