:root {
  --ok: #1a7f37; --ok-bg: #dafbe1; --warn: #9a6700; --warn-bg: #fff8c5; --bad: #cf222e; --bad-bg: #ffebe9;
  --info: #0969da; --info-bg: #ddf4ff; --muted: #656d76; --mute-bg: #eaeef2; --line: #d8dee4; --bg: #f6f8fa;
  --ink: #1f2328; --head: #24292f; --uat: #bc4c00; --dev: #0969da;
}
* { box-sizing: border-box; }
body { margin: 0; font: 13px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: #fff; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 17px; margin: 2px 0 8px; }
h2 { font-size: 14px; margin: 14px 0 6px; }
p { margin: 4px 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; word-break: break-all; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); }

/* header and environment tabs */
header.top { display: flex; gap: 18px; align-items: center; padding: 0 16px; height: 38px; background: var(--head); color: #fff; }
header.top a { color: #d0d7de; }
header.top a:hover, header.top a.active { color: #fff; text-decoration: none; }
.brand { font-weight: 600; color: #fff !important; }
.envs { display: flex; gap: 14px; height: 100%; }
.envs a { display: flex; align-items: center; border-bottom: 2px solid transparent; }
.envs a.active { border-bottom-color: #fff; }
.who { margin-left: auto; display: flex; gap: 10px; align-items: center; font-size: 12px; }
.who form { margin: 0; }
.role { background: #424a53; border-radius: 10px; padding: 1px 8px; }
.subnav { display: flex; gap: 2px; align-items: center; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--bg); }
.subnav a { padding: 8px 12px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a:hover { color: var(--ink); text-decoration: none; }
.subnav a.active { color: var(--ink); font-weight: 600; border-bottom-color: #fd8c73; }
.subnav .env-badge { margin-right: 10px; }
.subnav .rg { margin-left: auto; font-size: 12px; }
.env-badge { display: inline-block; font-weight: 700; font-size: 11px; letter-spacing: .04em; color: #fff; background: var(--muted);
  border-radius: 4px; padding: 2px 7px; }
.env-badge.env-uat { background: var(--uat); }
.env-badge.env-dev { background: var(--dev); }
main { padding: 12px 16px 24px; max-width: 1600px; }

/* tables */
table { border-collapse: collapse; width: 100%; margin: 6px 0; }
th, td { border-bottom: 1px solid var(--line); padding: 4px 8px; text-align: left; vertical-align: middle; }
th { background: var(--bg); font-weight: 600; font-size: 12px; color: var(--muted); position: sticky; top: 0; }
tbody tr:hover { background: #f8fafc; }
tr.nochange td { color: var(--muted); }
td.num { white-space: nowrap; }
td.arrow { color: var(--muted); width: 1%; padding: 0 2px; }
.tagname { font-weight: 600; color: var(--ink); }
.sub { display: block; font-family: system-ui, sans-serif; font-size: 11px; color: var(--muted); }
table.dim td { color: var(--muted); }

/* pills */
.pill { display: inline-block; font-size: 11px; font-weight: 600; line-height: 16px; padding: 0 7px; border-radius: 9px;
  background: var(--mute-bg); color: var(--muted); white-space: nowrap; }
.pill-running, .pill-runningatmaxscale, .pill-healthy, .pill-succeeded, .pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-processing, .pill-degraded, .pill-updating, .pill-waiting, .pill-warn, .pill-activating { background: var(--warn-bg); color: var(--warn); }
.pill-stopped, .pill-unhealthy, .pill-failed, .pill-interrupted, .pill-bad { background: var(--bad-bg); color: var(--bad); }
.pill-info { background: var(--info-bg); color: var(--info); }

/* summary strip, notices */
.summary { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 8px 12px; margin: 4px 0 8px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px; }
.stat b { font-size: 14px; }
.push { margin-left: auto; }
.notice { padding: 8px 12px; margin: 6px 0; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); }
.notice.warn { background: var(--warn-bg); border-color: #d4a72c; color: #4d2d00; }
.notice.bad { background: var(--bad-bg); border-color: #ff8182; color: #82071e; }

/* wizard steps */
.steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 2px 0 10px; }
.steps li { display: flex; align-items: center; gap: 6px; padding: 4px 12px 4px 6px; border-radius: 14px; background: var(--bg);
  color: var(--muted); border: 1px solid var(--line); }
.steps li span { display: inline-flex; width: 18px; height: 18px; border-radius: 50%; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; background: var(--mute-bg); }
.steps li.current { color: var(--ink); border-color: var(--info); font-weight: 600; }
.steps li.current span { background: var(--info); color: #fff; }
.steps li.done span { background: var(--ok); color: #fff; }

/* forms */
form { margin: 6px 0; }
.quick { display: flex; gap: 8px; align-items: center; margin: 4px 0 10px; }
.cols { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
fieldset { border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px 8px; margin: 0; }
legend { font-weight: 600; font-size: 12px; padding: 0 4px; }
.checks { display: grid; grid-template-columns: repeat(2, minmax(190px, auto)); gap: 2px 18px; }
.checks label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0 0; }
.order { margin: 4px 0 10px; padding-left: 22px; }
.order li { margin: 2px 0; }
.danger-zone { border: 1px solid #ff8182; border-radius: 6px; padding: 10px 12px; background: #fff8f8; }
.danger-zone .bar { margin-top: 8px; }
button, .button { display: inline-block; font: inherit; font-weight: 500; padding: 4px 12px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--ink); cursor: pointer; }
button:hover, .button:hover { background: #eef1f4; border-color: #afb8c1; text-decoration: none; }
button.primary, .button.primary { background: #1f883d; border-color: #1a7f37; color: #fff; }
button.primary:hover, .button.primary:hover { background: #1a7f37; }
button.danger { background: var(--bad); color: #fff; border-color: var(--bad); }
button.danger:hover { background: #a40e26; }
button.link { background: none; border: none; color: #d0d7de; text-decoration: underline; padding: 0; }
input[type=text], select { font: inherit; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
select { max-width: 100%; }
select.mono { font-size: 12px; }

/* home */
.cards { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.card { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; min-width: 300px; }
.card-head { display: flex; gap: 10px; align-items: center; margin-bottom: 4px; }
.card-actions { display: flex; gap: 6px; margin-top: 8px; }

/* signed-out landing */
.landing { max-width: 340px; margin: 14vh auto 0; padding: 24px 20px; text-align: center; border: 1px solid var(--line); border-radius: 8px; }
.landing h1 { font-size: 20px; }
.landing .button { margin-top: 12px; padding: 7px 16px; font-weight: 600; }

/* builds */
td.actions-cell { white-space: nowrap; text-align: right; }
td.actions-cell .button { margin-left: 4px; }
table.params { width: auto; min-width: 520px; }
table.params th { position: static; text-align: right; white-space: nowrap; width: 1%; vertical-align: top; padding-top: 6px; }
table.params input[type=text], table.params select { min-width: 260px; }
button[disabled] { opacity: .5; cursor: not-allowed; }
.notice.ok-notice { background: var(--ok-bg); border-color: #4ac26b; color: #0d3b1e; }
pre.console { background: #0d1117; color: #c9d1d9; padding: 10px 12px; border-radius: 6px; font-size: 11.5px; line-height: 1.35;
  max-height: 460px; overflow: auto; white-space: pre-wrap; word-break: break-all; }

/* Sortable status board headers */
th a.sort { color: inherit; text-decoration: none; white-space: nowrap; }
th a.sort:hover { color: var(--ink); }
th a.sort.active { color: var(--ink); }
th a.sort .arrow { margin-left: 4px; font-size: 10px; }

/* App types on the status board: colour badge, row stripe and legend */
.kind { display: inline-block; font-size: 11px; font-weight: 600; line-height: 16px; padding: 0 7px; border-radius: 4px; white-space: nowrap; }
a.kind:hover { text-decoration: none; filter: brightness(.95); }
.kind-backend { background: #ddf4ff; color: #0969da; }
.kind-ui { background: #fbefff; color: #8250df; }
.kind-infra { background: #fff1e5; color: #bc4c00; }
.kind-unmanaged { background: var(--mute-bg); color: var(--muted); }
tr.row-backend td:first-child { box-shadow: inset 3px 0 #0969da; }
tr.row-ui td:first-child { box-shadow: inset 3px 0 #8250df; }
tr.row-infra td:first-child { box-shadow: inset 3px 0 #bc4c00; }
tr.row-unmanaged td:first-child { box-shadow: inset 3px 0 var(--line); }
.legend { display: flex; gap: 6px; margin: -4px 0 10px; }

/* Release list on the deploy page */
details.release { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 10px; }
details.release summary { cursor: pointer; font-weight: 600; }
details.release textarea { width: 100%; box-sizing: border-box; font-size: 12px; padding: 6px; }
