html, body {
    margin: 0;
    min-height: 100%;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--background);
    color: var(--foreground);
}

* {
    box-sizing: border-box;
}

/* ---- App shell: fixed-width sidebar + flexible main column ---- */
.cp-shell {
    display: flex;
    min-height: 100vh;
}

.cp-sidebar {
    width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    background: var(--card);
}

.cp-brand {
    display: flex;
    align-items: center;
    height: 3.5rem;
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.95rem;
}

.cp-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cp-topbar {
    display: flex;
    align-items: center;
    height: 3.5rem;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border);
}

.cp-topbar-title {
    font-weight: 500;
    font-size: 0.95rem;
}

.cp-content {
    flex: 1;
    padding: 1.5rem 2rem;
}

/* ---- Sidebar navigation ---- */
.cp-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
}

.cp-nav-link {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    color: var(--foreground);
    text-decoration: none;
    font-size: 0.875rem;
    line-height: 1.25rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.cp-nav-link:hover {
    background: var(--accent);
    color: var(--accent-foreground);
}

.cp-nav-link.active {
    background: var(--accent);
    color: var(--accent-foreground);
    font-weight: 500;
}

/* ---- Page content ---- */
.cp-page {
    max-width: 48rem;
}

.cp-page-title {
    margin: 0 0 1rem;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.cp-lead {
    margin: 0 0 1.5rem;
    color: var(--muted-foreground);
    line-height: 1.6;
}

.cp-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 2px);
    background: var(--card);
}

.cp-muted {
    margin: 0;
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

/* ---- Responsive: stack the sidebar above the content on narrow screens ---- */
@media (max-width: 768px) {
    .cp-shell {
        flex-direction: column;
    }

    .cp-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .cp-content {
        padding: 1.25rem;
    }
}

/* ---- Blazor's unhandled-error banner (hidden until an error occurs) ---- */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }
