/* === SCROLL CORRETO EM TODOS OS MODAIS === */

/* Modal com scroll independente */
.modal.d-block {
    overflow-y: auto;
    padding-right: 0 !important;
}

.modal-dialog-scrollable {
    max-height: 90vh;
    margin: 1.75rem auto;
}

.modal-dialog-scrollable .modal-body {
    max-height: calc(90vh - 130px);
    overflow-y: auto;
}

/* Garantir que backdrop não interfira */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    width: 100vw;
    height: 100vh;
    background-color: #000;
}

.modal-backdrop.show {
    opacity: 0.5;
}

/* Espaçamento correto do modal */
.modal-dialog {
    position: relative;
    width: auto;
    margin: 1.75rem auto;
    pointer-events: none;
}

.modal-dialog .modal-content {
    pointer-events: auto;
}

/* Larguras personalizadas */
.modal-lg {
    max-width: 800px;
}

.modal-xl {
    max-width: 1140px;
}

/* Scroll suave */
.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1rem;
}

/* Evitar scroll duplo no body */
body.modal-open {
    overflow: hidden;
}

/* Melhorar aparência do scroll */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* === GARANTIR VISIBILIDADE DO OBRA SELECTOR === */
.nav-item .dropdown {
    display: inline-block !important;
}

.nav-item .dropdown-toggle {
    display: inline-flex !important;
    align-items: center;
    white-space: nowrap;
}

/* Garantir que dropdown funcione */
.dropdown-menu {
    position: absolute !important;
    z-index: 1050;
}

.dropdown-menu.show {
    display: block;
}
