:root {
    --bg-dark: #0f172a;
    --bg-panel: rgba(30, 41, 59, 0.7);
    --bg-sidebar: #0b1120;
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --glass-blur: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

.layout {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    padding: 0 1.5rem;
    margin-bottom: 2rem;
}
.logo-icon {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--accent-blue), #8b5cf6);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
}

.nav-links {
    display: flex; flex-direction: column; flex: 1;
}
.nav-item {
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    display: flex; align-items: center; gap: 0.75rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}
.nav-item:hover, .nav-item.active {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}
.nav-item.active {
    border-left-color: var(--accent-blue);
}

/* Content Area */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.topbar {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center;
    background: var(--bg-panel);
    backdrop-filter: blur(var(--glass-blur));
    position: sticky; top: 0; z-index: 10;
}

.page-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.page { display: none; }
.page.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from {opacity:0;} to {opacity:1;} }

/* Status */
.status-badge {
    display: flex; align-items: center; gap: 0.5rem;
    background: rgba(16, 185, 129, 0.1); color: var(--accent-green);
    padding: 0.5rem 1rem; border-radius: 99px; font-size: 0.875rem; font-weight: 600;
}
.status-badge.scanning { background: rgba(59, 130, 246, 0.1); color: var(--accent-blue); }
.status-dot { width: 8px; height: 8px; background: currentColor; border-radius: 50%; box-shadow: 0 0 8px currentColor; }
.status-badge.scanning .status-dot { animation: pulse 1.5s infinite; }
@keyframes pulse { 0%, 100% {transform: scale(0.95); opacity:1;} 50% {transform: scale(1.2); opacity:0.5;} }

/* Panels & Grid */
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 1024px) { .grid-2col { grid-template-columns: 1fr; } }

.glass-panel {
    background: var(--bg-panel); border: 1px solid var(--border-color);
    border-radius: 12px; padding: 2rem;
}

.metrics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.metric-card { background: rgba(0,0,0,0.2); border: 1px solid var(--border-color); border-radius: 8px; padding: 1.5rem; }
.metric-label { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.metric-value { font-size: 2rem; font-weight: 700; }

.progress-bar { width: 100%; height: 6px; background: rgba(255,255,255,0.1); border-radius: 4px; margin-top: 1rem; }
.progress-fill { height: 100%; background: var(--accent-blue); border-radius: 4px; transition: width 0.5s; }
.progress-fill.danger { background: var(--accent-red); }

/* Bots Grid */
.bots-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.bot-card {
    background: rgba(0,0,0,0.2); border: 1px solid var(--border-color);
    border-radius: 8px; padding: 1.5rem;
}
.bot-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.bot-title { font-size: 1.125rem; font-weight: 600; display:flex; align-items:center; gap:0.5rem;}
.bot-desc { color: var(--text-secondary); font-size: 0.875rem; margin-bottom: 1.5rem; }

/* Toggles & Features */
.features-list { display: flex; flex-direction: column; gap: 1rem; }
.feature-item {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.05);
}
.feature-info h4 { font-size: 0.875rem; font-weight: 500; }
.feature-info p { font-size: 0.75rem; color: var(--text-secondary); }

/* Switch Toggle CSS */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255,255,255,0.2); transition: .4s; border-radius: 34px;
}
.slider:before {
    position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px;
    background-color: white; transition: .4s; border-radius: 50%;
}
input:checked + .slider { background-color: var(--accent-green); }
input:checked + .slider:before { transform: translateX(20px); }

/* Utils */
.btn {
    padding: 0.75rem 1.5rem; border: none; border-radius: 6px; font-weight: 600;
    cursor: pointer; transition: 0.2s;
}
.btn-primary { background: var(--accent-blue); color: white; }
.btn-primary:hover { background: var(--accent-blue-hover); }
.btn-secondary { background: rgba(255,255,255,0.1); color: white; border: 1px solid var(--border-color); }
.btn-secondary:hover { background: rgba(255,255,255,0.2); }
.input-group { margin-bottom: 1rem; }
.input-group label { display: block; margin-bottom: 0.5rem; font-size: 0.875rem; color: var(--text-secondary); }
.input-group input { width: 100%; padding: 0.75rem; background: rgba(0,0,0,0.3); border: 1px solid var(--border-color); border-radius: 6px; color: white; }
.checkbox-group { margin-bottom: 0.75rem; font-size: 0.875rem; }
.mt-4 { margin-top: 1rem; } .mb-4 { margin-bottom: 1rem; } .mb-2 { margin-bottom: 0.5rem; }
.max-w-md { max-width: 500px; }

/* Terminal */
.terminal-container {
    background: #000; border-radius: 8px; border: 1px solid var(--border-color);
    padding: 1rem; overflow-y: auto; font-family: monospace; font-size: 0.875rem; line-height: 1.5; color: #a3be8c;
}
.log-line.error { color: #bf616a; }
.log-line.info { color: #88c0d0; }
.log-line.success { color: #a3be8c; }
