/* ================================================================
   detalle-incidencia.css — Componente compartido de detalle modal
   ================================================================ */

/* ── Overlay ──────────────────────────────────────────────── */
.detalle-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 7777;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.detalle-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ── Modal container ────────────────────────────────────────*/
.detalle-modal {
  width: min(900px, calc(100vw - 32px));
  max-height: min(820px, calc(100vh - 32px));
  background: var(--color-surface);
  border-radius: var(--radius-2xl, 16px);
  box-shadow: var(--shadow-2xl, 0 25px 50px rgba(0,0,0,0.25));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.25s ease;
  box-sizing: border-box;
}
.detalle-overlay.visible .detalle-modal {
  transform: scale(1) translateY(0);
}

/* ── Header ───────────────────────────────────────────────── */
.detalle-header {
  position: relative;
  padding: 24px 70px 20px 28px;
  border-bottom: 1px solid var(--color-border-light, #e5e7eb);
  flex-shrink: 0;
}
.detalle-header h2,
.detalle-header h3 {
  margin: 0;
  font-size: var(--text-lg, 1.125rem);
  font-weight: var(--fw-bold, 700);
  color: var(--color-text, #111827);
  line-height: 1.3;
}

/* ── Close button ─────────────────────────────────────────── */
.detalle-cerrar {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-md, 8px);
  font-size: 1.5rem;
  color: var(--color-text-secondary, #6b7280);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.detalle-cerrar:hover {
  background: var(--color-surface-alt, #f3f4f6);
  color: var(--color-text, #111827);
}

/* ── Body (scrollable) ────────────────────────────────────── */
.detalle-body {
  overflow-y: auto;
  padding: 28px 32px 32px;
  flex: 1;
}
.detalle-body > :last-child {
  margin-bottom: 0;
}

/* ── Info grid ────────────────────────────────────────────── */
.detalle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  margin-bottom: 24px;
}
.detalle-grid .detalle-campo {
  font-size: var(--text-sm, 0.875rem);
  line-height: 1.5;
}
.detalle-grid .detalle-campo strong {
  display: block;
  margin-bottom: 2px;
  color: var(--color-text-muted, #6b7280);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.detalle-grid .detalle-campo.detalle-campo-full {
  grid-column: 1 / -1;
}

/* ── Description ──────────────────────────────────────────── */
.detalle-descripcion {
  margin-bottom: 24px;
}
.detalle-descripcion strong {
  display: block;
  margin-bottom: 8px;
  color: var(--color-text-muted, #6b7280);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.detalle-descripcion p {
  background: var(--color-surface-alt, #f9fafb);
  padding: var(--space-4, 16px);
  border-radius: var(--radius-md, 8px);
  font-size: var(--text-sm, 0.875rem);
  line-height: 1.7;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ── Progress line ────────────────────────────────────────── */
.detalle-progreso {
  margin-bottom: 24px;
}
.detalle-progreso > strong {
  display: block;
  margin-bottom: 12px;
  color: var(--color-text-muted, #6b7280);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.progreso-linea {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: center;
  padding: 16px 0;
  gap: 0;
  position: relative;
}

.progreso-paso {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  text-align: center;
}

.progreso-circulo {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2.5px solid #d1d5db;
  background: transparent;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: all 0.2s;
}

.progreso-paso.completado .progreso-circulo {
  background: var(--color-success, #10b981);
  border-color: var(--color-success, #10b981);
}
.progreso-paso.actual .progreso-circulo {
  background: var(--color-primary, #1d4ed8);
  border-color: var(--color-primary, #1d4ed8);
  box-shadow: 0 0 0 3px var(--color-primary-pale, rgba(29,78,216,0.15));
}
.progreso-paso.pendiente .progreso-circulo {
  background: transparent;
  border-color: #d1d5db;
}

.progreso-paso span {
  font-size: 0.65rem;
  color: #9ca3af;
  white-space: nowrap;
  line-height: 1.1;
}
.progreso-paso.completado span {
  color: var(--color-success, #10b981);
  font-weight: var(--fw-semi, 600);
}
.progreso-paso.actual span {
  color: var(--color-primary, #1d4ed8);
  font-weight: var(--fw-bold, 700);
}

/* ── Connector line between circles ───────────────────────── */
.progreso-conector {
  height: 2px;
  background: #d1d5db;
  flex-shrink: 0;
  align-self: center;
  margin-top: -20px;
}
.progreso-paso.completado + .progreso-conector {
  background: var(--color-success, #10b981);
}
.progreso-paso.actual + .progreso-conector {
  background: #d1d5db;
}

/* ── History ──────────────────────────────────────────────── */
.detalle-historial {
  margin-bottom: 16px;
}
.detalle-historial strong {
  display: block;
  margin-bottom: 12px;
  color: var(--color-text-muted, #6b7280);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.detalle-historial-vacio {
  font-size: var(--text-xs, 0.75rem);
  color: var(--color-text-muted, #9ca3af);
  font-style: italic;
}

.historial-lista {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.historial-item {
  font-size: var(--text-sm, 0.875rem);
  padding: 12px;
  background: var(--color-surface-alt, #f9fafb);
  border-radius: var(--radius-md, 8px);
  border-left: 3px solid var(--color-primary-light, #60a5fa);
}
.historial-fecha {
  color: var(--color-text-muted, #6b7280);
  font-size: var(--text-xs, 0.75rem);
  display: block;
  margin-bottom: 2px;
}
.historial-transicion {
  font-weight: var(--fw-semi, 600);
  display: block;
  margin-bottom: 2px;
}
.historial-comentario {
  margin: 4px 0 0;
  font-size: var(--text-xs, 0.75rem);
  color: var(--color-text-secondary, #4b5563);
}

/* ── Evidencias ────────────────────────────────────────────── */
.detalle-evidencias {
  margin-bottom: 16px;
}
.detalle-evidencias strong {
  display: block;
  margin-bottom: 8px;
  color: var(--color-text-muted, #6b7280);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.detalle-evidencias-vacio {
  font-size: var(--text-xs, 0.75rem);
  color: var(--color-text-muted, #9ca3af);
  font-style: italic;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .detalle-modal {
    width: 100vw;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    min-height: 100vh;
  }
  .detalle-overlay {
    padding: 0;
  }
  .detalle-grid {
    grid-template-columns: 1fr;
  }
  .progreso-linea {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 0;
  }
  .progreso-paso {
    flex-direction: row;
    gap: 8px;
    width: 100%;
    text-align: left;
  }
  .progreso-conector {
    width: 2px;
    height: 12px;
    margin: 0 0 0 7px;
  }
  .detalle-header {
    padding: 16px 56px 14px 20px;
  }
  .detalle-body {
    padding: 20px 20px 24px;
  }
  .detalle-cerrar {
    top: 14px;
    right: 14px;
  }
}
