:root {
    --header-height: 60px;
    --primary-color: #0d6efd;
    --accent-color: #facc15;
    --accent-light: #fde68a;
    --dark-bg: #1e1e2f;
    --sidebar-hover: rgba(255, 255, 255, 0.05);
    --border-radius: 0.375rem;
    --transition-speed: 0.2s;
}

body {
    overflow-y: hidden;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
}

.alert {
    margin: 20px;
}

.app-header {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: #fff;
}

.app-header .navbar {
    height: var(--header-height);
    min-height: var(--header-height);
    padding: 0;
}

.body-wrapper {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    border-radius: 0;
}

.body-wrapper-inner {
    flex: 1 1 auto;
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    overflow-x: hidden;
}

.body-wrapper .container-fluid,
.body-wrapper .container-sm,
.body-wrapper .container-md,
.body-wrapper .container-lg,
.body-wrapper .container-xl,
.body-wrapper .container-xxl {
    max-width: none;
    margin: 0;
    padding: 20px;
    transition: 0.2s ease-in;
}

.card.shadow {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
}

.form-control {
    height: auto;
}

.left-sidebar.bg-dark {
    background-color: var(--dark-bg);
    color: #f8f9fa;
}

.left-sidebar .sidebar-link {
    color: #cfd8dc;
    background-color: transparent;
    transition: background var(--transition-speed) ease, color var(--transition-speed) ease;
}

.left-sidebar .sidebar-link:hover,
.left-sidebar .sidebar-link:focus {
    background-color: var(--sidebar-hover);
    color: #ffffff;
}

.left-sidebar .sidebar-link.active,
.left-sidebar .sidebar-item.selected > .sidebar-link {
    background-color: var(--primary-color);
    color: #ffffff;
    font-weight: 600;
}

.left-sidebar .sidebar-link i,
.left-sidebar .sidebar-link svg {
    color: inherit;
}

.left-sidebar .nav-small-cap {
    color: #9aa0ac;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin: 1rem 0 0.5rem;
}

.left-sidebar .collapse .sidebar-item .sidebar-link {
    padding-left: 2.5rem;
}

.left-sidebar {
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

.sidebar-item.sidebar-link-title.active {
    background-color: var(--sidebar-hover);
    color: var(--accent-color) !important;
    font-weight: 600;
}

.sidebar-link:hover svg-inline--fa,
.sidebar-link:hover .menu-icon,
.sidebar-link:hover .menu-title {
    color: var(--accent-light);
    text-decoration: none;
    transition: color var(--transition-speed) ease-in-out;
}

.sidebar-link.active .menu-icon,
.sidebar-link.active .menu-title {
    color: var(--accent-color) !important;
    font-weight: 600;
}

.logo-link {
    text-decoration: none !important;
    box-shadow: none !important;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
}

.logo-link:hover .logo-text {
    color: #f0f0f0;
}

.nav-pills .nav-link.active {
    background-color: var(--accent-color);
    color: #212529;
    font-weight: 500;
}

.nav-tabs .nav-link .badge {
    line-height: 1;
    padding: 0.25em 0.5em;
    vertical-align: middle;
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 13px;
}

::-webkit-scrollbar-track {
    background-color: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: #d6dee1;
    border-radius: 13px;
    border: 3px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #a8bbbf;
}

#cart.card.border-secondary.shadow-sm {
    background-color: #f9f9f9;
    border-width: 2px;
    max-height: calc(100vh - 110px);
}

/* Custom items del navbar */
.app-header .navbar-nav > .nav-item.dropdown {
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
}

.app-header .nav-link.pointer {
    color: #fff;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    font-size: 1.2rem;
}

.app-header #notificationsIcon .fa-bell {
    font-size: 1.2rem;
}

.app-header #notificationsIcon .fa-circle {
    position: absolute;
    bottom: 20px;
    font-size: 0.6rem;
}

.fs-line {
    padding-top: 0 !important;
    padding-bottom: .25rem !important;
}

/* ****************************************************************************************************************  */
/* ============================================ PARCHES ESPECIFICOS ================================================ */
/* ****************************************************************************************************************  */

/* ================================================ Select2 ======================================================== */
.select2-container.select2-container--bootstrap4 {
    font: inherit;
}

.select2-container--bootstrap4 .select2-selection--single,
.select2-container--bootstrap4 .select2-selection--multiple {
    border: var(--bs-border-width, 1px) solid var(--bs-border-color, #ced4da) !important;
    border-radius: var(--border-radius) !important;
    background-color: var(--bs-body-bg, #fff);
    color: var(--bs-body-color, #212529);
    min-height: calc(1.5em + .75rem + 2px);
    display: flex;
    align-items: center;
    padding: .375rem .75rem;
}

.select2-container--bootstrap4 .select2-selection__rendered {
    padding: 0 !important;
    line-height: 1.5 !important;
    color: inherit !important;
}

.select2-container--bootstrap4 .select2-selection__placeholder {
    color: var(--bs-secondary-color, #6c757d);
}

.select2-container--bootstrap4 .select2-selection__arrow {
    position: absolute;
    right: .75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    pointer-events: none;
}

.select2-container--bootstrap4 .select2-selection__arrow b {
    border: 0 !important;
    width: 100%;
    height: 100%;
    display: block;
    background: center / 16px 12px no-repeat;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%236c757d' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e");
}

.select2-container--bootstrap4 .select2-selection--single:hover,
.select2-container--bootstrap4 .select2-selection--multiple:hover {
    border-color: var(--bs-secondary-border-subtle, #b3b7bb);
}

.select2-container--bootstrap4.select2-container--focus .select2-selection--single,
.select2-container--bootstrap4.select2-container--focus .select2-selection--multiple,
.select2-container--bootstrap4.select2-container--open .select2-selection--single,
.select2-container--bootstrap4.select2-container--open .select2-selection--multiple {
    border-color: var(--primary-color) !important;
    outline: 0;
    box-shadow: none !important;
}

.select2-container--bootstrap4.select2-container--disabled .select2-selection--single,
.select2-container--bootstrap4.select2-container--disabled .select2-selection--multiple {
    background-color: var(--bs-secondary-bg, #e9ecef) !important;
    color: var(--bs-secondary-color, #6c757d) !important;
    cursor: not-allowed;
}

.select2-container--bootstrap4 .select2-selection--multiple {
    padding: .25rem .375rem .125rem .375rem;
    gap: .25rem;
    flex-wrap: wrap;
}

.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice {
    background-color: var(--bs-primary-bg-subtle, #e7f1ff);
    border: 1px solid var(--bs-primary-border-subtle, #9ec5fe);
    color: var(--primary-color);
    border-radius: var(--border-radius);
    padding: .125rem .5rem;
    margin-top: .125rem;
}

.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove {
    margin-right: .25rem;
    color: inherit;
}

.select2-container--bootstrap4 .select2-dropdown {
    border: 1px solid var(--bs-border-color, #ced4da);
    border-radius: var(--border-radius);
    background-color: var(--bs-body-bg, #fff);
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .18);
}

.select2-container--bootstrap4 .select2-search--dropdown .select2-search__field {
    border: 1px solid var(--bs-border-color, #ced4da);
    border-radius: var(--border-radius);
    padding: .375rem .5rem;
    width: 100%;
    outline: 0;
}

.select2-container--bootstrap4 .select2-results__option {
    padding: .5rem .75rem;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.select2-container--bootstrap4 .select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary-color);
    color: #fff;
}

.select2-container--bootstrap4 .select2-results__option[aria-selected=true] {
    background-color: var(--bs-primary-bg-subtle, #e7f1ff);
    color: var(--primary-color);
}

[data-bs-theme="dark"] .select2-container--bootstrap4 .select2-selection--single,
[data-bs-theme="dark"] .select2-container--bootstrap4 .select2-selection--multiple {
    background-color: var(--bs-body-bg, #1e1e1e);
    color: var(--bs-body-color, #e9ecef);
    border-color: var(--bs-border-color, #495057) !important;
}

[data-bs-theme="dark"] .select2-container--bootstrap4 .select2-dropdown {
    background-color: var(--bs-body-bg, #1e1e1e);
    border-color: var(--bs-border-color, #495057);
}

.select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered {
    padding-right: 2rem !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.select2-container {
    display: block !important;
}

.modal .select2-container--bootstrap4 .select2-selection--single,
.modal .select2-container--bootstrap4 .select2-selection--multiple {
    width: 100% !important;
}

.modal .select2-container--bootstrap4 .selection,
.modal .select2-container--bootstrap4 .select2-selection {
    flex: 1 1 auto;
}

.select2-container--bootstrap4 .select2-dropdown {
    min-width: 100% !important;
}

/* ============================================ jQuery UI Autocomplete ============================================ */

.ui-autocomplete {
    width: auto !important;
    max-width: calc(100vw - 20rem) !important;
    max-height: 320px;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-gutter: stable;
    box-sizing: border-box;
    z-index: 1055;
}

.ui-autocomplete .ui-menu-item-wrapper {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* Scrollbar específico para autocomplete */
.ui-autocomplete::-webkit-scrollbar {
    width: 8px;
}

.ui-autocomplete::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.ui-autocomplete::-webkit-scrollbar-thumb {
    background-color: #c1c1c1;
    border-radius: 4px;
}

.ui-autocomplete::-webkit-scrollbar-thumb:hover {
    background-color: #a8a8a8;
}

.ui-autocomplete {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}
