/* CMFI Modern UI - navy / emerald / slate palette */
:root {
    --cmfi-navy: #1e2a5a;
    --cmfi-navy-dark: #141d42;
    --cmfi-emerald: #10b981;
    --cmfi-emerald-dark: #059669;
    --cmfi-slate: #64748b;
    --cmfi-bg: #f1f5f9;
    --cmfi-card: #ffffff;
    --cmfi-radius: 12px;
    --cmfi-shadow: 0 4px 16px rgba(30, 42, 90, 0.08);
}

html {
    font-size: 100%;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--cmfi-bg) !important;
    color: #1e293b;
    font-size: 16px;
}

/* Kill Metronic's dark page-container-bg-solid body background */
body.page-container-bg-solid {
    background: var(--cmfi-bg) !important;
}

.cmfi-hero {
    background: linear-gradient(135deg, var(--cmfi-navy) 0%, var(--cmfi-navy-dark) 60%, #0f766e 100%);
    color: #fff;
    border-radius: var(--cmfi-radius);
    box-shadow: var(--cmfi-shadow);
}

.cmfi-card {
    background: var(--cmfi-card);
    border-radius: var(--cmfi-radius);
    box-shadow: var(--cmfi-shadow);
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
}

.cmfi-kpi {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cmfi-kpi .kpi-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    flex-shrink: 0;
}

.cmfi-kpi .kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--cmfi-navy);
    line-height: 1.1;
}

.cmfi-kpi .kpi-label {
    font-size: 0.85rem;
    color: var(--cmfi-slate);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cmfi-btn {
    display: inline-block;
    padding: 0.65rem 1.4rem;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
    text-decoration: none;
}

.cmfi-btn-primary {
    background: var(--cmfi-navy);
    color: #fff;
}

.cmfi-btn-primary:hover {
    background: var(--cmfi-navy-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(30, 42, 90, 0.25);
    color: #fff;
}

.cmfi-btn-success {
    background: var(--cmfi-emerald);
    color: #fff;
}

.cmfi-btn-success:hover {
    background: var(--cmfi-emerald-dark);
    transform: translateY(-1px);
    color: #fff;
}

table.cmfi-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: var(--cmfi-radius);
    overflow: hidden;
    box-shadow: var(--cmfi-shadow);
}

table.cmfi-table thead th {
    background: var(--cmfi-navy);
    color: #fff;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

table.cmfi-table tbody td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid #e2e8f0;
}

table.cmfi-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

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

.cmfi-badge {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.cmfi-badge-green { background: #d1fae5; color: #065f46; }
.cmfi-badge-amber { background: #fef3c7; color: #92400e; }
.cmfi-badge-red { background: #fee2e2; color: #991b1b; }
.cmfi-badge-blue { background: #dbeafe; color: #1e40af; }

.cmfi-login-split {
    display: flex;
    min-height: 100vh;
}

.cmfi-login-brand {
    flex: 1;
    background: linear-gradient(135deg, var(--cmfi-navy), #0f766e);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    text-align: center;
}

.cmfi-login-form-wrap {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    background: var(--cmfi-bg);
}

.cmfi-login-card {
    width: 100%;
    max-width: 420px;
}

.cmfi-input {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.6rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
}

.cmfi-input:focus {
    outline: none;
    border-color: var(--cmfi-emerald);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.cmfi-input-group {
    position: relative;
    margin-bottom: 1rem;
}

.cmfi-input-group .input-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--cmfi-slate);
}

.cmfi-quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.cmfi-quick-action {
    text-align: center;
    padding: 1.25rem;
    border-radius: var(--cmfi-radius);
    background: #fff;
    box-shadow: var(--cmfi-shadow);
    border: 1px solid #e2e8f0;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    text-decoration: none;
    color: var(--cmfi-navy);
    font-weight: 600;
}

.cmfi-quick-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(30, 42, 90, 0.12);
}

@media (max-width: 768px) {
    .cmfi-login-split { flex-direction: column; }
    .cmfi-login-brand { padding: 2rem 1.5rem; }
    .cmfi-login-form-wrap { padding: 2rem 1.5rem; }
}

/* ======================================================
   CMFI TOP NAVBAR
   ====================================================== */
.cmfi-topnav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    z-index: 1040;
    background: var(--cmfi-topbar-bg, var(--cmfi-navy));
    display: flex;
    align-items: center;
    padding: 0 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
    gap: 0.75rem;
}

.cmfi-topnav .cmfi-nav-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    flex: 1;
    overflow: hidden;
}

.cmfi-topnav .cmfi-nav-brand img {
    height: 36px;
    width: 36px;
    object-fit: contain;
    border-radius: 6px;
}

.cmfi-topnav .cmfi-nav-brand span {
    display: none;
}
@media (min-width: 576px) {
    .cmfi-topnav .cmfi-nav-brand span { display: inline; }
}

/* Hamburger toggle */
.cmfi-sidebar-toggle {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    line-height: 1;
    flex-shrink: 0;
    transition: background 0.15s;
}
.cmfi-sidebar-toggle:hover { background: rgba(255,255,255,.12); }

/* Right side user area */
.cmfi-topnav .cmfi-nav-right {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.cmfi-user-menu {
    position: relative;
}

.cmfi-user-btn {
    background: rgba(255,255,255,.12);
    border: none;
    color: #fff;
    border-radius: 8px;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.15s;
}
.cmfi-user-btn:hover { background: rgba(255,255,255,.2); }
.cmfi-user-btn img {
    width: 30px; height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.cmfi-user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    min-width: 180px;
    z-index: 2000;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}
.cmfi-user-menu.open .cmfi-user-dropdown { display: block; }

.cmfi-user-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    color: #1e293b;
    text-decoration: none;
    font-size: 0.875rem;
    transition: background 0.12s;
}
.cmfi-user-dropdown a:hover { background: #f1f5f9; }
.cmfi-user-dropdown .cmfi-dd-divider {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 0;
}
.cmfi-user-dropdown .cmfi-dd-danger { color: #dc2626; }
.cmfi-user-dropdown .cmfi-dd-danger:hover { background: #fee2e2; }

/* Flash messages in topnav area */
.cmfi-flash-wrap {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    z-index: 1039;
    padding: 0 1rem;
}
.cmfi-flash-wrap .alert { margin-bottom: 0.25rem; border-radius: 8px; }

/* ======================================================
   CMFI SIDEBAR
   ====================================================== */
:root {
    --cmfi-sidebar-w: 250px;
    --cmfi-sidebar-collapsed-w: 58px;
    /* Overridden per-request from system_details (sidebar_color / button_color) */
    --cmfi-sidebar-bg: var(--cmfi-navy-dark);
    --cmfi-btn-bg: var(--cmfi-navy);
}

.cmfi-sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    width: var(--cmfi-sidebar-w);
    height: calc(100vh - 60px);
    height: calc(100dvh - 60px);
    max-height: calc(100vh - 60px);
    max-height: calc(100dvh - 60px);
    background: var(--cmfi-sidebar-bg);
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    z-index: 1030;
    transition: width 0.22s ease, transform 0.22s ease;
    display: block;
    padding-bottom: 5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.45) rgba(0, 0, 0, 0.2);
}

/* Scrollbar styling */
.cmfi-sidebar::-webkit-scrollbar {
    width: 6px;
    display: block;
}
.cmfi-sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
.cmfi-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.45);
    border-radius: 4px;
}
.cmfi-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.7);
}

/* Customizable primary buttons (button_color from system settings) */
.btn-primary,
.cmfi-btn-primary {
    background-color: var(--cmfi-btn-bg);
    border-color: var(--cmfi-btn-bg);
}

.btn-primary:hover, .btn-primary:focus,
.cmfi-btn-primary:hover, .cmfi-btn-primary:focus {
    background-color: var(--cmfi-btn-bg);
    border-color: var(--cmfi-btn-bg);
    filter: brightness(0.88);
    color: #fff;
}

/* Collapsed state (desktop) */
body.cmfi-sidebar-collapsed .cmfi-sidebar { width: var(--cmfi-sidebar-collapsed-w); }

/* Mobile: hidden by default, slide in when open */
@media (max-width: 991px) {
    .cmfi-sidebar {
        transform: translateX(-100%);
        touch-action: pan-y;
        height: calc(100vh - 60px);
        height: calc(100dvh - 60px);
        max-height: calc(100vh - 60px);
        max-height: calc(100dvh - 60px);
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6rem;
    }
    body.cmfi-sidebar-open .cmfi-sidebar {
        transform: translateX(0);
        overflow-y: auto !important;
    }
    body.cmfi-sidebar-open .cmfi-sidebar-overlay {
        display: block !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
}

.cmfi-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: 60px;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1029;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* Ensure any legacy quick nav overlay does not cover the mobile screen */
.quick-nav-overlay {
    display: none !important;
    pointer-events: none !important;
}

/* Sidebar user info card (dashboard info at a glance) */
.cmfi-sidebar-profile {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin: 1rem 0.8rem 0.65rem;
    padding: 0.85rem 0.75rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.09);
    overflow: visible;
}

.cmfi-sidebar-profile img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(16, 185, 129, 0.6);
}

.cmfi-sidebar-profile-body {
    overflow: hidden;
    min-width: 0;
}

.cmfi-sidebar-profile-name {
    font-weight: 700;
    color: #fff;
    font-size: 0.82rem;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cmfi-sidebar-profile-role {
    font-size: 0.7rem;
    line-height: 1.4;
    color: #6ee7b7;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cmfi-sidebar-profile-meta {
    font-size: 0.72rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.cmfi-sidebar-collapsed .cmfi-sidebar-profile-body { display: none; }
body.cmfi-sidebar-collapsed .cmfi-sidebar-profile { justify-content: center; margin: 0.85rem 0.4rem 0.4rem; padding: 0.5rem; }

/* Nav group label */
.cmfi-nav-group-label {
    padding: 1.25rem 1rem 0.55rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.3;
    color: rgba(255,255,255,.38);
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.15s;
}
body.cmfi-sidebar-collapsed .cmfi-nav-group-label { opacity: 0; }

/* Nav items */
.cmfi-nav-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.78rem 0.85rem;
    color: rgba(255,255,255,.75);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 0;
    transition: background 0.13s, color 0.13s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    line-height: 1.35;
}

.cmfi-nav-item i, .cmfi-nav-item .fa {
    font-size: 1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    color: rgba(255,255,255,.6);
    transition: color 0.13s;
}

.cmfi-nav-item:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
}
.cmfi-nav-item:hover i, .cmfi-nav-item:hover .fa { color: var(--cmfi-emerald); }

/* Active panel and active link styles */
.cmfi-nav-item.active,
.cmfi-nav-item.active:hover,
.cmfi-nav-item.active-panel,
.cmfi-nav-item.active-panel:hover {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.22) 0%, rgba(30, 42, 90, 0.5) 100%) !important;
    color: #ffffff !important;
    border-left: 4px solid var(--cmfi-emerald) !important;
    font-weight: 600;
}
.cmfi-nav-item.active i, .cmfi-nav-item.active .fa,
.cmfi-nav-item.active-panel i, .cmfi-nav-item.active-panel .fa {
    color: var(--cmfi-emerald) !important;
}

/* Collapse arrow */
.cmfi-nav-arrow {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.2s;
    flex-shrink: 0;
    color: rgba(255,255,255,.45);
}
body.cmfi-sidebar-collapsed .cmfi-nav-arrow { display: none; }
.cmfi-nav-item[aria-expanded="true"] .cmfi-nav-arrow,
.cmfi-nav-item.active-panel .cmfi-nav-arrow {
    transform: rotate(90deg);
    color: var(--cmfi-emerald) !important;
}

/* Sub-items - Active Panel Container */
.cmfi-nav-sub {
    list-style: none;
    margin: 0;
    padding: 0;
    display: none;
}
.cmfi-nav-sub.open,
.cmfi-nav-item[aria-expanded="true"] + .cmfi-nav-sub {
    display: block;
    background: rgba(10, 15, 36, 0.55);
    border-left: 2px solid rgba(16, 185, 129, 0.35);
    margin-left: 14px;
    margin-right: 8px;
    border-radius: 0 0 8px 8px;
    padding: 0.35rem 0;
}

.cmfi-nav-sub a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem 0.65rem 1.8rem;
    color: rgba(255,255,255,.65);
    text-decoration: none;
    font-size: 0.825rem;
    white-space: nowrap;
    transition: background 0.12s, color 0.12s;
    border-radius: 6px;
    margin: 1px 6px;
    line-height: 1.35;
}
.cmfi-nav-sub a::before {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,.3);
    flex-shrink: 0;
    transition: background 0.12s, transform 0.12s;
}
.cmfi-nav-sub a:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
}
.cmfi-nav-sub a:hover::before {
    background: var(--cmfi-emerald);
    transform: scale(1.3);
}
.cmfi-nav-sub a.active {
    color: #ffffff !important;
    background: rgba(16, 185, 129, 0.22) !important;
    font-weight: 600;
}
.cmfi-nav-sub a.active::before {
    background: var(--cmfi-emerald) !important;
    box-shadow: 0 0 6px var(--cmfi-emerald);
    transform: scale(1.4);
}

body.cmfi-sidebar-collapsed .cmfi-nav-sub { display: none; }

/* ======================================================
   BODY LAYOUT WITH SIDEBAR
   ====================================================== */
body.cmfi-has-sidebar {
    padding-top: 60px !important;
}

/* Kill the old Metronic 141px content offset (meant for the old
   fixed header we hide; our topnav is 60px, covered by body padding) */
body.cmfi-has-sidebar .page-container {
    margin-top: 0 !important;
}

body.cmfi-has-sidebar .page-wrapper {
    margin-left: var(--cmfi-sidebar-w);
    width: calc(100% - var(--cmfi-sidebar-w));
    max-width: calc(100% - var(--cmfi-sidebar-w));
    overflow-x: clip;
    transition: margin-left 0.22s ease, width 0.22s ease, max-width 0.22s ease;
    min-height: calc(100vh - 60px);
}

body.cmfi-has-sidebar.cmfi-sidebar-collapsed .page-wrapper {
    margin-left: var(--cmfi-sidebar-collapsed-w);
    width: calc(100% - var(--cmfi-sidebar-collapsed-w));
    max-width: calc(100% - var(--cmfi-sidebar-collapsed-w));
}

/* Hide the old horizontal nav & header wrapper row when sidebar is active */
body.cmfi-has-sidebar .page-header-menu,
body.cmfi-has-sidebar .page-header,
body.cmfi-has-sidebar .page-header-top,
body.cmfi-has-sidebar .page-header-inner,
body.cmfi-has-sidebar .page-wrapper-top,
body.cmfi-has-sidebar .page-wrapper-row:first-child,
body.cmfi-has-sidebar .page-bar {
    display: none !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
}

/* On mobile the page wrapper takes full width.
   Also reset Metronic's display:table model — on mobile those
   display:table-cell children don't stretch to viewport height,
   causing the dark body to show through the content area. */
@media (max-width: 991px) {
    body.cmfi-has-sidebar .page-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        /* Reset Metronic table layout so the content fills normally */
        display: block !important;
        background: var(--cmfi-bg) !important;
        min-height: calc(100vh - 60px) !important;
    }
    /* Reset table-row/table-cell children on mobile */
    body.cmfi-has-sidebar .page-wrapper-row,
    body.cmfi-has-sidebar .page-wrapper-middle,
    body.cmfi-has-sidebar .page-wrapper-bottom {
        display: block !important;
        width: 100% !important;
        background: var(--cmfi-bg) !important;
    }
    /* Page content area must fill full height on mobile */
    body.cmfi-has-sidebar .page-container,
    body.cmfi-has-sidebar .page-content-wrapper {
        background: var(--cmfi-bg) !important;
        min-height: calc(100vh - 60px) !important;
    }
}

/* Make page-container and container truly full width */
body.cmfi-has-sidebar .page-container,
body.cmfi-has-sidebar .container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
}

/* Remove inner padding from page content containers */
body.cmfi-has-sidebar .page-inner,
body.cmfi-has-sidebar .page-content {
    padding: 0.25rem 0 0 0 !important;
}

/* Collapse the (usually empty) page-head strip above content.
   When a flash message exists the alerts render and the strip shows. */
body.cmfi-has-sidebar .page-head {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    min-height: 0 !important;
}

body.cmfi-has-sidebar .page-head:not(:has(.alert)) {
    display: none !important;
}

/* Flatten portlet wrappers — we use our own card styles */
body.cmfi-has-sidebar .portlet.light {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
}
body.cmfi-has-sidebar .portlet-title {
    display: none !important;
}
body.cmfi-has-sidebar .portlet-body {
    padding: 0 !important;
}

/* Fix Bootstrap row negative margin causing right-side overflow */
body.cmfi-has-sidebar .page-content > .container > .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}
body.cmfi-has-sidebar .page-content > .container > .row > [class*="col-"] {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Tooltip on collapsed sidebar */
body.cmfi-sidebar-collapsed .cmfi-nav-item-text {
    display: none;
}

/* ======================================================
   MODERN DASHBOARD STRUCTURE & STYLING
   ====================================================== */
.cmfi-dash-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Hero Welcome Banner */
.cmfi-dash-hero {
    background: linear-gradient(135deg, var(--cmfi-navy) 0%, #172554 50%, #0f766e 100%);
    color: #fff;
    border-radius: var(--cmfi-radius);
    padding: 1.75rem 2rem;
    box-shadow: 0 8px 24px rgba(30, 42, 90, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.25rem;
    position: relative;
    overflow: hidden;
}
.cmfi-dash-hero::after {
    content: '';
    position: absolute;
    right: -40px;
    bottom: -50px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.cmfi-dash-hero-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.cmfi-dash-hero-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    margin: 0;
}

.cmfi-dash-hero-badge {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* KPI Statistics Grid */
.cmfi-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.cmfi-kpi-card {
    background: #fff;
    border-radius: var(--cmfi-radius);
    padding: 1.25rem 1.4rem;
    box-shadow: var(--cmfi-shadow);
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cmfi-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(30, 42, 90, 0.12);
}

.cmfi-kpi-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.cmfi-kpi-blue   { background: #eff6ff; color: #2563eb; }
.cmfi-kpi-green  { background: #ecfdf5; color: #059669; }
.cmfi-kpi-purple { background: #faf5ff; color: #9333ea; }
.cmfi-kpi-amber  { background: #fffbeb; color: #d97706; }

.cmfi-kpi-body {
    flex: 1;
    min-width: 0;
}
.cmfi-kpi-number {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--cmfi-navy);
    line-height: 1.1;
    margin: 0;
}
.cmfi-kpi-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--cmfi-slate);
    margin: 0.2rem 0 0;
}
.cmfi-kpi-sub {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.2rem;
}

/* Quick Action Strip */
.cmfi-quick-actions-strip {
    background: #fff;
    border-radius: var(--cmfi-radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--cmfi-shadow);
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.cmfi-qa-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--cmfi-navy);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.cmfi-qa-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--cmfi-navy);
    background: #f1f5f9;
    text-decoration: none;
    transition: all 0.13s ease;
    border: 1px solid #e2e8f0;
}
.cmfi-qa-btn:hover {
    background: var(--cmfi-navy);
    color: #fff;
    border-color: var(--cmfi-navy);
    text-decoration: none;
    transform: translateY(-1px);
}
.cmfi-qa-btn i { font-size: 0.85rem; }

/* Dashboard Section Heading */
.cmfi-dash-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.5rem;
    margin-bottom: -0.5rem;
}
.cmfi-dash-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--cmfi-navy);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.cmfi-dash-section-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: var(--cmfi-emerald);
    border-radius: 2px;
}

/* Modules Grid */
.cmfi-dash-modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.cmfi-module-card {
    background: #fff;
    border-radius: var(--cmfi-radius);
    padding: 1.4rem;
    box-shadow: var(--cmfi-shadow);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    position: relative;
    overflow: hidden;
}
.cmfi-module-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(30, 42, 90, 0.12);
    border-color: var(--cmfi-emerald);
    text-decoration: none;
}
.cmfi-module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--cmfi-navy), var(--cmfi-emerald));
    opacity: 0;
    transition: opacity 0.15s ease;
}
.cmfi-module-card:hover::before { opacity: 1; }

.cmfi-module-card-top {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.cmfi-module-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
    transition: transform 0.15s;
}
.cmfi-module-card:hover .cmfi-module-card-icon { transform: scale(1.08); }

.cmfi-module-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--cmfi-navy);
    margin: 0;
    line-height: 1.25;
}
.cmfi-module-card-desc {
    font-size: 0.825rem;
    color: var(--cmfi-slate);
    line-height: 1.45;
    margin: 0;
    flex: 1;
}

.cmfi-module-card-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
}
.cmfi-module-tag {
    font-size: 0.725rem;
    font-weight: 600;
    color: var(--cmfi-navy);
    background: #f8fafc;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    transition: background 0.12s, color 0.12s;
}
.cmfi-module-card:hover .cmfi-module-tag {
    background: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}

/* Module Landing Hub Cards */
.cmfi-hub-container {
    padding: 0.5rem 0;
}
.cmfi-hub-header {
    margin-bottom: 1.5rem;
}
.cmfi-hub-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--cmfi-navy);
    margin: 0 0 0.4rem;
}
.cmfi-hub-header p {
    color: var(--cmfi-slate);
    font-size: 0.9rem;
    margin: 0;
}
.cmfi-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}
.cmfi-hub-action-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--cmfi-radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--cmfi-shadow);
    transition: all 0.13s ease;
}
.cmfi-hub-action-card:hover {
    border-color: var(--cmfi-emerald);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(30, 42, 90, 0.1);
    text-decoration: none;
}
.cmfi-hub-action-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #f1f5f9;
    color: var(--cmfi-navy);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: background 0.12s, color 0.12s;
}
.cmfi-hub-action-card:hover .cmfi-hub-action-icon {
    background: var(--cmfi-emerald);
    color: #fff;
}
.cmfi-hub-action-title {
    font-weight: 600;
    font-size: 0.925rem;
    color: var(--cmfi-navy);
    margin: 0 0 0.15rem;
}
.cmfi-hub-action-desc {
    font-size: 0.775rem;
    color: var(--cmfi-slate);
    margin: 0;
}


