/* ============================================================
   Tessie Live Vehicle Dashboard - Tesla UI Styling
   ============================================================ */

.tessie-card {
    background: var(--bg-card);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-card);
    padding: 22px 26px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.tessie-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #e82127, #3b82f6, #10b981);
    opacity: 0.85;
}

/* Header */
.tessie-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}

.tessie-car-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.tessie-car-avatar {
    width: 44px;
    height: 44px;
    border-radius: 0px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

.tessie-car-avatar svg {
    width: 24px;
    height: 24px;
}

.tessie-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tessie-title-group h2 {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.tessie-vehicle-switcher-wrap {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 0px;
    padding: 3px 8px 3px 10px;
    transition: all 0.2s ease;
}

.tessie-vehicle-switcher-wrap:hover,
.tessie-vehicle-switcher-wrap:focus-within {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.06);
}

.switcher-icon {
    font-size: 14px;
    margin-right: 6px;
    line-height: 1;
}

.tessie-vehicle-select {
    background: transparent;
    color: #ffffff;
    border: none;
    outline: none;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    padding: 4px 6px 4px 0;
}

.tessie-vehicle-select option {
    background: #181920;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    padding: 6px;
}

.tessie-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

/* Status Pill */
.tessie-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-online {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.status-asleep {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.status-charging {
    background: rgba(0, 240, 255, 0.15);
    color: #00f0ff;
    border: 1px solid rgba(0, 240, 255, 0.35);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
}

.status-driving {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.35);
}

/* Top Actions */
.tessie-top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tessie-btn-small {
    padding: 7px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-btn);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tessie-btn-small:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: var(--border-hover);
}

.tessie-btn-small:active {
    transform: scale(0.95);
}

.tessie-btn-small svg {
    width: 14px;
    height: 14px;
}

/* Spinning Animation for Refresh */
.spinning svg {
    animation: tessieSpin 0.8s linear infinite;
}

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

/* ============================================================
   Main Metrics Grid
   ============================================================ */
.tessie-metrics-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.metric-box {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 120px;
    position: relative;
    transition: var(--transition);
}

.metric-box:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.35);
}

.metric-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.metric-value-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 8px 0 4px;
}

.metric-huge {
    font-size: 32px;
    font-weight: 800;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.metric-unit {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
}

.metric-sub {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Battery Progress Bar */
.battery-bar-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0px;
    overflow: hidden;
    margin-top: 8px;
    position: relative;
}

.battery-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 0px;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.battery-limit-marker {
    position: absolute;
    top: 0; bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.6);
    z-index: 2;
}

/* Climate Dual Value */
.temp-dual {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 6px 0;
}

.temp-item {
    display: flex;
    flex-direction: column;
}

.temp-item span:first-child {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
}

.temp-item span:last-child {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* TPMS Tire Pressure Mini Graphic */
.tpms-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
    margin-top: 6px;
    font-size: 12px;
}

.tpms-wheel {
    display: flex;
    justify-content: space-between;
    padding: 3px 6px;
    border-radius: 0px;
    background: rgba(255, 255, 255, 0.04);
}

.tpms-wheel span:first-child {
    color: var(--text-muted);
    font-weight: 700;
}

.tpms-wheel span:last-child {
    color: #ffffff;
    font-weight: 700;
}

/* Status Rows */
.status-pill-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 4px;
}

.status-mini-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
}

/* ============================================================
   Remote Controls Bar
   ============================================================ */
.tessie-controls-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    overflow-x: auto;
}

.control-btn {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-card);
    border-radius: 0px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.control-btn:active {
    transform: scale(0.94);
}

.control-btn.active-state {
    background: rgba(232, 33, 39, 0.15);
    border-color: rgba(232, 33, 39, 0.4);
    color: #ffffff;
}

.control-btn.charging-active {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.5);
    color: #34d399;
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.25);
}

.control-btn svg {
    width: 16px;
    height: 16px;
}

.charge-modal-card {
    max-width: 540px;
    width: 92%;
}

.modal-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Collapsed State */
.tessie-card.collapsed .tessie-metrics-grid,
.tessie-card.collapsed .tessie-controls-bar {
    display: none;
}

.tessie-card.collapsed .tessie-header {
    margin-bottom: 0;
}

/* Responsive */
@media (max-width: 1200px) {
    .tessie-metrics-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 650px) {
    .tessie-metrics-grid {
        grid-template-columns: 1fr;
    }
    .tessie-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .tessie-top-actions {
        width: 100%;
        justify-content: space-between;
    }
}

/* ============================================================
   Slide-to-Confirm Modal for Remote Vehicle Commands
   Square, Tesla-Cyber UI, Touch & Pointer Optimized
   ============================================================ */
.tessie-cmd-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: tessieModalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tessieModalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tessie-cmd-modal-card {
    background: #111317;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 0px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(232, 33, 39, 0.3);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
    position: relative;
    animation: tessieModalScaleUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.tessie-cmd-modal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #e82127;
}

@keyframes tessieModalScaleUp {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.tessie-cmd-modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.tessie-cmd-modal-icon {
    width: 42px;
    height: 42px;
    border-radius: 0px;
    background: rgba(232, 33, 39, 0.15);
    border: 1px solid rgba(232, 33, 39, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e82127;
    flex-shrink: 0;
}

.tessie-cmd-modal-icon svg {
    width: 22px;
    height: 22px;
}

.tessie-cmd-modal-titles {
    flex: 1;
    min-width: 0;
}

.tessie-cmd-modal-titles h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
}

.tessie-modal-veh-name {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 3px;
}

.tessie-cmd-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.15s;
    border-radius: 0px;
}

.tessie-cmd-modal-close:hover {
    color: #ffffff;
}

.tessie-cmd-modal-body {
    padding: 22px 20px;
}

.tessie-modal-desc {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 22px;
}

/* ============================================================
   Swipe to Confirm Slider Component
   ============================================================ */
.tessie-swipe-track {
    position: relative;
    width: 100%;
    height: 56px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 0px;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
}

.tessie-swipe-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, rgba(232, 33, 39, 0.75), #e82127);
    border-radius: 0px;
    pointer-events: none;
    transition: width 0s linear;
}

.tessie-swipe-track.completed .tessie-swipe-fill {
    background: #10b981 !important;
}

.tessie-swipe-text {
    position: absolute;
    width: 100%;
    padding: 0 54px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.15s ease;
    z-index: 1;
}

.tessie-swipe-chevron {
    font-size: 16px;
    color: #e82127;
    animation: tessieArrowShimmer 1.2s infinite ease-in-out;
}

@keyframes tessieArrowShimmer {
    0%, 100% { transform: translateX(0); opacity: 0.4; }
    50% { transform: translateX(4px); opacity: 1; }
}

.tessie-swipe-handle {
    position: absolute;
    left: 0;
    top: 0;
    width: 56px;
    height: 54px;
    background: #ffffff;
    color: #0f1015;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    border-radius: 0px;
    box-shadow: 3px 0 12px rgba(0, 0, 0, 0.5);
    z-index: 2;
    touch-action: none;
    transition: transform 0s linear, background 0.2s ease, color 0.2s ease;
}

.tessie-swipe-handle:active {
    cursor: grabbing;
}

.tessie-swipe-handle svg {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.tessie-swipe-track.completed .tessie-swipe-handle {
    background: #10b981;
    color: #ffffff;
}

.tessie-cmd-modal-footer {
    margin-top: 18px;
}

.tessie-cmd-modal-cancel {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
}

.tessie-cmd-modal-cancel:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
}

/* ============================================================
   Floating Toast Notifications for Remote Commands
   ============================================================ */
.tessie-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.tessie-toast {
    background: #14161d;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 4px solid #3b82f6;
    border-radius: 0px;
    padding: 12px 18px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: tessieToastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
    max-width: 380px;
}

.tessie-toast.success {
    border-left-color: #10b981;
}

.tessie-toast.error {
    border-left-color: #ef4444;
}

.tessie-toast.info {
    border-left-color: #3b82f6;
}

@keyframes tessieToastIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================================
   Tesla Fleet Map Section (OpenStreetMap / Leaflet)
   Square Cyberpunk/Tesla Dark UI
   ============================================================ */
.tessie-btn-small.active {
    background: rgba(232, 33, 39, 0.2);
    border-color: #e82127;
    color: #ffffff;
}

.tessie-fleet-map-wrap,
.tessie-fleet-map-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    z-index: 999999;
    margin: 0;
    border: none;
    border-radius: 0px;
    display: flex;
    flex-direction: column;
    background: #0d0f15;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    animation: tessieModalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: none;
    overflow: hidden;
}

.tessie-fleet-map-wrap[style*="display: none"],
.tessie-fleet-map-modal-overlay[style*="display: none"],
.tessie-cmd-modal-overlay[style*="display: none"] {
    display: none !important;
}

.tessie-fleet-map-fullscreen-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.tessie-map-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 22px;
    background: #11141c;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    flex-wrap: wrap;
    gap: 12px;
    flex-shrink: 0;
    z-index: 10;
}

.tessie-map-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.tessie-map-title svg {
    width: 16px;
    height: 16px;
    color: #e82127;
}

.tessie-map-count {
    background: rgba(232, 33, 39, 0.15);
    border: 1px solid rgba(232, 33, 39, 0.35);
    color: #e82127;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 0px;
}

.tessie-map-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tessie-map-btn {
    padding: 7px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 0px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.tessie-map-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.35);
}

.tessie-map-btn svg {
    width: 14px;
    height: 14px;
}

.tessie-map-close-btn {
    background: rgba(232, 33, 39, 0.15);
    border-color: rgba(232, 33, 39, 0.4);
    color: #ffffff;
}

.tessie-map-close-btn:hover {
    background: #e82127;
    border-color: #e82127;
    color: #ffffff;
}

.tessie-osm-map {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    width: 100% !important;
    background: #0d0f17;
    position: relative;
    z-index: 1;
}

/* High-Tech Dark Mode for OpenStreetMap Tiles (100% Free, No Watermark, No API Key) */
.tessie-osm-map .leaflet-tile-pane {
    filter: invert(100%) hue-rotate(180deg) brightness(86%) contrast(96%) grayscale(25%);
}

.tessie-map-fleet-list {
    flex-shrink: 0;
    z-index: 10;
    background: #0d0f15;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 10px 16px;
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: thin;
    max-height: 120px;
}

/* ============================================================
   Leaflet Dark Custom Overrides (100% Square)
   ============================================================ */
.leaflet-container {
    background-color: #090a0f !important;
    font-family: inherit !important;
}

.leaflet-bar {
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 0px !important;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6) !important;
}

.leaflet-bar a {
    background-color: #141722 !important;
    color: #ffffff !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 0px !important;
    width: 32px !important;
    height: 32px !important;
    line-height: 30px !important;
}

.leaflet-bar a:hover {
    background-color: #232736 !important;
    color: #e82127 !important;
}

.leaflet-control-attribution {
    background: rgba(0, 0, 0, 0.75) !important;
    color: var(--text-muted) !important;
    font-size: 10px !important;
    border-radius: 0px !important;
}

.leaflet-control-attribution a {
    color: #94a3b8 !important;
}

.leaflet-popup-content-wrapper {
    background: #11141c !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: 0px !important;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.85) !important;
    padding: 0 !important;
    overflow: hidden;
}

.leaflet-popup-tip {
    display: none !important;
}

.leaflet-popup-content {
    margin: 0 !important;
    line-height: 1.4 !important;
    width: 320px !important;
}

.leaflet-container a.leaflet-popup-close-button {
    color: #ffffff !important;
    padding: 8px !important;
    font-size: 20px !important;
    top: 6px !important;
    right: 6px !important;
    border-radius: 0px !important;
}

/* ============================================================
   Custom Tesla Car Marker on OpenStreetMap
   ============================================================ */
.tessie-marker-wrap {
    background: none !important;
    border: none !important;
}

.tessie-car-marker {
    width: 46px;
    height: 46px;
    background: #161822;
    border: 2px solid #e82127;
    border-radius: 0px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.8), 0 0 10px rgba(232, 33, 39, 0.35);
    cursor: pointer;
    transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s;
}

.tessie-car-marker:hover,
.tessie-car-marker.selected {
    transform: scale(1.15);
    border-color: #ffffff;
    z-index: 1000;
}

.tessie-car-marker.driving {
    border-color: #3b82f6;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.8), 0 0 12px rgba(59, 130, 246, 0.4);
}

.tessie-car-marker.charging {
    border-color: #00f0ff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.8), 0 0 12px rgba(0, 240, 255, 0.4);
}

.tessie-marker-heading {
    position: absolute;
    top: -7px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 7px solid #e82127;
    transform-origin: center bottom;
}

.tessie-marker-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

.tessie-marker-icon svg {
    width: 22px;
    height: 22px;
}

.tessie-marker-batt {
    position: absolute;
    bottom: -8px;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 0px;
    letter-spacing: 0.2px;
    line-height: 1.1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}

.tessie-marker-name {
    position: absolute;
    top: -18px;
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 0px;
    pointer-events: none;
    letter-spacing: 0.4px;
}

/* ============================================================
   Popup Card Content inside OpenStreetMap
   ============================================================ */
.tessie-popup-card {
    background: #11141c;
    color: #ffffff;
    border-radius: 0px;
    font-size: 12px;
}

.tessie-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tessie-popup-title {
    font-size: 15px;
    font-weight: 800;
    color: #ffffff;
}

.tessie-popup-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.btn-select-car-popup {
    padding: 4px 10px;
    background: #e82127;
    border: none;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 0px;
    transition: opacity 0.15s;
}

.btn-select-car-popup:hover {
    opacity: 0.85;
}

.tessie-popup-body {
    padding: 14px;
}

.tessie-popup-batt-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}

.tessie-popup-batt-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0px;
    overflow: hidden;
    margin-bottom: 12px;
}

.tessie-popup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 11px;
    color: var(--text-secondary);
}

.tessie-popup-grid strong {
    color: #cbd5e1;
}

.tessie-popup-cmds-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 12px 0 8px;
}

.tessie-popup-cmds {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.popup-cmd-btn {
    padding: 7px 4px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 0px;
    color: #ffffff;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
    white-space: nowrap;
}

.popup-cmd-btn:hover {
    background: rgba(232, 33, 39, 0.2);
    border-color: #e82127;
    color: #ffffff;
}

/* ============================================================
   Fleet Horizontal Cards Strip below Map
   ============================================================ */
.tessie-map-fleet-list {
    display: flex;
    align-items: stretch;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    overflow-x: auto;
}

.fleet-card {
    min-width: 220px;
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.18s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.fleet-card:hover,
.fleet-card.active {
    background: rgba(255, 255, 255, 0.07);
    border-color: #e82127;
    transform: translateY(-2px);
}

.fleet-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.fleet-card-name {
    font-weight: 700;
    color: #ffffff;
    font-size: 14px;
}

.fleet-card-pill {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 0px;
    text-transform: uppercase;
}

.fleet-card-pill.online { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.fleet-card-pill.driving { background: rgba(59, 130, 246, 0.15); color: #3b82f6; border: 1px solid rgba(59, 130, 246, 0.3); }
.fleet-card-pill.charging { background: rgba(0, 240, 255, 0.15); color: #00f0ff; border: 1px solid rgba(0, 240, 255, 0.3); }
.fleet-card-pill.asleep { background: rgba(148, 163, 184, 0.15); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.3); }

.fleet-card-mid {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.fleet-card-mid strong {
    color: #ffffff;
    font-size: 13px;
}

.fleet-card-bottom {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ============================================================
   Mini Solar-Charging Badge in Tesla Battery Box
   ============================================================ */
.solar-charge-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 0px;
    color: #f59e0b;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    margin-top: 6px;
    transition: var(--transition);
}

.solar-charge-badge:hover {
    background: rgba(245, 158, 11, 0.22);
    border-color: #f59e0b;
    transform: translateY(-1px);
}

.solar-charge-badge .badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 0px;
    background: #f59e0b;
    box-shadow: 0 0 6px #f59e0b;
}

.solar-charge-badge.green {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.solar-charge-badge.green .badge-dot {
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
}
