/* ============================================================
   CHECKLIST VIEW STYLES — Estética AnimalCare & Selwo Marina
   ============================================================ */

.cl-page {
  max-width: 980px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem 1rem;
}

/* ── Selector Rápido de Departamentos (Pills) ───────────── */
.cl-dept-switcher-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  background: white;
  padding: 0.75rem 1.25rem;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid var(--gray-200);
}

.cl-dept-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.cl-dept-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1.5px solid var(--gray-200);
  background: var(--gray-50);
  color: var(--gray-700);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cl-dept-pill:hover {
  border-color: var(--accent-400);
  background: white;
  transform: translateY(-1px);
}

.cl-dept-pill.active {
  background: #0a2647;
  border-color: #0a2647;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(10, 38, 71, 0.2);
}

.cl-global-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.cl-btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
}

/* ── Tarjeta Central Estilo AnimalCare ───────────────────── */
.cl-main-card-wrap {
  display: flex;
  justify-content: center;
}

.cl-task-card {
  width: 100%;
  max-width: 820px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
  border: 1px solid var(--gray-200);
  padding: 2rem 2.5rem;
}

/* Pestañas de listas si hay más de 1 */
.cl-tabs-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--gray-100);
}

.cl-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  border: 1.5px solid var(--gray-200);
  background: var(--gray-50);
  color: var(--gray-700);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.cl-tab-btn:hover {
  background: white;
  border-color: var(--gray-300);
}

.cl-tab-btn.active {
  background: #0284c7;
  border-color: #0284c7;
  color: white;
}

.cl-tab-badge {
  background: rgba(0, 0, 0, 0.1);
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 0.75rem;
}

.cl-tab-btn.active .cl-tab-badge {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

/* ── Metadatos Superiores Estilo AnimalCare ─────────────── */
.cl-task-meta-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.cl-meta-row {
  display: flex;
  gap: 2rem;
  align-items: center;
  flex-wrap: wrap;
}

.cl-meta-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 220px;
}

.cl-meta-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: #64748b;
  min-width: 85px;
}

.cl-meta-val {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e293b;
}

.cl-assigned-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #0d9488;
  color: #ffffff;
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.cl-task-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 1.25rem 0 1.5rem 0;
}

/* ── Encabezado TASK CHECKLIST ───────────────────────────── */
.cl-checklist-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.cl-heading-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cl-task-tag {
  font-size: 0.85rem;
  font-weight: 800;
  color: #334155;
  letter-spacing: 0.6px;
}

.cl-name-badge {
  background: #0f766e;
  color: #ffffff;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.cl-counter-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
}

/* ── Barra de Progreso ───────────────────────────────────── */
.cl-progress-wrapper {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

.cl-progress-num {
  font-size: 0.85rem;
  font-weight: 700;
  color: #64748b;
  min-width: 38px;
}

.cl-progress-track {
  flex: 1;
  height: 8px;
  background: #cbd5e1;
  border-radius: 999px;
  overflow: hidden;
}

.cl-progress-fill {
  height: 100%;
  background: #0284c7;
  border-radius: 999px;
  transition: width 0.25s ease;
}

.cl-progress-fill.complete {
  background: #10b981;
}

/* ── Lista de Tareas (Checkboxes) ────────────────────────── */
.cl-items-container {
  margin-bottom: 2rem;
}

.cl-checklist-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.cl-task-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s ease, opacity 0.2s ease, border 0.15s ease;
}

.cl-task-row:hover {
  background: #f8fafc;
}

/* Tirador Drag & Drop y estados */
.cl-drag-handle {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  padding: 0.65rem 0.25rem 0.65rem 0.75rem;
  color: #94a3b8;
  font-size: 1.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.cl-drag-handle:hover {
  color: var(--primary-600);
}
.cl-drag-handle:active {
  cursor: grabbing;
}
.cl-task-row.is-dragging,
.cl-edit-item-row.is-dragging {
  opacity: 0.4 !important;
  background: #f1f5f9 !important;
}
.cl-task-row.drag-over-top,
.cl-edit-item-row.drag-over-top {
  border-top: 2.5px solid var(--primary-500) !important;
}
.cl-task-row.drag-over-bottom,
.cl-edit-item-row.drag-over-bottom {
  border-bottom: 2.5px solid var(--primary-500) !important;
}

.cl-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.5rem;
  cursor: pointer;
  user-select: none;
  width: 100%;
}

/* Checkbox personalizado */
.cl-native-cb {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cl-custom-check {
  width: 18px;
  height: 18px;
  border: 1.8px solid #94a3b8;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #ffffff;
  transition: all 0.15s ease;
}

.cl-checkbox-label:hover .cl-custom-check {
  border-color: #0284c7;
}

.cl-native-cb:checked + .cl-custom-check {
  background: #0284c7;
  border-color: #0284c7;
}

.cl-check-svg {
  width: 12px;
  height: 12px;
  color: #ffffff;
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.15s ease;
}

.cl-native-cb:checked + .cl-custom-check .cl-check-svg {
  opacity: 1;
  transform: scale(1);
}

.cl-task-text {
  font-size: 0.95rem;
  color: #334155;
  font-weight: 500;
  transition: color 0.15s ease;
}

.cl-task-row.is-done .cl-task-text {
  color: #94a3b8;
  text-decoration: line-through;
}

/* ── Barra Inferior (AnimalCare Action Bar) ──────────────── */
.cl-task-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e2e8f0;
}

.cl-bottom-left, .cl-bottom-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cl-btn-del {
  background: #f97316 !important; /* Naranja/rojo de AnimalCare */
  border-color: #f97316 !important;
  color: white !important;
  font-weight: 700 !important;
  padding: 0.55rem 1.4rem !important;
  border-radius: 6px !important;
}

.cl-btn-del:hover {
  background: #ea580c !important;
}

/* ── Estado Vacío Hero ───────────────────────────────────── */
.cl-empty-hero {
  padding: 3.5rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cl-empty-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  animation: float 3s ease-in-out infinite;
}

.cl-empty-hero h3 {
  font-size: 1.4rem;
  color: #0f172a;
  margin: 0 0 0.5rem 0;
}

.cl-empty-hero p {
  color: #64748b;
  max-width: 460px;
  margin: 0 0 1.75rem 0;
  line-height: 1.5;
}

.cl-empty-btns {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.cl-hero-btn {
  padding: 0.75rem 1.5rem !important;
  font-size: 1rem !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25);
}

/* ── Estilos de Modales HTML (Edit / New List) ───────────── */
.cl-modal-box {
  width: 100%;
  max-width: 520px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--gray-200);
}

.cl-btn-rename-icon {
  background: transparent;
  border: none;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.cl-btn-rename-icon:hover {
  background: var(--gray-100);
}

.cl-edit-item-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--gray-100);
}

.cl-edit-item-num {
  font-size: 0.8rem;
  font-weight: 700;
  color: #94a3b8;
  width: 24px;
  text-align: center;
}

.cl-edit-item-input {
  flex: 1;
  padding: 0.45rem 0.65rem;
  border: 1.5px solid var(--gray-200);
  border-radius: 6px;
  font-size: 0.9rem;
  color: #1e293b;
  transition: border-color 0.15s ease;
}

.cl-edit-item-input:focus {
  outline: none;
  border-color: #0284c7;
}

.cl-edit-item-actions {
  display: flex;
  gap: 0.25rem;
}

.cl-icon-btn {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  color: #475569;
  transition: all 0.15s ease;
}

.cl-icon-btn:hover:not(:disabled) {
  background: var(--gray-200);
  color: #0f172a;
}

.cl-icon-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.cl-icon-btn.danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@media (max-width: 640px) {
  .cl-task-card {
    padding: 1.25rem;
  }
  .cl-task-meta-grid {
    gap: 0.5rem;
  }
  .cl-meta-row {
    gap: 0.5rem;
  }
  .cl-meta-item {
    min-width: 100%;
  }
  .cl-task-bottom-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .cl-bottom-left, .cl-bottom-right {
    justify-content: stretch;
  }
  .cl-bottom-left button, .cl-bottom-right button {
    flex: 1;
  }
}
