:root {
  --font-sans: Inter, Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --color-olymp-blue: #008ecb;
  --color-olymp-blue-dark: #006fa8;
  --color-olymp-blue-deep: #064a7a;
  --color-olymp-blue-soft: #eef9fd;
  --color-olymp-blue-tint: #dff4fb;
  --color-olymp-yellow: #ffc400;
  --color-warning-soft: #fff5c4;
  --color-warning-text: #7a5900;
  --color-page: #f6fbfd;
  --color-surface: #ffffff;
  --color-surface-soft: #fbfdff;
  --color-text: #172636;
  --color-muted: #64748b;
  --color-border: #d5e8f1;
  --color-border-strong: #b9d9e8;
  --color-danger: #b42318;
  --color-danger-soft: #fee4e2;
  --color-success: #087443;
  --color-success-soft: #e7f7ef;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-soft: 0 10px 30px rgba(6, 74, 122, 0.08);
  --shadow-panel: 0 18px 45px rgba(6, 74, 122, 0.10);
  --shadow-auth: 0 22px 60px rgba(6, 74, 122, 0.13);
  --shadow-lift: 0 18px 40px rgba(6, 74, 122, 0.13);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--color-page);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(0, 142, 203, 0.11), transparent 30%),
    radial-gradient(circle at 88% 18%, rgba(255, 196, 0, 0.10), transparent 24%),
    linear-gradient(180deg, #ffffff 0%, var(--color-page) 44%, #f8fcfd 100%);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

a {
  color: var(--color-olymp-blue-dark);
}

a:hover {
  color: var(--color-olymp-blue-deep);
}

.app-shell {
  min-height: 100vh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(213, 232, 241, 0.9);
  box-shadow: 0 8px 28px rgba(6, 74, 122, 0.05);
  backdrop-filter: blur(18px);
}

.app-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 24px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 250px;
  color: var(--color-text);
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.project-logo {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--color-olymp-blue-deep);
}

.project-logo__mark {
  display: block;
  width: 74px;
  height: auto;
  flex: 0 0 auto;
}

.project-logo__text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.project-logo__name {
  color: var(--color-olymp-blue-deep);
  font-size: 21px;
  font-weight: 950;
  line-height: 0.95;
  letter-spacing: 0;
  text-transform: uppercase;
}

.project-logo__rule {
  display: block;
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-olymp-blue), var(--color-olymp-yellow));
}

.project-logo__subtitle {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.15;
  white-space: nowrap;
}

.project-logo--auth {
  justify-content: center;
  gap: 20px;
}

.project-logo--auth .project-logo__mark {
  width: 116px;
}

.project-logo--auth .project-logo__name {
  font-size: 38px;
}

.project-logo--auth .project-logo__rule {
  height: 4px;
}

.project-logo--auth .project-logo__subtitle {
  font-size: 14px;
}

.app-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 4px;
  border: 1px solid rgba(213, 232, 241, 0.72);
  border-radius: 999px;
  background: rgba(238, 249, 253, 0.62);
}

.app-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--color-olymp-blue-deep);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.app-nav a:hover,
.app-nav a:focus-visible {
  background: #fff;
  color: var(--color-olymp-blue-dark);
  box-shadow: 0 6px 18px rgba(6, 74, 122, 0.08);
}

.notification-badge {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--color-warning);
  color: #3a2a00;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
}

.notification-bell {
  position: relative;
  text-decoration: none;
}

.notification-bell .notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
}

.user-area {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: var(--color-muted);
  font-size: 14px;
  font-weight: 600;
}

.app-popover {
  position: relative;
}

.app-popover > summary {
  list-style: none;
}

.app-popover > summary::-webkit-details-marker {
  display: none;
}

.header-icon-button,
.user-menu__summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid rgba(213, 232, 241, 0.9);
  border-radius: 999px;
  background: rgba(238, 249, 253, 0.74);
  color: var(--color-olymp-blue-deep);
  cursor: pointer;
  transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.header-icon-button:hover,
.header-icon-button:focus-visible,
.user-menu__summary:hover,
.user-menu__summary:focus-visible,
.app-popover[open] > .header-icon-button,
.app-popover[open] > .user-menu__summary {
  background: #fff;
  box-shadow: 0 8px 22px rgba(6, 74, 122, 0.12);
  transform: translateY(-1px);
}

.header-icon-button {
  width: 34px;
  font-weight: 900;
  font-style: italic;
}

.user-menu__summary {
  gap: 6px;
  width: 58px;
  min-width: 58px;
  padding: 4px 8px;
  font-weight: 800;
}

.user-menu__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--color-olymp-blue);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.user-menu__summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.app-popover__panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 60;
  min-width: 240px;
  border: 1px solid rgba(213, 232, 241, 0.96);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 44px rgba(5, 28, 44, 0.16);
  color: var(--color-text);
  transform-origin: top right;
  animation: popover-in 150ms ease both;
}

.user-menu__dropdown {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.user-menu__identity {
  display: grid;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.user-menu__identity strong {
  color: var(--color-olymp-blue-deep);
  font-size: 15px;
}

.user-menu__identity span {
  color: var(--color-muted);
  font-size: 13px;
}

.user-menu__logout {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface-soft);
  color: var(--color-olymp-blue-deep);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.user-menu__logout:hover,
.user-menu__logout:focus-visible {
  border-color: var(--color-olymp-blue);
  background: #fff;
  color: var(--color-olymp-blue-dark);
}

.info-popover__panel {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(330px, calc(100vw - 32px));
  padding: 18px;
  text-align: center;
}

.info-popover__avatar {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(213, 232, 241, 0.96);
  border-radius: 50%;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, var(--color-olymp-blue), var(--color-olymp-yellow)) border-box;
  color: var(--color-olymp-blue-deep);
  font-size: 18px;
  font-weight: 950;
  box-shadow: 0 10px 24px rgba(6, 74, 122, 0.12);
}

.info-popover__panel strong {
  display: block;
  color: var(--color-olymp-blue-deep);
  font-size: 18px;
  line-height: 1.15;
}

.info-popover__rule {
  display: block;
  width: 110px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-olymp-blue), var(--color-olymp-yellow));
}

.info-popover__panel p {
  margin: 0;
  color: var(--color-text);
  line-height: 1.45;
}

.info-popover__developer,
.info-popover__developer p {
  margin: 0;
}

.info-popover__developer {
  display: grid;
  justify-items: center;
  gap: 5px;
  width: 100%;
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
}

.info-popover__developer-label {
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.info-popover__developer p {
  color: var(--color-olymp-blue-deep);
  font-weight: 850;
}

.info-popover__panel a {
  color: var(--color-olymp-blue-dark);
  font-weight: 800;
  text-decoration: none;
}

.info-popover__panel a:hover,
.info-popover__panel a:focus-visible {
  text-decoration: underline;
}

@keyframes popover-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.content {
  max-width: 1240px;
  margin: 0 auto;
  padding: 34px 24px 56px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 20px;
}

.page-header h1 {
  margin: 0;
  color: var(--color-text);
  font-size: 32px;
  font-weight: 800;
  line-height: 1.12;
}

.document-list-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.page-actions--compact {
  gap: 10px;
}

.page-action-button {
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 16px;
  border-color: rgba(185, 217, 232, 0.92);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(246, 251, 253, 0.92) 100%);
  box-shadow: 0 10px 24px rgba(6, 74, 122, 0.06);
  font-size: 14px;
  letter-spacing: 0;
}

.page-action-button:hover,
.page-action-button:focus-visible {
  border-color: rgba(0, 142, 203, 0.34);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(238, 249, 253, 0.94) 100%);
  box-shadow: 0 12px 26px rgba(6, 74, 122, 0.10);
}

.page-action-button--accent {
  border-color: rgba(0, 142, 203, 0.24);
  background: linear-gradient(180deg, rgba(235, 248, 253, 0.98) 0%, rgba(223, 244, 251, 0.96) 100%);
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--color-olymp-blue-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.panel {
  margin-bottom: 20px;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(251, 253, 255, 0.96)),
    var(--color-surface);
  border: 1px solid rgba(213, 232, 241, 0.95);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.messages {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.messages li,
.alert {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  background: var(--color-olymp-blue-soft);
  color: var(--color-olymp-blue-deep);
  font-weight: 650;
}

.alert-error {
  border-color: rgba(180, 35, 24, 0.22);
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.alert-success {
  border-color: rgba(8, 116, 67, 0.20);
  background: var(--color-success-soft);
  color: var(--color-success);
}

.alert-warning {
  border-color: rgba(255, 196, 0, 0.44);
  background: var(--color-warning-soft);
  color: #755600;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  align-items: end;
}

.panel > .form-grid {
  margin-bottom: 18px;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.form-control--compact,
.form-select--compact {
  min-height: 36px;
  padding: 7px 10px;
}

.document-form {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.field-wide {
  grid-column: 1 / -1;
}

.laboratory-row-form {
  display: grid;
  grid-template-columns: minmax(120px, 170px) minmax(260px, 1fr) auto;
  width: 100%;
  align-items: center;
}

.user-laboratory-row-form {
  display: grid;
  grid-template-columns: minmax(180px, 260px) auto;
  width: fit-content;
  max-width: 100%;
  align-items: center;
}

.user-laboratory-row-form .form-select {
  min-width: 0;
}

.workplace-row-actions {
  white-space: nowrap;
}

.workplace-code {
  font-weight: 800;
}

.workplace-name-block {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.workplace-name-link {
  color: var(--color-text);
  font-weight: 800;
  text-decoration: none;
}

.workplace-name-link:hover {
  color: var(--color-olymp-blue-dark);
  text-decoration: underline;
}

.workplace-coverage-cell {
  display: grid;
  gap: 6px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.workplace-coverage-cell strong {
  color: var(--color-olymp-blue-deep);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.workplace-coverage-cell:hover strong {
  color: var(--color-olymp-blue-dark);
}

.workplace-coverage-cell__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.workplace-row-actions__group {
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.workplace-modal {
  width: min(100%, 560px);
}

.workplace-modal__form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.workplace-drawer {
  width: min(100%, 680px);
  height: min(100vh, 100%);
  margin-left: auto;
  border-radius: 26px 0 0 26px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.workplace-drawer .modal-body {
  min-height: 0;
  overflow-y: auto;
}

.workplace-drawer__body {
  display: grid;
  gap: 12px;
}

.workplace-drawer__toolbar {
  position: sticky;
  top: -20px;
  z-index: 2;
  display: grid;
  gap: 10px;
  margin: -20px -20px 0;
  padding: 20px 20px 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.94) 78%, rgba(255, 255, 255, 0) 100%);
}

.workplace-drawer__summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workplace-drawer__tools {
  display: grid;
  gap: 8px;
}

.workplace-drawer__filters {
  gap: 8px;
}

.workplace-documents-list {
  display: grid;
  gap: 6px;
}

.workplace-document-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.78);
}

.workplace-document-card--compact {
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}

.workplace-document-card__main,
.workplace-document-card__content {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.workplace-document-card__titleline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.workplace-document-card__version {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
}

.workplace-document-card__name {
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.3;
}

.workplace-document-card__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.workplace-documents-empty {
  margin-top: 4px;
}

.field-error {
  display: block;
  margin-top: 6px;
  color: var(--color-danger);
  font-size: 12px;
  font-weight: 750;
}

.form-actions {
  grid-column: 1 / -1;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
}

.form-actions label,
.form-actions .errorlist {
  grid-column: 1 / -1;
}

.field,
.auth-field {
  display: grid;
  gap: 7px;
}

.filter-actions {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  justify-content: flex-start;
}

.filter-actions .filter-action-button {
  width: 46px;
  min-width: 46px;
  height: 46px;
  min-height: 46px;
  border-radius: 12px;
  padding: 0;
}

.filter-actions .filter-action-button span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.filter-actions .filter-action-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.filter-action-button--apply {
  border-color: rgba(0, 142, 203, 0.38);
  background: linear-gradient(180deg, #1da3dd 0%, #008ecb 100%);
  color: #fff;
  box-shadow: 0 10px 22px rgba(0, 142, 203, 0.18);
}

.filter-action-button--apply:hover,
.filter-action-button--apply:focus-visible {
  border-color: rgba(0, 111, 168, 0.46);
  background: linear-gradient(180deg, #28abe2 0%, #007db4 100%);
  color: #fff;
  box-shadow: 0 12px 24px rgba(0, 142, 203, 0.22);
}

.filter-action-button--reset {
  border-color: rgba(185, 217, 232, 0.92);
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-olymp-blue-deep);
  box-shadow: 0 8px 20px rgba(6, 74, 122, 0.06);
}

.filter-action-button--reset:hover,
.filter-action-button--reset:focus-visible {
  border-color: rgba(0, 142, 203, 0.34);
  background: rgba(238, 249, 253, 0.96);
  color: var(--color-olymp-blue-dark);
  box-shadow: 0 10px 22px rgba(6, 74, 122, 0.08);
}

.audit-log-filters {
  grid-template-columns:
    minmax(170px, 1fr)
    minmax(170px, 1fr)
    minmax(170px, 1fr)
    minmax(160px, 0.95fr)
    minmax(160px, 0.95fr)
    auto;
}

.audit-log-filters .filter-actions {
  flex-wrap: nowrap;
  white-space: nowrap;
}

@media (max-width: 1420px) {
  .audit-log-filters {
    grid-template-columns: repeat(3, minmax(190px, 1fr));
  }
}

.checkbox-field {
  grid-template-columns: auto 1fr;
  align-items: center;
  justify-content: start;
}

.checkbox-field .errorlist {
  grid-column: 1 / -1;
}

.copy-registration-form {
  display: grid;
  gap: 16px;
}

.copy-registration-section {
  display: grid;
  gap: 14px;
}

.copy-registration-section__header {
  display: grid;
  gap: 4px;
}

.copy-registration-section__header h2 {
  margin: 0;
  font-size: 20px;
}

.copy-registration-status-list {
  display: grid;
  gap: 10px;
}

.copy-registration-status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.78);
}

.copy-registration-status-card p {
  margin: 4px 0 0;
}

.copy-workplace-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.copy-workplace-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.copy-workplace-option:hover,
.copy-workplace-option:focus-within {
  border-color: rgba(0, 142, 203, 0.34);
  background: rgba(238, 249, 253, 0.9);
  box-shadow: 0 8px 18px rgba(6, 74, 122, 0.08);
}

.copy-workplace-option input {
  width: 18px;
  height: 18px;
}

.copy-workplace-option__name {
  font-weight: 800;
}

@media (max-width: 720px) {
  .copy-registration-status-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .workplace-document-card {
    flex-direction: column;
  }

  .workplace-document-card__meta {
    justify-content: flex-start;
  }
}

.copy-print-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 750;
}

.wizard-step {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.wizard-step__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px 16px;
}

.wizard-step__header > div {
  flex: 1 1 320px;
}

.wizard-step__header h2 {
  margin: 0 0 4px;
}

.wizard-step__header p {
  margin: 0;
  max-width: 72ch;
}

.wizard-step__number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--color-olymp-blue-soft);
  color: var(--color-olymp-blue-deep);
  font-weight: 800;
  font-size: 14px;
}

/* ── Шаг 1: разделы со строками документов ──────────────── */
.wizard-section {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  overflow: hidden;
}

.wizard-section + .wizard-section {
  margin-top: 10px;
}

.wizard-section--complete {
  background: var(--color-surface-soft);
}

.wizard-section__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 10px 14px;
}

.wizard-section__check {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.wizard-section__toggle {
  grid-template-columns: 16px 30px minmax(0, auto);
  flex: 0 1 auto;
}

.wizard-section__title {
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wizard-section__meta {
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.wizard-section__selected {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--color-olymp-blue-soft);
  color: var(--color-olymp-blue-deep);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.wizard-section__body {
  border-top: 1px solid var(--color-border);
}

.wizard-section__body[hidden] {
  display: none;
}

.wizard-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 140ms var(--ease);
}

.wizard-row + .wizard-row {
  border-top: 1px solid rgba(213, 232, 241, 0.7);
}

.wizard-row:hover {
  background: var(--color-surface-soft);
}

.wizard-row:has(input:checked) {
  background: var(--color-olymp-blue-soft);
}

.wizard-row__title {
  flex: 1 1 280px;
  min-width: 200px;
  font-weight: 700;
}

.wizard-row--done .wizard-row__title {
  color: var(--color-muted);
  font-weight: 650;
}

.wizard-row__version,
.wizard-row__pages {
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.wizard-row__pages {
  min-width: 92px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.wizard-row__status {
  min-width: 210px;
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 720px) {
  .wizard-row__pages,
  .wizard-row__status {
    min-width: 0;
    text-align: left;
    justify-content: flex-start;
  }
}

.wizard-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}

.wizard-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  cursor: pointer;
}

.wizard-option:hover {
  border-color: var(--color-border-strong);
}

.wizard-option:has(input:checked) {
  border-color: var(--color-olymp-blue);
  background: var(--color-olymp-blue-soft);
}

.wizard-option__body {
  display: grid;
  gap: 4px;
}

.wizard-option__name {
  font-weight: 750;
}

.wizard-option__meta {
  color: var(--color-muted);
  font-size: 13px;
}

.wizard-summary {
  position: sticky;
  bottom: 12px;
}

.batch-part-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.batch-part-switch__item {
  display: grid;
  gap: 2px;
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  text-decoration: none;
  color: var(--color-text);
}

.batch-part-switch__item:hover {
  border-color: var(--color-border-strong);
}

.batch-part-switch__item--active {
  border-color: var(--color-olymp-blue);
  background: var(--color-olymp-blue-soft);
  color: var(--color-olymp-blue-deep);
}

.batch-part-switch__number {
  font-size: 16px;
  font-weight: 800;
}

.batch-part-switch__meta {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 750;
}

.batch-next-ready {
  box-shadow: 0 0 0 3px var(--color-olymp-blue-tint);
}

.batch-print-groups {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.batch-print-group {
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 14px 16px;
}

.batch-print-group__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
}

.batch-print-group__list {
  margin: 8px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
  font-size: 14px;
}

.field label,
.auth-field label {
  color: var(--color-text);
  font-size: 13px;
  font-weight: 750;
}

/* ── Компактная панель фильтров журнала ─────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 14px;
  padding: 18px 20px;
}

.filter-bar .field {
  min-width: 170px;
  flex: 1 1 170px;
  margin: 0;
}

.filter-bar .field--wide {
  flex: 1 1 220px;
}

.filter-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border: 1px dashed var(--color-border-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--color-olymp-blue-dark);
  font-family: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.filter-toggle:hover {
  background: var(--color-olymp-blue-soft);
}

.filter-toggle svg {
  width: 14px;
  height: 14px;
  transition: transform 160ms var(--ease);
}

.filter-bar.advanced-open .filter-toggle svg {
  transform: rotate(180deg);
}

.filter-advanced {
  display: none;
}

.filter-advanced.is-open {
  display: contents;
}

.filter-advanced-divider {
  flex-basis: 100%;
  height: 1px;
  background: var(--color-border);
  margin: 2px 0 4px;
  display: none;
}

.filter-advanced.is-open .filter-advanced-divider {
  display: block;
}

.result-caption {
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 14px 2px;
}

.result-caption strong {
  color: var(--color-text);
  font-weight: 800;
}

/* ── Единая панель массовых действий журнала ────────────── */
.panel--flush {
  padding: 0;
  overflow: hidden;
}

.panel--flush .table-wrap {
  margin: 0;
}

.bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-soft);
}

.bulk-chip-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px;
  background: #eef2f6;
  border-radius: 999px;
}

.bulk-chip {
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--color-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
}

.bulk-chip:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.7);
}

.bulk-counter {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--color-olymp-blue-soft);
  color: var(--color-olymp-blue-deep);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}

.bulk-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  color: var(--color-warning-text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--color-warning-soft);
  white-space: nowrap;
}

.bulk-shortcut:hover {
  filter: brightness(0.97);
}

.form-control,
.form-select,
input[type="text"],
input[type="password"],
input[type="email"],
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--color-text);
  font: inherit;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.form-select,
select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23064a7a' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.8'/%3E%3C/svg%3E");
  background-position: right 14px center;
  background-repeat: no-repeat;
  background-size: 14px 14px;
  cursor: pointer;
}

.form-control:focus,
.form-select:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 0;
  border-color: var(--color-olymp-blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0, 142, 203, 0.16);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  gap: 7px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: 9px 15px;
  background: #fff;
  color: var(--color-olymp-blue-deep);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(6, 74, 122, 0.12);
}

.btn-primary {
  border-color: var(--color-olymp-blue);
  background: linear-gradient(180deg, #07a2dc 0%, var(--color-olymp-blue) 100%);
  color: #fff;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.88);
  color: var(--color-olymp-blue-deep);
}

.btn-light {
  min-height: 38px;
  padding: 8px 13px;
  border-color: rgba(185, 217, 232, 0.86);
  background: rgba(255, 255, 255, 0.72);
  color: var(--color-olymp-blue-deep);
  box-shadow: none;
}

.btn-light:hover,
.btn-light:focus-visible {
  border-color: rgba(0, 142, 203, 0.34);
  background: rgba(238, 249, 253, 0.9);
  box-shadow: 0 8px 20px rgba(6, 74, 122, 0.08);
}

.btn-light--accent {
  border-color: rgba(0, 142, 203, 0.26);
  background: rgba(238, 249, 253, 0.82);
}

.btn-compact {
  border-radius: 11px;
  font-size: 13px;
  font-weight: 800;
}

.btn-warning {
  border-color: var(--color-olymp-yellow);
  background: linear-gradient(180deg, #ffd947 0%, var(--color-olymp-yellow) 100%);
  color: #4d3a00;
}

.btn-danger {
  border-color: var(--color-danger);
  background: var(--color-danger);
  color: #fff;
}

.btn-link {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.icon-action {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  font-size: 16px;
  line-height: 1;
}

.icon-action--quiet {
  border-color: rgba(185, 217, 232, 0.92);
  background: rgba(255, 255, 255, 0.76);
  color: var(--color-olymp-blue-deep);
  box-shadow: none;
}

.icon-action--quiet:hover,
.icon-action--quiet:focus-visible {
  border-color: rgba(0, 142, 203, 0.34);
  background: rgba(238, 249, 253, 0.95);
  color: var(--color-olymp-blue-dark);
  box-shadow: 0 8px 18px rgba(6, 74, 122, 0.08);
}

.icon-action span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}

.icon-action .button-emoji {
  font-size: 17px;
}

.page-action-button .button-emoji {
  font-size: 15px;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th,
.data-table td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.data-table th {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 800;
  background: var(--color-surface-soft);
}

.data-table th:first-child {
  border-top-left-radius: var(--radius-sm);
}

.data-table th:last-child {
  border-top-right-radius: var(--radius-sm);
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr {
  height: 58px;
  transition: background 140ms ease;
}

.data-table tbody tr:hover {
  background: rgba(238, 249, 253, 0.62);
}

.drag-cell {
  white-space: nowrap;
}

.drag-cell__content {
  display: flex;
  align-items: center;
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-right: 8px;
  border-radius: var(--radius-sm);
  color: var(--color-muted);
  cursor: grab;
  user-select: none;
}

.drag-handle:hover {
  background: var(--color-olymp-blue-soft);
  color: var(--color-olymp-blue-deep);
}

.document-scope-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-self: start;
  gap: 6px;
  margin: 0;
  padding: 4px;
  border: 1px solid rgba(213, 232, 241, 0.72);
  border-radius: 999px;
  background: rgba(238, 249, 253, 0.62);
  width: fit-content;
}

.document-scope-tab {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--color-olymp-blue-deep);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.document-scope-tab:hover,
.document-scope-tab:focus-visible {
  background: #fff;
  color: var(--color-olymp-blue-dark);
  box-shadow: 0 6px 18px rgba(6, 74, 122, 0.08);
}

.document-scope-tab--active {
  background: #fff;
  color: var(--color-olymp-blue-dark);
  box-shadow: 0 6px 18px rgba(6, 74, 122, 0.08);
}

.section-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  margin: 0;
}

.section-toolbar .icon-action svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.1;
}

tr.is-dragging {
  opacity: 0.55;
  background: rgba(238, 249, 253, 0.9);
}

.document-section {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.document-section + .document-section {
  margin-top: 12px;
}

.document-section--unassigned {
  border-style: solid;
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.section-toggle {
  display: inline-grid;
  grid-template-columns: 16px 30px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  flex: 1 1 auto;
  width: auto;
  min-height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.section-toggle:focus-visible {
  outline: 0;
}

.section-toggle:focus-visible .section-icon {
  box-shadow: 0 0 0 4px rgba(0, 142, 203, 0.16);
}

.section-chevron {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid var(--color-muted);
  transform: translateX(3px);
  transition: transform 140ms ease, border-left-color 140ms ease;
}

.section-toggle[aria-expanded="true"] .section-chevron {
  transform: rotate(90deg) translateX(3px);
  border-left-color: var(--color-olymp-blue-deep);
}

.section-icon,
.document-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--color-olymp-blue-deep);
}

.section-icon {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(185, 217, 232, 0.88);
  border-radius: var(--radius-sm);
  background: var(--color-olymp-blue-soft);
}

.section-icon svg,
.document-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.section-icon--folder svg {
  fill: rgba(0, 142, 203, 0.10);
}

.section-title-block {
  display: grid;
  min-width: 0;
}

.section-title {
  color: var(--color-olymp-blue-deep);
  font-size: 18px;
  font-weight: 850;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.section-count-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid rgba(0, 142, 203, 0.18);
  border-radius: 999px;
  background: var(--color-olymp-blue-soft);
  color: var(--color-olymp-blue-deep);
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.section-header__description {
  flex: 0 1 420px;
  min-width: 0;
}

.section-body[hidden] {
  display: none;
}

.document-section.is-drop-target,
.data-table tbody.is-drop-target {
  border-color: rgba(0, 142, 203, 0.46);
  background: rgba(238, 249, 253, 0.72);
  box-shadow: 0 12px 34px rgba(6, 74, 122, 0.12);
}

.document-title-cell {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.document-title-block {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.document-meta {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.document-access-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.document-attention-badge {
  border: 1px solid rgba(255, 196, 0, 0.32);
  background: linear-gradient(180deg, #fff4bf 0%, #ffe588 100%);
  color: #6f5600;
}

.document-warning-action {
  border-color: rgba(255, 196, 0, 0.42);
  background: linear-gradient(180deg, #fff4bf 0%, #ffd947 100%);
  color: #6f5600;
  box-shadow: 0 8px 18px rgba(255, 196, 0, 0.18);
}

.document-warning-action:hover,
.document-warning-action:focus-visible {
  border-color: rgba(227, 176, 0, 0.46);
  background: linear-gradient(180deg, #fff0a8 0%, #ffca24 100%);
  color: #5a4500;
  box-shadow: 0 10px 20px rgba(255, 196, 0, 0.22);
}

.document-access-trigger {
  min-height: auto;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.document-access-trigger:hover,
.document-access-trigger:focus-visible {
  filter: brightness(0.98);
  transform: translateY(-1px);
}

.document-icon {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: rgba(238, 249, 253, 0.86);
  color: var(--color-muted);
}

.section-description {
  margin: 0;
  max-width: 760px;
  color: var(--color-muted);
  font-size: 14px;
  line-height: 1.5;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--color-olymp-blue-soft);
  color: var(--color-olymp-blue-deep);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-approved,
.status-active {
  background: var(--color-success-soft);
  color: var(--color-success);
}

.status-pending {
  background: var(--color-olymp-blue-soft);
  color: var(--color-olymp-blue-deep);
}

.status-warning,
.status-requires_replacement {
  background: var(--color-warning-soft);
  color: var(--color-warning-text);
}

.status-rejected,
.status-danger {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.status-muted,
.status-archived {
  background: #eef2f6;
  color: var(--color-muted);
}

.table-meta {
  margin-top: 6px;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.4;
}

.inline-delivery-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.inline-action-form {
  display: inline-flex;
}

.copy-selection-toolbar {
  justify-content: space-between;
}

.copy-selection-toolbar .action-row {
  align-items: center;
}

.selection-counter {
  color: var(--color-muted);
  font-size: 14px;
  font-weight: 700;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 600;
}

.checkbox-label input[type="checkbox"] {
  inline-size: 16px;
  block-size: 16px;
}

.copy-history-summary {
  display: grid;
  gap: 18px;
}

.next-action-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--color-border);
}

.next-action-card h2,
.next-action-card p {
  margin: 0;
}

.next-action-card--active {
  background: linear-gradient(135deg, rgba(229, 245, 238, 0.95), rgba(255, 255, 255, 0.98));
}

.next-action-card--pending {
  background: linear-gradient(135deg, rgba(230, 244, 252, 0.95), rgba(255, 255, 255, 0.98));
}

.next-action-card--warning {
  background: linear-gradient(135deg, rgba(255, 247, 227, 0.98), rgba(255, 255, 255, 0.98));
}

.next-action-card--muted {
  background: linear-gradient(135deg, rgba(242, 245, 248, 0.98), rgba(255, 255, 255, 0.98));
}

.copy-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px 22px;
}

.copy-history-label {
  display: block;
  margin-bottom: 6px;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.copy-history-timeline {
  display: grid;
  gap: 14px;
}

.copy-history-event {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
}

.copy-history-event:first-child {
  padding-top: 0;
  border-top: 0;
}

.copy-history-event__time {
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 700;
}

.copy-history-event__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.copy-history-event__body p {
  margin: 0;
}

.copy-history-actor {
  color: var(--color-text);
  font-size: 14px;
  font-weight: 600;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}

.approval-order-actions-cell {
  white-space: nowrap;
}

.approval-order-actions {
  flex-wrap: nowrap;
}

.action-menu {
  position: relative;
  display: inline-flex;
}

.action-menu summary {
  list-style: none;
}

.action-menu summary::-webkit-details-marker {
  display: none;
}

.action-menu__content {
  position: fixed;
  right: 0;
  top: calc(100% + 6px);
  z-index: 35;
  display: grid;
  min-width: 180px;
  padding: 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.dashboard-metric {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.dashboard-metric span {
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 750;
}

.dashboard-metric strong {
  color: var(--color-olymp-blue-deep);
  font-size: 34px;
  line-height: 1;
}

.dashboard-metric a,
.quick-links a {
  justify-self: start;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ── Пользовательский дашборд: статусная шапка, показатели, блоки задач ── */

.status-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  margin-bottom: 18px;
  padding: 26px 30px;
  border: 1px solid rgba(213, 232, 241, 0.9);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 88% -20%, rgba(255, 196, 0, 0.16), transparent 52%),
    radial-gradient(circle at 4% 120%, rgba(0, 142, 203, 0.14), transparent 55%),
    linear-gradient(180deg, #ffffff, var(--color-surface-soft));
  box-shadow: var(--shadow-soft);
}

.status-hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--color-olymp-yellow), var(--color-olymp-blue));
}

.status-hero__title {
  margin: 0;
  font-size: 34px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.4px;
}

.status-hero__sub {
  margin: 8px 0 0;
  color: var(--color-muted);
  font-size: 15px;
  font-weight: 650;
}

.status-hero__sub b {
  color: var(--color-warning-text);
  font-weight: 800;
}

.status-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.metric {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 6px;
  padding: 20px 22px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  color: inherit;
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), border-color 180ms var(--ease);
}

.metric:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  border-color: var(--color-border-strong);
}

.metric__label {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.metric__value {
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1.5px;
  color: var(--color-olymp-blue-deep);
}

.metric__hint {
  color: var(--color-muted);
  font-size: 12.5px;
  font-weight: 700;
}

.metric--zero .metric__value {
  color: #b7c4d1;
}

.metric--zero .metric__hint {
  color: #a8b6c4;
}

.metric--attention {
  border-color: rgba(255, 196, 0, 0.55);
  background: linear-gradient(180deg, #fffdf4, var(--color-surface) 62%);
}

.metric--attention::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--color-olymp-yellow);
}

.metric--attention .metric__value {
  color: var(--color-warning-text);
}

.metric--info::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--color-olymp-blue);
}

.metric--info .metric__value {
  color: var(--color-olymp-blue-dark);
}

.metric--good .metric__value {
  color: var(--color-success);
}

.block {
  margin-bottom: 22px;
  padding: 4px 0 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.block__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  padding: 20px 24px 16px;
}

.block__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  background: var(--color-olymp-blue-soft);
  color: var(--color-olymp-blue-dark);
}

.block__icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.block__icon--warning {
  background: var(--color-warning-soft);
  color: var(--color-warning-text);
}

.block__titles {
  flex: 1 1 280px;
}

.block__titles h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.block__titles p {
  margin: 3px 0 0;
  color: var(--color-muted);
  font-size: 13.5px;
  max-width: 68ch;
}

.block__count {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  background: var(--color-olymp-blue-soft);
  color: var(--color-olymp-blue-deep);
  font-variant-numeric: tabular-nums;
}

.block__count--warning {
  background: var(--color-warning-soft);
  color: var(--color-warning-text);
}

.rows {
  display: block;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 14px 24px;
  border-top: 1px solid rgba(213, 232, 241, 0.7);
  transition: background 160ms var(--ease);
}

.row:hover {
  background: var(--color-surface-soft);
}

.row--attention {
  box-shadow: inset 3px 0 0 var(--color-olymp-yellow);
}

.row--pending {
  box-shadow: inset 3px 0 0 var(--color-olymp-blue);
}

.row__body {
  flex: 1 1 320px;
  min-width: 240px;
}

.row__title {
  font-weight: 750;
  font-size: 14.5px;
}

.row__meta {
  margin-top: 3px;
  color: var(--color-muted);
  font-size: 13px;
}

.row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.block__empty {
  margin: 0 24px 22px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--color-success-soft);
  color: var(--color-success);
  display: grid;
  gap: 4px;
  text-align: center;
}

.block__empty strong {
  font-size: 15px;
}

.block__empty span {
  color: #2f8a63;
  font-size: 13.5px;
}

.wp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 14px;
  padding: 4px 24px 24px;
}

.wp-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-soft);
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), border-color 180ms var(--ease);
}

.wp-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  border-color: var(--color-border-strong);
}

a.wp-card {
  text-decoration: none;
  color: inherit;
}

.wp-card__top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ring {
  --value: 0;
  --ring-color: var(--color-success);
  position: relative;
  width: 58px;
  height: 58px;
  flex: none;
  border-radius: 50%;
  background: conic-gradient(var(--ring-color) calc(var(--value) * 1%), #e7eef4 0);
}

.ring::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--color-surface);
}

.ring__label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
}

/* ── Карточка рабочего места ────────────────────────────── */
.workplace-overview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 20px;
}

.workplace-overview__ring {
  width: 72px;
  height: 72px;
}

.workplace-overview__body {
  flex: 1 1 320px;
  display: grid;
  gap: 10px;
}

.workplace-overview__title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.workplace-overview__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.workplace-set__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 18px;
}

.workplace-set__header h2 {
  margin: 0 0 4px;
}

.workplace-set__header p {
  margin: 0;
  max-width: 72ch;
  font-size: 13.5px;
}

.template-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.template-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-soft);
}

.template-card > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.template-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-card .muted-text {
  font-size: 12.5px;
  font-weight: 700;
}

.workplace-docs__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  margin-bottom: 16px;
}

.workplace-docs__search {
  flex: 1 1 260px;
  margin: 0;
}

.workplace-docs__filters {
  gap: 4px;
  padding: 3px;
  background: #eef2f6;
  border-radius: 999px;
}

.workplace-doc-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 12px 14px;
}

.workplace-doc-row + .workplace-doc-row {
  border-top: 1px solid rgba(213, 232, 241, 0.7);
}

.workplace-doc-row:hover {
  background: var(--color-surface-soft);
}

.workplace-doc-row[hidden] {
  display: none;
}

.workplace-doc-row__main {
  flex: 1 1 320px;
  min-width: 220px;
  display: grid;
  gap: 3px;
}

.workplace-doc-row__title {
  font-weight: 700;
}

.workplace-doc-row__meta {
  color: var(--color-muted);
  font-size: 13px;
}

.workplace-doc-row__actions {
  margin-left: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.ring--warning {
  --ring-color: var(--color-olymp-yellow);
}

.ring--pending {
  --ring-color: var(--color-olymp-blue);
}

.wp-card--warning .ring {
  --ring-color: var(--color-olymp-yellow);
}

.wp-card--pending .ring {
  --ring-color: var(--color-olymp-blue);
}

.wp-card__name {
  font-weight: 750;
  font-size: 15px;
}

.wp-card__code {
  color: var(--color-muted);
  font-size: 12.5px;
  font-weight: 700;
}

.wp-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.block__empty-state {
  margin: 0 24px 24px;
}

a.status-badge {
  text-decoration: none;
  cursor: pointer;
  transition: background 160ms var(--ease), color 160ms var(--ease);
}

a.status-badge:hover {
  background: var(--color-border-strong);
  color: var(--color-text);
}

.status-badge--action {
  border: 1px solid rgba(0, 142, 203, 0.35);
  background: rgba(0, 142, 203, 0.14);
  color: var(--color-olymp-blue-dark);
  font-weight: 800;
}

a.status-badge--action:hover,
button.status-badge--action:hover {
  border-color: var(--color-olymp-blue);
  background: rgba(0, 142, 203, 0.22);
  color: var(--color-olymp-blue-dark);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-list {
  display: grid;
  align-content: start;
  gap: 12px;
}

.dashboard-list h2 {
  margin: 0;
  font-size: 18px;
}

.dashboard-list ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dashboard-list li {
  display: grid;
  grid-template-columns: minmax(90px, 0.35fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid var(--color-border);
}

.dashboard-list li:first-child {
  border-top: 0;
}

.dashboard-list strong,
.dashboard-list span {
  min-width: 0;
}

.settings-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.settings-summary div {
  display: grid;
  gap: 5px;
}

.settings-summary strong {
  overflow-wrap: anywhere;
}

.delivery-status-panel h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.delivery-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin: 0;
}

.delivery-status-grid div {
  display: grid;
  gap: 5px;
}

.delivery-status-grid dt {
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 750;
}

.delivery-status-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 750;
}

.status-pill {
  display: inline-flex;
  width: fit-content;
  border-radius: var(--radius-md);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 850;
}

.status-pill--sent {
  background: var(--color-success-soft);
  color: var(--color-success);
}

.status-pill--failed {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.status-pill--skipped {
  background: var(--color-warning-soft);
  color: #755600;
}

.muted-text {
  margin: 0;
  color: var(--color-muted);
}

.verification-page {
  background-color: var(--color-page);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.verification-container {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.verification-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.verification-status-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.verification-status-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 8px;
}

.verification-status-icon svg {
  width: 48px;
  height: 48px;
}

.verification-status-hero--current .verification-status-icon {
  background-color: rgba(46, 139, 87, 0.1);
  color: #2e8b57;
}

.verification-status-hero--current .verification-status-title {
  color: #2e8b57;
}

.verification-status-hero--outdated .verification-status-icon {
  background-color: var(--color-warning-soft);
  color: #b38900;
}

.verification-status-hero--outdated .verification-status-title {
  color: #b38900;
}

.verification-status-hero--muted .verification-status-icon {
  background-color: rgba(100, 116, 139, 0.1);
  color: #64748b;
}

.verification-status-hero--muted .verification-status-title {
  color: #64748b;
}

.verification-status-title {
  font-size: 34px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.5px;
  text-transform: uppercase;
}

.verification-status-desc {
  color: var(--color-muted);
  font-size: 16px;
  margin: 0;
  line-height: 1.4;
}

.verification-details {
  background-color: var(--color-surface);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(23, 38, 54, 0.05), 0 2px 8px rgba(23, 38, 54, 0.03);
  border: 1px solid rgba(207, 231, 242, 0.5);
}

.verification-doc-header {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.verification-doc-code {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-muted);
}

.verification-doc-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
  line-height: 1.35;
}

.verification-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.verification-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.verification-field--full {
  grid-column: 1 / -1;
}

.verification-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-muted);
}

.verification-value {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
  word-break: break-word;
}

.verification-footer {
  text-align: center;
  color: var(--color-muted);
  font-size: 13px;
}

.verification-footer p {
  margin: 0 0 6px 0;
}

.action-menu__content a,
.action-menu__content button {
  display: flex;
  width: 100%;
  min-height: 34px;
  align-items: center;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.action-menu__content a:hover,
.action-menu__content button:hover,
.action-menu__content a:focus-visible,
.action-menu__content button:focus-visible {
  outline: 0;
  background: var(--color-olymp-blue-soft);
  color: var(--color-olymp-blue-deep);
}


.participant-access-form {
  display: grid;
  gap: 18px;
}

.participant-list {
  display: grid;
  gap: 10px;
}

.participant-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.participant-row:hover {
  border-color: var(--color-border-strong);
  background: #fff;
  box-shadow: 0 10px 24px rgba(6, 74, 122, 0.08);
}

.participant-row__check input {
  width: 18px;
  height: 18px;
  accent-color: var(--color-olymp-blue);
}

.participant-row__content {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.participant-row__name {
  color: var(--color-text);
  font-weight: 800;
}

.participant-row__meta {
  color: var(--color-muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.form-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.viewer-shell {
  display: grid;
  gap: 10px;
}

.viewer-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: none;
}

.viewer-toolbar h1 {
  margin: 2px 0 0;
  color: var(--color-olymp-blue-deep);
  font-size: 20px;
  font-weight: 850;
  line-height: 1.2;
}

.viewer-toolbar .page-subtitle {
  margin: 4px 0 0;
  font-size: 14px;
}

.viewer-pages-wrap {
  position: relative;
  min-height: calc(100vh - 190px);
  overflow: hidden;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: #252525;
  box-shadow: var(--shadow-panel);
  user-select: none;
}

.viewer-page-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
  min-height: calc(100vh - 190px);
  padding: 18px;
  overflow: auto;
}

.viewer-page {
  display: flex;
  justify-content: center;
}

.viewer-page-image {
  display: block;
  width: min(100%, 960px);
  height: auto;
  background: #fff;
  box-shadow: 0 10px 28px rgba(5, 28, 44, 0.22);
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.viewer-print-frame {
  position: fixed;
  left: -10000px;
  bottom: 0;
  width: 1px;
  height: 1px;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.watermark {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(6, 74, 122, 0.11);
  font-size: clamp(24px, 5vw, 64px);
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
  transform: rotate(-24deg);
  pointer-events: none;
  user-select: none;
}

.empty-state {
  display: grid;
  gap: 8px;
  padding: 26px;
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: rgba(238, 249, 253, 0.55);
  color: var(--color-muted);
  text-align: center;
}

.notification-list {
  display: grid;
  gap: 10px;
}

.notification-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
}

.notification-item-unread {
  border-color: rgba(0, 142, 203, 0.34);
  background: rgba(238, 249, 253, 0.66);
}

.notification-item p {
  margin: 0 0 4px;
  color: var(--color-text);
  font-weight: 700;
}

.notification-item span {
  color: var(--color-muted);
  font-size: 13px;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 34px 22px;
  background:
    radial-gradient(circle at 20% 20%, rgba(0, 142, 203, 0.11), transparent 30%),
    radial-gradient(circle at 84% 78%, rgba(255, 196, 0, 0.08), transparent 25%),
    linear-gradient(145deg, #fbfeff 0%, #f2fbfe 52%, #fffef7 100%);
}

.auth-card {
  width: min(100%, 460px);
  padding: 30px;
  border: 1px solid rgba(213, 232, 241, 0.95);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-auth);
  backdrop-filter: blur(20px);
}

.auth-card__brand {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-bottom: 22px;
  text-align: center;
}

.auth-card h1 {
  margin: 0;
  color: var(--color-olymp-blue-deep);
  font-size: 32px;
  font-weight: 850;
  line-height: 1.05;
}

.auth-card__subtitle {
  margin: 0;
  max-width: 360px;
  color: #35536b;
  font-size: 15px;
  line-height: 1.35;
}

.auth-card .alert-error {
  margin: 0 0 18px;
}

.auth-card__form {
  display: grid;
  gap: 15px;
}

.auth-altcha {
  display: grid;
  gap: 8px;
}

.auth-altcha altcha-widget {
  width: 100%;
}

.field-error {
  margin: 0;
  color: var(--color-danger);
  font-size: 13px;
  line-height: 1.4;
}

.auth-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
}

.auth-note {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 13px;
  text-align: center;
}

.auth-note__line {
  display: block;
}

.login-page,
.login-card {
  /* Backward compatibility for older templates; use auth-shell/auth-card for new work. */
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(23, 38, 54, 0.48);
  backdrop-filter: blur(10px);
}

.modal-backdrop:has(.workplace-drawer) {
  place-items: stretch;
  padding: 0;
  justify-items: end;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-window {
  width: min(100%, 560px);
  overflow: hidden;
  border: 1px solid rgba(213, 232, 241, 0.96);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(23, 38, 54, 0.26);
}

.modal-header,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 20px;
}

.modal-header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-soft);
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

.modal-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: #fff;
  color: var(--color-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.modal-body {
  padding: 20px;
}

.modal-window--access-summary {
  width: min(100%, 720px);
  max-height: min(86vh, 860px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.modal-window--access-summary .modal-header,
.modal-window--access-summary .modal-actions {
  padding: 15px 18px;
}

.modal-window--access-summary .modal-body {
  min-height: 0;
  overflow-y: auto;
  padding: 16px 18px 18px;
}

.page-subtitle {
  margin: 4px 0 0;
  color: var(--color-muted);
  font-size: 14px;
  line-height: 1.45;
}

.access-summary-modal {
  display: grid;
  gap: 14px;
}

.access-summary-group {
  display: grid;
  gap: 8px;
}

.access-summary-group__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.access-summary-group__header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.access-summary-list {
  display: grid;
  gap: 6px;
}

.access-summary-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px 12px;
  padding: 9px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(251, 253, 255, 0.92);
}

.access-summary-item__content {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.access-summary-actions {
  margin-top: 0;
  gap: 8px;
  justify-self: end;
  align-self: center;
}

.modal-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-soft);
}

@media (max-width: 720px) {
  .modal-window--access-summary {
    width: min(100%, 100vw - 24px);
    max-height: calc(100vh - 24px);
  }

  .access-summary-item {
    grid-template-columns: 1fr;
  }

  .access-summary-actions {
    justify-self: start;
  }
}

@media (max-width: 860px) {
  .app-header-inner,
  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .document-list-header {
    grid-template-columns: 1fr auto;
  }

  .document-list-header .document-scope-tabs {
    grid-column: 1;
    grid-row: 1;
  }

  .document-list-header .section-toolbar {
    grid-column: 2;
    grid-row: 1;
  }

  .brand-link {
    min-width: 0;
  }

  .app-nav {
    justify-content: flex-start;
    border-radius: var(--radius-lg);
  }

  .document-form,
  .form-actions {
    grid-template-columns: 1fr;
  }

  .participant-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .participant-row .status-badge {
    grid-column: 2;
    justify-self: start;
  }

  .viewer-toolbar {
    display: grid;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .section-header__description {
    flex-basis: auto;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 14px;
  }

  .content {
    padding: 22px 14px 38px;
  }

  .panel {
    padding: 15px;
    border-radius: var(--radius-md);
  }

  .page-header h1 {
    font-size: 26px;
  }

  .document-list-header {
    gap: 10px;
  }

  .document-scope-tabs {
    width: 100%;
  }

  .document-scope-tab {
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
    text-align: center;
  }

  .dashboard-list li {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .auth-shell {
    padding: 22px 14px;
  }

  .auth-card {
    padding: 24px;
    border-radius: var(--radius-lg);
  }

  .project-logo--auth {
    gap: 14px;
  }

  .project-logo--auth .project-logo__mark {
    width: 88px;
  }

  .project-logo--auth .project-logo__name {
    font-size: 30px;
  }

  .project-logo--auth .project-logo__subtitle {
    font-size: 12px;
  }

  .auth-card h1 {
    font-size: 29px;
  }

  .modal-backdrop {
    padding: 14px;
  }
}
