/* ============ LAYOUT ============ */
.app {
    display: flex;
    min-height: 100vh;
}

/* ============ SIDEBAR ============ */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--bg-elev), #090e19);
    border-right: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    transition: width .32s cubic-bezier(.65, 0, .35, 1), transform .32s cubic-bezier(.65, 0, .35, 1);
    overflow: hidden;
    z-index: 100;
}

.sidebar.collapsed {
    width: var(--sidebar-w-collapsed);
}

.sb-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 20px 18px;
    border-bottom: 1px solid var(--border-soft);
    flex-shrink: 0;
    white-space: nowrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent), var(--mint));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk';
    font-weight: 700;
    font-size: 16px;
    color: #06101f;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 6px 16px -4px rgba(76, 126, 255, .5);
}

.brand-name {
    font-weight: 700;
    font-size: 16.5px;
    letter-spacing: .2px;
}

.brand-sub {
    font-size: 10.5px;
    color: var(--text-faint);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-top: 1px;
}

.sb-toggle {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .2s, color .2s, transform .32s;
}

.sb-toggle:hover {
    background: var(--surface-2);
    color: var(--text);
}

.sidebar.collapsed .sb-toggle svg {
    transform: rotate(180deg);
}

.sb-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 14px 20px;
}

.sb-section-label {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 1.3px;
    text-transform: uppercase;
    color: var(--text-faint);
    padding: 14px 10px 8px;
    white-space: nowrap;
}

.sidebar.collapsed .sb-section-label,
.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .client-meta,
.sidebar.collapsed .sb-foot-text {
    opacity: 0;
    pointer-events: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    border-radius: 10px;
    margin-bottom: 2px;
    color: var(--text-dim);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: background .18s, color .18s;
    white-space: nowrap;
    position: relative;
}

.nav-item svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.nav-item:hover {
    background: var(--surface);
    color: var(--text);
}

.nav-item.active {
    background: var(--accent-soft);
    color: #bfd2ff;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -14px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    border-radius: 3px;
    background: var(--accent);
}

.nav-label {
    flex: 1;
    transition: opacity .15s;
}

.nav-badge {
    font-family: 'JetBrains Mono';
    font-size: 10px;
    font-weight: 600;
    background: var(--surface-2);
    color: var(--text-dim);
    padding: 2px 6px;
    border-radius: 6px;
    transition: opacity .15s;
}

.client-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 10px;
    margin-bottom: 1px;
    cursor: pointer;
    transition: background .18s;
    white-space: nowrap;
}

.client-row:hover {
    background: var(--surface);
}

.client-avatar {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10.5px;
    font-weight: 700;
    color: #06101f;
    font-family: 'Space Grotesk';
}

.client-meta {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity .15s;
}

.client-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-dots {
    display: flex;
    gap: 3px;
    margin-top: 2px;
}

.pdot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.sb-foot {
    padding: 14px 18px 18px;
    border-top: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    white-space: nowrap;
}

.avatar-ring {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--amber), #e0722a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: #1a0f00;
}

.sb-foot-text {
    overflow: hidden;
    transition: opacity .15s;
}

.sb-foot-name {
    font-size: 13px;
    font-weight: 600;
}

.sb-foot-role {
    font-size: 11px;
    color: var(--text-faint);
}

/* mobile overlay */
.sb-scrim {
    display: none;
}

@media (max-width:900px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 20px 0 60px rgba(0, 0, 0, .5);
    }

    .sidebar.collapsed {
        width: 280px;
    }

    .sb-scrim {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(4, 6, 12, .6);
        backdrop-filter: blur(2px);
        z-index: 90;
    }

    .sb-scrim.show {
        display: block;
    }
}

/* ============ MAIN ============ */
.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 28px;
    background: rgba(8, 12, 22, .82);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-soft);
}

.hamburger {
    display: none;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-dim);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

@media (max-width:900px) {
    .hamburger {
        display: flex;
    }
}

.topbar-title {
    margin-right: auto;
}

.eyebrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 3px;
}

.page-title {
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -.2px;
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--mint);
    display: inline-block;
    margin-left: 9px;
    box-shadow: 0 0 0 0 rgba(34, 211, 172, .6);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 211, 172, .55);
    }

    70% {
        box-shadow: 0 0 0 7px rgba(34, 211, 172, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(34, 211, 172, 0);
    }
}

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

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    color: var(--text-faint);
    width: 230px;
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 13px;
    width: 100%;
    font-family: 'Inter';
}

.search-box svg {
    flex-shrink: 0;
}

@media (max-width:760px) {
    .search-box {
        display: none;
    }
}

.select-pill {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text);
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    cursor: pointer;
    position: relative;
}

.icon-btn .dot {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--coral);
    border: 1.5px solid var(--bg-elev);
}

.topbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--amber), #e0722a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: #1a0f00;
    cursor: pointer;
}

.content {
    padding: 26px 28px 60px;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
}
