/* Optiges PDF viewer — Documents + future Formulaires / annotations */

.opv-root {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.82);
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  color: #e2e8f0;
}

.opv-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #0b1220;
  border-bottom: 1px solid #1e293b;
  flex-shrink: 0;
}

.opv-bar .opv-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #f8fafc;
  max-width: min(42vw, 420px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 4px;
}

.opv-bar button,
.opv-bar .opv-chip {
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
}

.opv-bar button:hover:not(:disabled) {
  background: #334155;
}

.opv-bar button:disabled {
  opacity: 0.4;
  cursor: default;
}

.opv-bar button.opv-active {
  background: #0078d4;
  border-color: #0078d4;
  color: #fff;
}

.opv-bar .opv-sep {
  width: 1px;
  height: 20px;
  background: #334155;
  margin: 0 4px;
}

.opv-bar .opv-meta {
  font-size: 0.75rem;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
  min-width: 4.5rem;
  text-align: center;
}

.opv-bar .opv-grow {
  flex: 1;
}

.opv-stage {
  flex: 1;
  overflow: auto;
  position: relative;
  background: #1a2332;
  overscroll-behavior: contain;
  cursor: grab;
}

.opv-stage.opv-panning {
  cursor: grabbing;
}

.opv-stage.opv-tool-draw {
  cursor: crosshair;
}

.opv-pages {
  margin: 0 auto;
  padding: 16px 12px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 100%;
  width: max-content;
  max-width: 100%;
  box-sizing: border-box;
}

.opv-page {
  position: relative;
  background: #0f172a;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

.opv-page canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #fff;
}

.opv-page .opv-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #64748b;
  font-size: 0.8rem;
  pointer-events: none;
  background: #f1f5f9;
}

.opv-page .opv-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.opv-page .opv-overlay .opv-hit {
  pointer-events: auto;
  cursor: pointer;
}

.opv-overlay .opv-pin-chip,
.opv-overlay .opv-label {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  fill: #0f172a;
  paint-order: stroke fill;
  stroke: #fff;
  stroke-width: 3px;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.opv-overlay .opv-shape {
  vector-effect: non-scaling-stroke;
  stroke-width: 2;
  fill-opacity: 0.35;
}

.opv-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  background: #0b1220;
  border-top: 1px solid #1e293b;
  font-size: 0.72rem;
  color: #94a3b8;
  flex-shrink: 0;
}

.opv-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.55);
  z-index: 2;
  font-size: 0.9rem;
  font-weight: 600;
  pointer-events: none;
}

.opv-err {
  color: #fecaca;
  padding: 24px;
  text-align: center;
}
