/* =============================================================================
   StreamHub Pro — Design System
   Premium dark streaming dashboard inspired by Castr
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ─── Variables ─────────────────────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg: #060b18;
  --surface: #0e1624;
  --surface-2: #141d2e;
  --surface-3: #1c2840;
  --surface-4: #243356;

  /* Borders */
  --border: rgba(255, 255, 255, 0.06);
  --border-2: rgba(255, 255, 255, 0.12);

  /* Brand */
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.12);
  --primary-glow: rgba(99, 102, 241, 0.35);

  /* Status */
  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.12);
  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.12);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.12);
  --info: #3b82f6;
  --info-light: rgba(59, 130, 246, 0.12);

  /* Text */
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Layout */
  --sidebar-w: 256px;
  --topbar-h: 64px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  /* Effects */
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.6);
  --shadow-primary: 0 8px 32px var(--primary-glow);

  /* Transition */
  --t: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: all 0.15s ease;
  --t-slow: all 0.35s ease;
}

/* ─── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; transition: var(--t); }
img, svg { max-width: 100%; vertical-align: middle; }
input, textarea, select, button { font-family: inherit; }
ul, ol { list-style: none; }

/* ─── Typography ─────────────────────────────────────────────────────────────── */
h1 { font-size: 2.5rem; font-weight: 800; line-height: 1.2; }
h2 { font-size: 2rem; font-weight: 700; line-height: 1.3; }
h3 { font-size: 1.5rem; font-weight: 700; }
h4 { font-size: 1.125rem; font-weight: 600; }
h5 { font-size: 1rem; font-weight: 600; }
h6 { font-size: 0.875rem; font-weight: 600; }
p { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, #6366f1, #a78bfa, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Layout — App Shell ─────────────────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), #a78bfa);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.sidebar-logo .logo-text span { color: var(--primary); }

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
}

.nav-section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 8px 8px;
  margin-top: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--t);
  margin-bottom: 2px;
  white-space: nowrap;
}

.nav-item:hover {
  background: var(--surface-3);
  color: var(--text);
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
}

.nav-item .nav-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: 0.8;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}

.nav-item.active .nav-icon { opacity: 1; }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: var(--t);
  cursor: pointer;
}

.user-card:hover { background: var(--surface-3); }

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #a78bfa);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-info .name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-info .role {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

/* ─── Main Area ──────────────────────────────────────────────────────────────── */
.main-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── Topbar ─────────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  background: rgba(6, 11, 24, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
}

.topbar-title { font-size: 1.125rem; font-weight: 700; flex: 1; }
.topbar-subtitle { font-size: 0.75rem; color: var(--text-muted); }

.topbar-actions { display: flex; align-items: center; gap: 10px; }

/* ─── Page Content ───────────────────────────────────────────────────────────── */
.page-content {
  padding: 28px;
  flex: 1;
}

/* ─── Flash Messages ─────────────────────────────────────────────────────────── */
.flash-container {
  padding: 0 28px;
  padding-top: 16px;
}

.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 10px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.flash-success { background: var(--success-light); color: var(--success); border: 1px solid rgba(16,185,129,0.2); }
.flash-error   { background: var(--danger-light);  color: var(--danger);  border: 1px solid rgba(239,68,68,0.2); }
.flash-warning { background: var(--warning-light); color: var(--warning); border: 1px solid rgba(245,158,11,0.2); }
.flash-info    { background: var(--info-light);    color: var(--info);    border: 1px solid rgba(59,130,246,0.2); }

/* ─── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.card-sm { padding: 16px; border-radius: var(--radius); }
.card-lg { padding: 32px; border-radius: var(--radius-xl); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.card-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Stat cards */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  transition: var(--t);
}

.stat-card:hover {
  border-color: var(--border-2);
  transform: translateY(-2px);
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.stat-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* ─── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--t);
  white-space: nowrap;
  line-height: 1.2;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-primary); }

.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover { background: #0da06f; box-shadow: 0 8px 24px rgba(16,185,129,0.4); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: #dc2626; box-shadow: 0 8px 24px rgba(239,68,68,0.4); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-2);
}
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }

.btn-surface {
  background: var(--surface-3);
  color: var(--text);
}
.btn-surface:hover { background: var(--surface-4); }

.btn-lg { padding: 13px 28px; font-size: 1rem; border-radius: var(--radius); }
.btn-sm { padding: 6px 12px; font-size: 0.8125rem; border-radius: var(--radius-xs); }
.btn-xs { padding: 4px 10px; font-size: 0.75rem; border-radius: var(--radius-xs); }
.btn-icon { padding: 9px; width: 38px; height: 38px; }
.btn-icon-sm { padding: 6px; width: 30px; height: 30px; }
.btn-block { width: 100%; }

/* ─── Badges ─────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
}

.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger  { background: var(--danger-light);  color: var(--danger); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-info    { background: var(--info-light);    color: var(--info); }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-muted   { background: var(--surface-3);     color: var(--text-secondary); }

/* Live pulse */
.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger);
  display: inline-block;
  animation: pulse 1.5s infinite;
}

.live-dot.live-success { background: var(--success); }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(1.3); }
}

/* ─── Forms ──────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group:last-child { margin-bottom: 0; }

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.875rem;
  transition: var(--t);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-control-sm { padding: 7px 12px; font-size: 0.8125rem; }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 5px; }

/* Toggle switch */
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--surface-4);
  border-radius: 24px;
  cursor: pointer;
  transition: var(--t);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; bottom: 3px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: var(--t);
}
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); background: #fff; }

/* ─── Tables ─────────────────────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--t-fast);
}

tbody tr:last-child { border-bottom: none; }

tbody tr:hover { background: var(--surface-2); }

tbody td {
  padding: 14px 16px;
  color: var(--text-secondary);
  vertical-align: middle;
}

tbody td strong { color: var(--text); }

/* ─── Modals ─────────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--t);
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(8px);
  transition: var(--t);
}

.modal-backdrop.open .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title { font-size: 1.125rem; font-weight: 700; }
.modal-close {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 1.2rem; padding: 2px;
  transition: var(--t);
}
.modal-close:hover { color: var(--text); }

.modal-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 24px;
}

/* ─── Grid ───────────────────────────────────────────────────────────────────── */
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ─── Flex utilities ─────────────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-4  { gap: 4px; }
.gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

/* ─── Spacing ────────────────────────────────────────────────────────────────── */
.mb-4  { margin-bottom: 4px; }
.mb-6  { margin-bottom: 6px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

/* ─── Divider ────────────────────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ─── Copy field ─────────────────────────────────────────────────────────────── */
.copy-field {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.copy-field input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-family: 'Fira Code', 'Consolas', monospace;
  padding: 10px 14px;
}

.copy-btn {
  padding: 0 14px;
  height: 100%;
  min-height: 38px;
  background: var(--surface-3);
  border: none;
  border-left: 1px solid var(--border-2);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  transition: var(--t);
  white-space: nowrap;
}

.copy-btn:hover { background: var(--surface-4); color: var(--primary); }

/* ─── Platform Chip ──────────────────────────────────────────────────────────── */
.platform-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--surface-3);
  color: var(--text-secondary);
}

.platform-chip .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ─── Channel Card ───────────────────────────────────────────────────────────── */
.channel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--t);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.channel-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), #a78bfa);
  opacity: 0;
  transition: var(--t);
}

.channel-card:hover {
  border-color: var(--border-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.channel-card:hover::before { opacity: 1; }
.channel-card.live { border-color: rgba(16,185,129,0.3); }
.channel-card.live::before { background: var(--success); opacity: 1; }

.channel-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.channel-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.channel-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.channel-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.channel-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.channel-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ─── Destination Row ────────────────────────────────────────────────────────── */
.dest-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.dest-row:last-child { border-bottom: none; }

.dest-platform-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
  color: #fff;
}

.dest-info { flex: 1; min-width: 0; }
.dest-name { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.dest-url {
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dest-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ─── Source type tabs ───────────────────────────────────────────────────────── */
.source-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}

.source-tab {
  flex: 1;
  padding: 7px 10px;
  border-radius: var(--radius-xs);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  cursor: pointer;
  transition: var(--t);
  border: none;
  background: none;
  white-space: nowrap;
}

.source-tab.active {
  background: var(--surface-4);
  color: var(--text);
}

.source-tab:hover:not(.active) { color: var(--text-secondary); }

.source-panel { display: none; }
.source-panel.active { display: block; }

/* ─── Upload zone ────────────────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border-2);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: var(--t);
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-icon { font-size: 2rem; margin-bottom: 8px; }
.upload-label { font-size: 0.875rem; font-weight: 600; color: var(--text-secondary); }
.upload-hint  { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* ─── Schedule card ──────────────────────────────────────────────────────────── */
.schedule-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  transition: var(--t);
}

.schedule-item:hover { border-color: var(--border-2); }

.schedule-date {
  text-align: center;
  min-width: 48px;
}

.schedule-date .day {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
  color: var(--primary);
}

.schedule-date .month {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* ─── Empty state ────────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
}

.empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.4; }
.empty-title { font-size: 1.125rem; font-weight: 700; margin-bottom: 8px; }
.empty-desc { font-size: 0.875rem; color: var(--text-muted); max-width: 280px; margin-bottom: 24px; }

/* ─── Section header ─────────────────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title { font-size: 1rem; font-weight: 700; }

/* ─── Tabs ───────────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.tab-link {
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: var(--t);
}

.tab-link:hover { color: var(--text-secondary); }
.tab-link.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ─── Stream log ─────────────────────────────────────────────────────────────── */
.log-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.8125rem;
}
.log-row:last-child { border-bottom: none; }
.log-time { color: var(--text-muted); font-variant-numeric: tabular-nums; min-width: 140px; }
.log-duration { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 72px; }

/* ─── Ingest info box ────────────────────────────────────────────────────────── */
.ingest-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.ingest-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* ─── Landing page ───────────────────────────────────────────────────────────── */
.landing-body {
  min-height: 100vh;
  background: var(--bg);
}

/* Navbar */
.landing-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; padding: 0 5%;
  height: 68px;
  background: rgba(6,11,24,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.landing-nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.1rem; font-weight: 800; letter-spacing: -0.02em;
  flex: 0 0 auto;
}

.landing-nav-logo .logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--primary), #a78bfa);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}

.landing-nav-links {
  display: flex; align-items: center; gap: 32px; margin-left: 40px; flex: 1;
}
.landing-nav-links a {
  font-size: 0.875rem; font-weight: 500; color: var(--text-secondary);
}
.landing-nav-links a:hover { color: var(--text); }

.landing-nav-cta { display: flex; align-items: center; gap: 10px; }

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: 100px 20px 60px;
  overflow: hidden;
}

.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(99,102,241,0.2) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(167,139,250,0.1) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 20% 80%, rgba(236,72,153,0.07) 0%, transparent 60%);
}

.hero-grid {
  position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}

.hero-content { position: relative; z-index: 1; max-width: 800px; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--primary-light);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 28px;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -0.03em;
}

.hero p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 36px;
}

.hero-cta {
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
}

/* Platforms strip */
.platforms-strip {
  display: flex; align-items: center; gap: 32px; flex-wrap: wrap;
  justify-content: center;
  margin-top: 52px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.platforms-strip-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.platform-logo {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.8125rem; font-weight: 700;
  color: var(--text-muted);
  transition: var(--t);
}

.platform-logo:hover { color: var(--text-secondary); }

.platform-logo-icon {
  width: 26px; height: 26px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.875rem;
}

/* Features section */
.section { padding: 80px 5%; }
.section-label {
  font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--primary); margin-bottom: 12px;
}
.section-title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.section-subtitle {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  max-width: 520px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 48px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--t);
}

.feature-card:hover {
  border-color: var(--border-2);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.feature-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.feature-title { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.feature-desc { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.65; }

/* Steps */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-top: 48px;
}

.step-card {
  text-align: center;
  padding: 24px;
}

.step-number {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--primary-light);
  border: 2px solid var(--primary);
  color: var(--primary);
  font-size: 1.25rem;
  font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}

/* CTA section */
.cta-section {
  margin: 0 5% 80px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: -50%; left: -20%;
  width: 60%; height: 200%;
  background: radial-gradient(ellipse, rgba(99,102,241,0.15) 0%, transparent 70%);
}

.cta-section::after {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 60%; height: 200%;
  background: radial-gradient(ellipse, rgba(167,139,250,0.1) 0%, transparent 70%);
}

.cta-section > * { position: relative; z-index: 1; }

/* Auth pages */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.auth-page::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(99,102,241,0.15) 0%, transparent 60%);
}

.auth-card {
  width: 100%; max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xl);
  padding: 36px;
  position: relative; z-index: 1;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.1rem; font-weight: 800;
  margin-bottom: 28px;
}

.auth-logo .logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), #a78bfa);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

.auth-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 6px; }
.auth-subtitle { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 28px; }
.auth-footer-link { font-size: 0.875rem; color: var(--text-muted); text-align: center; margin-top: 24px; }
.auth-footer-link a { color: var(--primary); font-weight: 600; }
.auth-footer-link a:hover { text-decoration: underline; }

/* ─── Scrollbar ──────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--surface-3); }

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .page-content { padding: 16px; }
  .flash-container { padding: 0 16px; padding-top: 12px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .cta-section { padding: 40px 24px; }
  .landing-nav-links { display: none; }
}

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Animations ─────────────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.4s ease forwards; }
.fade-in-1 { animation: fadeIn 0.4s ease 0.05s both; }
.fade-in-2 { animation: fadeIn 0.4s ease 0.1s both; }
.fade-in-3 { animation: fadeIn 0.4s ease 0.15s both; }
.fade-in-4 { animation: fadeIn 0.4s ease 0.2s both; }

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-xs);
}

/* ─── Misc ───────────────────────────────────────────────────────────────────── */
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.monospace { font-family: 'Fira Code', 'Consolas', 'Monaco', monospace; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
