/* Header Global Structure */
#header-container {
    background: var(--bg-side);
    border-bottom: 1px solid var(--border);
    margin: -16px -24px 16px -24px; /* Offset parent padding */
}

.header-main-bar {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
}

.header-nav {
    display: flex;
    gap: 4px;
    margin: 0 24px;
    flex: 1;
}

.header-title-bar {
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.title-and-tabs {
    display: flex;
    align-items: center;
    gap: 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.logo i {
    color: var(--primary);
}

.logo span span {
    color: var(--text-muted);
    font-weight: 400;
}

.logo:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.nav-links {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-item:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.nav-status {
    display: flex;
    align-items: center;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.dot {
    width: 8px;
    height: 8px;
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

/* Sub Navigation */
.sub-nav {
    display: flex;
    gap: 8px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 12px;
    width: fit-content;
}

.sub-item {
    padding: 6px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.sub-item:hover {
    color: var(--text-main);
}

.sub-item.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

/* Tab/Sub Content Visibility */
.tab-content, .sub-content {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.tab-content.active, .sub-content.active {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sub-content {
    animation: slideUp 0.3s ease-out;
}

/* Nav Responsive */
@media (max-width: 768px) {
    .top-nav {
        padding: 0 20px;
        height: auto;
        min-height: 72px;
        flex-direction: column;
        padding-bottom: 12px;
    }
    .logo {
        margin: 8px 0;
    }
    .nav-links {
        width: 100%;
        justify-content: center;
        overflow-x: auto;
        padding-bottom: 2px;
    }
    .nav-item span {
        display: none;
    }
    .nav-status {
        display: none;
    }
}

/* User Profile in Header */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 16px;
    margin-right: 16px;
    border-right: 1px solid var(--border);
}

#user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

.icon-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.icon-btn:hover {
    color: #ef4444;
    background: #fef2f2;
    border-color: #fca5a5;
}
