/* Ficha 360 de Contactos. Se carga desde admin-contactos.js para mantener el
   alcance aislado del shell general del admin. */
#contact-drawer {
  width: min(760px, 100vw);
}

#contact-drawer .drawer-body {
  display: block;
  padding: 0;
  background: #f7f9f8;
}

.contact360-summary {
  padding: 1rem 1.1rem .9rem;
  background: #fff;
  border-bottom: 1px solid #dfe6e2;
}

.contact360-identity {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.contact360-identity > div {
  min-width: 0;
}

.contact360-eyebrow {
  display: block;
  margin-bottom: .2rem;
  color: #607069;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.contact360-identity h3 {
  margin: 0;
  color: #17372d;
  font-size: 1.35rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.contact360-identity p {
  margin: .25rem 0 0;
  color: #607069;
  font-size: .82rem;
}

.contact360-addresses {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .65rem;
  margin-top: .4rem;
  color: #344d43;
  font-size: .76rem;
  font-weight: 700;
}

.contact360-addresses span {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.contact360-channels {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .75rem;
}

.contact360-channel,
.contact360-event-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: .2rem .45rem;
  border: 1px solid #cad5d0;
  border-radius: 5px;
  background: #f5f7f6;
  color: #3e5149;
  font-size: .68rem;
  font-weight: 800;
  line-height: 1.2;
}

.contact360-channel.is-whatsapp {
  border-color: #a6d9c3;
  background: #ecf8f1;
  color: #176a46;
}

.contact360-channel.is-email {
  border-color: #b7cce8;
  background: #eef5fc;
  color: #285783;
}

.contact360-channel.is-missing,
.contact360-channel.is-blocked {
  border-color: #ebc1bd;
  background: #fff1f0;
  color: #a43d35;
}

.contact360-commercial-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: .9rem 0 0;
  border: 1px solid #dfe6e2;
  border-radius: 6px;
  background: #fbfcfb;
  overflow: hidden;
}

.contact360-commercial-grid > div {
  min-width: 0;
  padding: .65rem .7rem;
  border-right: 1px solid #dfe6e2;
}

.contact360-commercial-grid > div:last-child {
  border-right: 0;
}

.contact360-commercial-grid dt {
  color: #6b7973;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.contact360-commercial-grid dd {
  margin: .2rem 0 0;
  color: #203b32;
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.contact360-commercial-grid dd small {
  margin-left: .15rem;
  color: #78857f;
  font-size: .65rem;
}

.contact360-actions {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .45rem;
  padding: .65rem 1.1rem;
  border-bottom: 1px solid #d6dfda;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 5px 12px rgba(20, 45, 36, .08);
}

.contact360-action {
  min-width: 0;
  min-height: 38px;
  padding: .45rem .55rem;
  border: 1px solid #b9c7c0;
  border-radius: 6px;
  background: #fff;
  color: #29473c;
  font: inherit;
  font-size: .76rem;
  font-weight: 850;
  line-height: 1.15;
  cursor: pointer;
}

.contact360-action.is-primary {
  border-color: #207451;
  background: #207451;
  color: #fff;
}

.contact360-action:hover:not(:disabled) {
  border-color: #176442;
  background: #eef7f2;
}

.contact360-action.is-primary:hover:not(:disabled) {
  background: #176442;
  color: #fff;
}

.contact360-action:focus-visible,
.contact360-editor > summary:focus-visible {
  outline: 3px solid rgba(35, 117, 82, .24);
  outline-offset: 2px;
}

.contact360-action:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.contact360-timeline-section {
  padding: 1rem 1.1rem 1.15rem;
  background: #fff;
  border-bottom: 1px solid #dfe6e2;
}

.contact360-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .75rem;
}

.contact360-section-head h3 {
  margin: 0;
  color: #203b32;
  font-size: 1rem;
}

.contact360-live {
  color: #6b7973;
  font-size: .72rem;
}

.contact360-timeline {
  position: relative;
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact360-timeline::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 6px;
  width: 2px;
  background: #dfe6e2;
}

.contact360-event {
  position: relative;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: .65rem;
  padding: 0 0 .9rem;
}

.contact360-event:last-child {
  padding-bottom: .2rem;
}

.contact360-event-mark {
  position: relative;
  z-index: 1;
  width: 12px;
  height: 12px;
  margin-top: .3rem;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #687a72;
  box-shadow: 0 0 0 1px #aebbb5;
}

.contact360-event.is-whatsapp .contact360-event-mark {
  background: #2c9b6b;
}

.contact360-event.is-email .contact360-event-mark {
  background: #4b7fb7;
}

.contact360-event.is-admin .contact360-event-mark,
.contact360-event.is-internal .contact360-event-mark {
  background: #b0782d;
}

.contact360-event article {
  min-width: 0;
  padding: .6rem .7rem;
  border: 1px solid #dfe6e2;
  border-radius: 6px;
  background: #fbfcfb;
}

.contact360-event-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}

.contact360-event-head b {
  min-width: 0;
  color: #243c34;
  font-size: .8rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.contact360-event-head time {
  flex: 0 0 auto;
  color: #75827c;
  font-size: .68rem;
  white-space: nowrap;
}

.contact360-event p {
  margin: .35rem 0 0;
  color: #4c5e56;
  font-size: .76rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.contact360-event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-top: .5rem;
}

.contact360-event-meta .is-channel {
  border-color: #b7cce8;
  background: #eef5fc;
  color: #285783;
}

.contact360-event-meta .is-status {
  border-color: #d9c695;
  background: #fff8e7;
  color: #745418;
}

.contact360-more {
  display: block;
  margin: .8rem auto 0;
}

.contact360-partial {
  margin: 0 0 .7rem;
  padding: .55rem .65rem;
  border-left: 3px solid #bd852e;
  background: #fff8e7;
  color: #6b4b18;
  font-size: .72rem;
  line-height: 1.4;
}

.contact360-timeline-empty,
.contact360-timeline-end {
  margin: .5rem 0;
  color: #687770;
  font-size: .76rem;
  line-height: 1.45;
  text-align: center;
}

.contact360-timeline-empty b,
.contact360-timeline-empty span {
  display: block;
  margin-bottom: .45rem;
}

.contact360-timeline-loading {
  display: grid;
  gap: .55rem;
}

.contact360-timeline-loading span {
  height: 62px;
  border-radius: 6px;
  background: linear-gradient(90deg, #edf1ef 25%, #f7f9f8 45%, #edf1ef 65%);
  background-size: 220% 100%;
  animation: contact360-loading 1.2s ease infinite;
}

@keyframes contact360-loading {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

.contact360-editor {
  margin: .8rem 1.1rem 1.1rem;
  border: 1px solid #d9e1dd;
  border-radius: 6px;
  background: #fff;
}

.contact360-editor > summary {
  padding: .75rem .85rem;
  color: #29473c;
  font-size: .8rem;
  font-weight: 850;
  cursor: pointer;
}

.contact360-editor[open] > summary {
  border-bottom: 1px solid #e2e8e5;
}

.contact360-editor > form,
.contact360-editor > .drawer-section {
  margin: .85rem;
}

@media (max-width: 720px) {
  .contact360-commercial-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact360-commercial-grid > div:nth-child(2) {
    border-right: 0;
  }

  .contact360-commercial-grid > div:nth-child(-n+2) {
    border-bottom: 1px solid #dfe6e2;
  }

  .contact360-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: .6rem .75rem;
  }

  .contact360-summary,
  .contact360-timeline-section {
    padding-right: .8rem;
    padding-left: .8rem;
  }

  .contact360-editor {
    margin-right: .8rem;
    margin-left: .8rem;
  }
}

@media (max-width: 420px) {
  .contact360-identity {
    display: grid;
  }

  .contact360-event-head {
    display: grid;
    gap: .2rem;
  }

  .contact360-event-head time {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .contact360-timeline-loading span {
    animation: none;
  }
}
