* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
body {
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh; 
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.conteudo-principal {
    padding: 40px 0;
    flex: 1; 
}

/* Cabeçalho */
.cabecalho {
    background-color: #2c3e50;
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.cabecalho .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 24px;
    color: #3498db;
}

.menu {
    display: flex;
    list-style: none;
}

.menu li {
    margin: 0 10px;
}

.menu-link {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.menu-link.ativo,
.menu-link:hover {
    background-color: #34495e;
}

.acoes-usuario .botao-secundario {
    background-color: transparent;
    border: 1px solid #3498db;
    color: #3498db;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.acoes-usuario .botao-secundario:hover {
    background-color: #3498db;
    color: white;
}

.titulo-secao {
    margin-bottom: 30px;
    font-size: 2rem;
    color: #2c3e50;
    text-align: center;
}

/* Controles de Produtos */
.controles-produtos {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.busca-produtos {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.campo-busca {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.botao-adicionar {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.botao-adicionar:hover {
    background-color: #2980b9;
}

/* Tabela de Produtos */
.tabela-produtos {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.tabela-produtos th,
.tabela-produtos td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.tabela-produtos th {
    background-color: #34495e;
    color: white;
    font-weight: 600;
}

.tabela-produtos tr:hover {
    background-color: #f8f9fa;
}

.acoes-produto {
    display: flex;
    gap: 10px;
}

.botao-editar {
    background-color: #f39c12;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.botao-editar:hover {
    background-color: #e67e22;
}

.botao-excluir {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.botao-excluir:hover {
    background-color: #c0392b;
}

/* Modal de Edição */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-conteudo {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.modal-cabecalho {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ecf0f1;
}

.modal-titulo {
    font-size: 1.5rem;
    color: #2c3e50;
}

.modal-fechar {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #7f8c8d;
}

.modal-fechar:hover {
    color: #34495e;
}

.formulario-produto {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.grupo-formulario {
    margin-bottom: 15px;
}

.grupo-formulario label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
}

.grupo-formulario input,
.grupo-formulario select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.grupo-formulario-full {
    grid-column: 1 / -1;
}

.botoes-formulario {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
}

.botao-cancelar {
    background-color: #95a5a6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.botao-cancelar:hover {
    background-color: #7f8c8d;
}

.botao-salvar {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.botao-salvar:hover {
    background-color: #27ae60;
}

/* Mensagens */
.mensagem {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    display: none;
}

.mensagem-sucesso {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mensagem-erro {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}


.rodape {
    background-color: #2c3e50;
    color: white;
    padding: 20px 0;
    text-align: center;
    margin-top: auto; 
    width: 100%;
}

/* Responsividade */
@media (max-width: 768px) {
    .cabecalho .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .formulario-produto {
        grid-template-columns: 1fr;
    }
    
    .tabela-produtos {
        display: block;
        overflow-x: auto;
    }
    
    .conteudo-principal {
        padding: 20px 0;
    }
}

@media (max-width: 480px) {
    .controles-produtos {
        flex-direction: column;
    }
    
    .busca-produtos {
        min-width: 100%;
    }
    
    .botoes-formulario {
        flex-direction: column;
    }
    
    .titulo-secao {
        font-size: 1.5rem;
    }
}