:root {
  color-scheme: dark;
  --bg: #080d17;
  --bg-raised: #0c1422;
  --panel: rgba(15, 25, 40, 0.86);
  --panel-solid: #0f1928;
  --panel-soft: #111f31;
  --border: rgba(145, 171, 201, 0.14);
  --border-strong: rgba(145, 171, 201, 0.24);
  --text: #edf5ff;
  --text-soft: #a5b6ca;
  --text-faint: #64758b;
  --accent: #60e4c3;
  --accent-deep: #2ab49e;
  --accent-wash: rgba(96, 228, 195, 0.12);
  --blue: #7ea7ff;
  --danger: #ff8292;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.26);
  --radius: 14px;
  --mono: "DM Mono", "SFMono-Regular", Consolas, monospace;
  --sans: "Manrope", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
[hidden] { display: none !important; }

.background-glow {
  position: fixed;
  width: 40vw;
  height: 40vw;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.14;
  pointer-events: none;
}

.glow-one { top: -22vw; right: -12vw; background: #196b89; }
.glow-two { bottom: -28vw; left: -12vw; background: #245c84; opacity: 0.1; }

.icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  flex: 0 0 auto;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 48px 20px 30px;
  position: relative;
}

.login-card {
  width: min(100%, 430px);
  padding: 42px 42px 36px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(19, 32, 50, 0.92), rgba(10, 18, 30, 0.94));
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.035);
  position: relative;
  z-index: 1;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(96, 228, 195, 0.45);
  border-radius: 15px;
  display: grid;
  place-items: center;
  position: relative;
  margin-bottom: 34px;
  background: rgba(96, 228, 195, 0.06);
  transform: rotate(-8deg);
}

.brand-mark-core {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 20px rgba(96, 228, 195, 0.8);
}

.brand-mark-orbit { position: absolute; border: 1px solid var(--accent); border-radius: 50%; opacity: 0.65; }
.orbit-one { width: 29px; height: 15px; transform: rotate(45deg); }
.orbit-two { width: 29px; height: 15px; transform: rotate(-45deg); }

.eyebrow, .section-label, .connection-label {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  margin: 0;
}

.login-card h1 {
  font-size: clamp(34px, 7.5vw, 45px);
  line-height: 1.1;
  letter-spacing: -0.055em;
  margin: 12px 0 18px;
}

.login-card h1 span { color: var(--text-soft); }

.login-description {
  color: var(--text-soft);
  line-height: 1.75;
  margin: 0 0 30px;
}

.login-form label, .params-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 9px;
}

.password-input-wrap { position: relative; }
.password-input-wrap input, .search-box input, .params-input {
  width: 100%;
  color: var(--text);
  background: rgba(5, 11, 20, 0.44);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.password-input-wrap input { height: 48px; padding: 0 46px 0 14px; }
.password-input-wrap input::placeholder, .search-box input::placeholder, .params-input::placeholder { color: var(--text-faint); }
.password-input-wrap input:focus, .search-box input:focus, .params-input:focus {
  border-color: rgba(96, 228, 195, 0.7);
  box-shadow: 0 0 0 3px rgba(96, 228, 195, 0.1);
  background: rgba(5, 11, 20, 0.66);
}

.icon-button, .toolbar-button {
  color: var(--text-soft);
  border: 0;
  background: transparent;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  transition: color 160ms ease, background 160ms ease;
}

.icon-button { width: 35px; height: 35px; }
.password-input-wrap .icon-button { position: absolute; top: 6px; right: 6px; }
.icon-button:hover, .toolbar-button:hover { color: var(--accent); background: var(--accent-wash); }
.icon-button.subtle { width: 30px; height: 30px; color: var(--text-faint); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 15px;
  color: var(--text);
  background: rgba(132, 158, 188, 0.1);
  font-size: 14px;
  font-weight: 700;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.button:hover:not(:disabled) { transform: translateY(-1px); }
.button-primary { color: #071a18; background: var(--accent); box-shadow: 0 7px 20px rgba(42, 180, 158, 0.18); }
.button-primary:hover:not(:disabled) { background: #83f0d3; }
.button-large { width: 100%; height: 48px; margin-top: 18px; font-size: 15px; }
.button-ghost { border-color: var(--border); color: var(--text-soft); background: transparent; }
.button-ghost:hover:not(:disabled) { border-color: var(--border-strong); background: rgba(132, 158, 188, 0.08); }
.spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-error { color: var(--danger); font-size: 14px; line-height: 1.5; margin: 12px 0 0; }
.login-note { display: flex; gap: 9px; align-items: flex-start; color: var(--text-faint); font-size: 13px; line-height: 1.6; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }
.login-note .icon { color: var(--accent); width: 15px; height: 15px; margin-top: 1px; }
.login-footer { position: absolute; bottom: 30px; margin: 0; color: var(--text-faint); font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; }
.login-footer span { color: var(--accent-deep); padding: 0 7px; }

.console-screen { min-height: 100vh; position: relative; z-index: 1; }
.topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 34px; border-bottom: 1px solid var(--border); background: rgba(8, 13, 23, 0.76); backdrop-filter: blur(18px); }
.topbar-brand, .topbar-actions, .secure-indicator, .panel-actions, .results-actions { display: flex; align-items: center; }
.topbar-brand { gap: 12px; font-size: 16px; font-weight: 800; letter-spacing: 0.03em; }
.mini-mark { width: 24px; height: 24px; border: 1px solid rgba(96, 228, 195, 0.7); border-radius: 7px; display: grid; place-items: center; transform: rotate(-8deg); }
.mini-mark span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px var(--accent); }
.topbar-divider { width: 1px; height: 18px; background: var(--border-strong); margin: 0 4px; }
.topbar-product { color: var(--text-faint); font-family: var(--mono); font-size: 11px; letter-spacing: 0.13em; font-weight: 400; }
.topbar-actions { gap: 12px; }
.secure-indicator { gap: 7px; color: var(--text-faint); font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px var(--accent); }
.toolbar-button { gap: 7px; padding: 6px 8px; font-size: 13px; }
.toolbar-button.text-button { font-weight: 600; }

.console-layout { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: calc(100vh - 68px); }
.sidebar { display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--border); background: rgba(10, 18, 30, 0.58); }
.sidebar-top { padding: 25px 17px 20px; }
.connection-card { display: flex; align-items: center; gap: 10px; padding: 12px 11px; border: 1px solid rgba(96, 228, 195, 0.17); border-radius: 10px; background: rgba(96, 228, 195, 0.06); position: relative; overflow: hidden; }
.connection-icon, .role-icon { width: 31px; height: 31px; border-radius: 8px; display: grid; place-items: center; color: var(--accent); background: rgba(96, 228, 195, 0.12); }
.connection-icon .icon, .role-icon .icon { width: 16px; height: 16px; }
.connection-card strong, .role-card strong { display: block; font-size: 13px; letter-spacing: 0.04em; margin-top: 4px; }
.connection-pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); margin-left: auto; align-self: flex-start; margin-top: 4px; }
.sidebar-section-heading { display: flex; align-items: center; justify-content: space-between; margin: 31px 3px 13px; }
.sidebar-section-heading h2, .panel-heading h2 { margin: 5px 0 0; font-size: 16px; letter-spacing: -0.02em; }
.search-box { position: relative; margin-bottom: 11px; }
.search-box .icon { position: absolute; top: 10px; left: 11px; width: 14px; height: 14px; color: var(--text-faint); }
.search-box input { height: 36px; padding: 0 10px 0 32px; border-radius: 7px; font-size: 13px; }
.table-list { display: grid; gap: 3px; max-height: calc(100vh - 360px); overflow: auto; padding-right: 2px; }
.table-list::-webkit-scrollbar, .results-table-wrap::-webkit-scrollbar { width: 5px; height: 5px; }
.table-list::-webkit-scrollbar-thumb, .results-table-wrap::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }
.table-item { width: 100%; min-height: 37px; display: flex; align-items: center; gap: 9px; padding: 0 10px; color: var(--text-soft); text-align: left; border: 1px solid transparent; border-radius: 7px; background: transparent; font-family: var(--mono); font-size: 13px; }
.table-item:hover { color: var(--text); background: rgba(126, 167, 255, 0.07); }
.table-item.active { color: var(--accent); border-color: rgba(96, 228, 195, 0.17); background: var(--accent-wash); }
.table-item .table-kind { color: var(--blue); font-size: 12px; }
.table-item.active .table-kind { color: var(--accent); }
.sidebar-empty { display: grid; justify-items: center; gap: 5px; padding: 25px 8px; color: var(--text-faint); text-align: center; font-size: 13px; }
.sidebar-empty small { color: var(--text-faint); font-size: 11px; line-height: 1.5; }
.empty-symbol { color: var(--border-strong); font-family: var(--mono); font-size: 28px; }
.sidebar-bottom { padding: 16px 17px 19px; border-top: 1px solid var(--border); }
.role-card { display: flex; align-items: center; gap: 10px; padding: 10px 8px; }
.role-icon { color: var(--blue); background: rgba(126, 167, 255, 0.1); }
.sidebar-caption { color: var(--text-faint); font-family: var(--mono); font-size: 11px; margin: 17px 8px 0; }

.workspace { width: min(100%, 1210px); padding: 45px 48px 70px; margin: 0 auto; }
.workspace-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.workspace-heading h1 { margin: 9px 0 7px; font-size: 30px; letter-spacing: -0.055em; }
.workspace-subtitle { color: var(--text-soft); font-size: 14px; margin: 0; }
.shortcut-hint { display: flex; align-items: center; gap: 6px; color: var(--text-faint); font-size: 12px; white-space: nowrap; }
kbd { min-width: 21px; padding: 4px 6px; border: 1px solid var(--border-strong); border-radius: 4px; color: var(--text-soft); background: var(--panel); font-family: var(--mono); font-size: 11px; text-align: center; }
.panel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); box-shadow: 0 15px 35px rgba(0, 0, 0, 0.09); overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 20px; }
.editor-panel { border-color: rgba(96, 228, 195, 0.2); box-shadow: 0 15px 45px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(96, 228, 195, 0.025); }
.editor-heading { border-bottom: 1px solid var(--border); }
.panel-title { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 700; }
.panel-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px rgba(96, 228, 195, 0.9); }
.mode-tag, .inspector-badge { color: var(--accent); border: 1px solid rgba(96, 228, 195, 0.2); border-radius: 4px; padding: 3px 5px; font-family: var(--mono); font-size: 10px; font-weight: 400; letter-spacing: 0.09em; }
.mode-tag.write { color: #ffc875; border-color: rgba(255, 200, 117, 0.25); }
.panel-actions { gap: 4px; }
.editor-wrap { display: grid; grid-template-columns: 45px minmax(0, 1fr); min-height: 245px; background: rgba(3, 8, 15, 0.31); }
.line-numbers { color: #405168; padding: 21px 13px 16px 0; border-right: 1px solid rgba(145, 171, 201, 0.08); font-family: var(--mono); font-size: 13px; line-height: 1.9; text-align: right; user-select: none; }
.editor-wrap textarea { resize: vertical; min-height: 245px; width: 100%; padding: 18px 21px; color: #d5e9ff; background: transparent; border: 0; outline: none; font-family: var(--mono); font-size: 14px; line-height: 1.9; tab-size: 2; }
.editor-wrap textarea::placeholder { color: #42536a; }
.editor-footer { display: grid; grid-template-columns: auto minmax(150px, 260px) 1fr; align-items: center; gap: 12px; padding: 11px 20px; border-top: 1px solid var(--border); }
.params-label { margin: 0; font-size: 13px; white-space: nowrap; }
.params-label small { color: var(--text-faint); font-size: 11px; font-weight: 400; }
.params-input { height: 29px; padding: 0 9px; border-radius: 6px; font-family: var(--mono); font-size: 12px; }
.editor-hint { color: var(--text-faint); font-size: 12px; text-align: right; }

.results-panel { margin-top: 17px; min-height: 245px; }
.results-heading { padding-bottom: 13px; }
.results-heading h2 { font-size: 18px; }
.results-actions { gap: 13px; }
.result-summary { color: var(--text-faint); font-family: var(--mono); font-size: 12px; }
.results-empty { min-height: 177px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: var(--text-faint); }
.results-empty strong { color: var(--text-soft); font-size: 14px; }
.results-empty span { font-size: 12px; }
.empty-illustration { display: flex; align-items: flex-end; gap: 4px; height: 34px; margin-bottom: 6px; }
.empty-illustration span { width: 9px; border: 1px solid rgba(96, 228, 195, 0.35); border-radius: 3px 3px 0 0; background: rgba(96, 228, 195, 0.08); }
.empty-illustration span:nth-child(1) { height: 17px; }.empty-illustration span:nth-child(2) { height: 28px; }.empty-illustration span:nth-child(3) { height: 22px; }.empty-illustration span:nth-child(4) { height: 34px; }
.results-table-wrap { max-width: 100%; overflow: auto; border-top: 1px solid var(--border); }
.results-table { width: 100%; }
table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12px; }
th, td { max-width: 330px; padding: 11px 14px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
th { color: var(--text-soft); background: rgba(126, 167, 255, 0.04); font-size: 11px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }
td { color: #c5d7e9; }.null-value { color: var(--text-faint); font-style: italic; }.number-value { color: #b9ccff; }
tr:last-child td { border-bottom: 0; }
.command-result { min-height: 177px; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--text-soft); }
.command-result > div:last-child { display: grid; gap: 5px; }.command-result strong { color: var(--accent); font-size: 15px; }.command-result span { color: var(--text-faint); font-size: 12px; }
.command-icon { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(96, 228, 195, 0.28); border-radius: 50%; color: var(--accent); background: var(--accent-wash); }

.lower-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 17px; margin-top: 17px; }
.compact-heading { padding: 15px 18px; border-bottom: 1px solid var(--border); }.compact-heading h2 { font-size: 15px; }
.history-list { display: grid; gap: 2px; padding: 8px; max-height: 190px; overflow: auto; }
.history-item { display: flex; gap: 8px; align-items: center; min-width: 0; padding: 8px 10px; color: var(--text-soft); border: 0; border-radius: 6px; background: transparent; text-align: left; font-family: var(--mono); font-size: 12px; }
.history-item:hover { color: var(--accent); background: var(--accent-wash); }.history-item .history-index { color: var(--text-faint); }.history-item .history-sql { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.small-empty { min-height: 91px; display: grid; place-items: center; padding: 20px; color: var(--text-faint); font-size: 12px; text-align: center; }
.inspector-badge { color: var(--blue); border-color: rgba(126, 167, 255, 0.22); }.column-list { padding: 7px 8px 8px; max-height: 190px; overflow: auto; }
.column-row { display: grid; grid-template-columns: 1fr 75px 38px; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 6px; font-family: var(--mono); font-size: 12px; }
.column-row:hover { background: rgba(126, 167, 255, 0.05); }.column-name { color: var(--text); overflow: hidden; text-overflow: ellipsis; }.column-type { color: var(--blue); overflow: hidden; text-overflow: ellipsis; }.column-pk { color: #ffc875; text-align: right; }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: min(390px, calc(100vw - 48px)); padding: 11px 14px; color: var(--text); border: 1px solid var(--border-strong); border-radius: 8px; background: #142236; box-shadow: var(--shadow); font-size: 13px; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity 180ms ease, transform 180ms ease; z-index: 10; }.toast.show { opacity: 1; transform: translateY(0); }.toast.error { color: #ffd8dd; border-color: rgba(255, 130, 146, 0.35); }

body[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f7fb;
  --bg-raised: #eef4f9;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-solid: #fff;
  --panel-soft: #f6f9fc;
  --border: rgba(40, 69, 101, 0.13);
  --border-strong: rgba(40, 69, 101, 0.23);
  --text: #14263b;
  --text-soft: #5a6c80;
  --text-faint: #8798aa;
  --accent: #168f7c;
  --accent-deep: #147563;
  --accent-wash: rgba(22, 143, 124, 0.09);
  --blue: #416fbf;
  --shadow: 0 22px 60px rgba(55, 82, 109, 0.12);
}
body[data-theme="light"] .topbar { background: rgba(243, 247, 251, 0.82); }
body[data-theme="light"] .sidebar { background: rgba(238, 244, 249, 0.72); }
body[data-theme="light"] .editor-wrap { background: rgba(236, 243, 249, 0.7); }
body[data-theme="light"] .editor-wrap textarea { color: #19344d; }
body[data-theme="light"] .editor-wrap textarea::placeholder { color: #99aaba; }
body[data-theme="light"] .password-input-wrap input, body[data-theme="light"] .search-box input, body[data-theme="light"] .params-input { background: rgba(255, 255, 255, 0.75); }

/* Visual CRUD workspace */
.workspace-actions { display: flex; align-items: center; gap: 8px; }
.sql-command-form { display: flex; align-items: center; gap: 6px; }
.sql-command-input { width: 290px; height: 38px; padding: 0 11px; color: var(--text); border: 1px solid var(--border-strong); border-radius: 8px; outline: none; background: rgba(5, 11, 20, .4); font-family: var(--mono); font-size: 12px; transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease; }
.sql-command-input::placeholder { color: var(--text-faint); }.sql-command-input:focus { border-color: rgba(96, 228, 195, .7); box-shadow: 0 0 0 3px rgba(96, 228, 195, .1); background: rgba(5, 11, 20, .66); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.sql-result-panel { margin-bottom: 15px; }.sql-result-heading { padding-bottom: 13px; border-bottom: 1px solid var(--border); }.sql-result-heading h2 { margin-top: 5px; font-size: 17px; }.sql-result-content { max-width: 100%; overflow: auto; }.sql-result-message { margin: 0; padding: 22px 20px; color: var(--text-soft); font-size: 13px; }.sql-result-error { color: var(--danger); }.sql-result-table { min-width: 100%; }
.button-secondary { color: var(--text-soft); border-color: var(--border-strong); background: rgba(132, 158, 188, 0.08); }
.button-secondary:hover:not(:disabled) { color: var(--text); border-color: rgba(96, 228, 195, 0.35); background: var(--accent-wash); }
.button-danger { color: var(--danger); border-color: rgba(255, 130, 146, 0.24); background: rgba(255, 130, 146, 0.07); }
.button-danger:hover:not(:disabled) { border-color: rgba(255, 130, 146, 0.5); background: rgba(255, 130, 146, 0.13); }
.welcome-panel { min-height: 225px; display: flex; align-items: center; justify-content: center; gap: 20px; padding: 30px; text-align: left; }
.welcome-panel h2 { margin: 8px 0 6px; font-size: 20px; }.welcome-panel p:not(.section-label) { color: var(--text-soft); font-size: 13px; margin: 0; }.welcome-icon { width: 54px; height: 54px; display: grid; place-items: center; border: 1px solid rgba(96, 228, 195, 0.22); border-radius: 15px; color: var(--accent); background: var(--accent-wash); }.welcome-icon .icon { width: 25px; height: 25px; }
.welcome-panel .button { margin-left: 20px; }
.table-workspace { display: grid; gap: 12px; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 18px; }
.selected-table-info, .table-toolbar-actions, .schema-summary, .form-field-head, .modal-actions, .field-heading { display: flex; align-items: center; }
.selected-table-info { gap: 11px; min-width: 0; }.table-title-icon { width: 39px; height: 39px; display: grid; place-items: center; color: var(--accent); border: 1px solid rgba(96, 228, 195, 0.22); border-radius: 10px; background: var(--accent-wash); }.table-title-icon .icon { width: 20px; height: 20px; }.selected-table-info h2 { overflow: hidden; max-width: 370px; margin: 4px 0 2px; font-family: var(--mono); font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }.table-record-count { color: var(--text-faint); font-size: 12px; }.table-toolbar-actions { gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.table-info-strip { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 1px 2px 2px; }.schema-summary { min-width: 0; gap: 9px; }.schema-summary-label { color: var(--text-faint); font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }.column-chips { display: flex; gap: 5px; min-width: 0; overflow: auto; }.column-chip { max-width: 170px; padding: 4px 7px; color: var(--text-soft); border: 1px solid var(--border); border-radius: 4px; background: rgba(132, 158, 188, 0.05); font-family: var(--mono); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.primary-key-hint { color: var(--text-faint); font-size: 12px; text-align: right; white-space: nowrap; }
.records-panel { min-height: 260px; overflow: hidden; }.records-table-wrap { max-width: 100%; overflow: auto; }.records-state { min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: var(--text-faint); font-size: 12px; }.records-state strong { color: var(--text-soft); font-size: 14px; }.records-state > .spinner { color: var(--accent); }.records-table-wrap table { min-width: 100%; }.records-table-wrap th, .records-table-wrap td { max-width: 260px; }.actions-column { width: 120px; }.row-actions { display: flex; gap: 4px; }.row-action { padding: 4px 7px; color: var(--text-soft); border: 1px solid var(--border); border-radius: 5px; background: transparent; font-size: 12px; }.row-action:hover { color: var(--accent); border-color: rgba(96, 228, 195, .35); background: var(--accent-wash); }.row-action.delete-action:hover { color: var(--danger); border-color: rgba(255,130,146,.35); background: rgba(255,130,146,.08); }.no-key-label { color: var(--text-faint); font-size: 11px; }
.visual-help-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 15px; }.help-card { display: flex; gap: 12px; align-items: flex-start; padding: 15px; }.help-number { color: var(--accent); font-family: var(--mono); font-size: 12px; }.help-card strong { font-size: 13px; }.help-card p { color: var(--text-faint); font-size: 12px; line-height: 1.5; margin: 5px 0 0; }

/* Import & Export UI */
.modal-description { margin: -12px 0 16px; color: var(--text-soft); font-size: 13px; line-height: 1.5; }
.modal-description strong { color: var(--accent); }
.import-dropzone { display: block; border: 2px dashed var(--border-strong); border-radius: 10px; background: rgba(5, 11, 20, 0.35); padding: 22px 16px; text-align: center; cursor: pointer; transition: border-color 160ms ease, background 160ms ease; }
.import-dropzone:hover, .import-dropzone.dragover { border-color: var(--accent); background: var(--accent-wash); }
.import-dropzone-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dropzone-icon { width: 32px; height: 32px; color: var(--accent); }
.import-dropzone p { margin: 0; font-size: 13px; color: var(--text-soft); }
.import-dropzone p strong { color: var(--text); }
.import-file-name { font-family: var(--mono); font-size: 12px; color: var(--accent); padding: 2px 8px; border-radius: 4px; background: rgba(96, 228, 195, 0.1); margin-top: 4px; }
.import-preview-box { margin-top: 16px; border: 1px solid var(--border); border-radius: 8px; background: rgba(5, 11, 20, 0.25); overflow: hidden; }
.import-preview-heading { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: rgba(132, 158, 188, 0.06); border-bottom: 1px solid var(--border); font-size: 13px; }
.import-preview-summary { font-size: 12px; color: var(--accent); font-family: var(--mono); }
.import-preview-table-wrap { max-height: 140px; overflow: auto; padding: 4px; }
.import-preview-table-wrap table { width: 100%; border-collapse: collapse; font-size: 12px; }
.import-preview-table-wrap th, .import-preview-table-wrap td { padding: 4px 8px; border: 1px solid var(--border); text-align: left; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-preview-table-wrap th { background: rgba(132, 158, 188, 0.08); color: var(--text-soft); }
.export-options { display: grid; gap: 10px; margin-top: 6px; }
.export-option-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border-strong); border-radius: 10px; background: rgba(5, 11, 20, 0.4); text-align: left; cursor: pointer; transition: all 160ms ease; color: var(--text); width: 100%; }
.export-option-card:hover { border-color: var(--accent); background: var(--accent-wash); transform: translateY(-1px); }
.export-card-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 8px; background: rgba(96, 228, 195, 0.12); color: var(--accent); font-family: var(--mono); font-weight: 700; font-size: 14px; flex-shrink: 0; }
.export-option-card strong { display: block; font-size: 14px; margin-bottom: 3px; }
.export-option-card small { display: block; color: var(--text-soft); font-size: 12px; line-height: 1.4; }
.sql-result-actions { display: flex; align-items: center; gap: 8px; }

.modal-dialog { width: min(92vw, 520px); max-height: 88vh; padding: 0; color: var(--text); border: 1px solid var(--border-strong); border-radius: 16px; background: var(--panel-solid); box-shadow: var(--shadow); }.modal-dialog::backdrop { background: rgba(3, 8, 15, .68); backdrop-filter: blur(5px); }.modal-card { padding: 22px; }.modal-card-wide { width: 100%; }.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; }.modal-heading h2 { margin: 6px 0 0; font-size: 19px; }.modal-close { width: 28px; height: 28px; padding: 0; color: var(--text-faint); border: 0; border-radius: 6px; background: transparent; font-size: 24px; line-height: 1; }.modal-close:hover { color: var(--text); background: var(--accent-wash); }.form-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-height: 48vh; overflow: auto; padding-right: 3px; }.form-field { min-width: 0; }.form-field-head { justify-content: space-between; gap: 7px; margin-bottom: 6px; }.form-field-head strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }.form-field-head small { color: var(--blue); font-family: var(--mono); font-size: 11px; }.field-label { display: block; color: var(--text); font-size: 13px; font-weight: 700; margin-bottom: 7px; }.form-input { width: 100%; height: 38px; padding: 0 10px; color: var(--text); border: 1px solid var(--border-strong); border-radius: 7px; outline: none; background: rgba(5, 11, 20, .4); font-size: 13px; }.form-input:focus { border-color: rgba(96, 228, 195, .7); box-shadow: 0 0 0 3px rgba(96, 228, 195, .1); }.form-input:disabled { color: var(--text-faint); opacity: .7; }.modal-actions { justify-content: flex-end; gap: 8px; margin-top: 22px; padding-top: 15px; border-top: 1px solid var(--border); }.field-heading { justify-content: space-between; margin-top: 17px; }.new-column-fields { display: grid; gap: 7px; max-height: 270px; overflow: auto; padding-right: 3px; }.new-column-row { display: grid; grid-template-columns: minmax(100px, 1fr) 92px auto auto 28px; gap: 6px; align-items: center; }.new-column-row .form-input { height: 36px; }.checkbox-label { display: inline-flex; align-items: center; gap: 4px; color: var(--text-soft); font-size: 11px; white-space: nowrap; }.checkbox-label input { accent-color: var(--accent-deep); }.remove-column-button { color: var(--danger); font-size: 20px; }.inspector-badge { display: none; }
body[data-theme="light"] .form-input { background: rgba(255, 255, 255, .78); }

@media (max-width: 900px) {
  .console-layout { grid-template-columns: 210px minmax(0, 1fr); }
  .workspace { padding: 32px 24px 50px; }
  .topbar { padding: 0 22px; }
  .topbar-product, .secure-indicator { display: none; }
  .editor-footer { grid-template-columns: auto minmax(130px, 1fr); }.editor-hint { display: none; }
  .workspace-actions { flex-shrink: 0; }.sql-command-input { width: 220px; }.visual-help-grid { gap: 8px; }.help-card { padding: 12px; }
}

@media (max-width: 680px) {
  .login-card { padding: 32px 25px 28px; }.login-footer { display: none; }
  .topbar { height: 59px; padding: 0 15px; }.console-layout { display: block; min-height: calc(100vh - 59px); }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--border); }.sidebar-top { padding: 14px 15px 11px; }.connection-card { display: none; }
  .sidebar-section-heading { margin: 0 2px 9px; }.table-list { display: flex; max-height: none; overflow-x: auto; padding-bottom: 2px; }.table-item { width: auto; min-width: max-content; padding: 0 10px; }
  .sidebar-empty { padding: 10px; }.sidebar-empty small, .empty-symbol { display: none; }.sidebar-bottom { display: none; }
  .workspace { padding: 28px 14px 40px; }.workspace-heading { align-items: flex-start; margin-bottom: 19px; }.workspace-heading h1 { font-size: 26px; }.shortcut-hint { display: none; }
  .workspace-heading { flex-direction: column; gap: 14px; }.workspace-actions, .workspace-actions .button, .sql-command-form { width: 100%; }.sql-command-form .sql-command-input { width: auto; flex: 1; min-width: 0; }.sql-command-form .button { width: auto; flex: 0 0 auto; }.welcome-panel { flex-direction: column; text-align: center; }.welcome-panel .button { margin: 5px 0 0; }.table-toolbar { align-items: flex-start; flex-direction: column; }.table-toolbar-actions { width: 100%; justify-content: stretch; }.table-toolbar-actions .button { flex: 1; padding-left: 7px; padding-right: 7px; }.table-info-strip { align-items: flex-start; flex-direction: column; }.primary-key-hint { white-space: normal; }.visual-help-grid { grid-template-columns: 1fr; }.form-fields { grid-template-columns: 1fr; }.new-column-row { grid-template-columns: minmax(90px, 1fr) 78px auto 28px; }.new-column-row .checkbox-label:nth-of-type(2) { display: none; }.modal-card { padding: 18px; }
  .panel-heading { padding: 14px 14px; }.editor-wrap { min-height: 220px; }.editor-wrap textarea { min-height: 220px; padding: 15px 14px; }.line-numbers { padding-top: 17px; padding-right: 9px; }
  .editor-footer { grid-template-columns: 1fr; gap: 7px; padding: 11px 14px; }.params-input { width: 100%; }.params-label { margin-top: 1px; }
  .results-actions { gap: 4px; }.result-summary { display: none; }.results-heading .section-label { display: none; }.results-heading h2 { margin-top: 0; }
  .lower-grid { grid-template-columns: 1fr; }.topbar-brand { gap: 8px; }.topbar-divider { margin: 0 1px; }.topbar-product { display: inline; font-size: 10px; }.topbar-actions { gap: 5px; }
}
