* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f2f4f7;
    margin: 0;
    padding: 30px 15px;
    color: #1f2937;
}

.contenedor {
    max-width: 800px;
    margin: 0 auto;
}

h1 { margin: 0; font-size: 24px; }
h2 { font-size: 16px; color: #374151; margin-top: 24px; }

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    margin-top: 10px;
}

th, td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    font-size: 14px;
}

th { background: #f9fafb; font-weight: 600; }
.centro { text-align: center; }
.derecha { text-align: right; }

.btn {
    background: #2563eb;
    color: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
}
.btn:hover { background: #1d4ed8; }

.btn-peligro {
    background: #fff;
    color: #dc2626;
    border: 1px solid #dc2626;
    cursor: pointer;
    font-size: 13px;
}
.btn-peligro:hover { background: #fef2f2; }

.volver {
    display: inline-block;
    margin-bottom: 15px;
    color: #2563eb;
    text-decoration: none;
    font-size: 14px;
}

.badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.badge-ok { background: #dcfce7; color: #166534; }
.badge-pendiente { background: #fef9c3; color: #854d0e; }

.factura {
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    margin-top: 15px;
}

.factura-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #111827;
    padding-bottom: 15px;
}

.num-factura { color: #6b7280; margin: 4px 0 0; }
.estado-box { text-align: right; }
.estado-box p { margin: 6px 0 0; font-size: 13px; color: #6b7280; }

.datos-cliente {
    background: #f9fafb;
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 15px;
}
.datos-cliente p { margin: 4px 0; font-size: 14px; }

.totales {
    margin-top: 20px;
    margin-left: auto;
    width: 280px;
}
.fila-total {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
}
.total-final {
    border-top: 2px solid #111827;
    margin-top: 6px;
    padding-top: 10px;
    font-size: 18px;
    font-weight: 700;
}

.menu {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 15px 0 20px;
}

.btn-secundario {
    background: #fff;
    color: #2563eb;
    border: 1px solid #2563eb;
}
.btn-secundario:hover { background: #eff6ff; }

.form-agregar {
    margin-top: 25px;
    border-top: 1px solid #e5e7eb;
    padding-top: 15px;
}
.form-agregar form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.form-agregar select,
.form-agregar input[type="text"],
.form-agregar input[type="number"] {
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}
.form-agregar select { flex: 1; min-width: 200px; }
.form-agregar input[type="number"] { width: 80px; }

.form-vertical {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 400px;
    margin-top: 15px;
}
.form-vertical label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-top: 8px;
}
.form-vertical input,
.form-vertical select {
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}
.form-vertical .btn {
    margin-top: 15px;
    align-self: flex-start;
    border: none;
    cursor: pointer;
}
