@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', 'Segoe UI', sans-serif; background: #0f172a; height: 100vh; overflow: hidden; }

/* Top Bar */
.topbar {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 60px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    z-index: 1000;
}
.topbar .logo { display: flex; align-items: center; gap: 12px; }
.topbar .logo-icon {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}
.topbar h1 { font-size: 17px; font-weight: 700; letter-spacing: -0.3px; }
.topbar h1 span { color: #60a5fa; font-weight: 300; }
.topbar .controls { display: flex; align-items: center; gap: 10px; }
.topbar input[type="date"] {
    padding: 8px 14px; border: 1px solid rgba(255,255,255,0.15); border-radius: 10px;
    font-size: 13px; font-family: 'Inter', sans-serif;
    background: rgba(255,255,255,0.07); color: white; cursor: pointer; transition: all 0.2s;
}
.topbar input[type="date"]:hover { border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.12); }
.topbar input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); }

.topbar button {
    padding: 8px 18px; border: none; border-radius: 10px;
    font-size: 13px; font-weight: 600; font-family: 'Inter', sans-serif;
    cursor: pointer; transition: all 0.25s;
    display: flex; align-items: center; gap: 6px; letter-spacing: -0.2px;
}
.btn-load { background: linear-gradient(135deg, #3b82f6, #2563eb); color: white; box-shadow: 0 2px 10px rgba(59,130,246,0.3); }
.btn-load:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(59,130,246,0.4); }
.btn-export { background: linear-gradient(135deg, #10b981, #059669); color: white; box-shadow: 0 2px 10px rgba(16,185,129,0.3); }
.btn-export:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(16,185,129,0.4); }
.btn-send-driver { background: linear-gradient(135deg, #8b5cf6, #7c3aed); color: white; box-shadow: 0 2px 10px rgba(139,92,246,0.3); }
.btn-send-driver:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(139,92,246,0.4); }
.btn-optimize { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; box-shadow: 0 2px 10px rgba(245,158,11,0.3); }
.btn-optimize:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(245,158,11,0.4); }
.btn-settings, .btn-clients {
    background: rgba(255,255,255,0.07); color: #94a3b8; padding: 8px 12px !important;
    border: 1px solid rgba(255,255,255,0.1);
}
.btn-settings:hover, .btn-clients:hover { background: rgba(255,255,255,0.12); color: white; border-color: rgba(255,255,255,0.2); }

/* Main Layout */
.main-container { display: flex; height: calc(100vh - 60px); position: relative; }

/* Left Panel */
.panel-left {
    width: 400px; min-width: 350px; background: #1e293b;
    display: flex; flex-direction: column;
    border-right: 1px solid rgba(255,255,255,0.06); overflow: hidden; z-index: 10;
}

/* Tab Navigation */
.tab-nav { display: flex; border-bottom: 1px solid rgba(255,255,255,0.08); }
.tab-btn {
    flex: 1; padding: 10px 12px; background: none; border: none; border-bottom: 2px solid transparent;
    color: #64748b; font-size: 12px; font-weight: 600; font-family: 'Inter', sans-serif;
    cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.tab-btn:hover { color: #94a3b8; background: rgba(255,255,255,0.02); }
.tab-btn.active { color: #60a5fa; border-bottom-color: #3b82f6; background: rgba(59,130,246,0.05); }
.tab-content { display: none; flex-direction: column; flex: 1; overflow: hidden; }
.tab-content.active { display: flex; }

.panel-header {
    padding: 10px 14px; background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 12px; font-weight: 600; color: #94a3b8;
    display: flex; justify-content: space-between; align-items: center;
    text-transform: uppercase; letter-spacing: 0.8px;
}
.stop-count {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6); color: white;
    padding: 3px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: 0;
}
.btn-add-stop {
    background: rgba(59,130,246,0.15) !important; color: #93c5fd !important;
    border: 1px solid rgba(59,130,246,0.2) !important; border-radius: 8px !important;
    padding: 5px 12px !important; cursor: pointer !important;
    font-size: 11px !important; font-weight: 600 !important; font-family: 'Inter', sans-serif !important;
    transition: all 0.2s !important; display: flex !important; align-items: center !important; gap: 4px !important;
}
.btn-add-stop:hover { background: rgba(59,130,246,0.25) !important; color: white !important; border-color: rgba(59,130,246,0.4) !important; }
.btn-return-base { background: rgba(249,115,22,0.15) !important; color: #fdba74 !important; border-color: rgba(249,115,22,0.25) !important; }
.btn-return-base:hover { background: rgba(249,115,22,0.3) !important; color: white !important; border-color: rgba(249,115,22,0.5) !important; }

/* Return to base stop */
.stop-item.return-base { border-left: 3px solid #f59e0b; background: rgba(249,115,22,0.05); }
.stop-item.return-base .stop-number { background: linear-gradient(180deg, #f59e0b, #d97706); }

/* Departure/Arrival stop */
.stop-item.departure-stop { border-left: 3px solid #22c55e; background: rgba(34,197,94,0.05); }
.stop-item.departure-stop .stop-number { background: linear-gradient(180deg, #22c55e, #16a34a); }
.stop-item.arrival-stop { border-left: 3px solid #ef4444; background: rgba(239,68,68,0.05); }
.stop-item.arrival-stop .stop-number { background: linear-gradient(180deg, #ef4444, #dc2626); }

/* Settings checkbox */
.checkbox-label { display: flex !important; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: #94a3b8; cursor: pointer; }
.checkbox-label input[type="checkbox"] { width: 18px; height: 18px; accent-color: #3b82f6; cursor: pointer; }
.btn-copy-departure {
    width: 100%; margin-top: 8px; padding: 8px; border: 1px dashed rgba(59,130,246,0.2);
    border-radius: 8px; background: rgba(59,130,246,0.05); color: #93c5fd;
    font-size: 12px; font-weight: 600; font-family: 'Inter', sans-serif;
    cursor: pointer; transition: all 0.2s;
}
.btn-copy-departure:hover { background: rgba(59,130,246,0.1); border-color: rgba(59,130,246,0.4); }

/* Stop List */
.stop-list { flex: 1; overflow-y: auto; padding: 6px 8px; scroll-behavior: smooth; }
.stop-item {
    display: flex; align-items: stretch;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px; margin-bottom: 4px; cursor: grab;
    transition: all 0.25s; overflow: hidden;
}
.stop-item:hover {
    border-color: rgba(59,130,246,0.4); background: rgba(255,255,255,0.07);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2); transform: translateX(2px);
}
.stop-item.dragging { opacity: 0.4; transform: scale(0.97); }
.stop-item.sortable-ghost { opacity: 0.2; background: rgba(59,130,246,0.1); border-color: rgba(59,130,246,0.3); }
.stop-item.lavender { border-left: 3px solid #a78bfa; }
.stop-number {
    display: flex; align-items: center; justify-content: center; flex-direction: column;
    width: 38px; min-width: 38px;
    background: linear-gradient(180deg, #3b82f6, #2563eb); color: white;
    font-weight: 800; font-size: 13px; letter-spacing: -0.5px;
}
.stop-item.lavender .stop-number { background: linear-gradient(180deg, #8b5cf6, #7c3aed); }
.stop-eta { font-size: 8px; font-weight: 500; opacity: 0.8; margin-top: 1px; letter-spacing: 0; }
.stop-content { flex: 1; padding: 6px 10px; min-width: 0; }
.stop-name {
    font-weight: 600; font-size: 12px; color: #f1f5f9;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.2px;
}
.stop-address {
    font-size: 10px; color: #64748b; margin-top: 1px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stop-tags { display: flex; gap: 3px; margin-top: 3px; flex-wrap: wrap; }
.tag { padding: 1px 6px; border-radius: 4px; font-size: 9px; font-weight: 600; letter-spacing: 0.2px; }
.tag-coffee { background: rgba(239,68,68,0.15); color: #fca5a5; }
.tag-bev { background: rgba(59,130,246,0.15); color: #93c5fd; }
.tag-canc { background: rgba(249,115,22,0.15); color: #fdba74; }
.tag-other { background: rgba(168,85,247,0.15); color: #c4b5fd; }
.tag-pos { background: rgba(34,197,94,0.15); color: #86efac; }
.tag-bolla { background: rgba(234,179,8,0.15); color: #fde047; }
.tag-vm { background: rgba(139,92,246,0.15); color: #a78bfa; border: 1px solid rgba(139,92,246,0.2); }
.tag-time { background: rgba(14,165,233,0.15); color: #7dd3fc; border: 1px solid rgba(14,165,233,0.15); }

.stop-actions { display: flex; flex-direction: column; justify-content: center; padding: 2px 1px; gap: 0; }
.stop-actions button {
    background: none; border: none; cursor: pointer; font-size: 12px;
    padding: 2px 5px; border-radius: 4px; opacity: 0.3; transition: all 0.15s; color: #cbd5e1;
}
.stop-actions button:hover { opacity: 1; background: rgba(255,255,255,0.08); }
.btn-delete:hover { background: rgba(239,68,68,0.15) !important; color: #fca5a5 !important; }
.drag-handle { display: flex; align-items: center; padding: 0 5px; cursor: grab; color: #475569; font-size: 14px; transition: color 0.2s; }
.drag-handle:hover { color: #94a3b8; }

/* Map */
.panel-right { flex: 1; position: relative; }
#map { width: 100%; height: 100%; }

/* Route Info */
.route-info {
    position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
    background: rgba(15,23,42,0.92); backdrop-filter: blur(20px);
    padding: 14px 32px; border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    z-index: 1000; display: flex; gap: 36px; font-size: 13px;
}
.route-info .info-item { text-align: center; }
.route-info .info-value {
    font-weight: 800; font-size: 20px;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; letter-spacing: -0.5px;
}
.route-info .info-label { color: #64748b; font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px; margin-top: 2px; font-weight: 500; }

/* ====== SLIDE PANELS ====== */
.slide-panel {
    position: absolute; top: 0; right: -400px; width: 380px; height: 100%;
    background: #1e293b; border-left: 1px solid rgba(255,255,255,0.08);
    z-index: 500; transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex; flex-direction: column;
    box-shadow: -8px 0 40px rgba(0,0,0,0.3);
}
.slide-panel.open { right: 0; }
.slide-panel-wide { width: 440px; right: -460px; }
.slide-panel-wide.open { right: 0; }

.slide-panel-header {
    padding: 18px 20px; display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.02);
}
.slide-panel-header h3 { color: #f1f5f9; font-size: 16px; font-weight: 700; }
.slide-close {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    color: #94a3b8; width: 32px; height: 32px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; cursor: pointer; transition: all 0.2s;
}
.slide-close:hover { background: rgba(239,68,68,0.15); color: #fca5a5; border-color: rgba(239,68,68,0.2); }

.slide-panel-body { flex: 1; overflow-y: auto; padding: 20px; }

/* Settings */
.settings-section { margin-bottom: 28px; }
.settings-section h4 {
    color: #94a3b8; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px; margin-bottom: 14px;
    padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.slide-panel label {
    display: block; font-size: 12px; color: #94a3b8;
    margin-bottom: 6px; margin-top: 12px; font-weight: 500;
}
.slide-panel label:first-of-type { margin-top: 0; }
.slide-panel input[type="time"], .slide-panel input[type="text"], .slide-panel input[type="number"] {
    width: 100%; padding: 10px 14px;
    border: 1px solid rgba(255,255,255,0.1); border-radius: 10px;
    font-size: 14px; font-family: 'Inter', sans-serif;
    background: rgba(255,255,255,0.05); color: #f1f5f9; transition: all 0.2s;
}
.slide-panel input:focus {
    outline: none; border-color: #3b82f6;
    background: rgba(59,130,246,0.05); box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.stepper {
    display: flex; gap: 8px; align-items: center;
}
.stepper button {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    color: #94a3b8; width: 42px; height: 42px; border-radius: 10px;
    font-size: 14px; font-weight: 700; cursor: pointer; transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}
.stepper button:hover { background: rgba(59,130,246,0.15); color: #93c5fd; border-color: rgba(59,130,246,0.3); }
.stepper input { text-align: center; font-weight: 700; font-size: 18px; }

.hint { font-size: 11px; color: #475569; margin-top: 8px; line-height: 1.5; }

/* Time Summary */
.time-summary {
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px; overflow: hidden;
}
.ts-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.ts-row:last-child { border-bottom: none; }
.ts-row span { color: #94a3b8; font-size: 13px; }
.ts-row strong { color: #f1f5f9; font-size: 14px; font-weight: 700; }
.ts-total { background: rgba(59,130,246,0.08); }
.ts-total strong {
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; font-size: 16px;
}

.btn-save-settings {
    width: 100%; padding: 12px; border: none; border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6, #2563eb); color: white;
    font-size: 14px; font-weight: 600; font-family: 'Inter', sans-serif;
    cursor: pointer; transition: all 0.2s; box-shadow: 0 4px 12px rgba(59,130,246,0.3);
    margin-top: 20px;
}
.btn-save-settings:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(59,130,246,0.4); }

/* ====== CLIENTS PANEL ====== */
.client-search-bar {
    display: flex; align-items: center; gap: 10px;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px; padding: 0 14px; margin-bottom: 16px;
}
.client-search-bar input {
    flex: 1; background: none !important; border: none !important;
    padding: 12px 0 !important; color: #f1f5f9; font-size: 14px;
    font-family: 'Inter', sans-serif;
}
.client-search-bar input:focus { outline: none; box-shadow: none !important; }
.client-search-bar input::placeholder { color: #475569; }

.client-list { flex: 1; overflow-y: auto; max-height: calc(100vh - 240px); }

.client-card {
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px; padding: 12px 14px; margin-bottom: 8px;
    transition: all 0.2s; cursor: pointer;
}
.client-card:hover { border-color: rgba(59,130,246,0.3); background: rgba(255,255,255,0.06); }
.client-card-header { display: flex; justify-content: space-between; align-items: flex-start; }
.client-card-name { font-weight: 600; font-size: 13px; color: #f1f5f9; }
.client-card-addr { font-size: 11px; color: #64748b; margin-top: 3px; }
.client-card-phone { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.client-card-actions { display: flex; gap: 4px; }
.client-card-actions button {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
    color: #94a3b8; width: 28px; height: 28px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; cursor: pointer; transition: all 0.15s;
}
.client-card-actions button:hover { background: rgba(255,255,255,0.1); color: white; }
.client-card-actions .btn-add-to-route:hover { background: rgba(34,197,94,0.15); color: #86efac; border-color: rgba(34,197,94,0.2); }
.client-card-actions .btn-edit-client:hover { background: rgba(59,130,246,0.15); color: #93c5fd; border-color: rgba(59,130,246,0.2); }
.client-card-actions .btn-del-client:hover { background: rgba(239,68,68,0.15); color: #fca5a5; border-color: rgba(239,68,68,0.2); }

.client-card.in-route { border-color: rgba(34,197,94,0.3); background: rgba(34,197,94,0.05); }
.client-card.in-route .client-card-name::after {
    content: "nel giro"; font-size: 9px; font-weight: 600; color: #86efac;
    background: rgba(34,197,94,0.15); padding: 2px 8px; border-radius: 4px;
    margin-left: 8px; vertical-align: middle;
}

.client-panel-footer {
    padding: 16px 0 0;
    border-top: 1px solid rgba(255,255,255,0.06); margin-top: 8px;
}
.btn-add-client {
    width: 100%; padding: 10px; border: 1px dashed rgba(59,130,246,0.3);
    border-radius: 10px; background: rgba(59,130,246,0.05); color: #93c5fd;
    font-size: 13px; font-weight: 600; font-family: 'Inter', sans-serif;
    cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-add-client:hover { background: rgba(59,130,246,0.1); border-color: rgba(59,130,246,0.5); color: white; }

.btn-import-csv {
    width: 100%; padding: 10px; margin-top: 8px;
    border: 1px dashed rgba(16,185,129,0.3); border-radius: 10px;
    background: rgba(16,185,129,0.05); color: #6ee7b7;
    font-size: 13px; font-weight: 600; font-family: 'Inter', sans-serif;
    cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-import-csv:hover { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.5); color: white; }

/* Modal */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); z-index: 2000;
    justify-content: center; align-items: center;
}
.modal-overlay.active { display: flex; }
.modal {
    background: #1e293b; border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px; padding: 28px; width: 440px; max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5); color: #e2e8f0;
}
.modal h3 { margin-bottom: 20px; color: #f1f5f9; font-size: 18px; font-weight: 700; }
.modal label { display: block; font-size: 11px; color: #94a3b8; margin-bottom: 6px; margin-top: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.modal input, .modal select {
    width: 100%; padding: 10px 14px;
    border: 1px solid rgba(255,255,255,0.1); border-radius: 10px;
    font-size: 14px; font-family: 'Inter', sans-serif;
    background: rgba(255,255,255,0.05); color: #f1f5f9; transition: all 0.2s;
}
.modal input:focus, .modal select:focus { outline: none; border-color: #3b82f6; background: rgba(59,130,246,0.05); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.modal select option { background: #1e293b; color: #f1f5f9; }
.modal-actions { display: flex; gap: 10px; margin-top: 24px; justify-content: flex-end; }
.modal-actions button {
    padding: 10px 24px; border: none; border-radius: 10px; cursor: pointer;
    font-weight: 600; font-family: 'Inter', sans-serif; font-size: 13px; transition: all 0.2s;
}
.btn-cancel { background: rgba(255,255,255,0.06); color: #94a3b8; border: 1px solid rgba(255,255,255,0.1); }
.btn-cancel:hover { background: rgba(255,255,255,0.1); color: #e2e8f0; }
.btn-save { background: linear-gradient(135deg, #3b82f6, #2563eb); color: white; box-shadow: 0 4px 12px rgba(59,130,246,0.3); }
.btn-save:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(59,130,246,0.4); }

/* Toast */
.toast {
    position: fixed; bottom: 90px; right: 24px;
    background: rgba(15,23,42,0.95); backdrop-filter: blur(20px); color: white;
    padding: 14px 28px; border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1); font-size: 13px; font-weight: 500;
    z-index: 3000; transform: translateY(100px); opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.toast.show { transform: translateY(0); opacity: 1; }

/* Empty & Loading */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: #64748b; text-align: center; padding: 40px; }
.empty-state .icon { font-size: 52px; margin-bottom: 16px; opacity: 0.5; }
.empty-state p { font-size: 14px; line-height: 1.8; }
.empty-state strong { color: #93c5fd; }
.loading { display: flex; align-items: center; justify-content: center; height: 100%; flex-direction: column; gap: 16px; color: #64748b; font-size: 13px; }
.spinner { width: 36px; height: 36px; border: 3px solid rgba(255,255,255,0.06); border-top: 3px solid #3b82f6; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Scrollbar */
.stop-list::-webkit-scrollbar, .client-list::-webkit-scrollbar, .slide-panel-body::-webkit-scrollbar { width: 5px; }
.stop-list::-webkit-scrollbar-track, .client-list::-webkit-scrollbar-track, .slide-panel-body::-webkit-scrollbar-track { background: transparent; }
.stop-list::-webkit-scrollbar-thumb, .client-list::-webkit-scrollbar-thumb, .slide-panel-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

/* Markers */
.numbered-marker {
    background: linear-gradient(135deg, #3b82f6, #2563eb); color: white;
    border-radius: 50%; width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 12px; font-family: 'Inter', sans-serif;
    border: 2.5px solid white; box-shadow: 0 3px 10px rgba(0,0,0,0.3); letter-spacing: -0.5px;
}
.numbered-marker.lavender { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }

/* Map Controls Overlay */
.map-controls {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.map-ctrl-btn {
    display: none; /* hidden by default, shown when Google Maps is active */
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(15,23,42,0.88);
    backdrop-filter: blur(12px);
    color: #94a3b8;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.map-ctrl-btn:hover { background: rgba(30,41,59,0.95); color: #e2e8f0; border-color: rgba(255,255,255,0.2); }
.map-ctrl-btn.active {
    background: rgba(59,130,246,0.2);
    color: #93c5fd;
    border-color: rgba(59,130,246,0.4);
    box-shadow: 0 0 12px rgba(59,130,246,0.15);
}
.map-ctrl-btn svg { flex-shrink: 0; }

/* Map theme */
.leaflet-tile-pane { filter: saturate(0.85) brightness(0.95); }
.leaflet-control-zoom a { background: #1e293b !important; color: #94a3b8 !important; border-color: rgba(255,255,255,0.1) !important; }
.leaflet-control-zoom a:hover { background: #334155 !important; color: white !important; }
.leaflet-control-attribution { background: rgba(15,23,42,0.8) !important; color: #64748b !important; font-size: 10px !important; }
.leaflet-control-attribution a { color: #60a5fa !important; }
.leaflet-popup-content-wrapper { background: #1e293b; color: #e2e8f0; border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.1); }
.leaflet-popup-tip { background: #1e293b; }
.leaflet-popup-content { font-family: 'Inter', sans-serif; font-size: 12px; line-height: 1.5; }
.leaflet-popup-content strong { color: #f1f5f9; font-size: 13px; }
.leaflet-popup-content small { color: #94a3b8; }
.leaflet-popup-content em { color: #64748b; font-size: 11px; }

/* ====== TRACKING ====== */
.tracking-panel { padding: 16px; }
.tracking-status {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06); border-radius: 10px;
    margin-bottom: 16px;
}
.tracking-indicator {
    width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
}
.tracking-indicator.offline { background: #475569; }
.tracking-indicator.active { background: #22c55e; animation: pulse-dot 1.5s infinite; }
.tracking-indicator.paused { background: #f59e0b; }
.tracking-indicator.stopped { background: #ef4444; }
@keyframes pulse-dot { 0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); } 50% { box-shadow: 0 0 0 8px rgba(34,197,94,0); } }
.tracking-status span { color: #e2e8f0; font-size: 13px; font-weight: 600; }

.tracking-controls { display: flex; gap: 10px; justify-content: center; margin-bottom: 20px; }
.track-btn {
    border: none; border-radius: 12px; cursor: pointer;
    font-family: 'Inter', sans-serif; font-weight: 600; font-size: 13px;
    transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.track-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.track-start { width: 56px; height: 56px; background: linear-gradient(135deg, #22c55e, #16a34a); color: white; box-shadow: 0 4px 16px rgba(34,197,94,0.3); }
.track-start:hover:not(:disabled) { transform: scale(1.05); }
.track-pause { width: 56px; height: 56px; background: linear-gradient(135deg, #f59e0b, #d97706); color: white; box-shadow: 0 4px 16px rgba(245,158,11,0.3); }
.track-pause:hover:not(:disabled) { transform: scale(1.05); }
.track-stop { width: 56px; height: 56px; background: linear-gradient(135deg, #ef4444, #dc2626); color: white; box-shadow: 0 4px 16px rgba(239,68,68,0.3); }
.track-stop:hover:not(:disabled) { transform: scale(1.05); }

.tracking-info {
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px; overflow: hidden; margin-bottom: 20px;
}
.track-info-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.track-info-row:last-child { border-bottom: none; }
.track-info-row span { color: #94a3b8; font-size: 12px; }
.track-info-row strong { color: #f1f5f9; font-size: 13px; font-weight: 700; }

.tracking-section-title {
    color: #94a3b8; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px;
    padding-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,0.06);
}

.replay-controls { display: flex; gap: 8px; margin-bottom: 12px; }
.replay-btn {
    flex: 1; padding: 8px 12px; border-radius: 8px;
    background: rgba(255,255,255,0.06); color: #94a3b8;
    border: 1px solid rgba(255,255,255,0.08);
}
.replay-btn:hover:not(:disabled) { background: rgba(255,255,255,0.1); color: white; }

.replay-slider-wrap { margin-bottom: 16px; }
.replay-slider-wrap input[type="range"] {
    width: 100%; height: 4px; -webkit-appearance: none; appearance: none;
    background: rgba(255,255,255,0.1); border-radius: 2px; outline: none;
}
.replay-slider-wrap input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 14px; height: 14px;
    background: #3b82f6; border-radius: 50%; cursor: pointer;
    border: 2px solid white; box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.driver-link-box {
    background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.15);
    border-radius: 10px; padding: 14px; margin: 16px 0; text-align: center;
}
.driver-link-box p { font-size: 12px; color: #94a3b8; margin-bottom: 8px; }
.driver-link-box code {
    display: block; background: rgba(0,0,0,0.2); color: #60a5fa;
    padding: 8px 12px; border-radius: 6px; font-size: 12px;
    margin-bottom: 10px; word-break: break-all; user-select: all;
}
.btn-copy-link {
    background: rgba(59,130,246,0.15); color: #93c5fd; border: 1px solid rgba(59,130,246,0.2);
    border-radius: 8px; padding: 6px 16px; font-size: 12px; font-weight: 600;
    font-family: 'Inter', sans-serif; cursor: pointer; transition: all 0.2s;
}
.btn-copy-link:hover { background: rgba(59,130,246,0.25); color: white; }

.btn-clear-track {
    width: 100%; padding: 10px; border: 1px dashed rgba(239,68,68,0.25);
    border-radius: 10px; background: rgba(239,68,68,0.05); color: #fca5a5;
    font-size: 12px; font-weight: 600; font-family: 'Inter', sans-serif;
    cursor: pointer; transition: all 0.2s; text-align: center;
}
.btn-clear-track:hover { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.4); }

.btn-deselect-all {
    width: 100%; padding: 10px; margin-top: 8px;
    border: 1px dashed rgba(239,68,68,0.25); border-radius: 10px;
    background: rgba(239,68,68,0.05); color: #fca5a5;
    font-size: 13px; font-weight: 600; font-family: 'Inter', sans-serif;
    cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-deselect-all:hover { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.4); color: white; }

/* Tracking dots on map */
.tracking-dot {
    width: 16px; height: 16px; background: #22c55e;
    border-radius: 50%; border: 3px solid white;
    box-shadow: 0 2px 8px rgba(34,197,94,0.5);
    transition: background 0.3s;
}
.tracking-dot.pulse { animation: pulse-dot 1.5s infinite; }
.tracking-dot.paused-dot { background: #f59e0b !important; box-shadow: 0 2px 8px rgba(245,158,11,0.5); }
.tracking-dot.stopped-dot { background: #ef4444 !important; box-shadow: 0 2px 8px rgba(239,68,68,0.5); }
.replay-dot {
    width: 12px; height: 12px; background: #f59e0b;
    border-radius: 50%; border: 2px solid white;
    box-shadow: 0 2px 8px rgba(245,158,11,0.5);
}
