/* Operator performance reports: page layouts, switch, timeline,
   spinners, dialog, toast and the sidebar group.
   Every rule is scoped under .perf-reports. Stylesheet order (index.html):
   performance-reports, -controls, -layout, -document, -pages. */

/* Layouts */
.perf-reports .pr-two,
.perf-reports .pr-gen,
.perf-reports .pr-pv,
.perf-reports .pr-ru-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
}
.perf-reports .pr-main {
  flex: 999 1 620px;
  min-width: 0;
}
.perf-reports .pr-side,
.perf-reports .pr-pv-side,
.perf-reports .pr-ru-side {
  flex: 1 1 300px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.perf-reports .pr-gen-form {
  flex: 1 1 360px;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.perf-reports .pr-gen-form .pr-seg {
  display: flex;
}
.perf-reports .pr-gen-form .pr-seg button {
  flex: 1;
  padding: 0 6px;
}
.perf-reports .pr-gen-form .pr-dates .pr-field {
  flex: 1;
  min-width: 140px;
  width: auto;
}
.perf-reports .pr-gen-form .pr-period-field {
  width: auto;
}
.perf-reports .pr-gen-data {
  flex: 999 1 560px;
}
.perf-reports .pr-gen-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--pr-muted);
  text-align: left;
}
.perf-reports .pr-gen-steps li.done {
  color: var(--pr-g);
  font-weight: 600;
}
.perf-reports .pr-pv-doc {
  flex: 999 1 640px;
  min-width: 0;
}
.perf-reports .pr-ru-main {
  flex: 999 1 640px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.perf-reports .pr-act-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Switch, steps, timeline */
.perf-reports .pr-switch {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  justify-content: center;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.perf-reports .pr-switch:hover {
  background: none;
}
.perf-reports .pr-switch[disabled] {
  cursor: not-allowed;
  opacity: 0.6;
}
.perf-reports .pr-switch-track {
  width: 42px;
  height: 24px;
  border-radius: 12px;
  background: var(--pr-line);
  position: relative;
  flex: none;
  transition: background-color 0.16s;
}
.perf-reports .pr-switch-track i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: left 0.2s;
}
.perf-reports .pr-switch.on .pr-switch-track {
  background: var(--pr-g);
}
.perf-reports .pr-switch.on .pr-switch-track i {
  left: 21px;
}
.perf-reports .pr-tl,
.perf-reports .pr-versions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
}
.perf-reports .pr-tl li {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
}
.perf-reports .pr-tl li::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 4px;
  background: var(--pr-line);
}
.perf-reports .pr-tl li.done::before {
  background: var(--pr-g);
}
.perf-reports .pr-tl li.now::before {
  background: var(--pr-accent);
}
.perf-reports .pr-tl li.bad::before {
  background: var(--pr-r);
}
.perf-reports .pr-tl small,
.perf-reports .pr-versions small {
  display: block;
  color: var(--pr-muted);
  font-size: 12px;
}
.perf-reports .pr-versions {
  font-size: 12px;
  gap: 12px;
}

/* Spinners */
.perf-reports .pr-spin,
.perf-reports .pr-ring {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--pr-sunken);
  border-top-color: var(--pr-accent);
  animation: pr-spin 0.8s linear infinite;
  display: inline-block;
}
.perf-reports .pr-ring {
  width: 44px;
  height: 44px;
}
.perf-reports .pr-spin.sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}
.perf-reports .pr-ok {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--pr-g-tint);
  color: var(--pr-g);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.perf-reports .pr-ok svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@keyframes pr-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .perf-reports .pr-spin,
  .perf-reports .pr-ring {
    animation-duration: 2.4s;
  }
  .perf-reports .pr-btn {
    transition: none;
  }
}

/* Dialog */
/* Native modal <dialog>: the page behind it is inert. */
dialog.perf-reports.pr-modal {
  padding: 0;
  border: 0;
  background: transparent;
  width: calc(100% - 32px);
  max-width: 560px;
  max-height: calc(100vh - 32px);
  overflow: visible;
}
dialog.perf-reports.pr-modal::backdrop {
  background: rgba(22, 20, 18, 0.5);
}
.perf-reports .pr-dialog {
  background: var(--pr-surface);
  border-radius: 18px;
  width: 100%;
  max-width: 560px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--pr-shadow-2);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}
.perf-reports .pr-dialog h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.perf-reports .pr-delivery-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
}
.perf-reports .pr-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.perf-reports .pr-email-pv {
  border: 1px solid var(--pr-line);
  border-radius: 12px;
  overflow: hidden;
}
.perf-reports .pr-email-pv .eh {
  padding: 10px 14px;
  background: var(--pr-surface-2);
  border-bottom: 1px solid var(--pr-line-soft);
  font-size: 12.5px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 4px 8px;
}
.perf-reports .pr-email-pv .eh > span:nth-child(odd) {
  color: var(--pr-muted);
  font-weight: 600;
}
.perf-reports .pr-email-pv .eb {
  padding: 14px;
  font-size: 13px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.perf-reports .pr-thumb {
  width: 72px;
  height: 94px;
  border-radius: 8px;
  flex: none;
  border: 1px solid var(--pr-line-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  background: #fff;
}
.perf-reports .pr-thumb i {
  display: block;
  border-radius: 2px;
  height: 4px;
  background: var(--pr-line-soft);
}
.perf-reports .pr-thumb i:first-child {
  height: 6px;
  width: 60%;
  background: var(--pr-ink);
}
.perf-reports .pr-thumb i:nth-child(2) {
  height: 22px;
  background: var(--pr-band-tint, var(--pr-sunken));
}
.perf-reports .pr-sent {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 8px 0;
  font-size: 13px;
}
.perf-reports .pr-delivery {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Toast (attached to body) */
.pr-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  background: #1c1917;
  color: #fff;
  border-radius: 10px;
  padding: 11px 16px;
  font:
    600 13.5px/1.4 "Montserrat",
    system-ui,
    sans-serif;
  z-index: 60;
  box-shadow: 0 24px 60px -24px rgba(28, 25, 23, 0.35);
}
.pr-toast.error {
  background: #b42318;
}
.pr-toast[hidden] {
  display: none;
}

/* Sidebar group (inside the existing Platform Control sidebar) */
.sidebar .perf-nav-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 9px;
  background: #e84a2e;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.sidebar .perf-nav-count[hidden] {
  display: none;
}
