:root {
    --color-principal: #152D3C;
    --color-principal-hover: #1c3c4f;
    --color-fondo: #eef2f4;
    --color-texto: #20252b;
    --color-superficie: #ffffff;
    --color-superficie-2: #f8fafb;
    --color-hover: #f4f6f8;
    --color-borde: #e1e5e9;
    --color-muted: #69727d;
    --color-sidebar-activo: rgba(255, 255, 255, 0.22);
    --color-sidebar-indicador: #ffffff;
    --sombra-card: 0 10px 28px rgba(21, 45, 60, 0.14);
    --sidebar-width-expanded: 180px;
    --sidebar-width-collapsed: 54px;
    --sidebar-pad-x: 10px;
    --fuente: "Montserrat", Arial, Helvetica, sans-serif;
}

/*
 * Modo oscuro derivado del color principal de la organización.
 * Fondos: principal mezclado con negro.
 * Bordes/separadores: aún más oscuros (más negro), no más claros.
 * Texto: principal mezclado con blanco.
 */
html.theme-dark {
    color-scheme: dark;
    --color-fondo: color-mix(in srgb, var(--color-principal) 82%, black);
    --color-superficie: color-mix(in srgb, var(--color-principal) 68%, black);
    --color-superficie-2: color-mix(in srgb, var(--color-principal) 58%, black);
    /* Hover: cerca del fondo, apenas más oscuro */
    --color-hover: color-mix(in srgb, var(--color-fondo) 90%, black);
    /* Bordes muy transparentes: apenas se perciben */
    --color-borde: color-mix(in srgb, white 2%, transparent);
    --color-muted: color-mix(in srgb, var(--color-principal) 42%, white);
    --color-texto: color-mix(in srgb, var(--color-principal) 16%, white);
    --sombra-card: 0 12px 28px color-mix(in srgb, black 55%, transparent);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    font-family: var(--fuente);
    font-size: 12px;
    line-height: 1.4;
}

body {
    background: var(--color-fondo);
    color: var(--color-texto);
}

html:has(body.admin-body) {
    height: 100%;
    overflow: hidden;
}

.admin-body {
    height: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    caret-color: transparent;
}

.admin-body input,
.admin-body textarea,
.admin-body select,
.admin-body [contenteditable="true"] {
    user-select: text;
    -webkit-user-select: text;
    caret-color: auto;
}

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: var(--color-principal);
    user-select: none;
    -webkit-user-select: none;
    caret-color: transparent;
}

.login-body input,
.login-body textarea {
    user-select: text;
    -webkit-user-select: text;
    caret-color: auto;
}

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
}

.login-container {
    width: 100%;
    max-width: 700px;
}

.login-card {
    display: flex;
    overflow: hidden;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
    min-height: 400px;
}

.login-visual {
    flex: 3;
    position: relative;
    min-width: 0;
    background: var(--color-principal);
}

.login-visual img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.login-panel {
    flex: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 24px 20px;
}

.login-welcome {
    margin-bottom: 18px;
    text-align: center;
}

.login-welcome h1 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 700;
    color: var(--color-principal);
}

.login-welcome p {
    margin: 0;
    font-size: 11px;
    color: #8a939c;
}

.login-panel .form-group input {
    width: 100%;
    padding: 7px 0;
    border: 0;
    border-bottom: 1px solid #c5ced6;
    border-radius: 0;
    background: transparent;
    font-size: 12px;
    color: var(--color-texto);
}

.login-panel .form-group input::placeholder {
    color: #9aa3ab;
}

.login-panel .form-group input:focus {
    outline: none;
    border-bottom-color: var(--color-principal);
}

.login-panel .button-primary {
    display: block;
    width: fit-content;
    margin: 4px auto 0;
    padding: 0 32px;
    min-height: 36px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 11px;
    line-height: 36px;
}

.login-cliente {
    background: #ffffff;
}

.login-cliente .login-card {
    background: var(--color-principal);
}

.login-cliente .login-panel {
    color: #ffffff;
}

.login-cliente .login-welcome h1 {
    color: #ffffff;
}

.login-cliente .login-welcome p {
    color: rgba(255, 255, 255, 0.72);
}

.login-cliente .login-panel .form-group input {
    border-bottom-color: rgba(255, 255, 255, 0.45);
    color: #ffffff;
}

.login-cliente .login-panel .form-group input::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

.login-cliente .login-panel .form-group input:focus {
    border-bottom-color: #ffffff;
}

.login-cliente .login-panel .button-primary {
    background: #ffffff;
    color: var(--color-principal);
}

.login-cliente .login-panel .button-primary:hover {
    background: #f3f6f8;
}

.login-cliente .alert-error {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

.login-cliente .login-back {
    margin: 18px 0 0;
    text-align: center;
}

.login-cliente .login-back a {
    color: rgba(255, 255, 255, 0.82);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
}

.login-cliente .login-back a:hover {
    color: #ffffff;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 11px;
}

.button-primary {
    width: 100%;
    padding: 8px 14px;
    border: 0;
    border-radius: 7px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    background: var(--color-principal);
    color: #ffffff;
}

.button-primary:hover {
    background: var(--color-principal-hover);
}

.alert-error {
    margin-bottom: 12px;
    padding: 8px 10px;
    border-radius: 7px;
    background: #f7dede;
    font-size: 11px;
    transition: opacity 0.4s ease;
}

.alert-success {
    margin-bottom: 12px;
    padding: 8px 10px;
    border-radius: 7px;
    background: #def2e4;
    font-size: 11px;
    transition: opacity 0.4s ease;
}

.alert-error.is-hiding,
.alert-success.is-hiding {
    opacity: 0;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: var(--color-superficie);
    color: var(--color-principal);
    overflow: visible;
    position: relative;
    z-index: 20;
    flex-shrink: 0;
    border-bottom: 1px solid transparent;
}

html.theme-dark .admin-header {
    border-bottom-color: var(--color-borde);
}

.admin-header-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--color-principal);
    cursor: pointer;
    line-height: 0;
}

.theme-toggle:hover {
    background: transparent;
    color: var(--color-principal-hover);
    opacity: 0.85;
}

.theme-toggle svg {
    display: block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

html.theme-transition,
html.theme-transition body,
html.theme-transition .admin-header,
html.theme-transition .admin-content,
html.theme-transition .panel,
html.theme-transition .stat-card,
html.theme-transition .drawer-panel,
html.theme-transition .modal-card,
html.theme-transition .inventario-card,
html.theme-transition .select-menu-trigger,
html.theme-transition .button-exportar,
html.theme-transition .export-menu-list,
html.theme-transition .inventario-filtro-pills,
html.theme-transition .inventario-filtro-pill,
html.theme-transition .view-toggle,
html.theme-transition .view-toggle-button,
html.theme-transition .lista-busqueda,
html.theme-transition .admin-form .form-group input,
html.theme-transition .admin-form .form-group select,
html.theme-transition .admin-form .form-group textarea,
html.theme-transition .theme-toggle,
html.theme-transition th,
html.theme-transition td,
html.theme-transition .user-menu-card,
html.theme-transition .ajuste-lote-fila {
    transition:
        background-color 0.28s ease,
        color 0.28s ease,
        border-color 0.28s ease,
        box-shadow 0.28s ease,
        opacity 0.28s ease;
}

.admin-page-title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--color-principal);
}

.admin-page-subtitle {
    margin: 2px 0 0;
    font-size: 11px;
    font-weight: 400;
    color: var(--color-muted);
}

.admin-user {
    position: relative;
    display: flex;
    align-items: center;
}

.admin-user-toggle {
    position: relative;
    z-index: 52;
    display: flex;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    border-radius: 50%;
}

.admin-user-toggle:hover .admin-avatar,
.admin-user.is-open .admin-user-toggle .admin-avatar {
    filter: brightness(1.12);
}

.admin-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--color-principal);
    color: #ffffff;
    flex-shrink: 0;
}

.admin-avatar svg {
    width: 14px;
    height: 14px;
}

.admin-avatar-lg {
    width: 56px;
    height: 56px;
}

.admin-avatar-lg svg {
    width: 28px;
    height: 28px;
}

.user-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(21, 45, 60, 0.48);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.admin-user.is-open .user-menu-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.user-menu-card {
    position: absolute;
    top: calc(100% + 20px);
    right: 0;
    z-index: 51;
    width: 220px;
    padding: 16px 12px 8px;
    background: var(--color-superficie);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(21, 45, 60, 0.16);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px) scale(0.96);
    transform-origin: top right;
    transition:
        opacity 0.22s ease,
        transform 0.22s ease,
        visibility 0.22s ease;
}

.admin-user.is-open .user-menu-card {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.user-menu-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 4px 8px 14px;
    border-bottom: 1px solid var(--color-borde);
}

.user-menu-name {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    color: var(--color-principal);
    word-break: break-word;
}

.user-menu-actions {
    padding-top: 6px;
}

.user-menu-item {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    color: var(--color-texto);
    text-align: left;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    box-sizing: border-box;
}

.user-menu-item:hover {
    background: #f4f6f8;
}

.admin-layout {
    display: flex;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.admin-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.admin-sidebar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: var(--sidebar-width-expanded);
    height: 100%;
    min-height: 0;
    padding: 12px var(--sidebar-pad-x) 12px 0;
    background: var(--color-principal);
    flex-shrink: 0;
    overflow: visible;
    position: relative;
    z-index: 4;
    transition: width 0.2s ease;
}

.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0 0 10px var(--sidebar-pad-x);
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    flex-shrink: 0;
}

.sidebar-toggle svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

.sidebar-toggle:hover {
    background: var(--color-sidebar-activo);
}

.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    margin: 0 0 10px 0;
    min-height: 32px;
    min-width: 0;
    position: relative;
    padding-left: var(--sidebar-pad-x);
}

.sidebar-top .sidebar-toggle {
    margin: 0;
}

.sidebar-collapsed .sidebar-top {
    margin-left: 0;
    padding-left: 0;
    flex-direction: column;
    align-items: center;
}

.sidebar-org {
    min-width: 0;
    flex: 1;
}

.sidebar-collapsed .sidebar-org:not(.is-switchable) {
    display: none;
}

.sidebar-org-name {
    margin: 0;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-org:not(.is-switchable) .sidebar-org-name {
    display: flex;
    align-items: center;
    height: 32px;
    padding: 0 8px;
}

.sidebar-org-menu {
    position: relative;
}

.sidebar-org-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    height: 32px;
    min-width: 0;
    padding: 0 8px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    text-align: left;
}

.sidebar-org-toggle:hover {
    background: var(--color-sidebar-activo);
}

.sidebar-org-initial {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 7px;
    background: var(--color-sidebar-activo);
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-collapsed .sidebar-org-initial {
    display: flex;
}

.sidebar-collapsed .sidebar-org-toggle {
    width: 32px;
    padding: 0;
    justify-content: center;
}

.sidebar-collapsed .sidebar-org-toggle .sidebar-org-name,
.sidebar-collapsed .sidebar-org-chevron {
    display: none;
}

.sidebar-org-toggle .sidebar-org-name {
    flex: 1;
    min-width: 0;
}

.sidebar-org-chevron {
    flex-shrink: 0;
    opacity: 0.75;
    transition: transform 0.18s ease;
}

.sidebar-org-menu.is-open .sidebar-org-chevron {
    transform: rotate(180deg);
}

.sidebar-org-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 40;
    min-width: 180px;
    padding: 6px;
    background: var(--color-superficie);
    border-radius: 10px;
    box-shadow: var(--sombra-card);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition:
        opacity 0.18s ease,
        transform 0.18s ease,
        visibility 0.18s ease;
}

.sidebar-org-menu.is-open .sidebar-org-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.sidebar-collapsed .sidebar-org-dropdown {
    top: 0;
    left: calc(100% + 10px);
}

.sidebar-org-option {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--color-texto);
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

.sidebar-org-option:hover:not(:disabled) {
    background: #f4f6f8;
}

.sidebar-org-option.is-current {
    font-weight: 600;
    cursor: default;
    color: var(--color-principal);
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-section + .sidebar-section {
    margin-top: 14px;
}

.sidebar-collapsed .sidebar-section + .sidebar-section {
    margin-top: 0;
}

.sidebar-section-title {
    margin: 2px 0 6px var(--sidebar-pad-x);
    padding: 0 8px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-collapsed .sidebar-section {
    width: 100%;
    align-items: center;
}

.sidebar-collapsed .sidebar-section-title {
    display: none;
}

.sidebar-collapsed .sidebar-toggle svg {
    transform: rotate(180deg);
}

.sidebar-collapsed .admin-sidebar {
    width: var(--sidebar-width-collapsed);
    padding-left: 0;
    padding-right: 0;
    align-items: center;
}

.sidebar-collapsed .sidebar-toggle {
    margin-left: 0;
}

.sidebar-item {
    position: relative;
    min-width: 0;
    padding-left: var(--sidebar-pad-x);
}

.sidebar-collapsed .sidebar-item {
    display: flex;
    justify-content: center;
    width: 100%;
    padding-left: 0;
}

.sidebar-item + .sidebar-item {
    margin-top: 3px;
}

.sidebar-item.is-active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 32px;
    background: var(--color-sidebar-indicador);
}

.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    width: 100%;
    overflow: hidden;
    padding: 0 8px;
    border-radius: 7px;
    color: #ffffff;
    background: transparent;
    text-decoration: none;
    white-space: nowrap;
    transition: width 0.2s ease;
}

.sidebar-collapsed .sidebar-link {
    width: 32px;
    min-width: 32px;
    padding: 0;
    justify-content: center;
    gap: 0;
}

.sidebar-collapsed .sidebar-label {
    display: none;
}

.sidebar-link svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.sidebar-link:hover,
.sidebar-item.is-active .sidebar-link {
    background: var(--color-sidebar-activo);
}

.sidebar-label {
    font-size: 12px;
    font-weight: 500;
}

.sidebar-credit {
    display: block;
    width: calc(100% + var(--sidebar-pad-x));
    margin-top: auto;
    margin-right: calc(-1 * var(--sidebar-pad-x));
    padding: 14px 0 2px;
    font-size: 8px;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.42);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.sidebar-credit strong {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.78);
}

.sidebar-collapsed .sidebar-credit {
    display: none;
}

.admin-container {
    flex: 1;
    min-width: 0;
    min-height: 0;
    padding: 16px;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Scrollbars: ocultos hasta hover o mientras se desplaza */
.admin-container,
.calendario-slide,
.dashboard-panel-actividad .actividad-lista,
.product-picker-results,
.venta-picker-results,
.select-menu-list,
.drawer-panel,
.modal-card,
.compra-lista,
.venta-lista,
.unidad-picker-list,
[data-usuario-existente-list] {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.admin-container:hover,
.admin-container.is-scrolling,
.calendario-slide:hover,
.calendario-slide.is-scrolling,
.dashboard-panel-actividad .actividad-lista:hover,
.dashboard-panel-actividad .actividad-lista.is-scrolling,
.product-picker-results:hover,
.product-picker-results.is-scrolling,
.venta-picker-results:hover,
.venta-picker-results.is-scrolling,
.select-menu-list:hover,
.select-menu-list.is-scrolling,
.drawer-panel:hover,
.drawer-panel.is-scrolling,
.modal-card:hover,
.modal-card.is-scrolling,
.compra-lista:hover,
.compra-lista.is-scrolling,
.venta-lista:hover,
.venta-lista.is-scrolling,
.unidad-picker-list:hover,
.unidad-picker-list.is-scrolling,
[data-usuario-existente-list]:hover,
[data-usuario-existente-list].is-scrolling {
    scrollbar-color: color-mix(in srgb, var(--color-principal) 40%, transparent) transparent;
}

.admin-container::-webkit-scrollbar,
.calendario-slide::-webkit-scrollbar,
.dashboard-panel-actividad .actividad-lista::-webkit-scrollbar,
.product-picker-results::-webkit-scrollbar,
.venta-picker-results::-webkit-scrollbar,
.select-menu-list::-webkit-scrollbar,
.drawer-panel::-webkit-scrollbar,
.modal-card::-webkit-scrollbar,
.compra-lista::-webkit-scrollbar,
.venta-lista::-webkit-scrollbar,
.unidad-picker-list::-webkit-scrollbar,
[data-usuario-existente-list]::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.admin-container::-webkit-scrollbar-track,
.calendario-slide::-webkit-scrollbar-track,
.dashboard-panel-actividad .actividad-lista::-webkit-scrollbar-track,
.product-picker-results::-webkit-scrollbar-track,
.venta-picker-results::-webkit-scrollbar-track,
.select-menu-list::-webkit-scrollbar-track,
.drawer-panel::-webkit-scrollbar-track,
.modal-card::-webkit-scrollbar-track,
.compra-lista::-webkit-scrollbar-track,
.venta-lista::-webkit-scrollbar-track,
.unidad-picker-list::-webkit-scrollbar-track,
[data-usuario-existente-list]::-webkit-scrollbar-track {
    background: transparent;
}

.admin-container::-webkit-scrollbar-thumb,
.calendario-slide::-webkit-scrollbar-thumb,
.dashboard-panel-actividad .actividad-lista::-webkit-scrollbar-thumb,
.product-picker-results::-webkit-scrollbar-thumb,
.venta-picker-results::-webkit-scrollbar-thumb,
.select-menu-list::-webkit-scrollbar-thumb,
.drawer-panel::-webkit-scrollbar-thumb,
.modal-card::-webkit-scrollbar-thumb,
.compra-lista::-webkit-scrollbar-thumb,
.venta-lista::-webkit-scrollbar-thumb,
.unidad-picker-list::-webkit-scrollbar-thumb,
[data-usuario-existente-list]::-webkit-scrollbar-thumb {
    background-color: transparent;
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.admin-container:hover::-webkit-scrollbar-thumb,
.admin-container.is-scrolling::-webkit-scrollbar-thumb,
.calendario-slide:hover::-webkit-scrollbar-thumb,
.calendario-slide.is-scrolling::-webkit-scrollbar-thumb,
.dashboard-panel-actividad .actividad-lista:hover::-webkit-scrollbar-thumb,
.dashboard-panel-actividad .actividad-lista.is-scrolling::-webkit-scrollbar-thumb,
.product-picker-results:hover::-webkit-scrollbar-thumb,
.product-picker-results.is-scrolling::-webkit-scrollbar-thumb,
.venta-picker-results:hover::-webkit-scrollbar-thumb,
.venta-picker-results.is-scrolling::-webkit-scrollbar-thumb,
.select-menu-list:hover::-webkit-scrollbar-thumb,
.select-menu-list.is-scrolling::-webkit-scrollbar-thumb,
.drawer-panel:hover::-webkit-scrollbar-thumb,
.drawer-panel.is-scrolling::-webkit-scrollbar-thumb,
.modal-card:hover::-webkit-scrollbar-thumb,
.modal-card.is-scrolling::-webkit-scrollbar-thumb,
.compra-lista:hover::-webkit-scrollbar-thumb,
.compra-lista.is-scrolling::-webkit-scrollbar-thumb,
.venta-lista:hover::-webkit-scrollbar-thumb,
.venta-lista.is-scrolling::-webkit-scrollbar-thumb,
.unidad-picker-list:hover::-webkit-scrollbar-thumb,
.unidad-picker-list.is-scrolling::-webkit-scrollbar-thumb,
[data-usuario-existente-list]:hover::-webkit-scrollbar-thumb,
[data-usuario-existente-list].is-scrolling::-webkit-scrollbar-thumb {
    background-color: color-mix(in srgb, var(--color-principal) 40%, transparent);
}

.admin-container:hover::-webkit-scrollbar-thumb:hover,
.admin-container.is-scrolling::-webkit-scrollbar-thumb:hover,
.drawer-panel:hover::-webkit-scrollbar-thumb:hover,
.drawer-panel.is-scrolling::-webkit-scrollbar-thumb:hover,
.modal-card:hover::-webkit-scrollbar-thumb:hover,
.modal-card.is-scrolling::-webkit-scrollbar-thumb:hover {
    background-color: color-mix(in srgb, var(--color-principal) 55%, transparent);
}

html.theme-dark .admin-container:hover,
html.theme-dark .admin-container.is-scrolling,
html.theme-dark .drawer-panel:hover,
html.theme-dark .drawer-panel.is-scrolling,
html.theme-dark .modal-card:hover,
html.theme-dark .modal-card.is-scrolling,
html.theme-dark .calendario-slide:hover,
html.theme-dark .calendario-slide.is-scrolling,
html.theme-dark .compra-lista:hover,
html.theme-dark .compra-lista.is-scrolling,
html.theme-dark .venta-lista:hover,
html.theme-dark .venta-lista.is-scrolling,
html.theme-dark .product-picker-results:hover,
html.theme-dark .product-picker-results.is-scrolling,
html.theme-dark .venta-picker-results:hover,
html.theme-dark .venta-picker-results.is-scrolling,
html.theme-dark .select-menu-list:hover,
html.theme-dark .select-menu-list.is-scrolling {
    scrollbar-color: color-mix(in srgb, white 28%, transparent) transparent;
}

html.theme-dark .admin-container:hover::-webkit-scrollbar-thumb,
html.theme-dark .admin-container.is-scrolling::-webkit-scrollbar-thumb,
html.theme-dark .drawer-panel:hover::-webkit-scrollbar-thumb,
html.theme-dark .drawer-panel.is-scrolling::-webkit-scrollbar-thumb,
html.theme-dark .modal-card:hover::-webkit-scrollbar-thumb,
html.theme-dark .modal-card.is-scrolling::-webkit-scrollbar-thumb,
html.theme-dark .calendario-slide:hover::-webkit-scrollbar-thumb,
html.theme-dark .calendario-slide.is-scrolling::-webkit-scrollbar-thumb,
html.theme-dark .compra-lista:hover::-webkit-scrollbar-thumb,
html.theme-dark .compra-lista.is-scrolling::-webkit-scrollbar-thumb,
html.theme-dark .venta-lista:hover::-webkit-scrollbar-thumb,
html.theme-dark .venta-lista.is-scrolling::-webkit-scrollbar-thumb,
html.theme-dark .product-picker-results:hover::-webkit-scrollbar-thumb,
html.theme-dark .product-picker-results.is-scrolling::-webkit-scrollbar-thumb,
html.theme-dark .venta-picker-results:hover::-webkit-scrollbar-thumb,
html.theme-dark .venta-picker-results.is-scrolling::-webkit-scrollbar-thumb,
html.theme-dark .select-menu-list:hover::-webkit-scrollbar-thumb,
html.theme-dark .select-menu-list.is-scrolling::-webkit-scrollbar-thumb {
    background-color: color-mix(in srgb, white 28%, transparent);
}

@media (max-width: 860px) {
    .login-card {
        flex-direction: column;
        min-height: auto;
    }

    .login-visual {
        flex: none;
        height: 140px;
    }

    .login-panel {
        flex: none;
        min-width: 0;
        width: 100%;
        padding: 18px 16px 22px;
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin: 0;
}

.stats-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 860px) {
    .stats-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .stats-grid-4 {
        grid-template-columns: minmax(0, 1fr);
    }
}

html:has(body.is-dashboard) {
    height: 100%;
    overflow: hidden;
}

.is-dashboard {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.is-dashboard .admin-layout,
.is-dashboard .admin-content {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.is-dashboard .admin-header {
    flex-shrink: 0;
}

.is-dashboard .admin-container {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.is-dashboard .stats-grid {
    flex-shrink: 0;
}

.dashboard-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
    align-items: stretch;
}

.is-dashboard .dashboard-row {
    flex: 1;
    min-height: 0;
}

.dashboard-col-izq {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    min-height: 0;
}

.is-dashboard .dashboard-cta-venta {
    flex-shrink: 0;
}

.dashboard-cta-venta {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    padding: 14px 18px;
    border: 0;
    border-radius: 9px;
    background: var(--color-principal);
    color: #ffffff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.dashboard-cta-mas {
    font-size: 22px;
    font-weight: 500;
    line-height: 1;
}

.dashboard-cta-venta:hover {
    background: var(--color-principal-hover);
}

.dashboard-panel-calendario {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dashboard-panel-calendario .panel-header,
.dashboard-panel-actividad .panel-header {
    flex-shrink: 0;
}

.calendario-cuerpo {
    position: relative;
    flex: 0 0 auto;
    overflow: hidden;
    padding: 8px 0 14px;
    cursor: grab;
    touch-action: pan-y;
    user-select: none;
    mask-image: linear-gradient(
        90deg,
        transparent 0%,
        #000 14%,
        #000 86%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        90deg,
        transparent 0%,
        #000 14%,
        #000 86%,
        transparent 100%
    );
}

.calendario-cuerpo.is-dragging {
    cursor: grabbing;
}

.calendario-selector {
    position: absolute;
    left: 50%;
    bottom: 14px;
    z-index: 0;
    width: 56px;
    height: 56px;
    margin-left: -28px;
    border-radius: 12px;
    background: var(--color-principal);
    box-shadow: 0 6px 16px rgba(21, 45, 60, 0.18);
    pointer-events: none;
}

.calendario-pista {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 12px;
    width: max-content;
    padding: 0;
    overflow: visible;
    mask-image: none;
    -webkit-mask-image: none;
    will-change: transform;
    transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.calendario-cuerpo.is-dragging .calendario-pista {
    transition: none;
}

.calendario-dia {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    width: 56px;
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    cursor: grab;
    opacity: calc(1 - (var(--d) * 0.18));
    transform: scale(calc(1 - (var(--d) * 0.1)));
    transform-origin: center bottom;
}

.calendario-nombre {
    font-size: 10px;
    font-weight: 500;
    color: #8a939c;
    text-transform: lowercase;
}

.calendario-cuadro {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: #eef2f4;
    color: var(--color-principal);
    font-size: 15px;
    font-weight: 600;
}

.calendario-dia.is-activo {
    opacity: 1;
    transform: none;
}

.calendario-dia.is-activo .calendario-nombre {
    color: var(--color-principal);
    font-weight: 600;
}

.calendario-dia.is-activo .calendario-cuadro {
    background: transparent;
    color: #ffffff;
    font-size: 18px;
}

.calendario-slides {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.calendario-slides-track {
    display: flex;
    height: 100%;
    transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.calendario-cuerpo.is-dragging ~ .calendario-slides .calendario-slides-track {
    transition: none;
}

.calendario-slide {
    flex: 0 0 100%;
    min-width: 0;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.calendario-movimientos-vacio {
    margin: 10px 2px 4px;
    font-size: 12px;
    color: #8a939c;
}

.calendario-movimientos-lista {
    display: flex;
    flex-direction: column;
}

.calendario-movimiento {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 2px;
    color: inherit;
    text-decoration: none;
    border-radius: 7px;
}

a.calendario-movimiento:hover {
    background: #f4f6f8;
}

.calendario-movimiento + .calendario-movimiento {
    border-top: 1px solid var(--color-borde);
}

.calendario-movimiento-foto {
    width: 40px;
    height: 40px;
}

.calendario-movimiento-copy {
    min-width: 0;
    flex: 1;
}

.actividad-tipo-simbolo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 12px;
    height: 12px;
}

.actividad-tipo-simbolo svg {
    display: block;
    width: 12px;
    height: 12px;
}

.actividad-tipo-simbolo.is-verde {
    color: #1f9d57;
}

.actividad-tipo-simbolo.is-rojo {
    color: #d64545;
}

.calendario-movimiento-tipo {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #8a939c;
}

.calendario-movimiento-producto-linea {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}

.calendario-movimiento-producto {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-principal);
}

.calendario-movimiento-total {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-texto);
    white-space: nowrap;
}

.dashboard-panel-actividad {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dashboard-panel-actividad .panel-toolbar {
    align-items: center;
    margin-bottom: 0;
}

.actividad-filtros {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.actividad-filtro {
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 11px;
    font-weight: 400;
    color: #8a939c;
    cursor: pointer;
}

.actividad-filtro:hover {
    color: var(--color-principal);
}

.actividad-filtro.is-active {
    font-weight: 600;
    color: var(--color-principal);
}

.actividad-lista {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    margin-top: 8px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.actividad-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 2px;
    color: inherit;
    text-decoration: none;
    border-radius: 7px;
}

a.actividad-item:hover {
    background: #f4f6f8;
}

.actividad-item[hidden],
.actividad-vacia[hidden] {
    display: none;
}

.actividad-item + .actividad-item {
    border-top: 1px solid #eef2f4;
}

.actividad-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 9px;
}

.actividad-icon svg {
    display: block;
}

.actividad-copy {
    min-width: 0;
    flex: 1;
}

.actividad-tipo {
    display: flex;
    align-items: center;
    gap: 6px;
}

.actividad-etiqueta {
    font-size: 11px;
    font-weight: 600;
    color: #69727d;
}

.actividad-fecha {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 400;
    color: #8a939c;
}

.actividad-fecha::before {
    content: "";
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #c5ced6;
    flex-shrink: 0;
}

.actividad-producto-linea {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}

.actividad-producto {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-principal);
}

.actividad-unidad {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 400;
    color: #8a939c;
}

.actividad-cantidad {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-texto);
    white-space: nowrap;
}

.actividad-cantidad-positiva {
    color: #1f9d57;
}

.actividad-cantidad-negativa {
    color: #d64545;
}

.actividad-vacia {
    margin: 12px 0 2px;
    font-size: 13px;
    color: #69727d;
}

@media (max-width: 860px) {
    .is-dashboard .admin-container {
        display: block;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .is-dashboard .dashboard-row {
        flex: none;
    }

    .dashboard-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .calendario-slide,
    .actividad-lista {
        max-height: 50vh;
    }
}

.stat-card {
    background: #ffffff;
    padding: 14px 16px;
    border-radius: 9px;
}

.stat-card span {
    display: block;
    color: #69727d;
    font-size: 11px;
}

.stat-card strong {
    display: block;
    margin-top: 4px;
    font-size: 20px;
}

a.stat-card {
    text-decoration: none;
    color: inherit;
}

a.stat-card:hover {
    box-shadow: var(--sombra-card);
}

.stat-card-kpi {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 36px 16px 14px;
}

.stat-card-kpi .stat-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #eef2f4;
    color: var(--color-principal);
}

.stat-card-icon svg {
    display: block;
}

.stat-card-kpi .stat-card-icon-peso,
.actividad-icon.stat-card-icon-peso {
    background: #e7f6ed;
    color: #1f9d57;
}

.stat-card-kpi .stat-card-icon-stock-bajo,
.stat-card-kpi .stat-card-icon-peso-rojo,
.actividad-icon.stat-card-icon-peso-rojo {
    background: #fdecea;
    color: #d64545;
}

.stat-card-body strong {
    overflow-wrap: anywhere;
}

.stat-card-body {
    min-width: 0;
}

.stat-card-arrow {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    color: #8a939c;
    text-decoration: none;
}

.stat-card-arrow:hover,
.stat-card-arrow:focus-visible {
    color: var(--color-principal);
    background: #eef2f4;
}

.stat-card-arrow:focus-visible {
    outline: 2px solid var(--color-principal);
    outline-offset: 1px;
}

.panel {
    background: var(--color-superficie);
    padding: 14px;
    border-radius: 9px;
}

.panel-header h2 {
    margin: 0 0 3px;
    font-size: 14px;
    font-weight: 700;
}

.panel-header p {
    margin: 0;
    color: var(--color-muted);
    font-size: 11px;
}

.config-panel .admin-form {
    max-width: 400px;
}

.config-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
}

.color-principal-campo {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 400px;
}

.admin-form .color-principal-campo input[type="color"] {
    width: 40px;
    height: 40px;
    padding: 3px;
    border: 1px solid #ccd2d8;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
}

.admin-form .color-principal-campo input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.admin-form .color-principal-campo input[type="color"]::-webkit-color-swatch {
    border: 0;
    border-radius: 5px;
}

.admin-form .color-principal-campo input[type="text"] {
    flex: 1;
    min-width: 0;
    text-transform: uppercase;
}

.config-dato-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 11px;
}

.config-dato-valor {
    margin: 0;
    color: #69727d;
    font-size: 12px;
}

.table-container {
    overflow: visible;
}

.panel > .table-container:first-child table {
    margin-top: 0;
}

.table-actions {
    width: 1%;
    text-align: right;
    white-space: nowrap;
    vertical-align: middle;
}

.table-actions .button-table + .button-table {
    margin-left: 5px;
}

.table-actions .icon-action + .button-table {
    margin-left: 6px;
}

.table-actions .icon-action + .row-menu {
    margin-left: 6px;
}

.cliente-redes {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.cliente-redes .icon-action {
    margin-left: 0;
    width: 22px;
    height: 22px;
    border-radius: 0;
    background: transparent;
}

.cliente-redes .icon-action:hover,
.cliente-redes .icon-action:focus-visible {
    background: transparent;
    opacity: 0.75;
}

.icon-action {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin-left: 2px;
    border-radius: 6px;
    color: var(--color-principal);
    text-decoration: none;
    vertical-align: middle;
}

.icon-action:hover,
.icon-action:focus-visible {
    background: #e8eef1;
    outline: none;
}

button.icon-action {
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    font: inherit;
}

.icon-action::after,
.icon-action::before {
    position: absolute;
    left: 50%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease, transform 0.12s ease;
    z-index: 30;
}

.icon-action::after {
    content: attr(data-tooltip);
    bottom: calc(100% + 8px);
    transform: translateX(-50%) translateY(4px);
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--color-principal);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.icon-action::before {
    content: "";
    bottom: calc(100% + 4px);
    transform: translateX(-50%) translateY(4px);
    border: 4px solid transparent;
    border-top-color: var(--color-principal);
}

.icon-action:hover::after,
.icon-action:hover::before,
.icon-action:focus-visible::after,
.icon-action:focus-visible::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.row-menu {
    display: inline-block;
    position: relative;
    margin-left: 2px;
    vertical-align: middle;
}

.row-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--color-principal);
    cursor: pointer;
    vertical-align: middle;
}

.row-menu-toggle:hover,
.row-menu.is-open .row-menu-toggle {
    background: #e8eef1;
}

.row-menu-list {
    display: none;
    position: fixed;
    z-index: 40;
    min-width: 148px;
    padding: 4px;
    background: var(--color-superficie);
    border-radius: 8px;
    box-shadow: var(--sombra-card);
}

.row-menu.is-open .row-menu-list {
    display: block;
}

.row-menu-item {
    display: block;
    width: 100%;
    padding: 7px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--color-texto);
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

a.row-menu-item {
    text-decoration: none;
    box-sizing: border-box;
}

.row-menu-item:hover:not(:disabled) {
    background: var(--color-hover);
}

.row-menu-item:disabled {
    color: #b0b7be;
    cursor: not-allowed;
}

.button-table {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--color-principal);
    color: #ffffff;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
}

.button-table:hover {
    background: var(--color-principal-hover);
}

button.button-table {
    border: 0;
    cursor: pointer;
    font-family: inherit;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 12px;
}

th,
td {
    text-align: left;
    padding: 7px 8px;
    border-bottom: 1px solid var(--color-borde);
}

th {
    font-size: 10px;
    font-weight: 600;
    color: #69727d;
}

.status-active,
.status-inactive {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 10px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 7px 2px 5px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
}

.status-pill::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-pill-active {
    background: #e4f6ea;
    color: #2f9e4f;
}

.status-pill-active::before {
    background: #2f9e4f;
}

.status-pill-inactive {
    background: #fdecec;
    color: #d64545;
}

.status-pill-inactive::before {
    background: #d64545;
}

.status-active {
    background: #def2e4;
}

.status-inactive {
    background: #eeeeee;
}

.status-disabled {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 10px;
    background: #f7e4d4;
}

.page-heading {
    margin-bottom: 14px;
}

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

.page-heading h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--color-principal);
}

.page-heading-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin: 4px 0 0;
    color: #69727d;
    font-size: 11px;
}

.meta-separator {
    color: #b0b7be;
}

.back-link {
    color: var(--color-principal);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.back-link:hover {
    text-decoration: underline;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 4px;
}

.module-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    border: 1px solid #e5e8eb;
    border-radius: 9px;
    background: #ffffff;
}

.module-card-text h3 {
    margin: 0 0 3px;
    font-size: 12px;
    font-weight: 600;
}

.module-card-text p {
    margin: 0;
    font-size: 11px;
    line-height: 1.4;
    color: #69727d;
}

.switch {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    inset: 0;
    background: #d5dbe0;
    border-radius: 18px;
    cursor: pointer;
}

.switch-slider::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    transition: transform 0.15s ease;
}

.switch input:checked + .switch-slider {
    background: var(--color-principal);
}

.switch input:checked + .switch-slider::before {
    transform: translateX(14px);
}

.switch input:focus-visible + .switch-slider {
    outline: 2px solid var(--color-principal);
    outline-offset: 2px;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 16px;
}

.admin-actions-split {
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.admin-actions-main {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.button-icon-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: #fdecec;
    color: #d64545;
    cursor: pointer;
}

.button-icon-danger:hover {
    background: #f8d4d4;
}

.admin-actions .button-primary {
    width: auto;
    height: 32px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    box-sizing: border-box;
}

.button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 12px;
    border: 1px solid #ccd2d8;
    border-radius: 8px;
    background: #ffffff;
    color: var(--color-texto);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-sizing: border-box;
}

.button-secondary:hover {
    background: #f4f6f8;
}

a.button-primary {
    width: auto;
    height: 32px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    white-space: nowrap;
}

.org-subnav {
    display: flex;
    gap: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--color-borde);
}

.org-subnav-link {
    padding: 6px 0;
    margin-bottom: -1px;
    border-bottom: 2px solid transparent;
    color: #69727d;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
}

.org-subnav-link:hover,
.org-subnav-link.is-active {
    color: var(--color-principal);
}

.org-subnav-link.is-active {
    border-bottom-color: var(--color-principal);
}

.panel-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.cell-primary {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.cell-primary small {
    color: #69727d;
    font-size: 11px;
    font-weight: 400;
}

.stock-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.stock-pill-neutro,
.stock-pill.stock-pill-neutro {
    background: #eef1f4;
    color: #3d454c !important;
}

.stock-pill-rojo,
.stock-pill.stock-pill-rojo {
    background: #fdecec;
    color: #b42318 !important;
}

.stock-pill-amarillo,
.stock-pill.stock-pill-amarillo {
    background: #fff4d6;
    color: #a16207 !important;
}

.stock-pill-verde,
.stock-pill.stock-pill-verde {
    background: #e4f6ea;
    color: #15803d !important;
}

.stock-pill-vencimiento {
    position: relative;
    cursor: default;
}

.stock-pill-vencimiento::after,
.stock-pill-vencimiento::before {
    position: absolute;
    left: 50%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease, transform 0.12s ease;
    z-index: 40;
}

.stock-pill-vencimiento::after {
    content: attr(data-tooltip);
    bottom: calc(100% + 8px);
    transform: translateX(-50%) translateY(4px);
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--color-principal);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.stock-pill-vencimiento::before {
    content: "";
    bottom: calc(100% + 4px);
    transform: translateX(-50%) translateY(4px);
    border: 4px solid transparent;
    border-top-color: var(--color-principal);
}

.stock-pill-vencimiento:hover::after,
.stock-pill-vencimiento:hover::before,
.stock-pill-vencimiento:focus-visible::after,
.stock-pill-vencimiento:focus-visible::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.badge-role {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 10px;
    background: #e8eef1;
    color: var(--color-principal);
}

.admin-form {
    max-width: 400px;
}

.admin-form .form-group input,
.admin-form .form-group select,
.admin-form .form-group textarea {
    width: 100%;
    padding: 7px 9px;
    border: 1px solid #ccd2d8;
    border-radius: 6px;
    font-size: 12px;
    background: #ffffff;
}

.admin-form .form-group input:focus,
.admin-form .form-group select:focus,
.admin-form .form-group textarea:focus {
    outline: 2px solid var(--color-principal);
    outline-offset: 1px;
    border-color: var(--color-principal);
}

.select-menu {
    position: relative;
    display: block;
    width: 100%;
}

.select-menu > select {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    pointer-events: none;
}

.select-menu-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    background: #ffffff;
    color: var(--color-texto);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
}

.select-menu-trigger:hover,
.select-menu.is-open .select-menu-trigger {
    border-color: #ccd2d8;
    background: #f8fafb;
}

.select-menu-trigger:focus {
    outline: 2px solid var(--color-principal);
    outline-offset: 1px;
    border-color: var(--color-principal);
}

.select-menu-trigger:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: #f4f6f8;
}

.select-menu-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.select-menu-chevron {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    color: #69727d;
    transition: transform 0.15s ease;
}

.select-menu.is-open .select-menu-chevron {
    transform: rotate(180deg);
}

.select-menu-list {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 50;
    max-height: 220px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    margin: 0;
    padding: 4px;
    list-style: none;
    background: var(--color-superficie);
    border-radius: 8px;
    box-shadow: var(--sombra-card);
}

.select-menu.is-open .select-menu-list {
    display: block;
}

.select-menu-option {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--color-texto);
    font-size: 12px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
}

.select-menu-option:hover,
.select-menu-option:focus-visible {
    outline: none;
    background: #f4f6f8;
}

.select-menu-option.is-selected {
    background: #e8eef1;
    color: var(--color-principal);
    font-weight: 600;
}

.select-menu-option:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.panel-toolbar-actions .select-menu,
.actividad-historial-filtro .select-menu {
    width: auto;
    min-width: 180px;
    display: inline-block;
    vertical-align: middle;
}

.form-hint {
    margin: 4px 0 0;
    font-size: 10px;
    color: #69727d;
    line-height: 1.4;
}

.admin-form-static {
    margin-bottom: 14px;
}

.admin-form-static strong {
    display: block;
    font-size: 13px;
}

.admin-form-static small {
    display: block;
    margin-top: 2px;
    color: #69727d;
    font-size: 11px;
}

.panel-toolbar-end {
    justify-content: flex-end;
}

/* Botón primary en toolbar: mismo tamaño que búsqueda de inventario */
.panel-toolbar .button-primary,
.panel-toolbar-actions .button-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: 32px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    box-sizing: border-box;
    white-space: nowrap;
}

.button-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--color-principal);
    border-radius: 8px;
    background: #ffffff;
    color: var(--color-principal);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-sizing: border-box;
}

.button-outline:hover {
    background: #f3f6f8;
}

.drawer-overlay[data-drawer="usuario-existente"] .drawer-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.drawer-overlay[data-drawer="usuario-existente"] .drawer-title,
.drawer-overlay[data-drawer="usuario-existente"] .drawer-lead,
.drawer-overlay[data-drawer="usuario-existente"] .alert-error {
    flex-shrink: 0;
}

.drawer-overlay[data-drawer="usuario-existente"] .admin-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.usuario-existente-search {
    width: 100%;
    margin: 0 0 10px;
    padding: 8px 10px;
    border: 1px solid #ccd2d8;
    border-radius: 7px;
    background: #ffffff;
    color: var(--color-texto);
    font-size: 12px;
    box-sizing: border-box;
}

.usuario-existente-search:focus {
    outline: 2px solid var(--color-principal);
    outline-offset: 1px;
    border-color: var(--color-principal);
}

.usuario-existente-scroll {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    margin: 0;
    padding-right: 2px;
}

.usuario-existente-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    background: #ffffff;
    color: var(--color-texto);
    text-align: left;
    cursor: pointer;
}

.usuario-existente-item:hover {
    border-color: #c5ced6;
    background: #f8fafb;
}

.usuario-existente-item.is-selected {
    border-color: var(--color-principal);
    background: var(--color-principal);
    color: #ffffff;
}

.usuario-existente-item.is-selected:hover {
    border-color: var(--color-principal);
    background: var(--color-principal);
    color: #ffffff;
}

.usuario-existente-item strong {
    font-size: 12px;
    font-weight: 600;
}

.usuario-existente-item small {
    color: #69727d;
    font-size: 11px;
}

.usuario-existente-item.is-selected small {
    color: rgba(255, 255, 255, 0.82);
}

.usuario-existente-hint {
    margin: 4px 2px 0;
    color: #69727d;
    font-size: 11px;
    line-height: 1.4;
}

.drawer-overlay[data-drawer="usuario-existente"] .admin-actions {
    flex-shrink: 0;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e1e5e9;
}

.drawer-lead {
    margin: 0 0 12px;
    color: #69727d;
    font-size: 12px;
}

.drawer-empty {
    margin: 8px 0 16px;
    color: #69727d;
    font-size: 12px;
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 60;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(21, 45, 60, 0.48);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-overlay.is-open {
    display: flex;
}

body.modal-open {
    overflow: hidden;
}

.modal-card {
    width: 100%;
    max-width: 380px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(21, 45, 60, 0.22);
    padding: 18px;
}

.modal-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.modal-card-header h2 {
    margin: 0;
    font-size: 15px;
    color: var(--color-principal);
}

.modal-close {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #69727d;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.modal-close:hover {
    background: #f4f6f8;
    color: var(--color-principal);
}

.modal-card .admin-form {
    max-width: none;
}

.modal-card .admin-actions {
    margin-top: 4px;
}

.venta-eliminar-card {
    max-width: 440px;
}

.venta-eliminar-card h2 {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 700;
    color: var(--color-principal);
}

.venta-eliminar-card p {
    margin: 0 0 14px;
    font-size: 12px;
    color: #69727d;
}

.venta-eliminar-card .form-group {
    margin-bottom: 0;
}

.venta-eliminar-card input[type="text"] {
    width: 100%;
}

.ajuste-precio-card {
    max-width: 420px;
}

.ajuste-precio-producto {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #69727d;
}

.ajuste-precio-cambio {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin: 8px 0 14px;
}

.ajuste-precio-actual,
.ajuste-precio-nuevo {
    flex: 1;
    min-width: 0;
}

.ajuste-precio-etiqueta {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 500;
    color: #69727d;
}

.ajuste-precio-actual strong {
    display: flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    background: #f8fafb;
    color: var(--color-texto);
    font-size: 13px;
    font-weight: 600;
    box-sizing: border-box;
}

.ajuste-precio-flecha {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    height: 34px;
    margin-bottom: 0;
    color: #69727d;
}

.ajuste-precio-nuevo input {
    width: 100%;
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    background: #ffffff;
    font-size: 13px;
    box-sizing: border-box;
}

.ajuste-precio-nuevo input:focus {
    outline: 2px solid var(--color-principal);
    outline-offset: 1px;
    border-color: var(--color-principal);
}

.ajuste-precio-card .form-hint {
    margin-top: 0;
    margin-bottom: 14px;
}

.drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    justify-content: flex-end;
    background: rgba(21, 45, 60, 0);
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.32s ease,
        visibility 0.32s ease,
        background 0.32s ease,
        backdrop-filter 0.32s ease,
        -webkit-backdrop-filter 0.32s ease;
}

.drawer-overlay.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    background: rgba(21, 45, 60, 0.48);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.drawer-panel {
    width: 100%;
    max-width: 400px;
    height: 100%;
    overflow-y: auto;
    background: #ffffff;
    box-shadow: -12px 0 40px rgba(21, 45, 60, 0.2);
    padding: 28px 24px 24px;
    transform: translateX(100%);
    transition: transform 0.32s ease;
}

.drawer-overlay.is-open .drawer-panel {
    transform: translateX(0);
}

.compra-form {
    max-width: 520px;
}

.drawer-overlay[data-drawer="compra"] .drawer-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.drawer-overlay[data-drawer="compra"] .drawer-title,
.drawer-overlay[data-drawer="compra"] .alert-error {
    flex-shrink: 0;
}

.drawer-overlay[data-drawer="compra"] .compra-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    max-width: none;
}

.drawer-overlay[data-drawer="compra"] .compra-form > .form-group,
.drawer-overlay[data-drawer="compra"] .compra-subtotal,
.drawer-overlay[data-drawer="compra"] .admin-actions {
    flex-shrink: 0;
}

.compras-row td {
    padding: 0;
}

.compras-row a,
.compras-row .compras-cell {
    display: block;
    padding: 7px 8px;
    color: inherit;
    text-decoration: none;
}

.compras-codigo {
    font-weight: 600;
    color: var(--color-principal);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.compras-codigo a,
.compras-codigo .compras-cell {
    color: var(--color-principal);
}

.compras-row:hover {
    background: #f4f7f9;
}

.compras-row td.table-actions {
    padding: 7px 8px;
    vertical-align: middle;
}

.compras-row .row-menu-item {
    padding: 7px 10px;
}

.ventas-row td {
    vertical-align: top;
}

.ventas-row td.table-actions {
    padding: 7px 8px;
    vertical-align: middle;
}

.ventas-row .row-menu-item {
    padding: 7px 10px;
}

.ventas-productos {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ventas-productos > span {
    display: block;
    line-height: 1.35;
}

.ventas-producto-unidades {
    margin-left: 4px;
    color: var(--color-principal);
    font-size: 10px;
    font-weight: 800;
}

.compra-detalle {
    display: grid;
    gap: 12px;
}

.compra-detalle-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

.compra-detalle-nombre {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--color-principal);
}

.compra-detalle-codigo {
    margin: 4px 0 0;
    color: #69727d;
    font-size: 12px;
}

.compra-detalle-fila {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
}

.compra-detalle-fila > span:not(.compra-detalle-valor) {
    color: #69727d;
    font-size: 12px;
}

.compra-detalle-fila strong {
    font-size: 13px;
    color: var(--color-principal);
}

.compra-detalle-valor {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.compra-proveedor-field {
    display: flex;
    align-items: center;
    gap: 6px;
}

.compra-proveedor-field .proveedor-picker {
    flex: 1;
    min-width: 0;
}

.proveedor-picker {
    position: relative;
}

.proveedor-picker input {
    width: 100%;
    box-sizing: border-box;
}

.drawer-overlay[data-drawer="proveedor"] {
    z-index: 55;
}

.compra-detalle-subtotal {
    justify-content: flex-end;
}

.producto-stock-titulo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.producto-stock-titulo .product-thumb {
    width: 56px;
    height: 56px;
}

.compra-detalle .panel > .table-container {
    margin-top: 8px;
}

.precio-historial-lista {
    list-style: none;
    margin: 0;
    padding: 0;
}

.precio-historial-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 2px;
    border-bottom: 1px solid var(--color-borde);
}

.precio-historial-item:last-child {
    border-bottom: 0;
}

.precio-historial-fecha {
    color: #69727d;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.precio-historial-valores {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-size: 12px;
}

.precio-historial-anterior {
    color: #8a939c;
    text-decoration: line-through;
}

.precio-historial-flecha {
    color: #8a939c;
}

.precio-historial-nuevo {
    color: var(--color-texto);
    font-weight: 600;
}

.precio-historial-grafico {
    position: relative;
    width: 100%;
    height: 260px;
    margin-top: 4px;
}

.precio-historial-grafico canvas {
    width: 100% !important;
    height: 100% !important;
}

.product-picker {
    position: relative;
}

.product-picker-field {
    display: flex;
    align-items: center;
}

.product-picker-field:not(.has-pill) {
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.product-picker-field.has-pill {
    min-height: 34px;
    padding: 4px 8px;
    border: 1px solid #ccd2d8;
    border-radius: 6px;
    background: #ffffff;
}

.product-picker-field.has-pill:focus-within {
    outline: 2px solid var(--color-principal);
    outline-offset: 1px;
    border-color: var(--color-principal);
}

.product-picker-input {
    width: 100%;
    font-size: 12px;
}

.admin-form .form-group .product-picker-field:not(.has-pill) .product-picker-input,
.admin-form .form-group .product-picker-field:not(.has-pill) .product-picker-input:focus {
    width: 100%;
    padding: 7px 9px;
    border: 1px solid #ccd2d8;
    border-radius: 6px;
    background: #ffffff;
    font-size: 12px;
}

.admin-form .form-group .product-picker-field:not(.has-pill) .product-picker-input:focus {
    outline: 2px solid var(--color-principal);
    outline-offset: 1px;
    border-color: var(--color-principal);
}

.admin-form .form-group .product-picker-field.has-pill .product-picker-input,
.admin-form .form-group .product-picker-field.has-pill .product-picker-input:focus {
    width: 100%;
    padding: 3px 1px;
    border: 0;
    border-radius: 0;
    background: transparent;
    outline: none;
    box-shadow: none;
}

.product-picker-field.has-pill .product-picker-input {
    display: none;
}

.product-pill[hidden] {
    display: none !important;
}

.product-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 3px 6px 3px 10px;
    border-radius: 999px;
    background: #e8eef1;
    color: var(--color-principal);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

.product-pill span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-pill-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #69727d;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.product-pill-clear:hover {
    background: #d7e0e6;
    color: var(--color-principal);
}

.product-picker-results {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    z-index: 20;
    margin: 0;
    padding: 4px;
    list-style: none;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--color-borde);
    border-radius: 8px;
    background: var(--color-superficie);
    box-shadow: var(--sombra-card);
}

.product-picker-results button {
    display: flex;
    flex-direction: column;
    gap: 1px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--color-texto);
    text-align: left;
    font-size: 12px;
    cursor: pointer;
}

.product-picker-results button:hover,
.product-picker-results button:focus-visible {
    background: #f4f6f8;
    outline: none;
}

.product-picker-results small {
    color: #69727d;
    font-size: 10px;
}

.product-picker-add {
    font-weight: 600;
    color: var(--color-principal);
}

.compra-subtotal,
.venta-subtotal {
    margin: 0 0 16px;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-principal);
}

.compra-lista {
    flex: 1;
    min-height: 140px;
    overflow-y: auto;
    margin: 0 0 16px;
    border: 1px solid #e4e8ec;
    border-radius: 8px;
    background: #f8fafb;
}

.compra-lista .venta-lineas {
    padding: 0 6px;
}

.compra-lista .venta-lineas:empty {
    display: none;
}

.compra-agregar-producto {
    position: sticky;
    top: 0;
    z-index: 1;
    width: calc(100% - 12px);
    margin: 6px;
    padding: 10px 12px;
    border: 1px dashed #ccd2d8;
    border-radius: 6px;
    background: #ffffff;
    color: var(--color-principal);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.compra-agregar-producto:hover {
    background: #eef4f7;
    border-color: var(--color-principal);
}

.compra-lista .venta-linea-monto {
    color: var(--color-principal);
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.compra-item-card {
    max-width: 440px;
    overflow: visible;
}

.compra-item-card h2 {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 700;
    color: var(--color-principal);
}

.drawer-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 92px;
    height: 92px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: #e8eef1;
    color: var(--color-principal);
}

.drawer-avatar svg {
    width: 42px;
    height: 42px;
}

.drawer-username {
    margin-bottom: 22px;
}

.drawer-username input {
    width: 100%;
    padding: 6px 4px 10px;
    border: 0;
    border-bottom: 1px solid var(--color-borde);
    border-radius: 0;
    background: transparent;
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    color: var(--color-principal);
}

.drawer-username input::placeholder {
    color: #9aa3ab;
    font-weight: 500;
}

.drawer-username input:focus {
    outline: none;
    border-bottom-color: var(--color-principal);
}

.drawer-title {
    margin: 0 0 22px;
    padding: 6px 4px 10px;
    border-bottom: 1px solid var(--color-borde);
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    color: var(--color-principal);
    line-height: 1.25;
}

.drawer-subtitle {
    margin: -12px 0 18px;
    color: var(--color-muted);
    font-size: 13px;
    font-weight: 500;
    text-align: center;
}

.drawer-subtitle:empty {
    display: none;
}

.drawer-overlay[data-drawer="ajuste"] .drawer-panel {
    max-width: 460px;
}

.drawer-overlay[data-drawer="ajuste"] .admin-form {
    max-width: none;
}

.ajuste-lotes {
    display: grid;
    gap: 10px;
}

.ajuste-lotes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.ajuste-lotes-header label {
    margin: 0;
}

.ajuste-lote-agregar {
    padding: 4px 10px;
    font-size: 11px;
}

.ajuste-lote-fila {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #e3e8ee;
    border-radius: 12px;
    background: #ffffff;
}

.ajuste-lote-campos {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.ajuste-lote-campos .select-menu {
    width: 100%;
}

.ajuste-lote-vencimiento {
    width: 100%;
    max-width: 100%;
}

.ajuste-lote-producto {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.ajuste-lote-thumb {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.ajuste-lote-thumb svg {
    width: 18px;
    height: 18px;
}

.ajuste-lote-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

.ajuste-lote-info strong {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-principal);
    line-height: 1.25;
}

.ajuste-lote-info small {
    color: #69727d;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.35;
}

.ajuste-lote-cantidad {
    width: 68px !important;
    min-width: 68px;
    flex-shrink: 0;
    text-align: right;
}

.ajuste-lote-quitar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-top: 2px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #8a939c;
    cursor: pointer;
    flex-shrink: 0;
}

.ajuste-lote-quitar:hover {
    background: #f1f4f6;
    color: #d64545;
}

.ajuste-lotes-vacio {
    margin: 0 0 10px;
    padding: 10px 12px;
    border: 1px dashed #d8dee5;
    border-radius: 10px;
    background: #fbfcfd;
    color: #69727d;
    font-size: 12px;
}

.ajuste-contador {
    margin: 6px 0 0;
    color: #69727d;
    font-size: 11px;
    font-weight: 500;
    text-align: right;
}

.ajuste-contador.is-limit {
    color: #b42318;
}

.drawer-panel .admin-form {
    max-width: none;
}

.drawer-panel .alert-error {
    margin-bottom: 14px;
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-row .form-group {
    flex: 1;
    min-width: 0;
}

.form-row-spacer {
    flex: 1;
    min-width: 0;
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 36px;
}

.password-toggle {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: #69727d;
    cursor: pointer;
}

.password-toggle:hover {
    color: var(--color-principal);
}

.password-toggle-hide {
    display: none;
}

.password-toggle.is-visible .password-toggle-show {
    display: none;
}

.password-toggle.is-visible .password-toggle-hide {
    display: block;
}

.panel-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.panel-exportar {
    position: relative;
    display: flex;
    justify-content: flex-end;
    margin: 2px 0 10px;
}

.button-exportar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--color-borde);
    border-radius: 8px;
    background: var(--color-superficie-2);
    color: var(--color-texto);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    box-sizing: border-box;
}

.button-exportar:hover,
.panel-exportar.is-open .button-exportar {
    border-color: var(--color-borde);
    background: var(--color-superficie);
}

.button-exportar-chevron {
    flex-shrink: 0;
    color: var(--color-muted);
    transition: transform 0.15s ease;
}

.panel-exportar.is-open .button-exportar-chevron {
    transform: rotate(180deg);
}

.export-menu-list {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 30;
    min-width: 148px;
    padding: 4px;
    background: var(--color-superficie);
    border: 1px solid var(--color-borde);
    border-radius: 8px;
    box-shadow: var(--sombra-card);
}

.export-menu-list[hidden] {
    display: none;
}

.export-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--color-texto);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    box-sizing: border-box;
}

.export-menu-item:hover,
.export-menu-item:focus-visible {
    outline: none;
    background: var(--color-superficie-2);
}

.export-menu-item svg {
    flex-shrink: 0;
    color: var(--color-muted);
}

.lista-busqueda {
    width: 220px;
    max-width: 100%;
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--color-borde);
    border-radius: 8px;
    background: var(--color-superficie-2);
    color: var(--color-texto);
    font-size: 12px;
    box-sizing: border-box;
}

.lista-busqueda:focus {
    outline: 2px solid var(--color-principal);
    outline-offset: 1px;
    border-color: var(--color-principal);
}

.lista-busqueda-vacia {
    margin: 8px 0 0;
    color: #69727d;
    font-size: 12px;
}

.inventario-filtro-pills {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 2px;
    border: 1px solid var(--color-borde);
    border-radius: 8px;
    background: var(--color-superficie-2);
    box-sizing: border-box;
}

.inventario-filtro-pill {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--color-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

.inventario-filtro-pill:hover,
.inventario-filtro-pill.is-active {
    background: var(--color-superficie);
    color: var(--color-principal);
}

.view-toggle {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 2px;
    border: 1px solid var(--color-borde);
    border-radius: 8px;
    background: var(--color-superficie-2);
    box-sizing: border-box;
}

.view-toggle-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--color-muted);
    cursor: pointer;
}

.view-toggle-button:hover,
.view-toggle-button.is-active {
    background: var(--color-superficie);
    color: var(--color-principal);
}

.product-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #e8eef1;
    color: var(--color-principal);
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.inventario-grid {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

html.inventario-cuadros .inventario-lista {
    display: none;
}

html.inventario-cuadros .inventario-grid {
    display: grid;
}

[data-lista-item][hidden],
[data-lista-resultados][hidden] {
    display: none !important;
}

.inventario-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 0;
    border: 1px solid var(--color-borde);
    border-radius: 10px;
    background: var(--color-superficie);
}

.inventario-card:hover {
    border-color: color-mix(in srgb, var(--color-principal) 35%, var(--color-borde));
    box-shadow: var(--sombra-card);
}

.inventario-card .row-menu {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    margin: 0;
}

.inventario-card .row-menu-toggle {
    background: color-mix(in srgb, var(--color-superficie) 92%, transparent);
    box-shadow: 0 1px 4px rgba(21, 45, 60, 0.14);
}

.inventario-card-open {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    cursor: pointer;
    color: var(--color-texto);
}

.inventario-card-open:focus {
    outline: none;
}

.inventario-card-open:focus-visible {
    outline: 2px solid var(--color-principal);
    outline-offset: 2px;
    border-radius: 8px;
}

.inventario-card-photo .product-thumb {
    width: 100%;
    height: 120px;
    border-radius: 8px;
}

.inventario-card-photo .product-thumb svg {
    width: 32px;
    height: 32px;
}

.inventario-card-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.inventario-card h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-texto);
}

.inventario-card-brand {
    margin: 0;
    color: var(--color-muted);
    font-size: 11px;
}

.inventario-card-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-texto);
}

.precio-ajustar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #69727d;
    cursor: pointer;
}

.precio-ajustar-btn svg {
    display: block;
    width: 12px;
    height: 12px;
}

.precio-ajustar-btn:hover {
    background: #f4f6f8;
    color: var(--color-principal);
}

.precio-ajustar-btn[hidden] {
    display: none !important;
}

.precio-fijo-campo {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
}

.precio-fijo-campo strong {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-texto);
}

.producto-modal-precio-fila {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.producto-modal-card {
    position: relative;
    max-width: 640px;
    padding: 0;
    overflow: hidden;
}

.producto-modal-card .modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
    background: rgba(255, 255, 255, 0.92);
}

.producto-modal-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 280px;
}

.producto-modal-photo {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    overflow: hidden;
    background: #f4f6f8;
    color: var(--color-principal);
}

.producto-modal-photo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.producto-modal-placeholder svg {
    width: 48px;
    height: 48px;
}

.producto-modal-info {
    padding: 22px 24px 22px 20px;
}

.producto-modal-info h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--color-principal);
}

.producto-modal-brand {
    margin: 2px 0 0;
    color: #69727d;
    font-size: 13px;
}

.producto-modal-fields {
    display: grid;
    gap: 12px;
    margin: 18px 0 0;
}

.producto-modal-fields div {
    margin: 0;
}

.producto-modal-fields dt {
    margin: 0;
    color: #69727d;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.producto-modal-fields dd {
    margin: 2px 0 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-principal);
}

.producto-modal-info .button-outline {
    margin-top: 16px;
}

.producto-form {
    max-width: none;
}

.producto-form-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr;
    column-gap: 16px;
    row-gap: 5px;
    align-items: stretch;
    margin-bottom: 4px;
}

.producto-form-label {
    grid-column: 1;
    grid-row: 1;
    display: block;
    font-weight: 600;
    font-size: 11px;
}

.producto-form-fields {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
}

.producto-form-photo {
    grid-column: 2;
    grid-row: 2;
    position: relative;
    min-width: 0;
    min-height: 0;
}

.producto-form-fields .form-group:last-child,
.producto-form-fields .form-row:last-child {
    margin-bottom: 0;
}

.producto-roles {
    margin: 12px 0 0;
    padding: 0;
    border: 0;
}

.producto-roles legend {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 11px;
    color: inherit;
}

.producto-roles-filas {
    display: grid;
    grid-template-columns: max-content auto;
    justify-content: start;
    column-gap: 8px;
    row-gap: 8px;
    align-items: center;
}

.producto-roles .producto-rol {
    display: grid;
    grid-template-columns: subgrid;
    grid-column: 1 / -1;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-principal);
    cursor: pointer;
}

.admin-form .producto-roles .switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.producto-roles-hint {
    margin: 6px 0 0;
    font-size: 11px;
    color: #69727d;
}

.producto-rol-nota {
    margin: 2px 0 0;
    font-size: 11px;
    font-weight: 500;
    color: var(--color-muted);
}

.producto-form-fields .form-row:last-child .form-group {
    margin-bottom: 0;
}

.product-photo-field {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    cursor: pointer;
}

.product-photo-preview {
    position: relative;
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0;
    overflow: hidden;
    border: 1px dashed #ccd2d8;
    border-radius: 10px;
    background: #f8fafb;
    color: var(--color-principal);
}

.product-photo-preview img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.product-photo-preview svg {
    width: 42px;
    height: 42px;
}

.product-photo-field .form-hint {
    position: absolute;
    right: 10px;
    bottom: 10px;
    left: 10px;
    margin: 0;
    padding: 4px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.88);
    text-align: center;
}

.admin-form .form-group input.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    outline: none;
}

@media (max-width: 640px) {
    .page-heading-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .panel-toolbar {
        flex-direction: column;
    }

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

    .lista-busqueda {
        width: 100%;
        max-width: none;
        flex: 1;
    }

    .producto-form-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    .producto-form-label,
    .producto-form-fields,
    .producto-form-photo {
        grid-column: 1;
    }

    .producto-form-label {
        grid-row: 1;
    }

    .producto-form-fields {
        grid-row: 2;
    }

    .producto-form-photo {
        grid-row: 3;
        min-height: 220px;
    }

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

    .producto-modal-photo {
        min-height: 200px;
        max-height: 240px;
    }
}

.venta-picker {
    position: relative;
}

.venta-picker-results {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    z-index: 20;
    margin: 0;
    padding: 4px;
    list-style: none;
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid var(--color-borde);
    border-radius: 8px;
    background: var(--color-superficie);
    box-shadow: var(--sombra-card);
}

.venta-picker-results[hidden] {
    display: none;
}

.venta-picker-result {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--color-texto);
    text-align: left;
    cursor: pointer;
}

.venta-picker-result:hover,
.venta-picker-result:focus-visible {
    background: #f4f6f8;
    outline: none;
}

.venta-picker-result .product-thumb {
    width: 40px;
    height: 40px;
}

.venta-picker-result-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.venta-picker-result-text strong {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-principal);
}

.venta-picker-result-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    color: #69727d;
    font-size: 10px;
    font-weight: 500;
}

.venta-picker-stock {
    flex: 1;
    min-width: 0;
    line-height: 1.35;
    white-space: normal;
}

.venta-picker-vto {
    color: #69727d;
    font-weight: 600;
}

.venta-picker-precio {
    flex-shrink: 0;
    white-space: nowrap;
}

.venta-picker-empty {
    margin: 0;
    padding: 10px;
    color: #69727d;
    font-size: 12px;
}

.venta-lista-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 8px 6px;
    color: var(--color-principal);
    font-size: 11px;
    font-weight: 600;
}

.venta-lista-head span:first-child {
    flex: 1;
    min-width: 0;
}

.venta-lista-head span:nth-child(2) {
    width: 72px;
    flex-shrink: 0;
    text-align: right;
}

.venta-lista-head-accion {
    width: 28px;
    flex-shrink: 0;
}

.venta-lista-vacia {
    margin: auto;
    padding: 24px 16px;
    color: #69727d;
    font-size: 12px;
    text-align: center;
}

.venta-lista-vacia[hidden] {
    display: none;
}

.venta-lineas {
    margin: 0;
    padding: 6px;
    list-style: none;
}

.venta-linea {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-bottom: 1px solid var(--color-borde);
}

.venta-linea-descuento-accion {
    padding: 6px;
    border-bottom: 0;
}

.venta-descuento-boton {
    width: 100%;
    padding: 10px 12px;
    border: 1px dashed #ccd2d8;
    border-radius: 6px;
    background: #ffffff;
    color: var(--color-principal);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.venta-descuento-boton:hover {
    background: #eef4f7;
    border-color: var(--color-principal);
}

.venta-descuento-thumb {
    color: var(--color-principal);
}

.venta-linea-producto {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.venta-linea-producto .product-thumb {
    width: 40px;
    height: 40px;
}

.venta-linea-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.venta-linea-copy strong {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-principal);
}

.venta-linea-copy small {
    color: #69727d;
    font-size: 10px;
}

.venta-linea-vencimiento {
    display: block;
}

.venta-linea-monto {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.venta-linea-monto-simbolo {
    color: var(--color-principal);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.venta-linea-cantidad-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.venta-linea-unidad {
    font-size: 11px;
    font-weight: 500;
    color: #69727d;
    white-space: nowrap;
}

.venta-linea-cantidad-wrap[data-tooltip]::after,
.venta-linea-cantidad-wrap[data-tooltip]::before {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease;
    z-index: 40;
}

.venta-linea-cantidad-wrap[data-tooltip]::after {
    content: attr(data-tooltip);
    right: calc(100% + 10px);
    top: 50%;
    width: 180px;
    padding: 6px 8px;
    border-radius: 6px;
    background: #d64545;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
    transform: translateY(-50%);
}

.venta-linea-cantidad-wrap[data-tooltip]::before {
    content: "";
    right: calc(100% + 2px);
    top: 50%;
    border: 5px solid transparent;
    border-left-color: #d64545;
    transform: translateY(-50%);
}

.venta-linea-cantidad-wrap[data-tooltip]:hover::after,
.venta-linea-cantidad-wrap[data-tooltip]:hover::before,
.venta-linea-cantidad-wrap[data-tooltip]:focus-within::after,
.venta-linea-cantidad-wrap[data-tooltip]:focus-within::before {
    opacity: 1;
}

.venta-linea-cantidad {
    width: 72px;
    flex-shrink: 0;
    padding: 7px 9px;
    border: 1px solid #ccd2d8;
    border-radius: 6px;
    background: #ffffff;
    font-size: 12px;
    text-align: right;
}

.venta-linea-cantidad.is-error {
    border-color: #d64545;
    color: #d64545;
}

.venta-linea-cantidad.is-error:focus {
    outline-color: #d64545;
    border-color: #d64545;
}

.venta-linea-acciones {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 2px;
}

.venta-linea-editar,
.venta-linea-borrar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #69727d;
    cursor: pointer;
}

.venta-linea-editar:hover {
    background: #eef4f7;
    color: var(--color-principal);
}

.venta-linea-borrar:hover {
    background: #fdecec;
    color: #d64545;
}

.venta-linea-cantidad:focus {
    outline: 2px solid var(--color-principal);
    outline-offset: 1px;
    border-color: var(--color-principal);
}

.drawer-overlay[data-drawer="venta"] .drawer-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.drawer-overlay[data-drawer="venta"] .admin-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    position: relative;
}

.drawer-overlay[data-drawer="venta"] .venta-lista {
    flex: 1;
    min-height: 140px;
    overflow-y: auto;
}

.venta-actions {
    justify-content: stretch;
}

.venta-actions .button-success,
.venta-actions .button-danger {
    flex: 1;
}

.button-success {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    background: #2f9e4f;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-sizing: border-box;
}

.button-success:hover {
    background: #278a43;
}

.button-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    background: #d64545;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-sizing: border-box;
}

.button-danger:hover {
    background: #c03939;
}

.button-danger:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.button-danger:disabled:hover {
    background: #d64545;
}

/* —— Modo noche (basado en --color-principal) —— */

/* Superficies de contenido: oscurecer */
html.theme-dark .panel,
html.theme-dark .stat-card,
html.theme-dark .drawer-panel,
html.theme-dark .modal-card,
html.theme-dark .producto-modal-card,
html.theme-dark .ajuste-precio-card,
html.theme-dark .ajuste-lote-fila,
html.theme-dark .inventario-card {
    background: var(--color-superficie);
    color: var(--color-texto);
    border-color: var(--color-borde);
}

/* Listas desplegables: sin borde */
html.theme-dark .user-menu-card,
html.theme-dark .product-picker-results,
html.theme-dark .venta-picker-results,
html.theme-dark .select-menu-list,
html.theme-dark .export-menu-list,
html.theme-dark .row-menu-list,
html.theme-dark .sidebar-org-dropdown,
html.theme-dark .unidad-picker-list {
    background: var(--color-superficie);
    color: var(--color-texto);
    border-color: transparent;
    box-shadow: var(--sombra-card);
}

html.theme-dark .row-menu-item,
html.theme-dark .select-menu-option,
html.theme-dark .export-menu-item,
html.theme-dark .sidebar-org-option,
html.theme-dark .product-picker-results button,
html.theme-dark .venta-picker-result {
    color: var(--color-texto);
    background: transparent;
}

html.theme-dark .admin-header {
    background: var(--color-superficie);
    border-bottom-color: transparent;
}

/* Controles: un tono más hundido, sin bordes */
html.theme-dark .admin-form .form-group input,
html.theme-dark .admin-form .form-group select,
html.theme-dark .admin-form .form-group textarea,
html.theme-dark .lista-busqueda,
html.theme-dark .venta-linea-cantidad,
html.theme-dark .ajuste-lote-cantidad,
html.theme-dark .ajuste-lote-vencimiento,
html.theme-dark .select-menu-trigger,
html.theme-dark .view-toggle {
    background: var(--color-superficie-2);
    border-color: transparent;
    color: var(--color-texto);
}

html.theme-dark .admin-form .form-group input:focus,
html.theme-dark .admin-form .form-group select:focus,
html.theme-dark .admin-form .form-group textarea:focus,
html.theme-dark .lista-busqueda:focus,
html.theme-dark .venta-linea-cantidad:focus,
html.theme-dark .select-menu-trigger:focus,
html.theme-dark .select-menu-trigger:hover,
html.theme-dark .select-menu.is-open .select-menu-trigger,
html.theme-dark .usuario-existente-search,
html.theme-dark .usuario-existente-search:focus,
html.theme-dark .product-picker-field.has-pill,
html.theme-dark .product-picker-field.has-pill:focus-within,
html.theme-dark .admin-form .form-group .product-picker-field:not(.has-pill) .product-picker-input,
html.theme-dark .admin-form .form-group .product-picker-field:not(.has-pill) .product-picker-input:focus {
    border-color: transparent;
}

html.theme-dark .usuario-existente-search,
html.theme-dark .admin-form .form-group .product-picker-field:not(.has-pill) .product-picker-input {
    background: var(--color-superficie-2);
    color: var(--color-texto);
}

html.theme-dark .product-picker-field.has-pill {
    background: var(--color-superficie-2);
}

html.theme-dark .theme-toggle {
    background: transparent;
    border: 0;
    color: var(--color-texto);
}

html.theme-dark .theme-toggle:hover {
    background: transparent;
    color: #ffffff;
    opacity: 0.9;
}

html.theme-dark .inventario-card {
    background: var(--color-superficie);
    border-color: var(--color-borde);
}

html.theme-dark .inventario-card:hover {
    border-color: color-mix(in srgb, white 4%, transparent);
}

html.theme-dark .inventario-card h3,
html.theme-dark .inventario-card-meta,
html.theme-dark .inventario-card-meta span,
html.theme-dark .inventario-card-open {
    color: color-mix(in srgb, var(--color-principal) 6%, white);
}

html.theme-dark .inventario-card-brand,
html.theme-dark .inventario-card .producto-rol-nota {
    color: var(--color-muted);
}

html.theme-dark .row-menu-toggle,
html.theme-dark .inventario-card .row-menu-toggle {
    background: color-mix(in srgb, var(--color-superficie) 88%, black);
    color: color-mix(in srgb, var(--color-principal) 6%, white);
}

html.theme-dark .producto-modal-info h2,
html.theme-dark .producto-modal-fields dd,
html.theme-dark .producto-modal-precio-fila,
html.theme-dark .producto-modal-precio-fila strong {
    color: color-mix(in srgb, var(--color-principal) 6%, white);
}

html.theme-dark .producto-modal-brand,
html.theme-dark .producto-modal-fields dt {
    color: var(--color-muted);
}

html.theme-dark .producto-modal-photo {
    background: #ffffff;
    color: var(--color-muted);
}

html.theme-dark .producto-modal-card .modal-close {
    background: var(--color-superficie-2);
    color: color-mix(in srgb, var(--color-principal) 6%, white);
}

html.theme-dark .inventario-filtro-pill.is-active,
html.theme-dark .inventario-filtro-pill:hover {
    background: var(--color-hover);
    color: var(--color-texto);
}

html.theme-dark .view-toggle-button.is-active,
html.theme-dark .view-toggle-button:hover {
    background: var(--color-hover);
    color: var(--color-texto);
}

html.theme-dark .button-exportar,
html.theme-dark .inventario-filtro-pills {
    background: var(--color-superficie-2);
    border-color: transparent;
    color: var(--color-texto);
}

html.theme-dark .export-menu-list {
    background: var(--color-superficie-2);
    border-color: transparent;
    color: var(--color-texto);
}

html.theme-dark .button-exportar:hover,
html.theme-dark .panel-exportar.is-open .button-exportar,
html.theme-dark .export-menu-item:hover,
html.theme-dark .export-menu-item:focus-visible {
    background: var(--color-hover);
    border-color: transparent;
}

/* Líneas divisorias sutiles (cerca del color de fondo) */
html.theme-dark th,
html.theme-dark td,
html.theme-dark .precio-historial-item,
html.theme-dark .user-menu-profile,
html.theme-dark .venta-linea,
html.theme-dark .compra-detalle-fila,
html.theme-dark .table-container,
html.theme-dark .ajuste-lote-fila,
html.theme-dark .panel-header,
html.theme-dark .drawer-subtitle,
html.theme-dark .actividad-item,
html.theme-dark .actividad-item + .actividad-item,
html.theme-dark .calendario-movimientos,
html.theme-dark .form-tabs,
html.theme-dark .tabs-nav,
html.theme-dark .config-stack > *,
html.theme-dark .producto-modal-fields > div,
html.theme-dark .org-subnav,
html.theme-dark .drawer-overlay[data-drawer="usuario-existente"] .admin-actions,
html.theme-dark .compra-lista,
html.theme-dark .venta-lista,
html.theme-dark .usuario-existente-item {
    border-color: var(--color-borde);
}

/* Modal ajustar precio: campos como búsqueda */
html.theme-dark .ajuste-precio-actual strong,
html.theme-dark .ajuste-precio-nuevo input,
html.theme-dark .ajuste-precio-nuevo input:focus {
    background: var(--color-superficie-2);
    border-color: transparent;
    color: var(--color-texto);
}

html.theme-dark .ajuste-precio-producto,
html.theme-dark .ajuste-precio-etiqueta,
html.theme-dark .ajuste-precio-flecha {
    color: var(--color-muted);
}

/* Hovers: más oscuros (nunca fondos claros de día) */
html.theme-dark .user-menu-item:hover,
html.theme-dark .select-menu-option:hover,
html.theme-dark .select-menu-option:focus-visible,
html.theme-dark .select-menu-option.is-selected,
html.theme-dark .select-menu-trigger:hover,
html.theme-dark .select-menu.is-open .select-menu-trigger,
html.theme-dark .sidebar-org-option:hover:not(:disabled),
html.theme-dark .compras-row:hover,
html.theme-dark .venta-picker-result:hover,
html.theme-dark .venta-picker-result:focus-visible,
html.theme-dark .row-menu-item:hover:not(:disabled),
html.theme-dark .icon-action:hover,
html.theme-dark .icon-action:focus-visible,
html.theme-dark .row-menu-toggle:hover,
html.theme-dark .row-menu.is-open .row-menu-toggle,
html.theme-dark a.calendario-movimiento:hover,
html.theme-dark a.actividad-item:hover,
html.theme-dark .button-secondary:hover,
html.theme-dark .button-outline:hover,
html.theme-dark .modal-close:hover,
html.theme-dark .product-picker-results button:hover,
html.theme-dark .product-picker-results button:focus-visible,
html.theme-dark .usuario-existente-item:hover,
html.theme-dark .compra-agregar-producto:hover,
html.theme-dark .precio-ajustar-btn:hover,
html.theme-dark .venta-descuento-boton:hover,
html.theme-dark .venta-linea-editar:hover,
html.theme-dark .product-pill-clear:hover {
    background: var(--color-hover);
    color: var(--color-texto);
}

html.theme-dark .ajuste-lote-quitar:hover {
    background: var(--color-hover);
    color: #f0c4c8;
}

html.theme-dark .venta-linea-borrar:hover,
html.theme-dark .button-icon-danger:hover {
    background: color-mix(in srgb, #d64545 22%, black);
    color: #f0c4c8;
}

html.theme-dark .inventario-card .row-menu-toggle:hover,
html.theme-dark .inventario-card .row-menu.is-open .row-menu-toggle {
    background: var(--color-hover);
}

html.theme-dark .cliente-redes .icon-action {
    color: color-mix(in srgb, var(--color-principal) 6%, white);
    background: transparent;
}

html.theme-dark .cliente-redes .icon-action:hover,
html.theme-dark .cliente-redes .icon-action:focus-visible {
    background: transparent;
    color: #ffffff;
    opacity: 0.85;
}

/* Tipografía de interfaz */
html.theme-dark .admin-page-title,
html.theme-dark .panel-header h2,
html.theme-dark .drawer-title,
html.theme-dark .user-menu-name,
html.theme-dark .compras-codigo,
html.theme-dark .compras-codigo a,
html.theme-dark .compras-codigo .compras-cell,
html.theme-dark .precio-historial-nuevo,
html.theme-dark strong {
    color: var(--color-texto);
}

html.theme-dark .admin-page-subtitle,
html.theme-dark .panel-header p,
html.theme-dark .drawer-subtitle,
html.theme-dark .ajuste-lote-info small,
html.theme-dark .precio-historial-fecha,
html.theme-dark .precio-historial-anterior,
html.theme-dark .user-menu-item,
html.theme-dark .form-hint {
    color: var(--color-muted);
}

html.theme-dark .button-outline,
html.theme-dark .button-secondary {
    background: var(--color-superficie-2);
    border-color: transparent;
    color: var(--color-texto);
}

html.theme-dark .button-outline:hover,
html.theme-dark .button-secondary:hover {
    border-color: transparent;
}

/* Fondos grises claros de día → tono hundido de noche */
html.theme-dark .view-toggle {
    background: var(--color-superficie-2);
    border-color: transparent;
    color: var(--color-muted);
}

html.theme-dark .ajuste-lotes-vacio,
html.theme-dark .venta-picker-empty,
html.theme-dark .product-thumb:not(:has(img)) {
    background: var(--color-superficie-2);
    border-color: var(--color-borde);
    color: var(--color-muted);
}

html.theme-dark .alert-error {
    background: color-mix(in srgb, #ff8a8a 18%, var(--color-superficie));
    color: #ffb4b4;
}

html.theme-dark .alert-success {
    background: color-mix(in srgb, #6ddea0 18%, var(--color-superficie));
    color: #9eebc0;
}

html.theme-dark .stock-pill-rojo,
html.theme-dark .stock-pill.stock-pill-rojo {
    background: color-mix(in srgb, #ff8a8a 16%, var(--color-superficie));
    color: #ffb4b4 !important;
}

html.theme-dark .stock-pill-verde,
html.theme-dark .stock-pill.stock-pill-verde {
    background: color-mix(in srgb, #6ddea0 16%, var(--color-superficie));
    color: #9eebc0 !important;
}

html.theme-dark .stock-pill-amarillo,
html.theme-dark .stock-pill.stock-pill-amarillo {
    background: color-mix(in srgb, #f0c86a 16%, var(--color-superficie));
    color: #f0d78a !important;
}

html.theme-dark .actividad-tipo-simbolo.is-rojo,
html.theme-dark .stat-card-kpi .stat-card-icon-peso-rojo,
html.theme-dark .actividad-icon.stat-card-icon-peso-rojo,
html.theme-dark .stat-card-kpi .stat-card-icon-stock-bajo {
    color: #ffb4b4;
}

html.theme-dark .actividad-tipo-simbolo.is-verde,
html.theme-dark .stat-card-kpi .stat-card-icon-peso,
html.theme-dark .actividad-icon.stat-card-icon-peso {
    color: #9eebc0;
}

html.theme-dark .stat-card-kpi .stat-card-icon-stock-bajo,
html.theme-dark .stat-card-kpi .stat-card-icon-peso-rojo,
html.theme-dark .actividad-icon.stat-card-icon-peso-rojo {
    background: color-mix(in srgb, #ff8a8a 16%, var(--color-superficie));
}

html.theme-dark .stat-card-kpi .stat-card-icon-peso,
html.theme-dark .actividad-icon.stat-card-icon-peso {
    background: color-mix(in srgb, #6ddea0 16%, var(--color-superficie));
}

/* Sidebar y botones principales: se mantienen en color principal (no se “aplanan”) */
html.theme-dark .admin-sidebar,
html.theme-dark .button-primary,
html.theme-dark .button-table,
html.theme-dark .admin-avatar {
    background: var(--color-principal);
    color: #ffffff;
}

/* Listas compra / venta / ajuste */
html.theme-dark .compra-lista,
html.theme-dark .venta-lista,
html.theme-dark .ajuste-lote-fila {
    background: var(--color-superficie-2);
    border-color: var(--color-borde);
    color: var(--color-texto);
}

html.theme-dark .compra-agregar-producto,
html.theme-dark .venta-descuento-boton {
    background: var(--color-superficie);
    border-color: transparent;
    color: color-mix(in srgb, var(--color-principal) 6%, white);
}

html.theme-dark .ajuste-lotes-vacio,
html.theme-dark .venta-lista-vacia,
html.theme-dark .venta-picker-empty {
    background: var(--color-superficie-2);
    border-color: transparent;
    color: var(--color-muted);
}

/* Subtotales y títulos de productos: claros */
html.theme-dark .compra-subtotal,
html.theme-dark .venta-subtotal,
html.theme-dark .venta-lista-head,
html.theme-dark .venta-linea-copy strong,
html.theme-dark .venta-linea-monto-simbolo,
html.theme-dark .compra-lista .venta-linea-monto,
html.theme-dark .ajuste-lote-info strong,
html.theme-dark .compra-detalle-nombre,
html.theme-dark .compra-detalle-fila strong,
html.theme-dark .compra-item-card h2,
html.theme-dark .drawer-title,
html.theme-dark .product-picker-add,
html.theme-dark .product-picker-results button,
html.theme-dark .venta-picker-result,
html.theme-dark .compras-codigo,
html.theme-dark .compras-codigo a,
html.theme-dark .compras-codigo .compras-cell {
    color: color-mix(in srgb, var(--color-principal) 6%, white);
}

html.theme-dark .venta-linea-copy small,
html.theme-dark .ajuste-lote-info small,
html.theme-dark .venta-linea-unidad,
html.theme-dark .venta-picker-vto {
    color: var(--color-muted);
}
