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

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: #2c3e50;
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 2em;
}

header nav a {
    color: white;
    text-decoration: none;
    background: #e74c3c;
    padding: 10px 20px;
    border-radius: 5px;
    transition: background 0.3s;
}

header nav a:hover {
    background: #c0392b;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #2c8f27 0%, #057612 100%);
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    width: 400px;
    text-align: center;
}

.login-container h1 {
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 2em;
}

.login-form {
    text-align: left;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.login-form button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #66ea92 0%, #077d3a 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s;
}

.login-form button:hover {
    transform: translateY(-2px);
}

.error {
    background: #e74c3c;
    color: white;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

.default-users {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    font-size: 12px;
    color: #666;
}

/* Dashboard específico da cozinha */
.dashboard-cozinha {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

#lista-pedidos {
    margin-top: 20px;
}

.pedido-cozinha {
    background: #fff3cd;
    border: 2px solid #ffc107;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 10px;
}

.pedido-pronto {
    background: #d4edda;
    border-color: #28a745;
}

.pedido-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-weight: bold;
    font-size: 1.1em;
}

.pedido-itens {
    margin-left: 20px;
}

.pedido-item {
    margin-bottom: 5px;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .cards {
        grid-template-columns: 1fr;
    }
    
    .login-container {
        width: 90%;
        padding: 20px;
    }
}

/* Estilos para o Módulo de Usuários (e outros módulos futuros) */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.header-link {
    color: white;
    text-decoration: none;
}

/* Botões */
.btn {
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: opacity 0.3s;
}

.btn:hover {
    opacity: 0.85;
}

.btn-primary { background-color: #3498db; }
.btn-secondary { background-color: #7f8c8d; }
.btn-danger { background-color: #e74c3c; }

/* Alertas */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    border: 1px solid transparent;
}
.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}
.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}


/* Tabelas */
.table-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow-x: auto; /* Para responsividade em telas pequenas */
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead tr {
    background-color: #f2f2f2;
    border-bottom: 2px solid #ddd;
}

table th, table td {
    padding: 12px 15px;
    text-align: left;
}

table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

table tbody tr:hover {
    background-color: #f1f1f1;
}

.actions .btn {
    margin-right: 5px;
}

.status-active {
    color: #27ae60;
    font-weight: bold;
}
.status-inactive {
    color: #c0392b;
    font-weight: bold;
}

/* Formulários */
.form-container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #777;
}

.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    background-color: white;
}

.form-actions {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: right;
}


/* Estilos para o Módulo de Produtos */

.product-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid #eee;
}

.product-thumbnail-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background-color: #f2f2f2;
    border: 2px solid #eee;
}

.image-preview {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.image-preview img {
    max-width: 100px;
    height: auto;
    border-radius: 8px;
    border: 2px solid #ddd;
}

.image-preview label {
    font-weight: normal;
    font-size: 14px;
}

/* Estilos para Módulo de Pedidos */
.order-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}
.order-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-left: 5px solid #7f8c8d; /* Cor padrão */
}
.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
}
.order-card-header h3 { font-size: 1.1em; }
.status-tag { font-size: 0.8em; padding: 5px 10px; border-radius: 15px; color: white; font-weight: bold; }
.order-card-body { padding: 15px; line-height: 1.6; }
.order-card-body p { margin-bottom: 5px; }
.order-card-actions { padding: 15px; background: #f9f9f9; border-top: 1px solid #eee; }
.order-card-actions select { padding: 8px; border-radius: 5px; margin-left: 10px; }

/* Cores de status */
.status-pendente { border-left-color: #f1c40f; } .status-pendente .status-tag { background: #f1c40f; }
.status-preparando { border-left-color: #e67e22; } .status-preparando .status-tag { background: #e67e22; }
.status-pronto { border-left-color: #3498db; } .status-pronto .status-tag { background: #3498db; }
.status-entregue { border-left-color: #9b59b6; } .status-entregue .status-tag { background: #9b59b6; }
.status-apagar { border-left-color: #e74c3c; } .status-apagar .status-tag { background: #e74c3c; }

/* Formulário de Novo Pedido */
.order-builder { margin-top: 20px; padding: 20px; border: 1px solid #ddd; border-radius: 5px; }
.form-group.inline { display: flex; gap: 10px; align-items: center; }
.order-total { text-align: right; font-size: 1.5em; margin-top: 20px; }
.btn-remove-item { background: #e74c3c; color: white; border: none; cursor: pointer; padding: 3px 8px; border-radius: 4px; }

/* Estilos para Módulo de Mesas */
.mesa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}
.mesa-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
    padding: 20px;
    border-bottom: 5px solid #ccc;
    transition: transform 0.2s;
}
.mesa-card:hover {
    transform: translateY(-5px);
}
.mesa-card h2 {
    font-size: 2em;
    margin: 0;
}
.mesa-card .status-tag {
    display: inline-block;
    margin-top: 5px;
    font-size: 0.9em;
}
.mesa-card-body {
    margin: 15px 0;
    color: #555;
}
.mesa-card-actions {
    margin-top: 15px;
}
.mesa-card-actions select {
    padding: 8px;
    border-radius: 5px;
}
/* Cores de status para Mesas */
.mesa-card.status-livre { border-color: #2ecc71; } .status-livre .status-tag { background: #2ecc71; }
.mesa-card.status-ocupada { border-color: #e74c3c; } .status-ocupada .status-tag { background: #e74c3c; }
.mesa-card.status-reservada { border-color: #9b59b6; } .status-reservada .status-tag { background: #9b59b6; }

/* AJUSTES VISUAIS PARA MÓDULO DE MESAS */

.mesa-card {
    padding: 0; /* Remover padding antigo para dar espaço ao header */
    border: 1px solid #ddd;
    border-bottom: 0; /* Remover borda antiga */
}

.mesa-card-header {
    padding: 15px;
    color: white;
    border-radius: 9px 9px 0 0; /* Arredondar cantos superiores */
}

.mesa-card-header h2 {
    font-size: 1.8em;
}

.mesa-card-body {
    padding: 15px;
    text-align: left;
    line-height: 1.6;
}
.mesa-card-body a {
    color: #2980b9;
    font-weight: bold;
    text-decoration: none;
}
.mesa-card-body a:hover {
    text-decoration: underline;
}

.mesa-card-actions {
    padding: 15px;
    background-color: #f8f8f8;
    border-top: 1px solid #eee;
    text-align: right;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* Novas Cores de Status para Header */
.mesa-card.status-livre .mesa-card-header { background-color: #2ecc71; }
.mesa-card.status-ocupada .mesa-card-header { background-color: #e74c3c; }
.mesa-card.status-reservada .mesa-card-header { background-color: #9b59b6; }

/* Sobrescrevendo a cor da tag para melhor contraste */
.mesa-card .status-tag {
    background-color: rgba(0,0,0,0.15);
}

/* Estilos para Módulo de Caixa */
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 30px; }
.summary-card { padding: 20px; border-radius: 10px; color: white; }
.summary-card h3 { margin-top: 0; }
.summary-card p { font-size: 2em; font-weight: bold; margin: 0; }
.summary-card.entradas { background: linear-gradient(135deg, #27ae60, #2ecc71); }
.summary-card.saidas { background: linear-gradient(135deg, #c0392b, #e74c3c); }
.summary-card.saldo { background: linear-gradient(135deg, #2980b9, #3498db); }

.caixa-section { background: #fff; padding: 20px; border-radius: 10px; margin-bottom: 30px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
.caixa-section h3 { margin-top: 0; padding-bottom: 10px; border-bottom: 1px solid #eee; }
.lista-pagamentos { list-style: none; padding: 0; }
.lista-pagamentos li { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; border-bottom: 1px solid #f0f0f0; }
.lista-pagamentos li:last-child { border-bottom: none; }
.lista-pagamentos .valor { font-weight: bold; font-size: 1.1em; }
.tipo-entrada { color: #27ae60; font-weight: bold; }
.tipo-saida { color: #e74c3c; font-weight: bold; }

/* Estilos para Modal */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.5); }
.modal-content { background-color: #fefefe; margin: 15% auto; padding: 30px; border: 1px solid #888; width: 80%; max-width: 500px; border-radius: 10px; }
.close { color: #aaa; float: right; font-size: 28px; font-weight: bold; }
.close:hover, .close:focus { color: black; text-decoration: none; cursor: pointer; }

/* Estilos para View Pedidos por Mesa (Garçom) */
.pedidos-por-mesa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}
.mesa-pedidos-container {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.mesa-pedidos-container h3 {
    margin-top: 0;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}
.order-card-sm {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    margin-top: 15px;
}
.order-card-sm p {
    margin: 0 0 8px 0;
}

/* Estilos para a View da Cozinha */
.cozinha-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cozinha-coluna h3 { text-align: center; padding-bottom: 10px; border-bottom: 2px solid #eee; }
.pedidos-lista { background-color: #f8f9fa; border-radius: 8px; padding: 10px; min-height: 400px; }

.cozinha-card { background: #fff; border-radius: 8px; margin-bottom: 15px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); border-left: 5px solid #f1c40f; }
.cozinha-card.status-pronto { border-left-color: #2ecc71; }
.cozinha-card-header { display: flex; justify-content: space-between; padding: 10px 15px; background: #f1f1f1; border-bottom: 1px solid #ddd; }
.cozinha-card-body { padding: 15px; list-style: none; }
.cozinha-card-body .pedido-item { padding: 5px 0; border-bottom: 1px dashed #eee; }
.cozinha-card-actions { padding: 10px 15px; text-align: right; }

/* Estilos para Alerta/Toast de Novo Pedido */
.toast-alert { position: fixed; bottom: 20px; right: 20px; width: 350px; background-color: #fff; border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); z-index: 2000; border-top: 5px solid #3498db; }
.toast-header { padding: 10px 15px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; }
.toast-header strong { font-size: 1.1em; }
.toast-close { background: none; border: none; font-size: 1.5em; cursor: pointer; color: #888; }
.toast-body { padding: 15px; }

/* Estilos para o Painel de Pedidos Ativos no Dashboard */
.painel-pedidos-container {
    margin-top: 40px;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.painel-pedidos-container h3 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}
.select-sm {
    padding: 6px;
    border-radius: 4px;
    font-size: 12px;
}

/* Estilos para a Página de Relatórios */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}
.report-results { margin-top: 30px; }
.print-title { display: none; text-align: center; margin-bottom: 20px; }

/* Estilos de Impressão (A4) */
@media print {
    body { background: #fff; }
    .no-print, header, .form-container .form-actions { display: none !important; }
    .container { max-width: 100%; padding: 0; }
    main { margin-top: 0; }
    .print-title { display: block; }
    .summary-grid, .table-container { box-shadow: none; border: 1px solid #ccc; }
}
/* Estilos para página de Edição de Pedido */
.itens-existentes { background: #f8f9fa; padding: 15px; border-radius: 5px; margin-bottom: 25px; border: 1px solid #eee; }
.itens-existentes h4 { margin-top: 0; }
.itens-existentes ul { list-style: none; padding-left: 0; }
.itens-existentes li { padding: 5px 0; }
/* Estilos para Status de Despesa */
.status-paga { color: #27ae60; font-weight: bold; }
.status-pendente { color: #e67e22; font-weight: bold; }
