body {
    margin: 0;
    padding: 10px;
    font-family: Arial, sans-serif;
}

.container {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin: 20px auto;
    max-width: 98%;
}

/* Contenedor para la tabla con scroll */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

.search-container {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}

.search-container input[type="text"] {
    width: 300px;
    padding: 10px;
    border: 2px solid #2052ee;
    border-radius: 5px;
    font-size: 16px;
}

.search-container button {
    padding: 10px 20px;
    background-color: #2052ee;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.search-container button:hover {
    background-color: #2052ee;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    white-space: nowrap;
}

/* Estilos específicos para cada columna */
th:nth-child(1), /* ID */
td:nth-child(1) {
    min-width: 50px;
}

th:nth-child(2), /* Código */
td:nth-child(2),
th:nth-child(17), /* Código Origen */
td:nth-child(17) {
    min-width: 150px;
}

th:nth-child(3), /* Chasis */
td:nth-child(3) {
    width: 120px;
}

th:nth-child(4), /* Batería */
td:nth-child(4) {
    width: 120px;
}

th:nth-child(5), /* Motor */
td:nth-child(5) {
    width: 120px;
}

/* Fechas */
th:nth-child(6),
th:nth-child(7),
th:nth-child(8),
th:nth-child(16),
td:nth-child(6),
td:nth-child(7),
td:nth-child(8),
td:nth-child(16) {
    min-width: 120px;
}

/* Campos de texto más largos */
th:nth-child(9), /* Destino */
td:nth-child(9),
th:nth-child(14), /* Notas */
td:nth-child(14) {
    min-width: 200px;
}

/* Campos de texto medianos */
th:nth-child(10), /* Factura */
td:nth-child(10),
th:nth-child(11), /* Albarán */
td:nth-child(11),
th:nth-child(12), /* Almacén */
td:nth-child(12),
th:nth-child(13), /* Orden Fabricación */
td:nth-child(13) {
    width: 100px;
}

/* Usuario */
th:nth-child(15),
td:nth-child(15) {
    width: 80px;
}

th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
}

th {
    background-color: #2052ee;
    color: white;
    font-size: 14px;
    padding: 10px 8px;
}

tr:nth-child(even) {
    background-color: #f8f9fa;
}

tr:hover {
    background-color: #f2f2f2;
}

.date-filter {
    display: flex;
    gap: 30px;
    margin-left: 35px;
    align-items: center;
    flex-wrap: wrap;
}

.date-filter input[type="date"] {
    padding: 10px;
    border: 2px solid #2052ee;
    border-radius: 5px;
    font-size: 16px;
}

/* Estilos para el login */
.login-body {
    background-image: url('../img/fondo.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 22vh;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.login-logo {
    display: block;
    margin: 0 auto 30px;
    max-width: 200px;
    height: auto;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    position: relative;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #2052ee;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
}

.login-form button {
    background-color: #2052ee;
    color: white;
    padding: 12px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-form button:hover {
    background-color: #0052a3;
}

.error-message {
    color: #dc3545;
    text-align: center;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f8d7da;
    border-radius: 5px;
    border: 1px solid #f5c6cb;
}

.logout-button {
    background-color: #dc3545;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.logout-button:hover {
    background-color: #c82333;
}

/* Estilos para filas clickables */
.clickable-row {
    cursor: pointer;
    transition: background-color 0.2s;
}

.clickable-row:hover {
    background-color: #e9ecef !important;
}

/* Estilos para la página de edición */
.edit-container {
    margin-top: 40px;
}

.back-button {
    background-color: #6c757d;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.back-button:hover {
    background-color: #5a6268;
}

/* Estilos para el formulario de edición */
.edit-form {
    margin-top: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 20px;
}

#id-display {
    grid-column: 1 / -1;
    padding: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    height: 100px;
    resize: vertical;
}

.readonly-field {
    padding: 8px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #666;
}

.button-group {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    grid-column: 2 / -1;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 0;
    width: 100%;
    justify-content: flex-end;
}

.cancel-button {
    background-color: #6c757d;
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}

.cancel-button:hover {
    background-color: #5a6268;
}

.delete-button {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.delete-button:hover {
    background-color: #c82333;
}

.save-button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.save-button:hover {
    background-color: #218838;
}

.id-display {
    font-size: 16px;
    color: #333;
    padding: 8px 0;
}

/* Añadir un contenedor para los elementos de búsqueda y filtros */
.search-filters {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.date-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-input-group label {
    color: #333;
    font-size: 14px;
    white-space: nowrap;
}

.search-filters input[type="text"],
.search-filters input[type="date"] {
    height: 18px;
    padding: 2px 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
}

.date-input-group input[type="date"] {
    height: 18px;
    width: 130px;
}

#searchInput,
#searchInputChasis,
#searchInputBateria,
#searchInputMotor {
    height: 18px;
    width: 130px;
}

.clear-filters-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 35px;
    transition: all 0.2s;
    color: #666;
    border-radius: 50%;
    width: 24px;
    height: 24px;
}

.clear-filters-btn:hover {
    color: #dc3545;
    transform: scale(1.1);
    background-color: rgba(220, 53, 69, 0.1);
}

.clear-filters-btn .material-icons {
    font-size: 18px;
}

.export-excel-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    transition: all 0.2s;
    color: #28a745;
    border-radius: 50%;
    width: 26px;
    height: 26px;
}

.export-excel-btn:hover {
    color: #fff;
    transform: scale(1.1);
    background-color: #28a745;
}

.export-excel-btn .material-symbols-outlined {
    font-size: 18px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-left: 10px;
    flex-wrap: wrap;
}

/* Estilos para la paginación */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.pagination-info {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.pagination-controls {
    display: flex;
    gap: 5px;
    align-items: center;
}

.pagination-btn {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    background-color: white;
    color: #495057;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 40px;
    text-align: center;
}

.pagination-btn:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.pagination-btn.active {
    background-color: #2052ee;
    color: white;
    border-color: #2052ee;
}

.pagination-btn.active:hover {
    background-color: #1a4fd6;
    border-color: #1a4fd6;
}

.pagination-btn:disabled {
    background-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    border-color: #dee2e6;
}