:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #334155;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-2: #0ea5e9;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: linear-gradient(180deg, #0b1220 0%, var(--bg) 100%);
  color: var(--text);
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

.container {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* Кабинет начальника — шире, без «узкой колонки» по центру */
body.page-manager .container {
  width: min(1140px, calc(100% - 32px));
  padding: 24px 20px 48px;
}

body.page-manager .tests-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

body.page-manager #stats-grid {
  grid-template-columns: repeat(4, 1fr);
}

body.page-manager .manager-toolbar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 8px;
}

@media (max-width: 900px) {
  body.page-manager #stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  body.page-manager .manager-toolbar-grid {
    grid-template-columns: 1fr;
  }
}

.header {
  text-align: center;
  margin-bottom: 24px;
}

.badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-position {
  text-transform: none;
  letter-spacing: 0.01em;
  line-height: 1.35;
  max-width: min(100%, 320px);
}

h1 {
  margin: 12px 0 8px;
  font-size: clamp(1.5rem, 5vw, 2rem);
  line-height: 1.2;
}

.subtitle {
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.card {
  background: var(--surface);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.card h2,
.card h3 {
  margin-top: 0;
}

label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

input[type="text"],
input[type="search"],
input[type="password"],
input[type="date"],
select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--surface-2);
  background: #0b1220;
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 14px;
  -webkit-appearance: none;
  appearance: none;
}

input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  height: 16px;
  width: 16px;
  margin-right: 4px;
  cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%2394a3b8' d='M4 4l8 8M12 4l-8 8' stroke='%2394a3b8' stroke-width='1.5'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

input::placeholder {
  color: #64748b;
}

input:focus,
select:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394a3b8' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.login-hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin: -6px 0 12px;
  line-height: 1.4;
}

.login-staff-toggle {
  display: block;
  width: 100%;
  margin: 14px 0 0;
  padding: 12px 14px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  text-align: center;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.login-staff-toggle:hover {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.55);
}

.login-staff-toggle-muted {
  margin-top: 10px;
  margin-bottom: 0;
  color: #0b3b75;
  background: rgba(125, 211, 252, 0.28);
  border-color: rgba(56, 189, 248, 0.45);
  font-weight: 600;
}

.login-staff-toggle-muted:hover {
  color: #0a2f5f;
  background: rgba(125, 211, 252, 0.4);
  border-color: rgba(14, 165, 233, 0.65);
}

.btn-help-search {
  width: 100%;
  margin: 4px 0 16px;
  padding: 14px 18px;
}

.btn-help-search.is-loading {
  opacity: 0.75;
  pointer-events: none;
}

.login-card {
  padding: 28px 26px 26px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

/* Главная: светлая карточка входа с зелёным оттенком */
body.page-home .login-card {
  background: linear-gradient(165deg, #f7fef9 0%, #ecf9f1 42%, #dff5ea 100%);
  border: 1px solid rgba(31, 157, 99, 0.38);
  box-shadow:
    0 22px 44px rgba(12, 52, 36, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.65) inset;
  backdrop-filter: none;
  color: #0f172a;
}

body.page-home .login-card .login-card-head h2 {
  color: #14532d;
}

body.page-home .login-card .login-card-lead {
  color: #2d6a4f;
}

body.page-home .login-card .form-field label {
  color: #1b5e40;
}

body.page-home .login-card input[type="text"],
body.page-home .login-card input[type="password"] {
  background: #ffffff;
  border-color: rgba(31, 157, 99, 0.35);
  color: #0f172a;
}

body.page-home .login-card input[type="text"]:focus,
body.page-home .login-card input[type="password"]:focus {
  border-color: #1f9d63;
  box-shadow: 0 0 0 3px rgba(31, 157, 99, 0.22);
}

body.page-home .login-card .btn-login {
  background: linear-gradient(180deg, #2eb872 0%, #1f9d63 100%);
  border-color: #17804f;
  color: #fff;
}

body.page-home .login-card .btn-login:hover {
  background: linear-gradient(180deg, #36c47c 0%, #24a86d 100%);
}

.login-card-head {
  margin-bottom: 20px;
}

.login-card-head h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.login-card-lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-field {
  margin-bottom: 4px;
}

.form-field label {
  margin-bottom: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #94a3b8;
}

.form-field-muted input[readonly] {
  opacity: 0.75;
  font-size: 0.9rem;
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 10px;
  height: 6px;
  margin-top: -3px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2394a3b8' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  pointer-events: none;
}

body.page-home select {
  margin-bottom: 0;
  background-color: #0f172a;
  border-color: rgba(148, 163, 184, 0.22);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.page-home select:focus,
body.page-home input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

body.page-home input[type="text"],
body.page-home input[type="password"] {
  margin-bottom: 0;
  background-color: #0f172a;
  border-color: rgba(148, 163, 184, 0.22);
}

.btn-login {
  margin-top: 18px;
  padding: 16px 20px;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.btn-login.is-loading {
  opacity: 0.75;
  pointer-events: none;
}

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

.test-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  width: 100%;
  padding: 20px 18px 18px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.85));
  color: #e2e8f0;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.test-card:hover {
  border-color: rgba(56, 189, 248, 0.55);
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35);
}

.test-card-done {
  border-color: rgba(148, 163, 184, 0.35);
}

.test-card-locked {
  cursor: default;
}

.test-card-locked:hover {
  transform: none;
  box-shadow: none;
  border-color: rgba(148, 163, 184, 0.35);
}

.test-card-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.test-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.test-card-top .test-card-title {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.btn-icon-delete {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(248, 113, 113, 0.45);
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-icon-delete:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(248, 113, 113, 0.7);
  color: #fecaca;
}

.btn-icon-delete:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.test-card-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.test-card-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.test-card-score-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: rgba(148, 163, 184, 0.14);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.28);
}

.test-card-metric {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 4.75rem;
  padding: 6px 12px 5px;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.28);
}

.test-card-metric-value {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.1;
  color: #f1f5f9;
}

.test-card-metric-label {
  margin-top: 2px;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: #94a3b8;
  text-transform: capitalize;
}

.test-card-title {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.3;
}

.test-card-status {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.test-card-status-pass {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
}

.test-card-status-inactive {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

button.test-card-status-toggle {
  margin: 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

button.test-card-status-toggle:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

button.test-card-status-toggle:disabled {
  opacity: 0.6;
  cursor: wait;
}

.test-card-status-fail {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
}

.test-card-status-pass-muted,
.test-card-status-fail-muted {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
}

.test-card-status-new {
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
}

.test-card-priority,
button.test-card-priority-toggle {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

button.test-card-priority-toggle {
  margin: 0;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}

button.test-card-priority-toggle:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

button.test-card-priority-toggle:disabled {
  opacity: 0.6;
  cursor: wait;
}

.test-card-priority--required {
  background: rgba(251, 191, 36, 0.2);
  border: 1px solid rgba(251, 191, 36, 0.55);
  color: #fde68a;
}

.test-card-priority--additional {
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.45);
  color: #cbd5e1;
}

.test-card-desc {
  margin: 0 0 14px;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.45;
  flex: 1;
}

.test-card-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 14px;
}

.test-card-meta strong {
  color: #e2e8f0;
  font-weight: 600;
}

.test-card-action {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--accent);
}

.test-card-static {
  cursor: default;
  display: flex;
  flex-direction: column;
}

.test-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
}

.test-card-retake-notice {
  margin: 0 0 8px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: clamp(0.8rem, 2.5vw, 0.88rem);
  line-height: 1.45;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  color: #fde68a;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.test-card-retake-notice strong {
  color: #fef3c7;
  font-weight: 700;
}

.test-card-static:hover {
  transform: none;
  box-shadow: none;
}

.test-card-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 180px;
  text-decoration: none;
  color: var(--accent);
  border-style: dashed;
  background: rgba(56, 189, 248, 0.06);
}

.test-card-add:hover {
  background: rgba(56, 189, 248, 0.12);
  color: #e0f2fe;
}

.test-card-add-icon {
  font-size: 2.2rem;
  font-weight: 300;
  line-height: 1;
}

.test-card-add-text {
  font-size: 0.95rem;
  font-weight: 600;
}

.card-section-head {
  margin-bottom: 16px;
}

.card-section-head h2 {
  margin: 0 0 6px;
}

.card-section-head .subtitle {
  margin: 0;
}

.manager-tests-actions {
  margin-top: 16px;
}

.manager-tests-actions .btn {
  width: 100%;
  text-align: center;
  text-decoration: none;
  display: block;
  box-sizing: border-box;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.topbar-actions .btn {
  white-space: nowrap;
  text-decoration: none;
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions {
    justify-content: stretch;
  }

  .topbar-actions .btn {
    flex: 1 1 auto;
    text-align: center;
  }
}

.btn-card-action {
  display: block;
  width: 100%;
  margin-top: 14px;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}

body input[type="file"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background-color: #0f172a;
  color: #e2e8f0;
  font-family: inherit;
}

.field-required {
  color: #f87171;
}

body textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background-color: #0f172a;
  color: #e2e8f0;
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  min-height: 100px;
}

body textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.home-eyebrow {
  margin: 0 0 10px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.home-header {
  margin-bottom: 22px;
}

.logo-block {
  text-align: center;
}

.logo-brand-name {
  margin: 18px 0 6px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #f8fafc;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.logo-brand-tagline {
  margin: 0;
  font-size: 0.95rem;
  color: #94a3b8;
  letter-spacing: 0.04em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #082f49;
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
}

.btn-success {
  background: linear-gradient(135deg, #4ade80, var(--success));
  color: #052e16;
}

.spvt-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(4px);
}

.spvt-confirm-dialog {
  width: min(440px, 100%);
  padding: 24px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: linear-gradient(165deg, #0f172a, #1e293b);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.55);
}

.spvt-confirm-title {
  margin: 0 0 12px;
  font-size: 1.2rem;
  color: #f1f5f9;
}

.spvt-confirm-message {
  margin: 0 0 20px;
  color: #cbd5e1;
  font-size: 0.95rem;
  line-height: 1.55;
}

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

.spvt-confirm-actions .btn {
  min-width: 120px;
}

.spvt-form-dialog .form-field {
  margin-bottom: 16px;
}

.spvt-form-dialog .form-field input[type="number"] {
  margin-bottom: 0;
}

.ticket-time-unlimited-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  color: #e2e8f0;
  font-size: 0.95rem;
  cursor: pointer;
}

.ticket-time-unlimited-row input {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}

#ticket-time-field.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

#import-excel-modal.import-excel-overlay {
  align-items: center;
  overflow-y: auto;
}

.import-excel-dialog {
  width: min(520px, 100%);
  max-height: min(88vh, 720px);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.import-excel-header {
  flex-shrink: 0;
  padding: 20px 24px 0;
}

.import-excel-header .spvt-confirm-title {
  margin-bottom: 8px;
}

.import-excel-file-label {
  margin: 0 0 0;
}

.import-excel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 12px 24px 8px;
  -webkit-overflow-scrolling: touch;
}

.import-excel-actions {
  flex-shrink: 0;
  margin: 0;
  padding: 14px 24px 20px;
  border-top: 1px solid rgba(148, 163, 184, 0.28);
  background: linear-gradient(165deg, #0f172a, #1e293b);
}

.import-excel-stats {
  margin: 0 0 12px;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 0.95rem;
  line-height: 1.5;
}

.import-excel-stats strong {
  color: #e2e8f0;
}

.import-excel-errors {
  margin: 0 0 12px;
  padding-left: 1.2rem;
  color: #fca5a5;
  font-size: 0.88rem;
  max-height: 120px;
  overflow-y: auto;
}

.import-excel-distribution {
  margin-bottom: 8px;
}

.import-excel-dist-summary {
  margin: 6px 0 8px;
}

.import-excel-dist-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.import-excel-dist-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.6);
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.import-excel-dist-list li span:last-child {
  color: #94a3b8;
  white-space: nowrap;
}

.import-mode-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 0;
  color: #e2e8f0;
  font-size: 0.95rem;
  cursor: pointer;
}

.import-mode-row input {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}

.form-label {
  display: block;
  font-size: 0.9rem;
  color: #94a3b8;
  margin-bottom: 4px;
}

.btn-danger {
  background: linear-gradient(135deg, #f87171, var(--danger));
  color: #450a0a;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.stat {
  background: #0b1220;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}

a.stat-clickable {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}

a.stat-clickable:hover {
  border-color: rgba(56, 189, 248, 0.45);
  background: #0f172a;
}

.worker-tests-cell {
  min-width: 220px;
}

.worker-test-line {
  margin-bottom: 6px;
  line-height: 1.45;
}

.worker-test-line:last-child {
  margin-bottom: 0;
}

.workers-filters-card h2 {
  color: #f1f5f9;
}

.workers-filters-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 16px;
  margin-bottom: 14px;
}

@media (max-width: 720px) {
  .workers-filters-grid {
    grid-template-columns: 1fr;
  }
}

.workers-filters-grid .form-field {
  margin: 0;
}

.workers-filters-grid label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.workers-filters-grid input,
.workers-filters-grid select {
  width: 100%;
  margin-bottom: 0;
}

.workers-filters-reset {
  width: 100%;
  max-width: 220px;
}

.workers-date-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.workers-date-wrap input[type="date"] {
  width: 100%;
  margin-bottom: 0;
  padding-right: 4.5rem;
  box-sizing: border-box;
}

.workers-date-clear {
  position: absolute;
  right: 2.5rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: #ef4444;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  background: rgba(15, 23, 42, 0.85);
}

.workers-date-clear:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.2);
}

.workers-date-clear:active {
  background: rgba(239, 68, 68, 0.35);
}

.workers-date-wrap.is-all-time .workers-date-clear {
  display: none;
}

.workers-date-wrap.is-all-time input[type="date"] {
  color: var(--muted);
  font-style: italic;
  padding-right: 2.75rem;
}

.workers-date-wrap.is-all-time input[type="date"]::-webkit-datetime-edit {
  color: var(--muted);
}

.workers-date-wrap.is-all-time input[type="date"]::placeholder {
  color: var(--muted);
}

.workers-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.workers-pagination-info {
  color: var(--muted);
  font-size: 0.9rem;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.85rem;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
}

.stat-label {
  color: var(--muted);
  font-size: 0.85rem;
}

.option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  margin-bottom: 10px;
  border-radius: 12px;
  border: 1px solid var(--surface-2);
  background: #0b1220;
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
}

.option.selected {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.12);
}

/* Подсказка: вопрос с несколькими правильными ответами (экран работника) */
.question-hint-wrap {
  margin: 0 0 18px;
}

.question-hint {
  margin: 0;
  padding: 12px 16px;
  border-radius: 12px;
  border-left: 4px solid rgba(56, 189, 248, 0.85);
  background: rgba(56, 189, 248, 0.1);
  font-size: 0.92rem;
  line-height: 1.5;
  color: #cbd5e1;
}

.question-hint strong {
  color: #e0f2fe;
  font-weight: 600;
}

.options--multi {
  margin-top: 2px;
}

.option--multi {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  text-align: left;
}

.option-multi__mark {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin-top: 2px;
  border-radius: 8px;
  border: 2px solid rgba(148, 163, 184, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
  color: transparent;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.option--multi.selected .option-multi__mark {
  border-color: #38bdf8;
  background: linear-gradient(145deg, #7dd3fc, #38bdf8);
  color: #0f172a;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

.option-multi__body {
  flex: 1;
  line-height: 1.45;
  white-space: normal;
}

.option--multi.selected {
  border-color: rgba(56, 189, 248, 0.75);
  background: rgba(56, 189, 248, 0.14);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25);
}

/* Фильтры таблицы «Результаты» (кабинет начальника) */
.results-filters-card {
  margin: 14px 0 20px;
  padding: 16px 18px 18px;
  border-radius: 14px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  background: linear-gradient(
    165deg,
    rgba(15, 23, 42, 0.92) 0%,
    rgba(30, 41, 59, 0.55) 100%
  );
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.results-filters-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #e2e8f0;
  letter-spacing: 0.02em;
}

.results-filters-lead {
  margin: 0 0 16px;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--muted);
  max-width: 52rem;
}

.results-filters-reset-btn {
  margin-top: 4px;
}

@media (max-width: 900px) {
  .results-filters-card .workers-filters-grid {
    grid-template-columns: 1fr;
  }
}

.progress {
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0 20px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--success));
  width: 0%;
  transition: width 0.25s ease;
}

.question-timer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid rgba(96, 165, 250, 0.25);
  font-size: 0.95rem;
}

.question-timer[hidden] {
  display: none !important;
}

.topbar--test {
  flex-wrap: wrap;
  gap: 12px;
}

.question-timer--card {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  margin: 0 0 16px;
  padding: 14px 18px;
  border-width: 2px;
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(56, 189, 248, 0.12);
}

.question-timer--card .question-timer__label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.question-timer--card .question-timer__value {
  font-size: 2rem;
  line-height: 1.1;
  color: #38bdf8;
}

.question-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 20px;
  margin: 0 0 18px;
}

.question-head-row #question-text {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  line-height: 1.35;
}

.question-timer--inline {
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  margin: 0;
  padding: 10px 14px;
  min-width: 92px;
  border-width: 2px;
  border-radius: 12px;
}

.question-timer--inline .question-timer__label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  line-height: 1.2;
}

.question-timer--inline .question-timer__value {
  font-size: 1.65rem;
  line-height: 1.1;
}

@media (max-width: 640px) {
  .question-head-row {
    flex-direction: column;
    gap: 12px;
  }

  .question-timer--inline {
    align-self: flex-end;
  }
}

.question-timer--warn {
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(251, 191, 36, 0.08);
}

.question-timer--urgent {
  border-color: rgba(239, 68, 68, 0.6);
  background: rgba(239, 68, 68, 0.1);
}

.question-timer__value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--accent);
}

.question-timer--warn .question-timer__value,
.question-timer--urgent .question-timer__value {
  color: #fbbf24;
}

.question-timer--urgent .question-timer__value {
  color: #f87171;
}

.time-cell {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  line-height: 1.35;
}

.time-cell-hint {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 400;
}

.alert {
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  line-height: 1.5;
}

.alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fecaca;
}

.alert-success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #bbf7d0;
}

.alert-info {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #bae6fd;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--surface-2);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.status-ready {
  color: var(--success);
  font-weight: 700;
}

.status-not-ready {
  color: var(--danger);
  font-weight: 700;
}

.status-pending {
  color: var(--warning);
  font-weight: 700;
}

.status-reset {
  color: var(--muted);
  font-style: italic;
}

.th-actions,
.td-actions {
  width: 48px;
  text-align: center;
  vertical-align: middle;
}

.btn-reset-attempt {
  border: none;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn-reset-attempt:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.25);
  transform: rotate(-90deg);
}

.btn-reset-attempt:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hidden {
  display: none !important;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.topbar .btn {
  width: auto;
  padding: 10px 14px;
  font-size: 0.9rem;
}

.role-cards {
  display: grid;
  gap: 12px;
}

.role-card {
  display: block;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.role-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.role-card span {
  color: var(--muted);
  font-size: 0.92rem;
}

@media (min-width: 640px) {
  .role-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Главная: базовый цвет; картинка и оверлей — в index.html с сервера + site_settings.js */
body.page-home {
  background-color: #0b1220;
}

body.page-home .header h1 {
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
}

body.page-home .subtitle {
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

body.page-home .card,
body.page-home .role-card {
  background: rgba(30, 41, 59, 0.92);
  backdrop-filter: blur(8px);
}

body.page-home .home-shell {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(16px, 4vw, 48px);
  min-height: 100vh;
  padding: 24px clamp(20px, 4vw, 48px) 40px clamp(20px, 5vw, 64px);
  max-width: 1280px;
  margin: 0;
  width: 100%;
}

body.page-home .home-main {
  flex: 0 1 420px;
  width: min(420px, 100%);
  margin: 0;
  padding: 0;
  align-self: center;
}

body.page-home .home-logo-panel {
  position: relative;
  flex: 0 1 min(560px, 52vw);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: none;
}

body.page-home .home-logo-panel::after {
  content: "";
  position: absolute;
  inset: 4% 2% 8% 2%;
  border-radius: 50%;
  background: radial-gradient(
    ellipse 72% 78% at 50% 48%,
    rgba(148, 163, 184, 0.1) 0%,
    rgba(15, 23, 42, 0.04) 42%,
    transparent 68%
  );
  pointer-events: none;
  z-index: 0;
}

.logo-shine {
  position: relative;
  z-index: 1;
  display: block;
  width: min(520px, 50vw);
  max-width: 100%;
  line-height: 0;
  isolation: isolate;
}

.logo-shine img {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: brightness(1.08) contrast(1.08);
}

.logo-shine::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  -webkit-mask-image: var(--logo-mask, url("/static/images/ink-logo.png"));
  mask-image: var(--logo-mask, url("/static/images/ink-logo.png"));
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-mode: alpha;
  mask-mode: alpha;
  background: linear-gradient(
    105deg,
    transparent 0%,
    transparent 34%,
    rgba(255, 255, 255, 0.12) 42%,
    rgba(255, 255, 255, 0.45) 48%,
    rgba(255, 255, 255, 0.75) 50%,
    rgba(255, 255, 255, 0.45) 52%,
    rgba(255, 255, 255, 0.12) 58%,
    transparent 66%,
    transparent 100%
  );
  background-size: 240% 100%;
  background-repeat: no-repeat;
  background-position: 130% 0;
  animation: logo-shimmer 8s cubic-bezier(0.42, 0, 0.2, 1) infinite;
  pointer-events: none;
  mix-blend-mode: overlay;
  opacity: 0.95;
}

@keyframes logo-shimmer {
  0%,
  78%,
  100% {
    background-position: 130% 0;
  }
  22% {
    background-position: -35% 0;
  }
}

/* —— Билеты и вопросы (кабинет менеджера) —— */
.tickets-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.tickets-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tickets-empty {
  margin: 0;
  text-align: center;
  padding: 8px 0;
}

.ticket-card {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.55);
  overflow: hidden;
}

.ticket-card-open {
  border-color: rgba(56, 189, 248, 0.35);
}

.ticket-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  cursor: default;
}

.ticket-toggle {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.12);
  color: #e2e8f0;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
}

.ticket-toggle:hover {
  background: rgba(56, 189, 248, 0.2);
}

.ticket-title {
  margin: 0;
  flex: 1;
  font-size: 1.05rem;
  font-weight: 600;
}

.ticket-meta {
  font-size: 0.85rem;
  color: #94a3b8;
  white-space: nowrap;
}

.ticket-delete-btn {
  flex-shrink: 0;
  margin-left: 4px;
}

.ticket-body {
  padding: 0 16px 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.ticket-questions {
  list-style: none;
  margin: 0 0 14px;
  padding: 12px 0 0;
}

.ticket-question-item {
  padding: 12px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.ticket-question-item:last-child {
  border-bottom: none;
}

.ticket-question-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.ticket-question-num {
  color: #64748b;
  font-weight: 600;
  flex-shrink: 0;
}

.ticket-question-text {
  flex: 1;
  line-height: 1.45;
}

.ticket-question-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.btn-link-edit,
.btn-link-delete {
  border: none;
  background: transparent;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  opacity: 0.75;
  border-radius: 6px;
}

.btn-link-edit {
  color: #38bdf8;
}

.btn-link-edit:hover {
  opacity: 1;
  background: rgba(56, 189, 248, 0.12);
}

.btn-link-delete {
  color: #f87171;
  font-size: 1.35rem;
}

.btn-link-delete:hover {
  opacity: 1;
  background: rgba(248, 113, 113, 0.12);
}

.ticket-question-item-editing {
  padding-bottom: 16px;
}

.ticket-question-item .question-form-wrap {
  margin-top: 12px;
  padding: 14px;
}

.ticket-question-options {
  margin: 0;
  padding-left: 1.6rem;
  font-size: 0.9rem;
  color: #cbd5e1;
}

.ticket-question-options li {
  margin: 4px 0;
}

.ticket-option-correct {
  color: #4ade80;
  font-weight: 600;
}

.ticket-option-correct::after {
  content: " ✓";
}

.ticket-no-questions {
  margin: 12px 0 0;
}

.btn-add-question {
  width: 100%;
  margin-bottom: 12px;
}

.question-form-wrap {
  margin-top: 8px;
  padding: 16px;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.question-form .form-hint {
  margin: 0 0 12px;
  font-size: 0.85rem;
}

.answer-options-fieldset {
  border: none;
  margin: 0 0 16px;
  padding: 0;
}

.answer-options-fieldset legend {
  font-weight: 600;
  margin-bottom: 4px;
  padding: 0;
}

.answer-options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.answer-option-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.answer-option-correct {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.answer-option-correct input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #4ade80;
  cursor: pointer;
}

.answer-option-text {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: #0f172a;
  color: #e2e8f0;
  font-family: inherit;
  font-size: 0.95rem;
}

.btn-icon-remove {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
}

.btn-icon-remove:hover {
  background: rgba(248, 113, 113, 0.28);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.9rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  cursor: pointer;
  font-size: 0.92rem;
  color: #cbd5e1;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  accent-color: #38bdf8;
}

.question-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.question-form-actions .btn {
  flex: 1;
  min-width: 140px;
}

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

@media (max-width: 900px) {
  body.page-home .home-shell {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding-left: 20px;
    padding-right: 20px;
  }

  body.page-home .home-main {
    flex: 1 1 auto;
    width: 100%;
    max-width: 420px;
    align-self: flex-start;
  }

  body.page-home .home-logo-panel {
    order: -1;
    padding-top: 0;
  }

  .logo-shine {
    width: min(360px, 88vw);
    margin: 0 auto;
  }
}

/* —— Результат теста (работник, A2) —— */
.result-card {
  padding: 20px 18px 22px;
}

.result-card__eyebrow {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}

.result-hero {
  text-align: center;
  padding: 20px 16px 18px;
  border-radius: 16px;
  margin-bottom: 18px;
}

.result-hero--pass {
  background: linear-gradient(160deg, rgba(34, 197, 94, 0.22), rgba(34, 197, 94, 0.06));
  border: 1px solid rgba(34, 197, 94, 0.45);
}

.result-hero--fail {
  background: linear-gradient(160deg, rgba(239, 68, 68, 0.22), rgba(239, 68, 68, 0.06));
  border: 1px solid rgba(239, 68, 68, 0.45);
}

.result-hero__icon {
  font-size: 2.75rem;
  line-height: 1;
  margin-bottom: 8px;
}

.result-hero__title {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.result-hero--pass .result-hero__title {
  color: #86efac;
}

.result-hero--fail .result-hero__title {
  color: #fca5a5;
}

.result-hero__subtitle {
  margin: 8px 0 0;
  font-size: 1.05rem;
  color: var(--text);
  opacity: 0.92;
}

.result-score-badge {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 1.15rem;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.35);
}

.result-facts {
  margin: 0 0 16px;
  display: grid;
  gap: 10px;
}

.result-facts dt {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.result-facts dd {
  margin: 2px 0 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.result-next {
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.28);
  margin-bottom: 16px;
}

.result-next__title {
  margin: 0 0 8px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.result-next__text {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text);
}

.result-extra {
  margin: 0 0 14px;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.45;
  text-align: center;
}

.btn-block {
  width: 100%;
  display: block;
}

.test-access-hint {
  margin: 12px 0 0;
}

.test-access-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0 20px;
}

.test-access-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--surface-2);
  background: rgba(15, 23, 42, 0.35);
  cursor: pointer;
}

.test-access-row:has(input:not(:checked)) {
  opacity: 0.72;
  border-color: rgba(239, 68, 68, 0.35);
}

.test-access-checkbox {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.test-access-row__body {
  flex: 1;
  min-width: 0;
}

.test-access-row__title {
  display: block;
  font-weight: 600;
  font-size: 1rem;
}

.test-access-row__slug {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 2px;
}

.test-access-row__state {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
}

.test-access-row:has(input:not(:checked)) .test-access-row__state {
  color: #fca5a5;
}

.test-access-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Управление персоналом */
.personnel-toolbar {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

@media (min-width: 640px) {
  .personnel-toolbar {
    grid-template-columns: 1fr auto auto;
    align-items: end;
  }
}

.personnel-search-field {
  margin: 0;
}

.personnel-active-only {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  white-space: nowrap;
}

.personnel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.personnel-count {
  margin: 8px 0 0;
}

.personnel-hint {
  margin: 4px 0 0;
  font-size: 0.85rem;
}

.personnel-group {
  margin-bottom: 12px;
  padding: 0;
  overflow: hidden;
}

.personnel-group__head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: none;
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.personnel-group__head:hover {
  background: rgba(255, 255, 255, 0.07);
}

.personnel-group__count {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted, #94a3b8);
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 10px;
  border-radius: 999px;
}

.personnel-group__body {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.personnel-group--empty .personnel-group__head {
  margin-bottom: 0;
}

.personnel-group__empty-hint {
  margin: 0 0 12px;
  padding: 0 4px;
  font-size: 0.88rem;
}

.personnel-table {
  width: 100%;
  font-size: 0.92rem;
}

.personnel-table .th-select,
.personnel-row__select {
  width: 36px;
  text-align: center;
}

.personnel-row {
  cursor: pointer;
}

.personnel-row.is-selected {
  background: rgba(59, 130, 246, 0.15);
}

.personnel-row--inactive {
  opacity: 0.65;
}

.personnel-row__name {
  font-weight: 500;
  min-width: 160px;
}

.personnel-dept-select {
  width: 100%;
  min-width: 140px;
  max-width: 280px;
  font-size: 0.88rem;
}

.badge-muted {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
}

.badge-success {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.badge-role-admin {
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}

.badge-role-moderator {
  background: rgba(168, 85, 247, 0.2);
  color: #d8b4fe;
}

.role-badge-btn {
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.role-badge-btn:hover:not(:disabled) {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.role-badge-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.badge-role-static {
  cursor: default;
}

.actions-table__time {
  white-space: nowrap;
  font-size: 0.88rem;
  color: #94a3b8;
}

.actions-table__message {
  max-width: 420px;
  line-height: 1.4;
}

.personnel-dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  max-width: 420px;
  width: calc(100% - 24px);
  background: var(--card-bg, #1e293b);
  color: inherit;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.personnel-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.personnel-dialog form {
  padding: 20px;
}

.personnel-dialog h2 {
  margin: 0 0 16px;
  font-size: 1.15rem;
}

.role-assign-pick {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.role-assign-pick__legend {
  padding: 0 6px;
  font-size: 0.85rem;
  color: #94a3b8;
}

.role-assign-pick__option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.95rem;
}

.moderator-candidates {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(50vh, 360px);
  overflow-y: auto;
  margin: 12px 0;
}

.moderator-candidate-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  cursor: pointer;
}

.moderator-candidate-btn:hover:not(:disabled) {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.35);
}

.moderator-candidate-name {
  font-weight: 500;
}

.moderator-candidate-meta,
.moderator-candidate-login {
  font-size: 0.85rem;
  color: #94a3b8;
}

.personnel-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.text-muted {
  color: var(--text-muted, #94a3b8);
  font-weight: 400;
}

.dept-add-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 12px;
}

.dept-add-form__field {
  flex: 1 1 220px;
  margin: 0;
}

body.page-personnel .container {
  width: min(1280px, calc(100% - 24px));
  padding: 24px 16px 48px;
}

.dept-list-card {
  padding: 20px 18px 24px;
}

.dept-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dept-bulk-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

@media (min-width: 520px) {
  .dept-bulk-actions {
    grid-template-columns: 1fr 1fr;
  }
}

.dept-bulk-btn {
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.dept-bulk-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.dept-bulk-btn--show {
  color: #ecfdf5;
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  border-color: rgba(34, 197, 94, 0.45);
  box-shadow: 0 2px 10px rgba(34, 197, 94, 0.25);
}

.dept-bulk-btn--show:hover:not(:disabled) {
  background: linear-gradient(180deg, #4ade80 0%, #22c55e 100%);
}

.dept-bulk-btn--hide {
  color: #fff1f2;
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.22);
}

.dept-bulk-btn--hide:hover:not(:disabled) {
  background: linear-gradient(180deg, #f87171 0%, #ef4444 100%);
}

.dept-bulk-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.dept-search-field {
  margin: 0 0 12px;
  max-width: 100%;
}

.dept-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
  padding: 4px 4px 8px;
}

.dept-table {
  width: 100%;
  min-width: 580px;
  table-layout: fixed;
}

.dept-table th:nth-child(1),
.dept-table td:nth-child(1) {
  width: auto;
  min-width: 140px;
}

.dept-table th:nth-child(2),
.dept-table td:nth-child(2) {
  width: 72px;
  text-align: center;
}

.dept-table th:nth-child(3),
.dept-table td.dept-table__login {
  width: 108px;
  min-width: 108px;
  text-align: center;
  vertical-align: middle;
}

.dept-table__login .dept-login-toggle {
  display: inline-block;
  max-width: 100%;
}

.dept-table th.th-actions,
.dept-table td.dept-table__actions {
  width: 132px;
  min-width: 132px;
}

.dept-table__name {
  font-weight: 500;
  word-break: break-word;
  padding-right: 12px;
}

.dept-table__count {
  text-align: center;
  vertical-align: middle;
}

.dept-table__actions {
  vertical-align: middle;
  padding: 8px 4px 8px 8px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.dept-table__actions .btn {
  margin: 0;
  width: 100%;
  min-width: 0;
  padding-left: 10px;
  padding-right: 10px;
  font-size: 0.82rem;
  white-space: normal;
  line-height: 1.25;
}

@media (min-width: 720px) {
  .dept-list-card {
    padding: 22px 24px 28px;
  }

  .dept-table {
    min-width: 720px;
  }

  .dept-table th:nth-child(3),
  .dept-table td.dept-table__login {
    width: 120px;
    min-width: 120px;
  }

  .dept-table th.th-actions,
  .dept-table td.dept-table__actions {
    width: 200px;
    min-width: 200px;
  }

  .dept-table__actions {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .dept-table__actions .btn {
    width: auto;
    flex: 1 1 88px;
    min-width: 88px;
  }
}

/* —— Экраны работника: светлая тема ИНК (белый + зелёный) —— */
html:has(body.page-worker) {
  background: #ffffff;
}

body.page-worker {
  --ink-green: #1a4731;
  --ink-green-hover: #22634a;
  --ink-green-soft: #e8f2ec;
  --ink-green-border: rgba(26, 71, 49, 0.14);
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef5f1;
  --text: #0f1f18;
  --muted: #4a6358;
  --accent: #1a4731;
  --accent-2: #2d6b4f;
  --success: #15803d;
  --danger: #b91c1c;
  --warning: #b45309;
  --shadow: 0 8px 32px rgba(26, 71, 49, 0.08);
  background: #ffffff;
  color: var(--text);
}

body.page-worker a {
  color: var(--ink-green-hover);
}

.worker-page {
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* Верхняя панель — те же стили, что у .worker-footer (зеркально) */
.worker-topbar {
  flex-shrink: 0;
  width: 100%;
  border-bottom: 1px solid rgba(26, 71, 49, 0.14);
  background: linear-gradient(180deg, #f7fbf9 0%, #e8f2ec 100%);
  box-shadow: 0 4px 24px rgba(26, 71, 49, 0.06);
}

.worker-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 14px;
  width: 100%;
  margin: 0 auto;
  padding: 14px clamp(16px, 3vw, 40px);
  box-sizing: border-box;
}

.worker-topbar__brand {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.worker-topbar__logo {
  display: flex;
  align-items: center;
  max-width: min(280px, 48vw);
  line-height: 0;
}

.worker-topbar__logo img.site-logo {
  display: block;
  height: 46px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}

.worker-topbar__logo::before {
  display: none !important;
  content: none !important;
}

.worker-topbar__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  gap: 10px 14px;
}

.worker-main {
  flex: 1;
  min-width: 0;
  width: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: stretch;
  padding-top: 20px;
}

body.page-worker .worker-container {
  width: 100%;
  max-width: none;
  flex: 1;
  min-width: 0;
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 40px) 40px;
  box-sizing: border-box;
}

.worker-logo-shine,
.worker-topbar__logo {
  max-width: 100%;
}

.worker-profile {
  margin-bottom: 20px;
}

.worker-profile--compact {
  margin-bottom: 16px;
}

.worker-profile__department {
  margin: 10px 0 0;
  font-size: clamp(0.95rem, 2.5vw, 1.05rem);
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink-green);
}

.worker-profile__name {
  margin: 8px 0 0;
  font-size: clamp(1.15rem, 3.5vw, 1.45rem);
  line-height: 1.25;
}

.worker-profile__lead {
  margin: 6px 0 0;
}

body.page-worker .logo-shine img {
  filter: none;
}

body.page-worker .logo-shine::before {
  background: linear-gradient(
    105deg,
    transparent 0%,
    transparent 34%,
    rgba(26, 71, 49, 0.08) 42%,
    rgba(26, 71, 49, 0.22) 48%,
    rgba(26, 71, 49, 0.35) 50%,
    rgba(26, 71, 49, 0.22) 52%,
    rgba(26, 71, 49, 0.08) 58%,
    transparent 66%,
    transparent 100%
  );
}

body.page-worker h1,
body.page-worker h2,
body.page-worker h3 {
  color: var(--text);
}

body.page-worker .subtitle {
  color: var(--muted);
}

body.page-worker .badge {
  background: var(--ink-green-soft);
  color: var(--ink-green);
  border: 1px solid var(--ink-green-border);
}

body.page-worker .worker-profile .badge-position {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  font-weight: 600;
  line-height: 1.45;
  text-align: left;
}

body.page-worker .worker-profile .worker-badge-line {
  display: block;
}

body.page-worker .card {
  background: var(--surface);
  border: 1px solid var(--ink-green-border);
  box-shadow: var(--shadow);
  color: var(--text);
}

body.page-worker .btn-primary {
  background: linear-gradient(135deg, var(--ink-green), var(--accent-2));
  color: #ffffff;
}

body.page-worker .btn-primary:hover {
  filter: brightness(1.06);
}

body.page-worker .btn-secondary {
  background: #ffffff;
  color: var(--ink-green);
  border: 1px solid rgba(26, 71, 49, 0.28);
}

body.page-worker .btn-secondary:hover {
  background: var(--ink-green-soft);
}

body.page-worker .alert-error {
  background: #fef2f2;
  border: 1px solid rgba(185, 28, 28, 0.28);
  color: #991b1b;
}

body.page-worker .alert-success {
  background: #ecfdf5;
  border: 1px solid rgba(21, 128, 61, 0.28);
  color: #166534;
}

body.page-worker .alert-info {
  background: var(--ink-green-soft);
  border: 1px solid var(--ink-green-border);
  color: var(--ink-green);
}

body.page-worker .test-card {
  background: linear-gradient(165deg, #f3faf6 0%, #e3f0e9 100%);
  border: 1px solid rgba(26, 71, 49, 0.24);
  color: var(--text);
  box-shadow: 0 6px 22px rgba(26, 71, 49, 0.08);
}

body.page-worker .test-card:hover {
  border-color: rgba(26, 71, 49, 0.42);
  background: linear-gradient(165deg, #edf7f1 0%, #d9ebe2 100%);
  box-shadow: 0 12px 28px rgba(26, 71, 49, 0.12);
}

body.page-worker .test-card-locked {
  background: linear-gradient(165deg, #f7faf8 0%, #eef3f0 100%);
  opacity: 0.92;
}

body.page-worker .test-card-locked:hover {
  border-color: rgba(26, 71, 49, 0.24);
  background: linear-gradient(165deg, #f7faf8 0%, #eef3f0 100%);
  box-shadow: 0 6px 22px rgba(26, 71, 49, 0.08);
}

body.page-worker .test-card-title {
  color: var(--text);
}

body.page-worker .test-card-desc,
body.page-worker .test-card-meta {
  color: var(--muted);
}

body.page-worker .test-card-meta strong {
  color: var(--text);
}

body.page-worker .test-card-action {
  color: var(--ink-green);
  font-weight: 700;
}

body.page-worker .test-card-status-pass {
  background: #dcfce7;
  color: #166534;
}

body.page-worker .test-card-status-fail {
  background: #fee2e2;
  color: #991b1b;
}

body.page-worker .test-card-status-pass-muted,
body.page-worker .test-card-status-fail-muted {
  background: #f1f5f3;
  color: var(--muted);
}

body.page-worker .test-card-status-new {
  background: var(--ink-green-soft);
  color: var(--ink-green);
}

body.page-worker .test-card-priority--required {
  background: #fef3c7;
  border: 1px solid rgba(180, 83, 9, 0.35);
  color: #92400e;
}

body.page-worker .test-card-priority--additional {
  background: var(--ink-green-soft);
  border: 1px solid var(--ink-green-border);
  color: var(--ink-green);
}

body.page-worker .test-card-score-badge {
  background: var(--ink-green-soft);
  color: var(--ink-green);
}

body.page-worker .test-card-retake-notice {
  background: #f1f5f9;
  border: 1px solid rgba(100, 116, 139, 0.28);
  color: #334155;
  font-weight: 500;
}

body.page-worker .test-card-retake-notice strong {
  color: #0f172a;
  font-weight: 700;
}

body.page-worker .test-card-time-limit {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--ink-green-soft);
  border: 1px solid rgba(26, 71, 49, 0.2);
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink-green);
  font-weight: 600;
}

body.page-worker .test-card-time-limit__icon {
  flex-shrink: 0;
  line-height: 1.3;
}

body.page-worker .question-timer--inline {
  border-color: rgba(26, 71, 49, 0.35);
  background: var(--ink-green-soft);
}

body.page-worker .question-timer--inline .question-timer__value {
  color: var(--ink-green);
}

body.page-worker .option {
  background: #ffffff;
  border: 1px solid rgba(26, 71, 49, 0.18);
  color: var(--text);
}

body.page-worker .option:hover {
  border-color: rgba(26, 71, 49, 0.35);
  background: var(--ink-green-soft);
}

body.page-worker .option.selected {
  border-color: var(--ink-green);
  background: var(--ink-green-soft);
  box-shadow: 0 0 0 1px rgba(26, 71, 49, 0.12);
}

body.page-worker .option--multi.selected {
  border-color: rgba(26, 71, 49, 0.55);
  background: var(--ink-green-soft);
  box-shadow: 0 0 0 1px rgba(26, 71, 49, 0.15);
}

body.page-worker .option--multi.selected .option-multi__mark {
  border-color: var(--ink-green);
  background: linear-gradient(145deg, #3d8b66, var(--ink-green));
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(26, 71, 49, 0.15);
}

body.page-worker .option-multi__mark {
  border-color: rgba(26, 71, 49, 0.35);
}

body.page-worker .question-hint {
  border-left-color: var(--ink-green);
  background: var(--ink-green-soft);
  color: var(--text);
}

body.page-worker .question-hint strong {
  color: var(--ink-green);
}

body.page-worker .progress {
  background: var(--surface-2);
}

body.page-worker .progress-bar {
  background: linear-gradient(90deg, var(--ink-green), #3d8b66);
}

body.page-worker .question-timer {
  background: var(--ink-green-soft);
  border-color: rgba(26, 71, 49, 0.22);
  color: var(--text);
}

body.page-worker .question-timer--card {
  border-color: rgba(26, 71, 49, 0.35);
  background: var(--ink-green-soft);
}

body.page-worker .question-timer--card .question-timer__value {
  color: var(--ink-green);
}

body.page-worker .question-timer--warn {
  border-color: rgba(180, 83, 9, 0.45);
  background: #fffbeb;
}

body.page-worker .question-timer--warn .question-timer__value {
  color: #b45309;
}

body.page-worker .question-timer--urgent {
  border-color: rgba(185, 28, 28, 0.45);
  background: #fef2f2;
}

body.page-worker .question-timer--urgent .question-timer__value {
  color: #b91c1c;
}

body.page-worker .result-hero--pass {
  background: linear-gradient(160deg, #dcfce7, #f0fdf4);
  border: 1px solid rgba(21, 128, 61, 0.35);
}

body.page-worker .result-hero--fail {
  background: linear-gradient(160deg, #fee2e2, #fef2f2);
  border: 1px solid rgba(185, 28, 28, 0.35);
}

body.page-worker .result-hero--pass .result-hero__title {
  color: #166534;
}

body.page-worker .result-hero--fail .result-hero__title {
  color: #991b1b;
}

body.page-worker .result-hero__subtitle {
  color: var(--text);
}

body.page-worker .result-score-badge {
  background: rgba(26, 71, 49, 0.08);
  color: var(--ink-green);
}

body.page-worker .result-next {
  background: var(--ink-green-soft);
  border: 1px solid var(--ink-green-border);
}

body.page-worker .result-next__title {
  color: var(--ink-green);
}

body.page-worker .result-next__text {
  color: var(--text);
}

body.page-worker #question-text {
  color: var(--text);
}

/* Нижняя панель работника (те же кнопки — .worker-footer-btn) */
.worker-footer {
  width: 100%;
  margin-top: auto;
  border-top: 1px solid rgba(26, 71, 49, 0.14);
  background: linear-gradient(180deg, #f7fbf9 0%, #e8f2ec 100%);
  box-shadow: 0 -4px 24px rgba(26, 71, 49, 0.06);
}

.worker-footer__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 14px clamp(16px, 3vw, 40px);
  max-width: 960px;
  margin: 0 auto;
}

a.worker-footer-btn {
  text-decoration: none;
}

.worker-footer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid rgba(26, 71, 49, 0.28);
  background: #ffffff;
  color: var(--ink-green);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.12s ease;
  box-shadow: 0 2px 10px rgba(26, 71, 49, 0.08);
}

.worker-footer-btn:hover {
  background: var(--ink-green-soft);
  border-color: rgba(26, 71, 49, 0.4);
  box-shadow: 0 4px 16px rgba(26, 71, 49, 0.12);
}

.worker-footer-btn:active {
  transform: scale(0.98);
}

body.page-worker .worker-feedback-overlay {
  background: rgba(15, 31, 24, 0.45);
}

body.page-worker .worker-feedback-dialog {
  background: #ffffff;
  border: 1px solid rgba(26, 71, 49, 0.2);
  box-shadow: 0 20px 48px rgba(26, 71, 49, 0.18);
}

body.page-worker .worker-feedback-dialog .spvt-confirm-title {
  color: var(--text);
}

body.page-worker .worker-feedback-dialog .spvt-confirm-message {
  color: var(--muted);
}

.worker-feedback-hint {
  margin: 0 0 20px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--ink-green-soft);
  border: 1px solid var(--ink-green-border);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink-green);
}

body.page-worker .worker-feedback-dialog .spvt-confirm-actions {
  justify-content: center;
}

body.page-worker .worker-feedback-dialog .spvt-confirm-actions .btn {
  min-width: 140px;
}

body.page-worker .tests-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 18px;
}

body.page-worker .tests-grid .test-card {
  flex: 0 0 auto;
  width: min(280px, 100%);
  max-width: 280px;
}

@media (max-width: 900px) {
  .worker-main {
    justify-content: stretch;
  }

  .worker-main {
    padding-top: 6px;
  }

  body.page-worker .worker-container {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    margin-left: 0;
    padding: 8px clamp(16px, 3vw, 24px) 36px;
  }
}

@media (max-width: 560px) {
  .worker-topbar__inner {
    padding: 12px;
    gap: 10px;
  }

  .worker-topbar__logo {
    max-width: min(200px, 46vw);
  }

  .worker-topbar__logo img.site-logo {
    height: 38px;
  }

  .worker-topbar__actions .worker-footer-btn {
    padding: 9px 16px;
    font-size: 0.88rem;
  }

  .worker-footer__inner {
    padding: 12px;
  }

  .worker-footer-btn {
    flex: 1 1 140px;
    max-width: 280px;
  }

  body.page-worker .worker-container {
    padding: 8px 12px 32px;
  }

  body.page-worker .tests-grid .test-card {
    width: 100%;
    max-width: none;
  }
}
