/* Historia manuscrita (Tahel, 2026-10-06): misma familia visual que el creador
   de reportes (.cr-), con prefijo .hm-. Sin depender del build de Tailwind. */
.hm { --hm-azul: #0074c2; --hm-celeste: #2ca7dc; --hm-azul-suave: #eaf4fb; --hm-tinta: #0f172a; --hm-gris: #64748b; --hm-gris-suave: #94a3b8; --hm-linea: #e2e8f0; --hm-fondo: #f6f8fb; --hm-ok: #15803d; --hm-ok-suave: #e8f6ec; --hm-aviso: #b45309; --hm-aviso-suave: #fff4e5; --hm-rojo: #dc2626; --hm-rojo-suave: #fee2e2; --hm-radio: 14px; color: var(--hm-tinta); font-size: 14px; }
.hm *, .hm *::before, .hm *::after { box-sizing: border-box; }
.hm button { font: inherit; cursor: pointer; }
.hm textarea, .hm select { font: inherit; color: inherit; }
[x-cloak] { display: none !important; }
/* Los iconos SVG (App\Support\Lab\Creador\Iconos) traen la clase .cr-ico; su
   tamaño vive aquí también para no depender de creador-reportes.css. */
.hm .cr-ico { width: 16px; height: 16px; flex: none; }

.hm-layout { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: 1.25rem; align-items: start; }
@media (max-width: 1100px) { .hm-layout { grid-template-columns: minmax(0, 1fr); } .hm-lateral { position: static !important; max-height: none !important; } }

/* ---------- cabecera de la cita ---------- */
.hm-cita { display: flex; flex-wrap: wrap; gap: .4rem 1.75rem; padding: .6rem .9rem; border: 1px solid var(--hm-linea); border-radius: var(--hm-radio); background: #fff; font-size: 13px; color: var(--hm-gris); margin-bottom: 1rem; }
.hm-cita b { color: var(--hm-tinta); font-weight: 600; }

/* ---------- lienzo ---------- */
.hm-resumen { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; color: var(--hm-gris); font-size: 13px; }
.hm-paginas { display: grid; grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr)); gap: .9rem; min-height: 6rem; }
.hm-vacio { grid-column: 1 / -1; border: 2px dashed #cbd5e1; border-radius: var(--hm-radio); padding: 2.75rem 1rem; text-align: center; color: var(--hm-gris); background: #fff; line-height: 1.5; }
.hm-vacio strong { color: var(--hm-azul); }
.hm-paginas.hm-recibe .hm-vacio, .hm-zona.hm-recibe { border-color: var(--hm-celeste); background: var(--hm-azul-suave); color: var(--hm-azul); }

.hm-pagina { background: #fff; border: 1px solid var(--hm-linea); border-radius: var(--hm-radio); box-shadow: 0 1px 2px rgba(15, 23, 42, .04); display: grid; grid-template-columns: 6.25rem minmax(0, 1fr); overflow: hidden; transition: box-shadow .15s, border-color .15s; }
.hm-pagina:hover { box-shadow: 0 4px 16px rgba(0, 116, 194, .08); }
.hm-pagina--activa { border-color: var(--hm-azul); box-shadow: 0 0 0 3px rgba(0, 116, 194, .15); }
.hm-pagina--error { border-left: 4px solid var(--hm-rojo); }
.hm-pagina__foto { position: relative; cursor: zoom-in; background: #f1f5f9; min-height: 9rem; }
.hm-pagina__foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hm-pagina__num { position: absolute; left: .4rem; top: .4rem; width: 1.6rem; height: 1.6rem; border-radius: 999px; background: rgba(15, 23, 42, .78); color: #fff; font-weight: 700; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.hm-pagina__velo { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .55); }
.hm-pagina__cuerpo { display: flex; flex-direction: column; min-width: 0; }
.hm-pagina__cab { display: flex; align-items: center; gap: .35rem; padding: .5rem .5rem .35rem .4rem; }
.hm-pagina__titulo { font-weight: 700; font-size: 14px; }
.hm-pagina__botones { margin-left: auto; display: inline-flex; gap: .1rem; }
.hm-pagina__texto { flex: 1; width: 100%; border: 1px solid transparent; background: transparent; border-radius: 8px; margin: 0 .5rem .5rem; padding: .35rem .5rem; font-size: 12.5px; line-height: 1.45; color: #334155; resize: vertical; min-height: 6.5rem; white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; width: calc(100% - 1rem); }
.hm-pagina__texto:hover { border-color: var(--hm-linea); background: #fff; }
.hm-pagina__texto:focus { outline: none; border-color: var(--hm-azul); background: #fff; box-shadow: 0 0 0 3px rgba(0, 116, 194, .15); }
.hm-pagina__texto::placeholder { color: var(--hm-gris-suave); font-family: inherit; }
.hm-pagina__error { margin: 0 .5rem .6rem; font-size: 12.5px; color: var(--hm-rojo); }

/* ---------- badges / asa / botones ---------- */
.hm-badge { display: inline-flex; align-items: center; gap: .3rem; border-radius: 999px; padding: .1rem .55rem; font-size: 11px; font-weight: 600; white-space: nowrap; }
.hm-badge--ok { background: var(--hm-ok-suave); color: var(--hm-ok); }
.hm-badge--espera { background: var(--hm-aviso-suave); color: var(--hm-aviso); }
.hm-badge--error { background: var(--hm-rojo-suave); color: var(--hm-rojo); }
.hm-badge--gris { background: #f1f5f9; color: var(--hm-gris); }
.hm-badge--editada { background: #ede9fe; color: #4c1d95; }
.hm-asa { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 26px; color: #cbd5e1; cursor: grab; flex: none; border-radius: 6px; }
.hm-asa:hover { color: var(--hm-gris); background: var(--hm-fondo); }
.hm-asa:active { cursor: grabbing; }
.hm-asa svg { width: 10px; height: 16px; fill: currentColor; }
.hm-btn { display: inline-flex; align-items: center; gap: .4rem; border-radius: 10px; padding: .5rem .9rem; font-weight: 600; font-size: 13.5px; border: 1px solid var(--hm-linea); background: #fff; color: var(--hm-tinta); white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; text-decoration: none; }
.hm-btn:hover { background: var(--hm-fondo); }
.hm-btn:active { transform: translateY(1px); }
.hm-btn:disabled { opacity: .55; cursor: default; transform: none; }
.hm-btn--primario { background: var(--hm-azul); border-color: var(--hm-azul); color: #fff; }
.hm-btn--primario:hover { background: #005f9e; }
.hm-btn--fantasma { border-style: dashed; color: var(--hm-azul); background: transparent; font-weight: 500; }
.hm-btn--fantasma:hover { background: var(--hm-azul-suave); border-color: var(--hm-azul); }
.hm-btn--xs { padding: .3rem .6rem; font-size: 12.5px; border-radius: 8px; }
.hm-btn--bloque { width: 100%; justify-content: center; }
.hm-ico-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; color: var(--hm-gris-suave); transition: background .15s, color .15s; flex: none; }
.hm-ico-btn:hover { background: var(--hm-azul-suave); color: var(--hm-azul); }
.hm-ico-btn--peligro:hover { background: var(--hm-rojo-suave); color: var(--hm-rojo); }
.hm-ico-btn svg { width: 17px; height: 17px; }
.hm-ico { width: 16px; height: 16px; flex: none; }
.hm-girando { animation: hm-girar 1s linear infinite; display: inline-flex; }
@keyframes hm-girar { to { transform: rotate(360deg); } }
.hm-spin { width: 22px; height: 22px; border: 3px solid #bfdbfe; border-top-color: var(--hm-azul); border-radius: 50%; animation: hm-girar 1s linear infinite; }
.hm-nota { font-size: 12px; color: var(--hm-gris); line-height: 1.45; }
.hm-nota--aviso { color: var(--hm-aviso); }
.hm-fantasma { opacity: .35; background: var(--hm-azul-suave) !important; border-radius: 10px; }
.hm-arrastrando { opacity: 1 !important; transform: rotate(-.5deg); }

/* ---------- panel lateral (vincular + subir) ---------- */
.hm-lateral { position: sticky; top: 4.5rem; display: flex; flex-direction: column; gap: 1rem; max-height: calc(100vh - 6rem); overflow: auto; }
.hm-bloque { background: #fff; border: 1px solid var(--hm-linea); border-radius: var(--hm-radio); padding: .9rem; display: grid; gap: .6rem; }
.hm-bloque__titulo { font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--hm-gris); display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.hm-qr { display: grid; justify-items: center; gap: .5rem; text-align: center; }
.hm-qr__marco { border: 1px solid var(--hm-linea); border-radius: 12px; padding: .5rem; background: #fff; }
.hm-qr__marco svg { width: 13rem; height: 13rem; display: block; }
.hm-qr__corta { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; color: var(--hm-azul); word-break: break-all; text-decoration: none; }
.hm-qr__corta:hover { text-decoration: underline; }
.hm-qr__tiempo { font-size: 12px; color: var(--hm-gris); }
.hm-qr__tiempo--vencido { color: var(--hm-rojo); font-weight: 600; }
.hm-zona { border: 2px dashed #cbd5e1; border-radius: 12px; padding: 1.1rem .75rem; text-align: center; color: var(--hm-gris); font-size: 13px; cursor: pointer; transition: border-color .15s, background .15s; line-height: 1.45; }
.hm-zona:hover { border-color: var(--hm-azul); background: var(--hm-azul-suave); color: var(--hm-azul); }
.hm-zona strong { color: var(--hm-azul); }
.hm-select { appearance: none; width: 100%; border: 1px solid var(--hm-linea); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2364748b'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.17l3.71-3.94a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E") no-repeat right .4rem center / 1rem; border-radius: 8px; padding: .4rem 1.6rem .4rem .6rem; font-size: 13px; }
.hm-select:focus { outline: none; border-color: var(--hm-azul); box-shadow: 0 0 0 3px rgba(0, 116, 194, .15); }
.hm-textarea { width: 100%; border: 1px solid var(--hm-linea); border-radius: 8px; padding: .4rem .6rem; font-size: 13px; resize: vertical; min-height: 4.5rem; }
.hm-textarea:focus { outline: none; border-color: var(--hm-azul); box-shadow: 0 0 0 3px rgba(0, 116, 194, .15); }
.hm-etq { font-size: 12px; font-weight: 600; color: var(--hm-gris); }

/* ---------- barra inferior ---------- */
.hm-barra { position: sticky; bottom: 0; z-index: 20; margin-top: 1rem; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); border: 1px solid var(--hm-linea); border-radius: var(--hm-radio); padding: .6rem .9rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.hm-barra__estado { display: inline-flex; align-items: center; gap: .45rem; font-size: 13px; color: var(--hm-gris); }
.hm-barra__punto { width: 9px; height: 9px; border-radius: 999px; background: var(--hm-ok); }
.hm-barra__punto--espera { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, .2); }
.hm-barra__punto--nada { background: #cbd5e1; }
.hm-barra__botones { margin-left: auto; display: inline-flex; gap: .5rem; }

/* ---------- drawer lateral (foto en grande) ---------- */
.hm-telon { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 70; }
.hm-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(62rem, 96vw); background: #fff; z-index: 71; display: grid; grid-template-rows: auto minmax(0, 1fr); box-shadow: -12px 0 40px rgba(15, 23, 42, .25); }
.hm-drawer__cab { display: flex; align-items: center; gap: .5rem; padding: .7rem .9rem; border-bottom: 1px solid var(--hm-linea); }
.hm-drawer__titulo { font-weight: 700; font-size: 15px; }
.hm-drawer__botones { margin-left: auto; display: inline-flex; gap: .2rem; align-items: center; }
.hm-drawer__cuerpo { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); min-height: 0; }
@media (max-width: 900px) { .hm-drawer__cuerpo { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; } }
.hm-drawer__visor { background: #0f172a; overflow: auto; position: relative; display: flex; align-items: flex-start; justify-content: center; }
.hm-drawer__visor img { max-width: 100%; display: block; transition: transform .15s; transform-origin: top center; cursor: zoom-in; }
.hm-drawer__visor img.hm-zoom { max-width: none; width: 180%; cursor: zoom-out; }
.hm-drawer__lado { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--hm-linea); }
.hm-drawer__lado-cab { padding: .6rem .9rem; border-bottom: 1px solid var(--hm-linea); display: flex; align-items: center; gap: .5rem; font-size: 13px; color: var(--hm-gris); }
.hm-drawer__texto { flex: 1; width: 100%; border: 0; padding: .9rem; font-size: 13.5px; line-height: 1.55; color: #334155; resize: none; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; min-height: 0; }
.hm-drawer__texto:focus { outline: none; background: #fbfdff; }
.hm-drawer__pie { padding: .6rem .9rem; border-top: 1px solid var(--hm-linea); display: flex; gap: .5rem; align-items: center; font-size: 12.5px; color: var(--hm-gris); }

/* ---------- toast ---------- */
.hm-toast { position: fixed; left: 50%; bottom: 5.5rem; transform: translateX(-50%); z-index: 80; background: var(--hm-tinta); color: #fff; border-radius: 12px; padding: .6rem .9rem; font-size: 13px; display: flex; align-items: center; gap: .75rem; box-shadow: 0 10px 30px rgba(15, 23, 42, .3); }
.hm-toast button { border: 0; background: rgba(255, 255, 255, .14); color: #fff; border-radius: 8px; padding: .3rem .6rem; font-weight: 600; }
.hm-toast button:hover { background: rgba(255, 255, 255, .24); }
