/**
 * Nexora — dashboard shell (sidebar + topbar + mobile drawer).
 */

body.nex-app {
    margin: 0;
    font-family: var(--font-body);
    background: var(--nex-bg);
    color: var(--nex-text);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.nex-shell {
    display: grid;
    grid-template-columns: var(--nex-sidebar-w) 1fr;
    min-height: 100vh;
}

.nex-sidebar {
    background: var(--nex-sidebar-bg);
    border-right: 1px solid var(--nex-sidebar-border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    color: var(--nex-sidebar-text);
}

.nex-brand {
    padding: 1.15rem 1.1rem;
    border-bottom: 1px solid var(--nex-sidebar-border);
}

.nex-brand-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.nex-brand-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.04em;
}

.nex-brand-sub {
    font-size: 0.58rem;
    letter-spacing: 0.16em;
    color: var(--nex-sidebar-muted);
    font-weight: 600;
}

.nex-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.65rem 0.55rem 1rem;
}

.nex-nav-section + .nex-nav-section {
    margin-top: 0.35rem;
}

.nex-nav-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--nex-sidebar-faint);
    padding: 0.75rem 0.7rem 0.35rem;
}

.nex-nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.58rem 0.75rem;
    border-radius: 10px;
    color: var(--nex-sidebar-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.86rem;
    min-height: 42px;
    transition: background 0.15s, color 0.15s;
}

.nex-nav-link i { width: 1rem; text-align: center; font-size: 0.85rem; }

.nex-nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--nex-sidebar-text);
}

.nex-nav-link.active {
    background: var(--nex-gradient);
    color: #fff;
    box-shadow: 0 6px 18px rgba(124, 58, 237, 0.35);
}

.nex-side-foot {
    padding: 0.85rem;
    border-top: 1px solid var(--nex-sidebar-border);
    flex-shrink: 0;
}

.nex-upgrade-card {
    background: rgba(124, 58, 237, 0.18);
    border: 1px solid rgba(167, 139, 250, 0.25);
    border-radius: var(--nex-radius-sm);
    padding: 0.85rem;
    margin-bottom: 0.65rem;
}

.nex-upgrade-card strong { display: block; font-size: 0.88rem; margin-bottom: 0.25rem; }
.nex-upgrade-card p { margin: 0 0 0.65rem; font-size: 0.78rem; color: var(--nex-sidebar-muted); }

.nex-logout {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--nex-sidebar-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.45rem 0.35rem;
}

.nex-main { min-width: 0; display: flex; flex-direction: column; }

.nex-topbar {
    height: var(--nex-topbar-h);
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0 1.25rem;
    background: var(--nex-surface);
    border-bottom: 1px solid var(--nex-border);
    position: sticky;
    top: 0;
    z-index: 20;
}

.nex-burger {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--nex-border);
    border-radius: 10px;
    background: var(--nex-surface);
    color: var(--nex-text);
    cursor: pointer;
}

.nex-topbar-titles h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 800;
}

.nex-topbar-titles p {
    margin: 0.1rem 0 0;
    font-size: 0.85rem;
    color: var(--nex-text-muted);
}

.nex-topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.nex-icon-btn {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--nex-border);
    color: var(--nex-text-soft);
    text-decoration: none;
    position: relative;
}

.nex-userchip {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.35rem 0.65rem 0.35rem 0.35rem;
    border: 1px solid var(--nex-border);
    border-radius: 999px;
    background: var(--nex-surface);
}

.nex-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--nex-gradient);
    color: #fff;
    font-weight: 800;
    font-size: 0.85rem;
}

.nex-username {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--nex-text-soft);
}

.nex-content {
    padding: 1.25rem;
    flex: 1;
}

.nex-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 10, 20, 0.55);
    z-index: 90;
}

@media (max-width: 1023px) {
    .nex-shell { grid-template-columns: 1fr; }
    .nex-burger { display: inline-flex; align-items: center; justify-content: center; }

    .nex-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 100;
        width: min(var(--nex-sidebar-w), 88vw);
        transform: translateX(-105%);
        transition: transform 0.22s ease;
        box-shadow: var(--nex-shadow);
    }

    body.nex-sidebar-open .nex-sidebar { transform: translateX(0); }
    body.nex-sidebar-open .nex-backdrop { display: block; }
}

@media (max-width: 640px) {
    .nex-username { display: none; }
    .nex-content { padding: 1rem; }
}
