/* TECTIC ML console. System fonts, no external assets; light and dark follow the OS. */
:root {
  --bg: #f5f6f8; --surface: #ffffff; --sunken: #f0f2f5; --border: #e3e6eb; --border-strong: #cfd4dc;
  --text: #121826; --muted: #5d6676; --faint: #8a93a3;
  --accent: #3b5bdb; --accent-soft: #e8edff; --accent-text: #2f4ac0;
  --ok: #138a52; --ok-soft: #e3f5ec; --warn: #b25e09; --warn-soft: #fdf1e2; --bad: #c4321f; --bad-soft: #fdeae7;
  --info: #5b6b86; --info-soft: #eef1f6;
  --c1: #3b5bdb; --c2: #e8590c; --c3: #0ca678; --c4: #ae3ec9;
  --radius: 10px; --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1016; --surface: #151922; --sunken: #10131a; --border: #252b38; --border-strong: #343c4d;
    --text: #e8ebf1; --muted: #9aa3b4; --faint: #6c7588;
    --accent: #6d8cff; --accent-soft: #1c2546; --accent-text: #9db1ff;
    --ok: #3ccf8e; --ok-soft: #12291f; --warn: #f0a44b; --warn-soft: #2e2213; --bad: #ff7a66; --bad-soft: #321713;
    --info: #9aa8c2; --info-soft: #1b2130;
    --c1: #6d8cff; --c2: #ff9147; --c3: #3ccf8e; --c4: #d17ce6;
    --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
h1 { font-size: 22px; font-weight: 650; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 620; margin: 0; }
h3 { font-size: 13px; font-weight: 600; margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; }
.right { text-align: right; } .nowrap { white-space: nowrap; }

/* shell */
.shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; padding: 18px 12px; border-right: 1px solid var(--border);
  background: var(--surface); display: flex; flex-direction: column; gap: 4px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 650; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; color: #fff; font-size: 13px; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--muted); font-weight: 520;
}
.nav a:hover { background: var(--sunken); color: var(--text); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--accent-text); }
.nav svg { width: 17px; height: 17px; flex: none; }
.nav .count { margin-left: auto; font-size: 11.5px; background: var(--ok-soft); color: var(--ok); padding: 0 7px; border-radius: 999px; }
.side-foot { margin-top: auto; padding: 10px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--border); }
.side-foot form { display: inline; }
.main { padding: 26px 32px 60px; max-width: 1360px; width: 100%; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.head p { margin: 4px 0 0; color: var(--muted); }

/* blocks */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s5 { grid-column: span 5; } .s6 { grid-column: span 6; }
.s7 { grid-column: span 7; } .s8 { grid-column: span 8; } .s12 { grid-column: span 12; }
@media (max-width: 1100px) { .s3, .s4 { grid-column: span 6; } .s5, .s6, .s7, .s8 { grid-column: span 12; } }
@media (max-width: 720px) {
  .shell { grid-template-columns: 1fr; } .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; }
  .brand { padding-bottom: 6px; } .side-foot { display: none; } .main { padding: 18px 16px 40px; }
  .s3, .s4 { grid-column: span 12; }
}
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head .muted { font-size: 12.5px; }
.card.flush { padding: 0; } .card.flush .card-head { padding: 16px 20px 0; }
.kpi { font-size: 26px; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; }
.kpi small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 10px; }
.sep { height: 1px; background: var(--border); margin: 14px 0; }

/* status */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--info-soft); color: var(--info); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok, .st-running, .st-done, .v-accepted { background: var(--ok-soft); color: var(--ok); }
.pill.warn, .st-stopping, .st-paused, .st-queued, .v-candidate { background: var(--warn-soft); color: var(--warn); }
.pill.bad, .st-failed, .v-rejected { background: var(--bad-soft); color: var(--bad); }
.st-running::before { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .st-running::before { animation: none; } }
.tag { display: inline-block; padding: 1px 7px; border-radius: 6px; background: var(--sunken); border: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.tag.accent { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.bar { height: 6px; border-radius: 6px; background: var(--sunken); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.bar.big { height: 9px; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--sunken); }
.card.flush table th:first-child, .card.flush table td:first-child { padding-left: 20px; }
.card.flush table th:last-child, .card.flush table td:last-child { padding-right: 20px; }

/* forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 13px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 560; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--sunken); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); }
.btn.sm { height: 27px; padding: 0 9px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 6px 9px; min-height: 32px; width: 100%;
}
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--accent); }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px; }
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
label.check { display: flex; align-items: center; gap: 7px; font-weight: 500; color: var(--text); font-size: 13px; margin: 0; }
.fields { display: grid; gap: 12px 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.field .hint { font-size: 11.5px; color: var(--faint); margin-top: 3px; }
.inline-form { display: inline; }
fieldset { border: 0; padding: 0; margin: 0; }
details > summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; }
details[open] > summary { margin-bottom: 12px; }

/* notices */
.msgs { margin-bottom: 16px; display: grid; gap: 8px; }
.msg { padding: 10px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); }
.msg.success { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.msg.error { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.msg.info, .msg.warning { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.callout { padding: 10px 14px; border-radius: 8px; background: var(--sunken); border: 1px solid var(--border); font-size: 13px; }
.callout.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.callout.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
pre.log { background: var(--sunken); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin: 0;
  max-height: 340px; overflow: auto; white-space: pre-wrap; word-break: break-word; }

/* run page */
.chart { position: relative; height: 240px; }
.chart.short { height: 150px; }
.frame { width: 100%; border-radius: 8px; border: 1px solid var(--border); background: var(--sunken); display: block; }
.shots { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.shots figure { margin: 0; } .shots figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }
.mixsum { font-weight: 650; } .mixsum.bad { color: var(--bad); } .mixsum.ok { color: var(--ok); }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: 100%; max-width: 360px; padding: 26px; }
