/* css/recordatorios.css */
:root {
     --icon-reminder: url('/images/bell.svg');
     --icon-reminderdone: url('/images/alarm.svg');
     --icon-reminderreopen: url('/images/alarm2.svg');
}
/* =====================================================
   Recordatorios – contenedor y panel
   ===================================================== */

:root{
  --mb-header-h: 260px;  /* fallback por si JS aún no ha corrido */
  --mb-reminders-gap: 12px;
}

.mb-reminders{
  position: fixed;
  right: 16px;
  top: calc(var(--mb-header-h) + var(--mb-reminders-gap));
  bottom: 84px;
  z-index: 40;
  pointer-events: none;
  font-family: inherit;
}

.mb-reminders__panel {
  width: 360px;
  height: 100%;
  max-height: 640px;
  background: #fff;
  border: 1px solid var(--primary-color);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  pointer-events: auto;

  /* Contexto de posicionamiento para el modal */
  position: relative;
  z-index: 45;
}

.mb-reminders__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  border-bottom: 1px solid var(--soft-color);
  background: #fff;
}

.mb-reminders__header {
  background: var(--soft-color);
  border-bottom: 1px solid var(--primary-color);
}


.mb-reminders__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 20px;
  color: var(--primary-color);
}

.mb-reminders__title-ico {
  width: 32px;
  height: 32px;
}

.mb-reminders__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mb-reminders__btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--soft-color);
  /* background: #fff; */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* .mb-reminders__btn:hover {
  border-color: var(--primary-color);
} */

.mb-reminders__btn svg {
  width: 24px;
  height: 24px;
}

.mb-reminders__body {
  padding: 10px;
  overflow: auto;
  flex: 1;
}

.mb-reminders__content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mb-reminders__empty {
  border: 1px dashed var(--soft-color);
  border-radius: 10px;
  padding: 12px;
  color: var(--secondary-color);
  font-size: 13px;
  line-height: 1.3;
}

.mb-reminders__footer {
  padding: 8px 10px;
  border-top: 1px solid var(--soft-color);
  font-size: 12px;
  color: var(--secondary-color);
}

/* =====================================================
   Tab (collapsed)
   ===================================================== */

.mb-reminders__tab {
  position: absolute;
  right: 0;
  top: 0px;
  width: 36px;
  height: 56px;
  z-index: 120;  
  border-radius: 12px 0 0 12px;
  border: 1px solid var(--soft-color);
  border-right: none;
  background: #fff;
  box-shadow: 0 10px 25px rgba(0,0,0,0.10);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
}

.mb-reminders__tab svg {
  width: 18px;
  height: 18px;
}

/* =====================================================
   Modos UI
   ===================================================== */

.mb-reminders.mode-open .mb-reminders__panel { display: flex; }
.mb-reminders.mode-open .mb-reminders__tab { display: none; }

.mb-reminders.mode-collapsed .mb-reminders__panel { display: none; }
.mb-reminders.mode-collapsed .mb-reminders__tab { display: inline-flex; }

.mb-reminders.mode-header { display: none; }

/* =====================================================
   Responsive
   ===================================================== */

@media (max-width: 768px) {
  .mb-reminders {
    right: 10px;
    left: 10px;
    top: 96px;
    bottom: 84px;
  }

  .mb-reminders__panel {
    width: auto;
    max-height: none;
  }
}

/* =====================================================
   Campana en cabecera
   - Se oculta SOLO el icono (SVG)
   - El botón mantiene su tamaño
   ===================================================== */

#mb-btn-reminders.mb-reminders-btn-hidden svg {
  visibility: hidden;
  pointer-events: none;
}

/* =====================================================
   Recordatorios – listado (secciones + items)
   ===================================================== */

.mb-reminders-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mb-reminders-section + .mb-reminders-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--soft-color);
}

/* Cabecera de sección (bloque + contador) */
.mb-reminders-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 8px 10px;
  border: 1px solid var(--soft-color);
  border-radius: 10px;
  background: #fff;
}


.mb-reminders-section__head {
  position: relative;
}

.mb-reminders-section__head::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 12px;
  bottom: -6px;
  height: 1px;
  background: var(--primary-color);
}

/* Título de sección (Today / Expired / Next 7 days / Future) */
.mb-reminders-section__title {
  font-weight: 800;
  color: var(--primary-color);
  font-size: 18px;
  letter-spacing: 0.8px;
  /* text-transform: uppercase; */
}

.mb-reminders-item__title {
  font-weight: 700;
  color: var(--primary-color);
  font-size: 14px;
  line-height: 1.2;
  word-break: break-word;
}

.mb-reminders-section__count {
  min-width: 28px;
  height: 22px;
  padding: 0 8px;

  border-radius: 999px;
  border: 1px solid var(--soft-color);
  color: var(--secondary-color);
  font-size: 12px;
  font-weight: 700;

  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Énfasis sutil para Expired (sin colores fijos) */
.mb-reminders-section--expired .mb-reminders-section__head {
  box-shadow: inset 4px 0 0 var(--soft-color);
}

.mb-reminders-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}



/* =====================================================
   Secciones colapsables
   ===================================================== */

.mb-reminders-section__head {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Título + chev alineados */
.mb-reminders-section__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Chevron delante del texto */
.mb-reminders-section__chev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.mb-reminders-section__chev svg {
  width: 16px;
  height: 16px;
}

/* Estado collapsed */
.mb-reminders-section.is-collapsed .mb-reminders-section__body {
  display: none;
}

/* Rotación del icono cuando está cerrado */
.mb-reminders-section.is-collapsed .mb-reminders-section__chev {
  transform: rotate(-90deg);
}



/* =====================================================
   Item
   ===================================================== */

.mb-reminders-item {
  position: relative;
  overflow: hidden;

  border: 1px solid var(--soft-color);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.mb-reminders-item:hover {
  border-color: var(--primary-color);
}

/* Fila principal */
.mb-reminders-item__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.mb-reminders-item__main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

/* Botón marcar hecho */
.mb-reminders-item__done {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid var(--soft-color);
  background: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.mb-reminders-item__done:hover {
  border-color: var(--primary-color);
}

.mb-reminders-item__done--disabled {
  opacity: 0.6;
}

/* Texto */
.mb-reminders-item__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.mb-reminders-item__title-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.mb-reminders-item__title {
  font-weight: 600;
  color: var(--primary-color);
  line-height: 1.2;
  word-break: break-word;
}

.mb-reminders-item__badge {
  flex: 0 0 auto;
  font-size: 12px;
  line-height: 1;

  border: 1px solid var(--soft-color);
  border-radius: 999px;
  padding: 3px 6px;

  color: var(--secondary-color);
  background: #fff;
  opacity: 0.9;
}

.mb-reminders-item__meta {
  font-size: 12px;
  color: var(--secondary-color);
}

/* Referencia (link a entidad) */
.mb-reminders-item__ref {
  font-size: 12px;
}

.mb-reminders-item__ref-link {
  color: var(--primary-color);
  text-decoration: none;
  border-bottom: 1px dashed var(--soft-color);
  cursor: pointer;
}

.mb-reminders-item__ref-link:hover {
  border-bottom-color: var(--primary-color);
}

/* Acciones derecha */
.mb-reminders-item__actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.mb-reminders-item__btn {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid var(--soft-color);
  background: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}



/* Shared (Notice): fondo suave usando secondary-color (sin afectar al texto) */
.mb-reminders-item--shared::before {
  content: '';
  position: absolute;
  inset: 0;
  /* background: var(--secondary-color); */
  /* opacity: 0.10; */
  pointer-events: none;
}

/* Asegura que el contenido quede por encima del overlay */
.mb-reminders-item--shared .mb-reminders-item__row {
  position: relative;
}

.mb-reminders-item__done svg {
  width: 16px;
  height: 16px;
}

/* =====================================================
   Detalle desplegable + marca de asignados
   ===================================================== */

/* Assigned: clase real generada por PHP */
.mb-reminders-item--assigned {
  border: 2px solid var(--highlight-color);
  background: var(--soft-color);
  border-radius: 10px;
}

/* Detalle: oculto por defecto */
.mb-reminders-item__details {
  margin-top: 6px;
  padding-left: 38px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--secondary-color);
  display: none;
}

/* Visible cuando el item está abierto */
.mb-reminders-item.is-open .mb-reminders-item__details {
  display: block;
}

/* Línea asignados en detalle */
.mb-reminders-item__assignees {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
}

.mb-reminders-item__assignees-ico {
  opacity: 0.8;
}

.mb-reminders-item__assignees-text {
  word-break: break-word;
}

/* Preserva saltos de línea en texto largo (si se usa) */
.mb-reminders-item__details-text {
  white-space: pre-wrap;
}

/* =====================================================
   Recordatorios tipo Notice (shared)
   - Avisos informativos
   - No expiran, no se cierran
   ===================================================== */

.mb-reminders-item--shared {
  background: var(--secondary-color);
  border-color: var(--secondary-color);
}

/* Texto y metadatos legibles sobre fondo secondary */
.mb-reminders-item--shared .mb-reminders-item__title,
.mb-reminders-item--shared .mb-reminders-item__meta,
.mb-reminders-item--shared .mb-reminders-item__details,
.mb-reminders-item--shared .mb-reminders-item__desc,
.mb-reminders-item--shared .mb-reminders-item__ref-link {
  color: #fff;
}

/* Referencias: subrayado visible */
.mb-reminders-item--shared .mb-reminders-item__ref-link {
  border-bottom-color: rgba(255, 255, 255, 0.35);
}

.mb-reminders-item--shared .mb-reminders-item__ref-link:hover {
  border-bottom-color: rgba(255, 255, 255, 0.7);
}

/* Botones de acción (shared): iconos blancos, sin borde */
.mb-reminders-item--shared .mb-reminders-item__btn,
.mb-reminders-item--shared .btn-icon.accion-icono {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #fff;
}

/* Feather usa SVG con stroke/fill en currentColor -> lo forzamos */
.mb-reminders-item--shared .mb-reminders-item__btn svg,
.mb-reminders-item--shared .btn-icon.accion-icono svg {
  stroke: currentColor;
  fill: none;
}

/* Hover: sin borde, solo un “halo” suave */
.mb-reminders-item--shared .mb-reminders-item__btn:hover,
.mb-reminders-item--shared .btn-icon.accion-icono:hover {
  /* background: rgba(255, 255, 255, 0.14); */
  border: 0;
}

/* Focus accesible, sin inventar colores */
.mb-reminders-item--shared .mb-reminders-item__btn:focus,
.mb-reminders-item--shared .btn-icon.accion-icono:focus {
  outline: none;
}

.mb-reminders-item--shared .mb-reminders-item__btn:focus-visible,
.mb-reminders-item--shared .btn-icon.accion-icono:focus-visible {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

/* Si el botón de notas lleva badge, lo hacemos legible en shared */
/* .mb-reminders-item--shared .btn-icon.accion-icono .badge {
  background: rgba(255, 255, 255, 0.18);
  border: 0;
  color: #fff;
} */

/* Iconos completamente blancos en shared */
.mb-reminders-item--shared .mb-reminders-item__btn,
.mb-reminders-item--shared .btn-icon.accion-icono {
  color: #fff;
}

/* Aseguramos que el SVG herede y no tenga overrides */
.mb-reminders-item--shared .mb-reminders-item__btn svg,
.mb-reminders-item--shared .btn-icon.accion-icono svg {
  stroke: #fff;
  fill: none;
}
/* =====================================================
   Recordatorios – modal (anclado al panel)
   ===================================================== */

.mb-reminders-modal.hidden {
  display: none;
}

.mb-reminders-modal {
  position: absolute;
  inset: 0;
  z-index: 60;

  /* El overlay captura clicks, el panel sigue siendo el “mundo” */
  pointer-events: auto;

  display: flex;

  /* En vez de centrar vertical a pantalla completa, lo anclamos arriba */
  align-items: flex-start;
  justify-content: center;

  /* margen superior + laterales */
  padding: 18px 12px 12px;
}

.mb-reminders-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
}

/* Diálogo */
.mb-reminders-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 520px;

  background: #fff;
  border: 1px solid var(--soft-color);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.18);
  overflow: hidden;

  max-height: calc(100% - 24px);
  display: flex;
  flex-direction: column;

  margin-top: 10px;
}

.mb-reminders-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  border-bottom: 1px solid var(--soft-color);
}

.mb-reminders-modal__title {
  font-weight: 700;
  color: var(--primary-color);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mb-reminders-modal__title svg,
.mb-reminders-modal__title i,
.mb-reminders-modal__title .mb-reminders__title-ico {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  display: inline-block;
  vertical-align: middle;
}

.mb-reminders-modal__body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
}

.mb-reminders-modal__row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Fix: no dejes que .mb-reminders-modal__row pise .hidden */
.mb-reminders-modal__row.hidden {
  display: none !important;
}

.mb-reminders-modal__label {
  font-size: 12px;
  color: var(--secondary-color);
}

.mb-reminders-modal__input,
.mb-reminders-modal__textarea,
.mb-reminders-modal__select {
  border: 1px solid var(--primary-color);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
}

.mb-reminders-modal__input:focus,
.mb-reminders-modal__textarea:focus,
.mb-reminders-modal__select:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--soft-color);
}

/* Footer: botones */
.mb-reminders-modal__footer {
  padding: 10px;
  border-top: 1px solid var(--soft-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.mb-reminders-modal__footer .btn,
.mb-reminders-modal__footer .btn-primary {
  white-space: nowrap;
}

/* Modal: ayudas y asignees */
.mb-reminders-modal__help {
  font-size: 12px;
  color: var(--secondary-color);
  border: 1px dashed var(--soft-color);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}

.mb-reminders-modal__assignees {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mb-reminders-modal__check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--primary-color);
}

.mb-reminders-modal__check input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

/* Footer buttons (no size-lock from .mb-reminders__btn) */
.mb-reminders-modal__footer .mb-reminders__btn {
  width: auto;
  height: auto;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1;
}

/* Botón primario dentro del modal */
#mb-reminders-modal-save.mb-reminders__btn {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

#mb-reminders-modal-save.mb-reminders__btn:hover {
  opacity: 0.9;
}

/* Texto muted auxiliar */
.mb-reminders-modal__muted {
  color: var(--secondary-color);
  font-size: 12px;
}


/* Evita flash: oculto hasta que JS marque ready */
.mb-reminders {
  visibility: hidden;
}

/* JS pondrá esta clase cuando ya haya aplicado el modo */
.mb-reminders.is-ready {
  visibility: visible;
}



/* =========================================================
   Modal historial recordatorio
   ========================================================= */

#modal-historial-recordatorio {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none; /* se controla con .hidden */
}

#modal-historial-recordatorio:not(.hidden) {
  display: block;
}

#modal-historial-recordatorio .modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

/* Contenedor central */
#modal-historial-recordatorio .modal-content {
  position: relative;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);

  max-width: 980px;
  width: calc(100% - 40px);

  margin: 60px auto;
  display: flex;
  flex-direction: column;

  max-height: calc(100vh - 120px);
  overflow: hidden;
}

/* Header fijo */
#modal-historial-recordatorio .modal-header {
  flex: 0 0 auto;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  background: #fff;
}

/* Body con scroll interno */
#modal-historial-recordatorio-body {
  flex: 1 1 auto;
  overflow-y: auto;
}

/* Animación suave */
#modal-historial-recordatorio:not(.hidden) .modal-content {
  animation: mbModalFadeIn 0.15s ease-out;
}

@keyframes mbModalFadeIn {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}


.icon-reminder {
  background-image: var(--icon-reminder);
}

.icon-reminderdone {
  background-image: var(--icon-reminderdone);
}

.hist-icon.reminder {
  background-image: var(--icon-reminder);
}

.hist-icon.reminderdone {
  background-image: var(--icon-reminderdone);
}

.hist-icon.reminderreopen {
  background-image: var(--icon-reminderreopen);
}


/* ==============================================
   Assigned (users) icon next to title
   ============================================== */

.mb-reminders-item__title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mb-reminders-item__assigned-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
}

.mb-reminders-item__assigned-ico svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}


/* =========================================
   Done checkbox (square)
   ========================================= */

.mb-reminders-item__done {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.mb-reminders-item__checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--primary-color);
  border-radius: 4px;
  display: inline-block;
  position: relative;
  transition: all .15s ease;
}

/* Hover */
.mb-reminders-item__done:hover .mb-reminders-item__checkbox {
  background: var(--soft-color);
}

/* Done state */
.mb-reminders-item__done.is-done .mb-reminders-item__checkbox {
  background: var(--primary-color);
}

/* Tick */
.mb-reminders-item__done.is-done .mb-reminders-item__checkbox::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}


.mb-reminders__btn.is-active {
  border-color: var(--primary-color);
  background: rgba(0, 0, 0, 0.03);
}



#modal-confirm-done.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

#modal-confirm-done .modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
}

#modal-confirm-done .modal-content {
  position: relative;
  z-index: 2;
  border-radius: 12px;
  overflow: hidden;
}
#modal-confirm-done .modal-content {
  border-radius: 16px;
  border: 2px solid var(--primary-color);
}


#modal-confirm-done .confirm-done-title {
  display: block;
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 6px;
}

#modal-confirm-done .btn {
  min-width: 110px;
}

.mb-reminders__btn.is-active {
  border-color: var(--primary-color);
  background: var(--highlight-color);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.02) inset;
}



.mb-reminders-item__assignees {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mb-reminders-item__assignee {
  display: flex;
  align-items: flex-start; 
  gap: 6px;
  font-size: 0.8rem;
  opacity: 0.8;
}

.mb-reminders-item__assignee-icon {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.mb-reminders-item__assignee .lucide {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;   
  margin-top: 2px;
}

.mb-reminders-item__desc {
  font-size: 0.9rem;
  line-height: 1.5;
  margin-top: 6px;
}

.mb-reminders-item__desc {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--primary-color);
}

.mb-reminders-item__details {
  margin-left: 0;
  padding-left: 0;
}
/* .mb-reminders-item__details {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--primary-color);
} */