/* --- GERAL E RESET --- */
*, *::before, *::after {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex-grow: 1; /* Garante que o conteúdo principal ocupe o espaço disponível */
}

.container {
    width: 95%;
    max-width: 1200px;
    margin: 20px auto; /* Centraliza o container e adiciona margem superior/inferior */
    padding: 20px;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-radius: 8px;
}

/* --- HEADER E NAVEGAÇÃO --- */
header {
    background-color: #0056b3; /* Tom de azul mais profissional */
    color: white;
    padding: 1rem 5%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
}

header h1 a {
    color: white;
    text-decoration: none;
}

header nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px; /* Espaçamento entre os itens do menu */
}

header nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

header nav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.menu-toggle {
    display: none; /* Escondido em telas grandes */
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

/* --- FORMULÁRIOS E BOTÕES --- */
.form-container, form {
    display: flex;
    flex-direction: column;
    gap: 15px; /* Espaçamento entre os campos */
}
.form-container {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}
label {
    font-weight: bold;
    margin-bottom: 5px;
}
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="time"],
select, textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
button, .btn {
    background-color: #007bff;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    font-size: 1rem;
    transition: background-color 0.3s;
    align-self: flex-start; /* Alinha o botão à esquerda */
}
button:hover, .btn:hover {
    background-color: #0056b3;
}
.btn-danger { background-color: #dc3545; }
.btn-secondary { background-color: #6c757d; }

/* --- TABELAS --- */
.table-wrapper {
    overflow-x: auto; /* Permite scroll horizontal em tabelas largas em mobile */
}
.responsive-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
.responsive-table th, .responsive-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}
.responsive-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}
.responsive-table tr:nth-child(even) { background-color: #f9f9f9; }
.responsive-table tr:hover { background-color: #f1f1f1; }

/* --- PÁGINA DE LOGIN --- */
.login-body {
    display: flex; justify-content: center; align-items: center;
    height: 100vh; background-color: #f4f7f6;
}
.login-container {
    background: white; padding: 40px; border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); text-align: center;
    width: 90%; max-width: 400px;
}

/* --- MENSAGENS E ALERTAS --- */
.success { color: #155724; background-color: #d4edda; border: 1px solid #c3e6cb; padding: 10px; border-radius: 4px; }
.error { color: #721c24; background-color: #f8d7da; border: 1px solid #f5c6cb; padding: 10px; border-radius: 4px; }

/* --- FOOTER --- */
footer {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    background-color: #e9ecef;
    border-top: 1px solid #dee2e6;
    color: #6c757d;
}

/* --- RESPONSIVIDADE --- */
@media (max-width: 820px) {
    .menu-toggle {
        display: block; /* Mostra o botão hamburger */
    }

    header nav {
        position: absolute;
        top: 70px; /* Altura do header */
        left: 0;
        width: 100%;
        background-color: #004a99; /* Fundo um pouco diferente para destacar */
        display: none; /* Escondido por padrão */
    }
    
    header nav.active {
        display: block; /* Mostra o menu quando a classe 'active' é adicionada */
    }

    header nav ul {
        flex-direction: column; /* Itens do menu em coluna */
        width: 100%;
        gap: 0;
    }

    header nav ul li {
        text-align: center;
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    header nav ul li a {
        padding: 15px;
        display: block;
        width: 100%;
        border-radius: 0;
    }
}