/* Top Header Styles */

.top-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: var(--surface-color);
    border-bottom: 1px solid #F1F5F9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 998;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    max-width: 600px;
}

.sidebar-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: #F8FAFC;
    color: var(--text-primary);
}

.header-search {
    position: relative;
    flex: 1;
    max-width: 500px;
}

.header-search i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 16px;
    pointer-events: none;
    z-index: 1;
}

.search-input {
    width: 100%;
    padding: 10px 16px 10px 44px;
    border: 2px solid #F1F5F9;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    transition: all 0.2s;
    background: #F8FAFC;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Icon Buttons */
.header-icon-btn {
    position: relative;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--primary-color);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.notification-badge.bg-danger {
    background: var(--danger-color);
}

/* Profile Button */
.profile-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px 6px 6px;
    border: 2px solid #F1F5F9;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.profile-btn:hover {
    border-color: var(--primary-light);
    background: #F8FAFC;
}

.profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.profile-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.profile-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.profile-role {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.2;
}

.profile-btn i {
    color: var(--text-secondary);
    font-size: 12px;
}

/* Dropdowns */
.notification-dropdown {
    width: 360px;
    border: 1px solid #F1F5F9;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 0;
    margin-top: 8px;
    z-index: 1000;
    background: white;
}

.notification-dropdown .dropdown-header {
    padding: 16px 20px;
    border-bottom: 1px solid #F1F5F9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notification-dropdown .dropdown-header h6 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #F8FAFC;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
}

.notification-item:hover {
    background: #F8FAFC;
}

.notification-item.unread {
    background: #F8FAFC;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
}

.notification-icon.bg-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
}

.notification-icon.bg-success {
    background: linear-gradient(135deg, var(--success-color), #34D399);
}

.notification-icon.bg-warning {
    background: linear-gradient(135deg, var(--warning-color), #FBBF24);
}

.notification-icon.bg-danger {
    background: linear-gradient(135deg, var(--danger-color), #F87171);
}

.notification-icon.bg-info {
    background: linear-gradient(135deg, var(--info-color), #60A5FA);
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.notification-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.notification-time {
    font-size: 12px;
    color: var(--text-secondary);
}

.notification-dropdown .dropdown-footer {
    padding: 12px 20px;
    border-top: 1px solid #F1F5F9;
    text-align: center;
}

.notification-dropdown .dropdown-footer a {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
}

.notification-dropdown .dropdown-footer a:hover {
    color: var(--primary-dark);
}

/* Profile Dropdown */
.profile-dropdown {
    width: 280px;
    border: 1px solid #F1F5F9;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 0;
    margin-top: 8px;
    z-index: 1000;
    background: white;
}

.profile-dropdown .dropdown-header {
    padding: 24px 20px;
    text-align: center;
    border-bottom: 1px solid #F1F5F9;
}

.profile-avatar-large {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 24px;
    margin: 0 auto 12px;
}

.profile-dropdown .dropdown-header h6 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.profile-dropdown .dropdown-header p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.profile-dropdown .dropdown-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.2s;
    text-decoration: none;
}

.profile-dropdown .dropdown-item:hover {
    background: #F8FAFC;
}

.profile-dropdown .dropdown-item i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.profile-dropdown .dropdown-item.text-danger {
    color: var(--danger-color);
}

.profile-dropdown .dropdown-divider {
    margin: 0;
    border-top: 1px solid #F1F5F9;
}

/* Main Content Adjustment */
.main-content {
    margin-top: var(--header-height);
}

/* Responsive */
@media (max-width: 768px) {
    .top-header {
        left: 0;
        padding: 0 16px;
    }

    .sidebar-toggle {
        display: flex;
    }

    .header-search {
        width: 200px;
    }

    .profile-info {
        display: none;
    }

    .notification-dropdown,
    .profile-dropdown {
        width: 300px;
    }
}

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

    .notification-dropdown,
    .profile-dropdown {
        width: calc(100vw - 32px);
    }
}