.app-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--wa-bg);
    border-right: 1px solid var(--border);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    animation: fade-up var(--motion-slow) var(--ease-out) both;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.32rem;
    font-weight: 800;
    color: #ffffff;
}

#notificationBell {
    position: relative;
}

.notification-bell-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    cursor: pointer;
    transition: background var(--motion-fast) ease, transform var(--motion-fast) var(--ease-out);
}

.notification-bell-btn:hover {
    background: var(--hover);
    transform: translateY(-1px);
}

.notification-bell-icon {
    width: 1.1rem;
    height: 1.1rem;
    color: inherit;
}

.notification-type-indicator {
    position: absolute;
    left: -2px;
    bottom: -2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.24);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: #50606a;
}

.notification-type-indicator .ui-icon {
    width: 0.7rem;
    height: 0.7rem;
}

.notification-type-message { background: #14866d; }
.notification-type-group { background: #4d7a36; }
.notification-type-follow { background: #9b6a28; }
.notification-type-connection { background: #2e6e96; }
.notification-type-post { background: #5d5f99; }
.notification-type-general { background: #50606a; }

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    color: var(--white);
    background: var(--danger);
    border-radius: 9px;
}

.notification-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    min-width: 320px;
    max-width: 380px;
    max-height: min(70vh, 520px);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 100;
    transform-origin: top right;
}

.notification-dropdown.open {
    display: flex;
    flex-direction: column;
    animation: soft-pop var(--motion-base) var(--ease-out) both;
}

.notification-dropdown-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.notification-dropdown-list {
    overflow-y: auto;
    max-height: min(58vh, 420px);
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    color: var(--text);
    transition: background-color var(--motion-fast) ease;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item.unread {
    background: var(--hover);
}

.notification-item-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.notification-item-text {
    line-height: 1.35;
}

.notification-item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.notification-item-time {
    font-size: 0.78rem;
    white-space: nowrap;
}

.notification-type-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.1;
    color: #d5dde2;
    background: rgba(255, 255, 255, 0.07);
}

.notification-type-pill .ui-icon {
    width: 0.78rem;
    height: 0.78rem;
}

.notification-type-pill.notification-type-message { background: rgba(20, 134, 109, 0.24); color: #9ce6d7; }
.notification-type-pill.notification-type-group { background: rgba(77, 122, 54, 0.26); color: #c7e7b8; }
.notification-type-pill.notification-type-follow { background: rgba(155, 106, 40, 0.28); color: #f0d1a5; }
.notification-type-pill.notification-type-connection { background: rgba(46, 110, 150, 0.28); color: #b9dcf3; }
.notification-type-pill.notification-type-post { background: rgba(93, 95, 153, 0.3); color: #d0d2ff; }
.notification-type-pill.notification-type-general { background: rgba(80, 96, 106, 0.32); color: #d0d8dd; }

.notification-item .avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
}

.notification-empty {
    padding: 24px 16px;
    text-align: center;
}

.notification-mark-read {
    margin: 12px 16px;
    align-self: flex-start;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-link {
    position: relative;
    display: block;
    padding: 11px 13px;
    border-radius: 11px;
    color: var(--text-secondary);
    font-weight: 700;
    transition: background var(--motion-fast) ease, color var(--motion-fast) ease, transform var(--motion-fast) var(--ease-out);
}

.nav-link:hover,
.nav-link.active {
    background: var(--primary-soft);
    color: var(--text);
}

.nav-link:hover {
    transform: translateX(2px);
}

.nav-dot {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    flex-shrink: 0;
}

.nav-dot.hidden {
    display: none;
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    transition: transform var(--motion-base) var(--ease-out), box-shadow var(--motion-base) var(--ease-out);
}

.user-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(28, 31, 28, 0.08);
}

.user-badge .avatar-img {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.main {
    padding: 22px;
    overflow: auto;
    animation: fade-up var(--motion-slow) var(--ease-out) both;
    background: var(--wa-bg);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    background: rgba(17, 27, 33, 0.98);
    backdrop-filter: blur(8px);
    color: #ffffff;
    transition: transform var(--motion-base) var(--ease-out), box-shadow var(--motion-base) var(--ease-out);
}

.topbar .page-title,
.topbar h1 {
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.02em;
}

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

.notification-bell-mobile {
    display: none;
    position: relative;
}

/* ---- Profile Switcher (Personal / Professional) ---- */
.profile-switcher-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
}
.profile-switcher-overlay.hidden {
    display: none !important;
}
.profile-switcher-panel {
    width: 100%;
    max-width: 360px;
    padding: 0;
    overflow: hidden;
}
.profile-switcher-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}
.profile-switcher-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
}
.profile-switcher-close:hover {
    color: var(--text);
}
.profile-switcher-modes {
    display: flex;
    flex-direction: column;
}
.profile-switcher-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 18px;
    border: none;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background var(--motion-fast) ease;
}
.profile-switcher-row:hover {
    background: var(--hover);
}
.profile-switcher-row.active {
    background: var(--primary-soft);
    color: var(--primary-dark);
}
.profile-switcher-check {
    color: var(--primary);
    width: 1rem;
    height: 1rem;
}
.profile-switcher-actions {
    padding: 12px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.profile-switcher-actions .btn-block {
    display: block;
    width: 100%;
}
.profile-switcher-actions a.btn-block {
    text-decoration: none;
}

.profile-switcher-row-disabled,
.profile-switcher-row:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.profile-switcher-note {
    padding: 10px 18px;
    margin: 0;
    font-size: 0.82rem;
    border-top: 1px solid var(--border);
}

.grid {
    display: grid;
    gap: 16px;
}

.grid.two {
    grid-template-columns: 340px 1fr;
}

/* Tablet and below: same as mobile; single column, no sidebar */
@media (max-width: 1024px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .grid.two {
        grid-template-columns: 1fr;
    }
}
