:root {
    /* Base Colors - More classic */
    --primary: #1e40af;
    --primary-glow: rgba(30, 64, 175, 0.2);
    --bg-dark: #0f172a; 
    --card-bg: #1e293b;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --border-light: rgba(255, 255, 255, 0.1);
    --text-muted: #64748b;

    /* Accents */
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-emerald: #10b981;
    --accent-orange: #f59e0b;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
    background-color: var(--bg-dark);
}

/* Simplified Cards */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

/* Removed noise and complex gradients */
.premium-gradient {
    background: var(--primary);
}

.premium-glow {
    box-shadow: 0 0 20px var(--primary-glow);
}

/* ==========================================
   LEGIBILIDAD MÓVIL — Dashboard del Conductor
   Sube los textos extremadamente pequeños a
   mínimos legibles en pantallas de teléfono.
   Solo aplica a portrait (landscape tiene su
   propio bloque más arriba).
   ========================================== */
@media screen and (max-width: 640px) and (orientation: portrait) {
    /* 6-7 px → 10 px */
    [class*="text-[6px]"],
    [class*="text-[7px]"] {
        font-size: 10px !important;
        letter-spacing: 0.05em !important;
    }

    /* 8 px → 11 px */
    [class*="text-[8px]"] {
        font-size: 11px !important;
    }

    /* 9 px → 12 px */
    [class*="text-[9px]"] {
        font-size: 12px !important;
    }

    /* 10 px → 13 px */
    [class*="text-[10px]"] {
        font-size: 13px !important;
    }

    /* 11 px → 13 px (botones de acción) */
    [class*="text-[11px]"] {
        font-size: 13px !important;
    }
}

/* Fleet map labels */
.fleet-label {
    background: rgba(10, 14, 23, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 10px !important;
    padding: 4px 10px !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 11px !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
    white-space: nowrap !important;
}

.fleet-label::before {
    display: none !important;
}

/* Simplified Grid */
.bento-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 0 16px;
}

.bento-card {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 16px;
    flex: 1 1 calc(50% - 16px);
}

.bento-card.large {
    flex: 1 1 100%;
}

/* Animations - Keyframes Reales (Premium UI) */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseSoft {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(0.98); }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

.animate-pulse-soft {
    animation: pulseSoft 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Speedometer Styles */
.speed-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px auto;
    border: 6px solid rgba(255, 255, 255, 0.05);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: rgba(16, 22, 34, 0.4);
}

.speed-value {
    font-size: 32px;
    font-weight: 900;
    line-height: 1;
}

.speed-unit {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.7;
}

.speed-green {
    color: #10b981;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.2);
}

.speed-amber {
    color: #fbbf24;
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.3);
    border-color: rgba(251, 191, 36, 0.4);
    animation: warning-pulse 1s infinite;
}

.speed-orange {
    color: #f59e0b;
    transform: scale(1.1);
    box-shadow: 0 0 50px rgba(245, 158, 11, 0.5);
    border-color: rgba(245, 158, 11, 0.6);
    animation: alarm-pulse 0.5s infinite;
    background: rgba(245, 158, 11, 0.1);
}

.speed-red {
    color: #ef4444;
    transform: scale(1.2);
    box-shadow: 0 0 60px rgba(239, 68, 68, 0.6);
    border-color: rgba(239, 68, 68, 0.7);
    animation: alarm-pulse 0.4s infinite;
    background: rgba(239, 68, 68, 0.15);
}

@keyframes warning-pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        opacity: 1;
    }
}

@keyframes alarm-pulse {
    0% {
        transform: scale(1.2);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1.2);
    }
}

.frena-banner {
    position: fixed;
    top: 20%;
    left: 0;
    right: 0;
    background: #ef4444;
    color: white;
    padding: 20px;
    text-align: center;
    font-size: 48px;
    font-weight: 900;
    z-index: 1000;
    animation: bounce 0.5s infinite;
}

/* Volumetric Glows - Removed */
/* Premium Selector & Option Styles (Fix Visibility) */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba(255,255,255,0.9)'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

select:focus {
    border-color: var(--accent-blue) !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%233b82f6'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
}

/* Icono del calendario en inputs de fecha — negro por defecto, invisible en dark */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.7;
    cursor: pointer;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

select option {
    background-color: #1e293b; /* --card-bg */
    color: white;
    padding: 12px;
}

/* Ensure no hardcoded opacity hides the content */
#selTractor, #selTanker, #selJob {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Placa ADR Reglamentaria */
.adr-plate {
    width: 100px;
    height: 75px;
    background-color: #FF7600; /* Naranja ADR */
    border: 3.5px solid #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: 'Inter', sans-serif;
    font-weight: 950; /* Máxima negrita */
    color: #000;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
}

.adr-plate-top {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    letter-spacing: 2px;
    width: 100%;
}

.adr-plate-divider {
    width: 100%;
    height: 3.5px;
    background-color: #000;
}

.adr-plate-bottom {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    letter-spacing: 2px;
    width: 100%;
}

/* ==========================================
   LANDSCAPE MOBILE — Dashboard del Conductor
   ========================================== */
@media (orientation: landscape) and (max-height: 600px) {
    #dash-landscape-wrapper {
        display: flex !important;
        flex-direction: row !important;
        align-items: flex-start !important;
        min-height: 100vh !important;
    }

    #dash-left-col {
        width: 176px !important;
        min-width: 176px !important;
        flex-shrink: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        position: sticky !important;
        top: 0 !important;
        height: 100vh !important;
        overflow: hidden !important;
        padding-top: 0.75rem !important;
        border-right: 1px solid rgba(255,255,255,0.05) !important;
    }

    /* Header en landscape: columna centrada, sin padding excesivo */
    #dash-header {
        padding: 0.5rem 0.75rem !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }

    /* Logo más pequeño */
    #dash-header img[alt="Logo"] {
        height: 2.5rem !important;
    }

    /* Info de usuario alineada al centro */
    #dash-header .flex.flex-col.items-end {
        align-items: center !important;
        margin-right: 0 !important;
    }

    /* Botones del header en landscape: más pequeños */
    #dash-header button {
        padding: 0.375rem !important;
    }

    /* Speedometer wrapper sin padding excesivo */
    #dash-speedometer-wrap {
        padding: 0 !important;
        width: 100% !important;
        justify-content: center !important;
    }

    /* Speedometer más pequeño */
    #speedometer {
        width: 112px !important;
        height: 112px !important;
    }

    #speedometer .speed-value {
        font-size: 2rem !important;
    }

    #odometerDisplay {
        font-size: 0.55rem !important;
        padding: 0.1rem 0.4rem !important;
        margin-top: 0.25rem !important;
    }

    #dash-right-col {
        flex: 1 !important;
        height: 100vh !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

