/******************************************* Variáveis **************************************************/
.table {
    --bs-table-hover-bg: rgba(255, 255, 255, 0.075) !important;
}

/************************************************* Base *************************************************/
html,
body {
    width: 100%;
    height: 100%;
    padding: 0px;
    margin: 0px;
}

a,
tr,
td,
li,
button,
i {
    cursor: pointer;
}

textarea {
    resize: none;
}

/************************************************ Styles ************************************************/
.principal {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    overflow: hidden;
    padding-bottom: 35px;
    /* Espaço para o rodapé fixo */
}

.window {
    margin-top: 0;
    padding: .25rem;
    width: 100%;
    max-height: -webkit-fill-available;
    height: -webkit-fill-available;
}

.janela {
    max-height: 100%;
    height: 100%;
    display: grid;
    gap: .25rem;
    align-content: stretch;
}

.lista tbody td {
    border-color: lightgray;
    border-width: 0 1px;
    padding: .25rem .5rem;
}

.lista tbody td:first-child {
    border-left-width: 0;
}

.lista tbody td:last-child {
    border-right-width: 0;
}

/* Destaque para a coluna de Status nas listas */
/* Anel (borda) ao redor da bola de status */
.lista tbody td.status-col .status-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.lista tbody td.status-col .status-icon i {
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
}

.lista tbody td.status-col .status-icon::after {
    content: "";
    position: absolute;
    width: 1.05em;
    height: 1.05em;
    border: 2px solid rgba(0, 0, 0, 0.55);
    /* cor da borda do anel */
    border-radius: 50%;
    box-sizing: border-box;
}

.lista tbody td.status-col .badge-status {
    font-weight: 700;
    letter-spacing: .5px;
}

.lista>thead>tr>th:has(i.bi-plus-lg) {
    border-left: 1px solid lightgray;
    text-align: center;
}

.table .selecionado td {
    background-color: burlywood;
    color: black;
}

.scroll {
    overflow-y: auto;
    white-space: nowrap;
}

td.text-truncate {
    max-width: 0;
}

/************************************************* Alterações *************************************************/
.card-header>i,
.offcanvas-body i.bi,
.navbar i.bi {
    margin-right: .5rem;
}

.nav {
    z-index: 1021;
}

.offcanvas-body a {
    text-decoration: none;
    color: var(--bs-heading-color);
}

.janela>.card>.card-body {
    padding: 0px;
    overflow-y: auto;
    height: 100px;
}

ul.dropdown-menu {
    z-index: 2000;
}

.bootbox.secondary {
    z-index: 1056;
}

.bootbox.secondary+.modal-backdrop {
    z-index: 1055;
    opacity: 0.75 !important;
}

.bootbox.secondary .modal-content {
    color: #fff !important;
    background-color: RGBA(108, 117, 125, var(--bs-bg-opacity, 1)) !important;
}

.bootbox.p-0 .modal-body {
    padding: 0px;
}

.bootbox.p-1 .modal-body {
    padding: .25rem;
}

.bootbox.p-2 .modal-body {
    padding: .5rem;
}

.bootbox.p-3 .modal-body {
    padding: .75rem;
}

.bootbox.p-4 .modal-body {
    padding: 1rem;
}

.bootbox.p-5 .modal-body {
    padding: 1.25rem;
}

.bootbox.pdf .modal-dialog {
    height: 80% !important;
}

.bootbox.pdf .modal-content {
    height: 100% !important;
}

.bootbox.pdf .modal-body {
    padding: 0px;
}

.bootbox.pdf .bootbox-body {
    height: 100% !important;
}

/************************************************* Diversos *************************************************/
.col-minima {
    width: 10px !important;
    white-space: nowrap;
}

.preSelect {
    width: 136px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

input.sem-seletor::-webkit-calendar-picker-indicator,
input.sem-seletor::-webkit-inner-spin-button {
    display: none;
}

input.sem-seletor {
    appearance: textfield;
    -moz-appearance: textfield;
}

/******************************************** Select2 Dark theme **************************************************/

/* Select 2 bootstrap-5 theme override */
html[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection {
    background-color: transparent !important;
    border: 1px solid #495057;
}

html[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--single {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23dee2e6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

html[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    color: #dee2e6 !important;
}

html[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice {
    color: #dee2e6 !important;
}

html[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice {
    border: 1px solid var(--bs-gray-600);
}

html[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered .select2-selection__placeholder {
    color: #dee2e6 !important;
}

html[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-dropdown .select2-search .select2-search__field {
    background-color: transparent !important;
    color: #dee2e6 !important;
}

html[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-dropdown {
    color: #dee2e6 !important;
    border: 1px solid #495057 !important;
    background-color: var(--bs-body-bg);
}

html[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option[role=group] .select2-results__group {
    color: var(--bs-secondary-color) !important;
}

/******************************************** Ajustes de largura **************************************************/
form>div:has(.parent-100) {
    width: 100% !important;
}

form>div:has(.parent-75) {
    width: calc(75% - 0.25rem) !important;
}

form>div:has(.parent-50) {
    width: calc(50% - 0.25rem) !important;
}

form>div:has(.parent-25) {
    width: calc(25% - 0.25rem) !important;
}

/* Removido: form>div:has(.d-none) - Este seletor era muito genérico e ocultava rows inteiras
   Se necessário esconder elementos, usar .d-none diretamente no elemento */

/************************************************ DatePicker ************************************************/
.datepicker table tr td.range,
.datepicker table tr td.range:hover,
.datepicker table tr td.range.disabled,
.datepicker table tr td.range.disabled:hover,
.datepicker table tr td.day:hover,
.datepicker table tr td.day.focused,
.datepicker table tr td span:hover,
.datepicker table tr td span.focused,
.datepicker .datepicker-switch:hover,
.datepicker .prev:hover,
.datepicker .next:hover,
.datepicker tfoot tr th:hover {
    color: black;
}

/* Estilos para preservar formatação de observações */
#observacoes_saida_texto {
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.5;
}

.observacoes-formatadas {
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.5;
}

/************************************************ Footer de Sugestões ************************************************/
.footer-sugestoes {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(13, 110, 253, 0.1);
    border-top: 1px solid rgba(13, 110, 253, 0.3);
    padding: 0.25rem 0;
    z-index: 1000;
    text-align: center;
    margin: 0;
}

.footer-sugestoes a {
    text-decoration: none;
}

.footer-sugestoes a:hover {
    text-decoration: underline;
}