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

:root {
    --cm-red: #c9192e;
    --cm-red-dark: #a81425;
    --cm-red-light: #fde8eb;
    --cm-sidebar: #2f4050;
    --cm-sidebar-active: #293846;
    --cm-sidebar-accent: #19aa8d;
    --cm-teal: #00a8a8;
    --cm-teal-light: #e6f7f7;
    --cm-bg: #f4f6f9;
    --cm-white: #ffffff;
    --cm-border: #e5e9ef;
    --cm-text: #111827;
    --cm-text-muted: #6b7280;
    --cm-success: #16a34a;
    --cm-warning: #f59e0b;
    --cm-info: #2563eb;
    --cm-purple: #7c3aed;
    --cm-sidebar-width: 260px;
    --cm-header-height: 64px;
    --cm-radius: 10px;
    --cm-radius-sm: 8px;
    --cm-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 16px rgba(15, 23, 42, 0.04);
}

/* ---- Base ---- */
body.cm-dashboard-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--cm-bg) !important;
    color: var(--cm-text);
    font-size: 14px;
}

body.cm-dashboard-body .pace-done {
    font-size: 14px;
}

/* ---- Sidebar ---- */
body.cm-dashboard-body .navbar-static-side {
    width: var(--cm-sidebar-width);
    background: var(--cm-sidebar) !important;
    border-right: none;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.06);
}

body.cm-dashboard-body .sidebar-collapse {
    padding: 0;
}

body.cm-dashboard-body .cm-sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 14px;
    background: var(--cm-sidebar);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body.cm-dashboard-body .cm-sidebar-brand-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

body.cm-dashboard-body .cm-sidebar-brand img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
}

body.cm-dashboard-body .cm-sidebar-brand span {
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.cm-dashboard-body .cm-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #dfe4ed;
    flex-shrink: 0;
    text-decoration: none !important;
    transition: background 0.15s, color 0.15s;
}

body.cm-dashboard-body .cm-sidebar-toggle:hover,
body.cm-dashboard-body .cm-sidebar-toggle:focus {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

body.cm-dashboard-body .cm-sidebar-toggle i {
    font-size: 18px;
    line-height: 1;
    transition: transform 0.25s ease;
}

body.mini-navbar.cm-dashboard-body .cm-sidebar-toggle i {
    transform: rotate(180deg);
}

body.cm-dashboard-body #side-menu {
    padding: 12px 10px 80px;
}

body.cm-dashboard-body #side-menu > li > a {
    color: rgba(255, 255, 255, 0.78) !important;
    padding: 11px 14px;
    border-radius: var(--cm-radius-sm);
    margin-bottom: 2px;
    font-weight: 500;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.15s, color 0.15s;
}

body.cm-dashboard-body #side-menu > li > a i {
    width: 18px;
    text-align: center;
    font-size: 15px;
    opacity: 0.9;
}

body.cm-dashboard-body #side-menu > li > a:hover,
body.cm-dashboard-body #side-menu > li > a:focus {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
}

body.cm-dashboard-body #side-menu > li.active > a {
    background: var(--cm-sidebar-active) !important;
    color: #fff !important;
    box-shadow: inset 4px 0 0 var(--cm-sidebar-accent);
}

body.cm-dashboard-body li.nav-header {
    display: none;
}

body.cm-dashboard-body .cm-sidebar-help {
    position: fixed;
    bottom: 52px;
    left: 10px;
    width: calc(var(--cm-sidebar-width) - 20px);
    background: var(--cm-sidebar-active);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--cm-radius);
    padding: 14px;
    z-index: 1001;
}

body.cm-dashboard-body .cm-sidebar-help p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
    margin: 0 0 10px;
    line-height: 1.4;
}

body.cm-dashboard-body .cm-sidebar-help a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
}

body.cm-dashboard-body .cm-sidebar-help a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

body.mini-navbar.cm-dashboard-body .cm-sidebar-help {
    display: none;
}

/* ---- Header ---- */
body.cm-dashboard-body #page-wrapper {
    margin-left: var(--cm-sidebar-width);
    width: calc(100% - var(--cm-sidebar-width));
    background: var(--cm-bg);
}

body.cm-dashboard-body .footer {
    left: var(--cm-sidebar-width);
    width: calc(100% - var(--cm-sidebar-width));
    height: 48px;
    line-height: 48px;
    background: var(--cm-white);
    border-top: 1px solid var(--cm-border);
    padding: 0 24px;
    font-size: 12px;
    color: var(--cm-text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body.cm-dashboard-body .footer strong {
    font-weight: 500;
    color: var(--cm-text-muted);
}

body.cm-dashboard-body .cm-topbar {
    background: var(--cm-white) !important;
    border-bottom: 1px solid var(--cm-border) !important;
    min-height: var(--cm-header-height);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0 !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    position: sticky;
    top: 0;
    z-index: 900;
}

body.cm-dashboard-body .cm-topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

body.cm-dashboard-body .cm-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--cm-border);
    border-radius: 10px;
    background: #fff;
    color: #2f4050;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    padding: 0;
    flex-shrink: 0;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

body.cm-dashboard-body .cm-menu-toggle:hover,
body.cm-dashboard-body .cm-menu-toggle:focus {
    background: #f8fafc;
    color: var(--cm-red);
    outline: none;
}

body.cm-dashboard-body .cm-sidebar-close {
    display: none;
}

body.cm-dashboard-body .cm-sidebar-backdrop {
    display: none;
}

body.cm-dashboard-body .cm-global-search {
    flex: 1;
    max-width: 520px;
    position: relative;
}

body.cm-dashboard-body .cm-global-search input {
    width: 100%;
    height: 42px;
    border: 1px solid var(--cm-border);
    border-radius: 999px;
    padding: 0 16px 0 42px;
    font-size: 14px;
    background: #f9fafb;
    color: var(--cm-text);
}

body.cm-dashboard-body .cm-global-search input:focus {
    outline: none;
    border-color: var(--cm-teal);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 168, 168, 0.12);
}

body.cm-dashboard-body .cm-global-search i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--cm-text-muted);
}

body.cm-dashboard-body .cm-topbar-right {
    display: flex;
    align-items: center;
    gap: 0;
    margin-right: 0;
    padding-right: 8px;
}

body.cm-dashboard-body .cm-topbar-right > li {
    padding: 0;
}

body.cm-dashboard-body .cm-notify-item {
    display: flex;
    align-items: center;
}

body.cm-dashboard-body .cm-notify-btn {
    position: relative;
    width: auto;
    height: auto;
    border: none;
    border-radius: 0;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #2f4050;
    font-size: 22px;
    padding: 8px 14px;
    line-height: 1;
}

body.cm-dashboard-body .cm-notify-badge {
    position: absolute;
    top: 2px;
    right: 6px;
    background: var(--cm-red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 17px;
    height: 17px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #fff;
}

body.cm-dashboard-body .cm-topbar-divider-item {
    display: flex;
    align-items: center;
    padding: 0 4px !important;
}

body.cm-dashboard-body .cm-topbar-divider {
    width: 1px;
    height: 34px;
    background: #dde3ea;
    display: block;
}

body.cm-dashboard-body .cm-user-menu > a,
body.cm-dashboard-body li.dropdown.profile-li a {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 6px 10px !important;
    background: transparent !important;
    color: #2f4050 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    box-shadow: none !important;
}

body.cm-dashboard-body li.dropdown.profile-li {
    padding: 0 !important;
}

body.cm-dashboard-body .cm-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e4ebf3;
    color: #2f4050;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

body.cm-dashboard-body .cm-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.25;
    min-width: 0;
}

body.cm-dashboard-body .cm-user-name {
    font-size: 15px;
    font-weight: 700;
    color: #2f4050;
    white-space: nowrap;
}

body.cm-dashboard-body .cm-user-info small {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: #8b95a5;
    line-height: 1.3;
}

body.cm-dashboard-body .cm-user-chevron {
    font-size: 11px;
    color: #2f4050;
    margin-left: 4px;
    flex-shrink: 0;
}

body.cm-dashboard-body .cm-user-menu .caret {
    display: none;
}

body.cm-dashboard-body .cm-user-menu .dropdown-menu {
    border-radius: var(--cm-radius-sm);
    border: 1px solid var(--cm-border);
    box-shadow: var(--cm-shadow);
    padding: 6px 0;
    min-width: 180px;
}

body.cm-dashboard-body .cm-user-menu .dropdown-menu .btn-link {
    color: var(--cm-text) !important;
    font-weight: 500 !important;
    padding: 8px 16px !important;
}

body.cm-dashboard-body .cm-user-menu .dropdown-menu .btn-link:hover {
    background: #f9fafb;
}

/* Mini navbar */
body.mini-navbar.cm-dashboard-body .navbar-static-side {
    width: 70px;
}

body.mini-navbar.cm-dashboard-body #page-wrapper,
body.mini-navbar.cm-dashboard-body .footer {
    margin-left: 70px;
    left: 70px;
    width: calc(100% - 70px);
}

body.mini-navbar.cm-dashboard-body .cm-sidebar-brand span {
    display: none;
}

body.mini-navbar.cm-dashboard-body .cm-sidebar-brand {
    flex-direction: column;
    gap: 8px;
    padding: 12px 6px;
}

body.mini-navbar.cm-dashboard-body .cm-sidebar-brand-left {
    justify-content: center;
}

body.mini-navbar.cm-dashboard-body #side-menu .nav-label {
    display: none;
}

/* ---- Page shell ---- */
.cm-page {
    padding: 24px;
}

.cm-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.cm-page-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--cm-text);
    margin: 0 0 6px;
    letter-spacing: -0.02em;
}

.cm-breadcrumb {
    font-size: 13px;
    color: var(--cm-text-muted);
}

.cm-breadcrumb a {
    color: var(--cm-teal);
    text-decoration: none;
    font-weight: 500;
}

.cm-breadcrumb a:hover {
    text-decoration: underline;
}

.cm-breadcrumb-sep {
    margin: 0 8px;
    color: #cbd5e1;
}

.cm-page-subtitle {
    font-size: 14px;
    color: var(--cm-text-muted);
    margin: 0;
}

/* ---- Cards ---- */
body.cm-dashboard-body .ibox.float-e-margins {
    background: transparent;
    border: none;
    box-shadow: none;
    margin-bottom: 0;
}

body.cm-dashboard-body .ibox-title {
    background: transparent;
    border: none;
    padding: 0;
    min-height: auto;
}

body.cm-dashboard-body .ibox-title h3 {
    display: none;
}

body.cm-dashboard-body .ibox-content {
    background: var(--cm-white);
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius);
    box-shadow: var(--cm-shadow);
    padding: 20px;
    margin-bottom: 16px;
}

body.cm-dashboard-body .cm-card {
    background: var(--cm-white);
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius);
    box-shadow: var(--cm-shadow);
    padding: 20px;
    margin-bottom: 16px;
}

body.cm-dashboard-body .cm-card:last-child {
    margin-bottom: 0;
}

/* ---- Tabs ---- */
.cm-tabs,
body.cm-dashboard-body #deliveryTabs,
body.cm-dashboard-body .nav-tabs {
    border-bottom: 2px solid var(--cm-border);
    margin-bottom: 20px;
    display: flex;
    gap: 4px;
    padding: 0;
    list-style: none;
}

.cm-tabs li,
body.cm-dashboard-body #deliveryTabs li,
body.cm-dashboard-body .nav-tabs > li {
    margin-bottom: -2px;
}

.cm-tabs li a,
body.cm-dashboard-body #deliveryTabs li a,
body.cm-dashboard-body .nav-tabs > li > a {
    display: inline-block;
    padding: 10px 18px;
    color: var(--cm-text-muted);
    font-weight: 600;
    font-size: 14px;
    border: none !important;
    border-bottom: 2px solid transparent !important;
    background: transparent !important;
    border-radius: 0 !important;
    text-decoration: none;
}

.cm-tabs li.active a,
.cm-tabs li a.active,
body.cm-dashboard-body #deliveryTabs li.active a,
body.cm-dashboard-body .nav-tabs > li.active > a,
body.cm-dashboard-body .nav-tabs > li > a.active {
    color: var(--cm-red) !important;
    border-bottom-color: var(--cm-red) !important;
    background: transparent !important;
}

/* Toggle tabs (Existing / New Request) */
.cm-toggle-tabs {
    display: inline-flex;
    gap: 8px;
    margin-bottom: 16px;
}

.cm-toggle-tabs .btn {
    border-radius: 999px !important;
    font-weight: 600;
    padding: 8px 20px;
}

.cm-toggle-tabs .btn.bg-info,
.cm-toggle-tabs .btn.cm-toggle-active {
    background: var(--cm-red) !important;
    color: #fff !important;
    border-color: var(--cm-red) !important;
}

.cm-toggle-tabs .btn:not(.bg-info):not(.cm-toggle-active) {
    background: #fff !important;
    color: var(--cm-text) !important;
    border: 1px solid var(--cm-border) !important;
}

/* ---- Inline filter row (rider/driver) ---- */
.cm-filter-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 16px;
    width: 100%;
}

.cm-filter-row .cm-filter-field {
    flex: 1 1 0;
    min-width: 0;
}

.cm-filter-row .cm-filter-field--search {
    flex: 1.5 1 0;
}

.cm-filter-row .cm-filter-field--date {
    flex: 1 1 0;
    max-width: 150px;
}

.cm-filter-row .cm-filter-clear {
    flex: 0 0 auto;
    padding-bottom: 1px;
}

.cm-filter-row .form-group {
    margin-bottom: 0;
}

.cm-filter-row .form-control,
.cm-filter-row .input-group {
    width: 100%;
}

.cm-filter-row .input-group .form-control {
    min-width: 0;
}

@media (max-width: 1200px) {
    .cm-filter-row {
        flex-wrap: wrap;
    }

    .cm-filter-row .cm-filter-field,
    .cm-filter-row .cm-filter-field--search,
    .cm-filter-row .cm-filter-field--date {
        flex: 1 1 calc(33.333% - 10px);
        max-width: none;
    }
}

/* ---- Rider/Driver management cards (mockup layout) ---- */
.cm-mgmt-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cm-mgmt-card {
    background: var(--cm-white);
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius);
    box-shadow: var(--cm-shadow);
    padding: 20px;
}

.cm-mgmt-tabs-card {
    padding: 16px 20px;
}

.cm-mgmt-tabs-card .cm-toggle-tabs {
    margin: 0;
}

.cm-mgmt-filter-card .cm-filter-row--inputs {
    margin-bottom: 0;
}

.cm-mgmt-filter-card .cm-filter-row {
    margin-bottom: 0;
}

.cm-filter-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.cm-filter-actions-right {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-left: auto;
}

.cm-search-input {
    position: relative;
}

.cm-search-input > i.fa-search {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--cm-text-muted);
    font-size: 13px;
    z-index: 2;
    pointer-events: none;
}

.cm-search-input .form-control {
    padding-left: 38px;
}

.cm-btn-reset,
.cm-btn-clear,
.cm-btn-download {
    height: 40px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--cm-radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cm-btn-reset {
    background: #fff;
    border: 1px solid var(--cm-border);
    color: var(--cm-text);
}

.cm-btn-reset:hover,
.cm-btn-reset:focus {
    background: #f8f9fa;
    color: var(--cm-text);
    border-color: var(--cm-border);
}

.cm-btn-clear {
    background: #fff;
    border: 1px solid var(--cm-border);
    color: var(--cm-red);
}

.cm-btn-clear:hover,
.cm-btn-clear:focus {
    background: #fff5f5;
    color: var(--cm-red);
    border-color: var(--cm-red);
}

.cm-btn-filter {
    min-width: 100px;
}

.cm-btn-download {
    background: #fff;
    border: 1px solid var(--cm-border);
    color: var(--cm-text);
}

.cm-btn-download i {
    color: var(--cm-teal);
}

.cm-btn-download:hover,
.cm-btn-download:focus {
    background: #f8f9fa;
    color: var(--cm-text);
    border-color: var(--cm-border);
}

.cm-mgmt-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.cm-mgmt-total {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cm-mgmt-total-label {
    font-weight: 600;
    color: var(--cm-text);
    font-size: 14px;
}

.cm-mgmt-total-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #e6f7f7;
    color: var(--cm-teal);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.cm-mgmt-total-icon--driver {
    background: #e8f0fe;
    color: #3b82f6;
}

.cm-mgmt-total-icon--transporter {
    background: #e6f7f7;
    color: var(--cm-teal);
}

.cm-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cm-name-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
    color: #334155;
}

.cm-table-actions {
    display: inline-flex;
    gap: 8px;
    justify-content: flex-end;
}

.cm-table-action-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--cm-border);
    background: #fff;
}

.cm-table-action-btn--edit {
    color: var(--cm-teal);
    border-color: #cce8e8;
    background: #f0fafa;
}

.cm-table-action-btn--delete {
    color: var(--cm-red);
    border-color: #f5d0d4;
    background: #fff5f5;
}

.cm-mgmt-total-icon--goods {
    background: #fce8eb;
    color: var(--cm-red);
}

.cm-mgmt-total-value--accent {
    color: var(--cm-red);
}

.cm-table-action-btn--edit-goods {
    color: var(--cm-red);
    border-color: #f5d0d4;
    background: #fff5f5;
}

.cm-mgmt-total-icon--vehicle {
    background: #e8f0fe;
    color: #3b82f6;
}

.cm-vehicle-type-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cm-vehicle-type-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    color: #334155;
}

.cm-vehicle-type-thumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--cm-border-light, #e8e8e8);
    background: #fff;
}

.cm-price-currency-group .cm-price-currency-btn {
    min-width: 88px;
    font-weight: 600;
    border-color: var(--cm-border, #dde1e6);
}

.cm-price-currency-menu li.active > a {
    background: #f0fafa;
    color: var(--cm-teal, #0d9488);
    font-weight: 600;
}

.cm-price-currency-hint {
    display: block;
    margin-top: 6px;
}

.cm-quantity-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e6f7f7;
    color: var(--cm-teal);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.cm-goods-categories-cell {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.45;
    color: #475569;
}

body.cm-dashboard-body .table-responsive > .table.cm-vehicle-category-table {
    width: 100%;
    min-width: 960px;
    max-width: 100%;
    table-layout: auto;
}

.cm-mgmt-table-card .table-responsive .cm-vehicle-category-table {
    width: 100%;
    min-width: 960px;
}

.cm-vehicle-category-table .cm-vehicle-col-sr {
    width: 72px;
    white-space: nowrap;
}

.cm-vehicle-category-table .cm-vehicle-col-type {
    width: 170px;
    min-width: 150px;
    white-space: nowrap;
}

.cm-vehicle-category-table .cm-vehicle-col-category {
    width: 120px;
    min-width: 110px;
    white-space: nowrap;
}

.cm-vehicle-category-table .cm-vehicle-col-quantity {
    width: 130px;
    min-width: 120px;
    white-space: nowrap;
}

.cm-vehicle-category-table .cm-vehicle-col-goods,
.cm-vehicle-category-table .cm-goods-categories-cell {
    min-width: 320px;
    width: 36%;
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: break-word;
    padding-right: 24px;
}

.cm-vehicle-category-table .cm-goods-categories-cell {
    display: block;
    overflow: visible;
}

body.cm-dashboard-body .table-responsive .cm-vehicle-category-table .cm-goods-categories-cell {
    white-space: normal !important;
}

.cm-vehicle-category-table .cm-vehicle-col-actions {
    width: 108px;
    min-width: 108px;
    max-width: 108px;
    white-space: nowrap !important;
    vertical-align: middle;
    padding-left: 8px;
}

.cm-vehicle-category-table .cm-table-actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
}

.cm-transaction-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

.cm-transaction-stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--cm-white);
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius);
    padding: 16px 18px;
    box-shadow: var(--cm-shadow);
    min-height: 88px;
}

.cm-transaction-stat-card .cm-stat-card-icon {
    margin-bottom: 0;
    border-radius: 50%;
    flex-shrink: 0;
}

.cm-transaction-stat-content {
    min-width: 0;
}

.cm-badge-mode {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.cm-badge-mode--cash {
    background: #dcfce7;
    color: #16a34a;
}

.cm-badge-mode--online {
    background: #dbeafe;
    color: #2563eb;
}

.cm-badge-payment {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.cm-badge-payment--success {
    background: #dcfce7;
    color: #16a34a;
}

.cm-badge-payment--pending {
    background: #fef3c7;
    color: #d97706;
}

.cm-badge-type-user {
    background: var(--cm-red);
    color: #fff;
}

.cm-badge-type-rider {
    background: var(--cm-success);
    color: #fff;
}

.cm-badge-type-driver {
    background: #6366f1;
    color: #fff;
}

.cm-notification-type-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.cm-badge-support-open {
    background: #ffedd5;
    color: #d97706;
}

.cm-badge-support-resolved {
    background: #dcfce7;
    color: #16a34a;
}

.cm-support-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

@media (max-width: 1200px) {
    .cm-transaction-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .cm-transaction-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.cm-mgmt-total-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--cm-text);
    line-height: 1;
}

.cm-mgmt-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.cm-mgmt-table-card {
    padding: 0;
    overflow: hidden;
}

.cm-mgmt-table-card .table-responsive {
    border-radius: 0;
    margin: 0;
}

.cm-mgmt-table-card .table {
    margin-bottom: 0;
}

.cm-mgmt-table-card .table thead th {
    background: #f8f9fb;
    border-bottom: 1px solid var(--cm-border);
    font-size: 12px;
    font-weight: 600;
    color: var(--cm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
    padding: 12px 16px;
}

.cm-mgmt-table-card .table tbody td {
    padding: 12px 16px;
    font-size: 13px;
    vertical-align: middle;
    border-top: 1px solid var(--cm-border-light, #f0f0f0);
}

.cm-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid var(--cm-border);
    flex-wrap: wrap;
    gap: 12px;
}

.cm-table-meta {
    font-size: 13px;
    color: var(--cm-text-muted);
    font-weight: 500;
}

.cm-table-pagination .btn-white.active {
    background: var(--cm-navy, #1e2a3a);
    color: #fff;
    border-color: var(--cm-navy, #1e2a3a);
}

@media (max-width: 768px) {
    .cm-mgmt-actions-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .cm-mgmt-actions {
        width: 100%;
    }

    .cm-filter-actions-row {
        flex-direction: column;
        align-items: stretch;
    }

    .cm-filter-actions-right {
        margin-left: 0;
        justify-content: flex-end;
    }
}

/* ---- Filters ---- */
.cm-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 16px;
}

.cm-filter-bar .form-control,
.cm-filter-bar .input-group {
    border-radius: var(--cm-radius-sm);
}

body.cm-dashboard-body .form-control {
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius-sm);
    height: 40px;
    font-size: 13px;
    box-shadow: none;
}

body.cm-dashboard-body .form-control:focus {
    border-color: var(--cm-teal);
    box-shadow: 0 0 0 3px rgba(0, 168, 168, 0.1);
}

body.cm-dashboard-body .input-group-addon {
    background: #f9fafb;
    border-color: var(--cm-border);
    color: var(--cm-text-muted);
}

.cm-filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: auto;
}

/* ---- Buttons ---- */
body.cm-dashboard-body .btn-primary {
    background: var(--cm-red) !important;
    border-color: var(--cm-red) !important;
    color: #fff !important;
    border-radius: var(--cm-radius-sm);
    font-weight: 600;
    padding: 8px 16px;
    font-size: 13px;
}

body.cm-dashboard-body .btn-primary:hover,
body.cm-dashboard-body .btn-primary:focus {
    background: var(--cm-red-dark) !important;
    border-color: var(--cm-red-dark) !important;
    color: #fff !important;
}

body.cm-dashboard-body .btn-default,
body.cm-dashboard-body .btn.btn:not(.btn-primary):not(.bg-info) {
    background: #fff;
    border: 1px solid var(--cm-border);
    color: var(--cm-text);
    border-radius: var(--cm-radius-sm);
    font-weight: 500;
}

body.cm-dashboard-body .btn-outline-teal {
    background: #fff;
    border: 1px solid var(--cm-teal);
    color: var(--cm-teal);
    border-radius: var(--cm-radius-sm);
    font-weight: 600;
}

/* ---- Tables ---- */
body.cm-dashboard-body .table-responsive {
    border-radius: var(--cm-radius-sm);
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
}

body.cm-dashboard-body .table-responsive > .table {
    width: max-content;
    min-width: 100%;
    margin-bottom: 0;
}

body.cm-dashboard-body .table-responsive .table th,
body.cm-dashboard-body .table-responsive .table td {
    white-space: nowrap;
}

body.cm-dashboard-body .table {
    margin-bottom: 0;
}

body.cm-dashboard-body .table thead th {
    background: #f8fafc;
    border-bottom: 1px solid var(--cm-border);
    color: var(--cm-text-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 12px 14px;
    white-space: nowrap;
}

body.cm-dashboard-body .table tbody td {
    padding: 12px 14px;
    vertical-align: middle;
    border-top: 1px solid #f1f5f9;
    color: var(--cm-text);
    font-size: 13px;
}

body.cm-dashboard-body .table-striped > tbody > tr:nth-of-type(odd) {
    background: #fafbfc;
}

body.cm-dashboard-body .table-striped > tbody > tr:hover {
    background: #f0fdfa;
}

/* ---- Stats ---- */
.cm-stat-card {
    background: var(--cm-white);
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius);
    padding: 16px 18px;
    box-shadow: var(--cm-shadow);
    height: 100%;
}

.cm-stat-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-bottom: 12px;
}

.cm-stat-card-icon.teal { background: var(--cm-teal-light); color: var(--cm-teal); }
.cm-stat-card-icon.red { background: var(--cm-red-light); color: var(--cm-red); }
.cm-stat-card-icon.blue { background: #dbeafe; color: var(--cm-info); }
.cm-stat-card-icon.orange { background: #ffedd5; color: var(--cm-warning); }
.cm-stat-card-icon.green { background: #dcfce7; color: var(--cm-success); }
.cm-stat-card-icon.purple { background: #ede9fe; color: var(--cm-purple); }

.cm-stat-card-label {
    font-size: 13px;
    color: var(--cm-text-muted);
    margin-bottom: 4px;
    font-weight: 500;
}

.cm-stat-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--cm-text);
    line-height: 1.1;
}

.cm-stat-card-trend {
    font-size: 12px;
    margin-top: 8px;
    font-weight: 500;
}

.cm-stat-card-trend.up { color: var(--cm-success); }
.cm-stat-card-trend.down { color: var(--cm-red); }

.cm-summary-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--cm-white);
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius);
    padding: 10px 16px;
    box-shadow: var(--cm-shadow);
}

.cm-summary-pill .cm-summary-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--cm-red);
}

.cm-summary-pill .cm-summary-label {
    font-size: 13px;
    color: var(--cm-text-muted);
    font-weight: 500;
}

/* ---- Dashboard specific ---- */
.cm-dashboard-greeting {
    margin-bottom: 24px;
}

.cm-dashboard-greeting h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--cm-text);
}

.cm-dashboard-greeting p {
    color: var(--cm-text-muted);
    margin: 0;
    font-size: 14px;
}

.cm-quick-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.cm-quick-stat {
    background: var(--cm-white);
    border: 1px solid var(--cm-border);
    border-radius: 999px;
    padding: 8px 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--cm-shadow);
}

.cm-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.cm-chart-card {
    background: var(--cm-white);
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius);
    padding: 20px;
    box-shadow: var(--cm-shadow);
    height: 100%;
}

.cm-chart-card h4 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--cm-text);
}

.cm-chart-card .cm-chart-meta {
    font-size: 13px;
    color: var(--cm-text-muted);
    margin-bottom: 16px;
}

.cm-chart-container {
    height: 300px;
    position: relative;
}

/* ---- Badges & status ---- */
.cm-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.cm-badge-teal { background: var(--cm-teal-light); color: var(--cm-teal); }
.cm-badge-red { background: var(--cm-red-light); color: var(--cm-red); }
.cm-badge-green { background: #dcfce7; color: var(--cm-success); }
.cm-badge-blue { background: #dbeafe; color: var(--cm-info); }
.cm-badge-orange { background: #ffedd5; color: #c2410c; }

.cm-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.cm-status-dot.green { background: var(--cm-success); }
.cm-status-dot.orange { background: var(--cm-warning); }

/* ---- CMS ---- */
.cm-cms-panel {
    padding: 0;
    overflow: hidden;
}

.cm-cms-body {
    padding: 24px;
}

.cm-cms-tabs {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
    border-bottom: 1px solid var(--cm-border);
    background: #f8f9fa;
}

.cm-cms-tabs li {
    flex: 1;
    margin: 0;
}

.cm-cms-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--cm-text);
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    text-decoration: none !important;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.cm-cms-tab i {
    font-size: 15px;
    color: var(--cm-text);
}

.cm-cms-tab:hover,
.cm-cms-tab:focus {
    color: var(--cm-text);
    background: rgba(255, 255, 255, 0.6);
}

.cm-cms-tab.active {
    color: var(--cm-red);
    border-bottom-color: var(--cm-red);
    background: #fff;
}

.cm-cms-tab.active i {
    color: var(--cm-red);
}

.cm-cms-section {
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius);
    padding: 20px;
    margin-bottom: 20px;
    background: #fff;
}

.cm-cms-section:last-of-type {
    margin-bottom: 0;
}

.cm-cms-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.cm-cms-section-title {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.cm-cms-section-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.cm-cms-section-icon--privacy {
    background: #fce8eb;
    color: var(--cm-red);
}

.cm-cms-section-icon--terms {
    background: #e8f0fe;
    color: #3b82f6;
}

.cm-cms-section-header h4 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--cm-text);
}

.cm-cms-section-header p {
    font-size: 13px;
    color: var(--cm-text-muted);
    margin: 0;
}

.cm-cms-updated {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--cm-text-muted);
    white-space: nowrap;
    padding: 6px 10px;
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius-sm);
    background: #fafbfc;
    flex-shrink: 0;
}

.cm-cms-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 20px;
    margin-top: 4px;
}

.cm-cms-content-card .note-editor,
.cm-cms-panel .note-editor {
    border-radius: var(--cm-radius-sm);
    overflow: hidden;
}

.cm-cms-content-card .note-editable,
.cm-cms-panel .note-editable {
    min-height: 180px !important;
}

/* ---- Create / Edit Forms ---- */
.cm-create-form-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cm-create-form-card {
    padding: 0;
    overflow: hidden;
}

.cm-form-section {
    padding: 24px;
    border-bottom: 1px solid var(--cm-border);
}

.cm-form-section:last-child {
    border-bottom: none;
}

.cm-form-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--cm-border);
}

.cm-form-section-header i {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fce8eb;
    color: var(--cm-red);
    font-size: 14px;
}

.cm-form-section-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--cm-text);
}

.cm-form-section-header p {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--cm-text-muted);
}

.cm-form-grid .form-group {
    margin-bottom: 16px;
}

.cm-form-grid label,
.cm-form-grid .cm-field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--cm-text);
    margin-bottom: 6px;
}

.cm-form-grid .form-control,
.cm-form-grid select.form-control {
    border: 1px solid var(--cm-border);
    border-radius: var(--cm-radius-sm);
    min-height: 42px;
    font-size: 14px;
    box-shadow: none;
}

.cm-form-grid .form-control:focus {
    border-color: var(--cm-red);
    box-shadow: 0 0 0 3px rgba(201, 25, 46, 0.08);
}

.cm-form-hint {
    font-size: 12px;
    color: var(--cm-text-muted);
    margin-top: 4px;
}

.cm-form-upload {
    border: 1px dashed var(--cm-border);
    border-radius: var(--cm-radius);
    padding: 16px;
    background: #fafbfc;
}

.cm-form-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    background: #fafbfc;
    border-top: 1px solid var(--cm-border);
}

.cm-form-footer .btn-primary {
    min-width: 160px;
}

.cm-create-form-card .dropify-wrapper {
    border-radius: var(--cm-radius-sm);
}

/* ---- Pagination ---- */
body.cm-dashboard-body #meta_data {
    font-size: 13px;
    color: var(--cm-text-muted);
    padding-top: 12px;
}

body.cm-dashboard-body #pagination .btn,
body.cm-dashboard-body #pagination .page-link,
body.cm-dashboard-body .pagination > li > a {
    border-radius: 6px !important;
    margin: 0 2px;
}

body.cm-dashboard-body #pagination .active .page-link,
body.cm-dashboard-body .pagination > .active > a {
    background: var(--cm-sidebar) !important;
    border-color: var(--cm-sidebar) !important;
}

/* ---- Toolbar row ---- */
.cm-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.cm-toolbar h3,
body.cm-dashboard-body #totalRider,
body.cm-dashboard-body #data_count {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: var(--cm-text) !important;
    margin: 0 !important;
}

/* ---- Switch / toggle ---- */
body.cm-dashboard-body input:checked + .slider {
    background-color: var(--cm-success) !important;
}

/* ---- Modals ---- */
body.cm-dashboard-body .modal-content {
    border-radius: var(--cm-radius);
    border: 1px solid var(--cm-border);
}

/* ---- Search clear ---- */
body.cm-dashboard-body .clear-search {
    color: var(--cm-text-muted);
}

body.cm-dashboard-body .clear-search:hover {
    color: var(--cm-red);
}

body.cm-dashboard-body .ibox-title .nav-tabs,
body.cm-dashboard-body #deliveryTabs {
    display: flex;
    margin-top: 0;
}

body.cm-dashboard-body .ibox-title {
    margin-bottom: 16px;
}

body.cm-dashboard-body .gray-bg {
    background: var(--cm-bg) !important;
}

body.cm-dashboard-body .wrapper-content {
    padding: 0;
}

body.cm-dashboard-body .cm-topbar-nav {
    background: transparent !important;
}

body.cm-dashboard-body .navbar-top-links > li > a.cm-notify-btn:hover,
body.cm-dashboard-body .navbar-top-links > li > a.cm-notify-btn:focus,
body.cm-dashboard-body li.dropdown.profile-li a:hover,
body.cm-dashboard-body li.dropdown.profile-li a:focus {
    background: transparent;
    color: #2f4050;
    opacity: 0.85;
}

body.cm-dashboard-body .view-delivery-details {
    color: var(--cm-teal) !important;
    font-size: 16px !important;
    border: 1px solid var(--cm-border);
    border-radius: 6px;
    padding: 4px 8px;
    background: #fff;
}

body.cm-dashboard-body .btn.bg-info:not(.cm-toggle-tabs .btn) {
    background: var(--cm-teal) !important;
    border-color: var(--cm-teal) !important;
    color: #fff !important;
}

body.cm-dashboard-body .btn.bg-success {
    background: var(--cm-success) !important;
    border-color: var(--cm-success) !important;
}

body.cm-dashboard-body .btn.bg-danger {
    background: var(--cm-red) !important;
    border-color: var(--cm-red) !important;
}

body.cm-dashboard-body .btn.btn-warning {
    background: var(--cm-warning) !important;
    border-color: var(--cm-warning) !important;
    color: #fff !important;
}

body.cm-dashboard-body .panel-body {
    padding: 0;
}

body.cm-dashboard-body .cm-page .row > .col-lg-12 > .ibox > .row,
body.cm-dashboard-body .cm-page .row > .col-lg-12 > .ibox > .ibox-content:first-of-type {
    margin-top: 0;
}

@media (max-width: 1200px) {
    .cm-metrics-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .cm-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    body.cm-dashboard-body .cm-global-search {
        display: none;
    }

    /* ---- Mobile / tablet shell: off-canvas drawer ---- */
    body.cm-dashboard-body .cm-menu-toggle {
        display: inline-flex !important;
    }

    body.cm-dashboard-body .cm-sidebar-toggle {
        display: none !important;
    }

    body.cm-dashboard-body .cm-sidebar-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border: 0;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
        font-size: 18px;
        cursor: pointer;
        flex-shrink: 0;
    }

    body.cm-dashboard-body .navbar-static-side {
        width: 280px !important;
        max-width: 86vw;
        transform: translateX(-105%);
        transition: transform 0.28s ease;
        z-index: 1200;
        box-shadow: none;
    }

    body.cm-dashboard-body.cm-nav-open .navbar-static-side {
        transform: translateX(0);
        box-shadow: 8px 0 32px rgba(15, 23, 42, 0.28);
    }

    body.cm-dashboard-body #page-wrapper,
    body.cm-dashboard-body .footer {
        margin-left: 0 !important;
        left: 0 !important;
        width: 100% !important;
    }

    body.cm-dashboard-body .cm-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        z-index: 1150;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.28s ease;
    }

    body.cm-dashboard-body.cm-nav-open .cm-sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    /* Defeat Inspinia body-small hide/show and mini-navbar 70px rail on phones */
    body.cm-dashboard-body.body-small .navbar-static-side,
    body.cm-dashboard-body.body-small.mini-navbar .navbar-static-side,
    body.cm-dashboard-body.mini-navbar .navbar-static-side {
        display: block !important;
        position: fixed !important;
        width: 280px !important;
        max-width: 86vw !important;
        margin: 0 !important;
        left: 0 !important;
        top: 0 !important;
        height: 100% !important;
        transform: translateX(-105%);
        transition: transform 0.28s ease;
        z-index: 1200 !important;
    }

    body.cm-dashboard-body.body-small.cm-nav-open .navbar-static-side,
    body.cm-dashboard-body.cm-nav-open .navbar-static-side,
    body.cm-dashboard-body.body-small.mini-navbar.cm-nav-open .navbar-static-side {
        transform: translateX(0) !important;
    }

    body.cm-dashboard-body.body-small #page-wrapper,
    body.cm-dashboard-body.mini-navbar #page-wrapper,
    body.cm-dashboard-body.body-small.mini-navbar #page-wrapper {
        margin: 0 !important;
        margin-left: 0 !important;
        width: 100% !important;
    }

    body.cm-dashboard-body.mini-navbar .cm-sidebar-help {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    body.cm-dashboard-body.mini-navbar #side-menu {
        padding: 12px 10px 80px !important;
    }

    body.cm-dashboard-body.mini-navbar #side-menu > li > a {
        font-size: 14px !important;
        padding: 11px 14px !important;
        justify-content: flex-start !important;
        text-align: left !important;
    }

    body.cm-dashboard-body .cm-sidebar-brand {
        gap: 8px;
    }

    /* Dashboard greeting + quick stats stack */
    body.cm-dashboard-body .cm-page > .row {
        margin-left: -6px;
        margin-right: -6px;
    }

    body.cm-dashboard-body .cm-dashboard-greeting,
    body.cm-dashboard-body .cm-page > .row > .col-md-5,
    body.cm-dashboard-body .cm-page > .row > .col-md-7 {
        flex: 0 0 100%;
        max-width: 100%;
        width: 100%;
        margin-bottom: 10px;
    }

    body.cm-dashboard-body .cm-quick-stats {
        justify-content: stretch;
    }

    body.cm-dashboard-body .cm-chart-card,
    body.cm-dashboard-body .cm-chart-container {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    body.cm-dashboard-body .cm-chart-container canvas {
        max-width: 100% !important;
        height: auto !important;
    }

    body.cm-dashboard-body .cm-topbar-nav {
        padding: 0 12px;
        gap: 8px;
    }

    body.cm-dashboard-body .cm-user-info,
    body.cm-dashboard-body .cm-user-chevron,
    body.cm-dashboard-body .cm-topbar-divider-item {
        display: none !important;
    }

    body.cm-dashboard-body .cm-user-menu > a.dropdown-toggle {
        padding: 4px !important;
        border: 0 !important;
    }

    body.cm-dashboard-body li.dropdown.profile-li a {
        border: 0 !important;
        font-size: inherit !important;
        padding: 4px !important;
        font-weight: inherit !important;
        border-radius: 999px !important;
    }

    body.cm-dashboard-body .cm-notify-btn {
        padding: 8px 10px;
        font-size: 20px;
    }

    .cm-page {
        padding: 14px 12px 24px;
    }

    .cm-page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 14px;
    }

    .cm-page-title {
        font-size: 22px;
        line-height: 1.25;
    }

    .cm-page-header-action {
        width: 100%;
    }

    .cm-page-header-action .btn,
    .cm-page-header-action a.btn {
        width: 100%;
        justify-content: center;
    }

    .cm-dashboard-greeting {
        margin-bottom: 12px;
    }

    .cm-dashboard-greeting h2 {
        font-size: 22px;
    }

    .cm-quick-stats {
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }

    .cm-quick-stat {
        flex: 1 1 calc(50% - 8px);
        min-width: 0;
    }

    .cm-filter-row,
    .cm-filter-row--inputs,
    .cm-filter-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        flex-wrap: nowrap !important;
        gap: 10px !important;
    }

    .cm-filter-row .cm-filter-field,
    .cm-filter-row .cm-filter-field--search,
    .cm-filter-row .cm-filter-field--date,
    .cm-filter-row .cm-filter-clear {
        flex: 1 1 auto !important;
        max-width: none !important;
        width: 100% !important;
    }

    .cm-filter-actions-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .cm-filter-actions-right,
    .cm-filter-actions {
        margin-left: 0 !important;
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .cm-filter-actions-right .btn,
    .cm-filter-actions .btn {
        flex: 1 1 auto;
        min-width: 0;
    }

    .cm-mgmt-actions-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .cm-mgmt-actions {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .cm-mgmt-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .cm-toggle-tabs {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }

    .cm-toggle-tabs .btn {
        flex: 1 1 auto;
        min-width: 0;
        white-space: normal;
        line-height: 1.25;
        padding: 10px 12px;
    }

    .cm-mgmt-card {
        padding: 14px;
    }

    .cm-transaction-stats,
    .cm-metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px;
    }

    .cm-stat-card,
    .cm-transaction-stat-card {
        padding: 12px;
    }

    .cm-stat-card-value,
    .cm-transaction-stat-card .cm-transaction-stat-value {
        font-size: 20px;
        word-break: break-word;
    }

    /* Bootstrap filter/action grids used on older pages */
    body.cm-dashboard-body .cm-page .row > [class*="col-"],
    body.cm-dashboard-body .ibox-content > .row > [class*="col-"],
    body.cm-dashboard-body .filter-container > .row > [class*="col-"],
    body.cm-dashboard-body .ibox-content .row > [class*="col-1"],
    body.cm-dashboard-body .ibox-content .row > [class*="col-2"],
    body.cm-dashboard-body .ibox-content .row > [class*="col-3"],
    body.cm-dashboard-body .ibox-content .row > [class*="col-4"],
    body.cm-dashboard-body .ibox-content .row > [class*="col-5"],
    body.cm-dashboard-body .ibox-content .row > [class*="col-6"] {
        flex: 0 0 100%;
        max-width: 100%;
        width: 100%;
        margin-bottom: 10px;
    }

    body.cm-dashboard-body .ibox-content .row > [class*="col-"].float-right,
    body.cm-dashboard-body .ibox-content .float-right {
        float: none !important;
        width: 100%;
    }

    body.cm-dashboard-body .ibox-content .btn,
    body.cm-dashboard-body .cm-page .btn-primary,
    body.cm-dashboard-body .cm-page a > .btn-primary {
        white-space: normal;
    }

    /* Tables: smooth horizontal swipe, never clip the page */
    body.cm-dashboard-body .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0;
        border: 1px solid var(--cm-border);
        border-radius: 10px;
        background: #fff;
    }

    body.cm-dashboard-body .table-responsive table {
        margin-bottom: 0;
        min-width: 640px;
    }

    body.cm-dashboard-body .table-responsive table th,
    body.cm-dashboard-body .table-responsive table td {
        white-space: nowrap;
        font-size: 12px;
        padding: 10px 12px;
    }

    .cm-table-footer,
    body.cm-dashboard-body .pull-left#meta_data,
    body.cm-dashboard-body #meta_data,
    body.cm-dashboard-body #pagination,
    body.cm-dashboard-body .btn-group.pull-right {
        float: none !important;
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        margin: 12px 0 0;
    }

    body.cm-dashboard-body #pagination .btn,
    body.cm-dashboard-body .cm-table-pagination .btn {
        min-width: 36px;
    }

    .footer {
        flex-direction: column;
        text-align: center;
        justify-content: center;
        padding: 12px 14px;
        font-size: 12px;
        line-height: 1.4;
    }

    .footer .float-right,
    .footer .cm-footer-meta {
        float: none !important;
        margin: 0;
    }

    body.cm-dashboard-body #wrapper {
        overflow-x: hidden;
    }

    /* Hide duplicate Inspinia ibox titles when page-header is present */
    body.cm-dashboard-body .cm-page .ibox-title {
        display: none;
    }

    body.cm-dashboard-body .cm-page .ibox {
        margin-bottom: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    body.cm-dashboard-body .cm-page .ibox-content {
        border: 1px solid var(--cm-border);
        border-radius: 12px;
        background: #fff;
        padding: 14px;
    }

    /* Dashboard chart cards stack */
    body.cm-dashboard-body .cm-page .row > .col-lg-6,
    body.cm-dashboard-body .cm-page .row > .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* CMS / rich editors */
    body.cm-dashboard-body .nav-tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0;
    }

    body.cm-dashboard-body .nav-tabs > li {
        float: none;
        flex: 0 0 auto;
    }

    body.cm-dashboard-body .note-toolbar,
    body.cm-dashboard-body .tox-toolbar__primary,
    body.cm-dashboard-body .cke_top {
        flex-wrap: wrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .cm-cms-tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0;
        width: 100%;
    }

    .cm-cms-tabs li {
        flex: 0 0 auto;
    }

    .cm-cms-tab {
        white-space: nowrap;
        padding: 12px 16px;
    }

    .cm-cms-panel .cm-cms-card-head,
    .cm-cms-body .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 8px;
    }

    /* Modals fit phone */
    body.cm-dashboard-body .modal-dialog {
        margin: 12px;
        max-width: calc(100% - 24px);
    }

    /* Action menus / status pills don't blow out rows */
    .cm-action-dropdown {
        min-width: 200px;
        max-width: min(260px, 80vw);
    }

    .cm-order-status-badge {
        min-width: 0;
        max-width: 160px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Delivery realtime pill */
    .cm-realtime-status {
        margin-left: 0;
        margin-top: 4px;
        display: inline-flex;
    }

    /* Form detail pages */
    body.cm-dashboard-body .form-group-wrap {
        flex-direction: column;
    }

    body.cm-dashboard-body .form-group-wrap .form-group {
        max-width: none;
        margin-right: 0;
    }

    body.cm-dashboard-body ._details h4 {
        flex-direction: column;
        gap: 4px;
    }

    body.cm-dashboard-body ._details h4 strong,
    body.cm-dashboard-body ._details h4 p {
        width: 100%;
        padding: 0;
    }
}

@media (max-width: 768px) {
    .cm-metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cm-transaction-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cm-page {
        padding: 12px 10px 20px;
    }

    .cm-page-title {
        font-size: 20px;
    }

    body.cm-dashboard-body .cm-topbar-nav {
        min-height: 56px;
        padding: 0 10px;
    }
}

@media (max-width: 480px) {
    .cm-metrics-grid,
    .cm-transaction-stats {
        grid-template-columns: 1fr !important;
    }

    .cm-quick-stat {
        flex: 1 1 100%;
    }

    body.cm-dashboard-body .table-responsive table {
        min-width: 560px;
    }

    .cm-toggle-tabs .btn {
        flex: 1 1 100%;
    }
}
