/* ========================= */
/* RESET */
/* ========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


/* ========================= */
/* BASE DA PÁGINA */
/* ========================= */

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f6f9;
}


/* ========================= */
/* MENU SUPERIOR */
/* ========================= */

.topbar {
    min-height: 70px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 20px;
    padding: 12px 30px;
    background: white;
    border-bottom: 1px solid #ddd;
}

.logo {
    height: 45px;
    flex-shrink: 0;
}

nav {
    display: flex;
    justify-content: center;
    gap: 10px;
}

nav a {
    background-color: #f3f4f6;
    border: none;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 15px;
    color: #000;
    text-decoration: none;
    white-space: nowrap;
}

nav a:hover {
    background: #e8eefc;
}

.usuario {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    color: #666;
    flex-shrink: 0;
}

.avatar-usuario {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 36px;
    height: 36px;

    border: none;
    border-radius: 50%;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;
}

.menu-usuario {
    position: absolute;

    top: 48px;
    right: 0;

    width: 260px;
    padding: 18px;

    display: flex;
    flex-direction: column;
    gap: 8px;

    background: white;

    border: 1px solid #e5e7eb;
    border-radius: 12px;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.12);

    z-index: 1000;
}

.menu-usuario strong {
    color: #1f2937;
    font-size: 15px;
}

.menu-usuario span {
    color: #6b7280;
    font-size: 13px;
}

.menu-usuario button {
    margin-top: 10px;
    padding: 9px 12px;

    background: white;
    color: #0b64ad;

    border: 1px solid #d6d6d6;
    border-radius: 8px;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;
}

.menu-usuario button:hover {
    background: #f3f4f6;
}

@media (max-width: 1200px) {
    .topbar {
        grid-template-columns: 1fr auto;
        gap: 12px 20px;
    }

    .topbar nav {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .topbar .usuario {
        grid-column: 2;
        grid-row: 1;
    }
}

/* ========================= */
/* CONTEÚDO DAS PÁGINAS */
/* ========================= */

main {
    padding: 30px;
}

.pagina {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ========================= */
/* CABEÇALHO DE LISTAGEM */
/* ========================= */

.cabecalho-listagem {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid #e5e7eb;
}

.cabecalho-listagem h1 {
    margin: 0;
    font-size: 24px;
}

.acoes-listagem {
    display: flex;
    align-items: center;
    gap: 8px;
}

.campo-pesquisa {
    width: 280px;
}

.botao-adicionar {
    width: 42px;
    height: 42px;
    border: 1px solid #0b64ad;
    border-radius: 8px;
    background: #0b64ad;
    color: white;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: 0.2s;
}

.botao-adicionar:hover {
    background: #095692;
    border-color: #095692;
}

/* ========================= */
/* MODAIS */
/* ========================= */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.conteudo-modal {
    background: white;
    width: 700px;
    max-width: 90%;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.cabecalho-modal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.cabecalho-modal h2 {
    margin: 0;
}

.fechar-modal {
    background: none;
    border: none;
    font-size: 26px;
    cursor: pointer;
    color: #666;
}

.fechar-modal:hover {
    color: #000;
}

.acoes-modal {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 28px;
}

/* COMPORTAMENTO DO MODAL */
body.modal-aberto {
    overflow: hidden;
}

/* ========================= */
/* FORMULÁRIOS */
/* ========================= */

/* Formulário */

.formulario {
    margin-top: 10px;
}


/* Grade do formulário */

.grade-formulario {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}


/* Grupo de campo */

.grupo-campo {
    display: flex;
    flex-direction: column;
}

.grupo-campo-inteiro {
    grid-column: 1 / 3;
}



/* Título do campo */

.grupo-campo label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #444;
}

.obrigatorio {
    color: #dc2626;
    font-weight: bold;
}


/* Campo */

.campo {
    height: 42px;
    border: 1px solid #d6d6d6;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 15px;
    outline: none;
    transition: 0.2s;
}


/* Campo em foco */

.campo:focus {
    border-color: #0b64ad;
    box-shadow: 0 0 0 3px rgba(11, 100, 173, 0.15);
}

.campo-erro {
    border-color: #dc2626;
}

.campo-erro:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}


/* Mensagem de erro */

.mensagem-erro {
    display: block;
    min-height: 18px;
    margin-top: 6px;
    font-size: 13px;
    color: #dc2626;
}

/* ========================= */
/* BOTÕES */
/* ========================= */

.botao-principal,
.botao-secundario {
    min-height: 42px;
    padding: 0 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.botao-principal {
    background: #0b64ad;
    color: white;
    border: 1px solid #0b64ad;
}

.botao-principal:hover {
    background: #095692;
    border-color: #095692;
}

.botao-secundario {
    background: white;
    color: #0b64ad;
    border: 1px solid #0b64ad;
}

.botao-secundario:hover {
    background: #eff6ff;
}

/* ========================= */
/* UTILITÁRIOS */
/* ========================= */

.hidden {
    display: none !important;
}

.escondido {
    display: none !important;
}

/* ========================= */
/* TOAST */
/* ========================= */

.toast {

    position: fixed;

    top: 24px;
    right: 24px;

    min-width: 280px;
    max-width: 420px;

    padding: 14px 18px;

    background-color: #f0fdf4;
    color: #166534;

    border: 1px solid #bbf7d0;
    border-radius: 10px;

    box-shadow:
        0 18px 45px rgba(15, 23, 42, 0.18),
        0 6px 18px rgba(15, 23, 42, 0.10);

    font-size: 14px;
    font-weight: 600;

    z-index: 10000;

    opacity: 0;

    transform:
        translateX(40px)
        translateY(-8px)
        scale(0.96);

    pointer-events: none;

    transition:
        opacity .30s ease,
        transform .30s ease;

}

.toast.visivel {

    opacity: 1;

    transform:
        translateX(0)
        translateY(0)
        scale(1);

}