:root {
  --bg: #f4f6f8; --card: #fff; --text: #1c2733; --muted: #66788a;
  --line: #dde4ea; --accent: #21707e; --accent-soft: #e2f0f2;
  --ok: #2e7d46; --warn: #b26a00; --err: #b3372e;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

nav { background: #123b44; padding: 0 20px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
nav .brand { color: #fff; font-weight: 700; padding: 12px 14px 12px 0; font-size: 16px; }
nav a.item { color: #cfe3e7; padding: 12px 11px; display: inline-block; }
nav a.item:hover { color: #fff; text-decoration: none; }
nav a.item.active { color: #fff; box-shadow: inset 0 -3px 0 #6cc4d4; }
nav .spacer { flex: 1; }
nav a.exit { color: #9db8be; padding: 12px 0; font-size: 13px; }

main { max-width: 1200px; margin: 24px auto; padding: 0 20px; }
h1 { font-size: 22px; margin: 0 0 18px; }
h2 { font-size: 17px; margin: 26px 0 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin-bottom: 18px; }
.grid { display: grid; gap: 14px; }
.grid.cols4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.stat .num { font-size: 26px; font-weight: 700; }
.stat .lbl { color: var(--muted); font-size: 13px; }

table { border-collapse: collapse; width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #eef2f5; font-size: 13px; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; white-space: nowrap; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12.5px; white-space: nowrap; background: #e6e9ec; }
.b-pending { background: #e8eaf6; color: #3a4a9f; }
.b-fetching { background: #fff3d6; color: #8a6100; }
.b-fetched, .b-done, .b-active, .b-ok { background: #ddf0e2; color: var(--ok); }
.b-no_subs { background: #f0f0f0; color: #666; }
.b-failed, .b-error, .b-rejected { background: #fbe2e0; color: var(--err); }
.b-queued { background: #e8eaf6; color: #3a4a9f; }
.b-running { background: #fff3d6; color: #8a6100; }
.b-paused, .b-proposed, .b-warn { background: #fdeeda; color: var(--warn); }
.b-merged_into { background: #ece4f5; color: #6a4a9f; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.flash.ok { background: #ddf0e2; color: var(--ok); }
.flash.err { background: #fbe2e0; color: var(--err); }

form.inline { display: inline; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 3px; }
input[type=text], input[type=password], input[type=number], input[type=url], select, textarea {
  width: 100%; max-width: 560px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px;
  font: inherit; background: #fff;
}
textarea { min-height: 70px; }
button, .btn {
  background: var(--accent); border: none; color: #fff; padding: 8px 16px; border-radius: 7px;
  font: inherit; cursor: pointer; display: inline-block;
}
button:hover, .btn:hover { filter: brightness(1.1); text-decoration: none; }
button.small, .btn.small { padding: 3px 10px; font-size: 13px; }
button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
button.danger { background: var(--err); }

.progress { background: #e8ecef; border-radius: 8px; height: 14px; overflow: hidden; max-width: 420px; }
.progress > div { background: var(--accent); height: 100%; }
.muted { color: var(--muted); font-size: 13px; }
pre.asset { background: #10222a; color: #d8e6ea; padding: 16px; border-radius: 10px; overflow-x: auto;
  white-space: pre-wrap; max-height: 640px; overflow-y: auto; font-size: 13px; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs a { padding: 6px 14px; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.tabs a.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.tabs a.stub { color: var(--muted); }
.pager { margin: 14px 0; display: flex; gap: 8px; align-items: center; }
.filters { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-bottom: 14px; }
.filters label { margin: 0 0 3px; }
.filters input, .filters select { width: auto; }
.login-box { max-width: 360px; margin: 90px auto; }
.kv td:first-child { color: var(--muted); width: 220px; }
