/**
 * Búho Smart ERP - Buzón de Tareas y Obligaciones de Hoy (Home)
 * Diseño Ultra-Compacto (100% Ancho, Mínima Altura)
 */

#block-buho-smart-tareas-operativas-erp,
.block-buho-smart-operational-tasks-block {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

.buho-tasks-container {
  width: 100% !important;
  max-width: 100% !important;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  padding: 12px 18px;
  margin-bottom: 14px;
  font-family: inherit;
  color: #1e293b;
  box-sizing: border-box;
}

/* Header Ultra-Compacto */
.buho-tasks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 10px;
}

.buho-tasks-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.buho-tasks-icon {
  font-size: 1.25rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 50%;
  flex-shrink: 0;
}

.buho-tasks-title-group h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.buho-tasks-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.buho-tasks-date-badge {
  background: #f1f5f9;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.buho-tasks-sub-desc {
  margin: 2px 0 0 0;
  font-size: 0.76rem;
  color: #64748b;
  line-height: 1.2;
}

/* KPI Badges Compactos */
.buho-tasks-kpi-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.buho-kpi-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 14px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.buho-kpi-num {
  font-size: 0.8rem;
  font-weight: 800;
}

.buho-kpi-urgent {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
  animation: buhoPulseUrgent 2s infinite;
}

@keyframes buhoPulseUrgent {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 5px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.buho-kpi-rec {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.buho-kpi-pay {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}

.buho-kpi-ticket {
  background: #fce7f3;
  color: #be185d;
  border-color: #fbcfe8;
}

/* Barra de Filtros Compacta */
.buho-tasks-filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.buho-filter-btn {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #cbd5e1;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
}

.buho-filter-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}

.buho-filter-btn.is-active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.buho-filter-urgent {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff5f5;
}

.buho-filter-urgent.is-active {
  background: #b91c1c;
  color: #ffffff;
  border-color: #b91c1c;
}

/* Inbox de Filas de Tareas (Con Scroll Vertical y Mínima Altura) */
.buho-task-inbox {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 290px;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 8px;
}

/* Custom Scrollbar Fino y Elegante */
.buho-task-inbox::-webkit-scrollbar {
  width: 5px;
}
.buho-task-inbox::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}
.buho-task-inbox::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.buho-task-inbox::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Fila de Tarea Ultra-Compacta (Estilo Dashboard / Inbox) */
.buho-task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 12px;
  transition: all 0.15s ease;
  gap: 12px;
  box-sizing: border-box;
  min-height: 38px;
}

.buho-task-row:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.buho-task-row.is-hidden {
  display: none !important;
}

/* Columna Principal */
.buho-task-col-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.buho-task-meta-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.buho-urg-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  flex-shrink: 0;
}

.buho-urg-overdue {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.buho-urg-today {
  background: #fff1f2;
  color: #e11d48;
  border: 1px solid #fecdd3;
}

.buho-urg-tomorrow {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.buho-urg-upcoming {
  background: #f0f9ff;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

.buho-type-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.buho-tag-group {
  background: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.buho-tag-hotel {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.buho-tag-ai {
  background: #fdf4ff;
  color: #a21caf;
  border: 1px solid #f5d0fe;
}

.buho-task-title {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.buho-task-sub {
  font-size: 0.76rem;
  color: #64748b;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.buho-task-meta-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.buho-task-date {
  color: #64748b;
  font-weight: 600;
  flex-shrink: 0;
}

.buho-task-alert {
  color: #c2410c;
  background: #fff7ed;
  border-left: 2px solid #ea580c;
  padding: 0 6px;
  border-radius: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Columna Derecha: Monto y Acciones en una Sola Línea */
.buho-task-col-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.buho-task-amount-box {
  text-align: right;
  min-width: 90px;
}

.buho-amount-val {
  font-size: 0.92rem;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
}

.buho-task-buttons {
  display: flex;
  align-items: center;
  gap: 5px;
}

.buho-task-btn-action {
  background: #0f172a;
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
  display: inline-block;
}

.buho-task-btn-action:hover {
  background: #2563eb;
  color: #ffffff;
  text-decoration: none;
}

.buho-task-btn-ask {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  outline: none;
}

.buho-task-btn-ask:hover {
  background: #ea580c;
  color: #ffffff;
  border-color: #ea580c;
}

/* Empty State Compacto */
.buho-tasks-empty {
  text-align: center;
  padding: 16px 12px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
}

.buho-tasks-empty span {
  font-size: 1.5rem;
  display: block;
}

.buho-tasks-empty h3 {
  margin: 4px 0 2px 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
}

.buho-tasks-empty p {
  margin: 0;
  font-size: 0.78rem;
  color: #64748b;
}

/* Footer Asistido Ultra-Compacto */
.buho-tasks-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 5px 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.buho-tasks-footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  color: #475569;
  flex: 1;
}

.buho-tasks-footer-logo {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  padding: 2px;
  flex-shrink: 0;
}

.buho-btn-pwa-install {
  background: #1d4ed8 !important;
  background-image: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  color: #ffffff !important;
  border: 1px solid #1e40af !important;
  padding: 6px 14px !important;
  border-radius: 8px !important;
  font-size: 0.78rem !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  outline: none !important;
  margin-right: 6px !important;
  text-decoration: none !important;
  box-shadow: 0 3px 8px rgba(29, 78, 216, 0.38) !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
}

.buho-btn-pwa-install:hover {
  background: #1e40af !important;
  background-image: linear-gradient(135deg, #1d4ed8, #1e40af) !important;
  color: #ffffff !important;
  border-color: #172554 !important;
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.55) !important;
  transform: translateY(-1.5px) !important;
}

.buho-btn-pwa-install:active {
  transform: translateY(0.5px) !important;
  box-shadow: 0 1px 4px rgba(29, 78, 216, 0.3) !important;
}

.buho-btn-assistant-summary {
  background: #f97316;
  color: #ffffff;
  border: none;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
}

.buho-btn-assistant-summary:hover {
  background: #ea580c;
}

/* Responsividad para Móviles */
@media (max-width: 768px) {
  .buho-tasks-container {
    padding: 10px 12px;
  }

  .buho-task-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .buho-task-meta-top,
  .buho-task-meta-bottom {
    flex-wrap: wrap;
    white-space: normal;
  }

  .buho-task-col-actions {
    justify-content: space-between;
    border-top: 1px dashed #e2e8f0;
    padding-top: 6px;
  }

  .buho-task-amount-box {
    text-align: left;
  }

  .buho-tasks-footer {
    flex-direction: column;
    text-align: center;
  }

  .buho-btn-assistant-summary {
    width: 100%;
  }
}
