body {
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    margin: 20px;
}

h2 {
    text-align: center;
}

/* LINKS */
a {
    text-decoration: none;
    padding: 6px 10px;
    background: #007bff;
    color: white;
    border-radius: 4px;
    margin-right: 5px;
}

a:hover {
    background: #0056b3;
}

/* TABLAS GENERALES (PRODUCTOS, FACTURAS) */
.tabla {
    width: 80%;
    margin: auto;
    border-collapse: collapse;
    background: white;
}

.tabla th {
    background: #333;
    color: white;
}

.tabla th,
.tabla td {
    padding: 10px;
    text-align: center;
    border: 1px solid #ccc;
}

.tabla tr:nth-child(even) {
    background: #f2f2f2;
}

/* FORMULARIOS */
form {
    width: 400px;
    margin: 30px auto;
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0px 0px 10px rgba(0,0,0,0.1);
}

/* LABELS */
label {
    font-weight: bold;
    display: block;
    margin-top: 10px;
}

/* INPUTS */
input,
select {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
    outline: none;
    box-sizing: border-box;
    transition: 0.3s;
}

/* FOCUS */
input:focus,
select:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0,123,255,0.5);
}

/* BOTONES */
button {
    padding: 10px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
}

button:hover {
    background: #218838;
}

.form-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* BASE PARA TODOS LOS BOTONES */
.btn {
    flex: 1; /* 🔥 hace que ambos ocupen el mismo ancho */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 45px; /* 🔥 misma altura para todos */
    padding: 0 20px;
    border-radius: 6px;
    font-size: 16px;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

/* BOTÓN ACTUALIZAR */
.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

/* BOTÓN CANCELAR */
.btn-cancelar {
    background: #007bff;
    color: white;
}

.btn-cancelar:hover {
    background: #0056b3;
}
/* PRODUCTOS DINÁMICOS */
.grupo-productos {
    margin-top: 20px;
}

.producto-item {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fafafa;
    margin-top: 10px;
}

/* ========================= */
/* 🧾 FACTURA (AISLADA) */
/* ========================= */

.factura {
    width: 320px;
    margin: 30px auto;
    background: #fff;
    padding: 15px;
    border: 1px dashed #000;
    font-family: monospace;
}

/* HEADER */
.factura .header {
    text-align: center;
}

.factura .header h2 {
    margin: 0;
    font-size: 18px;
}

/* INFO */
.factura .info p {
    margin: 3px 0;
    font-size: 13px;
}

/* TABLA SOLO FACTURA */
.factura table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.factura th {
    border-bottom: 1px dashed #000;
}

.factura td,
.factura th {
    padding: 5px;
    text-align: left;
}

/* ALINEACIONES */
.factura td:nth-child(2) {
    text-align: center;
}

.factura td:nth-child(3) {
    text-align: right;
}

/* TOTALES */
.factura .totales {
    margin-top: 10px;
    font-size: 14px;
}

.factura .totales p {
    margin: 3px 0;
    text-align: right;
}

.factura .total {
    font-weight: bold;
    font-size: 16px;
}

/* FOOTER */
.factura .footer {
    text-align: center;
    margin-top: 10px;
    font-size: 12px;
}

/* BOTÓN VOLVER */
.btn-volver {
    display: block;
    width: 120px;
    margin: 15px auto;
    text-align: center;
    background: #007bff;
    color: white;
    padding: 8px;
    border-radius: 5px;
}

.btn-volver:hover {
    background: #0056b3;
}