@layer layout {
/* reportes.css — Reportes de la beta (core/js/reportes/). Sólo tokens de themes.css: claro y oscuro.
   Niveles: el editor es un diálogo a pantalla completa (marco + lienzo + hoja); el panel usa la hoja. */

/* ── Editor ─────────────────────────────────────────────────────────────── */
.rep-editor {
  position: fixed; inset: 0; z-index: var(--z-overlay);
  display: grid; grid-template-columns: minmax(0, 1fr) 380px;
  background: var(--color-shell); color: var(--color-text);
}
.rep-editor__lienzo { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: var(--space-3); gap: var(--space-3); }
.rep-bar { flex-wrap: wrap; }
.rep-stage { flex: 1; min-height: 0; display: grid; place-items: center; overflow: auto; background: var(--color-content); border: 1px solid var(--color-border); border-radius: var(--radius-container); padding: var(--space-3); } /* zona de la captura */
.rep-stage__caja { position: relative; max-width: 100%; max-height: 100%; line-height: var(--line-height-tight); box-shadow: var(--shadow-float); border-radius: var(--radius-control); overflow: hidden; }
.rep-stage__caja canvas { display: block; max-width: 100%; max-height: calc(100vh - 150px); width: auto; height: auto; }
.rep-stage__marcas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; max-height: none !important; touch-action: none; }
.rep-stage[data-modo="rect"] .rep-stage__marcas, .rep-stage[data-modo="flecha"] .rep-stage__marcas, .rep-stage[data-modo="lapiz"] .rep-stage__marcas { cursor: crosshair; }
.rep-stage[data-modo="num"] .rep-stage__marcas { cursor: copy; }
.rep-stage__vacio { text-align: center; }
.rep-stage__vacio svg { width: 28px; height: 28px; }

.rep-editor__form { display: flex; flex-direction: column; min-height: 0; background: var(--color-surface); border-left: 1px solid var(--color-border); box-shadow: var(--shadow-panel); }
.rep-form__head { display: flex; align-items: center; justify-content: space-between; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-border); }
.rep-form__body { flex: 1; min-height: 0; overflow-y: auto; padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-4); }
.rep-form__foot { display: flex; justify-content: flex-end; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-top: 1px solid var(--color-border); }

/* Modo «Señalar un elemento» */
.rep-pick { position: fixed; z-index: calc(var(--z-overlay) + 1); pointer-events: none; border: 2px solid var(--color-accent); background: color-mix(in srgb, var(--color-accent) 14%, transparent); border-radius: calc(var(--radius-control) / 2); transition: all 60ms linear; }
.rep-pick__tip { position: fixed; z-index: calc(var(--z-overlay) + 1); left: 50%; bottom: 20px; transform: translateX(-50%); padding: 8px var(--space-4); border-radius: var(--radius-pill); background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); box-shadow: var(--shadow-float); font-size: var(--font-size-sm); pointer-events: none; }

/* ── Panel «Mis reportes» ───────────────────────────────────────────────── */
.rep-panel { padding: var(--space-4); }
.rep-seg { display: flex; }
.rep-seg .segmented__btn { flex: 1; justify-content: center; }
.rep-seg--panel { margin-bottom: var(--space-3); }
.rep-det pre { max-height: 220px; overflow: auto; margin: var(--space-2) 0 0; white-space: pre-wrap; word-break: break-word; }
.rep-confirm { flex-wrap: wrap; align-items: center; }
.rep-confirm .alert__text { flex: 1 1 100%; }
.rep-detalle__top { display: flex; align-items: center; justify-content: space-between; }
.rep-hilo { display: flex; flex-direction: column; gap: var(--space-2); }
.rep-captura { display: block; width: 100%; padding: 0; overflow: hidden; cursor: zoom-in; }
.rep-captura img { display: block; width: 100%; height: auto; }
.rep-captura__vacio { display: block; padding: var(--space-4); }
.rep-visor { display: grid; place-items: center; z-index: calc(var(--z-overlay) + 2); padding: var(--space-6); cursor: zoom-out; }
.rep-visor img { max-width: 100%; max-height: 100%; }
.rep-visor .btn-icon { position: absolute; top: 12px; right: 12px; }

.rep-detalle { display: flex; flex-direction: column; gap: var(--space-3); }

@media (prefers-reduced-motion: reduce) { .rep-pick { transition: none; } }

/* ── Angosto: la imagen arriba y el formulario abajo ────────────────────── */
@media (max-width: 900px) {
  .rep-editor { grid-template-columns: 1fr; grid-template-rows: minmax(0, 42vh) minmax(0, 1fr); overflow: hidden; }
  .rep-editor__form { border-left: 0; border-top: 1px solid var(--color-border); }
  .rep-stage__caja canvas { max-height: calc(42vh - 110px); }
  .rep-bar .segmented__btn span { display: none; }
}

/* Mientras se saca la captura el botón del header gira */
.btn-icon.rep-busy svg { animation: rep-giro 1s linear infinite; }
@keyframes rep-giro { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn-icon.rep-busy svg { animation: none; opacity: .5; } }
} /* @layer layout */
