: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-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);
}

* {
  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;
}

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

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

.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;
}

.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;
}

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

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

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

.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-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;
}

.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 {
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.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);
}

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-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: #7a5900;
}

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

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

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

.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;
}

.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);
}

.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[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-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-soft);
}

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

  .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;
  }

  .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;
  }
}
