/*Estilos gerais para todo o sistema privado ----------------------------------------------------*/
@import url('https://fonts.googleapis.com/css2?family=Open+Sans&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Open Sans', sans-serif;
    background-color: #f5f6f7;
    letter-spacing: 0.02em;
    font-size: 1rem;
}

:root {
    --theme: rgb(39, 67, 104);
    --theme_dark: rgb(29, 51, 79);
    --gray: #232323;
    --gray_2: #707070;
}

ul {
    list-style-type: none;
}

a {
    text-decoration: none;
    color: black;
}


/*Scroll Bar ------------------------------------------------------------------------------------*/
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--gray)
}

::-webkit-scrollbar-thumb {
    background: var(--theme)
}

::-webkit-scrollbar-thumb:hover {
    background: var(--theme_dark)
}


/*Estilos Padrão --------------------------------------------------------------------------------*/
section {
    display: flex;
    justify-content: center;
}

input,
select,
textarea {
    width: 300px;
    height: 40px;
    padding: 0.5em;
    font-size: 1rem;
    font-family: 'Open Sans', sans-serif;
    border: 1px solid #b1b1b1;
}

textarea {
    height: 100px
}

input[type="checkbox"],
input[type="radio"] {
    width: 15px;
    height: 15px;
    cursor: pointer;    
}

.m-container {
    display: flex;
    justify-content: center;
    width: 85vw;
    max-width: 1632px;
    padding: 1rem;
    border: 1px solid #f0f1f2;
    border-radius: 5px;
    background-color: white;
    margin-bottom: 1rem;
    flex-direction: column;
    box-shadow: 0 2px 3px rgba(56, 59, 61, .05);
}

.m-form-container {
    display: flex;
    align-items: center;
    flex-direction: column;
}

.m-header {
    display: flex;
    justify-content: center;
    width: 85vw;
    max-width: 1632px;
}

.m-icon {
    width: 36px;
    cursor: pointer;
}

.m-icon:hover {
    transform: scale(1.015);
}

input.m-invalid,
select.m-invalid,
textarea.m-invalid {
    border-color: red;
    box-shadow: 0 0 2px 0px red;
}

.m-invalid-msg {
    display: none;
    color: red;
    font-size: 12px
}

.m-subtitle {
    font-weight: bold;
    display: flex;
    font-size: 1.2rem;
    justify-content: center;
}

@media screen and (max-width: 1200px) {

    input,
    select,
    textarea {
        width: 100%;
    }
}

/*Endereço da Página ----------------------------------------------------------------------------*/
.m-page-address-container {
    display: flex;
    justify-content: start;
    width: 85vw;
    max-width: 1632px;
    gap: 0.2rem;
}

.m-page-address-container a,
.m-page-address-container span {
    font-size: 0.8rem;
}

.m-page-address-container a:hover,
.m-page-address-container span:hover {
    font-weight: bold;
    cursor: pointer;
}

@media screen and (max-width: 1200px) {
    .m-address-page {
        display: none;
    }
}

/*Cards de Navegação -------------------------------------------------------------------------------------*/
.m-navigation-cards {
    height: 80vh;
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
}

.m-page-menu {
    position: fixed;
    top: 10%;
    left: 50%;
    transform: translate(-50%, 0%);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    width: 60vw;
    max-width: 1632px;
    min-height: 40vh;
    max-height: 80vh;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    background-color: white;
    border: 1px solid #f0f1f2;
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    z-index: 10;
    overflow-y: auto;
}

.m-page-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 50%);
}

.m-page-menu-btn-closed {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
}

.m-page-menu-btn-closed:hover {
    color: var(--theme);
}


.m-navigation-cards a,
.m-page-menu a {
    padding: 1.5rem 2rem;
    border: none;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    transition: all 0.3s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 200px;
    text-align: center;
}

.m-page-menu a.card {
    border-radius: 12px 0px 0px 12px;
    z-index: 1;
}

.m-page-menu a.card-option {
    min-width: 0;
    padding: 1.5rem 0.5rem;
    border-radius: 0px 12px 12px 0px;
    cursor: pointer;
}

.m-navigation-cards a:hover,
.m-page-menu a:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
    background: linear-gradient(135deg, #4a90e2, #265aa0);
    color: #fff;
}

.m-navigation-cards a:active,
.m-page-menu a:active {
    transform: translateY(2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.js-card-option-modal {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.m-page-menu .card-option-modal {
    display: flex;
    align-items: center;
    margin: 0 0.5rem;

    .box {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -70%);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.5s ease-out, transform 0.5s ease-out;
        max-width: 1632px;
        display: flex;
        flex-direction: column;
        flex-wrap: wrap;
        justify-content: flex-start;
        align-items: center;
        gap: 0.2rem;
        padding: 2rem;
        background-color: white;
        border: 1px solid #f0f1f2;
        border-radius: 5px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
        z-index: 10;

        .btn-closed {
            position: absolute;
            top: 10px;
            right: 10px;
            background: none;
            border: none;
            font-size: 24px;
            font-weight: bold;
        }

        .btn-closed:hover {
            color: var(--theme);
            cursor: pointer;
        }

        h3 {
            margin-top: 1rem;
            margin-bottom: 0.5rem;
        }
    }

    .box.show {
        opacity: 1;
        visibility: visible;
        transform: translate(-50%, -50%);
        /* Garante que a caixa permaneça centralizada mesmo quando expandir */

    }
}


@media screen and (max-width: 1200px) {

    .m-navigation-cards,
    .m-page-menu {
        flex-direction: column;
    }
}

/*Cabeçalho -------------------------------------------------------------------------------------*/
header {
    display: flex;
    justify-content: center;
    position: sticky;
    top: 0;
    margin-bottom: 2rem;
    background-color: white;
    z-index: 99;
    box-shadow: 0 2px 3px rgba(151, 160, 167, 0.05);
}

header .m-title {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 1rem;
    padding: 0.5rem 0;
}

header h2 {
    border-bottom: 1px solid var(--theme);
    padding-right: 3rem;
    padding-left: 0.5rem;
}

@media screen and (max-width: 1200px) {
    header .m-title {
        flex-wrap: wrap;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 100%;
    }

    header h2 {
        padding-right: 0.5rem;
    }
}

/*Campo de Paginação ----------------------------------------------------------------------------*/
.m-paginator {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
}


/*Botões -----------------------------------------------------------------------------------------*/
.m-btn-field {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
}

.m-btn,
.m-btn-redirect {
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    margin: 0.1rem;
    border-radius: 0.25rem;
    color: #fff;
    cursor: pointer;
    font-family: 'Open Sans', sans-serif;
    font-size: 1em;
    transition: transform 0.3s ease-in-out;
    white-space: nowrap;
}

.m-btn-redirect {
    padding: 0rem 0.75rem;
    border-left: 1px solid transparent;
    border-right: 1px solid transparent;
    border-top: none;
    border-bottom: none;
}

.m-btn:hover {
    transform: scale(1.015);
}

.m-btn-false {
    visibility: hidden;
}

.m-btn-theme {
    color: #fff;
    background-color: var(--theme);
    border-color: var(--theme);
}

.m-btn-theme:hover {
    background-color: var(--theme_dark);
    border-color: var(--theme_dark);
}

.m-btn-gray {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

.m-btn-gray:hover {
    background-color: #5c666f;
    border-color: #5c666f;
}

.m-btn-green {
    color: #fff;
    background-color: #28a745;
    border-color: #28a745;
}

.m-btn-green:hover {
    background-color: #24993d;
    border-color: #24993d;
}

.m-btn-red {
    color: #fff;
    background-color: #dc3545;
    border-color: #dc3545;
}

.m-btn-red:hover {
    background-color: #c12d3b;
    border-color: #c12d3b;
}

.m-btn-yellow {
    color: #212529;
    background-color: #ffc107;
    border-color: #ffc107;
}

.m-btn-yellow:hover {
    background-color: #d6a100;
    border-color: #d6a100;
}

.m-btn-blue {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

.m-btn-blue:hover {
    background-color: #0066cc;
    border-color: #0066cc;
}

.m-btn-white {
    color: #212529;
    background-color: #f8f9fa;
    border-color: #f8f9fa;
}

.m-btn-white:hover {
    background-color: #e2e3e4;
    border-color: #e2e3e4;
}

.m-btn-black {
    color: #fff;
    background-color: #343a40;
    border-color: #343a40;
}

.m-btn-black:hover {
    color: #fff;
    background-color: #303338;
    border-color: #303338;
}

.m-btn-green-link {
    color: #28a745;
    background-color: transparent;
}

.m-btn-green-link:hover {
    color: #24993d;
}

.m-btn-blue-link {
    color: #007bff;
    background-color: transparent;
}

.m-btn-blue-link:hover {
    color: #0066cc;
}

.m-btn-red-link {
    color: #dc3545;
    background-color: transparent;
}

.m-btn-red-link:hover {
    color: #c12d3b;
}

@media screen and (max-width: 1200px) {
    .m-btn-field {
        flex-wrap: wrap;
    }
}

/*Campo de Consulta -----------------------------------------------------------------------------*/
.m-search {
    display: flex;
    align-items: center;
    margin: 0 0.5rem;

    input[type='text'] {
        width: 300px;
        height: 35px;
        padding: 0.5em;
    }

    .btn-show {
        background: none;
        border: none;
        padding: 0;
        font: inherit;
        color: inherit;
        cursor: pointer;
        font-size: 24px;
        opacity: 0.7;
        padding: 0 0.5rem;
        left: -70px;
        top: -18px;
        position: absolute;
    }

    .btn-show:hover {
        opacity: 1;
    }

    .btn-search {
        color: #444444;
        display: flex;
        justify-content: center;
        right: 1px;
        background: #e7e7e7;
        cursor: pointer;
        padding: 0.45em;
        border: 1px solid #444444;
        transition: 0.3s;
        height: 35px;
        width: 35px;
    }

    .btn-search:hover {
        color: #232323;
        background: #c0c0c0;
    }

    .box {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -70%);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.5s ease-out, transform 0.5s ease-out;
        max-width: 1632px;
        display: flex;
        flex-direction: column;
        flex-wrap: wrap;
        justify-content: flex-start;
        align-items: center;
        gap: 0.2rem;
        padding: 2rem;
        background-color: white;
        border: 1px solid #f0f1f2;
        border-radius: 5px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
        z-index: 10;

        .btn-closed {
            position: absolute;
            top: 10px;
            right: 10px;
            background: none;
            border: none;
            font-size: 24px;
            font-weight: bold;
        }

        .btn-closed:hover {
            color: var(--theme);
            cursor: pointer;
        }

        h3 {
            margin-top: 1rem;
            margin-bottom: 0.5rem;
        }

        .list {
            display: flex;
            flex-direction: column;
            overflow: auto;
            max-height: 300px;

            div {
                display: flex;
                flex-direction: column;
                position: relative;
            }

            input[type='text'] {
                margin-right: 50px;
            }

            input[type='date'] {
                width: 200px;
            }

            .date label {
                display: flex;
                flex-wrap: nowrap;
                align-items: center;

                span {
                    width: 70px;
                }
            }

            .checkbox label {
                display: flex;
                padding: 0.5rem 1rem;
                flex-wrap: nowrap;
                gap: 0.5rem;
                border-radius: 5px;
                align-items: center;
            }

            .checkbox label:hover {
                background-color: var(--theme);
                cursor: pointer;
                color: white;
            }

            button {
                position: absolute;
                top: -2px;
                right: 0;
                padding: 0.3rem 1rem;
            }
        }

        .btn-field {
            display: flex;
            width: 100%;
            margin-top: 0.75rem;
            align-items: center;
            justify-content: space-between;
        }

        .btn-search-show {
            display: flex;
            align-items: center;
            background: #e7e7e7;
            color: #444444;
            border: 1px solid #444444;
            padding: 0.5em 1rem;
            transition: 0.3s;
            gap: 0.5rem;
            font-size: 1rem;
            font-weight: bold;
            border-radius: 5px;
        }

        .btn-search-show:hover {
            color: #232323;
            background: #c0c0c0;
            cursor: pointer;
        }
    }

    .box.show {
        opacity: 1;
        visibility: visible;
        transform: translate(-50%, -50%);
        /* Garante que a caixa permaneça centralizada mesmo quando expandir */

    }
}

/*Lista de Itens --------------------------------------------------------------------------------*/
.m-list-field {
    display: flex;
    justify-content: flex-start;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem 0;
    width: 100%;
}

.m-list-field-box {
    display: flex;
    align-items: center;
    flex-direction: row;
    gap: 1rem;
}

.m-list-field-data {
    font-weight: bold;
    min-width: 300px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.m-list-field-options {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

@media screen and (max-width: 1200px) {
    .m-list-field-box {
        flex-direction: column;
        gap: 0;
    }

    .m-list-field-data {
        min-width: 0;
        justify-content: center;
        align-items: center;
    }
}


/*Configuração de Tabela ------------------------------------------------------------------------*/
.m-table {
    display: flex;
    justify-content: flex-start;
    flex-direction: column;
    width: 100%;

    .header {
        display: flex;
        flex-wrap: nowrap;
        font-weight: bold;
        align-items: center;
        gap: 0.5rem;
        padding: 1rem;
    }

    .box {
        border-radius: 5px;
        display: flex;
        flex-direction: row;
        background: white;
        transition: transform 0.3s ease-in-out;
        padding: 1rem;
        color: black;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        align-items: center;
        gap: 0.5rem;
        cursor: pointer;

        div {
            display: flex;
            flex-direction: row;
            flex-wrap: nowrap;
            align-items: center;
            gap: 0.5em;

            span:first-of-type {
                display: none;
            }
        }
    }

    .box:hover {
        transform: scale(1.015);
        background-color: var(--theme);
        color: white;
    }



    .dropdown {
        position: relative;

        .arrow {
            position: absolute;
            top: 15px;
            right: 5px;
            transition: transform 0.3s ease;
        }

        .rotate {
            transform: rotate(90deg);
        }

        .box:hover+.arrow {
            color: white;
        }

        .detail {
            display: flex;
            flex-direction: column;
            height: 0;
            overflow: hidden;
            transition: 0.1s ease;
            border: 0px solid #c9c9c9;
            border-top: 0px solid transparent;
            border-bottom-left-radius: 10px;
            border-bottom-right-radius: 10px;
            justify-content: flex-start;
            gap: 0.5rem;
            padding: 0;
            width: 100%;

            div {
                display: flex;
                align-items: center;
                flex-direction: row;
                gap: 1rem;

                span:first-of-type {
                    font-weight: bold;
                    min-width: 300px;
                    display: flex;
                    align-items: center;
                    justify-content: flex-end;
                }
            }
        }

        .opened {
            border: 1px solid #c9c9c9;
            border-top: 1px solid transparent;
            height: auto;
            margin-bottom: 0.5rem;
            padding: 0.5rem 0rem;
        }

    }
}



@media screen and (max-width: 1200px) {
    .m-table {
        justify-content: center;

        .header {
            display: none;
        }

        .box {
            flex-direction: column;
            align-items: center;
            justify-content: center;

            div {
                width: 100% !important;

                span:first-of-type {
                    display: inherit;
                    font-weight: bold;
                }
            }
        }

        .dropdown .detail div span:first-of-type {
            min-width: 0;
            margin-left: 0.2rem;
        }
    }
}

/*Configuração de botão flutuante com Dropdown --------------------------------------------------*/
.m-menu-field {
    display: flex;
    position: relative;
}

.m-menu-field-btn {
    background: none;
    border: none;
    padding: 0 0.5rem;
    cursor: pointer;
    opacity: 0.7;
    top: -2px;
    font-size: 2rem;
}

.m-menu-field-btn:hover {
    opacity: 1;
}

.m-menu-field-list {
    top: 40px;
    /*left:0 Definir o posicionamento negativo conforme a largura do conteúdo, mantendo alinhamento a direita*/
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border: 1px solid #f0f1f2;
    box-shadow: 0 5px 11px 0 rgba(56, 59, 61, 0.07);
    background-color: #fff;
    border-radius: 5px;
    padding: 0rem 0.5rem;
    gap: 0.5rem;
    overflow: hidden;
    position: absolute;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, visibility 0s 0.3s, transform 0.3s ease;
    min-width: fit-content;
    width: auto;
}

.m-menu-field-opened {
    max-height: 200px;
    opacity: 1;
    visibility: visible;
    padding: 0.5rem 0.5rem;
    transition: max-height 0.3s ease, opacity 0.3s ease, visibility 0s, transform 0.3s ease;
    transform: translateY(10px);
}

.m-menu-field li:hover {
    font-weight: bold;
}

.m-menu-field li label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: black;
    white-space: nowrap;
    width: 100%;
    cursor: pointer;
}

.m-menu-field-list li a,
.m-menu-field-list li span {
    white-space: nowrap;
}

/*Configuração de botão seletor -----------------------------------------------------------------*/
.m-select-field {
    display: flex;
    gap: 0.5rem;
}

.m-select-field-btn {
    display: inline-flex;
    align-items: center;
    border: 1px solid transparent;
    cursor: pointer;
    border-radius: 0.25rem;
    font-family: 'Open Sans', sans-serif;
    font-size: 1em;
    transition: transform 0.3s ease-in-out;
    background-color: #C0C0C0;
    color: white;
    white-space: nowrap;
}

.m-select-field-btn:hover {
    transform: scale(1.015);
}

.m-select-field-btn input {
    clip: rect(0 0 0 0);
    height: 1px;
    width: 1px;
    position: absolute;
}

.m-select-field span {
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
}

.m-select-field-btn input:not(:checked)+span {
    background-color: #C0C0C0;
    color: white;
}

.m-select-field-btn input:not(:checked):hover+span {
    background-color: #444444;
    color: white;
}

.m-select-field-btn input:checked+span {
    background-color: var(--theme);
    color: white;
}

/*Configuração de botão tipo interruptor --------------------------------------------------------*/
.m-switch-field {
    width: 50px;
    height: 30px;
    display: flex;
    gap: 0.5rem;
}

.m-switch-field:hover {
    transform: scale(1.015);
}

.m-switch-field input[type="checkbox"] {
    display: none;
}

.m-switch-field label {
    width: 100%;
    height: 100%;
    border-radius: 30px;
    background-color: #ccc;
    cursor: pointer;
}

.m-switch-field-btn {
    top: 0;
    left: 0;
    width: 60%;
    height: 100%;
    background-color: #fff;
    border-radius: 30px;
    transition: transform 0.3s;
    border: 0.01rem solid rgba(0, 0, 0, 0.2);
}

.m-switch-field input[type="checkbox"]:checked+label .m-switch-field-btn {
    transform: translateX(70%);
}

.m-switch-field input[type="checkbox"]:checked+label {
    background-color: #28a745;
}