/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #3c231a 0%, #5a3628 50%, #3c231a 100%);
    min-height: 100vh;
    color: #333;
    background-attachment: fixed;
    position: relative;
}


body > * {
    position: relative;
    z-index: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    margin-bottom: 30px;
    color: white;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.logo-container {
    width: 100%;
    background: transparent;
    padding: 30px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-img {
    width: 250px;
    height: 250px;
    object-fit: cover;
    object-position: center;
    border-radius: 0;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
    transition: transform 0.3s ease;
    display: block;
    margin: 0 auto;
}

.logo-img:hover {
    transform: scale(1.05);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
}

.header-title {
    text-align: center;
    flex: 1;
    min-width: 300px;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    color: #ff8c42;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.95;
    color: #ffb366;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255,255,255,0.1);
    padding: 10px 20px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.user-name {
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
}

.btn-logout {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 5px;
    backdrop-filter: blur(10px);
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 15px 30px;
    margin: 0 5px;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: #9d5101;
    color: white;
    box-shadow: 0 4px 15px rgba(157, 81, 1, 0.4);
}

/* Tab Content */
.tab-content {
    display: none;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Formulários */
.form h2 {
    color: #9d5101;
    margin-bottom: 25px;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #9d5101;
    background: white;
    box-shadow: 0 0 0 3px rgba(157, 81, 1, 0.15);
}

.form-group input[readonly] {
    background: #e9ecef;
    color: #6c757d;
}

/* Itens de venda */
.item-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.item-row input {
    flex: 1;
    margin-bottom: 0;
}

.item-nome {
    flex: 2;
}

.item-qtd {
    flex: 1;
    max-width: 100px;
}

.item-preco {
    flex: 1;
    max-width: 120px;
}

.remove-item {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 40px;
}

.remove-item:hover {
    background: #c82333;
    transform: scale(1.05);
}

.add-item-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.add-item-btn:hover {
    background: #218838;
    transform: translateY(-2px);
}

/* Botões */
.submit-btn {
    background: linear-gradient(135deg, #9d5101 0%, #b8661a 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px auto 0;
    min-width: 200px;
    justify-content: center;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(157, 81, 1, 0.5);
    background: linear-gradient(135deg, #b8661a 0%, #d9771f 100%);
}

/* Relatórios */
.relatorios-container h2 {
    color: #9d5101;
    margin-bottom: 25px;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filtros {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    align-items: end;
    flex-wrap: wrap;
}

.filtros .form-group {
    margin-bottom: 0;
    min-width: 150px;
}

.btn-relatorio {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    height: fit-content;
}

.btn-relatorio:hover {
    background: #138496;
    transform: translateY(-2px);
}

/* Resumo Financeiro */
.resumo-financeiro {
    margin-bottom: 30px;
}

.card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.card h3 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.metricas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.metrica {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.metrica .valor {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    color: #9d5101;
    margin-bottom: 5px;
}

.metrica .label {
    color: #6c757d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Gráficos */
.graficos-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.grafico-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.grafico-card h3 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.2rem;
    text-align: center;
}

.grafico-card canvas {
    max-height: 300px;
}

/* Ações do Relatório */
.acoes-relatorio {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-excel {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-excel:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-print {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-print:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Toast */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(0);
}

.toast.error {
    background: #dc3545;
}

/* Cards de Seleção de Gráficos */
.graficos-selecao {
    margin-bottom: 30px;
}

.graficos-selecao h3 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.3rem;
    text-align: center;
}

.cards-graficos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card-grafico {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 15px;
}

.card-grafico:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.card-grafico.active {
    border-color: #9d5101;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.card-grafico-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #9d5101 0%, #b8661a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.card-grafico-content h4 {
    color: #495057;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.card-grafico-content p {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0;
}

/* Análise Diária */
.analise-diaria {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.analise-diaria h3 {
    color: #9d5101;
    margin-bottom: 20px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filtros-diarios {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    align-items: end;
    flex-wrap: wrap;
}

.filtros-diarios .form-group {
    margin-bottom: 0;
    min-width: 150px;
}

.btn-analise {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    height: fit-content;
}

.btn-analise:hover {
    background: #138496;
    transform: translateY(-2px);
}

.resultado-analise {
    margin-top: 20px;
}

.vendas-dia h4 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.lista-vendas {
    display: grid;
    gap: 15px;
}

.venda-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    border-left: 4px solid #667eea;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.venda-item:hover {
    background: #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.venda-item-content {
    flex: 1;
    cursor: pointer;
}

.venda-item-content:hover {
    transform: translateX(5px);
}

.venda-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.venda-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-editar-venda,
.btn-excluir-venda {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-editar-venda {
    background: #ffc107;
    color: #333;
}

.btn-editar-venda:hover {
    background: #e0a800;
    transform: scale(1.05);
}

.btn-excluir-venda {
    background: #dc3545;
    color: white;
}

.btn-excluir-venda:hover {
    background: #c82333;
    transform: scale(1.05);
}

.venda-data {
    font-size: 0.85rem;
    color: #666;
    margin-top: 8px;
}

.venda-tipo {
    background: #9d5101;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.venda-valor {
    font-size: 1.2rem;
    font-weight: bold;
    color: #28a745;
}

.venda-itens {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.venda-observacoes {
    color: #6c757d;
    font-size: 0.8rem;
    font-style: italic;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

.modal-content.modal-gastos {
    max-width: 1200px;
    width: 95%;
}

/* Tabs do modal de gastos */
.gastos-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.tab-gasto {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    transition: all 0.3s;
}

.tab-gasto:hover {
    color: #9d5101;
}

.tab-gasto.active {
    color: #9d5101;
    border-bottom-color: #9d5101;
}

.tab-gasto-content {
    display: none;
}

.tab-gasto-content.active {
    display: block;
}

/* Grid de gastos */
.gastos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.gasto-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.gasto-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.gasto-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #f8f9fa;
}

.gasto-img-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 48px;
}

.gasto-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.gasto-categoria {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
}

.gasto-valor {
    margin: 0 0 5px 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: #dc3545;
}

.gasto-data {
    margin: 5px 0;
    color: #666;
    font-size: 0.9rem;
}

.gasto-descricao {
    margin: 8px 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
    flex-grow: 1;
}

.gasto-pagamento,
.gasto-fornecedor,
.gasto-anexos {
    margin: 5px 0;
    color: #999;
    font-size: 0.85rem;
}

.gasto-actions {
    padding: 12px 15px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-ver-gasto,
.btn-editar-gasto,
.btn-excluir-gasto-card {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-ver-gasto {
    background: #f8f9fa;
    color: #9d5101;
    border: 1px solid #e0e0e0;
}

.btn-ver-gasto:hover {
    background: #e9ecef;
    border-color: #9d5101;
}

.btn-editar-gasto {
    background: #ffc107;
    color: #333;
}

.btn-editar-gasto:hover {
    background: #e0a800;
}

.btn-excluir-gasto-card {
    background: #dc3545;
    color: white;
}

.btn-excluir-gasto-card:hover {
    background: #c82333;
}

.gasto-loading,
.gasto-error {
    text-align: center;
    padding: 40px;
    color: #666;
}

.gasto-loading i {
    font-size: 2rem;
    color: #9d5101;
}

/* Cards Modernos de Vendas */
.registros-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.venda-card-modern {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid #e9ecef;
}

.venda-card-modern:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-color: #9d5101;
}

.venda-card-content {
    padding: 20px;
    cursor: pointer;
    flex: 1;
}

.venda-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
}

.venda-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #9d5101 0%, #b8661a 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(157, 81, 1, 0.3);
}

.venda-card-badge i {
    font-size: 0.85rem;
}

.venda-card-valor {
    text-align: right;
}

.valor-principal {
    font-size: 1.8rem;
    font-weight: 700;
    color: #28a745;
    line-height: 1;
}

.venda-card-body {
    margin-bottom: 16px;
}

.venda-card-data,
.venda-card-itens,
.venda-card-itens-lista,
.venda-card-observacoes {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #666;
    font-size: 0.9rem;
}

.venda-card-data i,
.venda-card-itens i,
.venda-card-observacoes i {
    color: #9d5101;
    width: 18px;
    text-align: center;
}

.venda-card-itens-lista {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    margin-top: 8px;
    border-left: 3px solid #9d5101;
}

.venda-card-itens-lista p {
    margin: 0;
    color: #495057;
    font-size: 0.85rem;
    line-height: 1.5;
}

.venda-card-observacoes {
    background: #fff3cd;
    padding: 10px;
    border-radius: 8px;
    border-left: 3px solid #ffc107;
    margin-top: 8px;
}

.venda-card-observacoes span {
    color: #856404;
    font-size: 0.85rem;
    font-style: italic;
}

.venda-card-footer {
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.venda-card-detalhes {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #9d5101;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s;
}

.venda-card-content:hover .venda-card-detalhes {
    color: #b8661a;
    transform: translateX(5px);
}

.venda-card-detalhes i {
    transition: transform 0.3s;
}

.venda-card-content:hover .venda-card-detalhes i {
    transform: scale(1.2);
}

.venda-card-actions {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    justify-content: flex-end;
}

.btn-editar-venda-card,
.btn-deletar-venda-card {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: 1rem;
}

.btn-editar-venda-card {
    background: #ffc107;
    color: #333;
}

.btn-editar-venda-card:hover {
    background: #e0a800;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.4);
}

.btn-deletar-venda-card {
    background: #dc3545;
    color: white;
}

.btn-deletar-venda-card:hover {
    background: #c82333;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.4);
}

.sem-registros {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.sem-registros i {
    display: block;
    margin-bottom: 15px;
}

.sem-registros p {
    font-size: 1.1rem;
    margin: 0;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background: linear-gradient(135deg, #9d5101 0%, #b8661a 100%);
    color: white;
    padding: 20px 25px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-modal {
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-modal:hover {
    transform: scale(1.1);
}

.modal-body {
    padding: 25px;
}

.pedido-info {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .label {
    font-weight: 600;
    color: #495057;
}

.itens-pedido {
    margin-bottom: 25px;
}

.itens-pedido h4 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.lista-itens {
    display: grid;
    gap: 10px;
}

.item-pedido {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-nome {
    font-weight: 600;
    color: #495057;
}

.item-detalhes {
    text-align: right;
    color: #6c757d;
    font-size: 0.9rem;
}

.analise-lucro {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
}

.analise-lucro h4 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.metricas-lucro {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.metrica-lucro {
    text-align: center;
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.metrica-lucro .valor {
    display: block;
    font-size: 1.3rem;
    font-weight: bold;
    color: #9d5101;
    margin-bottom: 5px;
}

.metrica-lucro .label {
    color: #6c757d;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.observacoes-pedido h4 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.observacoes-pedido p {
    color: #6c757d;
    font-style: italic;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 0;
}

.modal-footer {
    padding: 20px 25px;
    background: #f8f9fa;
    border-radius: 0 0 20px 20px;
}

.modal-footer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.modal-footer-admin-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-fechar-modal {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-fechar-modal:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-editar-venda-modal,
.btn-excluir-venda-modal {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-editar-venda-modal {
    background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
    color: #333;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.btn-editar-venda-modal:hover {
    background: linear-gradient(135deg, #ffb300 0%, #ffa000 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

.btn-excluir-venda-modal {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.btn-excluir-venda-modal:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

/* Responsividade */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .tabs {
        flex-direction: column;
        gap: 5px;
    }
    
    .tab-btn {
        margin: 0;
        justify-content: center;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    .item-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .item-row input {
        width: 100%;
    }
    
    .filtros {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filtros .form-group {
        min-width: auto;
    }
    
    .metricas {
        grid-template-columns: 1fr;
    }
    
    .graficos-container {
        grid-template-columns: 1fr;
    }
    
    .acoes-relatorio {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .tab-content {
        padding: 15px;
    }
    
    .form h2 {
        font-size: 1.5rem;
    }
}

/* Estilos do Modal de Produtos */
.modal-produtos {
    max-width: 1000px;
}

.produtos-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-produto {
    background: none;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-produto:hover {
    color: #9d5101;
}

.tab-produto.active {
    color: #9d5101;
    border-bottom-color: #9d5101;
    font-weight: 600;
}

.tab-produto-content {
    display: none;
}

.tab-produto-content.active {
    display: block;
}

.produtos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.produto-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.produto-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.produto-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: #f8f9fa;
}

.produto-img-placeholder {
    width: 100%;
    height: 150px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 3rem;
}

.produto-info {
    padding: 15px;
    flex-grow: 1;
}

.produto-nome {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    color: #333;
    font-weight: 600;
}

.produto-preco {
    margin: 0 0 8px 0;
    font-size: 1.3rem;
    color: #9d5101;
    font-weight: 700;
}

.produto-descricao {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

.produto-actions {
    padding: 15px;
    display: flex;
    gap: 8px;
    border-top: 1px solid #f0f0f0;
}

.btn-adicionar-produto,
.btn-editar-produto {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-adicionar-produto {
    background: linear-gradient(135deg, #9d5101 0%, #b8661a 100%);
    color: white;
}

.btn-adicionar-produto:hover {
    background: linear-gradient(135deg, #b8661a 0%, #d9771f 100%);
    transform: scale(1.05);
}

.btn-editar-produto {
    background: #f8f9fa;
    color: #9d5101;
    border: 1px solid #e0e0e0;
}

.btn-editar-produto:hover {
    background: #e9ecef;
    border-color: #9d5101;
}

.produto-loading,
.produto-error,
.sem-produtos {
    text-align: center;
    padding: 40px;
    color: #666;
    grid-column: 1 / -1;
}

.produto-loading i {
    font-size: 2rem;
    color: #9d5101;
    margin-bottom: 10px;
}

/* Formulário de Produto */
.form-produto {
    max-width: 600px;
    margin: 0 auto;
}

.foto-preview-container {
    margin-bottom: 15px;
}

.foto-preview-container img {
    display: block;
    margin: 0 auto 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.foto-preview-container input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s;
}

.foto-preview-container input[type="file"]:hover {
    border-color: #9d5101;
    background: #fff5e6;
}

.foto-preview-container small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.85rem;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.btn-cancelar {
    padding: 12px 24px;
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-cancelar:hover {
    background: #e9ecef;
    border-color: #ccc;
}

.btn-salvar {
    padding: 12px 24px;
    background: linear-gradient(135deg, #9d5101 0%, #b8661a 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-salvar:hover {
    background: linear-gradient(135deg, #b8661a 0%, #d9771f 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(157, 81, 1, 0.5);
}

.btn-excluir-produto {
    padding: 12px 24px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-excluir-produto:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

/* Responsive para modal de produtos */
@media (max-width: 768px) {
    .produtos-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .produto-actions {
        flex-direction: column;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-cancelar,
    .btn-salvar {
        width: 100%;
    }
}

/* Estilos para Gerenciamento de Usuários */
.usuarios-container {
    padding: 20px 0;
}

.usuarios-container h2 {
    color: #9d5101;
    margin-bottom: 25px;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.usuarios-actions {
    margin-bottom: 25px;
}

.btn-novo-usuario {
    background: linear-gradient(135deg, #9d5101 0%, #b8661a 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-novo-usuario:hover {
    background: linear-gradient(135deg, #b8661a 0%, #d9771f 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(157, 81, 1, 0.4);
}

.usuarios-list {
    display: grid;
    gap: 15px;
}

.usuario-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.usuario-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.usuario-info {
    flex: 1;
}

.usuario-info h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 1.2rem;
}

.usuario-email {
    margin: 0 0 12px 0;
    color: #666;
    font-size: 0.95rem;
}

.usuario-badges {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-admin {
    background: #9d5101;
    color: white;
}

.badge-usuario {
    background: #6c757d;
    color: white;
}

.badge-ativo {
    background: #28a745;
    color: white;
}

.badge-inativo {
    background: #dc3545;
    color: white;
}

.usuario-info small {
    color: #999;
    font-size: 0.85rem;
}

.usuario-actions {
    display: flex;
    gap: 10px;
}

.btn-editar-usuario {
    background: #f8f9fa;
    color: #9d5101;
    border: 1px solid #e0e0e0;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-editar-usuario:hover {
    background: #e9ecef;
    border-color: #9d5101;
}

.loading-message {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading-message i {
    font-size: 2rem;
    color: #9d5101;
    margin-bottom: 10px;
}

/* Estilos para cálculo de frete */
.btn-calcular-frete {
    background: linear-gradient(135deg, #9d5101 0%, #b8661a 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-calcular-frete:hover {
    background: linear-gradient(135deg, #b8661a 0%, #d9771f 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(157, 81, 1, 0.4);
}

.btn-calcular-frete:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

#freteInfo {
    margin-top: 15px;
}

#freteInfo p {
    margin: 8px 0;
    font-size: 0.95rem;
}

#freteInfo strong {
    color: #333;
}

#freteInfo #distanciaKm,
#freteInfo #valorFrete {
    color: #9d5101;
    font-weight: 700;
}