/* ─── BARITU DASHBOARD — Runtime States, Motion & Operational Atmosphere ──
   The system must feel: persistently alive. Not animated. Alive.
────────────────────────────────────────────────────────────────────────── */

/* ══ INFRASTRUCTURE HEARTBEAT ═════════════════════════════════════════════ */
/* Breathing — not blinking. The system inhales and exhales. */
@keyframes breath {
  0%, 100% { opacity: .7; }
  50%       { opacity: 1; }
}
@keyframes breath-soft {
  0%, 100% { opacity: .4; }
  50%       { opacity: .75; }
}
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(74,158,110,.3); opacity: 1; }
  70%  { box-shadow: 0 0 0 6px rgba(74,158,110,0); opacity: .7; }
  100% { box-shadow: 0 0 0 0 rgba(74,158,110,0); opacity: .7; }
}
@keyframes pulse-ring-p {
  0%   { box-shadow: 0 0 0 0 rgba(0,173,80,.25); }
  70%  { box-shadow: 0 0 0 5px rgba(0,173,80,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,173,80,0); }
}

/* ══ RUNTIME INDICATORS ═══════════════════════════════════════════════════ */
/* The heartbeat dot — primary runtime presence signal */
.rt-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
  display: inline-block;
}
.rt-dot.active {
  background: var(--rt-pulse);
  animation: pulse-ring var(--dur-pulse) ease-out infinite;
}
.rt-dot.idle    { background: var(--text-ghost); }
.rt-dot.warn    { background: var(--warn); animation: breath var(--dur-breath) ease-in-out infinite; }
.rt-dot.err     { background: var(--err-bright); animation: breath 1.8s ease-in-out infinite; }
.rt-dot.orch    { background: var(--p-text); animation: pulse-ring-p var(--dur-pulse) ease-out infinite; }

/* Atmospheric live indicator — larger, for topbar */
.live-indicator {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  animation: pulse-ring var(--dur-pulse) ease-out infinite;
}
.live-indicator.ok   { background: var(--ok-bright); }
.live-indicator.warn { background: var(--warn); animation: breath var(--dur-breath) ease-in-out infinite; }
.live-indicator.err  { background: var(--err-bright); animation: breath 1.8s ease-in-out infinite; }
.live-indicator.idle { background: var(--text-ghost); animation: breath-soft 4s ease-in-out infinite; }

/* ══ TOPBAR OPERATIONAL CONTEXT ═══════════════════════════════════════════ */
.rt-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .05em;
  padding: 3px 9px; border-radius: 20px;
  background: var(--bg-surface); border: 1px solid var(--border);
  color: var(--text-muted); white-space: nowrap;
  transition: border-color var(--dur);
}
.rt-pill.runtime {
  background: var(--rt-active); border-color: var(--rt-border); color: var(--rt-text);
}
.rt-pill.orch {
  background: var(--orch-active); border-color: var(--orch-border); color: var(--orch-text);
}
.rt-pill.observer {
  background: var(--obs-active); border-color: var(--obs-border); color: var(--obs-text);
}
.rt-pill.env-prod  { background: var(--env-prod);  border-color: var(--env-prod-b);  color: var(--err-bright); }
.rt-pill.env-stage { background: var(--env-stage); border-color: var(--env-stage-b); color: var(--warn); }
.rt-pill.env-local { background: var(--env-local); border-color: var(--env-local-b); color: var(--p-text); }

/* Confidence marker */
.conf-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--mono); font-size: 8.5px; letter-spacing: .07em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 3px;
}
.conf-pill.high     { background: rgba(74,158,110,.1);  color: var(--conf-high);     border: 1px solid rgba(74,158,110,.18); }
.conf-pill.medium   { background: rgba(192,128,64,.1);  color: var(--conf-medium);   border: 1px solid rgba(192,128,64,.18); }
.conf-pill.low      { background: rgba(184,80,80,.1);   color: var(--conf-low);      border: 1px solid rgba(184,80,80,.18); }
.conf-pill.critical { background: rgba(208,48,48,.12);  color: var(--conf-critical); border: 1px solid rgba(208,48,48,.2); animation: breath 1.8s ease-in-out infinite; }

/* ══ SIDEBAR OPERATIONAL STATES ═══════════════════════════════════════════ */
.sidebar-runtime-strip {
  padding: 8px 12px 6px;
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 9px; letter-spacing: .07em;
  color: var(--text-ghost);
}
.sidebar-runtime-val {
  margin-left: auto; color: var(--rt-text);
  font-size: 9px; letter-spacing: .05em;
}
.sidebar-env-label {
  font-family: var(--mono); font-size: 8.5px; letter-spacing: .1em;
  text-transform: uppercase;
  padding: 10px 14px 5px;
  color: var(--text-dim);
  display: flex; align-items: center; justify-content: space-between;
}

/* ══ TASK PIPELINE ════════════════════════════════════════════════════════ */
.pipeline-steps { display: flex; flex-direction: column; gap: 6px; }
.pipeline-step {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--bg-surface); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted);
  transition: all var(--dur-md) var(--ease-soft);
}
.pipeline-step.active {
  border-color: var(--orch-border); color: var(--orch-text);
  background: var(--orch-active);
}
.pipeline-step.done {
  border-color: var(--rt-border); color: var(--rt-text);
  background: var(--rt-active);
}
.pipeline-step.failed {
  border-color: rgba(184,80,80,.18); color: var(--err-bright);
  background: var(--err-soft);
}
.step-pct { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--text-ghost); }

/* ══ PROGRESS BAR — animated when running ════════════════════════════════ */
@keyframes progress-flow {
  0%   { background-position: 0 0; }
  100% { background-position: 32px 0; }
}
.progress-bar { height: 2px; background: var(--bg-surface); border-radius: 1px; overflow: hidden; }
.progress-fill {
  height: 100%; border-radius: 1px;
  background: var(--p);
  transition: width var(--dur-md) var(--ease-soft);
}
.progress-fill.running {
  background: repeating-linear-gradient(
    90deg,
    var(--p) 0px, var(--p) 8px,
    rgba(0,173,80,.4) 8px, rgba(0,173,80,.4) 16px
  );
  background-size: 32px 100%;
  animation: progress-flow 1.2s linear infinite;
}

/* ══ OBSERVER — Operational intelligence, not error logs ═════════════════ */
.obs-timeline {
  display: flex; flex-direction: column; gap: 0;
  position: relative;
}
.obs-timeline::before {
  content: ''; position: absolute;
  left: 7px; top: 12px; bottom: 12px; width: 1px;
  background: var(--border-soft);
}
.obs-event {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 8px 0; position: relative;
}
.obs-event-dot {
  width: 15px; height: 15px; border-radius: 50%;
  border: 1px solid; flex-shrink: 0; margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-elevated); z-index: 1;
}
.obs-event-dot.ok   { border-color: var(--rt-border);   }
.obs-event-dot.warn { border-color: rgba(192,128,64,.3); }
.obs-event-dot.err  { border-color: rgba(184,80,80,.3);  }
.obs-event-inner { width: 5px; height: 5px; border-radius: 50%; }
.obs-event-dot.ok   .obs-event-inner { background: var(--ok-bright); animation: breath var(--dur-breath) ease-in-out infinite; }
.obs-event-dot.warn .obs-event-inner { background: var(--warn); }
.obs-event-dot.err  .obs-event-inner { background: var(--err-bright); }
.obs-event-body { flex: 1; }
.obs-event-title { font-size: 12px; font-weight: 500; color: var(--text-secondary); line-height: 1.4; }
.obs-event-meta  { font-family: var(--mono); font-size: 10px; color: var(--text-ghost); margin-top: 2px; }

/* ══ TRANSITION SYSTEM — view enter ═══════════════════════════════════════ */
@keyframes view-enter {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.view.active { animation: view-enter var(--dur-md) var(--ease-soft); }

/* ══ CARD DEPTH — subtle layered atmosphere ══════════════════════════════ */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
/* Very subtle atmospheric depth hint */
.card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--cream-dim), transparent);
  pointer-events: none;
}

/* ══ OPERATIONAL TASK STATES ══════════════════════════════════════════════ */
.task-item { transition: background var(--dur), border-color var(--dur); }
.task-item.status-running {
  border-color: var(--orch-border);
  background: var(--orch-active);
}
.task-item.status-done {
  border-color: var(--rt-border);
  background: var(--rt-active);
}
.task-item.status-failed {
  border-color: rgba(184,80,80,.15);
  background: var(--err-soft);
}

/* ══ VERTICAL DOMAIN TAGS ════════════════════════════════════════════════ */
.vertical-tag {
  font-family: var(--mono); font-size: 8.5px; letter-spacing: .08em;
  padding: 2px 7px; border-radius: 3px; text-transform: uppercase;
  border: 1px solid; display: inline-block;
}
.vt-fintech    { background: rgba(0,173,80,.08); color: #3ce58f; border-color: rgba(0,173,80,.18); }
.vt-healthcare { background: rgba(74,158,110,.08);  color: #4fab7a; border-color: rgba(74,158,110,.18); }
.vt-commerce   { background: rgba(192,128,64,.08);  color: #c08040; border-color: rgba(192,128,64,.18); }
.vt-hr         { background: rgba(80,140,180,.08);  color: #5a90b8; border-color: rgba(80,140,180,.18); }
.vt-logistics  { background: rgba(170,80,80,.08);   color: #aa5050; border-color: rgba(170,80,80,.18); }
.vt-lms        { background: rgba(180,140,80,.08);  color: #b49050; border-color: rgba(180,140,80,.18); }
.vt-saas       { background: rgba(140,80,180,.08);  color: #8c50b4; border-color: rgba(140,80,180,.18); }
.vt-ai_ops     { background: rgba(80,180,180,.08);  color: #50b4b4; border-color: rgba(80,180,180,.18); }

/* ══ SKELETON ════════════════════════════════════════════════════════════ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-surface) 25%, rgba(255,255,255,.02) 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
  border-radius: var(--radius-sm); height: 34px; margin-bottom: 6px;
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ══ LOG ITEMS ════════════════════════════════════════════════════════════ */
.log-list { display: flex; flex-direction: column; gap: 3px; max-height: 340px; overflow-y: auto; }
.log-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 7px 10px; border-radius: var(--radius-sm);
  font-family: var(--mono); font-size: 11px;
  border-left: 2px solid var(--border);
  transition: background var(--dur-fast);
}
.log-item.err  { border-left-color: var(--err-bright); background: var(--err-soft); }
.log-item.warn { border-left-color: var(--warn);       background: var(--warn-soft); }
.log-item.info { border-left-color: var(--p);          background: var(--p-dim); }
.log-item.ok   { border-left-color: var(--ok-bright);  background: var(--ok-dim); }
.log-time  { color: var(--text-ghost); flex-shrink: 0; font-size: 10px; margin-top: 1px; min-width: 52px; }
.log-level { flex-shrink: 0; font-weight: 600; width: 34px; font-size: 9px; letter-spacing: .07em; }
.log-item.err  .log-level { color: var(--err-bright); }
.log-item.warn .log-level { color: var(--warn); }
.log-item.info .log-level { color: var(--p-text); }
.log-item.ok   .log-level { color: var(--ok-bright); }
.log-msg { color: var(--text-secondary); line-height: 1.5; }

/* ══ FILTER PILLS ════════════════════════════════════════════════════════ */
.filter-pills { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 10px; }
.filter-pill {
  font-family: var(--mono); font-size: 9px; letter-spacing: .06em;
  padding: 3px 9px; border-radius: 20px;
  background: var(--bg-surface); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; transition: all var(--dur);
}
.filter-pill.active { background: var(--p-soft); border-color: var(--p-border); color: var(--p-text); }

/* ══ RESULT CARD ═════════════════════════════════════════════════════════ */
.result-card {
  background: var(--bg-surface); border: 1px solid var(--rt-border);
  border-radius: var(--radius); padding: 16px;
  animation: view-enter var(--dur-md) var(--ease-soft);
}
.result-score-row { display: flex; gap: 10px; margin-top: 12px; }
.result-score {
  flex: 1; background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px; text-align: center;
}
.result-score-num { font-size: 20px; font-weight: 600; letter-spacing: -0.03em; color: var(--text-primary); }
.result-score-label { font-family: var(--mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-top: 2px; }

/* ══ EMPTY STATE ═════════════════════════════════════════════════════════ */
.empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 36px 20px; gap: 8px;
}
.empty-text { font-size: 12px; color: var(--text-muted); text-align: center; font-family: var(--mono); letter-spacing: .02em; }

/* ══ REFINEMENT v2 — Runtime continuity, Observer intelligence ═══════════ */

/* ── Runtime continuity lines — connect cards visually ── */
.runtime-connected {
  position: relative;
}
.runtime-connected::before {
  content: '';
  position: absolute;
  left: -24px; top: 0; bottom: 0; width: 1px;
  background: linear-gradient(to bottom,
    transparent 0%,
    var(--border-warm) 20%,
    var(--border-warm) 80%,
    transparent 100%
  );
  pointer-events: none;
}

/* ── Continuity grid — cards feel connected, not isolated ── */
.continuity-grid {
  display: grid;
  gap: 14px;
  position: relative;
}
.continuity-grid::before {
  content: '';
  position: absolute;
  left: 50%; top: 18px; bottom: 18px;
  width: 1px;
  background: linear-gradient(to bottom,
    transparent,
    var(--border-soft) 15%,
    var(--border-soft) 85%,
    transparent
  );
  pointer-events: none;
}
.continuity-grid.grid-2 { grid-template-columns: 1fr 1fr; }
.continuity-grid.grid-3 { grid-template-columns: repeat(3, 1fr); }
.continuity-grid.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Observer as operational intelligence, not log viewer ── */
.obs-intel-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 16px;
  margin-bottom: 20px;
}
.obs-intel-title {
  font-size: 11px; font-weight: 500;
  color: var(--text-secondary); letter-spacing: -.01em;
}
.obs-intel-sub {
  font-family: var(--mono); font-size: 9px;
  color: var(--text-muted); letter-spacing: .04em;
  margin-top: 3px;
}

/* Observer state pill — more presence than topbar */
.obs-state-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 9px; letter-spacing: .07em;
  text-transform: uppercase;
  padding: 4px 11px; border-radius: 4px;
  background: var(--obs-active); border: 1px solid var(--obs-border);
  color: var(--obs-text); flex-shrink: 0;
}
.obs-state-pill .rt-dot { width: 5px; height: 5px; }

/* ── Operational continuity bar — subtle strip between sections ── */
.op-continuity-bar {
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    var(--border-warm) 20%,
    var(--p-border) 50%,
    var(--border-warm) 80%,
    transparent
  );
  margin: 0;
  opacity: .6;
}

/* ── Infrastructure heartbeat — ambient page indicator ── */
.infra-heartbeat {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0;
  font-family: var(--mono); font-size: 9px;
  color: var(--text-ghost); letter-spacing: .05em;
}
.infra-heartbeat .rt-dot.active {
  animation: pulse-ring var(--dur-pulse) ease-out infinite;
}

/* ── Observer intelligence cards — replace flat metrics ── */
.obs-intel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 8px;
  position: relative; overflow: hidden;
  transition: border-color var(--dur);
}
.obs-intel-card:hover { border-color: var(--obs-border); }
.obs-intel-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--obs-border), transparent);
  opacity: .5; pointer-events: none;
}
.obs-card-val {
  font-size: 28px; font-weight: 600;
  color: var(--text-primary); letter-spacing: -0.04em; line-height: 1;
}
.obs-card-val.ok   { color: var(--ok-bright); }
.obs-card-val.warn { color: var(--warn); }
.obs-card-val.p    { color: var(--p-text); }
.obs-card-label {
  font-family: var(--mono); font-size: 9px;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--obs-text);
}
.obs-card-context {
  font-family: var(--mono); font-size: 10px;
  color: var(--text-ghost); letter-spacing: .02em;
  margin-top: 2px;
}

/* ── Release graph — temporal continuity ── */
.release-timeline {
  display: flex; flex-direction: column; gap: 0;
  position: relative;
}
.release-timeline::before {
  content: ''; position: absolute;
  left: 9px; top: 14px; bottom: 14px; width: 1px;
  background: linear-gradient(to bottom,
    transparent,
    var(--border-soft) 10%,
    var(--border-soft) 90%,
    transparent
  );
}
.rt-event {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 9px 0;
}
.rt-event-dot {
  width: 19px; height: 19px; border-radius: 50%;
  border: 1px solid; flex-shrink: 0; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-elevated); z-index: 1;
}
.rt-event-dot.ok   { border-color: var(--rt-border); }
.rt-event-dot.warn { border-color: rgba(192,128,64,.3); }
.rt-event-dot.err  { border-color: rgba(184,80,80,.3); }
.rt-event-inner { width: 7px; height: 7px; border-radius: 50%; }
.rt-event-dot.ok   .rt-event-inner { background: var(--ok-bright); animation: breath var(--dur-breath) ease-in-out infinite; }
.rt-event-dot.warn .rt-event-inner { background: var(--warn); }
.rt-event-dot.err  .rt-event-inner { background: var(--err-bright); }
.rt-event-body { flex: 1; padding-top: 1px; }
.rt-event-title {
  font-size: 12px; font-weight: 500;
  color: var(--text-secondary); line-height: 1.4;
}
.rt-event-fp {
  font-family: var(--mono); font-size: 9.5px;
  color: var(--text-ghost); margin-top: 2px; letter-spacing: .03em;
}
.rt-event-scores {
  display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap;
}
.rt-score-chip {
  font-family: var(--mono); font-size: 8.5px;
  padding: 1px 7px; border-radius: 3px;
  background: var(--bg-surface); border: 1px solid var(--border);
  color: var(--text-muted); letter-spacing: .04em;
}
.rt-score-chip.ok { background: var(--ok-soft); border-color: var(--rt-border); color: var(--ok-bright); }

/* ── Topbar release context ── */
.topbar-release-ctx {
  display: flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 9px;
  color: var(--text-ghost); letter-spacing: .04em;
  padding: 0 10px; border-left: 1px solid var(--border);
}
.topbar-release-ctx .ctx-label { color: var(--text-muted); }
.topbar-release-ctx .ctx-val   { color: var(--obs-text); font-weight: 500; }

/* ── System depth strip — below topbar, above content ── */
.depth-strip {
  height: 32px; flex-shrink: 0;
  background: var(--bg-depth);
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center;
  padding: 0 24px; gap: 20px;
  overflow: hidden;
}
.depth-strip-item {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 9px;
  color: var(--text-ghost); letter-spacing: .05em;
  white-space: nowrap;
}
.depth-strip-item .ds-val { color: var(--text-muted); }
.depth-strip-item .ds-sep {
  color: var(--text-dim); margin: 0 2px;
}
.depth-strip-scroll {
  display: flex; gap: 20px;
  animation: strip-drift 32s linear infinite;
}
@keyframes strip-drift {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
