/* === PRO UI FIX — LINEAR / MACOS PRO (ZERO AI SLOP) === */

/* 1. Abas da Sidebar: 3 colunas equilibradas (Ajustar, Mídia, Configurar) */
.sidebar-tabs,
.left-panel-tabs {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  align-items: center !important;
  gap: 2px !important;
  padding: 3px !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.sidebar-tabs button,
.left-panel-tabs button {
  width: 100% !important;
  min-width: 0 !important;
  height: 28px !important;
  padding: 0 7px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 7px !important;
  font-size: 11.5px !important;
  font-weight: 500 !important;
  color: #8490A5 !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
}

.sidebar-tabs button.active,
.sidebar-tabs button.is-active,
.left-panel-tabs button.active,
.left-panel-tabs button.is-active {
  background: rgba(255, 255, 255, 0.09) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #ECEFF4 !important;
}

/* 2. Aba Configurar (Meta Pixel, GA4, VSL, Webhook, Scripts) — limpa, sem borda amarela gritante */
.config-card,
.config-field-card,
.panel-config-group {
  background: rgba(255, 255, 255, 0.022) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 11px !important;
  padding: 12px !important;
  margin-bottom: 10px !important;
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.config-card:focus-within,
.config-field-card:focus-within {
  border-color: rgba(255, 255, 255, 0.18) !important;
  background: rgba(255, 255, 255, 0.032) !important;
}

.config-card input,
.config-card textarea,
.config-field-card input,
.config-field-card textarea {
  width: 100% !important;
  box-sizing: border-box !important;
  min-height: 36px !important;
  padding: 8px 11px !important;
  border-radius: 8px !important;
  background: #080A0F !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  color: #ECEFF4 !important;
  font-size: 12.5px !important;
  line-height: 1.4 !important;
  outline: none !important;
}

.config-card input:focus,
.config-card textarea:focus {
  border-color: rgba(255, 94, 26, 0.55) !important;
}

/* Botão Aplicar Configurações no HTML — sólido, com padding real (nunca uma "linha brilhante") */
.btn-apply-config,
#applyConfigBtn,
button[data-action="apply-config"] {
  width: 100% !important;
  height: 38px !important;
  padding: 0 16px !important;
  margin: 14px 0 16px !important;
  border-radius: 9px !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  background: #ECEFF4 !important;
  color: #090C12 !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28) !important;
  cursor: pointer !important;
  transition: transform 150ms cubic-bezier(0.22, 1, 0.36, 1), filter 150ms ease !important;
}
.btn-apply-config:hover,
#applyConfigBtn:hover {
  filter: brightness(0.93) !important;
}
.btn-apply-config:active,
#applyConfigBtn:active {
  transform: scale(0.985) !important;
}

/* 3. Vincular Cliente & Pendências — estilo macOS Toolbar minimalista (sem neon/slop) */
.btn-link-client,
.client-pill,
.btn-pending-status,
.pending-badge {
  height: 28px !important;
  padding: 0 10px !important;
  border-radius: 7px !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  color: #CBD5E1 !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  box-shadow: none !important;
  cursor: pointer !important;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease !important;
}

.btn-link-client:hover,
.client-pill:hover,
.btn-pending-status:hover,
.pending-badge:hover {
  background: rgba(255, 255, 255, 0.07) !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
  color: #F8FAFC !important;
}

/* Ponto de status silencioso de 6px em vez de fundo colorido gritante */
.btn-link-client::before,
.client-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10B981;
  flex-shrink: 0;
}

.btn-pending-status::before,
.pending-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #F59E0B;
  flex-shrink: 0;
}

/* 4. Histórico de Versões com Changelog claro */
.vh-empty {
  padding: 18px 12px;
  font-size: 12px;
  color: #6B768B;
  text-align: center;
}
.vh-item {
  padding: 11px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.022);
  border: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.vh-item.is-current {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.045);
}
.vh-item__top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.vh-badge {
  font-size: 11px;
  font-weight: 600;
  color: #ECEFF4;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: 5px;
}
.vh-time {
  font-size: 11px;
  color: #6B768B;
}
.vh-current-tag {
  margin-left: auto;
  font-size: 10.5px;
  color: #10B981;
  font-weight: 600;
}
.vh-restore-btn {
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: #CBD5E1;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.vh-restore-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.vh-summary {
  font-size: 12.5px;
  font-weight: 500;
  color: #ECEFF4;
  line-height: 1.4;
}
.vh-changes {
  margin: 0;
  padding-left: 16px;
  font-size: 11.5px;
  color: #8490A5;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* === BARRA DE PROGRESSO HAIRLINE GLOBAL (TOPO) === */
.leg-top-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  transition: opacity 180ms ease;
}
.leg-top-progress.is-active {
  opacity: 1;
}
.leg-top-progress__bar {
  width: 36%;
  height: 100%;
  background: linear-gradient(90deg, transparent, #FF7A2F, #FF5E1A, #FFFFFF, transparent);
  animation: legTrackSlide 1.1s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

/* === OVERLAY DE CARREGAMENTO DO CANVAS (VETORIZADOR / PROCESSAMENTO) === */
.leg-stage-loader {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 9, 13, 0.85);
  opacity: 0;
  transition: opacity 200ms cubic-bezier(0.22, 1, 0.36, 1);
}
.leg-stage-loader.is-visible {
  opacity: 1;
}
.leg-stage-loader__box {
  width: min(290px, 86%);
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(14, 18, 27, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.leg-stage-loader__head {
  display: flex;
  align-items: center;
  gap: 9px;
}
.leg-stage-loader__title {
  font-size: 13px;
  font-weight: 600;
  color: #ECEFF4;
}
.leg-stage-loader__timer {
  margin-left: auto;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: #8490A5;
}
.leg-stage-loader__track,
.leg-card-progress__track {
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  position: relative;
}
.leg-stage-loader__fill,
.leg-card-progress__fill {
  position: absolute;
  inset: 0;
  width: 44%;
  border-radius: 999px;
  background: linear-gradient(90deg, #FF9A3C, #FF5E1A);
  animation: legTrackSlide 1.15s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
.leg-stage-loader__sub {
  font-size: 11.5px;
  color: #8490A5;
}

.leg-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-top-color: #FF5E1A;
  animation: legSpin 700ms linear infinite;
  flex-shrink: 0;
}

/* === LOADING INLINE NO CARD DE MÍDIA (RECORTE GPU COM PROGRESSO & ANSIEDADE REDUZIDA) === */
.media-item.is-card-loading {
  position: relative;
  border-color: rgba(255, 94, 26, 0.45) !important;
  box-shadow: 0 0 16px rgba(255, 94, 26, 0.12) !important;
  pointer-events: none;
}
.media-item.is-card-loading .media-item__thumb {
  opacity: 0.35;
  filter: blur(1.5px);
  transition: opacity 180ms ease, filter 180ms ease;
}
.leg-card-progress {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px 0 2px 0;
  width: 100%;
  animation: legFadeIn 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.leg-card-progress__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  line-height: 1.2;
}
.leg-card-progress__label {
  color: #FF9A3C;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 65%;
  letter-spacing: -0.01em;
}
.leg-card-progress__stats {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #8490A5;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  font-size: 10px;
}
.leg-card-progress__pct {
  color: #FFB370;
  font-weight: 600;
}
.leg-card-progress__timer {
  color: #64748B;
}
.leg-card-progress__track {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  position: relative;
}
.leg-card-progress__fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #FF9A3C, #FF5E1A);
  transition: width 100ms cubic-bezier(0.2, 0.8, 0.2, 1), background 200ms ease;
  box-shadow: 0 0 10px rgba(255, 94, 26, 0.45);
}
.leg-card-progress.is-done .leg-card-progress__fill {
  background: #10B981 !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.6) !important;
}
.leg-card-progress.is-done .leg-card-progress__label {
  color: #10B981 !important;
}
.leg-card-progress.is-done .leg-card-progress__pct {
  color: #10B981 !important;
}
.leg-card-progress.is-error .leg-card-progress__fill {
  background: #EF4444 !important;
}
.leg-card-progress.is-error .leg-card-progress__label {
  color: #EF4444 !important;
}

/* === HISTÓRICO COMPACTO (1 LINHA) === */
.vh-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 5px;
  transition: background 140ms ease, border-color 140ms ease;
}
.vh-row:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.12);
}
.vh-row.is-current {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
}
.vh-row__title {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 500;
  color: #ECEFF4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes legTrackSlide {
  0% { transform: translateX(-115%); }
  100% { transform: translateX(270%); }
}
@keyframes legSpin {
  to { transform: rotate(360deg); }
}

/* === Layout da Sidebar Esquerda do Editor (Ajustar | Mídia | Configurar | Vetorizar) === */
.sidebar,
#sidebar,
#view-editor .sidebar {
  box-sizing: border-box !important;
  overflow-x: hidden !important;
  padding: 12px !important;
}

.sidebar *,
#sidebar * {
  box-sizing: border-box;
}

.sidebar .sidebar-tabs,
.sidebar .tabs {
  margin: 0 0 8px 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.sidebar .tab-panel,
#sidebar .tab-panel {
  box-sizing: border-box !important;
  overflow-x: hidden !important;
  padding: 8px 0 !important;
  width: 100% !important;
}

/* === Vector Workbench: Ocultar Original RASTER quando vazio === */
#vecImgOriginal:not([src]),
#vecImgOriginal[src=""],
#vecImgOriginal[src="#"],
.vec-compare-img:not([src]),
.vec-compare-img[src=""],
.vec-compare-img[src="#"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

