/* Hugo Panel — Index rail menu
 * Same DOM/classes. Visual only.
 */

.sidebar {
    width: calc(var(--sidebar-width, 248px) - var(--panel-gutter, 16px));
    min-height: 0;
    height: auto;
    background: #14181c;
    border: 1px solid var(--border-color, #2a3038);
    box-shadow: none;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: var(--panel-gutter, 16px);
    top: var(--panel-gutter, 16px);
    bottom: var(--panel-gutter, 16px);
    z-index: 100;
    border-radius: 18px;
    overflow: hidden;
    font-family: var(--hugo-font, "Segoe UI", system-ui, sans-serif);
}

.sidebar-logo {
    padding: 22px 18px 16px;
    border-bottom: 1px solid transparent;
    background:
        linear-gradient(var(--border-color, #2a3038), var(--border-color, #2a3038)) bottom / 72% 1px no-repeat;
    position: relative;
    overflow: hidden;
}

.logo-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    position: relative;
    z-index: 2;
}

.logo-svg-container,
.logo-glow,
.logo-fog,
.logo-particles,
.logo-separator {
    display: none !important;
}

.logo-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    width: 100%;
}

.logo-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-white, #eeeae3);
    letter-spacing: 0.34em;
    text-transform: uppercase;
    text-shadow: none;
    line-height: 1.2;
}

.logo-name::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    margin-top: 10px;
    background: var(--red-primary, #c9a36a);
    animation: hugoRuleDraw 0.55s 0.15s ease forwards;
}

.logo-subtitle {
    font-size: 0.58rem;
    color: var(--text-dim, #6f6b64);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-top: 8px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px 10px;
    overflow-y: auto;
    counter-reset: hugo-nav;
}

.nav-section { margin-bottom: 22px; }

.nav-section-title {
    font-size: 0.58rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    padding: 0 12px 8px;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px 9px 10px;
    border-radius: 999px;
    color: var(--text-gray);
    cursor: pointer;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease,
        padding-left 0.2s ease;
    margin-bottom: 3px;
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 500;
    border: 1px solid transparent;
    position: relative;
    counter-increment: hugo-nav;
    animation: hugoNavIn 0.4s ease both;
}

.nav-item:nth-of-type(1) { animation-delay: 0.04s; }
.nav-item:nth-of-type(2) { animation-delay: 0.08s; }
.nav-item:nth-of-type(3) { animation-delay: 0.12s; }
.nav-item:nth-of-type(4) { animation-delay: 0.16s; }
.nav-item:nth-of-type(5) { animation-delay: 0.2s; }

.nav-item::before {
    content: counter(hugo-nav, decimal-leading-zero);
    font-family: var(--hugo-mono, ui-monospace, Consolas, monospace);
    font-size: 0.6rem;
    letter-spacing: 0.04em;
    color: var(--text-dim);
    width: 1.35rem;
    flex-shrink: 0;
    position: static;
    transform: none;
    height: auto;
    border-radius: 0;
    background: none;
    box-shadow: none;
    transition: color 0.2s ease;
}

.nav-item-builder:hover {
    border-color: transparent;
    background: rgba(201, 163, 106, 0.08);
    color: var(--text-white);
}

.nav-item-builder.nav-item-disabled {
    opacity: 0.55;
}

.nav-item-builder {
    position: relative;
    padding-right: 28px !important;
}

.builder-status-dot {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    flex-shrink: 0;
    box-shadow: none;
    pointer-events: none;
}

.nav-item-builder.is-online .builder-status-dot {
    background: #6fbf9a;
    box-shadow: 0 0 0 3px rgba(111, 191, 154, 0.16);
}

.nav-item-builder.is-offline .builder-status-dot {
    background: #c46b6b;
    box-shadow: none;
}

.nav-item-builder.is-unconfigured .builder-status-dot {
    background: rgba(255, 255, 255, 0.2);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-white);
    border-color: transparent;
    transform: translateX(4px);
}

.nav-item.active {
    background: var(--sidebar-active-bg, rgba(201, 163, 106, 0.14)) !important;
    color: var(--sidebar-active-text, #eeeae3) !important;
    border-color: rgba(201, 163, 106, 0.28) !important;
    box-shadow: none !important;
    transform: none;
}

.nav-item.active::before {
    color: var(--red-primary, #c9a36a);
    content: counter(hugo-nav, decimal-leading-zero) !important;
    background: none !important;
    width: 1.35rem !important;
    height: auto !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.nav-item-icon {
    width: 16px;
    height: 16px;
    stroke-width: 1.7;
    flex-shrink: 0;
    transition: transform 0.2s ease, color 0.2s ease;
}
.nav-item:hover .nav-item-icon { transform: scale(1.08); }
.nav-item.active .nav-item-icon { color: var(--red-primary, #c9a36a); }
.nav-item-icon svg { width: 16px; height: 16px; }

.nav-item-text {
    font-size: 0.84rem;
    font-weight: 500;
    position: relative;
}

.nav-item-text::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 0;
    height: 1px;
    background: var(--red-primary, #c9a36a);
    transition: width 0.22s ease;
}

.nav-item:hover .nav-item-text::after,
.nav-item.active .nav-item-text::after {
    width: 100%;
}

.nav-item-badge {
    margin-left: auto;
    background: var(--red-primary);
    color: #1a1610;
    font-size: 0.68rem;
    padding: 1px 7px;
    border-radius: 999px;
    font-weight: 650;
}
.nav-item.active .nav-item-badge {
    background: rgba(255, 255, 255, 0.14);
    color: var(--text-white);
}

.sidebar-user {
    padding: 12px 14px 14px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--red-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 650;
    font-size: 0.74rem;
    color: #1a1610;
    flex-shrink: 0;
    overflow: hidden;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 0.84rem; font-weight: 600; color: var(--text-white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 0.66rem; color: var(--text-dim); }

.user-logout {
    color: var(--text-dim);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
}

.user-logout svg { width: 18px; height: 18px; }
.user-logout:hover {
    color: var(--red-primary);
    background: var(--bg-card);
    transform: rotate(-12deg);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--overlay-bg, rgba(10, 12, 14, 0.62));
    z-index: 99;
}
.sidebar-overlay.show { display: block; }

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-white);
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}
.mobile-menu-btn svg { width: 24px; height: 24px; }

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(calc(-100% - 24px));
        transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    }
    .sidebar.open { transform: translateX(0); }
    .mobile-menu-btn { display: inline-flex; }
}

@keyframes hugoNavIn {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes hugoRuleDraw {
    to { width: 34px; }
}

@media (prefers-reduced-motion: reduce) {
    .nav-item,
    .logo-name::after,
    .nav-item-text::after,
    .nav-item-icon,
    .user-logout {
        animation: none !important;
        transition: none !important;
    }
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark, #101214);
}
::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb, #3a4048);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim, #6f6b64);
}
html, body, .sidebar, .sidebar-nav, .main, .main-content {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb, #3a4048) var(--bg-dark, #101214);
}

.sidebar-credits {
    display: none !important;
}
.sidebar-credits-title {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--red-primary);
    font-weight: 700;
    margin-bottom: 8px;
}
.sidebar-credits a {
    display: block;
    font-size: 0.78rem;
    color: var(--text-gray);
    text-decoration: none;
    padding: 3px 0;
    transition: color 0.12s;
    line-height: 1.5;
}
.sidebar-credits a:hover {
    color: var(--text-white);
}

.wing-left,
.wing-right,
.wolf-art,
.wolf-glow,
.wolf-glow--mist,
.wolf-logo {
    animation: none !important;
    filter: none !important;
}
