@import url('https://fonts.googleapis.com/css2?family=Geist+Mono:ital,wght@0,100..900;1,100..900&family=Geist+Pixel&family=Geist:ital,wght@0,100..900;1,100..900&display=swap');

:root {
    --font-sans: Geist, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-pixel: "Geist Pixel", ui-sans-serif, system-ui, sans-serif;
    --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --bg: #f6f7f9;
    --panel: #ffffff;
    --panel-soft: #f0f3f6;
    --line: #dfe4ea;
    --line-strong: #cbd3dc;
    --text: #151a20;
    --muted: #677482;
    --muted-strong: #3e4a56;
    --accent: #1b7f5c;
    --accent-soft: #e6f4ee;
    --blue: #2f6fcb;
    --shadow: 0 18px 50px rgba(18, 27, 35, .08);
    --topbar-height: 72px;
    --sidebar-width: 292px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
}

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

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

code {
    font-family: var(--font-mono);
    color: var(--blue);
}

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

.site-shell {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content:  space-between;
    gap: 20px;
    padding: 0 24px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(18px);
    z-index: 20;
}

.brand {
    display: inline-flex;
    width: max-content;
    align-items: baseline;
    gap: 8px;
}

.brand span {
    font-size: 1.05rem;
    font-weight: 760;
    color: var(--text);
}

.brand small {
    font-family: var(--font-pixel);
    font-size: .92rem;
    color: var(--accent);
}

.topbar-search {
    height: 42px;
    display: grid;
    grid-template-columns: 1fr 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
    overflow: hidden;
}

.topbar-search:focus-within {
    border-color: rgba(27, 127, 92, .55);
    box-shadow: 0 0 0 3px rgba(27, 127, 92, .12);
}

.topbar-search input {
    min-width: 0;
    border: 0;
    outline: 0;
    padding: 0 14px;
    color: var(--text);
    background: transparent;
}

.topbar-search input::placeholder {
    color: var(--muted);
}

.topbar-search button {
    border: 0;
    border-left: 1px solid var(--line);
    color: var(--muted-strong);
    background: transparent;
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.icon-button,
.profile-button {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted-strong);
    background: var(--panel);
}

.icon-button:hover,
.profile-button:hover {
    border-color: var(--line-strong);
    color: var(--text);
}

.profile-button {
    width: 42px;
    color: #ffffff;
    border-color: var(--accent);
    background: var(--accent);
    font-size: .82rem;
    font-weight: 760;
}

.app-frame {
    min-height: 0;
    flex: 1;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
    min-height: 0;
    padding: 22px 18px;
    border-right: 1px solid var(--line);
    background: #fbfcfd;
    overflow-y: auto;
}

.sidebar-label {
    display: block;
    margin: 0 10px 10px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: .72rem;
    font-weight: 720;
    text-transform: uppercase;
}

.side-nav {
    display: grid;
    gap: 4px;
}

.side-link {
    min-height: 42px;
    display: grid;
    grid-template-columns: 14px 1fr;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
    border-radius: 8px;
    color: var(--muted-strong);
    font-size: .93rem;
    font-weight: 620;
}

.side-link:hover,
.side-link.active {
    color: var(--text);
    background: var(--panel-soft);
}

.side-link.active {
    box-shadow: inset 0 0 0 1px var(--line);
}

.side-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--line-strong);
}

.side-link.active .side-dot {
    background: var(--accent);
}

.latest-topics {
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.latest-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 0 10px 12px;
}

.latest-head span {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: .72rem;
    font-weight: 720;
    text-transform: uppercase;
}

.latest-head a {
    color: var(--accent);
    font-size: .78rem;
    font-weight: 700;
}

.latest-topics ol {
    display: grid;
    gap: 6px;
    list-style: none;
    counter-reset: topics;
}

.latest-topics li {
    counter-increment: topics;
}

.latest-topics li a {
    min-height: 46px;
    display: grid;
    grid-template-columns: 24px 1fr;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--muted-strong);
    font-size: .86rem;
    line-height: 1.35;
}

.latest-topics li a::before {
    content: counter(topics);
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--muted);
    background: var(--panel-soft);
    font-family: var(--font-mono);
    font-size: .72rem;
}

.latest-topics li a:hover {
    color: var(--text);
    background: var(--panel-soft);
}

.main {
    min-width: 0;
    height: calc(100vh - var(--topbar-height));
    overflow-y: auto;
    padding: 28px;
}

.content-page,
.content-dashboard {
    width: min(80%);
    margin: auto;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border: 1px solid rgba(27, 127, 92, .18);
    border-radius: 7px;
    color: var(--accent);
    background: var(--accent-soft);
    font-family: var(--font-mono);
    font-size: .72rem;
    font-weight: 720;
}

h1 {
    margin-top: 12px;
    font-size: 2rem;
    line-height: 1.16;
    font-weight: 780;
    letter-spacing: 0;
}

p {
    color: var(--muted-strong);
    line-height: 1.7;
}

.lead {
    max-width: 720px;
    margin-top: 10px;
    font-size: 1rem;
}

.dashboard-grid,
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.wide-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
    gap: 14px;
    margin-top: 14px;
}

.panel,
.feature {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.metric,
.feature {
    min-height: 150px;
    padding: 20px;
}

.metric span,
.panel-label {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: .73rem;
    font-weight: 720;
    text-transform: uppercase;
}

.metric strong {
    display: block;
    margin-top: 12px;
    font-size: 1.75rem;
}

.metric p,
.feature p {
    margin-top: 8px;
    font-size: .94rem;
}

.panel {
    padding: 20px;
}

.panel h2,
.feature h2 {
    margin-top: 10px;
    font-size: 1.05rem;
}

.panel-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.panel-list a,
.panel-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted-strong);
    background: var(--panel-soft);
}

.panel-list a:hover {
    color: var(--text);
    border-color: var(--line-strong);
}

.panel-row strong {
    color: var(--text);
}

.section {
    margin-top: 20px;
}

.button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border-radius: 8px;
    border: 1px solid var(--line);
    color: var(--muted-strong);
    background: var(--panel);
    font-size: .9rem;
    font-weight: 700;
}

.button.primary {
    color: #ffffff;
    border-color: var(--accent);
    background: var(--accent);
}

.button.secondary:hover {
    color: var(--text);
    border-color: var(--line-strong);
}

@media (max-width: 980px) {
    html,
    body {
        overflow: auto;
    }

    .site-shell {
        height: auto;
        min-height: 100vh;
    }

    .topbar {
        height: auto;
        grid-template-columns: 1fr auto;
        padding: 14px;
    }

    .topbar-search {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .app-frame {
        grid-template-columns: 1fr;
    }

    .sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--line);
        overflow: visible;
    }

    .side-nav {
        grid-template-columns: repeat(6, max-content);
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .sidebar-label {
        display: none;
    }

    .latest-topics {
        display: none;
    }

    .main {
        height: auto;
        overflow: visible;
        padding: 22px 14px 34px;
    }

    .dashboard-grid,
    .feature-grid,
    .wide-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .topbar {
        grid-template-columns: 1fr;
    }

    .topbar-actions {
        justify-content: flex-start;
    }

    .page-head {
        align-items: flex-start;
        flex-direction: column;
    }

    h1 {
        font-size: 1.7rem;
    }
}
