/* Ace Timing - Navigation Banner */
/* Scoped with nb- prefix to avoid style conflicts */

.nb-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: #1a2332;
    display: flex;
    align-items: center;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    user-select: none;
}

.nb-nav.nb-autohide {
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.nb-nav.nb-autohide.nb-visible {
    transform: translateY(0);
}

.nb-spacer {
    height: 48px;
    display: block;
}

/* Brand */
.nb-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    height: 100%;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
    text-decoration: none;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.nb-brand:hover {
    background: rgba(255, 255, 255, 0.05);
}

.nb-brand-icon {
    font-size: 20px;
    line-height: 1;
}

/* Menu container */
.nb-menu {
    display: flex;
    height: 100%;
    align-items: stretch;
    flex: 1;
}

/* Nav group (dropdown) */
.nb-group {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.nb-group-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 100%;
    padding: 0 14px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.nb-group-btn:hover,
.nb-group.nb-open .nb-group-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.nb-group.nb-active .nb-group-btn {
    color: #60a5fa;
}

.nb-group-btn::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    opacity: 0.6;
}

/* Dropdown panel */
.nb-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: #1e2d3d;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    padding: 6px 0;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-top: 2px solid #3b82f6;
}

.nb-group.nb-open .nb-dropdown {
    display: block;
}

.nb-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 13px;
    font-family: inherit;
    transition: background 0.15s, color 0.15s;
}

.nb-dropdown a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.nb-dropdown a.nb-current {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    font-weight: 600;
}

.nb-dropdown a.nb-current::before {
    content: '\25B8';
    font-size: 10px;
}

/* Hamburger (mobile) */
.nb-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    margin-left: auto;
    padding: 0;
    font-family: inherit;
}

.nb-hamburger:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Mobile overlay */
.nb-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
}

.nb-overlay.nb-show {
    display: block;
}

/* Mobile panel */
.nb-mobile-panel {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100%;
    background: #1a2332;
    z-index: 10002;
    overflow-y: auto;
    padding: 16px 0;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

.nb-mobile-panel.nb-show {
    display: block;
}

.nb-mobile-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    cursor: pointer;
    margin-left: auto;
    margin-right: 12px;
    border-radius: 4px;
    font-family: inherit;
}

.nb-mobile-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nb-mobile-group-label {
    padding: 16px 20px 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.35);
}

.nb-mobile-panel a {
    display: block;
    padding: 10px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    font-family: inherit;
    transition: background 0.15s;
}

.nb-mobile-panel a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.nb-mobile-panel a.nb-current {
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.12);
    font-weight: 600;
    border-left: 3px solid #3b82f6;
    padding-left: 17px;
}

/* User area (right side) */
.nb-user-area {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    padding: 0 12px;
    height: 100%;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.nb-user-name {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nb-role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.nb-auth-btn {
    padding: 5px 14px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
}

.nb-login-btn {
    background: rgba(59, 130, 246, 0.25);
    color: #60a5fa;
}

.nb-login-btn:hover {
    background: rgba(59, 130, 246, 0.4);
}

.nb-logout-btn {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.nb-logout-btn:hover {
    background: rgba(239, 68, 68, 0.35);
}

/* Mobile user area */
.nb-mobile-user-area {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 16px;
    padding-top: 12px;
}

.nb-mobile-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
}

.nb-mobile-user-area a {
    display: block;
    padding: 10px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    font-family: inherit;
    transition: background 0.15s;
}

.nb-mobile-user-area a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.nb-mobile-user-area #nb-mobile-logout {
    color: #f87171;
}

/* Hide user area on mobile (shown in slide-out panel instead) */
@media (max-width: 900px) {
    .nb-user-area {
        display: none;
    }
}

/* Responsive */
@media (max-width: 900px) {
    .nb-menu {
        display: none;
    }

    .nb-hamburger {
        display: flex;
    }
}


/* D4: Global navbar auto-hide (all pages) — VISUAL only.
   Do NOT set pointer-events:none on the hidden nav. The only element in the
   nav's 48px viewport footprint is the non-interactive .nb-spacer (which
   merely reserves space below the fixed nav), so an always-hit-testable nav
   blocks nothing usable. Disabling pointer-events (an earlier D4 revision)
   made #nb-logout-btn unclickable when the nav was idle-hidden: the click
   passed THROUGH the transparent nav and landed on the spacer below —
   empirically confirmed by Playwright ("nb-spacer intercepts pointer events
   over nb-logout-btn"). Keeping pointer-events at its default (auto) means
   the logout button is always clickable; the nav just fades visually. */
.nb-nav {
    opacity: 0;
    transition: opacity 0.3s ease;
}
.nb-nav:hover,
.nb-nav.nb-visible {
    opacity: 1;
}
:fullscreen .nb-nav {
    display: none !important;
}
.nb-nav:focus-within {
    opacity: 1;
}

/* Deployed-version badge (nav-banner.js fills it from /version.txt, baked
   into the image at build time). Hidden entirely until the version loads,
   so local dev builds without a version file show nothing. */
.nb-version {
    display: none;
    margin-right: 10px;
    padding: 2px 8px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 10px;
    font-size: 0.72em;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
    user-select: text;
}
.nb-version.nb-version-loaded {
    display: inline-block;
}
.nb-mobile-version {
    display: none;
    padding: 8px 16px 4px;
    font-size: 0.8em;
    color: #999;
    text-align: center;
    user-select: text;
}
.nb-mobile-version.nb-version-loaded {
    display: block;
}
