/* Collapsed nav rail — global (not scoped); tips/flyouts sit beside links, not inside them */

.nav-rail-item {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    flex-shrink: 0;
    overflow: visible;
}

.nav-rail-item > .nav-rail-link {
    position: relative;
    z-index: 1;
}

/* Hover label (sibling of link — avoids 48×48 anchor clipping) */
.nav-rail-tip {
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    background: #3c4043;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.2;
    padding: 6px 12px;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.12s ease, visibility 0.12s ease;
    z-index: 1103;
}

.nav-rail-tip::before {
    content: "";
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: #3c4043;
}

.nav-rail-item:hover > .nav-rail-tip {
    opacity: 1;
    visibility: visible;
}

/* Items with flyout: hide single-line tip while flyout is usable */
.nav-rail-item--flyout:hover > .nav-rail-tip {
    opacity: 0;
    visibility: hidden;
}

/* Child flyout panel */
.nav-rail-flyout {
    display: none;
    position: absolute;
    left: calc(100% + 6px);
    top: 0;
    min-width: 200px;
    background: #2d2d30;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    padding: 6px 0;
    z-index: 1104;
}

/* Invisible bridge so pointer can reach flyout without losing hover */
.nav-rail-flyout::before {
    content: "";
    position: absolute;
    right: 100%;
    top: 0;
    width: 12px;
    height: 100%;
}

.nav-rail-item--flyout:hover .nav-rail-flyout,
.nav-rail-item--flyout:focus-within .nav-rail-flyout,
.nav-rail-flyout:hover {
    display: block;
}

.nav-rail-icon-menu {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
    background: transparent;
}

.nav-rail-flyout-link {
    display: block;
    padding: 8px 16px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.875rem;
    white-space: nowrap;
}

.nav-rail-flyout-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-rail-flyout-link.active {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    box-shadow: inset 3px 0 0 #4da3ff;
}

.nav-rail-flyout-link.nav-rail-flyout-admin {
    color: rgba(253, 224, 71, 0.9);
    font-size: 0.8125rem;
}

.nav-rail-flyout-link.nav-rail-flyout-manager {
    color: rgba(147, 197, 253, 0.95);
}

.nav-rail-flyout-link.nav-rail-flyout-manager:hover {
    color: #bfdbfe;
}

.nav-rail-flyout-link.nav-rail-flyout-admin:hover {
    color: #fde047;
}

/* Tree flyout */
.nav-rail-flyout--tree {
    min-width: 220px;
    padding: 8px 0 6px;
}

.nav-rail-flyout-legend {
    display: flex;
    gap: 14px;
    padding: 0 16px 8px;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.nav-rail-flyout-legend-manager {
    color: rgba(147, 197, 253, 0.9);
}

.nav-rail-flyout-legend-admin {
    color: rgba(253, 224, 71, 0.9);
}

.nav-rail-tree {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-rail-tree > li {
    margin: 0;
}

.nav-rail-tree-group {
    margin: 2px 0;
}

.nav-rail-tree-branch {
    display: block;
    padding: 6px 16px 2px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
}

.nav-rail-tree-children {
    list-style: none;
    margin: 0 0 4px 18px;
    padding: 0 0 0 10px;
    border-left: 2px solid rgba(255, 255, 255, 0.18);
}

.nav-rail-tree-children .nav-rail-flyout-link {
    padding: 6px 12px 6px 8px;
    font-size: 0.8125rem;
}

.nav-rail-signout-wrap {
    margin-top: auto;
}
