/* ==========================================================================
   HIMALAYA UNFOLDED — STUDIO COMMAND CENTER ("KHATRA DASHBOARD")
   Obsidian Glassmorphism · Himalayan Gold · Executive Dark Editorial UI
   ========================================================================== */

:root {
  --bg-base: #070B14;
  --bg-elevated: #0E1628;
  --bg-card: rgba(14, 22, 40, 0.78);
  --bg-card-solid: #0F182C;
  --bg-surface-2: rgba(19, 30, 54, 0.72);
  --bg-input: rgba(8, 13, 25, 0.85);

  --border-subtle: rgba(148, 163, 184, 0.12);
  --border-hover: rgba(245, 184, 38, 0.34);
  --border-highlight: rgba(255, 255, 255, 0.06);

  --gold: #F5B826;
  --gold-bright: #FCD34D;
  --gold-dim: rgba(245, 184, 38, 0.14);
  --gold-glow: rgba(245, 184, 38, 0.25);

  --emerald: #10B981;
  --emerald-dim: rgba(16, 185, 129, 0.14);
  --cyan: #38BDF8;
  --cyan-dim: rgba(56, 189, 248, 0.14);
  --crimson: #EF4444;
  --crimson-dim: rgba(239, 68, 68, 0.14);
  --amber: #F59E0B;
  --violet: #A78BFA;

  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-editorial: 'Oswald', Impact, 'Arial Narrow', sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', Menlo, Monaco, Consolas, monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-card: 0 12px 32px -12px rgba(2, 6, 23, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --shadow-glow-gold: 0 0 28px -6px rgba(245, 184, 38, 0.32);

  --sidebar-width: 274px;
  --transition: 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: rgba(148, 163, 184, 0.12);
  padding: 2px 6px;
  border-radius: 5px;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--text-secondary);
}

.text-emerald { color: var(--emerald); }
.text-gold { color: var(--gold); }
.text-cyan { color: var(--cyan); }
.text-crimson { color: var(--crimson); }

/* Ambient Obsidian Backdrop */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.22;
}

.orb-gold {
  width: 560px;
  height: 560px;
  top: -220px;
  left: 16%;
  background: radial-gradient(circle, rgba(245, 184, 38, 0.52), transparent 68%);
}

.orb-cyan {
  width: 520px;
  height: 520px;
  bottom: -200px;
  right: -120px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.38), transparent 68%);
}

.ambient-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 100%);
}

/* ==========================================================================
   APP SHELL & STICKY SIDEBAR
   ========================================================================== */
.app-shell {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: var(--sidebar-width);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 16px;
  background: rgba(9, 14, 26, 0.86);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-right: 1px solid var(--border-subtle);
  overflow-y: auto;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Brand Lockup */
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 4px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(245, 184, 38, 0.2);
}

.brand-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-title {
  font-family: var(--font-editorial);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  line-height: 1.1;
}

.brand-sub {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--gold);
  margin-top: 3px;
}

/* Channel Status Card */
.channel-status-card {
  background: linear-gradient(180deg, rgba(19, 30, 54, 0.72), rgba(11, 18, 34, 0.85));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.channel-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.channel-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(245, 184, 38, 0.25), rgba(56, 189, 248, 0.2));
  border: 1.5px solid rgba(245, 184, 38, 0.45);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}

.channel-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-fallback {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--gold-bright);
}

.channel-meta {
  min-width: 0;
  flex: 1;
}

.channel-handle {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-subline {
  font-size: 11px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* Pulsing API Status Pill */
.api-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.12);
  color: #34D399;
}

.api-pill.is-snapshot {
  border-color: rgba(245, 158, 11, 0.38);
  background: rgba(245, 158, 11, 0.12);
  color: #FBBF24;
}

.api-pill.is-offline {
  border-color: rgba(239, 68, 68, 0.38);
  background: rgba(239, 68, 68, 0.12);
  color: #F87171;
}

.api-pill.is-loading {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.12);
  color: var(--cyan);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  position: relative;
  flex-shrink: 0;
}

.api-pill.is-live .pulse-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  animation: pulseRing 1.9s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes pulseRing {
  0% { transform: scale(0.7); opacity: 0.9; }
  80%, 100% { transform: scale(1.9); opacity: 0; }
}

/* Navigation */
.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 20px 0 auto;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.nav-item:hover {
  background: rgba(148, 163, 184, 0.07);
  color: var(--text-primary);
}

.nav-item.is-active {
  background: linear-gradient(90deg, rgba(245, 184, 38, 0.16), rgba(245, 184, 38, 0.04));
  border-color: rgba(245, 184, 38, 0.32);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--gold);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.nav-item.is-active .nav-icon {
  color: var(--gold);
}

.nav-icon svg {
  width: 18px;
  height: 18px;
}

.nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-badge {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.nav-badge.badge-gold {
  background: var(--gold-dim);
  color: var(--gold-bright);
  border: 1px solid rgba(245, 184, 38, 0.3);
}

/* Sidebar Footer */
.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.autopilot-widget {
  background: rgba(11, 18, 34, 0.72);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 11px 12px;
}

.autopilot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.autopilot-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
}

.autopilot-desc {
  margin: 0 0 5px;
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 500;
}

.autopilot-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.last-sync-note {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================================================================
   BUTTONS & PILLS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

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

.btn-primary {
  background: linear-gradient(135deg, #F5B826 0%, #D99611 100%);
  color: #090D16;
  box-shadow: 0 6px 20px -6px rgba(245, 184, 38, 0.55);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #FCD34D 0%, #EAB308 100%);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -6px rgba(245, 184, 38, 0.65);
}

.btn-emerald {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #04130D;
  box-shadow: 0 6px 20px -6px rgba(16, 185, 129, 0.5);
}

.btn-emerald:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-refresh {
  width: 100%;
  background: rgba(245, 184, 38, 0.11);
  border-color: rgba(245, 184, 38, 0.34);
  color: var(--gold-bright);
  padding: 10px 14px;
}

.btn-refresh:hover:not(:disabled) {
  background: rgba(245, 184, 38, 0.2);
  border-color: var(--gold);
}

.btn-refresh.is-spinning .icon-spin-target {
  animation: spin 0.85s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn-ghost {
  background: rgba(148, 163, 184, 0.08);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(148, 163, 184, 0.16);
  border-color: rgba(148, 163, 184, 0.28);
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
}

.btn-lg {
  padding: 11px 18px;
  font-size: 13.5px;
}

.pill, .status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pill-gold {
  background: var(--gold-dim);
  color: var(--gold-bright);
  border: 1px solid rgba(245, 184, 38, 0.32);
}

.pill-cyan {
  background: var(--cyan-dim);
  color: #7DD3FC;
  border: 1px solid rgba(56, 189, 248, 0.32);
}

.pill-emerald, .chip-emerald {
  background: var(--emerald-dim);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.32);
}

.pill-crimson {
  background: var(--crimson-dim);
  color: #FCA5A5;
  border: 1px solid rgba(239, 68, 68, 0.32);
}

.pill-muted {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-secondary);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

/* ==========================================================================
   MAIN WORKSPACE & TOPBAR
   ========================================================================== */
.main-workspace {
  flex: 1;
  min-width: 0;
  padding: 24px 30px 48px;
  max-width: 1520px;
  margin: 0 auto;
  width: 100%;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.topbar-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--gold);
  margin-bottom: 4px;
}

.topbar-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(22px, 2.3vw, 29px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.15;
}

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

.npt-clock {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
}

.npt-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.npt-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.npt-time {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Mode Banner */
.mode-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 18px;
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.11);
  border: 1px solid rgba(245, 158, 11, 0.34);
  color: #FDE68A;
  font-size: 12.5px;
}

.mode-banner-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  flex-shrink: 0;
}

/* Tab Panels */
.tab-panel {
  display: none;
  flex-direction: column;
  gap: 20px;
  animation: fadeSlideIn 220ms ease-out;
}

.tab-panel.is-active {
  display: flex;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Glass Cards */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
}

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

.card-kicker {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.card-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* ==========================================================================
   TAB 1: HERO KPIS, YPP TRACKER, ALERTS, SVG CHART, VIDEOS TABLE
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.kpi-card {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  opacity: 0.9;
}

.kpi-card::after {
  content: '';
  position: absolute;
  top: -40px;
  right: -30px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  filter: blur(36px);
  opacity: 0.16;
  pointer-events: none;
}

.kpi-gold::before { background: linear-gradient(90deg, var(--gold), transparent); }
.kpi-gold::after { background: var(--gold); }
.kpi-cyan::before { background: linear-gradient(90deg, var(--cyan), transparent); }
.kpi-cyan::after { background: var(--cyan); }
.kpi-emerald::before { background: linear-gradient(90deg, var(--emerald), transparent); }
.kpi-emerald::after { background: var(--emerald); }
.kpi-amber::before { background: linear-gradient(90deg, #FBBF24, transparent); }
.kpi-amber::after { background: #FBBF24; }

.kpi-card:hover {
  border-color: rgba(148, 163, 184, 0.25);
  transform: translateY(-2px);
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.kpi-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.11em;
  color: var(--text-secondary);
}

.kpi-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-secondary);
}

.kpi-gold .kpi-icon { color: var(--gold); background: var(--gold-dim); }
.kpi-cyan .kpi-icon { color: var(--cyan); background: var(--cyan-dim); }
.kpi-emerald .kpi-icon { color: var(--emerald); background: var(--emerald-dim); }
.kpi-amber .kpi-icon { color: #FBBF24; background: rgba(251, 191, 36, 0.14); }

.kpi-icon svg {
  width: 16px;
  height: 16px;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: clamp(26px, 2.5vw, 34px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  margin-bottom: 8px;
}

.kpi-foot {
  font-size: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.kpi-split-bar {
  display: flex;
  height: 5px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.14);
  margin: 0 0 8px;
  gap: 2px;
}

.split-long {
  background: var(--gold);
  border-radius: 999px;
  transition: width 400ms ease;
}

.split-short {
  background: var(--cyan);
  border-radius: 999px;
  transition: width 400ms ease;
}

/* Split Grid 7/5 */
.split-grid-7-5 {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 20px;
}

/* YPP Tracker */
.ypp-rings-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.ypp-meter-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(8, 13, 25, 0.56);
  border: 1px solid var(--border-subtle);
}

.ring-wrap {
  position: relative;
  width: 82px;
  height: 82px;
  flex-shrink: 0;
}

.progress-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: rgba(148, 163, 184, 0.14);
  stroke-width: 9;
}

.ring-fill {
  fill: none;
  stroke-width: 9;
  stroke-linecap: round;
  transition: stroke-dashoffset 800ms cubic-bezier(0.22, 1, 0.36, 1);
}

.ring-gold {
  stroke: var(--gold);
  filter: drop-shadow(0 0 6px rgba(245, 184, 38, 0.45));
}

.ring-emerald {
  stroke: var(--emerald);
  filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.45));
}

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ring-pct {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.ring-sublabel {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-top: 3px;
}

.ypp-meter-info {
  flex: 1;
  min-width: 0;
}

.ypp-metric-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.ypp-metric-val {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 3px 0 8px;
  font-variant-numeric: tabular-nums;
}

.bar-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  overflow: hidden;
}

.bar-track.bar-lg {
  height: 9px;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 800ms cubic-bezier(0.22, 1, 0.36, 1);
}

.fill-gold { background: linear-gradient(90deg, #D97706, #F5B826, #FDE047); }
.fill-emerald { background: linear-gradient(90deg, #059669, #10B981, #34D399); }
.fill-cyan { background: linear-gradient(90deg, #0284C7, #38BDF8, #7DD3FC); }

.ypp-shorts-row {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(8, 13, 25, 0.56);
  border: 1px solid var(--border-subtle);
  margin-bottom: 14px;
}

.ypp-shorts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 12.5px;
  flex-wrap: wrap;
}

.ypp-shorts-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
}

.dot-cyan, .dot-emerald, .dot-gold {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot-cyan { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.dot-emerald { background: var(--emerald); box-shadow: 0 0 8px var(--emerald); }
.dot-gold { background: var(--gold); box-shadow: 0 0 8px var(--gold); }

.ypp-shorts-val {
  font-family: var(--font-display);
  font-weight: 600;
  color: #7DD3FC;
  font-variant-numeric: tabular-nums;
}

.top-video-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, rgba(245, 184, 38, 0.1), rgba(14, 22, 40, 0.4));
  border: 1px solid rgba(245, 184, 38, 0.24);
  font-size: 12.5px;
}

.top-video-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.top-video-title {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Algorithm Diagnostic Alerts */
.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 318px;
  overflow-y: auto;
  padding-right: 2px;
}

.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 13px;
  border-radius: var(--radius-md);
  background: rgba(8, 13, 25, 0.65);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--gold);
  font-size: 12.5px;
  line-height: 1.48;
  color: #E2E8F0;
}

.alert-item.sev-critical {
  border-left-color: var(--crimson);
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.1), rgba(8, 13, 25, 0.65));
}

.alert-item.sev-positive {
  border-left-color: var(--emerald);
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.1), rgba(8, 13, 25, 0.65));
}

.alert-item.sev-info {
  border-left-color: var(--cyan);
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.1), rgba(8, 13, 25, 0.65));
}

.alert-icon {
  font-size: 14px;
  line-height: 1.2;
  flex-shrink: 0;
}

/* Interactive SVG Chart */
.chart-card {
  position: relative;
}

.chart-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.swatch-gold { background: var(--gold); }
.swatch-cyan { background: var(--cyan); }

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: rgba(8, 13, 25, 0.78);
  border: 1px solid var(--border-subtle);
  gap: 2px;
}

.seg-btn {
  padding: 6px 11px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.seg-btn:hover {
  color: var(--text-primary);
}

.seg-btn.is-active {
  background: rgba(245, 184, 38, 0.16);
  color: var(--gold-bright);
}

.seg-count {
  font-family: var(--font-display);
  font-size: 11px;
  opacity: 0.85;
}

.chart-stage {
  width: 100%;
  min-height: 270px;
  position: relative;
}

.chart-svg {
  width: 100%;
  height: 280px;
  display: block;
  overflow: visible;
}

.chart-bar-group {
  cursor: pointer;
}

.chart-bar-rect {
  transition: opacity 160ms ease, filter 160ms ease;
}

.chart-bar-group:hover .chart-bar-rect {
  filter: brightness(1.18) drop-shadow(0 0 10px rgba(245, 184, 38, 0.35));
}

.chart-tooltip {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  width: 280px;
  padding: 12px 13px;
  border-radius: var(--radius-md);
  background: rgba(9, 14, 27, 0.96);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(245, 184, 38, 0.35);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.75);
}

.tt-head {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.tt-thumb {
  width: 56px;
  height: 32px;
  border-radius: 5px;
  object-fit: cover;
  background: #141E33;
  flex-shrink: 0;
}

.tt-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tt-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.tt-m-label {
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.tt-m-val {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* Videos Table */
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box svg {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 7px 11px 7px 31px;
  font-size: 12.5px;
  width: 210px;
  outline: none;
  transition: var(--transition);
}

.search-box input:focus,
.select-compact:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 184, 38, 0.14);
}

.select-compact {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 12.5px;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
}

.table-scroll {
  overflow-x: auto;
  margin: 0 -6px;
  padding: 0 6px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.data-table th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th.num,
.data-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.data-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.07);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 140ms ease;
}

.data-table tbody tr:hover {
  background: rgba(148, 163, 184, 0.05);
}

.video-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 420px;
}

.video-thumb-wrap {
  position: relative;
  width: 84px;
  height: 48px;
  border-radius: 7px;
  overflow: hidden;
  background: #101A2F;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.video-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-format-tag {
  position: absolute;
  bottom: 3px;
  right: 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(7, 11, 20, 0.88);
  color: var(--gold-bright);
}

.thumb-format-tag.is-short {
  color: var(--cyan);
}

.video-title-text {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-meta-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.empty-cell, .empty-state, .empty-state-inline {
  text-align: center;
  color: var(--text-secondary);
  padding: 28px 16px;
  font-size: 13px;
}

.empty-state-inline {
  padding: 18px 12px;
  background: rgba(8, 13, 25, 0.45);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-subtle);
}

/* ==========================================================================
   TAB 2: CONTENT CALENDAR ("KAHILE KUN CONTENT")
   ========================================================================== */
.rhythm-banner {
  background: linear-gradient(135deg, rgba(245, 184, 38, 0.1), rgba(14, 22, 40, 0.85) 45%, rgba(56, 189, 248, 0.08));
  border-color: rgba(245, 184, 38, 0.24);
}

.rhythm-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.rhythm-sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.rhythm-sub strong {
  color: var(--text-primary);
}

.rhythm-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.week-day-pill {
  padding: 10px 8px;
  border-radius: var(--radius-md);
  background: rgba(8, 13, 25, 0.65);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
}

.week-day-pill.is-long {
  background: rgba(245, 184, 38, 0.12);
  border-color: rgba(245, 184, 38, 0.42);
}

.week-day-pill.is-short {
  border-color: rgba(56, 189, 248, 0.24);
}

.wd-name {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.wd-type {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--cyan);
}

.week-day-pill.is-long .wd-type {
  color: var(--gold-bright);
}

.wd-time {
  font-size: 10.5px;
  color: var(--text-secondary);
}

/* 14-Day Grid */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
}

.cal-day-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-height: 178px;
  padding: 13px;
  border-radius: var(--radius-md);
  background: rgba(8, 13, 25, 0.66);
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
  position: relative;
}

.cal-day-card:hover {
  transform: translateY(-2px);
  border-color: rgba(148, 163, 184, 0.3);
}

.cal-day-card.format-long {
  background: linear-gradient(180deg, rgba(245, 184, 38, 0.1), rgba(8, 13, 25, 0.78));
  border-color: rgba(245, 184, 38, 0.35);
}

.cal-day-card.format-short {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.07), rgba(8, 13, 25, 0.76));
}

.cal-day-card.is-today {
  box-shadow: 0 0 0 1.5px var(--emerald), 0 8px 24px -10px rgba(16, 185, 129, 0.45);
}

.cal-day-card.is-clickable {
  cursor: pointer;
}

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.cal-date-box {
  display: flex;
  flex-direction: column;
}

.cal-day-name {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.cal-date-str {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.cal-time-line {
  font-size: 11px;
  font-weight: 600;
  color: var(--gold-bright);
  display: flex;
  align-items: center;
  gap: 5px;
}

.cal-day-card.format-short .cal-time-line {
  color: #7DD3FC;
}

.cal-ep-badge {
  font-family: var(--font-editorial);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.cal-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.09);
}

/* ==========================================================================
   TAB 3: GLOBAL PIPELINE & NEXT PLANNING
   ========================================================================== */
.pipeline-stats-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 14px;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
}

.pstat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pstat-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.11em;
  color: var(--text-muted);
}

.pstat-val {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pipeline-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.section-heading-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.count-pill {
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
}

.ready-pipeline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.ready-ep-card {
  background: var(--bg-card);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-card);
}

.ep-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ep-id-tag {
  font-family: var(--font-editorial);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(245, 184, 38, 0.16);
  color: var(--gold-bright);
  border: 1px solid rgba(245, 184, 38, 0.32);
  text-transform: uppercase;
}

.ep-card-title {
  margin: 6px 0 4px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.ep-tags-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.mini-thumb-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.mini-thumb-btn {
  position: relative;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  overflow: hidden;
  background: #0A101E;
  aspect-ratio: 16 / 9;
  cursor: pointer;
  transition: var(--transition);
}

.mini-thumb-btn:hover {
  border-color: var(--gold);
  transform: scale(1.02);
}

.mini-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mini-thumb-label {
  position: absolute;
  left: 6px;
  bottom: 6px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(7, 11, 20, 0.85);
  color: var(--gold-bright);
}

/* Queue List Cards */
.queue-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.queue-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 15px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
}

.queue-card:hover {
  border-color: rgba(245, 184, 38, 0.3);
  background: rgba(18, 28, 50, 0.85);
}

.queue-rank {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(8, 13, 25, 0.82);
  border: 1px solid var(--border-subtle);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--gold-bright);
}

.queue-card:first-child .queue-rank {
  background: var(--gold-dim);
  border-color: rgba(245, 184, 38, 0.45);
  box-shadow: 0 0 18px -4px rgba(245, 184, 38, 0.4);
}

.queue-main {
  min-width: 0;
}

.queue-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}

.queue-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.thumb-hook-badge {
  font-family: var(--font-editorial);
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 5px;
  background: #141F36;
  border: 1px solid rgba(245, 184, 38, 0.35);
  color: var(--gold-bright);
  text-transform: uppercase;
}

.queue-notes {
  margin: 5px 0 0;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.queue-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ==========================================================================
   TAB 4: READY STUDIO & 1-CLICK YOUTUBE UPLOAD
   ========================================================================== */
.jobs-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.jobs-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.job-item {
  border-radius: var(--radius-md);
  background: rgba(6, 10, 20, 0.85);
  border: 1px solid var(--border-subtle);
  padding: 13px 15px;
}

.job-item.is-running {
  border-color: rgba(56, 189, 248, 0.45);
}

.job-item.is-done {
  border-color: rgba(16, 185, 129, 0.4);
}

.job-item.is-failed {
  border-color: rgba(239, 68, 68, 0.45);
}

.job-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.job-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}

.job-terminal {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #04070E;
  border: 1px solid rgba(148, 163, 184, 0.12);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  color: #CBD5E1;
  max-height: 165px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Studio Episode Master Cards */
.studio-deck {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.studio-episode-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.studio-ep-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.studio-ep-title {
  margin: 7px 0 6px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.studio-block-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* A/B Thumbnail Strip */
.ab-thumb-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.ab-thumb-card {
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: #080E1B;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}

.ab-thumb-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -10px rgba(245, 184, 38, 0.35);
}

.ab-thumb-img-wrap {
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  background: #0E1628;
  position: relative;
}

.ab-thumb-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ab-zoom-hint {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(7, 11, 20, 0.82);
  color: var(--text-primary);
  opacity: 0;
  transition: opacity 150ms ease;
}

.ab-thumb-card:hover .ab-zoom-hint {
  opacity: 1;
}

.ab-thumb-foot {
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

/* Studio Main Layout: Players + Upload Control */
.studio-media-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr);
  gap: 20px;
  align-items: start;
}

.video-player-frame {
  background: #04070F;
  border: 1px solid rgba(245, 184, 38, 0.28);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.video-player-frame video {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  background: #000;
}

.player-caption-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  background: rgba(11, 18, 34, 0.9);
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
}

/* 1-Click Upload Control Box */
.upload-panel {
  background: linear-gradient(180deg, rgba(19, 30, 54, 0.72), rgba(8, 13, 25, 0.9));
  border: 1px solid rgba(245, 184, 38, 0.28);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.upload-panel-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.privacy-options {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.privacy-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  background: rgba(7, 11, 20, 0.65);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: var(--transition);
  font-size: 12.5px;
}

.privacy-radio:hover {
  border-color: rgba(245, 184, 38, 0.35);
}

.privacy-radio input[type="radio"] {
  accent-color: var(--gold);
  margin: 0;
}

.privacy-radio-meta {
  display: flex;
  flex-direction: column;
}

.privacy-radio-title {
  font-weight: 600;
  color: var(--text-primary);
}

.privacy-radio-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* Toggle Switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.24);
  cursor: pointer;
  font-size: 12.5px;
}

.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.28);
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #FFF;
  transition: var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--cyan);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

/* 9:16 Auto-Cut Shorts Deck */
.shorts-deck {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.short-player-card {
  background: rgba(6, 10, 20, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.short-video-wrap {
  background: #000;
  display: flex;
  justify-content: center;
}

.short-video-wrap video {
  width: 100%;
  max-height: 360px;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  background: #000;
  display: block;
}

.short-card-foot {
  padding: 9px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  border-top: 1px solid var(--border-subtle);
}

.short-name {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Metadata Drawer */
.metadata-drawer {
  border-radius: var(--radius-md);
  background: rgba(6, 10, 20, 0.78);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.metadata-drawer summary {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metadata-drawer summary::-webkit-details-marker {
  display: none;
}

.metadata-pre {
  margin: 0;
  padding: 12px 14px;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.55;
  color: #CBD5E1;
  max-height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* ==========================================================================
   MODALS, LIGHTBOX & TOASTS
   ========================================================================== */
.modal-backdrop, .lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 6, 14, 0.8);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fadeIn 150ms ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-panel {
  width: 100%;
  max-width: 580px;
  background: #0D1528;
  border: 1px solid rgba(245, 184, 38, 0.3);
  padding: 24px;
}

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

.modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
}

.icon-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-secondary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.icon-close:hover {
  color: var(--text-primary);
  border-color: rgba(245, 184, 38, 0.4);
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-row-2.align-end {
  align-items: end;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.req { color: var(--gold); }

.char-counter {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 184, 38, 0.14);
}

.thumb-live-preview {
  height: 44px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #171F33 0%, #090D18 100%);
  border: 1px solid rgba(245, 184, 38, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  overflow: hidden;
}

.thumb-preview-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.thumb-preview-words {
  font-family: var(--font-editorial);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--gold-bright);
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(245, 184, 38, 0.45);
}

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

/* Lightbox */
.lightbox-backdrop {
  background: rgba(2, 5, 12, 0.92);
}

.lightbox-figure {
  margin: 0;
  max-width: min(1080px, 90vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.lightbox-figure img {
  max-width: 100%;
  max-height: 78vh;
  border-radius: var(--radius-md);
  border: 1px solid rgba(245, 184, 38, 0.38);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.85);
}

.lightbox-caption {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-primary);
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 23, 42, 0.8);
  color: #FFF;
  font-size: 24px;
  cursor: pointer;
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 23, 42, 0.8);
  color: #FFF;
  font-size: 26px;
  cursor: pointer;
}

.lightbox-nav.prev { left: 24px; }
.lightbox-nav.next { right: 24px; }
.lightbox-nav:hover, .lightbox-close:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
}

/* Toasts */
.toast-stack {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(11, 18, 34, 0.96);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--gold);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.65);
  font-size: 13px;
  color: var(--text-primary);
  animation: toastIn 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.toast.toast-success { border-left-color: var(--emerald); }
.toast.toast-error { border-left-color: var(--crimson); }
.toast.toast-info { border-left-color: var(--cyan); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-grid-7-5 { grid-template-columns: 1fr; }
  .calendar-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .studio-media-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    width: 100%;
    height: auto;
    padding: 12px 16px;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    gap: 10px;
    overflow: visible;
  }

  .sidebar-top {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
  }

  .channel-status-card {
    flex-direction: row;
    align-items: center;
    padding: 7px 10px;
  }

  .channel-meta {
    display: none;
  }

  .nav-menu {
    flex-direction: row;
    margin: 0;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-item {
    width: auto;
    flex-shrink: 0;
    padding: 8px 12px;
  }

  .sidebar-footer {
    display: none;
  }

  .main-workspace {
    padding: 18px 16px 40px;
  }

  .week-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ready-pipeline-grid,
  .shorts-deck {
    grid-template-columns: 1fr;
  }

  .pipeline-stats-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pstat-action {
    grid-column: 1 / -1;
  }

  .queue-card {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .queue-controls {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 600px) {
  .kpi-grid,
  .ypp-rings-row,
  .calendar-grid,
  .form-row-2 {
    grid-template-columns: 1fr;
  }

  .week-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-box input {
    width: 100%;
  }
}
