.select2-container .select2-selection--single {
    height: 38px !important;
    padding: 6px 12px;
    line-height: 1.42857143;
    box-sizing: border-box;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 24px;
    padding-left: 0px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
}

.loader-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--color-border);
    border-top: 4px solid var(--color-info);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loader-text {
    margin-top: 10px;
    font-size: 14px;
    color: var(--color-text-secondary);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}



#navbar-global {
    background-color: var(--color-header);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 3px 0 var(--color-box-shadow);
    border-bottom: 1px solid var(--color-border-bottom);
    padding: 0.8rem 1rem;
}

/* Separador vertical sutil */
.navbar-divider {
    width: 1px;
    height: 30px;
    background-color: var(--color-background);
    margin: 0 12px;
    display: none;
    /* Oculto en móvil */
}

@media (min-width: 576px) {
    .navbar-divider {
        display: inline-block;
        vertical-align: middle;
    }
}

/* Contenedor "Pastilla" del Perfil */
.user-profile-link {
    display: flex;
    align-items: center;
    padding: 6px 15px !important;
    border-radius: 30px;
    transition: all 0.2s ease-in-out;
    background: var(--color-background);
    border: 1px solid transparent;
    margin-left: 5px;
}

.user-profile-meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.15;
    min-height: 35px;
}

/* Efecto al pasar el mouse (Hover) */
.user-profile-link:hover,
.user-menu.show .user-profile-link {
    background-color: var(--color-background);
    border-color: var(--color-border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Círculo para el avatar/icono */
.user-avatar-circle {
    width: 30px;
    height: 30px;
    background-color: var(--color-primary);
    color: var(--color-primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 600;
    margin-right: 10px;
}

/* Flecha pequeña indicadora */
.user-chevron {
    font-size: 0.7rem;
    color: var(--color-text-secondary);
    margin-left: 8px;
}

/* Ajuste de badges de notificación */
.navbar-badge-custom {
    font-size: 10px;
    font-weight: 600;
    padding: 4px 6px;
    border-radius: 50%;
    box-shadow: 0 2px 5px var(--color-box-shadow);
    position: absolute;
    right: 0;
    top: 0;
}

.navbar-icon-link {
    color: var(--color-text-secondary);
}

.navbar-icon-link:hover {
    color: var(--color-text-secondary);
}

@media (max-width: 991.98px) {
    #navbar-global {
        flex-wrap: wrap;
        row-gap: 0.25rem;
        padding: 0.5rem 0.75rem;
    }

    #navbar-global > .navbar-nav {
        flex: 0 0 100%;
        min-width: 0;
    }

    #navbar-global > .navbar-nav:first-of-type {
        justify-content: flex-start;
    }

    #navbar-global > .navbar-nav:last-of-type {
        justify-content: flex-end;
        margin-left: 0 !important;
    }

    #navbar-global .navbar-divider {
        display: none;
    }

    #navbar-global > .navbar-nav:first-of-type .user-profile-link {
        max-width: calc((100vw - 5rem) / 2);
        overflow: hidden;
        padding-right: 0.5rem !important;
        padding-left: 0.5rem !important;
    }

    #navbar-global > .navbar-nav:first-of-type .user-profile-link > span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

.table-responsive-details .responsive-details-toggle-header,
.table-responsive-details .responsive-details-toggle-cell {
    display: none;
}

.table-responsive-details .responsive-details-row[hidden] {
    display: none !important;
}

.table-responsive-details .responsive-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.table-responsive-details .responsive-details-grid > div {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.table-responsive-details .responsive-details-actions > span {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

/* Estilo global para tablas administrativas */
.table {
    width: 100%;
    margin-bottom: 0;
    color: #1f2937;
    font-size: 11.5px;
}

.table > thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f8fafc;
    color: #475569;
    border-top: none;
    border-bottom: 1px solid #e5e7eb;
    padding: 9px 6px;
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: .25px;
    vertical-align: middle;
}

.table:not(.table-sm) > tbody td {
    padding: 7px 6px;
    vertical-align: middle;
}

.table > tbody tr {
    transition: background-color .15s ease;
}

.table > tbody tr:hover {
    background: #f8fbff;
    cursor: pointer;
}

.table.table-striped tbody tr:nth-of-type(odd) {
    background: rgba(248, 250, 252, .65);
}

.table.table-striped tbody tr:nth-of-type(odd):hover,
.table.table-hover tbody tr:hover {
    background: #edf4ff;
}

@media (max-width: 991.98px) {
    .table-responsive-details .responsive-hide-mobile {
        display: none !important;
    }

    .table-responsive-details .responsive-details-toggle-header,
    .table-responsive-details .responsive-details-toggle-cell {
        display: table-cell;
        width: 1%;
        white-space: nowrap;
    }

    .table-responsive-details .responsive-details-toggle {
        width: auto !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0.35rem 0.5rem;
        font-size: 0.8rem !important;
        white-space: nowrap;
    }

    .table-responsive-details .responsive-details-actions .btn {
        width: auto !important;
        height: auto !important;
        margin: 0 !important;
        font-size: 0.8rem !important;
    }
}

.stock-alert-dropdown {
    width: 360px;
    overflow: hidden;
}

.stock-alert-list {
    max-height: 320px;
    overflow-y: auto;
}

.stock-alert-item {
    border-bottom: 1px solid var(--color-border);
    transition: background-color .15s ease;
}

.stock-alert-item:hover {
    background-color: var(--color-background);
}

.stock-alert-item:last-child {
    border-bottom: 0;
}

.stock-product-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 10px;
    background: var(--color-background);
    color: var(--color-warning);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stock-product-name {
    font-size: 10px;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.stock-value {
    font-size: 16px;
    line-height: 16px;
}

.stock-alert-list::-webkit-scrollbar {
    width: 5px;
}

.stock-alert-list::-webkit-scrollbar-thumb {
    background: var(--color-background);
    border-radius: 10px;
}

.min-width-0 {
    min-width: 0;
}

.bg-danger-light {
    background: var(--color-danger-light);
}

.cxc-alert-item {
    transition: all 0.15s ease;
}

.cxc-alert-item:hover {
    background: var(--color-background);
}

.cxc-alert-item+.cxc-alert-item {
    border-top: 1px solid var(--color-border-top)
}

.cxcAlertCount {
    min-width: 24px;
    padding: 4px 7px;
    font-size: 11px;
}

.cxc-loading {
    padding: 30px 15px;
    text-align: center;
}

.cxc-loading .spinner-border {
    width: 1.8rem;
    height: 1.8rem;
}