/* App Shell */
.app-shell {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100%;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    border-radius: 0;
    /* Override glass-panel radius */
    flex-shrink: 0;
}

.logo {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 0.75rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
}

.nav-links {
    list-style: none;
    padding: 1rem;
    flex: 1;
}

.nav-links li {
    margin-bottom: 0.5rem;
}

.nav-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    border-radius: var(--radius);
    cursor: pointer;
    text-align: left;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-links li.active .nav-btn {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
}

/* Main Content */
#main-content {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.05), transparent 40%);
}

.view {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
}

.top-bar {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    flex-shrink: 0;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-indicator .dot {
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    grid-template-rows: 1fr;
    gap: 1rem;
    flex: 1;
    min-height: 0;
    /* Important for scroll */
}

.algo-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 1rem;
    flex: 1;
    min-height: 0;
}

.widget {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    overflow: hidden;
}

/* Modal Layout */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
}