:root {
    --ft-sidebar: #0f172a;
    --ft-bg: #f5f7fb;
    --ft-card: #ffffff;
    --ft-border: #e5e7eb;
    --ft-text: #111827;
    --ft-muted: #6b7280;
    --ft-primary: #2563eb;
}

* {
    box-sizing: border-box;
}

body {
    background: var(--ft-bg);
    color: var(--ft-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    text-decoration: none;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    min-height: 100vh;
    padding: 1.25rem;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, .35), transparent 35%),
        linear-gradient(180deg, #0f172a 0%, #111827 100%);
    color: #fff;
    position: sticky;
    top: 0;
    align-self: flex-start;
}

.brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-weight: 800;
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.brand-icon,
.auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, #3b82f6, #22c55e);
    color: #fff;
    box-shadow: 0 12px 26px rgba(37, 99, 235, .25);
}

.sidebar .nav-link,
.offcanvas .nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: rgba(255,255,255,.72);
    border-radius: 14px;
    padding: .8rem .9rem;
    font-weight: 600;
}

.offcanvas .nav-link {
    color: #334155;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(255,255,255,.12);
    color: #fff;
}

.offcanvas .nav-link.active {
    background: #eff6ff;
    color: #1d4ed8;
}

.sidebar-user {
    margin-top: 2rem;
    padding: 1rem;
    border-radius: 18px;
    background: rgba(255,255,255,.08);
}

.main {
    flex: 1;
    min-width: 0;
    padding: 1.5rem;
}

.topbar {
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    font-weight: 800;
    margin: 0;
}

.page-subtitle {
    color: var(--ft-muted);
    font-size: .95rem;
}

.content {
    max-width: 1500px;
    margin: 0 auto;
}

.card,
.stat-card,
.account-card {
    border-radius: 24px;
}

.stat-card {
    padding: 1.25rem;
    background: var(--ft-card);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
    border: 1px solid rgba(226, 232, 240, .85);
    height: 100%;
}

.stat-icon {
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: var(--ft-primary);
    border-radius: 14px;
    margin-bottom: .85rem;
    font-size: 1.2rem;
}

.stat-value {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -.03em;
}

.account-card {
    background:
        linear-gradient(135deg, rgba(37, 99, 235, .08), rgba(34, 197, 94, .08)),
        #fff;
    border: 1px solid var(--ft-border);
    padding: 1.25rem;
    height: 100%;
}

.balance {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -.03em;
}

.color-dot {
    display: inline-block;
    width: .8rem;
    height: .8rem;
    border-radius: 999px;
    margin-right: .45rem;
    vertical-align: middle;
}

.empty-state {
    text-align: center;
    border: 1px dashed #cbd5e1;
    border-radius: 24px;
    padding: 3rem 1rem;
    background: #f8fafc;
    color: #64748b;
}

.empty-state i {
    font-size: 2.4rem;
    display: block;
    margin-bottom: .75rem;
}

.auth-bg {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background:
        radial-gradient(circle at 20% 20%, rgba(59,130,246,.25), transparent 30%),
        radial-gradient(circle at 80% 30%, rgba(34,197,94,.20), transparent 28%),
        linear-gradient(135deg, #f8fafc, #e0f2fe);
}

.auth-card {
    width: min(100%, 440px);
    background: rgba(255,255,255,.88);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 28px;
    padding: 2rem;
    box-shadow: 0 20px 45px rgba(15, 23, 42, .12);
}

.budget-table-wrap {
    max-height: 70vh;
}

.budget-table th,
.budget-table td {
    min-width: 150px;
    vertical-align: top;
}

.budget-table .sticky-col {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 2;
    min-width: 220px;
    box-shadow: 6px 0 12px rgba(15, 23, 42, .04);
}

.budget-cell input {
    min-width: 120px;
}

.xsmall {
    font-size: .72rem;
}

.content-sticky {
    top: 1rem;
}

.table > :not(caption) > * > * {
    padding: .85rem .75rem;
}

.form-control,
.form-select,
.btn {
    border-radius: 14px;
}

@media (max-width: 991.98px) {
    .sidebar {
        display: none;
    }

    .main {
        padding: 1rem;
    }

    .topbar .container-fluid {
        gap: .75rem;
    }

    .page-subtitle {
        display: none;
    }

    .auth-card {
        padding: 1.4rem;
    }
}

@media (max-width: 575.98px) {
    .stat-value,
    .balance {
        font-size: 1.25rem;
    }

    .card-body {
        padding: 1.15rem !important;
    }

    .table {
        font-size: .92rem;
    }
}


.feature-icon {
    width: 42px;
    height: 42px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.stat-card.compact {
    padding: 1.05rem;
    min-height: 100%;
}

.stat-card.compact .stat-value {
    font-size: 1.05rem;
    word-break: break-word;
}

.bulk-apply-form {
    min-width: min(100%, 320px);
}

.empty-state i {
    font-size: 2.5rem;
    color: #94a3b8;
}

.mini-help-card {
    height: 100%;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 20px;
    padding: 1rem;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.mini-help-card i {
    font-size: 1.4rem;
    color: #0d6efd;
}

.mini-help-card span {
    color: #64748b;
    font-size: .9rem;
}
