/* ============================================================
   DASHBOARD VEHÍCULOS ELÉCTRICOS - SISTEMA NAVY + GOLD
   ============================================================ */

/* ===== SISTEMA DE DISEÑO MODERNO NAVY + GOLD ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Radio de bordes */
    --radius: 0.875rem;
    --radius-xl: 1.25rem;
    --radius-2xl: 1.5rem;
    
    /* Colores base */
    --background: oklch(0.99 0.005 90);
    --foreground: oklch(0.18 0.04 260);
    --card: oklch(1 0 0);
    --card-foreground: oklch(0.18 0.04 260);
    
    /* Paleta Navy */
    --navy: oklch(0.22 0.06 265);
    --navy-deep: oklch(0.14 0.05 265);
    --navy-light: oklch(0.35 0.08 265);
    --primary: oklch(0.22 0.06 265);
    --primary-foreground: oklch(0.98 0.005 90);
    
    /* Paleta Gold */
    --gold: oklch(0.82 0.16 85);
    --gold-dark: oklch(0.70 0.14 85);
    --gold-light: oklch(0.88 0.14 88);
    --gold-foreground: oklch(0.18 0.04 260);
    
    /* Colores semánticos */
    --muted: oklch(0.96 0.01 250);
    --muted-foreground: oklch(0.45 0.03 260);
    --accent: oklch(0.82 0.16 85);
    --border: oklch(0.9 0.012 260);
    --input: oklch(0.95 0.005 90);
    --ring: oklch(0.82 0.16 85);
    
    /* Gradientes */
    --gradient-hero: linear-gradient(135deg, oklch(0.14 0.05 265) 0%, oklch(0.22 0.06 265) 55%, oklch(0.32 0.09 270) 100%);
    --gradient-gold: linear-gradient(135deg, oklch(0.88 0.14 88) 0%, oklch(0.78 0.17 75) 100%);
    --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.98), rgba(248,250,252,0.98));
    
    /* Sombras */
    --shadow-elegant: 0 25px 60px -25px color-mix(in oklab, var(--navy-deep) 45%, transparent);
    --shadow-gold: 0 20px 50px -20px color-mix(in oklab, var(--gold) 55%, transparent);
    --shadow-card: 0 10px 30px -15px color-mix(in oklab, var(--navy-deep) 25%, transparent);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    
    /* Tipografías */
    --font-display: 'Space Grotesk', system-ui, sans-serif;
    --font-sans: 'Inter', system-ui, sans-serif;
    --font-mono: 'DM Mono', monospace;
    
    /* Colores específicos (semánticos) */
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.12);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.12);
    --cyan: #06b6d4;
    --cyan-bg: rgba(6, 182, 212, 0.12);
    --purple: #8b5cf6;
    --purple-bg: rgba(139, 92, 246, 0.12);
}

/* ===== ESTILOS BASE ===== */
body {
    background: radial-gradient(circle at 10% 20%, var(--navy) 0%, var(--navy-deep) 100%);
    color: var(--foreground);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: 72px;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    letter-spacing: -0.02em;
}

/* ===== HERO ===== */
.dashboard-hero {
    background: var(--gradient-hero);
    padding: 3rem 1.5rem;
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.dashboard-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" opacity="0.08"><path d="M50 20 L80 40 L80 60 L50 80 L20 60 L20 40 Z" fill="none" stroke="white" stroke-width="1.5"/><circle cx="50" cy="50" r="5" fill="white" opacity="0.5"/></svg>');
    background-size: 60px;
    background-repeat: repeat;
    opacity: 0.1;
    pointer-events: none;
}

.dashboard-hero-content h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.75rem;
}

.dashboard-hero-content h1 span {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.dashboard-hero-content p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ===== FECHA ACTUAL ===== */
.fecha-actual {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    color: white;
    margin: 0 auto 2rem;
    width: fit-content;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ===== CONTENEDOR PRINCIPAL ===== */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

/* ===== KPI GRID ===== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: var(--gradient-card);
    border-radius: var(--radius-2xl);
    padding: 1.25rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-3px);
    border-color: var(--gold);
    box-shadow: var(--shadow-gold);
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.kpi-header h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--navy);
    margin: 0;
}

.kpi-icon {
    width: 40px;
    height: 40px;
    background: var(--info-bg);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-icon i {
    font-size: 1.2rem;
    color: var(--info);
}

.kpi-card.electric .kpi-icon i {
    color: var(--cyan);
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 0.5rem;
    font-family: var(--font-mono);
}

.kpi-change {
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.kpi-change.positive {
    color: var(--success);
}

/* ===== GRID 3 COLUMNAS ===== */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* ===== IMPACT CARDS ===== */
.impact-card {
    background: var(--gradient-card);
    border-radius: var(--radius-2xl);
    padding: 1.5rem;
    text-align: center;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.impact-card:hover {
    transform: translateY(-3px);
    border-color: var(--gold);
    box-shadow: var(--shadow-gold);
}

.impact-card.primary {
    background: linear-gradient(135deg, var(--navy), var(--navy-light));
    color: white;
}

.impact-card.primary .impact-value,
.impact-card.primary .impact-label {
    color: white;
}

.impact-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 0.5rem;
    font-family: var(--font-mono);
}

.impact-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted-foreground);
    margin-bottom: 1rem;
}

/* ===== BATTERY BAR ===== */
.battery-bar {
    background: #e2e8f0;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.battery-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.impact-card .battery-fill {
    background: linear-gradient(90deg, var(--cyan), var(--success));
}

/* ===== CHART GRID ===== */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 900px) {
    .chart-grid {
        grid-template-columns: 1fr;
    }
}

.chart-card {
    background: var(--gradient-card);
    border-radius: var(--radius-2xl);
    padding: 1.25rem;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.chart-card:hover {
    transform: translateY(-3px);
    border-color: var(--gold);
    box-shadow: var(--shadow-gold);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.chart-header h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--navy);
    margin: 0;
}

.chart-container {
    position: relative;
    height: 250px;
    width: 100%;
}

/* ===== ELECTRIC STATS ===== */
.electric-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 700px) {
    .electric-stats {
        grid-template-columns: 1fr;
    }
}

.stat-electric {
    background: linear-gradient(135deg, var(--navy), var(--navy-light));
    border-radius: var(--radius-2xl);
    padding: 1.5rem;
    text-align: center;
    color: white;
    transition: all 0.3s ease;
}

.stat-electric:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-gold);
}

.stat-electric i {
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    font-family: var(--font-mono);
}

.stat-label {
    font-size: 0.7rem;
    opacity: 0.8;
}

/* ===== TABLA ELÉCTRICOS ===== */
.dashboard-card {
    background: var(--gradient-card);
    border-radius: var(--radius-2xl);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.dashboard-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gold);
}

.dashboard-card-header i {
    font-size: 1.5rem;
    color: var(--gold);
    background: var(--muted);
    padding: 0.5rem;
    border-radius: var(--radius);
}

.dashboard-card-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 0.25rem;
}

.dashboard-card-header p {
    font-size: 0.7rem;
    color: var(--muted-foreground);
}

/* ===== FILTROS ===== */
.filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.4rem 1rem;
    background: var(--muted);
    border: 1px solid var(--border);
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--muted-foreground);
}

.filter-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.filter-btn.active {
    background: var(--gradient-gold);
    border-color: var(--gold);
    color: var(--gold-foreground);
}

/* ===== TABLA ===== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.table-electric {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.7rem;
    min-width: 800px;
}

.table-electric th {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    color: white;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.table-electric td {
    padding: 0.7rem;
    border-bottom: 1px solid var(--border);
}

.table-electric tr:hover td {
    background: rgba(210, 158, 0, 0.05);
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 600;
}

.badge-autonomia-alta {
    background: var(--success-bg);
    color: var(--success);
}

.badge-autonomia-media {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-autonomia-estandar {
    background: var(--info-bg);
    color: var(--info);
}

/* ===== NOTA ===== */
.nota {
    text-align: center;
    font-size: 0.7rem;
    color: var(--muted-foreground);
    margin-top: 1rem;
    padding: 1rem;
    background: var(--muted);
    border-radius: var(--radius);
}

/* ===== BOTONES FLOTANTES ===== */
.btn-back-floating {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    color: white;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    font-size: 1.25rem;
    box-shadow: var(--shadow-card);
    transition: all 0.2s;
    z-index: 40;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-back-floating:hover {
    transform: scale(1.1);
    background: var(--gold);
    color: var(--navy);
    border-color: var(--gold);
}

/* ===== FOOTER ===== */
footer {
    background: var(--gradient-hero);
    color: white;
    margin-top: 2rem;
    padding: 1.5rem;
    text-align: center;
}

footer p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.7rem;
    margin-bottom: 0.5rem;
}

footer a {
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0.5rem;
    font-size: 1.1rem;
    transition: all 0.2s;
    display: inline-block;
    text-decoration: none;
}

footer a:hover {
    color: white;
    transform: translateY(-2px);
}

/* ===== ANIMACIONES ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.kpi-card, .impact-card, .chart-card {
    animation: fadeIn 0.4s ease;
}

/* ===== SCROLLBAR PERSONALIZADA ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold-dark);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    body {
        padding-top: 64px;
    }
    
    .dashboard-hero {
        padding: 2rem 1rem;
    }
    
    .dashboard-hero-content h1 {
        font-size: 1.8rem;
    }
    
    .dashboard-container {
        padding: 0 1rem 2rem;
    }
    
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .impact-value {
        font-size: 1.5rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
}

@media (max-width: 600px) {
    .dashboard-hero-content h1 {
        font-size: 1.5rem;
    }
    
    .dashboard-hero-content p {
        font-size: 0.85rem;
    }
    
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    
    .kpi-value {
        font-size: 1.2rem;
    }
    
    .fecha-actual {
        font-size: 0.6rem;
    }
    
    .dashboard-card {
        padding: 1rem;
    }
    
    .table-electric {
        font-size: 0.65rem;
        min-width: 600px;
    }
    
    .table-electric th,
    .table-electric td {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .dashboard-hero-content h1 {
        font-size: 1.3rem;
    }
    
    .impact-value {
        font-size: 1.2rem;
    }
    
    .stat-number {
        font-size: 1.2rem;
    }
    
    .chart-header h3 {
        font-size: 0.7rem;
    }
    
    .filter-btn {
        padding: 0.3rem 0.8rem;
        font-size: 0.65rem;
    }
}

/* ===== UTILIDADES ===== */
.text-center {
    text-align: center;
}

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

.text-left {
    text-align: left;
}

/* ===== SMOOTH SCROLL ===== */
html {
    scroll-behavior: smooth;
}