/* ── State badge ─────────────────────────────────────────────────────────── */
.badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 9999px;
  letter-spacing: 0.08em;
}
.badge-stopped  { background: #334155; color: #94a3b8; }
.badge-running  { background: #166534; color: #4ade80; animation: pulse 2s infinite; }
.badge-paused   { background: #78350f; color: #fbbf24; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

/* ── Stat cards ──────────────────────────────────────────────────────────── */
.stat-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  text-align: center;
}
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: 0.65rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
  border: none;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-sm       { padding: 4px 10px; font-size: 0.7rem; }
.btn-primary   { background: #2563eb; color: #fff; }
.btn-primary:not(:disabled):hover  { background: #1d4ed8; }
.btn-warning   { background: #d97706; color: #fff; }
.btn-warning:not(:disabled):hover  { background: #b45309; }
.btn-danger    { background: #dc2626; color: #fff; }
.btn-danger:not(:disabled):hover   { background: #b91c1c; }
.btn-secondary { background: #334155; color: #e2e8f0; }
.btn-secondary:not(:disabled):hover { background: #475569; }

/* ── Form controls ───────────────────────────────────────────────────────── */
.form-group  { display: flex; flex-direction: column; gap: 4px; }
.form-label  { font-size: 0.7rem; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; }
.form-input  {
  background: #0f172a;
  border: 1px solid #475569;
  border-radius: 6px;
  color: #e2e8f0;
  padding: 6px 8px;
  font-size: 0.75rem;
  font-family: monospace;
  resize: vertical;
  transition: border-color 0.15s;
  width: 100%;
}
.form-input:focus  { outline: none; border-color: #3b82f6; }
.form-input:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Log console ─────────────────────────────────────────────────────────── */
.log-console { font-size: 0.7rem; line-height: 1.6; }

.log-line            { padding: 1px 0; white-space: pre-wrap; word-break: break-all; }
.log-line.info       { color: #94a3b8; }
.log-line.success    { color: #4ade80; }
.log-line.warn       { color: #fbbf24; }
.log-line.error      { color: #f87171; }
.log-line.connected  { color: #60a5fa; font-style: italic; }

/* ── Table ───────────────────────────────────────────────────────────────── */
tbody tr:nth-child(even) { background: #1e293b; }
tbody tr:hover            { background: #334155; }
tbody td                  { padding: 6px 12px; color: #cbd5e1; }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.page-btn {
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 0.7rem;
  background: #334155;
  color: #e2e8f0;
  cursor: pointer;
  border: none;
}
.page-btn:hover     { background: #475569; }
.page-btn.active    { background: #2563eb; color: #fff; }
.page-btn:disabled  { opacity: 0.3; cursor: not-allowed; }

/* ── Toggle switch ───────────────────────────────────────────────────────── */
.toggle-wrap {
  position: relative; display: inline-flex; align-items: center; gap: 7px;
  cursor: pointer; user-select: none;
}
.toggle-input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  width: 36px; height: 20px; background: #334155; border-radius: 9999px;
  transition: background 0.2s; flex-shrink: 0; position: relative;
}
.toggle-track::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; background: #fff; border-radius: 50%;
  transition: transform 0.2s;
}
.toggle-input:checked + .toggle-track               { background: #2563eb; }
.toggle-input:checked + .toggle-track::after        { transform: translateX(16px); }
.toggle-wa .toggle-input:checked + .toggle-track    { background: #16a34a; }

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #475569; border-radius: 3px; }
