/* Conductor fleet dashboard — minimal, no framework. */
:root {
  color-scheme: light dark;
  --bg: #f6f6f4;
  --card: #ffffff;
  --ink: #1c1c1a;
  --muted: #6b6b64;
  --line: #dcdcd6;
  --up: #2e7d32;
  --down: #b3261e;
  --warn: #b26a00;
  --foreign: #8a5a00;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

header {
  padding: 1.25rem 1.5rem 0.5rem;
}

h1 {
  font-size: 1.35rem;
  margin: 0;
}

main {
  padding: 0 1.5rem 2rem;
  max-width: 76rem;
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  padding: 0.05em 0.3em;
  border-radius: 4px;
}

#token-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem;
  margin-top: 1rem;
}

#token-panel p {
  margin: 0 0 0.75rem;
  color: var(--muted);
}

form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

label {
  font-weight: 600;
}

input[type="password"] {
  flex: 1;
  min-width: 14rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  background: var(--bg);
  color: var(--ink);
}

button {
  padding: 0.45rem 1rem;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-weight: 600;
  background: var(--ink);
  color: var(--bg);
  cursor: pointer;
}

.error {
  color: var(--down);
  font-weight: 600;
  margin: 0.75rem 0 0;
  width: 100%;
}

.projects {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.project {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.9rem 1rem;
}

.dot {
  flex: 0 0 auto;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  margin-top: 0.4rem;
}

.dot-ok {
  background: var(--up);
}

.dot-stopped,
.dot-unreachable,
.dot-other-project {
  background: var(--down);
}

.body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.name {
  font-weight: 700;
}

.repo {
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85rem;
}

.state {
  font-size: 0.9rem;
}

.state-ok {
  color: var(--up);
}

.state-stopped,
.state-unreachable,
.state-other-project {
  color: var(--down);
  font-weight: 600;
}

/* Monitoring surface (#294) */
.is-clickable {
  cursor: pointer;
}

.is-clickable:hover {
  border-color: var(--muted);
}

.back {
  font-size: 0.9rem;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.state-degraded {
  color: var(--down);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.state-muted,
.state-red {
  color: var(--down);
}

.state-green {
  color: var(--up);
}

.meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.base {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.summary {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0.25rem 0 1rem;
}

.holds {
  margin: 0.25rem 0 0;
  padding-left: 1.25rem;
  color: var(--warn);
  font-size: 0.85rem;
}

.tabs {
  display: flex;
  gap: 0.4rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.tabs button {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.tabs button.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.lanes {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  align-items: flex-start;
}

.lane {
  flex: 0 0 13rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem;
}

.lane-title {
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  cursor: pointer;
}

.card:hover {
  border-color: var(--muted);
}

.card-state {
  font-size: 0.78rem;
  color: var(--muted);
}

.empty {
  color: var(--muted);
  font-size: 0.85rem;
}

table.ledger,
table.runs {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

table.ledger th,
table.ledger td,
table.runs th,
table.runs td {
  border-bottom: 1px solid var(--line);
  padding: 0.4rem 0.6rem;
  text-align: left;
  vertical-align: top;
}

.mono {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.82rem;
}

ul.reports,
#run-attempts .empty {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  color: var(--ink);
}

ul.reports li {
  padding: 0.15rem 0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17171a;
    --card: #202024;
    --ink: #ececea;
    --muted: #9b9b93;
    --line: #33333a;
    --up: #7fc97f;
    --down: #ff8a80;
  }
}

/* The control surface (#295). Destructive actions are visually distinct because
   the confirm dialog is the second line of defence, not the first. */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.75rem 0;
}

.controls button {
  background: #1b1f27;
  color: #d7dae0;
  border: 1px solid #2f3542;
  border-radius: 4px;
  padding: 0.35rem 0.7rem;
  font: inherit;
  cursor: pointer;
}

.controls button:hover {
  border-color: #4a5568;
}

.controls button.destructive {
  border-color: #6b2f2f;
  color: #e8b4b4;
}

.controls button.destructive:hover {
  background: #2a1b1b;
}

.controls #control-result,
.controls > p.state {
  flex-basis: 100%;
  margin: 0.25rem 0 0;
}

/* Live transcript (#296). Fixed height with its own scroll so a long run does
   not push the run controls off the page. */
.transcript-head {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin: 0.75rem 0 0.25rem;
}

.transcript-head label {
  font-size: 0.85rem;
  color: #9aa0aa;
}

.transcript {
  max-height: 26rem;
  overflow-y: auto;
  margin: 0;
  padding: 0.6rem 0.75rem;
  background: #0f1115;
  border: 1px solid #2f3542;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Analytics (#297). Hand-rolled SVG, per the epic's no-dependency constraint. */
.chart {
  margin: 1rem 0;
}

.chart h4 {
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #c8ccd4;
}

.chart .bars {
  width: 100%;
  max-width: 40rem;
  height: auto;
}

.chart .bar {
  fill: #3d6ea8;
}

.chart .bar-label,
.chart .bar-value {
  fill: #9aa0aa;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.stat {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.2rem 0;
  border-bottom: 1px solid #1e222a;
  font-size: 0.85rem;
}

.stat-label {
  color: #9aa0aa;
}

.stat-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #d7dae0;
}
