:root {
  --bg: #0f1419;
  --card: #1a2332;
  --text: #e7ecf3;
  --muted: #9aa7b8;
  --accent: #3b82f6;
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --border: #2a3648;
}
[data-theme="light"] {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.auth-card, .card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
}
.auth-card { width: min(400px, 100%); }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-actions { display: flex; gap: 0.5rem; }
.container { padding: 1rem; max-width: 1100px; margin: 0 auto; display: grid; gap: 1rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
h1,h2 { margin: 0 0 0.75rem; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
label { display: grid; gap: 0.35rem; margin-bottom: 0.75rem; font-size: 0.9rem; }
input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
button {
  border: 0;
  border-radius: 10px;
  padding: 0.55rem 0.9rem;
  background: var(--accent);
  color: white;
  font-weight: 600;
  cursor: pointer;
}
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
button.ok { background: var(--ok); color: #06210f; }
button.warn { background: var(--warn); color: #1f1300; }
button.danger { background: var(--danger); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.9rem; }
.status-body { display: grid; gap: 0.35rem; font-size: 0.95rem; }
.pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}
.pill.on { background: rgba(34,197,94,.2); color: var(--ok); }
.pill.off { background: rgba(239,68,68,.18); color: var(--danger); }
.pill.pause { background: rgba(245,158,11,.2); color: var(--warn); }
.log-view {
  margin: 0;
  max-height: 420px;
  overflow: auto;
  background: #0b1020;
  color: #d7e2ff;
  border-radius: 10px;
  padding: 0.85rem;
  font-size: 0.78rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
[data-theme="light"] .log-view { background: #0f172a; }
.qr-body img { max-width: 100%; height: auto; border-radius: 8px; background: white; padding: 0.5rem; }
.row-between { display: flex; justify-content: space-between; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.stack { max-width: 420px; }
@media (max-width: 640px) {
  .topbar { flex-direction: column; align-items: flex-start; }
}

.bots-root { display: grid; gap: 1rem; }
.bot-card h3 { margin-top: 1rem; }
@media (min-width: 960px) {
  .bots-root { grid-template-columns: 1fr 1fr; align-items: start; }
}
