/* ---------- app shell: sidebar + main content ---------- */
.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 224px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 22px;
  color: var(--text);
}
.sidebar-brand svg { color: var(--accent); flex-shrink: 0; }
.sidebar-brand-text { font-weight: 800; font-size: 15px; letter-spacing: -.01em; }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 13.5px;
  text-decoration: none;
  transition: .12s background, .12s color;
}
.sidebar-link:hover { background: var(--surface-2); color: var(--text); }
.sidebar-link.active { background: var(--accent-soft); color: var(--accent); }
.sidebar-link svg { flex-shrink: 0; }
.sidebar-link.disabled { color: var(--text-faint); pointer-events: none; }
.sidebar-link-badge {
  margin-left: auto;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-faint);
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 99px;
}

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 10px;
}
.sidebar-logout-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  transition: .12s background, .12s color;
}
.sidebar-logout-btn:hover { background: var(--danger-soft); color: var(--danger); }

.main {
  flex: 1;
  min-width: 0;
  padding: 32px 36px;
  max-width: 1180px;
}

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    padding: 10px 14px;
    overflow-x: auto;
  }
  .sidebar-brand { padding: 0 14px 0 0; }
  .sidebar-nav { flex-direction: row; flex: none; }
  .sidebar-link-badge { display: none; }
  .sidebar-link span:not(.sidebar-link-badge) { display: none; }
  .sidebar-footer { border-top: none; margin: 0 0 0 auto; padding: 0; }
  .sidebar-logout-btn span { display: none; }
  .main { padding: 20px 18px; }
}

/* ---------- shared page header, used by every new page ---------- */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-title { font-size: 22px; font-weight: 800; letter-spacing: -.015em; margin: 0 0 4px; }
.page-sub { color: var(--text-muted); font-size: 13.5px; margin: 0; }

.empty-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ---------- shared modal (Link Generator, Manage Channels) ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 23, 31, .38);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 44px 16px;
  overflow-y: auto;
  z-index: 100;
}
.modal-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 15px; font-weight: 800; letter-spacing: -.005em; }
.modal-close-btn {
  background: none; border: none; cursor: pointer; color: var(--text-faint);
  padding: 4px; display: flex; border-radius: var(--radius-sm);
}
.modal-close-btn:hover { color: var(--text); background: var(--surface-2); }
.modal-body { padding: 20px 22px; max-height: 70vh; overflow-y: auto; }
.modal-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 22px; border-top: 1px solid var(--border);
}

.step-dots { display: flex; gap: 5px; }
.step-dot { width: 6px; height: 6px; border-radius: 99px; background: var(--border-strong); }
.step-dot.active { background: var(--accent); width: 16px; }

.option-card {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface); cursor: pointer; font-family: inherit; margin-bottom: 8px;
  transition: .1s border-color, .1s background;
}
.option-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.option-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.option-card-icon {
  width: 34px; height: 34px; border-radius: var(--radius-sm); background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--text-muted);
}
.option-card.selected .option-card-icon { background: var(--accent); color: #fff; }
.option-card-label { font-weight: 700; font-size: 13.5px; }
.option-card-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }

.readonly-box {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 11px; font-size: 12.5px; color: var(--text-muted); word-break: break-all;
}
