/* =====================================================
   TailAdmin Design System — Transcreve.ai
   Premium UI with dark mode, glassmorphism, micro-animations
   ===================================================== */

/* Google Fonts — carregadas de forma não bloqueante em templates/base.html */

/* ---------- CSS Custom Properties (Design Tokens) ---------- */
:root {
  /* Primary palette — rich violet/indigo */
  --color-primary-50:  #f5f3ff;
  --color-primary-100: #ede9fe;
  --color-primary-200: #ddd6fe;
  --color-primary-300: #c4b5fd;
  --color-primary-400: #a78bfa;
  --color-primary-500: #8b5cf6;
  --color-primary-600: #7c3aed;
  --color-primary-700: #6d28d9;
  --color-primary-800: #5b21b6;
  --color-primary-900: #4c1d95;

  /* Accent — cyan/teal */
  --color-accent-400: #22d3ee;
  --color-accent-500: #06b6d4;
  --color-accent-600: #0891b2;

  /* Semantic colors */
  --color-success-50:  #f0fdf4;
  --color-success-500: #22c55e;
  --color-success-600: #16a34a;
  --color-success-700: #15803d;

  --color-warning-50:  #fffbeb;
  --color-warning-500: #f59e0b;
  --color-warning-600: #d97706;

  --color-danger-50:  #fef2f2;
  --color-danger-500: #ef4444;
  --color-danger-600: #dc2626;

  --color-info-50:  #eff6ff;
  --color-info-500: #3b82f6;
  --color-info-600: #2563eb;

  /* Neutral / Surface */
  --color-surface: #ffffff;
  --color-surface-alt: #f8fafc;
  --color-border: #e2e8f0;
  --color-border-light: #f1f5f9;
  --color-text: #1e293b;
  --color-text-secondary: #64748b;
  --color-text-muted: #94a3b8;

  /* Sidebar */
  --sidebar-bg: linear-gradient(180deg, #1e1b4b 0%, #312e81 50%, #3730a3 100%);
  --sidebar-width: 280px;
  --sidebar-collapsed-width: 80px;

  /* Header */
  --header-height: 72px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.06);
  --shadow-glow: 0 0 20px rgba(139, 92, 246, .15);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(.4,0,.2,1);
  --transition-base: 250ms cubic-bezier(.4,0,.2,1);
  --transition-slow: 350ms cubic-bezier(.4,0,.2,1);

  /* Z-index scale */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;
  --z-toast: 800;

  /* Landing page gradient */
  --color-landing-bg-from: #f5f3ff;
  --color-landing-bg-to: #eff6ff;
}

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

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--color-text);
  line-height: 1.6;
}

code, pre, .font-mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-text-muted); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-secondary); }

/* ---------- Gradient Utilities ---------- */
.gradient-primary {
  background: linear-gradient(135deg, var(--color-primary-600) 0%, var(--color-primary-500) 50%, var(--color-accent-500) 100%);
}

.gradient-primary-soft {
  background: linear-gradient(135deg, var(--color-primary-50) 0%, var(--color-primary-100) 100%);
}

.gradient-sidebar {
  background: var(--sidebar-bg);
}

.gradient-hero {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 30%, #4c1d95 60%, #6d28d9 100%);
}

.gradient-text {
  background: linear-gradient(135deg, var(--color-primary-500), var(--color-accent-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- Backward Compatibility (legacy templates) ---------- */
.gradient-bg {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 35%, #5b21b6 70%, #6d28d9 100%);
}
.card-hover { transition: all 0.3s ease; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.progress-bar { transition: width 0.3s ease; }
.flash-message { animation: fadeIn 0.3s ease; }

/* ---------- Card Component ---------- */
.ta-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.ta-card:hover {
  box-shadow: var(--shadow-md);
}

.ta-card-interactive:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

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

.ta-card-body {
  padding: 1.5rem;
}

.ta-card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--color-border-light);
  background: var(--color-surface-alt);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ---------- Glassmorphism Card ---------- */
.ta-glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

/* ---------- Stats Card ---------- */
.ta-stat-card {
  position: relative;
  overflow: hidden;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.ta-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  border-radius: 0 0 0 100%;
  opacity: 0.08;
  transition: opacity var(--transition-base);
}

.ta-stat-card:hover::before { opacity: 0.12; }

.ta-stat-card.stat-primary::before { background: var(--color-primary-500); }
.ta-stat-card.stat-success::before { background: var(--color-success-500); }
.ta-stat-card.stat-warning::before { background: var(--color-warning-500); }
.ta-stat-card.stat-danger::before  { background: var(--color-danger-500); }
.ta-stat-card.stat-info::before    { background: var(--color-info-500); }

.ta-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.ta-stat-icon.icon-primary { background: var(--color-primary-50); color: var(--color-primary-600); }
.ta-stat-icon.icon-success { background: var(--color-success-50); color: var(--color-success-600); }
.ta-stat-icon.icon-warning { background: var(--color-warning-50); color: var(--color-warning-600); }
.ta-stat-icon.icon-danger  { background: var(--color-danger-50);  color: var(--color-danger-600); }
.ta-stat-icon.icon-info    { background: var(--color-info-50);    color: var(--color-info-600); }

.ta-stat-value {
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
}

.ta-stat-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-top: 0.25rem;
}

.ta-stat-trend {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.ta-stat-trend.trend-up { background: var(--color-success-50); color: var(--color-success-700); }
.ta-stat-trend.trend-down { background: var(--color-danger-50); color: var(--color-danger-600); }

/* ---------- Buttons ---------- */
.ta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.ta-btn:focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
}

.ta-btn:disabled, .ta-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary */
.ta-btn-primary {
  background: var(--color-primary-600);
  color: #fff;
  box-shadow: 0 1px 3px rgba(124, 58, 237, .3);
}
.ta-btn-primary:hover { background: var(--color-primary-700); box-shadow: 0 4px 12px rgba(124, 58, 237, .35); transform: translateY(-1px); }
.ta-btn-primary:active { transform: translateY(0); }

/* Secondary */
.ta-btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}
.ta-btn-secondary:hover { background: var(--color-surface-alt); border-color: var(--color-primary-300); color: var(--color-primary-700); }

/* Success */
.ta-btn-success { background: var(--color-success-600); color: #fff; }
.ta-btn-success:hover { background: var(--color-success-700); transform: translateY(-1px); }

/* Danger */
.ta-btn-danger { background: var(--color-danger-500); color: #fff; }
.ta-btn-danger:hover { background: var(--color-danger-600); transform: translateY(-1px); }

/* Ghost */
.ta-btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
}
.ta-btn-ghost:hover { background: var(--color-surface-alt); color: var(--color-text); }

/* Gradient */
.ta-btn-gradient {
  background: linear-gradient(135deg, var(--color-primary-600), var(--color-accent-500));
  color: #fff;
  box-shadow: 0 2px 8px rgba(124, 58, 237, .25);
}
.ta-btn-gradient:hover { box-shadow: 0 6px 20px rgba(124, 58, 237, .35); transform: translateY(-1px); }

/* Size variants */
.ta-btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; border-radius: var(--radius-sm); }
.ta-btn-lg { padding: 0.875rem 1.75rem; font-size: 1rem; }
.ta-btn-xl { padding: 1rem 2rem; font-size: 1.125rem; }
.ta-btn-icon { padding: 0.625rem; }
.ta-btn-icon.ta-btn-sm { padding: 0.375rem; }

/* ---------- Badges ---------- */
.ta-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  line-height: 1.5;
  white-space: nowrap;
}

.ta-badge-primary { background: var(--color-primary-50); color: var(--color-primary-700); }
.ta-badge-success { background: var(--color-success-50); color: var(--color-success-700); }
.ta-badge-warning { background: var(--color-warning-50); color: var(--color-warning-600); }
.ta-badge-danger  { background: var(--color-danger-50);  color: var(--color-danger-600); }
.ta-badge-info    { background: var(--color-info-50);    color: var(--color-info-600); }
.ta-badge-neutral { background: #f1f5f9; color: var(--color-text-secondary); }

.ta-badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ---------- Form Inputs ---------- */
.ta-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  appearance: none;
}

.ta-input::placeholder { color: var(--color-text-muted); }
.ta-input:hover { border-color: var(--color-primary-300); }
.ta-input:focus {
  outline: none;
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.ta-input-error { border-color: var(--color-danger-500); }
.ta-input-error:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12); }

.ta-label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.ta-input-help {
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.ta-input-error-msg {
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  color: var(--color-danger-500);
}

/* ---------- Checkbox ---------- */
.ta-checkbox {
  width: 1rem;
  height: 1rem;
  accent-color: var(--color-primary-600);
  cursor: pointer;
  flex-shrink: 0;
}

.ta-checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* ---------- Select ---------- */
.ta-select {
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='%2364748b'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.25rem;
}

/* ---------- Tables ---------- */
.ta-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.ta-table thead th {
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-alt);
  white-space: nowrap;
}

.ta-table tbody td {
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: middle;
}

.ta-table tbody tr {
  transition: background var(--transition-fast);
}

.ta-table tbody tr:hover {
  background: var(--color-surface-alt);
}

.ta-table tbody tr:last-child td {
  border-bottom: none;
}

/* ---------- Progress Bar ---------- */
.ta-progress {
  width: 100%;
  height: 8px;
  background: var(--color-border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.ta-progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--color-primary-500), var(--color-accent-400));
  transition: width 0.6s cubic-bezier(.4,0,.2,1);
  position: relative;
}

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

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

/* ---------- Pagination ---------- */
.ta-pagination {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.ta-page-btn {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.ta-page-btn:hover { border-color: var(--color-primary-300); color: var(--color-primary-600); }
.ta-page-btn.active { background: var(--color-primary-600); color: #fff; border-color: var(--color-primary-600); }
.ta-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- Toast / Notifications ---------- */
.ta-toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 420px;
  width: 100%;
  pointer-events: none;
}

.ta-toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-xl);
  animation: toast-in 0.4s cubic-bezier(.21,1.02,.73,1);
  pointer-events: auto;
}

.ta-toast.toast-success { border-left: 4px solid var(--color-success-500); }
.ta-toast.toast-error   { border-left: 4px solid var(--color-danger-500); }
.ta-toast.toast-warning { border-left: 4px solid var(--color-warning-500); }
.ta-toast.toast-info    { border-left: 4px solid var(--color-info-500); }

.ta-toast-leaving {
  animation: toast-out 0.3s ease-in forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(100%); }
}

/* ---------- Dropdown ---------- */
.ta-dropdown {
  position: absolute;
  z-index: var(--z-dropdown);
  min-width: 200px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.375rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all var(--transition-fast);
}

.ta-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.ta-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--color-text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
  text-decoration: none;
}

.ta-dropdown-item:hover { background: var(--color-surface-alt); }
.ta-dropdown-item.danger { color: var(--color-danger-500); }
.ta-dropdown-item.danger:hover { background: var(--color-danger-50); }

.ta-dropdown-divider {
  height: 1px;
  background: var(--color-border-light);
  margin: 0.375rem 0;
}

/* ---------- Modal ---------- */
.ta-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal-backdrop);
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.ta-modal-backdrop.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.whatsapp-required-backdrop { z-index: 9000; }
.whatsapp-required-modal { max-width: 440px; }

.ta-modal {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-base);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ta-modal-backdrop.show .ta-modal {
  transform: scale(1) translateY(0);
}

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

.ta-modal-title { font-size: 1.125rem; font-weight: 600; }

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

.ta-modal-body { padding: 1.5rem; overflow-y: auto; flex: 1; }
.ta-modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--color-border-light);
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* ---------- Sidebar Layout ---------- */
.ta-layout {
  display: flex;
  min-height: 100vh;
}

.ta-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  z-index: var(--z-fixed);
  transition: width var(--transition-slow), transform var(--transition-slow);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.ta-sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.ta-sidebar-logo {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.ta-sidebar-logo-icon {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,.1);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.ta-sidebar-logo-text {
  font-size: 1.125rem;
  font-weight: 700;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition-base);
}

.ta-sidebar.collapsed .ta-sidebar-logo-text { opacity: 0; width: 0; }

.ta-sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
}

.ta-sidebar-section-title {
  padding: 0.5rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 700;
  color: rgba(255,255,255,.4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 1rem;
  white-space: nowrap;
  overflow: hidden;
}

.ta-sidebar.collapsed .ta-sidebar-section-title { opacity: 0; height: 0; margin: 0; padding: 0; }

.ta-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  margin-bottom: 0.125rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255,255,255,.7);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
}

.ta-nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.ta-nav-link.active { color: #fff; background: rgba(255,255,255,.12); box-shadow: inset 3px 0 0 var(--color-accent-400); }
.ta-nav-link i, .ta-nav-link svg { width: 20px; text-align: center; flex-shrink: 0; font-size: 1rem; }

.ta-sidebar.collapsed .ta-nav-link span { opacity: 0; width: 0; }
.ta-sidebar.collapsed .ta-nav-link { justify-content: center; padding: 0.75rem; }

/* Sidebar footer */
.ta-sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.ta-sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  background: rgba(0,0,0,.15);
}

.ta-sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  flex-shrink: 0;
}

/* ---------- Main Content Area ---------- */
.ta-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-slow);
  min-height: 100vh;
  background: var(--color-surface-alt);
}

.ta-sidebar.collapsed ~ .ta-main,
.sidebar-collapsed .ta-main {
  margin-left: var(--sidebar-collapsed-width);
}

.ta-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  height: var(--header-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
}

.ta-content {
  padding: 1.5rem;
}

/* ---------- Breadcrumbs ---------- */
.ta-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.ta-breadcrumbs a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.ta-breadcrumbs a:hover { color: var(--color-primary-600); }
.ta-breadcrumbs .separator { color: var(--color-text-muted); }
.ta-breadcrumbs .current { color: var(--color-text); font-weight: 500; }

/* ---------- Avatar ---------- */
.ta-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  background: var(--color-primary-100);
  color: var(--color-primary-700);
  flex-shrink: 0;
}

.ta-avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.ta-avatar-lg { width: 56px; height: 56px; font-size: 1.25rem; }
.ta-avatar-xl { width: 80px; height: 80px; font-size: 1.75rem; }

.ta-avatar-premium {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #78350f;
}

/* ---------- File Upload Zone ---------- */
.ta-upload-zone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: 3rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  background: var(--color-surface-alt);
}

.ta-upload-zone:hover {
  border-color: var(--color-primary-400);
  background: var(--color-primary-50);
}

.ta-upload-zone.dragover {
  border-color: var(--color-primary-500);
  background: var(--color-primary-50);
  box-shadow: var(--shadow-glow);
  transform: scale(1.01);
}

.ta-upload-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-100);
  color: var(--color-primary-600);
  font-size: 1.5rem;
  transition: transform var(--transition-base);
}

.ta-upload-zone:hover .ta-upload-icon { transform: translateY(-4px); }

/* ---------- Tab Component ---------- */
.ta-tabs {
  display: flex;
  border-bottom: 2px solid var(--color-border-light);
  gap: 0;
}

.ta-tab {
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  text-decoration: none;
}

.ta-tab:hover { color: var(--color-primary-600); }
.ta-tab.active {
  color: var(--color-primary-600);
  border-bottom-color: var(--color-primary-600);
  font-weight: 600;
}

.ta-tab-panel { display: none; }
.ta-tab-panel.active { display: block; }

/* ---------- Empty State ---------- */
.ta-empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.ta-empty-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  font-size: 2rem;
}

.ta-empty-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.ta-empty-text {
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Skeleton Loading ---------- */
.ta-skeleton {
  background: linear-gradient(90deg, var(--color-border-light) 25%, var(--color-surface-alt) 50%, var(--color-border-light) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- Pulse animation for processing ---------- */
.ta-pulse {
  animation: pulse 2s cubic-bezier(.4,0,.6,1) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ---------- Spin animation ---------- */
.ta-spin {
  animation: spin 1s linear infinite;
}

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

/* ---------- Fade In animation ---------- */
.ta-fade-in {
  animation: fadeIn 0.3s ease-out;
}

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

/* ---------- Slide Up animation ---------- */
.ta-slide-up {
  animation: slideUp 0.4s cubic-bezier(.21,1.02,.73,1);
}

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

/* ---------- Job Status Colors ---------- */
.status-pending    { --status-color: var(--color-info-500);    --status-bg: var(--color-info-50); }
.status-processing { --status-color: var(--color-warning-500); --status-bg: var(--color-warning-50); }
.status-completed  { --status-color: var(--color-success-500); --status-bg: var(--color-success-50); }
.status-failed     { --status-color: var(--color-danger-500);  --status-bg: var(--color-danger-50); }

/* ---------- Responsive: Mobile ---------- */
@media (max-width: 1024px) {
  .ta-sidebar {
    transform: translateX(-100%);
  }
  .ta-sidebar.mobile-open {
    transform: translateX(0);
  }
  .ta-main {
    margin-left: 0 !important;
  }
  .ta-content { padding: 1rem; }
}

@media (max-width: 640px) {
  .ta-stat-value { font-size: 1.5rem; }
  .ta-modal { max-width: calc(100vw - 2rem); margin: 0 1rem; }
  .ta-toast-container { max-width: calc(100vw - 2rem); left: 1rem; right: 1rem; }
  .whatsapp-required-backdrop {
    align-items: flex-start;
    padding: max(0.75rem, env(safe-area-inset-top)) 0 max(1rem, env(safe-area-inset-bottom));
    overflow-y: auto;
  }
  .whatsapp-required-modal {
    max-width: calc(100vw - 1.5rem);
    margin: 0.5rem 0.75rem 1rem;
    max-height: none;
  }
}

/* ---------- Public Navbar ---------- */
.ta-public-nav {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.ta-public-nav.scrolled {
  box-shadow: var(--shadow-sm);
}

/* ---------- Footer ---------- */
.ta-footer {
  background: #0f172a;
  color: rgba(255,255,255,.7);
}

.ta-footer a { color: rgba(255,255,255,.6); transition: color var(--transition-fast); }
.ta-footer a:hover { color: #fff; }

/* ---------- Print ---------- */
@media print {
  .ta-sidebar, .ta-header, .ta-toast-container { display: none !important; }
  .ta-main { margin-left: 0 !important; }
  .ta-card { box-shadow: none; border: 1px solid #ddd; }
}

/* =============================================================
   DARK MODE
   Toggle via [data-theme="dark"] on <html>
   Smooth 300ms transition on all theme properties
   ============================================================= */

html {
  transition: background-color 0.3s ease, color 0.3s ease;
}

[data-theme="dark"] {
  /* Surface */
  --color-surface: #1e1e2e;
  --color-surface-alt: #181825;
  --color-border: #313244;
  --color-border-light: #2a2a3c;

  /* Text */
  --color-text: #cdd6f4;
  --color-text-secondary: #a6adc8;
  --color-text-muted: #6c7086;

  /* Shadows (subtler in dark mode) */
  --shadow-sm: 0 1px 3px 0 rgba(0,0,0,.25);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.3), 0 2px 4px -2px rgba(0,0,0,.2);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.35), 0 4px 6px -4px rgba(0,0,0,.2);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.4), 0 8px 10px -6px rgba(0,0,0,.25);
  --shadow-glow: 0 0 20px rgba(139, 92, 246, .25);

  /* Sidebar (already dark — keep consistent) */
  --sidebar-bg: linear-gradient(180deg, #11111b 0%, #1e1b4b 50%, #1e1e2e 100%);

  /* Semantic backgrounds (badges, alerts) */
  --color-primary-50: rgba(124, 58, 237, 0.14);
  --color-primary-100: rgba(124, 58, 237, 0.22);
  --color-success-50: rgba(34, 197, 94, 0.12);
  --color-warning-50: rgba(245, 158, 11, 0.12);
  --color-danger-50: rgba(239, 68, 68, 0.12);
  --color-info-50: rgba(59, 130, 246, 0.12);

  --color-landing-bg-from: #181825;
  --color-landing-bg-to: #1e1e2e;

  color-scheme: dark;
}

[data-theme="dark"] body {
  background-color: #11111b;
  color: var(--color-text);
}

/* Card */
[data-theme="dark"] .ta-card {
  background: var(--color-surface);
  border-color: var(--color-border);
}

/* Inputs */
[data-theme="dark"] .ta-input,
[data-theme="dark"] .ta-select,
[data-theme="dark"] .ta-textarea {
  background: var(--color-surface-alt);
  border-color: var(--color-border);
  color: var(--color-text);
}
[data-theme="dark"] .ta-input:focus,
[data-theme="dark"] .ta-select:focus,
[data-theme="dark"] .ta-textarea:focus {
  border-color: var(--color-primary-500);
}
[data-theme="dark"] .ta-input::placeholder { color: var(--color-text-muted); }

/* Buttons */
[data-theme="dark"] .ta-btn-secondary {
  background: var(--color-surface-alt);
  border-color: var(--color-border);
  color: var(--color-text);
}
[data-theme="dark"] .ta-btn-secondary:hover {
  background: #313244;
}
[data-theme="dark"] .ta-btn-ghost {
  color: var(--color-text-secondary);
}
[data-theme="dark"] .ta-btn-ghost:hover {
  background: rgba(255,255,255,.06);
  color: var(--color-text);
}

/* Navbar */
[data-theme="dark"] .ta-public-nav {
  background: rgba(30,30,46,.88);
  border-bottom-color: var(--color-border);
}
[data-theme="dark"] .ta-public-nav .ta-nav-public-link {
  color: var(--color-text-secondary);
}
[data-theme="dark"] .ta-public-nav .ta-nav-public-link:hover {
  color: var(--color-primary-400);
  background: rgba(139,92,246,.1);
}

/* Dropdown */
[data-theme="dark"] .ta-dropdown {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
[data-theme="dark"] .ta-dropdown-item:hover {
  background: rgba(255,255,255,.06);
}
[data-theme="dark"] .ta-dropdown-divider {
  background: var(--color-border);
}

/* Modal */
[data-theme="dark"] .ta-modal-backdrop {
  background: rgba(0,0,0,.7);
}
[data-theme="dark"] .ta-modal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}
[data-theme="dark"] .ta-modal-header {
  border-bottom-color: var(--color-border);
}
[data-theme="dark"] .ta-modal-footer {
  border-top-color: var(--color-border);
  background: var(--color-surface-alt);
}

/* Toast */
[data-theme="dark"] .ta-toast {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}

/* Table */
[data-theme="dark"] .ta-table th {
  background: var(--color-surface-alt);
  border-color: var(--color-border);
  color: var(--color-text-secondary);
}
[data-theme="dark"] .ta-table td {
  border-color: var(--color-border);
}
[data-theme="dark"] .ta-table tr:hover td {
  background: rgba(255,255,255,.03);
}

/* Badge */
[data-theme="dark"] .ta-badge-muted {
  background: #313244;
  color: var(--color-text-secondary);
}

/* Stat card */
[data-theme="dark"] .ta-stat-card {
  background: var(--color-surface);
  border-color: var(--color-border);
}

/* Mobile menu */
[data-theme="dark"] #nav-mobile-menu {
  background: var(--color-surface) !important;
  border-top-color: var(--color-border) !important;
}
[data-theme="dark"] .ta-nav-mobile-link {
  color: var(--color-text);
}

/* Header (admin) */
[data-theme="dark"] .ta-header {
  background: rgba(30,30,46,.9);
  border-bottom-color: var(--color-border);
}

/* Footer — already dark, minor adjustments */
[data-theme="dark"] .ta-footer {
  background: #11111b;
}

/* Scrollbar dark */
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #45475a;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: #585b70;
}

/* =============================================================
   DARK MODE TOGGLE BUTTON
   ============================================================= */

.ta-theme-toggle {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  font-size: 1rem;
}
.ta-theme-toggle:hover {
  background: var(--color-primary-50);
  color: var(--color-primary-600);
}
[data-theme="dark"] .ta-theme-toggle:hover {
  background: rgba(139,92,246,.15);
  color: var(--color-primary-400);
}
.ta-theme-toggle .icon-sun,
.ta-theme-toggle .icon-moon { position: absolute; transition: all 0.3s ease; }
.ta-theme-toggle .icon-sun { opacity: 1; transform: rotate(0deg); }
.ta-theme-toggle .icon-moon { opacity: 0; transform: rotate(-90deg); }
[data-theme="dark"] .ta-theme-toggle .icon-sun { opacity: 0; transform: rotate(90deg); }
[data-theme="dark"] .ta-theme-toggle .icon-moon { opacity: 1; transform: rotate(0deg); }

/* =============================================================
   NOTIFICATION BELL
   ============================================================= */

.ta-notif-bell {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  font-size: 1rem;
}
.ta-notif-bell:hover {
  background: var(--color-primary-50);
  color: var(--color-primary-600);
}
[data-theme="dark"] .ta-notif-bell:hover {
  background: rgba(139,92,246,.15);
  color: var(--color-primary-400);
}

.ta-notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  background: var(--color-danger-500);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  animation: ta-notif-pulse 2s infinite;
}
.ta-notif-badge:empty,
.ta-notif-badge[data-count="0"] { display: none; }

@keyframes ta-notif-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* Notification dropdown */
.ta-notif-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 360px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-dropdown);
  display: none;
}
.ta-notif-dropdown.show { display: block; }

.ta-notif-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  font-weight: 600;
}

.ta-notif-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border-light);
  transition: background var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.ta-notif-item:hover {
  background: var(--color-surface-alt);
}
.ta-notif-item.unread {
  background: rgba(139,92,246,.04);
}
[data-theme="dark"] .ta-notif-item.unread {
  background: rgba(139,92,246,.08);
}
.ta-notif-item:last-child {
  border-bottom: none;
}
.ta-notif-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.75rem;
}
.ta-notif-icon.success { background: var(--color-success-50); color: var(--color-success-600); }
.ta-notif-icon.error { background: var(--color-danger-50); color: var(--color-danger-600); }
.ta-notif-icon.warning { background: var(--color-warning-50); color: var(--color-warning-600); }
.ta-notif-icon.info { background: var(--color-info-50); color: var(--color-info-600); }
[data-theme="dark"] .ta-notif-icon.success { background: rgba(34,197,94,.15); }
[data-theme="dark"] .ta-notif-icon.error { background: rgba(239,68,68,.15); }
[data-theme="dark"] .ta-notif-icon.warning { background: rgba(245,158,11,.15); }
[data-theme="dark"] .ta-notif-icon.info { background: rgba(59,130,246,.15); }

.ta-notif-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

@media (max-width: 480px) {
  .ta-notif-dropdown { width: calc(100vw - 2rem); right: -1rem; }
}

/* =============================================================
   DARK MODE — utilitários Tailwind CDN (páginas legadas)
   Corrige bg-white, text-gray-*, etc. após migração TailAdmin
   ============================================================= */

[data-theme="dark"] .bg-white { background-color: var(--color-surface) !important; }
[data-theme="dark"] .bg-gray-50,
[data-theme="dark"] .bg-gray-100 { background-color: var(--color-surface-alt) !important; }
[data-theme="dark"] .bg-gray-200 { background-color: var(--color-border) !important; }
[data-theme="dark"] .bg-gray-300 { background-color: var(--color-border) !important; }

[data-theme="dark"] .hover\:bg-gray-50:hover,
[data-theme="dark"] .hover\:bg-gray-100:hover { background-color: var(--color-surface-alt) !important; }
[data-theme="dark"] .hover\:bg-gray-300:hover { background-color: var(--color-border-light) !important; }

[data-theme="dark"] .text-gray-900,
[data-theme="dark"] .text-gray-800 { color: var(--color-text) !important; }
[data-theme="dark"] .text-gray-700,
[data-theme="dark"] .text-gray-600 { color: var(--color-text-secondary) !important; }
[data-theme="dark"] .text-gray-500,
[data-theme="dark"] .text-gray-400 { color: var(--color-text-muted) !important; }

[data-theme="dark"] .border-gray-200,
[data-theme="dark"] .border-gray-300 { border-color: var(--color-border) !important; }

[data-theme="dark"] .bg-purple-50,
[data-theme="dark"] .bg-purple-100 { background-color: var(--color-primary-50) !important; }

[data-theme="dark"] .bg-blue-50 { background-color: var(--color-info-50) !important; }
[data-theme="dark"] .border-blue-200 { border-color: rgba(59, 130, 246, 0.35) !important; }
[data-theme="dark"] .text-blue-900 { color: #93c5fd !important; }
[data-theme="dark"] .text-blue-700 { color: #bfdbfe !important; }

[data-theme="dark"] .bg-yellow-50 { background-color: var(--color-warning-50) !important; }
[data-theme="dark"] .border-yellow-200 { border-color: rgba(245, 158, 11, 0.35) !important; }
[data-theme="dark"] .text-yellow-900 { color: #fcd34d !important; }
[data-theme="dark"] .text-yellow-700,
[data-theme="dark"] .text-yellow-600 { color: #fde68a !important; }

[data-theme="dark"] .bg-red-50 { background-color: var(--color-danger-50) !important; }
[data-theme="dark"] .border-red-200 { border-color: rgba(239, 68, 68, 0.35) !important; }
[data-theme="dark"] .text-red-800 { color: #fca5a5 !important; }

[data-theme="dark"] .bg-green-50 { background-color: var(--color-success-50) !important; }
[data-theme="dark"] .border-green-200 { border-color: rgba(34, 197, 94, 0.35) !important; }
[data-theme="dark"] .text-green-800,
[data-theme="dark"] .text-green-600 { color: #86efac !important; }

[data-theme="dark"] .bg-gradient-to-br.from-purple-50.to-blue-50,
[data-theme="dark"] .min-h-screen.bg-gradient-to-br.from-purple-50.to-blue-50 {
  background: linear-gradient(135deg, var(--color-landing-bg-from) 0%, var(--color-landing-bg-to) 100%) !important;
}

[data-theme="dark"] input.border-gray-300,
[data-theme="dark"] input.border-2,
[data-theme="dark"] textarea.border-gray-300 {
  background-color: var(--color-surface) !important;
  color: var(--color-text) !important;
  border-color: var(--color-border) !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: var(--color-text-muted);
  opacity: 1;
}

[data-theme="dark"] .group:hover .group-hover\:text-purple-600 {
  color: var(--color-primary-400) !important;
}

[data-theme="dark"] .hover\:text-gray-600:hover {
  color: var(--color-text-secondary) !important;
}

/* =============================================================
   LANDING PAGES SEO (download / transcrever ferramentas)
   Usa tokens TailAdmin — compatível dark/light
   ============================================================= */

.ta-landing-page {
  min-height: calc(100vh - 64px);
  background: linear-gradient(135deg, var(--color-landing-bg-from) 0%, var(--color-landing-bg-to) 100%);
  padding: 2.5rem 0;
}

.ta-landing-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.ta-landing-hero { text-align: center; margin-bottom: 3rem; }

.ta-landing-h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 1rem;
  line-height: 1.15;
}

.ta-landing-subtitle {
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
}

.ta-landing-desc {
  font-size: 1.0625rem;
  color: var(--color-text-muted);
  max-width: 48rem;
  margin: 0 auto;
  line-height: 1.6;
}

.ta-landing-card,
.ta-landing-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.ta-landing-card { padding: clamp(1.5rem, 4vw, 3rem); margin-bottom: 3rem; }
.ta-landing-card--narrow { max-width: 48rem; margin-left: auto; margin-right: auto; }
.ta-landing-panel { padding: 2rem; text-align: center; }

.ta-landing-grid-3 {
  display: grid;
  gap: 2rem;
  margin-bottom: 3rem;
  max-width: 64rem;
  margin-left: auto;
  margin-right: auto;
}
@media (min-width: 768px) {
  .ta-landing-grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.ta-landing-stack { display: flex; flex-direction: column; gap: 2rem; max-width: 56rem; margin: 0 auto 3rem; }

.ta-landing-h2 {
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  font-weight: 700;
  text-align: center;
  color: var(--color-text);
  margin-bottom: 2rem;
}

.ta-landing-h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.ta-landing-body {
  color: var(--color-text-secondary);
  line-height: 1.7;
}
.ta-landing-body strong { color: var(--color-text); }
.ta-landing-body p + p { margin-top: 0.75rem; }

.ta-landing-label {
  display: block;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 1rem;
}

.ta-landing-field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
@media (min-width: 768px) {
  .ta-landing-field-row { flex-wrap: nowrap; }
}

.ta-landing-input {
  flex: 1;
  min-width: 220px;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.ta-landing-input:focus {
  outline: none;
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}
.ta-landing-input::placeholder { color: var(--color-text-muted); }

.ta-landing-hint {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.ta-landing-preview {
  display: none;
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: var(--color-surface-alt);
  border-radius: var(--radius-md);
  text-align: center;
  border: 1px solid var(--color-border-light);
}

.ta-landing-preview-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text);
}

.ta-landing-preview-meta {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

.ta-landing-note {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: 1rem;
  text-align: center;
}

.ta-landing-note--sm { font-size: 0.75rem; }

.ta-landing-link {
  color: var(--color-primary-500);
  font-weight: 600;
  text-decoration: none;
}
.ta-landing-link:hover { color: var(--color-primary-400); text-decoration: underline; }

.ta-landing-body a,
.ta-landing-faq-a a {
  color: var(--color-primary-500);
  font-weight: 600;
  text-decoration: none;
}
.ta-landing-body a:hover,
.ta-landing-faq-a a:hover {
  color: var(--color-primary-400);
  text-decoration: underline;
}

.ta-landing-step-num {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: var(--color-primary-50);
  color: var(--color-primary-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 auto 1rem;
}

.ta-landing-faq-item + .ta-landing-faq-item { margin-top: 1.5rem; }

.ta-landing-faq-q {
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.ta-landing-faq-a {
  color: var(--color-text-secondary);
  line-height: 1.7;
}

.ta-landing-icon-lg {
  font-size: 2.5rem;
  color: var(--color-primary-500);
  margin-bottom: 1rem;
}

.ta-landing-cta-wrap {
  max-width: 48rem;
  margin: 0 auto;
  text-align: center;
  padding-bottom: 2rem;
}

.ta-landing-btn-block {
  width: 100%;
  justify-content: center;
}

/* Pastas — lista de transcrições */
.folder-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.625rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.folder-link:hover { background: var(--color-surface-alt); color: var(--color-text); }
.folder-link.is-active {
  background: var(--color-primary-50);
  color: var(--color-primary-700);
  font-weight: 600;
}
.folder-row {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  min-width: 0;
}
.folder-row .folder-link {
  flex: 1;
  min-width: 0;
}
.folder-row-actions {
  display: flex;
  gap: 0.125rem;
  opacity: 0;
  transition: opacity var(--transition-fast);
  flex-shrink: 0;
}
.folder-row:hover .folder-row-actions,
.folder-row:focus-within .folder-row-actions {
  opacity: 1;
}
.folder-action-btn {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 0.6875rem;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.folder-action-btn:hover {
  background: var(--color-surface-alt);
  color: var(--color-text);
}
.folder-action-btn.btn-delete-folder:hover {
  color: var(--color-danger-500);
}
[data-theme="dark"] .folder-link.is-active {
  color: var(--color-primary-400);
}

@media (max-width: 768px) {
  .jobs-layout-grid { grid-template-columns: 1fr !important; }
  .jobs-sidebar { position: static !important; }
}

/* Upload — seletor de pasta + criar inline */
.upload-folder-toolbar {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.upload-folder-toolbar .ta-select {
  flex: 1;
  min-width: 0;
}
.upload-folder-new-btn {
  flex-shrink: 0;
  white-space: nowrap;
  gap: 0.375rem;
}
.upload-howto-hints {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
}
.upload-howto-hints p {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.45;
  margin: 0;
}
.upload-howto-desktop { display: block; }
.upload-howto-mobile { display: none; }
@media (max-width: 768px) {
  .upload-howto-desktop { display: none; }
  .upload-howto-mobile { display: block; }
}
@media (max-width: 480px) {
  .upload-folder-new-btn span { display: none; }
  .upload-folder-new-btn { padding-left: 0.75rem; padding-right: 0.75rem; }
}

/* ── Dashboard / Início — hub de transcrições ── */
.dashboard-page {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.dashboard-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.dashboard-welcome {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-top: 0.25rem;
}
.dash-referral-btn {
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #fff;
  border: none;
  font-weight: 600;
}

/* Guia 3 passos */
.dash-guide {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--color-primary-50) 0%, var(--color-surface) 55%);
  border: 1px solid var(--color-primary-100);
}
.dash-guide-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.dash-guide-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.dash-guide-subtitle {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-top: 0.25rem;
  max-width: 36rem;
  line-height: 1.5;
}
.dash-guide-cta { flex-shrink: 0; }
.dash-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.dash-step {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.875rem;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  font-size: 0.8125rem;
  line-height: 1.45;
}
.dash-step-num {
  width: 1.625rem;
  height: 1.625rem;
  border-radius: var(--radius-full);
  background: var(--color-primary-500);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dash-step strong { display: block; color: var(--color-text); margin-bottom: 0.2rem; }
.dash-step-hint { color: var(--color-text-muted); font-size: 0.75rem; display: block; }
.dash-step-hint-mobile { display: none; }
.dash-step-hint-desktop { display: block; }

/* Ações rápidas upload */
.dash-upload-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.dash-action-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  text-decoration: none;
  border: 1px solid var(--color-border-light);
  background: var(--color-surface);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}
.dash-action-card:hover {
  border-color: var(--color-primary-300);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.dash-action-card.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}
.dash-action-upload .dash-action-icon {
  background: var(--color-primary-50);
  color: var(--color-primary-600);
}
.dash-action-youtube .dash-action-icon {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}
.dash-action-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.dash-action-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--color-text);
}
.dash-action-desc {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.125rem;
}
.dash-action-arrow {
  margin-left: auto;
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

/* Grid principal */
.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(200px, 240px) 1fr;
  gap: 1.25rem;
  align-items: start;
}
.dash-folders-sidebar { padding: 1rem; position: sticky; top: 80px; }
.dash-folders-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.dash-folders-head h2 {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
}
.dash-folders-help {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.45;
  margin-bottom: 0.75rem;
}
.dash-folders-help a { color: var(--color-primary-600); font-weight: 600; }
.dash-folders-nav { display: flex; flex-direction: column; gap: 0.25rem; }
.folder-count-badge { font-size: 0.6875rem; opacity: 0.7; flex-shrink: 0; }
.dash-folders-empty {
  text-align: center;
  padding: 1rem 0.5rem;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}
.dash-folders-empty i { font-size: 1.5rem; color: var(--color-primary-400); margin-bottom: 0.5rem; display: block; }
.dash-formats-hint {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border-light);
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

/* Lista de transcrições no dashboard */
.dash-transcriptions-header {
  flex-wrap: wrap;
  gap: 0.75rem;
}
.dash-transcriptions-sub {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-top: 0.25rem;
}
.dash-transcriptions-sub a { color: var(--color-primary-600); font-weight: 600; }
.dash-transcriptions-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.dash-job-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border-light);
  flex-wrap: wrap;
}
.dash-job-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dash-job-icon.status-pending { background: var(--color-info-50); color: var(--color-info-500); }
.dash-job-icon.status-processing { background: var(--color-warning-50); color: var(--color-warning-500); }
.dash-job-icon.status-completed { background: var(--color-success-50); color: var(--color-success-500); }
.dash-job-icon.status-failed { background: var(--color-danger-50); color: var(--color-danger-500); }
.dash-job-info { flex: 1; min-width: 0; }
.dash-job-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 0.375rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-job-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}
.dash-job-status-text { font-size: 0.75rem; color: var(--color-text-muted); }
.dash-folder-badge { font-size: 0.6875rem; }
.dash-job-progress { width: 80px; flex-shrink: 0; }
.dash-job-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.dash-job-date { font-size: 0.75rem; color: var(--color-text-muted); white-space: nowrap; }
.dash-jobs-footer {
  padding: 1rem 1.25rem;
  text-align: center;
  border-top: 1px solid var(--color-border-light);
  background: var(--color-surface-alt);
}
.dash-empty-wrap { padding: 0.5rem 0; }
.dash-empty-alt {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  padding-bottom: 1.5rem;
}
.dash-empty-alt a { color: var(--color-primary-600); font-weight: 600; }

/* Stats + conta */
.dash-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}
.dash-account-details { overflow: hidden; }
.dash-account-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  list-style: none;
  user-select: none;
}
.dash-account-summary::-webkit-details-marker { display: none; }
.dash-account-summary span { display: flex; align-items: center; gap: 0.5rem; }
.dash-account-chevron { transition: transform var(--transition-fast); font-size: 0.75rem; }
.dash-account-details[open] .dash-account-chevron { transform: rotate(180deg); }
.dash-account-body { padding: 0 1.25rem 1.25rem; border-top: 1px solid var(--color-border-light); }
.dash-limits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}
.dash-limit-item {
  text-align: center;
  padding: 1rem;
  border-radius: var(--radius-md);
}
.dash-limit-item i { font-size: 1.25rem; margin-bottom: 0.375rem; display: block; }
.dash-limit-item p { font-size: 0.75rem; color: var(--color-text-secondary); }
.dash-limit-item strong { font-size: 1.125rem; color: var(--color-text); }
.dash-limit-info { background: var(--color-info-50); }
.dash-limit-info i { color: var(--color-info-500); }
.dash-limit-success { background: var(--color-success-50); }
.dash-limit-success i { color: var(--color-success-500); }
.dash-limit-danger { background: var(--color-danger-50); }
.dash-limit-danger i { color: var(--color-danger-500); }
.dash-upgrade-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border: none;
  font-size: 0.75rem;
}

@media (max-width: 900px) {
  .dash-steps { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .dashboard-main-grid { grid-template-columns: 1fr !important; }
  .dash-folders-sidebar { position: static !important; }
  .dash-upload-actions { grid-template-columns: 1fr; }
  .dash-step-hint-mobile { display: block; }
  .dash-step-hint-desktop { display: none; }
  .dash-guide-cta { width: 100%; justify-content: center; }
  .dash-transcriptions-actions { width: 100%; }
  .dash-transcriptions-actions .ta-btn { flex: 1; justify-content: center; }
  .dash-job-row { padding: 0.875rem 1rem; }
  .dash-job-title { white-space: normal; }
}
@media (max-width: 480px) {
  .dash-btn-label { display: none; }
  .dash-guide { padding: 1rem; }
}

