/* ============================================================
   Workspace Engine — split-pane grid layout
   ============================================================ */

/* Host page overrides */
.da-ws-host {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  padding: 0 !important;
}

.da-ws-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  background: var(--bg-0, #080914);
  overflow: hidden;
}

/* ── Toolbar ─────────────────────────────────────────────── */
.da-ws-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 38px;
  min-height: 38px;
  padding: 0 10px;
  background: var(--bg-1, #0d0f1a);
  border-bottom: 1px solid var(--border, #1e293b);
  gap: 8px;
  flex-shrink: 0;
  overflow: hidden;
}

.da-ws-toolbar-left,
.da-ws-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.da-ws-toolbar-right { margin-left: auto; }

/* ── Aggregation strip ───────────────────────────────────── */
.da-aggr-strip {
  display: flex;
  align-items: center;
  gap: 4px;
}

.da-aggr-label {
  font-size: 10px;
  color: var(--text-muted, #475569);
  white-space: nowrap;
}

.da-aggr-sel,
.da-aggr-input {
  font-size: 11px;
  background: var(--bg-2, #111827);
  color: var(--text-1, #e2e8f0);
  border: 1px solid var(--border, #1e293b);
  border-radius: 3px;
  padding: 1px 4px;
  height: 22px;
  cursor: pointer;
  outline: none;
}

.da-aggr-sel:hover,
.da-aggr-input:hover { border-color: var(--color-info, #3b82f6); }

.da-aggr-sep {
  width: 1px;
  height: 16px;
  background: var(--border, #1e293b);
  margin: 0 2px;
}

/* ── Workspace area ─────────────────────────────────────── */
.da-ws-area {
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ── Workspace root ─────────────────────────────────────── */
.ws-root {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* ── Split containers ───────────────────────────────────── */
.ws-split {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.ws-split-h { flex-direction: row; }
.ws-split-v { flex-direction: column; }

.ws-child {
  position: relative;
  overflow: hidden;
  min-width: 80px;
  min-height: 60px;
}

/* ── Resize dividers ─────────────────────────────────────── */
.ws-divider {
  flex-shrink: 0;
  background: var(--border, #1e293b);
  z-index: 10;
  transition: background 0.15s;
}

.ws-divider:hover,
.ws-divider:active { background: var(--color-info, #3b82f6); }

.ws-divider-h {
  width: 4px;
  height: 100%;
  cursor: col-resize;
}

.ws-divider-v {
  height: 4px;
  width: 100%;
  cursor: row-resize;
}

/* ── Pane ────────────────────────────────────────────────── */
.ws-pane {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: var(--bg-0, #080914);
  overflow: hidden;
}

.ws-pane-titlebar {
  display: flex;
  align-items: center;
  height: 26px;
  min-height: 26px;
  padding: 0 4px 0 8px;
  background: var(--bg-1, #0d0f1a);
  border-bottom: 1px solid var(--border, #1e293b);
  font-size: 11px;
  color: var(--text-muted, #64748b);
  user-select: none;
  flex-shrink: 0;
  gap: 4px;
}

.ws-pane-icon { font-size: 12px; }
.ws-pane-label { font-weight: 600; color: var(--text-1, #94a3b8); }
.ws-pane-spacer { flex: 1; }

.ws-pane-btn {
  background: none;
  border: none;
  color: var(--text-muted, #475569);
  padding: 2px 4px;
  cursor: pointer;
  font-size: 11px;
  border-radius: 3px;
  line-height: 1;
}
.ws-pane-btn:hover { background: var(--bg-2, #1e293b); color: var(--text-1, #e2e8f0); }
.ws-pane-close:hover  { color: #ef4444 !important; }

.ws-pane-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ── Empty pane placeholder ─────────────────────────────── */
.ws-empty-pane {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted, #334155);
  font-size: 12px;
}

.ws-btn-add {
  background: var(--bg-2, #111827);
  border: 1px dashed var(--border, #1e293b);
  color: var(--text-muted, #64748b);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}
.ws-btn-add:hover { border-color: var(--color-info, #3b82f6); color: var(--color-info, #3b82f6); }

/* ── Workspace setup modal ───────────────────────────────── */
.ws-setup-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ws-setup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}

.ws-setup-window {
  position: relative;
  background: var(--bg-1, #0d0f1a);
  border: 1px solid var(--border, #1e293b);
  border-radius: 8px;
  width: 480px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,0.8);
}

.ws-setup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, #1e293b);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1, #e2e8f0);
}

.ws-setup-close {
  background: none;
  border: none;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  border-radius: 4px;
}
.ws-setup-close:hover { color: #ef4444; }

.ws-setup-body {
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ws-setup-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--bg-2, #111827);
  border: 1px solid transparent;
  transition: border-color 0.1s;
}
.ws-setup-item:hover { border-color: var(--color-info, #3b82f6); }

.ws-setup-icon { font-size: 20px; width: 28px; text-align: center; flex-shrink: 0; }

.ws-setup-info { flex: 1; min-width: 0; }
.ws-setup-name { font-size: 12px; font-weight: 600; color: var(--text-1, #e2e8f0); }
.ws-setup-desc { font-size: 10px; color: var(--text-muted, #64748b); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ws-setup-add-btn {
  background: var(--color-info, #3b82f6);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 4px 12px;
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
}
.ws-setup-add-btn:hover { background: #2563eb; }

/* ============================================================
   DOM Ladder pane styles
   ============================================================ */

.da-dom-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  font-size: 11px;
  font-family: monospace;
}

.da-dom-table-wrap {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.da-dom-side { overflow-y: auto; flex: 1; }
.da-dom-asks { display: flex; flex-direction: column; }
.da-dom-bids { display: flex; flex-direction: column; }

.da-dom-spread {
  text-align: center;
  padding: 2px;
  font-size: 10px;
  color: var(--text-muted, #64748b);
  background: var(--bg-1, #0d0f1a);
  border-top: 1px solid var(--border, #1e293b);
  border-bottom: 1px solid var(--border, #1e293b);
  flex-shrink: 0;
}

.da-dom-row {
  display: flex;
  align-items: center;
  padding: 1px 4px;
  gap: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.02);
}
.da-dom-row:hover { background: rgba(255,255,255,0.04); }

.da-dom-price { min-width: 72px; color: var(--text-1, #e2e8f0); }
.da-dom-qty   { min-width: 50px; text-align: right; color: var(--text-muted, #64748b); margin-left: auto; }
.da-dom-bar-bid { height: 6px; background: rgba(34,197,94,0.4); border-radius: 1px; }
.da-dom-bar-ask { height: 6px; background: rgba(239,68,68,0.4); border-radius: 1px; }
.da-dom-large .da-dom-price { color: #f59e0b !important; font-weight: 700; }
.da-dom-ask-row .da-dom-price { color: rgba(239,68,68,0.9); }
.da-dom-bid-row .da-dom-price { color: rgba(34,197,94,0.9); }

/* ============================================================
   Pulse pane styles
   ============================================================ */

.da-pulse-wrap { height: 100%; overflow-y: auto; }

.da-gauge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--text-muted, #64748b);
}
.da-gauge-row > span:first-child { min-width: 70px; }
.da-gauge-row > span:last-child  { min-width: 36px; text-align: right; color: var(--text-1, #94a3b8); }

.da-gauge {
  flex: 1;
  height: 8px;
  background: var(--bg-2, #111827);
  border-radius: 4px;
  overflow: hidden;
}
.da-gauge-bar { height: 100%; border-radius: 4px; transition: width 0.3s; }
.da-g-buy   { background: linear-gradient(90deg, #166534, #22c55e); }
.da-g-sell  { background: linear-gradient(90deg, #7f1d1d, #ef4444); }
.da-g-score { background: linear-gradient(90deg, #1e3a8a, #3b82f6); }

/* ============================================================
   Liquidity table pane
   ============================================================ */

.da-liq-table th, .da-liq-table td {
  padding: 2px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
