/* Shared page preview for recortar / tarjar PDF */
.ppdf-workspace { margin-top: 12px; }
.ppdf-workspace[hidden] { display: none !important; }
.ppdf-page-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
}
.ppdf-page-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--dica-ink);
  min-width: 7.5rem;
}
.ppdf-preview-wrap {
  position: relative;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--dica-border);
  border-radius: 12px;
  background: #e8ebf0;
  padding: 10px;
  display: flex;
  justify-content: center;
}
html[data-theme="dark"] .ppdf-preview-wrap { background: #1a1f2a; }
.ppdf-page-stage {
  position: relative;
  display: inline-block;
  box-shadow: 0 4px 18px rgba(16, 24, 40, 0.12);
  line-height: 0;
  touch-action: none;
}
.ppdf-page-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  background: #fff;
}
.ppdf-crop-box {
  position: absolute;
  border: 2px solid var(--dica-action, #1b4f9c);
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.42);
  box-sizing: border-box;
  cursor: move;
  touch-action: none;
}
.ppdf-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #fff;
  border: 2px solid var(--dica-action, #1b4f9c);
  border-radius: 2px;
  box-sizing: border-box;
  z-index: 2;
}
.ppdf-handle.nw { left: -6px; top: -6px; cursor: nwse-resize; }
.ppdf-handle.n { left: 50%; top: -6px; margin-left: -6px; cursor: ns-resize; }
.ppdf-handle.ne { right: -6px; top: -6px; cursor: nesw-resize; }
.ppdf-handle.e { right: -6px; top: 50%; margin-top: -6px; cursor: ew-resize; }
.ppdf-handle.se { right: -6px; bottom: -6px; cursor: nwse-resize; }
.ppdf-handle.s { left: 50%; bottom: -6px; margin-left: -6px; cursor: ns-resize; }
.ppdf-handle.sw { left: -6px; bottom: -6px; cursor: nesw-resize; }
.ppdf-handle.w { left: -6px; top: 50%; margin-top: -6px; cursor: ew-resize; }
.ppdf-redact-layer {
  position: absolute;
  inset: 0;
  cursor: crosshair;
  touch-action: none;
}
.ppdf-redact-rect {
  position: absolute;
  background: #111;
  border: 1px solid #000;
  box-sizing: border-box;
  cursor: pointer;
}
.ppdf-redact-rect.is-drawing {
  background: rgba(17, 17, 17, 0.72);
  border: 1px dashed #fff;
  pointer-events: none;
}
.ppdf-redact-rect.is-selected {
  outline: 2px solid #fbbf24;
}
.ppdf-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.ppdf-thumb {
  border: 1px solid var(--dica-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--dica-surface);
  display: flex;
  flex-direction: column;
}
.ppdf-thumb img {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: contain;
  background: #f1f5f9;
}
html[data-theme="dark"] .ppdf-thumb img { background: #111827; }
.ppdf-thumb-meta {
  padding: 8px 10px 10px;
  font-size: 0.78rem;
  color: var(--dica-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ppdf-thumb-name {
  font-weight: 700;
  color: var(--dica-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ppdf-mm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 640px) {
  .ppdf-handle { width: 16px; height: 16px; }
  .ppdf-handle.nw, .ppdf-handle.sw { left: -8px; }
  .ppdf-handle.ne, .ppdf-handle.se { right: -8px; }
  .ppdf-handle.nw, .ppdf-handle.ne { top: -8px; }
  .ppdf-handle.sw, .ppdf-handle.se { bottom: -8px; }
}
