/* ============================================================
   DB Explorer Styles — ADR-095 Phase 3
   ============================================================ */

body.db-explorer-active #expanded-title,
body.db-explorer-active #detail-panel,
body.db-explorer-active #bg-layer,
body.db-explorer-active #c4-link { display: none !important; }

#db-explorer-view {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: #f1f5f9;
  overflow: hidden;
}

.dbe-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px 12px;
}
.dbe-header-left { display: flex; align-items: baseline; gap: 12px; }
.dbe-title { font-size: 22px; font-weight: 600; color: #1e293b; margin: 0; }
.dbe-subtitle { font-size: 14px; color: #64748b; font-weight: 400; }
.dbe-header-right { display: flex; gap: 6px; flex-wrap: wrap; }

.dbe-layout {
  display: flex;
  height: calc(100vh - 80px);
  padding: 0 32px 20px;
  gap: 16px;
}

/* Sidebar */
.dbe-sidebar {
  width: 260px;
  min-width: 220px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow-y: auto;
  flex-shrink: 0;
}
.dbe-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #f1f5f9;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.dbe-sidebar-header h3 { font-size: 13px; font-weight: 600; color: #1e293b; margin: 0; }
.dbe-table-count { font-size: 11px; color: #94a3b8; font-weight: 500; }

.dbe-table-list { padding: 6px 8px; }
.dbe-table-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  font-size: 12px;
  color: #334155;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
  text-align: left;
  font-family: 'Inter', sans-serif;
}
.dbe-table-item:hover { background: #f8fafc; }
.dbe-table-selected { background: #eff6ff !important; color: #2563eb; font-weight: 500; }
.dbe-table-name { font-family: 'SF Mono', 'Consolas', monospace; font-size: 11.5px; }
.dbe-table-rows {
  font-size: 10px;
  background: #f1f5f9;
  color: #64748b;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 500;
  min-width: 24px;
  text-align: center;
}
.dbe-table-selected .dbe-table-rows { background: #dbeafe; color: #2563eb; }

/* Main area */
.dbe-main {
  flex: 1;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dbe-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid #f1f5f9;
}
.dbe-table-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
  font-family: 'SF Mono', 'Consolas', monospace;
}
.dbe-row-info { font-size: 12px; color: #94a3b8; }

.dbe-pagination {
  display: flex;
  gap: 8px;
  padding: 8px 20px;
  border-bottom: 1px solid #f1f5f9;
}
.dbe-page-btn {
  padding: 4px 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  color: #334155;
  font-family: 'Inter', sans-serif;
}
.dbe-page-btn:hover:not(:disabled) { background: #f8fafc; }
.dbe-page-btn:disabled { opacity: 0.4; cursor: default; }

.dbe-data-scroll {
  flex: 1;
  overflow: auto;
}

.dbe-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.dbe-data-table thead { position: sticky; top: 0; z-index: 1; }
.dbe-data-table th {
  padding: 8px 12px;
  text-align: left;
  background: #f8fafc;
  color: #475569;
  font-weight: 500;
  font-size: 11px;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
  font-family: 'SF Mono', 'Consolas', monospace;
  user-select: none;
}
.dbe-data-table th:hover { background: #f1f5f9; }
.dbe-data-table td {
  padding: 6px 12px;
  border-bottom: 1px solid #f8fafc;
  color: #334155;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dbe-data-table tr:hover td { background: #fafbfd; }

.dbe-cell-null { color: #cbd5e1; font-style: italic; font-size: 11px; }
.dbe-cell-json { color: #7c3aed; font-family: 'SF Mono', 'Consolas', monospace; font-size: 11px; }

.dbe-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #94a3b8;
}
.dbe-empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }
.dbe-empty-state p { font-size: 14px; }
.dbe-empty-table { padding: 40px; text-align: center; color: #94a3b8; font-size: 13px; }

.dbe-loading { padding: 20px; text-align: center; color: #94a3b8; font-size: 13px; }
.dbe-error { padding: 20px; text-align: center; color: #ef4444; font-size: 13px; }
