/* ============================================================
   Left-sidebar navigation ("Ledger" design), gated behind the
   Nav:UseSidebar app setting. Rendered by both nav surfaces from
   Components/Layout/SidebarNav.cs:
     - Razor Pages ...... Pages/Shared/_Layout.cshtml
     - Blazor ........... Components/Layout/GoalsLayout.razor
   Class prefixes: .whm shared shell, .whm-* shared mobile chrome,
   .whm4-* the sidebar itself. The whm4 numbering is historical —
   this was Design 4 of five previews; the other four are gone.
   Palette: ink #2f2f6f · muted #726b8e · coral #e97a75 ·
   gold #f4b33a · warm paper gradient (body already paints it).
   ============================================================ */

.whm {
    min-height: 100vh;
}

.whm svg {
    display: block;
    height: 18px;
    width: 18px;
}

/* ---- reusable density utility ----
   Apply to any page wrapper (Razor or Blazor) to shrink type and spacing ~12%
   so more fits per screen. zoom (unlike transform:scale) reflows layout and
   keeps text crisp. If the redesign is adopted, add this class to the site
   layout's <main> to roll the compact scale out everywhere consistently. */
.bp-compact {
    zoom: 0.85;
}

/* ---- shared mobile chrome ---- */
.whm-burger {
    align-items: center;
    background: rgba(47, 47, 111, 0.08);
    border: 0;
    border-radius: 12px;
    color: #2f2f6f;
    display: none;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.whm-mobilebar {
    align-items: center;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid rgba(47, 47, 111, 0.08);
    display: none;
    gap: 12px;
    padding: 8px 14px;
    position: sticky;
    top: 0;
    z-index: 1040;
}

.whm-mobilebar img {
    height: 38px;
    object-fit: contain;
}

.whm-scrim {
    display: none;
}

/* ============================================================
   The sidebar — maximum-density text-first dock
   ============================================================ */

.whm4-frame {
    align-items: flex-start;
    display: flex;
    gap: 16px;
    margin: 0 auto;
    max-width: 1600px;
    padding: 16px 16px 40px;
}

.whm4-ledger {
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(47, 47, 111, 0.10);
    border-radius: 32px;
    box-shadow: 0 24px 60px rgba(47, 47, 111, 0.08);
    display: flex;
    flex: 0 0 208px;
    flex-direction: column;
    height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 18px 12px 14px;
    position: sticky;
    top: 16px;
    width: 208px;
}

.whm4-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 4px;
}

.whm4-brand img {
    height: 46px;
    object-fit: contain;
}

.whm4-nav {
    flex: 1 1 auto;
}

.whm4-group {
    border-top: 1px solid rgba(47, 47, 111, 0.07);
    margin-top: 8px;
    padding-top: 7px;
}

.whm4-nav .whm4-group:first-child {
    border-top: 0;
}

.whm4-group-label {
    align-items: center;
    color: #a09ab8;
    display: flex;
    font-size: 9.5px;
    font-weight: 800;
    gap: 6px;
    letter-spacing: 0.1em;
    margin-bottom: 3px;
    padding: 0 8px;
    text-transform: uppercase;
}

.whm4-dot {
    border-radius: 999px;
    display: inline-block;
    height: 7px;
    width: 7px;
}

.whm4-dot-coral { background: #e97a75; }
.whm4-dot-gold { background: #f4b33a; }
.whm4-dot-indigo { background: #6c67d9; }
.whm4-dot-mint { background: #58b99d; }
.whm4-dot-slate { background: #94a3b8; }

.whm4-link {
    border-radius: 8px;
    color: #4a4670;
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 1px;
    padding: 4px 8px 4px 14px;
    text-decoration: none;
    transition: background 120ms ease, color 120ms ease;
}

.whm4-link:hover {
    background: rgba(233, 122, 117, 0.08);
    color: #2f2f6f;
}

.whm4-link.is-active {
    background: #2f2f6f;
    box-shadow: 0 8px 18px rgba(47, 47, 111, 0.18);
    color: #fffdf8;
    font-weight: 700;
}

.whm4-user {
    align-items: center;
    border-top: 1px solid rgba(47, 47, 111, 0.08);
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
}

.whm4-avatar {
    align-items: center;
    background: #2f2f6f;
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 800;
    height: 30px;
    justify-content: center;
    width: 30px;
}

.whm4-user-name {
    color: #2f2f6f;
    font-size: 12px;
    font-weight: 700;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.whm4-logout {
    color: #9a94b5;
    margin-left: auto;
}

.whm4-logout:hover {
    color: #2f2f6f;
}

.whm4-logout svg {
    height: 14px;
    width: 14px;
}

.whm4-main {
    flex: 1;
    min-width: 0;
}

/* ============================================================
   Mobile: the sidebar becomes an off-canvas drawer
   ============================================================ */

@media (max-width: 991.98px) {
    .whm-burger {
        display: inline-flex;
    }

    .whm-mobilebar {
        display: flex;
    }

    .whm-scrim.is-open {
        background: rgba(31, 30, 68, 0.45);
        display: block;
        inset: 0;
        position: fixed;
        z-index: 1050;
    }

    .whm4-ledger {
        backdrop-filter: none;
        background: #fffdfb;
        border-radius: 0 24px 24px 0;
        bottom: 0;
        flex: none;
        height: 100vh;
        left: 0;
        max-height: none;
        overflow-y: auto;
        position: fixed;
        top: 0;
        transform: translateX(-105%);
        transition: transform 180ms ease;
        width: 290px;
        z-index: 1055;
    }

    .whm4-ledger.is-open {
        transform: translateX(0);
    }

    .whm4-frame {
        padding: 12px 12px 60px;
    }
}
