/* TAREAS */
#tasks-nav-item > a{
    position:relative;
    display:inline-block;
}

#tasks-nav-item #tasks-badge{
    display:none;
    position:absolute;
    top:0;
    right:0;
    min-width:16px;
    height:16px;
    font-size:9px;
    padding:0 3px;
    border-radius:8px;
    background:#dc3545;
    color:#fff;
    text-align:center;
    line-height:16px;
    font-weight:700;
}

#tasks-nav-item #tasks-dropdown-panel{
    width: 360px;
    border-bottom:1px solid #e9ecef;
}

#tasks-nav-item #tasks-dropdown-panel #tasks-tabs{
    font-size: 13px;
    gap: 10px;
}

#tasks-nav-item #tasks-dropdown-panel #tasks-dropdown-list{
    max-height:350px;
    overflow-y:auto;
}

/* --- Panel Principal del Dropdown --- */
#tasks-dropdown-panel {
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.04) !important;
  overflow: hidden;
  background-color: #ffffff;
}

/* --- Cabecera y Tabs --- */
#tasks-dropdown-panel .bg-light {
  background-color: #f8fafc !important; /* Gris ultra suave */
  border-bottom: 1px solid #f1f5f9;
  padding: 8px 12px !important;
}

#tasks-tabs .nav-item {
    width: 100%;
    text-align: center;
}

#tasks-tabs .nav-item.nav-item-new {
    width: 30px;
    text-align: center;
}

#tasks-tabs .nav-item.nav-item-new .nav-link {
    background-color: #c2f5c2;
}

#tasks-tabs .nav-link {
  color: #64748b !important;
  font-weight: 500;
  font-size: 12px;
  border-radius: 6px;
  padding: 6px 10px !important;
  transition: all 0.2s ease;
  border: none !important;
}

#tasks-tabs .nav-link:hover {
  color: #0f172a !important;
  background-color: rgba(0, 0, 0, 0.04);
}

#tasks-tabs .nav-link.active {
  color: #2563eb !important; /* Azul moderno */
  background-color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Badges de las Tabs */
#tasks-tabs .badge {
  font-size: 10px !important;
  border-radius: 10px;
  padding: 2px 6px;
}

/* --- Contenedor de la Lista con Scroll --- */
#tasks-dropdown-list {
  max-height: 380px; /* Limita la altura para que no ocupe toda la pantalla */
  overflow-y: auto;
}

/* --- Items de Tarea --- */
#tasks-dropdown-list .dropdown-item {
  border-bottom: 1px solid #f1f5f9 !important;
  padding: 10px 14px !important;
  transition: background-color 0.15s ease;
}

#tasks-dropdown-list .dropdown-item:last-child {
  border-bottom: none !important;
}

#tasks-dropdown-list .dropdown-item:hover {
  background-color: #f8fafc !important;
}

#tasks-dropdown-list .dropdown-item:active {
  background-color: #f1f5f9 !important;
}

/* Texto dentro del Item */
#tasks-dropdown-list .dropdown-item div[style*="font-weight:600"] {
  color: #1e293b;
  font-size: 13px !important;
}

#tasks-dropdown-list .dropdown-item div[style*="color:#888"] {
  color: #64748b !important;
  font-size: 11px !important;
}

/* Badges dentro de la lista (Estilo Soft Badge) */
#tasks-dropdown-list .badge-secondary {
  background-color: #e2e8f0 !important;
  color: #475569 !important;
  font-weight: 500;
  border-radius: 6px;
  padding: 4px 8px;
}

/* Estado: Advertencia / En Proceso */
#tasks-dropdown-list .badge-warning {
  background-color: #fef3c7 !important; /* Ámbar/Amarillo suave */
  color: #b45309 !important;            /* Texto café/ámbar oscuro */
  font-weight: 500;
  border-radius: 6px;
  padding: 4px 8px;
}

/* Estado: Información / En revisión */
#tasks-dropdown-list .badge-info {
  background-color: #e0f2fe !important; /* Azul cielo suave */
  color: #0369a1 !important;            /* Texto azul oscuro */
  font-weight: 500;
  border-radius: 6px;
  padding: 4px 8px;
}

/* Estado: Exitoso / Completado */
#tasks-dropdown-list .badge-success {
  background-color: #dcfce7 !important; /* Verde Menta suave */
  color: #15803d !important;            /* Texto verde bosque */
  font-weight: 500;
  border-radius: 6px;
  padding: 4px 8px;
}

#tasks-dropdown-list .badge-danger {
  background-color: #fee2e2 !important;
  color: #dc2626 !important;
  font-weight: 600;
  border-radius: 6px;
}

/* --- Scrollbar Personalizado (Webkit) --- */
#tasks-dropdown-list::-webkit-scrollbar {
  width: 5px;
}

#tasks-dropdown-list::-webkit-scrollbar-track {
  background: transparent;
}

#tasks-dropdown-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

#tasks-dropdown-list::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* --- MODAL DE NUEVA TAREA --- */

#modal-new-task .select2-selection.select2-selection--multiple{
    line-height: 1;
}
/* ==========================================================================
   Contenedor Principal "Asociar a"
   ========================================================================== */
#modal-new-task .bg-light.border.rounded.p-4 {
  background-color: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 1.25rem !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

#modal-new-task p.font-weight-bold {
  color: #1e293b;
  font-size: 0.875rem;
  font-weight: 600 !important;
  letter-spacing: -0.01em;
}

#modal-new-task p.font-weight-bold small {
  color: #94a3b8 !important;
}

/* ==========================================================================
   Segmented Control (Tabs de tipo)
   ========================================================================== */
#modal-new-task .btn-group {
  background-color: #e2e8f0;
  padding: 3px;
  border-radius: 8px;
  gap: 2px;
}

#modal-new-task .task-ent-tab {
  border: none !important;
  border-radius: 6px !important;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #64748b !important;
  background: transparent !important;
  padding: 6px 10px !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: none !important;
}

#modal-new-task .task-ent-tab:hover {
  color: #0f172a !important;
  background-color: rgba(255, 255, 255, 0.5) !important;
}

#modal-new-task .task-ent-tab.active {
  background-color: #ffffff !important;
  color: #2563eb !important; /* Azul primario moderno */
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06) !important;
}

#modal-new-task .task-ent-tab i {
  font-size: 0.75rem;
  opacity: 0.8;
}

#modal-new-task .task-ent-tab.active i {
  opacity: 1;
}

/* ==========================================================================
   Buscador Estilizado
   ========================================================================== */
#modal-new-task .input-group {
  position: relative;
  border-radius: 8px;
  transition: all 0.2s ease;
}

#modal-new-task .input-group-text {
  background-color: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-right: none !important;
  border-top-left-radius: 8px !important;
  border-bottom-left-radius: 8px !important;
  color: #94a3b8;
  padding-left: 12px;
}

#modal-new-task #taskEntSearch {
  border: 1px solid #cbd5e1 !important;
  border-left: none !important;
  border-top-right-radius: 8px !important;
  border-bottom-right-radius: 8px !important;
  background-color: #ffffff !important;
  color: #334155;
  font-size: 0.875rem;
  padding-left: 0;
  box-shadow: none !important;
}

/* Estado Focus en el buscador (simula iluminación conjunta) */
#modal-new-task .input-group:focus-within .input-group-text,
#modal-new-task .input-group:focus-within #taskEntSearch {
  border-color: #3b82f6 !important;
}

#modal-new-task .input-group:focus-within .input-group-text {
  color: #3b82f6;
}

#modal-new-task #taskEntSearch::placeholder {
  color: #94a3b8;
}

/* ==========================================================================
   Desplegable de Resultados
   ========================================================================== */
#modal-new-task #taskEntResults {
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.08) !important;
  margin-top: 4px;
}

/* Scrollbar personalizado para los resultados */
#modal-new-task #taskEntResults::-webkit-scrollbar {
  width: 5px;
}

#modal-new-task #taskEntResults::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

/* ==========================================================================
   Contenedor de Items Seleccionados / Badges
   ========================================================================== */
#modal-new-task #taskEntSelected {
  margin-top: 10px;
  align-items: center;
}

#modal-new-task #taskEntSelected small.text-muted {
  color: #94a3b8 !important;
  font-style: italic;
  font-size: 0.8125rem;
}

/* Estilo por si renderizas badges/tags al seleccionar un elemento */
#modal-new-task #taskEntSelected .selected-tag {
  display: inline-flex;
  align-items: center;
  background-color: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
  gap: 6px;
}

#modal-new-task #taskEntSelected .selected-tag .remove-tag {
  cursor: pointer;
  color: #3b82f6;
  transition: color 0.15s ease;
}

#modal-new-task #taskEntSelected .selected-tag .remove-tag:hover {
  color: #1e40af;
}

/* ==========================================================================
   Badges de Elementos Asociados (Tags)
   ========================================================================== */
#modal-new-task #taskEntSelected .badge {
  background-color: #eff6ff !important; /* Azul pastel muy suave */
  color: #1d4ed8 !important;            /* Azul intenso para legibilidad */
  border: 1px solid #bfdbfe !important; /* Borde delicado */
  border-radius: 6px !important;
  font-size: 0.75rem !important;        /* 12px */
  font-weight: 500 !important;
  padding: 4px 8px !important;
  gap: 6px !important;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

/* Hover suave en todo el badge */
#modal-new-task #taskEntSelected .badge:hover {
  background-color: #dbeafe !important;
  border-color: #93c5fd !important;
}

/* Icono dentro del badge */
#modal-new-task #taskEntSelected .badge i {
  color: #3b82f6;
  font-size: 0.75rem;
}

/* Botón de eliminar (×) */
#modal-new-task #taskEntSelected .badge a {
  color: #93c5fd !important;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none !important;
  margin-left: 2px;
  padding: 0 2px;
  border-radius: 3px;
  transition: all 0.15s ease;
}

/* Hover específico en el botón eliminar */
#modal-new-task #taskEntSelected .badge a:hover {
  color: #ef4444 !important; /* Rojo al querer eliminar */
  background-color: rgba(239, 68, 68, 0.1);
}

/* ==========================================================================
   Detalles de la Tarea (.task-details-info)
   ========================================================================== */

/* ==========================================================================
   Contenedor Principal (.task-details-info)
   ========================================================================== */
.task-details-info {
  background-color: #f8fafc !important; /* Fondo suave para el bloque */
  border: 1px solid #e2e8f0 !important;   /* Borde fino sutil */
  border-radius: 12px !important;       /* Esquinas redondeadas estilo moderno */
  padding: 1rem 1.25rem !important;      /* Espaciado interno cómodo */
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.01);
}

/* --- Cabecera y Meta info --- */
.task-details-info span[style*="color:#aaa"],
.task-details-info .text-muted {
  color: #64748b !important;
  font-size: 0.75rem !important; /* 12px */
  font-weight: 500;
  display: inline-flex;
  align-items: center;
}

.task-details-info span[style*="color:#aaa"] i {
  color: #94a3b8;
}

/* --- Select2 Estilizado (Fondo Blanco para Destacar) --- */
.task-details-info .select2-container--default .select2-selection--single {
  background-color: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  height: 32px !important;
  padding: 2px 6px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important; /* Sombra suave para destacar */
  transition: all 0.2s ease;
}

.task-details-info .select2-container--default .select2-selection--single:before{
    right: 10px;
    bottom: 10px;
}

.task-details-info .select2-container--default .select2-selection--single:hover {
  border-color: #94a3b8 !important;
}

.task-details-info .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #1e293b !important;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  line-height: 1.5 !important;
}

.task-details-info .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 30px !important;
  right: 6px !important;
}

.task-details-info .select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: #64748b transparent transparent transparent !important;
}

/* --- Badges de Usuarios / Asignados --- */
.task-details-info .badge-info {
  background-color: #e0f2fe !important;
  color: #0369a1 !important;
  border: 1px solid #bae6fd !important;
  border-radius: 6px !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  padding: 5px 10px !important;
  box-shadow: none !important;
}

.task-details-info .badge-info i {
  color: #0284c7;
}

/* Ocultar badges vacíos que vengan del backend */
.task-details-info .badge:empty {
  display: none !important;
}

/* ==========================================================================
   Botones Destacados (Entidades / Relaciones)
   ========================================================================== */
.task-details-info a.btn.btn-secondary {
  background-color: #ffffff !important;   /* Blanco puro sobre el fondo gris suave */
  color: #1e293b !important;              /* Texto oscuro para máximo contraste */
  border: 1px solid #cbd5e1 !important;     /* Borde ligeramente más definido */
  border-radius: 8px !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;             /* Un poco más de grosor en la fuente */
  padding: 5px 12px !important;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04) !important; /* Eleva el botón */
  text-decoration: none !important;
}

/* Hover de los Botones */
.task-details-info a.btn.btn-secondary:hover {
  background-color: #f1f5f9 !important;
  color: #2563eb !important;               /* Resalta en azul al interactuar */
  border-color: #93c5fd !important;
  transform: translateY(-1px);            /* Efecto de elevación */
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

.task-details-info a.btn.btn-secondary i {
  color: #3b82f6 !important;               /* Iconos coloreados para dar vida */
  transition: color 0.15s ease;
}

.task-details-info a.btn.btn-secondary:hover i {
  color: #1d4ed8 !important;
}

/* ==========================================================================
   Adjuntos (Attachments)
   ========================================================================== */
.task-details-info a.btn.btn-light {
  background-color: #ffffff !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 20px !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  padding: 4px 12px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  transition: all 0.15s ease !important;
  text-decoration: none !important;
}

.task-details-info a.btn.btn-light:hover {
  background-color: #f8fafc !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08) !important;
}

.task-details-info a.btn.btn-light i {
  color: #64748b;
}
