/* ==========================================================================
   MEEZOTECH FLEET MANAGEMENT SYSTEM — UI Design System
   --------------------------------------------------------------------------
   Brand layer loaded AFTER assets/css/all.min.css (Limitless / Bootstrap 4).
   Pure presentation: overrides colors, typography, spacing and component
   chrome. No structural or behavioral assumptions beyond the theme's own
   class names.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
    /* Brand */
    --mz-red: #d7282c;
    --mz-red-600: #bf2125;
    --mz-red-700: #a31d20;
    --mz-red-050: #fdeeee;
    --mz-red-100: #f9d8d9;

    /* Graphite (primary actions) */
    --mz-ink: #2a3342;
    --mz-ink-600: #222a37;
    --mz-ink-700: #1a212c;

    /* Sidebar */
    --mz-sidebar-bg: #1c222d;
    --mz-sidebar-bg-deep: #171c26;
    --mz-sidebar-text: #aab3c2;
    --mz-sidebar-text-strong: #eef1f6;
    --mz-sidebar-hover: rgba(255, 255, 255, 0.055);
    --mz-sidebar-active: rgba(215, 40, 44, 0.16);

    /* Neutrals */
    --mz-body-bg: #f4f6f9;
    --mz-surface: #ffffff;
    --mz-border: #e6eaf1;
    --mz-border-strong: #d7dde8;
    --mz-text: #2b3442;
    --mz-text-soft: #57637a;
    --mz-text-muted: #7c8698;

    /* Semantic */
    --mz-green: #16a34a;
    --mz-green-050: #e9f7ef;
    --mz-amber: #d97706;
    --mz-amber-050: #fdf3e4;
    --mz-blue: #2563eb;
    --mz-blue-050: #eaf1fd;

    /* Geometry */
    --mz-navbar-h: 64px;
    --mz-sidebar-w: 16.25rem;
    --mz-radius-sm: 0.4375rem;
    --mz-radius: 0.625rem;
    --mz-radius-lg: 0.875rem;

    /* Elevation */
    --mz-shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
    --mz-shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.07), 0 1px 2px rgba(16, 24, 40, 0.04);
    --mz-shadow-md: 0 6px 16px -4px rgba(16, 24, 40, 0.1), 0 2px 6px -2px rgba(16, 24, 40, 0.06);
    --mz-shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, 0.18);

    --mz-font: "Inter", "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI",
        "Helvetica Neue", Arial, sans-serif;

    /* Re-point Bootstrap variables at the brand */
    --primary: var(--mz-ink);
    --primary-100: #eceff4;
    --danger: #dc3545;
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
body {
    font-family: var(--mz-font);
    background-color: var(--mz-body-bg);
    color: var(--mz-text);
    font-size: 0.875rem;
    letter-spacing: 0.005em;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

.h1, .h2, .h3, .h4, .h5, .h6,
h1, h2, h3, h4, h5, h6 {
    font-family: var(--mz-font);
    color: var(--mz-text);
    font-weight: 600;
    letter-spacing: -0.01em;
}

a {
    color: var(--mz-red);
}

a:hover {
    color: var(--mz-red-600);
}

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

.font-weight-semibold {
    font-weight: 600 !important;
}

/* Thin, quiet scrollbars everywhere */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 112, 132, 0.35) transparent;
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background-color: rgba(100, 112, 132, 0.3);
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
    background-color: rgba(100, 112, 132, 0.5);
}

::selection {
    background: var(--mz-red-100);
    color: var(--mz-red-700);
}

/* --------------------------------------------------------------------------
   3. App shell geometry
   Replaces the ad-hoc 94/100px offsets baked into all.min.css.
   -------------------------------------------------------------------------- */
.navbar.mz-navbar {
    min-height: var(--mz-navbar-h);
    height: var(--mz-navbar-h);
    padding: 0 1.25rem 0 1rem;
    flex-wrap: nowrap;
}

/* The theme bundle pins the navbar with position:fixed !important and pushes
   content down 6.5rem. Return the navbar to the document flow so the shell
   needs no magic offsets. */
.navbar.sticky-top.navbar-static {
    position: sticky !important;
}

.sidebar.sidebar-dark.sidebar-main.sidebar-expand-lg {
    height: calc(100vh - var(--mz-navbar-h));
    padding-top: 0;
    padding-right: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.content-wrapper.flex-grow-1 {
    /* Block flow, not flex: the theme's column-flex squeezes children to the
       viewport and its .page-content{overflow:hidden} then clips everything
       below the fold. The wrapper is the single vertical scroll container. */
    display: block;
    margin-top: 0 !important;
    height: calc(100vh - var(--mz-navbar-h));
    max-height: calc(100vh - var(--mz-navbar-h));
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem 1.75rem 2.25rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Scrolling belongs to the wrapper — page sections must never clip or trap it */
.content-wrapper .page-content {
    overflow: visible;
    min-height: 0;
}

@media (max-width: 767.98px) {
    .content-wrapper.flex-grow-1 {
        padding: 1rem 1rem 1.75rem;
    }
}

/* The wrapper already provides page padding */
.content-wrapper .content {
    padding: 0;
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   4. Top navbar — same dark surface as the sidebar, one continuous app frame
   -------------------------------------------------------------------------- */
.mz-navbar {
    background: var(--mz-sidebar-bg) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 1px 10px rgba(10, 14, 22, 0.35);
}

.mz-navbar .navbar-brand {
    padding: 0;
    margin: 0 1rem 0 0;
    display: inline-flex;
    align-items: center;
}

.mz-logo {
    height: 32px;
    width: auto;
    display: block;
}

@media (max-width: 575.98px) {
    .mz-logo {
        height: 26px;
    }
}

/* Round icon buttons (sidebar toggle, notifications) */
.mz-navbar-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--mz-radius-sm);
    background: transparent;
    color: var(--mz-sidebar-text);
    font-size: 1.0625rem;
    position: relative;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.mz-navbar-btn:hover,
.mz-navbar-btn:focus {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    outline: 0;
}

.mz-navbar-btn .mz-dot {
    position: absolute;
    top: 9px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mz-red);
    border: 2px solid var(--mz-sidebar-bg);
}

.mz-navbar .navbar-nav {
    align-items: center;
}

/* Vertical separator between navbar groups */
.mz-navbar-divider {
    width: 1px;
    height: 26px;
    background: rgba(255, 255, 255, 0.12);
    margin: 0 0.875rem;
    align-self: center;
}

/* Initials avatar */
.mz-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e6404415 0%, #d7282c22 100%);
    color: var(--mz-red);
    border: 1px solid var(--mz-red-100);
    font-weight: 600;
    font-size: 0.8125rem;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    user-select: none;
}

.mz-avatar.mz-avatar-dark {
    background: linear-gradient(135deg, rgba(215, 40, 44, 0.28), rgba(215, 40, 44, 0.14));
    color: #ffb4b6;
    border-color: rgba(215, 40, 44, 0.35);
}

.mz-avatar.mz-avatar-lg {
    width: 42px;
    height: 42px;
    font-size: 0.9375rem;
}

/* Navbar user chip */
.mz-user-chip {
    display: inline-flex !important;
    align-items: center;
    gap: 0.625rem;
    padding: 0.3125rem 0.5rem 0.3125rem 0.3125rem !important;
    border-radius: 2rem;
    color: var(--mz-sidebar-text-strong) !important;
    transition: background-color 0.15s ease;
    line-height: 1.2;
}

.mz-user-chip:hover,
.mz-user-chip:focus,
.show > .mz-user-chip {
    background: rgba(255, 255, 255, 0.08);
}

.mz-user-chip .mz-user-name {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--mz-sidebar-text-strong);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mz-user-chip .mz-user-role {
    font-size: 0.6875rem;
    color: var(--mz-sidebar-text);
    font-weight: 500;
}

.mz-user-chip .mz-caret {
    font-size: 0.875rem;
    color: var(--mz-sidebar-text);
    margin-left: 0.125rem;
}

/* --------------------------------------------------------------------------
   5. Sidebar
   -------------------------------------------------------------------------- */
.sidebar {
    width: var(--mz-sidebar-w);
}

.sidebar-dark {
    background: var(--mz-sidebar-bg);
    color: var(--mz-sidebar-text);
}

/* Keep collapse/unfold behavior consistent with the new width */
.sidebar-main-resized.sidebar-main-unfold {
    width: var(--mz-sidebar-w);
}

/* Collapsed (mini) sidebar stays in the flex row exactly like the expanded
   one — same top/height below the navbar, only the width animates. The
   theme's absolute positioning (top:0, under the navbar, sibling margin
   hack) existed solely for the hover-unfold overlay, which is disabled. */
@media (min-width: 992px) {
    .sidebar.sidebar-expand-lg {
        transition: width 0.25s ease;
    }

    .sidebar.sidebar-expand-lg.sidebar-main-resized {
        position: static;
        top: auto;
        transition: width 0.25s ease;
    }

    .sidebar-main-resized + * {
        margin-left: 0 !important;
    }
}

/* User card */
.mz-sidebar-user {
    margin: 0.875rem 0.75rem 0.5rem;
    padding: 0.75rem 0.875rem;
    background: var(--mz-sidebar-bg-deep);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--mz-radius);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mz-sidebar-user .mz-su-name {
    font-weight: 600;
    font-size: 0.84375rem;
    color: var(--mz-sidebar-text-strong);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mz-sidebar-user .mz-su-role {
    font-size: 0.6875rem;
    color: var(--mz-sidebar-text);
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 0.3125rem;
}

.mz-sidebar-user .mz-su-role::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #37c978;
    box-shadow: 0 0 0 3px rgba(55, 201, 120, 0.18);
    flex-shrink: 0;
}

.mz-sidebar-user .media-body {
    min-width: 0;
}

/* Sidebar control buttons (collapse / close) */
.mz-sidebar-user .btn.sidebar-control {
    color: var(--mz-sidebar-text) !important;
    background: transparent !important;
    border: 0 !important;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--mz-radius-sm);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.mz-sidebar-user .btn.sidebar-control:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
}

/* Section label */
.mz-nav-label {
    padding: 1.125rem 1.375rem 0.4375rem;
    font-size: 0.65625rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: rgba(170, 179, 194, 0.55);
    user-select: none;
}

.sidebar-main-resized:not(.sidebar-main-unfold) .mz-nav-label {
    visibility: hidden;
    padding-left: 0;
    padding-right: 0;
}

/* Nav links */
.sidebar .nav-sidebar {
    padding: 0 0.75rem 1.25rem;
}

.sidebar .nav-sidebar > .nav-item {
    margin-bottom: 2px;
}

.sidebar .nav-sidebar > .nav-item > .nav-link {
    display: flex;
    align-items: center;
    padding: 0.59375rem 0.75rem;
    border-radius: var(--mz-radius-sm);
    color: var(--mz-sidebar-text);
    font-size: 0.84375rem;
    font-weight: 500;
    line-height: 1.4;
    transition: background-color 0.15s ease, color 0.15s ease;
    position: relative;
}

.sidebar .nav-sidebar > .nav-item > .nav-link i {
    font-size: 1.0625rem;
    margin-right: 0.75rem;
    margin-top: 0;
    margin-bottom: 0;
    color: #7e8aa0;
    transition: color 0.15s ease;
    top: 0;
    flex-shrink: 0;
}

.sidebar .nav-sidebar > .nav-item > .nav-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar .nav-sidebar > .nav-item > .nav-link:hover {
    background: var(--mz-sidebar-hover);
    color: var(--mz-sidebar-text-strong);
}

.sidebar .nav-sidebar > .nav-item > .nav-link:hover i {
    color: var(--mz-sidebar-text-strong);
}

/* Active state: red rail + tint */
.sidebar .nav-sidebar > .nav-item > .nav-link.active,
.sidebar .nav-sidebar > .nav-item.nav-item-open > .nav-link {
    background: var(--mz-sidebar-active);
    color: #fff;
}

.sidebar .nav-sidebar > .nav-item > .nav-link.active::before {
    content: "";
    position: absolute;
    left: -0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    border-radius: 0 3px 3px 0;
    background: var(--mz-red);
}

.sidebar .nav-sidebar > .nav-item > .nav-link.active i,
.sidebar .nav-sidebar > .nav-item.nav-item-open > .nav-link i {
    color: #f0575b;
}

/* Submenu arrow */
.nav-item-submenu > .nav-link:after {
    top: 50%;
    margin-top: 0;
    right: 0.875rem;
    transform: translateY(-50%);
    font-size: 0.875rem;
    opacity: 0.5;
}

.nav-item-submenu.nav-item-open > .nav-link:after {
    transform: translateY(-50%) rotate(90deg);
    opacity: 0.85;
}

/* Submenu panel */
.sidebar .nav-group-sub {
    background: transparent;
    padding: 0.125rem 0 0.375rem;
    position: relative;
}

.sidebar .nav-group-sub .nav-item {
    position: relative;
}

.sidebar .nav-group-sub .nav-link {
    display: block;
    padding: 0.4375rem 0.75rem 0.4375rem 2.5rem;
    margin: 1px 0;
    border-radius: var(--mz-radius-sm);
    color: #8d97a9;
    font-size: 0.8125rem;
    font-weight: 400;
    position: relative;
    transition: background-color 0.15s ease, color 0.15s ease;
}

/* Guide line + node dot */
.sidebar .nav-group-sub .nav-link::before {
    content: "";
    position: absolute;
    left: 1.375rem;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255, 255, 255, 0.09);
}

.sidebar .nav-group-sub .nav-item:last-child .nav-link::before {
    bottom: 50%;
}

.sidebar .nav-group-sub .nav-item:first-child .nav-link::before {
    top: -0.125rem;
}

.sidebar .nav-group-sub .nav-link::after {
    content: "";
    position: absolute;
    left: calc(1.375rem - 2.5px);
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.sidebar .nav-group-sub .nav-link:hover {
    color: var(--mz-sidebar-text-strong);
    background: var(--mz-sidebar-hover);
}

.sidebar .nav-group-sub .nav-link.active {
    color: #fff;
    background: transparent;
    font-weight: 500;
}

.sidebar .nav-group-sub .nav-link.active::after {
    background: var(--mz-red);
    box-shadow: 0 0 0 3px rgba(215, 40, 44, 0.25);
}

/* Mini (icon-only) mode */
.sidebar-main-resized:not(.sidebar-main-unfold) .mz-sidebar-user {
    padding: 0.5rem 0;
    margin: 0.875rem 0.375rem 0.5rem;
    justify-content: center;
}

/* The card reduces to the toggle control, so the sidebar can always be
   reopened. Identity is still shown by the navbar user chip. */
.sidebar-main-resized:not(.sidebar-main-unfold) .mz-sidebar-user .media-body,
.sidebar-main-resized:not(.sidebar-main-unfold) .mz-sidebar-user > .mz-avatar {
    display: none;
}

.sidebar-main-resized:not(.sidebar-main-unfold) .mz-sidebar-user .mz-sidebar-controls {
    margin: 0;
}

.sidebar-main-resized:not(.sidebar-main-unfold) .mz-sidebar-user .btn.sidebar-control {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.07) !important;
    font-size: 1rem;
}

.sidebar-main-resized:not(.sidebar-main-unfold) .mz-sidebar-user .btn.sidebar-control:hover {
    background: rgba(255, 255, 255, 0.14) !important;
}

.sidebar-main-resized:not(.sidebar-main-unfold) .nav-sidebar {
    padding-left: 0.375rem;
    padding-right: 0.375rem;
}

.sidebar-main-resized:not(.sidebar-main-unfold) .nav-sidebar > .nav-item > .nav-link {
    justify-content: center;
}

.sidebar-main-resized:not(.sidebar-main-unfold) .nav-sidebar > .nav-item > .nav-link i {
    margin-right: 0;
}

/* --------------------------------------------------------------------------
   6. Page header & breadcrumbs
   -------------------------------------------------------------------------- */
.page-header {
    margin-bottom: 0;
}

.page-header-light {
    background: transparent;
    border-bottom: 0;
    box-shadow: none;
    margin-bottom: 0.25rem;
}

.page-header-content {
    padding: 0 0 1rem;
}

.page-title {
    padding: 0.25rem 0;
}

.page-title h4,
.page-title h5 {
    margin-bottom: 0;
    font-weight: 700;
    letter-spacing: -0.015em;
}

.page-title h4 {
    font-size: 1.1875rem;
}

.page-title h4 .font-weight-semibold,
.page-title h5 .font-weight-semibold {
    font-weight: inherit !important;
}

/* Long titles wrap; the actions group keeps its natural size and never
   crushes its buttons (which would wrap their labels into tall pills). */
.header-elements-lg-inline .page-title {
    min-width: 0;
}

.header-elements-lg-inline .page-title h5 {
    line-height: 1.35;
}

@media (min-width: 992px) {
    .header-elements-lg-inline .header-elements {
        flex-shrink: 0;
        flex-wrap: nowrap;
    }
}

.breadcrumb {
    background: transparent;
    padding: 0;
    font-size: 0.78125rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--mz-text-muted);
}

.breadcrumb .breadcrumb-item a {
    color: var(--mz-text-muted);
}

.breadcrumb .breadcrumb-item a:hover {
    color: var(--mz-red);
}

.breadcrumb .breadcrumb-item.active {
    color: var(--mz-text-soft);
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   7. Cards
   -------------------------------------------------------------------------- */
.card {
    border: 1px solid var(--mz-border);
    border-radius: var(--mz-radius-lg);
    box-shadow: var(--mz-shadow-sm);
    margin-bottom: 1.375rem;
}

.card > .card-header {
    background: var(--mz-surface);
    border-bottom: 1px solid var(--mz-border);
    padding: 0.9375rem 1.25rem;
    border-top-left-radius: var(--mz-radius-lg);
    border-top-right-radius: var(--mz-radius-lg);
}

.card-header .card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0;
}

.card > .card-body {
    padding: 1.25rem;
}

.card .card-header.header-elements-inline {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

/* Icon chip used in card headers */
.mz-card-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5625rem;
    font-size: 0.9375rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.mz-card-icon.is-red    { background: var(--mz-red-050);   color: var(--mz-red); }
.mz-card-icon.is-ink    { background: #eceff4;             color: var(--mz-ink); }
.mz-card-icon.is-green  { background: var(--mz-green-050); color: var(--mz-green); }
.mz-card-icon.is-amber  { background: var(--mz-amber-050); color: var(--mz-amber); }
.mz-card-icon.is-blue   { background: var(--mz-blue-050);  color: var(--mz-blue); }

/* --------------------------------------------------------------------------
   8. Stat cards (dashboard)
   -------------------------------------------------------------------------- */
.mz-stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.375rem;
    background: var(--mz-surface);
    border: 1px solid var(--mz-border);
    border-radius: var(--mz-radius-lg);
    box-shadow: var(--mz-shadow-sm);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    height: 100%;
}

.mz-stat-card:hover {
    box-shadow: var(--mz-shadow-md);
    transform: translateY(-1px);
}

.mz-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.mz-stat-icon.is-red   { background: var(--mz-red-050);   color: var(--mz-red); }
.mz-stat-icon.is-ink   { background: #eceff4;             color: var(--mz-ink); }
.mz-stat-icon.is-green { background: var(--mz-green-050); color: var(--mz-green); }
.mz-stat-icon.is-amber { background: var(--mz-amber-050); color: var(--mz-amber); }

.mz-stat-label {
    font-size: 0.71875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mz-text-muted);
    margin-bottom: 0.1875rem;
    white-space: nowrap;
}

.mz-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--mz-text);
    letter-spacing: -0.02em;
}

.mz-stat-hint {
    font-size: 0.75rem;
    color: var(--mz-text-muted);
    margin-top: 0.1875rem;
}

/* Compact KPI variant for dense stat grids */
.mz-stat-card.mz-stat-sm {
    padding: 1rem 1.125rem;
    gap: 0.875rem;
}

.mz-stat-card.mz-stat-sm .mz-stat-icon {
    width: 42px;
    height: 42px;
    font-size: 1.125rem;
    border-radius: 0.625rem;
}

.mz-stat-card.mz-stat-sm .mz-stat-value {
    font-size: 1.3125rem;
}

.mz-stat-card .mz-stat-body {
    min-width: 0;
    flex: 1 1 auto;
}

/* Thin progress meter inside stat cards */
.mz-stat-progress {
    height: 5px;
    border-radius: 3px;
    background: #edf0f5;
    overflow: hidden;
    margin-top: 0.5rem;
}

.mz-stat-progress > span {
    display: block;
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.mz-stat-progress.is-red > span   { background: var(--mz-red); }
.mz-stat-progress.is-ink > span   { background: var(--mz-ink); }
.mz-stat-progress.is-green > span { background: var(--mz-green); }
.mz-stat-progress.is-amber > span { background: var(--mz-amber); }
.mz-stat-progress.is-blue > span  { background: var(--mz-blue); }

/* Chart cards */
.mz-chart-body {
    position: relative;
    flex: 1 1 auto;
    min-height: 260px;
    max-height: 320px;
    padding: 1rem 1.25rem 1.25rem;
}

.mz-chart-body canvas {
    max-width: 100%;
}

.mz-chart-total {
    margin-left: auto;
    text-align: right;
}

.mz-chart-total .mz-ct-value {
    font-weight: 700;
    font-size: 1.0625rem;
    color: var(--mz-text);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.mz-chart-total .mz-ct-label {
    font-size: 0.6875rem;
    color: var(--mz-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* Scrollable operational panels */
.mz-panel {
    min-height: 480px;
    height: 100%;
    margin-bottom: 0;
}

.mz-panel .mz-panel-scroll {
    max-height: 320px;
    overflow-y: auto;
}

/* --------------------------------------------------------------------------
   9. Buttons
   -------------------------------------------------------------------------- */
.btn {
    font-family: var(--mz-font);
    font-weight: 500;
    border-radius: var(--mz-radius-sm);
    letter-spacing: 0.005em;
    white-space: nowrap;
    transition: color 0.15s ease, background-color 0.15s ease,
        border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn:focus {
    box-shadow: 0 0 0 3px rgba(42, 51, 66, 0.15) !important;
}

.btn-primary {
    color: #fff;
    background-color: var(--mz-ink);
    border-color: var(--mz-ink);
    box-shadow: var(--mz-shadow-xs);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active,
.show > .btn-primary.dropdown-toggle {
    color: #fff;
    background-color: var(--mz-ink-600);
    border-color: var(--mz-ink-700);
}

.btn-outline-primary {
    color: var(--mz-ink);
    border-color: var(--mz-border-strong);
}

.btn-outline-primary:hover,
.btn-outline-primary:not(:disabled):not(.disabled):active,
.btn-outline-primary:not(:disabled):not(.disabled).active {
    color: #fff;
    background-color: var(--mz-ink);
    border-color: var(--mz-ink);
}

/* Brand-red button for hero/danger-free emphasis (login, CTAs) */
.btn-brand {
    color: #fff;
    background-color: var(--mz-red);
    border-color: var(--mz-red);
    box-shadow: 0 1px 2px rgba(215, 40, 44, 0.25);
}

.btn-brand:hover,
.btn-brand:focus,
.btn-brand:not(:disabled):not(.disabled):active {
    color: #fff;
    background-color: var(--mz-red-600);
    border-color: var(--mz-red-700);
    box-shadow: 0 4px 12px -2px rgba(215, 40, 44, 0.4);
}

.btn-brand:focus {
    box-shadow: 0 0 0 3px rgba(215, 40, 44, 0.22) !important;
}

.btn-light {
    background-color: var(--mz-surface);
    border-color: var(--mz-border-strong);
    color: var(--mz-text-soft);
    box-shadow: var(--mz-shadow-xs);
}

.btn-light:hover,
.btn-light:focus {
    background-color: var(--mz-body-bg);
    border-color: var(--mz-border-strong);
    color: var(--mz-text);
}

.btn-secondary {
    background-color: #5b6779;
    border-color: #5b6779;
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary:not(:disabled):not(.disabled):active {
    background-color: #4c576a;
    border-color: #46505f;
}

.btn-success {
    background-color: var(--mz-green);
    border-color: var(--mz-green);
}

.btn-success:hover,
.btn-success:focus,
.btn-success:not(:disabled):not(.disabled):active {
    background-color: #12813b;
    border-color: #107436;
}

.btn-info {
    background-color: var(--mz-blue);
    border-color: var(--mz-blue);
    color: #fff;
}

.btn-info:hover,
.btn-info:focus,
.btn-info:not(:disabled):not(.disabled):active {
    background-color: #1d4fd7;
    border-color: #1a47c2;
    color: #fff;
}

.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
}

.btn-danger:hover,
.btn-danger:focus,
.btn-danger:not(:disabled):not(.disabled):active {
    background-color: #bd2130;
    border-color: #b21f2d;
}

.btn-sm,
.btn-group-sm > .btn {
    border-radius: 0.375rem;
    font-size: 0.78125rem;
    padding: 0.375rem 0.75rem;
}

/* --------------------------------------------------------------------------
   10. Forms
   -------------------------------------------------------------------------- */
label {
    font-weight: 500;
    color: var(--mz-text-soft);
    margin-bottom: 0.375rem;
    font-size: 0.8125rem;
}

input,
button,
select,
optgroup,
textarea,
.form-control,
.custom-select {
    font-family: var(--mz-font);
}

.form-control {
    border: 1px solid var(--mz-border-strong);
    border-radius: var(--mz-radius-sm);
    color: var(--mz-text);
    background-color: var(--mz-surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control::placeholder {
    color: #a5adbd;
}

.form-control:focus {
    border-color: var(--mz-red);
    box-shadow: 0 0 0 3px rgba(215, 40, 44, 0.12);
    outline: 0;
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

select.form-control:not([size]):not([multiple]) {
    cursor: pointer;
}

/* Select2 alignment with the design system */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    border: 1px solid var(--mz-border-strong) !important;
    border-radius: var(--mz-radius-sm) !important;
    min-height: calc(1.5715em + 0.875rem + 2px);
    font-family: var(--mz-font);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: calc(1.5715em + 0.875rem);
    padding-left: 0.875rem;
    color: var(--mz-text);
    font-size: 0.8125rem;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: calc(1.5715em + 0.875rem);
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--mz-red) !important;
    box-shadow: 0 0 0 3px rgba(215, 40, 44, 0.12);
}

.select2-dropdown {
    border: 1px solid var(--mz-border) !important;
    border-radius: var(--mz-radius-sm) !important;
    box-shadow: var(--mz-shadow-md);
    font-family: var(--mz-font);
    font-size: 0.8125rem;
    overflow: hidden;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--mz-ink);
    color: #fff;
}

.select2-container--default .select2-results__option[aria-selected="true"] {
    background-color: var(--mz-red-050);
    color: var(--mz-red-700);
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid var(--mz-border-strong);
    border-radius: 0.375rem;
}

/* Custom checkboxes / radios / switches */
.custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--mz-red);
    border-color: var(--mz-red);
}

.custom-control-input:focus ~ .custom-control-label::before {
    box-shadow: 0 0 0 3px rgba(215, 40, 44, 0.15);
}

/* --------------------------------------------------------------------------
   11. Tables
   -------------------------------------------------------------------------- */
.table {
    color: var(--mz-text);
}

.table thead th {
    border-top: 0;
    border-bottom: 1px solid var(--mz-border);
    background: #f8f9fc;
    color: var(--mz-text-muted);
    font-size: 0.71875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.055em;
    padding: 0.6875rem 1rem;
    white-space: nowrap;
    vertical-align: middle;
}

.table td {
    padding: 0.6875rem 1rem;
    vertical-align: middle;
    border-top: 1px solid var(--mz-border);
    font-size: 0.8281rem;
}

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

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #fafbfd;
}

.table-striped.table-hover tbody tr:hover {
    background-color: #f3f6fa;
}

.thead-light th {
    background: #f8f9fc !important;
    color: var(--mz-text-muted) !important;
}

/* DataTables chrome */
.dataTables_wrapper {
    overflow-x: auto;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--mz-border-strong);
    border-radius: var(--mz-radius-sm);
    padding: 0.375rem 0.625rem;
    background-color: var(--mz-surface);
    outline: 0;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--mz-red);
    box-shadow: 0 0 0 3px rgba(215, 40, 44, 0.12);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--mz-ink) !important;
    color: #fff !important;
    border-color: var(--mz-ink) !important;
    border-radius: var(--mz-radius-sm);
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--mz-body-bg);
    border-radius: var(--mz-radius-sm);
}

/* --------------------------------------------------------------------------
   12. Badges
   -------------------------------------------------------------------------- */
.badge {
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.3125rem 0.5625rem;
    border-radius: 0.375rem;
}

.badge-pill {
    border-radius: 2rem;
}

.badge-primary {
    background: #eceff4;
    color: var(--mz-ink);
}

.badge-danger {
    background: var(--mz-red-050);
    color: var(--mz-red-600);
}

.badge-success {
    background: var(--mz-green-050);
    color: #0e7a37;
}

.badge-warning {
    background: var(--mz-amber-050);
    color: #b45309;
}

.badge-info {
    background: var(--mz-blue-050);
    color: var(--mz-blue);
}

.badge-secondary {
    background: #eef1f5;
    color: var(--mz-text-soft);
}

.badge-light {
    background: var(--mz-body-bg);
    color: var(--mz-text-soft);
}

.badge-dark {
    background: var(--mz-ink);
    color: #fff;
}

/* --------------------------------------------------------------------------
   13. Dropdown menus
   -------------------------------------------------------------------------- */
.dropdown-menu {
    border: 1px solid var(--mz-border);
    border-radius: var(--mz-radius);
    box-shadow: var(--mz-shadow-md);
    padding: 0.4375rem;
    font-size: 0.8281rem;
    color: var(--mz-text);
}

.dropdown-item {
    border-radius: var(--mz-radius-sm);
    padding: 0.5rem 0.75rem;
    color: var(--mz-text);
    display: flex;
    align-items: center;
    transition: background-color 0.12s ease;
}

.dropdown-item i {
    margin-right: 0.625rem;
    font-size: 0.9375rem;
    color: var(--mz-text-muted);
    top: 0;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--mz-body-bg);
    color: var(--mz-text);
}

.dropdown-item:hover i {
    color: var(--mz-text-soft);
}

.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--mz-red-050);
    color: var(--mz-red-700);
}

.dropdown-divider {
    border-top-color: var(--mz-border);
    margin: 0.375rem 0.25rem;
}

/* Header block inside user dropdown */
.mz-dropdown-user-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem 0.625rem;
    margin: -0.4375rem -0.4375rem 0.375rem;
    background: #f8f9fc;
    border-bottom: 1px solid var(--mz-border);
    border-top-left-radius: var(--mz-radius);
    border-top-right-radius: var(--mz-radius);
}

.mz-dropdown-user-header .mz-du-name {
    font-weight: 600;
    font-size: 0.8281rem;
    color: var(--mz-text);
    line-height: 1.25;
}

.mz-dropdown-user-header .mz-du-mail {
    font-size: 0.71875rem;
    color: var(--mz-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 190px;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   14. Modals
   -------------------------------------------------------------------------- */
.modal-content {
    border: 0;
    border-radius: var(--mz-radius-lg);
    box-shadow: var(--mz-shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--mz-border);
    padding: 1rem 1.375rem;
    background: var(--mz-surface) !important;
    border-top-left-radius: var(--mz-radius-lg);
    border-top-right-radius: var(--mz-radius-lg);
}

.modal-title {
    font-weight: 600;
    font-size: 0.9375rem;
}

.modal-footer {
    border-top: 1px solid var(--mz-border);
    padding: 0.875rem 1.375rem;
}

.modal-backdrop.show {
    opacity: 0.4;
}

/* --------------------------------------------------------------------------
   15. Pagination
   -------------------------------------------------------------------------- */
.pagination {
    gap: 0.25rem;
}

.page-link {
    border: 1px solid var(--mz-border);
    color: var(--mz-text-soft);
    border-radius: var(--mz-radius-sm) !important;
    min-width: 2.125rem;
    text-align: center;
    font-weight: 500;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.page-link:hover {
    background: var(--mz-body-bg);
    color: var(--mz-text);
    border-color: var(--mz-border-strong);
}

.page-item.active .page-link {
    background: var(--mz-ink);
    border-color: var(--mz-ink);
    color: #fff;
    box-shadow: var(--mz-shadow-xs);
}

.page-item.disabled .page-link {
    color: #b6bdc9;
    border-color: var(--mz-border);
}

/* --------------------------------------------------------------------------
   16. Alerts
   -------------------------------------------------------------------------- */
.alert {
    border: 1px solid transparent;
    border-radius: var(--mz-radius);
    padding: 0.8125rem 1.125rem;
}

.alert-danger {
    background: var(--mz-red-050);
    border-color: var(--mz-red-100);
    color: var(--mz-red-700);
}

.alert-success {
    background: var(--mz-green-050);
    border-color: #cceedd;
    color: #0e6b32;
}

.alert-warning {
    background: var(--mz-amber-050);
    border-color: #f7e3c3;
    color: #92400e;
}

.alert-info {
    background: var(--mz-blue-050);
    border-color: #d4e2fa;
    color: #1d4fd7;
}

/* --------------------------------------------------------------------------
   17. Tabs & pills
   -------------------------------------------------------------------------- */
.nav-tabs {
    border-bottom: 1px solid var(--mz-border);
    margin-bottom: 1rem;
}

.nav-tabs .nav-link {
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--mz-text-muted);
    font-weight: 500;
    padding: 0.625rem 0.9375rem;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-tabs .nav-link:hover {
    color: var(--mz-text);
    border-bottom-color: var(--mz-border-strong);
}

.nav-tabs .nav-link.active {
    color: var(--mz-red);
    background: transparent;
    border-bottom-color: var(--mz-red);
}

.nav-pills .nav-link {
    border-radius: var(--mz-radius-sm);
    color: var(--mz-text-soft);
    font-weight: 500;
}

.nav-pills .nav-link.active {
    background-color: var(--mz-ink);
    color: #fff;
}

/* --------------------------------------------------------------------------
   18. Utilities
   -------------------------------------------------------------------------- */
.mz-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--mz-text-muted);
}

.mz-empty i {
    font-size: 2.5rem;
    color: var(--mz-green);
    display: block;
    margin-bottom: 0.875rem;
}

.mz-empty .mz-empty-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--mz-text-soft);
    margin-bottom: 0.25rem;
}

/* Legacy bg-* stat cards used on a few inner pages — soften them */
.card[class*="bg-"]:not(.bg-white):not(.bg-light) {
    border: 0;
}

/* Keep long tables inside their cards */
.table-responsive {
    border-radius: 0 0 var(--mz-radius-lg) var(--mz-radius-lg);
}

/* Focus visibility for keyboard users */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--mz-red);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   19. Login page
   -------------------------------------------------------------------------- */
.mz-login-page {
    min-height: 100vh;
    display: flex;
    background: var(--mz-surface);
    font-family: var(--mz-font);
}

.mz-login-form-col {
    flex: 0 0 44%;
    max-width: 44%;
    display: flex;
    flex-direction: column;
    padding: 2.25rem 3.5rem;
    overflow-y: auto;
}

.mz-login-visual-col {
    flex: 1 1 auto;
    position: relative;
    background: var(--mz-sidebar-bg-deep);
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}

.mz-login-visual-col .mz-login-visual-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0.9;
}

.mz-login-visual-col::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(200deg, rgba(23, 28, 38, 0) 30%, rgba(23, 28, 38, 0.82) 82%),
        linear-gradient(90deg, rgba(23, 28, 38, 0.35), rgba(23, 28, 38, 0) 40%);
}

.mz-login-visual-caption {
    position: relative;
    z-index: 1;
    padding: 3rem 3.25rem;
    color: #fff;
}

.mz-login-visual-caption .mz-lv-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.71875rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #ffd5d6;
    margin-bottom: 0.875rem;
}

.mz-login-visual-caption .mz-lv-kicker::before {
    content: "";
    width: 22px;
    height: 2px;
    background: var(--mz-red);
    border-radius: 2px;
}

.mz-login-visual-caption h2 {
    color: #fff;
    font-size: 1.625rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.625rem;
    max-width: 30rem;
}

.mz-login-visual-caption p {
    color: rgba(255, 255, 255, 0.72);
    font-weight: 400;
    font-size: 0.875rem;
    max-width: 26rem;
    margin: 0;
}

.mz-login-brand img {
    height: 40px;
    width: auto;
}

.mz-login-body {
    margin: auto 0;
    width: 100%;
    max-width: 24rem;
    align-self: center;
    padding: 2.5rem 0;
}

.mz-login-body h1 {
    font-size: 1.4375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.375rem;
}

.mz-login-sub {
    color: var(--mz-text-muted);
    font-size: 0.84375rem;
    margin-bottom: 1.75rem;
}

.mz-login-body .form-group {
    margin-bottom: 1.125rem;
}

.mz-login-body .form-control {
    height: 46px;
    font-size: 0.875rem;
    padding-left: 2.5rem;
}

.mz-input-icon {
    position: relative;
}

.mz-input-icon > i {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa3b2;
    font-size: 0.9375rem;
    pointer-events: none;
}

.mz-login-body .btn-brand {
    height: 46px;
    font-size: 0.875rem;
    font-weight: 600;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.mz-login-footer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--mz-text-muted);
    padding-top: 1.5rem;
}

.mz-login-check {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.375rem;
}

.mz-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin: 0;
    color: var(--mz-text-soft);
    font-weight: 400;
    font-size: 0.8125rem;
}

.mz-checkbox input {
    accent-color: var(--mz-red);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

@media (max-width: 991.98px) {
    .mz-login-visual-col {
        display: none;
    }

    .mz-login-form-col {
        flex: 1 1 100%;
        max-width: 100%;
        padding: 1.75rem 1.5rem;
    }
}

/* --------------------------------------------------------------------------
   20. Responsive refinements
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    /* Off-canvas sidebar keeps full height on mobile */
    .sidebar.sidebar-dark.sidebar-main.sidebar-expand-lg {
        height: 100vh;
        box-shadow: var(--mz-shadow-lg);
    }
}

@media (max-width: 575.98px) {
    .mz-user-chip .mz-user-meta {
        display: none;
    }

    .card > .card-body {
        padding: 1rem;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .mz-stat-card,
    .mz-stat-card:hover {
        transition: none;
        transform: none;
    }
}
