/* 3. Сводка, фильтры, карточки тестов. Порядок файлов менять нельзя: следующий перекрывает предыдущий. */
/* Общая статистика — счётчики без клика */
.general-stats-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.general-stats-cube {
  position: relative;
  padding: 10px 10px 8px;
  border-radius: 10px;
  border: 1px solid var(--border-light, #e2e8f0);
  background: var(--surface, #fff);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

button.general-stats-cube {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

button.general-stats-cube:hover:not(:disabled) {
  border-color: #94a3b8;
}

button.general-stats-cube.is-selected {
  border-color: #0f172a;
  box-shadow: inset 0 0 0 1px #0f172a;
}

button.general-stats-cube:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

button.general-stats-cube:disabled {
  cursor: default;
}

.general-stats-cube::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 14px 14px 0 0;
  opacity: 0.85;
}

.general-stats-cube--total::before {
  background: #64748b;
}

.general-stats-cube--ready::before {
  background: #16a34a;
}

.general-stats-cube--not-ready::before {
  background: #dc2626;
}

.general-stats-cube--not-started::before {
  background: #94a3b8;
}

.general-stats-cube--no-result::before {
  background: #64748b;
}

.general-stats-cube--in-progress::before {
  background: #d97706;
}

.general-stats-cube--abandoned::before {
  background: #9333ea;
}

.general-stats-value {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 2px;
}

.general-stats-cube--total .general-stats-value {
  color: var(--text, #0f172a);
}

.general-stats-cube--ready .general-stats-value {
  color: #15803d;
}

.general-stats-cube--not-ready .general-stats-value {
  color: #b91c1c;
}

.general-stats-cube--not-started .general-stats-value,
.general-stats-cube--no-result .general-stats-value {
  color: #64748b;
}

.status-no-result {
  color: #64748b;
  font-weight: 650;
}

.general-stats-cube--in-progress .general-stats-value {
  color: #d97706;
}

.general-stats-cube--abandoned .general-stats-value {
  color: #9333ea;
}

.general-stats-label {
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--text-secondary, #64748b);
}

@media (max-width: 1100px) {
  .general-stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .general-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

html.dark .general-stats-cube {
  background: rgba(45, 47, 49, 0.75);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

html.dark button.general-stats-cube.is-selected {
  border-color: #e2e8f0;
  box-shadow: inset 0 0 0 1px #e2e8f0;
}

.general-stats-name {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: min(100%, 280px);
  max-width: 360px;
}

.general-stats-name input {
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border-light, #e2e8f0);
  background: var(--surface, #fff);
  padding: 0 12px;
  font: inherit;
  color: inherit;
}

html.dark .general-stats-name input {
  background: rgba(45, 47, 49, 0.75);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
}

html.dark .general-stats-cube--total .general-stats-value {
  color: #e2e8f0;
}

html.dark .general-stats-cube--ready .general-stats-value {
  color: #4ade80;
}

html.dark .general-stats-cube--not-ready .general-stats-value {
  color: #f87171;
}

html.dark .general-stats-cube--not-started .general-stats-value {
  color: #94a3b8;
}

html.dark .general-stats-label {
  color: #94a3b8;
}

.general-stats-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.general-stats-status-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  min-height: 44px;
  min-width: 0;
}

.stats-chip-filter {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.stats-chip-filter:hover {
  border-color: rgba(100, 116, 139, 0.55);
  background: rgba(255, 255, 255, 0.92);
}

.stats-chip-filter input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.stats-chip-filter-box {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 2px solid rgba(100, 116, 139, 0.45);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.stats-chip-filter-box::after {
  content: "";
  width: 5px;
  height: 9px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg) scale(0);
  margin-top: -2px;
  transition: transform 0.12s ease;
}

.stats-chip-filter-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text, #0f172a);
}

.stats-chip-filter--passed:has(input:checked) {
  border-color: rgba(21, 128, 61, 0.45);
  background: rgba(21, 128, 61, 0.08);
  box-shadow: inset 0 0 0 1px rgba(21, 128, 61, 0.12);
}

.stats-chip-filter--passed:has(input:checked) .stats-chip-filter-box {
  border-color: #15803d;
  background: #15803d;
}

.stats-chip-filter--passed:has(input:checked) .stats-chip-filter-text {
  color: #14532d;
}

.stats-chip-filter--not-passed:has(input:checked) {
  border-color: rgba(185, 28, 28, 0.45);
  background: rgba(185, 28, 28, 0.08);
  box-shadow: inset 0 0 0 1px rgba(185, 28, 28, 0.12);
}

.stats-chip-filter--not-passed:has(input:checked) .stats-chip-filter-box {
  border-color: #b91c1c;
  background: #b91c1c;
}

.stats-chip-filter--not-passed:has(input:checked) .stats-chip-filter-text {
  color: #7f1d1d;
}

.stats-chip-filter--not-started:has(input:checked) {
  border-color: rgba(100, 116, 139, 0.55);
  background: rgba(100, 116, 139, 0.1);
  box-shadow: inset 0 0 0 1px rgba(100, 116, 139, 0.14);
}

.stats-chip-filter--not-started:has(input:checked) .stats-chip-filter-box {
  border-color: #64748b;
  background: #64748b;
}

.stats-chip-filter--not-started:has(input:checked) .stats-chip-filter-text {
  color: #334155;
}

.stats-chip-filter:has(input:checked) .stats-chip-filter-box::after {
  transform: rotate(45deg) scale(1);
}

.stats-chip-filter:has(input:focus-visible) {
  outline: 2px solid rgba(30, 107, 75, 0.45);
  outline-offset: 2px;
}

html.dark .stats-chip-filter {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

html.dark .stats-chip-filter:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.07);
}

html.dark .stats-chip-filter-box {
  border-color: rgba(148, 163, 184, 0.55);
}

html.dark .stats-chip-filter-text {
  color: #e2e8f0;
}

html.dark .stats-chip-filter--passed:has(input:checked) {
  border-color: rgba(74, 222, 128, 0.45);
  background: rgba(74, 222, 128, 0.1);
}

html.dark .stats-chip-filter--passed:has(input:checked) .stats-chip-filter-text {
  color: #bbf7d0;
}

html.dark .stats-chip-filter--not-passed:has(input:checked) {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.1);
}

html.dark .stats-chip-filter--not-passed:has(input:checked) .stats-chip-filter-text {
  color: #fecaca;
}

html.dark .stats-chip-filter--not-started:has(input:checked) {
  border-color: rgba(148, 163, 184, 0.5);
  background: rgba(148, 163, 184, 0.12);
}

html.dark .stats-chip-filter--not-started:has(input:checked) .stats-chip-filter-text {
  color: #cbd5e1;
}

.general-stats-panel {
  max-width: none;
}

.general-stats-table-wrap {
  margin-top: 8px;
}

.general-stats-workers-table {
  width: 100%;
  min-width: 640px;
  table-layout: fixed;
}

.general-stats-workers-table .col-name {
  width: 28%;
}

.general-stats-workers-table .col-department {
  width: 24%;
}

.general-stats-workers-table .col-position {
  width: 24%;
}

.general-stats-workers-table .col-status {
  width: 24%;
}

.general-stats-workers-table th,
.general-stats-workers-table td {
  padding: 12px 14px;
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
}

.general-stats-workers-table .col-status {
  line-height: 1.45;
}

.general-stats-cube--placeholder .general-stats-value {
  color: var(--text-secondary, #94a3b8);
}

.general-stats-pass-threshold {
  color: #15803d;
  font-weight: 600;
}

html.dark .general-stats-pass-threshold {
  color: #4ade80;
}

.general-stats-workers-table tbody tr:not(:last-child) td {
  border-bottom: 1px solid var(--border-light, #e2e8f0);
}

html.dark .general-stats-workers-table tbody tr:not(:last-child) td {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.status-not-started {
  color: var(--text-secondary, #64748b);
}

html.dark .status-not-started {
  color: #94a3b8;
}

.test-card-retake-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: clamp(0.8rem, 2.5vw, 0.88rem);
  line-height: 1.45;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  color: #334155;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.28);
}

.test-card-retake-notice__icon {
  flex-shrink: 0;
  line-height: 1.3;
  color: #dc2626;
}

.test-card-retake-notice__text {
  flex: 1;
  min-width: 0;
}

.test-card-retake-notice strong {
  color: #0f172a;
  font-weight: 700;
}

html.dark .test-card-retake-notice {
  color: #cbd5e1;
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.22);
}

html.dark .test-card-retake-notice__icon {
  color: #f87171;
}

html.dark .test-card-retake-notice strong {
  color: #f8fafc;
}

.topbar-actions {
  display: flex;
  flex-wrap: nowrap;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.topbar-actions .btn {
  white-space: nowrap;
  text-decoration: none;
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions {
    flex-wrap: wrap;
    justify-content: stretch;
  }

  .topbar-actions .btn {
    flex: 1 1 auto;
    text-align: center;
  }}

.btn-card-action {
  display: block;
  width: 100%;
  margin-top: 14px;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}

body input[type="file"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background-color: var(--input-bg);
  color: var(--text);
  font-family: inherit;
}

.field-required {
  color: #f87171;
}

body textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background-color: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  min-height: 100px;
}

body textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(76, 183, 130, 0.2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.btn:active {
  opacity: 0.9;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(30, 107, 75, 0.15);
  transition: all 0.2s ease !important;
}

.btn-primary:hover {
  background: var(--accent-2);
  box-shadow: 0 6px 16px rgba(30, 107, 75, 0.3) !important;
}

.btn-secondary {
  background: rgba(214, 229, 220, 0.5) !important;
  color: #17563c !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  transition: all 0.2s ease !important;
  box-shadow: none !important;
}

.btn-secondary:hover {
  background: rgba(214, 229, 220, 0.7) !important;
  color: #17563c !important;
}

.spvt-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(4px);
}

dialog.spvt-confirm-overlay {
  border: none;
  margin: 0;
  padding: 20px;
  max-width: 100vw;
  max-height: 100vh;
  width: 100%;
  height: 100%;
  background: transparent;
  color: inherit;
  overflow: visible;
}

dialog.spvt-confirm-overlay:not([open]) {
  display: none;
}

dialog.spvt-confirm-overlay[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

dialog.spvt-confirm-overlay::backdrop {
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(4px);
}

.spvt-confirm-dialog.spvt-publish-dialog {
  width: min(760px, 94vw);
}

.spvt-publish-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(240px, 0.9fr);
  gap: 20px;
  margin-top: 8px;
}

.spvt-publish-side h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.spvt-publish-depts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

.spvt-publish-dept {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  color: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}

.spvt-publish-dept input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent, #4cb782);
}

.spvt-publish-facts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.spvt-publish-fact {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.spvt-publish-fact span {
  color: var(--muted, #94a3b8);
}

.spvt-publish-note {
  min-height: 2.6em;
  margin: 0 0 12px;
  color: var(--muted, #94a3b8);
  font-size: 0.9rem;
}

@media (max-width: 720px) {
  .spvt-publish-grid {
    grid-template-columns: 1fr;
  }
}

.spvt-confirm-dialog {
  width: min(440px, 100%);
  padding: 24px;
  border-radius: 16px;
  border: var(--dialog-border);
  background: var(--dialog-bg);
  box-shadow: var(--dialog-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.spvt-confirm-dialog--even-out {
  width: min(520px, 100%);
}

.ticket-even-out-field {
  margin: 0 0 12px;
}

.ticket-even-out-field .spvt-confirm-prompt--line {
  max-width: 160px;
}

.spvt-confirm-dialog input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
.spvt-confirm-dialog select,
.spvt-confirm-dialog textarea,
.personnel-dialog input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
.personnel-dialog select,
.personnel-dialog textarea {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  min-height: 44px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--input-border, var(--border));
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
  -webkit-appearance: none;
  appearance: none;
}

.spvt-confirm-dialog select,
.personnel-dialog select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394a3b8' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.spvt-confirm-dialog textarea,
.personnel-dialog textarea {
  min-height: 96px;
  resize: vertical;
}

.spvt-confirm-dialog input[type="number"],
.personnel-dialog input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.spvt-confirm-dialog .form-field,
.personnel-dialog .form-field {
  margin-bottom: 16px;
}

.spvt-confirm-dialog input:disabled,
.personnel-dialog input:disabled,
.spvt-confirm-dialog select:disabled,
.personnel-dialog select:disabled,
.spvt-confirm-dialog textarea:disabled,
.personnel-dialog textarea:disabled {
  background: rgba(148, 163, 184, 0.16) !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
  color: var(--muted) !important;
  cursor: not-allowed;
  box-shadow: none !important;
  opacity: 1;
}

html.dark .spvt-confirm-dialog input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
html.dark .spvt-confirm-dialog select,
html.dark .spvt-confirm-dialog textarea,
html.dark .personnel-dialog input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
html.dark .personnel-dialog select,
html.dark .personnel-dialog textarea {
  background-color: var(--input-bg) !important;
  border-color: var(--input-border, var(--border)) !important;
  color: var(--text) !important;
}

html.dark .spvt-confirm-dialog input:disabled,
html.dark .personnel-dialog input:disabled,
html.dark .spvt-confirm-dialog select:disabled,
html.dark .personnel-dialog select:disabled,
html.dark .spvt-confirm-dialog textarea:disabled,
html.dark .personnel-dialog textarea:disabled {
  background: rgba(51, 65, 85, 0.55) !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
  color: var(--muted) !important;
}

.spvt-confirm-title {
  margin: 0 0 12px;
  font-size: 1.2rem;
  color: var(--dialog-title);
}

.spvt-confirm-message {
  margin: 0 0 20px;
  color: var(--dialog-message);
  font-size: 0.95rem;
  line-height: 1.55;
}

.spvt-confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.spvt-confirm-actions .btn {
  min-width: 120px;
}

.spvt-confirm-actor {
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: var(--dialog-message);
}

.spvt-confirm-field-label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--dialog-title);
}

.spvt-confirm-prompt {
  width: 100%;
  min-height: 88px;
  margin: 0 0 6px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--outline, #747878);
  background: var(--surface, #fff);
  color: inherit;
  resize: vertical;
}

.spvt-confirm-prompt--line {
  min-height: 0;
  height: 44px;
  resize: none;
}

.spvt-wipe-download {
  width: 100%;
  margin: 0 0 14px;
}

.spvt-wipe-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 16px;
  font-size: 0.92rem;
  line-height: 1.4;
  cursor: pointer;
}

.spvt-wipe-check input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.spvt-wipe-status {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

.spvt-wipe-status.is-ok {
  color: var(--success, #059669);
}

.spvt-wipe-status.is-err {
  color: var(--danger-text);
}

.backups-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.backups-row-actions .btn {
  min-width: 0;
  width: auto;
  padding: 8px 14px;
}

.spvt-confirm-field-hint {
  margin: 0 0 16px;
  font-size: 0.8rem;
  color: var(--muted);
}

.test-ready {
  text-align: center;
  padding: 28px 22px;
}

.test-ready__eyebrow {
  margin: 0 0 8px;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.test-ready__title {
  margin: 0 0 10px;
  font-size: 1.35rem;
}

.test-ready__lead {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.5;
}

.test-ready__facts {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  text-align: left;
}

.test-ready__facts li {
  position: relative;
  padding: 8px 0 8px 22px;
  border-bottom: 1px solid var(--surface-2, rgba(148, 163, 184, 0.2));
  line-height: 1.45;
}

.test-ready__facts li::before {
  content: "•";
  position: absolute;
  left: 6px;
  color: var(--accent, #4cb782);
}

.test-ready__note {
  margin: 0 0 20px;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
  text-align: left;
}

.test-ready__actions .btn-block + .btn-block {
  margin-top: 10px;
}

.spvt-confirm-details {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.spvt-confirm-details__row {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 8px 12px;
  padding: 6px 0;
}

.spvt-confirm-details__row:not(:last-child) {
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.spvt-confirm-details__row dt {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
  font-weight: 500;
}

.spvt-confirm-details__row dd {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--dialog-title);
  font-weight: 600;
}

.spvt-confirm-compare {
  max-height: min(40vh, 280px);
  overflow: auto;
}

.spvt-confirm-compare__head,
.spvt-confirm-compare__row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(72px, 1fr) minmax(72px, 1fr);
  gap: 8px;
  align-items: center;
}

.spvt-confirm-compare__head {
  padding: 0 0 8px;
  margin-bottom: 2px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.spvt-confirm-compare__head span:not(:first-child),
.spvt-confirm-compare__from,
.spvt-confirm-compare__to {
  text-align: right;
}

.spvt-confirm-compare__row {
  padding: 8px 0;
}

.spvt-confirm-compare__row:not(:last-child) {
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.spvt-confirm-compare__label {
  min-width: 0;
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 500;
}

.spvt-confirm-compare__from {
  font-size: 0.875rem;
  color: var(--muted);
}

.spvt-confirm-compare__to {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--dialog-title);
}

.spvt-confirm-compare__row--changed .spvt-confirm-compare__to {
  color: #2f9e6e;
}

html.dark .spvt-confirm-compare__row--changed .spvt-confirm-compare__to {
  color: #8fd6b2;
}

.spvt-confirm-compare__row--removed .spvt-confirm-compare__to {
  color: #dc2626;
}

html.dark .spvt-confirm-compare__row--removed .spvt-confirm-compare__to {
  color: #f87171;
}

.spvt-publish-dialog {
  max-width: 520px;
}

.spvt-publish-test-name {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--dialog-title);
}

.spvt-publish-lead {
  margin: 0 0 14px;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text);
}

.spvt-publish-hint {
  margin: 0 0 16px;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--muted);
}

.spvt-publish-details {
  margin-bottom: 14px;
}

.spvt-confirm-details__row--warn dd {
  color: #b45309;
}

html.dark .spvt-confirm-details__row--warn dd {
  color: #fbbf24;
}

.spvt-publish-warn-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  vertical-align: middle;
  color: #92400e;
  background: rgba(245, 158, 11, 0.18);
}

html.dark .spvt-publish-warn-tag {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.22);
}

.spvt-confirm-dialog:has(.spvt-confirm-move) {
  width: min(560px, 100%);
}

@media (max-width: 540px) {
  .spvt-confirm-move {
    grid-template-columns: 1fr;
  }

  .spvt-confirm-move__arrow {
    transform: rotate(90deg);
  }

  .spvt-confirm-details__row {
    grid-template-columns: 1fr;
    gap: 4px;
  }}

.spvt-confirm-move {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: stretch;
  margin: 0 0 20px;
}

.spvt-confirm-move__col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(76, 183, 130, 0.08);
  border: 1px solid rgba(76, 183, 130, 0.22);
}

.spvt-confirm-move__label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.spvt-confirm-move__value {
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--dialog-title);
}

.spvt-confirm-move__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
}

.spvt-toast-container {
  position: fixed;
  top: 80px;
  right: 16px;
  left: auto;
  bottom: auto;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.spvt-toast {
  pointer-events: auto;
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.45;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.22);
  opacity: 0;
  transform: translateX(120%);
  transition: opacity 0.28s ease, transform 0.28s ease;
  cursor: pointer;
}

.spvt-toast--visible {
  opacity: 1;
  transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
  .spvt-toast {
    transform: none;
    transition: opacity 0.15s ease;
  }}

.spvt-toast--success {
  background: #ecfdf5;
  border: 1px solid #34d399;
  color: #065f46;
}

.spvt-toast--error {
  background: #fef2f2;
  border: 1px solid #f87171;
  color: #991b1b;
}

html.dark .spvt-toast--success {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
}

html.dark .spvt-toast--error {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fca5a5;
}

.reset-results-page-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-top: 20px;
}

.reset-results-reason-field textarea {
  width: 100%;
  min-height: 80px;
}

.reset-results-page-actions .btn {
  align-self: flex-end;
}

.reset-results-page .reset-results-list-panel {
  max-height: none;
}

.reset-results-list-panel {
  border: 1px solid var(--outline-variant, rgba(148, 163, 184, 0.35));
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.reset-results-list-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98) 0%, rgba(241, 245, 249, 0.92) 100%);
}

.reset-results-list-header-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #64748b);
}

.reset-results-segment {
  display: inline-flex;
  padding: 3px;
  border-radius: 11px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.24);
  gap: 2px;
}

.reset-results-seg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 13px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted, #64748b);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.reset-results-seg-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.85;
}

.reset-results-seg-btn:hover {
  color: var(--text, #0f172a);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.reset-results-seg-btn--select:hover {
  color: #17563c;
}

.reset-results-seg-btn--select:hover svg {
  color: #1e6b4b;
  opacity: 1;
}

.reset-results-seg-btn--clear:hover {
  color: #475569;
}

.reset-results-seg-btn:focus-visible {
  outline: 2px solid var(--accent, #1e6b4b);
  outline-offset: 1px;
}

.reset-results-seg-btn:active {
  transform: scale(0.98);
}

.reset-results-list-panel .reset-results-list {
  max-height: min(52vh, 420px);
  overflow: auto;
}

html.dark .reset-results-list-panel {
  background: rgba(15, 23, 42, 0.35);
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: none;
}

html.dark .reset-results-list-header {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.88) 100%);
  border-bottom-color: rgba(148, 163, 184, 0.14);
}

html.dark .reset-results-segment {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.18);
}

html.dark .reset-results-seg-btn:hover {
  background: rgba(51, 65, 85, 0.65);
  color: #e2e8f0;
  box-shadow: none;
}

html.dark .reset-results-seg-btn--select:hover {
  color: #8fd6b2;
}

html.dark .reset-results-seg-btn--select:hover svg {
  color: #6bc59a;
}

.reset-results-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.reset-results-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  cursor: pointer;
}

.reset-results-item:last-child {
  border-bottom: none;
}

.reset-results-item:hover {
  background: rgba(46, 139, 98, 0.06);
}

.reset-results-pick {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  margin: 0;
  cursor: pointer;
  color: inherit;
  font-size: inherit;
}

.reset-results-pick input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.reset-results-box {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  flex: 0 0 22px;
  border: 2px solid #94a3b8;
  border-radius: 6px;
  background: transparent;
}

.reset-results-pick input:checked + .reset-results-box {
  border-color: #4cb782;
  background: #4cb782 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.2l3 3.1 6-6.6'/%3E%3C/svg%3E") center / 14px 14px no-repeat;
}

.reset-results-item.is-picked {
  background: rgba(76, 183, 130, 0.16);
}

.reset-results-item input {
  margin-top: 4px;
  flex-shrink: 0;
}

.reset-results-item-main {
  min-width: 0;
}

.reset-results-item-name,
.reset-results-item-meta {
  display: block;
}

.reset-results-item-name {
  font-weight: 600;
  color: var(--text, #0f172a);
}

.reset-results-item-meta {
  margin-top: 4px;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--muted, #64748b);
}

.reset-results-empty,
.reset-results-loading {
  margin: 0;
  padding: 16px;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted, #64748b);
  font-size: 0.95rem;
}

.spvt-form-dialog .form-field {
  margin-bottom: 16px;
}

.spvt-form-dialog .form-field input[type="number"] {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.upload-test-stats {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 0.95rem;
  line-height: 1.5;
}

.spvt-confirm-dialog.upload-test-dialog {
  width: min(720px, 94vw);
  max-height: min(90vh, 900px);
  overflow: auto;
}

.upload-test-questions {
  margin: 0 0 14px;
}

.upload-test-questions__title {
  margin: 0 0 8px;
  font-weight: 700;
}

.upload-test-questions__list {
  max-height: 280px;
  overflow: auto;
  margin: 0;
  padding-left: 1.2rem;
}

.upload-test-questions__list p {
  margin: 0 0 6px;
  font-weight: 600;
}

.upload-test-questions__list ul {
  margin: 0 0 12px;
  padding-left: 1.1rem;
}

.upload-test-questions__list .is-correct span {
  margin-left: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #047857;
}

html.dark .upload-test-questions__list .is-correct span {
  color: #6ee7b7;
}

.spvt-toast a {
  display: inline-block;
  margin-top: 6px;
  font-weight: 700;
  color: inherit;
}

.upload-test-errors-wrap {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(185, 28, 28, 0.08);
  border: 1px solid rgba(185, 28, 28, 0.4);
}

.upload-test-errors-title {
  margin: 0 0 8px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--danger-text, #b91c1c);
}

.upload-test-errors {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--danger-text, #991b1b);
  font-size: 0.9rem;
  line-height: 1.5;
  max-height: 240px;
  overflow-y: auto;
}

.upload-test-error-item {
  margin: 0 0 10px;
}

.upload-test-error-item--star {
  font-weight: 600;
}

.upload-test-errors-more {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: var(--danger-text, #b91c1c);
}

html.dark .upload-test-errors-wrap {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.4);
}

html.dark .upload-test-errors-title,
html.dark .upload-test-errors,
html.dark .upload-test-errors-more {
  color: #fca5a5;
}

.upload-test-block-reason {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(185, 28, 28, 0.08);
  border: 1px solid rgba(185, 28, 28, 0.35);
  color: var(--danger-text, #b91c1c);
  font-size: 0.92rem;
  line-height: 1.45;
}

.upload-test-block-reason ul {
  margin: 8px 0 0;
  padding-left: 1.2rem;
}

html.dark .upload-test-block-reason {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}

.upload-test-verify-notice {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text);
}

html.dark .upload-test-verify-notice--block {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}

.upload-test-dist-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.upload-test-dist-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface);
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.upload-test-distribution {
  margin-bottom: 8px;
}

.upload-test-info-dialog {
  width: min(440px, 100%);
}

.upload-test-info-lead {
  margin: 0 0 16px;
  color: var(--dialog-message);
  font-size: 0.95rem;
  line-height: 1.55;
}

.upload-test-format-hint {
  margin: 0 0 20px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(30, 107, 75, 0.08);
  border: 1px solid rgba(30, 107, 75, 0.18);
  color: var(--dialog-message);
  font-size: 0.85rem;
  line-height: 1.5;
}

html.dark .upload-test-format-hint {
  background: rgba(76, 183, 130, 0.08);
  border-color: rgba(76, 183, 130, 0.2);
}

.upload-test-sample-link {
  display: inline;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent, #1e6b4b);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.upload-test-sample-link:hover {
  opacity: 0.85;
}

/* Файл не подошёл: понятное сообщение и кнопка «Скачать образец» */
.upload-test-problem {
  display: flex;
  gap: 12px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(220, 38, 38, 0.35);
  border-left: 4px solid #dc2626;
  background: #fef2f2;
  color: #7f1d1d;
  font-size: 0.9rem;
  line-height: 1.5;
}

.upload-test-problem[hidden] {
  display: none;
}

html.dark .upload-test-problem {
  background: rgba(220, 38, 38, 0.14);
  border-color: rgba(248, 113, 113, 0.35);
  border-left-color: #f87171;
  color: #fecaca;
}

.upload-test-problem__icon {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #dc2626;
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-test-problem__body {
  min-width: 0;
  flex: 1;
}

.upload-test-problem__title {
  margin: 0 0 4px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.upload-test-problem__text {
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}

.upload-test-problem__note {
  margin: 0 0 10px;
  font-size: 0.82rem;
  opacity: 0.85;
}

.upload-test-problem__sample {
  min-height: 38px;
  padding: 6px 14px;
  border-color: var(--accent, #1e6b4b);
  color: var(--accent, #1e6b4b);
  font-weight: 600;
}

html.dark .upload-test-problem__sample {
  color: #a7f3d0;
  border-color: rgba(167, 243, 208, 0.5);
}

.upload-test-info-actions {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.upload-test-info-actions .btn {
  width: 100%;
  min-width: 0;
  min-height: 44px;
}

.btn-danger {
  background: linear-gradient(135deg, #f87171, var(--danger));
  color: #450a0a;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.stat {
  background: var(--surface-2);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}

.worker-tests-cell {
  min-width: 220px;
}

.worker-test-line {
  margin-bottom: 6px;
  line-height: 1.45;
}

.worker-test-line:last-child {
  margin-bottom: 0;
}

.workers-filters-card h2 {
  color: var(--text);
}

.workers-filters-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 16px;
  margin-bottom: 14px;
}

@media (max-width: 720px) {
  .workers-filters-grid {
    grid-template-columns: 1fr;
  }}

.workers-filters-grid .form-field {
  margin: 0;
}

.workers-filters-grid label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.workers-filters-grid input,
.workers-filters-grid select {
  width: 100%;
  margin-bottom: 0;
}

.workers-filters-reset {
  width: auto;
  max-width: none;
}

.workers-filters-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.workers-export-pdf-btn {
  width: auto !important;
}

.workers-export-pdf-hint {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.workers-date-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.workers-date-field {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 52px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--input-bg);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.workers-date-field:focus-within {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(76, 183, 130, 0.25);
}

.workers-date-field input[type="date"] {
  flex: 1 1 auto;
  min-width: 0;
  width: auto !important;
  height: 50px;
  margin: 0 !important;
  padding: 0 8px 0 20px !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 1rem;
  font-style: normal;
  color: var(--text);
}

.workers-date-field input[type="date"]:focus {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

.workers-date-field input[type="date"]::-webkit-clear-button,
.workers-date-field input[type="date"]::-webkit-inner-spin-button {
  display: none !important;
  -webkit-appearance: none;
  appearance: none;
}

.workers-date-field input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.workers-date-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 2px;
  padding: 0 8px 0 4px;
}

.workers-date-action-divider {
  width: 1px;
  height: 22px;
  background: rgba(148, 163, 184, 0.28);
  margin: 0 2px;
}

html.dark .workers-date-action-divider {
  background: rgba(255, 255, 255, 0.12);
}

.workers-date-clear,
.workers-date-picker {
  position: static;
  transform: none;
  z-index: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  color: #64748b;
  line-height: 0;
  background: transparent;
  transition: color 0.15s ease, background 0.15s ease;
}

.workers-date-clear svg,
.workers-date-picker svg {
  display: block;
}

.workers-date-clear svg {
  width: 14px;
  height: 14px;
}

.workers-date-clear:hover,
.workers-date-picker:hover {
  color: #334155;
  background: rgba(148, 163, 184, 0.16);
}

.workers-date-clear:active,
.workers-date-picker:active {
  background: rgba(148, 163, 184, 0.24);
}

html.dark .workers-date-clear,
html.dark .workers-date-picker {
  color: #94a3b8;
}

html.dark .workers-date-clear:hover,
html.dark .workers-date-picker:hover {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.08);
}

html.dark .workers-date-clear:active,
html.dark .workers-date-picker:active {
  background: rgba(255, 255, 255, 0.12);
}

html.dark .workers-date-field {
  background-color: var(--bg) !important;
  border-color: var(--border) !important;
}

html.dark .workers-date-field:focus-within {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(76, 183, 130, 0.2) !important;
}

html.dark .workers-date-field input[type="date"] {
  color: var(--text) !important;
  background: transparent !important;
}

.workers-date-wrap.is-all-time .workers-date-clear,
.workers-date-wrap.is-all-time .workers-date-action-divider {
  display: none;
}

.workers-date-wrap.is-all-time .workers-date-field::before {
  content: "За всё время";
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  color: var(--muted);
  font-size: 1rem;
  font-style: normal;
  pointer-events: none;
}

.workers-date-wrap.is-all-time .workers-date-field input[type="date"] {
  color: transparent;
}

.workers-date-wrap.is-all-time .workers-date-field input[type="date"]::-webkit-datetime-edit,
.workers-date-wrap.is-all-time .workers-date-field input[type="date"]::-webkit-datetime-edit-fields-wrapper,
.workers-date-wrap.is-all-time .workers-date-field input[type="date"]::-webkit-datetime-edit-text,
.workers-date-wrap.is-all-time .workers-date-field input[type="date"]::-webkit-datetime-edit-month-field,
.workers-date-wrap.is-all-time .workers-date-field input[type="date"]::-webkit-datetime-edit-day-field,
.workers-date-wrap.is-all-time .workers-date-field input[type="date"]::-webkit-datetime-edit-year-field {
  color: transparent;
  opacity: 0;
}

.shift-date-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.general-stats-top-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
}

.general-stats-top-filters select,
.general-stats-top-filters .shift-date-row__picker input[type="date"] {
  font-size: 0.8125rem;
  line-height: 1.25;
  padding: 10px 36px 10px 14px;
  margin-bottom: 0;
}

.general-stats-test-row__controls select,
.general-stats-department-row__controls select {
  width: 300px;
  min-width: 200px;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
}

/* Список тестов шире, чем список подразделений: длинные названия меньше обрезаются. */
.general-stats-test-row {
  flex: 1 1 420px;
  min-width: 0;
}
.general-stats-test-row__controls {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.general-stats-test-row__controls select {
  width: 100%;
  max-width: 640px;
}
.general-stats-test-fullname {
  margin: 6px 0 0;
  max-width: 640px;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--text-secondary, #64748b);
  white-space: normal;
  overflow-wrap: anywhere;
}

.general-stats-export-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.general-stats-export-btn {
  width: auto !important;
  min-height: 44px;
  margin-bottom: 0;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid #185c37 !important;
  background: linear-gradient(180deg, #33a867 0%, #217346 55%, #1e6b3f 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(33, 115, 70, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.general-stats-export-btn__icon {
  display: block;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.general-stats-export-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #3fbb72 0%, #248552 55%, #1f7547 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(33, 115, 70, 0.34);
}

.general-stats-export-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

html.dark .general-stats-export-btn {
  border-color: #2f8f5d !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

.general-stats-export-btn--pdf {
  border-color: #b42318 !important;
  background: linear-gradient(180deg, #ef5350 0%, #d92d20 55%, #b42318 100%) !important;
  box-shadow: 0 2px 8px rgba(180, 35, 24, 0.28);
}

.general-stats-export-btn--pdf:hover:not(:disabled) {
  background: linear-gradient(180deg, #f87171 0%, #e03e2f 55%, #c62828 100%) !important;
  box-shadow: 0 4px 12px rgba(180, 35, 24, 0.34);
}

html.dark .general-stats-export-btn--pdf {
  border-color: #ef5350 !important;
}

@media (max-width: 720px) {
  .general-stats-controls {
    grid-template-columns: 1fr;
  }

  .general-stats-export-actions {
    justify-self: end;
  }}

.shift-date-row__label {
  flex-shrink: 0;
}

.shift-date-row__controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
}

.shift-date-row__picker.workers-date-wrap {
  width: 220px;
  min-width: 200px;
  flex-shrink: 0;
}

.stats-period-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px 20px;
}

.stats-period-row__label {
  padding-bottom: 14px;
}

.stats-period-row__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
}

.stats-period-picker.workers-date-wrap {
  width: 220px;
  min-width: 180px;
}

.stats-period-reset-btn {
  height: 52px;
  width: auto;
  min-width: 8.5rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.workers-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.workers-pagination-info {
  color: var(--muted);
  font-size: 0.9rem;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.85rem;
}

.option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  margin-bottom: 10px;
  border-radius: 12px;
  border: 1px solid var(--surface-2);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
}

.option.selected {
  border-color: var(--accent);
  background: rgba(76, 183, 130, 0.12);
}

.test-nav {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.test-nav .btn {
  flex: 1;
}

/* Подсказка: вопрос с несколькими правильными ответами (экран работника) */
.question-hint-wrap {
  margin: 0 0 18px;
}

.question-hint {
  margin: 0;
  padding: 12px 16px;
  border-radius: 12px;
  border-left: 4px solid rgba(76, 183, 130, 0.85);
  background: rgba(76, 183, 130, 0.1);
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--border);
}

.question-hint strong {
  color: #e6f4ec;
  font-weight: 600;
}

.options--multi {
  margin-top: 2px;
}

.option--multi {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  text-align: left;
}

.option-multi__mark {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin-top: 2px;
  border-radius: 8px;
  border: 2px solid rgba(148, 163, 184, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
  color: transparent;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.option--multi.selected .option-multi__mark {
  border-color: var(--input-focus);
  background: linear-gradient(145deg, #8fd6b2, var(--input-focus));
  color: #0f172a;
  box-shadow: 0 0 0 2px rgba(76, 183, 130, 0.25);
}

.option-multi__body {
  flex: 1;
  line-height: 1.45;
  white-space: normal;
}

.option--multi.selected {
  border-color: rgba(76, 183, 130, 0.75);
  background: rgba(76, 183, 130, 0.14);
  box-shadow: 0 0 0 1px rgba(76, 183, 130, 0.25);
}

.progress {
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0 20px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--success));
  width: 0%;
  transition: width 0.25s ease;
}

.question-timer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid rgba(107, 197, 154, 0.25);
  font-size: 0.95rem;
}

.question-timer[hidden] {
  display: none !important;
}

.test-ticket-badge {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}

.question-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 20px;
  margin: 0 0 18px;
}

.question-head-row #question-text {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  line-height: 1.35;
}

.question-image-wrap {
  margin: 0 0 16px;
  text-align: center;
}

.question-image {
  display: block;
  max-width: 100%;
  max-height: 320px;
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  object-fit: contain;
  background: var(--surface, #fff);
}

.question-image--form {
  max-height: 220px;
}

.question-image--thumb {
  max-height: 140px;
}

.question-image--review {
  max-height: 200px;
}

.question-image--pending {
  display: none !important;
}

.question-image-status--loading {
  margin: 0 0 12px;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.4;
  color: #64748b;
}

.question-image-status--error,
.question-image-missing {
  margin: 0 0 12px;
  padding: 12px 16px;
  border-radius: 12px;
  border-left: 4px solid #d97706;
  background: #fffbeb;
  color: #78350f;
  text-align: left;
  font-size: 1rem;
  line-height: 1.45;
}

.question-image-status--error p,
.question-image-missing {
  margin: 0 0 10px;
}

.question-image-status__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.question-image-status__actions .btn {
  width: 100%;
  min-height: 44px;
}

html.dark .question-image-status--loading {
  color: #cbd5e1;
}

html.dark .question-image-status--error,
html.dark .question-image-missing {
  background: rgba(217, 119, 6, 0.14);
  color: #fde68a;
}

.question-image-field .question-image-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.question-image-preview {
  margin: 8px 0 0;
}

.question-image-preview:not([hidden]) {
  display: block;
  min-height: 48px;
}

.question-image-preview .question-image--form {
  margin: 0 auto;
}

.ticket-question-image {
  margin: 8px 0 10px 1.75rem;
}

.worker-review-item__image {
  margin: 0 0 10px;
  text-align: center;
}

.question-timer--inline {
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  margin: 0;
  padding: 10px 14px;
  min-width: 92px;
  border-width: 2px;
  border-radius: 12px;
}

.question-timer--inline .question-timer__label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  line-height: 1.2;
}

.question-timer--inline .question-timer__value {
  font-size: 1.65rem;
  line-height: 1.1;
}

@media (max-width: 640px) {
  .question-head-row {
    flex-direction: column;
    gap: 12px;
  }

  .question-timer--inline {
    align-self: flex-end;
  }}

.question-timer--warn {
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(251, 191, 36, 0.08);
}

.question-timer--urgent {
  border-color: rgba(239, 68, 68, 0.6);
  background: rgba(239, 68, 68, 0.1);
}

.question-timer__value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--accent);
}

.question-timer--warn .question-timer__value,
.question-timer--urgent .question-timer__value {
  color: #fbbf24;
}

.question-timer--urgent .question-timer__value {
  color: #f87171;
}

.time-cell {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  line-height: 1.35;
}

.time-cell-hint {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 400;
}

.question-errors-table th.question-errors-col-pct,
.question-errors-table td.question-errors-col-pct {
  width: 5.5rem;
  white-space: nowrap;
}

.question-errors-table th.question-errors-col-n,
.question-errors-table td.question-errors-col-n {
  width: 6.5rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.question-errors-text {
  line-height: 1.45;
  max-width: 42rem;
}

.attempt-journal-table td {
  vertical-align: middle;
}

.attempt-journal-table .td-actions {
  width: auto;
  text-align: right;
}

.attempt-person-name {
  font-weight: 650;
}

.attempt-person-num,
.attempt-date-time {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.8rem;
}

.attempt-date-main,
.attempt-score,
.attempt-code {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.attempt-code {
  font-family: ui-monospace, Consolas, monospace;
  letter-spacing: 0.02em;
}

.tester-head {
  display: flex;
  align-items: center;
  gap: 20px;
}

.tester-photo {
  flex: none;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-light);
}

.tester-access-folder {
  padding-top: 14px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #94a3b8);
  background: transparent;
}

.spvt-confirm-ask {
  display: block;
  margin: 12px 0 0;
}

.spvt-confirm-ask textarea {
  width: 100%;
  min-height: 72px;
  margin-top: 6px;
}

.attempt-status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8125rem;
  font-weight: 650;
  font-style: normal;
  line-height: 1.2;
  white-space: nowrap;
}

.attempt-status-pill--ready {
  background: #dcfce7;
  color: #166534;
}

.attempt-status-pill--fail {
  background: #fee2e2;
  color: #991b1b;
}

.attempt-status-pill--void {
  background: #e2e8f0;
  color: #334155;
}

.attempt-status-pill--progress {
  background: #fef3c7;
  color: #92400e;
}

html.dark .attempt-status-pill--ready {
  background: #14532d;
  color: #bbf7d0;
}

html.dark .attempt-status-pill--fail {
  background: #3f1d1d;
  color: #fecaca;
}

html.dark .attempt-status-pill--void {
  background: #334155;
  color: #e2e8f0;
}

html.dark .attempt-status-pill--progress {
  background: #78350f;
  color: #fde68a;
}

.question-errors-table th button {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: inherit;
}

.question-errors-table tr[data-question-id] {
  cursor: pointer;
}

.question-choice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  margin: 10px 0;
}

.question-choice-bar {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.35);
  overflow: hidden;
}

.question-choice-bar > span {
  display: block;
  height: 100%;
  background: #64748b;
}

.question-choice-bar > span.is-correct {
  background: #16a34a;
}

.question-error-pct {
  display: inline-block;
  min-width: 3rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.qa-row {
  cursor: pointer;
}

.qa-row:hover,
.qa-row.is-open {
  background: rgba(148, 163, 184, 0.12);
}

.qa-question {
  font-weight: 500;
}

.qa-ticket {
  color: #64748b;
  font-size: 0.8rem;
  margin-top: 2px;
}

.qa-edit-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1d4ed8;
}

html.dark .qa-edit-link {
  color: #93c5fd;
}

.question-errors-table th.qa-col-correct,
.question-errors-table td.qa-col-correct {
  width: 220px;
  white-space: nowrap;
}

.qa-bar {
  display: inline-block;
  vertical-align: middle;
  width: 130px;
  height: 10px;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.35);
  overflow: hidden;
  margin-right: 8px;
}

.qa-bar__fill {
  display: block;
  height: 100%;
  border-radius: 99px;
}

.qa-bar__fill--low {
  background: #dc2626;
}

.qa-bar__fill--mid {
  background: #d97706;
}

.qa-bar__fill--ok {
  background: #16a34a;
}

.qa-bar__pct {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.question-errors-table th.qa-col-flag,
.question-errors-table td.qa-col-flag {
  width: 230px;
}

.qa-flag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 600;
}

.qa-flag--bad {
  background: #fee2e2;
  color: #b91c1c;
}

.qa-flag--warn {
  background: #fef3c7;
  color: #92400e;
}

.qa-flag--few {
  background: rgba(148, 163, 184, 0.16);
  color: var(--muted);
  font-weight: 500;
}

html.dark .qa-flag--bad {
  background: rgba(248, 113, 113, 0.18);
  color: #fca5a5;
}

html.dark .qa-flag--warn {
  background: rgba(251, 191, 36, 0.18);
  color: #fcd34d;
}

.qa-detail > td {
  padding: 12px 16px 18px;
  background: rgba(148, 163, 184, 0.08);
}

.qa-detail .question-choice {
  max-width: 720px;
}

.qa-detail__hint {
  margin: 0 0 8px;
  font-weight: 600;
}

.qa-detail__hint--bad {
  color: #b91c1c;
}

.qa-detail__hint--warn {
  color: #92400e;
}

.qa-detail__top {
  margin: 0 0 8px;
}

.qa-detail__counts {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 0.85rem;
}

.qa-correct-mark {
  color: #15803d;
  font-weight: 600;
  margin-left: 6px;
}

.question-error-pct--mid {
  color: #b45309;
}

.question-error-pct--high {
  color: #b91c1c;
}

html.dark .question-error-pct--mid {
  color: #fbbf24;
}

html.dark .question-error-pct--high {
  color: #f87171;
}

.alert {
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  line-height: 1.5;
}

.alert-error {
  background: #fee2e2;
  border: 1px solid #f87171;
  color: var(--danger-text);
}

body.page-manager #error-box:not(.hidden) {
  position: sticky;
  top: 4.5rem;
  z-index: 40;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
}

.alert-success {
  background: #d1fae5;
  border: 1px solid #34d399;
  color: #065f46;
}

.table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
}

/* «Тестируемые» на телефоне: каждая строка таблицы — отдельная карточка. */
@media (max-width: 640px) {
  .testers-table-wrap {
    overflow: visible;
  }
  .testers-table,
  .testers-table tbody,
  .testers-table tr,
  .testers-table td {
    display: block;
    width: 100%;
  }
  .testers-table thead {
    display: none;
  }
  .testers-table tr {
    padding: 10px 12px;
    margin-bottom: 10px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 10px;
    box-sizing: border-box;
  }
  .testers-table td {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 0;
    overflow-wrap: anywhere;
    text-align: right;
  }
  .testers-table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    max-width: 45%;
    color: var(--text-secondary, #64748b);
    font-size: 0.8125rem;
    text-align: left;
  }
  .testers-table td:first-child {
    font-weight: 600;
    text-align: left;
    padding-bottom: 6px;
  }
  .testers-table td:first-child::before {
    display: none;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  text-align: left;
  vertical-align: top;
  transition: background-color 0.15s ease;
}

tr:hover td {
  background-color: rgba(0, 0, 0, 0.02) !important;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.status-ready {
  color: var(--success-text, #065f46);
  font-weight: 700;
}

.status-not-ready {
  color: var(--danger-text, var(--danger));
  font-weight: 700;
}

.status-pending {
  color: var(--warning);
  font-weight: 700;
}

.status-reset {
  color: var(--muted);
  font-style: italic;
}

.th-actions,
.td-actions {
  width: 48px;
  text-align: center;
  vertical-align: middle;
}

.hidden {
  display: none !important;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.topbar .btn {
  width: auto;
  padding: 10px 14px;
  font-size: 0.9rem;
}

/* Главная: фото задано на html в index.html. Здесь цвет не ставим, иначе он закрывает снимок. */
body.page-home {
  background-color: transparent;
}

body.page-home .header h1 {
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
}

body.page-home .subtitle {
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

body.page-home .card,
body.page-home .role-card {
  background: rgba(30, 41, 59, 0.92);
  backdrop-filter: blur(8px);
}

.logo-shine {
  position: relative;
  z-index: 1;
  display: block;
  width: min(520px, 50vw);
  max-width: 100%;
  line-height: 0;
  isolation: isolate;
}

.logo-shine img {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: brightness(1.08) contrast(1.08);
}

.logo-shine::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  -webkit-mask-image: var(--logo-mask, url("/static/images/ink-logo.png"));
  mask-image: var(--logo-mask, url("/static/images/ink-logo.png"));
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-mode: alpha;
  mask-mode: alpha;
  background: linear-gradient(
    105deg,
    transparent 0%,
    transparent 34%,
    rgba(255, 255, 255, 0.12) 42%,
    rgba(255, 255, 255, 0.45) 48%,
    rgba(255, 255, 255, 0.75) 50%,
    rgba(255, 255, 255, 0.45) 52%,
    rgba(255, 255, 255, 0.12) 58%,
    transparent 66%,
    transparent 100%
  );
  background-size: 240% 100%;
  background-repeat: no-repeat;
  background-position: 130% 0;
  animation: logo-shimmer 8s cubic-bezier(0.42, 0, 0.2, 1) infinite;
  pointer-events: none;
  opacity: 0.95;
}

@media (prefers-reduced-motion: reduce) {
  .logo-shine::before {
    animation: none;
  }}

@keyframes logo-shimmer {
  0%,
  78%,
  100% {
    background-position: 130% 0;
  }
  22% {
    background-position: -35% 0;
  }
}

/* Результаты теста и разбор попытки: раскладка как в Moodle. */
.results-crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.results-crumb a {
  color: var(--accent);
  text-decoration: none;
}

.results-crumb a:hover {
  text-decoration: underline;
}

.results-title {
  margin: 0 0 16px;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

.results-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.results-tab {
  margin-bottom: -1px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 8px 8px 0 0;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.results-tab:hover {
  background: rgba(148, 163, 184, 0.12);
}

.results-tab.is-active {
  border-color: var(--border);
  border-bottom-color: var(--surface-2);
  background: var(--surface-2);
  color: var(--text);
}

.results-lead {
  margin: 0 0 12px;
  font-weight: 600;
  color: var(--text);
}

.results-settings,
.results-card {
  margin-bottom: 20px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: var(--surface-2);
}

.results-settings > summary {
  padding: 14px 20px;
  font-weight: 700;
  cursor: pointer;
  list-style-position: inside;
}

.results-settings[open] > summary {
  border-bottom: 1px solid var(--border-light);
}

.results-settings__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px 20px;
  padding: 16px 20px 0;
}

.results-field {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.results-field > label {
  display: flex;
  align-items: center;
  min-height: 1.25rem;
  margin: 0;
  line-height: 1.25;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.results-field input:not([type="date"]),
.results-field select {
  height: 48px;
  margin: 0;
  padding: 0 16px;
  line-height: 46px;
}

.results-field .stats-period-picker.workers-date-wrap {
  width: 100%;
  min-width: 0;
}

.results-settings__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 16px 20px;
}

.results-settings__actions .btn {
  width: auto;
}

.results-settings__hint {
  color: var(--muted);
  font-size: 0.85rem;
}

.results-settings__hint.hidden {
  display: none;
}

.results-download {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 12px;
  font-size: 0.92rem;
}

.results-download label {
  margin: 0;
}

.results-download select {
  width: auto;
  min-width: 170px;
  height: 44px;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  padding-right: 44px;
}

.results-download .btn {
  width: auto;
  height: 44px;
  min-height: 44px;
  margin: 0;
  gap: 8px;
}

.results-pinned {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(76, 183, 130, 0.1);
  font-size: 0.92rem;
}

.results-pinned.hidden {
  display: none;
}

.results-pinned button {
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.results-pinned button:hover {
  text-decoration: underline;
}

.results-download__aside {
  margin-left: auto;
  color: var(--accent);
  font-weight: 600;
}

.results-card {
  padding: 16px 20px;
}

.results-section-title {
  margin: 0 0 12px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.results-table thead th {
  white-space: nowrap;
}

.results-table td {
  vertical-align: top;
}

.results-table tfoot th,
.results-table tfoot td {
  border-top: 2px solid var(--border);
  border-bottom: 0;
  color: var(--text);
  font-weight: 700;
}

.attempt-review-link {
  display: inline-block;
  margin-top: 4px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
}

.attempt-elapsed {
  white-space: nowrap;
}

.results-empty {
  margin: 12px 0 0;
  color: var(--muted);
}

.results-empty.hidden {
  display: none;
}

.results-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.results-pagination.hidden {
  display: none;
}

.results-footnote {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.results-footnote--top {
  margin: 0 0 12px;
}

.results-info {
  width: auto;
  min-width: min(100%, 520px);
}

.results-info th {
  width: 220px;
  font-weight: 600;
}

.results-info td {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 24px;
  align-items: start;
}

.review-summary {
  margin-bottom: 20px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: var(--surface-2);
}

.review-summary th {
  width: 160px;
  padding-left: 16px;
  font-weight: 600;
}

.review-summary td {
  color: var(--text);
}

.review-summary tr:last-child th,
.review-summary tr:last-child td {
  border-bottom: 0;
}

.review-summary__muted {
  display: inline-block;
  margin-left: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.review-questions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.review-q {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 12px;
  scroll-margin-top: 80px;
}

.review-q__info {
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 0.85rem;
}

.review-q__num {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.review-q__state {
  margin: 0 0 4px;
  font-weight: 700;
}

.review-q.is-correct .review-q__state {
  color: #047857;
}

.review-q.is-wrong .review-q__state {
  color: #b91c1c;
}

.review-q.is-empty .review-q__state {
  color: var(--muted);
}

.review-q__grade {
  margin: 0;
  color: var(--muted);
}

.review-q__content {
  padding: 14px 16px;
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.06);
}

.review-q__text {
  margin: 0 0 10px;
  line-height: 1.5;
  color: var(--text);
}

.review-q__note {
  margin: 0 0 8px;
  color: #92400e;
  font-size: 0.82rem;
}

.review-q__image {
  margin: 0 0 10px;
}

.review-q__answer {
  margin: 0;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--text);
}

.review-q__answer span {
  color: var(--muted);
  font-weight: 600;
}

.review-q.is-correct .review-q__answer {
  background: rgba(16, 185, 129, 0.12);
}

.review-q.is-wrong .review-q__answer {
  background: rgba(239, 68, 68, 0.1);
}

.review-q__feedback {
  margin-top: 8px;
  padding: 10px 16px;
  border: 1px solid rgba(217, 119, 6, 0.3);
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.08);
  color: var(--text);
  font-size: 0.92rem;
}

.review-annul {
  display: grid;
  gap: 8px;
  max-width: 640px;
  margin-top: 24px;
  padding: 16px 20px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: var(--surface-2);
}

.review-annul textarea {
  width: 100%;
  min-height: 72px;
}

.review-annul .btn {
  justify-self: start;
  width: auto;
}

.review-finish {
  margin-top: 24px;
}

.review-finish .btn {
  width: auto;
}

.review-nav {
  position: sticky;
  top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: var(--surface-2);
}

.review-nav__title {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.review-nav__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
  gap: 6px;
}

.review-nav__cell,
.review-nav__swatch {
  border: 1px solid var(--border);
  border-radius: 6px;
}

.review-nav__cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}

.review-nav__cell.is-correct,
.review-nav__swatch.is-correct {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.18);
}

.review-nav__cell.is-wrong,
.review-nav__swatch.is-wrong {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

.review-nav__cell.is-empty,
.review-nav__swatch.is-empty {
  background: rgba(148, 163, 184, 0.15);
}

.review-nav__legend {
  display: grid;
  gap: 4px;
  margin: 12px 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.8rem;
}

.review-nav__legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.review-nav__swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
}

.review-nav__finish {
  color: var(--accent);
  font-weight: 600;
}

html.dark .review-q.is-correct .review-q__state {
  color: #4ade80;
}

html.dark .review-q.is-wrong .review-q__state {
  color: #f87171;
}

html.dark .review-q__note {
  color: #fbbf24;
}

@media (max-width: 1000px) {
  .results-settings__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .review-layout {
    grid-template-columns: 1fr;
  }

  .review-nav {
    position: static;
    grid-row: 1;
  }
}

@media (max-width: 640px) {
  .results-settings__grid {
    grid-template-columns: 1fr;
  }

  .results-download__aside {
    margin-left: 0;
  }

  .review-q {
    grid-template-columns: 1fr;
  }
}


/* База знаний МарИНКи */
.kb-card {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.kb-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 14px;
}

.kb-warning {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(217, 119, 6, 0.35);
  background: rgba(254, 243, 199, 0.6);
  color: #92400e;
  font-size: 0.9rem;
}

.kb-mode {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.15);
}

.kb-mode-btn {
  border: 0;
  background: transparent;
  padding: 8px 14px;
  border-radius: 8px;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
}

.kb-mode-btn.is-active {
  background: #fff;
  color: var(--text, #0f172a);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.kb-form .btn {
  width: auto;
}

.kb-form textarea {
  min-height: 160px;
}

.kb-hint {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
}

.kb-over {
  color: var(--danger-text);
}

.kb-list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.kb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kb-item {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 10px;
}

.kb-item-main {
  flex: 1 1 320px;
  min-width: 0;
}

.kb-item-title {
  margin: 0 0 4px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.kb-item-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.kb-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kb-item-actions .btn {
  min-width: 0;
  width: auto;
  padding: 8px 14px;
}

.kb-item-body {
  flex: 1 1 100%;
  max-height: 420px;
  overflow: auto;
  border-top: 1px solid rgba(148, 163, 184, 0.3);
  padding-top: 10px;
}

.kb-chunk + .kb-chunk {
  margin-top: 12px;
}

.kb-chunk-label {
  margin: 0 0 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.kb-chunk-text {
  margin: 0;
  white-space: pre-wrap;
  font-size: 0.9rem;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .kb-card {
    padding: 16px;
  }

  .kb-item-actions,
  .kb-item-actions .btn,
  .kb-form .btn {
    width: 100%;
  }

  .kb-item-actions .btn {
    flex: 1 1 0;
  }
}

html.dark .kb-mode-btn.is-active {
  background: rgba(30, 41, 59, 0.9);
  color: #e2e8f0;
}

html.dark .kb-warning {
  background: rgba(120, 53, 15, 0.25);
  color: #fcd34d;
}
