/* ═══════════════════════════════════════════════════════════
   Navigation — extracted from TNonline (Sidebar / MainLayout)
   Dark vertical sidebar: brand, section labels, nav items with
   icons, active/hover states, and a user footer. Built to sit
   in a fixed-width column (var(--tn-sidebar-width)).
   ═══════════════════════════════════════════════════════════ */

.tn-sidebar {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: var(--tn-sidebar-width);
    background-color: var(--tn-sidebar-bg);
    color: var(--tn-text-on-dark);
    font-family: var(--tn-font-family);
}

/* ── Brand ── */
.tn-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 28px 22px 20px;
}

/* On phones the sidebar is used as a full-width top bar / drawer, not a
   252px column. Without this it stays 252px wide inside a full-width
   container, so a `margin-left:auto` toggler lands mid-screen instead of
   the corner (the "off-center hamburger"). Fill the width and sit the
   brand row on the page gutter so the toggler aligns to the screen edge. */
@media (max-width: 640px) {
    .tn-sidebar {
        width: 100%;
    }

    .tn-sidebar-brand {
        padding: 16px var(--tn-page-pad-x);
    }
}

.tn-brand-text {
    font-size: var(--tn-font-size-lg);
    font-weight: 700;
    color: var(--tn-text-on-dark-bright);
    letter-spacing: -0.01em;
}

/* ── Section labels ── */
.tn-nav-label {
    padding: 24px 22px 6px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.28);
}

.tn-nav-section {
    display: flex;
    flex-direction: column;
}

/* ── Nav items ── */
.tn-nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 22px;
    margin: 1px 10px;
    color: var(--tn-text-on-dark);
    text-decoration: none;
    font-size: var(--tn-font-size-sm);
    font-weight: 400;
    transition: background 0.12s ease, color 0.12s ease;
    cursor: pointer;
    border: none;
    background: none;
    border-radius: 5px;
    font-family: inherit;
    width: calc(100% - 20px);
    box-sizing: border-box;
}

.tn-nav-item:hover {
    background: var(--tn-sidebar-hover);
    color: var(--tn-text-on-dark-bright);
    text-decoration: none;
}

.tn-nav-item:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--tn-accent);
}

.tn-nav-item.is-active {
    background: var(--tn-sidebar-active);
    color: #fff;
    font-weight: 500;
}

.tn-nav-item i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    width: 20px;
    min-width: 20px;
    flex-shrink: 0;
    opacity: 0.55;
}

.tn-nav-item:hover i,
.tn-nav-item.is-active i {
    opacity: 1;
}

.tn-nav-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tn-sidebar-spacer {
    flex: 1;
}

/* ── User footer ── */
.tn-sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.tn-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--tn-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.tn-user-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.tn-user-name {
    font-size: var(--tn-font-size-sm);
    font-weight: 500;
    color: var(--tn-text-on-dark-bright);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tn-user-email {
    font-size: var(--tn-font-size-xs);
    color: rgba(255, 255, 255, 0.35);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

/* ── Horizontal tab nav (page-level sub-navigation) ── */
.tn-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--tn-border);
}

.tn-tab {
    padding: 10px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--tn-text-secondary);
    font-size: var(--tn-font-size-sm);
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: color var(--tn-transition), border-color var(--tn-transition);
}

.tn-tab:hover {
    color: var(--tn-text-primary);
}

.tn-tab.is-active {
    color: var(--tn-accent);
    border-bottom-color: var(--tn-accent);
}
