* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background: #f0f2f5;
    padding: 20px;
}

.container { 
    max-width: 900px; 
    margin: 0 auto 30px; 
    background: white; 
    padding: 30px; 
    border-radius: 10px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); 
}

h1 { color: #333; margin-bottom: 20px; text-align: center; }

.info { 
    background: #e3f2fd; 
    padding: 15px; 
    border-radius: 5px; 
    margin-bottom: 20px; 
    font-size: 14px; 
    color: #1976d2; 
}

.input-area { 
    display: flex; 
    gap: 10px; 
    margin-bottom: 20px; 
    flex-wrap: wrap; 
}

input[type="text"], input[type="number"] { 
    padding: 12px; 
    border: 2px solid #ddd; 
    border-radius: 5px; 
    font-size: 16px; 
    flex: 1;
    min-width: 120px;
}

input:focus { border-color: #1976d2; outline: none; }

button { 
    padding: 12px 24px; 
    background: #1976d2; 
    color: white; 
    border: none; 
    border-radius: 5px; 
    cursor: pointer; 
    font-size: 16px;
}

button:hover { background: #1565c0; }
button.danger { background: #d32f2f; }
button.success { background: #388e3c; }

table { width: 100%; border-collapse: collapse; margin-top: 20px; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid #ddd; }
th { background: #f5f5f5; font-weight: bold; }

.total { 
    font-size: 24px; 
    font-weight: bold; 
    color: #1976d2; 
    text-align: right; 
    margin-top: 20px; 
}

.actions { 
    margin-top: 20px; 
    display: flex; 
    gap: 10px; 
    justify-content: flex-end; 
}

/* ESTILOS DO CUPOM (visível na tela para conferência) */
.cupom-fiscal {
    max-width: 400px;
    margin: 0 auto;
    background: white;
    border: 2px dashed #ccc;
    padding: 20px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.4;
}

.cupom-header {
    text-align: center;
    margin-bottom: 10px;
}

.cupom-header h2 {
    font-size: 18px;
    margin-bottom: 5px;
    font-family: 'Courier New', Courier, monospace;
}

.cupom-header p {
    font-size: 12px;
    margin: 2px 0;
}

.cupom-item { 
    display: flex; 
    justify-content: space-between; 
    margin: 5px 0; 
    font-size: 13px;
}

.cupom-total { 
    margin-top: 10px; 
    font-weight: bold; 
    font-size: 14px; 
    text-align: right;
}

.cupom-cliente {
    margin-top: 10px;
    font-size: 12px;
    border-top: 1px dashed #000;
    padding-top: 5px;
}

.cupom-footer { 
    text-align: center; 
    margin-top: 15px; 
    font-size: 11px; 
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.close { 
    color: #aaa; 
    float: right; 
    font-size: 28px; 
    font-weight: bold; 
    cursor: pointer; 
}

.close:hover { color: black; }

/* CONFIGURAÇÕES DE IMPRESSÃO */
@media print {
    body { 
        background: white;
        padding: 0;
        margin: 0;
    }
    
    .no-print, .modal { 
        display: none !important; 
    }
    
    .cupom-fiscal {
        display: block !important;
        border: none;
        margin: 0;
        padding: 10px;
        max-width: 80mm; /* Largura padrão de impressora térmica 80mm */
        width: 80mm;
        position: absolute;
        left: 0;
        top: 0;
        font-size: 12px;
    }
    
    .cupom-content {
        width: 100%;
    }
    
    /* Remove margens da página de impressão */
    @page {
        margin: 0;
        size: 80mm auto;
    }
}