/* ═══════════════════════════════════════════════════════════
   EditeIA Studio — En-Volver Academy Neurotech
   Brand Identity: Lívia Andrade · IA Com Alma · NeuroAlquimIA
   ═══════════════════════════════════════════════════════════ */

:root {
  --moss: #2D4A3E;
  --moss-dark: #1E342B;
  --moss-light: #3D6454;
  --amber: #C9913D;
  --amber-glow: #E8C87A;
  --amber-light: #DDB166;
  --cream: #F5ECD7;
  --cream-warm: #FAF3E3;
  --rose: #C97B84;
  --rose-light: #DCA3AA;
  --purple-deep: #5B3A7A;
  --purple-medium: #8E6AAF;
  --purple-light: #C4A8D8;
  --charcoal: #2C2C2C;
  --charcoal-soft: #4A4A4A;
  --jade: #6ABFAD;
  --jade-light: #8ED4C6;

  --bg: #0E1A15;
  --bg-card: #152520;
  --bg-elevated: #1A2E27;
  --bg-glass: rgba(45, 74, 62, 0.3);
  --border: rgba(201, 145, 61, 0.15);
  --border-active: rgba(201, 145, 61, 0.4);
  --text: #F5ECD7;
  --text-muted: rgba(245, 236, 215, 0.5);
  --text-dim: rgba(245, 236, 215, 0.3);

  --grad-alquimia: linear-gradient(135deg, #2D4A3E 0%, #5B3A7A 50%, #C9913D 100%);
  --grad-glow: linear-gradient(135deg, #C9913D 0%, #E8C87A 50%, #C9913D 100%);
  --grad-dark: linear-gradient(180deg, #0E1A15 0%, #152520 100%);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 8px 32px rgba(0,0,0,0.3);
  --shadow-glow: 0 0 40px rgba(201,145,61,0.15);

  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Montserrat', -apple-system, sans-serif;
  --font-accent: 'Dancing Script', cursive;
  --font-caps: 'Cinzel', serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body, #root {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ═══ SCROLLBAR ═══ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(201,145,61,0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(201,145,61,0.4); }

/* ═══ APP SHELL ═══ */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ═══ HEADER ═══ */
.header {
  height: 64px;
  background: var(--moss-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--grad-alquimia);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cream);
  flex-shrink: 0;
  box-shadow: var(--shadow-glow);
}

.header-brand h1 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--cream);
  line-height: 1.1;
}

.header-brand span {
  font-family: var(--font-accent);
  font-size: 0.7rem;
  color: var(--amber-glow);
  opacity: 0.8;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-badge {
  background: rgba(201,145,61,0.12);
  border: 1px solid rgba(201,145,61,0.2);
  color: var(--amber-glow);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 100px;
}

.header-sessions-btn {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.75rem;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.header-sessions-btn:hover {
  border-color: var(--border-active);
  color: var(--text);
}

/* ═══ MAIN CONTENT ═══ */
.main-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ═══ UPLOAD SCREEN ═══ */
.upload-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px;
  position: relative;
  overflow-y: auto;
}

.upload-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(91,58,122,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(201,145,61,0.06) 0%, transparent 50%);
  pointer-events: none;
}

.upload-hero {
  text-align: center;
  margin-bottom: 40px;
  position: relative;
}

.upload-hero h2 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  margin-bottom: 8px;
}

.upload-hero h2 em {
  font-weight: 300;
  color: var(--amber-glow);
}

.upload-hero .tagline {
  font-family: var(--font-accent);
  font-size: 1.2rem;
  color: var(--amber-glow);
  margin-bottom: 8px;
}

.upload-hero .sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Drop zone */
.drop-zone {
  width: 100%;
  max-width: 640px;
  padding: 60px 40px;
  border: 2px dashed rgba(201,145,61,0.25);
  border-radius: var(--radius);
  background: var(--bg-card);
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.drop-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-alquimia);
  opacity: 0;
  transition: opacity 0.3s;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--amber);
  box-shadow: var(--shadow-glow);
}
.drop-zone:hover::before, .drop-zone.dragover::before {
  opacity: 0.05;
}

.drop-zone-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.6;
  position: relative;
}

.drop-zone h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--cream);
  position: relative;
}

.drop-zone p {
  font-size: 0.8rem;
  color: var(--text-muted);
  position: relative;
}

.drop-zone .formats {
  margin-top: 16px;
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 1px;
  position: relative;
}

/* Prompt input */
.prompt-section {
  width: 100%;
  max-width: 640px;
  margin-top: 24px;
  position: relative;
}

.prompt-input {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  resize: vertical;
  min-height: 60px;
  transition: border-color 0.2s;
}
.prompt-input:focus {
  outline: none;
  border-color: var(--amber);
}
.prompt-input::placeholder { color: var(--text-dim); }

.prompt-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* File selected state */
.file-selected {
  width: 100%;
  max-width: 640px;
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.file-info {
  flex: 1;
}

.file-info h4 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.file-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 0.3px;
}

.btn-primary {
  background: var(--grad-alquimia);
  color: var(--cream);
  box-shadow: 0 4px 20px rgba(201,145,61,0.2);
}
.btn-primary:hover {
  box-shadow: 0 8px 32px rgba(201,145,61,0.35);
  transform: translateY(-2px);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-secondary:hover {
  border-color: var(--border-active);
  background: var(--bg-elevated);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 8px 16px;
}
.btn-ghost:hover { color: var(--amber-glow); }

.btn-danger {
  background: rgba(200,60,60,0.15);
  border: 1px solid rgba(200,60,60,0.3);
  color: #e88;
}

/* ═══ PROCESSING SCREEN ═══ */
.processing-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px;
  text-align: center;
}

.processing-orb {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--grad-alquimia);
  margin-bottom: 32px;
  position: relative;
  animation: pulse-orb 2s ease-in-out infinite;
}

.processing-orb::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--amber-glow);
  animation: spin 1.5s linear infinite;
}

@keyframes pulse-orb {
  0%, 100% { transform: scale(1); box-shadow: 0 0 40px rgba(201,145,61,0.2); }
  50% { transform: scale(1.05); box-shadow: 0 0 60px rgba(201,145,61,0.35); }
}

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

.processing-step {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.processing-detail {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.progress-bar-wrap {
  width: 100%;
  max-width: 400px;
  height: 6px;
  background: var(--bg-card);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--grad-glow);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.progress-percent {
  font-size: 0.75rem;
  color: var(--amber-glow);
  font-weight: 600;
}

.processing-steps-list {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 360px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-dim);
  transition: color 0.3s;
}
.step-item.active { color: var(--amber-glow); }
.step-item.done { color: var(--jade); }

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
  transition: all 0.3s;
}
.step-item.active .step-dot { background: var(--amber-glow); box-shadow: 0 0 8px var(--amber-glow); }
.step-item.done .step-dot { background: var(--jade); }

/* ═══ EDITOR SCREEN ═══ */
.editor-screen {
  display: grid;
  grid-template-columns: 320px 1fr;
  grid-template-rows: 1fr 140px;
  height: 100%;
  gap: 0;
}

/* Scene panel (left) */
.scene-panel {
  grid-row: 1 / -1;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.scene-panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.scene-panel-header h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
}

.scene-count {
  font-size: 0.7rem;
  color: var(--amber-glow);
  background: rgba(201,145,61,0.12);
  padding: 3px 10px;
  border-radius: 100px;
}

.scene-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

/* Scene card */
.scene-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.scene-card:hover {
  border-color: var(--border-active);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.scene-card.active {
  border-color: var(--amber);
  box-shadow: 0 0 0 1px var(--amber), 0 4px 16px rgba(201,145,61,0.15);
}

.scene-card.excluded {
  opacity: 0.4;
}

.scene-card-top {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

.scene-thumb {
  width: 80px;
  height: 52px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  background: var(--bg);
  flex-shrink: 0;
}

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

.scene-title {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scene-time {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: 'Courier New', monospace;
}

.scene-badges {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.scene-badge {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge-BOMBA { background: rgba(200,60,60,0.2); color: #f88; }
.badge-TANGIVEL { background: rgba(106,191,173,0.2); color: var(--jade-light); }
.badge-CONTEXTO { background: rgba(142,106,175,0.2); color: var(--purple-light); }
.badge-HUMANIZA { background: rgba(201,123,132,0.2); color: var(--rose-light); }
.badge-METODO { background: rgba(201,145,61,0.2); color: var(--amber-glow); }
.badge-HUMOR { background: rgba(232,200,122,0.2); color: #ffd; }
.badge-CTA { background: rgba(106,191,173,0.3); color: var(--jade); }
.badge-INTRO { background: rgba(91,58,122,0.2); color: var(--purple-light); }
.badge-TRANSICAO { background: rgba(100,100,100,0.2); color: #aaa; }

.scene-text-preview {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.scene-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.04);
}

.scene-score {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--amber-glow);
}

.scene-toggle {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: rgba(255,255,255,0.1);
  cursor: pointer;
  transition: background 0.2s;
  border: none;
}
.scene-toggle.on { background: var(--jade); }
.scene-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  transition: transform 0.2s;
}
.scene-toggle.on::after { transform: translateX(16px); }

.scene-drag-handle {
  cursor: grab;
  color: var(--text-dim);
  font-size: 0.9rem;
  padding: 4px;
}
.scene-drag-handle:active { cursor: grabbing; }

/* Preview area (center top) */
.preview-area {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}

.preview-video-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  position: relative;
  min-height: 0;
}

.preview-video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.preview-controls {
  height: 48px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
}

.play-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--amber);
  color: var(--moss-dark);
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.play-btn:hover { background: var(--amber-glow); transform: scale(1.1); }

.time-display {
  font-size: 0.75rem;
  font-family: 'Courier New', monospace;
  color: var(--text-muted);
  min-width: 110px;
}

.seek-bar {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.seek-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--amber);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(201,145,61,0.4);
}

.preview-actions {
  display: flex;
  gap: 8px;
}

/* Scene detail sidebar (appears when scene selected) */
.scene-detail {
  position: absolute;
  top: 0;
  right: 0;
  width: 340px;
  height: 100%;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  padding: 20px;
  overflow-y: auto;
  z-index: 10;
  box-shadow: -4px 0 20px rgba(0,0,0,0.3);
}

.scene-detail h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.detail-field {
  margin-bottom: 16px;
}

.detail-field label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.detail-field textarea,
.detail-field input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.8rem;
  resize: vertical;
}
.detail-field textarea:focus,
.detail-field input:focus {
  outline: none;
  border-color: var(--amber);
}

/* Timeline (bottom) */
.timeline-area {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.timeline-header h4 {
  font-family: var(--font-caps);
  font-size: 0.6rem;
  letter-spacing: 3px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.timeline-duration {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: 'Courier New', monospace;
}

.timeline-track {
  height: 48px;
  background: var(--bg);
  border-radius: var(--radius-xs);
  display: flex;
  overflow: hidden;
  position: relative;
}

.timeline-block {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--bg);
}

.timeline-block:hover { filter: brightness(1.2); }
.timeline-block.active { box-shadow: inset 0 -3px 0 var(--amber); }
.timeline-block.excluded { opacity: 0.25; }

.timeline-block span {
  font-size: 0.6rem;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 6px;
}

.timeline-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--amber-glow);
  z-index: 5;
  pointer-events: none;
  transition: left 0.1s linear;
}

.timeline-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ═══ EXPORT SCREEN ═══ */
.export-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px;
  text-align: center;
}

.export-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 500px;
  margin: 24px 0;
}

.export-option {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}
.export-option:hover {
  border-color: var(--border-active);
}
.export-option.selected {
  border-color: var(--amber);
  background: rgba(201,145,61,0.05);
}

.export-option label {
  font-size: 0.8rem;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
  cursor: pointer;
}

.export-option p {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.export-option input[type="checkbox"] {
  accent-color: var(--amber);
  margin-right: 6px;
}

.ratio-grid {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.ratio-btn {
  padding: 6px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.ratio-btn:hover { border-color: var(--border-active); }
.ratio-btn.active {
  background: var(--amber);
  color: var(--moss-dark);
  border-color: var(--amber);
}

.style-grid {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.style-btn {
  padding: 5px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.2s;
}
.style-btn.active {
  background: var(--purple-deep);
  color: var(--cream);
  border-color: var(--purple-medium);
}

/* Download section */
.download-section {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* ═══ SESSIONS LIST ═══ */
.sessions-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sessions-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 90%;
  max-width: 600px;
  max-height: 70vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sessions-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sessions-modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
}

.sessions-list {
  overflow-y: auto;
  padding: 12px;
}

.session-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}
.session-item:hover { background: var(--bg-elevated); }

.session-item-info {
  flex: 1;
}

.session-item-info h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.session-item-info p {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.ready, .status-dot.done { background: var(--jade); }
.status-dot.error { background: #e88; }
.status-dot.uploading, .status-dot.transcribing, .status-dot.analyzing, .status-dot.thumbnails, .status-dot.rendering {
  background: var(--amber);
  animation: pulse-dot 1s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ═══ FOOTER BADGE ═══ */
.footer-badge {
  position: fixed;
  bottom: 12px;
  right: 16px;
  font-size: 0.6rem;
  color: var(--text-dim);
  z-index: 50;
  pointer-events: none;
}

.footer-badge span {
  font-family: var(--font-accent);
  color: var(--amber-glow);
  opacity: 0.5;
}

/* ═══ AUTH SCREENS ═══ */

.auth-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.auth-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(91,58,122,0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(201,145,61,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(45,74,62,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4), 0 0 0 1px rgba(201,145,61,0.06);
  position: relative;
  z-index: 1;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 28px;
}

.auth-logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--grad-alquimia);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 12px;
  box-shadow: 0 8px 24px rgba(201,145,61,0.25);
}

.auth-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--cream);
  line-height: 1.1;
}

.auth-subtitle {
  font-family: var(--font-accent);
  font-size: 0.8rem;
  color: var(--amber-glow);
  opacity: 0.8;
}

.auth-heading {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 6px;
  text-align: center;
}

.auth-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  text-align: center;
  line-height: 1.5;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

.auth-field-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.auth-link-sm {
  font-size: 0.7rem;
  color: var(--amber-glow);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.auth-link-sm:hover { color: var(--amber-light); }

.auth-field input {
  padding: 11px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color 0.2s;
  width: 100%;
}
.auth-field input:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(201,145,61,0.1);
}
.auth-field input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-input-wrap {
  position: relative;
}
.auth-input-wrap input {
  padding-right: 44px;
}
.auth-eye {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.auth-eye:hover { opacity: 1; }

.auth-error {
  background: rgba(200,60,60,0.12);
  border: 1px solid rgba(200,60,60,0.25);
  color: #f99;
  font-size: 0.78rem;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  line-height: 1.4;
}

.auth-btn-primary {
  width: 100%;
  padding: 13px 24px;
  background: var(--grad-alquimia);
  color: var(--cream);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 4px 16px rgba(201,145,61,0.2);
  margin-top: 4px;
}
.auth-btn-primary:hover:not(:disabled) {
  box-shadow: 0 8px 28px rgba(201,145,61,0.35);
  transform: translateY(-1px);
}
.auth-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.auth-divider {
  display: flex;
  align-items: center;
  margin: 20px 0 16px;
  gap: 12px;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-divider span {
  font-size: 0.72rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.auth-btn-secondary {
  width: 100%;
  padding: 11px 24px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.auth-btn-secondary:hover {
  border-color: var(--border-active);
  color: var(--text);
  background: var(--bg-glass);
}

/* Steps indicator */
.auth-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 24px;
}

.auth-step {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}
.auth-step.active {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--moss-dark);
}
.auth-step.done {
  background: var(--jade);
  border-color: var(--jade);
  color: white;
}

.auth-step-line {
  width: 40px;
  height: 1px;
  background: var(--border);
}

/* Success state */
.auth-success {
  text-align: center;
  padding: 24px 0;
}

.auth-success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(106,191,173,0.2);
  color: var(--jade);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  border: 1px solid rgba(106,191,173,0.3);
}
.auth-success h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  margin-bottom: 8px;
}
.auth-success p { font-size: 0.82rem; color: var(--text-muted); }

/* Footer */
.auth-footer {
  margin-top: 24px;
  font-size: 0.65rem;
  color: var(--text-dim);
  text-align: center;
  position: relative;
  z-index: 1;
}
.auth-footer-brand {
  font-family: var(--font-accent);
  color: var(--amber-glow);
  opacity: 0.7;
}

/* ═══ ADMIN PANEL ═══ */

.admin-panel {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.admin-header {
  height: 64px;
  background: var(--moss-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.admin-header h2 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--cream);
}

.admin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  background: var(--bg-card);
}

.admin-tab {
  padding: 14px 20px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  margin-bottom: -1px;
}
.admin-tab:hover { color: var(--cream); }
.admin-tab.active {
  color: var(--amber-glow);
  border-bottom-color: var(--amber);
}

.admin-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.admin-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
}

.admin-stat-number {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--amber-glow);
  line-height: 1;
  margin-bottom: 4px;
}

.admin-stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.admin-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--text-muted);
  vertical-align: middle;
}
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }

.admin-code {
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--amber-glow);
  background: rgba(201,145,61,0.1);
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}
.admin-code:hover { background: rgba(201,145,61,0.2); }

.admin-section-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--cream);
}

.admin-form-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.admin-form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 120px;
}

.admin-form-field label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.admin-form-field input {
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.8rem;
}
.admin-form-field input:focus {
  outline: none;
  border-color: var(--amber);
}

.badge-active { color: var(--jade); font-size: 0.7rem; font-weight: 600; }
.badge-inactive { color: #888; font-size: 0.7rem; }

/* ═══ UTILITIES ═══ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.w-full { width: 100%; }

/* ═══ ANIMATIONS ═══ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.4s ease; }

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

.slide-in { animation: slideIn 0.3s ease; }

/* ═══ REELS SCREEN ═══ */
.reels-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
}

.reels-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.reels-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

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

.reels-header-actions {
  display: flex;
  gap: 10px;
}

.reels-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.reels-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  padding: 20px 28px;
  overflow-y: auto;
  align-content: start;
}

/* ─── Reel Card ─── */
.reel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reel-card:hover {
  border-color: var(--amber-glow);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.reel-card.selected {
  border-color: var(--jade);
  box-shadow: 0 0 0 2px rgba(106,191,173,0.3);
}

.reel-card.rejected {
  opacity: 0.5;
}

.reel-card.rejected:hover {
  opacity: 0.8;
}

.reel-card-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 12;
  background: var(--moss-dark);
  overflow: hidden;
}

.reel-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reel-card-overlay {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.reel-badge-duration {
  background: rgba(0,0,0,0.7);
  color: var(--amber-glow);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

.reel-badge-category {
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.reel-card-info {
  padding: 10px 12px 6px;
}

.reel-card-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.reel-card-hook {
  font-size: 0.7rem;
  color: var(--amber-glow);
  font-style: italic;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 4px;
}

.reel-card-meta {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.reel-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px 10px;
}

.reel-toggle {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 2px;
}

.reel-edit-btn {
  font-size: 0.65rem !important;
  padding: 3px 8px !important;
}

/* ─── Reel Detail Panel ─── */
.reel-detail-panel {
  width: 340px;
  min-width: 340px;
  border-left: 1px solid var(--border);
  background: var(--bg-card);
  padding: 20px;
  overflow-y: auto;
}

.reel-detail-panel h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.reel-detail-meta {
  display: flex;
  gap: 12px;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.reel-detail-section {
  margin-bottom: 16px;
}

.reel-detail-section label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.reel-detail-hook {
  font-size: 0.85rem;
  color: var(--amber-glow);
  font-style: italic;
  line-height: 1.5;
}

.reel-detail-caption {
  font-size: 0.75rem;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
  font-family: var(--font-body);
  max-height: 300px;
  overflow-y: auto;
  background: var(--bg);
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* ─── Reel Edit Modal ─── */
.reel-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.reel-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
}

.reel-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.reel-modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
}

.reel-modal-body {
  padding: 20px;
}

.reel-field {
  margin-bottom: 14px;
}

.reel-field label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.reel-field input,
.reel-field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}

.reel-field input:focus,
.reel-field textarea:focus {
  border-color: var(--jade);
}

.reel-field textarea {
  resize: vertical;
  min-height: 180px;
  line-height: 1.5;
}

.reel-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}

/* ─── Download list ─── */
.reel-download-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 0.8rem;
  color: var(--text);
}

.reel-download-item:hover {
  background: var(--bg-card);
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .reels-layout { flex-direction: column; }
  .reel-detail-panel { width: 100%; min-width: 100%; border-left: none; border-top: 1px solid var(--border); }
  .reels-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}
