:root {
    --sidebar-bg: #10192e;
    --sidebar-bg-2: #1d2740;
    --sidebar-active: #2b3f6b;
    --sidebar-text: #b9c2d6;
    --brand: #1d2740;
    --brand-dark: #10192e;
    --brand-light: #3b5a99;
    --gold: #c9a227;
    --bg: #f4f6fb;
}

* {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

body {
    background: var(--bg);
    color: #1e293b;
}

/* ---------- Layout shell ---------- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg-2));
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    transition: transform .25s ease;
    z-index: 1040;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar .brand {
    padding: 1.4rem 1.25rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: .6rem;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.sidebar .brand i {
    color: var(--gold);
}

.sidebar .brand img {
    height: 34px;
    width: 34px;
    border-radius: 50%;
    object-fit: cover;
}

.sidebar .nav-link {
    color: var(--sidebar-text);
    padding: .7rem 1.25rem;
    margin: .15rem .6rem;
    border-radius: .6rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    font-weight: 500;
    transition: all .18s ease;
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, .07);
    color: #fff;
}

.sidebar .nav-link.active {
    background: var(--sidebar-active);
    color: #fff;
    box-shadow: 0 6px 16px rgba(29, 39, 64, .45);
}

.sidebar .nav-section {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #64748b;
    padding: 1rem 1.5rem .35rem;
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, .06);
}

.main {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 64px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.content {
    padding: 1.75rem;
}

/* ---------- Cards ---------- */
.card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
}

.stat-card {
    overflow: hidden;
    position: relative;
    animation: rise .45s ease both;
}

.stat-card .icon {
    width: 52px;
    height: 52px;
    border-radius: .85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
}

.stat-card .value {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card .label {
    color: #64748b;
    font-size: .85rem;
}

.bg-grad-indigo {
    background: linear-gradient(135deg, #6366f1, #4338ca);
}

.bg-grad-green {
    background: linear-gradient(135deg, #10b981, #059669);
}

.bg-grad-amber {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.bg-grad-red {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.bg-grad-blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.bg-grad-slate {
    background: linear-gradient(135deg, #64748b, #475569);
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.stat-card:nth-child(2) {
    animation-delay: .05s
}

.stat-card:nth-child(3) {
    animation-delay: .1s
}

.stat-card:nth-child(4) {
    animation-delay: .15s
}

/* ---------- Forms ---------- */
.form-card {
    max-width: 920px;
}

.form-label {
    font-weight: 600;
    font-size: .85rem;
    color: #334155;
}

.form-control,
.form-select {
    border-radius: .6rem;
    padding: .6rem .85rem;
    border-color: #e2e8f0;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 .2rem rgba(29, 39, 64, .15);
}

.btn-brand {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.btn-brand:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #fff;
}

/* ---------- Document cards ---------- */
.doc-tile {
    border: 1px dashed #cbd5e1;
    border-radius: 1rem;
    overflow: hidden;
    transition: .2s;
    background: #fff;
}

.doc-tile:hover {
    border-color: var(--brand);
    box-shadow: 0 8px 24px rgba(29, 39, 64, .12);
}

.doc-thumb {
    height: 170px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
    overflow: hidden;
    position: relative;
}

.doc-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.doc-thumb .placeholder {
    color: #94a3b8;
    font-size: 2.2rem;
}

.doc-thumb #preview- {
    display: none;
}

/* ---------- Auth ---------- */
.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
    background: radial-gradient(1200px 600px at 10% 10%, #2b3f6b 0%, transparent 60%),
        radial-gradient(1000px 500px at 90% 90%, #1d2740 0%, transparent 55%), #10192e;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    border-radius: 1.25rem;
}

.auth-brand {
    text-align: center;
    color: #fff;
    margin-bottom: 1.25rem;
}

.auth-brand img {
    height: 64px;
    margin-bottom: .5rem;
}

.auth-brand .tagline {
    letter-spacing: .18em;
    font-size: .72rem;
    color: rgba(255, 255, 255, .55);
    text-transform: uppercase;
}

.avatar-sm {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}

.badge-soft {
    font-weight: 600;
    padding: .4em .7em;
    border-radius: .5rem;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: none;
    }

    .main {
        margin-left: 0;
    }
}
/* ================================================================
   UI ENHANCEMENTS — v2 polish
   ================================================================ */

/* Smoother base */
body {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.ls-wide { letter-spacing: .08em; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; border: 2px solid transparent; background-clip: content-box; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border: 2px solid transparent; background-clip: content-box; }

/* Sidebar polish */
.sidebar .nav-link {
    position: relative;
}
.sidebar .nav-link:hover {
    transform: translateX(3px);
}
.sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: -0.6rem;
    top: 22%;
    bottom: 22%;
    width: 4px;
    border-radius: 4px;
    background: var(--gold);
}
.sidebar .nav-link.disabled { cursor: not-allowed; }

/* Topbar frosted */
.topbar {
    backdrop-filter: saturate(1.4) blur(8px);
    background: rgba(255, 255, 255, .88);
}

/* Cards: hover lift + subtle border */
.card {
    border: 1px solid rgba(226, 232, 240, .7);
    transition: box-shadow .22s ease, transform .22s ease, border-color .22s ease;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, .10);
    border-color: #dbeafe;
}
.stat-card .icon {
    box-shadow: 0 8px 18px rgba(15, 23, 42, .18);
    flex: 0 0 auto;
}
.stat-card::after {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-light), transparent);
    opacity: 0;
    transition: opacity .22s ease;
}
.stat-card:hover::after { opacity: 1; }

/* Active pipeline tab */
.stat-card-active {
    border-color: var(--brand-light) !important;
    box-shadow: 0 0 0 2px rgba(59, 90, 153, .25), 0 10px 24px rgba(15, 23, 42, .08);
}

/* Extra gradients */
.bg-grad-teal { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.bg-grad-purple { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.bg-grad-gold { background: linear-gradient(135deg, #c9a227, #a17f13); }

/* Chart cards */
.chart-card { animation: rise .5s ease both; }
.chart-holder { position: relative; width: 100%; }

/* LIVE indicator */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .4rem .85rem;
    border-radius: 2rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
    color: #16a34a;
}
.live-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #22c55e;
    position: relative;
}
.live-dot::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: rgba(34, 197, 94, .4);
    animation: livePulse 1.6s ease-out infinite;
}
@keyframes livePulse {
    0%   { transform: scale(.6); opacity: .9; }
    70%  { transform: scale(1.7); opacity: 0; }
    100% { opacity: 0; }
}

/* Tables */
.table thead th {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #64748b;
    font-weight: 700;
    border-bottom-width: 1px;
}
.table-hover > tbody > tr { transition: background .15s ease; }
.table-hover > tbody > tr:hover { background: #f1f5f9; }
.table > :not(caption) > * > * { padding-top: .8rem; padding-bottom: .8rem; }

/* Buttons */
.btn { border-radius: .6rem; font-weight: 600; transition: all .18s ease; }
.btn:active { transform: scale(.97); }
.btn-primary {
    background: linear-gradient(135deg, #2b3f6b, var(--brand));
    border-color: var(--brand);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    border-color: var(--brand-dark);
    box-shadow: 0 6px 16px rgba(29, 39, 64, .28);
}
.btn-sm { border-radius: .5rem; }

/* Badges */
.badge-soft { letter-spacing: .01em; }

/* Alerts */
.alert { border: none; border-radius: .85rem; box-shadow: 0 1px 3px rgba(15,23,42,.05); }
.alert-warning { background: #fef7e6; color: #92600a; }
.alert-info { background: #e8f2fd; color: #175a9c; }
.alert-secondary { background: #eef1f6; color: #47536b; }

/* Support page */
.support-card { text-align: center; }
.support-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 36px rgba(15, 23, 42, .12);
}
.support-icon {
    width: 64px;
    height: 64px;
    border-radius: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    color: #fff;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .18);
}

/* Dropdown menus */
.dropdown-menu {
    border: 1px solid #e2e8f0;
    border-radius: .75rem;
    padding: .4rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .14);
}
.dropdown-item { border-radius: .5rem; padding: .5rem .8rem; font-weight: 500; }
.dropdown-item:hover { background: #f1f5f9; }

/* Pagination */
.pagination .page-link { border-radius: .5rem; margin: 0 .15rem; border-color: #e2e8f0; color: var(--brand); }
.pagination .page-item.active .page-link { background: var(--brand); border-color: var(--brand); }

/* List groups */
.list-group-item { border-color: #eef2f7; }

/* Content max width on huge screens */
@media (min-width: 1700px) {
    .content { max-width: 1560px; margin: 0 auto; width: 100%; }
}

/* ==================================================================
   UI ENHANCEMENTS — v3 polish (July 2026)
   Status pills, cash/account badges, richer theme, impersonation bar
   ================================================================== */

:root {
    --st-ontheway:  #4c1d95;   /* On the way — dark purple */
    --st-arrived:   #facc15;   /* Arrived    — yellow      */
    --st-pob:       #dc2626;   /* POB        — red         */
    --st-completed: #16a34a;   /* Completed  — green       */
    --pt-cash:      #b45309;
    --pt-account:   #1d4ed8;
    --brand-ink:    #101a33;
    --brand-gold:   #d4a72c;
}

/* ---- Driver trip-status pills (exact requested colours) ---- */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .02em;
    padding: .3em .65em;
    border-radius: 999px;
    line-height: 1.2;
    white-space: nowrap;
}
.status-pill.st-ontheway  { background: var(--st-ontheway);  color: #fff; }
.status-pill.st-arrived   { background: var(--st-arrived);   color: #1f2937; }
.status-pill.st-pob       { background: var(--st-pob);       color: #fff; }
.status-pill.st-completed { background: var(--st-completed); color: #fff; }
.status-pill.st-danger    { background: #7f1d1d;             color: #fff; }
.status-pill.st-muted     { background: #e5e7eb;             color: #4b5563; }
.status-pill.st-request   { background: #fff7ed; color: #b45309; border: 1px dashed #f59e0b; }

/* ---- Cash / Account job badges ---- */
.status-pill.pt-cash    { background: #fef3c7; color: var(--pt-cash);    border: 1px solid #fcd34d; }
.status-pill.pt-account { background: #dbeafe; color: var(--pt-account); border: 1px solid #93c5fd; }

/* ---- Impersonation bar ---- */
.impersonation-bar {
    background: linear-gradient(90deg, #4c1d95, #6d28d9);
    color: #fff;
    font-size: .85rem;
    padding: .45rem 1rem;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,.15);
}
.impersonation-bar .btn-light { font-size: .75rem; font-weight: 600; }

/* ---- General theme lift ---- */
body { background: linear-gradient(180deg, #f6f8fc 0%, #eef2f9 100%); }

.card {
    border: 1px solid rgba(16, 26, 51, .06);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(16, 26, 51, .04), 0 8px 24px -18px rgba(16, 26, 51, .25);
}
.card.stat-card { transition: transform .18s ease, box-shadow .18s ease; }
.card.stat-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -18px rgba(16,26,51,.35); }

.table thead th {
    text-transform: uppercase;
    font-size: .72rem;
    letter-spacing: .06em;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0 !important;
}
.table-hover tbody tr:hover { background: #f4f7fe; }

.btn { border-radius: 9px; font-weight: 500; }
.btn-primary {
    background: linear-gradient(135deg, #1d2740, #34456e);
    border-color: #1d2740;
}
.btn-primary:hover { background: linear-gradient(135deg, #16203a, #2c3c62); border-color: #16203a; }
.btn-success { background: linear-gradient(135deg, #15803d, #22a04f); border-color: #15803d; }

.form-control:focus, .form-select:focus {
    border-color: var(--brand-gold);
    box-shadow: 0 0 0 .2rem rgba(212, 167, 44, .18);
}

/* Google Places dropdown above modals */
.pac-container { z-index: 10000 !important; border-radius: 10px; box-shadow: 0 12px 30px -12px rgba(16,26,51,.4); }
.pac-item { padding: .4rem .75rem; font-size: .85rem; }
.pac-item:hover { background: #f4f7fe; }

/* Payment-type select on Live Bookings */
.payment-type-select { border-radius: 8px; font-size: .78rem; }

/* Tiny buttons (password reveal etc.) */
.btn-xs { font-size: .7rem; line-height: 1.4; }

/* Sidebar & topbar tune-up */
.sidebar .nav-link { border-radius: 10px; margin: 2px 10px; transition: background .15s ease, color .15s ease; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.08); }
.sidebar .nav-link.active { box-shadow: inset 3px 0 0 var(--brand-gold); }
.topbar { backdrop-filter: blur(8px); }

/* Alerts */
.alert { border-radius: 12px; border-width: 0; box-shadow: 0 4px 14px -10px rgba(16,26,51,.25); }

/* ==================================================================
   RESPONSIVE & MOBILE UX ENHANCEMENTS
   ================================================================== */

/* Mobile Sidebar Backdrop Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(16, 25, 46, 0.55);
    backdrop-filter: blur(4px);
    z-index: 1035;
    display: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* Touch & Responsive Controls */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 0 0 25px rgba(0, 0, 0, 0.35);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main {
        margin-left: 0;
    }
    .content {
        padding: 1.25rem 1rem;
    }
    .topbar {
        padding: 0 1rem;
    }
}

@media (max-width: 767.98px) {
    .content {
        padding: 1rem 0.85rem;
    }
    .topbar {
        padding: 0 0.85rem;
    }
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        float: none !important;
        text-align: left !important;
        margin-bottom: 0.5rem;
    }
    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        margin-left: 0 !important;
        margin-top: 0.25rem;
    }
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        float: none !important;
        text-align: center !important;
        margin-top: 0.75rem;
    }
    .dataTables_wrapper .dataTables_paginate .pagination {
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 575.98px) {
    .topbar {
        height: 56px;
        padding: 0 0.75rem;
    }
    .topbar h5 {
        font-size: 1rem;
    }
    .content {
        padding: 0.85rem 0.65rem;
    }
    .auth-wrap {
        padding: 1.25rem 0.5rem;
    }
    .auth-card {
        padding: 1.5rem 1.25rem !important;
    }
    .stat-card .value {
        font-size: 1.4rem;
    }
    .doc-thumb {
        height: 140px;
    }
    .card {
        border-radius: 12px;
    }
    .modal-dialog {
        margin: 0.5rem;
    }
}

/* Table responsiveness enhancements */
.table-responsive {
    border-radius: 10px;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

.table-responsive > .table {
    margin-bottom: 0;
}

/* Vertical Mobile Table Styles */
@media (max-width: 767.98px) {
    .table-vertical-mobile,
    .table-responsive > .table {
        display: block !important;
        width: 100% !important;
        border: none !important;
    }

    .table-vertical-mobile > thead,
    .table-responsive > .table > thead {
        display: none !important;
    }

    .table-vertical-mobile > tbody,
    .table-responsive > .table > tbody {
        display: block !important;
        width: 100% !important;
    }

    .table-vertical-mobile > tbody > tr,
    .table-responsive > .table > tbody > tr {
        display: block !important;
        width: 100% !important;
        background: #ffffff;
        border: 1px solid #e2e8f0 !important;
        border-radius: 12px !important;
        margin-bottom: 1rem !important;
        padding: 0.75rem 1rem !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
        position: relative;
    }

    .table-vertical-mobile > tbody > tr > td,
    .table-responsive > .table > tbody > tr > td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        text-align: right !important;
        padding: 0.55rem 0 !important;
        border: none !important;
        border-bottom: 1px dashed #edf2f7 !important;
        font-size: 0.85rem !important;
        min-height: 2.25rem;
        word-break: break-word;
    }

    .table-vertical-mobile > tbody > tr > td:last-child,
    .table-responsive > .table > tbody > tr > td:last-child {
        border-bottom: none !important;
        padding-bottom: 0.25rem !important;
    }

    .table-vertical-mobile > tbody > tr > td[data-label]::before,
    .table-responsive > .table > tbody > tr > td[data-label]::before {
        content: attr(data-label);
        font-weight: 600;
        color: #475569;
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        padding-right: 0.75rem;
        text-align: left;
        flex-shrink: 0;
        max-width: 48%;
    }

    .table-vertical-mobile > tbody > tr > td.text-end,
    .table-responsive > .table > tbody > tr > td.text-end,
    .table-vertical-mobile > tbody > tr > td[data-label="Actions"],
    .table-responsive > .table > tbody > tr > td[data-label="Actions"],
    .table-vertical-mobile > tbody > tr > td[data-label="Action"],
    .table-responsive > .table > tbody > tr > td[data-label="Action"] {
        justify-content: flex-end !important;
        gap: 0.5rem;
    }

    .table-vertical-mobile > tbody > tr > td[colspan],
    .table-responsive > .table > tbody > tr > td[colspan] {
        display: block !important;
        text-align: center !important;
        border-bottom: none !important;
        padding: 1.25rem 0 !important;
    }

    .table-vertical-mobile > tbody > tr > td[colspan]::before,
    .table-responsive > .table > tbody > tr > td[colspan]::before {
        display: none !important;
    }
}

/* Mobile Phone Ultra-Responsive Rules */
@media (max-width: 575.98px) {
    .btn-sm {
        padding: 0.3rem 0.55rem;
        font-size: 0.78rem;
    }   
    .filter-form,
    form.d-flex.flex-wrap {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    form.d-flex.flex-wrap .form-control,
    form.d-flex.flex-wrap .form-select,
    form.d-flex.flex-wrap .btn {
        width: 100% !important;
    }
    .badge {
        font-size: 0.7rem;
    }
    .stat-card .icon {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }
}



