/* ═══════════════════════════════════════════════════════════════════════════
   Gerador de Voz — Design System
   Dark mode · Glassmorphism · Premium
   ═══════════════════════════════════════════════════════════════════════════ */

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

/* ── CSS Variables ───────────────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-root:        #080812;
  --bg-sidebar:     #0d0d1a;
  --bg-surface:     rgba(255, 255, 255, 0.04);
  --bg-surface-hover: rgba(255, 255, 255, 0.07);
  --bg-input:       rgba(255, 255, 255, 0.06);

  /* Borders */
  --border:         rgba(255, 255, 255, 0.08);
  --border-focus:   rgba(124, 58, 237, 0.6);

  /* Accent */
  --accent:         #7C3AED;
  --accent-2:       #3B82F6;
  --accent-grad:    linear-gradient(135deg, #7C3AED, #3B82F6);
  --accent-glow:    0 0 24px rgba(124, 58, 237, 0.35);

  /* Text */
  --text-1:         #F1F5F9;
  --text-2:         #94A3B8;
  --text-3:         #475569;

  /* Semantic */
  --success:        #10B981;
  --success-bg:     rgba(16, 185, 129, 0.1);
  --warning:        #F59E0B;
  --warning-bg:     rgba(245, 158, 11, 0.1);
  --error:          #EF4444;
  --error-bg:       rgba(239, 68, 68, 0.1);
  --info:           #3B82F6;
  --info-bg:        rgba(59, 130, 246, 0.1);

  /* Layout */
  --sidebar-width:  260px;
  --topbar-height:  60px;
  --radius:         12px;
  --radius-sm:      8px;
  --radius-lg:      16px;

  /* Transitions */
  --transition:     0.2s ease;
  --transition-slow: 0.35s ease;
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-root);
  color: var(--text-1);
  height: 100vh;
  display: flex;
  overflow: hidden;   /* apenas .content deve rolar */
  -webkit-font-smoothing: antialiased;
}

/* Subtle animated background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(124, 58, 237, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgba(59, 130, 246, 0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* ═══════════════════════════════════════════════════════════════ SIDEBAR ═══ */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;          /* fixo no viewport */
  overflow-y: auto;       /* scroll interno se o menu for longo */
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: transform var(--transition-slow);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.logo-icon {
  font-size: 1.75rem;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-grad);
  border-radius: var(--radius-sm);
  box-shadow: var(--accent-glow);
  flex-shrink: 0;
}

.logo-text { display: flex; flex-direction: column; }
.logo-title { font-size: .9rem; font-weight: 700; color: var(--text-1); line-height: 1.2; }
.logo-sub   { font-size: .7rem; color: var(--text-3); margin-top: .1rem; }

/* ── Sidebar Navigation ──────────────────────────────────────────────────── */
.sidebar-nav {
  flex: 1;
  padding: 1rem .75rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .875rem;
  width: 100%;
  padding: .75rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  text-align: left;
}

.nav-item:hover {
  background: var(--bg-surface-hover);
  color: var(--text-1);
}

.nav-item.active {
  background: rgba(124, 58, 237, 0.15);
  color: var(--text-1);
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-item.active .nav-icon { filter: none; }

.nav-icon { font-size: 1.1rem; width: 22px; text-align: center; flex-shrink: 0; }
.nav-label { flex: 1; }
.nav-badge {
  background: var(--accent-grad);
  color: white;
  font-size: .65rem;
  font-weight: 700;
  padding: .15rem .45rem;
  border-radius: 99px;
  min-width: 20px;
  text-align: center;
}

/* ── Sidebar Footer ──────────────────────────────────────────────────────── */
.sidebar-footer {
  padding: 1rem 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
}

.version-badge {
  display: inline-flex;
  align-items: center;
  background: var(--accent-grad);
  color: white;
  font-size: .65rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 99px;
  margin-bottom: .5rem;
  letter-spacing: .03em;
}

.sidebar-footer-note {
  font-size: .68rem;
  color: var(--text-3);
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════ MAIN ══════ */
.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  height: 100vh;        /* altura FIXA = viewport, permite .content rolar */
  overflow: hidden;     /* só .content deve ter overflow-y:auto */
  position: relative;
  z-index: 1;
}

/* ── Top Bar ─────────────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.75rem;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 8, 18, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 1.25rem;
  cursor: pointer;
  padding: .375rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}

.sidebar-toggle:hover { color: var(--text-1); }

.topbar-title {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-1);
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .75rem;
  color: var(--text-3);
}

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-3);
}

.status-dot.online { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.error  { background: var(--error);   box-shadow: 0 0 6px var(--error); }

/* ── Content ─────────────────────────────────────────────────────────────── */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 2rem 4rem;
}

/* ─ Sections ────────────────────────────────────────────────────────────── */
.section { display: none; }
.section.active { display: block; }

.section-header { margin-bottom: 1.75rem; }

.section-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: .35rem;
}

.section-desc {
  font-size: .875rem;
  color: var(--text-2);
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════ GLASS CARD ═ */
.glass-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(8px);
  margin-bottom: 1.25rem;
  position: relative;
  transition: border-color var(--transition);
}

.glass-card:hover { border-color: rgba(255,255,255,0.12); }

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: .875rem;
}

.card-desc {
  font-size: .8rem;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* ─ Step card ───────────────────────────────────────────────────────────── */
.step-card { padding-left: 2rem; }

.step-number {
  position: absolute;
  left: -14px;
  top: 1.5rem;
  width: 28px; height: 28px;
  background: var(--accent-grad);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  color: white;
  box-shadow: var(--accent-glow);
}

/* ═══════════════════════════════════════════════════════════════ LAYOUT ════ */
.two-col {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.25rem;
  align-items: start;
}

.settings-col { position: sticky; top: calc(var(--topbar-height) + 1rem); }

.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

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

.toolbar {
  display: flex;
  gap: .75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════ FORMS ═════ */
.form-group { margin-bottom: 1.25rem; }
.form-group:last-child { margin-bottom: 0; }

.form-label {
  display: block;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: .5rem;
}

.form-select,
.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-family: inherit;
  font-size: .875rem;
  padding: .625rem .875rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
  outline: none;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%2394A3B8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  padding-right: 2.25rem;
}

.form-select:focus,
.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.form-select option { background: #1a1a2e; }

.form-hint {
  display: block;
  font-size: .75rem;
  color: var(--text-3);
  margin-top: .35rem;
}

.form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-family: inherit;
  font-size: .875rem;
  padding: .875rem 1rem;
  resize: vertical;
  min-height: 200px;
  line-height: 1.6;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.form-textarea::placeholder { color: var(--text-3); }
.form-input::placeholder    { color: var(--text-3); }

.textarea-wrap { position: relative; }

.char-counter {
  position: absolute;
  bottom: .5rem;
  right: .75rem;
  font-size: .7rem;
  color: var(--text-3);
  pointer-events: none;
}

/* ─ Range slider ─────────────────────────────────────────────────────────── */
.form-range {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent-grad);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(124,58,237,.5);
  transition: transform var(--transition);
}

.form-range::-webkit-slider-thumb:hover { transform: scale(1.2); }

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: .65rem;
  color: var(--text-3);
  margin-top: .3rem;
}

/* ─ Radio group ──────────────────────────────────────────────────────────── */
.radio-group { display: flex; flex-direction: column; gap: .4rem; }

.radio-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  cursor: pointer;
  font-size: .8rem;
  color: var(--text-2);
  padding: .4rem .6rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.radio-item:hover { background: var(--bg-surface-hover); }

.radio-item input[type="radio"] {
  accent-color: var(--accent);
  width: 15px; height: 15px;
  cursor: pointer;
}

/* ─ Checkbox ─────────────────────────────────────────────────────────────── */
.checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  cursor: pointer;
  font-size: .825rem;
  color: var(--text-2);
  line-height: 1.5;
  padding: .875rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition);
}

.checkbox-item:hover { border-color: rgba(255,255,255,0.15); }
.checkbox-item input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; margin-top: .15rem; cursor: pointer; }

/* ═══════════════════════════════════════════════════════════════ BUTTONS ═══ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .625rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  outline: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: .4;
  cursor: not-allowed;
  filter: grayscale(.5);
}

.btn-lg { padding: .875rem 2rem; font-size: .95rem; border-radius: var(--radius); }

.btn-sm { padding: .45rem .9rem; font-size: .8rem; }

.btn-primary {
  background: var(--accent-grad);
  color: white;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.35);
}

.btn-primary:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(124, 58, 237, 0.5);
}

.btn-primary:not(:disabled):active { transform: translateY(0); }

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

.btn-secondary:not(:disabled):hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}

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

.btn-danger {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:not(:disabled):hover { background: rgba(239,68,68,.2); }

.btn-icon { font-size: 1rem; }

.btn-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 1.25rem;
}

/* ═══════════════════════════════════════════════════════════════ DROPZONE ══ */
.dropzone {
  border: 2px dashed rgba(124, 58, 237, 0.4);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.dropzone:hover, .dropzone.drag-over {
  border-color: var(--accent);
  background: rgba(124, 58, 237, 0.07);
}

.dropzone.has-file {
  border-style: solid;
  border-color: var(--success);
  background: var(--success-bg);
}

.dropzone-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.dropzone-text { font-size: .9rem; color: var(--text-2); margin-bottom: .4rem; }
.dropzone-link { color: var(--accent); font-weight: 600; }
.dropzone-hint { font-size: .75rem; color: var(--text-3); }

/* ═══════════════════════════════════════════════════════════════ RESULT ════ */
.result-area { margin-top: 1.25rem; }

.result-card {
  background: var(--success-bg);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  animation: slideIn .3s ease;
}

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

.result-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--success);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: .75rem;
  margin-bottom: 1.25rem;
}

.metric-card {
  background: rgba(0,0,0,.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .75rem;
  text-align: center;
}

.metric-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-1);
  display: block;
}

.metric-label {
  font-size: .7rem;
  color: var(--text-3);
  margin-top: .2rem;
  display: block;
}

/* Custom audio player wrapper */
.audio-wrap {
  margin: 1rem 0;
}

.audio-wrap audio {
  width: 100%;
  border-radius: var(--radius-sm);
  accent-color: var(--accent);
  filter: invert(1) hue-rotate(180deg);
}

/* ═══════════════════════════════════════════════════════════════ VALIDATION = */
.validation-area {
  margin-top: 1.25rem;
}

.validation-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  animation: slideIn .3s ease;
}

.validation-card.valid { border-color: rgba(16,185,129,.3); }
.validation-card.invalid { border-color: rgba(239,68,68,.3); }

.validation-metrics {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.val-metric {
  flex: 1;
  min-width: 80px;
  text-align: center;
  padding: .625rem;
  background: rgba(0,0,0,.2);
  border-radius: var(--radius-sm);
}

.val-metric-value { font-size: 1rem; font-weight: 700; display: block; }
.val-metric-label { font-size: .68rem; color: var(--text-3); display: block; margin-top: .15rem; }

.alert-list { display: flex; flex-direction: column; gap: .5rem; margin-top: .75rem; }

.alert-item {
  padding: .625rem .875rem;
  border-radius: var(--radius-sm);
  font-size: .8rem;
  border-left: 3px solid;
}

.alert-item.warning { background: var(--warning-bg); border-color: var(--warning); color: var(--warning); }
.alert-item.error   { background: var(--error-bg);   border-color: var(--error);   color: var(--error); }
.alert-item.info    { background: var(--info-bg);     border-color: var(--info);    color: var(--info); }

/* ═══════════════════════════════════════════════════════════════ PROFILES ══ */
.profiles-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.25rem;
  align-items: start;
  transition: border-color var(--transition);
  animation: slideIn .3s ease;
}

.profile-card:hover { border-color: rgba(255,255,255,0.15); }

.profile-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: .5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.profile-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: .75rem;
  flex-wrap: wrap;
}

.profile-meta-item {
  font-size: .75rem;
  color: var(--text-3);
}

.profile-id {
  font-size: .7rem;
  color: var(--text-3);
  font-family: monospace;
  background: rgba(0,0,0,.2);
  padding: .2rem .5rem;
  border-radius: 4px;
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: .625rem;
  min-width: 140px;
}

.profile-gen-form {
  background: rgba(0,0,0,.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .875rem;
  display: none;
  flex-direction: column;
  gap: .625rem;
  margin-top: .5rem;
}

.profile-gen-form.open { display: flex; }

/* ═══════════════════════════════════════════════════════════════ TABLE ═════ */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }

.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .825rem;
}

.preview-table th {
  background: rgba(0,0,0,.3);
  color: var(--text-2);
  font-weight: 600;
  padding: .625rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.preview-table td {
  padding: .5rem 1rem;
  color: var(--text-1);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: top;
}

.preview-table tr:last-child td { border-bottom: none; }
.preview-table tr:hover td { background: rgba(255,255,255,.02); }

.preview-table .cena-col {
  width: 80px;
  font-weight: 600;
  color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════ STATS ═════ */
.stats-row {
  display: flex;
  gap: .875rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .875rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: .8rem;
}

.stat-pill .stat-value { font-weight: 700; color: var(--text-1); }
.stat-pill .stat-label { color: var(--text-3); }

.stats-summary {
  font-size: .875rem;
  color: var(--text-2);
  margin-bottom: 1.25rem;
}

/* ═══════════════════════════════════════════════════════════════ ROTEIRO RES */
.roteiro-results { display: flex; flex-direction: column; gap: .75rem; }

.roteiro-cena-card {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  animation: slideIn .2s ease;
  align-items: center;
}

.roteiro-cena-card.error { border-color: rgba(239,68,68,.25); }

.roteiro-cena-meta { }
.roteiro-cena-num { font-size: 1rem; font-weight: 700; margin-bottom: .25rem; }
.roteiro-cena-text { font-size: .78rem; color: var(--text-3); line-height: 1.5; }
.roteiro-cena-file { font-size: .72rem; color: var(--text-3); font-family: monospace; margin-top: .25rem; }

/* ═══════════════════════════════════════════════════════════════ SAIDAS ════ */
.saidas-list { display: flex; flex-direction: column; gap: .75rem; }

.saida-card {
  display: grid;
  grid-template-columns: 1.5fr 3fr auto;
  gap: 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  align-items: center;
  transition: border-color var(--transition);
  animation: slideIn .2s ease;
}

.saida-card:hover { border-color: rgba(255,255,255,.12); }

.saida-name {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-1);
  word-break: break-all;
}

.saida-meta {
  font-size: .72rem;
  color: var(--text-3);
  margin-top: .2rem;
}

.saida-actions { display: flex; gap: .5rem; }

/* ════════════════════════════════════════════════════════ BANNERS / ALERTS ══ */
.warning-banner {
  background: var(--warning-bg);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-left: 4px solid var(--warning);
  border-radius: var(--radius-sm);
  padding: .875rem 1.25rem;
  font-size: .825rem;
  color: var(--warning);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.info-banner {
  background: var(--info-bg);
  border: 1px solid rgba(59,130,246,.2);
  border-left: 4px solid var(--info);
  border-radius: var(--radius-sm);
  padding: .875rem 1.25rem;
  font-size: .825rem;
  color: var(--info);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.success-banner {
  background: var(--success-bg);
  border: 1px solid rgba(16,185,129,.25);
  border-left: 4px solid var(--success);
  border-radius: var(--radius-sm);
  padding: .875rem 1.25rem;
  font-size: .825rem;
  color: var(--success);
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════ COLLAPSIBLE */
.collapsible { }

.collapsible-toggle {
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem 0;
  transition: color var(--transition);
}

.collapsible-toggle:hover { color: var(--text-1); }
.collapsible-toggle::-webkit-details-marker { display: none; }
.collapsible[open] .collapsible-toggle { color: var(--text-1); }

.collapsible-body {
  padding: 1rem;
  background: rgba(0,0,0,.15);
  border-radius: var(--radius-sm);
  margin-top: .5rem;
  font-size: .825rem;
  color: var(--text-2);
  line-height: 1.6;
}

/* ══════════════════════════════════════════════════════════ GLOBAL LOADER ═══ */
.global-loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 18, .7);
  backdrop-filter: blur(4px);
}

.loader-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 2.5rem 3rem;
  min-width: 240px;
}

.spinner {
  width: 44px; height: 44px;
  border: 3px solid rgba(124,58,237,.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

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

.loader-text {
  font-size: .9rem;
  color: var(--text-2);
  text-align: center;
}

/* ── Loader progress bar ──────────────────────────────────────────────────── */
.loader-card {
  min-width: 320px;
  max-width: 420px;
}

.loader-progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  overflow: hidden;
}

.loader-progress-bar {
  height: 100%;
  background: var(--accent-grad);
  border-radius: 99px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.5);
}

.loader-progress-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-3);
}

#loader-progress-pct {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.85rem;
}

#loader-progress-detail {
  color: var(--text-2);
}

/* ══════════════════════════════════════════════════════════════ TOAST ══════ */
.toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: .625rem;
  pointer-events: none;
}

.toast {
  background: #1e1e2e;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .875rem 1.25rem;
  font-size: .825rem;
  color: var(--text-1);
  min-width: 260px;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  animation: toastIn .3s ease;
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: .625rem;
  border-left: 4px solid var(--border);
}

.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); }

.toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast-body { flex: 1; line-height: 1.5; }

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

@keyframes toastOut {
  to { opacity: 0; transform: translateX(24px); }
}

/* ═══════════════════════════════════════════════════════════════ MISC ═══════ */
.tag-optional {
  font-size: .7rem;
  color: var(--text-3);
  font-weight: 400;
  background: rgba(255,255,255,.06);
  padding: .1rem .4rem;
  border-radius: 4px;
  margin-left: .25rem;
}

code {
  font-family: 'Courier New', monospace;
  background: rgba(124,58,237,.15);
  color: var(--accent);
  padding: .1rem .4rem;
  border-radius: 4px;
  font-size: .85em;
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-3);
}

.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; opacity: .5; }
.empty-state-title { font-size: 1rem; font-weight: 600; color: var(--text-2); margin-bottom: .5rem; }
.empty-state-desc  { font-size: .825rem; line-height: 1.6; }

/* Progress bar */
.progress-bar-wrap {
  background: rgba(0,0,0,.2);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--accent-grad);
  border-radius: 99px;
  transition: width .3s ease;
  position: relative;
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.2), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

/* ═══════════════════════════════════════════════════════════════ RESPONSIVE ═ */
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .settings-col { position: static; }
  .roteiro-cena-card { grid-template-columns: 1fr; }
  .saida-card { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0,0,0,.5);
  }

  .main { margin-left: 0; }

  .sidebar-toggle { display: flex; }

  .content { padding: 1.25rem 1rem 3rem; }

  .profile-card { grid-template-columns: 1fr; }
}
