body {
    font-family: Arial, sans-serif;
    background-color: #f4f7f6; /* Fondo gris muy claro */
    margin: 0;
    padding: 0;
    color: #333;
}

/* --- Contenedor Principal (Para todas las páginas) --- */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    border-radius: 8px;
}

/* --- Estilos de Títulos y Secciones --- */
h1 {
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.section-title { /* Nuevo estilo para subtítulos o títulos de secciones */
    font-size: 1.5em;
    font-weight: bold;
    color: #007bff;
    border-bottom: 2px solid #007bff;
    padding-bottom: 5px;
    margin-bottom: 20px;
}

/* --- Estilos de Tablas (Para Historial y Admin) --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

table th, table td {
    padding: 12px;
    text-align: left;
    border: 1px solid #e9ecef;
}

table thead th {
    background-color: #007bff;
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9em;
}

table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

table tbody tr:hover {
    background-color: #e2e6ea;
}

/* Ajustes de columnas numéricas a la derecha */
table td:nth-child(3), 
table td:nth-child(4), 
table td:nth-child(5),
table td:nth-child(6),
table td:nth-child(7) {
    text-align: right;
}

/* Centrar la columna de Acciones si aplica */
table td:last-child {
    text-align: center;
}

/* --- Estilos de Formularios (Mejorados) --- */
.card { /* Contenedor de formulario */
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #495057;
}

input[type="text"],
input[type="number"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 16px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

input:focus, select:focus, textarea:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* --- Estilos de Botones Generales (Para consistencia) --- */
.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.2s;
    display: inline-block;
    text-align: center;
}

.btn-primary { /* Azul - Usado para guardar o acciones principales */
    background-color: #007bff;
    color: white;
}
.btn-primary:hover {
    background-color: #0056b3;
}

.btn-success { /* Verde - Usado para añadir o confirmar */
    background-color: #28a745;
    color: white;
}
.btn-success:hover {
    background-color: #1e7e34;
}

.btn-danger { /* Rojo - Usado para eliminar o cancelar */
    background-color: #dc3545;
    color: white;
}
.btn-danger:hover {
    background-color: #c82333;
}

/* Estilo para los botones en la tabla de acciones (si tienen la clase pdf-btn) */
.pdf-btn {
    padding: 6px 10px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9em;
    transition: background-color 0.2s;
    border: none; /* Asegura que el botón no tenga bordes */
}
.pdf-btn:hover {
    background-color: #0056b3;
}


/* --- Estilos específicos de Cotizador (index.php) --- */
/* (Deja estos estilos como los tenías si ya funcionaban bien) */

.alerta {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}
.alerta-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}
.alerta-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* Contenedor de artículos */
.items-section {
    padding: 20px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background-color: #f8f9fa;
}

.item-row {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed #ced4da; /* Línea separadora */
    margin-bottom: 5px;
}
.item-row:last-of-type {
    border-bottom: none;
}

.item-row > div {
    flex: 1; 
}
.item-row .cantidad-input {
    flex: 0 0 80px; /* Ancho fijo para la cantidad */
    text-align: center;
}
.item-row .precio-unitario {
    flex: 0 0 100px;
    text-align: right;
    font-weight: bold;
}
.item-row .subtotal-item {
    flex: 0 0 100px;
    text-align: right;
    font-weight: bold;
}
.item-row .remove-item {
    flex: 0 0 auto;
}

/* Sección de totales */
.totales {
    margin-top: 20px;
    padding: 15px;
    background-color: #f0f3f5;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}
.total-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 5px;
}
.total-row label {
    flex: 0 0 150px;
    text-align: right;
    padding-right: 15px;
    font-weight: normal;
    color: #333;
}
.total-row input,
.total-row .valor-total {
    flex: 0 0 150px;
    text-align: right;
    font-size: 1.1em;
}

.total-final {
    font-size: 1.5em;
    font-weight: bold;
    color: #dc3545;
}

/* Sección de últimas cotizaciones */
.recent-quotes ul {
    list-style: none;
    padding: 0;
}
.recent-quotes li {
    background-color: #e9ecef;
    padding: 10px;
    margin-bottom: 8px;
    border-left: 5px solid #007bff;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95em;
}
.recent-quotes li span {
    margin-right: 15px;
}