.layout-px-spacing .widget-table-two,
.layout-px-spacing .widget.widget-table-two {
    background: #0e1726;
    border: 1px solid rgba(191, 201, 212, .06);
    border-radius: 14px;
    padding: 22px 24px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .28);
}

.widget-table-two .widget-heading {
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(191, 201, 212, .08);
}

.widget-table-two .widget-heading.d-flex {
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.widget-table-two .widget-heading h5 {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .3px;
    color: #e0e6ed;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-table-two .widget-heading > .text-muted {
    display: block;
    font-size: 12px;
    color: #888ea8 !important;
    margin-top: 5px;
}

.widget-table-two .widget-content {
    background: transparent;
}

.analytics-kpi {
    position: relative;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease;
}

.analytics-kpi:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, .35);
}

.analytics-kpi::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--kpi-accent, #973ffb), transparent);
}

.analytics-kpi.kpi-primary { --kpi-accent: #973ffb; }
.analytics-kpi.kpi-success { --kpi-accent: #00ab55; }
.analytics-kpi.kpi-info { --kpi-accent: #2196f3; }
.analytics-kpi.kpi-warning { --kpi-accent: #e2a03f; }
.analytics-kpi.kpi-danger { --kpi-accent: #e7515a; }
.analytics-kpi.kpi-secondary { --kpi-accent: #805dca; }

.analytics-kpi .widget-content {
    padding: 4px 0 2px;
}

.kpi-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.kpi-icon-badge {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-badge-primary { background: rgba(151, 63, 251, .15); color: #b58bfb; }
.kpi-badge-success { background: rgba(0, 171, 85, .15); color: #3ddc9a; }
.kpi-badge-info { background: rgba(33, 150, 243, .15); color: #6cbcf9; }
.kpi-badge-warning { background: rgba(226, 160, 63, .15); color: #f0bd6c; }
.kpi-badge-danger { background: rgba(231, 81, 90, .15); color: #f28e94; }
.kpi-badge-secondary { background: rgba(128, 93, 202, .15); color: #b09ee6; }

.kpi-text {
    min-width: 0;
}

.kpi-title {
    font-size: 12.5px;
    font-weight: 600;
    color: #888ea8;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin: 2px 0 6px;
}

.analytics-kpi h2 {
    font-size: 27px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: .2px;
    margin: 0;
    line-height: 1.15;
}

.analytics-kpi p.kpi-subtitle {
    font-size: 12px;
    color: #888ea8 !important;
    letter-spacing: .2px;
    margin: 5px 0 0;
}

/* Tables */
.widget-table-two .table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    margin-bottom: 0;
    background: transparent;
    table-layout: auto;
}

.widget-table-two .table thead th {
    background: #161f3d !important;
    border: none !important;
    border-bottom: 2px solid rgba(151, 63, 251, .35) !important;
    padding: 12px 16px !important;
    white-space: nowrap;
}

.widget-table-two .table thead th .th-content {
    color: #bfc9d4 !important;
    font-weight: 700 !important;
    font-size: 12.5px !important;
    letter-spacing: .6px !important;
    text-transform: uppercase;
    margin: 0 !important;
}

.widget-table-two .table tbody tr > td {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid rgba(191, 201, 212, .07) !important;
    padding: 13px 16px !important;
    vertical-align: middle;
}

.widget-table-two .table tbody tr:nth-child(even) > td {
    background: rgba(191, 201, 212, .02) !important;
}

.widget-table-two .table tbody tr:hover > td {
    background: rgba(151, 63, 251, .09) !important;
}

.widget-table-two .table tbody tr:last-child > td {
    border-bottom: none !important;
}

.widget-table-two .table .td-content,
.widget-table-two .table .th-content {
    font-weight: 500;
    letter-spacing: .2px;
    color: #bfc9d4;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.widget-table-two .table thead th:first-child .th-content,
.widget-table-two .table tbody td:first-child .td-content {
    text-align: left !important;
    white-space: normal;
    font-weight: 600;
    color: #e0e6ed;
}

.widget-table-two .table thead th:not(:first-child) .th-content,
.widget-table-two .table tbody td:not(:first-child) .td-content {
    text-align: right !important;
}

.widget-table-two .table-responsive {
    overflow-x: auto;
}

/* Badges */
.widget-table-two .badge {
    font-size: 11.5px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 20px;
    letter-spacing: .3px;
}

/* Filter bar */
.widget-table-two form.row {
    align-items: center;
}

.widget-table-two .form-control,
.widget-table-two .form-select {
    background-color: #161f3d;
    border: 1px solid rgba(191, 201, 212, .12);
    color: #e0e6ed;
    border-radius: 8px;
    font-size: 13.5px;
    padding: 9px 14px;
}

.widget-table-two .form-control::placeholder {
    color: #6b7394;
}

.widget-table-two .form-control:focus,
.widget-table-two .form-select:focus {
    background-color: #161f3d;
    border-color: #973ffb;
    color: #e0e6ed;
    box-shadow: 0 0 0 3px rgba(151, 63, 251, .18);
}

.widget-table-two .btn-primary {
    background: linear-gradient(135deg, #973ffb, #7c3aed);
    border: none;
    font-weight: 600;
    letter-spacing: .3px;
    border-radius: 8px;
    padding: 9px 18px;
}

.widget-table-two .btn-outline-primary {
    border-radius: 8px;
    font-weight: 600;
    font-size: 12.5px;
    padding: 5px 14px;
    white-space: nowrap;
}

/* Chart containers */
.widget-table-two [id$="-chart"] {
    margin-top: 4px;
}

.apexcharts-tooltip {
    background: #161f3d !important;
    color: #e0e6ed !important;
    border: 1px solid rgba(191, 201, 212, .12) !important;
}

.apexcharts-legend-text {
    color: #bfc9d4 !important;
}

/* Layout spacing */
.layout-top-spacing > [class*="col-"] {
    margin-bottom: 4px;
}

.layout-px-spacing .row.layout-top-spacing {
    row-gap: 20px;
}

/* Section heading dividers in the sidebar */
.menu-heading .heading span {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #506690;
}

/* Cohort retention table */
.cohort-table-wrap {
    overflow-x: auto;
}

.cohort-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 3px;
    font-size: 12.5px;
}

.cohort-table th {
    color: #888ea8;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    font-size: 11px;
    padding: 6px 8px;
    text-align: center;
    white-space: nowrap;
}

.cohort-table th:first-child,
.cohort-table td.cohort-label {
    text-align: left;
}

.cohort-table td {
    text-align: center;
    padding: 10px 6px;
    border-radius: 6px;
    color: #e0e6ed;
    font-weight: 700;
    white-space: nowrap;
}

.cohort-table td.cohort-label {
    font-weight: 600;
    color: #bfc9d4;
    background: transparent !important;
}

.cohort-table td.cohort-size {
    color: #888ea8;
    font-weight: 600;
    background: rgba(191, 201, 212, .04);
}

.cohort-table td.cohort-cell.empty {
    background: rgba(191, 201, 212, .03) !important;
    color: #3d4566;
    font-weight: 400;
}

/* Funnel visual */
.funnel {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 10px 0;
}

.funnel-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.funnel-bar {
    height: 46px;
    max-width: 100%;
    border-radius: 10px;
    background: linear-gradient(135deg, #973ffb, #5a3ecb);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    box-shadow: 0 8px 18px rgba(151, 63, 251, .25);
    transition: width .3s ease;
}

.funnel-stage:nth-child(2) .funnel-bar {
    background: linear-gradient(135deg, #2196f3, #1565c0);
    box-shadow: 0 8px 18px rgba(33, 150, 243, .22);
}

.funnel-stage:nth-child(3) .funnel-bar {
    background: linear-gradient(135deg, #00ab55, #007a3d);
    box-shadow: 0 8px 18px rgba(0, 171, 85, .22);
}

.funnel-stage:nth-child(4) .funnel-bar {
    background: linear-gradient(135deg, #e2a03f, #b87a1f);
    box-shadow: 0 8px 18px rgba(226, 160, 63, .22);
}

.funnel-label {
    font-size: 12.5px;
    color: #888ea8;
    font-weight: 600;
}

.funnel-label strong {
    color: #e0e6ed;
}

/* Insight / recommendation banner */
.insight-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, rgba(151, 63, 251, .14), rgba(33, 150, 243, .08));
    border: 1px solid rgba(151, 63, 251, .25);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 18px;
}

.insight-banner .insight-icon {
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(151, 63, 251, .2);
    color: #b58bfb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.insight-banner p {
    margin: 0;
    font-size: 13.5px;
    color: #d7ddf0;
}

.insight-banner strong {
    color: #ffffff;
}

/* Segment / growth badges reused across insight tables */
.growth-up { color: #3ddc9a; font-weight: 700; }
.growth-down { color: #f28e94; font-weight: 700; }
