:root {
  --bg: #14171c;
  --card: #1e232b;
  --line: #2c333d;
  --text: #e6e9ee;
  --muted: #8a93a0;
  --green: #2ecc71;
  --red: #e74c3c;
  --amber: #f39c12;
  --blue: #3498db;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px; border-bottom: 1px solid var(--line);
}
header h1 { font-size: 18px; margin: 0; }
.logout { color: var(--muted); text-decoration: none; font-size: 14px; }
.logout:hover { color: var(--text); }
main { max-width: 720px; margin: 22px auto; padding: 0 16px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 18px 20px; margin-bottom: 16px;
}
.card h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); margin: 0 0 14px; }
.status-line { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 600; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--muted); }
.dot.active { background: var(--green); box-shadow: 0 0 10px var(--green); }
.dot.inactive, .dot.failed { background: var(--red); }
.dot.unknown { background: var(--amber); }
.metrics { display: flex; gap: 28px; margin: 16px 0 0; }
.metrics dt { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.metrics dd { margin: 2px 0 0; font-size: 20px; font-weight: 600; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn {
  border: 0; border-radius: 8px; padding: 10px 18px; font-size: 15px;
  font-weight: 600; color: #fff; cursor: pointer; transition: filter .15s;
  text-decoration: none; display: inline-block;
}
.btn:hover { filter: brightness(1.1); }
.btn:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.green { background: var(--green); }
.btn.red { background: var(--red); }
.btn.amber { background: var(--amber); }
.btn.blue { background: var(--blue); }
input[type=text], select {
  padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: #161a20; color: var(--text); font-size: 14px;
}
#backup-label { flex: 1; min-width: 180px; }
.hint { color: var(--muted); font-size: 12px; flex-basis: 100%; }

/* restore */
.restore-grid { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.restore-grid label { display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; color: var(--muted); text-transform: uppercase; flex: 1; min-width: 220px; }
.restore-grid select { width: 100%; }
.hidden { display: none !important; }

/* overview */
.overview { width: 100%; border-collapse: collapse; font-size: 14px; }
.overview td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.overview td:first-child { color: var(--muted); }
.overview td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.disks { display: flex; gap: 22px; margin-top: 14px; flex-wrap: wrap; }
.disk { font-size: 13px; color: var(--muted); }
.disk .bar { width: 160px; height: 8px; background: #161a20; border-radius: 4px;
  overflow: hidden; margin-top: 5px; }
.disk .bar div { height: 100%; background: var(--blue); }

/* log */
.log-head { display: flex; align-items: center; justify-content: space-between; }
.log-head h2 { margin: 0; }
.auto { font-size: 12px; color: var(--muted); text-transform: none; letter-spacing: 0; }
.log {
  background: #0f1216; border: 1px solid var(--line); border-radius: 8px;
  padding: 12px; font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px; line-height: 1.5; color: #c7cdd6; max-height: 320px;
  overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 12px 0 0;
}

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: #2c333d; color: var(--text); padding: 12px 20px; border-radius: 8px;
  opacity: 0; pointer-events: none; transition: all .25s; font-size: 14px;
  border: 1px solid var(--line); max-width: 90%; z-index: 10;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: var(--red); }
.toast.ok { border-color: var(--green); }

/* login */
.login-body { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.login-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 30px; width: 320px; display: flex; flex-direction: column; gap: 14px;
}
.login-card h1 { font-size: 18px; margin: 0 0 6px; text-align: center; }
.login-card input {
  padding: 11px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: #161a20; color: var(--text); font-size: 15px;
}
.login-card button {
  padding: 11px; border: 0; border-radius: 8px; background: var(--blue);
  color: #fff; font-weight: 600; font-size: 15px; cursor: pointer;
}
.error { background: rgba(231,76,60,.15); border: 1px solid var(--red);
  color: #ffb4ab; padding: 9px 12px; border-radius: 8px; font-size: 14px; }
