/* ═══════════════════════════════════════════════════════════════════════════════
   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 {
    /* ─── Canvas & Surfaces ─── */
    --bg-body: #F4F6FA;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F8FAFC;
    --bg-card-muted: #F8FAFC;
    --bg-sidebar: #171026;
    --bg-sidebar-hover: rgba(255, 255, 255, 0.05);
    --bg-sidebar-active: rgba(124, 58, 237, 0.22);
    --bg-sidebar-active-glow: rgba(124, 58, 237, 0.35);
    --bg-input: #F8FAFC;
    --bg-input-focus: #FFFFFF;

    /* ─── Borders ─── */
    --border-color: #E2E8F0;
    --border-light: #F1F5F9;
    --border-strong: #CBD5E1;
    --border-focus: rgba(109, 40, 217, 0.40);

    /* ─── Brand & Primary Accent ─── */
    --primary: #6D28D9;
    --primary-dark: #5B21B6;
    --primary-hover: #5B21B6;
    --primary-soft: #F5F3FF;
    --primary-soft-border: rgba(109, 40, 217, 0.20);
    --primary-gradient: linear-gradient(135deg, #7C3AED 0%, #6D28D9 100%);
    --accent: #6D28D9;
    --accent-purple-light: #C4B5FD;

    /* ─── Semantic Feedback (Success, Warning, Danger, Info) ─── */
    --success: #10B981;
    --success-text: #047857;
    --success-soft: #ECFDF5;
    --success-border: rgba(16, 185, 129, 0.25);
    --warning: #F59E0B;
    --warning-text: #B45309;
    --warning-soft: #FFFBEB;
    --warning-border: rgba(245, 158, 11, 0.25);
    --danger: #EF4444;
    --danger-text: #B91C1C;
    --danger-soft: #FEF2F2;
    --danger-border: rgba(239, 68, 68, 0.25);
    --info: #3B82F6;
    --info-text: #1D4ED8;
    --info-soft: #EFF6FF;
    --info-border: rgba(59, 130, 246, 0.25);

    /* ─── Typography & Contrast (WCAG AA Compliant) ─── */
    --text-main: #0F172A;
    --text-secondary: #334155;
    --text-muted: #64748B;
    --text-dimmed: #94A3B8;
    --text-inverse: #FFFFFF;
    --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --heading-font: 'Outfit', 'Inter', system-ui, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

    /* ─── Radii ─── */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-pill: 9999px;

    /* ─── Elevation & Shadows ─── */
    --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-card: 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.07), 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.10), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    --shadow-modal: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
    --shadow-focus: 0 0 0 3px rgba(109, 40, 217, 0.16);

    /* ─── Transitions ─── */
    --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;
}

/* Visually hidden but available to screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ─── 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: linear-gradient(180deg, #1A112E 0%, #130C23 60%, #0E081B 100%);
    border-right: 1px solid rgba(124, 58, 237, 0.16);
    display: flex;
    flex-direction: column;
    padding: 1.25rem 0.875rem;
    z-index: 100;
    box-shadow: 4px 0 24px rgba(14, 8, 27, 0.45);
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 0.375rem 1rem 0.375rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid rgba(124, 58, 237, 0.14);
}

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    object-fit: contain;
    box-shadow: 0 4px 14px rgba(109, 40, 217, 0.35);
    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.2;
    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.05);
    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(109, 40, 217, 0.15);
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.85rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    border-left: 4px 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: rgba(255, 255, 255, 0.05);
    color: #F1F5F9;
}

.nav-item.active {
    background: rgba(124, 58, 237, 0.24);
    color: #EDE9FE;
    font-weight: 700;
    border-left-color: #A78BFA;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.nav-item.active i {
    color: #C4B5FD;
}

/* Sidebar Footer */
.sidebar-footer {
    padding-top: 0.875rem;
    border-top: 1px solid rgba(124, 58, 237, 0.14);
    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: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
    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: 58px;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
    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: var(--shadow-focus);
    background: var(--bg-input-focus);
}

.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;
    align-items: center;
    gap: 0.625rem;
    overflow-x: auto;
}

.stat-pill {
    padding: 0.35rem 0.8rem;
    border-radius: var(--radius-pill);
    font-size: 0.74rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xs);
    transition: all var(--transition-fast);
    line-height: 1.2;
    white-space: nowrap;
}

.stat-pill:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.stat-pill.green {
    color: var(--success-text);
    background: var(--success-soft);
    border-color: var(--success-border);
}

.stat-pill.blue {
    color: #5B21B6;
    background: var(--primary-soft);
    border-color: var(--primary-soft-border);
}

.stat-pill.amber {
    color: var(--warning-text);
    background: var(--warning-soft);
    border-color: var(--warning-border);
}

/* User Profile */
.user-profile {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-md);
    transition: background-color var(--transition-fast);
}

.user-profile:hover {
    background: var(--bg-card-hover);
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid var(--border-color);
    box-shadow: var(--shadow-xs);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.825rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.user-role-badge {
    font-size: 0.68rem;
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ═══════════════════════════════════════
   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.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.tab-header h2 i {
    color: var(--primary);
}

.tab-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    font-weight: 500;
}

/* Dispatch Command Center & Subtabs */
.dispatch-main-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-top: 1.25rem;
}

.dispatch-subtab-bar {
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.85rem;
    margin-bottom: 1.25rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.dispatch-subtab-btn {
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 0.8rem;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.45rem 1.1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    box-shadow: var(--shadow-xs);
    transition: background var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
}

.dispatch-subtab-btn:hover {
    filter: brightness(0.96);
    box-shadow: var(--shadow-sm);
}

.dispatch-subtab-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Dispatch View Toggle */
.dispatch-view-toggle {
    display: inline-flex;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-input);
    padding: 2px;
    gap: 2px;
}

.dispatch-view-toggle button {
    border: none;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.dispatch-view-toggle button:hover {
    filter: brightness(0.95);
}

.dispatch-view-toggle button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

/* Executive Empty State Card */
.empty-state-card {
    text-align: center;
    padding: 3.5rem 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin: 1rem auto;
    width: 100%;
    max-width: 600px;
    box-sizing: border-box;
}

.empty-state-card.grid-span {
    grid-column: 1 / -1;
}

.empty-state-icon-wrap {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    background: var(--primary-soft);
    border: 1px solid var(--primary-soft-border);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 1.25rem;
}

.empty-state-title {
    font-family: var(--heading-font);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 0.4rem 0;
}

.empty-state-desc {
    font-family: var(--font-family);
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0 auto 1.5rem auto;
    max-width: 440px;
}

.empty-state-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

/* Fleet Asset Management Panel & Vehicle Roster */
.fleet-main-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-top: 1.25rem;
}

.fleet-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.fleet-filter-toggle {
    display: inline-flex;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 2px;
    gap: 2px;
}

.fleet-filter-btn {
    border: none;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.35rem 0.9rem;
    border-radius: var(--radius-xs);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: background var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
}

.fleet-filter-btn:hover {
    filter: brightness(0.96);
}

.fleet-filter-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.fleet-toolbar-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.fleet-search-wrap {
    position: relative;
    width: 100%;
    margin-bottom: 1.25rem;
}

.fleet-search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.fleet-search-input {
    width: 100%;
    padding: 0.55rem 0.85rem 0.55rem 2.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.85rem;
    color: var(--text-main);
    background: var(--bg-input);
    box-sizing: border-box;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.fleet-search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: #FFFFFF;
    box-shadow: var(--shadow-focus);
}

.fleet-section-title {
    font-family: var(--heading-font);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 0.85rem 0;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.fleet-drivers-title {
    border-top: 1px solid var(--border-light);
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

.fleet-section-badge {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-left: 0.15rem;
}

.fleet-section-count {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.fleet-vehicles-grid {
    margin-bottom: 1.5rem;
}

.fleet-loading-text {
    color: var(--text-muted);
    font-size: 0.82rem;
    padding: 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fleet-category-block {
    margin-bottom: 1.5rem;
}

.fleet-category-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.fleet-category-title {
    font-family: var(--heading-font);
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.fleet-category-badge {
    background: var(--bg-input);
    color: var(--text-muted);
    font-weight: 700;
    padding: 0.12rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.68rem;
    border: 1px solid var(--border-light);
}

.fleet-category-line {
    flex: 1;
    height: 1px;
    background: var(--border-light);
}

.fleet-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 1.1rem;
}

.fleet-vehicle-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-fast) ease, box-shadow var(--transition-fast) ease, border-color var(--transition-fast) ease;
}

.fleet-vehicle-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-soft-border);
}

.fleet-vehicle-media {
    height: 135px;
    width: 100%;
    overflow: hidden;
    position: relative;
    background: #0F172A;
}

.fleet-vehicle-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.fleet-vehicle-card:hover .fleet-vehicle-img {
    transform: scale(1.04);
}

.fleet-vehicle-rate-pill {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(6px);
    color: #C4B5FD;
    font-weight: 800;
    padding: 0.18rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.fleet-vehicle-reg-pill {
    position: absolute;
    bottom: 8px;
    left: 8px;
    max-width: calc(100% - 16px);
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(4px);
    color: #FFFFFF;
    font-family: var(--font-mono);
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-xs);
    font-size: 0.78rem;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.fleet-vehicle-content {
    padding: 0.95rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.75rem;
}

.fleet-vehicle-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.fleet-vehicle-model {
    font-family: var(--heading-font);
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
    line-height: 1.25;
}

.fleet-ownership-badge {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}

.fleet-ownership-badge.self {
    background: #E0E7FF;
    color: #3730A3;
    border: 1px solid #C7D2FE;
}

.fleet-ownership-badge.vendor {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
}

.fleet-ownership-badge.temp {
    background: #FEF3C7;
    color: #B45309;
    border: 1px solid #FDE68A;
}

.fleet-vehicle-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0.35rem 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.fleet-meta-sep {
    color: var(--border-color);
}

.fleet-vehicle-details {
    font-size: 0.74rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.fleet-detail-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Fleet actions: 32px soft purple primary slot and 32px square delete with red hover */
.fleet-vehicle-actions,
.fleet-driver-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    border-top: 1px solid var(--border-light);
    padding-top: 0.65rem;
    margin-top: 0.5rem;
}

.fleet-act-btn {
    height: 32px;
    padding: 0 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.74rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: var(--primary-soft);
    color: var(--primary-dark);
    border: 1px solid var(--primary-soft-border);
    box-shadow: none;
    transition: var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
}

.fleet-act-btn:hover {
    background: #FFFFFF;
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: var(--shadow-xs);
}

.fleet-act-del {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    border-radius: var(--radius-sm);
    font-size: 0.74rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xs);
    transition: var(--transition-fast);
    cursor: pointer;
}

.fleet-act-del:hover {
    background: #FEF2F2;
    color: #DC2626;
    border-color: #FECACA;
}

/* ==========================================================================
   Fleet Driver Roster (Section 2: #registeredDriversGrid)
   ========================================================================== */
.fleet-driver-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    box-shadow: var(--shadow-xs);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
    position: relative;
}

.fleet-driver-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}

.fleet-driver-card--self   { border-left: 3.5px solid #059669; }
.fleet-driver-card--vendor { border-left: 3.5px solid #D97706; }
.fleet-driver-card--temp   { border-left: 3.5px solid #B45309; }

.fleet-driver-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.fleet-driver-identity {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.fleet-driver-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.fleet-driver-initials {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.78rem;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    user-select: none;
}

.fleet-driver-initials--self   { background: #D1FAE5; color: #065F46; border-color: #A7F3D0; }
.fleet-driver-initials--vendor { background: #FEF3C7; color: #92400E; border-color: #FDE68A; }
.fleet-driver-initials--temp   { background: #FEF3C7; color: #B45309; border-color: #FDE68A; }

.fleet-driver-name-wrap {
    min-width: 0;
}

.fleet-driver-name {
    font-weight: 800;
    color: var(--text-main);
    font-size: 0.88rem;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fleet-driver-subtext {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 0.1rem;
}

.fleet-driver-body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.6rem;
    font-size: 0.74rem;
}

.fleet-driver-phone-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
}

.fleet-driver-phone {
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.fleet-copy-btn {
    background: none;
    border: none;
    padding: 0.15rem 0.35rem;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-xs);
    font-size: 0.72rem;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.fleet-copy-btn:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.fleet-collapse-wrap {
    margin-top: 1rem;
    text-align: center;
    grid-column: 1 / -1;
}

.fleet-collapse-btn {
    height: 34px;
    padding: 0 1.25rem;
    border-radius: var(--radius-pill);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-xs);
    cursor: pointer;
    transition: var(--transition-fast);
}

.fleet-collapse-btn:hover {
    background: var(--bg-input);
    color: var(--text-main);
    border-color: var(--border-strong);
}

.fleet-driver-license {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
}

.license-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.08rem 0.45rem;
    border-radius: var(--radius-xs);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.fleet-drivers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

/* Card section headers — deliberately distinct from the page <h2>:
   body font, smaller, uppercase + tracked, so hierarchy reads clearly. */
.card-title {
    font-family: var(--font-family);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title i {
    font-size: 0.95rem;
}

/* Action-column button chips in data tables — consistent, compact, aligned. */
.data-table td .action-btns {
    display: inline-flex;
    gap: 0.4rem;
    justify-content: center;
    flex-wrap: nowrap;
}

.btn-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-chip.chip-map {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: rgba(109, 40, 217, 0.22);
}

.btn-chip.chip-map:hover {
    background: var(--primary);
    color: #fff;
}

.btn-chip.chip-details {
    background: #F1F5F9;
    color: var(--text-secondary);
    border-color: #E2E8F0;
}

.btn-chip.chip-details:hover {
    background: #E2E8F0;
    color: var(--text-main);
}

.btn-chip.chip-pay {
    background: var(--success-soft);
    color: #059669;
    border-color: rgba(16, 185, 129, 0.28);
}

.btn-chip.chip-pay:hover {
    background: #059669;
    color: #fff;
}

/* KPI tiles — calm white cards with a single colored top-accent bar.
   Replaces loud full-gradient cards so the dashboard reads as one system.
   Semantic accent via modifier class (.pos / .neg / .warn / .brand / .info). */
.kpi-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1rem;
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

.kpi-tile::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--kpi-accent, var(--primary));
}

.kpi-tile .kpi-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.kpi-tile .kpi-value {
    font-family: var(--heading-font);
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-top: 0.3rem;
    color: var(--kpi-accent, var(--text-main));
}

.kpi-tile .kpi-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.kpi-tile.pos   { --kpi-accent: #059669; }
.kpi-tile.neg   { --kpi-accent: #DC2626; }
.kpi-tile.warn  { --kpi-accent: #D97706; }
.kpi-tile.accent { --kpi-accent: #6D28D9; }
.kpi-tile.info  { --kpi-accent: #4338CA; }

/* Logout — quiet neutral ghost. Deliberately recessive so the primary brand CTA
   stays the visual hero; only a soft red hint appears on hover. */
.btn-logout {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    font-weight: 600;
    border-radius: 8px;
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-logout i {
    color: var(--danger);
    opacity: 0.8;
    transition: opacity var(--transition-fast);
}

.btn-logout:hover {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.28);
}

.btn-logout:hover i {
    opacity: 1;
}

/* ═══════════════════════════════════════
   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 Frosted Glass Dock) */
.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: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-main);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
    pointer-events: auto;
    flex-shrink: 0;
}
.map-controls-toggle:hover {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: rgba(109, 40, 217, 0.3);
}

/* Map Layer Selector Dock (Segmented frosted control surface) */
.map-layer-selector {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    padding: 0.35rem 0.55rem;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 4px 18px -2px rgba(15, 23, 42, 0.1), 0 2px 6px -1px rgba(15, 23, 42, 0.05);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center top;
    pointer-events: auto;
    max-width: calc(100vw - 120px);
    overflow-x: auto;
    scrollbar-width: none;
}
.map-layer-selector::-webkit-scrollbar {
    display: none;
}

.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;
}

.map-dock-group {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.map-dock-divider {
    display: inline-block;
    width: 1px;
    height: 20px;
    background: var(--border-color, #E2E8F0);
    margin: 0 0.2rem;
    flex-shrink: 0;
}

.layer-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.32rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 600;
    font-family: var(--font-family);
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.layer-btn i {
    font-size: 0.75rem;
}

.layer-btn:hover {
    background: var(--bg-hover, #F1F5F9);
    color: var(--text-main);
}

.layer-btn.active {
    background: var(--primary);
    color: #FFFFFF;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(109, 40, 217, 0.28);
}
.layer-btn.active i {
    color: #FFFFFF;
}

.track-fullscreen-btn {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: rgba(109, 40, 217, 0.2);
}
.track-fullscreen-btn:hover {
    background: rgba(109, 40, 217, 0.18);
    color: var(--primary);
}
.track-fullscreen-btn.active {
    background: var(--primary);
    color: #FFFFFF;
}

/* 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, #7C3AED, #6D28D9); }
.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: #6D28D9; }
.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: 380px;
    max-width: min(380px, calc(100% - 1.5rem));
    max-height: calc(100% - 1.5rem);
    overflow-y: auto;
    z-index: 1000;
    padding: 0.85rem;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 12px 36px -4px rgba(15, 23, 42, 0.18), 0 4px 12px -2px rgba(15, 23, 42, 0.08);
    transition: width 300ms ease;
}

/* 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: #6D28D9;
    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(109, 40, 217, 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);
}

/* UX polish — active-dispatch card: primary actions sit in a 3-col grid (set inline in the
   card template). Each button fills its cell (full width, equal) and centres its icon+label so
   the row reads as neat, full-width buttons rather than content-hugging chips. */
.dispatch-action-grid > .btn {
    width: 100%;
    justify-content: center;
}

/* UX polish — Billing master-tab summary pill (Client/Vendors/Walk-in). A bordered, tinted
   container on the tab-bar row holding the per-tab KPI metrics (inline styles set the per-tab
   colour). Small hover lift; on a narrow viewport it wraps its metrics and the dividers hide so
   it never overflows. */
.bill-summary-strip {
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.bill-summary-strip:hover {
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.10);
    transform: translateY(-1px);
}
@media (max-width: 860px) {
    .bill-summary-strip {
        flex-wrap: wrap;
        row-gap: 0.35rem;
    }
    .bill-summary-strip > div[style*="width: 1px"] {
        display: none;
    }
}

/* UX polish — Billing WORKFLOW STEPPER (Client / Vendors). The lifecycle stages read as a
   connected left→right stepper instead of loose grey pills: numbered circular markers, a
   connector line between stages, and the ACTIVE stage filled with the section accent
   (--step-accent set inline per tab) and raised so the workflow draws the eye. Placed above
   the filter so the primary action comes first. */
.bill-stepper {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 0;
    padding: 0.35rem;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
}
.bill-step {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: #64748B;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.bill-step:hover:not(.is-active) {
    background: #EEF2F7;
    color: #334155;
}
/* Count badge = a QUANTITY of items at this stage (not a step number). Styled as a soft pill with
   an outline so it never reads as an ordinal. Order is conveyed by the connectors + flow, so there
   is no step-number circle. */
.bill-step-count {
    display: none;                 /* shown by JS only when a count > 0 */
    min-width: 20px;
    padding: 0 0.4rem;
    height: 18px;
    line-height: 17px;
    text-align: center;
    border-radius: 999px;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    color: #475569;
    font-size: 0.68rem;
    font-weight: 800;
}
.bill-step-count.has-count { display: inline-block; }
.bill-step.is-active {
    background: var(--step-accent, #6D28D9);
    color: #fff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
    transform: translateY(-1px);
}
.bill-step.is-active .bill-step-count {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.45);
    color: #fff;
}
.bill-step-conn {
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 16px;
    height: 16px;
    margin: 0 0.15rem;
    color: var(--border-strong, #CBD5E1);
    font-size: 0.65rem;
}
.bill-step-conn::before {
    content: "\f054";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}
@media (max-width: 680px) {
    .bill-step-conn { display: none; }
    .bill-stepper { gap: 0.25rem; }
}

/* ═══════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════ */
.btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.8rem;
    font-family: var(--font-family);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    line-height: 1.2;
    text-decoration: none;
    user-select: none;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
}

.btn:disabled, .btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
    transform: none !important;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(109, 40, 217, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 4px 14px rgba(109, 40, 217, 0.35);
}

.btn-secondary {
    background: #FFFFFF;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-main);
    border-color: var(--border-strong);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary-soft-border);
}

.btn-outline:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
}

.btn-ghost:hover {
    background: var(--border-light);
    color: var(--text-main);
}

.btn-success {
    background: linear-gradient(135deg, #10B981, #059669);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.btn-warning {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.btn-warning:hover {
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.btn-danger {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.74rem;
    border-radius: var(--radius-sm);
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    border-radius: var(--radius-xs);
}

.btn-lg {
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    border-radius: var(--radius-md);
}

.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);
}

/* ═══════════════════════════════════════
   BADGES & PILLS
   ═══════════════════════════════════════ */
.badge, .pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
    border: 1px solid transparent;
}

.badge-success, .pill-success {
    background: var(--success-soft);
    color: var(--success-text);
    border-color: var(--success-border);
}

.badge-warning, .pill-warning {
    background: var(--warning-soft);
    color: var(--warning-text);
    border-color: var(--warning-border);
}

.badge-danger, .pill-danger {
    background: var(--danger-soft);
    color: var(--danger-text);
    border-color: var(--danger-border);
}

.badge-info, .pill-info {
    background: var(--info-soft);
    color: var(--info-text);
    border-color: var(--info-border);
}

.badge-primary, .pill-primary {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: var(--primary-soft-border);
}

.badge-neutral, .pill-neutral {
    background: var(--border-light);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

/* ═══════════════════════════════════════
   SEGMENTED CONTROLS & SUBTABS
   ═══════════════════════════════════════ */
.segmented-control {
    display: inline-flex;
    align-items: center;
    background: var(--border-light);
    padding: 3px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    gap: 2px;
}

.segmented-control .seg-btn,
.segmented-control button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.segmented-control .seg-btn:hover,
.segmented-control button:hover {
    color: var(--text-main);
}

.segmented-control .seg-btn.active,
.segmented-control button.active {
    background: var(--bg-card);
    color: var(--primary);
    font-weight: 700;
    box-shadow: var(--shadow-xs);
}

/* ═══════════════════════════════════════
   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, Roster)
   ═══════════════════════════════════════ */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.825rem;
}

thead th {
    background: var(--bg-input);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    white-space: nowrap;
}

tbody td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    vertical-align: middle;
}

tbody tr {
    transition: background-color var(--transition-fast);
}

tbody tr:hover {
    background: var(--bg-card-hover);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    box-shadow: var(--shadow-xs);
}

/* ═══════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════ */
.form-group {
    margin-bottom: 0.85rem;
}

.form-group label,
label.form-label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-group input,
.form-group select,
.form-group textarea,
.form-control {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.825rem;
    font-family: var(--font-family);
    color: var(--text-main);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
    outline: none;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover,
.form-control:hover {
    border-color: var(--border-strong);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-control:focus {
    background: var(--bg-input-focus);
    border-color: var(--primary);
    box-shadow: var(--shadow-focus);
}

.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled,
.form-control:disabled {
    background: var(--border-light);
    color: var(--text-dimmed);
    cursor: not-allowed;
    opacity: 0.7;
}

.form-group input::placeholder,
.form-group textarea::placeholder,
.form-control::placeholder {
    color: var(--text-dimmed);
    font-weight: 400;
}

/* ═══════════════════════════════════════
   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.72);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 560px;
    padding: 1.5rem;
    box-shadow: var(--shadow-modal);
    color: var(--text-main);
    transform: translateY(12px) scale(0.98);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-card {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 1.25rem;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close-btn {
    background: var(--border-light);
    border: 1px solid var(--border-color);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close-btn:hover {
    background: var(--border-color);
    color: var(--text-main);
}

.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: #F3EBFC;
    color: #6D28D9;
}

.autocomplete-item i {
    color: #6D28D9;
    font-size: 0.85rem;
}
/* ------------------------------------------------
   FLEET MAP CONTAINER & LEAFLET MAP VIEWPORT
   ------------------------------------------------ */
.fleet-map-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 210px);
    min-height: 520px;
    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: #F3EBFC;
}

.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;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DUTY CARD (Booking & Dispatch) — UX-3 spec: .agents/collab/duty-card-design-samples.html
   One primary ("hero") action per lifecycle state, compact vehicle/driver block,
   neutral utility chips, Cancel · Edit footer. Per-card colours come from the inline
   custom properties --duty-accent / --duty-border / --duty-bg / --duty-code set by
   renderActiveDispatchCards (ongoing = green, overdue = amber, stale = red).
   ═══════════════════════════════════════════════════════════════════════════ */
.trip-card.duty-card {
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    background: var(--duty-bg, var(--bg-card));
    border: 1px solid var(--duty-border, var(--border-color));
    border-left: 4px solid var(--duty-accent, var(--primary));
    border-radius: var(--radius-md);
    padding: 0.9rem 0.9rem 0.8rem;
    margin-bottom: 0;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.trip-card.duty-card:hover {
    border-color: var(--duty-border, var(--border-color));
    box-shadow: var(--shadow-md);
}

/* Header: code · type badge · status badge (wraps instead of overflowing). */
.duty-card-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.5rem;
    padding-right: 1.8rem; /* clear the activity-history icon */
}

.duty-card .duty-code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    color: var(--duty-code, var(--primary));
    word-break: break-all;
}

.duty-type,
.duty-status {
    display: inline-flex;
    align-items: center;
}

/* Route block: dot rail + stops + distance/ETA */
.duty-route {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.6rem 0.7rem;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
}

.duty-route-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 0.3rem;
    flex-shrink: 0;
}

.duty-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.duty-dot--from { background: #059669; box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15); }
.duty-dot--to { background: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

.duty-rail-line {
    width: 2px;
    height: 14px;
    margin: 2px 0;
    background: var(--border-strong);
    border-radius: 1px;
}

.duty-route-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.duty-route-stop {
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.duty-route-km {
    flex-shrink: 0;
    text-align: right;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-main);
    white-space: nowrap;
}

.duty-route-eta {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Passenger / client */
.duty-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.duty-meta-cell { min-width: 0; }

.duty-label {
    font-size: 0.64rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.duty-val {
    margin-top: 0.1rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.duty-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.duty-schedule {
    font-size: 0.74rem;
    color: var(--text-secondary);
}

.duty-schedule i { color: var(--text-dimmed); margin-right: 0.15rem; }

.duty-card .duty-elapsed {
    margin-left: 0.6rem;
    color: #047857;
    font-weight: 700;
    white-space: nowrap;
}

/* Vehicle · driver block */
.duty-vehicle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.65rem;
    background: var(--primary-soft);
    border: 1px solid var(--primary-soft-border);
    border-radius: var(--radius-sm);
}

.duty-card--ongoing .duty-vehicle {
    background: #F0FDF4;
    border-color: #BBF7D0;
}

.duty-vehicle--empty {
    background: var(--bg-input);
    border-color: var(--border-color);
    border-style: dashed;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.duty-vehicle--empty i { color: var(--text-dimmed); }

.duty-vehicle-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    background: #fff;
}

.duty-vehicle-info {
    flex: 1;
    min-width: 0;
}

.duty-vehicle-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.2rem 0.45rem;
}

.duty-plate {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 800;
    color: var(--text-main);
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    padding: 0.05rem 0.4rem;
    white-space: nowrap;
}

.duty-driver-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.duty-vehicle-phone {
    margin-top: 0.15rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.duty-vehicle-phone i { font-size: 0.62rem; color: var(--text-dimmed); }

.duty-vehicle-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-family: var(--font-family);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary-dark);
    background: #fff;
    border: 1px solid var(--primary-soft-border);
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.duty-vehicle-btn:hover { background: var(--primary-soft); }
.duty-card--ongoing .duty-vehicle-btn { color: #047857; border-color: #A7F3D0; }
.duty-card--ongoing .duty-vehicle-btn:hover { background: #ECFDF5; }

/* Actions */
.duty-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    cursor: default;
}

.duty-hero {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.62rem 0.75rem;
    font-family: var(--font-family);
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.duty-hero:hover { box-shadow: var(--shadow-md); }
.duty-hero--allocate { background: #B45309; }
.duty-hero--allocate:hover { background: #92400E; }
.duty-hero--start,
.duty-hero--finish { background: #047857; }
.duty-hero--start:hover,
.duty-hero--finish:hover { background: #065F46; }

.duty-chip-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
}

.duty-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    min-width: 0;
    padding: 0.4rem 0.3rem;
    font-family: var(--font-family);
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.duty-chip:hover { background: #fff; border-color: var(--border-strong); color: var(--text-main); }
.duty-chip--gps i { color: #6D28D9; }
.duty-chip--link i { color: #0369A1; }
.duty-chip--wa i { color: #15803D; }
.duty-chip--mail i { color: #3730A3; }
.duty-chip--slip i { color: #475569; }
.duty-chip--map i { color: #1D4ED8; }

.duty-chip:disabled,
.duty-foot-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.duty-chip:disabled:hover { background: var(--bg-input); border-color: var(--border-color); color: var(--text-secondary); }

.duty-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
}

.duty-foot-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-family: var(--font-family);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.duty-foot-btn:hover:not(:disabled) { background: var(--bg-input); color: var(--text-main); }
.duty-foot-btn--edit { color: var(--primary-dark); border-color: var(--primary-soft-border); }
.duty-foot-btn--edit:hover:not(:disabled) { background: var(--primary-soft); color: var(--primary-dark); }

.duty-hero:focus-visible,
.duty-chip:focus-visible,
.duty-foot-btn:focus-visible,
.duty-vehicle-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DISPATCH TABLE VIEW — spec: .agents/collab/dispatch-table-design-samples.html
   Fixed column widths with ellipsis + tooltips, a right-pinned Actions column made of
   three fixed slots (primary 128px · Edit 32px · "⋯" 32px, all 32px high), grouped menu.
   Per-row colours come from --dt-accent / --dt-row-bg set by renderActiveDispatchTable.
   ═══════════════════════════════════════════════════════════════════════════ */
.dispatch-table-wrap {
    overflow: auto;
    max-height: calc(100vh - 230px);
    min-height: 340px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
}

.dispatch-table {
    width: 100%;
    font-size: 0.78rem;
    border-collapse: separate;
    border-spacing: 0;
}

.dispatch-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 0.7rem 0.7rem;
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
}

.dispatch-table tbody td {
    padding: 0.55rem 0.7rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}

/* Column widths (th and td share the class). Text columns truncate with an ellipsis; each carries a title tooltip. */
.dispatch-table .dt-c-booking { min-width: 140px; white-space: nowrap; }
.dispatch-table .dt-c-status { min-width: 100px; white-space: nowrap; }
.dispatch-table .dt-c-pax { width: 130px; min-width: 130px; max-width: 130px; }
.dispatch-table .dt-c-client { width: 120px; min-width: 120px; max-width: 120px; }
.dispatch-table .dt-c-route { width: 240px; min-width: 240px; max-width: 240px; }
.dispatch-table .dt-c-vehicle { min-width: 130px; white-space: nowrap; }
.dispatch-table .dt-c-driver { width: 130px; min-width: 130px; max-width: 130px; }
.dispatch-table .dt-c-sched { min-width: 145px; white-space: nowrap; }
.dispatch-table .dt-c-km { min-width: 64px; text-align: right; white-space: nowrap; font-weight: 800; color: var(--text-main); }
.dispatch-table thead .dt-c-km { color: var(--text-secondary); }
.dispatch-table .dt-c-type { width: 100px; min-width: 100px; max-width: 100px; }

/* Row: left accent bar + status tint. */
.dispatch-table tr.dt-row { cursor: pointer; background: var(--dt-row-bg, var(--bg-card)); transition: background var(--transition-fast); }
.dispatch-table tr.dt-row > td:first-child { border-left: 4px solid var(--dt-accent, var(--primary)); }
.dispatch-table tr.dt-row:hover { background: var(--bg-card-hover); }

/* Group header row (IN PROGRESS / OVERDUE, TODAY · …). The label stays visible when the table is scrolled sideways. */
.dispatch-table tr.dispatch-table-group > td {
    padding: 0.5rem 0.85rem;
    background: var(--border-light);
    border-bottom: 1px solid var(--border-color);
}

.dt-group-label {
    position: sticky;
    left: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.dt-group-dot { width: 8px; height: 8px; border-radius: 50%; background: #F59E0B; }
.dt-group-dot--live { background: #10B981; }

.dt-group-count {
    padding: 0.05rem 0.45rem;
    border-radius: var(--radius-pill);
    background: #fff;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.64rem;
    font-weight: 700;
}

/* Cell content */
.dt-trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dt-strong { font-weight: 700; color: var(--text-main); }
.dt-sub { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); margin-top: 0.1rem; }
.dt-muted { color: var(--text-muted); font-size: 0.74rem; }

.dt-code {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius-xs);
    border: 1px solid var(--primary-soft-border);
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
}

.dt-client { display: flex; align-items: center; gap: 0.35rem; font-weight: 600; color: var(--text-secondary); }
.dt-client-icon { flex-shrink: 0; font-size: 0.66rem; color: var(--text-dimmed); }

.dt-route { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.dt-route-from,
.dt-route-to { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dt-route-from { flex: 0 1 55%; font-weight: 700; color: var(--text-main); }
.dt-route-to { flex: 1 1 0; min-width: 4.5rem; color: var(--text-secondary); }
.dt-route-arrow { flex-shrink: 0; font-size: 0.62rem; color: var(--text-dimmed); }
.dt-dot { flex-shrink: 0; width: 7px; height: 7px; border-radius: 50%; }
.dt-dot--from { background: #059669; }
.dt-dot--to { background: var(--primary); }

.dt-plate {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.1rem 0.5rem;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
}

.dt-plate i { font-size: 0.62rem; color: var(--primary); }

.dt-driver { display: flex; align-items: center; gap: 0.4rem; }
.dt-driver-avatar { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border-color); }
.dt-driver-phone { padding-left: calc(18px + 0.4rem); }
.dt-unassigned { color: var(--text-dimmed); font-style: italic; white-space: nowrap; }
.dt-unassigned i { font-size: 0.66rem; margin-right: 0.15rem; }
.dt-sched { color: var(--text-secondary); font-weight: 500; }

/* Actions column: pinned to the right edge, opaque so scrolled cells never show through. */
.dispatch-table .dt-actions {
    position: sticky;
    right: 0;
    z-index: 1;
    width: 232px;
    min-width: 232px;
    text-align: right;
    white-space: nowrap;
    background: var(--dt-row-bg, var(--bg-card));
    border-left: 1px solid var(--border-color);
    box-shadow: -6px 0 12px -6px rgba(15, 23, 42, 0.1);
}

.dispatch-table thead .dt-actions-h { z-index: 3; background: var(--bg-input); text-align: right; }
.dispatch-table tr.dt-row:hover .dt-actions { background: var(--bg-card-hover); }

.dt-actions-inner { display: inline-flex; align-items: center; gap: 0.4rem; }
.dt-more-wrap { position: relative; display: inline-block; }

.dt-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 128px;
    height: 32px;
    padding: 0 0.5rem;
    flex-shrink: 0;
    overflow: hidden;
    border: none;
    border-radius: var(--radius-md);
    color: #fff;
    font-family: var(--font-family);
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: var(--shadow-xs);
    transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.dt-primary:hover { box-shadow: var(--shadow-sm); }
.dt-primary > span { overflow: hidden; text-overflow: ellipsis; }

.dt-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.dt-icon-btn:hover:not(:disabled) { background: #fff; border-color: var(--border-strong); }
.dt-icon-btn--edit { background: var(--primary-soft); border-color: var(--primary-soft-border); color: var(--primary-dark); }
.dt-icon-btn--edit:hover:not(:disabled) { background: #fff; border-color: var(--primary); }
.dt-icon-btn:disabled { opacity: 0.55; cursor: not-allowed; color: var(--text-dimmed); }

.dt-primary:focus-visible,
.dt-icon-btn:focus-visible,
.dt-menu-item:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* "⋯" menu: lifted to <body> by _toggleDispatchRowMenu while open (position/left/top are set inline there). */
.dispatch-row-menu.dt-menu {
    position: fixed;
    width: 216px;
    max-height: 70vh;
    overflow-y: auto;
    z-index: 3000;
    padding: 0.3rem 0;
    text-align: left;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.dt-menu-group { padding: 0.25rem 0; }
.dt-menu-group + .dt-menu-group { border-top: 1px solid var(--border-light); }

.dt-menu-heading {
    padding: 0.2rem 0.85rem;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.dt-menu-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.42rem 0.85rem;
    border: none;
    background: transparent;
    font-family: var(--font-family);
    font-size: 0.76rem;
    font-weight: 600;
    text-align: left;
    color: var(--text-secondary);
    cursor: pointer;
}

.dt-menu-item i { width: 1rem; text-align: center; color: var(--text-muted); }
.dt-menu-item:hover:not(:disabled),
.dt-menu-item:focus-visible { background: var(--bg-input); color: var(--text-main); }
.dt-menu-item:disabled { opacity: 0.55; cursor: not-allowed; }
.dt-menu-item--danger { color: #B91C1C; }
.dt-menu-item--danger i { color: #B91C1C; }
.dt-menu-item--danger:hover:not(:disabled),
.dt-menu-item--danger:focus-visible { background: #FEF2F2; color: #991B1B; }

/* ═══════════════════════════════════════════════════════════════════════════
   COMPLETED TRIPS HISTORY TABLE — spec: .agents/collab/dispatch-history-design-samples.html
   Fixed column widths, sticky right-pinned actions header & cell, and toolbar styling.
   ═══════════════════════════════════════════════════════════════════════════ */
.history-table-wrap {
    overflow: auto;
    max-height: calc(100vh - 230px);
    min-height: 340px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
}

.history-table {
    width: 100%;
    font-size: 0.78rem;
    border-collapse: separate;
    border-spacing: 0;
}

.history-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 0.7rem 0.7rem;
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
}

.history-table tbody td {
    padding: 0.55rem 0.7rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}

/* History Column widths */
.history-table .ht-c-trip { width: 130px; min-width: 130px; white-space: nowrap; }
.history-table .ht-c-pax { width: 150px; min-width: 150px; max-width: 150px; }
.history-table .ht-c-route { width: 260px; min-width: 260px; max-width: 260px; }
.history-table .ht-c-vehicle { width: 140px; min-width: 140px; max-width: 140px; }
.history-table .ht-c-package { width: 120px; min-width: 120px; max-width: 120px; }
.history-table .ht-c-distance { width: 150px; min-width: 150px; max-width: 150px; }
.history-table .ht-c-time { width: 125px; min-width: 125px; white-space: nowrap; }

/* Actions column pinned right */
.history-table .ht-actions {
    position: sticky;
    right: 0;
    z-index: 1;
    width: 195px;
    min-width: 195px;
    text-align: right;
    white-space: nowrap;
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    box-shadow: -6px 0 12px -6px rgba(15, 23, 42, 0.1);
}

.history-table thead .ht-actions-h {
    z-index: 3;
    background: var(--bg-input);
    text-align: right;
}

.history-table tr:hover td.ht-actions {
    background: var(--bg-card-hover);
}

.history-toolbar-wrap {
    padding-bottom: 0.85rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-light);
}

.history-toolbar-controls {
    display: flex;
    gap: 0.45rem;
    align-items: center;
    flex-wrap: wrap;
}

.history-search-input-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.history-search-input-wrap i {
    position: absolute;
    left: 0.65rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    pointer-events: none;
}

.history-search-input-wrap input {
    padding: 0.4rem 0.65rem 0.4rem 1.8rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    font-size: 0.78rem;
    background: var(--bg-input);
    color: var(--text-main);
    width: 160px;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.history-search-input-wrap input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: var(--shadow-focus);
}


/* ═══════════════════════════════════════════════════════════════════════════
   COMPLETED TRIPS HISTORY — row / cell styles for the JS-rendered body
   (table shell + column widths above: .history-table, .ht-c-*, .ht-actions)
   Reuses the dispatch-table pieces: .dt-code, .dt-route*, .dt-plate, .dt-primary,
   .dt-icon-btn, .dt-more-wrap, .dt-menu*, .dt-trunc, .dt-strong, .dt-muted.
   ═══════════════════════════════════════════════════════════════════════════ */
/* Actions column: 3 fixed slots (128 + 32 + 32) like the dispatch table. */
.history-table .ht-actions { width: 232px; min-width: 232px; }
.history-table tbody td.ht-actions { padding: 0.55rem 0.7rem; }
.dt-primary--soft { background: var(--primary-soft); color: var(--primary-dark); border: 1px solid var(--primary-soft-border); box-shadow: none; }
.dt-primary--soft:hover { background: #fff; border-color: var(--primary); }

.history-table tr.ht-row { background: var(--bg-card); transition: background var(--transition-fast); }
.history-table tr.ht-row:hover { background: var(--bg-card-hover); }
.history-table tr.ht-row--cancelled td:not(.ht-actions) { color: var(--text-muted); }
.history-table .ht-c-trip { white-space: nowrap; }
.history-table .ht-c-vehicle,
.history-table .ht-c-package { overflow: hidden; }

/* Month header strip (button inside a clickable cell) */
.history-table .ht-month-cell {
    padding: 0.5rem 0.7rem;
    background: var(--bg-input);
    border-top: 2px solid var(--primary);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}

.ht-month-inner {
    position: sticky;
    left: 0.7rem;
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
}

.ht-month-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.15rem 0.3rem;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    font-family: var(--font-family);
    cursor: pointer;
}

.ht-month-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ht-chevron { font-size: 0.7rem; color: var(--text-dimmed); transition: transform var(--transition-fast); }
.ht-month-label { font-size: 0.82rem; font-weight: 800; color: var(--text-main); }

.ht-month-count {
    padding: 0.05rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    background: #fff;
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.ht-month-billed {
    padding: 0.1rem 0.55rem;
    border: 1px solid #A7F3D0;
    border-radius: var(--radius-sm);
    background: #ECFDF5;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #047857;
}

.ht-month-billed strong { margin-left: 0.25rem; font-size: 0.78rem; font-weight: 800; text-transform: none; }

.history-table .ht-month-search-cell { padding: 0.4rem 0.7rem 0.6rem; background: #FCFDFE; border-bottom: 1px solid var(--border-light); }
.ht-month-search { position: sticky; left: 0.7rem; max-width: 360px; }
.ht-month-search i { position: absolute; left: 0.65rem; top: 50%; transform: translateY(-50%); font-size: 0.72rem; color: var(--text-muted); pointer-events: none; }
.ht-month-search input {
    width: 100%;
    padding: 0.4rem 0.6rem 0.4rem 1.9rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    font-size: 0.76rem;
    color: var(--text-main);
}
.ht-month-search input:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: var(--shadow-focus); }
.history-table .ht-month-empty { padding: 1rem; text-align: center; font-size: 0.8rem; color: var(--text-dimmed); border-bottom: 1px solid var(--border-light); }

/* Status icon + trip code chip */
.ht-status { margin-left: 0.2rem; font-size: 0.95rem; vertical-align: middle; }
.ht-status--ok { color: #059669; }
.ht-status--warn { color: #F59E0B; }
.ht-status--bad { color: #DC2626; }
.dt-code.ht-code--bad { background: #FEF2F2; border-color: #FECACA; color: #B91C1C; }

/* Passenger / client */
.ht-client { display: flex; align-items: center; gap: 0.3rem; margin-top: 0.1rem; font-size: 0.7rem; font-weight: 600; color: var(--text-muted); }
.ht-client i { flex-shrink: 0; font-size: 0.62rem; color: var(--text-dimmed); }
.history-table tr.ht-row--cancelled .ht-strike { text-decoration: line-through; color: var(--text-dimmed); }

/* Vehicle / driver, package */
.ht-driver { margin-top: 0.2rem; font-size: 0.7rem; font-weight: 600; color: var(--text-secondary); }
.ht-driver--none { color: var(--text-dimmed); font-style: italic; }
.ht-pkg-name { font-weight: 600; color: var(--text-secondary); }
.ht-pkg-amt { margin-top: 0.1rem; font-size: 0.7rem; color: var(--text-muted); }
.ht-pkg-amt strong { color: var(--text-main); }

/* Time */
.ht-time-date { font-size: 0.74rem; font-weight: 600; color: var(--text-secondary); }
.ht-time-clock { font-size: 0.68rem; color: var(--text-muted); }

/* Distance & fare ledger cell */
.ht-dist { font-size: 0.7rem; line-height: 1.45; white-space: nowrap; }
.ht-dist-line { color: var(--text-muted); }
.ht-dist-lab { font-weight: 700; color: var(--text-dimmed); }
.ht-dist-val { color: var(--text-muted); }
.ht-dist-sep { margin: 0 0.3rem; color: var(--border-strong); }
.ht-dist-bill { color: var(--text-main); }
.ht-dist-bill strong { font-size: 0.74rem; }
.ht-dist-bill i { margin-left: 0.15rem; font-size: 0.6rem; color: var(--text-dimmed); }
.ht-dist-bill--edit .ht-dist-lab { color: #059669; }
.ht-dist-bill--edit strong { color: #065F46; }
.ht-dist-bill--edit i { color: #059669; }
.ht-dist-total { margin-top: 0.1rem; color: var(--text-muted); }
.ht-dist-total span { font-weight: 800; color: var(--text-main); }
.ht-dist-cancelled { font-weight: 800; color: #DC2626; }

/* History route cell: pickup on top, destination below, each trimmed with an ellipsis (full text in the tooltip). */
.ht-route { display: flex; align-items: stretch; gap: 0.55rem; min-width: 0; }
.ht-route-rail { display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; }
.ht-rail-line { width: 2px; flex: 1 1 auto; min-height: 8px; margin: 2px 0; background: var(--border-strong); border-radius: 1px; }
.ht-route-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.ht-route-stop { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.76rem; line-height: 1.25; color: var(--text-secondary); }
.ht-route-stop--from { font-weight: 700; color: var(--text-main); }

/* ═══════════════════════════════════════════════════════════════════════════
   BILLING & INVOICES (accountingTab) — Phase 1 Static Shell
   Spec: .agents/collab/billing-invoices-design-samples.html
   ═══════════════════════════════════════════════════════════════════════════ */
.bill-master-tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
}

.bill-master-tabs {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.3rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.bill-master-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1.25rem;
    border-radius: var(--radius-md);
    border: none;
    font-family: var(--font-family);
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
}

.bill-master-tab-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.bill-summary-strip {
    display: flex;
    align-items: stretch;
    border-radius: var(--radius-lg);
    padding: 0.35rem 0.2rem;
    border: 1px solid var(--border-color);
    background: #fff;
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--transition-fast);
}

.bill-summary-strip:hover {
    box-shadow: var(--shadow-sm);
}

.bill-summary-metric {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    padding: 0.2rem 1rem;
}

.bill-summary-label {
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.15rem;
}

.bill-summary-val {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 800;
}

.bill-summary-sep {
    width: 1px;
    background: var(--border-light);
    margin: 0.2rem 0;
}

.bill-filter-bar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 0.6rem 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2xs);
}

.bill-search-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.bill-search-wrap i {
    position: absolute;
    left: 0.65rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    pointer-events: none;
}

.bill-search-wrap input {
    padding: 0.38rem 0.65rem 0.38rem 1.8rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    font-size: 0.78rem;
    background: var(--bg-input);
    color: var(--text-main);
    width: 180px;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.bill-search-wrap input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: var(--shadow-focus);
}


/* ═══════════════════════════════════════════════════════════════════════════
   MONTH STRIP (shared renderMonthView: Billing client / vendor / walk-in tabs) + CORPORATE "READY TO
   BILL" CARD — spec: .agents/collab/billing-invoices-design-samples.html
   ═══════════════════════════════════════════════════════════════════════════ */
.mv-month { margin-bottom: 1.25rem; }

.mv-month-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.45rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.mv-month-head.is-clickable { cursor: pointer; }
.mv-month-head.is-clickable:hover { background: #fff; }

.mv-month-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.15rem 0.3rem;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    font-family: var(--font-family);
    cursor: pointer;
}

.mv-month-toggle--static { cursor: default; }
.mv-month-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.mv-chevron { font-size: 0.7rem; color: var(--text-dimmed); transition: transform var(--transition-fast); }
.mv-month-label { font-family: var(--heading-font); font-size: 0.86rem; font-weight: 800; color: var(--text-main); }

.mv-month-count {
    padding: 0.05rem 0.55rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    background: #fff;
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.mv-month-total { display: flex; align-items: baseline; gap: 0.4rem; font-size: 0.74rem; color: var(--text-secondary); white-space: nowrap; }
.mv-total-label { font-weight: 600; color: var(--text-muted); }
.mv-total-label::after { content: ':'; }
.mv-month-total strong { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 800; color: #3730A3; }

.mv-search { position: relative; max-width: 360px; margin: 0 0 0.75rem; }
.mv-search i { position: absolute; left: 0.65rem; top: 50%; transform: translateY(-50%); font-size: 0.72rem; color: var(--text-muted); pointer-events: none; }
.mv-search input {
    width: 100%;
    padding: 0.4rem 0.6rem 0.4rem 1.9rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    font-size: 0.76rem;
    color: var(--text-main);
}
.mv-search input:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: var(--shadow-focus); }

/* Corporate "Ready to Bill" card (client × month × issuing company) */
.cn-card {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--transition-fast);
}

.cn-card:hover { box-shadow: var(--shadow-md); }
.cn-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.cn-card-id { min-width: 0; }
.cn-card-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9rem; font-weight: 800; color: var(--text-main); }
.cn-card-city { display: flex; align-items: center; gap: 0.3rem; margin-top: 0.1rem; font-size: 0.72rem; font-weight: 500; color: var(--text-muted); }
.cn-card-city i { font-size: 0.62rem; color: var(--text-dimmed); }

.cn-card-period {
    flex-shrink: 0;
    padding: 0.1rem 0.55rem;
    border: 1px solid #C7D2FE;
    border-radius: var(--radius-pill);
    background: #EEF2FF;
    font-size: 0.66rem;
    font-weight: 800;
    color: #3730A3;
}

.cn-card-billedby {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    align-self: flex-start;
    max-width: 100%;
    padding: 0.15rem 0.5rem;
    border: 1px solid var(--primary-soft-border);
    border-radius: var(--radius-sm);
    background: var(--primary-soft);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--primary-dark);
    overflow: hidden;
}

.cn-card-billedby i { flex-shrink: 0; font-size: 0.6rem; }
.cn-card-billedby span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cn-card-metrics {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border-light);
}

.cn-card-trips { font-size: 0.78rem; color: var(--text-secondary); }
.cn-card-trips strong { font-weight: 800; color: var(--text-main); }
.cn-card-amount { text-align: right; }
.cn-card-amount-label { font-size: 0.6rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.cn-card-amount-val { display: block; font-family: var(--font-mono); font-size: 0.98rem; font-weight: 800; color: #3730A3; }
.cn-card-sel { min-height: 1em; font-size: 0.7rem; font-weight: 700; color: #4338CA; }
.cn-card-cta { width: 100%; height: 32px; justify-content: center; margin-top: auto; font-size: 0.78rem; }
.cn-card-cta:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ═══════════════════════════════════════════════════════════════════════════
   REVENUE & PROFIT/LOSS DASHBOARD (#reportsTab)
   Spec: .agents/collab/revenue-pl-design-samples.html
   ═══════════════════════════════════════════════════════════════════════════ */

/* Header controls */
.report-controls-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.report-select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.report-select-icon {
    position: absolute;
    left: 0.65rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    pointer-events: none;
}

.report-preset-select {
    appearance: none;
    padding: 0.42rem 1.8rem 0.42rem 1.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--bg-input);
    color: var(--text-main);
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.report-preset-select:hover {
    background: #FFFFFF;
    border-color: #CBD5E1;
}

.report-preset-select:focus {
    outline: none;
    border-color: var(--primary);
    background: #FFFFFF;
    box-shadow: var(--shadow-focus);
}

.report-select-chevron {
    position: absolute;
    right: 0.65rem;
    font-size: 0.62rem;
    color: var(--text-muted);
    pointer-events: none;
}

.report-date-input {
    padding: 0.38rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.78rem;
    background: var(--bg-input);
    color: var(--text-main);
}

.report-date-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--shadow-focus);
}

/* KPI Cards Row */
.report-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.report-kpi-grid .kpi-tile {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.report-kpi-grid .kpi-tile:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    border-color: #CBD5E1;
}

.report-kpi-grid .kpi-value {
    font-variant-numeric: tabular-nums;
}

/* Charts Row (2fr 1fr) */
.report-charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.report-chart-card {
    padding: 1.15rem;
    height: 320px;
    display: flex;
    flex-direction: column;
}

.report-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--border-light);
}

.report-card-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.report-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.75rem;
    border: 1px solid var(--primary-soft-border);
}

.report-card-title-wrap .card-title {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-main);
}

.report-card-subtitle {
    margin: 0.15rem 0 0 0;
    font-size: 0.68rem;
    color: var(--text-muted);
}

.report-card-badge {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.15rem 0.45rem;
    border-radius: 9999px;
    background: var(--bg-card-hover);
    color: var(--text-muted);
    border: 1px solid var(--border-light);
}

.report-card-caption {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
}

.report-chart-canvas-wrap {
    position: relative;
    flex: 1;
    min-height: 0;
}

/* P&L Breakdown + Top Customers Row (1fr 1fr) */
.report-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.report-panel {
    padding: 1.15rem;
}

.report-vehicle-panel {
    margin-bottom: 1.25rem;
}

.report-table-scroll {
    overflow-x: auto;
}

.report-loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 2.5rem 1rem;
}

/* Number plate badge */
.plate-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    padding: 0.12rem 0.45rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-main);
    line-height: 1.3;
}

.plate-badge::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #2563EB;
}

/* Responsive collapse */
@media (max-width: 1024px) {
    .report-charts-grid,
    .report-details-grid {
        grid-template-columns: 1fr;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   REVENUE & P&L — JS-rendered content (reports.js): ledger (.pl-*), tables (.rpt-*), aging (.ra-*)
   Static shell / cards / KPI tiles are the .report-* block above.
   ═══════════════════════════════════════════════════════════════════════════ */
/* Ledger */
.pl-section { display: flex; align-items: center; gap: 0.4rem; padding: 0 0.5rem; margin: 0.15rem 0 0.25rem; font-size: 0.64rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.pl-section--in i { color: #10B981; font-size: 0.62rem; }
.pl-section--out i { color: #F43F5E; font-size: 0.62rem; }
.pl-rows { display: flex; flex-direction: column; gap: 1px; margin-bottom: 0.4rem; }
.pl-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.38rem 0.5rem; border-radius: var(--radius-sm); }
.pl-row:hover { background: var(--bg-input); }
.pl-row-label { display: flex; align-items: center; gap: 0.55rem; min-width: 0; font-size: 0.8rem; font-weight: 500; color: var(--text-secondary); }
.pl-row-label i { width: 1rem; text-align: center; font-size: 0.72rem; color: var(--text-dimmed); }
.pl-tag { padding: 0 0.3rem; border: 1px solid #FCD34D; border-radius: var(--radius-xs); background: #FFFBEB; font-size: 0.58rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: #92400E; }
.pl-row-amt { flex-shrink: 0; font-family: var(--font-mono); font-size: 0.8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pl-row-amt--pos { color: #059669; }
.pl-row-amt--neg { color: #DC2626; }
.pl-row-amt--info { color: var(--primary); }
.pl-row-amt--zero { color: var(--text-dimmed); font-weight: 600; }
.pl-divider { height: 0; margin: 0.35rem 0.5rem 0.5rem; border-top: 1px dashed var(--border-strong); }

.pl-total { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin: 0.6rem 0 0.6rem; padding: 0.75rem 0.9rem; border: 1px solid; border-radius: var(--radius-lg); }
.pl-total--pos { background: #ECFDF5; border-color: #A7F3D0; }
.pl-total--neg { background: #FEF2F2; border-color: #FECACA; }
.pl-total-id { display: flex; align-items: center; gap: 0.6rem; }
.pl-total-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: var(--radius-md); background: #fff; font-size: 0.8rem; }
.pl-total--pos .pl-total-icon { color: #059669; }
.pl-total--neg .pl-total-icon { color: #DC2626; }
.pl-total-title { font-family: var(--heading-font); font-size: 0.86rem; font-weight: 800; color: var(--text-main); }
.pl-total-sub { font-size: 0.68rem; color: var(--text-muted); }
.pl-total-amt { font-family: var(--font-mono); font-size: 1.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.pl-total--pos .pl-total-amt { color: #047857; }
.pl-total--neg .pl-total-amt { color: #B91C1C; }

.pl-pill { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 0.9rem; padding: 0.5rem 0.75rem; border: 1px solid; border-radius: var(--radius-md); font-size: 0.76rem; font-weight: 600; }
.pl-pill--good { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.pl-pill--warn { background: #FFFBEB; border-color: #FDE68A; color: #92400E; }
.pl-pill--bad { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }
.pl-pill-main { display: inline-flex; align-items: center; gap: 0.4rem; }
.pl-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pl-pill-meta { font-size: 0.7rem; font-weight: 500; color: var(--text-secondary); }
.pl-pill-meta strong, .pl-pill-main strong { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.pl-note { margin: 0.6rem 0 0; font-size: 0.66rem; line-height: 1.45; color: var(--text-muted); }

/* Tables (vehicle economics, top customers) */
.rpt-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.78rem; }
.rpt-table thead th { padding: 0.55rem 0.6rem; background: var(--bg-input); border-bottom: 1px solid var(--border-color); font-size: 0.64rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; }
.rpt-table thead th:first-child { border-top-left-radius: var(--radius-sm); }
.rpt-table thead th:last-child { border-top-right-radius: var(--radius-sm); }
.rpt-table tbody td { padding: 0.6rem; border-bottom: 1px solid var(--border-light); color: var(--text-secondary); vertical-align: middle; }
.rpt-table tbody tr:hover td { background: var(--bg-input); }
.rpt-l { text-align: left; }
.rpt-r { text-align: right; }
.rpt-c { text-align: center; }
.rpt-num { font-family: var(--font-mono); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rpt-pos { color: #059669; }
.rpt-neg { color: #DC2626; }
/* Table-cell specificity so the tone beats `.rpt-table tbody td` */
.rpt-table tbody td.rpt-pos { color: #059669; }
.rpt-table tbody td.rpt-neg { color: #DC2626; }
.rpt-muted { color: var(--text-dimmed); }
.rpt-sub { margin-top: 0.1rem; font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-muted); }
.rpt-sub-inline { margin-left: 0.5rem; font-size: 0.72rem; color: var(--text-muted); }
.rpt-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: var(--text-main); }
.rpt-rank-col { width: 2rem; }
.rpt-rank { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--bg-input); border: 1px solid var(--border-color); font-size: 0.66rem; font-weight: 800; color: var(--text-muted); }
.rpt-rank--top { background: var(--primary-soft); border-color: var(--primary-soft-border); color: var(--primary-dark); }
.rpt-count { display: inline-block; min-width: 1.6rem; padding: 0.05rem 0.5rem; border-radius: var(--radius-pill); background: var(--bg-input); font-size: 0.7rem; font-weight: 700; color: var(--text-secondary); }
.rpt-pill { display: inline-block; padding: 0.1rem 0.5rem; border: 1px solid; border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rpt-pill--pos { background: #ECFDF5; border-color: #A7F3D0; color: #047857; }
.rpt-pill--neg { background: #FEF2F2; border-color: #FECACA; color: #B91C1C; }
.rpt-pill--warn { background: #FFFBEB; border-color: #FDE68A; color: #B45309; }
.rpt-foot { padding-top: 0.6rem; font-size: 0.7rem; color: var(--text-muted); }
.rpt-empty { display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 1.75rem 1rem; font-size: 0.8rem; color: var(--text-muted); }
.rpt-empty i { color: var(--text-dimmed); }
.rpt-allpaid { display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 1.5rem 1rem; font-size: 0.82rem; font-weight: 700; color: #059669; }

/* Receivables aging */
.ra-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1rem; }
.ra-tile { padding: 0.7rem 0.85rem; border: 1px solid var(--border-color); border-left-width: 4px; border-radius: var(--radius-md); background: var(--bg-card); }
.ra-tile--out { border-left-color: #EF4444; }
.ra-tile--over { border-left-color: #F59E0B; }
.ra-tile-label { font-size: 0.64rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.ra-tile-val { margin-top: 0.1rem; font-family: var(--font-mono); font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text-main); }
.ra-tile--out .ra-tile-val { color: #B91C1C; }
.ra-tile--over .ra-tile-val { color: #B45309; }
.ra-tile-sub { font-size: 0.68rem; color: var(--text-muted); }
.ra-buckets { display: flex; flex-direction: column; gap: 0.55rem; }
.ra-row { display: flex; align-items: center; gap: 0.75rem; }
.ra-label { display: flex; align-items: center; gap: 0.45rem; min-width: 84px; font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); }
.ra-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ra-track { flex: 1; height: 10px; border-radius: var(--radius-pill); background: var(--border-light); overflow: hidden; }
.ra-fill { height: 100%; border-radius: var(--radius-pill); transition: width 0.6s ease; }
.ra-amt { min-width: 84px; text-align: right; font-family: var(--font-mono); font-size: 0.75rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-main); }
.ra-cnt { min-width: 36px; text-align: right; font-size: 0.7rem; color: var(--text-muted); }
@media (max-width: 640px) { .ra-summary { grid-template-columns: 1fr; } }


/* ==========================================================================
   Expenses, Fuel Logs & Driver Payroll (#expensesTab)
   ========================================================================== */
.exp-panel {
    padding: 1.25rem 1.35rem;
    margin-bottom: 1.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
}

.exp-panel:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}

.exp-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding-bottom: 0.85rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.exp-panel-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.exp-panel-subtitle {
    margin: 0.15rem 0 0;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.exp-panel-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.exp-panel-icon--purple { background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary-soft-border); }
.exp-panel-icon--amber  { background: #FEF3C7; color: #D97706; border: 1px solid #FDE68A; }
.exp-panel-icon--green  { background: #D1FAE5; color: #059669; border: 1px solid #A7F3D0; }
.exp-panel-icon--indigo { background: #EEF2FF; color: #4F46E5; border: 1px solid #C7D2FE; }

.exp-grid-dual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 900px) {
    .exp-grid-dual {
        grid-template-columns: 1fr;
    }
}

.exp-form-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-bottom: 0;
}

.exp-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 0.85rem;
}

@media (max-width: 540px) {
    .exp-form-grid {
        grid-template-columns: 1fr;
    }
}

.exp-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.exp-field--full {
    grid-column: 1 / -1;
}

.exp-label {
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.exp-input {
    width: 100%;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    color: var(--text-main);
    background: var(--bg-input);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.exp-input:focus {
    outline: none;
    border-color: var(--primary);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.exp-input--uppercase {
    text-transform: uppercase;
}

.exp-input--inline {
    width: auto;
    min-width: 130px;
    padding: 0.35rem 0.6rem;
}

.exp-input--driver-select {
    min-width: 180px;
}

/* External decorative input prefix / addon wrap */
.exp-input-addon-wrap {
    display: flex;
    align-items: center;
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    overflow: hidden;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.exp-input-addon-wrap:focus-within {
    border-color: var(--primary);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.exp-input-addon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    user-select: none;
    min-width: 32px;
}

.exp-addon-input {
    flex: 1;
    width: 100%;
    min-width: 0;
    padding: 0.45rem 0.65rem;
    border: none;
    background: transparent;
    font-size: 0.78rem;
    color: var(--text-main);
    outline: none;
}

.exp-form-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
}

.exp-ctrl-cluster {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.exp-settlement-controls {
    display: flex;
    gap: 0.65rem;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
    background: var(--bg-input);
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.exp-settlement-actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    padding-bottom: 0.1rem;
}

.exp-filter-cluster {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    align-items: center;
}

.exp-filter-pill {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.exp-filter-pill:hover {
    background: var(--bg-input);
    color: var(--text-main);
    border-color: var(--border-strong);
}

.exp-filter-pill.active {
    background: var(--primary);
    color: #FFFFFF;
    border-color: var(--primary);
    box-shadow: 0 1px 3px rgba(124, 58, 237, 0.3);
}

/* ═══════════════════════════════════════════════════════════════════════════
   EXPENSES & PAYROLL — JS-rendered content (expenses.js): pending payments, payroll, settlement,
   expense history. Static shell / forms are the .exp-* block above.
   ═══════════════════════════════════════════════════════════════════════════ */
/* Shared bits */
.ex-l { text-align: left; }
.ex-r { text-align: right; }
.ex-c { text-align: center; }
.ex-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.ex-pos { color: #059669; }
.ex-neg { color: #DC2626; }
.ex-muted { color: var(--text-dimmed); }
.ex-strong { font-weight: 700; color: var(--text-main); }
.ex-sub { margin-top: 0.1rem; font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-muted); }
.ex-foot { padding-top: 0.6rem; text-align: center; font-size: 0.72rem; color: var(--text-muted); }
.ex-empty { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 1.75rem 1rem; text-align: center; font-size: 0.8rem; color: var(--text-muted); }
.ex-empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--bg-input); color: var(--text-dimmed); font-size: 1rem; }

.ex-btn-success { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.8rem; border: none; border-radius: var(--radius-md); background: #047857; color: #fff; font-family: var(--font-family); font-size: 0.74rem; font-weight: 700; cursor: pointer; box-shadow: var(--shadow-xs); transition: background var(--transition-fast); }
.ex-btn-success:hover { background: #065F46; }
.ex-btn-success:focus-visible, .ex-paid-btn:focus-visible, .ex-pay:focus-visible, .ex-del:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Tables (payroll roster, expense history) */
.ex-table-wrap { overflow-x: auto; border: 1px solid var(--border-color); border-radius: var(--radius-lg); }
.ex-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.78rem; }
.ex-table thead th { padding: 0.55rem 0.7rem; background: var(--bg-input); border-bottom: 1px solid var(--border-color); font-size: 0.64rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; }
.ex-table tbody td { padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--border-light); vertical-align: middle; color: var(--text-secondary); }
.ex-table tbody tr:last-child td { border-bottom: none; }
.ex-table tbody tr:hover td { background: var(--bg-input); }
.ex-date { white-space: nowrap; font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-muted); }
.ex-desc { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--text-main); }
.ex-amt { font-family: var(--font-mono); font-weight: 700; font-variant-numeric: tabular-nums; color: #DC2626; white-space: nowrap; }
.ex-who { font-size: 0.74rem; font-weight: 600; color: var(--text-secondary); }
.ex-del { background: none; border: none; padding: 0.3rem 0.4rem; border-radius: var(--radius-sm); color: #FB7185; font-size: 0.85rem; cursor: pointer; transition: color var(--transition-fast), background var(--transition-fast); }
.ex-del:hover { color: #E11D48; background: #FFF1F2; }
/* Cell colours need the table-cell specificity to beat `.ex-table tbody td` */
.ex-table tbody td.ex-pos { color: #059669; }
.ex-table tbody td.ex-neg { color: #DC2626; }
.ex-table tbody td.ex-strong { color: var(--text-main); }
.ex-table tbody td.ex-amt { color: #DC2626; }
.ex-table tbody td.ex-desc { color: var(--text-main); }
.ex-table tbody td.ex-date { color: var(--text-muted); }

/* Category pills */
.ex-cat { display: inline-block; padding: 0.1rem 0.55rem; border: 1px solid var(--border-color); border-radius: var(--radius-pill); background: var(--bg-input); font-size: 0.68rem; font-weight: 700; color: var(--text-secondary); white-space: nowrap; }
.ex-cat--Fuel { background: #FFFBEB; border-color: #FDE68A; color: #92400E; }
.ex-cat--Maintenance { background: #EFF6FF; border-color: #BFDBFE; color: #1E40AF; }
.ex-cat--DriverSalary { background: #EEF2FF; border-color: #C7D2FE; color: #3730A3; }
.ex-cat--Insurance { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.ex-cat--EMI { background: var(--primary-soft); border-color: var(--primary-soft-border); color: var(--primary-dark); }
.ex-cat--Penalty { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }

/* Pending payments */
.ex-ok { display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.75rem 1rem; border: 1px solid #A7F3D0; border-radius: var(--radius-lg); background: #ECFDF5; font-size: 0.8rem; font-weight: 700; color: #065F46; }
.ex-ok i { color: #059669; }
.ex-pend-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.7rem; }
.ex-pend-count { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; font-weight: 700; color: #BE123C; }
.ex-pulse { width: 8px; height: 8px; border-radius: 50%; background: #F43F5E; animation: exPulse 1.6s ease-in-out infinite; }
@keyframes exPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(1.3); } }
.ex-pend-list { display: flex; flex-direction: column; gap: 0.5rem; }
.ex-pend-item { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.6rem 0.75rem; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); }
.ex-pend-id { display: flex; align-items: center; gap: 0.65rem; min-width: 0; }
.ex-pend-icon { font-size: 1rem; }
.ex-pend-text { min-width: 0; }
.ex-pend-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8rem; font-weight: 700; color: var(--text-main); }
.ex-pend-meta { font-size: 0.7rem; color: var(--text-muted); }
.ex-pend-act { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }
.ex-pend-amt { font-family: var(--font-mono); font-size: 0.82rem; font-weight: 700; font-variant-numeric: tabular-nums; color: #DC2626; }
.ex-paid-btn { padding: 0.3rem 0.7rem; border: 1px solid #A7F3D0; border-radius: var(--radius-sm); background: #ECFDF5; font-family: var(--font-family); font-size: 0.72rem; font-weight: 700; color: #047857; cursor: pointer; transition: background var(--transition-fast); }
.ex-paid-btn:hover { background: #D1FAE5; }

/* Payroll */
.ex-sal-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin-bottom: 1rem; }
.ex-sal-tile { padding: 0.65rem 0.8rem; border: 1px solid; border-radius: var(--radius-lg); text-align: center; }
.ex-sal-tile-label { font-size: 0.62rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.ex-sal-tile-val { margin-top: 0.1rem; font-family: var(--font-mono); font-size: 1.05rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.ex-sal-tile-sub { font-size: 0.66rem; color: var(--text-muted); }
.ex-sal-tile--earned { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.ex-sal-tile--ded { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }
.ex-sal-tile--net { background: var(--primary-soft); border-color: var(--primary-soft-border); color: var(--primary-dark); }
.ex-sal-tile--paid { background: #F0FDF4; border-color: #BBF7D0; color: #14532D; }
.ex-status { display: inline-block; padding: 0.1rem 0.55rem; border: 1px solid; border-radius: var(--radius-pill); font-size: 0.66rem; font-weight: 700; }
.ex-status--paid { background: #ECFDF5; border-color: #A7F3D0; color: #047857; }
.ex-status--due { background: #FFFBEB; border-color: #FDE68A; color: #B45309; }
.ex-pay { padding: 0.25rem 0.7rem; border: none; border-radius: var(--radius-sm); background: #047857; color: #fff; font-family: var(--font-family); font-size: 0.72rem; font-weight: 700; cursor: pointer; }
.ex-pay:hover { background: #065F46; }
.ex-done { font-weight: 800; color: var(--text-dimmed); }

/* Settlement receipt */
.ex-set { max-width: 480px; margin: 0 auto; padding: 1rem 1.1rem; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.ex-set-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; padding-bottom: 0.6rem; margin-bottom: 0.7rem; border-bottom: 1px solid var(--border-light); }
.ex-set-name { margin: 0; font-size: 0.95rem; font-weight: 800; color: var(--text-main); }
.ex-set-model { padding: 0.12rem 0.55rem; border: 1px solid; border-radius: var(--radius-pill); font-size: 0.62rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.ex-set-model--commission { background: #F0FDF4; border-color: #BBF7D0; color: #15803D; }
.ex-set-model--salaried { background: #EEF2FF; border-color: #C7D2FE; color: #4338CA; }
.ex-set-rows { font-size: 0.82rem; }
.ex-set-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.35rem 0; color: var(--text-secondary); }
.ex-set-val { font-family: var(--font-mono); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-main); }
.ex-set-val.ex-neg { color: #DC2626; }
.ex-set-sub { margin: 0.25rem 0 0.1rem; padding-top: 0.35rem; border-top: 1px dashed var(--border-color); font-size: 0.64rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-dimmed); }
.ex-set-net { display: flex; align-items: center; justify-content: space-between; margin-top: 0.4rem; padding-top: 0.5rem; border-top: 2px solid var(--text-main); font-weight: 800; color: var(--text-main); }
.ex-set-net-amt { font-family: var(--font-mono); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.ex-set-net-amt--pos { color: #059669; }
.ex-set-net-amt--neg { color: #DC2626; }
.ex-set-net-amt--zero { color: var(--text-muted); }
.ex-set-status { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 0.7rem; padding: 0.5rem 0.75rem; border-radius: var(--radius-md); font-size: 0.8rem; font-weight: 700; }
.ex-set-status--pos { background: #ECFDF5; color: #065F46; }
.ex-set-status--neg { background: #FEF2F2; color: #991B1B; }
.ex-set-status--zero { background: var(--bg-input); color: var(--text-muted); }
.ex-set-foot { display: flex; justify-content: flex-end; margin-top: 0.85rem; }
.ex-set-error { padding: 1.5rem 1rem; text-align: center; font-size: 0.82rem; font-weight: 600; color: #DC2626; }
@media (max-width: 720px) { .ex-sal-tiles { grid-template-columns: repeat(2, 1fr); } }

/* ═══════════════════════════════════════════════════════════════════════════
   FLEET — driver avatar (initials circle with the uploaded photo laid on top), small helpers, focus rings
   ═══════════════════════════════════════════════════════════════════════════ */
.fleet-driver-avatar-wrap { position: relative; display: inline-block; width: 38px; height: 38px; flex-shrink: 0; }
.fleet-driver-avatar-wrap .fleet-driver-avatar { position: absolute; inset: 0; width: 38px; height: 38px; background: #fff; }
.fleet-none { color: var(--text-dimmed); }
.fleet-act-btn:focus-visible,
.fleet-act-del:focus-visible,
.fleet-copy-btn:focus-visible,
.fleet-collapse-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* FLEET — driver name never truncated to "S…": ownership badge sits on its own line under the name */
.fleet-driver-name-wrap .fleet-driver-name {
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}
.fleet-driver-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.2rem;
    min-width: 0;
}
.fleet-driver-meta .fleet-driver-subtext { margin-top: 0; }
.fleet-driver-meta .fleet-ownership-badge {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fleet-collapse-note {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* FLEET — collapsible vehicle categories */
button.fleet-cat-toggle {
    width: 100%;
    background: none;
    border: 0;
    padding: 0.25rem 0;
    cursor: pointer;
    text-align: left;
    font: inherit;
    border-radius: 8px;
}
button.fleet-cat-toggle:hover .fleet-category-title { color: var(--primary, #1A73E8); }
button.fleet-cat-toggle:focus-visible { outline: 2px solid var(--primary, #1A73E8); outline-offset: 2px; }
button.fleet-cat-toggle:disabled { cursor: default; }
.fleet-cat-chevron { font-size: 0.7rem; color: var(--text-muted); width: 0.9rem; text-align: center; }
.fleet-cat-tools { display: flex; justify-content: flex-end; gap: 0.5rem; margin-bottom: 0.5rem; }
.fleet-cat-tool {
    background: none;
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 8px;
    padding: 0.25rem 0.7rem;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
}
.fleet-cat-tool:hover { color: var(--text-main); border-color: var(--text-muted); }
.fleet-cat-tool:focus-visible { outline: 2px solid var(--primary, #1A73E8); outline-offset: 2px; }

/* ═══════════════════════════════════════
   LIVE TRACKING & FLEET MAP - FULLSCREEN & ENRICHED TELEMETRY
   ═══════════════════════════════════════ */

/* Fullscreen Map Mode */
.fleet-map-container.map-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    z-index: 99999 !important;
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.fleet-map-container.map-fullscreen #map {
    height: 100% !important;
    min-height: 100vh !important;
}

/* Telemetry In-Panel Search & Filter Tabs */
.track-search-filter-wrap {
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.track-search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.track-search-box i.fa-magnifying-glass {
    position: absolute;
    left: 0.65rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    pointer-events: none;
}

.track-search-box input {
    width: 100%;
    padding: 0.45rem 2rem 0.45rem 1.85rem;
    font-size: 0.75rem;
    font-family: var(--font-family);
    background: var(--bg-input, #F8FAFC);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    transition: all var(--transition-fast);
}

.track-search-box input:focus {
    outline: none;
    border-color: var(--primary);
    background: #FFFFFF;
    box-shadow: var(--shadow-focus);
}

.track-clear-search-btn {
    position: absolute;
    right: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.track-clear-search-btn:hover {
    color: var(--text-main);
}

.track-filter-pills {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.track-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.22rem 0.55rem;
    font-size: 0.68rem;
    font-weight: 600;
    font-family: var(--font-family);
    background: var(--bg-input, #F1F5F9);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.track-filter-pill:hover {
    background: var(--bg-hover, #E2E8F0);
    color: var(--text-main);
}

.track-filter-pill.active {
    background: var(--primary);
    color: #FFFFFF;
    border-color: var(--primary);
    box-shadow: 0 1px 4px rgba(109, 40, 217, 0.25);
}

.track-filter-count {
    font-weight: 700;
    opacity: 0.85;
    font-size: 0.65rem;
}

/* Enriched Vehicle Cards in Sidebar (Kiro's dynamic renderer target) */
.track-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.track-card:hover {
    border-color: rgba(109, 40, 217, 0.35);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.track-card.selected {
    border-color: var(--primary);
    background: var(--primary-soft);
    box-shadow: 0 0 0 1.5px var(--primary);
}

.track-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.track-card-driver {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.track-driver-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    color: var(--text-main);
}

.track-driver-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.6rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.track-route-chip {
    padding: 0.3rem 0.5rem;
    background: var(--bg-input, #F8FAFC);
    border: 1px solid var(--border-light, #E2E8F0);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.track-route-endpoints {
    color: var(--primary);
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.track-trip-ref {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    flex-shrink: 0;
}

.track-telemetry-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.35rem;
    border-top: 1px solid var(--border-light, #F1F5F9);
    font-size: 0.72rem;
}

.track-speed-val {
    font-weight: 800;
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.track-speed-val.is-moving {
    color: #059669;
}

.track-fix-age {
    font-size: 0.65rem;
    color: var(--text-dimmed, #94A3B8);
}

.track-locate-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 700;
    font-family: var(--font-family);
    border-radius: var(--radius-sm);
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid rgba(109, 40, 217, 0.2);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.track-locate-btn:hover {
    background: var(--primary);
    color: #FFFFFF;
}

.copy-phone-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 9.5px;
    padding: 0;
}

.copy-phone-btn:hover {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: rgba(109, 40, 217, 0.3);
}


.track-idle-note {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0.45rem 0.6rem;
    background: var(--bg-input, #F8FAFC);
    border: 1px dashed var(--border-color, #E2E8F0);
    border-radius: var(--radius-sm);
    margin-top: 0.35rem;
}

.track-idle-btn {
    background: transparent;
    border: none;
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
    font-size: inherit;
    text-decoration: underline;
    padding: 0;
}
.track-idle-btn:hover {
    color: var(--primary-hover, #5B21B6);
}

/* Responsive Narrow-Width Adjustments */
@media (max-width: 768px) {
    .map-controls-container {
        left: 0.75rem;
        top: 0.5rem;
        right: 0.75rem;
    }
    .map-layer-selector {
        overflow-x: auto;
        max-width: calc(100% - 44px);
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    .telemetry-overlay {
        top: auto;
        bottom: 0.75rem;
        right: 0.75rem;
        left: 0.75rem;
        width: auto !important;
        max-width: none;
        max-height: 45vh;
    }
}

/* LIVE TRACKING — JS-rendered card pieces (vehicle-map-state.js) */
.track-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.track-status { font-size: 0.65rem; font-weight: 700; padding: 0.12rem 0.5rem; border-radius: 999px; white-space: nowrap; }
.track-status--Available  { background: var(--success-soft); color: #059669; }
.track-status--Dispatched { background: var(--warning-soft); color: #B45309; }
.track-status--EnRoute    { background: var(--primary-soft); color: var(--primary); }
.track-card-model { display: inline-flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; min-width: 0; font-weight: 600; color: var(--text-main); }
.track-card-driver { gap: 0.5rem; flex-wrap: wrap; }
.track-driver-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 9rem; }
.track-no-driver { font-style: italic; color: var(--text-dimmed, #94A3B8); }
.track-route-endpoints { min-width: 0; }
.track-telemetry-row { gap: 0.4rem; }
.track-empty { text-align: center; padding: 1rem; color: var(--text-muted); font-size: 0.8rem; }
/* LIVE TRACKING — brand chip shown only in fullscreen */
.map-fs-brand { display: none; }
.fleet-map-container.map-fullscreen .map-fs-brand {
    display: flex; align-items: center; gap: 0.55rem;
    position: absolute; left: 12px; bottom: 34px; z-index: 6;
    padding: 0.4rem 0.8rem 0.4rem 0.5rem;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(15, 23, 42, 0.08); border-radius: 12px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.15);
    pointer-events: none;
}
.map-fs-brand img { width: 26px; height: 26px; }
.map-fs-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.map-fs-brand-text strong { font-size: 0.82rem; color: var(--text-main); }
.map-fs-brand-text span { font-size: 0.62rem; color: var(--text-muted); }

/* ═══════════════════════════════════════
   TEAM & USER ROSTER MANAGEMENT (#teamTab)
   ═══════════════════════════════════════ */

.team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.team-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main, #0F172A);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.team-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted, #64748B);
    margin-top: 0.2rem;
    display: block;
}

.team-onboard-btn {
    background: #6D28D9;
    border: none;
    color: #FFFFFF;
    font-weight: 700;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.team-onboard-btn:hover {
    background: #5B21B6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(109, 40, 217, 0.25);
}

/* 4-Tile Role KPI Summary Strip */
.team-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.team-kpi-card {
    background: #FFFFFF;
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 72px;
}
.team-kpi-card--owner {
    background: #FAF5FF;
    border-color: #E9D5FF;
}
.team-kpi-card--admin {
    background: #EFF6FF;
    border-color: #DBEAFE;
}
.team-kpi-card--ops {
    background: #FDF4FF;
    border-color: #F5D0FE;
}

.team-kpi-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.team-kpi-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #64748B);
}
.team-kpi-card--owner .team-kpi-label { color: #7C3AED; }
.team-kpi-card--admin .team-kpi-label { color: #2563EB; }
.team-kpi-card--ops .team-kpi-label   { color: #A21CAF; }

.team-kpi-icon {
    font-size: 0.85rem;
    color: var(--text-muted, #94A3B8);
}
.team-kpi-card--owner .team-kpi-icon { color: #7C3AED; }
.team-kpi-card--admin .team-kpi-icon { color: #2563EB; }
.team-kpi-card--ops .team-kpi-icon   { color: #A21CAF; }

.team-kpi-val-row {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.team-kpi-val {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main, #0F172A);
    line-height: 1.2;
}
.team-kpi-card--owner .team-kpi-val { color: #4C1D95; }
.team-kpi-card--admin .team-kpi-val { color: #1E3A8A; }
.team-kpi-card--ops .team-kpi-val   { color: #701A75; }

.team-kpi-sub {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, #64748B);
}

/* Main Container */
.team-main-card {
    background: #FFFFFF;
    border-radius: 12px;
    border: 1px solid var(--border-color, #E2E8F0);
    padding: 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

/* Search & Role Filter Bar */
.team-search-filter-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.team-search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 240px;
    max-width: 440px;
}

.team-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: var(--text-muted, #94A3B8);
    pointer-events: none;
}

.team-search-box {
    width: 100%;
    padding: 0.55rem 2rem 0.55rem 2.2rem;
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-main, #0F172A);
    background: #F8FAFC;
    box-sizing: border-box;
    transition: all 0.15s ease;
}
.team-search-box:focus {
    background: #FFFFFF;
    border-color: #7C3AED;
    outline: none;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.team-search-clear {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted, #94A3B8);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.team-search-clear:hover {
    color: var(--text-main, #475569);
}

.team-filter-pills {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.team-filter-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted, #94A3B8);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 0.2rem;
}

.team-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 7px;
    font-size: 0.78rem;
    font-weight: 600;
    background: #F1F5F9;
    color: #475569;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}
.team-filter-pill:hover {
    background: #E2E8F0;
    color: #0F172A;
}
.team-filter-pill.active {
    background: #6D28D9;
    color: #FFFFFF;
    font-weight: 700;
    border-color: #6D28D9;
}
.team-filter-pill:disabled,
.team-filter-pill.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.team-filter-count {
    font-size: 0.72rem;
    opacity: 0.85;
    font-weight: 700;
}

/* User Cards Grid */
.team-users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

/* Team Card styling (for Kiro's dynamic renderer) */
.team-card {
    background: #FFFFFF;
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 12px;
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
    position: relative;
}
.team-card:hover {
    border-color: #C4B5FD;
    box-shadow: 0 4px 14px rgba(109, 40, 217, 0.08);
}

.team-card.inactive {
    background: #F8FAFC;
    border-color: #E2E8F0;
    opacity: 0.82;
}
.team-card.inactive .team-avatar-initials {
    background: #E2E8F0;
    color: #64748B;
}
.team-card.inactive .team-user-name {
    color: #475569;
}

.team-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.team-card-identity {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

/* Privacy-First Local Initials Avatar Circle */
.team-avatar-wrap {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
}
.team-avatar-initials {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    color: #6D28D9;
    background: #EDE9FE;
    border: 2px solid #FFFFFF;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.team-avatar-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #FFFFFF;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.team-card-meta {
    min-width: 0;
}

.team-user-name {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main, #0F172A);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

/* FontAwesome Role Badges */
.team-role-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    letter-spacing: 0.02em;
    margin-top: 0.2rem;
    white-space: nowrap;
}
.team-role-owner {
    background: #FAF5FF;
    color: #7C3AED;
    border: 1px solid #E9D5FF;
}
.team-role-admin {
    background: #EFF6FF;
    color: #2563EB;
    border: 1px solid #DBEAFE;
}
.team-role-manager {
    background: #FDF4FF;
    color: #A21CAF;
    border: 1px solid #F5D0FE;
}
.team-role-dispatcher {
    background: #ECFDF5;
    color: #059669;
    border: 1px solid #A7F3D0;
}

/* Active / Inactive Status Pills */
.team-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}
.team-status--active {
    background: #ECFDF5;
    color: #059669;
    border: 1px solid #A7F3D0;
}
.team-status--active .status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #10B981;
}
.team-status--inactive {
    background: #F1F5F9;
    color: #64748B;
    border: 1px solid #CBD5E1;
}

/* Contact Information Block */
.team-contact-box {
    font-size: 0.78rem;
    color: #475569;
    background: #F8FAFC;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    margin-bottom: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.team-contact-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.team-contact-val {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.team-contact-val i {
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}
.team-contact-val strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}
.team-contact-val.phone {
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    font-weight: 600;
    color: #334155;
}

.team-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    border: 1px solid #E2E8F0;
    background: #FFFFFF;
    color: #64748B;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.7rem;
    flex-shrink: 0;
}
.team-copy-btn:hover {
    background: #EDE9FE;
    color: #6D28D9;
    border-color: #C4B5FD;
}

/* Unified 32px Action Buttons */
.team-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    border-top: 1px solid #F1F5F9;
    padding-top: 0.65rem;
}

.team-act-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    height: 32px;
    padding: 0 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 7px;
    background: #EDE9FE;
    color: #6D28D9;
    border: 1px solid rgba(109, 40, 217, 0.2);
    cursor: pointer;
    transition: all 0.15s ease;
}
.team-act-btn:hover {
    background: #DDD6FE;
    color: #5B21B6;
}

.team-act-del {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 7px;
    background: #F8FAFC;
    color: #64748B;
    border: 1px solid #E2E8F0;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.75rem;
}
.team-act-del:hover {
    background: #FEE2E2;
    color: #DC2626;
    border-color: #FCA5A5;
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
    .team-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 520px) {
    .team-kpi-grid {
        grid-template-columns: 1fr;
    }
    .team-search-input-wrap {
        max-width: 100%;
    }
}

/* TEAM — full names and emails, never trimmed: they wrap instead of ending in "…" */
.team-card-meta { flex: 1; min-width: 0; }
.team-card-identity { flex: 1; min-width: 0; }
.team-card .team-user-name { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.25; }
.team-card .team-contact-val { white-space: normal; min-width: 0; align-items: flex-start; }
.team-card .team-contact-val i { margin-top: 0.15rem; }
.team-card .team-contact-val strong { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.team-card .team-status-pill { align-self: flex-start; }

/* ═══════════════════════════════════════════════════════════
   PHASE 7: CORPORATE CLIENTS & NEGOTIATED RATES POLISH
   Executive 4-tile KPI summary strip, polished toolbar with
   dynamic type pills, organization identity chips, GSTIN copy,
   and unified 32px action buttons.
   ═══════════════════════════════════════════════════════════ */

/* Header Bar & Subtitle */
.cc-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.cc-header-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.cc-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main, #0F172A);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    letter-spacing: -0.01em;
}

.cc-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted, #64748B);
    font-weight: 500;
}

/* 4-Tile Client Portfolio KPI Strip */
.cc-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.cc-kpi-card {
    background: #FFFFFF;
    border-radius: 10px;
    border: 1px solid var(--border-color, #E2E8F0);
    padding: 0.85rem 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cc-kpi-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    border-color: #CBD5E1;
}

.cc-kpi-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cc-kpi-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #64748B);
}
.cc-kpi-card--contracts .cc-kpi-label { color: #7C3AED; }
.cc-kpi-card--gst .cc-kpi-label       { color: #059669; }
.cc-kpi-card--mix .cc-kpi-label       { color: #A21CAF; }

.cc-kpi-icon {
    font-size: 0.85rem;
    color: var(--text-muted, #94A3B8);
}
.cc-kpi-card--contracts .cc-kpi-icon { color: #7C3AED; }
.cc-kpi-card--gst .cc-kpi-icon       { color: #059669; }
.cc-kpi-card--mix .cc-kpi-icon       { color: #A21CAF; }

.cc-kpi-val-row {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.cc-kpi-val {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main, #0F172A);
    line-height: 1.2;
}
.cc-kpi-card--contracts .cc-kpi-val { color: #4C1D95; }
.cc-kpi-card--gst .cc-kpi-val       { color: #065F46; }
.cc-kpi-card--mix .cc-kpi-val       { color: #701A75; font-size: 1rem; }

.cc-kpi-sub {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, #64748B);
}

/* Main Container & Top Card */
.cc-main-card {
    background: #FFFFFF;
    border-radius: 12px;
    border: 1px solid var(--border-color, #E2E8F0);
    padding: 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.cc-card-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cc-client-count {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted, #64748B);
    margin-left: 0.4rem;
}

.cc-add-client-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
}

/* Polished Toolbar */
.cc-toolbar {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 0.75rem 0.85rem;
    margin-bottom: 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.cc-toolbar-inputs {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cc-select-wrap {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.cc-select-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748B;
    white-space: nowrap;
}

.cc-company-select {
    padding: 0.45rem 0.65rem;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    font-size: 0.82rem;
    box-sizing: border-box;
    background: #FFFFFF;
    color: #1E293B;
    font-weight: 600;
    cursor: pointer;
    min-width: 170px;
    transition: all 0.15s ease;
}
.cc-company-select:focus {
    border-color: #7C3AED;
    outline: none;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.cc-search-wrap {
    position: relative;
    flex: 1;
    min-width: 220px;
}

.cc-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: #94A3B8;
    pointer-events: none;
}

.cc-search-box {
    width: 100%;
    padding: 0.5rem 2rem 0.5rem 2.2rem;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #0F172A;
    background: #FFFFFF;
    box-sizing: border-box;
    transition: all 0.15s ease;
}
.cc-search-box:focus {
    border-color: #7C3AED;
    outline: none;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.cc-search-clear {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94A3B8;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cc-search-clear:hover {
    color: #475569;
}

/* Dynamic Filter Pills Container (#ccTypePills) */
.cc-filter-pills {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.cc-filter-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 0.2rem;
}

.cc-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #FFFFFF;
    color: #475569;
    border: 1px solid #E2E8F0;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}
.cc-filter-pill:hover {
    background: #F1F5F9;
    color: #0F172A;
}
.cc-filter-pill.active,
.cc-filter-pill[aria-pressed="true"] {
    background: #6D28D9;
    color: #FFFFFF;
    font-weight: 700;
    border-color: #6D28D9;
}
.cc-filter-pill:disabled,
.cc-filter-pill.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cc-filter-count {
    font-size: 0.7rem;
    opacity: 0.85;
    font-weight: 700;
}

/* Elevated Table Shell */
.cc-table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    background: #FFFFFF;
}

.cc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    text-align: left;
}

.cc-table thead tr {
    background: #F8FAFC;
    border-bottom: 2px solid #E2E8F0;
}

.cc-table th {
    padding: 0.65rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
    white-space: nowrap;
}

.cc-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #F1F5F9;
    vertical-align: middle;
}

.cc-table tbody tr:hover {
    background: rgba(245, 243, 255, 0.5);
}

/* Client Identity, Avatars & Badges */
.client-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.78rem;
    font-family: inherit;
    background: #EDE9FE;
    color: #6D28D9;
    border: 1px solid #DDD6FE;
    flex-shrink: 0;
}

.company-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    vertical-align: middle;
    white-space: nowrap;
    letter-spacing: 0.01em;
}
.company-pill.diamond { background: #EDE9FE; color: #6D28D9; border: 1px solid #DDD6FE; }
.company-pill.ssk { background: #DBEAFE; color: #1D4ED8; border: 1px solid #BFDBFE; }
.company-pill.default { background: #F1F5F9; color: #475569; border: 1px solid #E2E8F0; }

/* GSTIN Chip & Copy Button */
.gstin-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    font-weight: 600;
    color: #334155;
    background: #F8FAFC;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
    border: 1px solid #E2E8F0;
    white-space: nowrap;
}

.gstin-state {
    font-weight: 800;
    color: #6D28D9;
}

.gstin-copy-btn,
.copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #CBD5E1;
    background: #FFFFFF;
    color: #64748B;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.68rem;
}
.gstin-copy-btn:hover,
.copy-btn:hover {
    background: #EDE9FE;
    color: #6D28D9;
    border-color: #C4B5FD;
}

.badge-no-gst {
    font-family: var(--font-mono, monospace);
    font-size: 0.7rem;
    color: #94A3B8;
    background: #F1F5F9;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    border: 1px solid #E2E8F0;
    font-style: italic;
    white-space: nowrap;
}

/* Client Type Badges */
.type-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    white-space: nowrap;
}
.type-pill.corporate { background: #EFF6FF; color: #2563EB; border: 1px solid #DBEAFE; }
.type-pill.agent { background: #FEF3C7; color: #B45309; border: 1px solid #FDE68A; }
.type-pill.personal { background: #ECFDF5; color: #059669; border: 1px solid #A7F3D0; }
.type-pill.inbound { background: #F3E8FF; color: #7E22CE; border: 1px solid #E9D5FF; }

/* Unified 32px Action Buttons */
.act-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    height: 32px;
    padding: 0 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    background: #EDE9FE;
    color: #6D28D9;
    border: 1px solid rgba(109, 40, 217, 0.2);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.act-btn:hover {
    background: #DDD6FE;
    color: #5B21B6;
}
.act-btn-secondary {
    background: #F8FAFC;
    color: #475569;
    border: 1px solid #E2E8F0;
}
.act-btn-secondary:hover {
    background: #F1F5F9;
    color: #0F172A;
}
.act-btn-del {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #F8FAFC;
    color: #64748B;
    border: 1px solid #E2E8F0;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.72rem;
}
.act-btn-del:hover {
    background: #FEE2E2;
    color: #DC2626;
    border-color: #FCA5A5;
}

/* Responsive Breakpoints for Corporate Tab */
@media (max-width: 900px) {
    .cc-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 520px) {
    .cc-kpi-grid {
        grid-template-columns: 1fr;
    }
    .cc-toolbar-inputs {
        flex-direction: column;
        align-items: stretch;
    }
    .cc-company-select {
        width: 100%;
    }
}

/* CORPORATE CLIENTS — JS-rendered row pieces (corporate-clients.js) */
.cc-client-cell { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.cc-client-main { min-width: 0; }
.cc-client-name { font-weight: 700; color: var(--text-main); overflow-wrap: anywhere; line-height: 1.3; }
.cc-client-pills { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.25rem; }
.client-avatar.is-agent { background: #FEF3C7; color: #B45309; border-color: #FDE68A; }
.cc-city { display: inline-flex; align-items: center; gap: 0.35rem; color: #475569; font-size: 0.82rem; }
.cc-city i { color: #94A3B8; font-size: 0.72rem; }
.cc-actions-cell { text-align: right; white-space: nowrap; }
.cc-actions-cell > * { margin-left: 0.3rem; }
.type-pill:not(.corporate):not(.agent):not(.personal):not(.inbound) { background: #F1F5F9; color: #475569; border: 1px solid #E2E8F0; }
.cc-filter-pill:focus-visible, .act-btn:focus-visible, .act-btn-del:focus-visible, .gstin-copy-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ═══════════════════════════════════════════════════════════
   PHASE 8: VENDORS & HIRED-CAR OPERATORS POLISH
   Executive 4-tile fleet summary strip, search toolbar with
   1-tap clear and bulk expand/collapse, accessible vendor
   accordion cards with initials avatars and fleet metric badges,
   HSRP plate badges, and unified 32px action buttons.
   ═══════════════════════════════════════════════════════════ */

/* Header Bar & Subtitle */
.vn-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.vn-header-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.vn-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main, #0F172A);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    letter-spacing: -0.01em;
}

.vn-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted, #64748B);
    font-weight: 500;
}

/* 4-Tile Fleet Summary Strip */
.vn-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.vn-kpi-card {
    background: #FFFFFF;
    border-radius: 10px;
    border: 1px solid var(--border-color, #E2E8F0);
    padding: 0.85rem 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.vn-kpi-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    border-color: #CBD5E1;
}

.vn-kpi-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vn-kpi-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #64748B);
}
.vn-kpi-card--vehicles .vn-kpi-label { color: #1D4ED8; }
.vn-kpi-card--drivers .vn-kpi-label  { color: #047857; }
.vn-kpi-card--cities .vn-kpi-label   { color: #7C3AED; }

.vn-kpi-icon {
    font-size: 0.85rem;
    color: var(--text-muted, #94A3B8);
}
.vn-kpi-card--vehicles .vn-kpi-icon { color: #1D4ED8; }
.vn-kpi-card--drivers .vn-kpi-icon  { color: #047857; }
.vn-kpi-card--cities .vn-kpi-icon   { color: #7C3AED; }

.vn-kpi-val-row {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.vn-kpi-val {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main, #0F172A);
    line-height: 1.2;
}
.vn-kpi-card--vehicles .vn-kpi-val { color: #1E3A8A; }
.vn-kpi-card--drivers .vn-kpi-val  { color: #065F46; }
.vn-kpi-card--cities .vn-kpi-val   { color: #4C1D95; }

.vn-kpi-sub {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, #64748B);
}

/* Main Container & Top Card */
.vn-main-card {
    background: #FFFFFF;
    border-radius: 12px;
    border: 1px solid var(--border-color, #E2E8F0);
    padding: 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.vn-card-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.vn-top-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.vn-vendor-count {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted, #64748B);
    background: #F1F5F9;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    border: 1px solid #E2E8F0;
}

.vn-top-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.vn-toggle-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    font-size: 0.78rem;
    cursor: pointer;
}

.vn-add-vendor-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
}

/* Polished Toolbar */
.vn-toolbar {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 0.75rem 0.85rem;
    margin-bottom: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.vn-search-wrap {
    position: relative;
    width: 100%;
}

.vn-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: #94A3B8;
    pointer-events: none;
}

.vn-search-box {
    width: 100%;
    padding: 0.5rem 2rem 0.5rem 2.2rem;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #0F172A;
    background: #FFFFFF;
    box-sizing: border-box;
    transition: all 0.15s ease;
}
.vn-search-box:focus {
    border-color: #7C3AED;
    outline: none;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.vn-search-clear {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94A3B8;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.vn-search-clear:hover {
    color: #475569;
}

/* Dynamic Filter Pills Container (#vnFilterPills) */
.vn-filter-pills {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.vn-filter-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 0.2rem;
}

.vn-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #FFFFFF;
    color: #475569;
    border: 1px solid #E2E8F0;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}
.vn-filter-pill:hover {
    background: #F1F5F9;
    color: #0F172A;
}
.vn-filter-pill.active,
.vn-filter-pill[aria-pressed="true"] {
    background: #6D28D9;
    color: #FFFFFF;
    font-weight: 700;
    border-color: #6D28D9;
}
.vn-filter-pill:disabled,
.vn-filter-pill.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.vn-filter-count {
    font-size: 0.7rem;
    opacity: 0.85;
    font-weight: 700;
}

.vn-instruction-note {
    font-size: 0.75rem;
    color: #64748B;
    margin: 0 0 0.85rem;
    font-weight: 500;
}

/* Vendor Accordion Card Structure */
.vn-card {
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    overflow: hidden;
    background: #FFFFFF;
    transition: all 0.2s ease;
}
.vn-card:hover {
    border-color: #CBD5E1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}
.vn-card.is-expanded {
    border-color: #8B5CF6;
    box-shadow: 0 6px 18px rgba(109, 40, 217, 0.08);
}

.vn-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #F8FAFC;
    transition: background 0.15s ease;
}
.vn-card:hover .vn-card-header {
    background: #F1F5F9;
}
.vn-card.is-expanded .vn-card-header {
    background: rgba(245, 243, 255, 0.6);
    border-bottom: 1px solid #F1F5F9;
}

/* Accessibility: Card Header Button (holding identity) */
.vn-card-header-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    color: inherit;
}
.vn-card-header-btn:focus-visible {
    outline: 2px solid #7C3AED;
    outline-offset: 4px;
    border-radius: 6px;
}

.vn-chev {
    color: #64748B;
    width: 14px;
    font-size: 0.8rem;
    transition: transform 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}
.vn-card.is-expanded .vn-chev {
    color: #6D28D9;
}

/* Vendor Avatar Initials */
.vn-avatar {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.82rem;
    font-family: inherit;
    background: #EDE9FE;
    color: #6D28D9;
    border: 1px solid #DDD6FE;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}
.vn-card:hover .vn-avatar {
    transform: scale(1.04);
}

.vn-card-meta {
    flex: 1;
    min-width: 0;
}

.vn-card-title-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.vn-vendor-name {
    font-weight: 800;
    color: #0F172A;
    font-size: 0.92rem;
    line-height: 1.25;
}

.vn-card-badges-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.25rem;
    flex-wrap: wrap;
}

/* Badges for City, Fleet, Drivers, GST, Blocked */
.vn-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.vn-badge--fleet {
    background: #EFF6FF;
    color: #1D4ED8;
    border: 1px solid #DBEAFE;
}
.vn-badge--driver {
    background: #F0FDF4;
    color: #15803D;
    border: 1px solid #DCFCE7;
}
.vn-badge--city {
    background: #F8FAFC;
    color: #475569;
    border: 1px solid #E2E8F0;
}
.vn-badge--gst {
    background: #FAF5FF;
    color: #7E22CE;
    border: 1px solid #F3E8FF;
    font-family: var(--font-mono, monospace);
}

.vn-chip-blocked {
    background: #FEE2E2;
    color: #DC2626;
    border: 1px solid #FCA5A5;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

/* Card Actions (sitting alongside the header button) */
.vn-card-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

/* Expanded Asset Panel */
.vn-expanded-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1rem;
    border-top: 1px solid #F1F5F9;
    background: #FFFFFF;
}

.vn-expanded-col {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.vn-col-header {
    font-size: 0.72rem;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid #F1F5F9;
    margin-bottom: 0.2rem;
}

.vn-vehicle-item,
.vn-driver-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
    background: #F8FAFC;
    border: 1px solid #F1F5F9;
    font-size: 0.78rem;
    color: #334155;
    transition: background 0.15s ease;
}
.vn-vehicle-item:hover,
.vn-driver-item:hover {
    background: #F1F5F9;
}

.vn-driver-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #EDE9FE;
    color: #6D28D9;
    font-weight: 800;
    font-size: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Responsive Breakpoints for Vendors Tab */
@media (max-width: 900px) {
    .vn-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .vn-expanded-panel {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 520px) {
    .vn-kpi-grid {
        grid-template-columns: 1fr;
    }
    .vn-card-header {
        flex-direction: column;
        align-items: stretch;
    }
    .vn-card-actions {
        justify-content: flex-end;
        padding-top: 0.4rem;
        border-top: 1px dashed #E2E8F0;
    }
}

/* VENDORS — JS-rendered pieces (vendors.js) */
.vn-card-header-btn .vn-card-meta { display: block; text-align: left; }
.vn-card-header-btn .vn-card-title-row, .vn-card-header-btn .vn-card-badges-row { flex-wrap: wrap; }
.vn-vendor-name { overflow-wrap: anywhere; }
.vn-empty { text-align: center; padding: 2rem; color: #94A3B8; font-size: 0.85rem; }
.vn-none { font-size: 0.76rem; color: #94A3B8; padding: 0.3rem 0.5rem; }
.vn-asset-main { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.vn-asset-name { font-weight: 600; color: #0F172A; overflow-wrap: anywhere; }
.vn-cat-pill { font-size: 0.66rem; font-weight: 700; padding: 0.1rem 0.45rem; border-radius: 6px; background: #EFF6FF; color: #1D4ED8; border: 1px solid #DBEAFE; white-space: nowrap; flex-shrink: 0; }
.vn-phone-wrap { display: inline-flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.vn-phone { font-family: var(--font-mono, monospace); font-size: 0.74rem; color: #475569; white-space: nowrap; }
.vn-filter-pill:focus-visible, .vn-card-actions .act-btn:focus-visible, .vn-card-actions .act-btn-del:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* VENDORS — more-cities picker next to the city pills */
.vn-city-select { padding: 0.28rem 0.5rem; border: 1px solid #CBD5E1; border-radius: 999px; background: #FFFFFF; color: #475569; font-size: 0.74rem; font-weight: 600; cursor: pointer; }
.vn-city-select:hover { border-color: #A78BFA; color: #0F172A; }
.vn-city-select:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ═══════════════════════════════════════════════════════════
   SETUP — CONFIGURE ONCE & VEHICLE TYPES (Phase 9)
   ═══════════════════════════════════════════════════════════ */

.setup-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.setup-header-info {
    display: flex;
    flex-direction: column;
}

.setup-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main, #0F172A);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.setup-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted, #64748B);
    margin-top: 0.2rem;
    display: block;
}

.setup-subtabs-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    align-items: center;
}

.setup-subtabs-nav .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.78rem;
    padding: 0.45rem 0.85rem;
    transition: all 0.15s ease;
}

.setup-subtabs-nav .btn-primary {
    background: var(--primary, #6D28D9);
    border-color: var(--primary, #6D28D9);
    color: #FFFFFF;
    box-shadow: 0 1px 3px rgba(109, 40, 217, 0.25);
}

.setup-subtabs-nav .btn-secondary {
    background: #F1F5F9;
    border-color: #E2E8F0;
    color: #475569;
}

.setup-subtabs-nav .btn-secondary:hover {
    background: #E2E8F0;
    color: #0F172A;
}

/* Vehicle Types Main Panel */
.vt-main-panel {
    padding: 1.25rem;
}

/* 4-Tile Category Summary Strip */
.vt-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.vt-kpi-card {
    background: #FFFFFF;
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: border-color 0.15s ease;
}

.vt-kpi-card:hover {
    border-color: #CBD5E1;
}

.vt-kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vt-kpi-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748B;
}

.vt-kpi-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0F172A;
    line-height: 1.2;
    margin: 0.2rem 0;
}

.vt-kpi-sub {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748B;
}

/* Vehicle Types Section Header */
.vt-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.vt-section-title-wrap {
    display: flex;
    flex-direction: column;
}

.vt-section-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0F172A;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.vt-section-desc {
    font-size: 0.76rem;
    color: #64748B;
    margin: 0.15rem 0 0;
}

/* Quick Entry / Edit Form Card */
.vt-form-card {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.25rem;
}

.vt-form-header {
    margin-bottom: 0.65rem;
}

.vt-form-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.vt-form-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 0.75rem;
    align-items: end;
}

.vt-field-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.vt-field-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #475569;
}

.vt-input {
    width: 100%;
    padding: 0.45rem 0.65rem;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    font-size: 0.8rem;
    background: #FFFFFF;
    color: #0F172A;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.vt-input:focus {
    outline: none;
    border-color: var(--primary, #6D28D9);
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.15);
}

.vt-form-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.vt-btn-save {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    height: 34px;
    padding: 0 1rem;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 8px;
    white-space: nowrap;
}

.vt-btn-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    height: 34px;
    padding: 0 0.85rem;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 8px;
    background: #E2E8F0;
    color: #334155;
    border: 1px solid #CBD5E1;
    white-space: nowrap;
}

.vt-btn-cancel:hover {
    background: #CBD5E1;
    color: #0F172A;
}

/* Modernized Table Container */
.vt-table-container {
    overflow-x: auto;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    background: #FFFFFF;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.vt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.vt-table th {
    background: #F8FAFC;
    border-bottom: 2px solid #E2E8F0;
    padding: 0.75rem 1rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
}

.vt-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #F1F5F9;
    color: #0F172A;
    vertical-align: middle;
}

.vt-table tbody tr:hover {
    background: rgba(248, 250, 252, 0.8);
}

.vt-th-name { text-align: left; }
.vt-th-seating { text-align: left; }
.vt-th-order { text-align: center; }
.vt-th-actions { text-align: right; }

/* Category Icon Badge */
.vt-icon-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    background: #EDE9FE;
    color: #6D28D9;
    border: 1px solid #DDD6FE;
    flex-shrink: 0;
}

/* Seating Capacity Pill */
.vt-seat-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 700;
    background: #F0FDF4;
    color: #166534;
    border: 1px solid #BBF7D0;
    white-space: nowrap;
}

.vt-seat-pill.large {
    background: #EFF6FF;
    color: #1E40AF;
    border-color: #BFDBFE;
}

/* Display Order Chip */
.vt-order-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    font-weight: 700;
    background: #F8FAFC;
    color: #475569;
    border: 1px solid #E2E8F0;
    min-width: 28px;
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
    .vt-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .vt-kpi-grid {
        grid-template-columns: 1fr;
    }
    .vt-form-grid {
        grid-template-columns: 1fr;
    }
    .vt-form-actions {
        justify-content: flex-end;
    }
}

/* ═══════════════════════════════════════════════════════════
   SETUP — DEFAULT PACKAGES (Phase 10)
   ═══════════════════════════════════════════════════════════ */

/* Packages Main Panel */
.pkg-main-panel {
    padding: 1.25rem;
}

/* 4-Tile Category & Tariff Strip */
.pkg-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.pkg-kpi-card {
    background: #FFFFFF;
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: border-color 0.15s ease;
}

.pkg-kpi-card:hover {
    border-color: #CBD5E1;
}

.pkg-kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pkg-kpi-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748B;
}

.pkg-kpi-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0F172A;
    line-height: 1.2;
    margin: 0.2rem 0;
}

.pkg-kpi-sub {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748B;
}

/* Section Header */
.pkg-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pkg-section-title-wrap {
    display: flex;
    flex-direction: column;
}

.pkg-section-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0F172A;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.pkg-section-desc {
    font-size: 0.76rem;
    color: #64748B;
    margin: 0.15rem 0 0;
}

/* Toolbar */
.pkg-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
}

.pkg-toolbar-left,
.pkg-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.pkg-count-badge {
    font-size: 0.74rem;
    font-weight: 700;
    color: #64748B;
}

.pkg-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 220px;
}

.pkg-search-wrap i.search-icon {
    position: absolute;
    left: 10px;
    color: #94A3B8;
    font-size: 12px;
    pointer-events: none;
}

.pkg-search-input {
    width: 100%;
    padding: 0.38rem 1.8rem 0.38rem 2rem;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    font-size: 0.78rem;
    background: #FFFFFF;
    color: #0F172A;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.pkg-search-input:focus {
    outline: none;
    border-color: var(--primary, #6D28D9);
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.12);
}

.pkg-clear-btn {
    position: absolute;
    right: 8px;
    color: #94A3B8;
    font-size: 12px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.pkg-clear-btn:hover {
    color: #475569;
}

.pkg-filter-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pkg-filter-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748B;
    text-transform: uppercase;
}

.pkg-filter-select {
    padding: 0.38rem 0.65rem;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    font-size: 0.78rem;
    background: #FFFFFF;
    color: #0F172A;
    font-weight: 600;
}

.pkg-filter-select:focus {
    outline: none;
    border-color: var(--primary, #6D28D9);
}

/* Category Pills (Taxonomy) */
.pkg-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.18rem 0.55rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.pkg-cat-local {
    background: #ECFDF5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.pkg-cat-intercity {
    background: #EFF6FF;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

.pkg-cat-monthly {
    background: #FDF2F8;
    color: #9D174D;
    border: 1px solid #FBCFE8;
}

.pkg-cat-outstation {
    background: #FAF5FF;
    color: #6B21A8;
    border: 1px solid #E9D5FF;
}

.pkg-cat-return {
    background: #FFFBEB;
    color: #92400E;
    border: 1px solid #FDE68A;
}

.pkg-cat-default {
    background: #F1F5F9;
    color: #475569;
    border: 1px solid #E2E8F0;
}

/* Rates Set Status Badge */
.pkg-rates-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
}

.pkg-rates-pill.active {
    background: #F0FDF4;
    color: #166534;
    border: 1px solid #BBF7D0;
}

.pkg-rates-pill.empty {
    background: #F8FAFC;
    color: #94A3B8;
    border: 1px solid #E2E8F0;
}

/* Table */
.pkg-table-container {
    overflow-x: auto;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    background: #FFFFFF;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.pkg-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.pkg-table th {
    background: #F8FAFC;
    border-bottom: 2px solid #E2E8F0;
    padding: 0.75rem 1rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
}

.pkg-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #F1F5F9;
    color: #0F172A;
    vertical-align: middle;
}

.pkg-table tbody tr:hover {
    background: rgba(248, 250, 252, 0.8);
}

.pkg-th-name { text-align: left; }
.pkg-th-cat { text-align: left; }
.pkg-th-order { text-align: center; }
.pkg-th-rates { text-align: left; }
.pkg-th-actions { text-align: right; }

/* ═══════════════════════════════════════════════════════════
   STANDALONE MODAL SYSTEM (Body-Reparented Safe)
   ═══════════════════════════════════════════════════════════ */

.omni-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2vh 2vw;
}

.omni-modal-dialog {
    background: #FFFFFF;
    border-radius: 14px;
    width: min(1060px, 98vw);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.3);
    border: 1px solid #E2E8F0;
    animation: omniModalIn 0.18s ease-out;
}

@keyframes omniModalIn {
    from { opacity: 0; transform: scale(0.97) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.omni-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #E2E8F0;
    background: #FFFFFF;
}

.omni-modal-title {
    font-size: 0.98rem;
    font-weight: 800;
    color: #0F172A;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.omni-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    color: #64748B;
    padding: 2px 6px;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}

.omni-modal-close:hover {
    color: #0F172A;
    background: #F1F5F9;
}

.omni-modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    background: #FFFFFF;
}

.omni-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 12px 20px;
    border-top: 1px solid #E2E8F0;
    background: #F8FAFC;
}

/* Package Modal Form Fields */
.pkg-modal-form-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 0.75rem;
    align-items: start;
    margin-bottom: 1rem;
}

.pkg-modal-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.pkg-modal-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #475569;
}

.pkg-modal-input,
.pkg-modal-select {
    width: 100%;
    padding: 0.45rem 0.65rem;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    font-size: 0.8rem;
    background: #FFFFFF;
    color: #0F172A;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.pkg-modal-input:focus,
.pkg-modal-select:focus {
    outline: none;
    border-color: var(--primary, #6D28D9);
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.12);
}

.pkg-modal-hint {
    font-size: 0.66rem;
    color: #94A3B8;
    line-height: 1.3;
}

.pkg-modal-rates-header {
    margin: 0.75rem 0 0.5rem;
}

.pkg-modal-rates-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* ═══════════════════════════════════════════════════════════
   STANDALONE VEHICLE-TYPE RATE MATRIX GRID (Shared Helper Safe)
   ═══════════════════════════════════════════════════════════ */

.rate-grid-container {
    overflow-x: auto;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    background: #FFFFFF;
}

.rate-grid-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.74rem;
}

.rate-grid-table th {
    background: #F8FAFC;
    border-bottom: 2px solid #E2E8F0;
    padding: 0.45rem 0.5rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
    white-space: nowrap;
}

.rate-grid-table td {
    padding: 0.3rem 0.4rem;
    border-bottom: 1px solid #F1F5F9;
    color: #0F172A;
    vertical-align: middle;
}

.rate-grid-table tbody tr:hover {
    background: #F8FAFC;
}

.rate-grid-table input[type="number"] {
    width: 74px !important;
    padding: 0.32rem 0.45rem !important;
    border: 1px solid #CBD5E1 !important;
    border-radius: 6px !important;
    font-size: 0.74rem !important;
    box-sizing: border-box !important;
    text-align: right !important;
    background: #FFFFFF !important;
    color: #0F172A !important;
    font-family: var(--font-mono, monospace) !important;
    transition: all 0.15s ease !important;
}

.rate-grid-table input[type="number"]:focus {
    outline: none !important;
    border-color: var(--primary, #6D28D9) !important;
    box-shadow: 0 0 0 2px rgba(109, 40, 217, 0.15) !important;
}

.rate-grid-table input[type="checkbox"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 16px !important;
    height: 16px !important;
    border: 1.5px solid #CBD5E1 !important;
    border-radius: 4px !important;
    background-color: #FFFFFF !important;
    cursor: pointer !important;
    display: inline-grid !important;
    place-content: center !important;
    margin: 0 auto !important;
    vertical-align: middle !important;
    transition: all 0.15s ease !important;
}

.rate-grid-table input[type="checkbox"]:hover {
    border-color: #94A3B8 !important;
    background-color: #F8FAFC !important;
}

.rate-grid-table input[type="checkbox"]:checked {
    background-color: var(--primary, #6D28D9) !important;
    border-color: var(--primary, #6D28D9) !important;
}

.rate-grid-table input[type="checkbox"]:checked::before {
    content: "" !important;
    width: 8px !important;
    height: 5px !important;
    border-left: 2px solid #FFFFFF !important;
    border-bottom: 2px solid #FFFFFF !important;
    transform: rotate(-45deg) translate(1px, -1px) !important;
}

.rate-grid-table input[type="checkbox"]:focus {
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(109, 40, 217, 0.2) !important;
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
    .pkg-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .pkg-kpi-grid {
        grid-template-columns: 1fr;
    }
    .pkg-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .pkg-toolbar-right {
        flex-direction: column;
        align-items: stretch;
    }
    .pkg-search-wrap {
        width: 100%;
    }
    .pkg-modal-form-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════
   SETUP — VENDOR PACKAGES (Phase 11 Master Polish)
   Central vendor-rate master by city/zone & vehicle type
   ═══════════════════════════════════════════════════════════ */
.vp-main-panel {
    padding: 1.5rem;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.04);
}

/* 4-Tile Tariff KPI Summary Strip */
.vp-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.vp-kpi-card {
    background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFC 100%);
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 1rem 1.15rem;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.vp-kpi-card:hover {
    border-color: #C4B5FD;
    box-shadow: 0 4px 12px -2px rgba(109, 40, 217, 0.08);
}

.vp-kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.vp-kpi-label {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748B;
}

.vp-kpi-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.76rem;
    background: #F1F5F9;
    color: #475569;
}

.vp-kpi-icon.text-emerald {
    background: #ECFDF5;
    color: #059669;
}

.vp-kpi-icon.text-blue {
    background: #EFF6FF;
    color: #2563EB;
}

.vp-kpi-icon.text-purple {
    background: #F5F3FF;
    color: #7C3AED;
}

.vp-kpi-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0F172A;
    line-height: 1.1;
    margin-bottom: 0.25rem;
    font-variant-numeric: tabular-nums;
}

.vp-kpi-sub {
    font-size: 0.72rem;
    font-weight: 500;
    color: #64748B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vp-kpi-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.vp-bar-total {
    background: linear-gradient(90deg, #6D28D9, #4F46E5);
}

.vp-bar-cat1 {
    background: linear-gradient(90deg, #10B981, #059669);
}

.vp-bar-cat2 {
    background: linear-gradient(90deg, #3B82F6, #2563EB);
}

.vp-bar-zones {
    background: linear-gradient(90deg, #8B5CF6, #6D28D9);
}

/* Section Header */
.vp-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.vp-section-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0F172A;
    margin: 0 0 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.vp-section-subtitle {
    font-size: 0.78rem;
    color: #64748B;
    margin: 0;
}

/* Search Toolbar */
.vp-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.vp-toolbar-left {
    flex: 1;
    min-width: 240px;
}

.vp-search-wrap {
    position: relative;
    max-width: 420px;
}

.vp-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.76rem;
    color: #94A3B8;
    pointer-events: none;
}

.vp-search-input {
    width: 100%;
    padding: 0.45rem 2rem 0.45rem 2.1rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: #0F172A;
    background: #FFFFFF !important;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    outline: none;
    transition: all 0.15s ease;
}

.vp-search-input:focus {
    border-color: var(--primary, #6D28D9);
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.12);
}

.vp-clear-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94A3B8;
    cursor: pointer;
    font-size: 0.76rem;
    padding: 0.25rem;
    border-radius: 4px;
    line-height: 1;
}

.vp-clear-btn:hover {
    color: #0F172A;
    background: #F1F5F9;
}

.vp-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.vp-filter-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.vp-filter-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.vp-filter-select {
    padding: 0.45rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
    background: #FFFFFF !important;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    cursor: pointer;
    outline: none;
    transition: all 0.15s ease;
}

.vp-filter-select:focus {
    border-color: var(--primary, #6D28D9);
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.12);
}

.vp-add-btn {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* Modal Form Grid */
.vp-modal-form-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 0.75rem;
    align-items: start;
    margin-bottom: 1.25rem;
}

.vp-col-name { grid-column: span 1; }
.vp-col-cat { grid-column: span 1; }
.vp-col-sort { grid-column: span 1; }

/* City / Zone Tariff Overrides in Modal */
.vp-zone-section-header {
    margin: 1.25rem 0 0.5rem 0;
}

.vp-zone-section-title {
    font-size: 0.8rem;
    font-weight: 800;
    color: #0F172A;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.vp-zone-section-sub {
    font-size: 0.7rem;
    color: #64748B;
    margin-top: 0.15rem;
}

.vp-zone-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 0.85rem;
}

.vp-zone-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid #E2E8F0;
    background: #FFFFFF;
    color: #334155;
}

.vp-zone-chip:hover {
    border-color: #C4B5FD;
    background: #F5F3FF;
    color: #6D28D9;
}

.vp-zone-chip.active,
.vp-zone-chip[aria-pressed="true"] {
    background: #4F46E5 !important;
    color: #FFFFFF !important;
    border-color: #4F46E5 !important;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.25);
}

.vp-add-zone-box {
    display: grid;
    grid-template-columns: 2fr 2fr auto;
    gap: 0.6rem;
    align-items: end;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
}

.vp-add-zone-field {
    display: flex;
    flex-direction: column;
}

.vp-add-zone-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748B;
    margin-bottom: 0.25rem;
}

.vp-add-zone-select,
.vp-add-zone-input {
    width: 100%;
    padding: 0.42rem 0.6rem;
    font-size: 0.76rem;
    background: #FFFFFF !important;
    color: #0F172A !important;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    box-sizing: border-box;
}

.vp-add-zone-btn {
    padding: 0.45rem 0.85rem;
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
}

.vp-modal-rates-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0.5rem 0 0.5rem 0;
}

.vp-modal-rates-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Modernized Table */
.vp-table-container {
    overflow-x: auto;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    background: #FFFFFF;
}

.vp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.vp-table thead tr {
    background: #F8FAFC;
    border-bottom: 2px solid #E2E8F0;
}

.vp-table th {
    padding: 0.65rem 0.85rem;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #475569;
    white-space: nowrap;
}

.vp-th-name { text-align: left; }
.vp-th-cat { text-align: left; }
.vp-th-order { text-align: left; }
.vp-th-zones { text-align: left; }
.vp-th-actions { text-align: right; }

.vp-table td {
    padding: 0.65rem 0.85rem;
    color: #1E293B;
    vertical-align: middle;
}

.vp-table tbody tr {
    border-bottom: 1px solid #F1F5F9;
    transition: background-color 0.15s ease;
}

.vp-table tbody tr:hover {
    background-color: #F8FAFC;
}

.vp-table tbody tr:last-child {
    border-bottom: none;
}

.vp-table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 1rem;
    background: #F8FAFC;
    border-top: 1px solid #E2E8F0;
}

.vp-showing-count {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748B;
}

/* Category Taxonomy Pills */
.vp-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}

.vp-cat-local {
    background: #ECFDF5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.vp-cat-intercity {
    background: #EFF6FF;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

.vp-cat-monthly {
    background: #F0FDFA;
    color: #0F766E;
    border: 1px solid #99F6E4;
}

.vp-cat-outstation {
    background: #FAF5FF;
    color: #6B21A8;
    border: 1px solid #E9D5FF;
}

.vp-cat-return {
    background: #FFFBEB;
    color: #92400E;
    border: 1px solid #FDE68A;
}

/* Zone Set Status Pills */
.vp-zone-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.vp-zone-pill.active {
    background: #F5F3FF;
    color: #5B21B6;
    border: 1px solid #DDD6FE;
}

.vp-zone-pill.empty {
    background: #F8FAFC;
    color: #94A3B8;
    border: 1px solid #E2E8F0;
}

/* Display Order Pill */
.vp-order-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 5px;
    font-family: var(--font-mono, monospace);
    font-size: 0.7rem;
    font-weight: 700;
    background: #F8FAFC;
    color: #475569;
    border: 1px solid #E2E8F0;
    min-width: 28px;
}

/* Unified 32px Action Buttons */
.vp-act-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 32px;
    padding: 0 10px;
    border-radius: 7px;
    font-size: 0.72rem;
    font-weight: 600;
    background: #F8FAFC;
    color: #475569;
    border: 1px solid #E2E8F0;
    cursor: pointer;
    transition: all 0.15s ease;
}

.vp-act-btn:hover:not(:disabled) {
    background: #EDE9FE;
    color: #6D28D9;
    border-color: #C4B5FD;
}

.vp-act-del {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 7px;
    font-size: 0.72rem;
    background: #F8FAFC;
    color: #94A3B8;
    border: 1px solid #E2E8F0;
    cursor: pointer;
    transition: all 0.15s ease;
}

.vp-act-del:hover:not(:disabled) {
    background: #FEF2F2;
    color: #DC2626;
    border-color: #FECACA;
}

.vp-act-del:disabled,
.vp-act-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: #F8FAFC !important;
    color: #CBD5E1 !important;
    border-color: #E2E8F0 !important;
    box-shadow: none !important;
}

/* Responsive Breakpoints for Vendor Packages */
@media (max-width: 900px) {
    .vp-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .vp-add-zone-box {
        grid-template-columns: 1fr 1fr;
    }
    .vp-add-zone-btn-wrap {
        grid-column: span 2;
    }
}

@media (max-width: 640px) {
    .vp-kpi-grid {
        grid-template-columns: 1fr;
    }
    .vp-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .vp-toolbar-right {
        flex-direction: column;
        align-items: stretch;
    }
    .vp-search-wrap {
        max-width: 100%;
    }
    .vp-modal-form-grid {
        grid-template-columns: 1fr;
    }
    .vp-add-zone-box {
        grid-template-columns: 1fr;
    }
    .vp-add-zone-btn-wrap {
        grid-column: span 1;
    }
}

/* ==========================================================================
   Phase 12: Setup — Billing Companies Tokens & Components
   ========================================================================== */

/* 4-Tile Summary Strip inside #setupIcPanel */
.ic-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.ic-kpi-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: all 0.15s ease;
}

.ic-kpi-card:hover {
    border-color: #CBD5E1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.ic-kpi-val {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0F172A;
    font-family: Inter, system-ui, sans-serif;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    margin-bottom: 0.25rem;
}

.ic-kpi-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ic-kpi-sub {
    font-size: 0.68rem;
    font-weight: 500;
    color: #94A3B8;
    margin-top: 0.15rem;
}

/* Toolbar & Search Bar */
.ic-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
}

.ic-toolbar-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ic-toolbar-title {
    font-size: 0.72rem;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ic-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.ic-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 280px;
    max-width: 380px;
}

.ic-search-wrap input {
    width: 100%;
    padding: 0.42rem 2rem 0.42rem 2.1rem;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 0.78rem;
    background: #FFFFFF;
    color: #0F172A;
    outline: none;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.ic-search-wrap input:focus {
    border-color: #7C3AED;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.ic-search-icon {
    position: absolute;
    left: 0.75rem;
    color: #94A3B8;
    font-size: 0.75rem;
    pointer-events: none;
}

.ic-clear-search-btn {
    position: absolute;
    right: 0.6rem;
    background: none;
    border: none;
    color: #94A3B8;
    cursor: pointer;
    padding: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.ic-clear-search-btn:hover {
    color: #475569;
}

/* Companies Table Container & Table */
.ic-table-container {
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    background: #FFFFFF;
    overflow: hidden;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.ic-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.ic-table th {
    background: #F8FAFC;
    padding: 0.65rem 0.85rem;
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid #E2E8F0;
    text-align: left;
}

.ic-table td {
    padding: 0.65rem 0.85rem;
    vertical-align: middle;
    border-bottom: 1px solid #F1F5F9;
    font-size: 0.78rem;
}

.ic-table tbody tr {
    transition: background 0.15s ease;
    cursor: pointer;
}

.ic-table tbody tr:hover {
    background: #F8FAFC;
}

.ic-table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0.85rem;
    background: #F8FAFC;
    border-top: 1px solid #E2E8F0;
    font-size: 0.72rem;
    color: #64748B;
}

/* Monogram, GSTIN, Status, Actions */
.ic-monogram {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #F3EBFC, #EDE9FE);
    color: #6D28D9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.72rem;
    border: 1px solid #DDD6FE;
    flex-shrink: 0;
}

.ic-gstin-pill {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.72rem;
    background: #F1F5F9;
    color: #334155;
    padding: 0.2rem 0.45rem;
    border-radius: 5px;
    border: 1px solid #E2E8F0;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.ic-status-active {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
    font-size: 0.72rem;
    color: #059669;
    background: #ECFDF5;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    border: 1px solid #A7F3D0;
}

.ic-status-inactive {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    font-size: 0.72rem;
    color: #64748B;
    background: #F1F5F9;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
}

.ic-act-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0 0.65rem;
    height: 32px;
    border-radius: 7px;
    font-size: 0.72rem;
    font-weight: 700;
    background: #F3EBFC;
    color: #6D28D9;
    border: 1px solid #DDD6FE;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ic-act-btn:hover {
    background: #EDE9FE;
    color: #5B21B6;
    border-color: #C4B5FD;
}

.ic-act-del {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 7px;
    font-size: 0.72rem;
    background: #F8FAFC;
    color: #94A3B8;
    border: 1px solid #E2E8F0;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ic-act-del:hover {
    background: #FEF2F2;
    color: #DC2626;
    border-color: #FECACA;
}

/* Edit / Add Form Header */
.ic-form-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.95rem;
    background: #F3EBFC;
    border: 1px solid #C4B5FD;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.ic-form-header-badge {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: #DDD6FE;
    color: #6D28D9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    flex-shrink: 0;
}

.ic-form-header-title {
    font-weight: 800;
    font-size: 0.85rem;
    color: #5B21B6;
}

/* Section Cards */
.ic-section-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 1.15rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.ic-section-header {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid #F1F5F9;
}

.ic-section-badge {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: #EDE9FE;
    color: #6D28D9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    flex-shrink: 0;
}

.ic-section-title {
    font-size: 0.78rem;
    font-weight: 800;
    color: #1E293B;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0;
}

.ic-section-desc {
    font-size: 0.7rem;
    color: #64748B;
    margin-top: 0.15rem;
}

/* Form Grid & Inputs */
.ic-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 0.75rem;
}

.ic-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ic-field-span-2 {
    grid-column: span 2;
}

.ic-field-full {
    grid-column: 1 / -1;
}

.ic-label {
    font-size: 0.68rem;
    color: #64748B;
    font-weight: 700;
    display: block;
    margin-bottom: 0.25rem;
}

.ic-input {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 0.78rem;
    box-sizing: border-box;
    background: #FFFFFF;
    color: #0F172A;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.ic-input:focus {
    border-color: #7C3AED;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.ic-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.76rem;
    color: #334155;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.ic-checkbox {
    width: 16px;
    height: 16px;
    accent-color: #6D28D9;
    cursor: pointer;
}

.ic-textarea {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 0.78rem;
    box-sizing: border-box;
    resize: vertical;
    min-height: 72px;
    background: #FFFFFF;
    color: #0F172A;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.ic-textarea:focus {
    border-color: #7C3AED;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.ic-field-hint {
    font-size: 0.64rem;
    color: #94A3B8;
    margin-top: 0.25rem;
}

/* Document Upload Grid (9 slots) */
.ic-doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
    gap: 0.75rem;
}

.ic-doc-card {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    transition: border-color 0.15s;
}

.ic-doc-card:hover {
    border-color: #CBD5E1;
}

.ic-doc-title {
    font-weight: 700;
    font-size: 0.72rem;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ic-doc-body {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ic-file-input {
    font-size: 0.7rem;
    max-width: 100%;
    color: #475569;
}

/* Bank Details & Table */
.ic-bank-hint {
    color: #94A3B8;
    font-size: 0.78rem;
    padding: 0.5rem 0 1rem;
}

.ic-bank-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.ic-bank-table th {
    background: #F8FAFC;
    padding: 0.55rem 0.75rem;
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid #E2E8F0;
    text-align: left;
}

.ic-bank-table td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid #F1F5F9;
    font-size: 0.76rem;
    vertical-align: middle;
}

/* Form Action Buttons */
.ic-form-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 1rem;
}

/* Responsive Rules for Billing Companies */
@media (max-width: 900px) {
    .ic-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .ic-field-span-2 {
        grid-column: span 1;
    }
}

@media (max-width: 640px) {
    .ic-kpi-grid {
        grid-template-columns: 1fr;
    }
    .ic-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .ic-toolbar-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .ic-search-wrap {
        max-width: 100%;
        min-width: 100%;
    }
    .ic-form-grid {
        grid-template-columns: 1fr;
    }
    .ic-doc-grid {
        grid-template-columns: 1fr;
    }
}

/* ════════════════════════════════════════════════════════════════
   CREATE DISPATCH / NEW BOOKING MODAL DIALOG (Pass 2)
   Replaces the 820px inline form accordion with a centered modal.
   Reparented to <body> by Kiro: zero ancestor dependencies.
   ════════════════════════════════════════════════════════════════ */

.omni-modal-dialog--dispatch {
    width: min(1060px, 98vw);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
}

.dispatch-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color, #E2E8F0);
    background: #FFFFFF;
    flex-shrink: 0;
}

.dispatch-modal-header .omni-modal-title {
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--text-primary, #0F172A);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#webModalModeBadge {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    border: 1px solid #CBD5E1;
    background: #F1F5F9;
    color: #475569;
}

#webModalModeBadge:empty,
#webAssignStatusBadge:empty {
    display: none;
}

.dispatch-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 1rem 1.25rem 2rem;
    background: #F8FAFC;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Spacing is owned by the grid gaps and the body gap, not by per-field margins. */
.dispatch-modal-body .form-group { margin-bottom: 0; }

/* Section Cards within Modal (SH-1) */
.form-section-card {
    background: #FFFFFF;
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: border-color 0.15s ease;
}

.form-section-card:hover {
    border-color: #CBD5E1;
}

.form-section-card--corporate {
    background: #EEF2FF;
    border-color: #C7D2FE;
}

.form-section-card--assign {
    background: #F8FAFC;
    border: 1px dashed #CBD5E1;
    padding: 0;
    overflow: hidden;
}

.dispatch-section-title {
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6366F1;
    margin-bottom: 0.65rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.dispatch-section-title .dispatch-section-sub {
    font-weight: 600;
    color: #94A3B8;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.72rem;
}

.dispatch-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid var(--border-color, #E2E8F0);
    background: var(--bg-card-footer, #F8FAFC);
    flex-shrink: 0;
}

.dispatch-footer-status {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary, #475569);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

#webModalFooterStatus {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

#webModalFooterStatus:empty {
    display: none;
}

#webModalFooterStatus.is-ready::before,
#webModalFooterStatus.is-pending::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    flex-shrink: 0;
}

#webModalFooterStatus.is-ready::before {
    background-color: var(--success, #10B981);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

#webModalFooterStatus.is-pending::before {
    background-color: var(--warning, #F59E0B);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

/* Trip Type Segmented Chips */
.web-triptype-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 700;
    border: 1px solid #CBD5E1;
    border-radius: 999px;
    padding: 0.45rem 1.1rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.web-triptype-chip:hover {
    filter: brightness(0.97);
}

.web-triptype-chip:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus, 0 0 0 3px rgba(109, 40, 217, 0.2));
}

/* Guest Row & Leg Styling (CD-2) */
.dg-row {
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: var(--radius-md, 8px);
    padding: 0.65rem 0.75rem;
    background: #F8FAFC;
    transition: var(--transition-fast, all 0.15s ease);
}

.dg-row--primary {
    border-color: #C7D2FE;
    background: #F5F7FF;
    box-shadow: 0 1px 3px rgba(99, 102, 241, 0.06);
}

.dg-arealine {
    font-size: 0.68rem;
    margin-top: 3px;
    line-height: 1.25;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.dg-arealine--ok {
    color: var(--success, #059669);
}

.dg-arealine--warn {
    color: var(--warning, #D97706);
}

.dg-del-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--danger, #DC2626);
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.dg-del-btn:hover {
    background: #FEE2E2;
}

#webAssignStatusBadge {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    border: 1px solid #CBD5E1;
    background: #F1F5F9;
    color: #475569;
}



/* ════════════════════════════════════════════════════════════════
   CREATE DISPATCH MODAL - guest row fields (rendered by guestRowHtml / _guestLegHtml in app.js)
   Gemini: tune looks here; do not edit the templates in app.js.
   ════════════════════════════════════════════════════════════════ */
.dg-row-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}

.dg-row-title {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.74rem;
    font-weight: 800;
    color: #64748B;
}

.dg-row--primary .dg-row-title { color: #4338CA; }

.dg-row-tag {
    font-size: 0.66rem;
    font-weight: 700;
    color: #4F46E5;
    background: #E0E7FF;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
}

.dg-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 0.65rem;
}

.dg-grid:last-child { margin-bottom: 0; }

.dg-field {
    position: relative;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.dg-pos { position: relative; }

.dg-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
}

.dg-req { color: #EF4444; }

.dg-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.45rem 0.6rem;
    border: 1px solid #CBD5E1;
    border-radius: 7px;
    background: #FFFFFF;
    color: #0F172A;
    font-size: 0.82rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dg-input:hover { border-color: var(--border-strong, #94A3B8); }

.dg-input:focus {
    outline: none;
    border-color: #6D28D9;
    box-shadow: var(--shadow-focus, 0 0 0 3px rgba(109, 40, 217, 0.15));
}

.dg-airport-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 0.45rem;
    align-items: start; /* the flight box keeps its normal height, not the airport cell's (name + status line) */
}

.dg-note {
    font-size: 0.68rem;
    line-height: 1.25;
    margin-top: 2px;
    color: #64748B;
}

.dg-note--warn { color: #B45309; }

/* The passenger-suggestion list hangs off the name field (one column wide): give it room. */
.dg-field #customerAutoDropdown { min-width: min(420px, 80vw); }

#webModalModeBadge[data-mode="corporate"] {
    background: #E0E7FF;
    color: #4338CA;
    border-color: #C7D2FE;
}

@media (max-width: 860px) {
    .dg-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Create Dispatch modal - compact layout (less vertical scrolling) */
.dispatch-billing-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.dispatch-billing-search {
    flex: 0 1 380px;
    min-width: 240px;
}

/* Nested inside the Billing card; JS shows/hides it with inline display. */
.dispatch-corp-panel {
    margin-top: 0.7rem;
    padding: 0.75rem 0.9rem;
    background: #EEF2FF;
    border: 1px solid #C7D2FE;
    border-radius: 10px;
}

/* Booker + booker mobile sit side by side (JS shows the group with display:''). */
#webCorpBookerGroup {
    grid-column: span 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 0.85rem;
    align-content: start;
}

#webCorpBookerGroup > label { grid-column: 1 / -1; }

.web-triptype-chip i { font-size: 0.72rem; }

/* Serving-city hint text removed (not needed); element kept because JS toggles it. */
#webCorpContractHint { display: none !important; }


/* Airport-vs-airport note not needed: the other leg's Airport option is already disabled. JS still writes the element. */
.dg-note--warn { display: none !important; }

/* ════════════════════════════════════════════════════════════════
   COMPLETED TRIPS — EDIT TRIP & BILLING RECONCILIATION MODAL (.et-*)
   Side-by-Side Reconciliation Layout (Masterpiece)
   Super Professional Theme-Variable-Driven Design System
   ════════════════════════════════════════════════════════════════ */

/* Modal Dialog Sizing */
.omni-modal-dialog--edit-trip {
    width: min(900px, 96vw);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-card, #FFFFFF);
    border-radius: var(--radius-lg, 14px);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.22);
}

/* Header */
.et-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid var(--border-color, #E2E8F0);
    background: var(--bg-card, #FFFFFF);
    flex-shrink: 0;
}

.et-header-main {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.et-header-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm, 8px);
    flex-shrink: 0;
    background: var(--primary-soft, #EDE9FE);
    color: var(--primary, #6D28D9);
    border: 1px solid var(--primary-soft-border, #DDD6FE);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.et-header-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.et-title {
    margin: 0;
    font-size: 0.96rem;
    font-weight: 800;
    color: var(--text-main, #0F172A);
}

.et-code {
    font-family: var(--font-mono, monospace);
    color: var(--primary, #6D28D9);
    font-weight: 800;
}

.et-subtitle {
    margin: 1px 0 0;
    font-size: 0.7rem;
    color: var(--text-muted, #64748B);
}

.et-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-pill, 999px);
    border: 1px solid transparent;
}
.et-badge--flag {
    background: var(--warning-soft, #FEF3C7);
    color: var(--warning-text, #92400E);
    border-color: var(--warning-border, #FDE68A);
}
.et-badge--lock {
    background: var(--bg-card-muted, #F1F5F9);
    color: var(--text-secondary, #475569);
    border-color: var(--border-strong, #CBD5E1);
}
.et-badge--cancel {
    background: var(--danger-soft, #FEE2E2);
    color: var(--danger-text, #991B1B);
    border-color: var(--danger-border, #FECACA);
}

/* Modal Body */
.et-modal-body {
    padding: 0.9rem 1.15rem;
    overflow-y: auto;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: var(--bg-body, #F4F6FA);
}

/* Top Status Banners */
.et-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm, 8px);
    border: 1px solid transparent;
    font-size: 0.74rem;
    line-height: 1.4;
}
.et-banner i { margin-top: 2px; font-size: 0.75rem; flex-shrink: 0; }
.et-banner--warn {
    background: var(--warning-soft, #FFFBEB);
    border-color: var(--warning-border, #FDE68A);
    color: var(--warning-text, #92400E);
}
.et-banner--lock {
    background: var(--bg-card-muted, #F1F5F9);
    border-color: var(--border-strong, #CBD5E1);
    color: var(--text-secondary, #334155);
}
.et-banner--cancel {
    background: var(--danger-soft, #FEF2F2);
    border-color: var(--danger-border, #FECACA);
    color: var(--danger-text, #991B1B);
}

/* Trip Context Info Strip */
.et-info-strip {
    background: var(--bg-card, #FFFFFF);
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: var(--radius-md, 10px);
    padding: 0.65rem 0.85rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.65rem 0.85rem;
    box-shadow: var(--shadow-xs);
}

.et-info-item {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    min-width: 0;
}

.et-info-label {
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #94A3B8);
    display: block;
    margin-bottom: 2px;
}

.et-info-val {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main, #0F172A);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.et-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    flex-shrink: 0;
    border: 1px solid var(--border-strong, #CBD5E1);
}

.et-avatar--pax {
    background: var(--primary-soft, #E0E7FF);
    color: var(--primary, #4338CA);
    border-color: var(--primary-soft-border, #C7D2FE);
}

.et-avatar--fleet {
    background: var(--bg-card-muted, #F1F5F9);
    color: var(--text-secondary, #475569);
}

.et-avatar--time {
    background: var(--success-soft, #ECFDF5);
    color: var(--success-text, #047857);
    border-color: var(--success-border, #A7F3D0);
}

.et-client-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 6px;
    border-radius: var(--radius-xs, 4px);
    font-size: 0.68rem;
    font-weight: 700;
    background: var(--primary-soft, #F5F3FF);
    color: var(--primary, #6D28D9);
    border: 1px solid var(--primary-soft-border, #DDD6FE);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}

.et-plate-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: var(--radius-xs, 4px);
    background: var(--bg-card, #FFFFFF);
    color: var(--text-main, #0F172A);
    border: 1.5px solid var(--text-main, #0F172A);
}
.et-plate-ind {
    font-size: 0.55rem;
    font-weight: 800;
    color: var(--info-text, #1E40AF);
    padding-right: 2px;
    border-right: 1px solid var(--border-strong, #CBD5E1);
}

.et-owner-tag {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: var(--radius-xs, 4px);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.et-owner-tag--self {
    background: var(--bg-card-muted, #F1F5F9);
    color: var(--text-secondary, #475569);
    border: 1px solid var(--border-strong, #CBD5E1);
}
.et-owner-tag--vendor {
    background: var(--info-soft, #F0F9FF);
    color: var(--info-text, #0369A1);
    border: 1px solid var(--info-border, #BAE6FD);
}

.et-info-sub {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
    margin-top: 3px;
}
.et-info-sub i { color: var(--text-dimmed, #94A3B8); margin-right: 3px; }

/* 4-Row Labelled Timetable (Brief Item #2) */
.et-time-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1px 8px;
    font-size: 0.72rem;
    margin-top: 2px;
}
.et-time-lbl {
    color: var(--text-muted, #64748B);
    font-weight: 600;
}
.et-time-val {
    color: var(--text-main, #0F172A);
    font-weight: 700;
}
.et-time-val--dur {
    color: var(--success-text, #047857);
}

/* Correct End Time Drawer (endTimeCorrectHtml) */
.et-link-btn {
    background: none;
    border: 0;
    padding: 0;
    margin-top: 3px;
    color: var(--primary, #6D28D9);
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.et-link-btn:hover { text-decoration: underline; }
.et-link-btn:focus-visible { outline: 2px solid var(--primary, #6366F1); outline-offset: 2px; border-radius: 4px; }

.et-endtime {
    margin-top: 0.5rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--primary-soft-border, #DDD6FE);
    background: var(--primary-soft, #FAF5FF);
    border-radius: var(--radius-sm, 8px);
    display: grid;
    gap: 0.35rem;
}
.et-endtime[hidden] { display: none; }
/* Full-width drawer: its own row of the trip strip, fields side by side, wraps on narrow widths, never scrolls sideways. */
.et-endtime--wide {
    grid-column: 1 / -1;
    margin-top: 0.15rem;
    min-width: 0;
    box-sizing: border-box;
}
.et-endtime-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem 0.75rem;
}
.et-endtime-when { flex: 0 1 230px; min-width: 0; }
.et-endtime-why { flex: 1 1 240px; min-width: 0; }
.et-endtime--wide .et-text { width: 100%; max-width: 100%; box-sizing: border-box; min-width: 0; }
.et-endtime-actions { display: flex; gap: 0.5rem; flex: 0 0 auto; }
.et-modal-body { overflow-x: hidden; }

/* Vertical hairlines between the Passenger / Vehicle / Trip panels (only when they sit side by side). */
@media (min-width: 800px) {
    .et-info-strip .et-info-item + .et-info-item {
        border-left: 1px solid var(--border-color, #E2E8F0);
        padding-left: 0.85rem;
    }
}
/* Route Strip */
.et-route-row {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.74rem;
    border-top: 1px solid var(--border-light, #F1F5F9);
    padding-top: 0.4rem;
    margin-top: 0.2rem;
    color: var(--text-muted, #64748B);
}
.et-route-origin, .et-route-dest {
    font-weight: 700;
    color: var(--text-main, #0F172A);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.et-route-origin i { color: var(--success, #10B981); }
.et-route-dest i { color: var(--danger, #EF4444); }

/* ════════════════════════════════════════════════════════════════
   THE ONE VISUAL LANGUAGE FOR EDITABLE VS READ-ONLY
   ════════════════════════════════════════════════════════════════ */
.et-field {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.et-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.et-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary, #475569);
    margin: 0;
}
.et-label--good { color: var(--success-text, #047857); }
.et-label--warn { color: var(--warning-text, #92400E); font-weight: 800; }
.et-label-sub { font-weight: 600; color: var(--text-dimmed, #94A3B8); }
.et-label--warn .et-label-sub { color: var(--warning-text, #B45309); }
.et-req { color: var(--danger, #EF4444); }

.et-auto-tag {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 1px 6px;
    border-radius: var(--radius-xs, 4px);
    background: var(--primary-soft, #F5F3FF);
    color: var(--primary, #6D28D9);
    border: 1px solid var(--primary-soft-border, #DDD6FE);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.et-lock-tag {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 1px 6px;
    border-radius: var(--radius-xs, 4px);
    background: var(--bg-card-muted, #F1F5F9);
    color: var(--text-muted, #64748B);
    border: 1px solid var(--border-strong, #CBD5E1);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* Base input group: White editable surface with crisp slate border */
.et-inp-group {
    display: flex;
    align-items: stretch;
    background: var(--bg-card, #FFFFFF);
    border: 1.5px solid var(--border-strong, #CBD5E1);
    border-radius: var(--radius-sm, 7px);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.et-inp-group:focus-within {
    border-color: var(--primary, #6D28D9);
    box-shadow: 0 0 0 3px var(--primary-soft-border, rgba(109, 40, 217, 0.15));
}

.et-inp-group.odo-bad {
    border-color: var(--danger, #EF4444) !important;
    box-shadow: 0 0 0 3px var(--danger-border, rgba(239, 68, 68, 0.15)) !important;
}

/* Read-only / disabled input group: Flat tinted surface */
.et-inp-group.is-readonly,
.et-inp-group.is-disabled {
    background: var(--bg-input, #F8FAFC) !important;
    border-color: var(--border-color, #E2E8F0) !important;
    box-shadow: none !important;
}

.et-inp-group.is-readonly .et-inp-field,
.et-inp-group.is-disabled .et-inp-field {
    background: transparent !important;
    color: var(--text-secondary, #475569) !important;
    cursor: default;
}

.et-inp-addon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.55rem;
    background: var(--bg-card-muted, #F8FAFC);
    color: var(--text-secondary, #64748B);
    font-size: 0.76rem;
    font-weight: 700;
    border-right: 1px solid var(--border-color, #E2E8F0);
    user-select: none;
}

.et-inp-addon--suffix {
    border-right: none;
    border-left: 1px solid var(--border-color, #E2E8F0);
    font-size: 0.7rem;
    color: var(--text-dimmed, #94A3B8);
}

.et-inp-field {
    flex: 1 1 auto;
    border: none !important;
    padding: 0.45rem 0.6rem;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-main, #0F172A);
    outline: none !important;
    background: transparent;
    width: 100%;
}

.et-mono { font-family: var(--font-mono, monospace); }
.et-strong { font-weight: 800; }
.et-inp-group--good .et-inp-field, .et-inp-group--good .et-inp-addon { color: var(--success-text, #059669); }

.et-text, .et-textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1.5px solid var(--border-strong, #CBD5E1);
    border-radius: var(--radius-sm, 7px);
    padding: 0.45rem 0.65rem;
    font-size: 0.8rem;
    color: var(--text-main, #0F172A);
    background: var(--bg-card, #FFFFFF);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.et-textarea { resize: vertical; font-family: inherit; }
.et-text:focus, .et-textarea:focus {
    outline: none;
    border-color: var(--primary, #6D28D9);
    box-shadow: 0 0 0 3px var(--primary-soft-border, rgba(109, 40, 217, 0.15));
}
.et-text:disabled, .et-textarea:disabled {
    background: var(--bg-input, #F1F5F9);
    color: var(--text-muted, #64748B);
    cursor: not-allowed;
    border-color: var(--border-color, #E2E8F0);
}
.et-text--warn { border-color: var(--warning, #F59E0B); }

/* ════════════════════════════════════════════════════════════════
   SIDE-BY-SIDE MATRIX LAYOUT (MASTERPIECE)
   ════════════════════════════════════════════════════════════════ */
.et-side-matrix {
    display: grid;
    grid-template-columns: 1.08fr 1fr;
    gap: 0.85rem;
    align-items: start;
}
@media (max-width: 820px) {
    .et-side-matrix {
        grid-template-columns: 1fr;
    }
}

.et-matrix-col {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
}

.et-card {
    background: var(--bg-card, #FFFFFF);
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: var(--radius-md, 12px);
    padding: 0.75rem 0.95rem;
    box-shadow: var(--shadow-xs);
    min-width: 0;
}

.et-card--audit {
    border-top: 3px solid var(--primary, #6D28D9);
}

.et-card--ledger {
    border-top: 3px solid var(--success, #10B981);
}

.et-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.et-card-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--primary, #6366F1);
}
.et-card-head .et-card-title { margin-bottom: 0; }
.et-card-sub {
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-muted, #94A3B8);
    font-size: 0.7rem;
}

.et-cross-badge {
    font-size: 0.64rem;
    font-weight: 700;
    color: var(--primary, #4338CA);
    background: var(--primary-soft, #EEF2FF);
    padding: 2px 7px;
    border-radius: var(--radius-xs, 4px);
    border: 1px solid var(--primary-soft-border, #C7D2FE);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Odometer Match State Box (#beOdoMatch) */
.et-odo-match {
    padding: 0.45rem 0.7rem;
    border-radius: var(--radius-sm, 7px);
    font-size: 0.72rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.35;
    margin-top: 0.35rem;
    margin-bottom: 0.5rem;
}
.et-odo-match.is-match {
    background: var(--success-soft, #ECFDF5);
    border: 1.5px solid var(--success, #10B981);
    color: var(--success-text, #047857);
}
.et-odo-match.is-mismatch {
    background: var(--danger-soft, #FEF2F2);
    border: 1.5px solid var(--danger, #EF4444);
    color: var(--danger-text, #B91C1C);
}
.et-odo-match.is-missing {
    background: var(--danger-soft, #FEF2F2);
    border: 1.5px solid var(--danger, #EF4444);
    color: var(--danger-text, #B91C1C);
}
.et-odo-match.is-pending {
    background: var(--info-soft, #EFF6FF);
    border: 1.5px solid var(--info, #3B82F6);
    color: var(--info-text, #1D4ED8);
}

/* Telemetry & Variance Bar (#beDistPanel) */
.et-telem-strip {
    background: var(--bg-card-muted, #F8FAFC);
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: var(--radius-sm, 7px);
    padding: 0.4rem 0.65rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.74rem;
}
.et-telem-label {
    font-size: 0.64rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted, #64748B);
}
.et-telem-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-secondary, #475569);
    font-weight: 600;
}
.et-telem-chip strong {
    color: var(--text-main, #0F172A);
    font-family: var(--font-mono, monospace);
}

.et-variance-box {
    background: var(--warning-soft, #FFFBEB);
    border: 1.5px solid var(--warning, #F59E0B);
    border-radius: var(--radius-sm, 7px);
    padding: 6px 10px;
    font-size: 0.72rem;
    color: var(--warning-text, #92400E);
    line-height: 1.4;
    margin-top: 6px;
}
.et-variance-box i { margin-right: 4px; }

/* Dynamic Notes & Errors */
.et-hint {
    font-size: 0.68rem;
    color: var(--text-muted, #64748B);
    margin-bottom: 0.4rem;
}
.et-contract-note {
    font-size: 0.66rem;
    font-weight: 600;
    color: var(--warning-text, #B45309);
    background: var(--warning-soft, #FFFBEB);
    border: 1px solid var(--warning-border, #FDE68A);
    border-radius: var(--radius-xs, 4px);
    padding: 2px 6px;
    margin-top: 3px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.et-override-wrap {
    background: var(--warning-soft, #FFFBEB);
    border: 1.5px solid var(--warning-border, #FDE68A);
    border-radius: var(--radius-sm, 8px);
    padding: 0.65rem 0.85rem;
    margin-top: 0.6rem;
}
.et-inline-error {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--danger, #DC2626);
    margin-top: 3px;
}
.et-odo-error {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--danger-text, #B91C1C);
    background: var(--danger-soft, #FEF2F2);
    border: 1px solid var(--danger-border, #FECACA);
    border-radius: var(--radius-xs, 4px);
    padding: 3px 6px;
    margin-bottom: 0.4rem;
}

/* Surcharges & Ledger Grid */
.et-surcharge-side-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem 0.75rem;
    margin-bottom: 0.6rem;
}
@media (max-width: 480px) {
    .et-surcharge-side-grid {
        grid-template-columns: 1fr;
    }
}
.et-surcharge-side-grid .et-contract-note {
    white-space: nowrap;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.62rem;
    padding: 2px 5px;
}

.et-discount-pair {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 0.55rem 0.75rem;
    border-top: 1px solid var(--border-light, #F1F5F9);
    padding-top: 0.6rem;
    margin-bottom: 0.6rem;
}
@media (max-width: 480px) {
    .et-discount-pair {
        grid-template-columns: 1fr;
    }
}

/* Vendor Km Card (#beVendorKmCard) - Clean non-alert slate partner theme */
#beVendorKmCard {
    background: var(--bg-card-muted, #F8FAFC);
    border: 1.5px solid var(--border-strong, #CBD5E1);
    border-radius: var(--radius-md, 10px);
    margin-top: 0.6rem;
}
#beVendorKmCard .et-card-title {
    color: var(--text-main, #0F172A);
}
#beVendorKmCard .et-card-title i {
    color: var(--info, #0284C7);
}

/* Special Rate Collapsible Card (#beSpecialRateCard) */
.et-card--collapsible {
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
    margin-top: 0.6rem;
}
.et-card-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    background: none;
    border: 0;
    padding: 0.15rem 0;
    margin: 0;
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
}
.et-card-toggle:focus-visible {
    outline: 2px solid var(--primary, #6366F1);
    outline-offset: 3px;
    border-radius: var(--radius-sm, 8px);
}
.et-card--collapsible .et-card-title {
    margin-bottom: 0;
    flex-wrap: wrap;
}
.et-card-chev {
    color: var(--text-dimmed, #94A3B8);
    font-size: 0.75rem;
    transition: transform 0.15s ease;
    flex-shrink: 0;
}
.et-card--collapsible.is-open .et-card-chev {
    transform: rotate(180deg);
}
.et-card-body {
    margin-top: 0.6rem;
}
.et-card-body[hidden] {
    display: none;
}
.et-card-pill {
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.68rem;
    padding: 1px 8px;
    border-radius: var(--radius-pill, 999px);
    background: var(--primary-soft, #EEF2FF);
    color: var(--primary, #4338CA);
    border: 1px solid var(--primary-soft-border, #C7D2FE);
}

/* Corporate Package Breakdown (#bePkgBreakdown) */
.et-pkg {
    margin-top: 0.6rem;
    background: var(--primary-soft, #EEF2FF);
    border: 1px solid var(--primary-soft-border, #C7D2FE);
    border-radius: var(--radius-sm, 8px);
    padding: 0.5rem 0.75rem;
    font-size: 0.74rem;
    color: var(--text-secondary, #475569);
}
.et-pkg-head {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--primary-dark, #312E81);
    margin-bottom: 4px;
}
.et-pkg-head i { color: var(--primary, #4F46E5); margin-right: 4px; }
.et-pkg-row {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    color: var(--text-main, #1E1B4B);
}
.et-pkg-row--over { color: var(--warning-text, #B45309); font-weight: 700; }
.et-pkg-sub { color: var(--text-dimmed, #94A3B8); }

/* Receipts Shelf (#beReceiptThumbs) */
.et-receipts-shelf {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 48px;
    align-items: center;
}
.et-receipt-tile {
    width: 88px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.et-receipt-tile a {
    display: block;
    width: 88px;
    height: 56px;
    border-radius: var(--radius-sm, 6px);
    border: 1px solid var(--border-strong, #CBD5E1);
    overflow: hidden;
    background: var(--bg-card-muted, #F8FAFC);
    text-decoration: none;
    transition: border-color 0.15s ease;
}
.et-receipt-tile a:hover {
    border-color: var(--primary, #6D28D9);
}
.et-receipt-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.et-receipt-pdf {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 2px;
    color: var(--text-secondary, #475569);
    padding: 2px 4px;
}
.et-receipt-pdf i {
    font-size: 1.25rem;
    color: var(--danger, #DC2626);
}
.et-receipt-pdf span {
    font-size: 0.55rem;
    font-weight: 600;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.et-receipt-del {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--danger, #DC2626);
    padding: 0;
    text-align: left;
}
.et-receipt-del:hover {
    text-decoration: underline;
}

/* Pinned Footer */
.et-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.15rem;
    border-top: 1px solid var(--border-color, #E2E8F0);
    background: var(--bg-card, #FFFFFF);
    flex-shrink: 0;
    position: relative;
}
.et-total-block {
    display: flex;
    flex-direction: column;
}
.et-total-label {
    font-size: 0.64rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #94A3B8);
}
.et-total-label span {
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}
.et-total-line {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.et-total-spin {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.et-total {
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--text-main, #0F172A);
    font-family: var(--font-mono, monospace);
    letter-spacing: -0.02em;
}
.et-updating-state {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--primary, #6D28D9);
}
.et-foot-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.et-fare-expand-pill {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--primary, #6D28D9);
    background: var(--primary-soft, #EDE9FE);
    border: 1px solid var(--primary-soft-border, #DDD6FE);
    padding: 1px 6px;
    border-radius: var(--radius-xs, 4px);
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 0.5rem;
}

/* Fare Breakdown Popover Container (#beFareBreakdownPopover) */
.et-fare-popover {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 1.15rem;
    background: var(--bg-card, #FFFFFF);
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: var(--radius-md, 10px);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
    padding: 0.75rem 1rem;
    min-width: 260px;
    z-index: 100;
    font-size: 0.76rem;
}


.et-fare-popover .et-fare-row {
    display: flex;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 3px 0;
    color: var(--text-secondary, #475569);
}
.et-fare-popover .et-fare-row--neg { color: var(--success, #059669); }
.et-fare-popover .et-fare-row--total {
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid var(--border-color, #E2E8F0);
    font-weight: 800;
    color: var(--text-primary, #0F172A);
}
/* ════════════════════════════════════════════════════════════════
   DOCUMENT PREVIEW MODAL (.omni-modal-dialog--doc-preview / .doc-*)
   Rendered in openHtmlPreviewModal (app.js) for Duty Slips & Invoices.
   ════════════════════════════════════════════════════════════════ */

.omni-modal-dialog--doc-preview {
    width: min(880px, 96vw);
    height: 92vh;
    max-height: 920px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #FFFFFF;
}

.doc-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color, #E2E8F0);
    background: #FFFFFF;
    flex-shrink: 0;
}

.doc-modal-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.doc-modal-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm, 8px);
    background: #EEF2FF;
    border: 1px solid #C7D2FE;
    color: #4338CA;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.doc-modal-icon--invoice {
    background: #ECFDF5;
    border-color: #A7F3D0;
    color: #047857;
}

.doc-modal-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.doc-modal-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary, #0F172A);
}

.doc-modal-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted, #64748B);
    margin-top: 1px;
}

.doc-chip-code {
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    background: #F1F5F9;
    color: #475569;
    border: 1px solid var(--border-color, #CBD5E1);
    letter-spacing: 0.03em;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}

.doc-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid transparent;
    line-height: 1.3;
    white-space: nowrap;
}
.doc-status-pill:empty {
    display: none;
}
/* Duty slip pill variants (DP-1) */
.doc-status-pill--signed {
    background: #ECFDF5;
    color: #047857;
    border-color: #A7F3D0;
}
.doc-status-pill--unsigned {
    background: #F1F5F9;
    color: #475569;
    border-color: #CBD5E1;
}
/* Invoice pill variants (DP-1) */
.doc-status-pill--draft {
    background: #F1F5F9;
    color: #475569;
    border-color: #CBD5E1;
}
.doc-status-pill--finalized {
    background: #EEF2FF;
    color: #4338CA;
    border-color: #C7D2FE;
}
.doc-status-pill--settled {
    background: #ECFDF5;
    color: #047857;
    border-color: #A7F3D0;
}
.doc-status-pill--void {
    background: #FEF2F2;
    color: #991B1B;
    border-color: #FECACA;
}

.doc-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    background: #525659;
    position: relative;
    overflow: hidden;
}

.doc-modal-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.doc-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    border-top: 1px solid var(--border-color, #E2E8F0);
    background: #FFFFFF;
    flex-shrink: 0;
}

.doc-modal-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    color: var(--text-muted, #64748B);
}

.doc-btn-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-secondary, #64748B);
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: var(--radius-sm, 6px);
    transition: color 0.15s ease, background 0.15s ease;
}
.doc-btn-link:hover {
    color: var(--primary, #6D28D9);
    text-decoration: underline;
    background: #F8FAFC;
}

.doc-modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.doc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-sm, 7px);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    line-height: 1.2;
}

.doc-btn-secondary {
    background: #F1F5F9;
    color: var(--text-primary, #334155);
    border-color: var(--border-color, #CBD5E1);
}
.doc-btn-secondary:hover {
    background: #E2E8F0;
    color: #0F172A;
}

.doc-btn-print {
    background: #FFFFFF;
    color: var(--text-primary, #334155);
    border-color: var(--border-color, #CBD5E1);
}
.doc-btn-print:hover {
    background: #F8FAFC;
    border-color: #94A3B8;
    color: #0F172A;
}

.doc-btn-email {
    background: #0F766E;
    color: #FFFFFF;
    border-color: #0D9488;
}
.doc-btn-email:hover {
    background: #115E59;
    box-shadow: 0 2px 6px rgba(15, 118, 110, 0.25);
}

.doc-btn-wa {
    background: #15803D;
    color: #FFFFFF;
    border-color: #16A34A;
}
.doc-btn-wa:hover {
    background: #166534;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.25);
}

/* Accessible focus visible (DP-8) */
.doc-btn:focus-visible,
.doc-btn-link:focus-visible,
.doc-modal-header .omni-modal-close:focus-visible,
.modal-close-btn:focus-visible {
    outline: 2px solid var(--primary, #6D28D9);
    outline-offset: 2px;
}

/* ════════════════════════════════════════════════════════════════
   VIEW TRIP DETAILS MODAL (.omni-modal-dialog--trip-details / .td-*)
   Rendered in openTripDetailsModal / buildTripDetailsHtml (app.js).
   100% Theme-Variable-Driven Design System (Zero Bare Hex)
   ════════════════════════════════════════════════════════════════ */

.omni-modal-dialog--trip-details {
    width: min(840px, 96vw) !important;
    max-width: 840px !important;
    max-height: 92vh;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-card, #FFFFFF);
    border-radius: var(--radius-lg, 14px);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.22);
}

.td-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid var(--border-color, #E2E8F0);
    background: var(--bg-card, #FFFFFF);
    flex-shrink: 0;
}

.td-header-main {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.td-header-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm, 8px);
    flex-shrink: 0;
    background: var(--primary-soft, #EDE9FE);
    border: 1px solid var(--primary-soft-border, #DDD6FE);
    color: var(--primary, #6D28D9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.td-header-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.td-header-title {
    font-size: 0.96rem;
    font-weight: 800;
    color: var(--text-main, #0F172A);
    letter-spacing: -0.01em;
}

.td-code-chip {
    font-family: var(--font-mono, monospace);
    font-size: 0.74rem;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: var(--radius-xs, 5px);
    background: var(--bg-card-muted, #F1F5F9);
    color: var(--primary, #6D28D9);
    border: 1px solid var(--border-strong, #CBD5E1);
    letter-spacing: 0.02em;
    display: inline-block;
}

.td-header-pills {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 2px;
}

.td-header-sep {
    color: var(--border-strong, #CBD5E1);
    font-size: 0.7rem;
}

.td-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.td-quick-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm, 7px);
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
    box-shadow: var(--shadow-xs);
}
.td-quick-btn--alloc {
    background: var(--warning-text, #D97706);
    color: var(--bg-card, #FFFFFF);
}
.td-quick-btn--alloc:hover {
    background: var(--warning-dark, #B45309);
}
.td-quick-btn--track {
    background: var(--success, #059669);
    color: var(--bg-card, #FFFFFF);
}
.td-quick-btn--track:hover {
    background: var(--success-dark, #047857);
}
.td-quick-btn--bill {
    background: var(--primary, #6D28D9);
    color: var(--bg-card, #FFFFFF);
}
.td-quick-btn--bill:hover {
    background: var(--primary-dark, #5B21B6);
}

.td-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 1rem 1.15rem;
    background: var(--bg-input, #F8FAFC);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Distance Audit Strip */
.td-dist-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: 0.65rem;
}

.td-dist-tile {
    background: var(--bg-card, #FFFFFF);
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: var(--radius-md, 10px);
    padding: 0.55rem 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-shadow: var(--shadow-xs);
    min-width: 0;
    transition: border-color 0.15s ease;
}

.td-dist-tile-lbl {
    font-size: 0.63rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #64748B);
    display: flex;
    align-items: center;
    gap: 4px;
}
.td-dist-tile-lbl i { font-size: 0.72rem; }

.td-dist-tile-val {
    font-size: 1.05rem;
    font-weight: 800;
    font-family: var(--font-mono, monospace);
    color: var(--text-main, #0F172A);
    letter-spacing: -0.01em;
}

.td-dist-tile--billed {
    background: var(--primary-soft, #FAF5FF);
    border-color: var(--primary-soft-border, #DDD6FE);
}
.td-dist-tile--billed .td-dist-tile-lbl { color: var(--primary, #6D28D9); }
.td-dist-tile--billed .td-dist-tile-val { color: var(--primary, #6D28D9); }

.td-dist-tile--vendor {
    background: var(--info-soft, #F0F9FF);
    border-color: var(--info-border, #BAE6FD);
}
.td-dist-tile--vendor .td-dist-tile-lbl { color: var(--info-text, #0369A1); }
.td-dist-tile--vendor .td-dist-tile-val { color: var(--info-text, #0369A1); }

.td-dist-tile--warn {
    background: var(--warning-soft, #FFFBEB);
    border-color: var(--warning-border, #FDE68A);
}
.td-dist-tile--warn .td-dist-tile-lbl { color: var(--warning-text, #92400E); }
.td-dist-tile--warn .td-dist-tile-val { color: var(--warning-text, #92400E); font-size: 0.84rem; }
.td-dist-warn-sub {
    font-size: 0.65rem;
    font-weight: 600;
    display: block;
    color: var(--warning-text, #B45309);
    letter-spacing: normal;
}

/* 2-Column Operational Dossier */
.td-grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.75rem;
}
.td-grid-2 > .td-card { min-width: 0; }
@media (max-width: 680px) {
    .td-grid-2 { grid-template-columns: 1fr; }
}

.td-card {
    background: var(--bg-card, #FFFFFF);
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: var(--radius-md, 12px);
    padding: 0.75rem 0.95rem;
    box-shadow: var(--shadow-xs);
    min-width: 0;
}

.td-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid var(--border-light, #F1F5F9);
}

.td-card-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--primary, #6D28D9);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.td-card-title i { font-size: 0.8rem; }

.td-person {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
}

.td-person-name {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text-main, #0F172A);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.td-more-pax {
    font-size: 0.72rem;
    color: var(--primary, #6D28D9);
    font-weight: 700;
    margin-top: 2px;
}

.td-booker {
    font-size: 0.7rem;
    color: var(--text-secondary, #64748B);
    font-weight: 500;
    margin-top: 4px;
}
.td-booker strong { color: var(--text-main, #334155); }

.td-plate-line { margin-bottom: 5px; }

.td-driver-name {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-main, #1E293B);
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.td-driver-phone { margin-top: 4px; }

.td-unassigned-box {
    text-align: center;
    padding: 0.85rem 0.5rem;
    color: var(--warning-text, #92400E);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}
.td-unassigned-box i {
    font-size: 1.35rem;
    color: var(--warning, #F59E0B);
}
.td-unassigned-title {
    font-size: 0.84rem;
    font-weight: 800;
    color: var(--warning-text, #92400E);
}
.td-unassigned-sub {
    font-size: 0.7rem;
    color: var(--text-muted, #64748B);
}

/* Route & Milestones Timeline */
.td-route-flow {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 0.75rem;
}
.td-route-node {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.78rem;
    font-weight: 600;
}
.td-route-node > i { margin-top: 3px; font-size: 0.78rem; }
.td-route-node--origin > i { color: var(--success, #10B981); }
.td-route-node--dest > i { color: var(--danger, #EF4444); }
.td-route-label {
    display: block;
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-dimmed, #94A3B8);
}
.td-route-name {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-main, #0F172A);
}
.td-route-line {
    border-left: 2px dashed var(--border-strong, #CBD5E1);
    margin-left: 5px;
    height: 16px;
}

.td-timetable-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light, #F1F5F9);
}
@media (max-width: 620px) {
    .td-timetable-grid { grid-template-columns: repeat(2, 1fr); }
}

.td-time-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.td-time-lbl {
    font-size: 0.63rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted, #64748B);
}
.td-time-val {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main, #0F172A);
}
.td-time-val--dur {
    color: var(--success-text, #047857);
}

/* Speed Monitoring Card (#tdSpeedCard) */
#tdSpeedCard {
    border-top: 3px solid var(--warning, #F59E0B);
}
.speed-pill {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--warning-text, #92400E);
    background: var(--warning-soft, #FEF3C7);
    border: 1px solid var(--warning-border, #FDE68A);
    padding: 1px 7px;
    border-radius: var(--radius-xs, 4px);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.speed-limit-line {
    font-size: 0.72rem;
    color: var(--text-secondary, #475569);
    margin-bottom: 0.4rem;
}
.speed-limit-line strong {
    color: var(--text-main, #0F172A);
}
.speed-summary {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--warning-text, #B45309);
    margin-bottom: 0.4rem;
}
.speed-ep-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.speed-ep-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
    color: var(--text-secondary, #475569);
    padding: 0.25rem 0.45rem;
    border-radius: var(--radius-xs, 4px);
    background: var(--bg-input, #F8FAFC);
}
.speed-ep-time {
    font-family: var(--font-mono, monospace);
    font-weight: 700;
    color: var(--text-muted, #64748B);
}
.speed-ep-list li strong {
    font-family: var(--font-mono, monospace);
    color: var(--danger, #EF4444);
    margin-left: auto;
}

/* Commercial Tariff & Financial Settlement */
.td-fare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.76rem;
}
.td-fare-table td {
    padding: 5px 0;
    color: var(--text-secondary, #475569);
    border-bottom: 1px solid var(--border-light, #F1F5F9);
}
.td-fare-table td:last-child {
    text-align: right;
    font-family: var(--font-mono, monospace);
    font-weight: 700;
    color: var(--text-main, #1E293B);
}
.td-fare-total-row td {
    border-top: 1.5px solid var(--border-strong, #CBD5E1);
    border-bottom: none;
    padding-top: 8px;
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text-main, #0F172A);
}
.td-fare-total-row td:last-child {
    font-size: 1.1rem;
    color: var(--success, #059669);
}
.td-overage-note {
    font-size: 0.68rem;
    color: var(--text-muted, #64748B);
    font-style: italic;
    padding: 4px 0 2px;
    border-bottom: none !important;
}
.td-overage-note i { color: var(--text-dimmed, #94A3B8); margin-right: 4px; }
.td-pay-row td {
    font-size: 0.74rem;
    color: var(--text-secondary, #475569);
    background: var(--bg-card-muted, #F8FAFC);
    padding: 4px 6px;
}

/* Modal Pinned Footer */
.td-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.15rem;
    border-top: 1px solid var(--border-color, #E2E8F0);
    background: var(--bg-card, #FFFFFF);
    flex-shrink: 0;
}
.td-footer-links, .td-footer-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.td-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary, #64748B);
    background: var(--bg-card, #FFFFFF);
    border: 1px solid var(--border-color, #E2E8F0);
    padding: 5px 10px;
    border-radius: var(--radius-sm, 6px);
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}
.td-link-btn:hover {
    color: var(--primary, #6D28D9);
    border-color: var(--primary-soft-border, #C4B5FD);
    background: var(--primary-soft, #F5F3FF);
}
.td-link-btn:disabled,
.td-link-btn.is-disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    background: var(--bg-input, #F8FAFC) !important;
    border-color: var(--border-color, #E2E8F0) !important;
    color: var(--text-dimmed, #94A3B8) !important;
    pointer-events: auto;
}

.td-link-btn:focus-visible,
.td-copy-btn:focus-visible,
.td-modal-header .omni-modal-close:focus-visible {
    outline: 2px solid var(--primary, #6D28D9);
    outline-offset: 2px;
}

/* Pills & Badges */
.td-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-xs, 6px);
    line-height: 1.2;
    border: 1px solid transparent;
    white-space: nowrap;
}
.td-pill:empty { display: none; }
.td-pill--completed { background: var(--success-soft, #ECFDF5); color: var(--success-text, #047857); border-color: var(--success-border, #A7F3D0); }
.td-pill--active { background: var(--primary-soft, #EDE9FE); color: var(--primary, #6D28D9); border-color: var(--primary-soft-border, #DDD6FE); }
.td-pill--cancelled { background: var(--danger-soft, #FEF2F2); color: var(--danger-text, #991B1B); border-color: var(--danger-border, #FECACA); }
.td-pill--invoiced { background: var(--info-soft, #EFF6FF); color: var(--info-text, #1E40AF); border-color: var(--info-border, #BFDBFE); }
.td-pill--uninvoiced,
.td-pill--not-invoiced { background: var(--warning-soft, #FFFBEB); color: var(--warning-text, #92400E); border-color: var(--warning-border, #FDE68A); }
.td-pill--paid { background: var(--success-soft, #ECFDF5); color: var(--success-text, #047857); border-color: var(--success-border, #A7F3D0); }
.td-pill--unpaid { background: var(--warning-soft, #FFFBEB); color: var(--warning-text, #92400E); border-color: var(--warning-border, #FDE68A); }
.td-pill--neutral,
.td-pill--other { background: var(--bg-card-muted, #F1F5F9); color: var(--text-secondary, #475569); border-color: var(--border-strong, #CBD5E1); }

/* Account Tags */
.td-corp-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 1px 7px;
    border-radius: var(--radius-xs, 4px);
    font-size: 0.68rem;
    font-weight: 700;
    background: var(--primary-soft, #F5F3FF);
    color: var(--primary, #6D28D9);
    border: 1px solid var(--primary-soft-border, #DDD6FE);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}
.td-corp-tag > i { flex-shrink: 0; }

.td-walkin-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 1px 7px;
    border-radius: var(--radius-xs, 4px);
    font-size: 0.68rem;
    font-weight: 700;
    background: var(--bg-card-muted, #F1F5F9);
    color: var(--text-secondary, #475569);
    border: 1px solid var(--border-strong, #CBD5E1);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}

/* Chips */
.td-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-xs, 5px);
    font-size: 0.68rem;
    font-weight: 700;
    background: var(--bg-card-muted, #F1F5F9);
    color: var(--text-secondary, #475569);
    border: 1px solid var(--border-color, #E2E8F0);
}
.td-chip--indigo {
    background: var(--primary-soft, #EEF2FF);
    color: var(--primary, #4338CA);
    border-color: var(--primary-soft-border, #C7D2FE);
}
.td-chip--emerald {
    background: var(--success-soft, #ECFDF5);
    color: var(--success-text, #047857);
    border-color: var(--success-border, #A7F3D0);
}

/* Avatars */
.td-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
.td-avatar--pax {
    background: var(--primary-soft, #EDE9FE);
    color: var(--primary, #6D28D9);
    border: 1px solid var(--primary-soft-border, #DDD6FE);
}
.td-avatar--driver {
    background: var(--success-soft, #ECFDF5);
    color: var(--success-text, #047857);
    border: 1px solid var(--success-border, #A7F3D0);
}
.td-avatar-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Copy Button */
.td-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-card-muted, #F1F5F9);
    border: 1px solid var(--border-color, #CBD5E1);
    border-radius: var(--radius-xs, 5px);
    padding: 1px 6px;
    font-size: 0.68rem;
    font-family: var(--font-mono, monospace);
    font-weight: 600;
    color: var(--text-secondary, #475569);
    cursor: pointer;
    transition: all 0.15s ease;
}
.td-copy-btn:hover {
    background: var(--border-color, #E2E8F0);
    color: var(--text-main, #0F172A);
}

/* The trip details overlay sits just under modals it can open */
#tripModalOverlay { z-index: 9990; }

/* History rows open the trip details on click */
.history-table tr.ht-row { cursor: pointer; }


/* ════════════════════════════════════════════════════════════════
   TRIP ROUTE MAP MODAL (.rm-*) — interactive trajectory & GPS telemetry viewer
   ════════════════════════════════════════════════════════════════ */
#routeMapModalOverlay {
    display: none;
    z-index: 9998;
}
#routeMapModalOverlay.active {
    display: flex;
}

.omni-modal-dialog--route-map {
    max-width: 860px;
    width: 92%;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg, 16px);
    overflow: hidden;
    box-shadow: var(--shadow-modal, 0 25px 60px -15px rgba(0, 0, 0, 0.5));
    border: 1px solid var(--border-color, #E2E8F0);
    background: var(--bg-surface, #FFFFFF);
}

/* Header */
.rm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color, #E2E8F0);
    background: #FFFFFF;
    flex-shrink: 0;
}
.rm-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.rm-icon-badge {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #F5F3FF;
    color: var(--primary, #6D28D9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    border: 1px solid #DDD6FE;
    flex-shrink: 0;
}
.rm-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.rm-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.rm-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary, #0F172A);
    letter-spacing: -0.01em;
    margin: 0;
    display: inline-flex;
    align-items: center;
}
.rm-subtitle {
    font-size: 0.72rem;
    color: var(--text-secondary, #64748B);
}
.rm-code-chip {
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    background: #F1F5F9;
    color: var(--text-primary, #334155);
    border: 1px solid var(--border-color, #CBD5E1);
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.rm-code-chip:empty { display: none; }
.rm-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    line-height: 1.2;
    border: 1px solid transparent;
    white-space: nowrap;
}
.rm-status-pill:empty { display: none; }
.rm-status-pill--completed { background: #ECFDF5; color: #047857; border-color: #A7F3D0; }
.rm-status-pill--active,
.rm-status-pill--inprogress { background: #EDE9FE; color: #6D28D9; border-color: #DDD6FE; }
.rm-status-pill--cancelled { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }
.rm-status-pill--pending,
.rm-status-pill--unallocated { background: #FFFBEB; color: #92400E; border-color: #FDE68A; }
.rm-status-pill--rejected { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }
.rm-status-pill--dispatched { background: #EFF6FF; color: #1E40AF; border-color: #BFDBFE; }

/* Scrollable Body */
.rm-modal-body {
    padding: 16px 20px;
    background: #F8FAFC;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

/* Executive Summary Card (#modalRouteMapHeader) */
.rm-summary-card {
    background: #FFFFFF;
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

/* Route Flow */
.rm-route-flow {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #F1F5F9;
}
.rm-route-node {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.rm-route-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.rm-route-badge--origin { color: #059669; }
.rm-route-badge--dest { color: #DC2626; }
.rm-route-address {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary, #0F172A);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.rm-route-sub {
    font-size: 0.7rem;
    color: var(--text-secondary, #64748B);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rm-route-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 0 8px;
    flex-shrink: 0;
}
.rm-dist-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 800;
    background: #ECFDF5;
    color: #047857;
    border: 1px solid #A7F3D0;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}
.rm-dist-pill--planned {
    background: #EFF6FF;
    color: #1E40AF;
    border-color: #BFDBFE;
}
.rm-dist-sub {
    font-size: 0.65rem;
    color: var(--text-muted, #94A3B8);
    font-weight: 600;
    white-space: nowrap;
}

/* Metadata Grid */
.rm-meta-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 16px;
    align-items: center;
    background: #F8FAFC;
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 8px;
    padding: 10px 14px;
}
@media (max-width: 680px) {
    .rm-meta-grid { grid-template-columns: 1fr; }
    .rm-times-box { border-left: none !important; padding-left: 0 !important; border-top: 1px solid #E2E8F0; padding-top: 8px; }
}
.rm-meta-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.rm-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-primary, #334155);
    flex-wrap: wrap;
}
.rm-plate-badge,
.rm-et-plate-badge {
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    background: #F1F5F9;
    color: #1E293B;
    border: 1px solid #CBD5E1;
    letter-spacing: 0.05em;
}
.rm-driver-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    color: var(--text-primary, #0F172A);
}
.rm-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ECFDF5;
    color: #047857;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    font-weight: 800;
    border: 1px solid #A7F3D0;
    flex-shrink: 0;
}
.rm-corp-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 1px 7px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    background: #F5F3FF;
    color: #6D28D9;
    border: 1px solid #DDD6FE;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rm-walkin-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 1px 7px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    background: #F1F5F9;
    color: #475569;
    border: 1px solid #CBD5E1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rm-copy-phone {
    font-family: var(--font-mono, monospace);
    font-size: 0.68rem;
    padding: 1px 6px;
    border-radius: 4px;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    color: var(--text-secondary, #475569);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: all 0.15s ease;
}
.rm-copy-phone:hover {
    background: #F1F5F9;
    color: var(--text-primary, #0F172A);
}

/* Times Box - 4-column Scheduled / Start / End / Duration */
.rm-times-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-left: 1px solid var(--border-color, #E2E8F0);
    padding-left: 14px;
}
.rm-date-line {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-primary, #0F172A);
    display: flex;
    align-items: center;
    gap: 5px;
}
.rm-times-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    font-size: 0.7rem;
}
@media (max-width: 600px) {
    .rm-times-grid { grid-template-columns: repeat(2, 1fr); }
}
.rm-time-col {
    display: flex;
    flex-direction: column;
}
.rm-time-lbl {
    color: var(--text-muted, #94A3B8);
    font-size: 0.62rem;
    text-transform: uppercase;
    font-weight: 700;
}
.rm-time-val {
    color: var(--text-primary, #0F172A);
    font-weight: 600;
}

/* Dynamic Route Caption & Legend */
.rm-caption-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    color: var(--text-secondary, #64748B);
    padding: 2px 2px;
    flex-wrap: wrap;
    gap: 8px;
}
.rm-caption-left {
    display: flex;
    align-items: center;
    gap: 6px;
}
.rm-legend-pills {
    display: flex;
    align-items: center;
    gap: 12px;
}
.rm-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #475569;
}
.rm-legend-swatch {
    width: 14px;
    height: 4px;
    border-radius: 2px;
    display: inline-block;
}
.rm-legend-swatch--planned { background: #1A73E8; }
.rm-legend-swatch--actual { background: #D946EF; }
.rm-legend-swatch--approx { background: #F59E0B; }

/* Full screen Route Map: the dialog fills the window and the map takes all the free height. */
.omni-modal-dialog--route-map.is-fullscreen {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: none;
    height: 100vh;
    max-height: none;
    border-radius: 0;
    border: 0;
    margin: 0;
}
.omni-modal-dialog--route-map.is-fullscreen .rm-modal-body { overflow: hidden; }
.omni-modal-dialog--route-map.is-fullscreen .rm-map-container {
    flex: 1 1 auto;
    height: auto;
    min-height: 320px;
}
#routeMapModalOverlay:has(.omni-modal-dialog--route-map.is-fullscreen) { padding: 0; }

/* Interactive Map Container */
.rm-map-container {
    height: clamp(300px, 46vh, 460px);
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--border-color, #CBD5E1);
    overflow: hidden;
    position: relative;
    background: #E2E8F0;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
}
.rm-map-float-legend {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 999;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.72rem;
    color: #334155;
}

/* Empty Map Panel (RM-2 b / Decision 1) */
.rm-map-empty {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #F8FAFC;
    color: var(--text-secondary, #64748B);
    gap: 10px;
    text-align: center;
    padding: 24px;
}
.rm-map-empty-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #F1F5F9;
    border: 1px solid #CBD5E1;
    color: #94A3B8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}
.rm-map-empty-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    max-width: 380px;
    line-height: 1.4;
}

/* Custom Markers */
.rm-map-marker {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    border: 2px solid #FFFFFF;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.rm-map-marker--origin {
    background: #10B981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.45);
}
.rm-map-marker--dest {
    background: #EF4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.45);
}
/* Timeline pins: where the trip ACTUALLY started / ended (first / last GPS point). */
.rm-map-marker--started { background: #0F766E; box-shadow: 0 4px 12px rgba(15, 118, 110, 0.45); }
.rm-map-marker--ended { background: #A21CAF; box-shadow: 0 4px 12px rgba(162, 28, 175, 0.45); }
.rm-map-marker--approx {
    background: #F59E0B;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.45);
}

/* Pinned Footer */
.rm-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid var(--border-color, #E2E8F0);
    background: #FFFFFF;
    flex-shrink: 0;
}
.rm-footer-links {
    display: flex;
    align-items: center;
    gap: 8px;
}
.rm-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary, #6D28D9);
    background: #F5F3FF;
    border: 1px solid #DDD6FE;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}
.rm-link-btn:hover {
    background: #EDE9FE;
    color: #5B21B6;
    border-color: #C4B5FD;
}
.rm-link-btn:disabled,
.rm-link-btn.is-disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    background: #F8FAFC !important;
    border-color: #E2E8F0 !important;
    color: #94A3B8 !important;
    pointer-events: auto;
}
.rm-link-btn:focus-visible,
.rm-recenter-btn:focus-visible,
.rm-close-btn:focus-visible,
.rm-modal-header .omni-modal-close:focus-visible {
    outline: 2px solid var(--primary, #6D28D9);
    outline-offset: 2px;
}
.rm-footer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.rm-recenter-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
    background: #FFFFFF;
    border: 1px solid var(--border-color, #CBD5E1);
    cursor: pointer;
    transition: all 0.15s ease;
}
.rm-recenter-btn:hover {
    background: #F8FAFC;
    color: var(--text-primary, #0F172A);
    border-color: #94A3B8;
}
.rm-close-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 7px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #FFFFFF;
    background: var(--primary, #6D28D9);
    border: 1px solid #5B21B6;
    cursor: pointer;
    transition: all 0.15s ease;
}
.rm-close-btn:hover {
    background: #5B21B6;
}

/* Route Map template additions (Kiro): driver photo over initials, phone copy as a real button, disabled recenter. */
.rm-avatar { position: relative; overflow: hidden; }
.rm-copy-phone { font-family: var(--font-mono, monospace); cursor: pointer; }
.rm-recenter-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ════════════════════════════════════════════════════════════════
   LIVE LOCATION MODAL (.lm-*) — real-time GPS tracking dialog
   ════════════════════════════════════════════════════════════════ */
/* The trip selector sits under Trip Details (9990), which a row click opens on top of it. */
#cnPanelModal.omni-modal-backdrop { z-index: 9985; }
.ts-row:hover { cursor: pointer; }

#liveMapModalOverlay {
    display: none;
    /* Sits under Trip Details (9990), Route Map and the document preview, which it can open on top. */
    z-index: 9985;
}
#liveMapModalOverlay.active {
    display: flex;
}

.omni-modal-dialog--live-map {
    max-width: 1080px;
    width: 95%;
    padding: 0; /* .modal-card adds 1.5rem, which framed the map in white (header/footer carry their own padding) */
    height: 86vh;
    max-height: 880px;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg, 16px);
    overflow: hidden;
    box-shadow: var(--shadow-modal, 0 25px 60px -15px rgba(0, 0, 0, 0.5));
    border: 1px solid var(--border-color, #E2E8F0);
    background: var(--bg-surface, #FFFFFF);
    transition: max-width 0.2s ease, width 0.2s ease, height 0.2s ease, border-radius 0.2s ease;
}
.omni-modal-dialog--live-map.is-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
    z-index: 10001;
}
/* Edge-to-edge: drop the backdrop's own padding/blur and the dialog's size caps while maximised. */
#liveMapModalOverlay:has(.omni-modal-dialog--live-map.is-fullscreen),
#liveMapModalOverlay:fullscreen {
    padding: 0;
    backdrop-filter: none;
    background: #0F172A;
}
.omni-modal-dialog--live-map.is-fullscreen .lm-modal-body,
.omni-modal-dialog--live-map.is-fullscreen .lm-map-container {
    width: 100%;
    height: 100%;
    min-height: 0;
    flex: 1 1 auto;
}
/* Maximised view is map-only (like Live Tracking fullscreen): header and footer return after exiting
   fullscreen via the toolbar's Exit Fullscreen button or Esc. */
.omni-modal-dialog--live-map.is-fullscreen .lm-modal-header,
.omni-modal-dialog--live-map.is-fullscreen .lm-modal-footer { display: none; }

/* Header */
.lm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color, #E2E8F0);
    background: #FFFFFF;
    flex-shrink: 0;
}
.lm-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.lm-icon-badge {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #F5F3FF;
    color: var(--primary, #6D28D9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    border: 1px solid #DDD6FE;
    flex-shrink: 0;
}
.lm-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.lm-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lm-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary, #0F172A);
    letter-spacing: -0.01em;
    margin: 0;
}
.lm-trip-code-chip {
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary, #6D28D9);
    background: #F5F3FF;
    border: 1px solid #DDD6FE;
    padding: 2px 7px;
    border-radius: 5px;
    letter-spacing: 0.02em;
}
.lm-trip-type-pill {
    font-size: 0.68rem;
    font-weight: 700;
    color: #0369A1;
    background: #E0F2FE;
    border: 1px solid #BAE6FD;
    padding: 2px 7px;
    border-radius: 5px;
}
.lm-subtitle {
    font-size: 0.72rem;
    color: var(--text-secondary, #64748B);
}
    color: var(--primary, #6D28D9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    border: 1px solid #DDD6FE;
    flex-shrink: 0;
}
.lm-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.lm-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lm-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary, #0F172A);
    letter-spacing: -0.01em;
    margin: 0;
    display: inline-flex;
    align-items: center;
}
.lm-subtitle {
    font-size: 0.72rem;
    color: var(--text-secondary, #64748B);
}

/* Pulsing live badge */
.lm-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 800;
    background: #ECFDF5;
    color: #047857;
    border: 1px solid #A7F3D0;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.lm-pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10B981;
    display: inline-block;
    animation: lmPulse 1.5s infinite;
}
@keyframes lmPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Modal Body */
.lm-modal-body {
    padding: 0;
    position: relative;
    background: #F8FAFC;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1 1 auto;
    min-height: 0;
}

/* Docked Map Controls Toolbar & Toggle Slider (top-left) */
.lm-map-controls-container {
    position: absolute;
    top: 12px;
    left: 48px; /* clear Leaflet +/- zoom controls (top:10px, left:10px, ~30-34px wide) */
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    max-width: calc(100% - 60px);
}
.lm-map-controls-toggle {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #475569;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    pointer-events: auto;
    flex-shrink: 0;
}
.lm-map-controls-toggle:hover {
    background: #EDE9FE;
    color: #6D28D9;
    border-color: rgba(109, 40, 217, 0.35);
    transform: scale(1.04);
}
.lm-map-controls-toggle.is-collapsed {
    background: #F8FAFC;
    color: #64748B;
    border-color: #CBD5E1;
}

.lm-map-toolbar {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 3px 6px;
    border-radius: 8px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
    pointer-events: auto;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: left center;
}
.lm-map-toolbar.map-controls-collapsed {
    opacity: 0;
    transform: scaleX(0.7) scaleY(0.7);
    pointer-events: none;
    max-width: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
    border-width: 0;
}
.lm-map-toolbar.map-controls-expanded {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}
.lm-tb-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #475569;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}
.lm-tb-btn:hover {
    background: #F1F5F9;
    color: #0F172A;
}
.lm-tb-btn.active {
    background: var(--primary, #6D28D9);
    color: #FFFFFF;
    border-color: #5B21B6;
}
.lm-tb-btn:disabled,
.lm-tb-btn.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
    color: #94A3B8;
    background: transparent !important;
    border-color: transparent !important;
}
.lm-tb-btn:focus-visible,
.lm-map-controls-toggle:focus-visible,
.lm-card-btn:focus-visible,
.lm-copy-btn:focus-visible,
.lm-full-link:focus-visible,
.lm-close-btn:focus-visible {
    outline: 2px solid var(--primary, #6D28D9);
    outline-offset: 2px;
}
.lm-tb-divider {
    width: 1px;
    height: 18px;
    background: #E2E8F0;
    margin: 0 2px;
}

/* Floating Single Cab Duty Telemetry Overlay (replicates Live Tracking panel) */
.lm-map-container .telemetry-overlay,
.lm-telemetry-overlay {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 360px;
    max-width: min(360px, calc(100% - 1.5rem));
    max-height: calc(100% - 1.5rem);
    z-index: 1000;
    padding: 0.85rem;
    border-radius: var(--radius-lg, 12px);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 12px 36px -4px rgba(15, 23, 42, 0.18), 0 4px 12px -2px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    overflow-y: auto;
    transition: width 300ms ease, max-height 300ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 250ms ease;
}
.lm-telemetry-overlay .panel-header {
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}
.lm-telemetry-overlay.is-collapsed {
    max-height: 48px;
    width: auto;
    min-width: 220px;
    overflow: hidden;
    padding-bottom: 0.5rem;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
}
.lm-telemetry-overlay.is-collapsed .telemetry-panel-body,
.lm-telemetry-overlay.is-collapsed .track-card,
.lm-telemetry-overlay.is-collapsed .track-card-duty-extra {
    display: none !important;
}
.track-card-duty-extra {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.5rem 0;
    border-top: 1px dashed var(--border-color, #E2E8F0);
    border-bottom: 1px dashed var(--border-color, #E2E8F0);
    margin: 0.35rem 0;
}

/* Route Origin & Destination Marker Badges */
.lm-marker-a, .lm-marker-b {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: #FFFFFF;
    font-weight: 800;
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
    border: 2px solid #FFFFFF;
}
.lm-marker-a { background: #10B981; }
.lm-marker-b { background: #EF4444; }

/* Telemetry & Trip Context Bar (#liveMapModalMeta - fallback if rendered as static strip) */
.lm-meta-bar {
    background: #FFFFFF;
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.lm-meta-bar--flat {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

/* Tier 1: Trip & Passenger Strip */
.lm-trip-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border-color, #E2E8F0);
}
.lm-trip-pax {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}
.lm-pax-name {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-primary, #0F172A);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.lm-pax-name i {
    color: var(--primary, #6D28D9);
    font-size: 0.75rem;
}
.lm-phone-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #1D4ED8;
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 5px;
    padding: 1px 6px;
    text-decoration: none;
    transition: all 0.15s ease;
}
.lm-phone-link:hover {
    background: #DBEAFE;
    color: #1E40AF;
}
.lm-phone-link:focus-visible {
    outline: 2px solid #2563EB;
    outline-offset: 1px;
}

/* Phone value and one-tap copy button (LM-4) */
.lm-phone-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.lm-phone-val {
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-primary, #1E293B);
}
.lm-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: #F1F5F9;
    border: 1px solid var(--border-color, #CBD5E1);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.66rem;
    color: var(--text-secondary, #475569);
    cursor: pointer;
    transition: all 0.15s ease;
}
.lm-copy-btn:hover {
    background: #E2E8F0;
    color: var(--text-primary, #0F172A);
    border-color: #94A3B8;
}
.lm-no-phone {
    font-size: 0.7rem;
    font-style: italic;
    color: #94A3B8;
}

/* Duty card quick actions (Decision 2) */
.lm-card-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #475569;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    cursor: pointer;
    transition: all 0.15s ease;
}
.lm-card-btn:hover {
    background: #F1F5F9;
    color: #0F172A;
    border-color: #94A3B8;
}
.lm-card-btn:disabled,
.lm-card-btn.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}
.lm-company-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #475569;
    background: #F1F5F9;
    border: 1px solid #CBD5E1;
    border-radius: 4px;
    padding: 1px 6px;
}
.lm-company-tag i {
    color: #64748B;
    font-size: 0.65rem;
}

.lm-trip-route {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lm-route-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-primary, #1E293B);
}
.lm-loc-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10B981;
    display: inline-block;
}
.lm-loc-dest {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #EF4444;
    display: inline-block;
}
.lm-time-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748B;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 4px;
    padding: 1px 6px;
}

/* Tier 2: Vehicle & Telemetry Strip */
.lm-telemetry-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.lm-telemetry-veh {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lm-meta-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.lm-plate-badge {
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    background: #F1F5F9;
    color: #1E293B;
    border: 1px solid #CBD5E1;
    letter-spacing: 0.05em;
}
.lm-vehicle-model {
    font-size: 0.72rem;
    color: #64748B;
    font-weight: 500;
}
.lm-driver-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary, #0F172A);
}
.lm-driver-phone {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #475569;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 4px;
    padding: 1px 5px;
    text-decoration: none;
    transition: all 0.15s ease;
}
.lm-driver-phone:hover {
    color: #0F172A;
    background: #F1F5F9;
    border-color: #CBD5E1;
}
.lm-driver-phone:focus-visible {
    outline: 2px solid #6D28D9;
    outline-offset: 1px;
}
.lm-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ECFDF5;
    color: #047857;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 800;
    border: 1px solid #A7F3D0;
    flex-shrink: 0;
}

.lm-telemetry-status {
    display: flex;
    align-items: center;
    gap: 8px;
}
.lm-meta-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.lm-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    line-height: 1.2;
    white-space: nowrap;
}
.lm-chip--moving,
.lm-chip--live-moving {
    background: #ECFDF5;
    color: #047857;
    border: 1px solid #A7F3D0;
}
.lm-chip--parked,
.lm-chip--live-parked {
    background: #FFFBEB;
    color: #92400E;
    border: 1px solid #FDE68A;
}
.lm-chip--delayed {
    background: #FEF3C7;
    color: #B45309;
    border: 1px solid #FCD34D;
}
.lm-chip--offline {
    background: #F1F5F9;
    color: #64748B;
    border: 1px solid #CBD5E1;
}
.lm-chip--waiting {
    background: #EFF6FF;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}
.lm-chip--ended {
    background: #F1F5F9;
    color: #475569;
    border: 1px solid #CBD5E1;
}
.lm-chip--weak {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

/* Narrow Windows Auto-Collapse (LM-10) */
@media (max-width: 768px) {
    .lm-telemetry-overlay:not(.is-expanded) {
        max-height: 48px;
        width: auto;
        min-width: 200px;
        overflow: hidden;
        padding-bottom: 0.5rem;
    }
    .lm-telemetry-overlay:not(.is-expanded) .telemetry-panel-body,
    .lm-telemetry-overlay:not(.is-expanded) .track-card,
    .lm-telemetry-overlay:not(.is-expanded) .track-card-duty-extra {
        display: none !important;
    }
}
.lm-fix-time {
    font-size: 0.68rem;
    color: var(--text-secondary, #64748B);
    white-space: nowrap;
}

/* Map Container */
.lm-map-container {
    flex: 1 1 auto;
    height: 100%;
    min-height: 520px;
    width: 100%;
    border-radius: 0;
    border: none;
    overflow: hidden;
    position: relative;
    background: #E2E8F0;
}
    overflow: hidden;
    position: relative;
    background: #E2E8F0;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
}
.lm-map-float-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 999;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    color: #334155;
}

/* Pinned Footer */
.lm-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid var(--border-color, #E2E8F0);
    background: #FFFFFF;
    flex-shrink: 0;
}
.lm-footer-links {
    display: flex;
    align-items: center;
    gap: 8px;
}
.lm-full-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary, #6D28D9);
    background: #F5F3FF;
    border: 1px solid #DDD6FE;
    padding: 6px 12px;
    border-radius: 7px;
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
}
.lm-full-link:hover {
    background: #EDE9FE;
    color: #5B21B6;
    border-color: #C4B5FD;
}
.lm-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
    background: #FFFFFF;
    border: 1px solid var(--border-color, #CBD5E1);
    padding: 6px 12px;
    border-radius: 7px;
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
}
.lm-btn-secondary:hover {
    background: #F8FAFC;
    color: var(--text-primary, #0F172A);
    border-color: #94A3B8;
}
.lm-full-link:focus-visible,
.lm-btn-secondary:focus-visible,
.lm-recenter-btn:focus-visible,
.lm-close-btn:focus-visible,
.lm-modal-header .omni-modal-close:focus-visible {
    outline: 2px solid var(--primary, #6D28D9);
    outline-offset: 2px;
}

.lm-footer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.lm-recenter-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
    background: #FFFFFF;
    border: 1px solid var(--border-color, #CBD5E1);
    cursor: pointer;
    transition: all 0.15s ease;
}
.lm-recenter-btn:hover {
    background: #F8FAFC;
    color: var(--text-primary, #0F172A);
    border-color: #94A3B8;
}
.lm-close-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 7px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #FFFFFF;
    background: var(--primary, #6D28D9);
    border: 1px solid #5B21B6;
    cursor: pointer;
    transition: all 0.15s ease;
}
.lm-close-btn:hover {
    background: #5B21B6;
}

.td-footer-actions .btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ════════════════════════════════════════════════════════════════
   REVIEW & SELECT TRIPS MODAL (.omni-modal-dialog--trip-selector / .ts-*)
   Used for Corporate Invoicing and Vendor Settlements (#cnPanelModal / cnOpenPanelModal).
   ════════════════════════════════════════════════════════════════ */

.omni-modal-dialog--trip-selector {
    width: min(1280px, 96vw) !important;
    max-width: 1280px !important;
    max-height: 88vh;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #FFFFFF;
    border-radius: var(--radius-lg, 16px);
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.45), 0 10px 20px -5px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color, #E2E8F0);
}

.ts-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color, #E2E8F0);
    background: #FFFFFF;
    flex-shrink: 0;
}
.ts-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.ts-icon-badge {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #F5F3FF;
    color: var(--primary, #6D28D9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    border: 1px solid #DDD6FE;
    flex-shrink: 0;
}
.ts-icon-badge--vendor {
    background: #FEF2F2;
    color: #DC2626;
    border-color: #FECACA;
}
.ts-title-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.ts-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.ts-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary, #0F172A);
    letter-spacing: -0.01em;
    margin: 0;
}
.ts-client-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-primary, #1E293B);
    background: #F1F5F9;
    border: 1px solid #CBD5E1;
    padding: 2px 8px;
    border-radius: 6px;
}
.ts-month-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary, #6D28D9);
    background: #F5F3FF;
    border: 1px solid #DDD6FE;
    padding: 2px 8px;
    border-radius: 6px;
}
.ts-company-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    padding: 2px 7px;
    border-radius: 5px;
}
.ts-subtitle {
    font-size: 0.72rem;
    color: var(--text-secondary, #64748B);
}

.ts-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 20px;
    background: #F8FAFC;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ts-info-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    font-size: 0.74rem;
    color: #1E40AF;
    line-height: 1.4;
}
.ts-info-strip i {
    font-size: 0.88rem;
    color: #2563EB;
    flex-shrink: 0;
}
.ts-info-strip--vendor {
    background: #FEF2F2;
    border-color: #FECACA;
    color: #991B1B;
}
.ts-info-strip--vendor i {
    color: #DC2626;
}

.ts-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.ts-search-wrap {
    position: relative;
    flex: 1;
    min-width: 240px;
    max-width: 380px;
}
.ts-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: #94A3B8;
    pointer-events: none;
}
.ts-search-input {
    width: 100%;
    padding: 6px 10px 6px 30px;
    border-radius: 7px;
    border: 1px solid #CBD5E1;
    background: #FFFFFF;
    font-size: 0.76rem;
    color: #0F172A;
    outline: none;
    transition: all 0.15s ease;
}
.ts-search-input:focus {
    border-color: var(--primary, #6D28D9);
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.12);
}
.ts-bulk-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.ts-bulk-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid #CBD5E1;
    background: #FFFFFF;
    color: var(--text-secondary, #475569);
    cursor: pointer;
    transition: all 0.15s ease;
}
.ts-bulk-btn:hover {
    background: #F1F5F9;
    color: var(--text-primary, #0F172A);
    border-color: #94A3B8;
}
.ts-bulk-btn:focus-visible,
.ts-btn-cancel:focus-visible,
.ts-btn-cta:focus-visible,
.ts-audit-btn:focus-visible {
    outline: 2px solid var(--primary, #6D28D9);
    outline-offset: 2px;
}

.ts-table-container {
    background: #FFFFFF;
    border: 1px solid var(--border-color, #E2E8F0);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
}
.ts-table {
    width: 100%;
    min-width: 1128px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    font-size: 0.76rem;
}
.ts-table--vendor {
    min-width: 1000px;
}
.ts-th {
    background: #F8FAFC;
    color: var(--text-secondary, #475569);
    font-weight: 700;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 9px 10px;
    border-bottom: 1px solid var(--border-color, #E2E8F0);
    text-align: left;
    white-space: nowrap;
    user-select: none;
}
.ts-th--right { text-align: right; }
.ts-th--center { text-align: center; }

/* Sticky Pinned Columns (TS-1) */
.ts-th--sticky-check,
.ts-td--sticky-check {
    position: sticky;
    left: 0;
    z-index: 2;
}
.ts-th--sticky-trip,
.ts-td--sticky-trip {
    position: sticky;
    left: 36px;
    z-index: 2;
    border-right: 1px solid #E2E8F0;
    box-shadow: 2px 0 4px -2px rgba(15, 23, 42, 0.08);
}
.ts-th--sticky-amt,
.ts-td--sticky-amt {
    position: sticky;
    right: 36px;
    z-index: 2;
    border-left: 1px solid #E2E8F0;
    box-shadow: -2px 0 4px -2px rgba(15, 23, 42, 0.08);
}
.ts-th--sticky-audit,
.ts-td--sticky-audit {
    position: sticky;
    right: 0;
    z-index: 2;
}

/* For Vendor Statement (where Payable is the last column, no audit): */
.ts-table--vendor .ts-th--sticky-amt,
.ts-table--vendor .ts-td--sticky-amt {
    right: 0;
}

/* Ensure sticky cells have opaque backgrounds so scrolled columns don't bleed through */
.ts-th--sticky-check,
.ts-th--sticky-trip,
.ts-th--sticky-amt,
.ts-th--sticky-audit {
    background: #F8FAFC !important;
    z-index: 4;
}
.ts-row .ts-td--sticky-check,
.ts-row .ts-td--sticky-trip,
.ts-row .ts-td--sticky-amt,
.ts-row .ts-td--sticky-audit {
    background: #FFFFFF;
}
.ts-row.is-selected .ts-td--sticky-check,
.ts-row.is-selected .ts-td--sticky-trip,
.ts-row.is-selected .ts-td--sticky-amt,
.ts-row.is-selected .ts-td--sticky-audit {
    background: #FAF5FF;
}
.ts-row:hover .ts-td--sticky-check,
.ts-row:hover .ts-td--sticky-trip,
.ts-row:hover .ts-td--sticky-amt,
.ts-row:hover .ts-td--sticky-audit {
    background: #F8FAFC;
}
.ts-row.is-selected:hover .ts-td--sticky-check,
.ts-row.is-selected:hover .ts-td--sticky-trip,
.ts-row.is-selected:hover .ts-td--sticky-amt,
.ts-row.is-selected:hover .ts-td--sticky-audit {
    background: #F3E8FF;
}

.ts-row {
    border-bottom: 1px solid #F1F5F9;
    transition: background 0.15s ease;
    background: #FFFFFF;
}
.ts-row:last-child {
    border-bottom: none;
}
.ts-row.is-selected {
    background: #FAF5FF;
}
.ts-row.is-selected:hover {
    background: #F3E8FF;
}
.ts-row.is-unselected {
    background: #FFFFFF;
}
.ts-row.is-unselected:hover {
    background: #F8FAFC;
}
.ts-row.is-unselected .ts-trip-code {
    background: #F1F5F9;
    color: #475569;
    border-color: #CBD5E1;
}
.ts-row.is-unselected .ts-point-name,
.ts-row.is-unselected .ts-pax-name,
.ts-row.is-unselected .ts-driver-name {
    color: #334155;
}
.ts-row.is-unselected .ts-amt-val {
    color: #475569;
}
.ts-td {
    padding: 9px 10px;
    vertical-align: middle;
    border-bottom: 1px solid #F1F5F9;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ts-td--right { text-align: right; }
.ts-td--center { text-align: center; }

.ts-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--primary, #6D28D9);
    cursor: pointer;
    vertical-align: middle;
    margin: 0;
    border: 1px solid #94A3B8;
    border-radius: 4px;
    background-color: #FFFFFF;
}

.ts-trip-code {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary, #6D28D9);
    background: #F5F3FF;
    border: 1px solid #DDD6FE;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.ts-copy-btn {
    background: transparent;
    border: none;
    color: #94A3B8;
    cursor: pointer;
    font-size: 0.68rem;
    padding: 0 2px;
    transition: color 0.15s ease;
}
.ts-copy-btn:hover { color: var(--primary, #6D28D9); }

.ts-date-text {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-primary, #1E293B);
    white-space: nowrap;
}
.ts-date-sub {
    font-size: 0.65rem;
    color: var(--text-secondary, #64748B);
}

.ts-route-flow {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}
.ts-route-point {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}
.ts-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.ts-dot--origin { background: #10B981; }
.ts-dot--dest { background: #EF4444; }
.ts-point-name {
    color: var(--text-primary, #1E293B);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.ts-pax-cell {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}
.ts-avatar,
.ts-pax-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #EEF2FF;
    color: #4338CA;
    font-size: 0.64rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #C7D2FE;
    flex-shrink: 0;
}
.ts-pax-name {
    font-weight: 700;
    color: var(--text-primary, #0F172A);
    font-size: 0.74rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}

.ts-pkg-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    color: #0369A1;
    background: #E0F2FE;
    border: 1px solid #BAE6FD;
    padding: 2px 7px;
    border-radius: 4px;
    white-space: nowrap;
}

.ts-driver-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}
.ts-driver-name {
    font-weight: 700;
    color: var(--text-primary, #1E293B);
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.ts-owner-tag {
    align-self: flex-start;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
}
.ts-owner-tag--self {
    background: #EEF2FF;
    color: #4338CA;
    border: 1px solid #C7D2FE;
}
.ts-owner-tag--vendor {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
}

.ts-km-est {
    color: #94A3B8;
    font-size: 0.74rem;
    font-family: var(--font-mono, monospace);
}
.ts-km-gps {
    color: var(--text-secondary, #64748B);
    font-size: 0.74rem;
    font-family: var(--font-mono, monospace);
}
/* NOTE: these classes sit on the <td> itself. They must NOT change display (it used to be inline-flex, which
   pulled the cell out of the table layout and left the Billed km column misaligned). */
.ts-km-billed {
    font-weight: 800;
    color: var(--text-primary, #0F172A);
    font-size: 0.76rem;
    font-family: var(--font-mono, monospace);
    text-align: right;
    white-space: nowrap;
}
.ts-km-lock {
    font-size: 0.62rem;
    color: #94A3B8;
    margin-left: 4px;
}
.ts-km-vendor {
    font-weight: 800;
    color: #92400E;
    font-size: 0.76rem;
    font-family: var(--font-mono, monospace);
    text-align: right;
    white-space: nowrap;
}
.ts-km-vendor.is-overridden { color: #B45309; }
.ts-km-edited { font-size: 0.58rem; color: #B45309; margin-left: 4px; }
.ts-veh-pill { font-family: var(--font-mono, monospace); font-weight: 700; }
.ts-table--vendor .ts-td { padding-top: 8px; padding-bottom: 8px; }
.ts-table--vendor .ts-date-sub { margin-top: 2px; }

.ts-amt-val {
    font-family: var(--font-mono, monospace);
    font-weight: 800;
    font-size: 0.82rem;
    color: var(--text-primary, #0F172A);
    white-space: nowrap;
}
.ts-amt-val--payable {
    color: #B91C1C;
}

.ts-td--audit {
    text-align: center;
    padding: 4px 2px;
    vertical-align: middle;
}
.ts-td--audit button,
.ts-td--audit .activity-balloon-btn {
    margin: 0 auto;
    border: 1px solid #E2E8F0 !important;
    background: #FFFFFF !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: all 0.15s ease;
}
.ts-td--audit button:hover,
.ts-td--audit .activity-balloon-btn:hover {
    background: #EDE9FE !important;
    border-color: #DDD6FE !important;
    color: var(--primary, #6D28D9) !important;
}

.ts-audit-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 1px solid var(--border-color, #E2E8F0);
    color: var(--primary, #6D28D9);
    font-size: 0.72rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: none;
}
.ts-audit-btn:hover {
    background: #EDE9FE;
    color: var(--primary, #6D28D9);
    border-color: #DDD6FE;
}

.ts-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid var(--border-color, #E2E8F0);
    background: #FFFFFF;
    flex-shrink: 0;
    gap: 12px;
    flex-wrap: wrap;
}
.ts-footer-summary {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ts-summary-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.ts-count-tag {
    font-size: 0.84rem;
    font-weight: 800;
    color: var(--primary, #6D28D9);
    background: #F5F3FF;
    border: 1px solid #DDD6FE;
    padding: 2px 9px;
    border-radius: 6px;
}
.ts-count-tag--vendor {
    color: #B91C1C;
    background: #FEF2F2;
    border-color: #FECACA;
}
.ts-total-val {
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--text-primary, #0F172A);
    font-family: var(--font-mono, monospace);
}
.ts-summary-hint {
    font-size: 0.68rem;
    color: var(--text-secondary, #64748B);
    display: flex;
    align-items: center;
    gap: 5px;
}
.ts-summary-hint--warn {
    color: #B45309;
    background: #FEF3C7;
    border: 1px solid #FDE68A;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.68rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
}
.ts-summary-hint--warn i {
    color: #D97706;
    font-size: 0.72rem;
}
.ts-footer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.ts-btn-cancel {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #CBD5E1;
    background: #FFFFFF;
    color: var(--text-secondary, #475569);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.ts-btn-cancel:hover {
    background: #F1F5F9;
    color: var(--text-primary, #0F172A);
    border-color: #94A3B8;
}
.ts-btn-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 18px;
    min-width: 250px;
    border-radius: 8px;
    background: var(--primary, #6D28D9);
    color: #FFFFFF;
    font-size: 0.8rem;
    font-weight: 700;
    border: 1px solid #5B21B6;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(109, 40, 217, 0.3);
}
.ts-btn-cta:hover:not(:disabled) {
    background: #5B21B6;
}
.ts-btn-cta:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}
.ts-btn-cta.is-busy {
    opacity: 0.85;
    cursor: wait;
    pointer-events: none;
    background: #5B21B6;
}
.ts-btn-cta.is-busy i {
    animation: fa-spin 1s infinite linear;
}
.ts-btn-cta--vendor {
    background: #DC2626;
    border-color: #B91C1C;
    box-shadow: 0 1px 3px rgba(220, 38, 38, 0.3);
}
.ts-btn-cta--vendor:hover:not(:disabled) {
    background: #B91C1C;
}
.ts-btn-cta--vendor.is-busy {
    background: #B91C1C;
}

.ts-empty-card {
    padding: 40px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #FFFFFF;
    border: 1px dashed #CBD5E1;
    border-radius: 12px;
}
.ts-empty-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #F1F5F9;
    color: #94A3B8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}
.ts-empty-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #1E293B;
}
.ts-empty-desc {
    font-size: 0.74rem;
    color: var(--text-secondary, #64748B);
    max-width: 380px;
}

/* ==========================================================================
   VEHICLE ASSET MODAL (Add / Edit) — Modern Executive Layout
   ========================================================================== */

.omni-modal-dialog--vehicle {
    background: #FFFFFF;
    border-radius: 16px;
    width: min(780px, 96vw);
    max-width: 780px;
    max-height: 90vh;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.45), 0 10px 20px -5px rgba(0, 0, 0, 0.1);
    border: 1px solid #E2E8F0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0 auto;
    animation: vmModalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes vmModalPop {
    0% { transform: scale(0.97) translateY(8px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Pinned Executive Header */
.vm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #E2E8F0;
    background: #FFFFFF;
    flex-shrink: 0;
}
.vm-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.vm-icon-badge {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #F5F3FF;
    color: #6D28D9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    border: 1px solid #DDD6FE;
    flex-shrink: 0;
}
.vm-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.vm-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.vm-title {
    font-size: 1.08rem;
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.01em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.vm-subtitle {
    font-size: 0.72rem;
    color: #64748B;
}

.vm-plate-chip {
    display: inline-flex;
    align-items: center;
    background: #F8FAFC;
    border: 1.5px solid #CBD5E1;
    border-radius: 5px;
    padding: 2px 7px 2px 5px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 800;
    font-size: 0.76rem;
    letter-spacing: 0.05em;
    color: #0F172A;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.vm-plate-chip[hidden] {
    display: none !important;
}
.vm-plate-ind {
    background: #1E40AF;
    color: #FFFFFF;
    font-size: 0.55rem;
    font-weight: 900;
    padding: 1px 3px;
    border-radius: 2px;
    margin-right: 5px;
    letter-spacing: 0;
}

.vm-header .omni-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    background: #FFFFFF;
    color: #64748B;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.vm-header .omni-modal-close:hover {
    background: #F1F5F9;
    color: #0F172A;
    border-color: #CBD5E1;
}
.vm-header .omni-modal-close:focus-visible {
    outline: 2px solid #6D28D9;
    outline-offset: 2px;
}

/* Scrollable Modal Body */
.vm-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 20px;
    background: #F8FAFC;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Structured Card Section */
.vm-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.vm-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid #F1F5F9;
}
.vm-card-title {
    font-size: 0.8rem;
    font-weight: 800;
    color: #1E293B;
    display: flex;
    align-items: center;
    gap: 7px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.vm-card-title i {
    color: #6D28D9;
    font-size: 0.85rem;
}
.vm-card-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    background: #F1F5F9;
    color: #475569;
    border: 1px solid #E2E8F0;
}

/* Form Grids & Fields */
.vm-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.vm-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}
.vm-grid-4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 10px;
}

@media (max-width: 680px) {
    .vm-grid-2, .vm-grid-3, .vm-grid-4 {
        grid-template-columns: 1fr;
    }
}

.vm-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}
.vm-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.vm-req {
    color: #EF4444;
    font-weight: 800;
    margin-left: 2px;
}
.vm-label-hint {
    font-size: 0.65rem;
    font-weight: 500;
    color: #94A3B8;
    text-transform: none;
    letter-spacing: normal;
}

/* Vehicle photo upload zone (Edit Vehicle modal — owner/admin only). Decoupled upload: the
   file is POSTed to /api/uploads/photo, then its URL is PUT to /api/vehicles/{id}/photo. */
.vh-photo-zone {
    position: relative;
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    background: #F8FAFC;
    min-height: 132px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    overflow: hidden;
}
.vh-photo-zone:hover,
.vh-photo-zone.is-dragover {
    border-color: #6D28D9;
    background: #F5F3FF;
}
.vh-photo-zone:focus-visible {
    outline: none;
    border-color: #6D28D9;
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.18);
}
.vh-photo-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #94A3B8;
    text-align: center;
    padding: 16px;
}
.vh-photo-empty i { font-size: 1.4rem; color: #6D28D9; }
.vh-photo-empty span { font-size: 0.8rem; font-weight: 600; color: #475569; }
.vh-photo-empty small { font-size: 0.68rem; color: #94A3B8; }
.vh-photo-preview-wrap {
    position: relative;
    width: 100%;
    height: 132px;
}
.vh-photo-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}
.vh-photo-clear-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}
.vh-photo-clear-btn:hover { background: rgba(220, 38, 38, 0.9); }
.vh-photo-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #6D28D9;
    font-size: 0.8rem;
    font-weight: 600;
    width: 100%;
    height: 132px;
}
.vh-photo-spinner i { font-size: 1.1rem; }

.vm-input, .vm-select {
    width: 100%;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    padding: 8px 11px;
    font-size: 0.82rem;
    color: #0F172A;
    background: #FFFFFF;
    outline: none;
    transition: all 0.15s ease;
    font-family: inherit;
    box-sizing: border-box;
}
.vm-input:focus, .vm-select:focus {
    border-color: #6D28D9;
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.12);
}
.vm-input:disabled {
    background: #F8FAFC;
    color: #475569;
    cursor: not-allowed;
    border-color: #E2E8F0;
}

/* Field Validation States (VM-8, VM-9) */
.vm-input.is-invalid,
.vm-select.is-invalid,
.vm-vendor-picker-host.is-invalid input,
#editVehVendorPickerHost.is-invalid input {
    border-color: #EF4444 !important;
    background-color: #FEF2F2 !important;
}
.vm-input.is-invalid:focus,
.vm-select.is-invalid:focus,
.vm-vendor-picker-host.is-invalid input:focus,
#editVehVendorPickerHost.is-invalid input:focus {
    border-color: #DC2626 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.vm-field-error {
    font-size: 0.68rem;
    font-weight: 600;
    color: #DC2626;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1.3;
}
.vm-field-error:empty {
    display: none;
}

.vm-input--plate {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: #FAF5FF;
    border-color: #DDD6FE;
    color: #5B21B6;
}
.vm-input--plate:disabled {
    background: #F8FAFC;
    border-color: #CBD5E1;
    color: #1E293B;
}

/* Currency & Suffix Input Wrap */
.vm-input-addon-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.vm-input-prefix {
    position: absolute;
    left: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #64748B;
    pointer-events: none;
}
.vm-input--has-prefix {
    padding-left: 24px;
}

/* Mileage + Suggest Action Wrap */
.vm-mileage-group {
    display: flex;
    gap: 6px;
    align-items: center;
}
.vm-btn-suggest {
    flex: 0 0 auto;
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid #DDD6FE;
    background: #F5F3FF;
    color: #6D28D9;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.vm-btn-suggest:hover:not(:disabled) {
    background: #EDE9FE;
    border-color: #C4B5FD;
    color: #5B21B6;
}
.vm-btn-suggest:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Compliance Expiry Cards */
.vm-expiry-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    padding: 8px 10px;
    border-radius: 8px;
    transition: all 0.15s ease;
}
.vm-expiry-item:focus-within {
    border-color: #6D28D9;
    background: #FFFFFF;
    box-shadow: 0 0 0 2px rgba(109, 40, 217, 0.1);
}
.vm-expiry-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.vm-expiry-tag {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
}
.vm-expiry-tag--valid {
    background: #ECFDF5;
    color: #059669;
    border: 1px solid #A7F3D0;
}
.vm-expiry-tag--warning {
    background: #FEF3C7;
    color: #B45309;
    border: 1px solid #FDE68A;
}
.vm-expiry-tag--expired {
    background: #FEF2F2;
    color: #DC2626;
    border: 1px solid #FECACA;
}
.vm-expiry-tag--empty {
    background: #F1F5F9;
    color: #64748B;
    border: 1px solid #CBD5E1;
}
.vm-input--date {
    border: 1px solid #CBD5E1;
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 0.78rem;
    background: #FFFFFF;
    color: #0F172A;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

/* Vendor Picker Host */
.vm-vendor-picker-host {
    min-height: 38px;
}

/* Pinned Footer */
.vm-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid #E2E8F0;
    background: #FFFFFF;
    flex-shrink: 0;
    gap: 12px;
    flex-wrap: wrap;
}
.vm-footer-note {
    font-size: 0.72rem;
    color: #64748B;
    display: flex;
    align-items: center;
    gap: 5px;
}
.vm-footer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.vm-btn-cancel {
    padding: 8px 18px;
    border-radius: 8px;
    border: 1px solid #CBD5E1;
    background: #FFFFFF;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.vm-btn-cancel:hover {
    background: #F1F5F9;
    color: #0F172A;
    border-color: #94A3B8;
}
.vm-btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 20px;
    min-width: 170px;
    border-radius: 8px;
    background: #6D28D9;
    color: #FFFFFF;
    font-size: 0.82rem;
    font-weight: 700;
    border: 1px solid #5B21B6;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(109, 40, 217, 0.3);
}
.vm-btn-submit:hover:not(:disabled) {
    background: #5B21B6;
}
.vm-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}
.vm-btn-submit.is-busy {
    opacity: 0.85;
    cursor: wait;
    pointer-events: none;
    background: #5B21B6;
}
.vm-btn-submit.is-busy i {
    animation: fa-spin 1s infinite linear;
}

.vm-btn-cancel:focus-visible,
.vm-btn-submit:focus-visible,
.vm-btn-suggest:focus-visible {
    outline: 2px solid #6D28D9;
    outline-offset: 2px;
}

/* ==========================================================================
   DRIVER ASSET MODAL (Add / Edit) — Modern Executive Layout
   ========================================================================== */

.omni-modal-dialog--driver {
    background: #FFFFFF;
    border-radius: 16px;
    width: min(780px, 96vw);
    max-width: 780px;
    max-height: 90vh;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.45), 0 10px 20px -5px rgba(0, 0, 0, 0.1);
    border: 1px solid #E2E8F0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0 auto;
    animation: dmModalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dmModalPop {
    0% { transform: scale(0.97) translateY(8px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Pinned Executive Header */
.dm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #E2E8F0;
    background: #FFFFFF;
    flex-shrink: 0;
}
.dm-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.dm-icon-badge {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #F5F3FF;
    color: #6D28D9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    border: 1px solid #DDD6FE;
    flex-shrink: 0;
}
.dm-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.dm-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.dm-title {
    font-size: 1.08rem;
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.01em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dm-subtitle {
    font-size: 0.72rem;
    color: #64748B;
}
.dm-type-chip {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 6px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
}
.dm-type-chip--self {
    background: #ECFDF5;
    color: #059669;
    border: 1px solid #A7F3D0;
}
.dm-type-chip--vendor {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
}
.dm-type-chip--temp {
    background: #FEF3C7;
    color: #B45309;
    border: 1px solid #FDE68A;
}
.dm-type-chip[hidden] {
    display: none !important;
}

.dm-header .omni-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    background: #FFFFFF;
    color: #64748B;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.dm-header .omni-modal-close:hover {
    background: #F1F5F9;
    color: #0F172A;
    border-color: #CBD5E1;
}
.dm-header .omni-modal-close:focus-visible {
    outline: 2px solid #6D28D9;
    outline-offset: 2px;
}

/* Scrollable Modal Body */
.dm-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 20px;
    background: #F8FAFC;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Structured Card Section */
.dm-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.dm-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid #F1F5F9;
}
.dm-card-title {
    font-size: 0.8rem;
    font-weight: 800;
    color: #1E293B;
    display: flex;
    align-items: center;
    gap: 7px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.dm-card-title i {
    color: #6D28D9;
    font-size: 0.85rem;
}
.dm-card-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    background: #F1F5F9;
    color: #475569;
    border: 1px solid #E2E8F0;
}
.dm-card-badge--valid {
    background: #ECFDF5;
    color: #059669;
    border-color: #A7F3D0;
}
.dm-card-badge--warning {
    background: #FEF3C7;
    color: #B45309;
    border-color: #FDE68A;
}
.dm-card-badge--expired {
    background: #FEF2F2;
    color: #DC2626;
    border-color: #FECACA;
}
.dm-card-badge--empty {
    background: #F1F5F9;
    color: #64748B;
    border-color: #CBD5E1;
}

/* Grids */
.dm-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.dm-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}
.dm-grid-4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 10px;
}

@media (max-width: 680px) {
    .dm-grid-2, .dm-grid-3, .dm-grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Fields & Labels */
.dm-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}
.dm-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.dm-req {
    color: #EF4444;
    font-weight: 800;
    margin-left: 2px;
}
.dm-label-hint {
    font-size: 0.65rem;
    font-weight: 500;
    color: #94A3B8;
    text-transform: none;
    letter-spacing: normal;
}

.dm-input, .dm-select {
    width: 100%;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    padding: 8px 11px;
    font-size: 0.82rem;
    color: #0F172A;
    background: #FFFFFF;
    outline: none;
    transition: all 0.15s ease;
    font-family: inherit;
    box-sizing: border-box;
}
.dm-input:focus, .dm-select:focus {
    border-color: #6D28D9;
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.12);
}
.dm-input:disabled {
    background: #F8FAFC;
    color: #475569;
    cursor: not-allowed;
    border-color: #E2E8F0;
}

.dm-input--mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    letter-spacing: 0.04em;
    font-weight: 700;
}

/* Addon Prefix Wrap */
.dm-input-addon-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.dm-input-prefix {
    position: absolute;
    left: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #64748B;
    pointer-events: none;
}
.dm-input--has-prefix {
    padding-left: 24px;
}

/* Profile Photo Strip */
.dm-photo-strip {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
}
.dm-avatar-wrap {
    position: relative;
    width: 58px;
    height: 58px;
    flex-shrink: 0;
}
.dm-avatar-initials {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #EDE9FE;
    color: #6D28D9;
    border: 2px solid #DDD6FE;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    font-weight: 800;
    user-select: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.dm-avatar-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #DDD6FE;
    background: #FFFFFF;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: block;
}
.dm-avatar-preview[src=""],
.dm-avatar-preview:not([src]),
.dm-avatar-preview[hidden],
.dm-avatar-preview.is-hidden {
    display: none !important;
}
.dm-photo-actions {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.dm-btn-upload {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 7px;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    color: #334155;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    width: fit-content;
}
.dm-btn-upload:hover {
    background: #F1F5F9;
    color: #0F172A;
    border-color: #94A3B8;
}
.dm-photo-hint {
    font-size: 0.68rem;
    color: #64748B;
}

/* Checkbox Rows */
.dm-checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
}
.dm-checkbox-row:hover {
    background: #F1F5F9;
}
.dm-checkbox {
    width: 17px;
    height: 17px;
    border-radius: 4px;
    accent-color: #6D28D9;
    cursor: pointer;
}
.dm-checkbox-text {
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
}

/* Notice Boxes */
.dm-notice-box {
    font-size: 0.78rem;
    line-height: 1.4;
    padding: 10px 14px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 9px;
}
.dm-notice-box--amber {
    background: #FEF3C7;
    border: 1px solid #FDE68A;
    color: #92400E;
}
.dm-notice-box--info {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    color: #1E40AF;
}
.dm-notice-box--error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #991B1B;
}
#driverModalErrorBanner:empty {
    display: none !important;
}

/* Validation States */
.dm-input.is-invalid,
.dm-select.is-invalid,
.dm-vendor-picker-host.is-invalid input,
#editDrvVendorPickerHost.is-invalid input {
    border-color: #EF4444 !important;
    background-color: #FEF2F2 !important;
}
.dm-input.is-invalid:focus,
.dm-select.is-invalid:focus,
.dm-vendor-picker-host.is-invalid input:focus,
#editDrvVendorPickerHost.is-invalid input:focus {
    border-color: #DC2626 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}
.dm-field-error {
    font-size: 0.68rem;
    font-weight: 600;
    color: #DC2626;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1.3;
}
.dm-field-error:empty { display: none; }

/* Pinned Footer */
.dm-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid #E2E8F0;
    background: #FFFFFF;
    flex-shrink: 0;
    gap: 12px;
    flex-wrap: wrap;
}
.dm-footer-note {
    font-size: 0.72rem;
    color: #64748B;
    display: flex;
    align-items: center;
    gap: 5px;
}
.dm-footer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.dm-btn-cancel {
    padding: 8px 18px;
    border-radius: 8px;
    border: 1px solid #CBD5E1;
    background: #FFFFFF;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.dm-btn-cancel:hover {
    background: #F1F5F9;
    color: #0F172A;
    border-color: #94A3B8;
}
.dm-btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 20px;
    min-width: 175px;
    border-radius: 8px;
    background: #6D28D9;
    color: #FFFFFF;
    font-size: 0.82rem;
    font-weight: 700;
    border: 1px solid #5B21B6;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(109, 40, 217, 0.3);
}
.dm-btn-submit:hover:not(:disabled) {
    background: #5B21B6;
}
.dm-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}
.dm-btn-submit.is-busy {
    opacity: 0.85;
    cursor: wait;
    pointer-events: none;
    background: #5B21B6;
}
.dm-btn-submit.is-busy i {
    animation: fa-spin 1s infinite linear;
}

.dm-btn-cancel:focus-visible,
.dm-btn-submit:focus-visible,
.dm-btn-upload:focus-visible {
    outline: 2px solid #6D28D9;
    outline-offset: 2px;
}

/* ==========================================================================
   TEAM MEMBER MODAL (Add / Edit) — Modern Executive Layout
   ========================================================================== */

.omni-modal-dialog--team {
    background: #FFFFFF;
    border-radius: 16px;
    width: min(760px, 96vw);
    max-width: 760px;
    max-height: 90vh;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.45), 0 10px 20px -5px rgba(0, 0, 0, 0.1);
    border: 1px solid #E2E8F0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0 auto;
    animation: tmModalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    color: #0F172A;
}

@keyframes tmModalPop {
    0% { transform: scale(0.97) translateY(8px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Pinned Executive Header */
.tm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #E2E8F0;
    background: #FFFFFF;
    flex-shrink: 0;
}
.tm-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.tm-icon-badge {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #F5F3FF;
    color: #6D28D9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    border: 1px solid #DDD6FE;
    flex-shrink: 0;
}
.tm-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.tm-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.tm-title {
    font-size: 1.08rem;
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.01em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tm-subtitle {
    font-size: 0.72rem;
    color: #64748B;
}
.tm-role-chip {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 6px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.tm-role-chip--owner {
    background: #FAF5FF;
    color: #7C3AED;
    border: 1px solid #E9D5FF;
}
.tm-role-chip--admin {
    background: #EFF6FF;
    color: #2563EB;
    border: 1px solid #DBEAFE;
}
.tm-role-chip--manager {
    background: #FDF4FF;
    color: #A21CAF;
    border: 1px solid #F5D0FE;
}
.tm-role-chip--dispatcher {
    background: #ECFDF5;
    color: #059669;
    border: 1px solid #A7F3D0;
}
.tm-role-chip[hidden] {
    display: none !important;
}

.tm-header .omni-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    background: #FFFFFF;
    color: #64748B;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.tm-header .omni-modal-close:hover {
    background: #F1F5F9;
    color: #0F172A;
    border-color: #CBD5E1;
}
.tm-header .omni-modal-close:focus-visible {
    outline: 2px solid #6D28D9;
    outline-offset: 2px;
}

/* Scrollable Modal Body */
.tm-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 20px;
    background: #F8FAFC;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Structured Card Section */
.tm-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.tm-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid #F1F5F9;
}
.tm-card-title {
    font-size: 0.8rem;
    font-weight: 800;
    color: #1E293B;
    display: flex;
    align-items: center;
    gap: 7px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.tm-card-title i {
    color: #6D28D9;
    font-size: 0.85rem;
}
.tm-card-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    background: #F1F5F9;
    color: #475569;
    border: 1px solid #E2E8F0;
}
.tm-card-badge--valid {
    background: #ECFDF5;
    color: #059669;
    border-color: #A7F3D0;
}
.tm-card-badge--warning {
    background: #FEF3C7;
    color: #B45309;
    border-color: #FDE68A;
}
.tm-card-badge--empty {
    background: #F1F5F9;
    color: #64748B;
    border-color: #CBD5E1;
}

/* Form Grids & Fields */
.tm-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.tm-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

@media (max-width: 680px) {
    .tm-grid-2, .tm-grid-3 {
        grid-template-columns: 1fr;
    }
}

.tm-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}
.tm-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.tm-req {
    color: #EF4444;
    font-weight: 800;
    margin-left: 2px;
}
.tm-label-hint {
    font-size: 0.65rem;
    font-weight: 500;
    color: #94A3B8;
    text-transform: none;
    letter-spacing: normal;
}

.tm-input, .tm-select {
    width: 100%;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    padding: 8px 11px;
    font-size: 0.82rem;
    color: #0F172A;
    background: #FFFFFF;
    outline: none;
    transition: all 0.15s ease;
    font-family: inherit;
    box-sizing: border-box;
}
.tm-input:focus, .tm-select:focus {
    border-color: #6D28D9;
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.12);
}
.tm-input:disabled, .tm-select:disabled {
    background: #F8FAFC;
    color: #64748B;
    cursor: not-allowed;
    border-color: #E2E8F0;
}
.tm-input--mono {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
    letter-spacing: 0.04em;
    font-weight: 600;
}

/* Photo Upload Strip */
.tm-photo-strip {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
}
.tm-avatar-wrap {
    position: relative;
    width: 58px;
    height: 58px;
    flex-shrink: 0;
}
.tm-avatar-initials {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #EDE9FE;
    color: #6D28D9;
    border: 2px solid #DDD6FE;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    font-weight: 800;
    user-select: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.tm-avatar-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #DDD6FE;
    background: #FFFFFF;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: block;
}
.tm-avatar-preview[src=""],
.tm-avatar-preview:not([src]),
.tm-avatar-preview[hidden],
.tm-avatar-preview.is-hidden {
    display: none !important;
}

.tm-photo-actions {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.tm-btn-upload {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 7px;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    color: #334155;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    width: fit-content;
}
.tm-btn-upload:hover {
    background: #F1F5F9;
    color: #0F172A;
    border-color: #94A3B8;
}
.tm-photo-hint {
    font-size: 0.68rem;
    color: #64748B;
}

/* Notice Boxes */
.tm-notice-box {
    font-size: 0.78rem;
    line-height: 1.4;
    padding: 10px 14px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 9px;
}
.tm-notice-box--info {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    color: #1E40AF;
}
.tm-notice-box--role {
    background: #FAF5FF;
    border: 1px solid #E9D5FF;
    color: #6D28D9;
}
.tm-notice-box--error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #991B1B;
}
#teamModalErrorBanner:empty {
    display: none !important;
}

/* Document Slots */
.tm-doc-slot {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tm-file-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    color: #64748B;
}
.tm-file-input {
    font-size: 0.72rem;
    color: #475569;
    max-width: 100%;
}
.tm-file-input::file-selector-button {
    padding: 4px 10px;
    border-radius: 6px;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    color: #334155;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    margin-right: 6px;
    transition: all 0.15s ease;
}
.tm-file-input::file-selector-button:hover {
    background: #F1F5F9;
    color: #0F172A;
}

/* Validation States */
.tm-input.is-invalid,
.tm-select.is-invalid {
    border-color: #EF4444 !important;
    background-color: #FEF2F2 !important;
}
.tm-input.is-invalid:focus,
.tm-select.is-invalid:focus {
    border-color: #DC2626 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}
.tm-field-error {
    font-size: 0.68rem;
    font-weight: 600;
    color: #DC2626;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1.3;
}
.tm-field-error:empty { display: none; }

/* Pinned Footer */
.tm-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid #E2E8F0;
    background: #FFFFFF;
    flex-shrink: 0;
    gap: 12px;
    flex-wrap: wrap;
}
.tm-footer-note {
    font-size: 0.72rem;
    color: #64748B;
    display: flex;
    align-items: center;
    gap: 5px;
}
.tm-footer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.tm-btn-cancel {
    padding: 8px 18px;
    border-radius: 8px;
    border: 1px solid #CBD5E1;
    background: #FFFFFF;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.tm-btn-cancel:hover {
    background: #F1F5F9;
    color: #0F172A;
    border-color: #94A3B8;
}
.tm-btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 20px;
    min-width: 190px;
    border-radius: 8px;
    background: #6D28D9;
    color: #FFFFFF;
    font-size: 0.82rem;
    font-weight: 700;
    border: 1px solid #5B21B6;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(109, 40, 217, 0.3);
}
.tm-btn-submit:hover:not(:disabled) {
    background: #5B21B6;
}
.tm-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}
.tm-btn-submit.is-busy {
    opacity: 0.85;
    cursor: wait;
    pointer-events: none;
    background: #5B21B6;
}
.tm-btn-submit.is-busy i {
    animation: fa-spin 1s infinite linear;
}

.tm-btn-cancel:focus-visible,
.tm-btn-submit:focus-visible,
.tm-btn-upload:focus-visible {
    outline: 2px solid #6D28D9;
    outline-offset: 2px;
}

/* ==========================================================================
   RECIPIENT PICKER MODAL (WhatsApp & Email Dialog) — Executive Redesign
   ========================================================================== */

.rp-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.omni-modal-dialog--picker {
    background: #FFFFFF;
    border-radius: 16px;
    width: min(480px, 95vw);
    max-height: 88vh;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.4), 0 10px 20px -5px rgba(0, 0, 0, 0.08);
    border: 1px solid #E2E8F0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0 auto;
    animation: rpModalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    color: #0F172A;
}

@keyframes rpModalPop {
    0% { transform: scale(0.97) translateY(8px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Pinned Executive Header */
.rp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #E2E8F0;
    background: #FFFFFF;
    flex-shrink: 0;
}
.rp-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.rp-icon-badge {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.rp-icon-badge--email {
    background: #F5F3FF;
    color: #6D28D9;
    border: 1px solid #DDD6FE;
}
.rp-icon-badge--wa {
    background: #F0FDF4;
    color: #16A34A;
    border: 1px solid #BBF7D0;
}

.rp-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.rp-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.rp-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.01em;
    margin: 0;
}
.rp-channel-badge {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 6px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.rp-channel-badge--wa {
    background: #ECFDF5;
    color: #059669;
    border: 1px solid #A7F3D0;
}
.rp-channel-badge--email {
    background: #FAF5FF;
    color: #7C3AED;
    border: 1px solid #E9D5FF;
}
.rp-subtitle {
    font-size: 0.72rem;
    color: #64748B;
}

.rp-header .omni-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    background: #FFFFFF;
    color: #64748B;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.rp-header .omni-modal-close:hover {
    background: #F1F5F9;
    color: #0F172A;
    border-color: #CBD5E1;
}
.rp-header .omni-modal-close:focus-visible {
    outline: 2px solid #6D28D9;
    outline-offset: 2px;
}

/* Sub-Header Toolbar (.rp-toolbar) */
.rp-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 18px;
    background: #F8FAFC;
    border-bottom: 1px solid #F1F5F9;
    flex-shrink: 0;
    font-size: 0.74rem;
}
.rp-toolbar-count {
    color: #475569;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.rp-toolbar-count strong {
    color: #0F172A;
    font-weight: 800;
}
.rp-toolbar-actions {
    display: flex;
    gap: 6px;
}
.rp-tool-btn {
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    color: #475569;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s ease;
}
.rp-tool-btn:hover {
    background: #F1F5F9;
    color: #0F172A;
    border-color: #94A3B8;
}

/* Scrollable Body (.rp-body) */
.rp-body {
    flex: 1 1 auto;
    min-height: 80px;
    overflow-y: auto;
    padding: 12px 18px;
    background: #F8FAFC;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Candidate Card (.rp-candidate-card) */
.rp-candidate-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    user-select: none;
    box-sizing: border-box;
}
.rp-candidate-card:hover {
    border-color: #CBD5E1;
    background: #FFFFFF;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}
.rp-candidate-card.is-checked {
    border-color: #DDD6FE;
    background: #F5F3FF;
}
.rp-candidate-card.is-checked.rp-candidate-card--wa {
    border-color: #BBF7D0;
    background: #F0FDF4;
}

/* Checkbox */
.rp-check-wrap {
    padding-top: 2px;
    flex-shrink: 0;
}
.rp-check {
    width: 17px;
    height: 17px;
    cursor: pointer;
    accent-color: #6D28D9;
    margin: 0;
}
.rp-candidate-card--wa .rp-check {
    accent-color: #16A34A;
}

/* Card Content */
.rp-candidate-content {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.rp-candidate-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.rp-candidate-name {
    font-size: 0.86rem;
    font-weight: 700;
    color: #0F172A;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Role Pills */
.rp-role-pill {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}
.rp-role-pill--passenger {
    background: #EFF6FF;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}
.rp-role-pill--driver {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
}
.rp-role-pill--booker {
    background: #FDF4FF;
    color: #86198F;
    border: 1px solid #F5D0FE;
}
.rp-role-pill--owner {
    background: #FAF5FF;
    color: #6D28D9;
    border: 1px solid #E9D5FF;
}
.rp-role-pill--other {
    background: #F1F5F9;
    color: #475569;
    border: 1px solid #E2E8F0;
}
.rp-role-pill--dev {
    background: #F1F5F9;
    color: #475569;
    border: 1px solid #CBD5E1;
}

/* Contact Readout */
.rp-contact-mono {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
    font-size: 0.78rem;
    color: #334155;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    word-break: break-all;
}

/* Inline Input for Missing Email/Phone */
.rp-inline-wrap {
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.rp-inline-box {
    display: flex;
    align-items: center;
    position: relative;
}
.rp-inline-icon {
    position: absolute;
    left: 9px;
    font-size: 0.75rem;
    color: #94A3B8;
    pointer-events: none;
}
.rp-inline-contact {
    width: 100%;
    border: 1px solid #CBD5E1;
    border-radius: 7px;
    padding: 6px 10px 6px 28px;
    font-size: 0.78rem;
    color: #0F172A;
    background: #FFFFFF;
    outline: none;
    transition: all 0.15s ease;
    font-family: inherit;
    box-sizing: border-box;
}
.rp-inline-contact:focus {
    border-color: #6D28D9;
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.12);
}
.rp-candidate-card--wa .rp-inline-contact:focus {
    border-color: #16A34A;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}
.rp-inline-contact.is-invalid {
    border-color: #EF4444 !important;
    background: #FEF2F2 !important;
}
.rp-inline-error {
    font-size: 0.68rem;
    font-weight: 600;
    color: #DC2626;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Pinned Footer (.rp-footer) */
.rp-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    border-top: 1px solid #E2E8F0;
    background: #FFFFFF;
    flex-shrink: 0;
    gap: 12px;
}
.rp-footer-note {
    font-size: 0.72rem;
    color: #64748B;
    display: flex;
    align-items: center;
    gap: 5px;
}
.rp-footer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.rp-btn-cancel {
    padding: 7px 15px;
    border-radius: 8px;
    border: 1px solid #CBD5E1;
    background: #FFFFFF;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.rp-btn-cancel:hover {
    background: #F1F5F9;
    color: #0F172A;
    border-color: #94A3B8;
}
.rp-btn-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 18px;
    min-width: 140px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #FFFFFF;
    border: none;
}
.rp-btn-send--email {
    background: #6D28D9;
    border: 1px solid #5B21B6;
    box-shadow: 0 1px 3px rgba(109, 40, 217, 0.3);
}
.rp-btn-send--email:hover:not(:disabled) {
    background: #5B21B6;
}
.rp-btn-send--wa {
    background: #16A34A;
    border: 1px solid #15803D;
    box-shadow: 0 1px 3px rgba(22, 163, 74, 0.3);
}
.rp-btn-send--wa:hover:not(:disabled) {
    background: #15803D;
}
.rp-btn-send:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}
.rp-btn-send.is-busy {
    opacity: 0.9;
    cursor: wait;
    pointer-events: none;
}

.rp-btn-cancel:focus-visible,
.rp-btn-send:focus-visible,
.rp-tool-btn:focus-visible {
    outline: 2px solid #6D28D9;
    outline-offset: 2px;
}




/* ==========================================================================
   CORPORATE CLIENT MODAL (Add / Edit) — Modern Executive Layout
   ========================================================================== */

.omni-modal-dialog--client {
    background: #FFFFFF;
    border-radius: 16px;
    width: min(780px, 96vw);
    max-width: 780px;
    max-height: 90vh;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.45), 0 10px 20px -5px rgba(0, 0, 0, 0.1);
    border: 1px solid #CBD5E1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0 auto;
    color: #0F172A;
    animation: ccModalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ccModalPop {
    0% { transform: scale(0.97) translateY(8px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Pinned Executive Header */
.cc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #E2E8F0;
    background: #FFFFFF;
    flex-shrink: 0;
}
.cc-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.cc-icon-badge {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #F5F3FF;
    color: #6D28D9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    border: 1px solid #DDD6FE;
    flex-shrink: 0;
}
.cc-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.cc-title {
    font-size: 1.08rem;
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.01em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cc-subtitle {
    font-size: 0.72rem;
    color: #64748B;
}
.cc-header .omni-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    background: #FFFFFF;
    color: #64748B;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.cc-header .omni-modal-close:hover {
    background: #F1F5F9;
    color: #0F172A;
    border-color: #CBD5E1;
}

/* Scrollable Body */
.cc-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 20px;
    background: #F8FAFC;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Structured Card Section */
.cc-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.cc-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid #F1F5F9;
}
.cc-card-title {
    font-size: 0.8rem;
    font-weight: 800;
    color: #1E293B;
    display: flex;
    align-items: center;
    gap: 7px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.cc-card-title i {
    color: #6D28D9;
    font-size: 0.85rem;
}
.cc-card-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    background: #F1F5F9;
    color: #475569;
    border: 1px solid #E2E8F0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.cc-card-badge--primary {
    background: #F5F3FF;
    color: #6D28D9;
    border-color: #DDD6FE;
}
.cc-card-badge--optional {
    background: #F8FAFC;
    color: #64748B;
    border-color: #E2E8F0;
}

/* Grids */
.cc-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.cc-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}
.cc-col-span-2 {
    grid-column: span 2;
}

@media (max-width: 680px) {
    .cc-grid-2, .cc-grid-3 {
        grid-template-columns: 1fr;
    }
    .cc-col-span-2 {
        grid-column: span 1;
    }
}

.cc-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}
.cc-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.cc-req {
    color: #EF4444;
    font-weight: 800;
    margin-left: 2px;
}
.cc-label-hint {
    font-size: 0.65rem;
    font-weight: 500;
    color: #94A3B8;
    text-transform: none;
    letter-spacing: normal;
}

.cc-input, .cc-select {
    width: 100%;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    padding: 8px 11px;
    font-size: 0.82rem;
    color: #0F172A;
    background: #FFFFFF;
    outline: none;
    transition: all 0.15s ease;
    font-family: inherit;
    box-sizing: border-box;
}
.cc-input:focus, .cc-select:focus {
    border-color: #6D28D9;
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.12);
}
.cc-input--mono {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
    letter-spacing: 0.04em;
    font-weight: 600;
}
.cc-field-caption {
    font-size: 0.68rem;
    color: #64748B;
    line-height: 1.35;
    margin-top: 2px;
}

/* Group Row with Manage Button */
.cc-group-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.cc-btn-manage {
    height: 38px;
    padding: 0 12px;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: all 0.15s ease;
    flex-shrink: 0;
    font-family: inherit;
}
.cc-btn-manage:hover {
    background: #F1F5F9;
    color: #0F172A;
    border-color: #94A3B8;
}

/* Advanced Billing Toggle */
.cc-adv-toggle-bar {
    margin-top: 2px;
}
.cc-adv-toggle-btn {
    width: 100%;
    background: #FFFFFF;
    border: 1px dashed #CBD5E1;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s ease;
    font-family: inherit;
}
.cc-adv-toggle-btn i {
    transition: transform 0.2s ease;
}
.cc-adv-toggle-btn[aria-expanded="true"] i {
    transform: rotate(180deg);
}
.cc-adv-toggle-btn:hover {
    background: #F8FAFC;
    border-color: #6D28D9;
    color: #6D28D9;
}

/* Advanced Container */
.cc-advanced-panel {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Address Multi-line Stack */
.cc-address-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Modern Compliance / Tax Checkbox Grid */
.cc-compliance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 8px;
}
.cc-toggle-tile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    background: #F8FAFC;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    margin: 0;
}
.cc-toggle-tile:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
}
.cc-toggle-tile input[type="checkbox"] {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    accent-color: #6D28D9;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}
.cc-toggle-tile span {
    font-size: 0.74rem;
    font-weight: 600;
    color: #334155;
    line-height: 1.25;
}
.cc-toggle-tile:has(input:checked) {
    background: #F5F3FF;
    border-color: #DDD6FE;
}
.cc-toggle-tile:has(input:checked) span {
    color: #5B21B6;
    font-weight: 700;
}

/* Pinned Footer */
.cc-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid #E2E8F0;
    background: #FFFFFF;
    flex-shrink: 0;
    gap: 12px;
    flex-wrap: wrap;
}
.cc-footer-note {
    font-size: 0.72rem;
    color: #64748B;
    display: flex;
    align-items: center;
    gap: 6px;
}
.cc-footer-note i {
    color: #6D28D9;
    font-size: 0.8rem;
}
.cc-footer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.cc-btn-cancel {
    padding: 8px 16px;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}
.cc-btn-cancel:hover {
    background: #F1F5F9;
    color: #0F172A;
    border-color: #94A3B8;
}
.cc-btn-save {
    padding: 8px 18px;
    background: #6D28D9;
    border: 1px solid #5B21B6;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #FFFFFF;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.15s ease;
    box-shadow: 0 2px 6px rgba(109, 40, 217, 0.25);
    font-family: inherit;
}
.cc-btn-save:hover {
    background: #5B21B6;
    box-shadow: 0 4px 10px rgba(109, 40, 217, 0.35);
    transform: translateY(-1px);
}


/* Notice banner & validation states */
.cc-notice-box {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.75rem;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 10px;
}
.cc-notice-box--error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #B91C1C;
}
#ccErrorBanner:empty {
    display: none !important;
}

.cc-input.is-invalid,
.cc-select.is-invalid {
    border-color: #EF4444 !important;
    background-color: #FEF2F2 !important;
}
.cc-input.is-invalid:focus,
.cc-select.is-invalid:focus {
    border-color: #DC2626 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}
.cc-field-error {
    font-size: 0.68rem;
    font-weight: 600;
    color: #DC2626;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1.3;
}
.cc-field-error:empty {
    display: none;
}

.cc-btn-save.is-busy {
    opacity: 0.85;
    cursor: wait;
    pointer-events: none;
}

/* Records only group */
.cc-records-group {
    background: #F8FAFC;
    border: 1px dashed #CBD5E1;
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cc-records-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.cc-records-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 6px;
}
.cc-records-badge {
    font-size: 0.65rem;
    font-weight: 600;
    color: #94A3B8;
    background: #F1F5F9;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid #E2E8F0;
}


/* ═══════════════════════════════════════════════════════════════
   ADD / EDIT VENDOR MODAL (.omni-modal-dialog--vendor / .vnm-* & .vn-*)
   Phase 2 Web Polish — Pinned Executive Header & Footer,
   State in Primary Card, Collapsible Advanced Panel, 9-Tile Policy Grid
   ═══════════════════════════════════════════════════════════════ */

.omni-modal-dialog--vendor {
    background: #FFFFFF;
    border-radius: 16px;
    width: min(780px, 96vw);
    max-width: 780px;
    max-height: 90vh;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.45), 0 10px 20px -5px rgba(0, 0, 0, 0.1);
    border: 1px solid #CBD5E1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0 auto;
    color: #0F172A;
    animation: vnmModalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes vnmModalPop {
    0% { transform: scale(0.97) translateY(8px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Pinned Executive Header */
.vnm-header,
.omni-modal-dialog--vendor .vn-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #E2E8F0;
    background: #FFFFFF;
    flex-shrink: 0;
}
.vnm-header-left,
.omni-modal-dialog--vendor .vn-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.vnm-icon-badge,
.omni-modal-dialog--vendor .vn-icon-badge {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #F5F3FF;
    color: #6D28D9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    border: 1px solid #DDD6FE;
    flex-shrink: 0;
}
.vnm-title-group,
.omni-modal-dialog--vendor .vn-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.vnm-title,
.omni-modal-dialog--vendor .vn-title {
    font-size: 1.08rem;
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.01em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
/* Suppress inline icon written into #vnFormTitle by legacy vendors.js to prevent duplicate icon */
.vnm-title i,
.omni-modal-dialog--vendor #vnFormTitle i {
    display: none;
}
.vnm-subtitle,
.omni-modal-dialog--vendor .vn-subtitle {
    font-size: 0.72rem;
    color: #64748B;
}
.vnm-header .omni-modal-close,
.omni-modal-dialog--vendor .vn-header .omni-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    background: #FFFFFF;
    color: #64748B;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.vnm-header .omni-modal-close:hover,
.omni-modal-dialog--vendor .vn-header .omni-modal-close:hover {
    background: #F1F5F9;
    color: #0F172A;
    border-color: #CBD5E1;
}

/* Scrollable Body */
.vnm-body,
.omni-modal-dialog--vendor .vn-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 20px;
    background: #F8FAFC;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Notice Box / Error Banner */
.vnm-notice-box,
.omni-modal-dialog--vendor .vn-notice-box {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.75rem;
    line-height: 1.45;
}
.vnm-notice-box--error,
.omni-modal-dialog--vendor .vn-notice-box--error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #991B1B;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
#vnErrorBanner:empty {
    display: none !important;
}

/* Structured Card Section */
.vnm-card,
.omni-modal-dialog--vendor .vn-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.vnm-card-header,
.omni-modal-dialog--vendor .vn-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid #F1F5F9;
}
.vnm-card-title,
.omni-modal-dialog--vendor .vn-card-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: #1E293B;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 7px;
}
.vnm-card-title i,
.omni-modal-dialog--vendor .vn-card-title i {
    color: #6D28D9;
}
.vnm-card-badge,
.omni-modal-dialog--vendor .vn-card-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    color: #475569;
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.vnm-card-badge--primary,
.omni-modal-dialog--vendor .vn-card-badge--primary {
    background: #F5F3FF;
    color: #6D28D9;
    border-color: #DDD6FE;
}

/* Form Grids & Layouts */
.vnm-grid-2,
.omni-modal-dialog--vendor .vn-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.vnm-col-span-2,
.omni-modal-dialog--vendor .vn-col-span-2 {
    grid-column: span 2;
}

@media (max-width: 680px) {
    .vnm-grid-2,
    .omni-modal-dialog--vendor .vn-grid-2 {
        grid-template-columns: 1fr;
    }
    .vnm-col-span-2,
    .omni-modal-dialog--vendor .vn-col-span-2 {
        grid-column: span 1;
    }
}

.vnm-field,
.omni-modal-dialog--vendor .vn-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}
.vnm-label,
.omni-modal-dialog--vendor .vn-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.vnm-req,
.omni-modal-dialog--vendor .vn-req {
    color: #EF4444;
    font-weight: 800;
    margin-left: 2px;
}
.vnm-label-hint,
.omni-modal-dialog--vendor .vn-label-hint {
    font-size: 0.65rem;
    font-weight: 500;
    color: #94A3B8;
    text-transform: none;
    letter-spacing: normal;
}
.vnm-field-caption,
.omni-modal-dialog--vendor .vn-field-caption {
    font-size: 0.65rem;
    color: #94A3B8;
    margin-top: 1px;
}

.vnm-input,
.vnm-select,
.omni-modal-dialog--vendor .vn-input,
.omni-modal-dialog--vendor .vn-select {
    width: 100%;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    padding: 8px 11px;
    font-size: 0.82rem;
    color: #0F172A;
    background: #FFFFFF;
    outline: none;
    transition: all 0.15s ease;
    font-family: inherit;
    box-sizing: border-box;
}
.vnm-input:focus,
.vnm-select:focus,
.omni-modal-dialog--vendor .vn-input:focus,
.omni-modal-dialog--vendor .vn-select:focus {
    border-color: #6D28D9;
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.12);
}
.vnm-input.is-invalid,
.vnm-select.is-invalid,
.omni-modal-dialog--vendor .vn-input.is-invalid,
.omni-modal-dialog--vendor .vn-select.is-invalid {
    border-color: #DC2626 !important;
    background: #FEF2F2 !important;
}
.vnm-input.is-invalid:focus,
.vnm-select.is-invalid:focus,
.omni-modal-dialog--vendor .vn-input.is-invalid:focus,
.omni-modal-dialog--vendor .vn-select.is-invalid:focus {
    border-color: #DC2626 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}
.vnm-field-error,
.omni-modal-dialog--vendor .vn-field-error {
    font-size: 0.68rem;
    font-weight: 600;
    color: #DC2626;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1.3;
}
.vnm-field-error:empty,
.omni-modal-dialog--vendor .vn-field-error:empty {
    display: none;
}
.vnm-input--mono,
.omni-modal-dialog--vendor .vn-input--mono {
    font-family: var(--font-mono, monospace);
    letter-spacing: 0.04em;
    font-weight: 600;
}

/* Advanced Settings Accordion Trigger */
.vnm-adv-toggle-bar,
.omni-modal-dialog--vendor .vn-adv-toggle-bar {
    margin-top: 2px;
}
.vnm-adv-toggle-btn,
.omni-modal-dialog--vendor .vn-adv-toggle-btn {
    width: 100%;
    background: #FFFFFF;
    border: 1px dashed #CBD5E1;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s ease;
    font-family: inherit;
}
.vnm-adv-toggle-btn i,
.omni-modal-dialog--vendor .vn-adv-toggle-btn i {
    transition: transform 0.2s ease;
}
.vnm-adv-toggle-btn:hover,
.omni-modal-dialog--vendor .vn-adv-toggle-btn:hover {
    background: #F8FAFC;
    border-color: #6D28D9;
    color: #6D28D9;
}
.vnm-adv-toggle-btn[aria-expanded="true"] i,
.omni-modal-dialog--vendor .vn-adv-toggle-btn[aria-expanded="true"] i {
    transform: rotate(180deg);
}

/* Advanced Container */
.vnm-advanced-panel,
.omni-modal-dialog--vendor .vn-advanced-panel {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Address Multi-line Stack (3 lines) */
.vnm-address-stack,
.omni-modal-dialog--vendor .vn-address-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Statutory Tax & Dispatch Allocation Checkbox Grid */
.vnm-compliance-grid,
.omni-modal-dialog--vendor .vn-compliance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 8px;
}
.vnm-toggle-tile,
.omni-modal-dialog--vendor .vn-toggle-tile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    margin: 0;
}
.vnm-toggle-tile:hover,
.omni-modal-dialog--vendor .vn-toggle-tile:hover {
    border-color: #CBD5E1;
    background: #F8FAFC;
}
.vnm-toggle-tile:has(input:checked),
.omni-modal-dialog--vendor .vn-toggle-tile:has(input:checked) {
    background: #F5F3FF;
    border-color: #DDD6FE;
    color: #5B21B6;
}
.vnm-toggle-tile input[type="checkbox"],
.omni-modal-dialog--vendor .vn-toggle-tile input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #6D28D9;
    cursor: pointer;
    margin: 0;
}

/* Pinned Executive Footer */
.vnm-footer,
.omni-modal-dialog--vendor .vn-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid #E2E8F0;
    background: #FFFFFF;
    flex-shrink: 0;
    gap: 12px;
}
.vnm-footer-note,
.omni-modal-dialog--vendor .vn-footer-note {
    font-size: 0.72rem;
    color: #64748B;
    display: flex;
    align-items: center;
    gap: 6px;
}
.vnm-footer-note i,
.omni-modal-dialog--vendor .vn-footer-note i {
    color: #6D28D9;
}
.vnm-footer-actions,
.omni-modal-dialog--vendor .vn-footer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.vnm-btn-cancel,
.omni-modal-dialog--vendor .vn-btn-cancel {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid #CBD5E1;
    background: #FFFFFF;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}
.vnm-btn-cancel:hover,
.omni-modal-dialog--vendor .vn-btn-cancel:hover {
    background: #F1F5F9;
    color: #0F172A;
    border-color: #94A3B8;
}
.vnm-btn-save,
.omni-modal-dialog--vendor .vn-btn-save {
    padding: 8px 18px;
    border-radius: 8px;
    border: none;
    background: #6D28D9;
    color: #FFFFFF;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.15s ease;
    box-shadow: 0 2px 6px rgba(109, 40, 217, 0.25);
    font-family: inherit;
}
.vnm-btn-save:hover,
.omni-modal-dialog--vendor .vn-btn-save:hover {
    background: #5B21B6;
    box-shadow: 0 4px 10px rgba(109, 40, 217, 0.35);
    transform: translateY(-1px);
}
.vnm-btn-save.is-busy,
.omni-modal-dialog--vendor .vn-btn-save.is-busy {
    opacity: 0.85;
    cursor: wait;
    pointer-events: none;
}


/* Records only group (VN-1) */
.vnm-records-group,
.omni-modal-dialog--vendor .vn-records-group {
    background: #F8FAFC;
    border: 1px dashed #CBD5E1;
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.vnm-records-header,
.omni-modal-dialog--vendor .vn-records-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.vnm-records-title,
.omni-modal-dialog--vendor .vn-records-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 6px;
}
.vnm-records-badge,
.omni-modal-dialog--vendor .vn-records-badge {
    font-size: 0.65rem;
    font-weight: 600;
    color: #94A3B8;
    background: #F1F5F9;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid #E2E8F0;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   FLEET COMMAND DASHBOARD STYLES (Landing Page)
   Prefix: .dash-
   Strictly follows design tokens & DB-1..DB-6, DB-10..DB-11 visual specification
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ─── Layout & Header ─── */
.dash-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.dash-header-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dash-title {
    font-family: var(--heading-font);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.dash-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.dash-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ─── Period Switcher ─── */
.dash-period-switch {
    display: inline-flex;
    align-items: center;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.dash-period-btn {
    border: none;
    background: transparent;
    padding: 0.35rem 0.75rem;
    font-family: var(--font-family);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.dash-period-btn:hover {
    color: var(--text-main);
}

.dash-period-btn.active {
    background: var(--primary);
    color: #FFFFFF;
    box-shadow: 0 2px 6px rgba(109, 40, 217, 0.25);
    font-weight: 700;
}

/* ─── Buttons ─── */
.dash-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.45rem 0.95rem;
    font-family: var(--font-family);
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    border: 1px solid transparent;
}

.dash-btn-primary {
    background: var(--primary);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(109, 40, 217, 0.25);
}

.dash-btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(109, 40, 217, 0.35);
}

.dash-btn-outline {
    background: #FFFFFF;
    color: var(--text-secondary);
    border-color: var(--border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.dash-btn-outline:hover {
    background: var(--bg-card-hover);
    color: var(--text-main);
    border-color: var(--border-strong);
}

.dash-btn-sm {
    padding: 0.3rem 0.65rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

.dash-btn-full {
    width: 100%;
}

.dash-link-btn {
    border: none;
    background: transparent;
    color: var(--primary);
    font-family: var(--font-family);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0;
}

.dash-link-btn:hover {
    text-decoration: underline;
}

/* ─── Bands Container ─── */
.dash-band {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    margin-bottom: 1.25rem;
}

.dash-band:last-child {
    margin-bottom: 0;
}

/* Zero gap when Band C is hidden for non-owners */
#dashMoneyBand[style*="display: none"],
#dashMoneyBand.dash-hidden {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.dash-band-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.dash-band-title-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dash-band-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dash-indicator-amber { background: var(--warning); }
.dash-indicator-emerald { background: var(--success); }
.dash-indicator-purple { background: var(--primary); }

.dash-band-title {
    font-family: var(--heading-font);
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-main);
    margin: 0;
}

.dash-band-caption {
    font-size: 0.75rem;
    color: var(--text-dimmed);
    font-weight: 500;
}

.dash-scope-caption {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0.25rem 0 0 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.dash-scope-caption i {
    color: var(--text-dimmed);
}

/* ─── Badges & Chips ─── */
.dash-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.dash-badge-amber {
    background: var(--warning-soft);
    color: var(--warning-text);
    border: 1px solid var(--warning-border);
}

.dash-badge-owner {
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid var(--primary-soft-border);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dash-mono-chip {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    background: #F1F5F9;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-xs);
}

/* ─── Status Dots & Pulsing (DB-10) ─── */
.dash-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.dash-status-dot.started { background: #10B981; }
.dash-status-dot.allocated { background: #8B5CF6; }
.dash-status-dot.unallocated { background: #F59E0B; }
.dash-status-dot.completed { background: #64748B; }
.dash-status-dot.cancelled { background: #94A3B8; }

@keyframes dashPulseGlow {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.35); opacity: 0.6; }
}

.dash-status-dot.pulse-live {
    animation: dashPulseGlow 1.8s infinite ease-in-out;
}

/* ─── BAND A: Attention Grid & Cards ─── */
.dash-attention-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.75rem;
}

.dash-attention-card {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.15s ease;
    cursor: pointer;
}

.dash-attention-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    border-color: var(--border-strong);
}

.dash-attention-card.urgent {
    border-left-color: var(--danger);
}

.dash-attention-card.warning {
    border-left-color: var(--warning);
}

.dash-attention-card.info {
    border-left-color: var(--info);
}

.dash-attention-card.purple {
    border-left-color: var(--primary);
}

.dash-attn-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.dash-attn-title {
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--text-main);
}

.dash-attn-body {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin: 0.35rem 0;
}

.dash-attn-footer {
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
}

/* ─── Celebratory Empty State (Nothing Needs Attention) ─── */
.dash-empty-celebration {
    background: #FFFFFF;
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.25rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.05);
}

.dash-celebration-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--success-soft);
    color: var(--success);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    box-shadow: inset 0 2px 4px rgba(16, 185, 129, 0.15);
}

.dash-celebration-title {
    font-family: var(--heading-font);
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0 0 0.35rem 0;
}

.dash-celebration-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    max-width: 540px;
    margin: 0 auto 1rem auto;
    line-height: 1.5;
}

.dash-celebration-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--success-soft);
    color: var(--success-text);
    border: 1px solid var(--success-border);
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ─── Common Error & Empty States ─── */
.dash-error-state,
.dash-empty-state {
    padding: 2.5rem 1.25rem;
    text-align: center;
}

.dash-error-icon,
.dash-empty-icon {
    font-size: 1.75rem;
    color: var(--text-dimmed);
    margin-bottom: 0.65rem;
}

.dash-error-icon {
    color: var(--danger);
}

.dash-error-title,
.dash-empty-title {
    font-family: var(--heading-font);
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0 0 0.35rem 0;
}

.dash-error-msg,
.dash-empty-msg {
    font-size: 0.78rem;
    color: var(--text-muted);
    max-width: 420px;
    margin: 0 auto 1rem auto;
    line-height: 1.5;
}

/* ─── BAND B: Chips & Live Board ─── */
.dash-board-header {
    margin-bottom: 1rem;
}

.dash-board-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.dash-urgency-tag {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.dash-chips-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dash-board-chips {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.dash-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.78rem;
    font-weight: 700;
    background: #FFFFFF;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.dash-chip:hover {
    background: var(--bg-card-hover);
    color: var(--text-main);
    border-color: var(--border-strong);
}

.dash-chip.active {
    background: var(--primary);
    color: #FFFFFF;
    border-color: var(--primary);
    box-shadow: 0 2px 6px rgba(109, 40, 217, 0.25);
}

.dash-chip-count {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.06);
    color: inherit;
}

.dash-chip.active .dash-chip-count {
    background: rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
}

/* Link-Style Unpaid Chip (DB-6) */
.dash-chip-unpaid {
    background: var(--warning-soft);
    color: var(--warning-text);
    border-color: var(--warning-border);
    margin-left: auto;
}

.dash-chip-unpaid:hover {
    background: #FEF3C7;
    border-color: #F59E0B;
}

.dash-chip-unpaid i {
    color: #D97706;
}

.dash-external-icon {
    font-size: 0.65rem;
    margin-left: 0.2rem;
}

/* ─── 7-Column Live Pulse Table (DB-10) ─── */
.dash-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #FFFFFF;
}

.dash-pulse-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    text-align: left;
}

.dash-pulse-table thead {
    background: #F8FAFC;
    border-bottom: 1px solid var(--border-color);
}

.dash-pulse-table th {
    padding: 0.65rem 0.85rem;
    font-family: var(--font-family);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    white-space: nowrap;
}

.dash-pulse-table td {
    padding: 0.75rem 0.85rem;
    border-top: 1px solid var(--border-light);
    color: var(--text-secondary);
    vertical-align: middle;
}

.dash-pulse-table tbody tr {
    transition: background-color 0.15s ease;
    cursor: pointer;
}

.dash-pulse-table tbody tr:hover {
    background-color: #F8FAFC;
}

.dash-pulse-table tr.row-urgent {
    background-color: #FFFDF7;
}

.dash-pulse-table tr.row-urgent:hover {
    background-color: #FEF9EE;
}

/* Start time has passed and the trip has not started: smooth red pulse across the whole row. */
@keyframes dash-row-late-pulse {
    0%, 100% { background-color: #FFF5F5; }
    50%      { background-color: #FECACA; }
}

.dash-pulse-table tr.row-late,
.dash-pulse-table tr.row-late:hover {
    animation: dash-row-late-pulse 1.6s ease-in-out infinite;
    box-shadow: inset 3px 0 0 #DC2626;
}

@media (prefers-reduced-motion: reduce) {
    .dash-pulse-table tr.row-late,
    .dash-pulse-table tr.row-late:hover { animation: none; background-color: #FEE2E2; }
}

.dash-cell-time {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.74rem;
    white-space: nowrap;
}

.dash-cell-booking {
    white-space: nowrap;
}

.dash-client-name {
    font-weight: 700;
    color: var(--text-main);
}

.dash-passenger-name {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.dash-route-text {
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 190px;
}

.dash-package-text {
    font-size: 0.7rem;
    color: var(--text-dimmed);
    margin-top: 2px;
}

.dash-vehicle-info {
    font-weight: 600;
    color: var(--text-main);
}

.dash-driver-info {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.dash-plate-chip {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    background: #F1F5F9;
    color: var(--text-secondary);
    padding: 0.1rem 0.35rem;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border-color);
    display: inline-block;
    margin-left: 0.35rem;
}

/* Row Action Buttons */
.dash-btn-row-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.65rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.dash-btn-action-track {
    background: var(--warning-soft);
    color: var(--warning-text);
    border-color: var(--warning-border);
}
.dash-btn-action-track:hover {
    background: #FEF3C7;
}

.dash-btn-action-allocate {
    background: var(--danger);
    color: #FFFFFF;
}
.dash-btn-action-allocate:hover {
    background: var(--danger-text);
}

.dash-btn-action-bill {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: var(--primary-soft-border);
}
.dash-btn-action-bill:hover {
    background: #EDE9FE;
}

.dash-btn-action-details {
    background: #F1F5F9;
    color: var(--text-secondary);
    border-color: var(--border-color);
}
.dash-btn-action-details:hover {
    background: #E2E8F0;
    color: var(--text-main);
}

/* Board Footer */
.dash-board-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dash-view-all-link {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.dash-view-all-link:hover {
    text-decoration: underline;
}

/* ─── BAND C: Money & Financial Performance ─── */
.dash-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.dash-kpi-card {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.dash-kpi-collected { border-top-color: var(--success); }
.dash-kpi-revenue { border-top-color: var(--primary); }
.dash-kpi-outstanding { border-top-color: var(--warning); }
.dash-kpi-profit { border-top-color: var(--info); }

.dash-kpi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.dash-kpi-label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.dash-kpi-icon-wrap {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.dash-kpi-collected .dash-kpi-icon-wrap { background: var(--success-soft); color: var(--success); }
.dash-kpi-revenue .dash-kpi-icon-wrap { background: var(--primary-soft); color: var(--primary); }
.dash-kpi-outstanding .dash-kpi-icon-wrap { background: var(--warning-soft); color: var(--warning); }
.dash-kpi-profit .dash-kpi-icon-wrap { background: var(--info-soft); color: var(--info); }

.dash-kpi-value {
    font-family: var(--font-mono);
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.dash-kpi-collected .dash-kpi-value { color: var(--success-text); }
.dash-kpi-revenue .dash-kpi-value { color: var(--primary); }
.dash-kpi-outstanding .dash-kpi-value { color: var(--warning-text); }
.dash-kpi-profit .dash-kpi-value { color: var(--info-text); }

.dash-kpi-value-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.dash-margin-pill {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-xs);
    background: var(--info-soft);
    color: var(--info-text);
}

.dash-kpi-footer {
    margin-top: 0.65rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
    font-size: 0.72rem;
    color: var(--text-muted);
}

.dash-kpi-split {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dash-kpi-subval {
    font-weight: 700;
    color: var(--text-main);
}

/* ─── 4 Real Aging Buckets Bar (DB-4) ─── */
.dash-aging-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.35rem;
    font-size: 0.7rem;
}

.dash-aging-bar {
    width: 100%;
    height: 6px;
    border-radius: 9999px;
    background: #F1F5F9;
    display: flex;
    overflow: hidden;
}

.dash-aging-segment {
    height: 100%;
    transition: width 0.3s ease;
}

.dash-aging-segment.seg-0-7 { background: #10B981; }
.dash-aging-segment.seg-8-30 { background: #3B82F6; }
.dash-aging-segment.seg-31-60 { background: #F59E0B; }
.dash-aging-segment.seg-60-plus { background: #EF4444; }

.dash-aging-legend {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.35rem;
    font-size: 0.65rem;
    color: var(--text-dimmed);
}

/* ─── Financial Chart & Today Summary ─── */
.dash-chart-card {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.dash-chart-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.dash-chart-title {
    font-family: var(--heading-font);
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dash-chart-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0.25rem 0 0 0;
}

.dash-chart-legend {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.dash-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dash-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot-revenue { background: #6D28D9; }
.dot-collected { background: #10B981; }

.dash-canvas-container {
    position: relative;
    width: 100%;
    height: 240px;
}

/* Today Summary Grid (DB-5) */
.dash-today-numbers {
    padding: 0.5rem 0;
}

.dash-today-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
}

.dash-today-note {
    font-size: 0.72rem;
    color: var(--text-dimmed);
    font-style: italic;
}

.dash-today-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
    text-align: center;
}

.dash-today-card {
    background: #F8FAFC;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 0.75rem;
}

.dash-today-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

.dash-today-value {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 900;
    margin-top: 0.35rem;
}

.text-purple { color: var(--primary); }
.text-emerald { color: var(--success); }
.text-blue { color: var(--info); }

.dash-today-sub {
    font-size: 0.72rem;
    color: var(--text-dimmed);
    margin-top: 0.25rem;
}

.dash-today-margin {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--info-text);
    margin-top: 0.25rem;
}

/* ─── PEEK DRAWER (DB-11) ─── */
.dash-peek-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    z-index: 1040;
    transition: opacity 0.2s ease;
}

.dash-peek-overlay.is-hidden {
    display: none;
}

.dash-peek-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 380px;
    max-width: 100vw;
    background: #FFFFFF;
    border-left: 1px solid var(--border-color);
    box-shadow: -8px 0 25px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.dash-peek-drawer.is-hidden {
    transform: translateX(100%);
    pointer-events: none;
}

.dash-peek-header {
    padding: 1rem 1.25rem;
    background: #F8FAFC;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dash-peek-heading-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dash-peek-close {
    background: transparent;
    border: none;
    color: var(--text-dimmed);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dash-peek-close:hover {
    color: var(--text-main);
    background: rgba(0, 0, 0, 0.05);
}

.dash-peek-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    font-size: 0.78rem;
}

.dash-peek-fact-box {
    background: #F8FAFC;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
}

.dash-peek-fact-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-dimmed);
    letter-spacing: 0.03em;
    margin-bottom: 0.25rem;
}

.dash-peek-fact-value {
    font-weight: 700;
    color: var(--text-main);
}

.dash-peek-footer {
    padding: 1rem 1.25rem;
    background: #F8FAFC;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.dash-peek-alt-action {
    text-align: center;
}

/* ─── Skeletons & Shimmer Animation ─── */
@keyframes dashShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.dash-loading-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem;
}

.dash-skeleton-card {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.dash-skeleton-line {
    height: 12px;
    border-radius: 4px;
    background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
    background-size: 200% 100%;
    animation: dashShimmer 1.5s infinite;
}

.dash-skeleton-line.short { width: 35%; }
.dash-skeleton-line.medium { width: 65%; }
.dash-skeleton-line.long { width: 90%; }

.dash-loading-table {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #FFFFFF;
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.dash-skeleton-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
}

.dash-skeleton-cell {
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
    background-size: 200% 100%;
    animation: dashShimmer 1.5s infinite;
}

.dash-skeleton-cell.cell-xs { width: 50px; }
.dash-skeleton-cell.cell-sm { width: 80px; }
.dash-skeleton-cell.cell-md { width: 140px; }
.dash-skeleton-cell.cell-lg { width: 200px; flex: 1; }

/* ─── Accessibility & Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {
    .dash-status-dot.pulse-live,
    .dash-skeleton-line,
    .dash-skeleton-cell {
        animation: none !important;
    }

    .dash-peek-drawer {
        transition: none !important;
    }

    .dash-btn,
    .dash-chip,
    .dash-pulse-table tbody tr {
        transition: none !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   Dashboard - runtime states added with the JS renderers (dashboard.js)
   ═══════════════════════════════════════════════════════════════════════ */
.dash-attn-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    background: var(--bg-card-hover);
    color: var(--text-secondary);
}
.dash-attn-badge.urgent { background: var(--danger-soft); color: var(--danger-text); }
.dash-attn-badge.warning { background: var(--warning-soft); color: var(--warning-text); }
.dash-attn-badge.info { background: var(--info-soft); color: var(--info-text); }
.dash-attn-badge.purple { background: var(--primary-soft); color: var(--primary); }
.dash-attn-code { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); }
.dash-attn-line { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.5; }
.dash-attn-action-wrap { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }

.dash-attention-badge {
    display: inline-block;
    margin-top: 0.2rem;
    padding: 0.1rem 0.45rem;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    background: var(--warning-soft);
    color: var(--warning-text);
}
.dash-attention-badge.is-unallocated,
.dash-attention-badge.is-late-start { background: var(--danger-soft); color: var(--danger-text); }
.dash-attention-badge.is-overdue { background: var(--warning-soft); color: var(--warning-text); }

.dash-status-indicator { display: flex; align-items: center; gap: 0.35rem; font-weight: 600; font-size: 0.78rem; }
.dash-unassigned { color: var(--text-dimmed); font-style: italic; font-weight: 500; }
.dash-prev-day-tag {
    display: inline-block;
    margin-top: 0.15rem;
    padding: 0 0.35rem;
    border-radius: 4px;
    font-family: var(--font-body, inherit);
    font-size: 0.62rem;
    font-weight: 700;
    background: var(--bg-card-hover);
    color: var(--text-muted);
}
.dash-pulse-table tbody tr:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.dash-margin-pill.is-negative { background: var(--danger-soft); color: var(--danger-text); }
.dash-peek-body .dash-attention-badge { margin: 0 0 0.6rem; }

.dash-back-pill {
    position: fixed;
    top: 0.75rem;
    right: 1.25rem;
    z-index: 1030;
    display: none;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--primary-soft-border, var(--border-color));
    border-radius: 999px;
    background: #FFFFFF;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.78rem;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
    cursor: pointer;
}
.dash-back-pill:hover { background: var(--primary-soft); }
.dash-back-pill:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ═══════════════════════════════════════════════════════════════════════
   Allocation Picker & Modal Dialog Polishing
   ═══════════════════════════════════════════════════════════════════════ */
.alloc-picker {
    font-family: var(--font-body, 'Inter', system-ui, -apple-system, sans-serif);
}

.alloc-step-badge {
    transition: all 0.15s ease;
}

.alloc-combo-input {
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.alloc-combo-input:focus {
    border-color: var(--primary, #6D28D9) !important;
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.12) !important;
}

.alloc-selected-chip-host {
    pointer-events: none;
    z-index: 2;
}

.alloc-token {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    max-width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.35;
}

.alloc-token--self {
    background: #F5F3FF;
    border: 1px solid #DDD6FE;
    color: #6D28D9;
}

.alloc-token--vendor {
    background: #F8FAFC;
    border: 1px solid #CBD5E1;
    color: #0F172A;
}

.alloc-token--veh {
    background: #F8FAFC;
    border: 1px solid #CBD5E1;
    color: #0F172A;
}

.alloc-token--drv {
    background: #F8FAFC;
    border: 1px solid #CBD5E1;
    color: #0F172A;
}

.alloc-token--auto {
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    color: #047857;
}

.alloc-opt-row {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
}

.alloc-opt-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 0.8rem;
}

.alloc-tag {
    font-size: 0.6rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 4px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* Modal refinements */
#allocationModalOverlay .modal-card {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

#allocationModalOverlay .modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.14) !important;
    color: #FFFFFF !important;
}

/* Allocation dialog can be opened from Edit Dispatch ("Manage allocation"); it must stack above it. */
#allocationModalOverlay { z-index: 10010; }

/* Briefly highlights the trip the user was sent to from the Dashboard. */
@keyframes dashFlashRing {
    0%   { box-shadow: 0 0 0 0 rgba(109, 40, 217, 0.55); }
    70%  { box-shadow: 0 0 0 10px rgba(109, 40, 217, 0); }
    100% { box-shadow: 0 0 0 0 rgba(109, 40, 217, 0); }
}
.dash-flash-target {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: 12px;
    animation: dashFlashRing 1.2s ease-out 2;
}
@media (prefers-reduced-motion: reduce) {
    .dash-flash-target { animation: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LIVE BOARD FULL SCREEN (wall display)
   The band is moved to <body> and pinned over the whole viewport (z-index below the peek drawer 1040/1050 and
   the modals), and the browser goes full screen as well. Money and the create button are never shown here.
   ═══════════════════════════════════════════════════════════════════════════ */
.dash-fs-bar { display: none; }

body.dash-fs-lock { overflow: hidden; }

.dash-band-board.dash-board-fs {
    --dash-fs-scale: 1.15;
    position: fixed;
    inset: 0;
    z-index: 1020;
    margin: 0;
    border-radius: 0;
    border: 0;
    background: #F1F5F9;
    padding: 0.9rem 1.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    overflow: hidden;
}

/* Control bar: brand | clock | tools, then a status line with the refresh progress. */
.dash-board-fs .dash-fs-bar {
    display: grid;
    grid-template-columns: auto auto 1fr;
    grid-template-areas: "brand clock tools" "status status status";
    align-items: center;
    column-gap: 1.5rem;
    row-gap: 0.45rem;
}
.dash-fs-brand { grid-area: brand; display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.dash-fs-brand-name { font-size: calc(1.15rem * var(--dash-fs-scale, 1.15)); font-weight: 800; color: var(--text-main, #0F172A); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 28vw; }
.dash-fs-live { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; padding: 0.15rem 0.5rem; border-radius: 999px; background: #DCFCE7; color: #166534; }
.dash-board-fs.is-paused .dash-fs-live { background: #FEF3C7; color: #92400E; }
.dash-fs-clock { grid-area: clock; text-align: left; line-height: 1.1; }
.dash-fs-time { font-family: var(--font-mono, ui-monospace, monospace); font-size: calc(1.6rem * var(--dash-fs-scale, 1.15)); font-weight: 800; color: var(--primary, #6D28D9); letter-spacing: 0.02em; }
.dash-fs-date { font-size: 0.78rem; font-weight: 600; color: var(--text-muted, #64748B); }
.dash-fs-tools { grid-area: tools; display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; flex-wrap: wrap; }
.dash-fs-search { display: flex; align-items: center; gap: 0.4rem; background: #fff; border: 1px solid var(--border-color, #E2E8F0); border-radius: 10px; padding: 0.35rem 0.65rem; min-width: 260px; flex: 0 1 380px; }
.dash-fs-search:focus-within { border-color: var(--primary, #6D28D9); box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.15); }
.dash-fs-search i { color: var(--text-muted, #64748B); }
.dash-fs-search input { border: 0; outline: 0; background: transparent; width: 100%; font-family: var(--font-family); font-size: 0.85rem; }
.dash-fs-group { display: inline-flex; gap: 0.25rem; }
.dash-fs-btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.7rem; border-radius: 10px; border: 1px solid var(--border-color, #E2E8F0); background: #fff; color: var(--text-secondary, #475569); font-family: var(--font-family); font-size: 0.8rem; font-weight: 700; cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease; }
.dash-fs-btn:hover { background: var(--bg-card-hover, #F8FAFC); border-color: var(--border-strong, #CBD5E1); }
.dash-fs-btn:focus-visible { outline: 2px solid var(--primary, #6D28D9); outline-offset: 2px; }
.dash-fs-btn[aria-pressed="true"] { background: var(--primary, #6D28D9); border-color: var(--primary, #6D28D9); color: #fff; }
.dash-fs-btn-exit { background: #0F172A; border-color: #0F172A; color: #fff; }
.dash-fs-btn-exit:hover { background: #1E293B; }
.dash-fs-status { grid-area: status; display: flex; align-items: center; gap: 0.75rem; }
.dash-fs-updated { font-size: 0.74rem; font-weight: 600; color: var(--text-muted, #64748B); white-space: nowrap; }
.dash-fs-progress { flex: 1; height: 3px; background: #E2E8F0; border-radius: 2px; overflow: hidden; }
.dash-fs-progress > span { display: block; height: 100%; width: 0; background: var(--primary, #6D28D9); transition: width 1s linear; }
.dash-board-fs.is-paused .dash-fs-progress > span { background: #F59E0B; transition: none; }

/* What is not needed (or not appropriate) on a wall display. */
.dash-board-fs .dash-board-title-row,
.dash-board-fs .dash-chip-unpaid,
.dash-board-fs .dash-board-footer .dash-view-all-link { display: none; }
.dash-board-fs .dash-board-header { margin-bottom: 0; }

/* Status chips become big, clickable tiles. */
.dash-board-fs .dash-chips-row { gap: 0.75rem; flex-wrap: nowrap; }
.dash-board-fs .dash-board-chips { flex: 1; flex-wrap: nowrap; gap: 0.7rem; }
.dash-board-fs .dash-chip { flex: 1 1 0; justify-content: space-between; padding: 0.6rem 1rem; border-radius: 12px; font-size: calc(0.88rem * var(--dash-fs-scale, 1.15)); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06); }
.dash-board-fs .dash-chip-count { font-size: calc(1.45rem * var(--dash-fs-scale, 1.15)); padding: 0.05rem 0.65rem; }

/* The table fills the rest of the screen and scrolls inside itself. */
.dash-board-fs .dash-table-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; }
.dash-board-fs .dash-pulse-table { font-size: calc(0.85rem * var(--dash-fs-scale, 1.15)); }
.dash-board-fs .dash-pulse-table th { position: sticky; top: 0; z-index: 2; font-size: calc(0.68rem * var(--dash-fs-scale, 1.15)); background: #F8FAFC; }
.dash-board-fs .dash-pulse-table td { padding-top: calc(0.5rem * var(--dash-fs-scale, 1.15)); padding-bottom: calc(0.5rem * var(--dash-fs-scale, 1.15)); }
.dash-board-fs .dash-board-footer { flex: 0 0 auto; margin-top: 0; }
.dash-board-fs #dashBoardEmpty,
.dash-board-fs #dashBoardError,
.dash-board-fs #dashBoardLoading { flex: 0 0 auto; }

/* A row whose status, vehicle or driver just changed lights up for a few seconds. */
@keyframes dashRowFlash { 0% { background: #DDD6FE; } 100% { background: transparent; } }
.dash-pulse-table tr.row-flash > td { animation: dashRowFlash 4s ease-out 1; }
@media (prefers-reduced-motion: reduce) {
    .dash-pulse-table tr.row-flash > td { animation: none; }
    .dash-pulse-table tr.row-flash > td:first-child { box-shadow: inset 4px 0 0 var(--primary, #6D28D9); }
    .dash-fs-progress > span { transition: none; }
}

@media (max-width: 1100px) {
    .dash-board-fs .dash-fs-bar { grid-template-columns: 1fr auto; grid-template-areas: "brand clock" "tools tools" "status status"; }
    .dash-board-fs .dash-chips-row, .dash-board-fs .dash-board-chips { flex-wrap: wrap; }
}

.dash-fs-logo { height: calc(1.9rem * var(--dash-fs-scale, 1.15)); width: auto; flex: none; }

.dash-fs-brandchip { display: none; }
.dash-board-fs .dash-fs-brandchip { display: flex; align-items: center; gap: 0.55rem; position: absolute; left: 12px; bottom: 10px; z-index: 6; padding: 0.4rem 0.8rem 0.4rem 0.5rem; background: rgba(255,255,255,0.88); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid rgba(15,23,42,0.08); border-radius: 12px; box-shadow: 0 2px 10px rgba(15,23,42,0.15); pointer-events: none; }
.dash-fs-brandchip img { width: 26px; height: 26px; }
.dash-fs-brandchip-text { display: flex; flex-direction: column; line-height: 1.2; }
.dash-fs-brandchip-text strong { font-size: 0.82rem; color: var(--text-main, #0F172A); }
.dash-fs-brandchip-text span { font-size: 0.62rem; color: var(--text-muted, #64748B); }


/* Live Board full screen: first two columns and Status & Attention scale with the table (they had fixed small sizes) */
.dash-board-fs .dash-cell-time { font-size: calc(0.95rem * var(--dash-fs-scale, 1.15)); }
.dash-board-fs .dash-prev-day-tag { font-size: calc(0.72rem * var(--dash-fs-scale, 1.15)); }
.dash-board-fs .dash-mono-chip { font-size: calc(0.85rem * var(--dash-fs-scale, 1.15)); padding: 0.2rem 0.55rem; }
.dash-board-fs .dash-passenger-name { font-size: calc(0.76rem * var(--dash-fs-scale, 1.15)); }
.dash-board-fs .dash-status-indicator { font-size: calc(0.95rem * var(--dash-fs-scale, 1.15)); gap: 0.5rem; }
.dash-board-fs .dash-attention-badge { font-size: calc(0.82rem * var(--dash-fs-scale, 1.15)); padding: 0.2rem 0.6rem; margin-top: 0.3rem; }
.dash-board-fs .dash-status-dot { width: 0.7rem; height: 0.7rem; }

.dash-fs-logo { height: calc(1.7rem * var(--dash-fs-scale, 1.15)); width: auto; flex: none; }

.dash-fs-brand-stack { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.dash-fs-tagline { font-size: calc(0.62rem * var(--dash-fs-scale, 1.15)); color: var(--text-muted, #64748B); font-weight: 600; letter-spacing: 0.02em; }

.track-offroute {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 10px;
    background: #FEE2E2;
    color: #B91C1C;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════
   SPEED ALERTS (web): pills, live chip, marker ring, dialog, settings card
   ═══════════════════════════════════════════════════════════════ */
.speed-pill {
    display: inline-flex; align-items: center; gap: 4px; margin-left: 0.25rem; padding: 0.12rem 0.5rem;
    border-radius: 12px; border: 1px solid #FCA5A5; background: #FEF2F2; color: #B91C1C;
    font-size: 0.64rem; font-weight: 800; white-space: nowrap; vertical-align: middle;
}
.dt-c-status .speed-pill { display: flex; width: fit-content; margin: 0.25rem 0 0 0; }
.speed-muted { color: #64748B; font-weight: 500; }

.track-speed-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.speed-chip-live {
    display: inline-flex; align-items: center; gap: 5px; padding: 0.15rem 0.55rem; border-radius: 12px;
    background: #DC2626; color: #FFFFFF; font-size: 0.7rem; font-weight: 800;
    animation: speed-chip-pulse 1.1s ease-in-out infinite;
}
.speed-chip-live.is-ended { animation: none; background: #FCA5A5; color: #7F1D1D; }
.speed-limit-note { font-size: 0.7rem; color: #64748B; font-weight: 600; }
.speed-limit-edit {
    border: 0; background: transparent; color: #64748B; cursor: pointer; padding: 2px 4px; border-radius: 4px; font-size: 0.7rem;
}
.speed-limit-edit:hover, .speed-limit-edit:focus-visible { color: #1A73E8; background: #EFF6FF; }
@keyframes speed-chip-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

/* red pulsing ring on the vehicle marker (MapLibre marker element / Leaflet icon element) */
.speed-alert { position: relative; }
.speed-alert::after {
    content: ''; position: absolute; inset: -10px; border: 3px solid #DC2626; border-radius: 50%;
    pointer-events: none; animation: speed-ring-pulse 1.2s ease-out infinite;
}
@keyframes speed-ring-pulse { 0% { transform: scale(0.7); opacity: 0.95; } 100% { transform: scale(1.35); opacity: 0; } }

.speed-hdr-toggle { padding: 0 0.25rem 0.5rem; }
.speed-hdr-btn {
    border: 1px solid #CBD5E1; background: #FFFFFF; color: #334155; border-radius: 999px; padding: 0.25rem 0.7rem;
    font-size: 0.72rem; font-weight: 700; cursor: pointer;
}
.speed-hdr-btn.is-on { border-color: #86EFAC; color: #166534; background: #F0FDF4; }
.speed-hdr-btn.is-off { border-color: #FCA5A5; color: #991B1B; background: #FEF2F2; }

/* Settings card */
.speed-settings-card { padding: 1.25rem 1.5rem; border-radius: 12px; background: #FFFFFF; border: 1px solid #E2E8F0; margin-top: 1rem; }
.speed-settings-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.speed-settings-head h3 { margin: 0; color: #1E293B; font-size: 1.05rem; }
.speed-settings-state { font-size: 0.7rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.speed-settings-state.is-on { background: #DCFCE7; color: #166534; }
.speed-settings-state.is-off { background: #FEE2E2; color: #991B1B; }
.speed-settings-note { font-size: 0.82rem; color: #64748B; margin: 0 0 0.75rem; }
.speed-settings-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; }
.speed-settings-label { font-size: 0.82rem; font-weight: 700; color: #334155; }
.speed-settings-row input[type="number"] { width: 90px; border: 1px solid #CBD5E1; border-radius: 6px; padding: 0.35rem 0.5rem; font-weight: 600; }
.speed-settings-hint { font-size: 0.74rem; color: #64748B; }
.speed-switch { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.85rem; font-weight: 700; color: #334155; cursor: pointer; }

/* Vehicle types form: one more field */
.vt-form-grid.has-speed { grid-template-columns: 2fr 1fr 1fr 1fr auto; }
@media (max-width: 900px) { .vt-form-grid.has-speed { grid-template-columns: 1fr; } }

/* Trip Details speed section */
.speed-limit-line { font-size: 0.85rem; color: #334155; padding: 0.15rem 0 0.35rem; }
.speed-summary { font-size: 0.82rem; font-weight: 700; color: #B91C1C; padding-bottom: 0.25rem; }
.speed-summary.speed-muted { color: #64748B; font-weight: 500; }
.speed-ep-list { list-style: none; margin: 0.25rem 0 0; padding: 0; display: grid; gap: 0.25rem; }
.speed-ep-list li { display: grid; grid-template-columns: minmax(120px, 160px) 1fr auto auto; gap: 0.5rem; align-items: baseline; font-size: 0.78rem; padding: 0.3rem 0.5rem; background: #FEF2F2; border-radius: 6px; }
.speed-ep-time { font-weight: 700; color: #7F1D1D; }
.speed-edit-btn { margin-left: auto; }

/* Change-limit dialog */
.speed-dlg-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5); display: flex; align-items: center; justify-content: center; z-index: 100000; padding: 1rem; }
.speed-dlg { background: #FFFFFF; border-radius: 12px; width: min(420px, 100%); padding: 1.25rem 1.4rem; box-shadow: 0 20px 50px rgba(15, 23, 42, 0.3); }
.speed-dlg h3 { margin: 0 0 0.5rem; font-size: 1.05rem; color: #1E293B; }
.speed-dlg p { font-size: 0.82rem; margin: 0 0 0.75rem; }
.speed-dlg label { display: block; font-size: 0.74rem; font-weight: 700; color: #475569; margin: 0.5rem 0 0.15rem; }
.speed-dlg input { width: 100%; border: 1px solid #CBD5E1; border-radius: 6px; padding: 0.45rem 0.55rem; font-weight: 600; box-sizing: border-box; }
.speed-dlg-err { min-height: 1.1rem; color: #B91C1C; font-size: 0.78rem; font-weight: 600; margin-top: 0.4rem; }
.speed-dlg-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; }
@media (prefers-reduced-motion: reduce) { .speed-chip-live, .speed-alert::after { animation: none; } }
/* ── Odometer match (Anil, 20 Nov 2026): Match green, Mismatch red, Missing neutral with an amber icon.
      Icon + text + colour (never colour alone). The amber variance box (odometer vs GPS) is a separate warning. ── */
.odo-badge { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.12rem 0.45rem; border-radius: 999px;
    font-size: 0.66rem; font-weight: 700; line-height: 1.35; white-space: nowrap; border: 1px solid transparent; }
.odo-badge i { font-size: 0.7rem; }
.odo-badge--ok { color: #047857; background: #ECFDF5; border-color: #A7F3D0; }
.odo-badge--bad { color: #B91C1C; background: #FEF2F2; border-color: #FECACA; }
.odo-badge--missing { color: #334155; background: #F1F5F9; border-color: #E2E8F0; }
.odo-badge--missing i { color: #D97706; }
.ht-c-odo { width: 92px; text-align: center; }
.et-inp-group.odo-bad { border-color: #DC2626 !important; box-shadow: 0 0 0 1px #DC2626 inset; }
.et-odo-match { margin-top: 0.4rem; display: flex; align-items: flex-start; gap: 0.45rem; padding: 0.5rem 0.65rem; border-radius: 8px; font-size: 0.75rem; font-weight: 600; }
.et-odo-match--bad { color: #991B1B; background: #FEF2F2; border: 1px solid #FECACA; }
.et-odo-match--ok { color: #065F46; background: #ECFDF5; border: 1px solid #A7F3D0; }
.et-odo-match--pending { color: #92400E; background: #FFFBEB; border: 1px solid #FDE68A; }
.cn-odo-hint { margin-top: 0.55rem; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.45rem 0.6rem;
    border-radius: 8px; font-size: 0.74rem; font-weight: 700; color: #B91C1C; background: #FEF2F2; border: 1px solid #FECACA; }
.cn-odo-hint a { color: #B91C1C; text-decoration: underline; white-space: nowrap; }
.cn-odo-hint--ok { color: #047857; background: #ECFDF5; border-color: #A7F3D0; justify-content: flex-start; }
.ts-odo-block { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; padding: 0.5rem 0.75rem;
    margin: 0.4rem 0; border-radius: 8px; font-size: 0.78rem; font-weight: 700; color: #B91C1C; background: #FEF2F2; border: 1px solid #FECACA; }

/* History: overspeed pill sits UNDER the trip code (wraps inside the 130 px column) so one row grows taller
   instead of the whole table scrolling sideways (Vaibhav, 20 Nov 2026). */
.history-table .ht-c-trip .ht-trip-flags { display: block; margin-top: 4px; white-space: normal; }
.history-table .ht-c-trip .ht-trip-flags .speed-pill { display: inline-block; max-width: 100%; white-space: normal; line-height: 1.3; }
