/* Browser-style tab strip used on the main shell (NOT on the attendance panel). */

.tabbar {
    display: flex;
    align-items: stretch;
    gap: 2px;
    padding: 6px 12px 0;
    background: var(--wt-bg);
    border-bottom: 1px solid var(--wt-border);
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
}

/* Hide native scrollbar for cleaner look on overflow */
.tabbar::-webkit-scrollbar { height: 4px; }
.tabbar::-webkit-scrollbar-thumb { background: var(--wt-border); border-radius: 4px; }

.tabbar-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px 6px 12px;
    border: 1px solid transparent;
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    background: transparent;
    color: var(--wt-fg-3);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    max-width: 200px;
    position: relative;
    /* Pull the active border down to merge with the content area below. */
    margin-bottom: -1px;
}

.tabbar-tab:hover { color: var(--wt-fg); background: var(--wt-bg-2); }

.tabbar-tab.is-active {
    background: var(--wt-bg-2);
    color: var(--wt-fg);
    border-color: var(--wt-border);
    border-bottom-color: var(--wt-bg-2);
}

.tabbar-tab.is-pinned { color: var(--wt-fg); }

.tabbar-tab-icon {
    font-size: 13px;
    line-height: 1;
    flex-shrink: 0;
}

.tabbar-tab-title {
    overflow: hidden;
    text-overflow: ellipsis;
}

.tabbar-tab-close {
    background: transparent;
    border: 0;
    color: var(--wt-fg-4);
    cursor: pointer;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    margin-left: 2px;
    padding: 0;
}

.tabbar-tab-close:hover { background: rgba(255, 255, 255, 0.10); color: var(--wt-fg); }

.tabbar-tab-pin { font-size: 9px; opacity: 0.7; margin-left: 2px; }

/* Plus button + menu */
.tabbar-add-wrap { position: relative; }

.tabbar-add {
    width: 26px;
    height: 26px;
    margin: 6px 0 0 4px;
    border-radius: 6px;
    background: transparent;
    border: 0;
    color: var(--wt-fg-3);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tabbar-add:hover { background: var(--wt-bg-2); color: var(--wt-fg); }

.tabbar-add-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: var(--wt-bg-2);
    border: 1px solid var(--wt-border);
    border-radius: 8px;
    padding: 4px;
    min-width: 180px;
    z-index: 50;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

/* Fixed-position variant — used when the popup must escape an ancestor's overflow:hidden.
   Inline style sets the actual top/left from element.getBoundingClientRect(). */
.tabbar-add-menu-fixed {
    position: fixed;
    margin-top: 0;
    z-index: 100;
}

.tabbar-add-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    background: transparent;
    border: 0;
    color: var(--wt-fg);
    font-size: 12.5px;
    text-align: left;
    border-radius: 6px;
    cursor: pointer;
}

.tabbar-add-item:hover { background: var(--wt-bg-3); }

.tabbar-add-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: transparent;
}
