.nav-item-selected
{
    background-color: #ff7f27;
}

.nav-item-selected a
{
    color: #f7f7f7 !important;
}

.dropdown-submenu {
    position: relative;
}

.dropdown-submenu a::after {
    transform: rotate(-90deg);
    position: absolute;
    right: 6px;
    top: .8em;
}

.dropdown-submenu .dropdown-menu {
    top: 0;
    left: 100%;
    margin-left: .1rem;
    margin-right: .1rem;
}

.more-less {
    float: right;
    color: #fff;
    padding-right: 10px;
    padding-top: 7px;
}

.panel-group .panel {
    border-radius: 0;
    box-shadow: none;
    border-color: #EEEEEE;
}

.width-100
{
    width: 100%;
    margin-top: 25px;
}

.back-to-top {
    position: fixed;
    bottom: 25px;
    right: 25px;
    display: none;
    background-color: #226299;
    color: #fff;
    z-index: 10000;
}

.combo-common
{

}

.modalLoadingOverlay {
    display:    none;
    position:   fixed;
    z-index:    9550;
    top:        0;
    left:       0;
    height:     100%;
    width:      100%;
    background-color: rgba( 255, 255, 255, .8 );
}

body.loading .modalLoadingOverlay {
    overflow: hidden;
}

body.loading .modalLoadingOverlay {
    display: block;
}

.loadingImage
{
    position: fixed;
    left: calc(50% - 174px);
    top:  calc(50% - 83px);
    z-index: 9700;
    display: table;
    background-color: white;
    border-radius: 5px;
    border: solid 1px #7d7d7d;
    padding: 20px;
}

.loadingImage img
{
    text-align: center;
    display: table-cell;
    margin: 0 auto;
}

.loadingImage span
{
    font-size: 16px;
}

.custom-file-upload {
    width: 154px;
    color: #fff;
    height: 35px;
}
.custom-file-upload::-webkit-file-upload-button {
    visibility: hidden;
}
.custom-file-upload::before {
    content: '+ Agregar Archivo';
    display: inline-block;
    background-color: #17a2b8;
    border: 1px solid #17a2b8;
    border-radius: 3px;
    padding: .375rem .75rem;
    outline: none;
    white-space: nowrap;
    -webkit-user-select: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 400;
    border-radius: .25rem;
    line-height: 1.5;
}
.custom-file-upload:hover::before {
    border-color: black;
}
.custom-file-upload:active::before {
    background: -webkit-linear-gradient(top, #e3e3e3, #f9f9f9);
}

td.details-control {
    background: url('../images/details_open.png') no-repeat center center;
    cursor: pointer;
}
tr.shown td.details-control {
    background: url('../images/details_close.png') no-repeat center center;
}

.dt-body-left{
    text-align: left;
}

.dt-body-center{
    text-align: center;
}

.dt-body-right{
    text-align: right;
}

.container-main
{
    margin: 15px;
}

/* Bootstrap 5 Compatibility Fixes */

/* Fix for .mr-auto (now .me-auto in BS5) */
.mr-auto {
    margin-right: auto !important;
}

/* Fix for .ml-auto (now .ms-auto in BS5) */
.ml-auto {
    margin-left: auto !important;
}

/* Margin utilities compatibility */
.mr-0 { margin-right: 0 !important; }
.mr-1 { margin-right: 0.25rem !important; }
.mr-2 { margin-right: 0.5rem !important; }
.mr-3 { margin-right: 1rem !important; }
.mr-4 { margin-right: 1.5rem !important; }
.mr-5 { margin-right: 3rem !important; }

.ml-0 { margin-left: 0 !important; }
.ml-1 { margin-left: 0.25rem !important; }
.ml-2 { margin-left: 0.5rem !important; }
.ml-3 { margin-left: 1rem !important; }
.ml-4 { margin-left: 1.5rem !important; }
.ml-5 { margin-left: 3rem !important; }

/* Padding utilities compatibility */
.pr-0 { padding-right: 0 !important; }
.pr-1 { padding-right: 0.25rem !important; }
.pr-2 { padding-right: 0.5rem !important; }
.pr-3 { padding-right: 1rem !important; }
.pr-4 { padding-right: 1.5rem !important; }
.pr-5 { padding-right: 3rem !important; }

.pl-0 { padding-left: 0 !important; }
.pl-1 { padding-left: 0.25rem !important; }
.pl-2 { padding-left: 0.5rem !important; }
.pl-3 { padding-left: 1rem !important; }
.pl-4 { padding-left: 1.5rem !important; }
.pl-5 { padding-left: 3rem !important; }

/* Fix for form-inline (removed in BS5) */
.form-inline {
    display: flex;
    flex-flow: row wrap;
    align-items: center;
}

.form-inline .form-control {
    display: inline-block;
    width: auto;
    vertical-align: middle;
}

.form-inline .form-check {
    width: auto;
    padding-left: 0;
    margin-right: 0.75rem;
}

.form-inline .form-select {
    width: auto;
}

/* Fix for .close button (now .btn-close in BS5) */
.close {
    box-sizing: content-box;
    width: 1em;
    height: 1em;
    padding: 0.25em 0.25em;
    color: #000;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    border: 0;
    border-radius: 0.25rem;
    opacity: .5;
    cursor: pointer;
}

.close:hover {
    color: #000;
    text-decoration: none;
    opacity: .75;
}

/* Fix dropdown menus */
.dropdown-menu {
    z-index: 1050;
}

/* Fix navbar dropdowns */
.navbar .dropdown-menu {
    position: absolute;
}

/* Fix for badge-* classes */
.badge-primary { background-color: #0d6efd; }
.badge-secondary { background-color: #6c757d; }
.badge-success { background-color: #198754; }
.badge-danger { background-color: #dc3545; }
.badge-warning { background-color: #ffc107; color: #000; }
.badge-info { background-color: #0dcaf0; color: #000; }
.badge-light { background-color: #f8f9fa; color: #000; }
.badge-dark { background-color: #212529; }

/* Fix for text utilities */
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }

/* Fix for float utilities */
.float-left { float: left !important; }
.float-right { float: right !important; }
.float-none { float: none !important; }

/* Fix my-lg-0 (spacing utilities) */
.my-lg-0 {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.my-2 {
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
}

/* Fix for disabled link appearance */
.nav-link.scrollto.disabled {
    pointer-events: none;
    cursor: default;
    opacity: 0.65;
}

/* Fix for modal backdrop stacking */
.modal-backdrop.modal-stack {
    z-index: 1040;
}

/* Fix for custom file input (removed in BS5) */
.custom-file-input {
    position: relative;
    z-index: 2;
    width: 100%;
    height: calc(1.5em + 0.75rem + 2px);
    margin: 0;
    opacity: 0;
}

.custom-file-label {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1;
    height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 0.75rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
}

/* Ensure DataTables compatibility */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 0.5rem 0.75rem;
}

/* Fix for input-group prepend/append (changed in BS5) */
.input-group-prepend,
.input-group-append {
    display: flex;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    text-align: center;
    white-space: nowrap;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
}



/* Bootstrap 5 - btn-block compatibility */
.btn-block {
    display: block;
    width: 100%;
}

.btn-block + .btn-block {
    margin-top: 0.5rem;
}

/* Fix for d-grid (Bootstrap 5 button container) */
.d-grid {
    display: grid;
}

.d-grid .btn {
    width: 100%;
}

/* Fix for form-group spacing in Bootstrap 5 */
.form-group {
    margin-bottom: 1rem;
}

/* Fix for col-md-offset-* (removed in Bootstrap 4+) */
.col-md-offset-1 { margin-left: 8.333333%; }
.col-md-offset-2 { margin-left: 16.666667%; }
.col-md-offset-3 { margin-left: 25%; }
.col-md-offset-4 { margin-left: 33.333333%; }
.col-md-offset-5 { margin-left: 41.666667%; }
.col-md-offset-6 { margin-left: 50%; }

/* Fix for justify-content-center */
.justify-content-center {
    justify-content: center !important;
}

/* Fix for alert-dismissible close button positioning */
.alert-dismissible .btn-close {
    position: absolute;
    top: 0;
    right: 0;
    padding: 1.25rem 1rem;
}

/* Bootstrap 4 panel compatibility for Bootstrap 5 */
.panel-group {
    margin-bottom: 20px;
}

.panel {
    margin-bottom: 20px;
    background-color: #fff;
    border: 1px solid transparent;
    border-radius: 4px;
    box-shadow: 0 1px 1px rgba(0,0,0,.05);
}

.panel-default {
    border-color: #ddd;
}

.panel-heading {
    padding: 10px 15px;
    border-bottom: 1px solid transparent;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
}

.panel-default > .panel-heading {
    color: #333;
    background-color: #f5f5f5;
    border-color: #ddd;
}

.panel-title {
    margin-top: 0;
    margin-bottom: 0;
    font-size: 16px;
    color: inherit;
}

.panel-title > a {
    text-decoration: none;
}

.panel-body {
    padding: 15px;
}

.panel-collapse {
    /* Ya está manejado por collapse de Bootstrap 5 */
}

/* Fix para modal-dialog sizes */
.modal-xl {
    max-width: 90%;
}

.modal-xxl {
    max-width: 90%;
}

@media (min-width: 1200px) {
    .modal-xl {
        max-width: 1140px;
    }
    
    .modal-xxl {
        max-width: 1400px;
    }
}

@media (min-width: 1400px) {
    .modal-xl {
        max-width: 1320px;
    }
}
