/* ============================================================
   marketing.css — Estilos de la vista de Marketing modernizada
   8 tabs: campañas, creatividades, audiencias, embudos, calendario, roi, conexiones, sugerencias
   ============================================================ */

/* ── Tabs Bar ── */
.mkt-tabs-bar {
  display: flex;
  gap: 4px;
  padding: 6px;
  background: var(--c-bg-soft);
  border-radius: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.mkt-tab {
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: var(--c-muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.mkt-tab:hover {
  background: rgba(255, 255, 255, 0.6);
  color: var(--c-text);
}

.mkt-tab.active {
  background: var(--c-card);
  color: var(--c-primary);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

/* ── KPI Cards (modernizadas) ── */
.mkt-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.mkt-kpi-card {
  background: var(--c-card);
  border-radius: 10px;
  padding: 16px;
  box-shadow: var(--shadow-xs);
  border-top: 3px solid var(--c-primary);
}

.mkt-kpi-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--c-muted);
  margin-bottom: 6px;
}

.mkt-kpi-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
}

.mkt-kpi-sub {
  font-size: 11px;
  color: var(--c-text-soft);
}

/* ── Section Head ── */
.mkt-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.mkt-section-head h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--c-text-strong);
  margin: 0;
}

/* ── Grid 3 columnas ── */
.mkt-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* ── Tabla con scroll ── */
.tabla-scroll {
  overflow-x: auto;
  max-width: 100%;
}

.mkt-table-card {
  min-width: 0;
}

/* ── Status badges ── */
.mkt-status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.mkt-status-active {
  background: var(--c-success-50);
  color: var(--c-success);
}

.mkt-status-paused {
  background: var(--c-warning-50);
  color: var(--c-warning);
}

/* ── Tags ── */
.mkt-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* ── Creatividades ── */
.mkt-creativa-card {
  background: var(--c-card);
  border-radius: 10px;
  padding: 16px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mkt-creativa-preview {
  background: var(--c-bg-soft);
  border-radius: 8px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--c-text-soft);
}

.mkt-creativa-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mkt-plat-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mkt-creativa-plat {
  font-size: 11px;
  font-weight: 600;
  color: var(--c-muted);
  flex: 1;
}

.mkt-creativa-score {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-warning);
}

.mkt-creativa-titulo {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text-strong);
  margin: 0;
  line-height: 1.3;
}

.mkt-creativa-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mkt-creativa-ctr {
  font-size: 12px;
  color: var(--c-success);
  font-weight: 600;
}

/* ── Audiencias ── */
.mkt-audiencia-card {
  background: var(--c-card);
  border-radius: 10px;
  padding: 16px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mkt-audiencia-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  align-self: flex-start;
}

.mkt-audiencia-nombre {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text-strong);
  margin: 0;
  line-height: 1.3;
}

.mkt-audiencia-detalle {
  font-size: 12px;
  color: var(--c-muted);
  margin: 0;
  line-height: 1.4;
}

.mkt-audiencia-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

.mkt-audiencia-size {
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text-strong);
}

/* ── Embudos ── */
.mkt-funnel-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
}

@media (max-width: 900px) {
  .mkt-funnel-layout { grid-template-columns: 1fr; }
}

.mkt-funnel-card {
  min-width: 0;
}

.mkt-funnel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mkt-funnel-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text-strong);
  margin: 0 0 12px 0;
}

.mkt-funnel-stage {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mkt-funnel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  height: 36px;
  border-radius: 6px;
  color: white;
  font-size: 12px;
  font-weight: 600;
  min-width: 60px;
}

.mkt-funnel-stage-name {
  flex: 1;
}

.mkt-funnel-stage-val {
  font-weight: 700;
}

.mkt-funnel-conv {
  font-size: 10px;
  color: var(--c-text-soft);
  padding-left: 4px;
}

.mkt-funnel-stats {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.mkt-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--c-border);
}

.mkt-stat-row:last-child {
  border-bottom: none;
}

.mkt-stat-label {
  font-size: 12px;
  color: var(--c-muted);
}

.mkt-stat-val {
  font-size: 14px;
  font-weight: 700;
}

/* ── Calendario ── */
.mkt-cal-card {
  padding: 16px;
}

.mkt-cal-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.mkt-cal-day-h {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--c-muted);
  padding: 6px 0;
}

.mkt-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.mkt-cal-cell {
  min-height: 80px;
  background: var(--c-bg-soft);
  border-radius: 6px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mkt-cal-empty {
  background: transparent;
}

.mkt-cal-day-num {
  font-size: 11px;
  font-weight: 600;
  color: var(--c-muted);
}

.mkt-cal-event {
  font-size: 9px;
  font-weight: 600;
  padding: 2px 4px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

/* ── Conexiones ── */
.mkt-con-card {
  background: var(--c-card);
  border-radius: 10px;
  padding: 20px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.mkt-con-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
}

.mkt-con-plat {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text-strong);
  margin: 0;
}

.mkt-con-cuenta {
  font-size: 12px;
  color: var(--c-muted);
}

.mkt-con-camps {
  font-size: 12px;
  font-weight: 500;
  color: var(--c-text-strong);
}

.mkt-con-btn-desconectar {
  color: var(--c-danger);
  border-color: var(--c-danger);
}

/* ── Sugerencias ── */
.mkt-sug-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mkt-sug-card {
  background: var(--c-card);
  border-radius: 10px;
  padding: 16px;
  box-shadow: var(--shadow-xs);
  display: flex;
  gap: 14px;
}

.mkt-sug-priority {
  width: 4px;
  border-radius: 2px;
  flex-shrink: 0;
  min-height: 60px;
}

.mkt-sug-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mkt-sug-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mkt-sug-titulo {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text-strong);
  margin: 0;
}

.mkt-sug-detalle {
  font-size: 12px;
  color: var(--c-muted);
  margin: 0;
  line-height: 1.4;
}

.mkt-sug-action {
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  align-self: flex-start;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .mkt-tabs-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .mkt-tab {
    flex-shrink: 0;
  }
  .mkt-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .mkt-grid-3 {
    grid-template-columns: 1fr;
  }
  .mkt-cal-cell {
    min-height: 60px;
  }
}

/* ── Elementos clickeables ── */
.mkt-link-detalle {
  color: var(--c-primary);
  cursor: pointer;
  text-decoration: none;
}

.mkt-link-detalle:hover {
  text-decoration: underline;
}

.mkt-creativa-card,
.mkt-audiencia-card {
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.mkt-creativa-card:hover,
.mkt-audiencia-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.mkt-cal-event {
  cursor: pointer;
}

/* ── Modal info rows ── */
.mkt-modal-info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--c-border);
  gap: 16px;
}

.mkt-modal-info-row:last-child {
  border-bottom: none;
}

.mkt-modal-info-label {
  font-size: 13px;
  color: var(--c-muted);
  flex-shrink: 0;
  font-weight: 500;
}

.mkt-modal-info-val {
  font-size: 13px;
  color: var(--c-text-strong);
  text-align: right;
  font-weight: 600;
}

.mkt-modal-creativa,
.mkt-modal-audiencia,
.mkt-modal-sugerencia {
  padding: 4px 0;
}

/* ── Tabla acción columna ── */
.tabla-mini td:last-child,
.tabla-mini th:last-child {
  white-space: nowrap;
}

/* ── Form en modal ── */
.modal .form-group select,
.modal .form-group input,
.modal .form-group textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--c-card);
}

.modal .form-group select:focus,
.modal .form-group input:focus,
.modal .form-group textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 2px var(--c-primary-soft);
}

.modal .form-group textarea {
  resize: vertical;
  min-height: 60px;
}