/* ==============================
   BookClaw Accounting — Dark Theme
   ============================== */

:root {
    --bg: #0c0c10;
    --surface: #16161e;
    --surface-2: #1e1e2a;
    --surface-3: #262636;
    --border: #2a2a3d;
    --border-light: #353550;
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --primary-bg: rgba(99,102,241,0.1);
    --accent: #10b981;
    --accent-hover: #34d399;
    --accent-bg: rgba(16,185,129,0.1);
    --danger: #ef4444;
    --danger-hover: #f87171;
    --danger-bg: rgba(239,68,68,0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245,158,11,0.1);
    --text: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --income: #10b981;
    --expense: #ef4444;
    --transfer: #8b5cf6;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.4);
    --transition: 200ms ease;
    --sidebar-width: 240px;
    --header-height: 64px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--primary-hover); }

/* ==============================
   Scrollbar
   ============================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ==============================
   Header
   ============================== */
.bk-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(22,22,30,0.9);
}

.bk-header__left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.bk-header__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.bk-header__logo svg {
    width: 28px;
    height: 28px;
    color: var(--primary);
}

.bk-header__nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.bk-header__nav a {
    padding: 8px 16px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition);
}

.bk-header__nav a:hover {
    color: var(--text);
    background: var(--surface-2);
}

.bk-header__right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ==============================
   Buttons
   ============================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    line-height: 1.4;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--primary-hover);
    color: #fff;
    transform: translateY(-1px);
}

.btn-accent {
    background: var(--accent);
    color: #fff;
}
.btn-accent:hover {
    background: var(--accent-hover);
    color: #fff;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-outline:hover {
    color: var(--text);
    border-color: var(--border-light);
    background: var(--surface-2);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover {
    color: var(--text);
    background: var(--surface-2);
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid transparent;
}
.btn-danger:hover {
    background: var(--danger);
    color: #fff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-icon {
    padding: 8px;
    width: 36px;
    height: 36px;
    justify-content: center;
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

/* ==============================
   Layout — App Shell
   ============================== */
.bk-app {
    display: flex;
    min-height: 100vh;
    padding-top: var(--header-height);
}

/* ==============================
   Sidebar
   ============================== */
.bk-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 50;
    overflow-y: auto;
}

.bk-sidebar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
}

.bk-sidebar__link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.7;
}

.bk-sidebar__link:hover {
    color: var(--text);
    background: var(--surface-2);
}

.bk-sidebar__link:hover svg {
    opacity: 1;
}

.bk-sidebar__link.active {
    color: var(--primary);
    background: var(--primary-bg);
}

.bk-sidebar__link.active svg {
    opacity: 1;
    color: var(--primary);
}

/* ==============================
   Main Content
   ============================== */
.bk-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px 32px;
    min-width: 0;
}

.bk-main__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.bk-main__title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ==============================
   Month Navigation
   ============================== */
.bk-month-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 4px;
}

.bk-month-nav__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.bk-month-nav__btn:hover {
    background: var(--surface-2);
    color: var(--text);
}

.bk-month-nav__label {
    padding: 0 16px;
    font-weight: 600;
    font-size: 0.95rem;
    min-width: 160px;
    text-align: center;
    color: var(--text);
}

/* ==============================
   Cards
   ============================== */
.bk-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition);
}

.bk-card:hover {
    border-color: var(--border-light);
}

.bk-card__title {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.bk-card__value {
    font-family: var(--font-mono);
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.bk-card__value.income { color: var(--income); }
.bk-card__value.expense { color: var(--expense); }
.bk-card__value.balance { color: var(--primary); }

.bk-card__sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* KPI Grid */
.bk-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

/* ==============================
   Tables
   ============================== */
.bk-table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.bk-table {
    width: 100%;
    border-collapse: collapse;
}

.bk-table th {
    background: var(--surface-2);
    padding: 12px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.bk-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    vertical-align: middle;
}

.bk-table tr:last-child td {
    border-bottom: none;
}

.bk-table tr:hover td {
    background: rgba(99,102,241,0.03);
}

.bk-table .col-amount {
    font-family: var(--font-mono);
    font-weight: 500;
    text-align: right;
    white-space: nowrap;
}

.bk-table .col-date {
    white-space: nowrap;
    color: var(--text-secondary);
}

.bk-table .col-actions {
    width: 80px;
    text-align: right;
}

.amount-income { color: var(--income); }
.amount-expense { color: var(--expense); }

/* Badge */
.bk-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.bk-badge.income {
    background: var(--accent-bg);
    color: var(--accent);
}

.bk-badge.expense {
    background: var(--danger-bg);
    color: var(--danger);
}

.bk-badge.transfer {
    background: rgba(139, 92, 246, 0.1);
    color: var(--transfer);
}

/* Amount transfer color */
.amount-transfer { color: var(--transfer); }

/* ==============================
   Filters
   ============================== */
.bk-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.bk-select {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color var(--transition);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

.bk-select:focus {
    border-color: var(--primary);
    outline: none;
}

/* ==============================
   Modal
   ============================== */
.bk-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all 250ms ease;
}

.bk-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.bk-modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 560px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px) scale(0.97);
    transition: transform 250ms ease;
}

.bk-modal-overlay.open .bk-modal {
    transform: translateY(0) scale(1);
}

.bk-modal__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 24px;
}

.bk-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

/* ==============================
   Form
   ============================== */
.bk-form-group {
    margin-bottom: 16px;
}

.bk-form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.bk-input {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.875rem;
    transition: border-color var(--transition);
}

.bk-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.bk-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.bk-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* ==============================
   Summary Blocks
   ============================== */
.bk-summary-section {
    margin-bottom: 24px;
}

.bk-summary-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--surface-2);
    border-radius: var(--radius) var(--radius) 0 0;
    border: 1px solid var(--border);
    border-bottom: none;
}

.bk-summary-section__title {
    font-weight: 600;
    font-size: 0.95rem;
}

.bk-summary-section__total {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.95rem;
}

.bk-summary-section .bk-table-wrap {
    border-radius: 0 0 var(--radius) var(--radius);
}

.bk-summary-grand {
    background: var(--surface);
    border: 1px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
}

.bk-summary-grand__label {
    font-size: 1.1rem;
    font-weight: 700;
}

.bk-summary-grand__value {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
}

/* ==============================
   Categories Tree
   ============================== */
.bk-category-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    overflow: hidden;
}

.bk-category-block__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.bk-category-block__title {
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bk-category-block__badge {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--surface-3);
    padding: 2px 8px;
    border-radius: 12px;
}

.bk-category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px 10px 40px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.bk-category-item:last-of-type {
    border-bottom: 1px solid var(--border);
}

.bk-category-item:hover {
    background: rgba(99,102,241,0.03);
}

.bk-category-item__name {
    font-weight: 500;
}

.bk-category-item__desc {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-left: 12px;
}

.bk-category-item__actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition);
}

.bk-category-block__actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bk-category-block__actions .btn-icon {
    opacity: 0;
    transition: opacity var(--transition);
}

.bk-category-block__header:hover .bk-category-block__actions .btn-icon {
    opacity: 1;
}

.bk-category-add-sub {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px 10px 40px;
    width: 100%;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: color var(--transition), background var(--transition);
}

.bk-category-add-sub:hover {
    color: var(--primary);
    background: rgba(99,102,241,0.05);
}

/* Type badge (Р/Д) on subcategories */
.bk-type-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 6px;
    letter-spacing: 0.5px;
}

.bk-type-badge.expense {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.12);
}

.bk-type-badge.income {
    color: var(--accent);
    background: rgba(16, 185, 129, 0.12);
}

.bk-type-badge.transfer {
    color: var(--transfer);
    background: rgba(139, 92, 246, 0.12);
}

.bk-category-item:hover .bk-category-item__actions {
    opacity: 1;
}

/* ==============================
   Dashboard Charts (CSS-only)
   ============================== */
.bk-chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.bk-bar-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bk-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bk-bar-label {
    flex: 0 0 120px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bk-bar-track {
    flex: 1;
    height: 24px;
    background: var(--surface-2);
    border-radius: 4px;
    overflow: hidden;
}

.bk-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--primary);
    transition: width 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
    min-width: 2px;
}

.bk-bar-fill.income { background: var(--accent); }

.bk-bar-value {
    flex: 0 0 90px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: right;
}

/* ==============================
   Landing / Front Page
   ============================== */
.bk-landing {
    min-height: 100vh;
    padding-top: var(--header-height);
}

.bk-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 24px 60px;
    max-width: 800px;
    margin: 0 auto;
}

.bk-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--primary-bg);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 24px;
}

.bk-hero__title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--text) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bk-hero__title span {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.bk-hero__desc {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 600px;
    margin-bottom: 36px;
}

.bk-hero__actions {
    display: flex;
    gap: 12px;
}

.bk-hero__actions .btn {
    padding: 12px 28px;
    font-size: 1rem;
}

/* Features */
.bk-features {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px 80px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.bk-feature {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    transition: all var(--transition);
}

.bk-feature:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.bk-feature__icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    background: var(--primary-bg);
    color: var(--primary);
}

.bk-feature__icon svg {
    width: 22px;
    height: 22px;
}

.bk-feature__title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.bk-feature__desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==============================
   Docs Page
   ============================== */
.bk-docs {
    max-width: 900px;
}

.bk-docs h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 32px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.bk-docs h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 20px 0 8px;
    color: var(--primary);
}

.bk-docs p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 12px;
}

.bk-docs code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent);
}

.bk-docs pre {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.bk-docs pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: var(--text);
    font-size: 0.85rem;
    line-height: 1.6;
}

.bk-endpoint {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
}

.bk-endpoint__method {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-right: 8px;
}

.bk-endpoint__method.get { background: var(--accent-bg); color: var(--accent); }
.bk-endpoint__method.post { background: var(--primary-bg); color: var(--primary); }
.bk-endpoint__method.put { background: var(--warning-bg); color: var(--warning); }
.bk-endpoint__method.delete { background: var(--danger-bg); color: var(--danger); }

.bk-endpoint__path {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text);
}

.bk-endpoint__desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 8px;
}

/* ==============================
   Footer
   ============================== */
.bk-footer {
    padding: 40px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    margin-top: 60px;
}

/* ==============================
   Empty State
   ============================== */
.bk-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.bk-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.bk-empty__title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

/* ==============================
   Toast Notifications
   ============================== */
.bk-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 20px;
    font-size: 0.875rem;
    color: var(--text);
    box-shadow: var(--shadow-lg);
    z-index: 300;
    transform: translateY(100px);
    opacity: 0;
    transition: all 300ms ease;
}

.bk-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.bk-toast.success { border-left: 3px solid var(--accent); }
.bk-toast.error { border-left: 3px solid var(--danger); }

/* ==============================
   Responsive
   ============================== */
@media (max-width: 1024px) {
    .bk-chart-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .bk-sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition);
    }

    .bk-sidebar.open {
        transform: translateX(0);
    }

    .bk-main {
        margin-left: 0;
        padding: 16px;
    }

    .bk-hero__title {
        font-size: 2rem;
    }

    .bk-features {
        grid-template-columns: 1fr;
    }

    .bk-kpi-grid {
        grid-template-columns: 1fr 1fr;
    }

    .bk-form-row {
        grid-template-columns: 1fr;
    }

    .bk-table {
        font-size: 0.8rem;
    }

    .bk-table th, .bk-table td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .bk-kpi-grid {
        grid-template-columns: 1fr;
    }

    .bk-header {
        padding: 0 16px;
    }

    .bk-hero__actions {
        flex-direction: column;
        width: 100%;
    }

    .bk-hero__actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==============================
   Utility
   ============================== */
.text-income { color: var(--income); }
.text-expense { color: var(--expense); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex-center { display: flex; align-items: center; gap: 8px; }
.hidden { display: none !important; }

/* ==============================
   Auth Modal — Tabs & Forms
   ============================== */
.bk-auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.bk-auth-tab {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.bk-auth-tab:hover {
    color: var(--text-secondary);
}

.bk-auth-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.bk-auth-form {
    animation: bk-fadeIn 200ms ease;
}

@keyframes bk-fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.bk-auth-error {
    background: var(--danger-bg);
    border: 1px solid rgba(239,68,68,0.2);
    color: var(--danger);
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.bk-auth-form .btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* API Key Display */
.bk-api-key-box {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 0;
}

.bk-api-key-box code {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent);
    word-break: break-all;
    flex: 1;
}

.bk-api-key-box .btn-copy {
    flex-shrink: 0;
}

/* Sidebar API Panel */
.bk-sidebar-api {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    margin-top: 8px;
}

.bk-sidebar-api__title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    padding: 0 4px;
}

.bk-sidebar-api .bk-api-key-box {
    padding: 8px 10px;
    margin: 0 0 6px;
}

.bk-sidebar-api .bk-api-key-box code {
    font-size: 0.75rem;
}

/* Fixed-width table columns (Summary page) */
.bk-table--fixed {
    table-layout: fixed;
    width: 100%;
}

/* ==============================
   Accounts Page
   ============================== */

.bk-accounts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bk-account-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: border-color var(--transition);
}

.bk-account-item:hover {
    border-color: var(--border-light);
}

.bk-account-item__info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.bk-account-item__icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-bg);
    border-radius: var(--radius);
    color: var(--primary);
    flex-shrink: 0;
}

.bk-account-item__icon svg {
    width: 20px;
    height: 20px;
}

.bk-account-item__name {
    font-weight: 500;
    color: var(--text);
}

.bk-account-item__desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.bk-account-item__actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition);
}

.bk-account-item:hover .bk-account-item__actions {
    opacity: 1;
}
