/* GCE Unified Pipeline — UI Styles */
/* One system. Two methodologies. One verified artifact. */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --raised: #F5F5F5;
  --border: rgba(0, 0, 0, 0.08);
  --verified: #7dba7d;
  --warning: #d4a84d;
  --danger: #c96b6b;
  --accent: #2563EB;
  --text: #111111;
  --muted: #666666;
  --ui: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--ui);
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── TOPBAR ── */
.topbar {
  height: 44px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 20px;
  flex-shrink: 0;
}
.brand {
  font-family: var(--ui);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.brand span { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; }
.status-bar { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }
.status-dot.ok { background: var(--verified); }
.status-text { font-size: 11px; color: var(--muted); font-family: var(--mono); }

/* ── MAIN LAYOUT ── */
.main {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* ── LEFT PANEL — 200px ── */
.left {
  width: 200px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}
.section {
  padding: 14px;
  border-bottom: 1px solid var(--border);
}
.section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.task-input {
  width: 100%;
  min-height: 70px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  color: var(--text);
  font-family: var(--ui);
  font-size: 13px;
  resize: vertical;
  outline: none;
}
.task-input:focus { border-color: var(--verified); }
.task-input::placeholder { color: var(--muted); }
.mode-select {
  display: flex;
  gap: 3px;
  margin-top: 8px;
}
.mode-btn {
  flex: 1;
  padding: 5px 2px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  text-align: center;
}
.mode-btn.active { color: var(--verified); border-color: var(--verified); }
.compile-btn {
  width: 100%;
  padding: 10px;
  margin-top: 10px;
  background: var(--verified);
  color: var(--bg);
  border: none;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.04em;
}
.compile-btn:hover { filter: brightness(1.1); }
.compile-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Artifacts list */
.art-list { list-style: none; }
.art-item {
  padding: 6px 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  cursor: pointer;
  font-size: 11px;
}
.art-item:hover { color: var(--verified); }
.art-meta { font-family: var(--mono); font-size: 9px; color: var(--muted); margin-top: 2px; }

/* ── CENTER — flex 1, dominant ── */
.center {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* Tabs */
.tabs {
  display: flex;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.tab {
  padding: 8px 18px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--verified); border-bottom-color: var(--verified); }

/* Document area */
.doc-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  font-size: 14px;
  line-height: 1.8;
}
.doc-area .empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--muted);
  font-size: 14px;
}

/* Live sentence rendering */
.sent { padding: 4px 0; transition: all 0.3s; }
.sent.pending { color: var(--muted); }
.sent.verifying { color: var(--warning); }
.sent.verified { color: var(--text); }
.sent.reconciled { color: var(--text); border-left: 2px solid var(--warning); padding-left: 8px; }
.sent.flagged { color: var(--text); border-left: 2px solid var(--danger); padding-left: 8px; }
.sent .tier-badge {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted);
  margin-left: 6px;
}

/* Pipeline monitor strip */
.pipeline-strip {
  height: 36px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 16px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.layer-pill {
  flex: 1;
  text-align: center;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  padding: 4px 0;
  border-radius: 3px;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
  transition: all 0.3s;
}
.layer-pill.running { color: var(--accent); border-color: var(--accent); animation: pulse 1s infinite; }
.layer-pill.passed { color: var(--verified); border-color: var(--verified); background: rgba(0,230,160,0.04); }
.layer-pill.failed { color: var(--danger); border-color: var(--danger); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ── RIGHT PANEL — 220px ── */
.right {
  width: 220px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}

/* Score display */
.score-display {
  text-align: center;
  padding: 16px 14px 12px;
}
.score-label { font-size: 9px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.score-value {
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 600;
  margin: 4px 0;
}
.score-value.a { color: var(--verified); }
.score-value.b { color: var(--verified); }
.score-value.c { color: var(--warning); }
.score-value.d { color: var(--warning); }
.score-value.f { color: var(--danger); }
.score-grade {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
}
.score-bar {
  height: 3px;
  background: var(--bg);
  border-radius: 2px;
  margin: 6px 14px 0;
  overflow: hidden;
}
.score-bar-fill { height: 100%; border-radius: 2px; transition: width 0.5s; }

/* Breakdown rows */
.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: 11px;
}
.breakdown-label { color: var(--muted); }
.breakdown-val { font-family: var(--mono); font-size: 11px; }
.breakdown-val.good { color: var(--verified); }
.breakdown-val.warn { color: var(--warning); }
.breakdown-val.bad { color: var(--danger); }

/* Tier chart */
.tier-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin: 6px 0;
  background: var(--bg);
}
.tier-seg { height: 100%; min-width: 2px; }

/* Artifact info */
.art-field {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  font-size: 10px;
}
.art-key { color: var(--muted); }
.art-val { font-family: var(--mono); color: var(--text); font-size: 10px; }
