/* ============================================
   GEMINI FLASH 3.5 — AI CONTROL SYSTEM
   Design: Retro-Futuristic · Acid Neon Palette
   Fonts: Clash Display + Space Mono + Outfit
============================================ */

:root {
  --neon: #CCFF00;
  --pink: #FF3CAC;
  --bg: #0D0D0D;
  --bg2: #111111;
  --bg3: #161616;
  --bg4: #1A1A1A;
  --border: rgba(204, 255, 0, 0.15);
  --border2: rgba(255, 60, 172, 0.15);
  --text: #E8E8E8;
  --text2: #888888;
  --text3: #555555;
  --sidebar-w: 220px;
  --topbar-h: 56px;
  --radius: 4px;
  --radius-lg: 8px;
  --glow: 0 0 20px rgba(204, 255, 0, 0.3);
  --glow-pink: 0 0 20px rgba(255, 60, 172, 0.3);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }
a { color: var(--neon); text-decoration: none; }

/* ---- PARTICLE CANVAS ---- */
#particleCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
}

/* ---- SCANLINES ---- */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.03) 2px,
    rgba(0,0,0,0.03) 4px
  );
}

/* ============================================
   BOOT SCREEN
============================================ */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.boot-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 400px;
}
.boot-logo {
  animation: bootSpin 2s linear infinite;
  filter: drop-shadow(0 0 16px #CCFF00);
}
@keyframes bootSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.boot-title {
  font-family: 'Clash Display', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--neon);
  letter-spacing: 6px;
  text-shadow: 0 0 30px rgba(204,255,0,0.8);
}
.boot-subtitle {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--text2);
  letter-spacing: 3px;
}
.boot-log {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: var(--neon);
  opacity: 0.7;
  height: 80px;
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--border);
  background: rgba(204,255,0,0.03);
}
.boot-log-line { animation: fadeInUp 0.3s ease; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.boot-bar-wrap {
  width: 100%;
  height: 3px;
  background: rgba(204,255,0,0.1);
  border-radius: 2px;
  overflow: hidden;
}
.boot-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--neon), var(--pink));
  transition: width 0.1s linear;
  box-shadow: 0 0 10px var(--neon);
}
.boot-percent {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--neon);
}

/* ============================================
   MAIN APP LAYOUT
============================================ */
.main-app {
  display: flex;
  height: 100vh;
  width: 100vw;
  position: relative;
  z-index: 2;
}
.hidden { display: none !important; }

/* ============================================
   SIDEBAR
============================================ */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
  position: relative;
  z-index: 10;
}
.sidebar::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 1px; height: 100%;
  background: linear-gradient(180deg, transparent, var(--neon), transparent);
  opacity: 0.3;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
}
.logo-text {
  font-family: 'Clash Display', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 2px;
}
.logo-accent { color: var(--neon); }

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  border-radius: 0;
  text-align: left;
  width: 100%;
}
.nav-item:hover {
  color: var(--text);
  background: rgba(204,255,0,0.05);
}
.nav-item.active {
  color: var(--neon);
  background: rgba(204,255,0,0.08);
}
.nav-item.active svg { stroke: var(--neon); }
.nav-indicator {
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 0;
  background: var(--neon);
  transition: height 0.2s ease;
  box-shadow: var(--glow);
}
.nav-item.active .nav-indicator { height: 60%; }
.badge {
  margin-left: auto;
  background: var(--pink);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  font-family: 'Space Mono', monospace;
}

.sidebar-status {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 8px var(--neon);
}
.status-dot.pulse { animation: statusPulse 2s ease-in-out infinite; }
@keyframes statusPulse {
  0%, 100% { box-shadow: 0 0 4px var(--neon); }
  50% { box-shadow: 0 0 16px var(--neon), 0 0 30px rgba(204,255,0,0.4); }
}
.status-label {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  color: var(--text3);
  letter-spacing: 1px;
}
.status-value {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--neon);
  font-weight: 700;
}

.sidebar-metrics {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.metric-label {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  color: var(--text3);
  letter-spacing: 1px;
}
.metric-value {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--text2);
}

/* ============================================
   CONTENT AREA
============================================ */
.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

/* ---- TOPBAR ---- */
.topbar {
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(13,13,13,0.8);
  backdrop-filter: blur(10px);
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.breadcrumb {
  font-family: 'Clash Display', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.model-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text2);
  background: rgba(204,255,0,0.06);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 20px;
  font-family: 'Space Mono', monospace;
}
.model-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--neon);
  animation: statusPulse 2s ease-in-out infinite;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.sys-time {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--text3);
}
.icon-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text2);
  transition: var(--transition);
}
.icon-btn:hover {
  border-color: var(--neon);
  color: var(--neon);
  background: rgba(204,255,0,0.05);
}

/* ============================================
   PANELS
============================================ */
.panel {
  display: none;
  flex: 1;
  overflow: hidden;
  flex-direction: column;
}
.panel.active { display: flex; }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.panel-title {
  font-family: 'Clash Display', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}
.panel-actions { display: flex; align-items: center; gap: 10px; }

/* ============================================
   BUTTONS
============================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--neon);
  color: #0D0D0D;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius);
  transition: var(--transition);
  letter-spacing: 0.5px;
}
.btn-primary:hover {
  background: #d4ff1a;
  box-shadow: var(--glow);
  transform: translateY(-1px);
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  color: var(--text2);
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}
.btn-secondary:hover {
  border-color: var(--text2);
  color: var(--text);
}
.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  color: var(--pink);
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(255,60,172,0.3);
  border-radius: var(--radius);
  transition: var(--transition);
}
.btn-danger:hover {
  background: rgba(255,60,172,0.1);
  box-shadow: var(--glow-pink);
}
.full-width { width: 100%; justify-content: center; }

/* ============================================
   CHAT PANEL
============================================ */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.message {
  display: flex;
  gap: 12px;
  animation: msgIn 0.3s ease;
  max-width: 800px;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.user-msg { flex-direction: row-reverse; align-self: flex-end; }
.msg-avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  background: rgba(204,255,0,0.05);
  flex-shrink: 0;
}
.user-msg .msg-avatar {
  background: rgba(255,60,172,0.1);
  border-color: var(--border2);
}
.msg-body { flex: 1; min-width: 0; }
.msg-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.user-msg .msg-header { flex-direction: row-reverse; }
.msg-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--neon);
  font-family: 'Space Mono', monospace;
}
.user-msg .msg-name { color: var(--pink); }
.msg-time {
  font-size: 10px;
  color: var(--text3);
  font-family: 'Space Mono', monospace;
}
.msg-text {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
}
.user-msg .msg-text {
  background: rgba(255,60,172,0.08);
  border-color: var(--border2);
}
.msg-text p { margin-bottom: 8px; }
.msg-text p:last-child { margin-bottom: 0; }
.msg-text strong { color: var(--neon); }
.highlight {
  color: var(--neon);
  background: rgba(204,255,0,0.1);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
}
.msg-capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.cap-tag {
  font-size: 11px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text2);
  background: rgba(204,255,0,0.03);
}

/* Typing indicator */
.typing-indicator .msg-text {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 14px 16px;
}
.typing-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--neon);
  animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* Code blocks in chat */
.msg-text pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin: 8px 0;
  overflow-x: auto;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--neon);
}

/* Chat Input */
.chat-input-area {
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  background: var(--bg2);
  flex-shrink: 0;
}
.input-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.tool-btn {
  width: 30px; height: 30px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text3);
  transition: var(--transition);
}
.tool-btn:hover { color: var(--neon); border-color: var(--neon); }
.model-selector { margin-left: auto; }
.model-selector select {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 4px 10px;
  border-radius: var(--radius);
  font-size: 11px;
  font-family: 'Space Mono', monospace;
  cursor: pointer;
  outline: none;
}
.model-selector select:focus { border-color: var(--neon); }

.input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
#chatInput {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  color: var(--text);
  font-size: 13.5px;
  resize: none;
  outline: none;
  transition: var(--transition);
  max-height: 120px;
  line-height: 1.5;
}
#chatInput:focus { border-color: var(--neon); box-shadow: 0 0 0 2px rgba(204,255,0,0.1); }
#chatInput::placeholder { color: var(--text3); }
.send-btn {
  width: 42px; height: 42px;
  border-radius: var(--radius-lg);
  background: var(--neon);
  color: #0D0D0D;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.send-btn:hover { background: #d4ff1a; box-shadow: var(--glow); transform: scale(1.05); }
.send-btn:active { transform: scale(0.95); }
.input-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 10px;
  color: var(--text3);
  font-family: 'Space Mono', monospace;
}
.char-count { color: var(--text3); }

/* ============================================
   APP MANAGER
============================================ */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  flex-shrink: 0;
}
.tab {
  padding: 12px 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  font-family: 'Space Mono', monospace;
  letter-spacing: 0.5px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--neon); border-bottom-color: var(--neon); }

.tab-content { display: none; flex: 1; overflow-y: auto; padding: 20px 24px; }
.tab-content.active { display: block; }
.tab-content::-webkit-scrollbar { width: 4px; }
.tab-content::-webkit-scrollbar-thumb { background: var(--border); }

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.app-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.app-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--neon), var(--pink));
  opacity: 0;
  transition: opacity 0.2s;
}
.app-card:hover { border-color: rgba(204,255,0,0.3); transform: translateY(-2px); }
.app-card:hover::before { opacity: 1; }
.app-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.app-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.app-info { flex: 1; min-width: 0; }
.app-name {
  font-family: 'Clash Display', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.app-version {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: var(--text3);
}
.app-status {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
}
.app-status.installed { background: rgba(204,255,0,0.1); color: var(--neon); border: 1px solid rgba(204,255,0,0.2); }
.app-status.update { background: rgba(255,60,172,0.1); color: var(--pink); border: 1px solid rgba(255,60,172,0.2); }
.app-status.available { background: rgba(255,255,255,0.05); color: var(--text2); border: 1px solid var(--border); }
.app-desc {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.5;
  margin-bottom: 12px;
}
.app-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
}
.app-tag {
  font-size: 10px;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text3);
}
.app-actions { display: flex; gap: 8px; }
.app-btn {
  flex: 1;
  padding: 7px 12px;
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  transition: var(--transition);
  text-align: center;
}
.app-btn.install {
  background: var(--neon);
  color: #0D0D0D;
}
.app-btn.install:hover { background: #d4ff1a; box-shadow: var(--glow); }
.app-btn.update-btn {
  background: rgba(255,60,172,0.15);
  color: var(--pink);
  border: 1px solid rgba(255,60,172,0.3);
}
.app-btn.update-btn:hover { background: rgba(255,60,172,0.25); }
.app-btn.open-btn {
  background: rgba(204,255,0,0.08);
  color: var(--neon);
  border: 1px solid var(--border);
}
.app-btn.open-btn:hover { background: rgba(204,255,0,0.15); }
.app-btn.uninstall-btn {
  background: transparent;
  color: var(--text3);
  border: 1px solid var(--border);
}
.app-btn.uninstall-btn:hover { color: var(--pink); border-color: rgba(255,60,172,0.3); }

/* Progress bar on app card */
.install-progress {
  margin-top: 10px;
  display: none;
}
.install-progress.active { display: block; }
.progress-bar-wrap {
  height: 3px;
  background: rgba(204,255,0,0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon), var(--pink));
  border-radius: 2px;
  transition: width 0.3s ease;
  box-shadow: 0 0 8px var(--neon);
}
.progress-label {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  color: var(--text3);
}

/* Featured Banner */
.featured-banner {
  background: linear-gradient(135deg, rgba(204,255,0,0.05), rgba(255,60,172,0.05));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  overflow: hidden;
  position: relative;
}
.featured-badge {
  display: inline-block;
  background: var(--pink);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 3px;
  letter-spacing: 1px;
  margin-bottom: 12px;
  font-family: 'Space Mono', monospace;
}
.featured-content h3 {
  font-family: 'Clash Display', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.featured-content p {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
  max-width: 400px;
  margin-bottom: 20px;
}
.brain-anim {
  position: relative;
  width: 120px; height: 120px;
  display: flex; align-items: center; justify-content: center;
}
.brain-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid;
  animation: brainSpin 4s linear infinite;
}
.brain-ring.r1 { width: 120px; height: 120px; border-color: rgba(204,255,0,0.3); }
.brain-ring.r2 { width: 85px; height: 85px; border-color: rgba(255,60,172,0.3); animation-direction: reverse; animation-duration: 3s; }
.brain-ring.r3 { width: 55px; height: 55px; border-color: rgba(204,255,0,0.2); animation-duration: 2s; }
@keyframes brainSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.brain-core { font-size: 28px; position: relative; z-index: 1; }

/* Search box */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 12px;
}
.search-box svg { color: var(--text3); flex-shrink: 0; }
.search-box input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 12px;
  width: 160px;
}
.search-box input::placeholder { color: var(--text3); }

/* ============================================
   CONTROL HUB
============================================ */
.control-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}
.control-grid::-webkit-scrollbar { width: 4px; }
.control-grid::-webkit-scrollbar-thumb { background: var(--border); }

.control-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.control-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-family: 'Clash Display', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}
.control-row label {
  font-size: 12px;
  color: var(--text2);
  min-width: 80px;
}
.slider-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.neon-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 3px;
  background: rgba(204,255,0,0.15);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.neon-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 8px var(--neon);
  cursor: pointer;
  transition: transform 0.1s;
}
.neon-slider::-webkit-slider-thumb:hover { transform: scale(1.3); }
.slider-val {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--neon);
  min-width: 36px;
  text-align: right;
}

/* Toggle Switch */
.toggle-switch { position: relative; display: inline-block; width: 40px; height: 22px; cursor: pointer; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: 11px;
  transition: var(--transition);
}
.toggle-track::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 2px; top: 2px;
  background: var(--text3);
  border-radius: 50%;
  transition: var(--transition);
}
.toggle-switch input:checked + .toggle-track { background: rgba(204,255,0,0.15); border-color: var(--neon); }
.toggle-switch input:checked + .toggle-track::before { transform: translateX(18px); background: var(--neon); box-shadow: 0 0 8px var(--neon); }

/* Safety Grid */
.safety-grid { display: flex; flex-direction: column; gap: 10px; }
.safety-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.safety-item span { font-size: 12px; color: var(--text2); }
.safety-select {
  background: var(--bg4);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 4px 8px;
  border-radius: var(--radius);
  font-size: 11px;
  font-family: 'Space Mono', monospace;
  outline: none;
  cursor: pointer;
}
.safety-select:focus { border-color: var(--neon); }

/* Live Metrics */
.metrics-live { display: flex; flex-direction: column; gap: 12px; }
.metric-live-item { display: flex; align-items: center; gap: 10px; }
.metric-live-label { font-size: 11px; color: var(--text2); min-width: 90px; }
.metric-live-bar {
  flex: 1;
  height: 4px;
  background: rgba(204,255,0,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.metric-live-fill {
  height: 100%;
  background: var(--neon);
  border-radius: 2px;
  box-shadow: 0 0 6px var(--neon);
  transition: width 0.5s ease;
}
.metric-live-fill.pink { background: var(--pink); box-shadow: 0 0 6px var(--pink); }
.metric-live-val {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--text2);
  min-width: 36px;
  text-align: right;
}

/* API Config */
.api-config { display: flex; flex-direction: column; gap: 12px; }
.api-row { display: flex; flex-direction: column; gap: 4px; }
.api-row label { font-size: 11px; color: var(--text2); }
.api-input-wrap { display: flex; gap: 6px; }
.api-input {
  flex: 1;
  background: var(--bg4);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 10px;
  border-radius: var(--radius);
  font-size: 12px;
  font-family: 'Space Mono', monospace;
  outline: none;
  width: 100%;
}
.api-input:focus { border-color: var(--neon); }
.api-toggle {
  padding: 7px 12px;
  background: var(--bg4);
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: var(--radius);
  font-size: 11px;
  cursor: pointer;
  transition: var(--transition);
}
.api-toggle:hover { border-color: var(--neon); color: var(--neon); }

.status-pill {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 1px;
}
.status-pill.online {
  background: rgba(204,255,0,0.1);
  color: var(--neon);
  border: 1px solid rgba(204,255,0,0.2);
}

/* ============================================
   UPDATE MANAGER
============================================ */
.update-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.update-stat {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
}
.update-stat-num {
  font-family: 'Clash Display', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.update-stat-num.neon { color: var(--neon); text-shadow: 0 0 20px rgba(204,255,0,0.5); }
.update-stat-num.pink { color: var(--pink); }
.update-stat-label {
  font-size: 11px;
  color: var(--text3);
  font-family: 'Space Mono', monospace;
}

.update-list {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.update-list::-webkit-scrollbar { width: 4px; }
.update-list::-webkit-scrollbar-thumb { background: var(--border); }

.update-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}
.update-item:hover { border-color: rgba(204,255,0,0.3); }
.update-item-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.update-item-info { flex: 1; }
.update-item-name {
  font-family: 'Clash Display', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.update-item-desc { font-size: 12px; color: var(--text2); margin-bottom: 6px; }
.update-item-versions {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
}
.ver-old { color: var(--text3); text-decoration: line-through; }
.ver-arrow { color: var(--text3); }
.ver-new { color: var(--neon); }
.update-item-actions { display: flex; gap: 8px; flex-shrink: 0; }

.update-history {
  padding: 0 24px 20px;
  flex-shrink: 0;
}
.section-title {
  font-family: 'Clash Display', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.history-version {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--neon);
  min-width: 50px;
}
.history-info { flex: 1; }
.history-title { font-size: 12px; color: var(--text); }
.history-date { font-size: 10px; color: var(--text3); font-family: 'Space Mono', monospace; }
.history-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-family: 'Space Mono', monospace;
}
.history-tag.stable { background: rgba(204,255,0,0.1); color: var(--neon); border: 1px solid rgba(204,255,0,0.2); }

/* ============================================
   SETTINGS
============================================ */
.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  flex: 1;
  padding: 0 24px 24px;
}
.settings-grid::-webkit-scrollbar { width: 4px; }
.settings-grid::-webkit-scrollbar-thumb { background: var(--border); }

.settings-section {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.settings-section:last-child { border-bottom: none; }
.settings-section-title {
  font-family: 'Clash Display', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  gap: 16px;
}
.setting-info { flex: 1; }
.setting-name { font-size: 13px; color: var(--text); margin-bottom: 2px; }
.setting-desc { font-size: 11px; color: var(--text3); }
.theme-options { display: flex; gap: 6px; }
.theme-opt {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 11px;
  color: var(--text2);
  transition: var(--transition);
  font-family: 'Space Mono', monospace;
}
.theme-opt:hover { border-color: var(--neon); color: var(--neon); }
.theme-opt.active { border-color: var(--neon); color: var(--neon); background: rgba(204,255,0,0.08); }
.settings-select {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: var(--radius);
  font-size: 12px;
  outline: none;
  cursor: pointer;
}
.settings-select:focus { border-color: var(--neon); }
.system-prompt-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px;
  border-radius: var(--radius);
  font-size: 12px;
  font-family: 'Space Mono', monospace;
  resize: vertical;
  min-height: 80px;
  outline: none;
  margin-top: 8px;
  line-height: 1.5;
}
.system-prompt-input:focus { border-color: var(--neon); }
.danger-zone {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(255,60,172,0.2);
  border-radius: var(--radius-lg);
  background: rgba(255,60,172,0.03);
}
.danger-zone h4 {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--pink);
  letter-spacing: 1px;
  margin-bottom: 12px;
  text-transform: uppercase;
}
.danger-zone { display: flex; flex-direction: column; gap: 8px; }
.danger-zone h4 { margin-bottom: 0; }

/* ============================================
   MODAL
============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 480px;
  max-width: 90vw;
  animation: modalIn 0.2s ease;
  box-shadow: 0 0 60px rgba(204,255,0,0.1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  font-family: 'Clash Display', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.modal-close {
  color: var(--text3);
  font-size: 16px;
  transition: var(--transition);
}
.modal-close:hover { color: var(--pink); }
.modal-body { padding: 24px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* ============================================
   TOAST NOTIFICATIONS
============================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  animation: toastIn 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
.toast.success { border-color: rgba(204,255,0,0.3); }
.toast.error { border-color: rgba(255,60,172,0.3); }
.toast.info { border-color: rgba(255,255,255,0.1); }
.toast-icon { font-size: 16px; }
.toast-text { flex: 1; font-size: 12px; color: var(--text); }
.toast-close { color: var(--text3); font-size: 12px; cursor: pointer; }
.toast-close:hover { color: var(--text); }

/* ============================================
   SCROLLBAR GLOBAL
============================================ */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(204,255,0,0.15); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(204,255,0,0.3); }

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 900px) {
  :root { --sidebar-w: 60px; }
  .sidebar-logo .logo-text,
  .nav-item span,
  .sidebar-status .status-info,
  .sidebar-metrics { display: none; }
  .nav-item { justify-content: center; padding: 12px; }
  .badge { position: absolute; top: 6px; right: 6px; }
  .control-grid { grid-template-columns: 1fr; }
  .update-summary { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .apps-grid { grid-template-columns: 1fr; }
  .featured-banner { flex-direction: column; }
  .brain-anim { display: none; }
}