/* ============================================================
   App shell — sidebar, topbar, breadcrumbs, user chip, page header
   ============================================================ */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--hd-navy) 0%, var(--hd-navy-900) 100%);
    color: #cdd9e8;
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    height: 100vh;
}
.sidebar-brand {
    padding: 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: #fff;
}
.sidebar-brand img { width: 100%; max-width: 200px; display: block; }
.sidebar-tag {
    padding: 14px 18px 8px;
    font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
    color: #7f93ad;
}
.sidebar-nav { padding: 4px 12px; flex: 1; overflow-y: auto; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 14px; margin: 2px 0;
    color: #cdd9e8; border-radius: 8px;
    font-weight: 500; text-decoration: none;
}
.sidebar-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar-nav a.active { background: var(--hd-blue); color: #fff; box-shadow: var(--shadow); }
.sidebar-nav .nav-ico { width: 20px; text-align: center; font-size: 16px; opacity: .9; }
.sidebar-foot {
    padding: 14px 14px; border-top: 1px solid rgba(255,255,255,.08);
    font-size: 12px; color: #8aa0bd;
}
/* User identity + actions, pinned to the bottom of the sidebar. */
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.sidebar-user .avatar { background: rgba(255,255,255,.14); color: #fff; flex: none; }
.sidebar-user .who { min-width: 0; flex: 1; line-height: 1.25; }
.sidebar-user .who b {
    display: block; color: #eaf0f8; font-size: 13.5px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-user .who span {
    display: block; color: #8aa0bd; font-size: 12px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-user .icon-btn {
    flex: none; cursor: pointer; background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.18); color: #cdd9e8;
    border-radius: 8px; padding: 6px 9px; font-size: 15px; line-height: 1;
}
.sidebar-user .icon-btn:hover { background: rgba(255,255,255,.14); color: #fff; }
/* Settings + Sign out, side by side under the user identity. The .btn.ghost selector (white, defined later
   in this file) would otherwise win on equal specificity, so match .btn.ghost here to stay dark-friendly. */
.sidebar-actions { display: flex; gap: 8px; margin: 12px 0 0; }
.sidebar-actions > a, .sidebar-actions > form { flex: 1; }
.sidebar-actions .btn.ghost {
    width: 100%; justify-content: center;
    background: rgba(255,255,255,.06); color: #eaf0f8; border-color: rgba(255,255,255,.18);
}
.sidebar-actions .btn.ghost:hover { background: rgba(255,255,255,.14); color: #fff; }
.thread-rule { height: 3px; background: linear-gradient(90deg, transparent, var(--hd-gold), transparent); }

.content { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 14px 28px; display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 10;
}
.crumbs { font-size: 13px; color: var(--ink-soft); }
.crumbs a { color: var(--ink-soft); }
.crumbs a:hover { color: var(--hd-blue); }
.crumbs .sep { margin: 0 7px; opacity: .5; }
.crumbs .here { color: var(--ink); font-weight: 600; }

.user-chip { display: flex; align-items: center; gap: 12px; }
.user-chip .who { text-align: right; line-height: 1.25; }
.user-chip .who b { color: var(--ink); font-size: 13.5px; }
.user-chip .who span { color: var(--ink-soft); font-size: 12px; }
.avatar {
    width: 38px; height: 38px; border-radius: 50%; overflow: hidden;
    background: var(--hd-navy); color: #fff; font-weight: 600;
    display: grid; place-items: center; font-size: 14px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 72px; height: 72px; font-size: 24px; }
.avatar-edit { display: flex; align-items: center; gap: 16px; }

.page { padding: 26px 32px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head .lead { color: var(--ink-soft); margin-top: 2px; max-width: 760px; }
