:root {
    --ps-bg: #0b1220;
    --ps-bg2: #0e1730;
    --ps-panel: rgba(255,255,255,.06);
    --ps-panel2: rgba(255,255,255,.03);
    --ps-border: rgba(231,236,255,.12);
    --ps-text: #e7ecff;
    --ps-muted: #a9b4d6;
    --ps-accent: rgba(110,168,255,.95);
    --ps-accent-soft: rgba(110,168,255,.16);
    --ps-good: rgba(61,220,151,.95);
    --ps-good-soft: rgba(61,220,151,.14);
    --ps-shadow: 0 12px 30px rgba(0,0,0,.35);
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    background: radial-gradient(1100px 700px at 10% 0%, rgba(110,168,255,.22), transparent 55%), radial-gradient(900px 600px at 90% 20%, rgba(61,220,151,.15), transparent 55%), var(--ps-bg);
    color: var(--ps-text);
}

a {
    color: inherit;
}

    a.ps-link {
        color: var(--ps-text);
        text-decoration: none;
        border: 1px solid rgba(231,236,255,.12);
        background: rgba(255,255,255,.04);
        padding: 8px 12px;
        border-radius: 12px;
    }

        a.ps-link:hover {
            background: rgba(255,255,255,.07);
            border-color: rgba(231,236,255,.18);
        }

/* ===== App Shell ===== */
.ps-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 270px 1fr;
}

.ps-sidebar {
    padding: 14px;
    background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
    border-right: 1px solid rgba(231,236,255,.10);
}

.ps-main {
    padding: 16px 18px 28px;
}

.ps-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid rgba(231,236,255,.10);
    background: rgba(0,0,0,.14);
    border-radius: 16px;
    margin-bottom: 16px;
}

.ps-topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ps-topbar-pill {
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(169,180,214,.95);
}

.ps-topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ps-user {
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(169,180,214,.95);
    font-weight: 600;
}

.ps-content {
    max-width: 1200px;
}

/* ===== Nav ===== */
.ps-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 16px;
    text-decoration: none;
    border: 1px solid rgba(231,236,255,.10);
    background: rgba(0,0,0,.10);
}

    .ps-brand:hover {
        background: rgba(255,255,255,.05);
        border-color: rgba(231,236,255,.16);
    }

.ps-brand-logo {
    height: 34px;
    width: auto;
    display: block;
}

.ps-brand-name {
    font-weight: 900;
    letter-spacing: -.02em;
    line-height: 1.1;
}

.ps-brand-tag {
    color: rgba(169,180,214,.9);
    font-size: 12px;
    margin-top: 2px;
}

.ps-nav {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ps-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    text-decoration: none;
    border: 1px solid transparent;
    background: transparent;
}

    .ps-nav-link:hover {
        background: rgba(255,255,255,.05);
        border-color: rgba(231,236,255,.12);
    }

    .ps-nav-link.active {
        background: var(--ps-accent-soft);
        border-color: rgba(110,168,255,.35);
    }

.ps-nav-ico {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: .9;
}

.ps-nav-section {
    margin-top: 12px;
    padding: 10px 10px 6px;
    color: rgba(169,180,214,.9);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.ps-nav-footer {
    margin-top: 14px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(231,236,255,.10);
    background: rgba(0,0,0,.10);
}

.ps-nav-footer-title {
    font-weight: 800;
    font-size: 12px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgba(169,180,214,.95);
}

.ps-nav-footer-text {
    margin-top: 6px;
    color: rgba(169,180,214,.9);
    font-size: 12px;
    line-height: 1.35;
}

@media (max-width: 900px) {
    .ps-shell {
        grid-template-columns: 1fr;
    }

    .ps-sidebar {
        position: sticky;
        top: 0;
        z-index: 10;
    }
}

/* ===== Active rail + glow ===== */
.ps-nav-link {
    position: relative;
}

    .ps-nav-link.active::before {
        content: "";
        position: absolute;
        left: 6px;
        top: 8px;
        bottom: 8px;
        width: 3px;
        border-radius: 99px;
        background: rgba(110,168,255,.85);
        box-shadow: 0 0 0 6px rgba(110,168,255,.10);
    }

/* ===== User chip ===== */
.ps-userchip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 6px 6px;
    border-radius: 999px;
    border: 1px solid rgba(231,236,255,.12);
    background: rgba(255,255,255,.03);
}

.ps-avatar {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    letter-spacing: .02em;
    color: rgba(231,236,255,.95);
    background: radial-gradient(14px 14px at 30% 30%, rgba(110,168,255,.55), rgba(110,168,255,.18));
    border: 1px solid rgba(110,168,255,.35);
}

.ps-usertext {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.ps-username {
    font-weight: 800;
    font-size: 13px;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ps-useremail {
    color: rgba(169,180,214,.9);
    font-size: 12px;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== Collapse button ===== */
.ps-nav-wrap .ps-collapse-btn {
    width: 100%;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(231,236,255,.12) !important;
    background: rgba(255,255,255,.03) !important;
    color: var(--ps-text) !important;
    appearance: none;
    cursor: pointer;
}

    .ps-nav-wrap .ps-collapse-btn:hover {
        background: rgba(255,255,255,.06) !important;
        border-color: rgba(231,236,255,.18) !important;
    }

/* ===== Collapsed nav mode ===== */
html.ps-nav-collapsed .ps-shell {
    grid-template-columns: 86px 1fr;
}

html.ps-nav-collapsed .ps-sidebar {
    padding: 12px 10px;
}

html.ps-nav-collapsed .ps-brand {
    justify-content: center;
    padding: 10px 8px;
}

html.ps-nav-collapsed .ps-brand-logo {
    height: 34px;
}

html.ps-nav-collapsed .ps-brand-text {
    display: none;
}

html.ps-nav-collapsed .ps-nav-link {
    justify-content: center;
    padding: 10px;
}

    html.ps-nav-collapsed .ps-nav-link span:not(.ps-nav-ico) {
        display: none;
    }

html.ps-nav-collapsed .ps-nav-section {
    display: none;
}

html.ps-nav-collapsed .ps-nav-footer {
    display: none;
}

html.ps-nav-collapsed .ps-nav-link.active::before {
    left: 4px;
}

.ps-nav-ico svg {
    width: 20px;
    height: 20px;
    display: block;
}

.ps-nav-ico {
    color: rgba(231,236,255,.92);
}
