:root {
    --bf-primary: #2e6fd5;
    --bf-primary-dark: #1f4d9f;
    --bf-primary-soft: #edf4ff;
    --bf-success: #37b56b;
    --bf-warning: #ffc658;
    --bf-danger: #f16570;
    --bf-text: #1f2a44;
    --bf-muted: #6a7591;
    --bf-panel-border: rgba(34, 63, 112, 0.12);
    --bf-shadow: 0 18px 40px rgba(37, 74, 138, 0.12);
}

body {
    color: var(--bf-text);
}

.sidebar {
    background: #fff;
}

.sidebar .nav-link {
    color: #2f3a4a;
    border-radius: 0.75rem;
    margin-bottom: 0.25rem;
    padding: 0.55rem 0.75rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link:focus {
    background: #e9f1ff;
    color: #0d6efd;
}

.sidebar-desktop {
    min-height: 100vh;
}

.card-kpi {
    border: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.table thead th {
    white-space: nowrap;
}

.baluflow-body {
    background:
        radial-gradient(circle at top right, rgba(83, 141, 242, 0.12), transparent 28%),
        linear-gradient(180deg, #f4f8ff 0%, #f7f9fc 28%, #f9fbff 100%);
}

.dashboard-main {
    padding-top: 1.25rem !important;
}

.baluflow-dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    font-size: 16px;
    line-height: 1.35;
}

.baluflow-hero {
    background: linear-gradient(130deg, #2054a9 0%, #2f77db 52%, #6ea8ff 100%);
    border-radius: 1.75rem;
    padding: 1.1rem 1.25rem;
    color: #fff;
    position: relative;
    overflow: visible;
    box-shadow: var(--bf-shadow);
}

.baluflow-hero::before,
.baluflow-hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.baluflow-hero::before {
    width: 160px;
    height: 160px;
    right: -60px;
    top: -80px;
}

.baluflow-hero::after {
    width: 130px;
    height: 130px;
    left: -40px;
    bottom: -110px;
}

.baluflow-hero-top {
    position: relative;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.baluflow-brand-wrap {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.baluflow-menu-btn {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.1);
    padding: 0;
}

.baluflow-menu-btn span {
    display: block;
    width: 18px;
    height: 2px;
    background: #fff;
    margin: 0 auto;
    border-radius: 999px;
}

.baluflow-mark {
    width: 48px;
    height: 48px;
    border-radius: 1rem;
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.06));
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.baluflow-mark span {
    position: absolute;
    bottom: 9px;
    width: 6px;
    border-radius: 999px;
    background: linear-gradient(180deg, #bce8ff, #ffffff);
}

.baluflow-mark span:nth-child(1) {
    left: 12px;
    height: 18px;
}

.baluflow-mark span:nth-child(2) {
    left: 21px;
    height: 25px;
}

.baluflow-mark span:nth-child(3) {
    left: 30px;
    height: 33px;
}

.baluflow-brand-name {
    font-size: 42px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.baluflow-brand-name span {
    font-weight: 400;
}

.baluflow-brand-tagline {
    margin-top: 0.45rem;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.88);
}

.baluflow-hero-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: flex-end;
}

.baluflow-hero-copy {
    text-align: right;
}

.baluflow-hero-greeting {
    font-size: 15px;
    font-weight: 700;
}

.baluflow-hero-meta {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-top: 0.45rem;
}

.baluflow-hero-host {
    color: rgba(255, 255, 255, 0.84);
    font-size: 14px;
}

.baluflow-top-icons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.baluflow-icon-link,
.baluflow-avatar,
.dashboard-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
}

.baluflow-icon-link {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.24);
    color: #fff;
    text-decoration: none;
}

.baluflow-icon-link svg {
    width: 1.2rem;
    height: 1.2rem;
    fill: currentColor;
}

.baluflow-settings-toggle::after {
    display: none;
}

.baluflow-settings-menu .dropdown-menu {
    border: 1px solid rgba(31, 42, 68, 0.08);
    border-radius: 1rem;
    min-width: 220px;
    padding: 0.45rem;
    z-index: 1080;
}

.baluflow-settings-menu .dropdown-item {
    border-radius: 0.8rem;
    font-weight: 600;
    color: var(--bf-text);
    padding: 0.65rem 0.8rem;
}

.baluflow-settings-menu .dropdown-item:hover,
.baluflow-settings-menu .dropdown-item:focus {
    background: #edf4ff;
    color: var(--bf-primary-dark);
}

.baluflow-avatar,
.dashboard-avatar {
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.variant-a { background: linear-gradient(135deg, #0d4fbf, #6ab4ff); }
.variant-b { background: linear-gradient(135deg, #34a96b, #8fe0b3); }
.variant-c { background: linear-gradient(135deg, #f06a6e, #ffb1af); }
.variant-d { background: linear-gradient(135deg, #6a4ee9, #b49cff); }
.variant-e { background: linear-gradient(135deg, #e78f2d, #ffd07c); }

.baluflow-kpis {
    margin-top: -0.25rem;
}

.baluflow-kpi-card {
    border-radius: 1.4rem;
    padding: 1rem 1.05rem;
    color: #fff;
    position: relative;
    overflow: hidden;
    min-height: 126px;
}

.baluflow-kpi-card::after {
    content: '';
    position: absolute;
    right: 1rem;
    bottom: 0.8rem;
    width: 88px;
    height: 56px;
    opacity: 0.16;
    background: linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.92) 100%);
    clip-path: polygon(0 100%, 0 72%, 16% 72%, 16% 46%, 34% 46%, 34% 18%, 56% 18%, 56% 0, 76% 0, 76% 34%, 100% 34%, 100% 100%);
}

.baluflow-kpi-success { background: linear-gradient(135deg, #2f965f, #67d38f); }
.baluflow-kpi-primary { background: linear-gradient(135deg, #2b66cc, #5da6ff); }
.baluflow-kpi-warning { background: linear-gradient(135deg, #f5b230, #ffd67e); color: #5e3600; }
.baluflow-kpi-danger { background: linear-gradient(135deg, #ef5d69, #fb8d95); }

.baluflow-kpi-warning .baluflow-kpi-label,
.baluflow-kpi-warning .baluflow-kpi-value {
    color: #5e3600;
}

.baluflow-kpi-label {
    font-size: 15px;
    font-weight: 700;
    opacity: 0.94;
}

.baluflow-kpi-value {
    margin-top: 0.7rem;
    font-size: clamp(34px, 3vw, 46px);
    font-weight: 800;
    line-height: 1;
}

.dashboard-panel {
    background: #fff;
    border: 1px solid var(--bf-panel-border);
    border-radius: 1.4rem;
    padding: 1.35rem 1.35rem 1.1rem;
    box-shadow: var(--bf-shadow);
}

.dashboard-panel-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.dashboard-panel-header.compact {
    margin-bottom: 0.7rem;
}

.dashboard-panel-header h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.dashboard-panel-header p {
    margin: 0.35rem 0 0;
    color: var(--bf-muted);
    font-size: 15px;
}

.dashboard-panel-pill {
    border-radius: 999px;
    background: var(--bf-primary-soft);
    color: var(--bf-primary-dark);
    padding: 0.45rem 0.85rem;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.dashboard-chart-wrap {
    padding-top: 0.5rem;
}

.dashboard-chart-svg {
    width: 100%;
    height: auto;
    display: block;
}

.dashboard-chart-grid {
    stroke: rgba(41, 72, 126, 0.11);
    stroke-width: 1;
}

.dashboard-chart-axis {
    fill: #76839d;
    font-size: 13px;
    font-weight: 600;
}

.dashboard-chart-bar {
    fill: url(#flowBarGradient);
}

.dashboard-chart-line {
    stroke: #45a66d;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dashboard-chart-point {
    fill: #fff;
    stroke: #45a66d;
    stroke-width: 3;
}

.dashboard-chart-tooltip rect {
    fill: #344152;
    opacity: 0.96;
}

.dashboard-chart-tooltip text {
    fill: #fff;
    font-size: 14px;
    font-weight: 700;
}

.dashboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dashboard-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid rgba(31, 42, 68, 0.08);
}

.dashboard-list-item:last-child {
    border-bottom: 0;
}

.dashboard-list-main {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.dashboard-list-title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.dashboard-list-subtitle {
    color: var(--bf-muted);
    font-size: 14px;
}

.dashboard-list-amount {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    white-space: nowrap;
}

.dashboard-list-amount strong {
    font-size: 18px;
    font-weight: 800;
}

.dashboard-list-amount span {
    color: var(--bf-muted);
    font-size: 14px;
}

.dashboard-empty {
    padding: 1rem 0 0.25rem;
    color: var(--bf-muted);
}

.small-list .dashboard-list-item {
    padding: 0.95rem 0;
}

.dashboard-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.85rem;
    padding-top: 0.25rem;
}

.dashboard-actions .btn {
    min-width: 220px;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(37, 74, 138, 0.16);
}

.dashboard-actions .btn-primary {
    background: linear-gradient(135deg, #2a66cc, #477ddb);
    border-color: #2a66cc;
}

.dashboard-actions .btn-outline-primary {
    background: #fff;
}

@media (max-width: 1199.98px) {
    .baluflow-hero-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .baluflow-hero-user {
        width: 100%;
        justify-content: space-between;
    }

    .baluflow-hero-copy {
        text-align: left;
    }

    .baluflow-hero-meta {
        justify-content: flex-start;
    }
}

@media (max-width: 991.98px) {
    .dashboard-actions {
        justify-content: stretch;
    }

    .dashboard-actions .btn {
        flex: 1 1 0;
        min-width: 0;
    }
}

@media (max-width: 767.98px) {
    .offcanvas.sidebar {
        width: 280px;
    }

    .dashboard-main {
        padding-top: 0.85rem !important;
        padding-left: 0.8rem !important;
        padding-right: 0.8rem !important;
    }

    .baluflow-dashboard {
        gap: 1rem;
    }

    .baluflow-hero {
        padding: 1.15rem 1.05rem;
        border-radius: 1.5rem;
    }

    .baluflow-brand-wrap {
        align-items: flex-start;
        gap: 0.8rem;
    }

    .baluflow-mark {
        width: 42px;
        height: 42px;
        border-radius: 1.2rem;
    }

    .baluflow-brand-name {
        font-size: 34px;
    }

    .baluflow-brand-tagline {
        font-size: 16px;
        max-width: 260px;
    }

    .baluflow-hero-user {
        align-items: flex-end;
        gap: 0.75rem;
    }

    .baluflow-top-icons {
        gap: 0.55rem;
    }

    .baluflow-icon-link,
    .baluflow-avatar,
    .dashboard-avatar {
        width: 38px;
        height: 38px;
    }

    .baluflow-kpi-card {
        min-height: 132px;
        border-radius: 1.2rem;
        padding: 1rem 1rem 0.95rem;
    }

    .baluflow-kpi-label {
        font-size: 14px;
    }

    .baluflow-kpi-value {
        margin-top: 0.55rem;
        font-size: 32px;
    }

    .dashboard-panel {
        border-radius: 1.2rem;
        padding: 1rem 1rem 0.85rem;
    }

    .dashboard-panel-header h2 {
        font-size: 23px;
    }

    .dashboard-list-item {
        align-items: flex-start;
        gap: 0.75rem;
    }

    .dashboard-list-title {
        font-size: 16px;
    }

    .dashboard-list-subtitle,
    .dashboard-list-amount span {
        font-size: 13px;
    }

    .dashboard-actions {
        flex-direction: column;
    }
}

@media (max-width: 575.98px) {
    .baluflow-hero-user {
        width: 100%;
        flex-wrap: wrap;
        align-items: center;
    }

    .baluflow-hero-copy,
    .baluflow-hero-meta {
        width: 100%;
    }

    .baluflow-hero-meta {
        gap: 0.4rem;
    }

    .dashboard-list-item {
        flex-direction: column;
    }

    .dashboard-list-amount {
        width: 100%;
        align-items: flex-start;
        text-align: left;
    }
}
