/* ═══════════════════════════════════════════════════════════════════
   incentivos.css · Módulo Campañas de Rotación
   Prefijo: .inc- para evitar colisiones con otros módulos
   ═══════════════════════════════════════════════════════════════════ */

#page-incentivos { padding: 0; }
#incentivosRoot { padding: 16px 20px; }

/* ── Header ─────────────────────────────────────────────────────── */
.inc-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 16px; gap: 12px; flex-wrap: wrap;
}
.inc-header h2 { font-size: 18px; font-weight: 800; color: #1A3C8F; margin: 0; }
.inc-header p { font-size: 11px; color: #6B7280; margin: 4px 0 0; }

/* ── Tabs navegación ────────────────────────────────────────────── */
.inc-tabs {
  display: flex; gap: 0; margin-bottom: 16px; border-bottom: 2px solid #E2E6EF;
}
.inc-tab {
  padding: 10px 20px; font-size: 12px; font-weight: 700; cursor: pointer;
  border: none; background: none; color: #6B7280; position: relative;
  font-family: inherit; transition: color .15s;
}
.inc-tab:hover { color: #1A3C8F; }
.inc-tab.active { color: #1A3C8F; }
.inc-tab.active::after {
  content: ''; position: absolute; bottom: -2px; left: 0; right: 0;
  height: 2px; background: #1A3C8F;
}

/* ── Filtros ─────────────────────────────────────────────────────── */
.inc-filtros {
  display: flex; gap: 10px; margin-bottom: 14px; align-items: center; flex-wrap: wrap;
}
.inc-filtros input[type="text"] {
  flex: 1; min-width: 200px;
}

/* ── Botones ────────────────────────────────────────────────────── */
.inc-btn-primary {
  padding: 10px 22px; border-radius: 8px; border: none; cursor: pointer;
  font-weight: 700; font-size: 13px; font-family: inherit;
  background: #1A3C8F; color: #fff; transition: background .15s;
}
.inc-btn-primary:hover { background: #15327A; }
.inc-btn-sm {
  padding: 5px 12px; border-radius: 6px; font-size: 11px; font-weight: 600;
  font-family: inherit; cursor: pointer; border: 1.5px solid #E2E6EF; background: #fff;
  transition: all .15s; white-space: nowrap;
}
.inc-btn-sm:hover { border-color: #1A3C8F; color: #1A3C8F; }
.inc-btn-sm.danger { border-color: #FCA5A5; color: #DC2626; background: #FEF2F2; }
.inc-btn-sm.danger:hover { background: #FEE2E2; }

.inc-info-btn {
  background: none; border: none; cursor: pointer; font-size: 14px;
  padding: 2px 4px; opacity: .7; transition: opacity .15s;
}
.inc-info-btn:hover { opacity: 1; }

/* ── Cards de campaña ───────────────────────────────────────────── */
.inc-lista { display: flex; flex-direction: column; gap: 8px; }
.inc-card {
  background: #fff; border: 1.5px solid #E2E6EF; border-radius: 12px;
  overflow: hidden; transition: border-color .15s;
}
.inc-card:hover { border-color: #FCA5A5; }
.inc-card-header {
  padding: 14px 18px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.inc-card-icon {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  background: linear-gradient(135deg, #FEF3C7, #FEE2E2);
  border: 1px solid rgba(220,38,38,.15);
}
.inc-card-info { flex: 1; min-width: 220px; }
.inc-card-nombre { font-weight: 700; font-size: 14px; color: #111827; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inc-card-meta { font-size: 10px; color: #6B7280; margin-top: 3px; display: flex; gap: 12px; flex-wrap: wrap; }
.inc-card-meta b { color: #111827; }
.inc-card-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }

.inc-badge {
  padding: 3px 10px; border-radius: 20px; font-size: 9px; font-weight: 700;
  flex-shrink: 0;
}

/* ── Sección de detalle / liquidación ──────────────────────────────*/
.inc-detail-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; flex-wrap: wrap; padding: 14px 18px; background: #fff;
  border: 1.5px solid #E2E6EF; border-radius: 12px; margin-bottom: 4px;
}
.inc-step-title { font-size: 11px; font-weight: 700; color: #1A3C8F; }
.inc-nota {
  padding: 10px 14px; background: #EFF6FF; border: 1px solid #BFDBFE;
  border-radius: 8px; margin: 10px 0 14px; font-size: 11px; color: #1E40AF;
}

/* ── Tabla genérica ─────────────────────────────────────────────── */
.inc-table {
  width: 100%; border-collapse: collapse; font-size: 11px;
  background: #fff; border: 1px solid #E2E6EF; border-radius: 10px; overflow: hidden;
}
.inc-table thead { background: #1A3C8F; color: #fff; }
.inc-table th { padding: 8px 10px; font-size: 9px; font-weight: 700; text-align: left; text-transform: uppercase; }
.inc-table td { padding: 8px 10px; border-bottom: 1px solid #F1F5F9; }
.inc-table tr:last-child td { border-bottom: none; }
.inc-table tr:hover { background: #F8FAFC; }
.inc-row-actions { display: flex; gap: 4px; white-space: nowrap; }

/* ── Barra de avance ────────────────────────────────────────────── */
.inc-progress {
  width: 80px; height: 8px; background: #E2E6EF; border-radius: 4px; overflow: hidden; display: inline-block; vertical-align: middle;
}
.inc-progress-bar { height: 100%; border-radius: 4px; transition: width .2s; }

/* ── Empty states ───────────────────────────────────────────────── */
.inc-empty {
  text-align: center; padding: 48px 24px; color: #94A3B8;
}
.inc-empty-icon { font-size: 56px; margin-bottom: 12px; }
.inc-empty-text { font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.inc-empty-sub { font-size: 12px; }
.inc-empty-mini { text-align: center; padding: 16px; color: #94A3B8; font-size: 11px; }

/* ── Modal (compartido con overlays de la casa) ────────────────────*/
.inc-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.5); z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  animation: incFadeIn .15s ease; padding: 16px;
}
@keyframes incFadeIn { from { opacity: 0; } to { opacity: 1; } }
.inc-modal {
  background: #fff; border-radius: 14px; width: 95%; max-width: 1200px;
  max-height: 92vh; overflow-y: auto; box-shadow: 0 20px 40px rgba(0,0,0,.2);
}
/* Modal ancho para wizard/agregar productos: aprovecha pantallas grandes */
.inc-modal.inc-modal-xl { max-width: 1500px; width: 96%; max-height: 94vh; }
/* Tabla de candidatos con más aire vertical y scroll propio para ver muchos productos */
.inc-modal .inc-cand-scroll {
  max-height: 55vh; overflow-y: auto; border: 1px solid #E2E6EF; border-radius: 8px;
}
.inc-modal-header {
  padding: 18px 24px; border-bottom: 1px solid #E2E6EF;
  display: flex; justify-content: space-between; align-items: center;
}
.inc-modal-header h3 { font-size: 16px; font-weight: 800; color: #1A3C8F; margin: 0; }
.inc-modal-close {
  width: 32px; height: 32px; border-radius: 8px; border: none;
  background: #F3F4F6; cursor: pointer; font-size: 16px; color: #6B7280;
}
.inc-modal-body { padding: 20px 24px; }
.inc-modal-footer {
  padding: 16px 24px; border-top: 1px solid #E2E6EF;
  display: flex; gap: 10px; justify-content: flex-end;
}

/* ── Formularios dentro del modal ──────────────────────────────── */
.inc-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.inc-form-full { grid-column: 1 / -1; }
.inc-form-label {
  font-size: 9px; font-weight: 700; color: #6B7280; text-transform: uppercase;
  display: block; margin-bottom: 4px;
}
.inc-form-input {
  width: 100%; padding: 9px 12px; border: 1.5px solid #E2E6EF; border-radius: 8px;
  font-size: 12px; font-family: inherit; box-sizing: border-box;
}
.inc-form-input:focus { outline: none; border-color: #1A3C8F; box-shadow: 0 0 0 3px rgba(26,60,143,.1); }
textarea.inc-form-input { resize: vertical; min-height: 60px; }

/* ── Selector de candidatos ─────────────────────────────────────── */
.inc-cand-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.inc-dias-group { display: flex; gap: 4px; }
.inc-dias-btn {
  padding: 7px 12px; border-radius: 6px; border: 1.5px solid #E2E6EF; background: #fff;
  font-size: 11px; font-weight: 700; cursor: pointer; font-family: inherit; color: #6B7280;
  transition: all .15s;
}
.inc-dias-btn:hover { border-color: #1A3C8F; color: #1A3C8F; }
.inc-dias-btn.active { background: #1A3C8F; border-color: #1A3C8F; color: #fff; }

.inc-cand-selall {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: #374151; margin-bottom: 8px; flex-wrap: wrap; gap: 8px;
}
.inc-cand-selall label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.inc-cand-count { font-weight: 700; color: #1A3C8F; }

.inc-cand-tablewrap, .inc-sel-tablewrap { max-height: 260px; overflow-y: auto; }

.inc-item-remove {
  width: 24px; height: 24px; border-radius: 6px; border: none;
  background: #FEE2E2; color: #DC2626; cursor: pointer; font-size: 13px;
}

/* ── Selector de modo de pago (wizard) ──────────────────────────── */
.inc-mode-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.inc-mode-card {
  border: 1.5px solid #E2E6EF; border-radius: 10px; padding: 12px; cursor: pointer;
  text-align: center; transition: all .15s; background: #fff;
}
.inc-mode-card:hover { border-color: #1A3C8F; }
.inc-mode-card.active { border-color: #1A3C8F; background: #EFF6FF; box-shadow: 0 0 0 2px rgba(26,60,143,.15); }
.inc-mode-icon { font-size: 22px; margin-bottom: 4px; }
.inc-mode-label { font-size: 11px; font-weight: 700; color: #111827; }
.inc-mode-desc { font-size: 9px; color: #6B7280; margin-top: 2px; }

/* ── KPIs (Reportes) ────────────────────────────────────────────── */
.inc-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.inc-kpi-card { background: #fff; border: 1.5px solid #E2E6EF; border-radius: 10px; padding: 12px 14px; }
.inc-kpi-val { font-size: 18px; font-weight: 800; color: #1A3C8F; }
.inc-kpi-lbl { font-size: 9px; font-weight: 700; color: #6B7280; text-transform: uppercase; margin-top: 3px; }
.inc-table tfoot td { border-top: 2px solid #E2E6EF; }

/* ── Tabla de candidatos (estilo Abastecimiento) ────────────────── */
.inc-cand-tbl td { padding: 10px 12px; vertical-align: middle; }
.inc-cand-cod   { font-weight: 800; color: #1A3C8F; font-size: 12px; letter-spacing: .3px; }
.inc-cand-art   { min-width: 260px; }
.inc-cand-nombre { font-weight: 600; color: #111827; font-size: 12.5px; line-height: 1.25; margin-bottom: 4px; }
.inc-cand-meta  { display: flex; gap: 6px; flex-wrap: wrap; }
.inc-cand-stock { text-align: center; font-weight: 800; font-size: 13px; color: #374151; }
.inc-cand-num   { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: #374151; }
.inc-cand-fecha { color: #6B7280; font-size: 11px; white-space: nowrap; }

/* Badges de antigüedad — colores heredados de abastecimiento */
.inc-cand-badge {
  display: inline-block; padding: 3px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 700; line-height: 1;
}
.inc-b-lento     { background: #FEF3C7; color: #92400E; }  /* amarillo */
.inc-b-estancado { background: #FED7AA; color: #9A3412; }  /* naranja */
.inc-b-muerto    { background: #FECACA; color: #991B1B; }  /* rojo */
.inc-b-inerte    { background: #111827; color: #FEF3C7; }  /* negro dominante */
.inc-b-compra       { background: #DBEAFE; color: #1E40AF; }  /* azul suave (compra normal) */
.inc-b-compra-vieja { background: #DDD6FE; color: #5B21B6; }  /* violeta (compra > 1 año) */

/* ── Info Modal ─────────────────────────────────────────────────── */
.inc-info-section { margin-bottom: 14px; }
.inc-info-section h4 { font-size: 11px; font-weight: 700; color: #1A3C8F; margin: 0 0 4px; }
.inc-info-section p { font-size: 11px; color: #374151; margin: 0; line-height: 1.5; }

/* ── Mobile ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .inc-form-grid { grid-template-columns: 1fr; }
  .inc-modal { width: 96%; max-height: 95vh; }
  .inc-card-header { flex-wrap: wrap; }
  .inc-detail-header { flex-direction: column; }
  .inc-mode-cards { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .inc-tabs { overflow-x: auto; }
}
