/* ==========================================================================
   BudgetKu — Modern Fintech Theme
   Aesthetic: cool off-white canvas, vivid emerald primary, electric coral accent,
   modern grotesque display + clean sans body. No serif, no editorial italic.
   Fonts: Bricolage Grotesque (display), Manrope (body), JetBrains Mono (numbers).
   ========================================================================== */

:root {
    /* --- Canvas --- */
    --bk-canvas:        #f7f7f6;
    --bk-paper:         #ffffff;
    --bk-paper-2:       #fafafa;

    /* --- Ink --- */
    --bk-ink:           #0a0a0a;
    --bk-ink-2:         #171717;
    --bk-ink-3:         #404040;
    --bk-muted:         #737373;
    --bk-faint:         #a3a3a3;

    /* --- Lines --- */
    --bk-line:          #e7e5e4;
    --bk-line-2:        #d6d3d1;
    --bk-line-strong:   #a8a29e;

    /* --- Primary — vivid modern emerald --- */
    --bk-primary:       #059669;
    --bk-primary-600:   #047857;
    --bk-primary-700:   #065f46;
    --bk-primary-soft:  #d1fae5;
    --bk-primary-mist:  #ecfdf5;
    --bk-primary-ink:   #064e3b;
    --bk-primary-ring:  rgba(5, 150, 105, .22);

    /* --- Accent — electric coral --- */
    --bk-accent:        #f43f5e;
    --bk-accent-600:    #e11d48;
    --bk-accent-soft:   #ffe4e6;

    /* --- Secondary — indigo --- */
    --bk-indigo:        #4f46e5;
    --bk-indigo-soft:   #e0e7ff;

    /* --- Semantic --- */
    --bk-success:       #10b981;
    --bk-success-soft:  #d1fae5;
    --bk-warn:          #f59e0b;
    --bk-warn-soft:     #fef3c7;
    --bk-danger:        #ef4444;
    --bk-danger-soft:   #fee2e2;
    --bk-info:          #3b82f6;
    --bk-info-soft:     #dbeafe;

    /* --- Chart palette --- */
    --chart-1: #059669;  /* emerald */
    --chart-2: #4f46e5;  /* indigo */
    --chart-3: #f43f5e;  /* rose */
    --chart-4: #f59e0b;  /* amber */
    --chart-5: #06b6d4;  /* cyan */
    --chart-6: #8b5cf6;  /* violet */
    --chart-7: #10b981;  /* bright emerald */

    /* --- Sidebar — charcoal with cool tint --- */
    --bk-side-bg:      #111214;
    --bk-side-bg-2:    #18191c;
    --bk-side-text:    #e5e5e5;
    --bk-side-dim:     #78716c;
    --bk-side-hover:   rgba(255, 255, 255, .06);
    --bk-side-active:  rgba(16, 185, 129, .14);
    --bk-side-border:  #2a2b2f;

    /* --- Legacy aliases (so older markup still works) --- */
    --bk-cream:         var(--bk-canvas);
    --bk-cream-soft:    var(--bk-paper-2);
    --bk-paper-warm:    var(--bk-paper-2);
    --bk-brass:         var(--bk-warn);
    --bk-brass-soft:    var(--bk-warn-soft);
    --bk-gold:          var(--bk-warn);
    --bk-gold-soft:     var(--bk-warn-soft);
    --bk-terracotta:    var(--bk-accent);
    --bk-terracotta-soft: var(--bk-accent-soft);
    --bk-plum:          #be185d;
    --bk-plum-soft:     #fce7f3;
    --bk-olive:         var(--bk-indigo);
    --bk-olive-soft:    var(--bk-indigo-soft);

    /* --- Typography --- */
    --ff-display:  'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --ff-body:     'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --ff-mono:     'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

    /* Type scale (H1–H4, body, small, caption) */
    --text-3xl: 1.875rem;  /* 30px — H1 */
    --text-2xl: 1.5rem;    /* 24px — H2 */
    --text-xl:  1.25rem;   /* 20px — H3 */
    --text-lg:  1.125rem;  /* 18px — H4 / lead */
    --text-base: 1rem;     /* 16px — body */
    --text-sm:  .875rem;   /* 14px — small */
    --text-xs:  .75rem;    /* 12px — caption */
    --lh-tight:  1.15;
    --lh-snug:   1.3;
    --lh-normal: 1.5;
    --fw-normal: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;

    /* --- Spacing scale (4px base) --- */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 24px;
    --sp-6: 32px;
    --sp-7: 48px;

    /* --- Elevation --- */
    --shadow-xs:  0 1px 2px rgba(10, 10, 10, .04);
    --shadow-sm:  0 1px 3px rgba(10, 10, 10, .06), 0 1px 2px rgba(10, 10, 10, .04);
    --shadow:     0 2px 8px rgba(10, 10, 10, .06), 0 1px 2px rgba(10, 10, 10, .04);
    --shadow-md:  0 8px 24px rgba(10, 10, 10, .08), 0 2px 4px rgba(10, 10, 10, .04);
    --shadow-lg:  0 20px 40px rgba(10, 10, 10, .12), 0 4px 12px rgba(10, 10, 10, .05);

    /* --- Radius --- */
    --r-xs: 4px;
    --r-sm: 6px;
    --r:    8px;
    --r-lg: 12px;
    --r-xl: 16px;
    --r-2xl: 24px;

    /* --- Motion --- */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.22, 0.61, 0.36, 1);
    --transition-fast: 150ms var(--ease);
    --transition-base: 200ms var(--ease);

    /* --- Focus ring (WCAG-visible) --- */
    --bk-focus-ring: 0 0 0 3px rgba(5, 150, 105, .35);

    /* --- Layout --- */
    --bk-content-max: 1200px;
    --bk-bottomnav-h: 60px;
}

/* ==========================================================================
   Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    background: var(--bk-canvas);
    color: var(--bk-ink);
    font-family: var(--ff-body);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Display type — modern grotesque */
.display, h1, h2, h3, .h1, .h2, .h3 {
    font-family: var(--ff-display);
    font-weight: 600;
    font-variation-settings: "opsz" 32, "wdth" 100;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--bk-ink);
}

h1, .h1 {
    font-size: clamp(2rem, 4.5vw, 3rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    font-variation-settings: "opsz" 96, "wdth" 100;
}
h2, .h2 { font-size: 1.75rem; font-weight: 600; }
h3, .h3 { font-size: 1.375rem; font-weight: 600; }

h4, h5, h6 {
    font-family: var(--ff-body);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--bk-ink);
}

/* Accent emphasis — replace editorial <em> italic with weight + color */
h1 em, h2 em, h3 em,
.h1 em, .h2 em, .h3 em,
.bk-welcome h1 em {
    font-style: normal;
    font-weight: 700;
    color: var(--bk-primary);
}

small, .small { color: var(--bk-muted); }
.text-muted { color: var(--bk-muted) !important; }
.text-faint { color: var(--bk-faint) !important; }

/* Tabular monospace for money */
.money, .num, td.num, th.num {
    font-family: var(--ff-mono);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" on, "zero" on;
    letter-spacing: -0.01em;
}

/* Uppercase tiny label */
.eyebrow {
    font-family: var(--ff-body);
    font-size: .6875rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--bk-muted);
}

/* Links */
a { color: var(--bk-primary); text-decoration: none; transition: color .15s var(--ease); }
a:hover { color: var(--bk-primary-600); }

/* Focus ring */
*:focus { outline: none; }
*:focus-visible {
    outline: 3px solid var(--bk-primary-ring);
    outline-offset: 2px;
    border-radius: var(--r-xs);
}

/* Prevent accidental double-tap zoom on interactive elements */
button, a, [role="button"], input, select, textarea, label {
    touch-action: manipulation;
}

/* Global horizontal-overflow guard */
html, body { overflow-x: clip; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================================================
   Layout shell
   ========================================================================== */

.bk-layout {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */

.bk-sidebar {
    width: 260px;
    background: var(--bk-side-bg);
    color: var(--bk-side-text);
    flex-shrink: 0;
    border-right: 1px solid var(--bk-side-border);
    padding: 1.25rem 0 1.5rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.bk-sidebar::-webkit-scrollbar { width: 6px; }
.bk-sidebar::-webkit-scrollbar-thumb { background: var(--bk-side-border); border-radius: 3px; }

.bk-brand {
    padding: 0 1.5rem 1.25rem;
    display: flex;
    align-items: baseline;
    gap: .5rem;
    border-bottom: 1px solid var(--bk-side-border);
    margin-bottom: 1rem;
}
.bk-brand-mark {
    font-family: var(--ff-display);
    font-size: 1.375rem;
    font-weight: 700;
    font-variation-settings: "opsz" 32, "wdth" 100;
    font-style: normal;
    color: #ffffff;
    letter-spacing: -0.02em;
    line-height: 1;
}
.bk-brand-dot {
    color: var(--bk-primary);
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1;
}
.bk-brand-sub {
    font-size: .625rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--bk-side-dim);
    margin-left: auto;
    padding-bottom: .2rem;
    font-weight: 600;
}

.bk-sidebar nav { flex: 1; padding: 0 .75rem; }

.bk-nav-divider {
    padding: 1.1rem .75rem .4rem;
    font-size: .625rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--bk-side-dim);
    font-weight: 700;
}
.bk-nav-divider:first-of-type { padding-top: .3rem; }

.bk-sidebar a {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .75rem;
    margin: 1px 0;
    border-radius: var(--r);
    color: var(--bk-side-text);
    text-decoration: none;
    font-size: .875rem;
    font-weight: 500;
    transition: background .15s var(--ease), color .15s var(--ease);
    position: relative;
}
.bk-sidebar a:hover {
    background: var(--bk-side-hover);
    color: #ffffff;
}
.bk-sidebar a.active {
    background: var(--bk-side-active);
    color: #ffffff;
    font-weight: 600;
}
.bk-sidebar a.active i {
    color: var(--bk-primary);
}
.bk-sidebar a i {
    font-size: 1.05rem;
    color: var(--bk-side-dim);
    flex-shrink: 0;
    transition: color .15s var(--ease);
}
.bk-sidebar a:hover i { color: #ffffff; }

.bk-sidebar-footer {
    padding: 1rem 1.5rem .25rem;
    border-top: 1px solid var(--bk-side-border);
    margin-top: auto;
    font-size: .7rem;
    color: var(--bk-side-dim);
    letter-spacing: 0.04em;
}

/* --- Main + topbar --- */

.bk-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.bk-topbar {
    background: var(--bk-paper);
    border-bottom: 1px solid var(--bk-line);
    padding: .85rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, .86);
}

.bk-page-title {
    font-family: var(--ff-body);
    font-weight: 600;
    font-size: 1.125rem;
    letter-spacing: -0.015em;
    color: var(--bk-ink);
    margin: 0;
    font-style: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}
.bk-page-breadcrumb { display: none; } /* removed editorial eyebrow */
.bk-page-breadcrumb::after { content: ""; }

/* Search input in topbar */
.bk-search {
    position: relative;
    display: none;
    align-items: center;
    background: var(--bk-paper-2);
    border: 1px solid var(--bk-line);
    border-radius: var(--r);
    padding: 0 .75rem;
    height: 36px;
    width: clamp(220px, 30vw, 360px);
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
.bk-search:focus-within {
    border-color: var(--bk-primary);
    box-shadow: 0 0 0 3px var(--bk-primary-ring);
    background: var(--bk-paper);
}
.bk-search i {
    color: var(--bk-faint);
    font-size: 1rem;
    margin-right: .5rem;
    flex-shrink: 0;
}
.bk-search input {
    border: 0;
    background: transparent;
    outline: none;
    font-family: var(--ff-body);
    font-size: .85rem;
    color: var(--bk-ink);
    flex: 1;
    min-width: 0;
}
.bk-search input::placeholder { color: var(--bk-faint); }
@media (min-width: 992px) { .bk-search { display: flex; } }

.bk-topbar-actions {
    display: flex;
    align-items: center;
    gap: .4rem;
}

.bk-footer {
    border-top: 1px solid var(--bk-border, rgba(15,23,42,.08));
    margin-top: 2rem;
    background: transparent;
}
.bk-footer .text-muted { font-size: .82rem; letter-spacing: .02em; }
.bk-footer strong { color: var(--bk-text-strong, #0f172a); font-weight: 600; }

.bk-content {
    padding: 1.75rem 2rem 3rem;
    flex: 1;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .6rem 1.1rem;
    font-family: var(--ff-body);
    font-size: .875rem;
    font-weight: 600;
    border-radius: var(--r);
    border: 1px solid transparent;
    cursor: pointer;
    letter-spacing: -0.005em;
    position: relative;
    transition: background .15s var(--ease),
                border-color .15s var(--ease),
                color .15s var(--ease),
                box-shadow .2s var(--ease),
                transform .12s var(--ease);
}
.btn-sm {
    padding: .4rem .75rem;
    font-size: .8rem;
    border-radius: var(--r-sm);
}
.btn-lg {
    padding: .85rem 1.5rem;
    font-size: 1rem;
    border-radius: 10px;
}

.btn-primary {
    background: var(--bk-primary);
    color: #fff;
    border-color: var(--bk-primary);
    box-shadow: 0 1px 2px rgba(5, 150, 105, .25),
                0 0 0 1px rgba(5, 150, 105, .15) inset;
}
.btn-primary:hover,
.btn-primary:focus {
    background: var(--bk-primary-600);
    border-color: var(--bk-primary-600);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, .3),
                0 0 0 1px rgba(5, 150, 105, .25) inset;
}
.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(5, 150, 105, .3);
}

.btn-secondary,
.btn-light,
.btn-outline-secondary {
    background: var(--bk-paper);
    color: var(--bk-ink);
    border-color: var(--bk-line-2);
    box-shadow: 0 1px 2px rgba(10, 10, 10, .04);
}
.btn-secondary:hover,
.btn-light:hover,
.btn-outline-secondary:hover {
    border-color: var(--bk-ink);
    background: var(--bk-paper-2);
    color: var(--bk-ink);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(10, 10, 10, .08);
}
.btn-secondary:active,
.btn-light:active,
.btn-outline-secondary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(10, 10, 10, .05);
}

.btn-outline-primary {
    background: transparent;
    color: var(--bk-primary);
    border-color: var(--bk-primary);
}
.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: var(--bk-primary);
    border-color: var(--bk-primary);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(5, 150, 105, .25);
}

.btn-accent {
    background: var(--bk-accent);
    color: #fff;
    border-color: var(--bk-accent);
    box-shadow: 0 1px 2px rgba(244, 63, 94, .3),
                0 0 0 1px rgba(244, 63, 94, .15) inset;
}
.btn-accent:hover,
.btn-accent:focus {
    background: var(--bk-accent-600);
    border-color: var(--bk-accent-600);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(244, 63, 94, .35);
}

.btn-ghost {
    background: transparent;
    color: var(--bk-ink-2);
    border-color: transparent;
    box-shadow: none;
}
.btn-ghost:hover {
    background: var(--bk-paper-2);
    color: var(--bk-ink);
}

.btn-success {
    background: var(--bk-success);
    color: #fff;
    border-color: var(--bk-success);
    box-shadow: 0 1px 2px rgba(16, 185, 129, .25);
}
.btn-success:hover {
    background: #059669;
    border-color: #059669;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, .3);
}

.btn-danger {
    background: var(--bk-danger);
    color: #fff;
    border-color: var(--bk-danger);
    box-shadow: 0 1px 2px rgba(239, 68, 68, .25);
}
.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, .3);
}

.btn-outline-danger {
    color: var(--bk-danger);
    border-color: var(--bk-line-2);
    background: var(--bk-paper);
}
.btn-outline-danger:hover {
    background: var(--bk-danger);
    border-color: var(--bk-danger);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(239, 68, 68, .25);
}

.btn-warning {
    background: var(--bk-warn);
    color: #78350f;
    border-color: var(--bk-warn);
}
.btn-warning:hover {
    background: #d97706;
    border-color: #d97706;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(245, 158, 11, .3);
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--bk-primary-ring),
                0 1px 2px rgba(10, 10, 10, .05);
}

.btn:disabled,
.btn.disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Loading spinner utility */
.btn[data-loading="true"] { color: transparent !important; pointer-events: none; }
.btn[data-loading="true"]::after {
    content: "";
    position: absolute;
    width: 14px; height: 14px;
    top: 50%; left: 50%;
    margin: -7px 0 0 -7px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: bk-spin .7s linear infinite;
    color: var(--bk-ink);
    opacity: .85;
}
.btn-primary[data-loading="true"]::after,
.btn-accent[data-loading="true"]::after,
.btn-danger[data-loading="true"]::after,
.btn-success[data-loading="true"]::after { color: #fff; }
@keyframes bk-spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
    background: var(--bk-paper);
    border: 1px solid var(--bk-line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-xs);
    transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
    position: relative;
}
.card:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--bk-line-2);
    transform: translateY(-1px);
}

.card-body { padding: 1.5rem; }
.card-title {
    font-family: var(--ff-body);
    font-weight: 600;
    letter-spacing: -0.012em;
    margin-bottom: 1rem;
}

.card.bk-card-warm {
    background: var(--bk-paper-2);
    border-color: var(--bk-line);
}

/* Ornate card — emerald top rule on paper-2 */
.card.bk-card-ornate {
    background: linear-gradient(180deg, var(--bk-primary-mist) 0%, var(--bk-paper) 100%);
    border-color: var(--bk-line);
    overflow: hidden;
}
.card.bk-card-ornate::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--bk-primary) 0%, var(--bk-indigo) 60%, transparent 100%);
    opacity: .85;
}

/* Stat card — KPI */
.bk-stat {
    position: relative;
    padding: 1.25rem 1.25rem 1.35rem;
    background: var(--bk-paper);
    border: 1px solid var(--bk-line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.bk-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--bk-line-2);
}
.bk-stat .bk-stat-label {
    font-size: .66rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--bk-muted);
    display: flex;
    align-items: center;
    gap: .35rem;
    position: relative;
    min-width: 0;
}
.bk-stat .bk-stat-label i {
    color: var(--bk-primary);
    font-size: .95rem;
    flex-shrink: 0;
}
.bk-stat .bk-stat-value {
    font-family: var(--ff-display);
    font-weight: 600;
    font-variation-settings: "opsz" 96, "wdth" 90;
    font-size: 1.875rem;
    letter-spacing: -0.025em;
    line-height: 1.1;
    margin-top: .75rem;
    color: var(--bk-ink);
    font-variant-numeric: tabular-nums;
}
.bk-stat .bk-stat-value .rp {
    font-family: var(--ff-mono);
    font-size: .78rem;
    color: var(--bk-muted);
    font-weight: 500;
    margin-right: .35rem;
    letter-spacing: 0;
    vertical-align: .35em;
}
.bk-stat .bk-stat-meta {
    margin-top: .55rem;
    font-size: .78rem;
    color: var(--bk-muted);
}

.bk-stat.bk-stat--income .bk-stat-label i { color: var(--bk-success); }
.bk-stat.bk-stat--spend  .bk-stat-label i { color: var(--bk-danger); }
.bk-stat.bk-stat--net    .bk-stat-label i { color: var(--bk-warn); }

/* Tiny colored accent strip on top of KPI cards */
.bk-stat::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--bk-primary);
    opacity: .9;
}
.bk-stat.bk-stat--income::after { background: var(--bk-success); }
.bk-stat.bk-stat--spend::after  { background: var(--bk-danger); }
.bk-stat.bk-stat--net::after    { background: var(--bk-warn); }
.bk-stat.bk-stat-primary::after { content: none; }

/* Primary hero stat */
.bk-stat.bk-stat-primary {
    background: linear-gradient(160deg, var(--bk-primary-mist) 0%, var(--bk-paper) 60%);
    border-color: var(--bk-primary-soft);
    padding: 1.5rem 1.5rem 1.65rem;
    border-left: 3px solid var(--bk-primary);
}
.bk-stat.bk-stat-primary .bk-stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}
@media (min-width: 1200px) {
    .bk-stat.bk-stat-primary .bk-stat-value { font-size: 2.625rem; }
}

/* Delta pill — for trend indicators */
.bk-delta {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    font-size: .75rem;
    font-weight: 600;
    padding: .15em .55em;
    border-radius: 999px;
    letter-spacing: -0.005em;
}
.bk-delta.up   { background: var(--bk-success-soft); color: var(--bk-success); }
.bk-delta.down { background: var(--bk-danger-soft);  color: var(--bk-danger); }
.bk-delta.flat { background: var(--bk-paper-2);      color: var(--bk-muted); }

/* Section header */
.bk-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 2rem 0 1rem;
    padding-bottom: .6rem;
    border-bottom: 1px solid var(--bk-line);
    position: relative;
    gap: 1rem;
    flex-wrap: wrap;
}
.bk-section-head::before {
    content: "";
    position: absolute;
    left: 0; bottom: -1px;
    width: 32px; height: 2px;
    background: var(--bk-primary);
    border-radius: 2px;
}
.bk-section-head h2,
.bk-section-head h3 {
    margin: 0;
    font-family: var(--ff-body);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--bk-ink);
    font-size: 1.25rem;
}
.bk-section-head h3 em,
.bk-section-head h2 em {
    font-style: normal;
    font-weight: 700;
    color: var(--bk-primary);
}
.bk-section-head .bk-section-meta {
    color: var(--bk-muted);
    font-size: .8rem;
    letter-spacing: 0.01em;
    font-style: normal;
}

/* Hero welcome block */
.bk-welcome {
    margin-bottom: 1.75rem;
    padding: .25rem 0 .5rem;
    position: relative;
}
.bk-welcome::before { content: none; }
.bk-welcome .bk-welcome-eyebrow {
    font-size: .6875rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--bk-muted);
    font-weight: 600;
    margin-bottom: .6rem;
    padding-top: .1rem;
}
.bk-welcome h1 {
    font-family: var(--ff-display);
    font-weight: 600;
    font-variation-settings: "opsz" 96, "wdth" 100;
    font-size: clamp(2rem, 4.5vw, 3rem);
    letter-spacing: -0.03em;
    line-height: 1.08;
    margin: 0;
    color: var(--bk-ink);
}
.bk-welcome h1 em {
    font-style: normal;
    font-weight: 700;
    color: var(--bk-primary);
}
.bk-welcome p {
    font-size: .95rem;
    color: var(--bk-muted);
    margin: .7rem 0 0;
    max-width: 48em;
    line-height: 1.55;
}
.bk-welcome p em {
    font-style: normal;
    color: var(--bk-ink-2);
    font-weight: 600;
}

/* ==========================================================================
   Forms
   ========================================================================== */

.form-label {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--bk-ink-2);
    letter-spacing: -0.005em;
    margin-bottom: .35rem;
}

.form-control, .form-select {
    background: var(--bk-paper);
    border: 1px solid var(--bk-line-2);
    color: var(--bk-ink);
    border-radius: var(--r);
    padding: .625rem .875rem;
    font-family: var(--ff-body);
    font-size: .9rem;
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
.form-control::placeholder { color: var(--bk-faint); }
.form-control:focus, .form-select:focus {
    border-color: var(--bk-primary);
    box-shadow: 0 0 0 3px var(--bk-primary-ring);
    background: var(--bk-paper);
}

.form-control-lg, .form-select-lg {
    padding: .8rem 1rem;
    font-size: 1rem;
    border-radius: 10px;
}

.form-control-sm, .form-select-sm {
    padding: .4rem .7rem;
    font-size: .8125rem;
    border-radius: var(--r-sm);
}

.form-check-input { border-color: var(--bk-line-2); }
.form-check-input:checked {
    background-color: var(--bk-primary);
    border-color: var(--bk-primary);
}
.form-check-input:focus {
    border-color: var(--bk-primary);
    box-shadow: 0 0 0 3px var(--bk-primary-ring);
}

/* Search icon input utility */
.bk-input-group {
    position: relative;
}
.bk-input-group > i {
    position: absolute;
    left: .85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bk-faint);
    font-size: 1rem;
}
.bk-input-group .form-control {
    padding-left: 2.3rem;
}

/* ==========================================================================
   Tables
   ========================================================================== */

.table {
    --bs-table-bg: transparent;
    font-size: .88rem;
    color: var(--bk-ink);
    margin-bottom: 0;
}
.table > :not(caption) > * > * {
    padding: .85rem 1rem;
    border-bottom-color: var(--bk-line);
    background: transparent;
}
.table thead th {
    background: transparent;
    color: var(--bk-muted);
    font-weight: 600;
    font-size: .68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--bk-line-2);
    padding: .7rem 1rem;
}
.table tbody tr { transition: background .12s var(--ease); }
.table tbody tr:hover { background: var(--bk-paper-2); }

.table-sm > :not(caption) > * > * { padding: .6rem .75rem; }

/* ==========================================================================
   Badges & chips
   ========================================================================== */

.badge {
    font-family: var(--ff-body);
    font-weight: 600;
    font-size: .7rem;
    letter-spacing: 0.01em;
    padding: .35em .7em;
    border-radius: 999px;
    border: 1px solid transparent;
}
.badge.bg-success   { background: var(--bk-success-soft) !important; color: var(--bk-primary-700); border-color: rgba(16, 185, 129, .25); }
.badge.bg-danger    { background: var(--bk-danger-soft)  !important; color: #b91c1c;             border-color: rgba(239, 68, 68, .25); }
.badge.bg-warning   { background: var(--bk-warn-soft)    !important; color: #92400e;             border-color: rgba(245, 158, 11, .25); }
.badge.bg-info      { background: var(--bk-info-soft)    !important; color: #1d4ed8;             border-color: rgba(59, 130, 246, .25); }
.badge.bg-secondary { background: var(--bk-paper-2)      !important; color: var(--bk-muted);     border-color: var(--bk-line-2); }
.badge.bg-primary   { background: var(--bk-primary-soft) !important; color: var(--bk-primary-700); border-color: rgba(5, 150, 105, .25); }

/* Category chip */
.bk-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .25em .65em;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 500;
    background: var(--bk-paper-2);
    border: 1px solid var(--bk-line);
    color: var(--bk-ink-2);
}
.bk-chip-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

/* Inline live suggestion pill (e.g. category auto-suggest under description field) */
.bk-suggest-pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-top: .35rem;
    padding: .3rem .65rem;
    border-radius: 999px;
    font-size: .78rem;
    background: var(--bk-primary-mist, #ecfdf5);
    border: 1px solid color-mix(in srgb, var(--bk-primary, #059669) 22%, transparent);
    color: var(--bk-primary-700, #047857);
    animation: bk-suggest-fade-in .18s ease-out;
}
.bk-suggest-pill .bk-suggest-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--bk-primary, #059669);
    flex-shrink: 0;
}
.bk-suggest-pill .bk-suggest-label {
    font-weight: 500;
}
.bk-suggest-pill .bk-suggest-sparkle {
    opacity: .85;
}
.bk-suggest-pill .bk-suggest-btn {
    border: 0;
    background: transparent;
    color: var(--bk-primary-700, #047857);
    font-size: .78rem;
    font-weight: 600;
    padding: 0 .25rem;
    cursor: pointer;
    text-decoration: underline;
}
.bk-suggest-pill .bk-suggest-btn:hover { text-decoration: none; }
.bk-suggest-pill .bk-suggest-close {
    border: 0;
    background: transparent;
    color: var(--bk-ink-3, #6b7280);
    font-size: .9rem;
    line-height: 1;
    padding: 0 .2rem;
    cursor: pointer;
}
.bk-suggest-pill .bk-suggest-close:hover { color: var(--bk-ink-1, #111827); }
@keyframes bk-suggest-fade-in {
    from { opacity: 0; transform: translateY(-2px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Progress bars
   ========================================================================== */

.progress {
    background: var(--bk-paper-2);
    border-radius: 999px;
    height: 8px !important;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(10, 10, 10, .04);
    border: 1px solid var(--bk-line);
}
.progress-bar {
    transition: width .6s var(--ease);
    border-radius: 999px;
    background: var(--bk-primary) !important;
}
.progress-bar.bg-success { background: linear-gradient(90deg, var(--bk-success) 0%, #059669 100%) !important; }
.progress-bar.bg-warning { background: linear-gradient(90deg, var(--bk-warn) 0%, #d97706 100%) !important; }
.progress-bar.bg-danger  { background: linear-gradient(90deg, var(--bk-danger) 0%, #dc2626 100%) !important; }
.progress-bar.bg-info    { background: linear-gradient(90deg, var(--bk-info) 0%, #2563eb 100%) !important; }

/* ==========================================================================
   Dropdowns & modals
   ========================================================================== */

.dropdown-menu {
    background: var(--bk-paper);
    border: 1px solid var(--bk-line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-md);
    padding: .35rem;
    font-size: .875rem;
    /* Lift the menu above sticky topbars and card stacking contexts
       while staying below Bootstrap modal backdrop (z-index 1050).
       Uses 1040 so report exports, filter menus, and card-nested
       dropdowns stay visible and don't clip or sink behind siblings. */
    z-index: 1040;
}
/* A .dropdown inside a .card must not be clipped by the card's overflow.
   Bootstrap uses overflow:hidden on some card variants — opt-out here so
   the floated popper stays fully visible. */
.card .dropdown,
.card .dropdown-menu,
.bk-dd-wrap { overflow: visible; }
/* Utility to force a visible overflow on arbitrary dropdown wrappers. */
.bk-dd-wrap .dropdown-menu { z-index: 1040; }
.dropdown-item {
    padding: .5rem .75rem;
    border-radius: var(--r-sm);
    color: var(--bk-ink-2);
    transition: background .12s var(--ease), color .12s var(--ease);
}
.dropdown-item:hover {
    background: var(--bk-paper-2);
    color: var(--bk-ink);
}
.dropdown-item.text-danger { color: var(--bk-danger); }
.dropdown-item.text-danger:hover { background: var(--bk-danger-soft); color: var(--bk-danger); }
.dropdown-divider { border-color: var(--bk-line); margin: .25rem 0; }

.modal-content {
    background: var(--bk-paper);
    border: 1px solid var(--bk-line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
}
.modal-header {
    border-bottom: 1px solid var(--bk-line);
    padding: 1.1rem 1.5rem;
}
.modal-title {
    font-family: var(--ff-body);
    font-weight: 600;
    letter-spacing: -0.015em;
    font-size: 1.125rem;
    color: var(--bk-ink);
}
.modal-body { padding: 1.5rem; }
.modal-footer {
    border-top: 1px solid var(--bk-line);
    padding: 1rem 1.5rem;
    gap: .5rem;
}
.btn-close { opacity: .6; }
.btn-close:hover { opacity: 1; }

/* ==========================================================================
   Alerts
   ========================================================================== */

.alert {
    border-radius: var(--r-lg);
    padding: .85rem 1.1rem;
    font-size: .88rem;
    border-width: 1px;
    border-style: solid;
}
.alert-info    { background: var(--bk-info-soft);    color: #1d4ed8;         border-color: rgba(59, 130, 246, .25); }
.alert-warning { background: var(--bk-warn-soft);    color: #92400e;         border-color: rgba(245, 158, 11, .25); }
.alert-danger  { background: var(--bk-danger-soft);  color: #b91c1c;         border-color: rgba(239, 68, 68, .25); }
.alert-success { background: var(--bk-success-soft); color: var(--bk-primary-700); border-color: rgba(16, 185, 129, .25); }

/* ==========================================================================
   List group
   ========================================================================== */

.list-group-flush > .list-group-item {
    background: transparent;
    border-color: var(--bk-line);
    padding: .85rem 0;
    color: var(--bk-ink);
}
.list-group-flush > .list-group-item:last-child { border-bottom: none; }

/* ==========================================================================
   Utility: transaction list
   ========================================================================== */

.bk-txn-list { list-style: none; padding: 0; margin: 0; }
.bk-txn-item {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    gap: .9rem;
    align-items: center;
    padding: .85rem 0;
    border-bottom: 1px solid var(--bk-line);
}
.bk-txn-item:last-child { border-bottom: none; }
.bk-txn-icon {
    width: 40px; height: 40px;
    border-radius: var(--r);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    background: var(--bk-paper-2);
    color: var(--bk-ink-2);
    flex-shrink: 0;
}
.bk-txn-meta { min-width: 0; }
.bk-txn-title {
    font-weight: 600;
    color: var(--bk-ink);
    margin: 0;
    font-size: .92rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bk-txn-sub {
    font-size: .75rem;
    color: var(--bk-muted);
    margin-top: .15rem;
    display: flex;
    gap: .4rem;
    align-items: center;
}
.bk-txn-amount {
    font-family: var(--ff-mono);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: .95rem;
}
.bk-txn-amount.neg { color: var(--bk-danger); }
.bk-txn-amount.pos { color: var(--bk-success); }
.bk-txn-amount.mov { color: var(--bk-info); }

/* Account row */
.bk-acct-row {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: .85rem;
    align-items: center;
    padding: .8rem 0;
    border-bottom: 1px solid var(--bk-line);
}
.bk-acct-row:last-child { border-bottom: none; }
.bk-acct-icon {
    width: 36px; height: 36px;
    border-radius: var(--r);
    background: var(--bk-primary-mist);
    color: var(--bk-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
}
.bk-acct-nama { font-weight: 600; color: var(--bk-ink); }
.bk-acct-type { font-size: .7rem; color: var(--bk-muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.bk-acct-balance {
    font-family: var(--ff-mono);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--bk-ink);
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes bk-fade-up {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* fill:backwards (not both) so the transform is released after the animation —
   a lingering filled transform creates a containing block that breaks fixed
   positioning (Bootstrap modals) nested inside these elements. */
.bk-animate { animation: bk-fade-up .4s var(--ease) backwards; }
.bk-animate-1 { animation: bk-fade-up .4s var(--ease) .05s backwards; }
.bk-animate-2 { animation: bk-fade-up .4s var(--ease) .1s backwards; }
.bk-animate-3 { animation: bk-fade-up .4s var(--ease) .15s backwards; }
.bk-animate-4 { animation: bk-fade-up .4s var(--ease) .2s backwards; }

/* ==========================================================================
   Responsive
   ========================================================================== */

.bk-hamburger { display: none; }

@media (max-width: 900px) {
    .bk-sidebar {
        position: fixed; top: 0; bottom: 0; left: -300px;
        width: 280px; z-index: 1050;
        transition: left .25s var(--ease);
        display: flex;
    }
    .bk-sidebar.bk-sidebar--open { left: 0; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
    .bk-sidebar-backdrop {
        position: fixed; inset: 0; background: rgba(10, 10, 10, .5);
        z-index: 1040; opacity: 0; pointer-events: none;
        transition: opacity .2s var(--ease);
    }
    .bk-sidebar-backdrop.bk-active { opacity: 1; pointer-events: auto; }

    .bk-main { margin-left: 0 !important; width: 100% !important; }
    .bk-content { padding: 1.25rem; }
    .bk-topbar { padding: .75rem 1rem; }
    .bk-welcome h1 { font-size: 1.75rem; }
    .bk-stat .bk-stat-value { font-size: 1.5rem; }

    .bk-hamburger { display: inline-flex; align-items: center; justify-content: center; }
    .bk-page-title { font-size: 1rem; }
}

@media (max-width: 480px) {
    .bk-page-title { font-size: .95rem; }
    .bk-content { padding: .9rem; }
}

@media (max-width: 768px) {
    .card-body > .table:not(.table-fit) { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ==========================================================================
   Login page
   ========================================================================== */

.bk-login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    background: var(--bk-canvas);
    position: relative;
    z-index: 1;
}
@media (max-width: 900px) {
    .bk-login-shell { grid-template-columns: 1fr; }
    .bk-login-aside { display: none; }
}

.bk-login-aside {
    background:
        radial-gradient(ellipse at 20% 30%, rgba(5, 150, 105, .28) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 80%, rgba(79, 70, 229, .16) 0%, transparent 50%),
        linear-gradient(160deg, var(--bk-ink) 0%, var(--bk-ink-2) 100%);
    color: var(--bk-side-text);
    padding: 3.5rem 3.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}
.bk-login-aside::before {
    /* subtle grid pattern */
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    mask-image: radial-gradient(ellipse at center, #000 40%, transparent 90%);
}
.bk-login-aside::after { content: none; }

.bk-login-brand {
    font-family: var(--ff-display);
    font-size: 1.625rem;
    font-style: normal;
    font-weight: 700;
    font-variation-settings: "opsz" 32, "wdth" 100;
    color: #ffffff;
    letter-spacing: -0.02em;
    margin-bottom: .35rem;
    position: relative;
    display: inline-flex;
    align-items: baseline;
}
.bk-login-brand::after {
    content: "·";
    color: var(--bk-primary);
    margin-left: .1em;
}
.bk-login-tagline {
    font-size: .6875rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--bk-side-dim);
    font-weight: 600;
    position: relative;
}
.bk-login-lead {
    font-family: var(--ff-display);
    font-size: clamp(2rem, 3.5vw, 2.875rem);
    line-height: 1.08;
    font-weight: 700;
    font-variation-settings: "opsz" 96, "wdth" 100;
    letter-spacing: -0.03em;
    color: #ffffff;
    margin: auto 0;
    position: relative;
    max-width: 14ch;
}
.bk-login-lead em {
    font-style: normal;
    color: var(--bk-primary);
    font-weight: 700;
}
.bk-login-footnote {
    font-size: .75rem;
    color: var(--bk-side-dim);
    letter-spacing: 0.02em;
    position: relative;
}

.bk-login-form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    background: var(--bk-paper);
}
.bk-login-card {
    width: 100%;
    max-width: 400px;
}
.bk-login-card h2 {
    font-family: var(--ff-body);
    font-weight: 700;
    font-size: 1.625rem;
    letter-spacing: -0.02em;
    margin-bottom: .25rem;
    color: var(--bk-ink);
}
.bk-login-card h2 em {
    font-style: normal;
    font-weight: 700;
    color: var(--bk-primary);
}
.bk-login-card p.lead {
    color: var(--bk-muted);
    font-size: .9rem;
    margin-bottom: 1.75rem;
}
.bk-login-card .form-control {
    font-size: .95rem;
    padding: .8rem 1rem;
    border-radius: var(--r);
}
.bk-login-card .btn-primary {
    width: 100%;
    padding: .85rem 1rem;
    font-size: .95rem;
    border-radius: var(--r);
}

/* ==========================================================================
   Empty state
   ========================================================================== */

.bk-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--bk-muted);
    position: relative;
}
.bk-empty-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bk-primary-mist);
    border: 1px solid var(--bk-primary-soft);
    color: var(--bk-primary);
    margin-bottom: 1rem;
    position: relative;
}
.bk-empty-icon::after { content: none; }
.bk-empty-icon i { font-size: 1.5rem; }
.bk-empty-title {
    font-family: var(--ff-body);
    font-weight: 700;
    font-size: 1.0625rem;
    color: var(--bk-ink);
    margin: 0 0 .35rem;
    letter-spacing: -0.015em;
    font-style: normal;
}
.bk-empty-title em {
    color: var(--bk-primary);
    font-style: normal;
    font-weight: 700;
}
.bk-empty-text {
    font-size: .9rem;
    color: var(--bk-muted);
    max-width: 32em;
    margin: 0 auto 1.1rem;
    line-height: 1.55;
}
.bk-empty-text a {
    color: var(--bk-primary);
    font-weight: 600;
    border-bottom: 1px solid var(--bk-primary-soft);
}
.bk-empty-text a:hover { color: var(--bk-primary-600); border-color: var(--bk-primary-600); }
.bk-empty-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    justify-content: center;
}
.bk-empty--sm { padding: 1.25rem 1rem; }
.bk-empty--sm .bk-empty-icon { width: 44px; height: 44px; }
.bk-empty--sm .bk-empty-icon i { font-size: 1.15rem; }
.bk-empty--sm .bk-empty-title { font-size: .95rem; }

/* ==========================================================================
   Filter bar
   ========================================================================== */
.bk-filter-bar {
    background: var(--bk-paper-2);
    border: 1px solid var(--bk-line);
    border-radius: var(--r-lg);
    padding: 1rem 1.1rem;
    margin-bottom: 1.1rem;
    box-shadow: var(--shadow-xs);
    position: relative;
}
.bk-filter-bar::before { content: none; }
.bk-filter-bar .bk-filter-label {
    font-size: .625rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bk-muted);
    font-weight: 700;
    margin-bottom: .35rem;
    display: block;
}
.bk-filter-bar .form-control,
.bk-filter-bar .form-select {
    font-size: .85rem;
    background: var(--bk-paper);
}

/* ==========================================================================
   Tab pills
   ========================================================================== */
.bk-tab-pills {
    display: inline-flex;
    gap: .25rem;
    padding: .25rem;
    background: var(--bk-paper-2);
    border-radius: var(--r);
    border: 1px solid var(--bk-line);
    list-style: none;
    margin: 0 0 1.25rem;
}
.bk-tab-pills li { margin: 0; }
.bk-tab-pills button,
.bk-tab-pills .nav-link {
    background: transparent;
    border: 0;
    border-radius: var(--r-sm);
    padding: .42rem 1rem;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--bk-muted);
    letter-spacing: -0.005em;
    transition: background .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
.bk-tab-pills button:hover,
.bk-tab-pills .nav-link:hover {
    color: var(--bk-ink);
    background: var(--bk-paper);
}
.bk-tab-pills button.active,
.bk-tab-pills .nav-link.active {
    background: var(--bk-paper);
    color: var(--bk-primary);
    box-shadow: var(--shadow-xs);
}

/* Polish Bootstrap nav-tabs — modern underline */
.nav-tabs {
    border-bottom: 1px solid var(--bk-line);
    gap: .25rem;
    margin-bottom: 1.25rem;
}
.nav-tabs .nav-link {
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--bk-muted);
    font-weight: 600;
    font-size: .875rem;
    letter-spacing: -0.005em;
    padding: .7rem 1rem;
    border-radius: 0;
    background: transparent;
    margin-bottom: -1px;
    transition: color .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease);
}
.nav-tabs .nav-link:hover {
    color: var(--bk-ink);
    background: transparent;
}
.nav-tabs .nav-link.active {
    color: var(--bk-primary);
    border-bottom-color: var(--bk-primary);
    background: transparent;
    font-weight: 700;
}
.nav-tabs .nav-link.active::after { content: none; }

/* ==========================================================================
   Chat polish
   ========================================================================== */
.bk-chat-avatar {
    flex-shrink: 0;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--bk-primary-mist);
    color: var(--bk-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    border: 1px solid var(--bk-primary-soft);
}

/* ==========================================================================
   Decorative leading bullet (card section titles)
   ========================================================================== */
.bk-ornament-title {
    font-family: var(--ff-body);
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -0.012em;
    color: var(--bk-ink);
    margin: 0;
    display: flex;
    align-items: center;
    gap: .55rem;
}
.bk-ornament-title::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--bk-primary);
    box-shadow: 0 0 0 3px var(--bk-primary-mist);
    flex-shrink: 0;
}

/* Chart header row */
.bk-chart-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1rem;
}
.bk-chart-head .bk-eyebrow-title { min-width: 0; }

/* Top-right dropdowns on cards (kebab menu) */
.bk-card-menu {
    background: transparent;
    border: 0;
    color: var(--bk-faint);
    padding: .2rem .4rem;
    border-radius: var(--r-sm);
    font-size: 1.1rem;
    line-height: 1;
    transition: color .15s var(--ease), background .15s var(--ease);
}
.bk-card-menu:hover {
    color: var(--bk-ink);
    background: var(--bk-paper-2);
}

/* ==========================================================================
   Accent utilities
   ========================================================================== */
.text-brass   { color: var(--bk-warn) !important; }
.text-plum    { color: var(--bk-plum) !important; }
.text-primary { color: var(--bk-primary) !important; }
.text-accent  { color: var(--bk-accent) !important; }
.text-indigo  { color: var(--bk-indigo) !important; }
.bg-brass-soft     { background: var(--bk-warn-soft) !important; }
.bg-primary-soft   { background: var(--bk-primary-soft) !important; }
.bg-paper-warm     { background: var(--bk-paper-2) !important; }
.bg-accent-soft    { background: var(--bk-accent-soft) !important; }
.bg-indigo-soft    { background: var(--bk-indigo-soft) !important; }
.border-brass-soft { border-color: var(--bk-warn-soft) !important; }

/* ==========================================================================
   Category tile
   ========================================================================== */
.bk-cat-tile {
    position: relative;
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: 1rem 1.1rem;
    background: var(--bk-paper);
    border: 1px solid var(--bk-line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-xs);
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
    min-height: 74px;
    overflow: hidden;
}
.bk-cat-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: var(--bk-line-2);
}
.bk-cat-tile::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--cat-color, var(--bk-primary));
    opacity: .9;
}
.bk-cat-tile-icon {
    flex-shrink: 0;
    width: 42px; height: 42px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--cat-color, var(--bk-primary)) 12%, var(--bk-paper));
    color: var(--cat-color, var(--bk-primary));
    font-size: 1.15rem;
    border: 1px solid color-mix(in srgb, var(--cat-color, var(--bk-primary)) 22%, var(--bk-line));
}
.bk-cat-tile-name {
    font-weight: 600;
    color: var(--bk-ink);
    font-size: .95rem;
    line-height: 1.1;
}
.bk-cat-tile-meta {
    font-size: .7rem;
    color: var(--bk-muted);
    letter-spacing: 0.06em;
    margin-top: .2rem;
    text-transform: uppercase;
    font-weight: 600;
}
.bk-cat-tile .bk-card-menu { margin-left: auto; }

/* ==========================================================================
   Eyebrow header pair
   ========================================================================== */
.bk-eyebrow-title .eyebrow,
.bk-eyebrow-title .bk-welcome-eyebrow { margin-bottom: .15rem; }
.bk-eyebrow-title h2,
.bk-eyebrow-title h3,
.bk-eyebrow-title h4,
.bk-eyebrow-title h5 {
    font-family: var(--ff-body);
    font-weight: 600;
    letter-spacing: -0.015em;
    margin: 0;
    color: var(--bk-ink);
}

/* ==========================================================================
   Chip variants
   ========================================================================== */
.bk-chip--primary { background: var(--bk-primary-mist); color: var(--bk-primary); border-color: var(--bk-primary-soft); }
.bk-chip--brass   { background: var(--bk-warn-soft);    color: #92400e;          border-color: color-mix(in srgb, var(--bk-warn) 25%, transparent); }
.bk-chip--success { background: var(--bk-success-soft); color: var(--bk-primary-700); border-color: color-mix(in srgb, var(--bk-success) 25%, transparent); }
.bk-chip--danger  { background: var(--bk-danger-soft);  color: #b91c1c;          border-color: color-mix(in srgb, var(--bk-danger) 25%, transparent); }
.bk-chip--plum    { background: var(--bk-plum-soft);    color: var(--bk-plum);   border-color: color-mix(in srgb, var(--bk-plum) 25%, transparent); }
.bk-chip--indigo  { background: var(--bk-indigo-soft);  color: var(--bk-indigo); border-color: color-mix(in srgb, var(--bk-indigo) 25%, transparent); }

/* ==========================================================================
   Stat strip (compact secondary stats)
   ========================================================================== */
.bk-stat-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0;
    background: var(--bk-paper);
    border: 1px solid var(--bk-line);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    margin-bottom: 1.25rem;
}
.bk-stat-strip .bk-stat-strip-item {
    padding: 1rem 1.15rem;
    border-right: 1px solid var(--bk-line);
    background: var(--bk-paper);
}
.bk-stat-strip .bk-stat-strip-item:last-child { border-right: 0; }
.bk-stat-strip .bk-stat-strip-label {
    font-size: .625rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--bk-muted);
    font-weight: 700;
}
.bk-stat-strip .bk-stat-strip-value {
    font-family: var(--ff-display);
    font-variation-settings: "opsz" 32, "wdth" 95;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-top: .25rem;
    color: var(--bk-ink);
    font-variant-numeric: tabular-nums;
}
.bk-stat-strip .bk-stat-strip-value .rp {
    font-family: var(--ff-mono);
    font-size: .72rem;
    color: var(--bk-muted);
    vertical-align: .2em;
    margin-right: .25rem;
    font-weight: 500;
}
@media (max-width: 600px) {
    .bk-stat-strip .bk-stat-strip-item { border-right: 0; border-bottom: 1px solid var(--bk-line); }
    .bk-stat-strip .bk-stat-strip-item:last-child { border-bottom: 0; }
}

/* =========================================================================
   Dashboard rework: period toggle, financial tiles, progress widgets
   ========================================================================= */

.bk-period-bar {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}
.bk-period-pills {
    display: inline-flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    background: var(--bk-paper-2);
    border: 1px solid var(--bk-line);
    border-radius: 999px;
    padding: 4px;
    gap: 2px;
    scrollbar-width: none;
}
.bk-period-pills::-webkit-scrollbar { display: none; }
.bk-period-pill {
    border: 0;
    background: transparent;
    padding: .4rem .9rem;
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 500;
    color: var(--bk-muted);
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}
.bk-period-pill:hover { color: var(--bk-ink, #1f1f1f); background: rgba(0,0,0,.03); }
.bk-period-pill.is-active {
    background: var(--bk-paper);
    color: var(--bk-ink, #1f1f1f);
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    font-weight: 600;
}

/* Financial tiles: net worth, portfolio, credit card */
.bk-tile {
    background: var(--bk-paper);
    border: 1px solid var(--bk-line);
    border-radius: 16px;
    padding: 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 128px;
}
.bk-tile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .5rem;
    color: var(--bk-muted);
}
.bk-tile-header i { font-size: 1.15rem; opacity: .55; }
.bk-tile-value {
    font-family: var(--ff-display);
    font-variation-settings: 'opsz' 32, 'wdth' 95;
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.05;
}
.bk-tile-value .rp {
    font-family: var(--ff-mono);
    font-size: .85rem;
    color: var(--bk-muted);
    vertical-align: .45em;
    margin-right: .3rem;
    font-weight: 500;
}
.bk-tile-breakdown {
    margin-top: .55rem;
    font-size: .82rem;
    color: var(--bk-muted);
    line-height: 1.45;
}
.bk-tile-link {
    position: absolute;
    right: 1rem;
    bottom: .75rem;
    font-size: .8rem;
    text-decoration: none;
    color: var(--bk-ink, #1f1f1f);
    opacity: .65;
}
.bk-tile-link:hover { opacity: 1; }
.bk-tile--networth { border-left: 3px solid var(--chart-1, #059669); }
.bk-tile--portfolio { border-left: 3px solid var(--chart-2, #4f46e5); }
.bk-tile--cc { border-left: 3px solid var(--chart-3, #f43f5e); }
.bk-tile--pension { border-left: 3px solid var(--chart-4, #f59e0b); }
.bk-tile--empty {
    justify-content: space-between;
    background: var(--bk-paper-2);
    border-style: dashed;
}
.bk-tile-empty-text {
    color: var(--bk-muted);
    font-size: .9rem;
    margin-top: auto;
}

/* Progress rows for budget + goal widgets */
.bk-progress-row {
    padding: .55rem 0;
    border-bottom: 1px solid var(--bk-line);
}
.bk-progress-row:last-child { border-bottom: 0; }
.bk-bar {
    margin-top: 6px;
    height: 6px;
    border-radius: 3px;
    background: var(--bk-paper-2);
    overflow: hidden;
}
.bk-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width .3s ease;
}
.bk-bar--ok     .bk-bar-fill { background: var(--bk-success, #059669); }
.bk-bar--warn   .bk-bar-fill { background: var(--bk-warn, #f59e0b); }
.bk-bar--danger .bk-bar-fill { background: var(--bk-danger, #dc2626); }

.bk-bud-coverage {
    font-size: .72rem;
    color: var(--bk-muted);
    font-style: italic;
    max-width: 60%;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: help;
}

/* Chart.js wrapper — prevents the "canvas grows by itself" issue that
   happens with maintainAspectRatio:false inside auto-sized containers. */
.bk-chart-wrap         { position: relative; height: 260px; }
.bk-chart-wrap.tall    { height: 320px; }
.bk-chart-wrap.short   { height: 180px; }
.bk-chart-wrap.tiny    { height: 120px; }
.bk-chart-wrap > canvas {
    position: absolute !important;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100% !important;
    height: 100% !important;
}

/* Bill rows */
.bk-bill-row {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .6rem 0;
    border-bottom: 1px solid var(--bk-line);
}
.bk-bill-row:last-child { border-bottom: 0; }
.bk-bill-icon {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: var(--bk-info-soft);
    color: var(--bk-info, #2563eb);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.bk-bill-row.is-urgent .bk-bill-icon {
    background: var(--bk-danger-soft);
    color: var(--bk-danger, #dc2626);
}
.bk-bill-nama {
    font-size: .9rem;
    font-weight: 500;
    line-height: 1.25;
}
.bk-bill-meta {
    font-size: .78rem;
    color: var(--bk-muted);
}
.bk-bill-amount {
    font-family: var(--ff-mono);
    font-size: .88rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Mobile polish */
@media (max-width: 600px) {
    .bk-tile-value { font-size: 1.45rem; }
    .bk-tile { min-height: 110px; padding: .9rem 1rem; }
    #cashWrap { height: 200px !important; }
    .bk-period-pill { padding: .35rem .75rem; font-size: .8rem; }
}

/* ==========================================================================
   Comprehensive mobile polish — applies to all modules at small viewports
   ========================================================================== */

/* Tablets and smaller — main content breathes, cards consolidate */
@media (max-width: 900px) {
    /* Every Bootstrap table inside a card-body becomes horizontally scrollable.
       Without this, long rows either break the viewport or wrap awkwardly. */
    .card-body > .table,
    .card-body > .dataTables_wrapper,
    .card-body > .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .card-body .dataTables_wrapper .dataTables_filter input,
    .card-body .dataTables_wrapper .dataTables_length select {
        min-width: 140px;
    }
    /* DataTables top bar wraps neatly instead of stretching */
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        float: none !important;
        text-align: left !important;
        margin: .25rem 0;
    }
    /* Card actions + top-of-page headers stack full-width so buttons are tappable */
    .card-body .d-flex.justify-content-between.align-items-center,
    .bk-content > .d-flex.justify-content-between.align-items-center,
    .bk-content > .d-flex.justify-content-between.align-items-baseline {
        flex-wrap: wrap;
        gap: .5rem;
    }
    /* btn-group with multiple actions — break into individual buttons that wrap */
    .bk-content > .d-flex .btn-group {
        display: flex;
        flex-wrap: wrap;
        gap: .35rem;
    }
    .bk-content > .d-flex .btn-group .btn {
        border-radius: var(--r, 10px) !important;
        flex: 0 1 auto;
    }
    /* Prevent narrow inputs from squashing */
    .form-select, .form-control { min-height: 38px; font-size: .95rem; }
    /* Larger touch targets on small buttons */
    .btn-sm { min-height: 34px; }
    .btn { min-height: 38px; }
    /* Modal full-width on mobile — no wasted margin */
    .modal-dialog { margin: 0; max-width: 100% !important; height: 100%; }
    .modal-dialog .modal-content { border-radius: 0; min-height: 100vh; }
    .modal-dialog .modal-body { padding: 1rem; }
    .modal-dialog .modal-header { padding: .75rem 1rem; }
    /* Sticky close button inside long modals */
    .modal-header {
        position: sticky;
        top: 0;
        background: var(--bk-paper);
        z-index: 10;
        border-bottom: 1px solid var(--bk-line);
    }
    /* Common "actions right of title" header pattern — stack on mobile */
    .bk-eyebrow-title + .btn,
    .bk-eyebrow-title + .d-flex,
    .bk-section-head .bk-section-meta {
        margin-top: .35rem;
    }
    /* Slightly shorter cards to reduce vertical scroll */
    .card-body { padding: 1rem; }
    /* Summary rows (multi-KPI horizontal) wrap instead of overflowing */
    .bk-stat-strip { flex-wrap: wrap; }
    /* Chart wrappers shrink */
    .bk-chart-wrap         { height: 220px; }
    .bk-chart-wrap.tall    { height: 260px; }
    .bk-chart-wrap.short   { height: 160px; }
}

/* Phones — compact typography, single-column KPI grids */
@media (max-width: 600px) {
    /* Welcome header */
    .bk-welcome h1 { font-size: 1.55rem; line-height: 1.2; }
    .bk-welcome p  { font-size: .9rem; }
    /* KPI stat card value — reduce to avoid overflow */
    .bk-stat-value { font-size: 1.6rem !important; letter-spacing: -0.01em; }
    .bk-stat-label { font-size: .72rem; }
    .bk-stat-meta  { font-size: .75rem; }
    .bk-stat { padding: .9rem 1rem; }
    /* Section headers tighten */
    .bk-section-head h3 { font-size: 1.05rem; }
    .bk-section-head .bk-section-meta { font-size: .75rem; }
    /* Eyebrow titles + h5 tighten */
    .bk-eyebrow-title h5 { font-size: 1rem; }
    .eyebrow { font-size: .68rem; }
    /* Form rows stack fully (Bootstrap col-6 too narrow at <360px) */
    .modal-body .row > [class*="col-"] { width: 100%; flex: 0 0 100%; max-width: 100%; }
    /* Form labels a hair smaller to fit more */
    .form-label { font-size: .85rem; margin-bottom: .25rem; }
    /* Detail table rows less cramped */
    .table-sm td, .table-sm th { padding: .45rem .5rem; }
    /* Tablets: period toggle already scrolls horizontally */
    /* Hide the desktop search box — focus on the hamburger + title */
    .bk-topbar .bk-search { display: none !important; }
    /* Workspace picker + bell + user — tighter spacing */
    .bk-topbar-actions { gap: .35rem; }
    .bk-topbar-actions .btn { padding: .35rem .55rem; }
    .bk-topbar-actions .dropdown-toggle span { display: none; }
    /* Charts inside modals stay readable */
    .modal .bk-chart-wrap { height: 180px; }
    /* Account & txn rows — reduce side padding */
    .bk-acct-row, .bk-txn-item { padding-left: 0; padding-right: 0; }
    /* Budget/bill progress rows keep nama short */
    .bk-bud-coverage { font-size: .7rem; }
    /* Bill row icon smaller */
    .bk-bill-icon { width: 30px; height: 30px; }
}

/* Ultra-narrow (<380px) — iPhone SE 1st gen, older Android */
@media (max-width: 379px) {
    .bk-welcome h1 { font-size: 1.35rem; }
    .bk-stat-value { font-size: 1.4rem !important; }
    .bk-tile-value { font-size: 1.25rem; }
    /* KPI 4-cards stack to 2 cols instead of 2x2 becoming weird */
    .row .col-md-4.col-6 { width: 100%; flex: 0 0 100%; max-width: 100%; }
    /* Reduce content padding */
    .bk-content { padding: .6rem; }
    .card-body { padding: .8rem; }
}

/* ==========================================================================
   Global foundation additions — breadcrumbs, bottom nav, collapsed sidebar,
   page transitions, skeletons, empty states, form fields
   ========================================================================== */

/* --- Breadcrumbs (topbar, non-dashboard pages) --- */
.bk-breadcrumbs {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: var(--text-xs);
    color: var(--bk-muted);
    line-height: 1.2;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bk-breadcrumbs a { color: var(--bk-muted); }
.bk-breadcrumbs a:hover { color: var(--bk-primary); }
.bk-breadcrumb-sep { color: var(--bk-faint); }
.bk-breadcrumbs [aria-current="page"] { color: var(--bk-ink-3); font-weight: 500; }
@media (max-width: 600px) { .bk-breadcrumbs { display: none; } }

/* --- Bottom navigation (mobile ≤900px) --- */
.bk-bottomnav {
    display: none;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 1030;
    background: var(--bk-paper);
    border-top: 1px solid var(--bk-line);
    padding-bottom: env(safe-area-inset-bottom, 0);
    height: calc(var(--bk-bottomnav-h) + env(safe-area-inset-bottom, 0));
    box-shadow: 0 -4px 16px rgba(10, 10, 10, .06);
}
.bk-bottomnav a,
.bk-bottomnav button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: var(--bk-bottomnav-h);
    min-width: 44px;
    background: none;
    border: 0;
    font-family: var(--ff-body);
    font-size: .625rem;
    font-weight: 600;
    color: var(--bk-muted);
    text-decoration: none;
    cursor: pointer;
    transition: color var(--transition-fast);
}
.bk-bottomnav a i,
.bk-bottomnav button i { font-size: 1.3rem; line-height: 1; }
.bk-bottomnav a.active,
.bk-bottomnav button.active { color: var(--bk-primary); }
.bk-bottomnav a:active,
.bk-bottomnav button:active { color: var(--bk-primary-600); }

@media (max-width: 900px) {
    .bk-bottomnav { display: flex; }
    .bk-content {
        padding-bottom: calc(var(--bk-bottomnav-h) + env(safe-area-inset-bottom, 0) + var(--sp-5));
    }
    .bk-footer { padding-bottom: var(--bk-bottomnav-h); }
}

/* --- Collapsed sidebar (desktop) --- */
@media (min-width: 901px) {
    .bk-sidebar { transition: width var(--transition-base); }
    .bk-sidebar--collapsed { width: 76px; }
    .bk-sidebar--collapsed .bk-brand { padding: 0 .75rem 1.25rem; justify-content: center; }
    .bk-sidebar--collapsed .bk-brand-sub { display: none; }
    .bk-sidebar--collapsed .bk-brand-mark { font-size: 1.1rem; }
    .bk-sidebar--collapsed .bk-collapse-toggle i { transform: rotate(180deg); }
    .bk-sidebar--collapsed nav { padding: 0 .5rem; }
    .bk-sidebar--collapsed nav a { justify-content: center; padding: .6rem .5rem; }
    .bk-sidebar--collapsed nav a span { display: none; }
    .bk-sidebar--collapsed .bk-nav-divider {
        font-size: 0;
        padding: .9rem .5rem .3rem;
        border-top: 1px solid var(--bk-side-border);
        margin: .4rem .25rem 0;
    }
    .bk-sidebar--collapsed .bk-sidebar-footer { visibility: hidden; padding: .75rem; }
}

.bk-collapse-toggle {
    display: none;
    margin-left: auto;
    background: none;
    border: 0;
    color: var(--bk-side-dim);
    font-size: 1.05rem;
    padding: .35rem;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: color var(--transition-fast), background var(--transition-fast);
}
.bk-collapse-toggle:hover { color: #fff; background: var(--bk-side-hover); }
@media (min-width: 901px) { .bk-collapse-toggle { display: inline-flex; } }

/* --- Page transition (subtle, ≤200ms) ---
   Opacity only: animating transform with fill:both would leave a lingering
   stacking context / fixed-position containing block on .bk-content, which
   traps Bootstrap modals under the .modal-backdrop and locks the page. */
@keyframes bk-page-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.bk-content { animation: bk-page-in .18s var(--ease) backwards; }

/* --- Skeleton loading --- */
.bk-skeleton-stack { display: flex; flex-direction: column; gap: var(--sp-2); }
.bk-skeleton {
    border-radius: var(--r-sm);
    background: linear-gradient(90deg,
        var(--bk-line) 25%, var(--bk-paper-2) 50%, var(--bk-line) 75%);
    background-size: 200% 100%;
    animation: bk-shimmer 1.4s infinite linear;
}
@keyframes bk-shimmer {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}

/* --- Empty state (standardized) --- */
.bk-empty-state {
    text-align: center;
    padding: var(--sp-7) var(--sp-5);
    color: var(--bk-muted);
}
.bk-empty-state .bk-empty-icon {
    width: 64px; height: 64px;
    margin: 0 auto var(--sp-4);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--bk-primary-mist);
    color: var(--bk-primary);
    font-size: 1.75rem;
}
.bk-empty-state .bk-empty-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--bk-ink-2);
    margin-bottom: var(--sp-1);
}
.bk-empty-state .bk-empty-text { font-size: var(--text-sm); margin-bottom: var(--sp-4); }

/* --- Button loading & disabled states --- */
.btn.is-loading {
    pointer-events: none;
    opacity: .75;
}
.btn.is-loading::before {
    content: "";
    width: 1em; height: 1em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    display: inline-block;
    animation: bk-spin .6s linear infinite;
}
@keyframes bk-spin { to { transform: rotate(360deg); } }
.btn:disabled, .btn.disabled { opacity: .55; pointer-events: none; }
/* Touch-friendly minimum target */
.btn { min-height: 44px; }
.btn-sm, .btn-group-sm > .btn { min-height: 36px; }

/* --- Ghost & danger button variants --- */
.btn-ghost {
    background: transparent;
    color: var(--bk-ink-3);
    border-color: transparent;
}
.btn-ghost:hover { background: var(--bk-paper-2); color: var(--bk-ink); }

/* --- Form field pattern (label + control + helper/error) --- */
.bk-field { margin-bottom: var(--sp-4); }
.bk-field .form-label, .bk-field label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--bk-ink-2);
    margin-bottom: var(--sp-1);
}
.bk-field .bk-help {
    font-size: var(--text-xs);
    color: var(--bk-muted);
    margin-top: var(--sp-1);
}
.bk-field .bk-error {
    display: none;
    font-size: var(--text-xs);
    color: var(--bk-danger);
    margin-top: var(--sp-1);
}
.bk-field.has-error .form-control,
.bk-field.has-error .form-select { border-color: var(--bk-danger); }
.bk-field.has-error .bk-error { display: block; }
.bk-field.has-error .bk-help { display: none; }

/* Mobile: inputs ≥48px tall, ≥16px font (prevents iOS auto-zoom) */
@media (max-width: 900px) {
    .form-control, .form-select, .form-control-lg {
        min-height: 48px;
        font-size: 1rem;
    }
    textarea.form-control { min-height: 96px; }
}

/* --- Floating action button (mobile quick-add) --- */
.bk-fab {
    display: none;
    position: fixed;
    right: var(--sp-4);
    bottom: calc(var(--bk-bottomnav-h) + env(safe-area-inset-bottom, 0) + var(--sp-4));
    z-index: 1020;
    width: 56px; height: 56px;
    border-radius: 50%;
    border: 0;
    background: var(--bk-primary);
    color: #fff;
    font-size: 1.5rem;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
    text-decoration: none;
}
.bk-fab:hover { background: var(--bk-primary-600); color: #fff; transform: translateY(-2px); }
@media (max-width: 900px) { .bk-fab { display: flex; } }


/* --- Bottom nav center FAB ("+ Catat") --- */
.bk-bottomnav-fabslot {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    min-width: 44px;
    padding-bottom: 6px;
}
.bk-bottomnav-fab {
    position: absolute;
    top: -20px;
    width: 52px; height: 52px;
    border-radius: 50%;
    background: var(--bk-primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 6px 16px rgba(5, 150, 105, .35);
    text-decoration: none;
    transition: background var(--transition-fast), transform var(--transition-fast);
}
.bk-bottomnav-fab:hover { background: var(--bk-primary-600); color: #fff; }
.bk-bottomnav-fab:active { transform: scale(.94); }
.bk-bottomnav-fablabel {
    font-size: .625rem;
    font-weight: 600;
    color: var(--bk-muted);
}

/* --- "Lainnya" bottom sheet --- */
.bk-more-sheet-backdrop {
    position: fixed; inset: 0;
    background: rgba(10, 10, 10, .5);
    z-index: 1050;
    opacity: 0;
    transition: opacity var(--transition-base);
}
.bk-more-sheet-backdrop.open { opacity: 1; }
.bk-more-sheet {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 1051;
    background: var(--bk-paper);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    max-height: 75vh;
    transform: translateY(100%);
    transition: transform var(--transition-base);
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -8px 32px rgba(10, 10, 10, .18);
}
.bk-more-sheet.open { transform: translateY(0); }
.bk-more-sheet-handle {
    width: 40px; height: 4px;
    border-radius: 2px;
    background: var(--bk-line-2);
    margin: 10px auto 4px;
}
.bk-more-sheet-body {
    overflow-y: auto;
    max-height: calc(75vh - 20px);
    padding: var(--sp-2) var(--sp-4) var(--sp-5);
}
.bk-more-sheet-group {
    font-size: .625rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--bk-faint);
    margin: var(--sp-4) 0 var(--sp-2);
}
.bk-more-sheet-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-2);
}
.bk-more-sheet-grid a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: var(--sp-3) var(--sp-1);
    min-height: 64px;
    border-radius: var(--r-lg);
    color: var(--bk-ink-3);
    text-decoration: none;
    font-size: .6875rem;
    font-weight: 500;
    text-align: center;
    transition: background var(--transition-fast), color var(--transition-fast);
}
.bk-more-sheet-grid a i { font-size: 1.35rem; color: var(--bk-muted); }
.bk-more-sheet-grid a:hover { background: var(--bk-paper-2); color: var(--bk-ink); }
.bk-more-sheet-grid a.active { background: var(--bk-primary-mist); color: var(--bk-primary-ink); font-weight: 600; }
.bk-more-sheet-grid a.active i { color: var(--bk-primary); }
@media (max-width: 379px) {
    .bk-more-sheet-grid { grid-template-columns: repeat(3, 1fr); }
}
