/* Nexadent · Radiografías e imágenes (pestaña del paciente + visor) */

/* ---------- Pestaña ---------- */
.im-panel { position: relative; }
.im-cab { gap: 12px; flex-wrap: wrap; align-items: center; }
.im-subir { position: relative; overflow: hidden; cursor: pointer; }
.im-subir input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.im-resumen { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 16px 0 12px; }
.im-dato { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--r-s); background: var(--item); border: 1px solid var(--line); color: var(--ink); text-align: left; font: inherit; }
.im-dato b { font-size: 20px; }
.im-dato span { font-size: 12.5px; color: var(--muted); }
.im-dato.aviso { border-color: #F2AE12; box-shadow: inset 0 0 0 1px #F2AE12; }
.im-dato.clic { cursor: pointer; }
.im-dato.clic:hover { border-color: #8B5CF6; }
.im-filtros { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.im-chip { border: 1px solid var(--line); background: var(--item); color: var(--ink); border-radius: 999px; padding: 7px 13px; font: 600 13px var(--sans); cursor: pointer; }
.im-chip b { opacity: .55; margin-left: 3px; }
.im-chip.on { background: #7B5CFF; color: #fff; border-color: #7B5CFF; }
.im-chip.on b { opacity: .85; }
.im-sel { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.im-sel select { border-radius: 10px; padding: 6px 8px; border: 1px solid var(--line); background: var(--input-bg); color: var(--input-txt); font: inherit; }
.im-dia { margin-top: 14px; }
.im-dia-t { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.im-dia-t::first-letter { text-transform: uppercase; }
.im-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.im-tarj { display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; background: var(--item); border: 1px solid var(--line); padding: 0; cursor: pointer; text-align: left; color: var(--ink); font: inherit; transition: transform .12s, box-shadow .12s; }
.im-tarj:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -16px rgba(30,10,90,.6); }
.im-tarj.retirada { opacity: .55; }
.im-mini { position: relative; aspect-ratio: 4 / 3; background: #E9E6F7; display: grid; place-items: center; overflow: hidden; }
.im-mini.rx { background: #0B0B0F; }
.im-mini img { width: 100%; height: 100%; object-fit: contain; }
.im-mini.falta::after { content: "Imagen no disponible en este ordenador"; color: #aaa; font-size: 12px; padding: 10px; text-align: center; position: absolute; }
.im-eti { position: absolute; top: 8px; left: 8px; background: rgba(255,255,255,.9); color: #241D5C; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.im-eti.n { left: auto; right: 8px; background: #FFD23F; }
.im-eti.r { top: auto; bottom: 8px; background: #F04B5E; color: #fff; }
.im-pie { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 12px; font-size: 13px; }
.im-pie b { font-size: 14px; }
.im-dientes { font-weight: 700; color: var(--enlace); }
.im-vacio { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 16px; text-align: center; color: var(--muted); border: 2px dashed var(--line); border-radius: var(--r-s); margin-top: 12px; }
.im-vacio b { color: var(--ink); font-size: 16px; }
.im-vacio-ico { font-size: 44px; }
.im-soltar { display: none; position: absolute; inset: 0; border-radius: inherit; background: rgba(123,92,255,.82); color: #fff; font-size: 24px; font-weight: 700; place-items: center; border: 3px dashed #fff; z-index: 5; pointer-events: none; }
.im-panel.soltando .im-soltar { display: grid; }
.im-alerta { background: #FFF4D6; color: #6B4A00; border: 1px solid #F2C14E; border-radius: 12px; padding: 10px 12px; font-size: 13.5px; margin: 8px 0; }
.im-lote { display: grid; grid-template-columns: 170px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.im-lote > img { width: 170px; height: 150px; object-fit: contain; background: #000; border-radius: 12px; }
.im-rapidos { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; font-weight: 500; }
.im-rapidos .im-chip { padding: 4px 10px; }
.im-check { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--ink); margin: 12px 0 4px; }
.im-legal p { margin: 0 0 10px; line-height: 1.5; }
.im-op { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: var(--r-s); background: var(--item); border: 1px solid var(--line); margin: 10px 0; }
.im-op span { color: var(--muted); font-size: 13.5px; }
.im-op .btn { align-self: flex-start; }
.im-ir-diente { margin-top: 12px; width: 100%; }
@media (max-width: 900px) { .im-resumen { grid-template-columns: 1fr 1fr; } .im-lote { grid-template-columns: 1fr; } .im-lote > img { width: 100%; } }

/* ---------- Visor (siempre oscuro, como un negatoscopio) ---------- */
body.vx-abierto { overflow: hidden; }
.vx { position: fixed; inset: 0; z-index: 900; background: #07070B; color: #EDEBFA; display: flex; flex-direction: column; font-family: var(--sans); user-select: none; -webkit-user-select: none; }
.vx button { font: inherit; color: inherit; }
.vx-cab { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #111019; border-bottom: 1px solid #23212F; }
.vx-tit { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.vx-tit span { color: #A9A5C4; }
.vx-acc { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.vx-b { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 11px; background: #1D1B2A; border: 1px solid #2E2B40; cursor: pointer; font-size: 14px; font-weight: 600; }
.vx-b:hover { background: #2A2740; }
.vx-b.cerrar { background: #3A1E2A; border-color: #5A2A3C; }
.vx-b.peligro { color: #FF9AA8; }
.vx-b svg { width: 18px; height: 18px; }
.vx-cuerpo { flex: 1; display: flex; min-height: 0; }
.vx-herr { width: 76px; padding: 8px 6px; display: flex; flex-direction: column; gap: 4px; background: #0E0D15; border-right: 1px solid #23212F; overflow-y: auto; }
.vx-h { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; border-radius: 10px; background: transparent; border: 1px solid transparent; cursor: pointer; font-size: 19px; line-height: 1.1; }
.vx-h span { font-size: 10.5px; color: #A9A5C4; font-weight: 600; }
.vx-h:hover { background: #1D1B2A; }
.vx-h.on { background: #7B5CFF; border-color: #9C85FF; }
.vx-h.on span { color: #fff; }
.vx-sep { height: 1px; background: #23212F; margin: 4px 6px; }
.vx-colores { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 4px 8px; }
.vx-color { width: 24px; height: 24px; border-radius: 50%; background: var(--c); border: 2px solid #0E0D15; box-shadow: 0 0 0 1px #3A3750; cursor: pointer; justify-self: center; }
.vx-color.on { box-shadow: 0 0 0 2px #fff; }
.vx-escena { flex: 1; display: grid; grid-template-columns: 1fr; gap: 4px; min-width: 0; background: #000; }
.vx-escena.dos { grid-template-columns: 1fr 1fr; }
.vx-pane { position: relative; overflow: hidden; touch-action: none; cursor: grab; background: #000; outline: 2px solid transparent; outline-offset: -2px; }
.vx-pane.act { outline-color: #7B5CFF; }
.vx-pane:active { cursor: grabbing; }
.vx-escena[data-herr="lupa"] .vx-pane { cursor: zoom-in; }
.vx-escena[data-herr="flecha"] .vx-pane, .vx-escena[data-herr="circulo"] .vx-pane, .vx-escena[data-herr="lapiz"] .vx-pane { cursor: crosshair; }
.vx-escena[data-herr="texto"] .vx-pane { cursor: text; }
.vx-escena[data-herr="goma"] .vx-pane { cursor: not-allowed; }
.vx-lienzo { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.vx-lienzo img { display: block; width: 100%; height: 100%; pointer-events: none; }
.vx-svg { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.vx-svg.goma [data-nota] { pointer-events: all; cursor: pointer; }
.vx-svg.goma [data-nota]:hover { opacity: .5; }
.vx-eti { position: absolute; left: 10px; top: 10px; background: rgba(0,0,0,.6); padding: 4px 10px; border-radius: 8px; font-size: 12.5px; pointer-events: none; }
.vx-escena:not(.dos) .vx-eti { display: none; }
.vx-lupa { position: absolute; width: 240px; height: 240px; border-radius: 50%; overflow: hidden; border: 3px solid #fff; box-shadow: 0 10px 40px rgba(0,0,0,.8); pointer-events: none; background: #000; z-index: 3; }
.vx-lupa-in { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.vx-lupa-in img { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; }
.vx-info { width: 320px; padding: 14px 16px; background: #111019; border-left: 1px solid #23212F; overflow-y: auto; font-size: 13.5px; user-select: text; -webkit-user-select: text; }
.vx-info h3 { margin: 0 0 10px; font-size: 16px; }
.vx-info h4 { margin: 16px 0 6px; font-size: 13px; color: #A9A5C4; }
.vx-f { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid #1F1D2B; }
.vx-f span { color: #A9A5C4; }
.vx-f b { text-align: right; font-weight: 600; }
.vx-f.vx-col { flex-direction: column; }
.vx-f code { background: none; padding: 0; font-size: 11px; word-break: break-all; color: #CFC8FF; }
.vx-vistas { font-size: 12px; color: #C9C5E0; display: flex; flex-direction: column; gap: 3px; }
.vx-info-acc { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.vx-info .im-alerta { font-size: 12.5px; }
.vx-pie { background: #111019; border-top: 1px solid #23212F; padding: 8px 14px 6px; }
.vx-ajustes { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; font-size: 13px; font-weight: 600; color: #C9C5E0; }
.vx-ajustes label { display: inline-flex; align-items: center; gap: 8px; }
.vx-ajustes input[type="range"] { width: 140px; accent-color: #7B5CFF; }
.vx-pre, .vx-zoom { display: inline-flex; gap: 4px; align-items: center; }
.vx-pre button, .vx-zoom button { min-height: 34px; padding: 0 10px; border-radius: 9px; background: #1D1B2A; border: 1px solid #2E2B40; cursor: pointer; font-size: 13px; font-weight: 600; }
.vx-pre button:hover, .vx-zoom button:hover { background: #2A2740; }
.vx-zoom span { min-width: 56px; text-align: center; }
.vx-tira { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 4px; }
.vx-t { flex: 0 0 auto; width: 92px; padding: 3px; border-radius: 10px; background: #1D1B2A; border: 2px solid transparent; cursor: pointer; }
.vx-t img { width: 100%; height: 56px; object-fit: contain; background: #000; border-radius: 7px; display: block; }
.vx-t span { font-size: 10.5px; color: #A9A5C4; }
.vx-t.on { border-color: #4A4470; }
.vx-t.act { border-color: #7B5CFF; }
.vx-legal { font-size: 11px; color: #77738F; text-align: center; padding-top: 2px; }
/* Modo «Enseñar al paciente»: solo la imagen y las herramientas de señalar */
.vx-modo-paciente .vx-tit, .vx-modo-paciente .vx-tira, .vx-modo-paciente .vx-ajustes, .vx-modo-paciente .vx-legal, .vx-modo-paciente .vx-acc .vx-b:not([data-a="vx-paciente"]):not([data-a="vx-completa"]) { visibility: hidden; }
.vx-modo-paciente .vx-tira, .vx-modo-paciente .vx-ajustes, .vx-modo-paciente .vx-legal { display: none; }
.vx-modo-paciente .vx-eti { display: none; }
.vx-modo-paciente [data-a="vx-paciente"] { background: #7B5CFF; border-color: #9C85FF; visibility: visible; }
@media (max-width: 820px) {
  .vx-acc .vx-b span { display: none; }
  .vx-herr { width: 58px; }
  .vx-h span { display: none; }
  .vx-info { position: absolute; right: 0; top: 60px; bottom: 0; z-index: 5; width: min(320px, 90vw); }
  .vx-escena.dos { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
}
/* Las ventanas y avisos que se abren desde el visor van encima de él (la pantalla de bloqueo, aún más arriba) */
body.vx-abierto .modal-fondo { z-index: 1000; }
body.vx-abierto .toast { z-index: 1010; }
/* Pantallas bajitas (portátil 1366 × 768): herramientas en dos columnas para que quepan todas */
@media (max-height: 860px) and (min-width: 821px) {
  .vx-herr { width: 108px; display: grid; grid-template-columns: 1fr 1fr; align-content: start; gap: 3px; }
  .vx-herr .vx-sep, .vx-herr .vx-colores { grid-column: 1 / -1; }
  .vx-colores { grid-template-columns: repeat(5, 1fr); padding: 2px 0; gap: 2px; }
  .vx-color { width: 18px; height: 18px; }
  .vx-h { padding: 4px 1px; font-size: 17px; }
  .vx-h span { font-size: 10px; }
}
.vx-sinc[hidden] { display: none !important; }
/* Flechas anterior / siguiente sobre la imagen */
.vx-centro { flex: 1; position: relative; display: flex; min-width: 0; }
.vx-centro .vx-escena { flex: 1; }
.vx-paso { position: absolute; top: 50%; transform: translateY(-50%); z-index: 4; width: 46px; height: 74px; border-radius: 14px; border: 1px solid #3A3750; background: rgba(17,16,25,.72); color: #fff; font-size: 38px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.vx-paso.izq { left: 10px; } .vx-paso.der { right: 10px; }
.vx-paso:hover { background: #7B5CFF; }
.vx-paso:disabled { opacity: .18; cursor: default; background: rgba(17,16,25,.72); }
.vx-modo-paciente .vx-paso { display: none; }
.vx .vx-paso { font-size: 44px; font-weight: 300; padding-bottom: 6px; }
