/* Estilos Gerais e Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    background-color: #ADEBB3;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Menu Superior */
header {
    background-color: #1b4d3e;
    padding: 10px 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo img {
    height: 60px;
    max-width: 100%;
    object-fit: contain;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #ADEBB3;
}

/* Conteúdo e Páginas */
main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* MENU INICIAL EM GRADE 4x4 (4 COLUNAS) */
.grid-menu {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 20px 0;
}

.btn-menu {
    background-color: #1b4d3e;
    color: white;
    border: none;
    padding: 30px 20px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s, background-color 0.2s;
}

.btn-menu:hover {
    background-color: #143a2e;
    transform: scale(1.02);
}

/* Container do Botão Voltar */
.back-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 30px;
}

/* Botão Voltar Comum */
.btn-back {
    background-color: #1b4d3e;
    color: #fff;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    transition: transform 0.2s, background-color 0.2s;
}
.btn-back:hover {
    background-color: #143a2e;
    transform: scale(1.02);
}

/* Títulos fora das caixas brancas */
.page-title-outside {
    color: #1b4d3e; 
    margin-bottom: 20px;
}

.page-title-outside.centered {
    text-align: center;
}

/* CAIXAS BRANCAS PADRÃO (Corte, Login, Conselhos, etc.) */
.corte-container, .login-container, .rh-dashboard-container, .conselhos-container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.rh-dashboard-container {
    max-width: 100%;
}

/* Estilos Internos dos Conselhos */
.conselho-box {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.conselho-box:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.conselho-box h3 {
    color: #1b4d3e;
    margin-bottom: 10px;
    font-size: 1.15rem;
}

.conselho-box p {
    font-size: 1rem;
    line-height: 1.6;
    color: #444;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1b4d3e;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #1b4d3e;
    border-radius: 6px;
    font-size: 1rem;
}

.btn-login {
    background-color: #1b4d3e;
    color: white;
    border: none;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    margin-bottom: 20px;
    transition: background-color 0.2s;
}

.btn-calc, .btn-login:hover {
    background-color: #143a2e;
}

.btn-calc {
    background-color: #1b4d3e;
    color: white;
    border: none;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    margin-bottom: 20px;
    transition: background-color 0.2s;
}

/* Controles de Filtro Gerais do RH e Escolas */
.filter-wrapper-single {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-input-single {
    flex: 1;
    min-width: 250px;
    padding: 12px;
    border: 2px solid #1b4d3e;
    border-radius: 6px;
    font-size: 1rem;
}

.btn-clear-filter {
    background-color: #bf360c;
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.btn-clear-filter:hover {
    background-color: #870000;
}

.rh-counter {
    font-size: 1rem;
    font-weight: 600;
    color: #1b4d3e;
    margin-bottom: 20px;
}

.result-box {
    margin-top: 20px;
    padding: 15px;
    background-color: #f4fbf5;
    border-left: 5px solid #1b4d3e;
    border-radius: 4px;
    text-align: center;
    display: none;
}

.result-box p {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.mec-link {
    margin-top: 25px;
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: center;
}

.mec-link a {
    color: #1b4d3e;
    font-weight: bold;
    text-decoration: underline;
}

/* Classe de Destaque para as buscas */
mark.match-highlight {
    background-color: #ffeb3b;
    color: #000;
    padding: 2px 0;
    border-radius: 2px;
}

/* MCCEB */
.mcceb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 40px;
    background: #ADEBB3;
    padding: 30px;
    border-radius: 12px;
}

.mcceb-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.6);
    padding: 30px;
    border-radius: 12px;
}

.mcceb-title {
    font-family: 'Sigmar One', sans-serif;
    font-size: 35px;
    color: #1b4d3e;
    line-height: 1.3;
    text-align: center;
    flex: 1;
}

.logo-300 {
    width: 300px;
    height: auto;
    object-fit: contain;
}

.mcceb-text {
    flex: 1;
    font-size: 1.1rem;
    line-height: 1.6;
    text-align: justify;
}

.mcceb-img {
    max-width: 40%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.mcceb-links-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.mcceb-links-container h3 {
    color: #1b4d3e;
    margin-bottom: 20px;
    text-align: center;
}

.mcceb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.mcceb-link-card {
    background: #1b4d3e;
    border: 2px solid #1b4d3e;
    padding: 15px;
    text-align: center;
    border-radius: 6px;
    color: white;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.2s;
}

.mcceb-link-card:hover {
    background: white;
    color: #1b4d3e;
}

.insta-btn-container {
    text-align: center;
    margin-top: 20px;
}

.insta-mcceb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #ffffff;
    border: 2px solid #E1306C;
    color: #E1306C;
    padding: 12px 25px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.insta-mcceb img {
    width: 28px;
    height: 28px;
}

.insta-mcceb:hover {
    background: #E1306C;
    color: white;
    transform: translateY(-2px);
}

/* TELA DO CALENDÁRIO ESCOLAR */
.calendario-container {
    max-width: 850px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.calendario-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.btn-download-pdf {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s;
}

.btn-download-pdf:hover {
    background-color: #218838;
}

.pdf-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 141.4%; 
    border: 2px solid #1b4d3e;
    border-radius: 6px;
    background-color: #eee;
}

.pdf-wrapper embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ESCOLAS / IDEB - TABELAS */
.table-container {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    overflow-x: auto;
    margin-bottom: 30px;
    width: 100%;
}

#rh-dashboard-box .table-container {
    position: relative;
}

#rh-sticky-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: white;
    padding: 10px 0 8px;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 8px;
}

#tabelaServidores thead th {
    position: sticky;
    top: 0;
    background: #1b4d3e;
    z-index: 10;
    white-space: nowrap;
}

#rh-dashboard-box .overflow-wrapper {
    overflow-y: auto;
    max-height: 65vh;
}

.section-table-title {
    color: #1b4d3e;
    margin-top: 10px;
    margin-bottom: 15px;
    font-size: 1.3rem;
    border-left: 4px solid #1b4d3e;
    padding-left: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    min-width: 600px;
    margin-bottom: 20px;
}

table:last-child {
    margin-bottom: 0;
}

th, td {
    padding: 12px 15px;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #1b4d3e;
    color: white;
    font-weight: 600;
}

tr:hover {
    background-color: #f5f5f5;
}

        #tabelaEscolas tbody tr:hover,
#tabelaEscolasEstadual tbody tr:hover,
#tabelaEscolasPrivada tbody tr:hover,
#tabelaIdebEscola tbody tr:hover {
    background-color: #a9d1b1;
}

#tabelaServidores tbody tr:hover {
    background-color: #a9d1b1;
}

#tabelaServidores.no-copy {
    user-select: none;
    -webkit-user-select: none;
}

#tabelaServidores {
    min-width: 100% !important;
    table-layout: fixed;
    width: 100%;
}

#tabelaServidores th, 
#tabelaServidores td {
    padding: 8px 4px;
    font-size: 0.80rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* Ajuste de colunas do RH para comportar a nova coluna */
#tabelaServidores th:nth-child(1)  { width: 5%; }   /* UND      */
#tabelaServidores th:nth-child(2)  { width: 19%; }  /* SERVIDOR */
#tabelaServidores th:nth-child(3)  { width: 10%; }  /* VÍNCULO  */
#tabelaServidores th:nth-child(4)  { width: 11%; }  /* MATRÍCULA*/
#tabelaServidores th:nth-child(5)  { width: 13%; }  /* CARGO    */
#tabelaServidores th:nth-child(6)  { width: 9%; }   /* ADMISSÃO */
#tabelaServidores th:nth-child(7)  { width: 14%; }  /* FUNÇÃO   */
#tabelaServidores th:nth-child(8)  { width: 8%; }   /* TURNO    */
#tabelaServidores th:nth-child(9)  { width: 8%; }   /* INÍCIO   */
#tabelaServidores th:nth-child(10) { width: 4%; }   /* CH       */
#tabelaServidores th:nth-child(11) { width: 7%; }   /* ATUAL */

/* Cores da Situação do RH */
.status-ativo {
    background-color: #78FD66 !important;
    color: #000000 !important;
    font-weight: 600;
    text-align: center;
}
.status-permuta {
    background-color: #5c5b57 !important;
    color: #ffffff !important;
    font-weight: 600;
    text-align: center;
}
.status-licenca {
    background-color: #9c0505 !important;
    color: #ffffff !important;
    font-weight: 600;
    text-align: center;
}
.status-reduc {
    background-color: #c061cb !important;
    color: #000000 !important;
    font-weight: 600;
    text-align: center;
}
.status-readap {
    background-color: #62a0ea !important;
    color: #000000 !important;
    font-weight: 600;
    text-align: center;
}

.tabela-resumida {
    min-width: 100%;
}

.tabela-resumida th:first-child, 
.tabela-resumida td:first-child {
    text-align: left;
}

.tabela-resumida th:not(:first-child),
.tabela-resumida td:not(:first-child) {
    text-align: center;
    width: 12%;
}

.tabela-alinhada-ideb th.col-ano,
.tabela-alinhada-ideb td.col-ano {
    text-align: center;
}

.ideb-sections-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
}

.ideb-sections-wrapper .table-container {
    margin-bottom: 20px;
}

.scroller-desativado {
    overflow-x: visible !important; 
}

/* SETORES */
.setores-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 20px 0;
}

.btn-setor {
    background-color: #1b4d3e;
    color: white;
    border: none;
    padding: 25px 15px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    cursor: default;
}

/* ORGANOGRAMA */
.organograma {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 0 30px;
}

.linha-v {
    display: none;
}

.item-nivel {
    padding: 12px 18px;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    font-size: 0.95rem;
    border: 2px solid;
    color: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.nivel-1 {
    font-size: 1.15rem;
    background-color: #2e7d32;
    border-color: #143a2e;
    color: white;
}

.nivel-2 {
    font-size: 0.95rem;
    background-color: #1b4d3e;
    border-color: #1b5e20;
    color: white;
}

.nivel-3,
.gabinete {
    font-size: 0.88rem;
    background-color: #558b2f;
    border-color: #33691e;
    color: white;
}

.ramos-row {
    display: flex;
    gap: 30px;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    width: 100%;
}

.ramo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    flex: 1 1 0;
    max-width: 280px;
}

.ramos-row > .ramo > .item-nivel.nivel-2 {
    width: 100%;
    box-sizing: border-box;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grupo-nivel3 {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    width: 100%;
}

@media (max-width: 768px) {
    .organograma {
        gap: 6px;
    }

    .ramos-row {
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }

    .ramo {
        max-width: 100%;
        width: 100%;
        gap: 6px;
    }

    .ramo-executivo {
        order: 1;
    }

    .ramo-coordenacao {
        order: 2;
    }

    .ramo-administrativa {
        order: 3;
    }
}

/* RODAPÉ */
footer {
    background-color: #1b4d3e;
    color: white;
    padding: 40px 20px;
    margin-top: 40px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.footer-box h4 {
    color: #ADEBB3;
    margin-bottom: 12px;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 5px;
}

.footer-box a {
    color: white;
    text-decoration: underline;
}
.footer-box a:hover {
    color: #ADEBB3;
}

/* Responsividade (Dispositivos Móveis) */
@media (max-width: 992px) {
    .ideb-sections-wrapper {
        grid-template-columns: 1fr; 
        gap: 10px;
    }
    .tabela-resumida th, .tabela-resumida td {
        padding: 10px 8px;
        font-size: 0.85rem;
    }
    #tabelaServidores {
        min-width: 1000px !important;
        table-layout: auto !important;
    }
    #tabelaServidores th, 
    #tabelaServidores td {
        font-size: 0.9rem;
        white-space: nowrap !important;
    }
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        text-align: center;
    }

    .grid-menu {
        grid-template-columns: 1fr;
    }

    .mcceb-header, .mcceb-section {
        flex-direction: column !important;
        text-align: center;
    }

    .logo-300, .mcceb-img {
        max-width: 80%;
    }

    .setores-grid {
        grid-template-columns: 1fr;
    }
}
