/* ═══════════════════════════════════════════════════════════════════════════════
   OmniTransport — Passenger Cab Fleet Portal
   Executive Light Theme — Super Professional Design System
   ═══════════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700&display=swap');

:root {
    --bg-body: #EFF2F7;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F8FAFC;
    --bg-sidebar: #1E293B;
    --bg-sidebar-hover: #334155;
    --bg-sidebar-active: rgba(37, 99, 235, 0.15);
    --bg-input: #F4F6FA;
    --border-color: #E2E8F0;
    --border-light: #F1F5F9;
    --primary: #2563EB;
    --primary-soft: #EFF6FF;
    --primary-gradient: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    --accent: #4F46E5;
    --success: #10B981;
    --success-soft: #ECFDF5;
    --warning: #F59E0B;
    --warning-soft: #FFFBEB;
    --danger: #EF4444;
    --danger-soft: #FEF2F2;
    --text-main: #0F172A;
    --text-secondary: #334155;
    --text-muted: #64748B;
    --text-dimmed: #94A3B8;
    --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --heading-font: 'Outfit', 'Inter', sans-serif;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-pill: 100px;
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tab Content Visibility Controller */
.tab-content {
    display: none !important;
}

.tab-content.active {
    display: block !important;
}

.hidden {
    display: none !important;
}

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body.dark-theme, body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-family);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    height: 100vh;
}

/* ─── Smooth Vehicle Marker Animations ─── */
.sim-vehicle-marker-wrapper,
.custom-vehicle-marker-wrapper {
    transition: transform 0.15s linear;
}

/* ═══════════════════════════════════════
   APP LAYOUT
   ═══════════════════════════════════════ */
.app-container,
.app-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* ═══════════════════════════════════════
   SIDEBAR NAVIGATION
   ═══════════════════════════════════════ */
.sidebar {
    width: 264px;
    min-width: 264px;
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: none;
    display: flex;
    flex-direction: column;
    padding: 1.25rem 0.875rem;
    z-index: 100;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.15);
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 0.375rem;
    margin-bottom: 1.5rem;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.30);
    flex-shrink: 0;
}

.brand-text h1,
.brand-text h2 {
    font-family: var(--heading-font);
    font-size: 0.95rem;
    font-weight: 800;
    color: #F8FAFC !important;
    line-height: 1.25;
    margin: 0;
    opacity: 1 !important;
    letter-spacing: -0.01em;
    word-break: break-word;
}

.brand-text span {
    font-size: 0.7rem;
    color: #94A3B8;
    font-weight: 500;
}

/* Role Selector */
.role-selector-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    margin-bottom: 1.25rem;
}

.role-selector-card label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.375rem;
}

.role-selector-card select {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    color: #F1F5F9;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 0.625rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: border-color var(--transition-fast);
    outline: none;
}

.role-selector-card select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    border-left: 3px solid transparent;
    color: #94A3B8;
    font-size: 0.825rem;
    font-weight: 500;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
    width: 100%;
}

.nav-item i {
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.nav-item:hover {
    background: var(--bg-sidebar-hover);
    color: #E2E8F0;
}

.nav-item.active {
    background: var(--bg-sidebar-active);
    color: #60A5FA;
    font-weight: 600;
    border-left-color: #60A5FA;
}

/* Sidebar Footer */
.sidebar-footer {
    padding-top: 0.875rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: auto;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #94A3B8;
    font-weight: 500;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ═══════════════════════════════════════
   MAIN CONTENT AREA
   ═══════════════════════════════════════ */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: var(--bg-body);
}

/* Top Header Bar */
.top-header {
    height: 60px;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
    box-shadow: var(--shadow-xs);
    gap: 1rem;
    flex-shrink: 0;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.875rem;
    border-radius: var(--radius-pill);
    width: 300px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.header-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.header-search i {
    color: var(--text-dimmed);
    font-size: 0.8rem;
}

.header-search input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 0.8rem;
    font-family: var(--font-family);
    width: 100%;
}

.header-search input::placeholder {
    color: var(--text-dimmed);
}

/* Header Stats Pills */
.header-stats {
    display: flex;
    gap: 0.625rem;
}

.stat-pill {
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--transition-fast);
}

.stat-pill:hover {
    box-shadow: var(--shadow-sm);
}

.stat-pill.green { color: #059669; background: var(--success-soft); border-color: rgba(16, 185, 129, 0.25); }
.stat-pill.blue  { color: #2563EB; background: var(--primary-soft); border-color: rgba(37, 99, 235, 0.25); }
.stat-pill.amber { color: #D97706; background: var(--warning-soft); border-color: rgba(245, 158, 11, 0.25); }

/* User Profile */
.user-profile {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.user-role-badge {
    font-size: 0.675rem;
    color: var(--primary);
    font-weight: 600;
}

/* ═══════════════════════════════════════
   TAB SYSTEM
   ═══════════════════════════════════════ */
.tab-content {
    display: none;
    padding: 1.25rem;
    flex: 1;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

.tab-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.tab-header h2 {
    font-family: var(--heading-font);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-header h2 i {
    color: var(--primary);
}

/* ═══════════════════════════════════════
   FLEET MAP VIEW
   ═══════════════════════════════════════ */
.fleet-map-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 60px - 2.5rem);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    box-shadow: var(--shadow-md);
}

.map-view, .leaflet-container {
    width: 100%;
    height: 100%;
    background: var(--bg-body) !important;
}

/* Map Controls Container (collapsible) */
.map-controls-container {
    position: absolute;
    top: 0.75rem;
    left: 3.25rem; /* clear the Leaflet +/- zoom control */
    right: 0.75rem;
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.4rem;
    pointer-events: none;
}

.map-controls-toggle {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(15, 23, 42, 0.85);
    color: #E2E8F0;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.2s;
    pointer-events: auto;
    flex-shrink: 0;
}
.map-controls-toggle:hover { background: rgba(30, 41, 59, 0.95); }

/* Map Layer Selector Bar */
.map-layer-selector {
    display: flex;
    gap: 0.375rem;
    flex-wrap: nowrap;
    align-items: center;
    padding: 0.4rem 0.5rem;
    background: rgba(15, 23, 42, 0.82);
    border-radius: 10px;
    backdrop-filter: blur(8px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center top;
    pointer-events: auto;
}

.map-layer-selector.map-controls-collapsed {
    opacity: 0;
    transform: scaleY(0);
    pointer-events: none;
    height: 0;
    overflow: hidden;
    padding: 0;
    gap: 0;
}

.map-layer-selector.map-controls-expanded {
    opacity: 1;
    transform: scaleY(1);
    pointer-events: auto;
}

.layer-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 600;
    font-family: var(--font-family);
    background: var(--bg-card);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.layer-btn:hover {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: rgba(37, 99, 235, 0.3);
}

.layer-btn.active {
    background: var(--primary);
    color: #FFFFFF;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* Vehicle Marker Pins */
.vehicle-marker-pin {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 11px;
    color: #FFFFFF;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.2);
    white-space: nowrap;
    border: 2px solid #FFFFFF;
    font-family: var(--font-family);
    letter-spacing: 0.01em;
}

.vehicle-marker-pin.EnRoute       { background: linear-gradient(135deg, #2563EB, #1D4ED8); }
.vehicle-marker-pin.Dispatched    { background: linear-gradient(135deg, #6366F1, #4F46E5); }
.vehicle-marker-pin.Available     { background: linear-gradient(135deg, #10B981, #059669); }
.vehicle-marker-pin.Loading       { background: linear-gradient(135deg, #F59E0B, #D97706); }
.vehicle-marker-pin.InMaintenance { background: linear-gradient(135deg, #EF4444, #DC2626); }

.vehicle-marker-pin.vehicle-marker-icon-only {
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    font-size: 20px;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

/* ─── Google Maps-style Top-Down Car Marker ─── */
.vehicle-marker-topview {
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center center;
    will-change: transform;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.35));
}

.vehicle-marker-topview img {
    display: block;
    pointer-events: none;
}

.vehicle-marker-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #1D4ED8;
    opacity: 0.4;
    animation: marker-pulse 2.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes marker-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.4; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.15; }
}

.vehicle-marker-topview-labeled {
    display: flex;
    align-items: center;
    gap: 6px;
}

.vehicle-marker-label {
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 10px;
    color: #FFFFFF;
    white-space: nowrap;
    font-family: var(--font-family);
    letter-spacing: 0.02em;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.vehicle-marker-label.EnRoute       { background: #1D4ED8; }
.vehicle-marker-label.Dispatched    { background: #4F46E5; }
.vehicle-marker-label.Available     { background: #059669; }
.vehicle-marker-label.Loading       { background: #D97706; }
.vehicle-marker-label.InMaintenance { background: #DC2626; }

/* ═══════════════════════════════════════
   TELEMETRY OVERLAY PANEL (Right-side floating)
   ═══════════════════════════════════════ */
.telemetry-overlay {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 340px;
    max-height: calc(100% - 1.5rem);
    overflow-y: auto;
    z-index: 1000;
    padding: 1rem;
    border-radius: var(--radius-lg);
}

/* Scrollbar styling for telemetry overlay */
.telemetry-overlay::-webkit-scrollbar { width: 4px; }
.telemetry-overlay::-webkit-scrollbar-track { background: transparent; }
.telemetry-overlay::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

.glass-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-lg);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
}

/* Collapse/Expand button focus and transition styles */
#btnCollapsePanel:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

#btnCollapsePanel i {
    transition: transform 300ms ease;
}

/* Telemetry panel body slide transition */
#telemetryPanelBody {
    transition: max-height 300ms ease, opacity 300ms ease, margin-top 300ms ease;
    overflow: hidden;
}

/* Telemetry overlay width transition for map expansion */
.telemetry-overlay {
    transition: width 300ms ease;
}

.panel-header h3 {
    font-family: var(--heading-font);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.panel-header h3 .text-primary { color: var(--primary); }

.live-badge {
    font-size: 0.6rem;
    padding: 0.2rem 0.5rem;
    background: var(--success-soft);
    color: var(--success);
    border-radius: var(--radius-pill);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    letter-spacing: 0.03em;
    animation: pulse-badge 2.5s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Simulator / GPS Tracking Card inside overlay */
.simulator-card {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.sim-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.sim-header .text-primary { color: var(--primary); }

.sim-body {
    padding: 0.5rem 0.75rem;
}

.sim-status {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    height: 20px;
    line-height: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.veh-route {
    font-size: 0.75rem;
    color: #2563EB;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    display: inline-block;
    vertical-align: middle;
}

/* ═══════════════════════════════════════
   VEHICLE LIST CARDS (inside telemetry overlay)
   ═══════════════════════════════════════ */
.vehicle-card-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.vehicle-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.vehicle-item:hover {
    border-color: rgba(37, 99, 235, 0.3);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.veh-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.veh-reg {
    font-weight: 700;
    font-size: 0.825rem;
    color: var(--text-main);
    letter-spacing: 0.01em;
}

.veh-status {
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-pill);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.veh-status.EnRoute       { background: var(--primary-soft); color: var(--primary); }
.veh-status.Available      { background: var(--success-soft); color: #059669; }
.veh-status.Loading        { background: var(--warning-soft); color: #D97706; }
.veh-status.InMaintenance  { background: var(--danger-soft);  color: #DC2626; }

.veh-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.veh-details span {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.veh-details i {
    width: 14px;
    text-align: center;
    color: var(--text-dimmed);
    font-size: 0.7rem;
}

/* v-card styles (alternate vehicle card styling in overlay) */
.v-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    box-shadow: var(--shadow-xs);
    transition: all var(--transition-fast);
}

.v-card:hover {
    box-shadow: var(--shadow-md);
    border-color: #CBD5E1;
}

.v-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.375rem;
}

.v-reg {
    font-weight: 700;
    font-size: 0.825rem;
    color: var(--text-main);
}

.v-status {
    font-size: 0.65rem;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-pill);
    font-weight: 700;
}

.v-status.EnRoute       { background: var(--primary-soft); color: var(--primary); }
.v-status.Available      { background: var(--success-soft); color: #059669; }
.v-status.Loading        { background: var(--warning-soft); color: #D97706; }
.v-status.InMaintenance  { background: var(--danger-soft);  color: #DC2626; }

.v-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.v-meta {
    display: flex;
    justify-content: space-between;
}

/* ═══════════════════════════════════════
   TRIP CARDS & DISPATCH BOARD
   ═══════════════════════════════════════ */
.trip-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.875rem;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-xs);
    margin-bottom: 0.5rem;
}

.trip-card:hover {
    box-shadow: var(--shadow-sm);
    border-color: #CBD5E1;
}

.trip-code {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-soft);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-pill);
    letter-spacing: 0.02em;
}

.trip-route {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.trip-route i { color: var(--primary); }

.mt-2 { margin-top: 0.5rem; }

/* ═══════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════ */
.btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.8rem;
    font-family: var(--font-family);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    line-height: 1;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.3rem 0.625rem;
    font-size: 0.72rem;
    border-radius: var(--radius-sm);
}

.btn-primary {
    background: var(--primary-gradient);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-success {
    background: linear-gradient(135deg, #10B981, #059669);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.btn-warning {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.btn-danger {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: #FFFFFF;
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: rgba(37, 99, 235, 0.25);
}

.btn-collapse {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.7rem;
}

.btn-collapse:hover {
    background: var(--primary);
    color: #FFFFFF;
    border-color: var(--primary);
}

/* ═══════════════════════════════════════
   UTILITY TEXT CLASSES
   ═══════════════════════════════════════ */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger  { color: var(--danger) !important;  }

/* ═══════════════════════════════════════
   TABLE STYLES (Gate logs, Accounting)
   ═══════════════════════════════════════ */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8rem;
}

thead th {
    background: var(--bg-input);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

tbody td {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}

tbody tr:hover {
    background: var(--bg-input);
}

/* ═══════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════ */
.form-group {
    margin-bottom: 0.75rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.625rem;
    font-size: 0.8rem;
    font-family: var(--font-family);
    color: var(--text-main);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ═══════════════════════════════════════
   ACCOUNTING PANELS & SECTIONS
   ═══════════════════════════════════════ */
.accounting-grid, .dispatch-grid, .insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.data-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.data-card h4 {
    font-family: var(--heading-font);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.data-card h4 i { color: var(--primary); }

/* ═══════════════════════════════════════
   RESPONSIVE SCROLLBAR
   ═══════════════════════════════════════ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }
/* ------------------------------------------------
   TELEMETRY OVERLAY - VEHICLE LIST CARDS
   ------------------------------------------------ */
.vehicle-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0.875rem;
    margin-bottom: 0.75rem;
    transition: all var(--transition-fast);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.vehicle-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: #CBD5E1;
}

.veh-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.veh-reg {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
}

.veh-status {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-pill);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.veh-details {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.veh-details span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
/* ------------------------------------------------
   MODAL DIALOGS (TRIP & INVOICE DETAILS)
   ------------------------------------------------ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: #FFFFFF;
    border-radius: 16px;
    width: 90%;
    max-width: 540px;
    padding: 1.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    color: #1E293B;
    transform: translateY(10px);
    transition: transform 0.2s ease;
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    border-bottom: 1px solid #E2E8F0;
    margin-bottom: 1rem;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #0F172A;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close-btn {
    background: #F1F5F9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    color: #64748B;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover {
    background: #E2E8F0;
    color: #0F172A;
}

.invoice-table {
    width: 100%;
    margin: 1rem 0;
    border-collapse: collapse;
}

.invoice-table th, .invoice-table td {
    padding: 0.6rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid #F1F5F9;
    font-size: 0.825rem;
}

.invoice-table th {
    color: #64748B;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
}
/* ------------------------------------------------
   AUTOCOMPLETE DROPDOWN STYLING
   ------------------------------------------------ */
.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 99999;
    max-height: 220px;
    overflow-y: auto;
    display: none;
}

.autocomplete-dropdown.show {
    display: block;
}

.autocomplete-item {
    padding: 0.6rem 0.85rem;
    font-size: 0.8rem;
    color: #1E293B;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid #F1F5F9;
    transition: background 0.15s ease;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: #EFF6FF;
    color: #2563EB;
}

.autocomplete-item i {
    color: #2563EB;
    font-size: 0.85rem;
}
/* ------------------------------------------------
   FLEET MAP CONTAINER & LEAFLET MAP VIEWPORT
   ------------------------------------------------ */
.fleet-map-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 140px);
    min-height: 550px;
    border-radius: 12px;
    overflow: hidden;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
}

#map {
    width: 100%;
    height: 100%;
    min-height: 550px;
}

/* ═══ Location Autocomplete Dropdown ═══ */
.autocomplete-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-top: none;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 280px;
    overflow-y: auto;
}

.autocomplete-dropdown.show {
    display: block;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.85rem;
    cursor: pointer;
    border-bottom: 1px solid #F1F5F9;
    transition: background 0.15s;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: #EFF6FF;
}

.autocomplete-item i {
    font-size: 0.85rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.autocomplete-item strong {
    font-size: 0.82rem;
    color: #1E293B;
    font-weight: 600;
}

.autocomplete-item span {
    font-size: 0.7rem;
    color: #94A3B8;
}
