/* ============================================================
   BondhuHub Dashboard — Premium Dark UI
   ============================================================ */

/* ── Reset & Variables ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a12;
  --bg-2: #0f0f1e;
  --bg-3: #141428;
  --surface: rgba(255,255,255,0.04);
  --surface-hover: rgba(255,255,255,0.08);
  --border: rgba(255,255,255,0.08);
  --border-active: rgba(138,110,255,0.5);

  --accent: #8a6eff;
  --accent-2: #6c4ef7;
  --accent-glow: rgba(138,110,255,0.3);
  --accent-soft: rgba(138,110,255,0.12);

  --green: #22c55e;
  --green-soft: rgba(34,197,94,0.15);
  --red: #ef4444;
  --red-soft: rgba(239,68,68,0.15);
  --yellow: #f59e0b;
  --yellow-soft: rgba(245,158,11,0.15);
  --blue: #3b82f6;
  --blue-soft: rgba(59,130,246,0.15);

  --text-1: #f0f0ff;
  --text-2: #a0a0c0;
  --text-3: #6060a0;

  --sidebar-w: 240px;
  --topbar-h: 64px;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --transition: 0.2s ease;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
}

html { font-size: 14px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

/* ── Utility ───────────────────────────────────────────────── */
.hidden { display: none !important; }

.glass-card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.glass-card:hover {
  border-color: rgba(255,255,255,0.12);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all var(--transition);
  text-decoration: none; white-space: nowrap;
  user-select: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: 0 0 20px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 24px var(--accent-glow);
}
.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface-hover); color: var(--text-1); }
.btn-danger {
  background: var(--red-soft);
  color: var(--red);
  border-color: rgba(239,68,68,0.2);
}
.btn-danger:hover { background: rgba(239,68,68,0.22); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }
.btn:active { transform: scale(0.97); }

/* ── Form Elements ─────────────────────────────────────────── */
input, textarea, select {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-family: inherit; font-size: 13px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
label { display: block; font-size: 12px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.form-group { margin-bottom: 14px; }
.form-group small { font-size: 11px; color: var(--text-3); margin-top: 4px; display: block; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Login Screen ──────────────────────────────────────────── */
.login-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 20% 50%, rgba(138,110,255,0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(59,130,246,0.1) 0%, transparent 50%),
              var(--bg);
  padding: 20px;
}

.login-card {
  width: 100%; max-width: 400px;
  padding: 40px;
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-logo {
  text-align: center; margin-bottom: 32px;
}
.logo-icon {
  font-size: 48px; line-height: 1;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 20px rgba(138,110,255,0.5));
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.login-logo h1 { font-size: 24px; font-weight: 800; color: var(--text-1); }
.login-logo p { font-size: 13px; color: var(--text-3); margin-top: 4px; }

.login-meta {
  text-align: center; margin-top: 20px;
  font-size: 11px; color: var(--text-3);
}

.error-msg {
  background: var(--red-soft);
  border: 1px solid rgba(239,68,68,0.3);
  color: var(--red);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px; margin-top: 8px;
  text-align: center; animation: shake 0.3s ease;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ── App Layout ────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  transition: grid-template-columns var(--transition);
}
.app.sidebar-collapsed {
  grid-template-columns: 72px 1fr;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh; position: sticky; top: 0;
  display: flex; flex-direction: column;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  overflow: hidden;
  transition: width var(--transition);
  z-index: 100;
}
.app.sidebar-collapsed .sidebar { width: 72px; }
.app.sidebar-collapsed .sidebar .logo-name,
.app.sidebar-collapsed .sidebar .logo-tag,
.app.sidebar-collapsed .sidebar .nav-section-label,
.app.sidebar-collapsed .sidebar span:not(.nav-badge),
.app.sidebar-collapsed .sidebar .server-info { display: none; }
.app.sidebar-collapsed .sidebar .nav-item { justify-content: center; padding: 10px; }
.app.sidebar-collapsed .sidebar .sidebar-footer { padding: 12px; }

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo { display: flex; align-items: center; gap: 10px; overflow: hidden; }
.logo-icon-sm { font-size: 24px; flex-shrink: 0; }
.logo-name { font-size: 16px; font-weight: 700; color: var(--text-1); white-space: nowrap; }
.logo-tag { font-size: 10px; font-weight: 500; color: var(--green); white-space: nowrap; }

.sidebar-toggle {
  background: none; border: none; color: var(--text-3); cursor: pointer;
  padding: 6px; border-radius: var(--radius-sm);
  transition: all var(--transition); flex-shrink: 0;
}
.sidebar-toggle:hover { color: var(--text-1); background: var(--surface-hover); }

.sidebar-nav {
  flex: 1; padding: 12px 8px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
}
.nav-section-label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-3); padding: 12px 10px 4px; white-space: nowrap;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2); text-decoration: none;
  font-size: 13px; font-weight: 500;
  transition: all var(--transition);
  position: relative; white-space: nowrap; overflow: hidden;
}
.nav-item svg { flex-shrink: 0; }
.nav-item:hover { background: var(--surface-hover); color: var(--text-1); }
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(138,110,255,0.2);
}
.nav-item.active svg { color: var(--accent); }

.nav-badge {
  margin-left: auto; flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 10px; padding: 1px 7px;
  font-size: 11px; font-weight: 600;
}
.new-badge { background: var(--green-soft); color: var(--green); }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}
.server-info { margin-bottom: 12px; }
.info-item {
  display: flex; justify-content: space-between;
  margin-bottom: 6px;
}
.info-label { font-size: 11px; color: var(--text-3); }
.info-value { font-size: 11px; font-weight: 600; color: var(--text-1); font-family: 'JetBrains Mono', monospace; }

/* ── Main Content ──────────────────────────────────────────── */
.main-content {
  display: flex; flex-direction: column;
  min-height: 100vh; overflow: hidden;
}

/* ── Topbar ────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-menu-btn {
  display: none; background: none; border: none; color: var(--text-2);
  cursor: pointer; padding: 6px; border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.topbar-menu-btn:hover { color: var(--text-1); background: var(--surface-hover); }
.page-title-wrap h2 { font-size: 18px; font-weight: 600; }
.page-title-wrap p { font-size: 12px; color: var(--text-3); }

.topbar-right { display: flex; align-items: center; gap: 8px; }
.api-url-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 5px 12px;
  font-size: 12px; color: var(--text-2);
  font-family: 'JetBrains Mono', monospace;
  cursor: default;
}

/* ── Pages Container ───────────────────────────────────────── */
.pages-container {
  flex: 1; overflow-y: auto;
}
.page { display: none; padding: 24px; animation: fadeIn 0.3s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ── Stats Grid ────────────────────────────────────────────── */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  padding: 20px;
  display: flex; align-items: center; gap: 16px;
  position: relative; overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon { font-size: 32px; line-height: 1; flex-shrink: 0; }
.stat-body .stat-value { font-size: 28px; font-weight: 800; font-family: 'JetBrains Mono', monospace; }
.stat-body .stat-label { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.online-card { border-color: rgba(34,197,94,0.2); }
.pulse-ring {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 0 rgba(34,197,94,0.5);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  70% { box-shadow: 0 0 0 10px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* ── Dashboard Grid ────────────────────────────────────────── */
.dashboard-grid {
  display: grid; grid-template-columns: 1fr 380px; gap: 16px;
}
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } }

.panel { padding: 0; overflow: hidden; }
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.panel-header h3 { font-size: 14px; font-weight: 600; }
.panel-body { padding: 16px; }

.info-rows { display: flex; flex-direction: column; gap: 12px; }
.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text-2);
}
.info-row:last-child { border-bottom: none; padding-bottom: 0; }
.info-row strong { font-weight: 600; color: var(--text-1); font-family: 'JetBrains Mono', monospace; font-size: 12px; }

.status-badge {
  display: inline-block; padding: 3px 10px; border-radius: 10px;
  font-size: 11px; font-weight: 600;
}
.status-badge.online { background: var(--green-soft); color: var(--green); }
.status-badge.offline { background: var(--red-soft); color: var(--red); }

/* ── User Items ────────────────────────────────────────────── */
.user-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.user-item:last-child { border-bottom: none; }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0; overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-name { font-weight: 500; }
.user-email { font-size: 11px; color: var(--text-3); }
.user-time { margin-left: auto; font-size: 11px; color: var(--text-3); white-space: nowrap; }

/* ── Toolbar ───────────────────────────────────────────────── */
.page-toolbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
}
.search-bar {
  flex: 1; max-width: 360px;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.search-bar svg { color: var(--text-3); flex-shrink: 0; }
.search-bar input { background: none; border: none; padding: 0; font-size: 13px; box-shadow: none; }

/* ── Data Table ────────────────────────────────────────────── */
.table-container { overflow: auto; }
.data-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  min-width: 600px;
}
.data-table th {
  text-align: left; padding: 12px 16px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--text-3); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-2); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.data-table tr:hover td { background: var(--surface-hover); color: var(--text-1); }
.data-table tr:last-child td { border-bottom: none; }

.badge-active { background: var(--green-soft); color: var(--green); padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.badge-banned { background: var(--red-soft); color: var(--red); padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.badge-google { background: var(--blue-soft); color: var(--blue); padding: 2px 8px; border-radius: 4px; font-size: 11px; }

.action-btns { display: flex; gap: 4px; }
.mono { font-family: 'JetBrains Mono', monospace; font-size: 11px; }

/* ── Pagination ────────────────────────────────────────────── */
.pagination {
  display: flex; gap: 6px; margin-top: 16px;
  justify-content: flex-end;
}
.pagination button {
  padding: 5px 12px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-2); font-size: 12px; cursor: pointer;
  transition: all var(--transition);
}
.pagination button:hover, .pagination button.active {
  background: var(--accent-soft); border-color: var(--accent); color: var(--accent);
}

/* ── Database Layout ───────────────────────────────────────── */
.db-layout {
  display: grid; grid-template-columns: 220px 1fr; gap: 16px;
  min-height: calc(100vh - var(--topbar-h) - 48px);
}
.db-sidebar { display: flex; flex-direction: column; overflow: hidden; }
.db-sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 600;
}
.tables-list { overflow-y: auto; padding: 8px; flex: 1; }
.table-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-radius: var(--radius-sm);
  cursor: pointer; transition: all var(--transition);
  font-size: 12px; color: var(--text-2);
}
.table-item:hover { background: var(--surface-hover); color: var(--text-1); }
.table-item.active { background: var(--accent-soft); color: var(--accent); }
.table-row-count { font-size: 10px; color: var(--text-3); font-family: 'JetBrains Mono', monospace; }

.db-main { display: flex; flex-direction: column; gap: 12px; }
.db-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0;
}
.db-table-name { font-size: 15px; font-weight: 600; color: var(--text-2); }
.db-toolbar-actions { display: flex; gap: 8px; }

.sql-editor { padding: 0; overflow: hidden; }
.sql-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  font-size: 12px; font-weight: 500; color: var(--text-3);
}
#sql-input {
  width: 100%; border: none; border-radius: 0;
  background: transparent; resize: none; height: 80px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  padding: 12px 14px; color: var(--text-1);
  box-shadow: none;
}

/* ── Storage / Files Grid ──────────────────────────────────── */
.files-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px;
}
.file-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; cursor: pointer;
  transition: all var(--transition); text-align: center;
}
.file-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.file-icon { font-size: 36px; margin-bottom: 8px; }
.file-name { font-size: 11px; color: var(--text-1); font-weight: 500; word-break: break-all; }
.file-size { font-size: 10px; color: var(--text-3); margin-top: 4px; }
.file-preview { width: 100%; height: 100px; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 8px; }
.storage-upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius-lg);
  padding: 40px; text-align: center; cursor: pointer;
  transition: all var(--transition); color: var(--text-3);
  grid-column: 1 / -1;
}
.storage-upload-zone:hover { border-color: var(--accent); color: var(--text-1); background: var(--accent-soft); }

/* ── Chats Layout ──────────────────────────────────────────── */
.chats-layout { display: grid; grid-template-columns: 280px 1fr; gap: 16px; min-height: 500px; }
.chats-list-panel { display: flex; flex-direction: column; overflow: hidden; }
.chats-panel-header { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.chats-panel-header h4 { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.search-bar-sm input {
  padding: 7px 10px; font-size: 12px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.05);
}
.chat-list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background var(--transition);
}
.chat-list-item:hover { background: var(--surface-hover); }
.chat-list-item.active { background: var(--accent-soft); }

.chats-view-panel { display: flex; flex-direction: column; overflow: hidden; }
.chat-messages { flex: 1; padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.msg-bubble {
  max-width: 65%; padding: 10px 14px; border-radius: 12px;
  font-size: 13px; line-height: 1.5;
}
.msg-in { background: var(--surface); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg-out { background: var(--accent-soft); align-self: flex-end; border-bottom-right-radius: 4px; }
.msg-sender { font-size: 10px; color: var(--text-3); margin-bottom: 3px; font-weight: 600; }
.msg-time { font-size: 10px; color: var(--text-3); margin-top: 3px; text-align: right; }

/* ── AI Page ────────────────────────────────────────────────── */
.ai-container { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.ai-header {
  display: flex; align-items: center; gap: 16px; padding: 20px 24px;
}
.ai-icon-wrap { font-size: 40px; flex-shrink: 0; }
.ai-header h3 { font-size: 18px; font-weight: 700; }
.ai-header p { font-size: 13px; color: var(--text-3); margin-top: 3px; }

.ai-mcp-setup, .ai-examples, .ai-tools-list { padding: 20px 24px; }
.ai-mcp-setup h4, .ai-examples h4, .ai-tools-list h4 { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.ai-mcp-setup p { font-size: 13px; color: var(--text-2); margin-bottom: 14px; }

.code-block {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
  position: relative; margin-bottom: 16px;
}
.code-block pre {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--text-2); overflow-x: auto; white-space: pre-wrap; word-break: break-all;
  padding-right: 60px;
}
.copy-btn {
  position: absolute; top: 10px; right: 10px;
  background: var(--accent-soft); border: 1px solid rgba(138,110,255,0.3);
  color: var(--accent); padding: 4px 10px; border-radius: 4px;
  font-size: 11px; cursor: pointer; transition: all var(--transition);
}
.copy-btn:hover { background: var(--accent); color: white; }

.mcp-instructions { display: flex; flex-direction: column; gap: 8px; }
.step { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }
.step-num {
  width: 20px; height: 20px; background: var(--accent-soft);
  border: 1px solid rgba(138,110,255,0.3); border-radius: 50%;
  color: var(--accent); display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}

.examples-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.example-chip {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 7px 14px; font-size: 12px; color: var(--text-2);
  cursor: pointer; transition: all var(--transition);
}
.example-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.tool-card {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px;
}
.tool-name { font-size: 12px; font-weight: 600; color: var(--accent); font-family: 'JetBrains Mono', monospace; margin-bottom: 4px; }
.tool-desc { font-size: 11px; color: var(--text-3); line-height: 1.4; }

/* ── Settings ───────────────────────────────────────────────── */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 16px; }
.settings-panel { padding: 20px 24px; }
.settings-panel-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.settings-icon { font-size: 20px; }
.settings-panel-header h4 { font-size: 14px; font-weight: 600; }

.danger-panel { border-color: rgba(239,68,68,0.2); }
.danger-actions { display: flex; flex-direction: column; gap: 12px; }
.danger-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.danger-item > div > strong { font-size: 13px; }
.danger-item > div > p { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* Toggle switch */
.toggle { display: inline-flex; align-items: center; cursor: pointer; }
.toggle input { display: none; }
.toggle-slider {
  width: 40px; height: 22px; background: rgba(255,255,255,0.1);
  border-radius: 11px; position: relative; transition: background 0.2s;
}
.toggle-slider::after {
  content: ''; position: absolute; left: 3px; top: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: white; transition: transform 0.2s;
}
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::after { transform: translateX(18px); }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn 0.2s ease;
}
.modal { width: 100%; max-width: 500px; max-height: 80vh; overflow: hidden; display: flex; flex-direction: column; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 15px; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text-3); cursor: pointer; font-size: 18px; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* ── Toast ──────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px; max-width: 340px;
}
.toast {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-1);
  box-shadow: var(--shadow);
  animation: slideInRight 0.3s ease;
}
@keyframes slideInRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.toast.success { border-color: rgba(34,197,94,0.3); }
.toast.error { border-color: rgba(239,68,68,0.3); }
.toast.info { border-color: rgba(138,110,255,0.3); }

/* ── Empty / Loading States ─────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-3); }
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }
.loading-state { text-align: center; padding: 24px; color: var(--text-3); font-size: 13px; }
.loading-state::after { content: ''; animation: dots 1.5s infinite; }
@keyframes dots { 0%,100% { content: ''; } 33% { content: '.'; } 66% { content: '..'; } }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: -100%; top: 0; height: 100vh; z-index: 200;
    transition: left var(--transition);
  }
  .sidebar.mobile-open { left: 0; }
  .topbar-menu-btn { display: flex; }
  .db-layout { grid-template-columns: 1fr; }
  .chats-layout { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
}
