/* ==========================================================================
   1. CONFIGURAÇÕES GLOBAIS E TIPOGRAFIA
   ========================================================================== */
@import url("https://fonts.googleapis.com/css?family=Nunito:400,600,700,800,900&display=swap");

:root {
    --sidebar-width: 250px;
    --color-primary: #049DD9;
    --color-highlight: #049DBF;

* {
    outline: none !important;
}

body {
    background-color: #F2F2F2 !important;
    font-family: "Nunito", sans-serif;
    margin: 0;
    font-size: 14px;
    padding-bottom: 65px;
}

html {
    overflow-x: hidden;
    position: relative;
    min-height: 100%;
}

/* ==========================================================================
   2. TOPNAV (Barra Superior Branca Purificada)
   ========================================================================== */
#topnav {
    position: fixed;
    right: 0;
    left: 0;
    top: 0;
    z-index: 1030;
    transition: all .5s ease;
}

    #topnav .topbar-main {
        background-color: #ffffff !important;
        border-bottom: #e2e8f0 solid 1px !important;
        padding: 12px 0 !important;
        height: 62px;
    }

        #topnav .topbar-main .logo {
            line-height: 70px;
            float: left;
            margin-right: 48px;
        }

.profile-username {
    color: #374151 !important;
    font-weight: 600;
    line-height: 36px;
    margin-left: 45px;
    display: block;
}

.profile img {
    border: 2px solid #edf0f0;
    height: 36px;
    width: 36px;
    float: left;
    border-radius: 50%;
}

.header-logo-modern {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
}

    .header-logo-modern .logo-icon {
        width: 36px;
        height: 36px;
        background-color: #049DD9 !important;
        border-radius: 9px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 6px rgba(4, 157, 217, 0.2);
    }

        .header-logo-modern .logo-icon i {
            font-size: 14px;
        }

    .header-logo-modern .logo-text h5 {
        color: #2c3144;
        font-weight: 800;
        font-size: 1.15rem;
        margin: 0;
        line-height: 1;
        letter-spacing: -0.3px;
    }

    .header-logo-modern .logo-text small {
        color: #9ca3af;
        font-size: 10px;
        font-weight: 600;
        display: block;
        margin-top: 2px;
    }

.dropdown-menu {
    border: 0;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    padding: 4px 0;
}

    .dropdown-menu li a {
        font-size: 14px;
        padding: 6px 20px;
    }

        .dropdown-menu li a:hover {
            color: #049DD9;
            background-color: #f8f9fa !important;
        }

.dropdown-toggle::after {
    display: none !important;
}

/* ==========================================================================
   3. SIDEBAR (Menu Lateral com Efeito de Pílula Flutuante)
   ========================================================================== */
.sidebar {
    position: fixed;
    top: 62px !important;
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - 62px) !important;
    background: linear-gradient(180deg, #049DD9 0%, #049DBF 100%) !important;
    border-right: none !important;
    padding-top: 1.5rem !important;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.02) !important;
}

    .sidebar .menu {
        list-style: none;
        padding: 0;
        margin: 0;
    }

        .sidebar .menu li a {
            display: flex !important;
            align-items: center !important;
            color: rgba(255, 255, 255, 0.85) !important;
            text-decoration: none;
            padding: 0.8rem 1.2rem !important;
            border-radius: 12px;
            margin: 0 12px 4px 12px !important;
            transition: all 0.2s ease;
        }

            .sidebar .menu li a:hover {
                background-color: rgba(255, 255, 255, 0.1) !important;
                color: #ffffff !important;
            }

            .sidebar .menu li a span {
                font-size: 15px !important;
                font-weight: 700 !important;
                display: inline-block !important;
            }

            .sidebar .menu li a i {
                font-size: 18px !important;
                margin-right: 12px;
            }

        .sidebar .menu li.active > a {
            background-color: #ffffff !important;
            color: #049DD9 !important;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06) !important;
        }

            .sidebar .menu li.active > a i {
                color: #049DD9 !important;
            }

    .sidebar .has-submenu .chev {
        margin-left: auto !important;
        font-size: 11px;
        opacity: 0.7;
        transition: transform 0.2s ease;
    }

    .sidebar .has-submenu.open .chev {
        transform: rotate(90deg);
        opacity: 1;
    }

    .sidebar .submenu {
        list-style: none;
        padding: 2px 0 6px 0 !important;
        margin: 0;
    }

        .sidebar .submenu li a {
            font-size: 0.9rem !important;
            font-weight: 500 !important;
            padding-left: 2.8rem !important;
            color: rgba(255, 255, 255, 0.75) !important;
            margin: 0 12px 2px 12px !important;
            background-color: transparent !important;
        }

            .sidebar .submenu li a:hover {
                background-color: rgba(255, 255, 255, 0.08) !important;
                color: #ffffff !important;
            }

        .sidebar .submenu li.sub-active a {
            color: #ffffff !important;
            font-weight: 700 !important;
            background-color: rgba(255, 255, 255, 0.15) !important;
        }

/* ==========================================================================
   4. COMPONENTES DE CONTEÚDO
   ========================================================================== */

body > .header-bg + div,
.wrapper,
form .container {
    margin-left: var(--sidebar-width) !important;
    width: calc(100% - var(--sidebar-width)) !important;
    padding: 30px 40px !important;
    margin-top: 62px !important;
    display: block !important;
    float: left !important;
    box-sizing: border-box !important;
}

    .wrapper .container-fluid,
    .wrapper .container,
    form .container .bgInterno {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        text-align: left !important;
    }

    .wrapper h2,
    form .container h2,
    .bgInterno h2 {
        font-size: 17px !important;
        color: #212529 !important;
        text-transform: uppercase !important;
        font-weight: 800 !important;
        font-family: 'Nunito', sans-serif !important;
        margin: 20px 0 25px 0 !important;
        display: block !important;
    }

        .wrapper h2:after,
        form .container h2:after,
        .bgInterno h2:after {
            height: 5px !important;
            width: 70px !important;
            border-radius: 20px !important;
            content: " " !important;
            background-color: #005ac5 !important;
            display: block !important;
            margin-top: 6px !important;
        }

.card, .bgInterno {
    background-color: #ffffff !important;
    border: none !important;
    border-radius: 12px !important;
    -webkit-box-shadow: 0px 0px 35px 0px rgba(0,0,0,0.04) !important;
    box-shadow: 0px 0px 35px 0px rgba(0,0,0,0.04) !important;
    margin-bottom: 30px !important;
    width: 100% !important;
}

.card-body {
    padding: 35px !important;
}

/* ==========================================================================
   5. AJUSTE DE FORMULÁRIOS, INPUTS E TABELAS LEGADAS
   ========================================================================== */
.form-group.col-md-3 {
    max-width: 320px !important;
    width: 100% !important;
    margin-bottom: 1.5rem !important;
}

.table-responsive {
    width: 100% !important;
    overflow-x: auto !important;
    margin-top: 15px;
}

    .table-responsive .table {
        width: 100% !important;
        max-width: 100% !important;
    }

/* ==========================================================================
   6. RESPONSIVIDADE AUTOMÁTICA (Mágica para Celular e Tablet)
   ========================================================================== */
@media (max-width: 991.98px) {
    .sidebar {
        top: 0 !important;
        height: 100vh;
        transform: translateX(-100%);
        z-index: 1050;
    }

        .sidebar.show {
            transform: translateX(0);
        }

    body > .header-bg + div,
    .wrapper,
    form .container,
    .bgInterno {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 15px !important;
        margin-top: 62px !important;
        float: none !important;
    }
}

form .bgInterno {
    margin-left: 0 !important;
    margin-top: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 2.5rem !important;
    box-shadow: none !important;
    background-color: transparent !important;
}

form .card {
    width: 100% !important;
    margin-top: 0 !important;
}

.wrapper form .container {
    margin-left: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Estilo moderno para o Painel de Pesquisa */
.pesquisa-card {
    background: #ffffff;
    border-radius: 16px !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03) !important;
    padding: 25px !important;
}

.input-moderno {
    border-radius: 8px !important;
    border: 1px solid #e0e0e0 !important;
    padding: 10px 15px !important;
    transition: all 0.3s ease;
}

    .input-moderno:focus {
        border-color: #049DD9 !important;
        box-shadow: 0 0 0 3px rgba(4, 157, 217, 0.1) !important;
    }

.btn-moderno {
    border-radius: 8px !important;
    padding: 10px 25px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease;
}

.btn-pesquisar {
    background: #049DD9;
    color: white;
}

    .btn-pesquisar:hover {
        background: #037aa9;
        color: white;
    }

/* Remove margens extras do container principal */
.wrapper {
    padding-left: 20px !important;
    padding-right: 20px !important;
}

/* Garante que o card ocupe o máximo da largura da coluna */
.pesquisa-card {
    width: 100% !important;
    max-width: 100% !important;
}