:root {
  --bg: #f4f6f9; --card: #fff; --text: #1f2933; --muted: #6b7785; --line: #e3e8ee;
  --primary: #1f6feb; --primary-d: #1859c4; --ok: #1a7f37; --warn: #b7791f; --bad: #c62828; --side: #16202c;
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.err { color: var(--bad); min-height: 1.2em; }
button { font: inherit; cursor: pointer; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 6px 12px; }
button:hover { border-color: var(--primary); }
button.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
button.primary:hover { background: var(--primary-d); }
button.danger { color: var(--bad); }
button.link { border: none; background: none; color: #9fb3c8; padding: 0; }
button.sm { padding: 3px 8px; font-size: 12px; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; width: 100%; background: #fff; }
textarea { min-height: 80px; font-family: Consolas, monospace; font-size: 12px; }
label { display: block; margin: 8px 0; color: var(--muted); font-size: 12px; }
label input, label select, label textarea { margin-top: 4px; color: var(--text); font-size: 14px; }

.login { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #16202c, #24476b); }
.login-card { width: 340px; }
.login-card h1 { margin: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin-bottom: 16px; }
.card h2 { margin: 0 0 12px; font-size: 16px; }
.card h3 { margin: 16px 0 8px; font-size: 14px; }

#app { display: flex; min-height: 100vh; }
.side { width: 200px; background: var(--side); color: #cfd8e3; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { padding: 18px 16px; font-weight: 600; font-size: 16px; color: #fff; }
.brand small { display: block; font-weight: 400; font-size: 12px; color: #9fb3c8; }
#nav a { display: block; padding: 10px 16px; color: #cfd8e3; cursor: pointer; text-decoration: none; }
#nav a:hover { background: #1f2d3d; }
#nav a.active { background: var(--primary); color: #fff; }
.me { margin-top: auto; padding: 14px 16px; border-top: 1px solid #2a3a4d; display: flex; justify-content: space-between; font-size: 12px; }
main { flex: 1; padding: 20px 24px; min-width: 0; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar input, .toolbar select { width: auto; }
.toolbar .grow { flex: 1; }

table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 13px; }
th { background: #f8fafc; color: var(--muted); font-weight: 600; white-space: nowrap; }
tr:hover td { background: #fafcff; }
td .sub { display: block; color: var(--muted); font-size: 12px; }
td.actions { white-space: nowrap; }
td.actions button { margin: 0 2px 2px 0; }
.mono { font-family: Consolas, monospace; font-size: 12px; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: #eef2f6; color: var(--muted); white-space: nowrap; }
.badge.ok { background: #e6f4ea; color: var(--ok); }
.badge.warn { background: #fdf3e1; color: var(--warn); }
.badge.bad { background: #fdecea; color: var(--bad); }
.badge.info { background: #e8f0fe; color: var(--primary); }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.stat b { display: block; font-size: 26px; margin-top: 4px; }
.stat span { color: var(--muted); font-size: 12px; }

.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 14px; padding: 8px 14px 4px; }
legend { font-weight: 600; padding: 0 6px; }
.checks label { display: inline-flex; gap: 6px; align-items: center; margin-right: 16px; color: var(--text); font-size: 14px; }
.checks input { width: auto; margin: 0; }

.steps { list-style: none; padding: 0; margin: 0; }
.steps li { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.steps li .dot { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; background: #eef2f6; color: var(--muted); flex: none; }
.steps li.success .dot { background: var(--ok); color: #fff; }
.steps li.running .dot { background: var(--primary); color: #fff; animation: pulse 1s infinite; }
.steps li.failed .dot { background: var(--bad); color: #fff; }
.steps li .name { min-width: 220px; }
.steps li .info { color: var(--muted); font-size: 12px; }
@keyframes pulse { 50% { opacity: .5; } }

pre.log { background: #0f1720; color: #d6e2ee; padding: 12px; border-radius: 8px; max-height: 420px; overflow: auto; font-size: 12px; white-space: pre-wrap; word-break: break-all; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; font-size: 13px; }
.kv div:nth-child(odd) { color: var(--muted); }

.modal { position: fixed; inset: 0; background: rgba(15, 23, 32, .45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow: auto; z-index: 10; }
.modal-box { background: #fff; border-radius: 10px; padding: 20px; width: min(900px, 100%); position: relative; }
.modal-box .close { position: absolute; right: 12px; top: 10px; border: none; font-size: 20px; background: none; }
.toast { position: fixed; right: 20px; bottom: 20px; background: #16202c; color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 20; max-width: 420px; }
.toast.bad { background: var(--bad); }
@media (max-width: 800px) {
  #app { flex-direction: column; } .side { width: 100%; height: auto; position: static; }
  .grid2, .grid3 { grid-template-columns: 1fr; } main { padding: 12px; }
}
