/* ==========================================================================
   EXECUTION DIAGRAM — LAYOUT
   ========================================================================== */
.executionDiagram {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 400px;
  overflow: hidden;
}

.exchangeBar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.exchangeLabel {
  font-weight: 600;
  color: var(--text-primary);
}

.exchangeId {
  font-size: 12px;
  background: var(--bg-hover);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--text-primary);
}

.exchangeMeta {
  color: var(--text-muted);
}

.jumpToError {
  margin-left: auto;
  font-size: 12px;
  padding: 3px 10px;
  border: 1px solid var(--error);
  background: var(--error-bg);
  color: var(--error);
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  font-family: inherit;
}

.jumpToError:hover {
  background: color-mix(in srgb, var(--error) 15%, var(--bg-surface));
}

.diagramArea {
  overflow: hidden;
  position: relative;
}

.downloadBtn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
  font-size: 12px;
  font-family: var(--font-mono);
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s, background 0.15s;
}

.downloadBtn:hover {
  opacity: 1;
  background: var(--bg-hover);
}

.splitter {
  height: 4px;
  background: var(--border);
  cursor: row-resize;
  flex-shrink: 0;
}

.splitter:hover {
  background: var(--amber);
}

.detailArea {
  overflow: hidden;
  min-height: 120px;
  display: flex;
  flex-direction: column;
}

.loadingState {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: var(--text-muted);
  font-size: 13px;
}

.errorState {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: var(--error);
  font-size: 13px;
}

.statusRunning {
  color: var(--amber);
  background: var(--amber-bg);
}

/* ==========================================================================
   DETAIL PANEL
   ========================================================================== */
.detailPanel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  flex: 1;
  min-height: 0;
}

.processorHeader {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
  min-height: 32px;
}

.processorName {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.processorId {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.processorDuration {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  margin-left: auto;
}

/* ==========================================================================
   STATUS BADGE
   ========================================================================== */
.statusBadge {
  font-size: 12px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.statusCompleted {
  color: var(--success);
  background: var(--success-bg);
}

.statusFailed {
  color: var(--error);
  background: var(--error-bg);
}

/* ==========================================================================
   TAB BAR
   ========================================================================== */
.tabBar {
  display: flex;
  flex-direction: row;
  border-bottom: 1px solid var(--border);
  padding: 0 14px;
  background: var(--bg-raised);
  gap: 0;
}

.tab {
  padding: 6px 12px;
  font-size: 12px;
  font-family: var(--font-body);
  cursor: pointer;
  color: var(--text-muted);
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  transition: color 0.12s, border-color 0.12s;
  white-space: nowrap;
}

.tab:hover {
  color: var(--text-secondary);
}

.tabActive {
  color: var(--amber);
  border-bottom: 2px solid var(--amber);
  font-weight: 600;
}

.tabDisabled {
  opacity: 0.4;
  cursor: default;
}

.tabDisabled:hover {
  color: var(--text-muted);
}

.tabError {
  color: var(--error);
}

.tabError:hover {
  color: var(--error);
}

/* ==========================================================================
   TAB CONTENT
   ========================================================================== */
.tabContent {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 14px;
}

/* ==========================================================================
   INFO TAB — GRID
   ========================================================================== */
.infoGrid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px 24px;
}

.fieldLabel {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.fieldValue {
  font-size: 12px;
  color: var(--text-primary);
  word-break: break-all;
}

.fieldValueMono {
  font-size: 12px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  word-break: break-all;
}

/* ==========================================================================
   ATTRIBUTE PILLS
   ========================================================================== */
.attributesSection {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.attributesLabel {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.attributesList {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.attributePill {
  font-size: 12px;
  padding: 2px 8px;
  background: var(--bg-hover);
  border-radius: 10px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* ==========================================================================
   HEADERS TAB — SPLIT
   ========================================================================== */
.headersSplit {
  display: flex;
  gap: 0;
  min-height: 0;
  overflow-y: auto;
  max-height: 100%;
}

.headersColumn {
  flex: 1;
  min-width: 0;
}

.headersColumn + .headersColumn {
  border-left: 1px solid var(--border);
  padding-left: 14px;
  margin-left: 14px;
}

.headersColumnLabel {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.headersTable {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
}

.headersTable td {
  padding: 3px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.headersTable tr:last-child td {
  border-bottom: none;
}

.headerKey {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  padding-right: 12px;
  width: 140px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.headerVal {
  font-family: var(--font-mono);
  color: var(--text-primary);
  word-break: break-all;
}

/* ==========================================================================
   BODY / CODE TAB
   ========================================================================== */
.codeHeader {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.codeFormat {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.codeSize {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.codeCopyBtn {
  margin-left: auto;
  font-size: 12px;
  font-family: var(--font-body);
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
}

.codeCopyBtn:hover {
  background: var(--bg-hover);
}

.codeBlock {
  --code-bg: var(--bg-inset);
  --code-fg: var(--text-primary);
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 12px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 400px;
  overflow-y: auto;
}

/* ==========================================================================
   ERROR TAB
   ========================================================================== */
.errorType {
  font-size: 13px;
  font-weight: 600;
  color: var(--error);
  margin-bottom: 8px;
}

.errorMessage {
  font-size: 12px;
  color: var(--text-primary);
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 12px;
  line-height: 1.5;
  word-break: break-word;
}

.errorStackTrace {
  --code-bg: var(--bg-inset);
  --code-fg: var(--text-primary);
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 12px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre;
  max-height: 300px;
  overflow-y: auto;
}

.errorStackWrap pre {
  max-height: 50vh;
  overflow-y: auto;
}

.errorStackLabel {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

/* ==========================================================================
   TIMELINE / GANTT TAB
   ========================================================================== */
.ganttContainer {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  max-height: 100%;
}

.ganttRow {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 3px 4px;
  border-radius: 3px;
  transition: background 0.1s;
}

.ganttRow:hover {
  background: var(--bg-hover);
}

.ganttSelected {
  background: var(--amber-bg);
}

.ganttSelected:hover {
  background: var(--amber-bg);
}

.ganttLabel {
  width: 100px;
  min-width: 100px;
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ganttBar {
  flex: 1;
  height: 16px;
  background: var(--bg-hover);
  border-radius: 2px;
  position: relative;
  min-width: 0;
}

.ganttFill {
  position: absolute;
  height: 100%;
  border-radius: 2px;
  min-width: 2px;
}

.ganttFillCompleted {
  background: var(--success);
}

.ganttFillFailed {
  background: var(--error);
}

.ganttDuration {
  width: 50px;
  min-width: 50px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-align: right;
}

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */
.emptyState {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  padding: 20px;
}
