@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Syne:wght@400;600;700;800&display=swap');

/* ── VARIABLES ─────────────────────────────────────────────── */
:root {
  --bg:        #0a0c0f;
  --bg-panel:  #0f1218;
  --bg-card:   #141820;
  --bg-hover:  #1a2030;
  --border:    #1e2a3a;
  --border-hi: #2a3d55;
  --accent:    #00e5a0;
  --accent-2:  #0091ff;
  --accent-3:  #ff6b35;
  --text:      #e2e8f0;
  --text-muted:#6b7fa3;
  --text-dim:  #3d4f6a;
  --font-mono: 'Space Mono', monospace;
  --font-ui:   'Syne', sans-serif;
  --radius:    6px;
  --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ── NOISE OVERLAY ──────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 1000; opacity: 0.4;
}

/* ── SCROLLBAR ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── TYPOGRAPHY ─────────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--font-ui); font-weight: 700; line-height: 1.2; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-muted); }
.accent { color: var(--accent); }

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 13px;
  cursor: pointer; border: none; transition: var(--transition);
  position: relative; overflow: hidden;
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: white; opacity: 0; transition: opacity 0.15s;
}
.btn:hover::after { opacity: 0.05; }
.btn-primary {
  background: var(--accent); color: #000; font-weight: 700;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(0,229,160,0.25); }
.btn-secondary {
  background: transparent; color: var(--text);
  border: 1px solid var(--border-hi);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost {
  background: transparent; color: var(--text-muted); padding: 8px 12px;
}
.btn-ghost:hover { color: var(--text); }
.btn-danger {
  background: transparent; color: #ff6b6b;
  border: 1px solid rgba(255,107,107,0.3);
}
.btn-danger:hover { background: rgba(255,107,107,0.1); border-color: #ff6b6b; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-icon { padding: 8px; border-radius: var(--radius); background: var(--bg-card); border: 1px solid var(--border); color: var(--text-muted); cursor: pointer; transition: var(--transition); display: inline-flex; align-items: center; justify-content: center; }
.btn-icon:hover { border-color: var(--accent); color: var(--accent); }

/* ── INPUTS ─────────────────────────────────────────────────── */
.input, .textarea, .select {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 13px;
  padding: 10px 14px;
  transition: var(--transition);
  outline: none;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,229,160,0.08);
}
.textarea { resize: vertical; min-height: 100px; line-height: 1.6; }
.select { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7fa3' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 36px;
}
.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-label { font-size: 12px; font-family: var(--font-mono); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.input-hint { font-size: 11px; color: var(--text-dim); font-family: var(--font-mono); }

/* ── CARDS ──────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 13px; font-family: var(--font-mono); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; display: flex; align-items: center; gap: 8px; }
.card-title .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; }

/* ── BADGE ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-family: var(--font-mono); font-weight: 700;
  letter-spacing: 0.05em;
}
.badge-green { background: rgba(0,229,160,0.1); color: var(--accent); border: 1px solid rgba(0,229,160,0.2); }
.badge-blue  { background: rgba(0,145,255,0.1); color: var(--accent-2); border: 1px solid rgba(0,145,255,0.2); }
.badge-orange{ background: rgba(255,107,53,0.1); color: var(--accent-3); border: 1px solid rgba(255,107,53,0.2); }

/* ── NAVBAR ─────────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; height: 58px;
  background: rgba(10,12,15,0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.navbar-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 15px; font-weight: 700;
  color: var(--text);
}
.navbar-logo-icon {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--accent); display: flex; align-items: center; justify-content: center;
  color: #000; font-size: 14px;
}
.navbar-logo span { color: var(--accent); }
.navbar-links { display: flex; align-items: center; gap: 6px; }
.navbar-link {
  padding: 6px 14px; border-radius: var(--radius);
  font-size: 13px; color: var(--text-muted);
  transition: var(--transition); cursor: pointer;
}
.navbar-link:hover { color: var(--text); background: var(--bg-hover); }
.navbar-link.active { color: var(--accent); }

/* ── FOOTER ─────────────────────────────────────────────────── */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 36px 48px 28px;
  background: var(--bg-panel);
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px;
}
.footer-brand-name { font-family: var(--font-mono); font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.footer-brand-name span { color: var(--accent); }
.footer-brand-desc { font-size: 13px; color: var(--text-muted); line-height: 1.7; max-width: 260px; }
.footer-col-title { font-size: 11px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); margin-bottom: 14px; }
.footer-col-links { display: flex; flex-direction: column; gap: 9px; }
.footer-col-links a { font-size: 13px; color: var(--text-muted); transition: var(--transition); }
.footer-col-links a:hover { color: var(--accent); }
.footer-bottom {
  max-width: 1100px; margin: 28px auto 0;
  padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--text-dim); font-family: var(--font-mono);
}
.footer-bottom-links { display: flex; gap: 20px; }
.footer-bottom-links a { color: var(--text-dim); transition: var(--transition); }
.footer-bottom-links a:hover { color: var(--text-muted); }

/* ── TOGGLE ─────────────────────────────────────────────────── */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.toggle-label { font-size: 13px; color: var(--text); }
.toggle-desc { font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); }
.toggle {
  position: relative; width: 40px; height: 22px; flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--border-hi); border-radius: 22px;
  transition: var(--transition);
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 16px; height: 16px; left: 3px; bottom: 3px;
  background: var(--text-muted); border-radius: 50%;
  transition: var(--transition);
}
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); background: #000; }

/* ── STATUS DOT ─────────────────────────────────────────────── */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.status-dot.online { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.status-dot.offline { background: var(--text-dim); }
.status-dot.error { background: #ff6b6b; box-shadow: 0 0 6px #ff6b6b; }

/* ── DIVIDER ────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--text-dim); font-size: 12px; font-family: var(--font-mono); }
.divider-text::before, .divider-text::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── PAGE LAYOUT ────────────────────────────────────────────── */
.page-content { flex: 1; }

/* ── ANIMATIONS ─────────────────────────────────────────────── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes blink  { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes pulse  { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

.fade-up { animation: fadeUp 0.5s ease both; }
.fade-up-1 { animation-delay: 0.05s; }
.fade-up-2 { animation-delay: 0.12s; }
.fade-up-3 { animation-delay: 0.20s; }
.fade-up-4 { animation-delay: 0.30s; }
.fade-up-5 { animation-delay: 0.40s; }
.fade-up-6 { animation-delay: 0.50s; }

/* ── CURSOR BLINK ───────────────────────────────────────────── */
.cursor { animation: blink 1s step-end infinite; color: var(--accent); }

/* ── TOAST ──────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px; z-index: 9999;
}
.toast {
  background: var(--bg-card); border: 1px solid var(--border-hi);
  border-radius: var(--radius); padding: 12px 16px;
  font-size: 13px; font-family: var(--font-mono);
  display: flex; align-items: center; gap: 10px;
  animation: slideIn 0.2s ease both;
  min-width: 240px; max-width: 360px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.toast.success { border-left: 3px solid var(--accent); }
.toast.error   { border-left: 3px solid #ff6b6b; }
.toast.info    { border-left: 3px solid var(--accent-2); }

/* ── MODAL ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-panel); border: 1px solid var(--border-hi);
  border-radius: 10px; padding: 28px; width: 100%; max-width: 480px;
  transform: translateY(12px); transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 18px; padding: 4px; line-height: 1; transition: color 0.15s; }
.modal-close:hover { color: var(--text); }

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .navbar { padding: 0 16px; }
  .navbar-links .btn-secondary { display: none; }
}
@media (max-width: 500px) {
  .footer-inner { grid-template-columns: 1fr; }
}

/* ────────────────────────────────────────────────────────────── */
/* INDEX PAGE STYLES                                             */
/* ────────────────────────────────────────────────────────────── */
.hero {
  min-height: calc(100vh - 58px);
  display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
  padding: 80px 48px;
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0,229,160,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,160,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 0%, black 40%, transparent 100%);
}
.hero-glow {
  position: absolute; top: -200px; left: 50%; transform: translateX(-50%);
  width: 600px; height: 400px;
  background: radial-gradient(ellipse, rgba(0,229,160,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero-content { max-width: 740px; position: relative; z-index: 1; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 24px;
  border: 1px solid rgba(0,229,160,0.2); padding: 6px 14px; border-radius: 20px;
  background: rgba(0,229,160,0.05);
}
.hero-title { font-size: clamp(36px, 6vw, 68px); font-weight: 800; line-height: 1.08; margin-bottom: 20px; }
.hero-title .line2 { color: var(--accent); }
.hero-desc { font-size: 17px; color: var(--text-muted); line-height: 1.8; margin-bottom: 36px; max-width: 580px; }
.hero-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hero-sql-preview {
  position: absolute; right: 48px; top: 50%; transform: translateY(-50%);
  width: min(420px, 40vw); background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; font-family: var(--font-mono); font-size: 13px;
}
.sql-preview-bar {
  background: var(--bg-panel); border-bottom: 1px solid var(--border);
  padding: 10px 14px; display: flex; align-items: center; gap: 8px;
}
.sql-preview-bar .dot-red   { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.sql-preview-bar .dot-yellow{ width: 10px; height: 10px; border-radius: 50%; background: #febc2e; }
.sql-preview-bar .dot-green { width: 10px; height: 10px; border-radius: 50%; background: #28c840; }
.sql-preview-filename { margin-left: 8px; color: var(--text-dim); font-size: 12px; }
.sql-preview-body { padding: 18px; line-height: 1.8; }
.sql-kw  { color: var(--accent-2); }
.sql-str { color: #ffd700; }
.sql-fn  { color: var(--accent-3); }
.sql-cmt { color: var(--text-dim); }
.sql-tbl { color: var(--accent); }
.sql-num { color: #c084fc; }

/* FEATURES SECTION */
.section { padding: 80px 48px; }
.section-label {
  font-family: var(--font-mono); font-size: 12px; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 12px;
}
.section-title { font-size: clamp(28px, 4vw, 42px); font-weight: 800; margin-bottom: 16px; }
.section-desc { font-size: 16px; color: var(--text-muted); max-width: 560px; line-height: 1.8; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 48px; }
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 24px;
  transition: var(--transition);
}
.feature-card:hover { border-color: var(--border-hi); transform: translateY(-2px); box-shadow: 0 12px 40px rgba(0,0,0,0.3); }
.feature-icon {
  width: 40px; height: 40px; border-radius: 8px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  background: rgba(0,229,160,0.08); border: 1px solid rgba(0,229,160,0.15);
}
.feature-card:nth-child(2) .feature-icon { background: rgba(0,145,255,0.08); border-color: rgba(0,145,255,0.15); }
.feature-card:nth-child(3) .feature-icon { background: rgba(255,107,53,0.08); border-color: rgba(255,107,53,0.15); }
.feature-card:nth-child(4) .feature-icon { background: rgba(192,132,252,0.08); border-color: rgba(192,132,252,0.15); }
.feature-title { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.feature-desc { font-size: 13px; color: var(--text-muted); line-height: 1.7; }

/* HOW IT WORKS */
.steps { display: flex; flex-direction: column; gap: 0; margin-top: 48px; max-width: 680px; }
.step { display: flex; gap: 24px; padding: 24px 0; border-bottom: 1px solid var(--border); }
.step:last-child { border-bottom: none; }
.step-num {
  font-family: var(--font-mono); font-size: 11px; color: var(--accent);
  background: rgba(0,229,160,0.08); border: 1px solid rgba(0,229,160,0.2);
  width: 32px; height: 32px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
  margin-top: 2px;
}
.step-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.step-desc { font-size: 13px; color: var(--text-muted); line-height: 1.7; }

/* ────────────────────────────────────────────────────────────── */
/* AUTH PAGE STYLES                                              */
/* ────────────────────────────────────────────────────────────── */
.auth-layout {
  min-height: calc(100vh - 58px);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px; position: relative; overflow: hidden;
}
.auth-glow-left  { position: absolute; left: -200px; top: 50%; transform: translateY(-50%); width: 400px; height: 400px; background: radial-gradient(circle, rgba(0,229,160,0.06), transparent 70%); pointer-events: none; }
.auth-glow-right { position: absolute; right: -200px; bottom: 0; width: 400px; height: 400px; background: radial-gradient(circle, rgba(0,145,255,0.05), transparent 70%); pointer-events: none; }
.auth-box {
  width: 100%; max-width: 420px; position: relative; z-index: 1;
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo-mark {
  width: 48px; height: 48px; border-radius: 12px; background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin: 0 auto 12px; color: #000;
}
.auth-logo-text { font-family: var(--font-mono); font-size: 16px; font-weight: 700; }
.auth-logo-text span { color: var(--accent); }
.auth-card {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 32px;
}
.auth-tabs { display: flex; gap: 4px; margin-bottom: 28px; background: var(--bg-card); border-radius: var(--radius); padding: 4px; }
.auth-tab {
  flex: 1; padding: 8px; text-align: center; cursor: pointer;
  border-radius: 4px; font-size: 13px; font-family: var(--font-mono);
  color: var(--text-muted); transition: var(--transition);
}
.auth-tab.active { background: var(--bg-hover); color: var(--text); }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form-panel { display: none; }
.auth-form-panel.active { display: flex; flex-direction: column; gap: 16px; }
.auth-subtitle { font-size: 13px; color: var(--text-muted); text-align: center; margin-bottom: 4px; }
.auth-footer-note { text-align: center; margin-top: 20px; font-size: 12px; color: var(--text-dim); font-family: var(--font-mono); }
.auth-footer-note a { color: var(--text-muted); transition: color 0.15s; }
.auth-footer-note a:hover { color: var(--accent); }

/* ────────────────────────────────────────────────────────────── */
/* WORKSHOP PAGE STYLES                                          */
/* ────────────────────────────────────────────────────────────── */
.workshop-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  grid-template-rows: 1fr;
  height: calc(100vh - 58px);
  overflow: hidden;
}
.sidebar {
  background: var(--bg-panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow-y: auto;
}
.sidebar-section { padding: 16px; border-bottom: 1px solid var(--border); }
.sidebar-section-title { font-size: 11px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); margin-bottom: 12px; }
.db-connect-btn {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius);
  background: var(--bg-card); border: 1px dashed var(--border-hi);
  color: var(--text-muted); font-size: 12px; font-family: var(--font-mono);
  cursor: pointer; transition: var(--transition);
}
.db-connect-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(0,229,160,0.04); }
.db-status {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius);
  background: var(--bg-card); border: 1px solid var(--border);
  font-size: 12px; font-family: var(--font-mono); color: var(--text-muted);
}
.db-name { font-weight: 700; color: var(--text); }
.db-tables { margin-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.db-table-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  border-radius: 4px; font-size: 12px; font-family: var(--font-mono);
  color: var(--text-muted); cursor: pointer; transition: var(--transition);
}
.db-table-item:hover { background: var(--bg-hover); color: var(--text); }
.db-table-item .table-icon { color: var(--accent-2); font-size: 11px; }
.db-table-item .row-count { margin-left: auto; color: var(--text-dim); font-size: 10px; }

.sidebar-history { flex: 1; padding: 16px; overflow-y: auto; }
.history-item {
  padding: 10px 12px; border-radius: var(--radius);
  cursor: pointer; transition: var(--transition); margin-bottom: 4px;
  border: 1px solid transparent;
}
.history-item:hover { background: var(--bg-hover); border-color: var(--border); }
.history-item.active { background: var(--bg-hover); border-color: var(--border-hi); }
.history-item-query { font-size: 12px; font-family: var(--font-mono); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-item-time { font-size: 10px; color: var(--text-dim); margin-top: 3px; }

.workshop-main {
  display: flex; flex-direction: column; overflow: hidden;
}
.workshop-header {
  padding: 12px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0; background: var(--bg-panel);
}
.workshop-header-left { display: flex; align-items: center; gap: 12px; }
.workshop-header-title { font-size: 14px; font-weight: 700; }
.workshop-header-sub { font-size: 12px; font-family: var(--font-mono); color: var(--text-muted); }
.workshop-header-right { display: flex; align-items: center; gap: 8px; }

.workshop-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; }

/* Prompt area */
.prompt-area {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; transition: border-color 0.2s;
}
.prompt-area:focus-within { border-color: var(--accent); }
.prompt-toolbar {
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-panel);
}
.prompt-toolbar-label { font-size: 11px; font-family: var(--font-mono); color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; flex: 1; }
.prompt-textarea {
  width: 100%; min-height: 90px; max-height: 200px;
  background: transparent; border: none; outline: none;
  color: var(--text); font-family: var(--font-ui); font-size: 14px;
  padding: 14px 16px; resize: none; line-height: 1.6;
}
.prompt-footer {
  padding: 10px 14px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-panel);
}
.prompt-footer-left { display: flex; align-items: center; gap: 8px; }
.prompt-hint { font-size: 12px; font-family: var(--font-mono); color: var(--text-dim); }

/* Dialect selector */
.dialect-wrap { position: relative; }
.dialect-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: var(--radius);
  background: var(--bg-hover); border: 1px solid var(--border-hi);
  font-size: 12px; font-family: var(--font-mono); color: var(--text-muted);
  cursor: pointer; transition: var(--transition);
}
.dialect-btn:hover { border-color: var(--accent); color: var(--text); }
.dialect-btn .arrow { font-size: 9px; transition: transform 0.15s; }
.dialect-btn.open .arrow { transform: rotate(180deg); }
.dialect-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0;
  background: var(--bg-panel); border: 1px solid var(--border-hi);
  border-radius: var(--radius); overflow: hidden; z-index: 50;
  min-width: 160px; box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  opacity: 0; pointer-events: none; transform: translateY(-4px); transition: all 0.15s;
}
.dialect-dropdown.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.dialect-option {
  padding: 9px 14px; font-size: 12px; font-family: var(--font-mono);
  color: var(--text-muted); cursor: pointer; transition: background 0.1s;
  display: flex; align-items: center; justify-content: space-between;
}
.dialect-option:hover { background: var(--bg-hover); color: var(--text); }
.dialect-option.active { color: var(--accent); }
.dialect-option .check { color: var(--accent); font-size: 10px; }

/* SQL output */
.sql-output-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
}
.sql-output-header {
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-panel);
}
.sql-output-actions { margin-left: auto; display: flex; gap: 6px; }
.sql-output-body {
  padding: 16px; font-family: var(--font-mono); font-size: 13px;
  line-height: 1.8; overflow-x: auto; white-space: pre;
  color: var(--text); min-height: 80px;
}
.sql-placeholder { color: var(--text-dim); font-style: italic; white-space: normal; }

/* Execute toggle + results */
.execute-section { display: flex; flex-direction: column; gap: 12px; }
.execute-row {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.execute-row-info { display: flex; flex-direction: column; gap: 2px; }
.execute-row-label { font-size: 14px; font-weight: 600; }
.execute-row-desc { font-size: 12px; font-family: var(--font-mono); color: var(--text-muted); }

.results-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
}
.results-header {
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-panel);
}
.results-export-btns { margin-left: auto; display: flex; gap: 6px; }
.results-table-wrap { overflow-x: auto; }
.results-table {
  width: 100%; border-collapse: collapse;
  font-family: var(--font-mono); font-size: 12px;
}
.results-table th {
  padding: 9px 14px; text-align: left;
  background: var(--bg-panel); border-bottom: 1px solid var(--border);
  color: var(--text-muted); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; font-size: 11px;
  white-space: nowrap;
}
.results-table td {
  padding: 9px 14px; border-bottom: 1px solid var(--border);
  color: var(--text); white-space: nowrap;
}
.results-table tr:last-child td { border-bottom: none; }
.results-table tr:hover td { background: var(--bg-hover); }
.results-table td.null-val { color: var(--text-dim); font-style: italic; }
.results-footer {
  padding: 10px 14px; border-top: 1px solid var(--border);
  font-size: 11px; font-family: var(--font-mono); color: var(--text-dim);
  display: flex; align-items: center; gap: 10px;
}
.results-time { margin-left: auto; }
.results-hidden { display: none; }


.auth-alert {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(255, 80, 80, 0.08);
  border: 1px solid rgba(255, 80, 80, 0.3);
  color: #ff6b6b;
  font-size: 13px;
  font-family: var(--font-mono);
  margin-bottom: 12px;
}
.auth-alert::before {
  content: '⚠';
  flex-shrink: 0;
}