.topbar {
    height: var(--header-height);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 30;
}

.topbar-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.topbar-title {
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.topbar-search {
    position: relative;
}

.topbar-search-icon {
    width: 16px;
    height: 16px;
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.topbar-search-input {
    width: 260px;
    padding: 10px 12px 10px 36px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: 13px;
}

.topbar-search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-card);
}

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

.icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.icon-btn:hover {
    background: var(--bg-body);
    color: var(--text-primary);
}

.icon-btn .icon {
    width: 18px;
    height: 18px;
}

.icon-badge {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--danger);
    position: absolute;
    top: 10px;
    right: 10px;
    border: 2px solid var(--bg-card);
}

.notifications-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 340px;
    min-width: 340px;
    max-width: 90vw;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    overflow-y: auto;
    max-height: 80vh;
    z-index: 9999;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    white-space: normal;
    word-wrap: break-word;
}

.notifications-panel.hidden {
    opacity: 0;
    transform: translateY(-10px);
    visibility: hidden;
    pointer-events: none;
}

.notifications-header {
    padding: 12px 14px;
    background: var(--bg-body);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notifications-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.notifications-action {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.notifications-body {
    max-height: 280px;
    overflow: auto;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    text-decoration: none;
    border-bottom: 1px solid var(--border-light);
}

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

.notification-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-top: 4px;
    flex-shrink: 0;
}

.notification-dot.danger {
    background: var(--danger);
}

.notification-dot.success {
    background: var(--success);
}

.notification-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.notification-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.notification-desc {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .topbar {
        display: none;
    }

    .topbar-search {
        display: none;
    }
}