/* ChangeHub — App shell (sidebar, header, responsive) */

.changehub-app {
    display: flex;
    min-height: 100vh;
    background: var(--ch-slate-50, #f8fafc);
}

/* ── Sidebar ── */
.changehub-sidebar {
    width: var(--ch-sidebar-width, 272px);
    min-width: var(--ch-sidebar-width, 272px);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    background: var(--ch-sidebar-bg, linear-gradient(180deg, #0f172a 0%, #1e1b4b 55%, #0f172a 100%)) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--ch-font, 'Plus Jakarta Sans', system-ui, sans-serif);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.changehub-sidebar-brand {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    gap: 0.75rem;
    margin-bottom: 0 !important;
}

.changehub-sidebar-brand img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    flex-shrink: 0;
}

.changehub-sidebar-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.changehub-sidebar-brand-name {
    font-size: 1.125rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #fff;
}

.changehub-sidebar-brand-tag {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.55);
}

.changehub-sidebar-scroll {
    flex: 1;
    min-height: 0;
    position: relative;
    padding: 0.75rem 0.75rem 1rem;
}

.changehub-sidebar-nav {
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    padding-right: 2px;
    height: 100%;
}

.changehub-sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.changehub-sidebar-nav::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.changehub-sidebar-fade {
    position: absolute;
    left: 0;
    right: 0;
    height: 1.5rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1;
}

.changehub-sidebar-fade.is-visible {
    opacity: 1;
}

.changehub-sidebar-fade--top {
    top: 0;
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.9), transparent);
}

.changehub-sidebar-fade--bottom {
    bottom: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.9), transparent);
}

/* Sidebar nav items */
.changehub-sidebar-menu {
    --ch-nav-text: rgba(255, 255, 255, 0.88);
    --ch-nav-text-muted: rgba(255, 255, 255, 0.62);
    --ch-nav-text-hover: #ffffff;
    --ch-nav-group-text: rgba(255, 255, 255, 0.78);
    --ch-nav-icon: rgba(255, 255, 255, 0.72);
}

.changehub-sidebar-menu .nav-link {
    color: var(--ch-nav-text) !important;
    font-weight: 500;
    font-size: 0.9375rem;
    letter-spacing: -0.01em;
    line-height: 1.35;
    border-radius: 0.625rem;
    padding: 0.5rem 0.75rem;
    transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    margin-bottom: 1px;
}

.changehub-sidebar-menu .nav-link:hover {
    color: var(--ch-nav-text-hover) !important;
    background: rgba(255, 255, 255, 0.1);
}

.changehub-sidebar-menu .nav-link.active {
    color: var(--ch-nav-text-hover) !important;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.42), rgba(20, 184, 166, 0.22));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
    font-weight: 600;
}

.changehub-nav-group-toggle {
    display: flex;
    align-items: center;
    border: 0;
    background: transparent;
    color: var(--ch-nav-group-text) !important;
    font-weight: 700;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.625rem 0.75rem !important;
    margin-top: 0.625rem;
    line-height: 1.3;
}

.changehub-nav-group-toggle > .bi:first-child {
    color: var(--ch-nav-icon);
    font-size: 0.9375rem;
    opacity: 1;
}

.changehub-nav-group:first-child .changehub-nav-group-toggle {
    margin-top: 0;
}

.changehub-nav-group-toggle:hover {
    color: var(--ch-nav-text-hover) !important;
    background: rgba(255, 255, 255, 0.06) !important;
}

.changehub-nav-group-toggle:hover > .bi:first-child {
    color: rgba(167, 139, 250, 0.95);
}

.changehub-nav-group-toggle:not(.collapsed) {
    color: rgba(255, 255, 255, 0.92) !important;
}

.changehub-nav-group-toggle:not(.collapsed) > .bi:first-child {
    color: rgba(129, 140, 248, 0.95);
}

.changehub-nav-group-toggle.collapsed .changehub-nav-chevron {
    transform: rotate(-90deg);
}

.changehub-nav-chevron {
    font-size: 0.625rem;
    color: var(--ch-nav-text-muted);
    opacity: 1;
    transition: transform 0.2s ease, color 0.15s ease;
}

.changehub-nav-sub .nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ch-nav-text-muted) !important;
    padding-left: 2.125rem !important;
    opacity: 1;
    position: relative;
}

.changehub-nav-sub .nav-link::before {
    content: '';
    position: absolute;
    left: 0.875rem;
    top: 50%;
    width: 4px;
    height: 4px;
    margin-top: -2px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.28);
    transition: background 0.15s ease, transform 0.15s ease;
}

.changehub-nav-sub .nav-link:hover {
    color: var(--ch-nav-text) !important;
}

.changehub-nav-sub .nav-link:hover::before {
    background: rgba(255, 255, 255, 0.55);
}

.changehub-nav-sub .nav-link.active {
    color: var(--ch-nav-text-hover) !important;
    font-weight: 600;
}

.changehub-nav-sub .nav-link.active::before {
    background: var(--ch-accent, #14b8a6);
    box-shadow: 0 0 6px rgba(20, 184, 166, 0.55);
    transform: scale(1.15);
}

.changehub-sidebar-footer {
    padding: 0.875rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.42);
    text-align: center;
}

/* ── Main area ── */
.changehub-main-wrap {
    flex: 1;
    margin-left: var(--ch-sidebar-width, 272px);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.changehub-header {
    height: var(--ch-header-height, 68px);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--ch-slate-200, #e2e8f0);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.changehub-header-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--ch-slate-900, #0f172a);
    letter-spacing: -0.03em;
    margin: 0;
    line-height: 1.3;
}

.changehub-header .breadcrumb + .changehub-header-title {
    margin-top: var(--ch-space-1, 0.25rem);
}

.changehub-header-subtitle {
    font-size: 0.8125rem;
    color: var(--ch-slate-500, #64748b);
    margin: var(--ch-space-1, 0.25rem) 0 0;
    line-height: 1.4;
}

.changehub-header-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.changehub-notif-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 0.625rem;
    border: 1px solid var(--ch-slate-200, #e2e8f0);
    background: #fff;
    color: var(--ch-slate-600, #475569);
    text-decoration: none;
    font-size: 1.125rem;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.changehub-notif-btn:hover {
    background: rgba(99, 102, 241, 0.06);
    border-color: rgba(99, 102, 241, 0.25);
    color: var(--ch-primary, #6366f1);
}

.changehub-notif-btn.is-active {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.35);
    color: var(--ch-primary, #6366f1);
}

.changehub-notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 1.125rem;
    height: 1.125rem;
    padding: 0 0.3rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 800;
    line-height: 1.125rem;
    text-align: center;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
}

.changehub-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--ch-primary, #6366f1), var(--ch-accent, #14b8a6));
    color: #fff;
    font-weight: 700;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
}

.changehub-user-info {
    display: none;
    flex-direction: column;
    line-height: 1.2;
}

@media (min-width: 576px) {
    .changehub-user-info {
        display: flex;
    }
}

.changehub-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ch-slate-800, #1e293b);
}

.changehub-user-role {
    font-size: 0.6875rem;
    color: var(--ch-slate-400, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.changehub-main {
    flex: 1;
    padding: var(--ch-space-6, 1.5rem);
    overflow-x: hidden;
}

/* Mobile sidebar toggle */
.changehub-sidebar-toggle {
    display: none;
    background: none;
    border: 1px solid var(--ch-slate-200, #e2e8f0);
    border-radius: 0.5rem;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    color: var(--ch-slate-700, #334155);
    font-size: 1.25rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.changehub-sidebar-toggle:hover {
    background: var(--ch-slate-100, #f1f5f9);
}

.changehub-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1035;
    backdrop-filter: blur(2px);
}

@media (max-width: 991.98px) {
    .changehub-sidebar {
        transform: translateX(-100%);
    }

    .changehub-sidebar.is-open {
        transform: translateX(0);
    }

    .changehub-sidebar-backdrop.is-visible {
        display: block;
    }

    .changehub-main-wrap {
        margin-left: 0;
    }

    .changehub-sidebar-toggle {
        display: inline-flex;
    }

    .changehub-main {
        padding: 1rem;
    }
}
