* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: #f4f6f9;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* HEADER (simplificado, sin menú hamburguesa ni sidebar) */
.main-header {
    background: #2c3e50;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.logo {
    height: 40px;
    width: auto;
}

.logo-area h1 {
    font-size: 1.5rem;
}

/* CONTENIDO PRINCIPAL */
.content {
    flex: 1;
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* TARJETAS Y FORMULARIOS */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card h2 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

input, select, button, textarea {
    width: 100%;
    padding: 0.8rem;
    margin: 0.5rem 0;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 1rem;
}

button {
    background: #2c3e50;
    color: white;
    border: none;
    cursor: pointer;
    transition: 0.2s;
}

button:hover {
    background: #1a242f;
}

.cards-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.historial-card {
    padding: 1rem;
}

.filter-bar {
    background: white;
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.filters select, .filters input, .filters button {
    width: auto;
    margin: 0;
}

.btn {
    display: inline-block;
    background: #2c3e50;
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    text-decoration: none;
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.data-table th {
    background: #f2f2f2;
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert.success {
    background: #d4edda;
    color: #155724;
}

.alert.error {
    background: #f8d7da;
    color: #721c24;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-card {
    width: 100%;
    max-width: 400px;
}

/* GRÁFICAS */
.graficas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

canvas {
    max-width: 100%;
    height: auto;
}

.chart-container {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.chart-container h3 {
    text-align: center;
    margin-bottom: 1rem;
    color: #2c3e50;
    font-size: 1.1rem;
}

.summary-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: space-between;
}

.summary-card {
    background: white;
    border-radius: 16px;
    padding: 1rem 2rem;
    flex: 1;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    border-left: 4px solid #2c3e50;
}

.summary-card h4 {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
}

.summary-card .value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2c3e50;
}

/* BOTONES ESPECIALES (para edición) */
.btn-edit {
    background-color: #f39c12;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.8rem;
    display: inline-block;
}
.btn-edit:hover {
    background-color: #e67e22;
}
.cancel {
    background-color: #95a5a6;
    margin-left: 0.5rem;
    display: inline-block;
    padding: 0.6rem 1rem;
    border-radius: 12px;
    text-decoration: none;
    color: white;
}

/* NUEVA PÁGINA DE INICIO (con botones) */
.inicio-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

.inicio-container h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.grid-botones {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.boton-inicio {
    background: #2c3e50;
    color: white;
    text-decoration: none;
    padding: 1.2rem;
    border-radius: 16px;
    text-align: center;
    font-weight: bold;
    transition: background 0.3s, transform 0.1s;
    font-size: 1.1rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.boton-inicio:hover {
    background: #1a242f;
    transform: scale(1.02);
}

.boton-salir {
    background-color: #e74c3c;
}

.boton-salir:hover {
    background-color: #c0392b;
}

/* BOTÓN VOLVER AL MENÚ */
.volver-menu {
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.btn-volver {
    display: inline-block;
    background-color: #95a5a6;
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    text-decoration: none;
    transition: background 0.3s;
}

.btn-volver:hover {
    background-color: #7f8c8d;
}

/* Asegura que labels y small se muestren en bloque */
label, small {
    display: block;
    margin-top: 0.5rem;
}

small {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}

/* Para los grupos de odómetro y manual que usan divs internos */
#odometro-group, #manual-group {
    margin-bottom: 1rem;
}

/* Opcional: mejorar espaciado general en formularios */
form > div, form > label, form > input, form > select, form > textarea, form > button {
    margin-bottom: 0.5rem;
}

.estado-critico { background-color: #f8d7da; }
.estado-alerta { background-color: #fff3cd; }
.estado-normal { background-color: #d4edda; }

.alert.warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

/* RESPONSIVE (solo ajustes de disposición, sin sidebar) */
@media (max-width: 768px) {
    .content {
        padding: 1rem;
    }

    .graficas-grid {
        grid-template-columns: 1fr;
    }

    .summary-cards {
        flex-direction: column;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filters select, .filters input, .filters button {
        width: 100%;
    }

    .grid-botones {
        grid-template-columns: 1fr;
    }

    .inicio-container h2 {
        font-size: 1.4rem;
    }
}