/* ═══════════════════════════════════════════════════════
   MONITORING — CONTROL TOWER PRO v3
   Mapa full-screen · Sidebar flotante · Player inferior
   ═══════════════════════════════════════════════════════ */

/* ── LAYOUT: mapa ocupa todo, sidebar flota encima ── */
.monitoring-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 72px);
    overflow: hidden;
}

#monitoring-map {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* ── SIDEBAR FLOTANTE ── */
.monitoring-sidebar {
    position: absolute;
    top: 12px;
    left: 12px;
    bottom: 12px;
    width: 360px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(10, 15, 28, 0.82);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0,180,240,0.08);
}

html:not(.dark) .monitoring-sidebar {
    background: rgba(255,255,255,0.88);
    border-color: rgba(0,0,0,0.08);
    box-shadow: 0 24px 64px rgba(0,0,0,0.18);
}

/* ── HEADER ── */
.mon-header {
    padding: 14px 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(0,180,240,0.08) 0%, transparent 100%);
}

html:not(.dark) .mon-header {
    background: linear-gradient(135deg, rgba(0,180,240,0.05) 0%, transparent 100%);
    border-bottom-color: rgba(0,0,0,0.06);
}

.mon-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.mon-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: #f1f5f9;
    letter-spacing: .04em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

html:not(.dark) .mon-title { color: #0f172a; }

.mon-live-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
    animation: mon-pulse 2s infinite;
}

@keyframes mon-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.7); }
    70%  { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
    100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

.mon-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.mon-stat-chip {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 8px 6px;
    text-align: center;
    transition: background 0.15s;
}

html:not(.dark) .mon-stat-chip {
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.07);
}

.mon-stat-chip .val {
    font-size: 1.3rem;
    font-weight: 900;
    line-height: 1;
    color: #f1f5f9;
    font-variant-numeric: tabular-nums;
}

html:not(.dark) .mon-stat-chip .val { color: #0f172a; }

.mon-stat-chip .lbl {
    font-size: 0.58rem;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-top: 3px;
    font-weight: 600;
}

html:not(.dark) .mon-stat-chip .lbl { color: rgba(0,0,0,0.4); }

.mon-stat-chip.online  .val { color: #22c55e; }
.mon-stat-chip.offline .val { color: #6b7280; }

/* ── TABS ── */
.mon-tabs {
    display: flex;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
    padding: 0 4px;
}

html:not(.dark) .mon-tabs {
    background: rgba(0,0,0,0.04);
    border-bottom-color: rgba(0,0,0,0.07);
}

.mon-tab {
    flex: 1;
    padding: 10px 2px 8px;
    font-size: 0.6rem;
    font-weight: 700;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.35);
    cursor: pointer;
    transition: all 0.18s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    border-bottom: 2px solid transparent;
    letter-spacing: .05em;
    text-transform: uppercase;
    position: relative;
}

html:not(.dark) .mon-tab { color: rgba(0,0,0,0.4); }

.mon-tab .tab-icon { font-size: 1.1rem; line-height: 1; }

.mon-tab:hover { color: rgba(255,255,255,0.7); }
html:not(.dark) .mon-tab:hover { color: rgba(0,0,0,0.7); }

.mon-tab.active {
    color: #00b4f0;
    border-bottom-color: #00b4f0;
}

.mon-tab-content { display: none; flex-direction: column; flex: 1; min-height: 0; }
.mon-tab-content.active { display: flex; }

.mon-tab-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
}

.mon-tab-scroll::-webkit-scrollbar { width: 3px; }
.mon-tab-scroll::-webkit-scrollbar-track { background: transparent; }
.mon-tab-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }

/* ── VEHICLE CARDS ── */
.car-status-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 11px 13px;
    cursor: pointer;
    transition: all 0.18s ease;
    position: relative;
    overflow: hidden;
}

html:not(.dark) .car-status-card {
    background: rgba(0,0,0,0.02);
    border-color: rgba(0,0,0,0.08);
}

/* Accent bar izquierda */
.car-status-card::before {
    content: '';
    position: absolute;
    left: 0; top: 10%; bottom: 10%;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: #6b7280;
    transition: background 0.2s, height 0.2s;
}

.car-status-card.status-moving::before   { background: #22c55e; box-shadow: 0 0 8px rgba(34,197,94,0.5); }
.car-status-card.status-speeding::before { background: #ef4444; box-shadow: 0 0 8px rgba(239,68,68,0.5); animation: blink-bar 0.8s infinite; }
.car-status-card.status-stopped::before  { background: #00b4f0; }
.car-status-card.status-offline::before  { background: #374151; }

@keyframes blink-bar {
    0%,100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

.car-status-card:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(0,180,240,0.3);
    transform: translateX(2px);
}

html:not(.dark) .car-status-card:hover {
    background: rgba(0,180,240,0.05);
    border-color: rgba(0,180,240,0.3);
}

.car-status-card.active {
    border-color: rgba(0,180,240,0.45);
    background: rgba(0,180,240,0.07);
}

.csc-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 9px;
}

.csc-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: #f1f5f9;
    line-height: 1.2;
}
html:not(.dark) .csc-name { color: #0f172a; }

.csc-plate {
    font-family: 'Courier New', monospace;
    font-size: 0.68rem;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 2px 8px;
    border-radius: 6px;
    color: rgba(255,255,255,0.6);
    letter-spacing: .06em;
    font-weight: 700;
}

html:not(.dark) .csc-plate {
    background: rgba(0,0,0,0.06);
    border-color: rgba(0,0,0,0.1);
    color: rgba(0,0,0,0.5);
}

.csc-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-top: 4px;
}

.badge-moving   { background: rgba(34,197,94,.15);   color: #22c55e; }
.badge-speeding { background: rgba(239,68,68,.15);   color: #ef4444; animation: badge-blink 0.8s infinite; }
.badge-stopped  { background: rgba(0,180,240,.12);   color: #00b4f0; }
.badge-offline  { background: rgba(107,114,128,.12); color: #6b7280; }

@keyframes badge-blink { 0%,100%{opacity:1} 50%{opacity:.5} }

.csc-grid {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 5px;
    margin-bottom: 9px;
}

.csc-metric {
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

html:not(.dark) .csc-metric { background: rgba(0,0,0,0.04); }

.csc-metric-val {
    font-size: 1rem;
    font-weight: 800;
    color: #f1f5f9;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

html:not(.dark) .csc-metric-val { color: #0f172a; }

.csc-metric-lbl {
    font-size: 0.55rem;
    color: rgba(255,255,255,0.3);
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 600;
}

html:not(.dark) .csc-metric-lbl { color: rgba(0,0,0,0.35); }

.csc-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

html:not(.dark) .csc-footer { border-top-color: rgba(0,0,0,0.06); }

.csc-update {
    font-size: 0.62rem;
    color: rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    gap: 4px;
}

html:not(.dark) .csc-update { color: rgba(0,0,0,0.35); }

/* ── ROUTE FORM ── */
.route-form-panel {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 13px;
}

html:not(.dark) .route-form-panel {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.07);
}

.route-form-panel label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: rgba(255,255,255,0.4);
    display: block;
    margin-bottom: 5px;
}

html:not(.dark) .route-form-panel label { color: rgba(0,0,0,0.45); }

.route-form-panel .form-control {
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.09);
    background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03));
    color: #f8fafc;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 10px 24px rgba(0,0,0,0.18);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.route-form-panel .form-control:hover {
    border-color: rgba(0,180,240,0.28);
}

.route-form-panel .form-control:focus {
    outline: none;
    border-color: rgba(0,180,240,0.7);
    box-shadow: 0 0 0 3px rgba(0,180,240,0.16), inset 0 1px 0 rgba(255,255,255,0.05);
}

.route-form-panel select.form-control {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 38px;
    background-image:
      linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.8) 50%),
      linear-gradient(135deg, rgba(255,255,255,0.8) 50%, transparent 50%);
    background-position:
      calc(100% - 19px) calc(50% - 3px),
      calc(100% - 13px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.route-form-panel input[type="date"].form-control {
    color-scheme: dark;
    padding-right: 42px;
    font-variant-numeric: tabular-nums;
}

.route-form-panel input[type="date"].form-control::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.9;
    filter: invert(1) brightness(1.15);
}

html:not(.dark) .route-form-panel .form-control {
    border-color: rgba(15,23,42,0.1);
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(241,245,249,0.92));
    color: #0f172a;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 10px 24px rgba(15,23,42,0.08);
}

html:not(.dark) .route-form-panel select.form-control {
    background-image:
      linear-gradient(45deg, transparent 50%, rgba(15,23,42,0.62) 50%),
      linear-gradient(135deg, rgba(15,23,42,0.62) 50%, transparent 50%);
}

html:not(.dark) .route-form-panel input[type="date"].form-control {
    color-scheme: light;
}

html:not(.dark) .route-form-panel input[type="date"].form-control::-webkit-calendar-picker-indicator {
    filter: none;
}

/* ── ROUTE PLAYER (panel flotante sobre el mapa) ── */
.route-player {
    position: absolute;
    bottom: 16px;
    left: 388px;
    right: 16px;
    z-index: 200;
    background: rgba(10, 15, 28, 0.88);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 14px 18px;
    display: none;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}

html:not(.dark) .route-player {
    background: rgba(255,255,255,0.92);
    border-color: rgba(0,0,0,0.08);
}

.route-player.visible { display: flex; }

/* ── Stats chips row inside player ── */
.rp-stats-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    margin-bottom: 2px;
}
.rp-stats-row::-webkit-scrollbar { display: none; }
html:not(.dark) .rp-stats-row { border-bottom-color: rgba(0,0,0,0.07); }

.rp-stat-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 5px 10px;
    min-width: 70px;
    flex-shrink: 0;
}
html:not(.dark) .rp-stat-chip { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.07); }

.rp-sc-lbl {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.38);
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}
html:not(.dark) .rp-sc-lbl { color: rgba(0,0,0,0.4); }

.rp-sc-val {
    font-size: 0.78rem;
    font-weight: 700;
    color: #e2e8f0;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
html:not(.dark) .rp-sc-val { color: #0f172a; }

.rp-top {
    display: flex;
    align-items: center;
    gap: 14px;
}

.rp-play-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00b4f0, #0090cc);
    border: none;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 18px rgba(0,180,240,0.5);
    transition: transform 0.15s, box-shadow 0.15s;
    flex-shrink: 0;
}

.rp-play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 28px rgba(0,180,240,0.7);
}

.rp-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.rp-time {
    font-size: 1.2rem;
    font-weight: 900;
    color: #f1f5f9;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

html:not(.dark) .rp-time { color: #0f172a; }

.rp-date {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.35);
    font-weight: 500;
}

html:not(.dark) .rp-date { color: rgba(0,0,0,0.4); }

.rp-speed-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.rp-speed {
    font-size: 1.3rem;
    font-weight: 900;
    color: #22c55e;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    transition: color 0.3s;
    min-width: 80px;
    text-align: right;
}

.rp-speed-unit {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.3);
    font-weight: 600;
    text-transform: uppercase;
}

html:not(.dark) .rp-speed-unit { color: rgba(0,0,0,0.35); }

.rp-speed-sel {
    font-size: 0.68rem;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    color: #f1f5f9;
    cursor: pointer;
    font-weight: 600;
}

html:not(.dark) .rp-speed-sel {
    background: rgba(0,0,0,0.06);
    border-color: rgba(0,0,0,0.1);
    color: #0f172a;
}

/* Timeline */
.rp-timeline {
    position: relative;
    padding-top: 18px;
}

.rp-hour-ticks {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 18px;
    pointer-events: none;
}

.rp-hour-tick {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateX(-50%);
    gap: 1px;
}

.rp-hour-tick span {
    font-size: 8px;
    color: rgba(255,255,255,0.3);
    font-weight: 600;
    white-space: nowrap;
}

html:not(.dark) .rp-hour-tick span { color: rgba(0,0,0,0.3); }

.rp-hour-tick div {
    width: 1px;
    height: 4px;
    background: rgba(255,255,255,0.15);
}

html:not(.dark) .rp-hour-tick div { background: rgba(0,0,0,0.15); }

#route-anim-slider {
    width: 100%;
    height: 5px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.1);
    border-radius: 5px;
    cursor: pointer;
    outline: none;
}

html:not(.dark) #route-anim-slider { background: rgba(0,0,0,0.1); }

#route-anim-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00b4f0, #0090cc);
    box-shadow: 0 0 10px rgba(0,180,240,0.6);
    cursor: pointer;
    transition: transform 0.1s;
    border: 2px solid rgba(255,255,255,0.2);
}

#route-anim-slider::-webkit-slider-thumb:hover { transform: scale(1.25); }

/* ── EVENTS ── */
.route-events-wrap {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    overflow: hidden;
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

html:not(.dark) .route-events-wrap {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.07);
}

.route-events-wrap.visible { display: flex; }

.route-events-header {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,0.3);
    flex-shrink: 0;
    background: rgba(0,0,0,0.15);
}

html:not(.dark) .route-events-header {
    border-bottom-color: rgba(0,0,0,0.07);
    color: rgba(0,0,0,0.35);
    background: rgba(0,0,0,0.03);
}

#route-points-list { flex: 1; overflow-y: auto; min-height: 0; }
#route-points-list::-webkit-scrollbar { width: 2px; }
#route-points-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }

.route-event-item {
    padding: 8px 13px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    cursor: pointer;
    transition: background 0.12s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

html:not(.dark) .route-event-item { border-bottom-color: rgba(0,0,0,0.05); }

.route-event-item:hover { background: rgba(0,180,240,0.08); }
.route-event-item:last-child { border-bottom: none; }

.route-event-label {
    font-size: 0.76rem;
    font-weight: 600;
    flex: 1;
}

.route-event-time {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.3);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

html:not(.dark) .route-event-time { color: rgba(0,0,0,0.35); }

/* ── COMMANDS & GEOFENCES ── */
.cmd-card, .geo-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    transition: border-color 0.15s, background 0.15s;
}

html:not(.dark) .cmd-card, html:not(.dark) .geo-card {
    border-color: rgba(0,0,0,0.07);
    background: rgba(0,0,0,0.03);
}

.cmd-card:hover, .geo-card:hover {
    border-color: rgba(0,180,240,0.35);
    background: rgba(0,180,240,0.05);
}

.cmd-card-dim { opacity: 0.35; }

.btn-cmd {
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: opacity 0.15s, transform 0.1s;
    flex-shrink: 0;
    letter-spacing: .03em;
}

.btn-cmd:hover { opacity: 0.85; transform: scale(0.96); }

/* ── MAP FLOATING BADGES (top-right) ── */
.mon-map-badges {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 100;
    display: flex;
    gap: 8px;
    pointer-events: none;
}

.mon-map-badge {
    background: rgba(10,15,28,0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: .03em;
}

html:not(.dark) .mon-map-badge {
    background: rgba(255,255,255,0.9);
    border-color: rgba(0,0,0,0.1);
    color: #0f172a;
}

.mon-map-badge .badge-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mon-map-badge.online-badge  .badge-dot { background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.mon-map-badge.offline-badge .badge-dot { background: #9ca3af; }
.mon-map-badge.online-badge  { border-color: rgba(34,197,94,0.25); }
.mon-map-badge.offline-badge { border-color: rgba(156,163,175,0.2); }

/* ── LEAFLET LIGHT MAP ── */
.leaflet-tile { filter: none !important; }

.leaflet-container { background: #dbe7f3; }

.leaflet-control-zoom {
    border-radius: 12px !important;
    overflow: hidden;
    border: none !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4) !important;
}

.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
    background: rgba(255,255,255,0.94) !important;
    backdrop-filter: blur(12px);
    color: #0f172a !important;
    border-bottom: 1px solid rgba(15,23,42,0.08) !important;
}

.leaflet-control-zoom-in:hover,
.leaflet-control-zoom-out:hover {
    background: rgba(0,180,240,0.14) !important;
    color: #0098cf !important;
}

.leaflet-popup-content-wrapper {
    background: rgba(10,15,28,0.92) !important;
    backdrop-filter: blur(16px);
    color: #f1f5f9 !important;
    border-radius: 14px !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    box-shadow: 0 16px 48px rgba(0,0,0,0.6) !important;
}

html:not(.dark) .leaflet-popup-content-wrapper {
    background: rgba(255,255,255,0.95) !important;
    color: #0f172a !important;
    border-color: rgba(0,0,0,0.1) !important;
}

.leaflet-popup-tip {
    background: rgba(10,15,28,0.92) !important;
}

html:not(.dark) .leaflet-popup-tip { background: rgba(255,255,255,0.95) !important; }

/* ── CAR MARKER ── */
.car-marker { display: flex; align-items: center; justify-content: center; }

.car-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

.car-label {
    position: absolute;
    bottom: -19px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(7,12,24,0.88);
    backdrop-filter: blur(6px);
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 9px;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,0.08);
    color: #e2e8f0;
    pointer-events: none;
    letter-spacing: .03em;
}

.car-label-offline { color: #6b7280; }

/* ── RESPONSIVE ── */
@media (max-width: 992px) {
    .monitoring-container { height: auto; min-height: 100vh; }
    #monitoring-map { position: relative; height: 55vw; min-height: 280px; }
    .monitoring-sidebar {
        position: relative;
        top: auto; left: auto; bottom: auto;
        width: 100%;
        border-radius: 0;
        max-height: 55vh;
    }
    .route-player {
        position: relative;
        bottom: auto; left: auto; right: auto;
        border-radius: 12px;
        margin: 10px;
    }
    .mon-map-badges { display: none; }
}

@media (max-width: 768px) {
    .monitoring-container {
        min-height: calc(100vh - 64px);
    }

    #monitoring-map {
        height: 58vh;
        min-height: 260px;
    }

    .monitoring-sidebar {
        margin: 8px;
        width: auto;
        max-height: none;
        border-radius: 14px;
    }

    .mon-title {
        font-size: 0.74rem;
    }

    .mon-stat-chip .val {
        font-size: 1.08rem;
    }

    .mon-tab {
        font-size: 0.56rem;
        padding: 9px 2px 7px;
    }

    .route-player {
        margin: 8px;
        padding: 10px 12px;
        border-radius: 12px;
        gap: 8px;
    }

    .rp-top {
        flex-wrap: wrap;
        gap: 10px;
    }

    .rp-play-btn {
        width: 42px;
        height: 42px;
        font-size: 15px;
    }

    .rp-speed {
        font-size: 1.75rem;
    }

    .rp-speed-sel {
        min-width: 62px;
        height: 28px;
        padding: 0 8px;
    }

    .route-events-wrap {
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;
        width: auto;
        height: 220px;
        margin: 0 8px 8px;
        border-radius: 12px;
    }
}

@media (max-width: 520px) {
    #monitoring-map {
        height: 54vh;
        min-height: 230px;
    }

    .monitoring-sidebar {
        margin: 6px;
        border-radius: 12px;
    }

    .mon-header {
        padding: 12px;
    }

    .mon-stat-chip {
        padding: 7px 5px;
    }

    .rp-stats-row {
        gap: 6px;
    }

    .rp-stat-chip {
        min-width: 84px;
        padding: 6px 7px;
    }

    .rp-time {
        font-size: 1.85rem;
    }

    .rp-speed {
        font-size: 1.58rem;
    }
}
