/* Top Navigation Bar */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--surface, #151b3d);
    border-bottom: 1px solid var(--border, #2d3561);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--accent, #8b5cf6);
}

.nav-right {
    position: relative;
}

/* Hamburger Toggle */
.hamburger-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.hamburger-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text, #e0e7ff);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-toggle.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Navigation Dropdown */
.nav-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--surface, #151b3d);
    border: 1px solid var(--border, #2d3561);
    border-radius: 8px;
    padding: 0.5rem 0;
    min-width: 180px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

.nav-dropdown.hidden {
    display: none;
}

.dropdown-link,
.nav-dropdown-link {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text, #e0e7ff);
    text-decoration: none;
    transition: all 0.2s ease;
}

.dropdown-link:hover,
.nav-dropdown-link:hover {
    background: var(--surface-hover, #1e2757);
    color: var(--accent, #8b5cf6);
}

.dropdown-separator {
    height: 1px;
    background: var(--border, #2d3561);
    margin: 0.5rem 0;
}

/* Left Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 60px;
    width: 280px;
    height: calc(100vh - 60px);
    background: var(--surface, #151b3d);
    border-right: 1px solid var(--border, #2d3561);
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 999;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text, #e0e7ff);
    margin: 0;
}

/* Sidebar Sections */
.sidebar-section {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border, #2d3561);
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary, #a5b4fc);
    margin-bottom: 1rem;
}

/* System Status */
.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border, #2d3561);
}

.status-item:last-child {
    border-bottom: none;
}

.status-label {
    font-size: 0.9rem;
    color: var(--text-secondary, #a5b4fc);
}

.status-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text, #e0e7ff);
    text-align: right;
    word-break: break-word;
    max-width: 60%;
}

.status-online {
    color: #10b981;
}

/* Main Wrapper - adjusts for sidebar */
.main-wrapper {
    margin-left: 280px;
    margin-top: 60px;
    min-height: calc(100vh - 60px);
    transition: margin-left 0.3s ease;
}

/* Sidebar Navigation Links */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    color: var(--text, #e0e7ff);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: var(--surface-hover, #1e2757);
    border-left-color: var(--accent, #8b5cf6);
    color: var(--accent, #8b5cf6);
}

.sidebar-icon {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--accent, #8b5cf6);
    color: var(--text, #e0e7ff);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--accent-hover, #7c3aed);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.5);
}

.back-to-top:active {
    transform: translateY(-1px);
}

.back-to-top span {
    line-height: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0;
    }

    .top-nav {
        padding: 0 1rem;
    }

    .back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
    }
}

