/* ecosystem.css - Estilos do Ecossistema Integrado Rennovata Móveis Planejados */

/* ==========================================================
   NAVEGAÇÃO DE MÓDULOS DO ECOSSISTEMA (HEADER SUPERIOR)
   ========================================================== */
.ecosystem-nav-bar {
  background: #0d1527;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.ecosystem-modules-nav {
  display: flex;
  gap: 4px;
}

.eco-nav-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  padding: 13px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.eco-nav-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.03);
}

.eco-nav-btn.active {
  color: #facc15;
  border-bottom-color: var(--primary);
  background: rgba(194, 153, 88, 0.08);
}

.eco-badge {
  background: #334155;
  color: #f8fafc;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 700;
}

.eco-badge.badge-gold {
  background: rgba(194, 153, 88, 0.25);
  color: #facc15;
  border: 1px solid rgba(194, 153, 88, 0.5);
}

.eco-badge.badge-green {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.eco-badge.badge-blue {
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
}

.eco-badge.badge-red {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.ecosystem-global-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================================
   CONTAINER DE MÓDULOS
   ========================================================== */
.workspace-container {
  flex-direction: column !important;
}

.ecosystem-module-view {
  display: none;
  width: 100%;
  animation: fadeInModule 0.25s ease;
}

.ecosystem-module-view.active {
  display: block;
}

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

.module-wrapper {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px;
}

/* Topo do Módulo */
.module-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.module-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.module-header-title h2 {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.5px;
}

.module-header-title p {
  font-size: 13px;
  color: #64748b;
  margin-top: 2px;
}

.module-actions-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ==========================================================
   CARDS DE MÉTRICAS (KPIs DO DASHBOARD)
   ========================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-bottom: 26px;
}

.kpi-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.kpi-gold::before { background: var(--primary); }
.kpi-blue::before { background: #0284c7; }
.kpi-green::before { background: #10b981; }
.kpi-purple::before { background: #8b5cf6; }
.kpi-orange::before { background: #f59e0b; }

.kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.kpi-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
}

.kpi-icon {
  font-size: 20px;
  background: #f1f5f9;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.kpi-value {
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.kpi-footer {
  font-size: 11.5px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.kpi-footer strong {
  color: #10b981;
}

/* ==========================================================
   PAINEL EM DUAS COLUNAS DO DASHBOARD
   ========================================================== */
.dashboard-content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 22px;
}

@media (max-width: 1080px) {
  .dashboard-content-grid {
    grid-template-columns: 1fr;
  }
}

.dashboard-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  padding: 22px;
  margin-bottom: 22px;
}

.dashboard-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.dashboard-card-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Alertas Rápidos no Dashboard */
.alert-item-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.alert-item-box.alert-red {
  background: #fef2f2;
  border-color: #fecaca;
  border-left-color: #ef4444;
}

.alert-item-box.alert-blue {
  background: #f0f9ff;
  border-color: #bae6fd;
  border-left-color: #0284c7;
}

/* ==========================================================
   KANBAN DO CRM / FUNIL DE LEADS
   ========================================================== */
.kanban-board-container {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 20px;
  min-height: 600px;
  align-items: flex-start;
}

.kanban-col {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  width: 320px;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  max-height: 820px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.kanban-col-header {
  padding: 14px 16px;
  border-bottom: 2px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
}

.kanban-col-title {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-col-count {
  font-size: 11px;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
  padding: 2px 7px;
  border-radius: 12px;
}

.kanban-cards-wrapper {
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

/* Card Individual de Lead */
.lead-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.03);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.lead-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.08);
  border-color: #cbd5e1;
}

.lead-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.lead-card-name {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.lead-temp-pill {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.temp-quente {
  background: #fee2e2;
  color: #dc2626;
}

.temp-morno {
  background: #fef3c7;
  color: #d97706;
}

.temp-frio {
  background: #e0f2fe;
  color: #0284c7;
}

.lead-card-ambientes {
  font-size: 12px;
  color: #475569;
  margin-bottom: 8px;
  line-height: 1.4;
}

.lead-card-value {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 10px;
}

.lead-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #94a3b8;
  border-top: 1px dashed #f1f5f9;
  padding-top: 8px;
}

.lead-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  border-top: 1px solid #f8fafc;
  padding-top: 8px;
}

/* ==========================================================
   TABELAS DE DADOS (CLIENTES, PEDIDOS, LOGÍSTICA)
   ========================================================== */
.eco-table-container {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.eco-table-toolbar {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  gap: 16px;
  flex-wrap: wrap;
}

.eco-search-input {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  width: 320px;
  outline: none;
  transition: border-color 0.2s ease;
}

.eco-search-input:focus {
  border-color: var(--primary);
  background: #ffffff;
}

.eco-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.eco-table th {
  background: #f8fafc;
  padding: 12px 18px;
  font-weight: 700;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.eco-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.eco-table tbody tr:hover {
  background: #fafbfc;
}

/* ==========================================================
   PIPELINE INDUSTRIAL DE PEDIDOS
   ========================================================== */
.pedido-card-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.pedido-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.pedido-pipeline-steps {
  display: flex;
  gap: 8px;
  margin: 16px 0;
  overflow-x: auto;
  padding-bottom: 6px;
}

.pipe-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: #f1f5f9;
  color: #64748b;
  white-space: nowrap;
}

.pipe-step.completed {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.pipe-step.active {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-weight: 700;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* ==========================================================
   QUADRO DE MONTADORES E CRONOGRAMA
   ========================================================== */
.montadores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.montador-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.montador-name-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.montador-tipo {
  font-size: 11.5px;
  color: #64748b;
}

.cronograma-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.progress-bar-container {
  background: #f1f5f9;
  border-radius: 10px;
  height: 8px;
  overflow: hidden;
  margin: 10px 0;
}

.progress-bar-fill {
  background: linear-gradient(90deg, #c29958 0%, #10b981 100%);
  height: 100%;
  border-radius: 10px;
  transition: width 0.4s ease;
}

/* Checklist de Vistoria */
.checklist-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12.5px;
}

/* Modais do Ecossistema */
.eco-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 17, 32, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.eco-modal-overlay.active {
  display: flex;
}

.eco-modal-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
  overflow: hidden;
  animation: modalScaleUp 0.2s ease;
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.eco-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
}

.eco-modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
}

.eco-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.eco-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #f8fafc;
}

/* Botão WhatsApp Direto */
.btn-whatsapp {
  background: #25d366;
  color: #ffffff;
  border: none;
  font-size: 11.5px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-whatsapp:hover {
  background: #1eb956;
  color: #ffffff;
}

/* ==========================================================
   MELHORIAS DE CORES, CONTRASTE E BOTÕES DO ECOSSISTEMA
   ========================================================== */

/* Correção geral de contraste para botões outline em superfícies claras */
.module-wrapper .btn-outline,
.eco-modal-card .btn-outline,
.eco-table-toolbar .btn-outline,
.pedido-card-item .btn-outline,
.dashboard-card .btn-outline {
  background: #ffffff;
  color: #1e293b;
  border: 1.5px solid #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  font-weight: 600;
}

.module-wrapper .btn-outline:hover,
.eco-modal-card .btn-outline:hover,
.eco-table-toolbar .btn-outline:hover,
.pedido-card-item .btn-outline:hover,
.dashboard-card .btn-outline:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

/* Botões do Topo: Novo Lead, Novo Cliente, Novo Pedido */
.btn-novo-lead {
  background: linear-gradient(135deg, #c29958 0%, #b08745 100%) !important;
  color: #0b1120 !important;
  font-weight: 700 !important;
  border: 1px solid #b08745 !important;
  box-shadow: 0 2px 8px rgba(194, 153, 88, 0.35) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}
.btn-novo-lead:hover {
  background: linear-gradient(135deg, #d4af37 0%, #c29958 100%) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(194, 153, 88, 0.5) !important;
}

.btn-novo-cliente {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}
.btn-novo-cliente:hover {
  background: linear-gradient(135deg, #334155 0%, #1e293b 100%) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.35) !important;
  color: #facc15 !important;
}

.btn-novo-pedido {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border: 1px solid #047857 !important;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}
.btn-novo-pedido:hover {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.45) !important;
}

/* Botão Carregar Promob na Esteira */
.btn-promob-upload {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border: 1px solid #6d28d9 !important;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 8px 14px !important;
}
.btn-promob-upload:hover {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.45) !important;
}

/* Botão de Avanço na Esteira - Super Visível */
.btn-avancar-etapa {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  font-size: 11.5px !important;
  padding: 6px 14px !important;
  border: 1px solid #0284c7 !important;
  border-radius: 6px !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}
.btn-avancar-etapa:hover {
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.6) !important;
  color: #0b1120 !important;
}

/* Botões de Ação de Documento: Orçamento & Contrato */
.btn-doc-orcamento {
  background: #fef3c7 !important;
  color: #92400e !important;
  border: 1.5px solid #fcd34d !important;
  font-weight: 700 !important;
  padding: 5px 11px !important;
  font-size: 11.5px !important;
  border-radius: 5px !important;
  cursor: pointer !important;
}
.btn-doc-orcamento:hover {
  background: #fde68a !important;
  color: #78350f !important;
  border-color: #f59e0b !important;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.25) !important;
}

.btn-doc-contrato {
  background: linear-gradient(135deg, #c29958 0%, #b08745 100%) !important;
  color: #0b1120 !important;
  border: 1.5px solid #b08745 !important;
  font-weight: 800 !important;
  padding: 5px 12px !important;
  font-size: 11.5px !important;
  border-radius: 5px !important;
  box-shadow: 0 2px 6px rgba(194, 153, 88, 0.35) !important;
  cursor: pointer !important;
}
.btn-doc-contrato:hover {
  background: linear-gradient(135deg, #d4af37 0%, #c29958 100%) !important;
  box-shadow: 0 4px 12px rgba(194, 153, 88, 0.5) !important;
}

/* Etapas do Pipeline Interativas */
.pipe-step {
  cursor: pointer;
  transition: all 0.2s ease;
}
.pipe-step:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  border-color: #3b82f6;
}

/* ==========================================================
   ESTÚDIO IA, ACERVO MULTIFORMATO & N8N
   ========================================================== */
.btn-filtro-midia {
  background: #F4EFEA;
  color: #5C5852;
  border: 1px solid #E6E1D8;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.btn-filtro-midia:hover {
  border-color: #BA9B69;
  color: #1A1B1D;
}
.btn-filtro-midia.ativo {
  background: #1A1B1D;
  color: #ffffff;
  border-color: #1A1B1D;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hover-midia-card:hover {
  transform: scale(1.02);
  border-color: #BA9B69 !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

@media (max-width: 1200px) {
  .estudio-ia-grid {
    grid-template-columns: 1fr !important;
  }
}

