body {
    background: #f1f5f9;
}

.sidebar {
    --sidebar-bg: #4c0519;
    /* Keeps the drawer as wide as the docked sidebar; Bootstrap defaults to 400px. */
    --bs-offcanvas-width: 260px;

    width: 260px;
    background: var(--sidebar-bg);
    color: #fecdd3;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
}

/* Docked from lg up. Below that `.offcanvas-lg` positions the sidebar as a
   drawer, which `position: sticky` here would override. */
@media (min-width: 992px) {
    .sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        min-height: 100vh;
        /* `.offcanvas-lg` forces `background-color: transparent !important` from
           lg up, so the docked sidebar has to answer in kind to stay dark. */
        background-color: var(--sidebar-bg) !important;
    }
}

.sidebar-brand {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid #881337;
}

.sidebar-brand .brand-name {
    font-weight: 700;
    color: #fff;
    font-size: 1rem;
}

.sidebar-brand .brand-badge {
    display: inline-block;
    background: #e11d48;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    vertical-align: middle;
    margin-left: 0.4rem;
}

.sidebar-brand .brand-sub {
    font-size: 0.72rem;
    color: #fda4af;
    margin-top: 0.2rem;
}

.sidebar .nav-section-label {
    padding: 0.5rem 1rem 0.25rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9f1239;
    font-weight: 600;
}

.sidebar .nav-link {
    color: #fecdd3;
    border-radius: 0.375rem;
    margin: 0.1rem 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition:
        background 0.15s,
        color 0.15s;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: #881337;
    color: #fff;
}

.sidebar .nav-link i {
    width: 1.25rem;
    text-align: center;
    margin-right: 0.5rem;
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem;
    border-top: 1px solid #881337;
}

.sidebar-footer .user-name {
    font-size: 0.8rem;
    color: #fff;
    font-weight: 600;
}

.sidebar-footer .user-email {
    font-size: 0.7rem;
    color: #fda4af;
}

.content-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar .page-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

main {
    padding: 1.5rem;
    flex: 1;
}

.section-row {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
}

.section-row:hover {
    border-color: #cbd5e1;
}

/* A flex <summary> drops the native disclosure triangle, so the chevron below
   stands in for it. */
.section-row > summary {
    cursor: pointer;
    list-style: none;
}

.section-row > summary::-webkit-details-marker {
    display: none;
}

.section-chevron {
    transition: transform 0.15s ease-in-out;
}

.section-row[open] .section-chevron {
    transform: rotate(90deg);
}
