:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --border: #dde1e7;
  --text: #1a1d23;
  --text-muted: #667085;
  --accent: #2454ff;
  --accent-hover: #1a3fd6;
  --danger: #d1392b;
  --danger-soft: #fbe7e5;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 20, 30, 0.04), 0 6px 16px -8px rgba(20, 20, 30, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar .brand { font-weight: 700; font-size: 16px; }
.topbar nav { display: flex; gap: 16px; align-items: center; font-size: 14px; }

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

h1 { font-size: 24px; margin: 0 0 6px; }
h2 { font-size: 18px; margin: 0 0 12px; }
.muted { color: var(--text-muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card + .card { margin-top: 14px; }

.channel-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

.channel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.channel-row .name { font-weight: 600; }
.channel-row .links { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn.secondary:hover { background: var(--bg); }
.btn.danger { background: var(--danger); }
.btn.big { padding: 16px 20px; font-size: 15px; }

.action-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.action-row .btn { flex: 1 1 200px; justify-content: center; text-align: center; }

form.stacked { display: flex; flex-direction: column; gap: 14px; }
label { font-size: 13px; font-weight: 600; color: var(--text-muted); display: block; margin-bottom: 5px; }
input[type="text"], input[type="password"], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.login-wrap { max-width: 360px; margin: 12vh auto 0; padding: 0 20px; }
.error-banner {
  background: var(--danger-soft);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  margin-bottom: 14px;
}

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.badge.ok { background: #e3f6e8; color: #1a7a3a; border-color: transparent; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }

.back-link { font-size: 13.5px; margin-bottom: 16px; display: inline-block; }
