:root {
  color-scheme: dark;
  --bg: #eef3f9;
  --bg-accent: #e7eef9;
  --panel: rgba(255, 255, 255, 0.84);
  --panel-strong: rgba(255, 255, 255, 0.98);
  --text: #0f172a;
  --muted: #5b687f;
  --accent: #1d4ed8;
  --accent-2: #0f766e;
  --accent-soft: rgba(29, 78, 216, 0.10);
  --line: rgba(15, 23, 42, 0.08);
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  --shadow-strong: 0 28px 70px rgba(15, 23, 42, 0.14);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", "Segoe UI", "Arial", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(29, 78, 216, 0.12), transparent 22%),
    radial-gradient(circle at 80% 0%, rgba(15, 118, 110, 0.08), transparent 26%),
    linear-gradient(180deg, #f8fbff, var(--bg));
  min-height: 100vh;
  letter-spacing: -0.01em;
}
body.theme-dark {
  --bg: #09101d;
  --bg-accent: #111b2e;
  --panel: rgba(15, 23, 42, 0.84);
  --panel-strong: rgba(15, 23, 42, 0.95);
  --text: #e5eefb;
  --muted: #9fb0c9;
  --accent: #60a5fa;
  --accent-2: #2dd4bf;
  --accent-soft: rgba(96, 165, 250, 0.12);
  --line: rgba(148, 163, 184, 0.14);
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.26);
  --shadow-strong: 0 28px 70px rgba(0, 0, 0, 0.40);
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.16), transparent 22%),
    radial-gradient(circle at 80% 0%, rgba(45, 212, 191, 0.10), transparent 26%),
    linear-gradient(180deg, #09101d, var(--bg));
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes subtleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
@keyframes glowPulse {
  0%, 100% { opacity: .55; transform: scale(1); }
  50% { opacity: .95; transform: scale(1.08); }
}
@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -10px, 0); }
}
@keyframes scanline {
  0% { transform: translateY(-120%); }
  100% { transform: translateY(120%); }
}
#app { display: grid; grid-template-columns: 320px 1fr; min-height: 100vh; }
.login-mode #app {
  display: block;
}
.login-shell {
  position: relative;
  min-height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: block;
  padding: 32px 36px;
  isolation: isolate;
  background:
    radial-gradient(circle at 20% 15%, rgba(96, 165, 250, 0.22), transparent 22%),
    radial-gradient(circle at 80% 20%, rgba(45, 212, 191, 0.18), transparent 20%),
    radial-gradient(circle at 50% 80%, rgba(168, 85, 247, 0.16), transparent 18%),
    linear-gradient(160deg, #040816 0%, #081225 38%, #06101d 100%);
}
.login-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at center, black 42%, transparent 78%);
  opacity: .25;
  pointer-events: none;
}
.login-shell::after {
  content: "";
  position: absolute;
  inset: -20% 0 auto;
  height: 40vh;
  background: linear-gradient(180deg, rgba(96,165,250,0.24), transparent);
  filter: blur(30px);
  animation: scanline 12s linear infinite;
  pointer-events: none;
}
.login-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(28px);
  pointer-events: none;
  animation: drift 10s ease-in-out infinite;
}
.orb-one { width: 260px; height: 260px; left: 6%; top: 14%; background: rgba(59,130,246,.38); animation-duration: 12s; }
.orb-two { width: 340px; height: 340px; right: 8%; top: 8%; background: rgba(20,184,166,.22); animation-duration: 14s; }
.orb-three { width: 220px; height: 220px; bottom: 10%; left: 30%; background: rgba(168,85,247,.20); animation-duration: 11s; }
.login-stage {
  width: min(100%, 1480px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(420px, 480px) minmax(0, 1fr);
  column-gap: clamp(28px, 4vw, 72px);
  align-items: center;
  z-index: 1;
}
.login-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  padding: 34px 32px 30px;
  border-radius: 28px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(8, 15, 31, 0.86)),
    radial-gradient(circle at top, rgba(96,165,250,.12), transparent 30%);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(22px);
  color: #e5eefb;
  z-index: 1;
  animation: fadeInUp 420ms ease both;
}
.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(96,165,250,.45), rgba(45,212,191,.18), rgba(168,85,247,.22));
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}
.login-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,.10), transparent 22%);
  pointer-events: none;
}
.login-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.login-kicker, .login-status, .login-chip {
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.login-kicker {
  color: #7dd3fc;
}
.login-status {
  color: #99f6e4;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(16,185,129,.10);
  border: 1px solid rgba(16,185,129,.18);
}
.login-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}
.login-mark {
  width: 58px;
  height: 58px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: white;
  background: linear-gradient(135deg, #7c3aed, #2563eb 50%, #14b8a6);
  box-shadow: 0 18px 45px rgba(37,99,235,.35);
  animation: glowPulse 4s ease-in-out infinite;
}
.login-title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.04em;
}
.login-subtitle {
  color: rgba(226, 232, 240, 0.72);
  font-size: 13px;
  margin-top: 3px;
}
.login-card h1 {
  margin: 8px 0 10px;
  font-size: clamp(32px, 4vw, 44px);
  line-height: .98;
  letter-spacing: -0.06em;
}
.login-card p {
  margin: 0 0 22px;
  color: rgba(226, 232, 240, 0.72);
  font-size: 15px;
  line-height: 1.65;
  max-width: 48ch;
}
.login-field {
  margin-bottom: 14px;
}
.login-input {
  background: rgba(7, 12, 25, 0.76);
  border-color: rgba(148, 163, 184, 0.22);
  color: #eef6ff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.login-input::placeholder {
  color: rgba(148, 163, 184, 0.7);
}
.login-input:focus {
  border-color: rgba(96, 165, 250, 0.65);
  box-shadow: 0 0 0 4px rgba(59,130,246,.16), inset 0 1px 0 rgba(255,255,255,.04);
}
.login-actions {
  margin-top: 8px;
}
.login-button {
  width: 100%;
  padding: 15px 18px;
  font-size: 15px;
  letter-spacing: -0.01em;
  box-shadow: 0 22px 40px rgba(37,99,235,.34);
}
.login-error {
  margin: 0 0 16px;
}
.login-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.login-hero-panel {
  position: relative;
  width: 100%;
  min-height: 720px;
  display: grid;
  place-items: center;
}
.hero-panel-card {
  width: 100%;
  max-width: 920px;
  min-height: 620px;
  padding: 32px;
  border-radius: 30px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background:
    linear-gradient(180deg, rgba(10, 18, 35, 0.70), rgba(6, 12, 24, 0.86)),
    radial-gradient(circle at 50% 0%, rgba(96,165,250,.16), transparent 28%);
  box-shadow: 0 32px 90px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(18px);
  color: #e5eefb;
  position: relative;
  overflow: hidden;
}
.hero-panel-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 25%, rgba(96,165,250,.24), transparent 18%),
    radial-gradient(circle at 80% 18%, rgba(45,212,191,.16), transparent 16%),
    radial-gradient(circle at 50% 80%, rgba(168,85,247,.16), transparent 20%);
  pointer-events: none;
}
.hero-panel-eyebrow {
  color: #7dd3fc;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 14px;
}
.hero-panel-title {
  font-size: clamp(34px, 4vw, 56px);
  line-height: .96;
  letter-spacing: -0.06em;
  font-weight: 900;
  max-width: 10ch;
}
.hero-panel-copy {
  max-width: 56ch;
  margin-top: 14px;
  color: rgba(226,232,240,.78);
  font-size: 15px;
  line-height: 1.7;
}
.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0 16px;
}
.hero-metric, .hero-grid-item {
  border: 1px solid rgba(148,163,184,.16);
  background: rgba(255,255,255,.04);
  border-radius: 20px;
  padding: 16px 16px 15px;
}
.hero-metric span, .hero-grid-item span {
  display: block;
  color: rgba(226,232,240,.68);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.hero-metric strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
  letter-spacing: -0.03em;
}
.hero-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.hero-grid-item strong {
  display: block;
  font-size: 16px;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}
.hero-grid-item span {
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.55;
  font-size: 13px;
}
.login-chip {
  padding: 9px 12px;
  border-radius: 999px;
  color: rgba(226,232,240,.92);
  border: 1px solid rgba(148,163,184,.18);
  background: rgba(255,255,255,.04);
  backdrop-filter: blur(10px);
}
.boot-card {
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,.2);
  background: rgba(15,23,42,.84);
  color: #e5eefb;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
@media (max-width: 1100px) {
  .login-stage {
    grid-template-columns: 1fr;
  }
  .login-shell {
    padding: 20px;
  }
  .login-stage {
    width: 100%;
    margin: 0;
  }
  .login-card {
    max-width: 640px;
  }
  .login-hero-panel {
    min-height: auto;
  }
  .hero-panel-card {
    width: min(100%, 640px);
  }
}
@media (max-width: 720px) {
  .login-shell {
    padding: 18px;
  }
  .login-card,
  .hero-panel-card {
    border-radius: 22px;
    padding: 24px 20px;
  }
  .hero-metrics,
  .hero-grid {
    grid-template-columns: 1fr;
  }
}
.main-shell { display: grid; grid-template-rows: auto auto; gap: 18px; padding: 22px 24px 30px; animation: fadeInUp 360ms ease both; }
.dashboard-grid { display: grid; grid-template-columns: 1.18fr .82fr; gap: 18px; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 26px 20px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.95), rgba(242, 246, 252, 0.96)),
    radial-gradient(circle at top, rgba(29, 78, 216, 0.06), transparent 30%);
  backdrop-filter: blur(18px);
}
.brand { display: flex; gap: 14px; align-items: center; margin-bottom: 22px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1d4ed8, #0f766e);
  color: #ffffff;
  font-weight: 900;
  box-shadow: 0 12px 30px rgba(29, 78, 216, 0.18);
  animation: subtleFloat 5s ease-in-out infinite;
}
.brand-title { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.brand-subtitle, .footer-note, p, .section-label { color: var(--muted); }
.sidebar-section { margin-top: 16px; display: grid; gap: 8px; }
.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 0 4px;
}
.sidebar-list { display: grid; gap: 8px; }
.empty-side {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.7);
  color: var(--muted);
}
.primary, .secondary, .nav-item, .table-item {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.82);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, color 160ms ease;
}
.primary:hover, .secondary:hover, .nav-item:hover, .table-item:hover { transform: translateY(-1px); border-color: rgba(29,78,216,.22); box-shadow: var(--shadow); }
.primary {
  background: linear-gradient(135deg, #1d4ed8, #0f766e);
  color: #ffffff;
  font-weight: 800;
  margin: 10px 0 18px;
  box-shadow: 0 18px 35px rgba(29, 78, 216, 0.22);
}
.secondary { width: auto; }
.danger {
  width: auto;
  border: 1px solid rgba(239, 68, 68, 0.18);
  background: rgba(254, 242, 242, 0.95);
  color: #b42318;
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
}
.nav-item, .table-item { text-align: left; }
.nav-item.active, .table-item.active { border-color: rgba(29,78,216,.2); background: rgba(29,78,216,0.08); }
.database-item {
  display: grid;
  gap: 4px;
  padding: 12px 13px;
}
.database-name, .table-entry-name {
  font-weight: 700;
  letter-spacing: -0.02em;
}
.database-meta, .table-entry-meta {
  color: var(--muted);
  font-size: 12px;
}
.main { padding: 24px 26px 30px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding: 8px 0 18px;
  border-bottom: 1px solid var(--line);
}
.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.topbar-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.topbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ghost {
  width: auto;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.86);
  color: var(--text);
  border-radius: 12px;
  padding: 11px 14px;
  cursor: pointer;
  font-weight: 600;
}
.ghost:hover { border-color: rgba(37,99,235,.18); box-shadow: var(--shadow); transform: translateY(-1px); }
.hero { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 22px; padding: 10px 0 2px; animation: fadeInUp 360ms ease both; }
.hero h1 { margin: 0 0 10px; font-size: 42px; letter-spacing: -0.055em; line-height: 1.02; }
.hero p { max-width: 780px; margin: 0; font-size: 15px; line-height: 1.6; }
.stats { display: flex; gap: 12px; }
.quick-start-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.quick-start-card {
  padding: 14px 15px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
  display: grid;
  gap: 6px;
}
.quick-start-card strong {
  font-size: 14px;
  letter-spacing: -0.02em;
}
.quick-start-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.stat, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); }
.panel {
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(14px);
  animation: fadeInUp 360ms ease both;
}
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.58), transparent 24%);
  pointer-events: none;
}
.stat {
  min-width: 120px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(243, 248, 255, 0.92));
  border-color: rgba(29, 78, 216, 0.10);
}
.stat-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }
.stat-value { font-size: 30px; font-weight: 800; margin-top: 8px; letter-spacing: -0.04em; }
.workspace { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
.workspace-stack { display: grid; gap: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.panel-head h2,
.panel-head h3,
.table-toolbar-title {
  margin: 0;
}
.panel-head p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}
.panel h2, .panel h3 { letter-spacing: -0.03em; }
.connection-card {
  max-width: 520px;
}
.connection-example {
  margin: 0;
  padding: 14px 15px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(10, 18, 32, 0.96);
  color: #cbd5e1;
  font-family: "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.connection-card .audit-item strong {
  color: var(--text);
}
.connection-card .audit-item .secondary {
  justify-self: start;
}
.grid-frame {
  border-radius: 20px;
  background: rgba(255,255,255,0.84);
}
.footer-note { font-size: 12px; }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.22), transparent 65%);
  opacity: 0.35;
}
.api-key-list {
  display: grid;
  gap: 10px;
}
.api-key-item {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.75);
}
.overview-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.overview-card {
  display: grid;
  gap: 8px;
  padding: 14px 15px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.92), rgba(244,248,252,0.76));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}
.overview-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.overview-value {
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.05em;
}
.overview-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.action-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-top: 2px;
  padding: 14px 0 0;
}
.table-toolbar-title { font-weight: 700; letter-spacing: -0.02em; }
.table-toolbar-sub { color: var(--muted); font-size: 13px; }
.table-list, .columns { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 999px; background: rgba(29,78,216,0.06); border: 1px solid rgba(29,78,216,0.10); color: #284e7b; }
.table-entry {
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  background: rgba(255,255,255,0.84);
  border-radius: 16px;
}
.grid-frame {
  margin-top: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.84);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}
.grid-frame-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(244, 248, 252, 0.98), rgba(239, 244, 251, 0.92));
}
.grid-frame-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #1f3a56;
}
.grid-frame-count { color: var(--muted); font-size: 13px; }
.grid-scroll { overflow: auto; max-width: 100%; }
table.freeze-first th:first-child,
table.freeze-first td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  box-shadow: 10px 0 18px -14px rgba(15, 23, 42, 0.28);
}
table.freeze-first th:first-child {
  z-index: 3;
}
table.freeze-first td:first-child {
  background: inherit;
}
.schema-map {
  margin-top: 14px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(29,78,216,0.12);
  background:
    radial-gradient(circle at top left, rgba(29, 78, 216, 0.08), transparent 30%),
    rgba(255,255,255,0.76);
}
.schema-map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.schema-map-header h3 { margin: 0; }
.schema-flow {
  display: grid;
  gap: 10px;
}
.sql-console {
  display: grid;
  gap: 12px;
}
.console-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}
.sql-editor {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  padding: 14px 15px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(10, 18, 32, 0.94);
  color: #e5eefb;
  font-family: "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.sql-editor:focus {
  outline: none;
  border-color: rgba(96, 165, 250, 0.35);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.12);
}
.console-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.quality-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.health-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(29, 78, 216, 0.12);
  background: linear-gradient(180deg, rgba(29, 78, 216, 0.06), rgba(255,255,255,0.78));
}
.health-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.health-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.health-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.10);
  overflow: hidden;
}
.health-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #16a34a, #1d4ed8);
}
.health-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.health-pill {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.76);
  color: var(--muted);
  font-size: 12px;
}
.schema-node, .schema-connector {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.72);
}
.schema-node-source {
  border-color: rgba(29, 78, 216, 0.20);
  background: rgba(29, 78, 216, 0.06);
}
.table-panel {
  display: grid;
  gap: 14px;
}
.table-rail {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 14px;
  align-items: start;
}
.table-main-column {
  display: grid;
  gap: 14px;
}
.table-side-column {
  display: grid;
  gap: 14px;
}
.schema-line, .schema-target { color: var(--text); }
.filter-bar {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.query-builder {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(29, 78, 216, 0.10);
  background: linear-gradient(180deg, rgba(255,255,255,0.88), rgba(244, 248, 252, 0.78));
}
.query-builder-hero {
  margin-top: 18px;
  padding: 18px 20px 20px;
  border-color: rgba(29, 78, 216, 0.18);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}
.query-builder-hero h3,
.query-builder-hero h3 + p {
  margin: 0;
}
.query-builder-hero h3 {
  font-size: 18px;
}
.query-builder-hero p {
  margin-top: 4px;
  color: var(--muted);
}
.filter-bar-compact {
  grid-template-columns: 1.35fr 0.95fr 0.95fr 1fr;
  margin-top: 4px;
}
.query-rules {
  display: grid;
  gap: 10px;
}
.query-rule {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr auto;
  gap: 10px;
  align-items: center;
}
.lookup-bar {
  display: grid;
  grid-template-columns: 1fr 1.1fr auto;
  gap: 10px;
  margin-bottom: 12px;
}
.filter-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.92);
  color: var(--text);
  box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset;
  outline: none;
}
.filter-input:focus {
  border-color: rgba(29,78,216,0.28);
  box-shadow: 0 0 0 4px rgba(29,78,216,0.08);
}
.pager {
  display: grid;
  grid-template-columns: auto auto auto 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}
.pager-info { color: var(--muted); }
.row-list { display: grid; gap: 12px; margin-top: 14px; }
.row-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.84);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
}
.row-card-editing {
  border-color: rgba(37, 99, 235, 0.24);
  background: rgba(37, 99, 235, 0.06);
}
.row-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}
.row-actions { display: flex; gap: 8px; }
.row-edit-field {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  align-items: center;
  padding: 6px 0;
}
.row-field { display: grid; grid-template-columns: 160px 1fr; gap: 12px; padding: 6px 0; }
.row-field-label { color: var(--muted); }
.row-field-value { word-break: break-word; }
table { width: 100%; border-collapse: collapse; background: var(--panel-strong); }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: #1f3a56; background: rgba(244,248,252,0.98); position: sticky; top: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .10em; }
table.freeze-first th:first-child { left: 0; }
tbody tr:nth-child(even) td { background: rgba(249, 251, 255, 0.7); }
tbody tr:hover td { background: rgba(37, 99, 235, 0.05); }
.chip { display: inline-flex; align-items: center; gap: 8px; }
.chip-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.empty-state {
  display: grid;
  gap: 8px;
  min-height: 240px;
  place-items: start;
  align-content: center;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 28%),
    radial-gradient(circle at bottom left, rgba(124, 58, 237, 0.08), transparent 30%),
    var(--panel);
}
.empty-state-card,
.onboarding-hero {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.empty-state-icon,
.onboarding-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  background: linear-gradient(135deg, #1d4ed8, #0f766e);
  box-shadow: 0 14px 34px rgba(29, 78, 216, 0.22);
}
.feature-pill-row,
.empty-state-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.empty-state h3 { margin: 0; font-size: 24px; }
.empty-state p { margin: 0; max-width: 620px; }
.empty { color: var(--muted); }
.error { padding: 20px; background: #fff1f2; color: #b42318; border: 1px solid rgba(239, 68, 68, 0.18); border-radius: 16px; }
.audit-list { display: grid; gap: 10px; margin-top: 10px; }
.audit-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.8);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.audit-item:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.audit-item.warning-item {
  border-color: rgba(245, 158, 11, 0.22);
  background: rgba(255, 251, 235, 0.96);
}
.audit-item.success-item {
  border-color: rgba(34, 197, 94, 0.18);
  background: rgba(240, 253, 244, 0.96);
}
.audit-time, .audit-detail { color: var(--muted); font-size: 13px; }
.audit-detail { word-break: break-word; }
.audit-panel, .snapshot-panel { min-height: 260px; }
.audit-panel { background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(244,248,252,0.88)); }
.snapshot-panel { background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(241,247,252,0.86)); }
.sparkline {
  display: flex;
  align-items: end;
  gap: 6px;
  min-height: 42px;
}
.sparkline-bar {
  width: 100%;
  min-width: 12px;
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(180deg, rgba(29,78,216,0.85), rgba(15,118,110,0.85));
  box-shadow: 0 8px 16px rgba(29, 78, 216, 0.12);
}
.error-banner {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(239, 68, 68, 0.18);
  background: rgba(254, 242, 242, 0.92);
  color: #b42318;
}
.palette-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(18px);
  display: grid;
  place-items: start center;
  padding-top: 12vh;
  z-index: 50;
}
.palette {
  width: min(720px, calc(100vw - 32px));
  border-radius: 24px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  background: rgba(255,255,255,0.98);
  box-shadow: var(--shadow-strong);
  padding: 18px;
}
.create-table-modal {
  width: min(860px, calc(100vw - 32px));
}
.create-table-copy {
  margin: 0 0 14px;
  color: var(--muted);
}
.create-table-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
.field-group {
  display: grid;
  gap: 8px;
}
.field-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.create-table-preview {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(244,248,252,0.72);
}
.create-table-actions {
  justify-content: flex-end;
}
.palette-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.palette-input { margin-bottom: 12px; }
.palette-list { display: grid; gap: 10px; }
.palette-item {
  text-align: left;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.95);
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 4px;
}
.palette-item:hover { border-color: rgba(37,99,235,.24); background: rgba(37,99,235,0.05); }
.suggestion-item strong { color: #173b68; }
.audit-panel, .snapshot-panel, .schema-map, .query-builder, .health-panel, .grid-frame {
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.audit-panel:hover, .snapshot-panel:hover, .schema-map:hover, .query-builder:hover, .health-panel:hover, .grid-frame:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-strong);
}
.theme-dark .query-builder-hero {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.20);
}
.theme-dark .quick-start-card {
  background: rgba(15, 23, 42, 0.62);
}
.theme-dark .connection-card {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.88), rgba(15, 23, 42, 0.72));
}
.theme-dark .connection-example {
  background: rgba(3, 7, 18, 0.96);
}
.theme-dark .connection-card .audit-item strong {
  color: #f1f5f9;
}
.theme-dark .api-key-item {
  background: rgba(15, 23, 42, 0.66);
}
.theme-dark .overview-card {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.88), rgba(15, 23, 42, 0.72));
}
.theme-dark .create-table-preview {
  background: rgba(15, 23, 42, 0.56);
}
.theme-dark .create-table-modal .filter-input {
  background: rgba(15, 23, 42, 0.86);
}
.theme-dark .sql-editor {
  background: rgba(3, 7, 18, 0.96);
}
.theme-dark .table-entry,
.theme-dark .table-panel,
.theme-dark .overview-card {
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.20);
}
.compare-modal {
  width: min(980px, calc(100vw - 32px));
}
.compare-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.compare-pane {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.82);
  max-height: 66vh;
  overflow: auto;
}
.compare-pane h3 {
  margin: 0;
  font-size: 16px;
}
.compare-field {
  display: grid;
  grid-template-columns: 180px 1fr 1fr;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.compare-field-label {
  color: var(--muted);
  font-weight: 600;
}
.compare-field-value {
  word-break: break-word;
}
.compare-field-other {
  text-align: right;
  color: #334155;
}
.compare-different {
  background: rgba(37, 99, 235, 0.05);
  border-radius: 12px;
  padding-left: 10px;
  padding-right: 10px;
}
@media (min-width: 981px) {
  .table-panel .grid-scroll { max-height: 48vh; }
}
@media (max-width: 980px) {
  #app, .workspace, .dashboard-grid { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .hero { align-items: start; flex-direction: column; }
  .quick-start-grid { grid-template-columns: 1fr; }
  .overview-cards { grid-template-columns: 1fr; }
  .topbar { align-items: start; flex-direction: column; }
  .filter-bar { grid-template-columns: 1fr; }
  .query-rule { grid-template-columns: 1fr; }
  .lookup-bar { grid-template-columns: 1fr; }
  .pager { grid-template-columns: 1fr; }
  .row-field { grid-template-columns: 1fr; }
  .row-edit-field { grid-template-columns: 1fr; }
  .main-shell { padding: 12px; }
  .palette-backdrop { padding-top: 8vh; }
  .table-rail { grid-template-columns: 1fr; }
  .connection-card { max-width: none; }
}
