/* odontOS · Ficha del paciente: avatar en escritorio y aviso de anamnesis pendiente compacto en celular. */
.pd-av2 { display: none; }
@media (min-width: 901px) {
  html body #patientDetail .pd-title { position: relative !important; padding-left: 152px !important; min-height: 132px; display: flex !important; flex-direction: column !important; justify-content: center !important; gap: 4px; }
  html body #patientDetail .pd-av2 { display: block !important; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 132px !important; height: 132px !important; min-width: 132px !important; border-radius: 50% !important; background-color: #EEF1F5; box-shadow: 0 0 0 1px rgba(15, 23, 42, .08), 0 2px 6px rgba(15, 23, 42, .08); }
}
/* Celular: el aviso «Anamnesis pendiente» pasa de caja alta con párrafo a una sola línea con botón (el texto completo queda en el título del aviso) */
@media (max-width: 620px) {
  html body #patientDetail .pd-alerts { width: 100% !important; }
  html body #patientDetail .clinical-banner.cb-pend { padding: 6px 8px 6px 12px !important; margin: 0 !important; gap: 8px !important; flex-wrap: nowrap !important; align-items: center !important; border-radius: 12px !important; width: 100% !important; }
  html body #patientDetail .clinical-banner.cb-pend > div { min-width: 0 !important; flex: 1 1 auto !important; }
  html body #patientDetail .clinical-banner.cb-pend > div > b { font-size: 12.5px !important; line-height: 1.2; letter-spacing: .02em; }
  html body #patientDetail .clinical-banner.cb-pend > div > div { display: none !important; }
  html body #patientDetail .clinical-banner.cb-pend > button { flex: none !important; min-height: 36px !important; height: 36px !important; padding: 0 12px !important; font-size: 13px !important; border-radius: 10px !important; width: auto !important; }
}

/* Foto de perfil: insignia de cámara sobre el avatar (solo cuando la subida está activa) */
.pd-av[data-subir], .pd-av2[data-subir] { position: relative; }
.pd-av[data-subir][data-foto^="https://ik.imagekit.io/"], .pd-av2[data-subir][data-foto^="https://ik.imagekit.io/"] { cursor: zoom-in; }
.pd-av2[data-subir] { position: absolute; }
/* Icono de cámara: un círculo pequeño dentro del avatar (la carita animada recorta lo que sobresale del círculo) */
html body .avp-btn { position: absolute; right: -2px; bottom: -2px; z-index: 2; display: grid; place-items: center; width: 28px; height: 28px; min-height: 0 !important; min-width: 0 !important; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 50%; background: #0369A1; color: #fff; cursor: pointer; box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(15, 23, 42, .25); transition: transform .12s, background .12s; }
.avp-btn:hover { background: #0284C7; transform: scale(1.06); }
.avp-btn:focus-visible { outline: 2px solid #0284C7; outline-offset: 3px; }
.avp-btn svg { width: 14px; height: 14px; display: block; }
.avp-btn::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; } /* zona táctil ≥ 44 px */
/* Celular: avatar grande y aviso de anamnesis aún más pequeño */
@media (max-width: 620px) {
  html body #patientDetail .pd-head .pd-av { width: 104px !important; height: 104px !important; border-radius: 50% !important; background-color: #EEF1F5 !important; box-shadow: 0 0 0 1px rgba(15, 23, 42, .08); }
  html body #patientDetail .pd-head { grid-template-columns: auto auto minmax(0, 1fr) !important; }
  html body #patientDetail .pd-alerts { width: auto !important; }
  html body #patientDetail .clinical-banner.cb-pend { display: inline-flex !important; width: auto !important; max-width: 100% !important; padding: 0 8px 0 9px !important; margin: 0 !important; min-height: 24px !important; height: 24px !important; gap: 2px !important; border-radius: 12px !important; border-width: 1px !important; cursor: pointer; }
  html body #patientDetail .clinical-banner.cb-pend > div { flex: none !important; min-width: 0 !important; }
  html body #patientDetail .clinical-banner.cb-pend > div > b { font-size: 10.5px !important; line-height: 1 !important; letter-spacing: .01em; white-space: nowrap !important; }
  html body #patientDetail .clinical-banner.cb-pend > div > div, html body #patientDetail .clinical-banner.cb-pend > button { display: none !important; }
  html body #patientDetail .clinical-banner.cb-pend::after { content: "›"; font-size: 15px; line-height: 1; font-weight: 700; }
}

/* Lista desplegable de la foto (estilo menú de Apple), flotando sobre el documento para que no la recorte la tarjeta */
.avp-menu { position: fixed; top: 0; left: 0; z-index: 100050; min-width: 220px; padding: 6px; border-radius: 14px; background: rgba(255, 255, 255, .96); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 0 0 .5px rgba(15, 23, 42, .12), 0 12px 32px rgba(15, 23, 42, .2); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; cursor: default; animation: avp-m .14s ease-out; text-align: left; }
@keyframes avp-m { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.avp-it { display: flex; align-items: center; width: 100%; min-height: 44px; margin: 0; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; color: #0F172A; font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; box-shadow: none; justify-content: flex-start; }
.avp-it:hover, .avp-it:focus-visible { background: rgba(2, 132, 199, .10); outline: 0; color: #0369A1; }
.avp-it:active { background: rgba(2, 132, 199, .18); }
.avp-rojo, .avp-rojo:hover, .avp-rojo:focus-visible { color: #C62828; }
@media (prefers-reduced-motion: reduce) { .avp-menu { animation: none; } }
@media (prefers-color-scheme: dark) { html[data-theme="dark"] .avp-menu { background: rgba(44, 44, 46, .96); } html[data-theme="dark"] .avp-it { color: #F5F5F7; } }

/* Carita animada dentro del avatar de la ficha: la figura llena el círculo y no se sale de él */
.av-anim { overflow: hidden; }
.av-anim > svg { display: block; width: 122%; height: 122%; margin: -11%; }

/* Celular: avatar de 104 px, icono más pequeño */
@media (max-width: 620px) {
  html body .avp-btn { right: -2px; bottom: -2px; width: 26px; height: 26px; }
  .avp-btn svg { width: 13px; height: 13px; }
}
/* Tablet vertical: el avatar mide 54 px */
@media (min-width: 621px) and (max-width: 900px) {
  html body .avp-btn { right: 2px; bottom: 2px; width: 24px; height: 24px; }
  .avp-btn svg { width: 13px; height: 13px; }
}

/* Ventana para ver la foto de perfil en grande al tocar el avatar */
.avp-visor, .avp-visor * { box-sizing: border-box; }
.avp-visor { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 100060; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15, 23, 42, .62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: avp-v .15s ease-out; }
@keyframes avp-v { from { opacity: 0; } to { opacity: 1; } }
.avp-visor-box { width: 100%; max-width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px); border-radius: 20px; background: var(--card, #fff); box-shadow: 0 24px 60px rgba(15, 23, 42, .35), 0 0 0 1px rgba(15, 23, 42, .08); overflow: hidden; display: flex; flex-direction: column; }
.avp-visor-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line, rgba(15, 23, 42, .08)); }
.avp-visor-title { font-size: 15px; font-weight: 700; color: var(--ink, #0F172A); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avp-visor-close { flex: none; width: 36px; height: 36px; min-width: 36px !important; min-height: 36px !important; padding: 0; margin: 0; border: 0; border-radius: 50%; background: rgba(148, 163, 184, .16); color: var(--ink, #0F172A); display: grid; place-items: center; cursor: pointer; }
.avp-visor-close:hover { background: rgba(148, 163, 184, .28); }
.avp-visor-img { display: block; width: 100%; max-height: calc(100vh - 104px); aspect-ratio: 1 / 1; object-fit: cover; background: #EEF1F5; }
/* En escritorio odontOS aplica html { zoom: 0.75 }: el visor debe cubrir el 100% real y centrarse al medio */
@media (min-width: 835px) {
  .avp-visor {
    width: calc(100vw / var(--zv, 0.75)) !important;
    height: calc(100vh / var(--zv, 0.75)) !important;
    max-width: none !important;
    max-height: none !important;
  }
  .avp-visor-box { zoom: 1.3334; }
}
@media (prefers-reduced-motion: reduce) { .avp-visor { animation: none; } }
