/* ==========================================================================
   PROJETO APROVAR — GERADOR DE CARROSSÉIS IA
   CSS Design System & Modular Stylesheet
   ========================================================================== */

/* --- 1. CSS Custom Properties / Tokens --- */
:root {
  /* Color Palette: Navy, Slate, Amber, Emerald, Crimson, Blue */
  --bg-base: #070b14;
  --bg-surface-0: #0a0f1d;
  --bg-surface-1: #0f172a;
  --bg-surface-2: #162038;
  --bg-surface-3: #1e2b4a;
  --bg-surface-hover: #263559;
  
  --bg-glass: rgba(15, 23, 42, 0.85);
  --bg-glass-card: rgba(22, 32, 56, 0.7);
  --bg-glass-subtle: rgba(255, 255, 255, 0.03);

  /* Police Gold / Amber Accent */
  --amber-50: #fffbeb;
  --amber-100: #fef3c7;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --amber-700: #b45309;
  --amber-glow: rgba(245, 158, 11, 0.22);
  --amber-glow-strong: rgba(245, 158, 11, 0.45);

  /* Emerald Green (Approval & Success) */
  --emerald-400: #34d399;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-700: #047857;
  --emerald-glow: rgba(16, 185, 129, 0.25);

  /* Crimson Red (Reject, Adjust & Errors) */
  --crimson-400: #f87171;
  --crimson-500: #ef4444;
  --crimson-600: #dc2626;
  --crimson-700: #b91c1c;
  --crimson-glow: rgba(239, 68, 68, 0.25);

  /* Cerulean Blue (AI, Research & Tools) */
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-glow: rgba(59, 130, 246, 0.25);

  /* Neutral Text & Borders */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-disabled: #475569;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.14);
  --border-active: var(--amber-500);

  /* Typography */
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.1);
  --shadow-glow: 0 0 24px var(--amber-glow);

  /* Spacing & Transitions */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 350ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- 2. Reset & Base Setup --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(245, 158, 11, 0.08), transparent 70%),
    radial-gradient(ellipse 60% 40% at 85% 95%, rgba(59, 130, 246, 0.05), transparent 70%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Code font utility */
.code-font, code, pre, textarea.form-textarea {
  font-family: var(--font-mono);
}

/* --- 3. App Header & Navbar --- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: border-color var(--transition-normal);
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

/* Brand area */
.brand-area {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
  user-select: none;
  transition: transform var(--transition-fast);
}

.brand-area:hover {
  transform: translateY(-1px);
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--bg-surface-3), var(--bg-surface-1));
  border: 1px solid rgba(245, 158, 11, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--amber-400);
  box-shadow: 0 0 16px var(--amber-glow);
}

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

.brand-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.brand-title strong {
  color: var(--amber-400);
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber-400);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-full);
  letter-spacing: 0.08em;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Navigation Tabs in Header */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-surface-0);
  padding: 0.3rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.templates-list {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.template-item {
  padding: 0.8rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-glass-subtle);
}

.template-item-title {
  color: var(--amber-400);
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.template-item-meta {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.template-picker-group .form-hint {
  margin-top: 0.35rem;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--text-primary);
  background: var(--bg-surface-2);
}

.nav-tab.active {
  color: #ffffff;
  background: var(--bg-surface-3);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-medium);
}

.nav-tab.active svg {
  color: var(--amber-400);
}

.badge-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  background: var(--amber-500);
  color: #000000;
  border-radius: var(--radius-full);
}

/* Header Actions: API status & API key */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.api-status-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber-500);
  transition: background-color var(--transition-fast);
}

.status-dot.online {
  background: var(--emerald-500);
  box-shadow: 0 0 8px var(--emerald-500);
}

.status-dot.offline {
  background: var(--crimson-500);
  box-shadow: 0 0 8px var(--crimson-500);
}

.status-dot.pulse {
  animation: dotPulse 1.8s infinite;
}

@keyframes dotPulse {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

/* --- 4. Main App Container & Views Layout --- */
.app-main {
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
}

.view-section {
  display: none;
  animation: fadeInView 0.3s ease-out;
}

.view-section.active {
  display: block;
}

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

/* --- 5. Studio View (Creation Form) --- */
.studio-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}

.studio-form-card {
  background: var(--bg-glass-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

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

.section-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--amber-400);
  background: rgba(245, 158, 11, 0.12);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-xs);
  margin-bottom: 0.5rem;
  border-left: 2px solid var(--amber-500);
}

.card-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 0.4rem;
}

.card-description {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Forms & Inputs */
.studio-form {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

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

.form-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.required-star {
  color: var(--amber-400);
}

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

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.form-textarea, .form-input, .form-select {
  width: 100%;
  background: var(--bg-surface-0);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  color: var(--text-primary);
  font-size: 0.92rem;
  transition: all var(--transition-fast);
  outline: none;
}

.form-textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.5;
}

.form-textarea:focus, .form-input:focus, .form-select:focus {
  border-color: var(--amber-500);
  box-shadow: 0 0 0 3px var(--amber-glow);
  background: var(--bg-surface-1);
}

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

/* Quick Presets / Suggestions */
.quick-presets-wrapper {
  margin-top: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.presets-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.preset-chip {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-main);
}

.preset-chip:hover {
  background: var(--bg-surface-3);
  color: #ffffff;
  border-color: var(--amber-500);
  transform: translateY(-1px);
}

/* Grid controls: Sliders & Switches */
.form-grid-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr;
  gap: 1rem;
}

.control-box {
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.control-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.control-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.counter-badge {
  font-size: 0.82rem;
  font-family: var(--font-mono);
  font-weight: 700;
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber-400);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.1rem 0.55rem;
  border-radius: var(--radius-sm);
}

.slider-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--bg-surface-3);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
}

.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--amber-400);
  border: 2px solid #ffffff;
  box-shadow: 0 0 8px var(--amber-glow-strong);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

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

.slider-marks {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  font-family: var(--font-mono);
  color: var(--text-disabled);
}

/* Switch styling */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  height: 100%;
}

.switch-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.switch-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.switch-title svg {
  color: var(--blue-400);
}

.switch-description {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.switch-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-surface-3);
  border: 1px solid var(--border-medium);
  transition: var(--transition-fast);
  border-radius: var(--radius-full);
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: var(--transition-fast);
  border-radius: 50%;
}

.switch-toggle input:checked + .switch-slider {
  background-color: var(--blue-600);
  border-color: var(--blue-500);
}

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

/* Drag and Drop Zone */
.drop-zone {
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1rem;
  background: var(--bg-surface-0);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--amber-500);
  background: rgba(245, 158, 11, 0.04);
}

.file-input-hidden {
  display: none;
}

.drop-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.drop-icon {
  color: var(--amber-400);
  margin-bottom: 0.2rem;
}

.drop-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.browse-link {
  color: var(--amber-400);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.drop-subtext {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* File list preview chips */
.file-list-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.file-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-medium);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-primary);
}

.file-chip-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-chip-size {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.file-chip-remove {
  background: transparent;
  border: none;
  color: var(--crimson-400);
  cursor: pointer;
  padding: 0 0.2rem;
  display: flex;
  align-items: center;
}

/* URLs list */
.url-inputs-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.url-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.input-with-icon {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.input-with-icon svg {
  position: absolute;
  left: 0.9rem;
  color: var(--text-muted);
  pointer-events: none;
}

.input-with-icon .form-input {
  padding-left: 2.6rem;
}

.btn-icon-delete {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--crimson-400);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--crimson-500);
}

/* Buttons System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  user-select: none;
  text-decoration: none;
}

.btn-lg {
  padding: 0.9rem 1.75rem;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--amber-400), var(--amber-600));
  color: #0b0f19;
  box-shadow: 0 4px 15px var(--amber-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--amber-glow-strong);
  background: linear-gradient(135deg, var(--amber-400), var(--amber-500));
}

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

.btn-amber {
  background: var(--amber-500);
  color: #0b0f19;
}

.btn-amber:hover {
  background: var(--amber-400);
  box-shadow: 0 0 15px var(--amber-glow);
}

.btn-emerald {
  background: linear-gradient(135deg, var(--emerald-500), var(--emerald-700));
  color: #ffffff;
  box-shadow: 0 4px 15px var(--emerald-glow);
}

.btn-emerald:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-crimson {
  background: linear-gradient(135deg, var(--crimson-500), var(--crimson-700));
  color: #ffffff;
  box-shadow: 0 4px 15px var(--crimson-glow);
}

.btn-crimson:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-blue {
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  color: #ffffff;
  box-shadow: 0 4px 15px var(--blue-glow);
}

.btn-blue:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-subtle {
  background: var(--bg-surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}

.btn-subtle:hover {
  background: var(--bg-surface-3);
  border-color: var(--border-active);
}

.btn-text-action {
  background: transparent;
  border: none;
  color: var(--amber-400);
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: color var(--transition-fast);
}

.btn-text-action:hover {
  color: var(--amber-100);
  text-decoration: underline;
}

.btn-icon-subtle {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon-subtle:hover {
  background: var(--bg-surface-2);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

/* Spinner & Button Loading state */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

.spinner.lg {
  width: 36px;
  height: 36px;
  border-width: 3px;
  border-top-color: var(--amber-400);
}

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

.btn-content {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

/* Studio Right Sidebar */
.studio-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.info-card {
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
}

.info-card.subtle {
  background: var(--bg-glass-subtle);
}

.info-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.8rem;
}

.info-icon.amber {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber-400);
}

.info-icon.blue {
  background: rgba(59, 130, 246, 0.15);
  color: var(--blue-400);
}

.info-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.6rem;
}

.info-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.info-steps strong {
  color: var(--amber-400);
}

.info-text {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.info-text em {
  color: var(--blue-400);
  font-style: normal;
  font-weight: 600;
}

.stats-mini-card {
  background: linear-gradient(135deg, var(--bg-surface-2), var(--bg-surface-1));
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.stat-mini-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.stat-mini-val {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--amber-400);
}

.stat-mini-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border-subtle);
}

/* --- 6. View 2: Projects & Approval Workflow --- */
.projects-workspace {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.5rem;
  min-height: 720px;
}

/* Projects Sidebar */
.projects-sidebar {
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: calc(100vh - 120px);
  position: sticky;
  top: 80px;
}

.sidebar-header {
  padding: 1.2rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

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

.sidebar-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
}

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

.search-input-box svg {
  position: absolute;
  left: 0.8rem;
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.8rem 0.55rem 2.2rem;
  color: var(--text-primary);
  font-size: 0.82rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.search-input:focus {
  border-color: var(--amber-500);
}

.filter-pills {
  display: flex;
  gap: 0.35rem;
  background: var(--bg-surface-1);
  padding: 0.25rem;
  border-radius: var(--radius-md);
}

.filter-pill {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.35rem 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-main);
  text-align: center;
}

.filter-pill:hover {
  color: var(--text-primary);
}

.filter-pill.active {
  background: var(--bg-surface-3);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.projects-list-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Project Item in Sidebar */
.project-item-card {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.project-item-card:hover {
  background: var(--bg-surface-2);
  border-color: var(--border-medium);
  transform: translateX(2px);
}

.project-item-card.active {
  background: var(--bg-surface-2);
  border-color: var(--amber-500);
  box-shadow: 0 0 12px var(--amber-glow);
}

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

.item-id {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-weight: 600;
}

.item-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

.badge-ideacao {
  background: rgba(59, 130, 246, 0.15);
  color: var(--blue-400);
}

.badge-gerando {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber-400);
}

.badge-finalizado {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-400);
}

.item-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
}

.item-meta {
  font-size: 0.74rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.empty-state-small {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.empty-icon {
  font-size: 2rem;
}

/* Stage Main Area */
.project-stage {
  background: var(--bg-glass-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
}

.stage-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 500px;
  gap: 1rem;
}

.empty-illustration {
  color: var(--text-disabled);
  margin-bottom: 0.5rem;
}

.stage-empty-state h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffffff;
}

.stage-empty-state p {
  color: var(--text-muted);
  max-width: 400px;
  font-size: 0.9rem;
}

/* Stage Header */
.stage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.5rem;
  gap: 1.5rem;
}

.stage-title-block {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.project-id-tag {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--bg-surface-0);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

.status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-full);
}

.theme-tag {
  font-size: 0.72rem;
  color: var(--text-secondary);
  background: var(--bg-surface-2);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-sm);
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-project-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
}

/* Progress widget */
.progress-widget {
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.progress-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
}

.progress-title {
  color: var(--text-muted);
  font-weight: 600;
}

.progress-value {
  font-family: var(--font-mono);
  color: var(--amber-400);
  font-weight: 700;
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  background: var(--bg-surface-0);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--amber-500), var(--emerald-500));
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* Stage Main Grid */
.stage-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
  align-items: start;
}

/* Carousel Player Viewport */
.carousel-viewport-card {
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.carousel-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.aspect-toggle {
  display: flex;
  background: var(--bg-surface-1);
  padding: 0.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.aspect-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.aspect-btn.active {
  background: var(--bg-surface-3);
  color: #ffffff;
}

.carousel-counter {
  font-size: 0.82rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--amber-400);
}

.viewport-actions {
  display: flex;
  gap: 0.4rem;
}

/* Slide Display Frame (Aspect 4:5 or 1:1) */
.slide-display-frame {
  position: relative;
  background: radial-gradient(circle at center, #16223b 0%, #0c1220 100%);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 0 auto;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width var(--transition-smooth), height var(--transition-smooth);
}

.slide-display-frame.aspect-portrait {
  width: 360px;
  height: 450px; /* 4:5 ratio */
}

.slide-display-frame.aspect-square {
  width: 400px;
  height: 400px; /* 1:1 ratio */
}

.slide-media-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-visual-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Placeholder inside frame */
.card-empty-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  gap: 0.8rem;
  color: var(--text-muted);
}

.placeholder-icon {
  color: var(--amber-400);
  opacity: 0.8;
}

.card-empty-placeholder h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
}

.card-empty-placeholder p {
  font-size: 0.8rem;
  line-height: 1.4;
  max-width: 240px;
}

/* Loading Overlay */
.slide-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(7, 11, 20, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 10;
}

.loading-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--amber-400);
}

/* Carousel Navigation Arrows */
.carousel-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-medium);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.carousel-nav-btn:hover {
  background: var(--amber-500);
  color: #000000;
  border-color: var(--amber-400);
  transform: translateY(-50%) scale(1.1);
}

.carousel-nav-btn.prev {
  left: 12px;
}

.carousel-nav-btn.next {
  right: 12px;
}

.carousel-nav-btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
  pointer-events: none;
}

/* Bottom Thumbnails Rail */
.thumbnails-rail {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding: 0.5rem 0.2rem;
  scrollbar-width: thin;
}

.thumbnail-item {
  flex-shrink: 0;
  width: 64px;
  height: 80px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-1);
  border: 2px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumbnail-item:hover {
  border-color: var(--text-muted);
  transform: translateY(-2px);
}

.thumbnail-item.active {
  border-color: var(--amber-400);
  box-shadow: 0 0 10px var(--amber-glow);
}

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

.thumbnail-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 0.62rem;
  font-family: var(--font-mono);
  font-weight: 700;
  background: rgba(0, 0, 0, 0.7);
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
  color: #ffffff;
}

.thumbnail-status-icon {
  position: absolute;
  bottom: 4px;
  right: 4px;
  font-size: 0.7rem;
}

/* Card Inspector Card */
.card-inspector-card {
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.inspector-header {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-order-tag {
  font-size: 0.88rem;
  font-weight: 800;
  color: #ffffff;
}

.card-status-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
}

.card-status-pill.status-pendente {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber-400);
}

.card-status-pill.status-aprovado {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-400);
}

.card-status-pill.status-regenerando {
  background: rgba(239, 68, 68, 0.15);
  color: var(--crimson-400);
}

.attempts-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--bg-surface-1);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.attempts-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber-400);
}

.inspector-body-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  max-height: 420px;
}

.inspector-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

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

.inspector-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.inspector-label.feedback-lbl {
  color: var(--crimson-400);
}

.inspector-slide-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
}

.inspector-copy-box, .inspector-prompt-box, .inspector-feedback-box {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text-secondary);
  word-break: break-word;
}

.inspector-prompt-box {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--amber-100);
  background: #090e1a;
  border-color: rgba(245, 158, 11, 0.2);
}

.inspector-feedback-box {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.06);
  color: #fca5a5;
  font-size: 0.8rem;
}

.btn-copy {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.btn-copy:hover {
  color: var(--amber-400);
}

.inspector-actions {
  padding: 1.1rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface-0);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.actions-primary-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.actions-secondary-row {
  display: flex;
  gap: 0.5rem;
}

/* --- 7. View 3: AI Research Lab --- */
.lab-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 1080px;
  margin: 0 auto;
}

.lab-header {
  background: var(--bg-glass-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
}

.lab-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  background: var(--bg-surface-0);
  padding: 0.4rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.lab-subtab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lab-subtab:hover {
  color: var(--text-primary);
  background: var(--bg-surface-2);
}

.lab-subtab.active {
  background: var(--blue-600);
  color: #ffffff;
  box-shadow: 0 4px 12px var(--blue-glow);
}

.lab-panel {
  display: none;
  background: var(--bg-glass-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  flex-direction: column;
  gap: 1.5rem;
}

.lab-panel.active {
  display: flex;
}

.form-row-flex {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.flex-1 { flex: 1; }
.width-120 { width: 130px; }
.align-end { align-self: flex-end; }

.lab-results-box {
  background: #090e1a;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  min-height: 200px;
  max-height: 450px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.lab-placeholder-msg {
  color: var(--text-disabled);
  text-align: center;
  padding: 3rem 1rem;
}

.search-result-card {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.search-res-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--amber-400);
  text-decoration: none;
}

.search-res-title:hover {
  text-decoration: underline;
}

.search-res-snippet {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.search-res-url {
  font-size: 0.7rem;
  color: var(--blue-400);
}

/* --- 8. Modals & Lightbox --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(5, 8, 16, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: modalFadeIn 0.2s ease-out;
}

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

.modal-dialog {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
  from { transform: translateY(20px) scale(0.96); }
  to { transform: translateY(0) scale(1); }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.modal-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-icon-badge.crimson {
  background: rgba(239, 68, 68, 0.15);
  color: var(--crimson-400);
}

.modal-icon-badge.amber {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber-400);
}

.modal-icon-badge.blue {
  color: #7dd3fc;
  background: rgba(14, 116, 144, 0.2);
  border-color: rgba(56, 189, 248, 0.35);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff;
}

.modal-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-icon-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.btn-icon-close:hover {
  background: var(--bg-surface-2);
  color: #ffffff;
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* Image Lightbox */
.lightbox-backdrop {
  background: rgba(2, 4, 10, 0.94);
}

.lightbox-dialog {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lightbox-close {
  position: absolute;
  top: -45px;
  right: 0;
  background: transparent;
  border: none;
  color: #ffffff;
  cursor: pointer;
}

.lightbox-content {
  max-width: 800px;
  max-height: 75vh;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-medium);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.lightbox-img {
  width: 100%;
  height: 100%;
  max-height: 75vh;
  object-fit: contain;
  display: block;
}

.lightbox-footer {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* --- 9. Toast Notification System --- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: 380px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.toast.hiding {
  opacity: 0;
  transform: translateX(30px);
}

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

.toast-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.toast-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.toast-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
}

.toast-message {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  display: flex;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: rgba(255, 255, 255, 0.2);
}

.toast-progress-bar {
  height: 100%;
  width: 100%;
  animation: toastProgress 4.5s linear forwards;
}

@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

/* Toast variants */
.toast.success { border-color: var(--emerald-500); }
.toast.success .toast-icon { color: var(--emerald-400); }
.toast.success .toast-progress-bar { background: var(--emerald-500); }

.toast.error { border-color: var(--crimson-500); }
.toast.error .toast-icon { color: var(--crimson-400); }
.toast.error .toast-progress-bar { background: var(--crimson-500); }

.toast.info { border-color: var(--blue-500); }
.toast.info .toast-icon { color: var(--blue-400); }
.toast.info .toast-progress-bar { background: var(--blue-500); }

.toast.warning { border-color: var(--amber-500); }
.toast.warning .toast-icon { color: var(--amber-400); }
/* --- 9.1. Enhanced Studio & Stage Actions --- */
.prompt-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.btn-prompt-magic {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.25) 100%);
  border: 1px solid var(--amber-500);
  color: var(--amber-300);
  font-family: var(--font-main);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-prompt-magic:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3) 0%, rgba(217, 119, 6, 0.4) 100%);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.35);
  transform: translateY(-1px);
}

.theme-selector-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-select-lbl {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-select-sm {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-select-sm:focus {
  border-color: var(--amber-400);
}

.stage-quick-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.modal-lg {
  max-width: 680px;
  width: 92%;
}

.actions-secondary-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

/* --- 10. Responsive Breakpoints --- */
@media (max-width: 1200px) {
  .studio-layout {
    grid-template-columns: 1fr;
  }
  .stage-grid {
    grid-template-columns: 1fr;
  }
  .projects-workspace {
    grid-template-columns: 280px 1fr;
  }
}

@media (max-width: 860px) {
  .header-container {
    flex-wrap: wrap;
  }
  .nav-tabs {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  .projects-workspace {
    grid-template-columns: 1fr;
  }
  .projects-sidebar {
    height: auto;
    max-height: 350px;
    position: static;
  }
  .form-grid-controls {
    grid-template-columns: 1fr 1fr;
  }
  .full-width-sm {
    grid-column: span 2;
  }
  .slide-display-frame.aspect-portrait {
    width: 300px;
    height: 375px;
  }
  .slide-display-frame.aspect-square {
    width: 320px;
    height: 320px;
  }
}

@media (max-width: 540px) {
  .form-grid-controls {
    grid-template-columns: 1fr;
  }
  .full-width-sm {
    grid-column: span 1;
  }
  .actions-primary-row {
    grid-template-columns: 1fr;
  }
  .form-row-flex {
    flex-direction: column;
  }
  .width-120 {
    width: 100%;
  }
  .align-end {
    align-self: stretch;
  }
  .slide-display-frame.aspect-portrait {
    width: 270px;
    height: 337px;
  }
  .slide-display-frame.aspect-square {
    width: 270px;
    height: 270px;
  }
}

/* ==========================================================================
   MODAL DE IDEIAS DE DESCRIÇÃO & COPY STUDIO (LUXURY THEME)
   ========================================================================== */
.modal-caption-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Style Tabs Selector */
.caption-style-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.caption-style-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
}

.caption-style-btn:hover {
  border-color: var(--amber-500);
  background: var(--bg-surface-1);
  transform: translateY(-2px);
}

.caption-style-btn.active {
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.12), rgba(15, 23, 42, 0.8));
  border-color: var(--amber-500);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.2);
}

.caption-style-btn .style-icon {
  font-size: 1.25rem;
  margin-bottom: 0.15rem;
}

.caption-style-btn .style-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.caption-style-btn .style-tag {
  font-size: 0.7rem;
  color: var(--amber-400);
  font-weight: 600;
}

/* Hooks Panel */
.caption-hooks-panel {
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.caption-hooks-panel .panel-header-row,
.caption-hashtags-panel .panel-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.caption-hooks-panel .panel-label,
.caption-hashtags-panel .panel-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--amber-400);
  letter-spacing: 0.5px;
}

.caption-hooks-panel .panel-hint,
.caption-hashtags-panel .panel-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.hooks-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-hook-chip {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-align: left;
}

.btn-hook-chip:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--amber-400);
  color: var(--text-main);
  transform: translateY(-1px);
}

/* Caption Editor */
.caption-editor-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

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

.editor-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.char-count-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--amber-400);
  background: var(--bg-surface-0);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.caption-textarea-large {
  width: 100%;
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-main);
  resize: vertical;
  transition: border-color 0.2s ease;
}

.caption-textarea-large:focus {
  border-color: var(--amber-500);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
}

/* Hashtags Panel */
.caption-hashtags-panel {
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.hashtag-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-hashtag-pill {
  background: var(--bg-surface-1);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--amber-400);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-hashtag-pill:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--amber-500);
  border-style: solid;
  color: var(--text-main);
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .caption-style-nav {
    grid-template-columns: 1fr;
  }
}

/* User pill & admin */
.user-pill {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 0.3rem 0.75rem;
  background: var(--bg-surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}
.user-pill:hover {
  border-color: var(--amber-500);
}
#user-pill-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}
#user-pill-role {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--amber-400);
}

.admin-layout {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}
.admin-card {
  background: var(--bg-surface-0);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.admin-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  margin: 1.25rem 0 1rem;
  padding-bottom: 0.5rem;
}
.admin-tab {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 0.5rem 0.9rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.admin-tab.active,
.admin-tab:hover {
  color: var(--text-main);
  background: rgba(245, 158, 11, 0.1);
  border-color: var(--amber-500);
}
.admin-panel {
  display: none;
}
.admin-panel.active {
  display: block;
}
.admin-panels .form-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.admin-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.admin-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
}
.admin-list-item .meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.admin-list-item .name {
  font-weight: 700;
  color: var(--text-main);
}
.admin-list-item .sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.admin-list-item .actions {
  display: flex;
  gap: 0.4rem;
}

@media (max-width: 768px) {
  .admin-panels .form-row {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   PALETAS DE CORES (BIBLIOTECA VISUAL)
   ========================================================================== */
.paletas-list {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.paleta-list-item {
  padding: 0.8rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-glass-subtle);
}

.paleta-list-name {
  color: var(--amber-400);
  font-weight: 700;
  font-size: 0.88rem;
  word-break: break-word;
}

.paleta-list-desc {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 0.15rem;
  word-break: break-word;
}

.paleta-swatches {
  display: flex;
  gap: 4px;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.paleta-swatch {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid var(--border-medium);
}

.paleta-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.paleta-cores-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.color-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-surface-0);
}

.color-field-row.full {
  grid-column: 1 / -1;
}

.color-field-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.color-picker {
  width: 42px;
  height: 30px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xs);
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.color-picker::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.color-picker::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}

.color-text-input {
  width: 150px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.35rem 0.5rem;
}

.color-text-input.full {
  width: 100%;
}

.paleta-preview-wrap {
  display: flex;
  justify-content: center;
  padding: 0.9rem;
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-md);
  background: var(--bg-surface-0);
  margin-top: 0.5rem;
}

.paleta-preview-card {
  display: flex;
  justify-content: center;
}

.paleta-preview-card svg {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

@media (max-width: 640px) {
  .paleta-cores-grid {
    grid-template-columns: 1fr;
  }
  .color-field-row.full {
    grid-column: auto;
  }
  .color-text-input {
    width: 100%;
  }
}
