/* =====================================================
   RESET
   ===================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}



/* =====================================================
   VARIÁVEIS GLOBAIS
   ===================================================== */

:root {

    --cor-fundo-body: #777;
    --cor-fundo-aplicacao: #e2e0db;
    --cor-barra-titulo: #35434b;
    --cor-menu: #d1cec7;
    --cor-menu-hover: #c4c1ba;
    --cor-borda-menu: #aaa69e;
    --cor-texto: #303030;

    /* BOTÃO MENU MOBILE */

    --menu-mobile-largura: 46px;
    --menu-mobile-altura: 42px;
    --menu-mobile-icone-largura: 22px;
    --menu-mobile-icone-altura: 18px;
    --menu-mobile-icone-espessura: 2px;
    --menu-mobile-cor-icone: #303030;
    --menu-mobile-cor-fundo: #d1cec7;
    --menu-mobile-cor-hover: #c4c1ba;
    --menu-mobile-cor-borda: #aaa69e;

}



/* =====================================================
   BASE
   ===================================================== */

html,
body {
    min-height: 100%;
}


body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--cor-fundo-body);
    color: #252525;
    min-height: 100vh;
    padding: 25px;
}



/* =====================================================
   APLICAÇÃO
   ===================================================== */

.aplicacao {
    width: 100%;
    max-width: 1100px;
    min-height: 650px;
    margin: 0 auto;
    background: var(--cor-fundo-aplicacao);
    border: 1px solid #4f5558;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}



/* =====================================================
   BARRA DE TÍTULO
   ===================================================== */

.barra-titulo {
    height: 48px;
    display: flex;
    align-items: center;
    padding: 0 18px;
    background: var(--cor-barra-titulo);
    color: #ffffff;
    border-bottom: 1px solid #252c30;
}


.barra-titulo h1 {
    font-size: 16px;
    font-weight: 600;
}


.nome-sistema {
    font-size: 16px;
    font-weight: 600;
}



/* =====================================================
   MENU PRINCIPAL
   ===================================================== */

.menu-principal {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: stretch;
    padding: 0 12px;
    background: var(--cor-menu);
    border-bottom: 1px solid var(--cor-borda-menu);
}


.menu-opcoes {
    display: flex;
    align-items: stretch;
    width: 100%;
}


.menu-principal button {
    min-width: 105px;
    padding: 0 16px;
    border: none;
    border-left: 1px solid transparent;
    border-right: 1px solid #b4b0a8;
    background: transparent;
    color: var(--cor-texto);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease;
}


.menu-principal button:first-child {
    border-left: 1px solid #b4b0a8;
}


.menu-principal button:hover {
    background: var(--cor-menu-hover);
}



/* =====================================================
   BOTÃO MENU MOBILE
   ===================================================== */

.btn-menu-mobile {
    display: none;
}



/* =====================================================
   ÍCONE HAMBÚRGUER
   ===================================================== */

.icone-menu {
    width: var(--menu-mobile-icone-largura);
    height: var(--menu-mobile-icone-altura);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}


.icone-menu span {
    display: block;
    width: 100%;
    height: var(--menu-mobile-icone-espessura);
    background: var(--menu-mobile-cor-icone);
}



/* =====================================================
   CABEÇALHO DAS PÁGINAS
   ===================================================== */

.cabecalho-pagina {
    width: 100%;
    margin-bottom: 26px;
}


.cabecalho-pagina h1 {
    color: #35434b;
    font-size: 25px;
    font-weight: 600;
}


.cabecalho-pagina p {
    margin-top: 6px;
    color: #666;
    font-size: 12px;
    line-height: 1.4;
}



/* =====================================================
   CONTEÚDO PADRÃO DAS PÁGINAS
   ===================================================== */

.conteudo-dashboard {
    width: 100%;
    padding: 30px 32px 35px;
}



/* =====================================================
   PAINÉIS
   ===================================================== */

.painel {
    width: 100%;
    background: #f4f3f0;
    border: 1px solid #aaa8a2;
    margin-bottom: 20px;
}


.titulo-painel {
    min-height: 38px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    background: #737d76;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}


.conteudo-painel {
    padding: 20px;
}



/* =====================================================
   FORMULÁRIOS
   ===================================================== */

.campo {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}


.campo label {
    margin-bottom: 7px;
    color: #444;
    font-size: 12px;
    font-weight: 600;
}


.campo input,
.campo select {
    width: 100%;
    height: 39px;
    padding: 0 10px;
    background: #fff;
    border: 1px solid #999;
    color: #333;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    outline: none;
}


.campo input:focus,
.campo select:focus {
    border-color: #5d6d75;
}



/* =====================================================
   BOTÕES
   ===================================================== */

.area-botao {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}


.area-botao button {
    min-width: 110px;
    height: 38px;
    padding: 0 16px;
    border: 1px solid #666;
    background: #737d76;
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    cursor: pointer;
}


.area-botao button:hover {
    background: #626b65;
}


.area-botao .botao-secundario,
.area-botao .btn-secundario {
    background: #d4d1ca;
    color: #333;
    border-color: #999;
}


.area-botao .botao-secundario:hover,
.area-botao .btn-secundario:hover {
    background: #c3c0b9;
}



/* =====================================================
   BOTÕES DE AÇÃO DAS TABELAS
   ===================================================== */

.btn-editar,
.btn-excluir {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 75px;
    height: 30px;
    margin: 0 2px;
    padding: 0 10px;
    border: 1px solid #666;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
}


.btn-editar {
    background: #737d76;
    color: #fff;
}


.btn-editar:hover {
    background: #626b65;
}


.btn-excluir {
    background: #9b4a4a;
    color: #fff;
    border-color: #7f3d3d;
}


.btn-excluir:hover {
    background: #853f3f;
}



/* =====================================================
   BOTÃO DE CONFIRMAÇÃO DE EXCLUSÃO
   ===================================================== */

.botao-confirmar-exclusao {
    min-width: 100px;
    height: 36px;
    padding: 0 15px;
    border: 1px solid #7f3d3d;
    background: #9b4a4a;
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    cursor: pointer;
}


.botao-confirmar-exclusao:hover {
    background: #853f3f;
}



/* =====================================================
   TABELAS
   ===================================================== */

.tabela-container {
    width: 100%;
    overflow-x: auto;
}


table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 12px;
}


th {
    height: 38px;
    padding: 0 10px;
    background: #d1cec7;
    border: 1px solid #aaa69e;
    color: #333;
    text-align: left;
    font-weight: 600;
}


td {
    min-height: 38px;
    padding: 9px 10px;
    border: 1px solid #ccc9c2;
    color: #444;
}


tbody tr:nth-child(even) {
    background: #f5f4f1;
}


tbody tr:hover {
    background: #e9e7e2;
}



/* =====================================================
   MENSAGENS DO SISTEMA
   ===================================================== */

.mensagem-sistema {
    display: flex;
    flex-direction: column;
    min-height: 20px;
    margin-top: 12px;
    font-size: 12px;
}


.mensagem-sistema-titulo {
    font-weight: 600;
}


.mensagem-sistema-texto {
    margin-top: 3px;
}



/* =====================================================
   MENSAGENS
   ===================================================== */

.mensagem {
    min-height: 20px;
    margin-top: 5px;
    font-size: 12px;
}


.mensagem.erro {
    color: #9b3030;
}


.mensagem.sucesso {
    color: #356b42;
}


.mensagem.aviso {
    color: #8a6d32;
}



/* =====================================================
   MODAIS
   ===================================================== */

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.45);
}


.modal.ativo {
    display: flex;
}


.modal-conteudo {
    width: 100%;
    max-width: 500px;
    background: #e2e0db;
    border: 1px solid #555;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.4);
}


.modal-conteudo .titulo-painel {
    min-height: 40px;
    background: #35434b;
}



/* =====================================================
   CONTEÚDO DOS MODAIS
   ===================================================== */

.mensagem-confirmacao-exclusao {
    padding: 20px;
    color: #444;
    font-size: 13px;
    line-height: 1.5;
}



/* =====================================================
   BOTÕES DOS MODAIS
   ===================================================== */

.modal-botoes {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 0 20px 20px;
}


.modal-botoes button {
    min-width: 100px;
    height: 36px;
    padding: 0 15px;
    border: 1px solid #777;
    background: #737d76;
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    cursor: pointer;
}


.modal-botoes button:hover {
    background: #626b65;
}


.modal-botoes .botao-secundario,
.modal-botoes .btn-cancelar {
    background: #d4d1ca;
    color: #333;
}


.modal-botoes .botao-secundario:hover,
.modal-botoes .btn-cancelar:hover {
    background: #c3c0b9;
}



/* =====================================================
   BARRA DE STATUS
   ===================================================== */

.barra-status {
    min-height: 28px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: var(--cor-menu);
    border-top: 1px solid var(--cor-borda-menu);
    color: #555;
    font-size: 11px;
}


.barra-status span + span {
    margin-left: 20px;
}



/* =====================================================
   RODAPÉ
   ===================================================== */

.rodape {
    min-height: 32px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    background: var(--cor-menu);
    border-top: 1px solid var(--cor-borda-menu);
    color: #666;
    font-size: 11px;
}



/* =====================================================
   CONTROLES DE JANELA
   ===================================================== */

.controles-janela {
    display: none;
}



/* =====================================================
   RESPONSIVIDADE — ATÉ 800PX
   ===================================================== */

@media (max-width: 800px) {

    body {
        padding: 10px;
    }


    .aplicacao {
        min-height: calc(100vh - 20px);
    }


    .menu-principal {
        overflow-x: auto;
        padding: 0;
    }


    .menu-opcoes {
        display: flex;
        flex-shrink: 0;
        width: max-content;
    }


    .menu-principal button {
        min-width: 95px;
        flex-shrink: 0;
    }


    .cabecalho-pagina {
        margin-bottom: 20px;
    }


    .cabecalho-pagina h1 {
        font-size: 23px;
    }

}



/* =====================================================
   RESPONSIVIDADE — ATÉ 650PX
   ===================================================== */

@media (max-width: 650px) {

    body {
        padding: 8px;
    }


    /* MENU MOBILE */

    .menu-principal {
        display: block;
        overflow: visible;
        padding: 0;
    }


    .menu-principal .btn-menu-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        width: var(--menu-mobile-largura);
        min-width: var(--menu-mobile-largura);
        height: var(--menu-mobile-altura);
        padding: 0;
        border: none;
        border-right: 1px solid var(--menu-mobile-cor-borda);
        background: var(--menu-mobile-cor-fundo);
        color: var(--menu-mobile-cor-icone);
        cursor: pointer;
    }


    .menu-principal .btn-menu-mobile:hover {
        background: var(--menu-mobile-cor-hover);
    }


    .menu-opcoes {
        display: none;
        width: 100%;
        background: #eceae6;
        border-top: 1px solid #aaa69e;
        border-bottom: 1px solid #aaa69e;
    }


    .menu-opcoes.aberto {
        display: block;
    }


    .menu-principal .menu-opcoes button {
        display: block;
        width: 100%;
        min-width: 0;
        height: 40px;
        padding: 0 15px;
        border: none;
        border-bottom: 1px solid #d0cdc6;
        background: transparent;
        color: #303030;
        font-family: Arial, Helvetica, sans-serif;
        font-size: 13px;
        text-align: left;
        cursor: pointer;
    }


    .menu-principal .menu-opcoes button:last-child {
        border-bottom: none;
    }


    .menu-principal .menu-opcoes button:hover {
        background: #d9d6d0;
    }


    /* CABEÇALHO */

    .cabecalho-pagina {
        margin-bottom: 17px;
    }


    .cabecalho-pagina h1 {
        font-size: 21px;
    }


    .cabecalho-pagina p {
        font-size: 11px;
    }


    /* PAINÉIS */

    .painel {
        margin-bottom: 15px;
    }


    .titulo-painel {
        min-height: 36px;
        padding: 0 12px;
        font-size: 12px;
    }


    .conteudo-painel {
        padding: 15px;
    }


    /* FORMULÁRIOS */

    .campo {
        margin-bottom: 13px;
    }


    .campo label {
        font-size: 11px;
    }


    .campo input,
    .campo select {
        height: 40px;
        font-size: 13px;
    }


    /* BOTÕES */

    .area-botao {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding-top: 5px;
    }


    .area-botao button {
        width: 100%;
        height: 40px;
    }


    /* TABELAS */

    .tabela-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }


    table {
        min-width: 600px;
    }


    th {
        height: 36px;
        padding: 0 8px;
        font-size: 11px;
    }


    td {
        padding: 8px;
        font-size: 11px;
    }


    /* BOTÕES DE AÇÃO */

    .btn-editar,
    .btn-excluir {
        min-width: 70px;
        height: 30px;
        padding: 0 8px;
        font-size: 11px;
    }


    /* MENSAGENS */

    .mensagem-sistema {
        margin-top: 10px;
        font-size: 11px;
    }


    .mensagem {
        font-size: 11px;
    }


    /* MODAIS */

    .modal {
        padding: 10px;
    }


    .modal-conteudo {
        max-width: 100%;
    }


    .modal-conteudo .titulo-painel {
        min-height: 38px;
    }


    .mensagem-confirmacao-exclusao {
        padding: 16px;
        font-size: 12px;
    }


    .modal-botoes {
        flex-direction: column;
        align-items: stretch;
        padding: 0 16px 16px;
        gap: 10px;
    }


    .modal-botoes button {
        width: 100%;
        height: 40px;
    }


    /* BARRA DE STATUS */

    .barra-status {
        min-height: 26px;
        padding: 0 10px;
        font-size: 10px;
    }


    .barra-status span + span {
        margin-left: 12px;
    }


    /* RODAPÉ */

    .rodape {
        min-height: 30px;
        padding: 0 10px;
        font-size: 10px;
    }

}



/* =====================================================
   RESPONSIVIDADE — ATÉ 360PX
   ===================================================== */

@media (max-width: 360px) {

    body {
        padding: 5px;
    }


    .aplicacao {
        min-height: calc(100vh - 10px);
    }


    .barra-titulo {
        height: 44px;
        padding: 0 12px;
    }


    .barra-titulo h1,
    .nome-sistema {
        font-size: 14px;
    }


    .cabecalho-pagina h1 {
        font-size: 19px;
    }


    .cabecalho-pagina p {
        font-size: 10px;
    }


    .conteudo-painel {
        padding: 12px;
    }


    .titulo-painel {
        padding: 0 10px;
    }


    .campo input,
    .campo select {
        height: 39px;
    }


    table {
        min-width: 560px;
    }


    .btn-editar,
    .btn-excluir {
        min-width: 65px;
        padding: 0 7px;
        font-size: 10px;
    }


    .mensagem-confirmacao-exclusao {
        padding: 12px;
    }


    .modal-botoes {
        padding: 0 12px 12px;
    }

}