/* ═══════════════════════════════════════════════════════════════════
   macOS Design System — ProVideo Engine
   Inspirado em macOS Sonoma / Sequoia: clean, calmo, translúcido
   ═══════════════════════════════════════════════════════════════════ */

:root {
  /* ── Surface layers (claros, Apple-style) ── */
  --bg:               #F5F5F7;
  --bg-elevated:      #FFFFFF;
  --bg-sidebar:       rgba(255, 255, 255, 0.72);
  --bg-card:          #FFFFFF;
  --bg-input:         #FFFFFF;
  --bg-hover:         rgba(0, 0, 0, 0.04);
  --bg-active:        rgba(0, 0, 0, 0.08);
  --bg-overlay:       rgba(0, 0, 0, 0.4);

  /* ── Brand ── */
  --primary:          #007AFF;
  --primary-hover:    #0066CC;
  --primary-bg:       rgba(0, 122, 255, 0.08);
  --primary-text:     #FFFFFF;

  /* ── Text ── */
  --text:             #1D1D1F;
  --text-secondary:   #6E6E73;
  --text-tertiary:    #8E8E93;
  --text-muted:       #AEAEB2;
  --text-on-primary:  #FFFFFF;

  /* ── Borders ── */
  --border:           rgba(0, 0, 0, 0.08);
  --border-strong:    rgba(0, 0, 0, 0.16);
  --border-subtle:    rgba(0, 0, 0, 0.04);

  /* ── Semantic ── */
  --success:          #34C759;
  --success-bg:       rgba(52, 199, 89, 0.12);
  --warning:          #FF9500;
  --warning-bg:       rgba(255, 149, 0, 0.12);
  --error:            #FF3B30;
  --error-bg:         rgba(255, 59, 48, 0.12);
  --info:             #5AC8FA;
  --info-bg:          rgba(90, 200, 250, 0.12);

  /* ── Spacing (8px rhythm) ── */
  --sp-xs:   4px;
  --sp-sm:   8px;
  --sp-md:   12px;
  --sp-lg:   16px;
  --sp-xl:   24px;
  --sp-2xl:  32px;
  --sp-3xl:  48px;
  --sp-4xl:  80px;
  --gutter:  24px;

  /* ── Radius (macOS-style, generoso) ── */
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   14px;
  --r-xl:   18px;
  --r-2xl:  24px;
  --r-full: 9999px;

  /* ── Shadows (soft, diffuse) ── */
  --shadow-sm:    0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow:       0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md:    0 4px 16px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg:    0 12px 32px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.06);
  --shadow-xl:    0 24px 64px rgba(0, 0, 0, 0.16);

  /* ── Typography ── */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
          "Inter", "Segoe UI", Roboto, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", Menlo, Monaco, Consolas, monospace;

  /* ── Layout ── */
  --sidebar-w: 240px;
  --topbar-h:  60px;
  --content-max: 1280px;

  /* ── Transitions (Apple's signature) ── */
  --ease:     cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in:  cubic-bezier(0.4, 0, 1, 1);
  --fast:     150ms;
  --normal:   250ms;
  --slow:     400ms;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
  letter-spacing: -0.01em;
}
a { color: var(--primary); text-decoration: none; transition: opacity var(--fast); }
a:hover { opacity: 0.8; }
input, button, select, textarea { font-family: inherit; font-size: inherit; }
.hidden { display: none !important; }

/* ── Scrollbar (macOS-style, sutil) ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.18); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.28); }

/* ── Typography Scale ── */
h1, .h1 { font-size: 2.25rem; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }
h2, .h2 { font-size: 1.625rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
h3, .h3 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.35; }
h4, .h4 { font-size: 1.0625rem; font-weight: 600; line-height: 1.4; }
.text-body { font-size: 1rem; line-height: 1.55; }
.text-body-sm { font-size: 0.875rem; line-height: 1.5; }
.text-caption { font-size: 0.75rem; color: var(--text-secondary); }
.text-label {
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-secondary);
}
.text-mono { font-family: var(--font-mono); font-size: 0.85rem; }

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

/* ── Sidebar (glass + vibrancy) ── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  position: fixed;
  left: 0; top: 0;
  background: var(--bg-sidebar);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: var(--sp-lg) var(--sp-md);
  z-index: 100;
  overflow-y: auto;
}
.sidebar-brand {
  display: flex; align-items: center; gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-md);
  margin-bottom: var(--sp-xl);
}
.sidebar-brand-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #007AFF, #5856D6);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.125rem;
}
.sidebar-brand h1 {
  font-size: 1.0625rem; font-weight: 600; color: var(--text); letter-spacing: -0.01em;
}
.sidebar-brand p { display: none; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar-nav a, .sidebar-nav button {
  display: flex; align-items: center; gap: var(--sp-sm);
  padding: 7px var(--sp-md);
  border-radius: var(--r-md);
  font-size: 0.875rem; font-weight: 500;
  color: var(--text);
  background: none; border: none; cursor: pointer;
  width: 100%; text-align: left;
  transition: all var(--fast) var(--ease);
}
.sidebar-nav a:hover, .sidebar-nav button:hover { background: var(--bg-hover); }
.sidebar-nav a.active, .sidebar-nav button.active {
  background: var(--primary);
  color: var(--text-on-primary);
  font-weight: 600;
}
.sidebar-nav a.active .icon, .sidebar-nav button.active .icon {
  font-variation-settings: 'FILL' 1;
}
.sidebar-nav .icon {
  font-size: 18px; color: var(--text-secondary);
  font-variation-settings: 'FILL' 0;
  transition: all var(--fast) var(--ease);
}
.sidebar-nav a.active .icon { color: var(--text-on-primary); }
.sidebar-divider {
  margin: var(--sp-md) 0;
  border-top: 1px solid var(--border);
}
.sidebar-footer {
  margin-top: auto;
  padding-top: var(--sp-md);
  border-top: 1px solid var(--border);
}

/* ── Top Bar ── */
.topbar {
  position: fixed;
  top: 0; right: 0;
  width: calc(100% - var(--sidebar-w));
  height: var(--topbar-h);
  background: rgba(245, 245, 247, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-xl);
  z-index: 90;
}
.topbar-left { display: flex; align-items: center; flex: 1; max-width: 480px; }
.topbar-search {
  position: relative; width: 100%;
}
.topbar-search .icon-search {
  position: absolute; left: var(--sp-md); top: 50%; transform: translateY(-50%);
  color: var(--text-tertiary); pointer-events: none; font-size: 18px;
}
.topbar-search input {
  width: 100%;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding: 7px 14px 7px 38px;
  font-size: 0.875rem;
  color: var(--text);
  outline: none;
  transition: all var(--fast) var(--ease);
}
.topbar-search input:focus {
  background: var(--bg-elevated);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}
.topbar-search input::placeholder { color: var(--text-tertiary); }

.topbar-right { display: flex; align-items: center; gap: var(--sp-md); }
.credits-badge {
  display: flex; align-items: center; gap: 6px;
  padding: 5px var(--sp-md);
  background: var(--primary-bg);
  border: 1px solid transparent;
  border-radius: var(--r-full);
  font-size: 0.8125rem; font-weight: 600;
  color: var(--primary);
  transition: all var(--fast) var(--ease);
}
.credits-badge:hover { background: rgba(0, 122, 255, 0.16); }
.credits-badge .material-symbols-outlined { font-size: 16px; }

.topbar-actions { display: flex; align-items: center; gap: 4px; }
.topbar-actions button {
  background: none; border: none; color: var(--text-secondary);
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--fast) var(--ease);
}
.topbar-actions button:hover { background: var(--bg-hover); color: var(--text); }
.topbar-actions button .material-symbols-outlined { font-size: 20px; }

.topbar-divider { width: 1px; height: 24px; background: var(--border); }
.btn-logout {
  background: none; border: none; color: var(--text-secondary);
  font-size: 0.8125rem; font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--fast) var(--ease);
}
.btn-logout:hover { background: var(--bg-hover); color: var(--text); }

/* ── Main Viewport ── */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  flex: 1;
  padding: var(--sp-2xl) var(--sp-2xl);
  max-width: var(--content-max);
}
.fade-in { animation: fadeIn var(--slow) var(--ease); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Section header ── */
.section-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: var(--sp-2xl);
  padding-bottom: var(--sp-lg);
  border-bottom: 1px solid var(--border);
  gap: var(--sp-lg);
}
.section-header h1 { font-size: 1.75rem; }
.section-header p { color: var(--text-secondary); font-size: 0.9375rem; margin-top: 2px; }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
  box-shadow: var(--shadow-sm);
  transition: all var(--normal) var(--ease);
}
.card:hover { box-shadow: var(--shadow); }
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
  box-shadow: var(--shadow-sm);
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-lg); }
.card-title { font-size: 1rem; font-weight: 600; color: var(--text); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-md);
  font-size: 0.875rem; font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--fast) var(--ease);
  white-space: nowrap;
  user-select: none;
}
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn .material-symbols-outlined { font-size: 18px; }

.btn-primary {
  background: var(--primary);
  color: var(--text-on-primary);
  border-color: var(--primary);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-primary:active:not(:disabled) { transform: scale(0.98); }

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg-hover); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) { background: var(--bg-hover); }

.btn-danger {
  background: var(--error);
  color: var(--text-on-primary);
  border-color: var(--error);
}
.btn-danger:hover:not(:disabled) { background: #E0291E; }

.btn-success {
  background: var(--success);
  color: var(--text-on-primary);
  border-color: var(--success);
}
.btn-success:hover:not(:disabled) { background: #2DA94A; }

.btn-sm { padding: 5px 10px; font-size: 0.8125rem; }
.btn-xs { padding: 3px 8px; font-size: 0.75rem; }
.btn-block { width: 100%; }
.btn-lg { padding: 12px 24px; font-size: 0.9375rem; }

/* ── Forms ── */
.form-group { margin-bottom: var(--sp-lg); }
.form-group label {
  display: block;
  font-size: 0.8125rem; font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  font-size: 0.9375rem;
  background: var(--bg-input);
  color: var(--text);
  outline: none;
  transition: all var(--fast) var(--ease);
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}
.form-control:disabled { opacity: 0.6; cursor: not-allowed; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: 0.6875rem; font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.badge-credit  { background: var(--success-bg); color: var(--success); }
.badge-debit   { background: var(--error-bg); color: var(--error); }
.badge-info    { background: var(--info-bg); color: var(--info); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-admin   { background: var(--primary-bg); color: var(--primary); }

/* ── Tables ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}
.data-table th {
  text-align: left;
  padding: var(--sp-md) var(--sp-lg);
  font-size: 0.75rem; font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-hover);
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: var(--sp-md) var(--sp-lg);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.875rem;
  color: var(--text);
}
.data-table tbody tr:hover td { background: var(--bg-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ── Stats Grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-lg);
  margin-bottom: var(--sp-2xl);
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--normal) var(--ease);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-value {
  font-size: 2rem; font-weight: 700; color: var(--primary);
  letter-spacing: -0.02em; line-height: 1;
}
.stat-label {
  font-size: 0.75rem; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-top: 6px;
}

/* ── Filter Tabs ── */
.filter-tabs {
  display: flex; gap: 4px;
  margin-bottom: var(--sp-xl);
  background: rgba(0, 0, 0, 0.04);
  padding: 4px;
  border-radius: var(--r-md);
  width: fit-content;
  flex-wrap: wrap;
}
.filter-tab {
  padding: 6px 14px;
  border-radius: var(--r-sm);
  font-size: 0.8125rem; font-weight: 500;
  background: none; border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--fast) var(--ease);
}
.filter-tab:hover { color: var(--text); }
.filter-tab.active {
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* ── Video Grid ── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-xl);
}
.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all var(--normal) var(--ease);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-sm);
}
.video-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.video-thumb {
  position: relative;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #f0f4ff, #e8eaf6);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.video-thumb .thumb-icon {
  font-size: 3.5rem;
  color: var(--text-muted);
  opacity: 0.5;
}
.video-status-overlay {
  position: absolute; top: var(--sp-sm); right: var(--sp-sm);
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  font-size: 0.6875rem; font-weight: 600;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  backdrop-filter: blur(8px);
}
.status-processing .status-processing { background: var(--info); }
.status-completed .status-completed { background: var(--success); }
.status-failed .status-failed { background: var(--error); }
.status-queued .status-queued { background: var(--warning); }
.video-progress-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: var(--sp-sm) var(--sp-md);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: white;
  display: flex; align-items: center; gap: 8px;
  font-size: 0.75rem;
}
.video-progress-bar {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
}
.video-progress-bar-fill {
  height: 100%;
  background: var(--primary);
  transition: width var(--normal) var(--ease);
}
.video-card-body { padding: var(--sp-lg); flex: 1; display: flex; flex-direction: column; gap: 8px; }
.video-card-title { font-size: 0.9375rem; font-weight: 600; color: var(--text); }
.video-card-meta {
  display: flex; gap: var(--sp-sm); font-size: 0.75rem; color: var(--text-secondary);
}
.video-card-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: var(--sp-sm); }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: var(--sp-4xl) var(--sp-xl);
  color: var(--text-secondary);
}
.empty-state .empty-icon {
  font-size: 4rem;
  color: var(--text-muted);
  margin-bottom: var(--sp-md);
  display: block;
  opacity: 0.6;
}
.empty-state h3 { font-size: 1.125rem; color: var(--text); margin-bottom: var(--sp-sm); }
.empty-state p { font-size: 0.9375rem; max-width: 360px; margin: 0 auto; }

/* ── Balance Card (Credits) ── */
.balance-card {
  background: linear-gradient(135deg, #007AFF, #5856D6);
  border-radius: var(--r-2xl);
  padding: var(--sp-2xl);
  text-align: center;
  color: white;
  margin-bottom: var(--sp-2xl);
  box-shadow: var(--shadow-md);
}
.balance-card .balance-label { font-size: 0.8125rem; opacity: 0.8; margin-bottom: var(--sp-xs); }
.balance-card .balance-amount {
  font-size: 4rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1;
  margin: var(--sp-sm) 0;
}
.balance-card .balance-estimate {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.875rem; opacity: 0.85;
  margin-top: var(--sp-sm);
}

/* ── Package Grid (Pricing) ── */
.package-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-lg);
  margin-bottom: var(--sp-2xl);
}
.package-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-xl);
  text-align: center;
  cursor: pointer;
  transition: all var(--normal) var(--ease);
  position: relative;
  box-shadow: var(--shadow-sm);
}
.package-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}
.package-card.selected {
  border-color: var(--primary);
  background: var(--primary-bg);
}
.package-card.featured {
  border-color: var(--primary);
  background: linear-gradient(180deg, var(--primary-bg) 0%, var(--bg-card) 50%);
}
.package-card .featured-tag {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--primary);
  color: white;
  padding: 2px 10px;
  border-radius: var(--r-full);
  font-size: 0.6875rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.package-card .package-icon {
  width: 48px; height: 48px;
  background: var(--primary-bg);
  border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: var(--sp-md);
}
.package-card .package-icon .material-symbols-outlined { color: var(--primary); font-size: 24px; }
.package-card .package-name { font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.package-card .package-credits { font-size: 1.75rem; font-weight: 700; color: var(--text); margin: 4px 0; }
.package-card .package-price { font-size: 1.125rem; font-weight: 600; color: var(--success); margin-bottom: var(--sp-md); }
.package-card .package-price small { font-size: 0.75rem; color: var(--text-secondary); font-weight: 400; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  animation: fadeIn var(--normal) var(--ease);
}
.modal {
  background: var(--bg-elevated);
  border-radius: var(--r-xl);
  padding: var(--sp-xl);
  max-width: 480px;
  width: calc(100% - 32px);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp var(--normal) var(--ease);
}
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.modal h3 { font-size: 1.25rem; font-weight: 600; margin-bottom: var(--sp-md); }
.modal-actions { display: flex; gap: var(--sp-sm); justify-content: flex-end; margin-top: var(--sp-xl); }

/* ── Upload Zone ── */
.upload-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-lg);
  padding: var(--sp-3xl) var(--sp-xl);
  text-align: center;
  cursor: pointer;
  transition: all var(--fast) var(--ease);
  background: var(--bg-hover);
}
.upload-zone:hover { border-color: var(--primary); background: var(--primary-bg); }
.upload-zone.dragover { border-color: var(--primary); background: var(--primary-bg); }
.upload-zone .upload-icon { font-size: 3rem; color: var(--text-tertiary); margin-bottom: var(--sp-sm); display: block; }
.upload-progress { margin-top: var(--sp-md); }
.progress-track {
  width: 100%; height: 4px;
  background: var(--bg-hover);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%; background: var(--primary);
  border-radius: 2px;
  transition: width var(--normal) var(--ease);
}
.progress-text { text-align: center; font-size: 0.75rem; color: var(--text-secondary); margin-top: 4px; }

/* ── Toast ── */
.toast-container {
  position: fixed; top: 20px; right: 20px;
  display: flex; flex-direction: column; gap: var(--sp-sm);
  z-index: 2000;
  max-width: 360px;
}
.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-md) var(--sp-lg);
  box-shadow: var(--shadow-md);
  font-size: 0.875rem;
  color: var(--text);
  display: flex; align-items: center; gap: var(--sp-sm);
  animation: slideInRight var(--normal) var(--ease);
  border-left: 3px solid var(--primary);
}
.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--error); }
.toast-warning { border-left-color: var(--warning); }
.toast-info { border-left-color: var(--info); }
@keyframes slideInRight { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }

/* ── Spinner ── */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── Utility ── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: var(--sp-sm); } .mt-2 { margin-top: var(--sp-md); } .mt-3 { margin-top: var(--sp-lg); } .mt-4 { margin-top: var(--sp-xl); }
.mb-1 { margin-bottom: var(--sp-sm); } .mb-2 { margin-bottom: var(--sp-md); } .mb-3 { margin-bottom: var(--sp-lg); } .mb-4 { margin-bottom: var(--sp-xl); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-1 { gap: var(--sp-sm); } .gap-2 { gap: var(--sp-md); } .gap-3 { gap: var(--sp-lg); }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.w-full { width: 100%; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform var(--normal) var(--ease); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .topbar { width: 100%; }
  .video-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .main-content { padding: var(--sp-lg) var(--sp-md); }
  .package-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Acessibilidade ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .spinner, .spinner-icon { animation: none !important; }
}
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ── AI Providers & Tasks (Admin) ── */
.ai-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--sp-lg);
  margin-bottom: var(--sp-2xl);
}
.provider-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  transition: all var(--normal) var(--ease);
  display: flex; flex-direction: column; gap: var(--sp-md);
}
.provider-card.enabled {
  border-color: var(--success);
  background: linear-gradient(180deg, var(--success-bg) 0%, var(--bg-card) 30%);
}
.provider-card .provider-header {
  display: flex; align-items: center; justify-content: space-between;
}
.provider-card .provider-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-bg);
  color: var(--primary);
}
.provider-card.enabled .provider-icon {
  background: var(--success-bg);
  color: var(--success);
}
.provider-card .provider-icon .material-symbols-outlined { font-size: 22px; }
.provider-card .provider-name { font-size: 1rem; font-weight: 600; }
.provider-card .provider-type { font-size: 0.75rem; color: var(--text-tertiary); text-transform: uppercase; }
.provider-card .provider-status {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: 0.6875rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.status-on { background: var(--success-bg); color: var(--success); }
.status-off { background: var(--bg-hover); color: var(--text-tertiary); }
.provider-card .form-group { margin-bottom: 0; }
.provider-card .form-group label { font-size: 0.75rem; }
.provider-card .provider-actions { display: flex; gap: var(--sp-xs); flex-wrap: wrap; }
.provider-card .provider-feedback {
  font-size: 0.8125rem;
  padding: var(--sp-xs) var(--sp-sm);
  border-radius: var(--r-sm);
  background: var(--bg-hover);
  min-height: 24px;
}

/* Tasks */
.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
  margin-bottom: var(--sp-lg);
  box-shadow: var(--shadow-sm);
}
.task-card .task-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: var(--sp-md);
  gap: var(--sp-md);
}
.task-card .task-name { font-size: 1.0625rem; font-weight: 600; }
.task-card .task-desc {
  font-size: 0.875rem; color: var(--text-secondary);
  margin-bottom: var(--sp-md);
}
.task-card .task-current {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: var(--primary-bg);
  color: var(--primary);
  border-radius: var(--r-full);
  font-size: 0.75rem; font-weight: 600;
  margin-bottom: var(--sp-md);
}
.task-card .task-current.configured {
  background: var(--success-bg);
  color: var(--success);
}
.task-card .task-current.unconfigured {
  background: var(--warning-bg);
  color: var(--warning);
}
.task-card .task-grid {
  display: grid; grid-template-columns: 1fr 2fr auto;
  gap: var(--sp-sm);
  align-items: end;
}
.task-card .task-actions { display: flex; gap: var(--sp-xs); margin-top: var(--sp-sm); }
.task-card .task-prompt {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--bg-hover);
  padding: var(--sp-sm);
  border-radius: var(--r-sm);
  margin-top: var(--sp-sm);
  max-height: 100px;
  overflow-y: auto;
  white-space: pre-wrap;
}
.task-card .task-requirements {
  font-size: 0.75rem; color: var(--info);
  background: var(--info-bg);
  padding: var(--sp-xs) var(--sp-sm);
  border-radius: var(--r-sm);
  margin-top: var(--sp-sm);
  display: flex; align-items: flex-start; gap: 4px;
}
.task-card .task-requirements .material-symbols-outlined { font-size: 14px; flex-shrink: 0; }

/* Model selector */
.model-selector {
  position: relative;
}
.model-selector select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  font-size: 0.875rem;
  background: var(--bg-input);
  color: var(--text);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236E6E73' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.model-selector select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}
.model-selector .model-info {
  font-size: 0.75rem; color: var(--text-tertiary);
  margin-top: 4px;
  display: flex; gap: 8px; flex-wrap: wrap;
}
.model-selector .model-info span {
  background: var(--bg-hover);
  padding: 2px 6px;
  border-radius: 4px;
}
.model-selector .model-pricing {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}
.model-selector .model-loader {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  padding: var(--sp-sm);
}
