/* ==========================================================================
   Global header — incrementaldb-inspired topbar
   Self-contained dark palette so it works on all pages (not just .home).
   ========================================================================== */

.topbar {
    box-sizing: border-box;
    width: 100%;
    height: 85px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.85);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 100;
    font-family: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    letter-spacing: -0.3px;
}

.topbar__inner {
    box-sizing: border-box;
    width: 100%;
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.topbar__left,
.topbar__right {
    display: flex;
    align-items: center;
    min-width: 0;
}

/* Logo */
.topbar__logo {
    display: flex;
    align-items: center;
    height: 38px;
    min-width: 27px;
    margin-right: 16px;
    cursor: pointer;
    text-decoration: none;
}

.topbar__logo-img {
    height: 38px;
    width: auto;
    display: block;
}

/* Nav */
.topbar__nav {
    display: flex;
    align-items: center;
    gap: 2px;
}

.topbar__nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 11px 20px;
    height: 100%;
    color: #aaaab1;
    font-size: 14px;
    text-decoration: none;
    box-sizing: border-box;
    transition: color 0.15s ease, background 0.15s ease;
    white-space: nowrap;
    cursor: pointer;
}

.topbar__nav-item:hover {
    color: #fff;
    background-color: #14141a;
    border-radius: 8px;
}

.topbar__nav-item--active {
    color: #fff;
}

.topbar__nav-icon {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.topbar__nav-icon svg {
    width: 100%;
    height: 100%;
}

.topbar__nav-text {
    line-height: 1;
}

/* Right side */
.topbar__right {
    justify-content: flex-end;
    gap: 12px;
}

/* Search */
.topbar__search {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 20px;
    border-radius: 10px;
    background-color: #14141a;
    border: 1px solid #14141a;
    color: #aaaab1;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.topbar__search:hover {
    color: #fff;
    border-color: #2a2e36;
}

.topbar__search-icon {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.topbar__search-icon svg {
    width: 100%;
    height: 100%;
}

/* Actions */
.topbar__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar__icon-btn {
    position: relative;
    width: 41px;
    height: 38px;
    border-radius: 10px;
    background-color: #14141a;
    border: 1px solid #14141a;
    color: #aaaab1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.topbar__icon-btn:hover {
    color: #fff;
    border-color: #2a2e36;
}

.topbar__icon-btn svg {
    width: 16px;
    height: 16px;
}

.topbar__badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background-color: #f1465a;
    color: #fff;
    border-radius: 50%;
    width: 12px;
    height: 12px;
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* Avatar + dropdown */
.topbar__avatar-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
}

.topbar__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: auto;
}

.topbar__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background-color: #0f0f13;
    border: 1px solid #2a2e36;
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 110;
    display: none;
}

.topbar__dropdown.show {
    display: block;
}

.topbar__dropdown-header {
    padding: 8px 10px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    border-bottom: 1px solid #2a2e36;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar__dropdown-item {
    display: block;
    padding: 7px 10px;
    border-radius: 6px;
    color: #aaaab1;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.15s ease, background 0.15s ease;
}

.topbar__dropdown-item:hover {
    color: #fff;
    background-color: #14141a;
}

.topbar__dropdown-divider {
    height: 1px;
    background-color: #2a2e36;
    margin: 4px 0;
}

/* Login */
.topbar__login {
    display: inline-flex;
    align-items: center;
    height: 38px;
    padding: 0 18px;
    border-radius: 10px;
    background-color: #4747d6;
    border: 1px solid #4747d6;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease;
}

.topbar__login:hover {
    background-color: #3535cd;
    color: #fff;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 992px) {
    .topbar {
        height: 64px;
    }
    .topbar__nav-item {
        padding: 8px 10px;
    }
    .topbar__search-text {
        display: none;
    }
    .topbar__search {
        padding: 0 12px;
    }
}

@media (max-width: 640px) {
    .topbar__nav {
        display: none;
    }
    .topbar__nav-item--active {
        display: none;
    }
    .topbar__logo {
        margin-right: 0;
    }
}
