/* OPaaS control plane — dashboard styles.
   Self-authored, no external fonts or CDN. System sans for UI, system mono for
   identifiers (SHAs, db names, job/UUIDs) — the vernacular of the subject.
   Theming: prefers-color-scheme by default, overridable via :root[data-theme]. */

:root {
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e5e8ee;
  --border-strong: #d5dae2;
  --text: #171a21;
  --text-muted: #5a6472;
  --text-faint: #8a93a2;
  --accent: #5457d6;
  --accent-text: #4144c2;
  --accent-weak: rgba(84, 87, 214, 0.10);
  --shadow: 0 1px 2px rgba(16, 20, 30, 0.05), 0 1px 3px rgba(16, 20, 30, 0.04);
  --shadow-pop: 0 8px 30px rgba(16, 20, 30, 0.14);
  --radius: 10px;
  --radius-sm: 7px;

  /* status tones (light) */
  --good-fg: #067647; --good-bg: #e6f6ec; --good-ring: #a9e4c2;
  --warn-fg: #9a5b00; --warn-bg: #fbf1de; --warn-ring: #eecd93;
  --bad-fg:  #c0322b; --bad-bg:  #fceceb; --bad-ring:  #f0b4b0;
  --info-fg: #2a5fd6; --info-bg: #e8effd; --info-ring: #b6cdf6;
  --neut-fg: #5a6472; --neut-bg: #eceff3; --neut-ring: #d6dbe3;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0e12;
    --surface: #14171d;
    --surface-2: #1b1f27;
    --border: #262b34;
    --border-strong: #333a46;
    --text: #e7eaf0;
    --text-muted: #9aa4b3;
    --text-faint: #69727f;
    --accent: #7d80f2;
    --accent-text: #a8abff;
    --accent-weak: rgba(125, 128, 242, 0.15);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-pop: 0 12px 34px rgba(0, 0, 0, 0.55);
    --good-fg: #52dd9a; --good-bg: rgba(30, 110, 68, 0.20); --good-ring: rgba(82, 221, 154, 0.28);
    --warn-fg: #f0b761; --warn-bg: rgba(140, 95, 20, 0.20); --warn-ring: rgba(240, 183, 97, 0.28);
    --bad-fg:  #f2938c; --bad-bg:  rgba(150, 52, 46, 0.22); --bad-ring:  rgba(242, 147, 140, 0.30);
    --info-fg: #8ba9f6; --info-bg: rgba(42, 82, 180, 0.24); --info-ring: rgba(139, 169, 246, 0.30);
    --neut-fg: #9aa4b3; --neut-bg: rgba(120, 132, 150, 0.16); --neut-ring: rgba(154, 164, 179, 0.24);
  }
}

:root[data-theme="dark"] {
  --bg: #0c0e12;
  --surface: #14171d;
  --surface-2: #1b1f27;
  --border: #262b34;
  --border-strong: #333a46;
  --text: #e7eaf0;
  --text-muted: #9aa4b3;
  --text-faint: #69727f;
  --accent: #7d80f2;
  --accent-text: #a8abff;
  --accent-weak: rgba(125, 128, 242, 0.15);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-pop: 0 12px 34px rgba(0, 0, 0, 0.55);
  --good-fg: #52dd9a; --good-bg: rgba(30, 110, 68, 0.20); --good-ring: rgba(82, 221, 154, 0.28);
  --warn-fg: #f0b761; --warn-bg: rgba(140, 95, 20, 0.20); --warn-ring: rgba(240, 183, 97, 0.28);
  --bad-fg:  #f2938c; --bad-bg:  rgba(150, 52, 46, 0.22); --bad-ring:  rgba(242, 147, 140, 0.30);
  --info-fg: #8ba9f6; --info-bg: rgba(42, 82, 180, 0.24); --info-ring: rgba(139, 169, 246, 0.30);
  --neut-fg: #9aa4b3; --neut-bg: rgba(120, 132, 150, 0.16); --neut-ring: rgba(154, 164, 179, 0.24);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }
.is-booting .app { visibility: hidden; }

a { color: inherit; text-decoration: none; }

.mono { font-family: var(--mono); font-variant-ligatures: none; }

/* ---------- authentication ---------- */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 20% 15%, var(--accent-weak), transparent 34%),
    var(--bg);
}
.login-card {
  width: min(430px, 100%);
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 3px);
  box-shadow: var(--shadow-pop);
}
.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}
.login-brand > span:last-child { display: flex; flex-direction: column; line-height: 1.15; }
.login-brand b { font-size: 17px; }
.login-brand em {
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.login-copy { margin: 32px 0 22px; }
.login-copy h1 { margin: 0; font-size: 25px; letter-spacing: -.025em; }
.login-copy > p:last-child { margin: 9px 0 0; color: var(--text-muted); }
.login-sso, .login-local { width: 100%; justify-content: center; height: 38px; }
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 18px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.login-divider::before, .login-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--border);
}
.login-break-glass .field + .field { margin-top: 12px; }
.login-local { margin-top: 18px; }
.login-error {
  margin: 16px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--bad-ring);
  border-radius: var(--radius-sm);
  background: var(--bad-bg);
  color: var(--bad-fg);
  font-size: 12.5px;
}

/* ---------- app shell ---------- */
.app {
  display: grid;
  grid-template-columns: 244px 1fr;
  min-height: 100vh;
}

/* ---------- sidebar ---------- */
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 14px 14px;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 8px 16px;
}
.brand__glyph svg rect { fill: var(--accent); }
.brand__glyph svg path { stroke: #fff; }
.brand__word { display: flex; flex-direction: column; line-height: 1.15; }
.brand__word b { font-size: 16px; letter-spacing: -0.01em; }
.brand__word em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.nav { flex: 1; overflow-y: auto; }
.nav__group { margin-bottom: 16px; }
.nav__label {
  margin: 0 0 6px;
  padding: 0 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  transition: background .12s ease, color .12s ease;
}
.nav__item:hover { background: var(--surface-2); color: var(--text); }
.nav__item.active {
  background: var(--accent-weak);
  color: var(--accent-text);
}
.nav__item .ico {
  width: 18px; height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .95;
}

.sidebar__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 10px 4px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
}
.sidebar__foot .mono { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--neut-fg); flex: none; }
.dot.ok { background: var(--good-fg); }
.dot.off { background: var(--bad-fg); }

/* ---------- main / topbar ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 22px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar__spacer { flex: 1; }

.identity {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.identity__k {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.identity__user {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--text);
  max-width: 40vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.identity__user.unset { color: var(--warn-fg); }
.identity__roles { display: flex; gap: 5px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s ease, border-color .12s ease, transform .05s ease;
}
.btn svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--sm { height: 27px; padding: 0 9px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.iconbtn:hover { background: var(--surface-2); color: var(--text); }
.iconbtn svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.theme-ico-moon { display: none; }
:root[data-theme="dark"] .theme-ico-sun { display: none; }
:root[data-theme="dark"] .theme-ico-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-ico-sun { display: none; }
  :root:not([data-theme="light"]) .theme-ico-moon { display: block; }
}
.only-mobile { display: none; }

/* ---------- identity panel ---------- */
.identity-panel {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 16px 22px 18px;
  animation: slideDown .16s ease;
}
.identity-panel__title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 13px;
  font-size: 12px;
}
.identity-panel__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field--wide { grid-column: span 4; }
.field__label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.field__label em { font-style: normal; color: var(--warn-fg); text-transform: none; letter-spacing: 0; }
input, select, textarea {
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
textarea { height: auto; padding: 8px 10px; resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}
select { appearance: none; cursor: pointer; }
.identity-panel__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}
.identity-panel__hint { color: var(--text-faint); font-size: 11px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity-panel__btns { display: flex; gap: 8px; flex: none; }

/* ---------- content ---------- */
.content {
  padding: 26px 26px 60px;
  max-width: 1180px;
  width: 100%;
  outline: none;
  animation: fadeUp .2s ease;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin: 0 0 6px;
}
.page-head h1 { margin: 0; font-size: 23px; letter-spacing: -0.02em; font-weight: 650; }
.page-head p.sub { margin: 5px 0 0; color: var(--text-muted); font-size: 13.5px; }
.page-head__actions { display: flex; gap: 8px; flex: none; }

.crumbs { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-muted); margin-bottom: 14px; }
.crumbs a { color: var(--accent-text); }
.crumbs a:hover { text-decoration: underline; }
.crumbs span.sep { color: var(--text-faint); }

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.card__head h2 { margin: 0; font-size: 14px; font-weight: 600; }
.card__body { padding: 16px; }
.card + .card { margin-top: 18px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 16px 16px 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.stat::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--rail, var(--neut-fg));
}
.stat__k {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.stat__v {
  font-size: 27px;
  font-weight: 640;
  letter-spacing: -0.02em;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.stat__sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* ---------- pills + rails ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: var(--pill-fg, var(--neut-fg));
  background: var(--pill-bg, var(--neut-bg));
  box-shadow: inset 0 0 0 1px var(--pill-ring, var(--neut-ring));
}
.pill::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.pill--plain::before { display: none; }

.tone-good { --pill-fg: var(--good-fg); --pill-bg: var(--good-bg); --pill-ring: var(--good-ring); }
.tone-warn { --pill-fg: var(--warn-fg); --pill-bg: var(--warn-bg); --pill-ring: var(--warn-ring); }
.tone-bad  { --pill-fg: var(--bad-fg);  --pill-bg: var(--bad-bg);  --pill-ring: var(--bad-ring); }
.tone-info { --pill-fg: var(--info-fg); --pill-bg: var(--info-bg); --pill-ring: var(--info-ring); }
.tone-neut { --pill-fg: var(--neut-fg); --pill-bg: var(--neut-bg); --pill-ring: var(--neut-ring); }

/* ---------- tables ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
table.grid thead th {
  position: sticky; top: 0;
  text-align: left;
  padding: 10px 14px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.grid tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.grid tbody tr:last-child td { border-bottom: none; }
table.grid tbody tr.row-link { cursor: pointer; }
table.grid tbody tr.row-link:hover { background: var(--surface-2); }
table.grid tbody tr[data-rail] { box-shadow: inset 3px 0 0 var(--rail, transparent); }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.nowrap { white-space: nowrap; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
code, .code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--text);
}
.code--bare { background: none; border: none; padding: 0; }

/* ---------- branch pipeline (signature) ---------- */
.pipeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.stage-col { display: flex; flex-direction: column; gap: 10px; }
.stage-col__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2px 2px;
}
.stage-col__title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 8px;
}
.stage-col__title::before {
  content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--rail, var(--neut-fg));
}
.stage-col__count { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }
.branch-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 13px 12px 15px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.branch-card::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--rail, var(--neut-fg));
}
.branch-card__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.branch-card__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.branch-card__meta { display: flex; align-items: center; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.branch-card__meta .mono { font-size: 11.5px; color: var(--text-muted); }
.stage-col--empty {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  color: var(--text-faint);
  font-size: 12.5px;
}

.rail-prod  { --rail: var(--bad-fg); }
.rail-stag  { --rail: var(--warn-fg); }
.rail-dev   { --rail: var(--info-fg); }
.rail-good  { --rail: var(--good-fg); }
.rail-neut  { --rail: var(--neut-fg); }

/* ---------- misc layout helpers ---------- */
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--text-faint); font-family: var(--mono); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; align-self: center; }
.kv dd { margin: 0; }

.filters { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filters .field { min-width: 150px; }
.pager { display: flex; align-items: center; gap: 10px; justify-content: flex-end; margin-top: 14px; font-size: 13px; color: var(--text-muted); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .field--wide { grid-column: span 2; }
.form-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ---------- states ---------- */
.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 54px 24px;
  color: var(--text-muted);
}
.state svg { width: 34px; height: 34px; stroke: var(--text-faint); fill: none; stroke-width: 1.4; }
.state h3 { margin: 4px 0 0; font-size: 15px; color: var(--text); font-weight: 600; }
.state p { margin: 0; max-width: 420px; font-size: 13px; }
.state--error svg { stroke: var(--bad-fg); }
.state--error h3 { color: var(--bad-fg); }
.state--auth svg { stroke: var(--warn-fg); }

.skeleton { display: flex; flex-direction: column; gap: 10px; padding: 4px; }
.skel-row { height: 42px; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--surface-2) 0%, var(--border) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }

.banner {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 18px;
  border: 1px solid var(--warn-ring);
  background: var(--warn-bg);
  color: var(--warn-fg);
}
.banner button { margin-left: auto; }

/* ---------- toasts ---------- */
.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, 90vw);
}
.toast {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-pop);
  animation: toastIn .18s ease;
}
.toast__bar { width: 3px; align-self: stretch; border-radius: 3px; background: var(--neut-fg); flex: none; }
.toast--ok .toast__bar { background: var(--good-fg); }
.toast--err .toast__bar { background: var(--bad-fg); }
.toast__body { min-width: 0; }
.toast__title { font-weight: 600; font-size: 13px; }
.toast__msg { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; word-break: break-word; }
.toast__x { margin-left: auto; cursor: pointer; color: var(--text-faint); background: none; border: none; font-size: 16px; line-height: 1; }

/* ---------- animations ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    width: 244px;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: var(--shadow-pop);
  }
  .sidebar.open { transform: none; }
  .only-mobile { display: inline-flex; }
  .identity-panel__grid { grid-template-columns: 1fr 1fr; }
  .field--wide { grid-column: span 2; }
  .two-col { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .field--wide { grid-column: span 1; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
}
@media (max-width: 560px) {
  .content { padding: 18px 14px 50px; }
  .topbar { padding: 0 12px; }
  .identity__k { display: none; }
  .identity-panel__grid { grid-template-columns: 1fr; }
  .field--wide { grid-column: span 1; }
}
