/*
 * Estilos propios de la zona «review». Los componentes comunes están en app.css:
 * aquí sólo lo que no reutiliza ninguna otra pantalla.
 *
 * Revisión: bandeja con la lista a la izquierda y el detalle a la derecha (prototipo
 * Revision.dc.html). Las medidas salen del prototipo.
 */

.rev {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

/* ---- Filtros ---- */

.rev-toolbar {
  gap: 12px;
}

/* Los filtros por tipo del prototipo: contorno de 1.5px, negrita, y el activo en rosa. */
.rev-chip {
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--neutral-600);
}

.rev-chip:hover {
  color: var(--brand-primary);
}

.rev-chip[aria-current="true"] {
  border-color: var(--brand-primary);
  background: var(--brand-primary-bg);
  color: var(--brand-primary);
}

.rev-chip[aria-current="true"] .chip__count {
  background: var(--surface);
  color: var(--brand-primary);
}

.rev-chip .chip__count {
  min-width: 0;
  font-weight: 600;
  color: inherit;
}

.rev-toolbar__end {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rev-agent-filter {
  display: flex;
  gap: 8px;
  margin: 0;
}

.rev-agent-filter__select {
  min-width: 200px;
  background-color: var(--surface);
  font-weight: 600;
  color: var(--text-secondary);
}

.rev-menu {
  min-width: 240px;
}

/* ---- Lo recién decidido, con «Deshacer» ---- */

.rev-done {
  align-items: center;
}

.rev-done__undo {
  border: 0;
  padding: 0;
  background: transparent;
  font: 700 13.5px var(--font-sans);
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* ---- Vacío ---- */

.rev-empty {
  padding: 60px 24px;
}

.rev-empty__title {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--text-heading);
}

.rev-empty .empty__text {
  margin-bottom: 0;
  max-width: 52ch;
  font-size: 14.5px;
}

/* ---- Lista + detalle ---- */

.rev-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
}

.rev-list {
  flex: 1 1 320px;
  min-width: 0;
  overflow: hidden;
}

.rev-item {
  display: flex;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
  border-bottom: 1px solid var(--divider);
  background: var(--surface);
  color: var(--text-primary);
}

.rev-item:last-child {
  border-bottom: 0;
}

.rev-item:hover {
  background: var(--neutral-25);
  color: var(--text-primary);
}

.rev-item[aria-current="true"] {
  background: var(--neutral-25);
  box-shadow: inset 3px 0 0 var(--brand-primary);
}

.rev-item:focus-visible {
  outline-offset: -2px;
}

.rev-tag {
  height: fit-content;
  padding: 2px 9px;
  font-size: 11.5px;
}

.rev-tag--lg {
  padding: 3px 11px;
  font-size: 12px;
}

.rev-item__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rev-item__title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.rev-item__meta {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.rev-list__more {
  margin: 0;
  padding: 12px 18px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
}

.rev-frame {
  display: block;
  flex: 2 1 440px;
  min-width: 0;
  position: sticky;
  top: 24px;
}

/* ---- Detalle ---- */

.rev-detail {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 26px;
}

.rev-detail__head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.rev-detail__agent {
  font-size: 13.5px;
  font-weight: 700;
}

.rev-detail__when {
  margin-left: -4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.rev-detail__title {
  margin: 0;
  font-size: 21px;
  text-wrap: pretty;
}

.rev-detail__form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 0;
}

.rev-field {
  gap: 6px;
}

.rev-field__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--neutral-600);
}

.rev-field__text {
  min-height: 0;
  padding: 13px 15px;
  border: 1.5px solid var(--brand-primary-bg-strong);
  border-radius: 14px;
  font-size: 15.5px;
  line-height: 1.55;
}

.rev-field__read {
  margin: 0;
  padding: 13px 15px;
  border-radius: 14px;
  background: var(--neutral-25);
  font-size: 15.5px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.rev-note {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--warning-bg);
  color: var(--warning);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
}

.rev-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rev-block .eyebrow {
  letter-spacing: 0.05em;
}

.rev-block__text {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--neutral-600);
}

/* Lo que escribió el modelo o una persona: se respetan sus saltos de línea. */
.rev-block__text--pre {
  white-space: pre-wrap;
}

.rev-block__meta {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-muted);
}

.rev-block__link {
  font-size: 13px;
  font-weight: 700;
}

.rev-quote {
  margin: 0;
  padding: 12px 16px;
  border-left: 3px solid var(--brand-orange);
  border-radius: 0 12px 12px 0;
  background: var(--neutral-25);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* «Dónde arreglarlo» de un hallazgo, con el enlace a la ficha. */
.rev-fix {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--brand-primary-bg);
}

.rev-fix__text {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--brand-primary-dark);
}

.rev-fix__hint {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 600;
  opacity: 0.8;
}

.rev-fix__go,
.rev-fix__go:hover {
  border-color: var(--surface);
  background: var(--surface);
  color: var(--brand-primary);
  font-weight: 700;
}

.rev-detail__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 18px;
  border-top: 1px solid var(--divider);
}

.rev-detail__actions .btn:not(.btn--sm) {
  font-weight: 700;
}

.rev-detail__actions .btn:not(.btn--sm):not(.btn--danger):not(.btn--secondary) {
  padding: 9px 22px;
}

.rev-detail__extra {
  display: flex;
  gap: 4px;
  margin-right: auto;
}

.rev-detail__extra .btn--ghost {
  padding-left: 10px;
  padding-right: 10px;
  color: var(--text-muted);
}

.rev-detail__keys {
  margin: -6px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: right;
}

.rev-detail__keys kbd {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: inherit;
}

/* ---- Pantallas estrechas: la lista encima y el detalle debajo, sin pegarse. ---- */

@media (max-width: 760px) {
  .rev-frame {
    position: static;
  }

  .rev-detail {
    padding: 20px;
  }

  /* En el móvil no hay teclado físico al que hacer caso. */
  .rev-detail__keys {
    display: none;
  }

  .rev-toolbar__end {
    margin-left: 0;
    width: 100%;
  }

  .rev-agent-filter,
  .rev-agent-filter__select {
    flex: 1;
  }
}

/* ---- Subpantallas (compactar, analizar el día, informes de un agente) ---- */

.rev-sub__text {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--neutral-600);
}

.rev-sub__text--lead {
  margin-bottom: 14px;
}

.rev-sub__meta {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-muted);
}

.rev-sub__ruled {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-bottom: 1px solid var(--divider);
}

.rev-sub__item,
.rev-finding {
  box-shadow: none;
}

.rev-sub__list {
  margin: 8px 0 0;
  padding-left: 1.2em;
  font-size: 14px;
  line-height: 1.55;
}

.rev-sub__list li + li {
  margin-top: 4px;
}

.rev-sub__day {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
}

.rev-sub__date {
  max-width: 200px;
}

.rev-finding__title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
