:root {
  --bg: #0b0f1a;
  --panel: #121826;
  --panel-2: #171f30;
  --border: #232c3f;
  --accent: #6c5ce7;
  --accent-2: #00d2a0;
  --text: #e6e9f0;
  --text-dim: #8992a6;
  --danger: #ff5c72;
  --warn: #ffb454;
}

* { box-sizing: border-box; }
body { font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif; }

.scrollbar-thin::-webkit-scrollbar { width: 6px; height: 6px; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: #2a3450; border-radius: 4px; }
.scrollbar-thin::-webkit-scrollbar-track { background: transparent; }

.glass {
  background: rgba(18, 24, 38, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
}

.pulse-dot {
  width: 8px; height: 8px; border-radius: 999px; background: var(--accent-2);
  box-shadow: 0 0 0 0 rgba(0, 210, 160, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 210, 160, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(0, 210, 160, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 210, 160, 0); }
}

.nav-btn { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--text-dim); font-size: 14px; font-weight: 500; transition: all .15s; cursor: pointer; }
.nav-btn:hover { background: var(--panel-2); color: var(--text); }
.nav-btn.active { background: linear-gradient(135deg, rgba(108,92,231,.18), rgba(0,210,160,.10)); color: var(--text); box-shadow: inset 0 0 0 1px rgba(108,92,231,.35); }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; }

.btn-primary { background: linear-gradient(135deg, var(--accent), #8f7bff); color: white; font-weight: 600; border-radius: 10px; padding: 8px 16px; transition: opacity .15s; }
.btn-primary:hover { opacity: .9; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }

.btn-outline { border: 1px solid var(--border); border-radius: 10px; padding: 8px 16px; color: var(--text); transition: all .15s; }
.btn-outline:hover { background: var(--panel-2); }

.input-field { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; color: var(--text); width: 100%; }
.input-field:focus { outline: none; border-color: var(--accent); }

.badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.badge-green { background: rgba(0,210,160,.15); color: var(--accent-2); }
.badge-amber { background: rgba(255,180,84,.15); color: var(--warn); }
.badge-red { background: rgba(255,92,114,.15); color: var(--danger); }
.badge-gray { background: rgba(137,146,166,.15); color: var(--text-dim); }

code, pre { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.code-block { background: #0a0e18; border: 1px solid var(--border); border-radius: 10px; padding: 12px; font-size: 13px; white-space: pre-wrap; word-break: break-word; }

.tab-btn { padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--text-dim); cursor: pointer; }
.tab-btn.active { background: var(--panel-2); color: var(--text); }

.chat-bubble-user { background: var(--accent); color: white; border-radius: 14px 14px 4px 14px; }
.chat-bubble-assistant { background: var(--panel-2); border: 1px solid var(--border); border-radius: 14px 14px 14px 4px; }

/* ---------- Responsive shell / mobile nav ---------- */
/* Small screens: sidebar becomes a fixed off-canvas drawer, hidden by default. */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  transform: translateX(-100%);
  transition: transform .22s ease;
  max-width: 85vw;
}
.sidebar.sidebar-open { transform: translateX(0); }

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.55);
}

/* md and up: sidebar is always visible, part of the normal flex flow. */
@media (min-width: 768px) {
  .sidebar {
    position: relative;
    inset: auto;
    transform: none;
    max-width: none;
    z-index: auto;
  }
}

/* Small-screen layout polish */
@media (max-width: 767px) {
  .card { border-radius: 12px; }
  table.w-full { font-size: 13px; }
}
