:root {
    /* Core palette */
    --brand-blue: #1E3A4A;
    --brand-hover: #4B8DA2;
    --brand-muted: #84b4c4;
    --ink: #111111;
    --muted: #6b7280;
    --border: #e8eaeb;
    --surface: #ffffff;
    /* Layout */
    --sidebar-w: 264px;
    --sidebar-w-collapsed: 84px;
    --content-gap: 12px;
    --header-h: 88px;
    --radius: 12px;
    --shadow: 0 2px 6px rgba(0,0,0,.05);
    /* Breadcrumb / header */
    --crumb-blue: #1E3A4A;
    --crumb-muted: #6b7280;
    --crumb-line: #e9eef4;
    --crumb-bg: #f7f9fc;
    /* Tables */
    --table-head: #ffffff; /* default fallback if not defined elsewhere */
    /* Unified checkbox rows */
    --cb-size: 28px; /* size of the custom checkbox */
}

/* ---------- Base ---------- */
html, body {
    height: 100%;
    overflow-x: hidden;
}

html, body, *, *::before, *::after {
    box-sizing: border-box;
}

body {
    color: var(--ink);
    background: #f7f9fc;
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
}

a {
    color: var(--brand-blue);
    text-decoration: none;
}

    a:hover {
        color: var(--brand-hover);
    }

.small, .text-muted {
    color: var(--muted) !important;
}

/* ===================================================================
   SIDEBAR • Solid Blue (full height, single scrollbar, footer pinned)
   =================================================================== */
aside#sidebar.nk-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w) !important;
    height: 100vh !important;
    background: var(--brand-blue) !important;
    color: #fff !important;
    border-right: 0 !important;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden; /* Only inner scroll */
    z-index: 1020;
    transition: width .2s ease;
}

/* Brand row */
aside#sidebar .sb-brand {
    height: var(--header-h) !important;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: .65rem;
    background: var(--brand-blue) !important;
    border-bottom: 1px solid rgba(255,255,255,.12) !important;
}

    aside#sidebar .sb-brand img {
        height: 40px !important;
        width: auto;
        display: block;
    }

    aside#sidebar .sb-brand .title {
        color: #fff !important;
        font-weight: 800;
        font-size: 19px;
        white-space: nowrap;
    }

    aside#sidebar .sb-brand .sb-toggle {
        margin-left: auto;
        border: 0;
        background: transparent;
        color: #fff;
        cursor: pointer;
    }

/* Scroll area */
aside#sidebar .nk-nav-scroll,
aside#sidebar .slimScrollDiv {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow-y: auto !important;
    background: transparent !important;
    padding: 10px 8px 0;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge legacy */
}

    aside#sidebar .nk-nav-scroll::-webkit-scrollbar,
    aside#sidebar .slimScrollDiv::-webkit-scrollbar {
        width: 0;
        height: 0;
    }

/* Kill any legacy white backgrounds inside the sidebar */
aside#sidebar ul,
aside#sidebar .metismenu,
aside#sidebar .nk-nav-scroll,
.nk-sidebar ul {
    background: transparent !important;
}

    /* Section labels */
    aside#sidebar .metismenu .nav-label {
        padding: 12px 14px 6px;
        color: rgba(255,255,255,.75) !important;
        font-size: .74rem;
        font-weight: 700;
        letter-spacing: .08em;
        text-transform: uppercase;
    }

    /* Links (default = white text/icons on blue) */
    aside#sidebar .metismenu > li > a,
    aside#sidebar .metismenu ul li > a {
        position: relative;
        display: flex;
        align-items: center;
        gap: .65rem;
        margin: 2px 8px;
        padding: 10px 14px;
        border-radius: 10px;
        color: #fff !important;
        background: transparent !important;
        border-left: 3px solid transparent;
        transition: background .15s, color .15s, box-shadow .15s;
    }

        /* Items with arrows shouldn’t touch the right border */
        aside#sidebar .metismenu > li > a.has-arrow {
            padding-right: 32px !important;
        }

    aside#sidebar .metismenu .has-arrow::after {
        right: 12px !important;
    }

    /* Default icon color */
    aside#sidebar .metismenu i,
    aside#sidebar .metismenu svg,
    aside#sidebar .metismenu svg * {
        color: #fff !important;
        fill: #fff !important;
        stroke: #fff !important;
    }

    /* Submenu rail */
    aside#sidebar .metismenu ul {
        list-style: none;
        margin: 4px 0 8px 16px;
        padding-left: 10px;
        border-left: 1px dashed rgba(255,255,255,.18);
    }

        /* Hover (not active): translucent */
        aside#sidebar .metismenu > li:hover > a:not(.active),
        aside#sidebar .metismenu > li:focus > a:not(.active),
        aside#sidebar .metismenu ul li:hover > a:not(.active),
        aside#sidebar .metismenu ul li:focus > a:not(.active) {
            background: rgba(255,255,255,.08) !important;
            color: #fff !important;
        }

            aside#sidebar .metismenu > li:hover > a:not(.active) *,
            aside#sidebar .metismenu > li:focus > a:not(.active) *,
            aside#sidebar .metismenu ul li:hover > a:not(.active) *,
            aside#sidebar .metismenu ul li:focus > a:not(.active) * {
                color: #fff !important;
                fill: #fff !important;
                stroke: #fff !important;
            }

        /* Active: white chip + brand-blue */
        aside#sidebar .metismenu > li > a.active,
        aside#sidebar .metismenu ul li > a.active {
            background: #fff !important;
            color: var(--brand-blue) !important;
            box-shadow: 0 1px 2px rgba(0,0,0,.06);
        }

            aside#sidebar .metismenu > li > a.active *,
            aside#sidebar .metismenu ul li > a.active * {
                color: var(--brand-blue) !important;
                fill: var(--brand-blue) !important;
                stroke: var(--brand-blue) !important;
            }

    /* IMPORTANT: Never highlight parent dropdown items (with has-arrow class) */
    aside#sidebar .metismenu > li > a.has-arrow,
    aside#sidebar .metismenu > li > a.has-arrow:hover,
    aside#sidebar .metismenu > li > a.has-arrow:focus,
    aside#sidebar .metismenu > li.active > a.has-arrow {
        background: transparent !important;
        color: #fff !important;
        box-shadow: none !important;
    }

        aside#sidebar .metismenu > li > a.has-arrow *,
        aside#sidebar .metismenu > li > a.has-arrow:hover *,
        aside#sidebar .metismenu > li > a.has-arrow:focus *,
        aside#sidebar .metismenu > li.active > a.has-arrow * {
            color: #fff !important;
            fill: #fff !important;
            stroke: #fff !important;
        }

    /* Allow subtle hover on dropdown items */
    aside#sidebar .metismenu > li:hover > a.has-arrow,
    aside#sidebar .metismenu > li:focus > a.has-arrow {
        background: rgba(255,255,255,.08) !important;
    }

/* Neutralize legacy rule that flips text dark on hover/active */
aside#sidebar.nk-sidebar .metismenu > li:hover span,
aside#sidebar.nk-sidebar .metismenu > li:focus span,
aside#sidebar.nk-sidebar .metismenu > li.active span {
    color: inherit !important;
}

/* Footer pinned at bottom */
aside#sidebar .metismenu {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--header-h));
    padding-bottom: 0 !important;
}

aside#sidebar .sb-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,.12) !important;
    background: transparent !important;
}

    aside#sidebar .sb-footer a {
        color: #fff !important;
        font-weight: 600;
    }

        aside#sidebar .sb-footer a:hover {
            color: #eaf3ff !important;
        }

/* Collapsed state */
aside#sidebar.sb-collapsed {
    width: var(--sidebar-w-collapsed) !important;
}

    aside#sidebar.sb-collapsed .sb-brand {
        justify-content: center;
    }

    aside#sidebar.sb-collapsed .title,
    aside#sidebar.sb-collapsed .nav-text,
    aside#sidebar.sb-collapsed .nav-label {
        display: none !important;
    }

    aside#sidebar.sb-collapsed .metismenu > li > a {
        justify-content: center;
    }

    aside#sidebar.sb-collapsed .metismenu ul {
        display: none !important;
    }

/* ===================================================================
   CONTENT OFFSET
   =================================================================== */
.content-body {
    margin-left: var(--sidebar-w) !important;
    transition: margin-left .2s ease;
    background: #f7f9fc;
}

body.sb-collapsed .content-body,
aside#sidebar.sb-collapsed + .content-body {
    margin-left: var(--sidebar-w-collapsed) !important;
}

.content-body > .container,
.content-body > .container-fluid {
    padding-left: 12px;
    padding-right: 12px;
}

/* ===================================================================
   NAV TABS / FORMS
   =================================================================== */
.nav-tabs {
    border-bottom: 1px solid var(--border) !important;
    margin: 8px 0 14px;
}

    .nav-tabs .nav-item {
        margin-right: 10px;
    }

    .nav-tabs .nav-link {
        padding: 10px 12px;
        border: 0;
        border-bottom: 2px solid transparent;
        border-radius: 0;
        background: transparent !important;
        color: #111;
        font-weight: 600;
    }

        .nav-tabs .nav-link:hover {
            color: var(--brand-blue);
            border-bottom-color: rgba(39,113,142,.28);
        }

        .nav-tabs .nav-link.active {
            color: var(--brand-blue);
            border-bottom-color: var(--brand-blue);
        }

/* Inputs */
.form-control:focus, input:focus, select:focus, textarea:focus {
    border-color: var(--brand-hover) !important;
    box-shadow: 0 0 0 3px rgba(76,156,188,.18) !important;
    outline: 0;
}

/* Remove number input spinners */
input[type="number"].no-spinner::-webkit-inner-spin-button,
input[type="number"].no-spinner::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"].no-spinner {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* ===================================================================
   CARDS / SECTIONS
   =================================================================== */
.section-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: .75rem;
    box-shadow: var(--shadow);
    padding: .9rem 1.1rem;
    margin-bottom: 1rem;
}

    .section-card.soft-card {
        background: #f9fbfc;
    }

.section-hd {
    font-weight: 600;
    font-size: .95rem;
    color: var(--brand-blue);
    margin-bottom: .75rem;
}

.section-bd {
    font-size: .875rem;
}

/* Key/Value rows */
.kv {
    display: flex;
    justify-content: space-between;
    padding: .4rem 0;
    border-bottom: 1px dashed var(--border);
}

    .kv .k {
        font-weight: 500;
        color: #111;
    }

    .kv .v {
        text-align: right;
        color: #333;
    }

.kv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem 1rem;
}

/* ===================================================================
   BUTTONS (consolidated)
   =================================================================== */
.btn {
    border-radius: 10px;
    font-weight: 600;
}

    .btn:focus {
        box-shadow: 0 0 0 3px rgba(76,156,188,.20) !important;
        outline: 0;
    }

.btn-sm {
    padding: .36rem .62rem;
    border-radius: 10px;
    font-weight: 600;
    line-height: 1.25;
}

.btn-xs {
    padding: .28rem .6rem;
    font-size: .85rem;
    border-radius: 10px;
}

/* Brand buttons */
.btn-primary,
.btn-brand {
    background: var(--brand-blue) !important;
    border-color: var(--brand-blue) !important;
    color: #fff !important;
}

    .btn-primary:hover,
    .btn-primary:focus,
    .btn-brand:hover,
    .btn-brand:focus {
        background: var(--brand-hover) !important;
        border-color: var(--brand-hover) !important;
        box-shadow: 0 0 0 .2rem rgba(39,113,142,.20) !important;
    }

/* Outline brand buttons */
.btn-outline-primary,
.btn-outline-brand {
    background: #fff !important;
    color: var(--brand-blue) !important;
    border: 1px solid var(--brand-blue) !important;
    border-radius: 10px;
}

    .btn-outline-primary:hover,
    .btn-outline-primary:focus,
    .btn-outline-brand:hover,
    .btn-outline-brand:focus {
        color: #fff !important;
        background: var(--brand-blue) !important;
        border-color: var(--brand-blue) !important;
        box-shadow: 0 0 0 .2rem rgba(39,113,142,.20) !important;
    }

/* Outline secondary buttons - override purple with brand blue */
.btn-outline-secondary {
    background: #fff !important;
    color: var(--brand-blue) !important;
    border: 1px solid var(--brand-blue) !important;
    border-radius: 10px;
}

    .btn-outline-secondary:hover,
    .btn-outline-secondary:focus,
    .btn-outline-secondary:active {
        color: #fff !important;
        background: var(--brand-blue) !important;
        border-color: var(--brand-blue) !important;
        box-shadow: 0 0 0 .2rem rgba(39,113,142,.20) !important;
    }

/* Page-level actions bar */
.page-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .page-actions .btn {
        border-radius: 10px;
        font-weight: 600;
        display: inline-flex;
        align-items: center;
        gap: .45rem;
    }

/* Icon-size utility button */
.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    background: #fff;
    margin-left: 4px;
}

    .btn-icon:hover {
        border-color: #cbd5e1;
        box-shadow: 0 1px 3px rgba(0,0,0,.08);
    }

/* Accordion controls */
.acc-controls .btn {
    border-radius: 10px !important;
    font-weight: 600 !important;
    padding: .36rem .62rem !important;
    line-height: 1.25 !important;
    box-shadow: none !important;
}

/* ===================================================================
   BADGES / STATUS
   =================================================================== */
.badge, .pill {
    border-radius: 999px;
}

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .25rem .75rem;
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 600;
}

    .badge-status .dot {
        width: .45rem;
        height: .45rem;
        border-radius: 50%;
    }

    .badge-status.active {
        background: #4B8DA2;
        color: #ffffff;
    }

        .badge-status.active .dot {
            background: #ffffff;
        }

    .badge-status.inactive {
        background: #e5e7eb;
        color: #4b5563;
    }

        .badge-status.inactive .dot {
            background: #9ca3af;
        }

/* Profile avatar */
.profile-avatar-lg {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: var(--brand-blue);
    color: #fff;
}

/* ===================================================================
   TABLES
   =================================================================== */
.table {
    width: 100%;
}

    .table thead th {
        position: sticky;
        top: 0;
        z-index: 1;
        background: #1E3A4A;
        color: #667085;
        font-size: .72rem;
        text-transform: uppercase;
        letter-spacing: .02em;
        padding: 0.75rem 0.75rem;
        border-bottom: 1px solid var(--border);
    }

    .table tbody td {
        padding: 0.5rem 0.75rem; /* compact padding */
        border-bottom: 1px solid #f0f2f5;
        vertical-align: middle;
    }

.table-hover tbody tr:hover {
    background: #f7fbfd;
}

/* DataTables quick styling */
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--brand-blue) !important;
    color: #fff !important;
    border: 0 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--brand-hover) !important;
    color: #fff !important;
    border: 0 !important;
}

/* ===================================================================
   ACCORDION (forms)
   =================================================================== */
.card, .accordion, .accordion .card {
    border: 0;
    background: transparent;
}

    .card-header, .accordion .card-header {
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 10px;
        margin-bottom: 8px;
        padding: 12px 14px;
    }

        .card-header .btn {
            color: #111;
            font-weight: 600;
        }

/* ===================================================================
   FOOTER
   =================================================================== */
.footer .copyright a {
    color: var(--brand-blue) !important;
    font-weight: 700;
}

    .footer .copyright a:hover {
        color: var(--brand-hover);
    }

/* ===================================================================
   PAGE HERO (company + role + avatar)
   =================================================================== */
.page-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
}

    .page-hero .ph-left {
        display: flex;
        flex-direction: column;
        gap: 2px;
        min-width: 0;
    }

    .page-hero .ph-title {
        font-size: 20px;
        line-height: 1.2;
        font-weight: 700;
        color: var(--brand-blue);
    }

    .page-hero .ph-sub {
        font-size: 12.5px;
        color: var(--muted);
        font-weight: 600;
        letter-spacing: .02em;
    }

    .page-hero .ph-right {
        display: flex;
        align-items: center;
        gap: 14px;
    }

    .page-hero .ph-user {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .page-hero .ph-user-meta {
        text-align: right;
    }

    .page-hero .ph-user-name {
        font-weight: 700;
        color: #0f172a;
        line-height: 1.1;
    }

    .page-hero .ph-user-role {
        font-size: 12.5px;
        color: var(--muted);
    }

    .page-hero .ph-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: var(--brand-blue);
        color: #fff;
        font-weight: 800;
        border: 2px solid #fff;
        box-shadow: 0 1px 3px rgba(0,0,0,.08);
        object-fit: cover;
    }

    .page-hero .ph-initials {
        font-size: 14px;
    }

/* ===================================================================
   BREADCRUMBS BAR (tight, below hero)
   =================================================================== */
.row.page-titles.mx-0 {
    margin: 0 !important;
}

.row.page-titles .col.p-md-0 {
    padding: 0 !important;
}

.row.page-titles {
    background: var(--crumb-bg);
    border-bottom: 1px solid var(--crumb-line);
    padding: 10px 0; /* trimmed vertical space */
}

    .row.page-titles .breadcrumb {
        background: transparent;
        margin: 0;
        padding: 0 12px;
        display: flex;
        align-items: center;
        gap: 10px;
    }

        .row.page-titles .breadcrumb .breadcrumb-item {
            font-weight: 500;
            color: var(--crumb-muted);
            display: inline-flex;
            align-items: center;
        }

            .row.page-titles .breadcrumb .breadcrumb-item + .breadcrumb-item::before {
                content: "•";
                color: var(--crumb-muted);
                padding: 0 6px;
            }

            .row.page-titles .breadcrumb .breadcrumb-item a {
                color: var(--crumb-blue);
                text-decoration: none;
            }

                .row.page-titles .breadcrumb .breadcrumb-item a:hover {
                    color: #1f5f77;
                    text-decoration: underline;
                }

/* Optional inline page title if you print one there */
.page-title-inline {
    font-size: 24px;
    font-weight: 500;
    color: var(--brand-blue);
    margin: 0 12px 0 0;
}

/* Header actions aligned to the right if you place them in same row */
.page-header-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-right: 12px;
}

/* ===================================================================
   TABS RAIL (Fleet soft-grey with white active pill)
   =================================================================== */
.tabs-rail {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #eef3f7;
    border: 1px solid #e3e9ef;
    border-radius: 14px;
    padding: 6px;
    margin: 0 12px 12px;
    overflow: auto;
}

    .tabs-rail .nav-item {
        margin: 0;
    }

    .tabs-rail .nav-link {
        border: 1px solid transparent !important;
        background: transparent !important;
        color: var(--brand-blue) !important;
        font-weight: 600;
        line-height: 1;
        white-space: nowrap;
        border-radius: 999px;
        padding: .6rem 1rem;
    }

        .tabs-rail .nav-link:hover {
            color: #1f5f77 !important;
            background: rgba(76,156,188,.08) !important;
            border-color: #d9e3ea !important;
        }

        .tabs-rail .nav-link.active {
            background: #fff !important;
            color: #0b3a4a !important;
            border-color: #d9e3ea !important;
            box-shadow: 0 2px 6px rgba(16,24,40,.06) inset, 0 1px 2px rgba(16,24,40,.04);
        }

/* ===================================================================
   MISC UTILITIES / FIXES
   =================================================================== */
.row-link {
    cursor: pointer;
}

    .row-link:focus {
        outline: 2px solid var(--brand-blue);
        outline-offset: -2px;
    }

.pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .25rem .6rem;
    border-radius: 9999px;
    font-size: .8125rem;
}

    .pill .dot {
        width: .5rem;
        height: .5rem;
        border-radius: 50%;
        display: inline-block;
    }

.pill-active {
    background: rgba(20,134,160,.12);
    color: #0B5666;
}

.pill-inactive {
    background: #F3F4F6;
    color: #6B7280;
}

.dot-active {
    background: #1486A0;
}

.dot-inactive {
    background: #9CA3AF;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #eef2f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

/* fixed typo + sensible utility */
.font-weight-bold {
    font-weight: 700;
    color: var(--brand-blue);
}

/* Typography tune */
h1, h2, h3, h4, .section-hd, .card-header .btn, .card-hd {
    font-weight: 500 !important;
    color: var(--brand-blue);
}

/* Chips for statuses */
.chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .22rem .55rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: .82rem;
    border: 1px solid transparent;
}

.chip-pending {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #b45309;
}

.chip-done {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #065f46;
}

/* Profile actions (icons near avatar) */
.profile-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin: 6px 0 2px;
}

.icon-btn {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    border: 1px solid #d9e6ee;
    background: #fff;
    color: #27718e;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

    .icon-btn:hover {
        background: #f2f8fb;
    }

    .icon-btn.danger {
        color: #b42318;
        border-color: #f3c7c9;
    }

        .icon-btn.danger:hover {
            background: #fff3f3;
        }

    .icon-btn.warn {
        color: #a16207;
        border-color: #fcd34d;
    }

        .icon-btn.warn:hover {
            background: #fffbeb;
        }

    .icon-btn.success {
        color: #166534;
        border-color: #86efac;
    }

        .icon-btn.success:hover {
            background: #f0fdf4;
        }

    /* Drivers-specific icon pills override shape + colors */
    .icon-btn.edit i {
        color: #4B8DA2;
    }

    .icon-btn.edit:hover {
        background: #e0f2fe;
        border-color: #bfdbfe;
    }

    .icon-btn.delete i {
        color: #e11d48;
    }

    .icon-btn.delete:hover {
        background: #fef2f2;
        border-color: #fecaca;
    }

    .icon-btn.more i {
        color: #6b7280;
    }

    .icon-btn.more:hover {
        background: #f3f4f6;
        border-color: #d1d5db;
    }

/* Trims big gap that sometimes appears after last tab */
.nav-tabs + .tab-content > .tab-pane {
    padding-top: 0;
}

.nav-tabs + .tab-content {
    margin-top: 6px;
}

/* ---------- Page fundamentals ---------- */
h1, h2, h3, h4 {
    color: var(--ink);
    font-weight: 800;
}

h3 {
    font-size: 1.35rem;
    letter-spacing: .1px;
    margin: 0;
}

.breadcrumb {
    background: transparent;
    margin: 0;
    padding: 0;
}

    .breadcrumb .breadcrumb-item,
    .breadcrumb .breadcrumb-item a {
        color: #6b7280;
    }

        .breadcrumb .breadcrumb-item + .breadcrumb-item::before {
            color: #9aa3af;
        }

        .breadcrumb .breadcrumb-item a:hover {
            color: var(--brand-blue);
        }

/* Card */
.shadow-panel {
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

/* Accordion wrapper */
.crm-acc .acc-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 12px;
    background: #fff;
    box-shadow: 0 10px 20px -18px rgba(20,134,160,.35);
}

.crm-acc .acc-hd {
    min-height: 52px;
    padding: 12px 16px;
    background: #fff;
    border: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
    text-align: left;
}

    .crm-acc .acc-hd:hover {
        background: rgba(20,134,160,.05);
    }

.crm-acc .acc-item.open .acc-hd {
    background: var(--table-head);
}

.crm-acc .acc-hd .icon {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(20,134,160,.18);
    color: var(--brand-blue);
}

.crm-acc .acc-hd .label {
    font-weight: 600;
    font-size: .98rem;
    letter-spacing: .1px;
}

.crm-acc .caret {
    margin-left: auto;
    font-size: .95rem;
    color: #6b7280;
    transition: transform .2s ease;
}

.crm-acc .acc-item.open .caret {
    transform: rotate(180deg);
}

.crm-acc .acc-bd {
    padding: 16px;
    border-top: 1px solid var(--border);
}

/* Forms */
.form-group label {
    font-weight: 600;
    color: #334155;
}

.form-control {
    height: 42px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

    .form-control:focus {
        border-color: var(--brand-hover) !important;
        box-shadow: 0 0 0 3px rgba(76,156,188,.18) !important;
        outline: 0;
    }

input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
    -webkit-text-fill-color: var(--ink);
}

/* --------- Unified checkbox rows (Training + Toolbox) ---------- */
.module-list, .toolbox-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ucheck {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #fff;
    transition: box-shadow .15s, border-color .15s;
    position: relative;
}

    .ucheck:hover {
        border-color: #cfd8e3;
        box-shadow: 0 1px 4px rgba(16,24,40,.08);
    }

    /* kill any theme bullets / fake boxes */
    .ucheck::before, .ucheck::after, label.ucheck::before, label.ucheck::after, .ucheck::marker {
        content: none !important;
        display: none !important;
    }

    /* hide native checkbox; label still toggles it */
    .ucheck > input {
        position: absolute;
        left: -9999px;
        width: 1px;
        height: 1px;
        opacity: 0;
    }

    /* visual box */
    .ucheck .box {
        width: var(--cb-size);
        height: var(--cb-size);
        border: 2px solid #cbd5e1;
        border-radius: 10px;
        background: #fff;
        display: grid;
        place-items: center;
        flex: 0 0 auto;
        box-sizing: border-box;
        position: relative;
        overflow: hidden;
        transition: border-color .12s, box-shadow .12s, background .12s;
    }

        /* tick as inline SVG, always centered */
        .ucheck .box::before {
            content: "";
            position: absolute;
            inset: 0;
            background-position: center;
            background-repeat: no-repeat;
            background-size: 64% 64%;
            opacity: 0;
            transform: scale(.85);
            transition: opacity .12s ease, transform .12s ease;
        }

    /* checked state */
    .ucheck > input:checked + .box {
        background: var(--brand-blue);
        border-color: var(--brand-blue);
        box-shadow: 0 0 0 3px rgba(39,113,142,.18);
    }

        .ucheck > input:checked + .box::before {
            background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'><path d='M4 13l6 6L20 7'/></svg>");
            opacity: 1;
            transform: scale(1);
        }

/* thumbnail */
.thumb {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
    flex: 0 0 auto;
    background: #f2f4f7;
}

/* title */
.mod-title {
    font-size: 1rem;
    line-height: 1.25;
    font-weight: 600;
    color: #0f172a;
}

/* hint strip */
.module-hint {
    font-size: .85rem;
    color: #6b7280;
    background: #f0f5ff;
    border: 1px solid #d7e3ff;
    padding: 10px 12px;
    border-radius: 8px;
    margin: 6px 0 14px;
}

/* ===================================================================
   NEW MOCKUP-BASED SIDEBAR
   =================================================================== */

.new-sidebar {
    width: 256px; /* w-64 */
    background-color: var(--brand-blue);
    color: white;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1020;
    transition: width 0.2s ease;
}

    .new-sidebar .sidebar-header {
        padding: 24px; /* p-6 */
        border-bottom: 1px solid #555555;
    }

        .new-sidebar .sidebar-header .flex-container {
            display: flex;
            align-items: center;
            gap: 12px; /* gap-3 */
        }

        .new-sidebar .sidebar-header .logo-container {
            width: 40px; /* w-10 */
            height: 40px; /* h-10 */
            background-color: var(--brand-hover);
            border-radius: 8px; /* rounded-lg */
            display: flex;
            align-items: center;
            justify-content: center;
        }

            .new-sidebar .sidebar-header .logo-container .fas {
                width: 24px; /* w-6 */
                height: 24px; /* h-6 */
                font-size: 24px;
            }

        .new-sidebar .sidebar-header .title-container h1 {
            font-size: 20px; /* text-xl */
            color: white;
            margin: 0;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            font-weight: 600;
        }

        .new-sidebar .sidebar-header .title-container p {
            font-size: 12px; /* text-xs */
            color: #D1D5DB; /* text-gray-300 */
            margin: 0;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
        }

        .new-sidebar .sidebar-collapse-btn {
            margin-left: auto;
            background: transparent;
            border: none;
            color: white;
            cursor: pointer;
            padding: 8px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background-color 0.2s ease;
        }

            .new-sidebar .sidebar-collapse-btn:hover {
                background-color: rgba(75, 141, 162, 0.3);
            }

            .new-sidebar .sidebar-collapse-btn i,
            .new-sidebar .sidebar-collapse-btn svg {
                width: 20px;
                height: 20px;
                stroke-width: 2;
            }

    .new-sidebar .sidebar-nav {
        flex: 1;
        padding: 16px; /* p-4 */
        overflow-y: auto; /* Enable vertical scrolling */
        overflow-x: hidden; /* Hide horizontal scrollbar */
    }

        /* Custom scrollbar styling for sidebar */
        .new-sidebar .sidebar-nav::-webkit-scrollbar {
            width: 6px;
        }

        .new-sidebar .sidebar-nav::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.05);
            border-radius: 3px;
        }

        .new-sidebar .sidebar-nav::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.2);
            border-radius: 3px;
        }

        .new-sidebar .sidebar-nav::-webkit-scrollbar-thumb:hover {
            background: rgba(255, 255, 255, 0.3);
        }

        .new-sidebar .sidebar-nav ul {
            list-style: none;
            padding: 0;
            margin: 0;
            display: flex;
            flex-direction: column;
            gap: 8px; /* space-y-2 */
        }

            .new-sidebar .sidebar-nav ul li a,
            .new-sidebar .sidebar-nav ul li button {
                width: 100%;
                display: flex;
                align-items: center;
                gap: 12px; /* gap-3 */
                padding: 12px 16px; /* px-4 py-3 */
                border-radius: 8px; /* rounded-lg */
                transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out;
                color: #E5E7EB; /* text-gray-200 */
                background-color: transparent;
                border: none;
                cursor: pointer;
                text-align: left;
                font-size: 15px;
                font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            }

                .new-sidebar .sidebar-nav ul li a span,
                .new-sidebar .sidebar-nav ul li button span {
                    font-weight: 500; /* Make text slightly bolder */
                }

            .new-sidebar .sidebar-nav ul li i,
            .new-sidebar .sidebar-nav ul li svg {
                width: 20px; /* w-5 */
                height: 20px; /* h-5 */
                stroke-width: 2; /* Consistent line weight */
                flex-shrink: 0; /* Prevent icon from shrinking */
            }

            .new-sidebar .sidebar-nav ul li a:hover,
            .new-sidebar .sidebar-nav ul li button:hover {
                background-color: rgba(75, 141, 162, 0.3); /* hover:bg-brand-hover/30 */
            }

            .new-sidebar .sidebar-nav ul li a.active,
            .new-sidebar .sidebar-nav ul li button.active {
                background-color: var(--brand-hover);
                color: white;
            }

            /* Sub-menu styles */
            .new-sidebar .sidebar-nav ul .sub-menu {
                list-style: none;
                padding: 8px 0 8px 28px; /* Indent sub-menu */
                margin: 0;
                display: none; /* Hidden by default */
                background-color: rgba(0, 0, 0, 0.1);
                border-radius: 8px;
            }

            .new-sidebar .sidebar-nav ul li.open .sub-menu {
                display: block; /* Show when parent is open */
            }

            .new-sidebar .sidebar-nav ul .sub-menu li a {
                padding: 8px 16px;
                font-size: 13px;
            }

    .new-sidebar .sidebar-footer {
        padding: 16px; /* p-4 */
        border-top: 1px solid #555555;
        display: flex;
        flex-direction: column;
        gap: 8px; /* space-y-2 */
    }

        .new-sidebar .sidebar-footer a,
        .new-sidebar .sidebar-footer button {
            width: 100%;
            display: flex;
            align-items: center;
            gap: 12px; /* gap-3 */
            padding: 12px 16px; /* px-4 py-3 */
            border-radius: 8px; /* rounded-lg */
            transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out;
            color: #E5E7EB; /* text-gray-200 */
            background-color: transparent;
            border: none;
            cursor: pointer;
            text-align: left;
            font-size: 15px;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
        }

            .new-sidebar .sidebar-footer a span,
            .new-sidebar .sidebar-footer button span {
                font-weight: 500; /* Make text slightly bolder */
            }

        .new-sidebar .sidebar-footer i,
        .new-sidebar .sidebar-footer svg {
            width: 20px; /* w-5 */
            height: 20px; /* h-5 */
            stroke-width: 2; /* Consistent line weight */
            flex-shrink: 0; /* Prevent icon from shrinking */
        }

        .new-sidebar .sidebar-footer a:hover,
        .new-sidebar .sidebar-footer button:hover {
            background-color: rgba(75, 141, 162, 0.3); /* hover:bg-brand-hover/30 */
        }

/* Collapsed sidebar state */
.new-sidebar.collapsed {
    width: 80px;
}

    .new-sidebar.collapsed .sidebar-header {
        padding: 16px 12px;
    }

    .new-sidebar.collapsed .sidebar-header .flex-container {
        flex-direction: column;
        gap: 16px;
    }

    .new-sidebar.collapsed .sidebar-header .title-container {
        display: none;
    }

    .new-sidebar.collapsed .sidebar-collapse-btn {
        margin-left: 0;
        padding: 8px;
        order: 1; /* Move button below logo */
    }

    .new-sidebar.collapsed .sidebar-header .logo-container {
        order: -1; /* Logo comes before button */
    }

    .new-sidebar.collapsed .sidebar-nav ul li a span,
    .new-sidebar.collapsed .sidebar-nav ul li button span {
        display: none;
    }

    .new-sidebar.collapsed .sidebar-nav ul li a,
    .new-sidebar.collapsed .sidebar-nav ul li button {
        justify-content: center;
        padding: 12px;
    }

    .new-sidebar.collapsed .sidebar-footer span {
        display: none;
    }

    .new-sidebar.collapsed .sidebar-footer a,
    .new-sidebar.collapsed .sidebar-footer button {
        justify-content: center;
        padding: 12px;
    }

    .new-sidebar.collapsed .sub-menu {
        display: none !important;
    }

/* Content body adjustment when sidebar is collapsed */
.content-body.sidebar-collapsed {
    margin-left: 80px !important;
}

/* ===================================================================
   MODERN TABLE UI (Standardized - used by all list pages)
   =================================================================== */

/* Page container */
.table-page,
.drivers-page {
    padding: 16px 0 24px;
}

/* Page header (title + action button) */
.table-page-header,
.drivers-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 8px;
}

/* Page title */
.table-title,
.drivers-title {
    margin: 0;
    font-size: 30px;
    font-weight: 700;
    color: var(--brand-blue);
}

/* Page subtitle */
.table-subtitle,
.drivers-subtitle {
    margin: 4px 0 0;
    font-size: 0.9rem;
    color: var(--muted);
}

/* Search bar */
.table-toolbar,
.drivers-toolbar {
    margin-bottom: 16px;
    margin-top: 18px;
}

.table-search,
.drivers-search {
    position: relative;
    width: 80%;
    max-width: none;
}

    .table-search .icon,
    .drivers-search .icon {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 0.85rem;
        color: #9ca3af;
        pointer-events: none;
    }

.table-search-input,
.drivers-search-input {
    border-radius: 999px !important;
    padding-left: 34px !important;
    height: 40px;
    background: #f3f4f6;
    border-color: #d1d5db;
    box-shadow: none;
}

/* Avatar in table rows */
.item-avatar,
.driver-avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: var(--brand-hover); /* teal-ish */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
}

/* Item name/title in table rows */
.item-name,
.driver-name {
    font-weight: 600;
    color: var(--ink);
}

/* Contact info */
.item-contact,
.driver-contact {
    /* No specific styles, just a wrapper */
}

.item-email,
.driver-email {
    display: block;
    font-size: 0.8rem;
    color: var(--brand-hover);
}

.item-phone,
.driver-phone {
    font-size: 0.8rem;
    color: #555;
}

/* Card wrapper for modern tables (zero padding) */
.section-card.table-card,
.section-card.drivers-card {
    padding: 0;
    margin-bottom: 1rem;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    background: transparent;
}

    /* White background only on table itself */
    .section-card.table-card .table-responsive,
    .section-card.drivers-card .table-responsive {
        background: #ffffff;
    }

/* Fix DataTables wrapper - remove default container-fluid padding */
.dataTables_wrapper.container-fluid {
    padding: 0 !important;
    background: transparent !important;
}

/* Filter card styling */
.filter-card {
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 1.5rem;
    background-color: #ffffff;
}

/* Table inside modern card */
.table-card .table,
.drivers-card .table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

    /* Header row: dark blue background with brand-blue top border */
    .table-card .table thead tr,
    .drivers-card .table thead tr {
        border-top: 2px solid var(--brand-blue);
    }

    .table-card .table thead th,
    .drivers-card .table thead th {
        background: #0f3546;
        color: #ffffff;
        text-transform: none;
        font-size: 0.85rem;
        border-top: none;
        border-bottom: 1px solid #d9e3ea !important;
        padding: 0.75rem 0.75rem;
    }

    /* Add border radius to first and last header cells */
    .table-card .table thead th:first-child,
    .drivers-card .table thead th:first-child {
        border-top-left-radius: 14px;
    }

    .table-card .table thead th:last-child,
    .drivers-card .table thead th:last-child {
        border-top-right-radius: 14px;
    }

    .table-card .table tbody td,
    .drivers-card .table tbody td {
        border-bottom: 1px solid #f0f2f5;
        padding: 0.5rem 0.75rem;
    }

    .table-card .table tbody tr:hover,
    .drivers-card .table tbody tr:hover {
        background: #f7fbfd;
    }

/* Status pills use .badge-status (defined earlier in file) */

/* Action buttons container */
.table-actions,
.drivers-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

    /* Individual action button (deprecated - use .icon-btn instead) */
    .table-actions .table-action-btn,
    .drivers-actions .drivers-action-btn {
        width: 32px;
        height: 32px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 999px;
    }

/* ===================================================================
   RESPONSIVE
   =================================================================== */
@media (max-width:1199.98px) {
    :root {
        --sidebar-w: 240px;
    }
}

@media (max-width:991.98px) {
    :root {
        --sidebar-w: 220px;
        --sidebar-w-collapsed: 72px;
    }

    .kv-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width:575.98px) {
    .page-hero {
        padding: 12px;
    }

        .page-hero .ph-title {
            font-size: 18px;
        }

        .page-hero .ph-user-name {
            font-size: 13.5px;
        }

        .page-hero .ph-user-role {
            font-size: 12px;
        }

        .page-hero .ph-avatar {
            width: 36px;
            height: 36px;
        }
}

/* ================================================
   DataTables Customization
   ================================================ */

/* Add horizontal padding/margin to the footer row containing length menu and pagination */
.dataTables_wrapper .d-flex {
    padding: 0 1rem !important;
}

/* Add left margin to "Show X entries" dropdown */
.dataTables_length {
    margin-left: 0 !important;
}

/* Add right margin to pagination */
.dataTables_paginate {
    margin-right: 0 !important;
}

/* Change pagination colors from purple (#7571f9) to brand color */
.page-item.active .page-link {
    background-color: var(--brand-blue) !important;
    border-color: var(--brand-blue) !important;
    color: #fff !important;
}

.page-link:hover {
    background-color: var(--brand-hover) !important;
    border-color: var(--brand-hover) !important;
    color: #fff !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--brand-blue) !important;
    border-color: var(--brand-blue) !important;
    color: white !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--brand-hover) !important;
    border-color: var(--brand-hover) !important;
    color: white !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-color: #dee2e6 !important;
}

/* Form card styling - white background, rounded corners, no shadow */
.form-card {
    background: #ffffff !important;
    border-radius: 0.5rem !important;
    padding: 2rem !important;
    margin-bottom: 2rem !important;
    border: 1px solid #e0e0e0 !important;
}

/* Form page header */
.form-page-header {
    margin-bottom: 1.5rem;
}

.form-page-header h4 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}
