/* ════════════════════════════════════════════════════════════════════
   visor.css — Visor de ficha clínica (F7) · LUZOcrm V2 / TRANSED ONG
   Faltaba por completo: por eso los SVG salían a tamaño completo (icono
   gigante). Acota todos los SVG y da layout de tarjeta. Tokens canónicos
   LUZOkit con fallbacks → hereda light/dark/midnight. Scope: .fcv-*
   ════════════════════════════════════════════════════════════════════ */

/* contenedor scrolleable + página centrada */
.fcv-scroll { position: absolute; inset: 0; overflow-y: auto; background: var(--bg-body, var(--bg-surface)); }
.fcv-page { max-width: 860px; margin: 0 auto; padding: 22px 24px 60px; }

/* SVG: TODOS acotados (esto repara el icono gigante) */
.fcv-page svg, .fcv-scroll svg { width: 16px; height: 16px; flex-shrink: 0; }

/* botón volver */
.fcv-back {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; margin-bottom: 16px;
  background: transparent; border: 0.5px solid var(--border); border-radius: 8px;
  color: var(--tx-base); font: 500 12px/1 inherit; cursor: pointer;
  transition: all .15s ease;
}
.fcv-back:hover { background: var(--bg-hover, rgba(127,127,127,.06)); border-color: var(--tx-muted); }
.fcv-back svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }

/* tarjeta */
.fcv-card { background: var(--bg-card); border: 0.5px solid var(--border); border-radius: 12px; padding: 22px 24px; }

/* head */
.fcv-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding-bottom: 16px; border-bottom: 0.5px solid var(--border-soft, var(--border)); margin-bottom: 16px; }
.fcv-head-l { min-width: 0; }
.fcv-head-tipo { font-size: 13.5px; font-weight: 600; color: var(--tx-base); }
.fcv-head-folio { font-family: ui-monospace, monospace; font-size: 11.5px; color: var(--c-brand-soft, #a78bfa); margin-top: 3px; }
.fcv-head-r { flex-shrink: 0; }

/* badge de estado */
.fcv-state { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 10px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.fcv-state.is-firmada, .fcv-state.firmada { background: var(--green-bg, rgba(29,158,117,.1)); color: var(--green-base, #1d9e75); }
.fcv-state.is-borrador, .fcv-state.borrador { background: var(--bg-surface, var(--bg-hover)); color: var(--tx-muted); }
.fcv-state.is-revision, .fcv-state.en_revision { background: var(--amber-bg, rgba(186,117,23,.1)); color: var(--amber-base, #ba7517); }
.fcv-state.is-rectificada, .fcv-state.rectificada { background: var(--c-brand-muted, rgba(127,119,221,.18)); color: var(--c-brand-soft, #a78bfa); }

/* meta grid */
.fcv-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 12px 14px; margin-bottom: 16px; background: var(--bg-surface, var(--bg-card)); border: 0.5px solid var(--border-soft, var(--border)); border-radius: 10px; }
@media (max-width: 640px) { .fcv-meta { grid-template-columns: 1fr; } }
.fcv-meta-i { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fcv-meta-k { font-size: 9px; color: var(--tx-soft); text-transform: uppercase; letter-spacing: .07em; font-weight: 500; }
.fcv-meta-v { font-size: 12.5px; color: var(--tx-base); }

/* secciones */
.fcv-sec { margin-bottom: 18px; }
.fcv-sec-lbl { font-size: 11px; font-weight: 600; color: var(--c-brand-soft, #a78bfa); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.fcv-field { margin-bottom: 12px; }
.fcv-field-lbl { font-size: 10.5px; color: var(--tx-muted); font-weight: 500; margin-bottom: 3px; }
.fcv-field-val { font-size: 12.5px; color: var(--tx-base); line-height: 1.6; white-space: pre-wrap; }
.fcv-empty-content { font-size: 12px; color: var(--tx-soft); font-style: italic; padding: 8px 0; }

/* notas privadas */
.fcv-notas { display: flex; align-items: center; gap: 9px; padding: 10px 13px; margin-bottom: 16px; background: var(--bg-surface, var(--bg-card)); border: 0.5px solid var(--border-soft, var(--border)); border-radius: 9px; font-size: 11.5px; color: var(--tx-muted); }
.fcv-notas svg { width: 14px; height: 14px; stroke: var(--tx-muted); fill: none; stroke-width: 1.8; }
.fcv-notas b { color: var(--tx-base); font-weight: 500; }

/* FEI */
.fcv-fei { display: flex; align-items: center; gap: 11px; padding: 12px 14px; margin: 16px 0; background: var(--green-bg, rgba(29,158,117,.08)); border: 0.5px solid var(--green-bd, rgba(29,158,117,.28)); border-radius: 10px; }
.fcv-fei svg { width: 20px; height: 20px; stroke: var(--green-base, #1d9e75); fill: none; stroke-width: 1.8; }
.fcv-fei-info { min-width: 0; }
.fcv-fei-t { font-size: 12px; font-weight: 600; color: var(--tx-base); }
.fcv-fei-hash { font-family: ui-monospace, monospace; font-size: 10.5px; color: var(--green-base, #1d9e75); margin-top: 2px; }
.fcv-fei-verify { font-size: 10.5px; color: var(--tx-muted); margin-top: 2px; }

/* rectificaciones */
.fcv-rects { display: flex; flex-direction: column; gap: 8px; }
.fcv-rect-row { padding: 10px 12px; background: var(--bg-surface, var(--bg-card)); border: 0.5px solid var(--border-soft, var(--border)); border-radius: 8px; }
.fcv-rect-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fcv-rect-folio { font-family: ui-monospace, monospace; font-size: 11px; font-weight: 600; color: var(--c-brand-soft, #a78bfa); }
.fcv-rect-date { font-size: 10.5px; color: var(--tx-muted); }
.fcv-rect-motivo { font-size: 12px; color: var(--tx-base); margin-top: 5px; line-height: 1.5; }
.fcv-rect-meta { font-size: 10.5px; color: var(--tx-soft); margin-top: 4px; }

/* auditoría (details) */
.fcv-audit { margin-top: 16px; border-top: 0.5px solid var(--border-soft, var(--border)); padding-top: 14px; }
.fcv-audit-sum { display: flex; align-items: center; gap: 7px; cursor: pointer; font-size: 11.5px; font-weight: 500; color: var(--tx-muted); list-style: none; }
.fcv-audit-sum::-webkit-details-marker { display: none; }
.fcv-audit-sum svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2.2; transition: transform .18s ease; }
.fcv-audit[open] .fcv-audit-sum svg { transform: rotate(180deg); }
.fcv-audit-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.fcv-audit-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; background: var(--bg-surface, var(--bg-card)); border-radius: 7px; font-size: 11px; }
.fcv-audit-act { font-weight: 500; color: var(--tx-base); }
.fcv-audit-user { color: var(--tx-muted); }
.fcv-audit-at { color: var(--tx-soft); margin-left: auto; }
.fcv-audit-hash { font-family: ui-monospace, monospace; font-size: 10px; color: var(--tx-soft); }

/* loading */
.fcv-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 80px 20px; color: var(--tx-muted); font-size: 12.5px; }
.fcv-loading svg { width: 30px !important; height: 30px !important; stroke: var(--c-brand-soft, #a78bfa); fill: none; stroke-width: 1.6; animation: fcv-spin 1.1s linear infinite; }
@keyframes fcv-spin { to { transform: rotate(360deg); } }

/* error */
.fcv-errbox { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 60px 20px; text-align: center; }
.fcv-errbox svg { width: 30px !important; height: 30px !important; stroke: var(--red-base, #e24b4a); fill: none; stroke-width: 1.6; }
.fcv-err-t { font-size: 14px; font-weight: 600; color: var(--tx-base); }
.fcv-err-s { font-size: 12px; color: var(--tx-muted); max-width: 360px; }

@media (prefers-reduced-motion: reduce){ .fcv-loading svg { animation: none; } }
