/* =============================================================================
   Variáveis globais
============================================================================= */

:root {
    --md3-surface: #fff;
    --md3-on-surface: #435375;
    --md3-outline-variant: #bbc5d8;

    /* Cores primárias */
    --md3-primary: #3E7099;
    --md3-primary-hover: #588FBB;
    --md3-primary-focus: #25425B;

    /* Estado desabilitado */
    --md3-disabled-bg: #f2f2f2;
    --md3-disabled-color: #a6a6a6;

    /* Cor neutra */
    --md3-gray: #D9D9D9;

    /* Radius e espaçamentos */
    --md3-radius: 6px;
    --md3-padding-y: 10px;
    --md3-padding-x: 14px;

    /* Sombras */
    --md3-shadow-1: 0 1px 2px rgba(0, 0, 0, .08), 0 1px 3px rgba(0, 0, 0, .06);
    --md3-shadow-2: 0 6px 24px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .08);
}




/* ==========================================================================
   COMPONENTES BASE COMUNS
   --------------------------------------------------------------------------
   Estrutura básica de agrupamento e posicionamento de inputs + labels flutuantes
   ========================================================================== */

.md-filled-group {
    position: relative;
    margin-bottom: 20px;
    background-color: transparent !important;
}

.md-filled-label {
    position: absolute;
    top: 16px;
    left: 12px;
    font-size: 16px;
    color: #435375;
    pointer-events: none;
    transition: 0.2s ease all;
    /** Corta o texto e coloca "..." quando o texto é muito grande **/
    max-width: 90%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}


.form-group input:disabled~label,
.form-group textarea:disabled~label {
    color: #A6A6A6;
}

/* ==========================================================================
   INPUTS DE TEXTO (md-filled-input)
   --------------------------------------------------------------------------
   Estilos para inputs com design "filled" (Material Design-like)
   ========================================================================== */

.md-filled-input {
    border: none;
    /* border-bottom: 2px solid #BBC5D8; */
    border-bottom: none !important;
    box-shadow: inset 0px -2px 0px 0px rgba(187, 197, 216, 1);
    border-radius: 5px 5px 0 0 !important;
    background-color: #EFF1F6;
    padding: 22px 12px 4px;
    font-size: 16px;
    width: 100%;
    transition: box-shadow 0.3s ease, border-color 0.3s ease, color 0.3s ease, background-color 0.3s !important;
    min-height: 56px !important;
    color: #1C2331;
}

.md-filled-input:hover {
    background-color: #DBE0EB;
}


.md-filled-input:focus {
    outline: none;
    box-shadow: inset 0px -2px 0px 0px #3E7099 !important;
    background-color: #EFF1F6;
    box-shadow: none;
}

.md-filled-input:active {
    background-color: #BBC5D8;
}

.md-filled-input:disabled {
    background-color: #F2F2F2;
    border-bottom-color: var(--md3-gray);
    color: #A6A6A6;
    box-shadow: inset 0px -2px 0px 0px var(--md3-gray);
}

.md-filled-input:read-only {
    color: #A6A6A6;
}

.md-filled-input::placeholder {
    color: transparent;
}

.md-filled-input:focus+.md-filled-label,
.md-filled-input:not(:placeholder-shown)+.md-filled-label {
    top: 4px;
    font-size: 14px;
}

.md-filled-input:focus+.md-filled-label {
    color: #325A7B;
}

/* -------- Textarea -------- */
textarea.md-filled-input {
    resize: vertical;
    min-height: 56px;
    line-height: 1.5;
}

/* ==========================================================================
   ESTADO DE VALIDAÇÃO (ERROS)
   --------------------------------------------------------------------------
   Estilos visuais para inputs inválidos (validação com `is-invalid`)
   ========================================================================== */

.md-filled-input.is-invalid {
    box-shadow: inset 0px -2px 0px 0px rgb(220 53 69) !important;
    border-bottom: none !important;
}

.md-filled-input.is-invalid+.md-filled-label {
    color: #FA0A1E;
}

.md-outlined-input.is-invalid {
    color: #69020B;
    border: 2px solid #FA0A1E !important;
}


.md-outlined-input.is-invalid:hover {
    color: #69020B;
    border: 2px solid #69020B !important;
}

.md-outlined-input.is-invalid:focus {
    border: 2px solid #FA0A1E !important;
}

.help-text {
    font-size: 12px;
    color: #A6A6A6;
    margin-left: 12px;
}

.help-text.text-danger {
    color: #FA0A1E !important;
}

label.form-label.md-outlined-label.text-danger {
    color: #FA0A1E !important;
}


.md-outlined-group:hover .md-outlined-label.text-danger {
    color: #69020B !important;
}

.help-text-hint {
    color: #A6A6A6;
    font-size: 12px;
    margin-top: 2px;
    margin-left: 12px;
    display: block;
}



/* =============================================================================
   INPUT OUTLINED MATERIAL DESIGN
============================================================================= */
.md-outlined-group {
    position: relative;
    margin-bottom: 1rem;
}

.md-outlined-input {
    width: 100%;
    border: 2px solid #BBC5D8 !important;
    border-radius: 6px !important;
    padding: 0.75rem;
    background-color: transparent !important;
    outline: none !important;
    height: 56px !important;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.md-outlined-input:hover {

    border: 2px solid #1C2331 !important;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.md-outlined-input:focus {
    box-shadow: none;
    border: 2px solid #3E7099 !important;
}

.md-outlined-label {
    position: absolute;
    left: 12px;
    top: 28px;
    transform: translateY(-50%);
    background-color: var(--md3-surface);
    padding: 0 4px;
    color: #435375;
    font-size: 1rem;
    transition: 0.2s ease all;
    pointer-events: none;
}

.md-outlined-input:focus+.md-outlined-label,
.md-outlined-input:not(:placeholder-shown)+.md-outlined-label {
    top: 0px;
    left: 8px;
    font-size: 0.75rem;
    color: #3E7099;
    font-weight: 500;
}

.md-outlined-input.is-invalid:focus+.md-outlined-label,
.md-outlined-input.is-invalid:not(:placeholder-shown)+.md-outlined-label {
    color: #FA0A1E !important;
}

/*******************
 somente leitura
********************/

.md-outlined-input:read-only {
    background-color: var(--md3-surface) !important;
    border: 2px solid var(--md3-gray) !important;
    color: var(--md3-disabled-color) !important;
}

/* Label em readonly */
.md-outlined-input:read-only+.md-outlined-label {
    color: var(--md3-disabled-color) !important;
}




/* ==========================================================================
   SELECT2 — ESTILO MATERIAL DESIGN (Modo Filled)
   --------------------------------------------------------------------------
   Adapta o componente Select2 ao layout de inputs preenchidos com labels flutuantes,
   seguindo o padrão visual de Material Design (como os inputs md-filled-input).
   ========================================================================== */

.md-filled-group-select {
    position: relative;
    margin-bottom: 24px;
    background-color: transparent;
}

.md-filled-group-select:has(.select2-selection__rendered[title])>.md-filled-label,
.md-filled-group-select:has(.select2-container--open)>.md-filled-label,
.md-filled-group-select:has(.select2-selection__choice)>.md-filled-label {
    top: 4px;
    font-size: 14px;
}

.select2-search--inline {
    padding: 0px 0px 0px 4px !important;
}

span.select2.select2-container.select2-container--default.select2-container--below.select2-container--focus>.md-filled-label {
    top: 4px;
    font-size: 14px;
}


/* Muda a cor do label somente quando o select está focado (aberto) */
.md-filled-group-select:has(.select2-container--open)>.md-filled-label {
    color: #325A7B;
}

.md-filled-group-select>.select2-container--default .select2-selection--single {
    border: none !important;
    border-bottom: 2px solid #BBC5D8 !important;
    border-radius: 4px 4px 0 0 !important;
    background-color: #EFF1F6 !important;
    padding: 25px 4px 4px !important;
    font-size: 14px !important;
    height: auto !important;
    min-height: 56px !important;
    transition: background-color 0.6s ease;
    display: block !important;
}

.md-filled-group-select>.select2-container--default .select2-selection--single:focus {
    box-shadow: none;
}

.md-filled-group-select>.select2-container--default .select2-selection--single:hover {
    background-color: #DBE0EB !important;
}

.select2-container--default.select2-container--open .select2-selection--single {
    border-bottom: 2px solid #3E7099 !important;
}

.select2-container--default.select2-container--open .select2-selection__rendered {
    color: #3E7099 !important;
}

/* Estilo para o texto dentro do select2 */
.md-filled-group-select>.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 1;
    padding-left: 8px;
    padding-right: 33px;
    white-space: normal;
    color: #1C2331;
    padding-bottom: 5px;
}



.md-filled-group-select>span.select2.select2-container.select2-container--default.select2-container--focus {
    box-shadow: none;
}

/* Botão de limpar (clear - x) reposicionado no modo single */
div.form-group.md-filled-group-select>span>span>span>span>span.select2-selection__clear {
    left: -3px !important;
    top: 0px !important;
}

.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear {
    display: block !important;
    cursor: unset !important;
    opacity: 0 !important;
}



.select2-container .select2-selection--single {
    transition: background-color 0.6s ease;
}

.select2-container .select2-selection--single:hover {
    background-color: #DBE0EB;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--md3-surface) !important;
    margin-left: 10px;
    font-size: 20px;
    margin-right: 0px !important;
    font-weight: 400 !important;
}

/* Estilo base para select2 múltiplo com aparência filled */
.md-filled-group-select>.select2-container--default .select2-selection--multiple {
    border: none !important;
    /* border-bottom: 2px solid #BBC5D8 !important; */
    border-bottom: none !important;
    box-shadow: inset 0px -2px 0px 0px rgba(187, 197, 216, 1);
    border-radius: 4px 4px 0 0 !important;
    background-color: #EFF1F6 !important;
    /* padding: 20px 0px 0px 5px !important; */
    font-size: 16px !important;
    height: auto !important;
    min-height: 56px !important;
}

.md-filled-group-select>.select2-container--default .select2-selection--multiple:hover {
    background-color: #DBE0EB !important;
}

.md-filled-group-select>.select2-container--default .select2-selection--multiple:focus {
    border-bottom: 2px solid #3E7099 !important;
}

.select2-search--inline {
    margin-top: 18px !important;
}

.select2-selection__choice {
    margin-top: 26px !important;
    margin-bottom: 0px;
}

/*Disabled*/
.md-filled-group-select select:disabled+.select2-container .select2-selection {
    background-color: #F2F2F2 !important;
    box-shadow: inset 0px -2px 0px 0px var(--md3-gray);
    border-bottom: none !important;
}

/* Texto cinza para selects single e múltiplos */
.md-filled-group-select select:disabled+.select2-container .select2-selection__rendered,
.md-filled-group-select select:disabled+.select2-container .select2-selection__choice {
    color: #A6A6A6 !important;
}


.md-filled-group-select select:disabled~label {
    color: #A6A6A6;
}

.md-filled-group-select select:disabled+.select2-container--default .select2-selection--multiple::after {
    display: none;
}

.select:disabled+.select2-container--default .select2-selection--single::after {
    color: #A6A6A6;

}


/* Estilo dos itens selecionados no select2 múltiplo */
.md-filled-group-select>.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    line-height: 1.2;
    padding-left: 8px;
    white-space: normal;
    top: 100px !important;
    /* padding-top: 10px !important; */
    /* max-height: 20%; */
}

.md-filled-group-select>.select2-container--default .select2-selection--multiple .select2-selection__choice {
    margin-top: 23px !important;
    margin-bottom: -19px !important;
    background-color: #3E7099;
    border: none;
    border-radius: 4px;
    padding: 0px 8px;
    font-size: 14px;
    color: var(--md3-surface);
    white-space: normal;
    max-width: 100%;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #DBE0EB !important;
    color: #000000 !important;
    padding: 12px;
}


.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #BBC5D8 !important;
    color: #000 !important;
}

.select2-container--default .select2-results__option {
    padding: 12px;
}

/* Placeholder do campo de busca interno do select2 */
input.select2-search__field::placeholder {
    color: #778AB1 !important;
}

.select2-dropdown {
    border: none !important;
    background-color: #eff1f6 !important;
}


/* Esconde a seta nativa do Select2 */
.select2-selection__arrow {
    display: none !important;
}

/* Ícone padrão (fa-chevron-down) */
.select2-container--default .select2-selection--single::after {
    font-family: "Font Awesome 5 Free";
    content: "\f078";
    /* fa-chevron-down */
    font-weight: 900;
    font-size: 16px;
    position: absolute;
    right: 14px;
    top: 32px;
    transform: translateY(-50%);
    pointer-events: none;
    color: #1C2331;
}

/* Ícone ao abrir (fa-chevron-up) */
.select2-container--open .select2-selection--single::after {
    font-family: "Font Awesome 5 Free";
    content: "\f077" !important;
    /* fa-chevron-up */
    color: #3E7099 !important;
    font-weight: 900;
}

.select2-container--open .select2-selection--single .select2-selection__clear::after {
    color: #3E7099 !important;
}


.select2-selection__clear {
    color: transparent;
    /* Esconde o "×" sem afetar ::after */
    position: relative;
}

.select2-selection__clear::after {
    font-family: "Font Awesome 5 Free" !important;
    content: "\f00d" !important;
    /* fa-xmark */
    font-weight: 900;
    font-size: 16px !important;
    position: absolute !important;
    top: 5px;
    left: 0;
    transform: translateY(-50%);
    color: #1C2331;
    pointer-events: none;
}

.select2-selection--multiple .select2-selection__clear::after {
    top: 10px !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__clear {
    font-weight: 900 !important;
    margin-right: 15px !important;
    margin-top: 20px !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 2px solid #BBC5D8 !important;
    border-radius: 6px;
    box-shadow: none !important;
    padding-left: 12px;
}


.select2-container--default .select2-search {
    padding: 12px;
}


.select2-container--default .select2-results__options {
    border-bottom: 6px solid #eff1f6;
    border-end-start-radius: 6px;
    border-end-end-radius: 6px;
}

.select2-container--default .select2-selection--multiple,
.select2-container--default .select2-selection--single {
    transition: box-shadow 0.6s ease, color 0.6s ease !important;
}

.select2-container--default .select2-selection--multiple.is-invalid,
.select2-container--default .select2-selection--single.is-invalid {
    box-shadow: inset 0px -2px 0px 0px rgb(220 53 69) !important;
    border-bottom: none !important;
}

.select2-container--default .select2-selection--multiple.is-invalid,
.select2-container--default .select2-selection--single.is-invalid::after {
    color: #dc3545 !important;

}

span.select2-dropdown.select2-dropdown--below {
    box-shadow: 0px 2px 10px 1px rgba(0, 0, 0, 0.2);
}

span.select2-dropdown.select2-dropdown--above {
    box-shadow: rgba(0, 0, 0, 0.2) 0px 2px 10px 1px;
}

span#select2-sector_id-container {
    justify-content: start;
}

/* ==========================================================================
   INPUT DATE
   ========================================================================== */


input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    cursor: pointer;
    position: absolute;
    right: 0;
    top: 0;
    width: 40px;
    height: 100%;
    z-index: 2;
    background: transparent;
}

/* Estilo do ícone customizado (FontAwesome) */
.custom-date-icon {
    position: absolute;
    top: 30px;
    right: 6px;
    transform: translateY(-50%);
    color: #1C2331;
    font-size: 1rem;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.custom-date-icon:hover {
    color: #3E7099;
}


span.custom-date-clear {
    display: none;
    cursor: pointer;
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    transition: color 0.3s ease;
}


.flatpickr-calendar.animate.open.arrowLeft.arrowBottom {
    box-shadow: 0px 2px 10px 1px rgba(0, 0, 0, 0.2);
}

span.flatpickr-day:hover {
    background: #dbe0eb;
    border-color: #dbe0eb;
}

/* Dia selecionado no calendário */
span.flatpickr-day.selected {
    background-color: #3e7099;
    border: 1px solid #3e7099;
}

span.flatpickr-day.selected:hover {
    background-color: #588FBB;
    border: 1px solid #588FBB;
}

span.flatpickr-prev-month {
    stroke: #000000;
    stroke-width: 1.5;
}

span.flatpickr-prev-month:hover {
    stroke: #3E7099;
}

span.flatpickr-next-month svg {
    stroke: #000000;
    stroke-width: 1.5;
}

span.flatpickr-next-month svg:hover {
    stroke: #3E7099;
}


/* ==========================================================================
   SELECT — ESTILO MATERIAL DESIGN (Modo outlined)
   ========================================================================== */

.md-outlined-group-select {
    position: relative;
    margin-top: 1.5rem;
}

.select2-container--material .select2-dropdown {
    border-radius: 6px;
    padding: 12px;
    background-color: rgb(255, 255, 255) !important;
    border: 2px solid #BBC5D8 !important;
    box-shadow: 0 2px 8px rgba(63, 81, 181, 0.2);
    max-height: calc(4 * 40px);
    overflow-y: auto;
}

.select2-container--open .select2-dropdown--below {
    border-top-left-radius: 6px !important;
    border-top-right-radius: 6px !important;
}

.select2-container--material .select2-selection--single {
    border: 2px solid #BBC5D8 !important;
    background-color: transparent;
    padding: 0.75rem 0.75rem 0.75rem 0.75rem;
    width: 100%;
    height: 56px !important;
    border-radius: 6px !important;
    appearance: none;
    font-weight: 400 !important;
    box-sizing: border-box;
    text-align: end;
}


select.is-invalid+.select2-container--material .select2-selection--single {
    border: 2px solid #fa0a1e !important;
}

.select2-container--default .select2-selection--multiple.is-invalid,
.select2-container--default .select2-selection--single.is-invalid {
    box-shadow: inset 0px -2px 0px 0px rgb(220 53 69) !important;
    border-bottom: none !important;
}

.select2-results__option[aria-selected=true] {
    background-color: #BBC5D8 !important;
    color: #000000 !important;
}

.select2-results__option {
    transition: background-color 0.3s ease-out;
}

.select2-results__option:hover {
    background-color: #DBE0EB;
}


.md-outlined-group-select:has(.select2-selection__rendered[title])>.md-outlined-label,
.md-outlined-group-select:has(.select2-container--open)>.md-outlined-label,
.md-outlined-group-select:has(.select2-selection__choice)>.md-outlined-label {
    top: 4px;
    font-size: 14px;
}

.select2-container .select2-selection--single .select2-selection__rendered {
    display: flex !important;
    justify-content: space-between;
    flex-direction: row-reverse;
    padding-top: 4px;
}


/* Botão de limpar (clear - x) reposicionado no modo single */
div.form-group.md-outlined-group-select>span>span>span>span>span.select2-selection__clear {
    margin-left: 14px !important;
    top: 6px !important;
    padding-left: 5px;
}

select.is-invalid+.select2-container--material .select2-selection--single::after {
    color: #fa0a1e;
}


.select2-container--material .select2-selection--single::after {
    font-family: "Font Awesome 5 Free";
    content: "\f078";
    font-weight: 900;
    font-size: 16px;
    position: absolute;
    right: 14px;
    top: 29px;
    transform: translateY(-50%);
    pointer-events: none;
    color: #1C2331;
}

div.md-outlined-group-select>span.select2>span.selection>span.select2-selection.select2-selection--single:hover {
    background-color: transparent;
    border: 2px solid #0F131A !important;
}

.md-outlined-group-select:hover .md-outlined-label.text-danger,
.select2-container--open .select2-selection--single .select2-selection__clear::after,
.md-outlined-group-select:hover .select2-container--material .select2-selection--single::after {
    color: #0F131A !important;
}



/* ==========================================================================
   SELECT MÚLTIPLO — ESTILO MATERIAL DESIGN (Modo outlined)
   ========================================================================== */

.select2-container--material .select2-selection--multiple {
    border: 2px solid #BBC5D8 !important;
    background-color: transparent;
    border-radius: 6px !important;
    min-height: 56px !important;
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    box-sizing: border-box;
}

.select2-container--material .select2-selection--multiple .select2-selection__choice {
    background-color: #DBE0EB;
    color: #000000;
    border-radius: 4px;
    padding: 2px 6px;
    margin: 2px 0;
    display: flex;
    align-items: center;
    font-size: 14px;
}

.select2-container--material .select2-selection--multiple .select2-selection__rendered {
    display: flex !important;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 5px ;
    padding-bottom: 1px;
    margin-right: 30px;
    align-items: baseline;
}

.select2-container--material .select2-selection--multiple.is-invalid {
    border: 2px solid #fa0a1e !important;
}

.select2-container--material .select2-selection--multiple:focus {
    border-color: #3F51B5 !important;
    box-shadow: 0 2px 8px rgba(63, 81, 181, 0.2);
}

/* Alinha o botão de remover no lado direito da tag */
.select2-container--material .select2-selection--multiple .select2-selection__choice {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--md3-primary);
    color: #fff;
    border-radius: 4px;
    padding: 2px 6px;
    margin: 2px 2px -22px 0;
    font-size: 14px;
    height: 25px;
}

.select2-container--material .select2-selection--multiple .select2-selection__choice__remove {
    margin-left: 6px;
    order: 2;
    font-size: 20px;
}

/* Move o botão de limpar (clear) para o final do select múltiplo */
.select2-container--material .select2-selection--multiple .select2-selection__clear {
    position: absolute;
    right: 25px;
    top: 35%;
    z-index: 10;
    display: inline-block;
    cursor: pointer;
}


.select2-container--material .select2-selection--multiple .select2-search--inline {
    flex-grow: 1;
    min-width: 50px;
    order: 1;
}

input.select2-search__field {
    box-shadow: none !important;
}


/* ==========================================================================
   CHECKBOX (md-check-group)
   --------------------------------------------------------------------------
   Usa a classe .md-check-group como wrapper para escopo isolado de estilos.
   ========================================================================== */

/* Personalização das bordas do checkbox */
.md-check-group>.form-check-input {
    border: 2px solid #bbc5d8 !important;
    border-radius: 6px !important;
}

.md-check-group>.form-check-input:checked {
    background-color: #3E7099 !important;
    border-color: #3E7099 !important;
}

.md-check-group>.form-check-input:hover {
    border-color: #1C2331 !important;
}

.md-check-group>.form-check-input:hover:checked {
    background-color: #1C2331 !important;
}

.md-check-group>.form-check-input:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 .25rem #80AACC;
    border: transparent !important;
}

.md-check-group>.form-check-input.is-invalid {
    border-color: #dc3545 !important;
}

.md-check-group>.form-check-input.is-invalid:checked {
    background-color: #dc3545 !important;
}

.md-check-group>.form-check-input.is-invalid:checked:hover {
    border-color: #9B0310 !important;
    background-color: #9B0310 !important;
}

.md-check-group>.form-check-label {
    color: #1C2331 !important;
}

/* ==========================================================================
   LINK
   ========================================================================== */

.md-link {
    font-size: 14px;
    font-weight: 500;
    color: #435375;
}

.md-link:hover {
    color: #778AB1;
}

.md-link:active {
    color: #1C2331;
}

.md-link:disabled {
    color: #A6A6A6;
}

.md-link:disabled i {
    color: #A6A6A6;
}

.btn-voltar-show {
    color: #1C2331 !important;
}

.btn-voltar-show:hover {
    color: #778AB1 !important;
}

/* ==========================================================================
   BOTÕES (Acões: Cancelar | Salvar)
   --------------------------------------------------------------------------
   Usa a classe .btn-actions-wrapper como wrapper para escopo isolado de estilos.
   ========================================================================== */

.btn-actions-wrapper {
    gap: 16px;
}

.btn-actions-wrapper>.btn-outline {
    border: 2px solid #3E7099;
    color: #3E7099;
    height: 56px;
    min-width: 120px;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 6px;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-actions-wrapper>.btn-outline:hover {
    border: 2px solid #80AACC !important;
    color: #80AACC !important;
}

.btn-actions-wrapper>.btn-outline:focus {
    box-shadow: 0 0 0 4px #97A6C4;
    color: #3E7099;
}

.btn-actions-wrapper>.btn-outline:active {
    border: 2px solid #192D3E !important;
    color: #192D3E !important;
}

.btn-actions-wrapper>.btn-primary {
    background-color: #3E7099;
    color: var(--md3-surface);
    height: 56px;
    min-width: 120px;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 400;
    border: none;
    border-radius: 6px;
    transition: background-color 0.4s ease, box-shadow 0.4s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0px;
}

.btn-actions-wrapper>.btn-primary:hover {
    background-color: #588FBB;
}

.btn-md>.btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 4px #80AACC;
}

.btn-md>.btn-primary:active {
    background-color: #25425B !important;
}

.btn-actions-wrapper>.btn-primary:disabled{
    background-color: var(--md3-disabled-bg);
    color: var(--md3-disabled-color);
    cursor:not-allowed !important;
}

/* =============================================================================
   BOTÃO PRIMÁRIO PERSONALIZADO
   -----------------------------------------------------------------------------
   Estilização customizada para o botão .btn-primary com:
   - Cor base:        #3E7099
   - Hover:           #588FBB
   - Focus:           borda  #80AACC
   - Click (active):  #25425B
   - Desabilitado:    fundo #F2F2F2 / texto #A6A6A6
   ============================================================================ */

.btn-primary-wrapper>.btn-primary {
    background-color: #3E7099;
    color: var(--md3-surface);
    height: 56px;
    min-width: 120px;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 400;
    border: none;
    border-radius: 6px;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0px;
}

.btn-primary-wrapper>.btn-primary:hover {
    background-color: #588FBB !important;
}

.btn-primary-wrapper>.btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 4px #80AACC;
}

.btn-primary-wrapper>.btn-primary:focus-visible {
    background-color: #3E7099;
}

.btn-primary-wrapper>.btn-primary:active {
    background-color: #25425B !important;
}

.btn-primary-wrapper>.btn-primary:disabled {
    background-color: #F2F2F2 !important;
    color: #A6A6A6 !important;
    cursor: not-allowed !important;
}

/* Para casos com confirm */
.confirm-modal-title {
    font-weight: 500;
    font-size: 24px;
    color: #0F131A;
    line-height: 32px;
    letter-spacing: 0px;
}

.confirm-modal-description {
    font-weight: 400;
    font-size: 16px;
    color: #1C2331;
    line-height: 26px;
    letter-spacing: 0px;
}

/* =============================================================================
   BOTÃO-LINK PERSONALIZADO
   -----------------------------------------------------------------------------
   Estilização customizada para o botão .btn-link (ancora <a>) com aparência
   semelhante ao botão primário:
   - Cor base:        #3E7099
   - Hover:           #588FBB
   - Focus:           borda #80AACC
   - Click (active):  #25425B
   - Desabilitado:    fundo #F2F2F2 / texto #A6A6A6
   ============================================================================ */

.btn-link-wrapper>.btn-link {
    background-color: #3E7099;
    color: var(--md3-surface);
    height: 56px;
    min-width: 120px;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 400;
    border: none;
    border-radius: 6px;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-link-wrapper>.btn-link:hover {
    background-color: #588FBB;
    color: var(--md3-surface) !important;
}

.btn-link-wrapper>.btn-link:focus {
    background-color: #3E7099 !important;
    color: var(--md3-surface);
    outline: none;
    box-shadow: 0 0 0 4px #80AACC;
}

.btn-link-wrapper>.btn-link:active {
    background-color: #25425B !important;
}

.btn-link-wrapper>.btn-link.disabled {
    background-color: #F2F2F2 !important;
    color: #A6A6A6 !important;
    cursor: not-allowed !important;
    pointer-events: auto;
    opacity: 0.6;
}

/* =============================================================================
   BOTÃO SECONDARY PERSONALIZADO
   -----------------------------------------------------------------------------
   Estilização customizada para o botão .btn-secondary com:
   - Cor base:        #576D99
   - Hover:           #778AB1
   - Focus:           borda #97A6C4
   - Click (active):  #303C54
   - Desabilitado:    fundo #F2F2F2 / texto #A6A6A6
   ============================================================================ */

.btn-secondary-wrapper>.btn-secondary {
    background-color: #576D99;
    color: var(--md3-surface);
    height: 56px;
    min-width: 120px;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 400;
    border: none;
    border-radius: 6px;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-secondary-wrapper>.btn-secondary:hover {
    background-color: #778AB1;
}

.btn-secondary-wrapper>.btn-secondary:focus {
    background-color: #576D99 !important;
    outline: none;
    box-shadow: 0 0 0 4px #97A6C4;
}

.btn-secondary-wrapper>.btn-secondary:active {
    background-color: #303C54 !important;
}

.btn-secondary-wrapper>.btn-secondary:disabled {
    background-color: #F2F2F2 !important;
    color: #A6A6A6 !important;
    cursor: not-allowed !important;
}

/* =============================================================================
   BOTÃO OUTLINE PERSONALIZADO
   -----------------------------------------------------------------------------
   Estilização customizada para o botão .btn-outline com:
   - Cor base:        #3E7099
   - Hover:           #80AACC
   - Focus:           borda #80AACC
   - Click (active):  #192D3E
   - Desabilitado:    borda #D9D9D9 / texto #D9D9D9
   ============================================================================ */

.btn-outline-wrapper>.btn-outline,
.btn-outline-danger-wrapper>.btn-outline {
    background-color: transparent !important;
    height: 56px;
    min-width: 120px;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 400;
    border-radius: 6px;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-outline-wrapper>.btn-outline {
    border: 2px solid #3E7099 !important;
    color: #3E7099;
}

/*
 * As costumizações danger foram implementados recentemente.
 * Consultar link-button component para entender sua utilização.
 */
.btn-outline-danger-wrapper>.btn-outline {
    border: 2px solid #FB3C4C !important;
    color: #FB3C4C;
}

.btn-outline-wrapper>.btn-outline:hover {
    border: 2px solid #80AACC !important;
    color: #80AACC !important;
}

.btn-outline-danger-wrapper>.btn-outline:hover {
    border: 2px solid #FC6E7A !important;
    color: #FC6E7A !important;
}

.btn-outline-wrapper>.btn-outline:focus {
    box-shadow: 0 0 0 4px #80AACC;
    color: #3E7099 !important;
}

.btn-outline-danger-wrapper>.btn-outline:focus {
    box-shadow: 0 0 0 4px #FC6E7A;
    color: #FB3C4C !important;
}

.btn-outline-wrapper>.btn-outline:active,
.btn-outline-danger-wrapper>.btn-outline:active {
    border: 2px solid #192D3E !important;
    color: #192D3E !important;
}

.btn-outline-wrapper>.btn-outline:disabled,
.btn-outline-danger-wrapper>.btn-outline:disabled {
    border: 2px solid var(--md3-gray) !important;
    color: var(--md3-gray) !important;
    cursor: not-allowed !important;
}


/* ==========================================================================
   SCROLLBAR
   ========================================================================== */

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #3E7099 #f1f1f1;
}

/* Chrome, Edge, Opera */
*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: #f1f1f1;
}

*::-webkit-scrollbar-thumb {
    background-color: #3E7099;
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
    background-color: #2f5678;
}



/* Estilo base para todos os alerts */
[class^="custom-alert-"] {
    border: 2px solid !important;
    padding: 16px !important;
    border-radius: 6px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

/* Sucesso */
.custom-alert-success {
    background-color: #e6f7ec !important;
    border-color: #179150 !important;
    border: 2px solid #179150 !important;
}

.icon-success,
.title-alert-success,
.description-alert-success,
.custom-close-success {
    color: #106135 !important;
}

/* Erro */
.custom-alert-error,
.custom-alert-danger {
    background-color: #FFE6E8 !important;
    border-color: #D00416 !important;
    border: 2px solid #D00416 !important;
}

.icon-danger,
.title-alert-error,
.description-alert-error,
.custom-close-error {
    color: #9B0310 !important;
}

/* Aviso */
.custom-alert-warning {
    background-color: #FFFAE5 !important;
    border-color: #A88700 !important;
}

.icon-warning,
.title-alert-warning,
.description-alert-warning,
.custom-close-warning {
    color: #805F00 !important;
}

/* Informação */
.custom-alert-info {
    background-color: #E9F0F6 !important;
    border-color: #3E7099 !important;
}

.icon-info,
.title-alert-info,
.description-alert-info,
.custom-close-info {
    color: #325A7B !important;
}

.description-alert-info,
.description-alert-warning,
.description-alert-success,
.description-alert-error {
    padding-left: 0 !important;
    margin-top: 4px !important;
}

/* Ícones */
.icon-alert {
    font-size: 1.2rem !important;
}

/* Botão de fechar */
.btn-close {
    background: transparent !important;
    border: none;
    font-size: 35px;
    opacity: 1 !important;
    font-weight: 400;
    padding-top: 5px !important;
    padding-right: 10px !important;
}

.btn-close:hover {
    opacity: 0.7 !important;
}

/**
 * Componente TABS
 */

.md-tab-group .md-tab-header,
.md-tab-group .md-tab-header-minimal {
    display: flex;
}

.md-tab-group .md-tab-header {
    border-bottom: 2px solid #3E7099;
}

.md-tab-group .md-tab-header-minimal {
    border-bottom: 2px solid #BBC5D8;
}

/* Base comum para todos os botões de aba */
.md-tab-group .md-tab-pill,
.md-tab-group .md-tab-pill-minimal {
    border-bottom: 0 !important;
    cursor: pointer;
    font-weight: 500;
    line-height: 24px;
    font-size: 16px;
}

/* Estilo padrão das abas */
.md-tab-group .md-tab-pill {
    border: 2px solid #3E7099 !important;
    border-bottom: 0 !important;
    border-radius: 6px 6px 0 0 !important;
    color: #3E7099 !important;
    min-width: 71px !important;
    min-height: 56px !important;
    margin: 0 8px !important;
    background-color: var(--md3-surface) !important;
}

.md-tab-group ul {
    list-style: none;
    padding-left: 0px;
}

/* Estilo minimalista das abas */
.md-tab-group .md-tab-pill-minimal {
    background-color: transparent !important;
    border-radius: 0 !important;
    padding: 10px 16px !important;
    color: #778AB1 !important;
}

/* Hover nas abas (ambos estilos), exceto quando ativa */
.md-tab-group .md-tab-pill:hover:not(.active),
.md-tab-group .md-tab-pill-minimal:hover:not(.active) {
    color: #80AACC !important;
    border-color: #80AACC !important;
}

/* Aba ativa no estilo padrão */
.md-tab-group .md-tab-pill.active {
    background-color: #3E7099 !important;
    color: var(--md3-surface) !important;
}

/* Aba ativa no estilo minimal */
.md-tab-group .md-tab-pill-minimal.active {
    margin-bottom: -2px !important;
    border-bottom: 4px solid #3E7099 !important;
    color: #3E7099 !important;
}

/* ==========================================================================
   modal
========================================================================== */

.modal.show {
    background-color: rgba(0, 0, 0, 0.4) !important;
}


/* ==========================================================================
    table
========================================================================== */

.table {
    --bs-table-hover-bg: #DBE0EB !important;
}

label.form-check-label.gse,
.gse {
    cursor: pointer !important;
}

.show-table tr td:first-child {
    background-color: #3e7099 !important;
    color: var(--md3-surface) !important;
    font-weight: 600;
    width: 30%;
}


/* ==========================================================================
    dropdown
========================================================================== */


/* ======= Botão de ícone "fantasma" ======= */
.md3-icon-btn {
    border: none;
    background: transparent;
    padding: 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    cursor: pointer;
    color: var(--md3-on-surface);
}

.md3-icon-btn:focus {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, .2);
}

.md3-icon-btn:hover {
    background: rgba(0, 0, 0, .04);
}

/* ======= Container do dropdown ======= */
.md3-dropdown {
    position: relative;
    display: inline-block;
}

/* ======= Menu do dropdown ======= */
.md3-dropdown__menu {
    position: absolute;
    right: 0;
    margin-top: 8px;
    min-width: 210px;
    background: var(--md3-surface);
    border: 2px solid var(--md3-outline-variant);
    border-radius: var(--md3-radius);
    box-shadow: var(--md3-shadow-2);
    padding: 6px 0;
    z-index: 1000;


    /* animação */
    transform-origin: top right;
    transform: scale(.98);
    opacity: 0;
    transition: transform .12s ease, opacity .12s ease;
}

/* visibilidade controlada por aria-hidden */
.md3-dropdown__menu[aria-hidden="true"] {
    display: none;
}

.md3-dropdown__menu[aria-hidden="false"] {
    display: block;
    transform: scale(1);
    opacity: 1;
}

/* ======= Itens do menu ======= */
.md3-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: var(--md3-padding-y) var(--md3-padding-x);
    text-decoration: none;
    color: #000;
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: .95rem;
}

.md3-menu__item:hover {
    background: #DBE0EB !important;
    color: #000 !important;
    transition: all 0.3s ease-in-out !important;
}

.md3-menu__item:focus {
    outline: 0;
    background: rgba(29, 78, 216, .12);
}


.md3-menu__icon {
    width: 18px;
    text-align: center;
}


/* ==========================================================================
    split-action-dropdown
========================================================================== */

.md3-split-dropdown .btn-group {
    display: flex;
    gap: 1px;
}

.md3-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 22px;
    border: none;
    cursor: pointer;
    border-radius: var(--md3-radius);
}

.md3-btn--primary {
    background: var(--md3-primary);
    color: var(--md3-surface);
}

.md3-btn--primary:hover {
    background: var(--md3-primary-hover);
    color: var(--md3-surface) !important;
}

.md3-btn--icon {
    padding: 6px 22px;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0px 6px 6px 0px;
}

.md3-btn--icon:focus {
    background-color: var(--md3-primary-focus);
}

.md3-btn--icon:active {
    background-color: var(--md3-primary-focus);
}


a.md3-btn.md3-btn--primary.emitir {
    border-radius: 6px 0px 0px 6px;
}


/* ======= Menu do dropdown ======= */
.md3-dropdown__menu_emitir {
    position: absolute;
    margin-top: 0px;
    min-width: 225px;
    background: var(--md3-surface);
    border: 2px solid var(--md3-outline-variant);
    border-radius: var(--md3-radius);
    box-shadow: var(--md3-shadow-2);
    padding: 6px 0;
    z-index: 1000;


    /* animação */
    transform-origin: top right;
    transform: scale(.98);
    opacity: 0;
    transition: transform .12s ease, opacity .12s ease;
}

/* visibilidade controlada por aria-hidden */
.md3-dropdown__menu_emitir[aria-hidden="true"] {
    display: none;
}

.md3-dropdown__menu_emitir[aria-hidden="false"] {
    display: block;
    transform: scale(1);
    opacity: 1;
}

/* Estado desabilitado */
.md3-btn.disabled,
.md3-btn:disabled {
    background-color: var(--md3-disabled-bg) !important;
    color: var(--md3-disabled-color) !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    opacity: 0.7;
}

/* Ícone dentro de botões desabilitados */
.md3-btn.disabled i,
.md3-btn:disabled i {
    color: var(--md3-disabled-color) !important;
}

/* ===========================================================
Outros componentes
=============================================================*/

.remover_servidor_temporario:hover {
    color: #3E7099 !important;
}

.icon-show {
    color: #1C2331 !important;
}

.icon-show:hover {
    color: #3E7099 !important;
}

.icon-edit {
    color: #1C2331 !important;
}

.icon-edit:hover {
    color: #3E7099 !important;
}


.removerOutraMedidaControle {
    color: #1C2331 !important;
}

.removerOutraMedidaControle:hover {
    color: #3E7099 !important;
}

.td_option {
    padding: 0;
    margin: 0;
    vertical-align: middle;
}

.td_option_wrapper {
    all: unset;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0;
    margin: 0;
}

.td_option_wrapper a,
.td_option_wrapper button {
    all: unset;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px !important;
    height: 30px !important;
    /* padding: 8px; */
    background: none;
    border: none;
    cursor: pointer;
    color: #1C2331;
}

.td_option_wrapper form {
    all: unset;
    display: inline-flex;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
}

.td_option_wrapper form button {
    all: unset;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px !important;
    height: 30px !important;
    cursor: pointer;
    color: #1C2331;
}

.td_option_wrapper a.disabled,
.td_option_wrapper button.disabled {
    pointer-events: none;
    opacity: 0.5;
}

.td_option_wrapper a:hover i,
.td_option_wrapper button:hover i,
.td_option_wrapper form button:hover i,
.td_option_icon:hover {
    color: #3E7099;
}

.td_option_icon {
    all: unset;
    font-size: 1rem;
    color: #1C2331;
    line-height: 1;
    margin: 0;
    padding: 0;
    display: inline-block;
    text-align: center;
    align-content: center;
}

/* ==========================================================================
   INPUTS FILE (md-filled-input)
   ========================================================================== */

.md-file-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.custom-file-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid var(--md3-outline-variant);
    border-radius: 6px;
    overflow: hidden;
    height: 56px;
    background-color: #fff;
}

.custom-file-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.custom-file-button {
    background-color: var(--md3-primary);
    color: #fff;
    border: none;
    padding: 0 12px;
    height: 100%;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.5s;
}

.custom-file-button:hover {
    background-color: var(--md3-primary-hover);
}

.custom-file-button:active,
.custom-file-button:focus  {
    background-color: var(--md3-primary-focus);
}

.custom-file-text {
    flex: 1;
    padding: 0 12px;
    font-size: 16px;
    color: var(--md3-on-surface);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
