:root {
    --fc-background: #f9f9f9;
    --fc-surface: #ffffff;
    --fc-surface-alt: #f3f3f4;
    --fc-border: rgba(10, 25, 47, 0.08);
    --fc-border-strong: rgba(10, 25, 47, 0.14);
    --fc-text: #102038;
    --fc-text-muted: #667085;
    --fc-accent: #c5a059;
    --fc-accent-deep: #775a19;
    --fc-success: #1f8f59;
    --fc-shadow: 0 24px 60px rgba(16, 32, 56, 0.08);
    --fc-radius-sm: 12px;
    --fc-radius-md: 18px;
    --fc-radius-lg: 28px;
    --fc-sidebar-width: 17.5rem;
}

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

html {
    font-family: 'Manrope', sans-serif;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(197, 160, 89, 0.18), transparent 22rem),
        linear-gradient(180deg, #ffffff 0%, var(--fc-background) 32%, #f1f2f4 100%);
    color: var(--fc-text);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--fc-sidebar-width);
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 2rem 1.25rem;
    background: rgba(255, 255, 255, 0.82);
    border-right: 1px solid var(--fc-border);
    backdrop-filter: blur(20px);
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.5rem 0.75rem;
}

.brand-mark {
    width: 2.75rem;
    height: 2.75rem;
    display: grid;
    place-items: center;
    border-radius: 0.9rem;
    background: linear-gradient(135deg, var(--fc-text), #223554);
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.brand-name {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
}

.brand-subtitle {
    margin: 0.2rem 0 0;
    color: var(--fc-text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

.sidebar-nav {
    display: grid;
    gap: 0.35rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.95rem 1rem;
    border-radius: var(--fc-radius-sm);
    color: var(--fc-text-muted);
    transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.sidebar-link:hover,
.sidebar-link:focus-visible {
    background: rgba(255, 255, 255, 0.95);
    color: var(--fc-text);
    transform: translateX(2px);
}

.sidebar-link.is-active {
    background: rgba(197, 160, 89, 0.13);
    color: var(--fc-accent-deep);
    font-weight: 700;
}

.sidebar-icon {
    width: 1.25rem;
    text-align: center;
    font-size: 1rem;
}

.sidebar-export {
    margin-top: auto;
    padding: 1.2rem;
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius-md);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 243, 244, 0.92));
}

.sidebar-export-label {
    margin: 0 0 0.5rem;
    color: var(--fc-text-muted);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.sidebar-export-link {
    font-weight: 700;
    color: var(--fc-accent-deep);
}

.app-main {
    margin-left: var(--fc-sidebar-width);
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.35rem 2rem;
    background: rgba(249, 249, 249, 0.86);
    border-bottom: 1px solid var(--fc-border);
    backdrop-filter: blur(18px);
}

.topbar-search {
    flex: 1;
    max-width: 34rem;
}

.topbar-search input {
    width: 100%;
    padding: 0.95rem 1.15rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: inset 0 0 0 1px rgba(10, 25, 47, 0.04);
}

.topbar-search input:focus {
    outline: none;
    border-color: rgba(197, 160, 89, 0.45);
    box-shadow: 0 0 0 4px rgba(197, 160, 89, 0.12);
}

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

.topbar-button {
    padding: 0.8rem 1.1rem;
    border: 1px solid var(--fc-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--fc-text);
}

.topbar-button-primary {
    border-color: transparent;
    background: var(--fc-accent);
    color: #fff;
}

.topbar-profile {
    padding-left: 1rem;
    margin-left: 0.2rem;
    border-left: 1px solid var(--fc-border);
}

.topbar-profile-name,
.topbar-profile-role {
    margin: 0;
}

.topbar-profile-name {
    font-size: 0.95rem;
    font-weight: 800;
}

.topbar-profile-role {
    font-size: 0.72rem;
    color: var(--fc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.content {
    padding: 2rem;
}

.hero,
.stat-card,
.panel,
.mini-note {
    border: 1px solid var(--fc-border);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--fc-shadow);
}

.hero {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    padding: 2rem;
    border-radius: var(--fc-radius-lg);
}

.eyebrow,
.panel-kicker,
.hero-balance span {
    margin: 0 0 0.65rem;
    color: var(--fc-accent-deep);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.hero h1,
.panel h2 {
    margin: 0;
    letter-spacing: -0.03em;
}

.hero h1 {
    font-size: clamp(2.2rem, 4vw, 3.9rem);
}

.hero-copy {
    max-width: 42rem;
    margin: 0.9rem 0 0;
    color: var(--fc-text-muted);
    line-height: 1.7;
}

.hero-balance {
    min-width: 18rem;
    padding: 1.5rem;
    border-radius: var(--fc-radius-md);
    background: linear-gradient(135deg, rgba(16, 32, 56, 0.98), rgba(47, 67, 99, 0.94));
    color: #fff;
}

.hero-balance strong {
    display: block;
    font-size: clamp(2rem, 3vw, 3.2rem);
    letter-spacing: -0.04em;
}

.hero-balance small {
    display: block;
    margin-top: 0.75rem;
    color: rgba(255, 255, 255, 0.75);
}

.stat-grid,
.panel-grid {
    display: grid;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card,
.panel {
    border-radius: var(--fc-radius-md);
}

.stat-card {
    display: grid;
    gap: 0.8rem;
    padding: 1.4rem;
}

.stat-card span,
.stat-card small,
.check-list span,
.ledger-row span,
.mini-note p {
    color: var(--fc-text-muted);
}

.stat-card strong {
    font-size: 1.85rem;
    letter-spacing: -0.03em;
}

.stat-card .is-positive {
    color: var(--fc-success);
}

.panel-grid {
    grid-template-columns: minmax(0, 1.65fr) minmax(18rem, 1fr);
}

.panel-grid-bottom {
    align-items: start;
}

.panel {
    padding: 1.5rem;
}

.panel-wide {
    min-width: 0;
}

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

.panel-heading a {
    color: var(--fc-accent-deep);
    font-weight: 700;
}

.chart-bars {
    display: flex;
    align-items: end;
    gap: 1rem;
    min-height: 16rem;
    padding: 1rem 0 0.5rem;
}

.chart-bar {
    flex: 1;
    display: grid;
    justify-items: center;
    gap: 0.8rem;
}

.chart-bar span {
    width: 100%;
    min-height: 3rem;
    border-radius: 999px 999px 1rem 1rem;
    background: linear-gradient(180deg, var(--fc-accent), rgba(119, 90, 25, 0.82));
}

.chart-bar small {
    color: var(--fc-text-muted);
    font-weight: 700;
}

.check-list,
.action-stack {
    display: grid;
    gap: 0.9rem;
}

.check-list {
    padding: 0;
    margin: 0;
    list-style: none;
}

.check-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--fc-border);
}

.check-list strong {
    white-space: nowrap;
}

.ledger-table {
    display: grid;
}

.ledger-row {
    display: grid;
    grid-template-columns: 9rem minmax(0, 1.8fr) 7rem 9rem;
    gap: 1rem;
    align-items: center;
    padding: 1rem 0;
    border-top: 1px solid var(--fc-border);
}

.ledger-head {
    padding-top: 0;
    border-top: 0;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.ledger-row strong {
    text-align: right;
    letter-spacing: -0.02em;
}

.action-stack button {
    width: 100%;
    padding: 0.95rem 1rem;
    border: 1px solid var(--fc-border-strong);
    border-radius: 999px;
    background: linear-gradient(180deg, #fff, #f8f8f8);
    text-align: left;
}

.mini-note {
    margin-top: 1rem;
    padding: 1.1rem 1.2rem;
    border-radius: var(--fc-radius-md);
}

.mini-note strong {
    display: block;
    font-size: 1.05rem;
}

@media (max-width: 1100px) {
    .stat-grid,
    .panel-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero {
        flex-direction: column;
    }

    .hero-balance {
        min-width: auto;
    }
}

@media (max-width: 860px) {
    .sidebar {
        position: static;
        width: 100%;
        border-right: 0;
        border-bottom: 1px solid var(--fc-border);
    }

    .app-main {
        margin-left: 0;
    }

    .topbar {
        position: static;
        padding: 1.2rem;
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-actions {
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .content {
        padding: 1.2rem;
    }

    .stat-grid,
    .panel-grid {
        grid-template-columns: 1fr;
    }

    .ledger-row {
        grid-template-columns: 1fr;
        padding: 0.9rem 0;
    }

    .ledger-row strong {
        text-align: left;
    }
}
