/* ═══════════════════════════════════════════════════════
   ORBITUBE — Design System v2
   Direction: Editorial Precision · Black/White · Minimal
   Font: Inter
═══════════════════════════════════════════════════════ */

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

/* ── Variables ──────────────────────────────────────── */
:root {
  --bg:          #F7F7F7;
  --surface:     #FFFFFF;
  --surface-2:   #F4F4F5;
  --border:      #E4E4E7;
  --border-2:    #D4D4D8;
  --text-1:      #09090B;
  --text-2:      #52525B;
  --text-3:      #A1A1AA;
  --accent:      #18181B;
  --accent-h:    #3F3F46;
  --green:       #16A34A;
  --green-bg:    #F0FDF4;
  --green-b:     #BBF7D0;
  --red:         #DC2626;
  --red-bg:      #FEF2F2;
  --red-b:       #FECACA;
  --amber:       #D97706;
  --amber-bg:    #FFFBEB;
  --amber-b:     #FDE68A;
  --blue:        #2563EB;
  --blue-bg:     #EFF6FF;
  --radius:      6px;
  --radius-lg:   10px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:      0 4px 16px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.04);
  --shadow-lg:   0 12px 40px rgba(0,0,0,.1);
  --sidebar-w:   240px;
  --transition:  all .15s ease;
}

/* ── Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
}
a { color: inherit; text-decoration: none; }
input, textarea, select, button { font-family: inherit; font-size: inherit; }
img { display: block; max-width: 100%; }

/* ── Logo ──────────────────────────────────────────── */
.logo-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}
.logo-mark {
  width: 32px; height: 32px;
  background: var(--text-1);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-mark svg { width: 18px; height: 18px; }
.logo-wordmark {
  display: flex; flex-direction: column; line-height: 1.1;
}
.logo-name {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -.3px;
  color: var(--text-1);
}
.logo-tag {
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: .5px;
  text-transform: uppercase;
  font-weight: 500;
}

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  flex-shrink: 0;
}
.sidebar-nav {
  padding: 10px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 12px 8px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
}
.nav-item:hover { background: var(--surface-2); color: var(--text-1); }
.nav-item.active {
  background: var(--text-1);
  color: #FFF;
  border-color: var(--text-1);
}
.nav-item.active .nav-icon { opacity: 1; color: #FFF; }
.nav-icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
  opacity: .6;
  display: flex; align-items: center; justify-content: center;
}
.nav-item.active .nav-icon { opacity: 1; color: #FFF; }
.sidebar-footer {
  padding: 14px 14px 18px;
  border-top: 1px solid var(--border);
}
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  margin-bottom: 10px;
}
.user-avatar {
  width: 28px; height: 28px;
  background: var(--text-1);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #FFF;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-email {
  font-size: 11.5px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plan-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 99px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  background: var(--text-1);
  color: #FFF;
  margin-top: 2px;
}
.plan-chip.free   { background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border); }
.plan-chip.basic  { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.plan-chip.pro    { background: var(--text-1); color: #FFF; }
.plan-chip.agency { background: #1C1917; color: #FCD34D; }
.btn-logout {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius);
  color: var(--text-3);
  font-size: 12px;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  width: 100%;
  border: 1px solid transparent;
}
.btn-logout:hover { background: var(--surface-2); color: var(--text-1); border-color: var(--border-2); }

/* ── Main content ────────────────────────────────────── */
.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Page header ─────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  gap: 16px;
}
.page-header-left h1 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: var(--text-1);
  line-height: 1.2;
}
.page-header-left p {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 2px;
}
.page-body {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1.4;
}
.btn-primary {
  background: var(--text-1);
  color: #FFF;
  border-color: var(--text-1);
}
.btn-primary:hover { background: var(--accent-h); border-color: var(--accent-h); }
.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border-2);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text-1); border-color: var(--border-2); }
.btn-danger { background: var(--text-1); color: #FFF; border-color: var(--text-1); }
.btn-danger:hover { opacity: .85; }
.btn-dark { background: var(--text-1); color: #FFF; border-color: var(--text-1); }
.btn-dark:hover { opacity: .85; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 6px 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── Cards ───────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.card-header h3 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -.2px;
}
.card-body { padding: 18px; }

/* ── Channel cards ───────────────────────────────────── */
.channel-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.channel-card:hover {
  border-color: var(--border-2);
  box-shadow: var(--shadow);
}
.channel-logo {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  cursor: pointer;
  transition: var(--transition);
}
.channel-logo:hover { border-color: var(--text-1); }
.channel-logo img { width: 100%; height: 100%; object-fit: cover; }
.channel-info { flex: 1; min-width: 0; }
.channel-name {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -.2px;
}
.channel-url { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.channel-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.niche-tag {
  display: inline-flex;
  padding: 2px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
}
.channel-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 7px;
}
.channel-stat {
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 4px;
}
.channel-stat strong { color: var(--text-2); font-weight: 600; }
.channel-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ── Badges ──────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1px;
}
.badge-success { background: var(--text-1); color: #FFF; }
.badge-danger  { background: var(--surface-2); color: var(--text-1); border: 1px solid var(--border-2); }
.badge-warning { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border-2); }
.badge-muted   { background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border); }
.badge-info    { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
/* Canal activo = negro sólido, conectado = gris oscuro con borde */
.badge-active    { background: var(--text-1); color: #FFF; }
.badge-connected { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border-2); }
/* Botón desconectar: hover oscuro con tooltip */
.btn-disconnect {
  position: relative;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-disconnect:hover {
  background: var(--text-1) !important;
  color: #FFF !important;
  border-color: var(--text-1) !important;
}
.btn-disconnect::after {
  content: 'Desconectar';
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-1);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.btn-disconnect:hover::after { opacity: 1; }

/* ── Forms ───────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 5px;
  letter-spacing: -.1px;
}
.form-control {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-1);
  font-size: 13.5px;
  transition: border-color .15s;
  outline: none;
  line-height: 1.5;
}
.form-control:focus { border-color: var(--text-1); }
.form-control::placeholder { color: var(--text-3); }
textarea.form-control { min-height: 80px; resize: vertical; }
select.form-control { cursor: pointer; }
.form-hint { font-size: 11.5px; color: var(--text-3); margin-top: 4px; line-height: 1.5; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.radio-group { display: flex; gap: 16px; flex-wrap: wrap; }
.radio-item {
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; font-size: 13px; color: var(--text-2);
}
.radio-item input { cursor: pointer; accent-color: var(--text-1); }
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px;
}
.checkbox-item {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-2);
  transition: var(--transition);
}
.checkbox-item:hover { border-color: var(--border-2); background: var(--surface-2); }
.checkbox-item input { accent-color: var(--text-1); }
.input-picker { display: flex; gap: 8px; }
.input-picker .form-control { flex: 1; }
.btn-pick {
  padding: 8px 12px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
  transition: var(--transition);
}
.btn-pick:hover { background: var(--text-1); color: #FFF; border-color: var(--text-1); }
.readonly-pick { cursor: pointer !important; }

/* ── Drop zone ───────────────────────────────────────── */
.drop-zone {
  border: 1.5px dashed var(--border-2);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--surface-2);
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--text-1);
  background: var(--surface);
}
.drop-zone.has-file { border-color: var(--text-1); background: var(--surface); }
.drop-zone-icon { font-size: 24px; margin-bottom: 6px; opacity: .5; }
.drop-zone-text { font-size: 12.5px; color: var(--text-3); line-height: 1.6; }

/* ── Alerts ──────────────────────────────────────────── */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  border: 1px solid transparent;
  line-height: 1.5;
  width: 100%;
  box-sizing: border-box;
}
.alert-success { background: var(--surface-2); color: var(--text-1); border-color: var(--border-2); }
.alert-danger  { background: var(--surface-2); color: var(--text-1); border-color: var(--border-2); }
.alert-warning { background: var(--surface-2); color: var(--text-2); border-color: var(--border-2); }
.alert-info    { background: var(--surface-2); color: var(--text-2); border-color: var(--border-2); }
.mt-14 { margin-top: 14px; }

/* ── Tables ──────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left;
  padding: 9px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text-2); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-2); }

/* ── Modal ───────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 200;
  background: rgba(9,9,11,.4);
  backdrop-filter: blur(3px);
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 580px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  animation: modalIn .18s cubic-bezier(.22,.68,0,1.2);
}
@keyframes modalIn { from{transform:scale(.95)translateY(8px);opacity:0} to{transform:scale(1)translateY(0);opacity:1} }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px; font-weight: 700;
  letter-spacing: -.2px;
}
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 20px; color: var(--text-3); line-height: 1;
  padding: 2px 6px; border-radius: 4px;
  transition: var(--transition);
}
.modal-close:hover { background: var(--surface-2); color: var(--text-1); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

/* ── Overlay (OV alerts) ─────────────────────────────── */
.overlay-backdrop {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: rgba(9,9,11,.5);
  backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
}
.overlay-backdrop.open { display: flex; }
.overlay-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 28px;
  max-width: 400px; width: 92%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: modalIn .18s cubic-bezier(.22,.68,0,1.2);
}
.overlay-close-x {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; font-size: 18px;
  color: var(--text-3); cursor: pointer; padding: 4px 6px;
  border-radius: 4px; transition: var(--transition);
}
.overlay-close-x:hover { background: var(--surface-2); color: var(--text-1); }
.ov-icon  { font-size: 40px; margin-bottom: 12px; display: block; }
.ov-title { font-family:'Inter',system-ui,sans-serif; font-size:16px; font-weight:700; color:var(--text-1); margin-bottom:8px; }
.ov-msg   { font-size:13px; color:var(--text-2); line-height:1.6; margin-bottom:20px; }
.ov-btns  { display:flex; gap:8px; justify-content:center; flex-wrap:wrap; }

/* ── Time picker ─────────────────────────────────────── */
.time-input-wrap { position: relative; }
.time-picker-popup {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 300;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 16px; min-width: 180px;
}
.time-picker-popup.open { display: block; }
.time-picker-row { display: flex; align-items: center; gap: 8px; justify-content: center; }
.time-spinner { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.time-spinner button {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 4px; width: 34px; height: 26px;
  font-size: 12px; cursor: pointer; transition: var(--transition); color: var(--text-2);
}
.time-spinner button:hover { background: var(--text-1); color: #FFF; border-color: var(--text-1); }
.time-val {
  font-size: 22px; font-weight: 700; color: var(--text-1);
  width: 46px; text-align: center; font-family: 'Inter', monospace;
}
.time-sep { font-size: 22px; font-weight: 700; color: var(--text-3); }
.time-picker-label { font-size: 11px; color: var(--text-3); margin-top: 10px; text-align: center; }
.time-picker-confirm {
  display: block; width: 100%; margin-top: 10px; padding: 7px;
  background: var(--text-1); color: #FFF; border: none; border-radius: var(--radius);
  font-size: 12px; font-weight: 600; cursor: pointer; transition: var(--transition);
}
.time-picker-confirm:hover { opacity: .85; }

/* ── Progress bars ───────────────────────────────────── */
.progress-section { margin-bottom: 18px; }
.progress-msg-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px; height: 20px; gap: 8px;
}
.progress-msg-text {
  font-size: 13px; font-weight: 500; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.progress-msg-pct {
  font-size: 13px; font-weight: 700; color: var(--text-1);
  flex-shrink: 0; white-space: nowrap; min-width: 36px; text-align: right;
}
.progress-bar-wrap {
  width: 100%; height: 6px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 99px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; background: var(--text-1); border-radius: 99px;
  transition: width .4s ease;
}
.progress-bar-fill.progress-bar-error { background: var(--text-3); }
.progress-bar-fill.progress-bar-done  { background: var(--text-1); }

/* ── Video list ──────────────────────────────────────── */
.video-list-wrap { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.video-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 13px;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface-2); transition: var(--transition);
}
.video-item.uploading { background: var(--surface); border-color: var(--border-2); }
.video-item.done      { background: var(--surface-2); border-color: var(--border); }
.video-item.error     { background: var(--surface-2); border-color: var(--border-2); }
.video-item .vi-icon  { font-size: 14px; flex-shrink: 0; }
.video-item .vi-name  { flex: 1; font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-item .vi-right { font-size: 11.5px; color: var(--text-3); flex-shrink: 0; text-align: right; white-space: nowrap; }

/* ── Divider ─────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.term-label { font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }

/* ── Terminal ────────────────────────────────────────── */
.terminal {
  background: var(--text-1); color: #E4E4E7;
  border-radius: var(--radius); padding: 14px;
  font-family: 'Inter', monospace; font-size: 12px;
  min-height: 120px; max-height: 300px;
  overflow-y: auto; white-space: pre-wrap; line-height: 1.7;
}

/* ── Stats cards ─────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.stat-val {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 28px; font-weight: 800;
  color: var(--text-1); line-height: 1;
}
.stat-lbl { font-size: 12px; color: var(--text-3); margin-top: 5px; font-weight: 500; }
.stat-card-sm { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; }
.stat-card-sm .val { font-family:'Inter',system-ui,sans-serif; font-size:24px; font-weight:800; color:var(--text-1); }
.stat-card-sm .lbl { font-size:11.5px; color:var(--text-3); margin-top:3px; }

/* ── Plans ───────────────────────────────────────────── */
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.plan-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.plan-card:hover { box-shadow: var(--shadow); border-color: var(--border-2); }
.plan-card.featured {
  border-color: var(--text-1);
  box-shadow: 0 0 0 1px var(--text-1), var(--shadow);
}
.plan-name {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-1); margin-bottom: 8px;
}
.plan-price {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 30px; font-weight: 800;
  color: var(--text-1); line-height: 1;
  margin-bottom: 14px;
}
.plan-price span { font-size: 13px; color: var(--text-3); font-weight: 400; }
.plan-features {
  font-size: 12.5px; color: var(--text-2);
  line-height: 2; border-top: 1px solid var(--border);
  padding-top: 12px; margin-bottom: 16px;
}
.plan-current-badge {
  text-align: center; padding: 7px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 12px; font-weight: 600; color: var(--text-3);
}

/* ── Empty state ─────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 20px; text-align: center;
}
.empty-icon { font-size: 40px; opacity: .3; margin-bottom: 14px; display: block; }
.empty-state h3 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px; font-weight: 700;
  color: var(--text-1); margin-bottom: 6px;
}
.empty-state p { font-size: 13px; color: var(--text-3); }

/* ── Auth pages ──────────────────────────────────────── */
.auth-page {
  min-height: 100vh; width: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  padding: 20px;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 36px 32px;
  width: 100%; max-width: 380px;
  box-shadow: var(--shadow-lg);
}
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo-mark {
  width: 48px; height: 48px;
  background: var(--text-1); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.auth-logo-mark svg { width: 26px; height: 26px; }
.auth-title { font-family:'Inter',system-ui,sans-serif; font-size:20px; font-weight:800; letter-spacing:-.3px; text-align:center; margin-bottom:4px; }
.auth-sub { font-size:13px; color:var(--text-3); text-align:center; margin-bottom:22px; }
.auth-footer { text-align:center; font-size:12.5px; color:var(--text-3); margin-top:20px; }
.auth-footer a { color:var(--text-1); font-weight:600; }

/* ── Utilities ───────────────────────────────────────── */
.flex-center { display: flex; align-items: center; }
.gap-12 { gap: 12px; }
.gap-8 { gap: 8px; }

/* ── Responsive ──────────────────────────────────────── */
/* ── Mobile top navbar ───────────────────────────────────────────────────── */
.mobile-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.mobile-topbar .mob-logo img { height: 44px; width: auto; display: block; }
.hamburger {
  width: 38px; height: 38px;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px;
  transition: var(--transition); flex-shrink: 0;
}
.hamburger:hover { background: var(--surface-2); }
.hamburger span {
  display: block; width: 18px; height: 2px;
  background: var(--text-1); border-radius: 2px;
  transition: all .25s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Drawer overlay */
.drawer-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 200;
  backdrop-filter: blur(2px);
}
.drawer-overlay.open { display: block; }

/* Mobile drawer (sidebar slides in from left) */
.mob-drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: min(280px, 85vw);
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 201; overflow-y: auto;
  transform: translateX(-100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
}
.mob-drawer.open { transform: translateX(0); }
.mob-drawer .logo-lockup {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.mob-drawer .sidebar-nav {
  flex: 1; padding: 10px 10px; display: flex;
  flex-direction: column; gap: 1px; overflow-y: auto;
}
.mob-drawer .sidebar-footer {
  padding: 12px 14px 20px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  body { flex-direction: column; }
  /* Hide desktop sidebar */
  .sidebar { display: none; }
  /* Show mobile topbar */
  .mobile-topbar { display: flex; }
  /* Content fills screen */
  .main-content { min-height: calc(100vh - 57px); }
  .page-header { padding: 16px; flex-wrap: wrap; gap: 10px; }
  .page-body { padding: 14px; gap: 14px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .channel-card { flex-wrap: wrap; }
  .channel-actions { width: 100%; justify-content: flex-end; }
  .modal { max-height: 95vh; margin: 0 10px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .plans-grid { grid-template-columns: 1fr; }
  .page-header h1 { font-size: 18px; }
  .table-wrap { font-size: 12px; }
  .auth-card { padding: 24px 20px; }
}

/* ── Scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

.logo-lockup { display:flex; align-items:center; justify-content:center; padding:18px 18px 14px; border-bottom:1px solid var(--border); text-decoration:none; }
.logo-lockup img { height:64px; width:auto; display:block; }

/* ── Stat icon ─────────────────────────────────────────────────────────────── */
.stat-icon-wrap {
  width: 36px; height: 36px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
/* ── Onboarding banner ───────────────────────────────────────────────────────── */
.onboarding-step {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.onboarding-step:last-child { border-bottom: none; }
.step-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--text-1); color: #FFF;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.step-num.done { background: var(--text-3); }
/* ── Filter bar ──────────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.filter-bar select, .filter-bar input {
  font-size: 13px; padding: 5px 10px; height: 32px;
}
/* ── Responsive grid ─────────────────────────────────────────────────────────── */
.responsive-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 768px) {
  .responsive-grid { grid-template-columns: 1fr; }
}
/* ── Quota bar ───────────────────────────────────────────────────────────────── */
.quota-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px;
  margin-bottom: 14px;
}
.quota-label { font-size: 13px; color: var(--text-2); flex: 1; }
.quota-nums { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.quota-track {
  width: 140px; height: 5px; background: var(--border);
  border-radius: 99px; overflow: hidden; flex-shrink: 0;
}
.quota-fill { height: 100%; border-radius: 99px; background: var(--text-1); transition: width .4s; }
.quota-fill.warn { background: var(--text-3); }
.quota-fill.full { background: var(--text-1); }
/* ── Plan change action buttons ──────────────────────────────────────────────── */
.plan-change-actions { display:flex; gap:10px; flex-wrap:wrap; }
.plan-change-actions .btn { min-width:0; white-space:normal; word-break:break-word; }
@media (max-width:480px) { .plan-change-actions { flex-direction:column; } .plan-change-actions .btn { width:100%; justify-content:center; } }
