/* Pipelines: a signal-board read on the gawk panel. Warm instrument paper,
   a spruce rail for the live counts, and status carried by colour alone. */

:root,
[data-theme="light"] {
  color-scheme: light;
  --ink: #191510;
  --mute: #6f6455;
  --paper: #efe7d7;
  --card: #fbf7ee;
  --field: #1e3d31;
  --on-field: #f2eada;
  --line: #d8ccb6;
  --chip: #e4d9c4;
  --header: #1e3d31;
  --header-mute: #c4d3c7;
  --header-sep: #46695a;
  --danger: #8f2e22;
  --danger-bg: #f7e9e3;
  --danger-line: #d9b6ad;
  --warn-bg: #efd9a8;
  --warn-line: #d8b969;
  --warn-ink: #6a5218;
  --signal-running: #b97612;
  --signal-queued: #3e5b74;
  --signal-failed: #8f2e22;
  --signal-success: #2f5a44;
}

[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f2ead9;
  --mute: #b3a894;
  --paper: #14110c;
  --card: #1d1913;
  --field: #3c6a56;
  --on-field: #f2ead9;
  --line: #3a3227;
  --chip: #2a241b;
  --header: #1a3329;
  --header-mute: #a9c0b0;
  --header-sep: #44604f;
  --danger: #e39a8f;
  --danger-bg: #2a1c18;
  --danger-line: #5a3832;
  --warn-bg: #3d3220;
  --warn-line: #7a6230;
  --warn-ink: #e6c88a;
  --signal-running: #d69a38;
  --signal-queued: #6f93b0;
  --signal-failed: #d97d70;
  --signal-success: #5c9b76;
}

html,
body {
  font-family: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  letter-spacing: 0.005em;
}

h1 {
  font-size: 1.7rem;
  font-weight: 650;
  letter-spacing: -0.012em;
  margin: 0.2rem 0 0.4rem;
}
h2 {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  color: var(--mute);
  margin: 1.6rem 0 0.7rem;
}

/* Machine data reads as an instrument: monospace, tabular, aligned. */
.mono,
th.num,
td.num,
.stat-v {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* The one bold element: a dark signal rail carrying the live counts. */
.stats {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0;
  margin: 0.6rem 0 1.6rem;
  border: 1px solid var(--header);
  border-radius: 3px;
  overflow: hidden;
  background: var(--header);
}
.stat {
  padding: 0.9rem 1.1rem 1rem;
  border-right: 1px solid var(--header-sep);
}
.stat:last-child {
  border-right: 0;
}
.stat-k {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--header-mute);
}
.stat-v {
  font-size: 2.3rem;
  font-weight: 600;
  line-height: 1.05;
  color: var(--on-field);
}

/* Tables: hairline rules, calm rows, links that look like links. */
table {
  border-radius: 3px;
}
th {
  font-weight: 600;
  font-size: 0.76rem;
  color: var(--mute);
}
tbody tr {
  transition: background-color 120ms ease;
}
tbody tr:hover {
  background: color-mix(in srgb, var(--field) 6%, transparent);
}
td a {
  color: var(--field);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--field) 35%, transparent);
}
td a:hover {
  border-bottom-color: var(--field);
}

/* Status pills use functional colour only. */
.badge {
  font-weight: 600;
  font-size: 0.74rem;
  padding: 0.08rem 0.55rem;
  border-radius: 999px;
  color: var(--ink);
  background: var(--chip);
}
.badge-running,
.badge-preparing {
  background: var(--signal-running);
  color: #16120c;
}
.badge-pending,
.badge-created,
.badge-waiting-for-resource,
.badge-scheduled,
.badge-manual {
  background: var(--signal-queued);
  color: #f2eada;
}
.badge-failed,
.badge-canceled {
  background: var(--signal-failed);
  color: #fdf6f2;
}
.badge-success {
  background: var(--signal-success);
  color: #f2eada;
}
.badge-skipped {
  background: var(--chip);
  color: var(--mute);
}

/* Live connection dot in the shell header. */
.live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--header-mute);
}
.live-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--header-mute);
}
.live-open .live-dot {
  background: #7cd39a;
  box-shadow: 0 0 0 3px rgba(124, 211, 154, 0.22);
}
.live-connecting .live-dot {
  background: var(--signal-running);
}

@media (max-width: 720px) {
  .stats {
    grid-auto-flow: row;
    grid-auto-columns: auto;
  }
  .stat {
    border-right: 0;
    border-bottom: 1px solid var(--header-sep);
  }
  .stat:last-child {
    border-bottom: 0;
  }
}
