/* ===== Tab Navigation ===== */
.tab-nav {
    display: flex;
    gap: 0.125rem;
    background: var(--color-bg);
    border-radius: 0.375rem;
    padding: 0.1875rem;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}

.tab-nav::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    flex: 1;
    padding: 0.375rem 1rem;
    border: none;
    border-radius: 0.25rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    color: var(--color-text-secondary);
    transition: all var(--transition);
    white-space: nowrap;
}

.tab-btn:hover {
    background: var(--color-surface);
    color: var(--color-text);
}

.tab-btn--active {
    background: var(--color-surface);
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.tab-btn--active:hover {
    background: var(--color-surface);
    color: var(--color-primary);
}

.tab-content {
    display: none;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.tab-content--active {
    display: flex;
    flex-direction: column;
    animation: fadeIn 200ms ease;
}

/* Ensure data-module wrappers inside tab content fill available space */
.tab-content > [data-module] {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ===== H5: tabs stretch full width ===== */
@media (max-width: 640px) {
    .tab-nav {
        width: 100%;
    }

    .tab-btn {
        padding: 0.5rem 0.5rem;
        font-size: 0.8125rem;
    }
}
