/* Developer Portal admin console.
   Design language: "signed & shipped" — a calm slate/paper control plane where
   every artifact wears its provenance. Versions, keys, and checksums are always
   monospace; channels are color-coded (petrol = stable, amber = beta). */

:root {
  --paper: #f4f5f2;
  --panel: #ffffff;
  --ink: #182230;
  --ink-2: #4a5568;
  --muted: #8a94a3;
  --line: #dfe3da;
  --stable: #0e6e6b;      /* petrol — stable channel + primary actions */
  --stable-soft: #e2efee;
  --beta: #b7791f;        /* amber — beta channel */
  --beta-soft: #f7edd8;
  --danger: #a3333d;
  --danger-soft: #f6e3e5;
  --ok: #2f7d4f;
  --ok-soft: #e2f0e7;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(24, 34, 48, .06), 0 4px 14px rgba(24, 34, 48, .05);
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); line-height: 1.5;
}
[x-cloak] { display: none !important; }

a { color: var(--stable); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--stable); outline-offset: 2px; }

/* ---- Shell ---- */
.shell { display: grid; grid-template-columns: 218px 1fr; min-height: 100vh; }
.side {
  background: var(--ink); color: #cdd5e0; padding: 20px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.side .brand {
  color: #fff; font-weight: 700; letter-spacing: .02em; margin: 2px 8px 6px;
  font-size: 1.02rem;
}
.side .brand small { display: block; color: #7d8898; font-weight: 500; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.side a.nav {
  color: #cdd5e0; padding: 8px 10px; border-radius: 8px; font-size: .94rem;
}
.side a.nav:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.side a.nav.on { background: var(--stable); color: #fff; font-weight: 600; }
.side .foot { margin-top: auto; padding: 8px 10px; font-size: .8rem; color: #7d8898; }
.side .foot .who { color: #cdd5e0; }
.side form { margin: 0; }
.side button.linkish {
  background: none; border: 0; color: #7d8898; cursor: pointer; padding: 2px 0;
  font: inherit; font-size: .8rem;
}
.side button.linkish:hover { color: #fff; }

.main { padding: 26px 30px 60px; max-width: 1180px; width: 100%; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
h1 { font-size: 1.45rem; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 10px; }
h3 { font-size: .95rem; margin: 0 0 8px; }

/* ---- Cards & panels ---- */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 16px;
}
.card.channel-stable { border-top: 3px solid var(--stable); }
.card.channel-beta { border-top: 3px solid var(--beta); }
.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .n { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; }

/* ---- Provenance (the signature element): versions, keys, hashes ---- */
.v, code, .keyish {
  font-family: var(--mono); font-size: .86em; background: #eef0ea;
  padding: 1px 6px; border-radius: 5px; word-break: break-all;
}
.v { font-weight: 600; }
.hash { color: var(--muted); font-family: var(--mono); font-size: .76rem; }
.fingerprint {
  font-family: var(--mono); font-size: .78rem; color: var(--ink-2);
  border: 1px dashed var(--line); border-radius: 6px; padding: 2px 8px; background: #fbfcf9;
}

/* ---- Pills & badges ---- */
.pill {
  display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .76rem;
  font-weight: 600; letter-spacing: .02em; vertical-align: middle;
}
.pill.stable { background: var(--stable-soft); color: var(--stable); }
.pill.beta { background: var(--beta-soft); color: var(--beta); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--beta-soft); color: var(--beta); }
.pill.err { background: var(--danger-soft); color: var(--danger); }
.pill.dim { background: #eceee9; color: var(--ink-2); }

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th {
  text-align: left; color: var(--muted); font-size: .74rem; text-transform: uppercase;
  letter-spacing: .08em; font-weight: 600; padding: 6px 10px; border-bottom: 1px solid var(--line);
}
td { padding: 9px 10px; border-bottom: 1px solid #edefe9; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #fafbf7; }
td .sub { color: var(--muted); font-size: .8rem; }

/* ---- Forms & buttons ---- */
label { display: block; font-size: .8rem; font-weight: 600; color: var(--ink-2); margin: 10px 0 3px; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date],
select, textarea {
  width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px;
  font: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 90px; font-family: var(--mono); font-size: .85rem; }
input[type=file] { font-size: .88rem; }
.check { display: flex; gap: 7px; align-items: center; font-size: .88rem; margin: 8px 0; }
.check input { width: auto; }
.btn {
  display: inline-block; background: var(--stable); color: #fff; border: 0; cursor: pointer;
  padding: 8px 16px; border-radius: 7px; font: inherit; font-weight: 600; font-size: .9rem;
}
.btn:hover { filter: brightness(1.08); }
.btn.sm { padding: 4px 10px; font-size: .8rem; }
.btn.ghost { background: transparent; color: var(--stable); border: 1px solid var(--stable); }
.btn.warn { background: var(--beta); }
.btn.danger { background: var(--danger); }
.btn.dim { background: #dfe3da; color: var(--ink-2); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a, .tabs button {
  background: none; border: 0; cursor: pointer; font: inherit; font-size: .92rem;
  padding: 8px 14px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs .on { color: var(--stable); border-bottom-color: var(--stable); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--ink); }

/* ---- Flash, search, pagination ---- */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: .92rem; }
.flash.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid #bfdcc9; }
.flash.err { background: var(--danger-soft); color: var(--danger); border: 1px solid #e5bfc4; }
.searchbar { display: flex; gap: 8px; margin-bottom: 12px; }
.searchbar input { max-width: 320px; }
.pager { display: flex; gap: 10px; align-items: center; margin-top: 12px; font-size: .85rem; color: var(--muted); }

/* ---- Bars (tiny CSS chart) ---- */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 64px; }
.bars .bar { flex: 1; background: var(--stable-soft); border-radius: 3px 3px 0 0; position: relative; min-width: 8px; }
.bars .bar > i { display: block; background: var(--stable); border-radius: 3px 3px 0 0; width: 100%; position: absolute; bottom: 0; }
.bars .bar:hover::after {
  content: attr(data-tip); position: absolute; bottom: 105%; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: .7rem; padding: 2px 7px; border-radius: 5px; white-space: nowrap;
}

/* ---- Adoption meter ---- */
.meter { height: 8px; border-radius: 99px; background: #e7eae2; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--stable); border-radius: 99px; }

/* ---- Login ---- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--ink); }
.login-card { width: min(380px, 92vw); background: var(--panel); border-radius: 14px; padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.login-card .brand { font-weight: 700; font-size: 1.15rem; }
.login-card .brand small { display: block; color: var(--muted); font-weight: 500; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }

details.raw { margin-top: 8px; }
details.raw summary { cursor: pointer; color: var(--muted); font-size: .8rem; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .side .foot { margin: 0 0 0 auto; }
  .main { padding: 18px 14px 40px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---- System / version screen ---- */
.kv th { text-transform: none; letter-spacing: 0; font-size: .82rem; width: 45%; color: var(--ink-2); }
.kv td { font-size: .92rem; }
.muted { color: var(--muted); }
.note {
  background: #f7f8f4; border-left: 3px solid var(--line); border-radius: 0 7px 7px 0;
  padding: 8px 12px; margin: 10px 0; color: var(--ink-2); font-size: .88rem; line-height: 1.5;
}
.note.small { font-size: .8rem; padding: 5px 9px; margin: 5px 0 0; }
.steps { margin: 8px 0 8px 18px; padding: 0; color: var(--ink-2); font-size: .92rem; line-height: 1.7; }
.steps li { margin: 2px 0; }
