/* Blot Nexus — polished Microsoft Fabric inspired theme */
@import url('https://fonts.googleapis.com/css2?family=Segoe+UI:wght@400;500;600;700&display=swap');

:root {
  --fabric-bg: #f5f5f5;
  --fabric-surface: #ffffff;
  --fabric-surface2: #fafafa;
  --fabric-border: #e8e8e8;
  --fabric-border2: #d6d6d6;
  --fabric-text: #242424;
  --fabric-text2: #616161;
  --fabric-text3: #8a8a8a;
  --fabric-blue: #0078d4;
  --fabric-blue-hover: #106ebe;
  --fabric-blue-soft: #e8f4fd;
  --fabric-teal: #038387;
  --fabric-green: #0e700e;
  --fabric-orange: #bc4b09;
  --fabric-red: #b10e1c;
  --fabric-purple: #5c2e91;
  --fabric-shadow: 0 1px 2px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.04);
  --fabric-shadow-md: 0 2px 8px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --fabric-shadow-lg: 0 8px 24px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.04);
  --rail-width: 220px;
  --topbar-h: 48px;
  --radius: 8px;
  --radius-lg: 14px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--fabric-bg);
  color: var(--fabric-text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.fx-topbar {
  height: var(--topbar-h);
  background: #1b1a19;
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 8px 0 0;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 8px;
}
.fx-topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: 100%;
  text-decoration: none;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  min-width: var(--rail-width);
}
.fx-topbar .brand .logo {
  width: 26px; height: 26px;
  background: linear-gradient(145deg, #0078d4 0%, #00bcf2 100%);
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff;
}
.fx-topbar .search {
  flex: 1;
  max-width: 440px;
  position: relative;
}
.fx-topbar .search input {
  width: 100%;
  height: 32px;
  border-radius: var(--radius);
  border: none;
  padding: 0 12px 0 34px;
  background: rgba(255,255,255,.10);
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: background .15s;
}
.fx-topbar .search input:focus { background: rgba(255,255,255,.16); }
.fx-topbar .search input::placeholder { color: rgba(255,255,255,.55); }
.fx-topbar .search-ico {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; opacity: .65; pointer-events: none;
}
.fx-topbar .actions {
  display: flex; align-items: center; gap: 4px; margin-left: auto; padding-right: 8px;
}
.fx-topbar .icon-btn {
  width: 34px; height: 34px;
  border: none; background: transparent; color: #fff;
  border-radius: var(--radius); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s;
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
}
.fx-topbar .icon-btn:hover { background: rgba(255,255,255,.10); }
.fx-topbar .user {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 8px; border-radius: var(--radius); cursor: pointer;
}
.fx-topbar .user:hover { background: rgba(255,255,255,.08); }
.fx-topbar .avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--fabric-blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; overflow: hidden;
}
.fx-topbar .avatar img { width: 100%; height: 100%; object-fit: cover; }

.fx-shell { display: flex; min-height: calc(100vh - var(--topbar-h)); }

.fx-rail {
  width: var(--rail-width);
  background: var(--fabric-surface);
  border-right: 1px solid var(--fabric-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  flex-shrink: 0;
}
.fx-rail-nav { padding: 6px 0; flex: 1; }
.fx-rail-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px 8px 13px;
  color: var(--fabric-text2);
  text-decoration: none;
  font-size: 13px; font-weight: 500;
  border-left: 3px solid transparent;
  cursor: pointer;
  background: transparent; border-top: 0; border-right: 0; border-bottom: 0;
  width: 100%; text-align: left;
  transition: background .12s, color .12s;
}
.fx-rail-item:hover { background: var(--fabric-surface2); color: var(--fabric-text); }
.fx-rail-item.active {
  background: var(--fabric-blue-soft);
  color: var(--fabric-blue);
  border-left-color: var(--fabric-blue);
  font-weight: 600;
}
.fx-rail-item .ico {
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 11px; font-weight: 700;
  letter-spacing: -0.02em;
  opacity: .85;
}
.fx-rail-sec {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--fabric-text3);
  padding: 14px 16px 5px; margin-top: 2px;
}
.fx-rail-footer {
  padding: 12px 16px; border-top: 1px solid var(--fabric-border);
  font-size: 11px; color: var(--fabric-text3);
}

.fx-main {
  flex: 1;
  padding: 22px 28px 48px;
  max-width: 1380px;
  overflow-x: hidden;
}

.fx-ws-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; gap: 14px; flex-wrap: wrap;
}
.fx-ws-title { display: flex; align-items: center; gap: 10px; }
.fx-ws-title h1 {
  font-size: 22px; font-weight: 600; color: var(--fabric-text); letter-spacing: -0.01em;
}
.fx-ws-title .badge {
  font-size: 11px; padding: 2px 9px; border-radius: 12px;
  background: var(--fabric-blue-soft); color: var(--fabric-blue); font-weight: 600;
}
.fx-ws-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.fx-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 14px;
  border-radius: var(--radius); font-size: 13px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent;
  font-family: var(--font);
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.fx-btn-primary { background: var(--fabric-blue); color: #fff; }
.fx-btn-primary:hover { background: var(--fabric-blue-hover); }
.fx-btn-secondary {
  background: var(--fabric-surface); color: var(--fabric-text);
  border-color: var(--fabric-border2);
}
.fx-btn-secondary:hover { background: var(--fabric-surface2); border-color: #c8c8c8; }
.fx-btn-ghost { background: transparent; color: var(--fabric-blue); border: none; }
.fx-btn-ghost:hover { background: var(--fabric-blue-soft); }
.fx-btn-danger {
  background: transparent; color: var(--fabric-red);
  border-color: #f0c8cb;
}
.fx-btn-danger:hover { background: #fdf3f4; }
.fx-btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }

.fx-card {
  background: var(--fabric-surface);
  border: 1px solid var(--fabric-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--fabric-shadow);
  padding: 16px 18px;
}
.fx-card-hover:hover {
  box-shadow: var(--fabric-shadow-md);
  border-color: var(--fabric-border2);
}
.fx-card-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.fx-card-desc { font-size: 12px; color: var(--fabric-text2); margin-bottom: 10px; }

.fx-item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 12px;
}
.fx-item-tile {
  background: var(--fabric-surface);
  border: 1px solid var(--fabric-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
  text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 8px;
}
.fx-item-tile:hover {
  box-shadow: var(--fabric-shadow-md);
  border-color: #b4d6f5;
}
.fx-item-tile .icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--fabric-blue-soft); color: var(--fabric-blue);
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
}
.fx-item-tile .name { font-weight: 600; font-size: 13px; }
.fx-item-tile .meta { font-size: 11px; color: var(--fabric-text3); line-height: 1.4; }

.fx-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.fx-kpi {
  background: var(--fabric-surface);
  border: 1px solid var(--fabric-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--fabric-shadow);
}
.fx-kpi .label { font-size: 12px; color: var(--fabric-text2); margin-bottom: 4px; }
.fx-kpi .value { font-size: 24px; font-weight: 700; color: var(--fabric-text); letter-spacing: -0.02em; }
.fx-kpi .value.blue { color: var(--fabric-blue); }
.fx-kpi .value.teal { color: var(--fabric-teal); }
.fx-kpi .value.green { color: var(--fabric-green); }

.fx-table-wrap {
  border: 1px solid var(--fabric-border);
  border-radius: var(--radius-lg);
  overflow: auto;
  background: var(--fabric-surface);
  box-shadow: var(--fabric-shadow);
}
.fx-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fx-table th {
  text-align: left; padding: 10px 14px;
  background: var(--fabric-surface2);
  border-bottom: 1px solid var(--fabric-border);
  font-weight: 600; font-size: 12px; color: var(--fabric-text2);
  white-space: nowrap;
}
.fx-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--fabric-border);
  color: var(--fabric-text);
}
.fx-table tr:last-child td { border-bottom: none; }
.fx-table tr:hover td { background: #f9f9f9; }

.fx-label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--fabric-text2); margin-bottom: 5px;
}
.fx-input, .fx-select, .fx-textarea {
  width: 100%;
  height: 32px;
  border: 1px solid var(--fabric-border2);
  border-radius: var(--radius);
  padding: 0 10px;
  font-size: 13px;
  font-family: var(--font);
  background: var(--fabric-surface);
  color: var(--fabric-text);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.fx-input:focus, .fx-select:focus, .fx-textarea:focus {
  border-color: var(--fabric-blue);
  box-shadow: 0 0 0 1px var(--fabric-blue);
}
.fx-textarea { height: auto; padding: 8px 10px; min-height: 80px; resize: vertical; }

.fx-status {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: 12px; text-transform: uppercase; letter-spacing: .02em;
}
.fx-status-ok { background: #e6f4ea; color: var(--fabric-green); }
.fx-status-run { background: #fff4ce; color: #8a6116; }
.fx-status-fail { background: #fde7e9; color: var(--fabric-red); }
.fx-status-info { background: var(--fabric-blue-soft); color: var(--fabric-blue); }

.fx-taskflow {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch;
  margin-bottom: 18px;
}
.fx-task-node {
  flex: 1; min-width: 130px;
  background: var(--fabric-surface);
  border: 1.5px solid var(--fabric-border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  box-shadow: var(--fabric-shadow);
}
.fx-task-node.green { border-color: #9fd4a3; background: #f4faf5; }
.fx-task-node.blue { border-color: #9ec5ea; background: #f3f9fd; }
.fx-task-node.orange { border-color: #f0c4a8; background: #fdf7f3; }
.fx-task-node.purple { border-color: #c9b3e0; background: #f7f4fb; }
.fx-task-node .tname { font-weight: 600; font-size: 13px; }
.fx-task-node .tmeta { font-size: 11px; color: var(--fabric-text3); margin-top: 3px; }

.fx-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--fabric-border);
  margin-bottom: 16px;
}
.fx-tab {
  padding: 10px 16px; font-size: 13px; font-weight: 600;
  color: var(--fabric-text2); cursor: pointer;
  border-bottom: 2px solid transparent;
  background: none; border-top: 0; border-left: 0; border-right: 0;
  font-family: var(--font);
  transition: color .12s;
}
.fx-tab:hover { color: var(--fabric-text); }
.fx-tab.active {
  color: var(--fabric-blue);
  border-bottom-color: var(--fabric-blue);
}

.fx-wizard-steps { display: flex; gap: 0; margin-bottom: 18px; }
.fx-wizard-step {
  flex: 1; text-align: center; padding: 10px 6px;
  font-size: 12px; font-weight: 600; color: var(--fabric-text3);
  border-bottom: 2.5px solid var(--fabric-border);
}
.fx-wizard-step.done { color: var(--fabric-green); border-bottom-color: var(--fabric-green); }
.fx-wizard-step.active { color: var(--fabric-blue); border-bottom-color: var(--fabric-blue); }

.fx-nb-cell {
  border: 1px solid var(--fabric-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--fabric-surface);
  box-shadow: var(--fabric-shadow);
}
.fx-nb-cell-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 12px; background: var(--fabric-surface2);
  border-bottom: 1px solid var(--fabric-border);
  font-size: 12px; color: var(--fabric-text3);
}
.fx-nb-cell textarea {
  width: 100%; border: none; padding: 12px;
  font-family: 'Cascadia Code', 'Consolas', 'Menlo', monospace;
  font-size: 13px; min-height: 90px; resize: vertical;
  background: #1e1e1e; color: #d4d4d4; outline: none;
}
.fx-nb-out {
  padding: 10px 12px; font-family: monospace; font-size: 12px;
  border-top: 1px dashed var(--fabric-border);
  white-space: pre-wrap; max-height: 200px; overflow: auto;
}

.fx-hidden { display: none !important; }
.fx-flex { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.fx-space-y > * + * { margin-top: 14px; }
.fx-text-dim { color: var(--fabric-text2); font-size: 13px; }
.fx-text-sm { font-size: 12px; color: var(--fabric-text3); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 900px) {
  .fx-rail { display: none; }
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr; }
  .fx-main { padding: 16px; }
}
.fx-footer {
  text-align: center; padding: 24px;
  font-size: 11px; color: var(--fabric-text3);
}
/* Dark theme (optional toggle) */
html.theme-dark, html:not(.theme-light) {
  /* keep light as default - only apply when explicitly dark */
}
html.theme-dark {
  --fabric-bg: #1a1a1a;
  --fabric-surface: #242424;
  --fabric-surface2: #2d2d2d;
  --fabric-border: #3a3a3a;
  --fabric-border2: #4a4a4a;
  --fabric-text: #f0f0f0;
  --fabric-text2: #b0b0b0;
  --fabric-text3: #808080;
  --fabric-blue-soft: #1a3a52;
  --fabric-shadow: 0 1px 2px rgba(0,0,0,.3);
  --fabric-shadow-md: 0 2px 8px rgba(0,0,0,.35);
  --fabric-shadow-lg: 0 8px 24px rgba(0,0,0,.4);
}
html.theme-dark .fx-topbar { background: #0d0d0d; }
html.theme-dark .fx-table tr:hover td { background: #2a2a2a; }
html.theme-dark .fx-nb-cell textarea { background: #111; }
html.theme-dark .fx-rail-item.active { background: #1a3a52; }
html.theme-dark .fx-item-tile:hover { border-color: #3a6a9a; }
html.theme-dark .fx-status-ok { background: #1a3a22; }
html.theme-dark .fx-status-fail { background: #3a1a1e; }
html.theme-dark .fx-status-run { background: #3a3520; }
html.theme-dark .fx-status-info { background: #1a3a52; }

/* SVG icons */
.fx-rail-item .ico svg,
.fx-item-tile .icon svg,
.fx-topbar .icon-btn svg,
.search-ico svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.fx-item-tile .icon svg {
  width: 18px;
  height: 18px;
}
.fx-topbar .icon-btn svg {
  width: 16px;
  height: 16px;
}
.fx-topbar .brand .logo {
  padding: 0;
  overflow: hidden;
  background: transparent;
}
.fx-topbar .brand .logo img {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  display: block;
  object-fit: cover;
}
.search-ico {
  color: rgba(255,255,255,.65);
}
.fx-item-tile .icon {
  color: var(--fabric-blue);
}


/* Softer curved edges — Fabric polished */
.fx-card,
.fx-item-tile,
.fx-kpi,
.fx-table-wrap,
.fx-task-node,
.fx-nb-cell,
.fx-modal {
  border-radius: var(--radius-lg);
}
.fx-btn,
.fx-input,
.fx-select,
.fx-textarea,
.fx-topbar .search input,
.fx-topbar .icon-btn {
  border-radius: var(--radius);
}
.fx-status {
  border-radius: 999px;
}
.fx-ws-title .badge {
  border-radius: 999px;
}
.fx-item-tile .icon {
  border-radius: 10px;
}
.fx-topbar .brand .logo,
.fx-topbar .brand .logo img {
  border-radius: 8px;
}
.fx-topbar .avatar {
  border-radius: 50%;
}
.fx-rail-item {
  margin: 2px 8px;
  border-radius: 8px;
  border-left-width: 0;
  padding-left: 14px;
}
.fx-rail-item.active {
  border-left-width: 0;
  box-shadow: inset 3px 0 0 var(--fabric-blue);
}
.fx-table-wrap {
  overflow: hidden;
}
.fx-table th:first-child {
  border-top-left-radius: calc(var(--radius-lg) - 1px);
}
.fx-table th:last-child {
  border-top-right-radius: calc(var(--radius-lg) - 1px);
}

/* Brand logo — always show logo.png clearly */
.fx-topbar .brand .logo {
  width: 30px;
  height: 30px;
  min-width: 30px;
  background: transparent !important;
  padding: 0;
  overflow: hidden;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fx-topbar .brand .logo img {
  width: 30px;
  height: 30px;
  display: block;
  object-fit: contain;
  border-radius: 8px;
  background: transparent;
}

/* Provider logos on connections */
.conn-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--fabric-surface2);
  border: 1px solid var(--fabric-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.conn-logo svg {
  display: block;
}



/* Provider tiles — BLOT Verse style app boxes */
.provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 14px;
  margin-top: 10px;
}
.provider-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 120px;
  padding: 18px 12px 16px;
  border-radius: 16px;
  border: 1px solid var(--fabric-border);
  background: var(--fabric-surface);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  cursor: pointer;
  font-family: var(--font);
  color: var(--fabric-text);
  transition: border-color .15s, box-shadow .15s, transform .12s, background .15s;
}
.provider-card:hover {
  border-color: #a8d0f0;
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  transform: translateY(-2px);
}
.provider-card.active {
  border-color: var(--fabric-blue);
  background: linear-gradient(180deg, #eef7fd 0%, #e8f4fd 100%);
  box-shadow: 0 0 0 2px rgba(0,120,212,.28), 0 4px 14px rgba(0,120,212,.12);
}
.provider-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #f3f3f3;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.04);
  overflow: hidden;
  flex-shrink: 0;
}
.provider-logo img {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.provider-name {
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  line-height: 1.25;
  letter-spacing: 0.01em;
}
.conn-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #f3f3f3;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.04);
  overflow: hidden;
}
.conn-logo img {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}
html.theme-dark .provider-card {
  background: #252525;
  border-color: #333;
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
}
html.theme-dark .provider-card:hover {
  border-color: #4a6a8a;
  background: #2c2c2c;
}
html.theme-dark .provider-card.active {
  background: linear-gradient(180deg, #1a3348 0%, #162a3c 100%);
  border-color: var(--fabric-blue);
}
html.theme-dark .provider-logo,
html.theme-dark .conn-logo {
  background: #1a1a1a;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}

.fx-modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  z-index: 300; display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.fx-modal-backdrop.fx-hidden { display: none !important; }
.fx-modal {
  background: var(--fabric-surface);
  border-radius: 14px;
  box-shadow: var(--fabric-shadow-lg);
  width: 100%; max-width: 440px;
  border: 1px solid var(--fabric-border);
}
.fx-modal-header { padding: 16px 18px; border-bottom: 1px solid var(--fabric-border); }
.fx-modal-header h2 { font-size: 16px; font-weight: 600; margin: 0; }
.fx-modal-body { padding: 16px 18px; }
.fx-modal-footer { padding: 12px 18px; border-top: 1px solid var(--fabric-border); display: flex; justify-content: flex-end; gap: 8px; }

/* Database workspace — clean layout */
.co-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  align-items: start;
  min-height: 420px;
}
@media (max-width: 900px) {
  .co-layout { grid-template-columns: 1fr; }
}
.co-side {
  background: var(--fabric-surface2);
  border: 1px solid var(--fabric-border);
  border-radius: 12px;
  padding: 14px;
}
.co-table-list {
  max-height: 220px;
  overflow: auto;
  margin-top: 6px;
}
.co-list-sec {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--fabric-text3);
  margin: 10px 0 6px;
}
.co-list-item {
  display: flex;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--font);
  color: var(--fabric-text);
  cursor: pointer;
  margin-bottom: 2px;
}
.co-list-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
}
.co-list-item:hover { background: var(--fabric-surface); }
.co-list-item.lake { color: var(--fabric-blue); }
.co-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.co-actions .fx-btn { width: 100%; justify-content: center; }
.co-status {
  margin-top: 10px;
  font-size: 12px;
  color: var(--fabric-text2);
  line-height: 1.4;
  word-break: break-word;
}
.co-main {
  border: 1px solid var(--fabric-border);
  border-radius: 12px;
  background: var(--fabric-surface);
  overflow: hidden;
  min-height: 420px;
  display: flex;
  flex-direction: column;
}
.co-main-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--fabric-border);
  background: var(--fabric-surface2);
  flex-wrap: wrap;
}
.co-grid-wrap {
  flex: 1;
  overflow: auto;
  max-height: 480px;
}
.co-empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--fabric-text3);
  font-size: 13px;
}
table.co-data {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}
table.co-data th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f0f0f0;
  color: var(--fabric-text2);
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--fabric-border);
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
table.co-data td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--fabric-border);
  vertical-align: top;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--fabric-surface);
}
table.co-data tr:hover td { background: #fafafa; }
table.co-data td[contenteditable]:focus {
  outline: 2px solid var(--fabric-blue);
  outline-offset: -2px;
  white-space: normal;
  background: #fff;
  z-index: 1;
  position: relative;
}
table.co-data .co-col-act {
  width: 56px;
  text-align: center;
  position: sticky;
  right: 0;
  background: var(--fabric-surface);
}
html.theme-dark table.co-data th { background: #2a2a2a; }
html.theme-dark table.co-data td { background: #242424; }
html.theme-dark table.co-data tr:hover td { background: #2c2c2c; }
html.theme-dark .co-side { background: #1f1f1f; }
html.theme-dark .co-main-bar { background: #1f1f1f; }

/* Multi-DB multi-table workspace */
.mx-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 14px;
  align-items: stretch;
  min-height: 480px;
}
@media (max-width: 960px) {
  .mx-layout { grid-template-columns: 1fr; }
}
.mx-side {
  background: var(--fabric-surface2);
  border: 1px solid var(--fabric-border);
  border-radius: 12px;
  padding: 14px;
  overflow: auto;
  max-height: 70vh;
}
.mx-main {
  border: 1px solid var(--fabric-border);
  border-radius: 12px;
  background: var(--fabric-surface);
  overflow: hidden;
  min-height: 480px;
  display: flex;
  flex-direction: column;
}
.mx-conn-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }
.mx-conn-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  border: 1px solid transparent;
  background: transparent;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  color: var(--fabric-text);
}
.mx-conn-item img, .mx-conn-item svg { width: 18px; height: 18px; }
.mx-conn-item:hover { background: var(--fabric-surface); }
.mx-conn-item.active {
  background: var(--fabric-blue-soft);
  border-color: #b4d6f5;
  color: var(--fabric-blue);
}
.mx-tabbar {
  border-bottom: 1px solid var(--fabric-border);
  background: var(--fabric-surface2);
  overflow: hidden;
}
.mx-tabbar-scroll {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 0 4px;
}
.mx-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  padding: 10px 12px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  color: var(--fabric-text2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  max-width: 180px;
}
.mx-tab-title {
  overflow: hidden;
  text-overflow: ellipsis;
}
.mx-tab:hover { color: var(--fabric-text); background: rgba(0,0,0,.03); }
.mx-tab.active {
  color: var(--fabric-blue);
  border-bottom-color: var(--fabric-blue);
  background: var(--fabric-surface);
}
.mx-tab-x {
  font-size: 14px;
  opacity: .5;
  padding: 0 2px;
}
.mx-tab-x:hover { opacity: 1; color: var(--fabric-red); }

.cl-checks { display: flex; flex-direction: column; gap: 6px; max-height: 160px; overflow: auto; padding: 8px; background: var(--fabric-surface2); border-radius: 8px; border: 1px solid var(--fabric-border); }
.cl-check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.cl-card { transition: box-shadow .15s; }
.cl-card:hover { box-shadow: var(--fabric-shadow-md); }

.cl-conn-block { margin-top: 4px; }
.cl-conn-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--fabric-border);
  background: var(--fabric-surface2);
  margin-top: 8px;
  flex-wrap: wrap;
}

/* Brighter light chrome */
html.theme-light,
html:not(.theme-dark) {
  --fabric-bg: #f3f6fb;
  --fabric-surface: #ffffff;
  --fabric-surface2: #f7f9fc;
  --fabric-border: #e2e8f0;
  --fabric-text: #0f172a;
  --fabric-text2: #475569;
  --fabric-text3: #94a3b8;
}
html.theme-light .fx-topbar,
html:not(.theme-dark) .fx-topbar {
  background: #ffffff;
  color: #0f172a;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 0 rgba(15,23,42,.04);
}
html.theme-light .fx-topbar .brand,
html:not(.theme-dark) .fx-topbar .brand {
  color: #0f172a;
}
html.theme-light .fx-topbar .brand .logo,
html:not(.theme-dark) .fx-topbar .brand .logo {
  background: transparent;
}
html.theme-light .fx-topbar .search input,
html:not(.theme-dark) .fx-topbar .search input {
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid #e2e8f0;
}
html.theme-light .fx-topbar .search input:focus,
html:not(.theme-dark) .fx-topbar .search input:focus {
  background: #ffffff;
  border-color: #0078d4;
  box-shadow: 0 0 0 3px rgba(0,120,212,.15);
}
html.theme-light .fx-topbar .search input::placeholder,
html:not(.theme-dark) .fx-topbar .search input::placeholder {
  color: #94a3b8;
}
html.theme-light .fx-topbar .search-ico,
html:not(.theme-dark) .fx-topbar .search-ico {
  opacity: .7;
  color: #64748b;
}
html.theme-light .fx-topbar .search-ico svg,
html:not(.theme-dark) .fx-topbar .search-ico svg {
  fill: #64748b;
  color: #64748b;
}
html.theme-light .fx-topbar .icon-btn,
html:not(.theme-dark) .fx-topbar .icon-btn {
  color: #334155;
  background: transparent;
}
html.theme-light .fx-topbar .icon-btn:hover,
html:not(.theme-dark) .fx-topbar .icon-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}
html.theme-light .fx-topbar .icon-btn svg,
html:not(.theme-dark) .fx-topbar .icon-btn svg {
  fill: currentColor;
  color: inherit;
}
html.theme-light .fx-topbar .user,
html:not(.theme-dark) .fx-topbar .user {
  color: #0f172a;
}
html.theme-light .fx-topbar .user:hover,
html:not(.theme-dark) .fx-topbar .user:hover {
  background: #f1f5f9;
}
html.theme-light .fx-topbar #bn-signin-btn,
html:not(.theme-dark) .fx-topbar #bn-signin-btn {
  color: #0f172a;
  border-color: #e2e8f0;
}
/* Dark mode search stays readable */
html.theme-dark .fx-topbar .search input {
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,.14);
}
html.theme-dark .fx-topbar .search input::placeholder {
  color: rgba(255,255,255,.55);
}
html.theme-dark .fx-topbar .brand {
  color: #fff;
}
html.theme-light .fx-rail,
html:not(.theme-dark) .fx-rail {
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
}
html.theme-light .fx-main,
html:not(.theme-dark) .fx-main {
  background: #f3f6fb;
}
html.theme-light .fx-card,
html:not(.theme-dark) .fx-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}

/* Object explorer items */
#sql-explorer { max-height: 60vh; overflow: auto; }
.obj-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 2px;
}
.obj-item:hover { background: #eef5fc; }
.obj-item.active { background: #e0f0fc; }
.obj-ico {
  flex-shrink: 0;
  width: 18px;
  text-align: center;
  color: var(--fabric-blue);
  font-size: 12px;
}
.obj-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  font-family: ui-monospace, Consolas, monospace;
}
.obj-meta {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--fabric-text3);
}

/* Context menu */
.bn-ctx-menu {
  position: fixed;
  z-index: 9999;
  min-width: 160px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(15,23,42,.14);
  padding: 6px;
  display: none;
}
.bn-ctx-menu.open { display: block; }
.bn-ctx-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--font);
  color: #0f172a;
  cursor: pointer;
}
.bn-ctx-menu button:hover { background: #f1f5f9; }
.bn-ctx-menu button.danger { color: #dc2626; }
.bn-ctx-menu button.danger:hover { background: #fef2f2; }
html.theme-dark .bn-ctx-menu {
  background: #252525;
  border-color: #3a3a3a;
}
html.theme-dark .bn-ctx-menu button { color: #eee; }
html.theme-dark .bn-ctx-menu button:hover { background: #333; }


/* bn-css-force-search — light mode search must never disappear */
html.theme-light .fx-topbar .search,
html:not(.theme-dark) .fx-topbar .search {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}
html.theme-light .fx-topbar .search input,
html:not(.theme-dark) .fx-topbar .search input {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
  -webkit-text-fill-color: #0f172a !important;
}
