/* WO-DEPLOY-013-deployer-admin-webapp/TASK-020 "admin SPA styles" — mobile-first, dark. */
:root {
  --bg: #0b0d12;
  --panel: #151922;
  --panel-2: #1d232f;
  --border: #2a3140;
  --text: #e6e9ef;
  --muted: #8b93a3;
  --accent: #4f8cff;
  --accent-press: #3a6fd0;
  --ok: #3fb950;
  --warn: #d29922;
  --bad: #f85149;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

#app { max-width: 640px; margin: 0 auto; padding: 16px 14px 64px; }

/* Header */
.topbar {
  display: flex; align-items: center; gap: 10px;
  position: sticky; top: 0; z-index: 5;
  background: linear-gradient(var(--bg) 78%, transparent);
  padding: 10px 2px 12px;
}
.topbar h1 { font-size: 17px; margin: 0; font-weight: 650; flex: 1; }
.back { background: none; border: none; color: var(--accent); font-size: 15px; padding: 6px 4px; }
.badge {
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  padding: 3px 8px; border-radius: 999px; text-transform: uppercase;
}
.badge.main { background: #123; color: var(--accent); border: 1px solid #24466f; }
.badge.root { background: #2a1720; color: #ff8a8a; border: 1px solid #6a2a36; }
.logout { background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 8px; padding: 5px 10px; font-size: 13px; }

/* Cards */
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-bottom: 12px;
}
.card h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 10px; }

/* Service list rows */
.svc-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-bottom: 10px; color: var(--text);
}
.svc-row:active { background: var(--panel-2); }
.svc-name { font-weight: 600; flex: 1; word-break: break-word; }
.svc-ver { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); }
.chev { color: var(--muted); }

/* Health dot */
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.healthy { background: var(--ok); }
.dot.degraded { background: var(--warn); }
.dot.unhealthy, .dot.unknown { background: var(--bad); }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--muted); }
.kv .v { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all; text-align: right; }

/* Version rows */
.ver { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.ver:last-child { border-bottom: none; }
.ver code { font-size: 12px; color: var(--text); flex: 1; word-break: break-all; }
.tag { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px; text-transform: uppercase; }
.tag.current { background: #123; color: var(--accent); border: 1px solid #24466f; }
.tag.status { background: var(--panel-2); color: var(--muted); border: 1px solid var(--border); }

/* Timeline */
.event { padding: 8px 0; border-bottom: 1px solid var(--border); }
.event:last-child { border-bottom: none; }
.event .row1 { display: flex; gap: 8px; align-items: baseline; }
.event .type { font-weight: 650; }
.event .when { color: var(--muted); font-size: 12px; margin-left: auto; }
.event .meta { color: var(--muted); font-size: 12.5px; font-family: ui-monospace, monospace; word-break: break-all; }
.event.fail .type { color: var(--bad); }

/* Forms + buttons */
input, button { font: inherit; }
input[type="text"], input[type="password"] {
  width: 100%; background: var(--panel-2); border: 1px solid var(--border);
  color: var(--text); border-radius: 10px; padding: 12px; margin-bottom: 10px;
}
button.btn {
  background: var(--accent); color: #fff; border: none; border-radius: 10px;
  padding: 12px 14px; font-weight: 600; width: 100%; margin-bottom: 8px;
}
button.btn:active { background: var(--accent-press); }
button.btn.ghost { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
button.btn.danger { background: #3a1c22; color: #ff8a8a; border: 1px solid #6a2a36; }
button.btn.small { width: auto; padding: 8px 12px; font-size: 13px; margin: 0; }
button:disabled { opacity: .5; }
.row-actions { display: flex; gap: 8px; align-items: center; }
.hint { color: var(--muted); font-size: 12px; margin: -4px 0 10px; }

/* Login */
.login-wrap { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; }
.login-wrap h1 { text-align: center; font-size: 20px; margin-bottom: 4px; }
.login-wrap .sub { text-align: center; color: var(--muted); margin-bottom: 24px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%); max-width: 90%;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  padding: 12px 16px; border-radius: 12px; z-index: 50; box-shadow: 0 8px 30px rgba(0,0,0,.5);
  font-size: 14px;
}
.toast.ok { border-color: #2a5; }
.toast.err { border-color: #a33; }

.spinner { color: var(--muted); text-align: center; padding: 30px; }
.empty { color: var(--muted); font-size: 13px; padding: 4px 0; }
