/* s2t admin — data-terminal tokens from the dealt app sheet.
   Canvas at 1440: sidebar 224 + padding 28*2. Inner width 1160.
   KPI strip is 4 hairline cells on that inner edge; the tape fills the rest of the lead row. */
:root {
  --ground: #171719;
  --surface: #131217;
  --raised: #212023;
  --border: #222224;
  --rule: #2a292e;
  --control: #3a3a3e;
  --text: #ffffff;
  --muted: #8a8c92;
  --accent: #4a8ad6;
  --positive: #44a282;
  --negative: #e5566f;
  --warning: #d9a441;
  --chart-1: #f2f2f3;
  --chart-2: #e5566f;
  --chart-3: #4a8ad6;
  --chart-muted: #5c5c60;
  --chart-span: 0.12;
  --grid: #2a292e;
  --axis-ink: #8a8c92;
  --ink: #ffffff;
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
  --sidebar-width: 224px;
  --pad: 28px;
  --gap: 24px;
  --font: "Public Sans", system-ui, sans-serif;
}

html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

::selection { background: #2c527f; color: #fff; }

:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

* { scrollbar-color: var(--control) transparent; }

a { color: inherit; }

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--ground);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 22px 20px 18px;
  text-decoration: none;
}

.brand-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-scope {
  color: var(--muted);
  font-size: 12px;
}

.bot-switch {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 20px 14px;
}

.bot-switch label {
  color: var(--muted);
  font-size: 11px;
}

.bot-switch select {
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--ground);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 6px 8px;
}

.bot-picker-wrap { position: relative; min-width: 220px; }

.bot-switch .bot-picker-wrap { width: 100%; min-width: 0; }

.bot-picker { position: relative; }

.bot-picker-current {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 4px 8px 4px 6px;
  border: 1px solid var(--control);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  list-style: none;
}

.bot-picker-current::-webkit-details-marker { display: none; }

.bot-picker[open] > .bot-picker-current { border-color: var(--accent); }

.bot-picker-current:hover { background: var(--raised); }

.bot-picker-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  text-align: left;
}

.bot-picker-name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-picker-handle {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-picker-caret {
  width: 14px;
  height: 14px;
  flex: none;
  color: var(--muted);
}

.bot-picker-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  width: max(100%, 260px);
  max-height: 320px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.bot-picker-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.bot-picker-opt:hover { background: var(--raised); }

.bot-picker-opt.is-on {
  background: var(--raised);
  outline: 1px solid var(--accent);
}


.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px;
  overflow: auto;
}

.nav-group + .nav-group {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0 8px;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  transition: color 160ms ease-out, background-color 160ms ease-out;
}

.nav-link:hover { color: var(--text); background: var(--raised); }

.nav-link[aria-current="page"] { color: var(--text); }

.nav-link[aria-current="page"] .nav-label {
  border-bottom: 1px solid var(--accent);
}

.ico { width: 16px; height: 16px; flex: none; }

.nav-label { font-size: 14px; font-weight: 400; }

#err-badge {
  margin-left: auto;
  color: var(--negative);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

#err-badge.hidden { display: none; }

.sidebar-foot {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--rule);
}

.canvas {
  flex: 1;
  min-width: 0;
  padding: 20px var(--pad) 32px;
}

.page-title {
  margin: 0 0 16px;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.nav-toggle,
.nav-backdrop { display: none; }

@media (max-width: 800px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 30;
    margin: -20px calc(var(--pad) * -1) 12px;
    padding: 12px var(--pad);
    width: calc(100% + var(--pad) * 2);
    border: 0;
    border-bottom: 1px solid var(--border);
    background: var(--ground);
    color: var(--text);
    font: inherit;
    cursor: pointer;
  }

  .sidebar {
    position: fixed;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 180ms ease-out;
  }

  .shell.is-open .sidebar { transform: translateX(0); }

  .nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 35;
    border: 0;
    background: rgba(0, 0, 0, 0.45);
    cursor: pointer;
  }

  .shell.is-open .nav-backdrop { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar, .nav-link { transition: none; }
}

/* ---------- login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-form {
  width: min(100%, 360px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-form h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.login-form p { margin: 0; color: var(--muted); }

.field { display: flex; flex-direction: column; gap: 6px; }

.field span { color: var(--muted); font-size: 13px; }

.field input {
  width: 100%;
  box-sizing: border-box;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--control);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.field select,
.field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--control);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.field select { height: 36px; padding: 0 10px; }

.field textarea {
  min-height: 180px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.5;
}

.field input:focus,
.field select:focus,
.field textarea:focus { outline: 1px solid var(--accent); outline-offset: 1px; }

.btn {
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease-out;
}

.btn:hover { background: #f2f2f3; }
.btn:active { transform: scale(0.98); }

.btn-quiet {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 2px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
}

.btn-quiet:hover { color: var(--accent); }

.form-error {
  margin: 0;
  color: var(--negative);
  font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
  .btn:active { transform: none; }
}

/* ---------- dashboard ---------- */
.dash-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: var(--gap);
  position: relative;
  z-index: 6;
}

.dash-head h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.finding {
  margin: 6px 0 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: 14px;
}

.dash-actions { display: flex; gap: 16px; flex: none; align-items: center; }

.dash-layout {
  display: grid;
  grid-template-columns: minmax(440px, 42%) minmax(0, 1fr);
  gap: var(--gap);
  align-items: start;
}

.bot-rail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 16px;
}

.bot-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--surface);
  text-decoration: none;
  color: inherit;
}

.bot-row:hover { background: var(--raised); }

.bot-row.is-on {
  background: var(--raised);
  outline: 1px solid var(--accent);
}

.bot-face {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  overflow: hidden;
  border-radius: 50%;
  background: #2a6f97;
  color: #fff;
  font-weight: 600;
}

.bot-face img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bot-face-all {
  background: var(--raised);
  color: var(--muted);
  font-size: 11px;
}

.bot-face.bot-face-sm {
  width: 28px;
  height: 28px;
  font-size: 12px;
}

.bot-face.bot-face-sm.bot-face-all {
  font-size: 8px;
  letter-spacing: -0.04em;
}

.bot-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bot-name {
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-handle,
.bot-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-stats {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.bot-stat b {
  display: block;
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.bot-stat span {
  color: var(--muted);
  font-size: 12px;
}

.bot-meta { grid-column: 1 / -1; }

.bot-spark {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 36px;
}

.bot-spark i {
  flex: 1;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
}

.bot-spark i.is-zero { height: 2px; background: var(--rule); }

.bot-spark-note {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

.who-id {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.scope-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
}

.scope-bar label { color: var(--muted); font-size: 13px; }

.scope-bar select {
  height: 36px;
  min-width: 220px;
  padding: 0 10px;
  border: 1px solid var(--control);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.bc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.8fr);
  gap: var(--gap);
  align-items: start;
  margin-bottom: var(--gap);
}

.bc-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.bc-preview {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.bc-preview ul {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  max-height: 180px;
  overflow: auto;
}

.prompt-stack { display: flex; flex-direction: column; gap: var(--gap); }

.prompt-card { padding: 16px 18px; }

.prompt-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.prompt-role { color: var(--muted); font-size: 13px; }

.hint { margin: 0 0 12px; color: var(--muted); font-size: 13px; max-width: 68ch; }

.prompt-card h2 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
}

.tag { font-size: 12px; color: var(--muted); }
.tag.is-ok { color: var(--positive); }
.tag.is-run { color: var(--warning); }
.tag.is-bad { color: var(--negative); }

.field label { display: flex; flex-direction: column; gap: 6px; }
.field label[hidden] { display: none; }
.field label + label,
.field .bc-actions { margin-top: 12px; }

.period-picker { position: relative; z-index: 7; }

.period-picker summary {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--surface);
  list-style: none;
  cursor: pointer;
}

.period-picker summary::-webkit-details-marker { display: none; }

.period-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 8;
  display: none;
  flex-direction: column;
  gap: 2px;
  min-width: 230px;
  padding: 8px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.period-picker[open] .period-menu { display: flex; }

.period-menu a {
  padding: 8px 10px;
  border-radius: 6px;
  text-decoration: none;
}

.period-menu a:hover,
.period-menu a[aria-current="true"] { background: var(--raised); }

.period-menu form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
  padding: 8px 10px 4px;
  border-top: 1px solid var(--rule);
}

.period-menu label { color: var(--muted); font-size: 12px; }

.period-menu input[type="date"] {
  width: 100%;
  margin-top: 2px;
  padding: 4px 6px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--ground);
  color: var(--text);
  font: inherit;
}

.period-menu button {
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.bot-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bot-tabs a {
  padding: 8px 14px;
  border-radius: 999px;
  background: #27272a;
  color: #d4d4d8;
  text-decoration: none;
  font-size: 13px;
}

.bot-tabs a.is-on {
  background: var(--accent, #6366f1);
  color: #fff;
}

.bot-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.bot-card {
  display: block;
  padding: 14px 16px;
  color: inherit;
  text-decoration: none;
}

.bot-card.is-on { outline: 1px solid var(--accent); }

.bot-card .figure-value { font-size: 22px; }

.panel {
  background: var(--surface);
  border-radius: 6px;
  box-shadow: var(--shadow); /* taste-skill-ignore: dealt data-terminal card shadow, nothing else is elevated */
}

.lead {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.lead-figures {
  display: flex;
  flex-direction: column;
}

.figure {
  padding: 18px 20px 16px;
}

.figure + .figure { border-top: 1px solid var(--rule); }

.figure-label { color: var(--muted); font-size: 14px; }

.figure-value {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.figure-lead .figure-value { font-size: 32px; }

.figure-sub { margin-top: 4px; color: var(--muted); font-size: 12px; }

.figure-value.is-bad { color: var(--negative); }

.tape, .period, .table-panel, .status-panel { padding: 16px 18px 12px; }

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.panel-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.freshness { color: var(--muted); font-size: 12px; }

.chart {
  min-height: 200px;
}

.tape { --chart-1: var(--accent); }

.kpi-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--rule);
  margin: -16px -18px 12px;
}

.kpi-strip button {
  appearance: none;
  text-align: left;
  padding: 14px 18px 12px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.kpi-strip button + button { border-left: 1px solid var(--rule); }

.kpi-strip button:hover .kpi-label { color: var(--text); }

.kpi-label { color: var(--muted); font-size: 14px; }

.kpi-strip button[aria-pressed="true"] .kpi-label {
  color: var(--text);
  border-bottom: 1px solid var(--accent);
}

.kpi-value {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.lower {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
  gap: var(--gap);
  margin-top: var(--gap);
}

.rows { width: 100%; border-collapse: collapse; }

.rows th {
  padding: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  text-align: left;
}

.rows td {
  height: 42px;
  border-top: 1px solid var(--rule);
  vertical-align: middle;
}

.rows .num { text-align: right; font-variant-numeric: tabular-nums; }

.rows a { text-decoration: none; }
.rows a:hover { border-bottom: 1px solid var(--accent); }

.status-list { margin: 0; }

.status-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  align-items: center;
  border-top: 1px solid var(--rule);
}

.status-list div:first-child { border-top: 0; }

.status-list dt { color: var(--muted); }

.status-list dd { margin: 0; font-variant-numeric: tabular-nums; }

.status-list a { color: var(--negative); text-decoration: none; }
.status-list a:hover { border-bottom: 1px solid var(--accent); }

.empty {
  min-height: 120px;
  display: flex;
  align-items: center;
  color: var(--muted);
}

@media (max-width: 1240px) {
  .dash-layout { grid-template-columns: 1fr; }
  .bot-rail { position: static; }
  .bc-layout { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .lead, .lower { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .dash-head { flex-direction: column; align-items: flex-start; }
  .kpi-strip { grid-template-columns: 1fr; }
  .kpi-strip button + button { border-left: 0; border-top: 1px solid var(--rule); }
}
