:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1f232d;
  --text: #e6e8ee;
  --muted: #8a93a6;
  --accent: #4f8cff;
  --ok: #3ecf8e;
  --warn: #f0b429;
  --bad: #ef4444;
  --border: #252a36;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
main { max-width: 960px; margin: 0 auto; padding: 32px 20px; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 0 0 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin-bottom: 20px; }
.bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.bar h1 { margin: 0; }

form { display: grid; gap: 12px; max-width: 560px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
input { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 7px; padding: 9px 11px; font: inherit; }
input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.inline { display: flex; align-items: center; gap: 6px; }
.inline input { flex: 1; }
.suffix { color: var(--muted); font-variant-numeric: tabular-nums; }

button {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 7px;
  padding: 9px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transform: translateZ(0);
  transition: transform .15s cubic-bezier(.2,.8,.2,1), box-shadow .2s ease, filter .15s ease, background-color .2s ease;
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 1px 2px rgba(0,0,0,.25);
}
button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--rx, 50%) var(--ry, 50%), rgba(255,255,255,.35), transparent 60%);
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
}
button:hover { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 6px 14px rgba(79,140,255,.28), 0 1px 0 rgba(255,255,255,.12) inset; }
button:hover::before { opacity: 1; }
button:active { transform: translateY(0) scale(.97); transition-duration: .05s; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}
button[data-loading="true"] {
  color: transparent;
  pointer-events: none;
}
button[data-loading="true"]::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 16px; height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: sdp-spin .7s linear infinite;
}
@keyframes sdp-spin { to { transform: rotate(360deg); } }

button.danger {
  background: transparent;
  color: var(--bad);
  border: 1px solid var(--bad);
  padding: 5px 12px;
  font-size: 13px;
  box-shadow: none;
}
button.danger:hover {
  background: rgba(239,68,68,.12);
  box-shadow: 0 4px 10px rgba(239,68,68,.18);
  transform: translateY(-1px);
}
button.danger:active { transform: translateY(0) scale(.96); }

@media (prefers-reduced-motion: reduce) {
  button, button::before { transition: none !important; animation: none !important; }
  button:hover, button:active { transform: none !important; }
}

.err { color: var(--bad); min-height: 1.2em; margin: 8px 0 0; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
td a { color: var(--accent); text-decoration: none; }
td a:hover { text-decoration: underline; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.badge.ok { background: rgba(62,207,142,.15); color: var(--ok); }
.badge.warn { background: rgba(240,180,41,.15); color: var(--warn); }
.badge.bad { background: rgba(239,68,68,.15); color: var(--bad); }

.progress { background: var(--panel-2); border: 1px solid var(--border); border-radius: 7px; height: 10px; overflow: hidden; margin-top: 12px; }
.bar-fill { background: var(--accent); height: 100%; width: 0%; transition: width .25s ease; }
#progress-pct { font-variant-numeric: tabular-nums; font-weight: 600; }
#progress-msg { color: var(--muted); margin-left: 8px; }

#view-login { max-width: 380px; margin: 80px auto 0; }
#view-login h1 { text-align: center; margin-bottom: 24px; }
