:root {
    --sidebar-width: 240px;
    --primary: #2563eb;
    --bg: #f4f6f9;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
}

* {
    box-sizing: border-box;
}

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

.app-body {
    min-height: 100vh;
}

#wrapper {
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    position: sticky;
    top: 0;
    flex-shrink: 0;
    z-index: 1040;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .65rem .9rem;
    color: #374151;
    border-radius: .5rem;
    margin-bottom: .15rem;
    font-weight: 500;
}

.sidebar-nav .nav-link:hover {
    background: #f3f4f6;
    color: var(--primary);
}

.sidebar-nav .nav-link.active {
    background: #eff6ff;
    color: var(--primary);
}

.main-wrap {
    min-width: 0;
    width: 100%;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
}

.content {
    min-height: calc(100vh - 110px);
}

.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: .75rem;
    padding: 1.1rem 1.25rem;
    height: 100%;
}

.stat-card .label {
    color: var(--muted);
    font-size: .85rem;
    margin-bottom: .35rem;
}

.stat-card .value {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.stat-card.income .value { color: #059669; }
.stat-card.expense .value { color: #dc2626; }
.stat-card.balance .value { color: #2563eb; }
.stat-card.receivable .value { color: #0d9488; }
.stat-card.payable .value { color: #d97706; }

.card-soft {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: .75rem;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.badge-soft-success { background: #d1fae5; color: #065f46; }
.badge-soft-danger { background: #fee2e2; color: #991b1b; }
.badge-soft-warning { background: #fef3c7; color: #92400e; }
.badge-soft-info { background: #e0f2fe; color: #075985; }
.badge-soft-secondary { background: #f3f4f6; color: #374151; }

/* Landing */
.landing-body {
    background: linear-gradient(160deg, #f8fafc 0%, #eef2ff 45%, #f8fafc 100%);
    min-height: 100vh;
}

.landing-hero {
    padding: 4rem 0 3rem;
}

.landing-hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.6rem);
    font-weight: 750;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.feature-item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: .75rem;
    padding: 1.25rem;
    height: 100%;
}

.feature-item i {
    font-size: 1.4rem;
    color: var(--primary);
}

.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(160deg, #f8fafc 0%, #eef2ff 100%);
}

.auth-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 8px 30px rgba(15, 23, 42, .06);
}

.sidebar-backdrop {
    display: none;
}

@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        transition: transform .25s ease;
        box-shadow: none;
    }

    .sidebar.show {
        transform: translateX(0);
        box-shadow: 0 0 40px rgba(0,0,0,.15);
    }

    .sidebar-backdrop.show {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .35);
        z-index: 1035;
    }
}

@media (max-width: 575.98px) {
    .stat-card .value {
        font-size: 1.15rem;
    }

    .table td, .table th {
        white-space: nowrap;
    }
}
