:root {
  --bg: #f3f4f6;
  --panel: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #2563eb;
  --ok: #059669;
  --warn: #d97706;
  --danger: #dc2626;
  --side: #0f172a;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}
a { color: var(--accent); text-decoration: none; }
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  background: var(--side);
  color: #e2e8f0;
  padding: 1.25rem 0.9rem;
  flex-shrink: 0;
}
.sidebar .brand {
  font-weight: 700;
  font-size: 1rem;
  padding: 0 0.6rem 1.2rem;
  letter-spacing: -0.02em;
}
.sidebar a {
  display: block;
  color: #cbd5e1;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  margin-bottom: 0.2rem;
  font-size: 0.92rem;
}
.sidebar a:hover, .sidebar a.active { background: #1e293b; color: #fff; }
.sidebar a.disabled { opacity: 0.4; pointer-events: none; }
.content { flex: 1; padding: 1.4rem 1.6rem 3rem; max-width: 1100px; }
h1 { margin: 0 0 0.35rem; font-size: 1.35rem; }
.sub { color: var(--muted); margin-bottom: 1.2rem; font-size: 0.92rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.75rem; margin-bottom: 1.2rem; }
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.9rem 1rem;
}
.stat .n { font-size: 1.4rem; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 0.82rem; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.55rem 0.4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; }
button, .btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 7px;
  padding: 0.42rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text);
  display: inline-block;
}
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.ok, .btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
button.danger, .btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0.5rem 0.65rem;
  font: inherit;
  background: #fff;
}
label { display: block; font-size: 0.85rem; color: var(--muted); margin: 0.6rem 0 0.25rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
@media (max-width: 800px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; }
  .grid-2 { grid-template-columns: 1fr; }
}
.channel-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.65rem;
  transition: opacity .2s;
}
.channel-card.is-processed { opacity: 0.42; }
.muted { color: var(--muted); }
.flash { padding: 0.7rem 0.9rem; border-radius: 8px; margin-bottom: 1rem; background: #ecfdf5; color: #065f46; }
.flash.error { background: #fef2f2; color: #991b1b; }
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
}
.login-box {
  width: 340px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 1.4rem;
}
pre.log {
  background: #0f172a; color: #e2e8f0; padding: 0.8rem;
  border-radius: 8px; max-height: 280px; overflow: auto; font-size: 0.78rem;
}
.badge {
  display: inline-block; padding: 0.1rem 0.45rem; border-radius: 999px;
  font-size: 0.75rem; background: #e5e7eb; color: #374151;
}
.badge.running { background: #d1fae5; color: #065f46; }
.badge.draft { background: #e5e7eb; }
.badge.error, .badge.stopped { background: #fee2e2; color: #991b1b; }
.badge.done { background: #dbeafe; color: #1e40af; }
.badge.paused { background: #ffedd5; color: #9a3412; }
.pager { display: flex; gap: 0.6rem; align-items: center; justify-content: center; margin-top: 1rem; }
.chk { width: auto; margin-right: 0.4rem; }
.variant {
  border: 1px dashed var(--line); border-radius: 8px; padding: 0.8rem; margin-bottom: 0.7rem;
}
.avatar-sm {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  background: #e5e7eb; display: block;
}
.avatar-sm.placeholder { border: 1px solid var(--line); }
.profile-avatar-wrap { margin-bottom: 0.8rem; }
.profile-avatar {
  width: 120px; height: 120px; border-radius: 50%; object-fit: cover;
  background: #e5e7eb; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 0.85rem;
}
.profile-avatar.placeholder { border: 1px solid var(--line); }

