/* style.css - 智翊路达车辆管理平台 H5 样式 */


* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    min-height: 100vh;
}
/* Loading */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: #fff;
}
.loading-screen .spinner {
    width: 40px; height: 40px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-screen p { margin-top: 16px; font-size: 14px; opacity: 0.8; }

/* Header */
.header {
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: #fff;
    padding: 12px 16px;
    position: sticky; top: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 2px 8px rgba(13,71,161,0.18);
}
.header-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.header h1 { font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 用户小圈 - 左上角 */
.user-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,0.22);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 600;
    cursor: pointer;
    border: 1.5px solid rgba(255,255,255,0.4);
    flex-shrink: 0;
    user-select: none;
    transition: background .15s ease, transform .15s ease;
}
.user-avatar:hover, .user-avatar:active { background: rgba(255,255,255,0.34); transform: scale(1.04); }

/* 轻量 popover - 点小圈弹出 */
.user-popover {
    position: absolute;
    top: 60px; right: 12px;
    background: #fff;
    color: #333;
    border-radius: 10px;
    box-shadow: 0 6px 22px rgba(0,0,0,0.20);
    padding: 10px 14px;
    min-width: 180px; max-width: 80vw;
    z-index: 200;
    display: none;
    font-size: 13px;
}
.user-popover.show { display: block; }
.user-popover .pop-name { font-weight: 600; color: #1a73e8; font-size: 14px; }
.user-popover .pop-id { font-size: 11px; color: #999; margin-top: 2px; word-break: break-all; }
.user-popover .pop-action {
    margin-top: 10px; padding-top: 10px;
    border-top: 1px solid #f0f0f0;
    color: #c62828; cursor: pointer;
    font-size: 13px;
    display: flex; align-items: center; gap: 6px;
}
.user-popover .pop-action:hover { color: #b71c1c; }

/* Nav Tabs */
.nav-tabs {
    display: flex;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    overflow-x: auto;
}
.nav-tab {
    flex: 1; min-width: 0;
    padding: 12px 8px;
    text-align: center;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.nav-tab.active { color: #1a73e8; border-bottom-color: #1a73e8; font-weight: 600; }

/* Content */
.content { padding: 16px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Cards */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.stat-item {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.stat-item.clickable:active {
    transform: scale(0.96);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.stat-item.warning { background: linear-gradient(135deg, #fff3e0, #ffe0b2); }
.stat-item.danger { background: linear-gradient(135deg, #fbe9e7, #ffccbc); }
.stat-item.success { background: linear-gradient(135deg, #e8f5e9, #c8e6c9); }
.stat-value { font-size: 28px; font-weight: 700; color: #1a73e8; }
.stat-item.warning .stat-value { color: #e65100; }
.stat-item.danger .stat-value { color: #c62828; }
.stat-item.success .stat-value { color: #2e7d32; }
.stat-label { font-size: 12px; color: #666; margin-top: 4px; }

/* Vehicle List */
.vehicle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
}
.vehicle-item:last-child { border-bottom: none; }
.vehicle-plate { font-size: 15px; font-weight: 600; }
.vehicle-driver { font-size: 12px; color: #999; margin-top: 2px; }
.vehicle-status {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
}
.status-running { background: #e8f5e9; color: #2e7d32; }
.status-parked { background: #e3f2fd; color: #1a73e8; }
.status-warning { background: #fbe9e7; color: #c62828; }

/* Search */
.search-bar {
    display: flex; gap: 8px; margin-bottom: 16px;
}
.search-bar input {
    flex: 1; padding: 10px 14px; border: 1px solid #ddd;
    border-radius: 8px; font-size: 14px; outline: none;
}
.search-bar input:focus { border-color: #1a73e8; }
.search-bar button {
    padding: 10px 16px; background: #1a73e8; color: #fff;
    border: none; border-radius: 8px; font-size: 14px; cursor: pointer;
}

/* List */
.list-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 16px; background: #fff;
    border-bottom: 1px solid #f0f0f0; cursor: pointer;
}
.list-item:active { background: #f5f5f5; }
.list-item-left { display: flex; align-items: center; gap: 12px; }
.list-icon { font-size: 20px; }
.list-text { font-size: 14px; }
.list-sub { font-size: 12px; color: #999; }
.list-arrow { color: #ccc; font-size: 14px; }

/* Vehicle Card (rich style) */
.vcard {
    position: relative;
    background: #fff;
    border-radius: 14px;
    padding: 14px 14px 12px 14px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #eef0f3;
    transition: transform .12s ease, box-shadow .12s ease;
}
.vcard:active { transform: scale(.995); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.vcard.offline { opacity: .55; filter: grayscale(.6); }
.vcard-head {
    display: flex; align-items: center; gap: 12px;
    padding-bottom: 10px; border-bottom: 1px dashed #eef0f3;
}
.vcard-no {
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    letter-spacing: .5px; flex-shrink: 0;
}
.vcard.offline .vcard-no { background: linear-gradient(135deg, #9e9e9e, #616161); }
.vcard-head-info { flex: 1; min-width: 0; }
.vcard-title { font-size: 15px; font-weight: 600; color: #222; line-height: 1.2; }
.vcard-sub { font-size: 11px; color: #999; margin-top: 3px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vcard-badge {
    font-size: 11px; font-weight: 600;
    padding: 4px 10px; border-radius: 20px;
    white-space: nowrap; flex-shrink: 0;
}
.vcard-badge.b-running { background: #e8f5e9; color: #2e7d32; }
.vcard-badge.b-parked  { background: #e3f2fd; color: #1a73e8; }
.vcard-badge.b-warning { background: #fbe9e7; color: #c62828; }
.vcard-badge.b-offline { background: #eee; color: #616161; }
.vcard-body { padding-top: 10px; }

/* Battery bar */
.vcard-battery {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 8px;
}
.vcard-battery-label { font-size: 11px; color: #999; flex-shrink: 0; }
.vcard-battery-bar {
    flex: 1; height: 6px; background: #f0f0f0; border-radius: 3px; overflow: hidden;
}
.vcard-battery-fill {
    height: 100%; border-radius: 3px;
    background: linear-gradient(90deg, #43a047, #2e7d32);
    transition: width .3s ease;
}
.vcard-battery-fill.low { background: linear-gradient(90deg, #ef5350, #c62828); }
.vcard-battery-fill.mid { background: linear-gradient(90deg, #ffb74d, #e65100); }
.vcard-battery-val {
    font-size: 12px; font-weight: 600; color: #2e7d32;
    min-width: 36px; text-align: right; flex-shrink: 0;
}
.vcard-battery-val.low { color: #c62828; }
.vcard-battery-val.mid { color: #e65100; }

/* Metric grid */
.vcard-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 10px 6px;
}
.vcard-metric {
    display: flex; align-items: center; gap: 5px;
    font-size: 11px; color: #555;
    white-space: nowrap; overflow: hidden;
}
.vcard-metric-icon {
    width: 20px; height: 20px; border-radius: 5px;
    display: flex; align-items: center; justify-content: center;
    background: #f3f6fb; font-size: 11px; flex-shrink: 0;
}
.vcard-metric-val { color: #333; font-weight: 500; }
.vcard-metric-val.dim { color: #999; font-weight: 400; }

/* View toggle */
.view-toggle { margin-left: auto; }
.view-btn {
    width: 34px; height: 32px; border: 1px solid #ddd;
    border-radius: 6px; background: #fff; cursor: pointer;
    font-size: 16px; color: #666; display: flex;
    align-items: center; justify-content: center;
    transition: all .15s ease; padding: 0;
}
.view-btn.active { background: #1a73e8; color: #fff; border-color: #1a73e8; }
.view-btn:active { transform: scale(.95); }

/* Double-column layout */
.vehicle-list-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
}
.vehicle-list-grid > .vcard { min-width: 0; max-width: 100%; overflow: hidden; box-sizing: border-box; }
/* Compact card for double-column */
.vcard.compact { padding: 5px 4px 4px 4px; margin-bottom: 0; border-radius: 8px; overflow: hidden; box-sizing: border-box; }
.vcard.compact .vcard-head { gap: 3px; padding-bottom: 3px; }
.vcard.compact .vcard-no { width: 22px; height: 22px; border-radius: 5px; font-size: 9px; }
.vcard.compact .vcard-title { font-size: 10px; }
.vcard.compact .vcard-sub { display: none; }
.vcard.compact .vcard-badge { font-size: 8px; padding: 1px 3px; max-width: 28px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vcard.compact .vcard-body { padding-top: 3px; }
.vcard.compact .vcard-battery { margin-bottom: 3px; gap: 2px; }
.vcard.compact .vcard-battery-label { font-size: 8px; }
.vcard.compact .vcard-battery-bar { height: 3px; }
.vcard.compact .vcard-battery-val { font-size: 9px; min-width: 20px; }
.vcard.compact .vcard-grid { gap: 2px; grid-template-columns: 1fr 1fr; }
.vcard.compact .vcard-metric { font-size: 8px; gap: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.vcard.compact .vcard-metric-icon { width: 12px; height: 12px; font-size: 7px; border-radius: 2px; }
.vcard.compact .vcard-metric-val { font-size: 8px; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: calc(100% - 14px); }
.vcard.compact .vcard-head-info { min-width: 0; overflow: hidden; flex: 1; }
.vcard.compact .vcard-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 双列模式 card 容器减小 padding */
.card.has-grid { padding: 4px; }
/* 双列模式减小 content padding */
.content:has(.has-grid) { padding: 6px; }

/* ===== Alert Page (redesigned) ===== */
.alert-summary {
    display: grid; grid-template-columns: repeat(4,1fr); gap: 6px;
    margin-bottom: 12px;
}
.alert-summary-item {
    border-radius: 8px; padding: 8px 4px; text-align: center;
}
.alert-summary-item.danger { background: linear-gradient(135deg,#fbe9e7,#ffccbc); }
.alert-summary-item.warning { background: linear-gradient(135deg,#fff3e0,#ffe0b2); }
.alert-summary-item.ok { background: linear-gradient(135deg,#e8f5e9,#c8e6c9); }
.alert-summary-item.info { background: linear-gradient(135deg,#e3f2fd,#bbdefb); }
.alert-summary-val { font-size: 20px; font-weight: 700; }
.alert-summary-item.danger .alert-summary-val { color: #c62828; }
.alert-summary-item.warning .alert-summary-val { color: #e65100; }
.alert-summary-item.ok .alert-summary-val { color: #2e7d32; }
.alert-summary-item.info .alert-summary-val { color: #1565c0; }
.alert-summary-label { font-size: 10px; color: #666; margin-top: 1px; }
.alert-card {
    background: #fff; border-radius: 10px; padding: 10px 12px;
    margin-bottom: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.08);
    border-left: 4px solid #c62828;
}
.alert-card.warn { border-left-color: #e65100; }
.alert-card.fault { border-left-color: #6a1b9a; }
.alert-card.alarm { border-left-color: #1565c0; }
.alert-card.offline { border-left-color: #757575; }
.alert-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.alert-no {
    width: 32px; height: 32px; border-radius: 8px;
    color: #fff; font-size: 12px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.alert-card:not(.warn):not(.fault):not(.alarm):not(.offline) .alert-no { background: linear-gradient(135deg,#c62828,#b71c1c); }
.alert-card.warn .alert-no { background: linear-gradient(135deg,#e65100,#bf360c); }
.alert-card.fault .alert-no { background: linear-gradient(135deg,#6a1b9a,#4a148c); }
.alert-card.alarm .alert-no { background: linear-gradient(135deg,#1565c0,#0d47a1); }
.alert-card.offline .alert-no { background: linear-gradient(135deg,#757575,#424242); }
.alert-info { flex: 1; min-width: 0; }
.alert-title { font-size: 13px; font-weight: 600; color: #222; }
.alert-loc { font-size: 11px; color: #999; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-tag {
    font-size: 10px; font-weight: 600; padding: 2px 6px;
    border-radius: 10px; white-space: nowrap; flex-shrink: 0;
}
.alert-tag.low { background: #fbe9e7; color: #c62828; }
.alert-tag.fault { background: #f3e5f5; color: #6a1b9a; }
.alert-tag.alarm { background: #e3f2fd; color: #1565c0; }
.alert-tag.offline { background: #eee; color: #616161; }
.alert-battery-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.alert-battery-bar { flex: 1; height: 6px; background: #eee; border-radius: 3px; overflow: hidden; }
.alert-battery-fill { height: 100%; background: linear-gradient(90deg,#ef5350,#c62828); border-radius: 3px; }
.alert-card.warn .alert-battery-fill { background: linear-gradient(90deg,#ffb74d,#e65100); }
.alert-battery-val { font-size: 14px; font-weight: 700; color: #c62828; min-width: 30px; text-align: right; }
.alert-card.warn .alert-battery-val { color: #e65100; }
.alert-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 11px; color: #777; margin-bottom: 6px; }
.alert-actions { display: flex; gap: 6px; }
.alert-btn { flex: 1; padding: 6px 0; border: none; border-radius: 6px; font-size: 12px; font-weight: 500; cursor: pointer; }
.alert-btn.primary { background: #1a73e8; color: #fff; }
.alert-btn.ghost { background: #f5f5f5; color: #666; }
.alert-btn:active { transform: scale(.97); }
.alert-empty { text-align: center; padding: 50px 20px; }
.alert-empty .emoji { font-size: 42px; margin-bottom: 10px; }
/* Alert filter tabs */
.alert-filters { display: flex; gap: 4px; margin-bottom: 10px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.alert-filter-btn {
    padding: 5px 10px; border: none; border-radius: 14px;
    font-size: 12px; font-weight: 500; cursor: pointer;
    white-space: nowrap; flex-shrink: 0;
    background: #f0f0f0; color: #666;
}
.alert-filter-btn.active { background: #1a73e8; color: #fff; }
.alert-filter-btn .count { font-size: 10px; opacity: .8; margin-left: 2px; }

/* Error */
.error-page {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    height: 100vh; text-align: center; padding: 20px;
}
.error-page h2 { color: #c62828; margin-bottom: 8px; }
.error-page p { color: #666; font-size: 14px; }
.retry-btn {
    margin-top: 20px; padding: 10px 24px;
    background: #1a73e8; color: #fff; border: none;
    border-radius: 8px; font-size: 14px; cursor: pointer;
}

/* Map */
#mapContainer {
    width: 100%;
    height: calc(100vh - 140px);
    min-height: 400px;
    border-radius: 12px;
    overflow: hidden;
    background: #e8eaed;
}
#mapContainer .leaflet-container { background: #e8eaed; }
#mapContainer .veh-marker-wrap { background: transparent !important; border: none !important; }
.map-hint {
    padding: 10px 12px;
    background: #fff3e0;
    color: #e65100;
    font-size: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
}
.map-legend {
    position: absolute;
    top: 12px; right: 12px;
    background: rgba(255,255,255,0.95);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 10;
}
.map-legend div { display: flex; align-items: center; gap: 6px; margin: 3px 0; }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,0.2); }
.dot-green { background: #2e7d32; }
.dot-blue { background: #1a73e8; }
.dot-red { background: #c62828; }
.dot-grey { background: #9e9e9e; }

/* ===== Vehicle Marker (divIcon, 自定义外观) ===== */
.veh-marker-wrap { background: transparent !important; border: none !important; }
.veh-marker {
    position: relative;
    cursor: pointer;
    transform: translate(-50%, -100%);
    user-select: none;
}
.veh-marker-body {
    background: #fff;
    border: 2px solid #2e7d32;
    color: #1f2937;
    padding: 4px 10px 4px 8px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(0,0,0,0.18);
    white-space: nowrap;
    display: flex; align-items: center; gap: 6px;
    transition: transform .15s ease;
}
.veh-marker:hover .veh-marker-body { transform: translateY(-2px); }
.veh-marker-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #2e7d32;
    box-shadow: 0 0 0 2px rgba(46,125,50,0.18);
}
.veh-marker-no { font-feature-settings: 'tnum'; letter-spacing: .5px; }
.veh-marker-tail {
    position: absolute;
    left: 50%; top: 100%;
    transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #2e7d32;
    margin-top: -2px;
}
/* 状态色 */
.veh-marker-green .veh-marker-body { border-color: #2e7d32; }
.veh-marker-green .veh-marker-dot  { background: #2e7d32; box-shadow: 0 0 0 2px rgba(46,125,50,0.18); }
.veh-marker-green .veh-marker-tail { border-top-color: #2e7d32; }
.veh-marker-blue .veh-marker-body  { border-color: #1a73e8; }
.veh-marker-blue .veh-marker-dot   { background: #1a73e8; box-shadow: 0 0 0 2px rgba(26,115,232,0.18); }
.veh-marker-blue .veh-marker-tail  { border-top-color: #1a73e8; }
.veh-marker-red .veh-marker-body   { border-color: #c62828; color: #c62828; }
.veh-marker-red .veh-marker-dot    { background: #c62828; box-shadow: 0 0 0 2px rgba(198,40,40,0.18); }
.veh-marker-red .veh-marker-tail   { border-top-color: #c62828; }
.veh-marker-red .veh-marker-body   { animation: veh-marker-pulse 1.5s infinite; }
@keyframes veh-marker-pulse {
    0%, 100% { box-shadow: 0 3px 10px rgba(198,40,40,0.18); }
    50%      { box-shadow: 0 3px 16px rgba(198,40,40,0.55); }
}
.veh-marker-grey .veh-marker-body  { border-color: #757575; opacity: .7; }
.veh-marker-grey .veh-marker-dot   { background: #757575; box-shadow: none; }
.veh-marker-grey .veh-marker-tail  { border-top-color: #757575; }

/* ===== Vehicle Detail (full-screen sheet) ===== */
.vehicle-detail {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: #f5f5f5;
    z-index: 500;
    transform: translateX(100%);
    transition: transform .28s cubic-bezier(.2,.8,.2,1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.vehicle-detail.show { transform: translateX(0); }

.vd-header {
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: #fff;
    padding: 12px 14px;
    position: sticky; top: 0;
    display: flex; align-items: center; gap: 10px;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(13,71,161,0.18);
}
.vd-back {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 22px; line-height: 1;
    border: none; padding: 0;
    flex-shrink: 0;
}
.vd-back:active { background: rgba(255,255,255,0.32); }
.vd-title { font-size: 17px; font-weight: 600; flex: 1; min-width: 0; }
.vd-status-pill { font-size: 12px; padding: 4px 12px; border-radius: 12px; background: rgba(255,255,255,0.22); flex-shrink: 0; }

.vd-hero {
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: #fff;
    padding: 4px 16px 30px;
    text-align: center;
}
.vd-hero-plate {
    display: inline-block;
    width: 86px; height: 86px;
    line-height: 86px;
    border-radius: 22px;
    background: rgba(255,255,255,0.16);
    border: 2px solid rgba(255,255,255,0.4);
    font-size: 38px; font-weight: 700;
    margin: 4px auto 14px;
    letter-spacing: 1px;
}
.vd-hero.offline .vd-hero-plate {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.22);
}
.vd-hero-name { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.vd-hero-frame { font-size: 12px; opacity: .85; word-break: break-all; padding: 0 12px; }

.vd-section {
    background: #fff;
    margin: 12px 12px 0;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.vd-section-title {
    font-size: 13px; font-weight: 600; color: #555;
    margin-bottom: 12px;
    display: flex; align-items: center; gap: 6px;
}
.vd-section-title::before {
    content: ''; width: 3px; height: 13px; background: #1a73e8; border-radius: 2px;
}
.vd-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
}
.vd-info-item { display: flex; flex-direction: column; min-width: 0; }
.vd-info-label { font-size: 11px; color: #999; margin-bottom: 3px; }
.vd-info-val { font-size: 14px; color: #222; font-weight: 500; word-break: break-all; }

.vd-battery {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 14px;
}
.vd-battery-label { font-size: 12px; color: #999; flex-shrink: 0; }
.vd-battery-bar {
    flex: 1; height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}
.vd-battery-fill { height: 100%; border-radius: 4px; transition: width .4s; }
.vd-battery-fill.high { background: linear-gradient(90deg, #43a047, #66bb6a); }
.vd-battery-fill.mid  { background: linear-gradient(90deg, #fb8c00, #ffa726); }
.vd-battery-fill.low  { background: linear-gradient(90deg, #e53935, #ef5350); }
.vd-battery-pct { font-size: 16px; font-weight: 700; flex-shrink: 0; }
.vd-battery-pct.high { color: #43a047; }
.vd-battery-pct.mid  { color: #fb8c00; }
.vd-battery-pct.low  { color: #e53935; }

.vd-metric-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.vd-metric {
    background: #f8f9fb;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex; align-items: center; gap: 8px;
}
.vd-metric-icon {
    width: 32px; height: 32px;
    background: #fff;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    flex-shrink: 0;
}
.vd-metric-info { min-width: 0; }
.vd-metric-label { font-size: 10px; color: #999; }
.vd-metric-val { font-size: 14px; font-weight: 600; color: #222; }
.vd-metric-val.dim { color: #999; font-weight: 500; }

.vd-map {
    position: relative;
    width: 100%;
    height: 280px;
    background: #e8eef7;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #d0d7e3;
}
.vd-map .leaflet-container { background: #e8eef7; }
.vd-map .veh-marker-wrap { background: transparent !important; border: none !important; }
.vd-map-pin {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    box-shadow: 0 3px 10px rgba(0,0,0,0.35);
    border: 2px solid #fff;
    white-space: nowrap;
}
.vd-map-marker {
    position: absolute;
    width: 34px; height: 34px;
    margin-left: -17px; margin-top: -17px;
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    box-shadow: 0 3px 10px rgba(13,71,161,0.45);
    border: 2px solid #fff;
    pointer-events: none;
    z-index: 2;
}
.vd-map-marker.b-warning { background: linear-gradient(135deg, #c62828, #b71c1c); box-shadow: 0 3px 10px rgba(198,40,40,0.45); }
.vd-map-marker.b-offline { background: linear-gradient(135deg, #9e9e9e, #616161); box-shadow: none; }
.vd-map-empty {
    width: 100%; aspect-ratio: 1;
    background: repeating-linear-gradient(45deg, #f0f4fa 0 12px, #e8eef7 12px 24px);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #999; font-size: 13px;
    border: 1px dashed #d0d7e3;
}
.vd-map-loading {
    position: absolute;
    inset: 0;
    background: rgba(232,238,247,0.85);
    display: flex; align-items: center; justify-content: center;
    color: #999; font-size: 12px;
    pointer-events: none;
    z-index: 1;
}
.vd-map-attrib {
    position: absolute;
    right: 4px; bottom: 4px;
    font-size: 10px;
    color: #fff;
    background: rgba(0,0,0,0.35);
    padding: 1px 5px;
    border-radius: 3px;
    pointer-events: none;
    z-index: 3;
}

.vd-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.vd-action-btn {
    padding: 12px 8px;
    border: 1px solid #e0e6ef;
    background: #fff;
    border-radius: 10px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    transition: transform .1s;
}
.vd-action-btn .ico { font-size: 18px; }
.vd-action-btn.primary { background: #1a73e8; color: #fff; border-color: #1a73e8; }
.vd-action-btn.danger  { background: #fff; color: #c62828; border-color: #fbe9e7; }
.vd-action-btn.disabled, .vd-action-btn:disabled { opacity: .5; cursor: not-allowed; }
.vd-action-btn:active:not(.disabled):not(:disabled) { transform: scale(.97); }

/* Raw data section */
.vd-raw-list {
    background: #f8f9fb;
    border-radius: 8px;
    padding: 10px 12px;
    max-height: 320px;
    overflow-y: auto;
}
.vd-raw-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 12px;
    line-height: 1.5;
}
.vd-raw-row:last-child { border-bottom: none; }
.vd-raw-key {
    color: #888;
    flex-shrink: 0;
    margin-right: 12px;
    font-family: monospace;
    max-width: 45%;
    word-break: break-all;
}
.vd-raw-val {
    color: #333;
    text-align: right;
    font-weight: 500;
    word-break: break-all;
}

/* Desktop: center the sheet */
@media (min-width: 600px) {
    .vehicle-detail { max-width: 460px; left: 50%; transform: translateX(50%); right: auto; }
    .vehicle-detail.show { transform: translateX(-50%); }
}


