/* ===== YOUTUBE CHANNELS – Enterprise Compact ===== */

/* Page */
.yt-page { max-width: 1100px; margin: 0 auto; padding: 0; }
.yt-page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.yt-page-header h2 { margin: 0 0 2px; font-size: 22px; }
.yt-page-header p { color: var(--muted); font-size: 12px; margin: 0; }

/* Stats */
.yt-stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
.yt-stat { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); min-height: 80px; }
.yt-stat-value { font: 700 22px Manrope; color: var(--text); }
.yt-stat-label { font: 600 10px 'DM Mono'; letter-spacing: .8px; color: var(--muted); margin-top: 2px; text-transform: uppercase; }

/* Channels Section */
.yt-channels-section { margin-bottom: 16px; }
.yt-channels-section h3 { font-size: 15px; margin: 0 0 12px; }

/* Table */
.yt-table { width: 100%; border-collapse: collapse; font-size: 13px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.yt-table thead { background: var(--panel2); }
.yt-table th { padding: 10px 14px; font: 600 10px 'DM Mono'; letter-spacing: .6px; color: var(--muted); text-transform: uppercase; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.yt-table td { padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.04); color: var(--text-secondary); vertical-align: middle; }
.yt-table tbody tr:hover { background: rgba(255,255,255,.02); }
.yt-table tbody tr:last-child td { border-bottom: none; }
.yt-td-channel { display: flex; align-items: center; gap: 10px; }
.yt-td-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--line); flex-shrink: 0; }
.yt-td-channel b { display: block; font: 600 13px Manrope; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.yt-td-channel small { font: 400 11px Manrope; color: var(--muted); }
.yt-owner-badge { display: inline-flex; padding: 2px 8px; border-radius: 4px; font: 600 10px Manrope; background: rgba(59,130,246,.1); color: #3b82f6; margin-right: 6px; }
.yt-status-pill { display: inline-flex; padding: 3px 10px; border-radius: 6px; font: 600 11px Manrope; }
.yt-status-pill.connected { background: rgba(220,38,38,.1); color: #dc2626; }
.yt-status-pill.disconnected { background: rgba(239,68,68,.1); color: #ef4444; }
.yt-td-actions { display: flex; gap: 6px; align-items: center; }
.yt-td-actions .secondary-page { padding: 5px 10px; font-size: 11px; height: 28px; }

/* ====== Right-side Channel Drawer ====== */
.yt-act-trigger {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 6px;
  border: 1px solid var(--line); background: transparent;
  color: var(--muted); cursor: pointer; transition: all 150ms;
}
.yt-act-trigger:hover { background: var(--panel2); color: var(--text); border-color: var(--accent); }

.dr-wrap { position: fixed; inset: 0; z-index: var(--z-drawer); pointer-events: none; }
.dr-wrap.dr-open { pointer-events: auto; }
.dr-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: var(--z-drawer); opacity: 0; transition: opacity 200ms ease; pointer-events: auto; }
.dr-wrap.dr-open .dr-overlay { opacity: 1; }
.dr-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: calc(var(--z-drawer) + 1);
  width: 380px; max-width: 90vw;
  background: var(--panel); color: var(--text);
  box-shadow: -8px 0 40px rgba(0,0,0,0.35);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 250ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: auto;
}
.dr-wrap.dr-open .dr-panel { transform: translateX(0); }
.dr-header {
  display: flex; align-items: center; gap: 12px; padding: 16px 14px;
  border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.dr-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--line); flex-shrink: 0; }
.dr-info { flex: 1; min-width: 0; }
.dr-info b { display: block; font: 600 14px Manrope; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-info small { display: block; font: 400 11px Manrope; color: var(--muted); margin-top: 1px; }
.dr-info .yt-status-pill { margin-top: 4px; }
.dr-close {
  width: 32px; height: 32px; border-radius: 6px; border: 0;
  background: var(--panel2); color: var(--muted); font-size: 20px; line-height: 1;
  cursor: pointer; display: grid; place-items: center; flex-shrink: 0;
}
.dr-close:hover { background: var(--line); color: var(--text); }
.dr-body { flex: 1; overflow-y: auto; padding: 4px 0 16px; }
.dr-section { padding: 10px 14px; }
.dr-section-title { font: 600 10px 'DM Mono'; letter-spacing: .6px; color: var(--muted); text-transform: uppercase; margin-bottom: 6px; }
.dr-section-danger .dr-section-title { color: #ef4444; }
.dr-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 10px; margin-bottom: 2px;
  border: 0; background: none; border-radius: 6px;
  color: var(--text); font: 500 13px Manrope; cursor: pointer;
  text-align: left; transition: background 150ms;
}
.dr-btn:hover { background: var(--panel2); }
.dr-btn svg { flex-shrink: 0; width: 16px; height: 16px; color: var(--muted); }
.dr-btn:hover svg { color: var(--text); }
.dr-danger { color: #ef4444; }
.dr-danger svg { color: #ef4444; }
.dr-danger:hover { background: rgba(239,68,68,0.1) !important; }
.dr-danger:hover svg { color: #ef4444; }

/* Empty State */
.yt-empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); text-align: center; min-height: 240px; }
.yt-empty-icon { width: 56px; height: 56px; border-radius: 14px; background: rgba(255,0,0,.1); display: grid; place-items: center; color: #ef4444; margin-bottom: 14px; }

/* Toolbar */
.yt-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.yt-search-inline { flex: 1; min-width: 200px; }
.yt-toolbar-input { width: 100%; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); font: 500 13px Manrope; box-sizing: border-box; }
.yt-toolbar-input:focus { border-color: #3b82f6; outline: none; }
.yt-toolbar-input::placeholder { color: var(--muted); }
.yt-toolbar-select { height: 36px; padding: 0 28px 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); font: 500 12px Manrope; cursor: pointer; appearance: auto; }
.yt-toolbar-select:focus { border-color: #3b82f6; outline: none; }

/* Tabs */
.yt-tab-bar { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.yt-tab { padding: 10px 18px; border: 0; background: none; color: var(--muted); font: 600 13px Manrope; cursor: pointer; border-bottom: 2px solid transparent; transition: all .15s; }
.yt-tab:hover { color: var(--text); }
.yt-tab.active { color: #3b82f6; border-bottom-color: #3b82f6; }

/* Pagination */
.yt-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 0; }
.yt-page-info { font: 500 12px Manrope; color: var(--muted); }

/* Filter Note */
.yt-filter-note { font: 500 12px Manrope; color: var(--muted); text-align: center; padding: 8px 0; margin: 0; }

/* Status Pills */
.yt-status-pill.processing { background: rgba(124,58,237,.1); color: #7c3aed; }
.yt-status-pill.review { background: rgba(245,158,11,.1); color: #f59e0b; }
.yt-status-pill.submitted { background: rgba(59,130,246,.1); color: #3b82f6; }
.yt-status-pill.failed { background: rgba(239,68,68,.1); color: #ef4444; }
.yt-status-pill.rejected { background: rgba(239,68,68,.1); color: #ef4444; }
.yt-empty-state h3 { margin: 0 0 6px; font-size: 16px; }
.yt-empty-state p { color: var(--muted); font-size: 13px; margin: 0 0 16px; max-width: 380px; line-height: 1.5; }

/* ===== WIZARD – Compact Modal ===== */
.yt-wiz-subtitle { color: var(--muted); font-size: 13px; margin: 0 0 12px; line-height: 1.5; }
.yt-radio-group { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }
.yt-radio { display: flex; align-items: flex-start; gap: 10px; padding: 14px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; transition: all .15s; }
.yt-radio:hover { border-color: #3b82f6; }
.yt-radio.selected { border-color: #3b82f6; background: rgba(59,130,246,.08); }
.yt-radio input[type="radio"] { margin-top: 2px; accent-color: #3b82f6; width: 16px; height: 16px; }
.yt-radio-content { display: flex; flex-direction: column; gap: 2px; }
.yt-radio-content b { font: 600 13px Manrope; color: var(--text); }
.yt-radio-content small { font: 500 11px Manrope; color: var(--muted); line-height: 1.4; }

/* Search */
.yt-search-wrap { position: relative; }
.yt-search-box { position: relative; }
.yt-search-box input { width: 100%; box-sizing: border-box; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); font: 500 13px Manrope; }
.yt-search-box input:focus { border-color: #3b82f6; outline: none; }
.yt-search-results { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; max-height: 180px; overflow-y: auto; z-index: 20; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.yt-search-results.hidden { display: none; }
.yt-search-item { width: 100%; border: 0; text-align: left; padding: 9px 12px; background: none; color: var(--text); font: 500 13px Manrope; cursor: pointer; border-bottom: 1px solid rgba(255,255,255,.04); height: 40px; display: flex; align-items: center; }
.yt-search-item:last-child { border-bottom: 0; }
.yt-search-item:hover, .yt-search-item:focus { background: var(--panel2); outline: none; }
.yt-search-item.selected { color: #3b82f6; font-weight: 700; }
.yt-search-empty { padding: 12px; text-align: center; color: var(--muted); font-size: 12px; }

/* Info boxes (step 2) */
.yt-wiz-info { display: flex; flex-direction: column; gap: 12px; }
.yt-info-box { display: flex; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); }
.yt-info-icon { width: 32px; height: 32px; border-radius: 8px; background: rgba(59,130,246,.12); display: grid; place-items: center; font-size: 16px; flex: 0 0 auto; }
.yt-info-box h3 { font: 600 13px Manrope; color: var(--text); margin: 0 0 3px; }
.yt-info-box p { font: 400 12px Manrope; color: var(--muted); line-height: 1.5; margin: 0; }

/* Invite (step 3) */
.yt-invite-summary { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); margin-bottom: 12px; }
.yt-invite-owner small { font: 600 10px 'DM Mono'; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.yt-invite-owner b { display: block; font: 600 13px Manrope; color: var(--text); margin-top: 2px; }
.yt-invite-summary p { font: 400 12px Manrope; color: var(--muted); margin: 8px 0 0; line-height: 1.5; }
.yt-invite-label { font: 500 13px Manrope; color: var(--text); }
.yt-invite-label input { width: 100%; box-sizing: border-box; height: 40px; margin-top: 5px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); font: 500 13px Manrope; }

/* Success (step 4) */
.yt-wiz-success { text-align: center; padding: 12px 0; }
.yt-success-icon { width: 52px; height: 52px; border-radius: 50%; background: #dc2626; display: inline-grid; place-items: center; font-size: 26px; color: #fff; margin-bottom: 12px; }
.yt-wiz-success h3 { font: 700 16px Manrope; color: var(--text); margin: 0 0 6px; }
.yt-wiz-success p { font: 400 13px Manrope; color: var(--muted); line-height: 1.5; margin: 0; }

/* Step Indicator */
.yt-step-indicator { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 20px; padding: 0 8px; }
.yt-step-dot { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 50px; }
.yt-step-dot span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 600 11px Manrope; background: var(--panel2); color: var(--muted); border: 1.5px solid var(--line); transition: all .2s; }
.yt-step-dot.active span { background: rgba(59,130,246,.12); color: #3b82f6; border-color: #3b82f6; }
.yt-step-dot.current span { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.yt-step-dot small { font: 500 10px Manrope; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.yt-step-dot.active small { color: #3b82f6; }
.yt-step-line { flex: 1; height: 1.5px; background: var(--line); margin: 0 4px; margin-bottom: 16px; }
.yt-step-line.active { background: #3b82f6; }

/* Field Labels */
.yt-wiz-field-label { font: 600 11px 'DM Mono', monospace; letter-spacing: .5px; color: var(--muted); text-transform: uppercase; margin-bottom: 6px; }

/* URL Input (step 2) */
.yt-url-input { width: 100%; box-sizing: border-box; height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); font: 500 13px Manrope; transition: border-color .15s; }
.yt-url-input:focus { border-color: #3b82f6; outline: none; }
.yt-url-hint { font: 400 12px Manrope; color: var(--muted); margin: 6px 0 0; line-height: 1.4; }

/* Loading Spinner */
.yt-wiz-loading { display: flex; align-items: center; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); margin: 12px 0; font: 500 13px Manrope; color: var(--muted); }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: #3b82f6; border-radius: 50%; animation: ytSpin .6s linear infinite; flex-shrink: 0; }
@keyframes ytSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* Channel Preview Card (step 3) */
.yt-preview-card { border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); overflow: hidden; }
.yt-preview-header { display: flex; align-items: center; gap: 14px; padding: 18px; border-bottom: 1px solid var(--line); }
.yt-preview-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--line); flex-shrink: 0; }
.yt-preview-name { font: 700 16px Manrope; color: var(--text); }
.yt-preview-handle { font: 400 12px Manrope; color: var(--muted); margin-top: 2px; }
.yt-preview-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.yt-preview-stat { display: flex; flex-direction: column; align-items: center; padding: 14px 8px; }
.yt-preview-stat:not(:last-child) { border-right: 1px solid var(--line); }
.yt-preview-stat-val { font: 700 18px Manrope; color: var(--text); }
.yt-preview-stat-label { font: 500 10px 'DM Mono'; letter-spacing: .5px; color: var(--muted); text-transform: uppercase; margin-top: 2px; }
.yt-preview-connected { padding: 14px 18px; }
.yt-preview-connected small { font: 600 10px 'DM Mono'; letter-spacing: .5px; color: var(--muted); text-transform: uppercase; }
.yt-preview-owner { margin-top: 4px; font: 500 13px Manrope; color: var(--text); }

/* Modal sizing */
#modal .modal-card { max-width: 580px; }

/* Force light inputs in wizard modal */
#modal .yt-url-input,
#modal .yt-search-box input,
#modal .yt-toolbar-input,
#modal .yt-invite-label input,
#modal input[type="text"],
#modal input[type="email"],
#modal select {
  background: #fff !important;
  color: #1A1A2E !important;
  border-color: #E5E7EB !important;
}
#modal input::placeholder { color: #9CA3AF !important; }
#modal input:focus { border-color: #3b82f6 !important; outline: none !important; box-shadow: 0 0 0 3px rgba(59,130,246,.12) !important; }

@media (max-width: 720px) {
  .yt-stats-row { grid-template-columns: 1fr; }
  .yt-radio-group { grid-template-columns: 1fr; }
  .yt-table { font-size: 12px; }
  .yt-table th, .yt-table td { padding: 8px 10px; }
  .yt-td-channel b { max-width: 140px; }
  .yt-page-header { flex-direction: column; gap: 12px; }
  .yt-toolbar { flex-direction: column; align-items: stretch; }
  .yt-search-inline { min-width: 100%; }
  .yt-toolbar-select { width: 100%; }
  .yt-tab-bar { overflow-x: auto; }
  .yt-td-actions { flex-direction: column; }
  .yt-td-actions .secondary-page { width: 100%; text-align: center; }
}