/* ============================================================
   SOLICITUD EXPEDIENTE — 17/09/2026 · SEC-HACIENDA
   · El botón de la tarjeta (Asignaciones y BD Predial): rojo y con
     latido cuando falta la respuesta de ARCHIVO.
   · El modal MENSAJE O BITÁCORA con cada mensaje en su burbuja.
   Nota viva: styles.css:146 pone `button{width:100%}` a TODO botón.
   ============================================================ */

/* ── el botón de la tarjeta ── */

.proc-icon-btn.sex-pendiente,
.bdp-icon-btn.sex-pendiente {
  background: linear-gradient(135deg, #ef4444, #b91c1c) !important;
  border-color: #b91c1c !important;
  box-shadow: 0 0 0 0 rgba(220, 38, 38, .55);
  animation: sexLatido 1.25s ease-in-out infinite;
  position: relative;
}

.proc-icon-btn.sex-pendiente img,
.bdp-icon-btn.sex-pendiente img {
  filter: brightness(0) invert(1);
}

.proc-icon-btn.sex-pendiente:hover,
.bdp-icon-btn.sex-pendiente:hover {
  background: linear-gradient(135deg, #dc2626, #991b1b) !important;
  border-color: #991b1b !important;
}

/* Latido de corazón: dos golpes y descanso, con un halo que se abre. */
@keyframes sexLatido {
  0%   { transform: scale(1);    box-shadow: 0 0 0 0 rgba(220, 38, 38, .55); }
  14%  { transform: scale(1.14); box-shadow: 0 0 0 4px rgba(220, 38, 38, .35); }
  28%  { transform: scale(1);    box-shadow: 0 0 0 6px rgba(220, 38, 38, .12); }
  42%  { transform: scale(1.10); box-shadow: 0 0 0 8px rgba(220, 38, 38, .06); }
  70%  { transform: scale(1);    box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
  100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* Quien pidió menos movimiento en su teléfono lo ve rojo, sin latir. */
@media (prefers-reduced-motion: reduce) {
  .proc-icon-btn.sex-pendiente,
  .bdp-icon-btn.sex-pendiente { animation: none; box-shadow: 0 0 0 3px rgba(220, 38, 38, .35); }
}

/* Respondida: un punto verde discreto, para distinguirla de "sin solicitud". */
.proc-icon-btn.sex-respondida,
.bdp-icon-btn.sex-respondida { position: relative; }

.proc-icon-btn.sex-respondida::after,
.bdp-icon-btn.sex-respondida::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 2px rgba(var(--surface-rgb), 1);
}

/* ── el modal ── */

#modal-expediente.sex-modal .card { max-height: calc(100vh - 32px); overflow: auto; }

.sex-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  margin: -4px 0 2px;
  font-size: .84rem;
  color: var(--text-muted, #5b6b63);
}

.sex-sub-exp b { color: var(--text-main, #0f1f16); }

.sex-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .2px;
  background: rgba(107, 124, 116, .14);
  color: var(--text-muted, #5b6b63);
  white-space: nowrap;
}

.sex-chip-rojo  { background: rgba(220, 38, 38, .12); color: #b91c1c; }
.sex-chip-verde { background: rgba(22, 163, 74, .12); color: #15803d; }

.sex-historial {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 44vh;
  min-height: 60px;
  overflow-y: auto;
  padding: 10px;
  border-radius: var(--radius-md, 14px);
  background: rgba(6, 64, 43, .04);
  border: 1.5px solid rgba(6, 64, 43, .12);
}

.sex-msg {
  align-self: flex-start;
  max-width: 88%;
  padding: 8px 11px 6px;
  border-radius: 14px 14px 14px 4px;
  background: rgba(var(--surface-rgb), 1);
  border: 1px solid rgba(6, 64, 43, .12);
  box-shadow: 0 1px 3px rgba(6, 64, 43, .06);
}

/* Las respuestas de ARCHIVO van al otro lado, en verde. */
.sex-msg-archivo {
  align-self: flex-end;
  border-radius: 14px 14px 4px 14px;
  background: rgba(22, 163, 74, .10);
  border-color: rgba(22, 163, 74, .28);
}

.sex-msg-cab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.sex-msg-autor {
  font-size: .72rem;
  font-weight: 800;
  color: var(--primary, #06402B);
  letter-spacing: .2px;
}

.sex-msg-tipo {
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(220, 38, 38, .10);
  color: #b91c1c;
}

.sex-msg-archivo .sex-msg-tipo { background: rgba(22, 163, 74, .16); color: #15803d; }

.sex-msg-texto {
  font-size: .88rem;
  font-weight: 500;
  color: var(--text-main, #0f1f16);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

.sex-msg-fecha {
  margin-top: 3px;
  font-size: .68rem;
  font-weight: 600;
  color: var(--text-muted, #6b7c74);
  text-align: right;
}

.sex-vacio {
  margin: 0;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted, #6b7c74);
  text-align: center;
}

/* ── modo oscuro ── */

html[data-tema="oscuro"] .sex-historial { background: rgba(255, 255, 255, .03); border-color: rgba(111, 211, 165, .16); }
html[data-tema="oscuro"] .sex-msg { border-color: rgba(111, 211, 165, .18); }
html[data-tema="oscuro"] .sex-msg-archivo { background: rgba(22, 163, 74, .18); border-color: rgba(74, 222, 128, .30); }
html[data-tema="oscuro"] .sex-msg-autor { color: #6fd3a5; }
html[data-tema="oscuro"] .sex-msg-tipo { background: rgba(248, 113, 113, .18); color: #fca5a5; }
html[data-tema="oscuro"] .sex-msg-archivo .sex-msg-tipo { background: rgba(74, 222, 128, .18); color: #86efac; }
html[data-tema="oscuro"] .sex-chip-rojo { background: rgba(248, 113, 113, .18); color: #fca5a5; }
html[data-tema="oscuro"] .sex-chip-verde { background: rgba(74, 222, 128, .16); color: #86efac; }
html[data-tema="oscuro"] .sex-sub-exp b { color: #e7f3ec; }

/* ── MI TRABAJO · pestaña Solicitudes ── */

.mt-sx-ultimo { margin: 2px 0 0; font-size: .8rem; color: var(--text-muted, #6b7c74); }
.mt-sx-ultimo b { color: var(--text-main, #0f1f16); }
html[data-tema="oscuro"] .mt-sx-ultimo b { color: #e7f3ec; }
.mt-sx-abrir {
  width: auto !important;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  border: 1.5px solid rgba(6, 64, 43, .22);
  background: rgba(var(--surface-rgb), .9);
  color: var(--primary, #06402B);
  cursor: pointer;
}
.mt-sx-abrir.sex-pendiente-txt { border-color: #dc2626; color: #b91c1c; }
