/* ===== ESTILOS BASE GLOBALES ===== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== PREVENCIÓN DE SUPERPOSICIONES ===== */
.container-fluid {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

.row {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    max-width: 100%;
}

[class*="col-"] {
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box;
}

:root {
    --color-principal: #e74c3c;
    --color-secundario: #7f8c8d;
    --color-success: #27ae60;
    --color-warning: #f39c12;
    --color-danger: #e74c3c;
    --color-info: #3498db;
    --color-dark: #2c3e50;
    --color-light: #ecf0f1;
    --color-muted: #7f8c8d;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== LAYOUT PRINCIPAL ===== */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    background: #f5f5f5;
}

/* ===== LOADER GLOBAL ===== */
.global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.global-loader.loader-hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-content {
    text-align: center;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.loader-text {
    color: #666;
    font-size: 14px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== COMPONENTES COMUNES ===== */

/* Sidebar de navegación */
.sidebar {
    width: 60px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    position: fixed;
    height: 100vh;
    z-index: 1000;
}

.sidebar-header {
    margin-bottom: 30px;
}

.logo-image {
    width: 130px;
    height: 130px;
    border-radius: 5%;
    object-fit: cover;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    align-items: center;
}

.nav-btn {
    width: 45px;
    height: 45px;
    border: none;
    background: transparent;
    color: #666666;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.nav-btn:hover {
    background: #f8f9fa;
    color: #2c3e50;
    transform: scale(1.05);
}

.nav-btn.active {
    background: var(--color-principal);
    color: white;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

/* Header del Dashboard */
.dashboard-header {
    background: white;
    padding: 20px 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-title {
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
}

.dashboard-subtitle {
    color: #7f8c8d;
    font-size: 1rem;
    margin: 5px 0 0 0;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-principal);
}

/* Contenido Principal */
.main-content {
    flex: 1;
    margin-left: 60px;
    padding: 0;
    min-height: calc(100vh - 80px);
}

main {
    padding: 30px;
    min-height: calc(100vh - 160px);
}

/* Footer */
.footer {
    background: #ffffff;
    color: rgb(0, 0, 0);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-left: 60px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.footer-left {
    display: flex;
    align-items: center;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 30px;
}

/* Paginación */
.pagination {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-arrow {
    background: #333333;
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
}

.nav-arrow:hover {
    background: var(--color-principal);
    transform: scale(1.1);
}

.page-info {
    font-size: 14px;
    font-weight: 500;
}

/* Controles de Zoom */
.zoom-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.zoom-btn {
    background: #333333;
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.zoom-btn:hover {
    background: var(--color-principal);
}

.zoom-slider {
    width: 100px;
    height: 6px;
    background: #333333;
    border-radius: 3px;
    position: relative;
    cursor: pointer;
}

.zoom-track {
    width: 100%;
    height: 100%;
    position: relative;
}

.zoom-thumb {
    width: 16px;
    height: 16px;
    background: var(--color-principal);
    border-radius: 50%;
    position: absolute;
    top: -5px;
    left: 0%;
    transition: left 0.3s ease;
    cursor: grab;
}

.zoom-thumb:active {
    cursor: grabbing;
}

.zoom-percentage {
    font-size: 12px;
    font-weight: 500;
    min-width: 40px;
}

/* Iconos Sociales */
.social-icons {
    display: flex;
    gap: 10px;
}

.social-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: white;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.social-icon.facebook {
    background: #3b5998;
}

.social-icon.twitter {
    background: #1da1f2;
}

.social-icon.linkedin {
    background: #0077b5;
}

.social-icon.share {
    background: #6c757d;
}

.social-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* ===== ESTILOS ESPECÍFICOS PARA PÁGINA 1 ===== */

/* Layout especial para página 1 - sin sidebar ni header */
.page1-layout {
    flex-direction: column;
}

.page1-layout .main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: 0;
    padding: 0;
}

.page1-layout main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 40px 20px;
    min-height: calc(100vh - 80px);
}

.page1-layout .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 40px;
    max-width: 600px;
    margin-top: 80px;
}

/* Estilos específicos para elementos de página 1 */
.page1-layout .logo {
    margin-bottom: 20px;
}

.page1-layout .title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.page1-layout .description {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
    max-width: 500px;
    color: #555;
}

.page1-layout .buttons-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    margin-top: 20px;
}

/* Contenedor principal */
.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    text-align: center;
    gap: 30px;
}

/* Header y Logo */
.header {
    margin-bottom: 0;
}

.logo {
    margin-bottom: 20px;
}

.logo-image {
    max-width: 200px;
    height: auto;
    display: block;
    margin: 0 auto;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

/* Títulos */
.title {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #555;
    max-width: 500px;
    margin: 0 auto;
}

/* Botones */
.buttons-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    margin-top: 30px;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
    text-align: center;
    display: inline-block;
}

.btn-dashboard {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.btn-dashboard:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.btn-platform {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn-platform:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

/* ===== ESTILOS ESPECÍFICOS PARA PÁGINA 2 ===== */

/* Colores para las celdas de la tabla de leyenda */
.metrics-table td.excellent {
    background-color: #27ae60;
    color: white;
    font-weight: bold;
}

.metrics-table td.good {
    background-color: #f39c12;
    color: white;
    font-weight: bold;
}

.metrics-table td.regular {
    background-color: #e67e22;
    color: white;
    font-weight: bold;
}

.metrics-table td.bad {
    background-color: #e74c3c;
    color: white;
    font-weight: bold;
}

/* Estilos para el header con filtros */
.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Estilos para los filtros de fecha */
.date-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
}

.date-input {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    transition: border-color 0.3s ease;
    min-width: 120px;
}

.date-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.patent-select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    transition: border-color 0.3s ease;
    min-width: 120px;
    background: white;
}

.patent-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Estilos para las tarjetas de métricas */
.metrics-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.metrics-card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.metrics-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.metrics-table th,
.metrics-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.metrics-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

/* Estilos para los gráficos */
.chart-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.chart-title {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

/* Estilos específicos para gráficos */
.gauge-container {
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#gaugeChart {
    width: 400px;
    height: 280px;
}

.score-legend {
    margin-top: -80px;
}

/* Estilos para la tabla de vehículos */
.vehicles-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.vehicles-table th,
.vehicles-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.vehicles-table th {
    background-color: #2c3e50;
    color: white;
    font-weight: 600;
}

.vehicles-table tr:hover {
    background-color: #f8f9fa;
}

/* Estilos para estados de vehículos */
.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.habilitado {
    background-color: #27ae60;
    color: white;
}

.status-badge.retirado {
    background-color: #95a5a6;
    color: white;
}

.status-badge.suspension {
    background-color: #f39c12;
    color: white;
}

.status-badge.deshabilitado {
    background-color: #e74c3c;
    color: white;
}

/* Estilos para tablas centradas */
.table-centered {
    text-align: center;
    color: #666;
    padding: 20px;
}

/* Grid de métricas */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Contenedor de gráficos */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* ===== SISTEMA DE GRID BOOTSTRAP ===== */

/* Container */
.container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* Row */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

/* Columnas base */
.col, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6, 
.col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
}

/* Columnas específicas */
.col-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
.col-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
.col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
.col-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

.col { flex-basis: 0; flex-grow: 1; max-width: 100%; }

/* Columnas Small (sm) */
@media (min-width: 576px) {
    .col-sm-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
    .col-sm-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-sm-3 { flex: 0 0 25%; max-width: 25%; }
    .col-sm-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-sm-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-sm-6 { flex: 0 0 50%; max-width: 50%; }
    .col-sm-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .col-sm-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-sm-9 { flex: 0 0 75%; max-width: 75%; }
    .col-sm-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
    .col-sm-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
    .col-sm-12 { flex: 0 0 100%; max-width: 100%; }
}

/* Columnas Medium (md) */
@media (min-width: 768px) {
    .col-md-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
    .col-md-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
    .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-md-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-md-9 { flex: 0 0 75%; max-width: 75%; }
    .col-md-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
    .col-md-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
    .col-md-12 { flex: 0 0 100%; max-width: 100%; }
}

/* Columnas Large (lg) */
@media (min-width: 992px) {
    .col-lg-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
    .col-lg-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
    .col-lg-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-lg-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
    .col-lg-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .col-lg-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-lg-9 { flex: 0 0 75%; max-width: 75%; }
    .col-lg-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
    .col-lg-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
    .col-lg-12 { flex: 0 0 100%; max-width: 100%; }
}

/* Columnas Extra Large (xl) */
@media (min-width: 1200px) {
    .col-xl-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
    .col-xl-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-xl-3 { flex: 0 0 25%; max-width: 25%; }
    .col-xl-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-xl-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-xl-6 { flex: 0 0 50%; max-width: 50%; }
    .col-xl-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .col-xl-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-xl-9 { flex: 0 0 75%; max-width: 75%; }
    .col-xl-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
    .col-xl-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
    .col-xl-12 { flex: 0 0 100%; max-width: 100%; }
}

/* Utilidades adicionales */
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-block { display: block !important; }
.d-inline-block { display: inline-block !important; }
.d-none { display: none !important; }

.justify-content-start { justify-content: flex-start !important; }
.justify-content-end { justify-content: flex-end !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-around { justify-content: space-around !important; }

.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.align-items-center { align-items: center !important; }
.align-items-baseline { align-items: baseline !important; }
.align-items-stretch { align-items: stretch !important; }

.text-left { text-align: left !important; }
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }

.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }

.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.ml-1 { margin-left: 0.25rem !important; }
.ml-2 { margin-left: 0.5rem !important; }
.ml-3 { margin-left: 1rem !important; }
.ml-4 { margin-left: 1.5rem !important; }
.ml-5 { margin-left: 3rem !important; }

.mr-1 { margin-right: 0.25rem !important; }
.mr-2 { margin-right: 0.5rem !important; }
.mr-3 { margin-right: 1rem !important; }
.mr-4 { margin-right: 1.5rem !important; }
.mr-5 { margin-right: 3rem !important; }

.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 3rem !important; }

.pt-1 { padding-top: 0.25rem !important; }
.pt-2 { padding-top: 0.5rem !important; }
.pt-3 { padding-top: 1rem !important; }
.pt-4 { padding-top: 1.5rem !important; }
.pt-5 { padding-top: 3rem !important; }

.pb-1 { padding-bottom: 0.25rem !important; }
.pb-2 { padding-bottom: 0.5rem !important; }
.pb-3 { padding-bottom: 1rem !important; }
.pb-4 { padding-bottom: 1.5rem !important; }
.pb-5 { padding-bottom: 3rem !important; }

.pl-1 { padding-left: 0.25rem !important; }
.pl-2 { padding-left: 0.5rem !important; }
.pl-3 { padding-left: 1rem !important; }
.pl-4 { padding-left: 1.5rem !important; }
.pl-5 { padding-left: 3rem !important; }

.pr-1 { padding-right: 0.25rem !important; }
.pr-2 { padding-right: 0.5rem !important; }
.pr-3 { padding-right: 1rem !important; }
.pr-4 { padding-right: 1.5rem !important; }
.pr-5 { padding-right: 3rem !important; }

/* ===== COMPONENTES BOOTSTRAP ===== */

/* Cards */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background-color: #fff;
    background-clip: border-box;
    border: 1px solid rgba(0,0,0,.125);
    border-radius: 0.375rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 0.75rem 1.25rem;
    margin-bottom: 0;
    background-color: rgba(0,0,0,.03);
    border-bottom: 1px solid rgba(0,0,0,.125);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.card-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
}

.card-body {
    flex: 1 1 auto;
    padding: 1.25rem;
}

/* Tables */
.table {
    width: 100%;
    margin-bottom: 1rem;
    color: #212529;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem;
    vertical-align: top;
    border-top: 1px solid #dee2e6;
}

.table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid #dee2e6;
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0,0,0,.05);
}

.table-sm th,
.table-sm td {
    padding: 0.3rem;
}

.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Form controls */
.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    color: #495057;
    background-color: #fff;
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* Container fluid */
.container-fluid {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

/* ===== ESTILOS PARA SECCIÓN DE RESUMEN ===== */

/* Card de resumen */
.summary-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #2c3e50;
    border: 1px solid #dee2e6;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    overflow: hidden;
    position: relative;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23667eea" opacity="0.05"/><circle cx="75" cy="75" r="1" fill="%23667eea" opacity="0.05"/><circle cx="50" cy="10" r="0.5" fill="%23667eea" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

/* Header del resumen */
.summary-header {
    background: rgba(255, 255, 255, 0.6);
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    backdrop-filter: blur(10px);
}

.summary-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.summary-title i {
    font-size: 1.5rem;
    color: var(--color-principal);
}

.summary-title h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    color: #2c3e50;
}

.summary-date {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

/* Body del resumen */
.summary-body {
    padding: 2rem;
    position: relative;
}

/* Grid de métricas mejorado */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-item {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.metric-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.3), transparent);
}

.metric-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #dee2e6;
}

.metric-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.metric-total .metric-icon {
    background: rgba(52, 152, 219, 0.15);
    color: #3498db;
}

.metric-active .metric-icon {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
}

.metric-inactive .metric-icon {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
}

.metric-content {
    flex: 1;
}

.metric-label {
    display: block;
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
}

/* Métrica principal mejorada */
.main-metric {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(10px);
    border: 1px solid #e9ecef;
    position: relative;
    overflow: hidden;
}

.main-metric::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.main-metric-content {
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.big-number {
    font-size: 4rem;
    font-weight: 800;
    color: var(--color-principal);
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.metric-unit {
    font-size: 1.2rem;
    color: #6c757d;
    font-weight: 600;
}

.metric-details {
    text-align: right;
}

.objective {
    font-size: 1rem;
    color: #495057;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.percentage {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.trend-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #2ecc71;
    font-weight: 600;
}

.trend-indicator i {
    font-size: 1rem;
}

/* Siluetas de autos mejoradas */
.background-cars {
    position: absolute;
    bottom: -20px;
    right: -20px;
    opacity: 0.05;
    pointer-events: none;
}

.car-silhouette {
    width: 60px;
    height: 30px;
    background: #6c757d;
    border-radius: 15px 15px 5px 5px;
    position: absolute;
    animation: float 6s ease-in-out infinite;
}

.car-silhouette:nth-child(1) {
    bottom: 0;
    right: 0;
    animation-delay: 0s;
}

.car-silhouette:nth-child(2) {
    bottom: 20px;
    right: 40px;
    animation-delay: 2s;
}

.car-silhouette:nth-child(3) {
    bottom: 10px;
    right: 80px;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Responsive para resumen */
@media (max-width: 768px) {
    .summary-header {
        flex-direction: column;
        gap: 1rem;
    text-align: center;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .main-metric {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .metric-details {
        text-align: center;
    }
    
    .big-number {
        font-size: 3rem;
    }
}
@media (max-width: 768px) {
    .sidebar {
        width: 50px;
    }
    
    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .main-content {
        margin-left: 50px;
    }
    
    .dashboard-header {
        padding: 15px 20px;
    }
    
    .dashboard-title {
        font-size: 1.5rem;
    }
    
    .dashboard-subtitle {
    font-size: 0.9rem;
}

    .footer {
        padding: 15px 20px;
    }
    
    .footer-right {
        flex-direction: column;
        gap: 15px;
    }
    
    .page1-layout .container {
        margin-top: 60px;
        gap: 30px;
    }
    
    .page1-layout .title {
        font-size: 2rem;
    }
    
    .page1-layout .description {
        font-size: 1rem;
    }
    
    .buttons-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .btn {
        min-width: 200px;
    }
    
    .header-right {
        flex-direction: column;
        gap: 10px;
    }
    
    .date-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .metrics-table,
    .vehicles-table {
        font-size: 12px;
    }
    
    .metrics-table th,
    .metrics-table td,
    .vehicles-table th,
    .vehicles-table td {
        padding: 6px 8px;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-container {
        grid-template-columns: 1fr;
    }
    
    .gauge-container {
        height: 250px;
    }
    
    #gaugeChart {
        width: 300px;
        height: 200px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        padding: 15px;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}


/* ===== LOADER AJAX ===== */

.ajax-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.ajax-loader.show {
    display: flex;
}

.ajax-loader-content {
    background: white;
    padding: 2rem 3rem;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: slideIn 0.3s ease-out;
}

.ajax-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--color-principal);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.ajax-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
