@import url("https://fonts.googleapis.com/css2?family=Unbounded:wght@700&display=swap");

:root {
  color-scheme: light;
  --bg-ground: #f9fbfc;
  --bg-main: #ffffff;
  --bg-hover: rgba(0, 0, 0, 0.03);
  --border-soft: rgba(0, 0, 0, 0.12);
  --text-primary: rgba(0, 0, 0, 0.9);
  --text-secondary: rgba(0, 0, 0, 0.6);
  --text-tertiary: rgba(0, 0, 0, 0.45);
  --accent: #1783ff;
  --accent-hover: #0f6de0;
  --danger: #c62828;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg-ground);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto,
    Ubuntu, "Noto Sans", Arial, sans-serif;
}

/* ——— Страница входа ——— */

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(23, 131, 255, 0.12), transparent),
    var(--bg-ground);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-main);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 28px 28px 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.04);
}

.login-brand {
  font-family: "Unbounded", system-ui, sans-serif;
  font-size: 18px;
  letter-spacing: -0.5px;
  text-transform: uppercase;
  margin: 0 0 6px;
  background: linear-gradient(135deg, #ffffff 0%, #e8f2ff 100%);
  border: 1px solid rgba(23, 131, 255, 0.18);
  padding: 10px 12px;
  border-radius: 10px;
  color: #212121;
}

.login-subtitle {
  margin: 0 0 22px;
  color: var(--text-secondary);
  font-size: 14px;
}

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

.field label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.field input[type="text"],
.field input[type="password"],
.field input[type="tel"],
.field select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
  color: var(--text-primary);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(23, 131, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(23, 131, 255, 0.15);
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0;
}

.password-toggle:hover {
  color: var(--text-secondary);
  background: var(--bg-hover);
}

.password-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(23, 131, 255, 0.2);
  color: var(--accent);
}

.password-toggle svg {
  width: 20px;
  height: 20px;
  display: block;
}

.password-toggle svg[hidden] {
  display: none !important;
}

.remember-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  user-select: none;
}

.remember-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.login-error {
  display: none;
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(198, 40, 40, 0.08);
  color: var(--danger);
  font-size: 14px;
}

.login-error.visible {
  display: block;
}

.btn-primary {
  margin-top: 4px;
  appearance: none;
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:active {
  transform: translateY(1px);
}

/* ——— Простая оболочка после входа ——— */

.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  background: #f9fbfc;
  border-right: 1px solid var(--border-soft);
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  z-index: 2;
}

.sidebar-project {
  margin: 10px 10px 12px;
  font-family: "Unbounded", system-ui, sans-serif;
  font-size: 14px;
  color: #212121;
  letter-spacing: -0.5px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #ffffff 0%, #e8f2ff 100%);
  border: 1px solid rgba(23, 131, 255, 0.18);
  padding: 8px 10px;
  border-radius: 10px;
  flex-shrink: 0;
}

.sidebar h2 {
  margin: 0 8px 12px;
  font-size: 22px;
  line-height: 1.1;
  font-weight: 800;
  color: #111;
  flex-shrink: 0;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 4px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.nav-btn {
  appearance: none;
  border: none;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  text-decoration: none;
}

.nav-btn:hover {
  background: var(--bg-hover);
}

.nav-btn.active {
  background: rgba(23, 131, 255, 0.1);
  color: var(--accent);
  font-weight: 600;
}

.sidebar-footer {
  margin-top: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 4px;
}

.sidebar-top {
  display: contents;
}

.sidebar-menu-toggle {
  display: none;
}

.user-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  font-size: 13px;
  color: var(--text-secondary);
}

.btn-link {
  appearance: none;
  border: none;
  background: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 13px;
  padding: 0;
}

.workspace {
  padding: 28px 32px;
}

.workspace h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.workspace p {
  margin: 0;
  color: var(--text-secondary);
}

.workspace-note {
  margin: 0 0 10px !important;
}

.password-change-banner {
  margin-top: 8px;
  max-width: 420px;
  padding: 20px 22px 22px;
  border-radius: 14px;
  border: 2px solid #e65100;
  background: linear-gradient(180deg, #fff3e0 0%, #ffe0b2 100%);
  box-shadow: 0 8px 24px rgba(230, 81, 0, 0.12);
}

.password-change-title {
  margin: 0 0 8px !important;
  font-size: 22px;
  font-weight: 700;
  color: #bf360c !important;
  letter-spacing: 0.01em;
}

.password-change-text {
  margin: 0 0 16px !important;
  color: rgba(0, 0, 0, 0.75) !important;
  line-height: 1.45;
}

.password-change-form {
  display: grid;
  gap: 12px;
}

.password-change-form .field {
  display: grid;
  gap: 6px;
}

.password-change-form .field span {
  font-size: 13px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.7);
}

.password-change-form .field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
}

.password-change-form .field input:focus {
  outline: 2px solid rgba(230, 81, 0, 0.35);
  border-color: #e65100;
}

.password-change-form .form-error {
  margin: 0;
  color: var(--danger);
  font-size: 14px;
}

.password-change-form .btn-primary {
  justify-self: start;
  margin-top: 4px;
}

.module-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 20px;
}

.module-tab {
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  font-size: 14px;
  background: #fff;
}

.module-tab:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.module-tab.active {
  border-color: rgba(23, 131, 255, 0.35);
  background: rgba(23, 131, 255, 0.1);
  color: var(--accent);
  font-weight: 600;
}

.data-table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

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

.data-table th {
  color: var(--text-secondary);
  font-weight: 600;
  background: #f9fbfc;
  white-space: nowrap;
}

.data-table th .th-sort {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-right: 6px;
  vertical-align: middle;
  line-height: 1;
}

.data-table th .th-sort-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #b0bac5;
  padding: 0;
  margin: 0;
  width: 14px;
  height: 10px;
  font-size: 9px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.data-table th .th-sort-btn:hover {
  color: var(--accent, #1783ff);
}

.data-table th .th-sort-btn.is-active {
  color: var(--accent, #1783ff);
}

.data-table th .th-label {
  vertical-align: middle;
}

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

.data-table tbody tr:hover td {
  background: rgba(23, 131, 255, 0.03);
}

.row-link {
  cursor: pointer;
}

.row-link:focus {
  outline: 2px solid rgba(23, 131, 255, 0.35);
  outline-offset: -2px;
}

.row-unreviewed td {
  background: rgba(198, 40, 40, 0.04);
}

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  background: #eef1f4;
  color: var(--text-secondary);
}

.status-badge-new {
  background: rgba(198, 40, 40, 0.12);
  color: var(--danger);
}

.status-badge-reviewed {
  background: rgba(25, 118, 210, 0.12);
  color: #1565c0;
}

.status-badge-rejected {
  background: #eceff1;
  color: #546e7a;
}

.status-badge-hired {
  background: rgba(46, 125, 50, 0.12);
  color: #2e7d32;
}

.cand-skills {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 280px;
}

.cand-skills-empty {
  color: var(--text-secondary);
}

.cand-skills-level {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.2;
}

.cand-skills-forte .cand-skills-level {
  color: #b26a00;
}

.cand-skills-good .cand-skills-level {
  color: #1565c0;
}

.cand-skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.cand-skill-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.35;
  background: #eef1f4;
  color: var(--text-primary);
}

.cand-skills-forte .cand-skill-chip {
  background: rgba(245, 166, 35, 0.16);
}

.cand-skills-good .cand-skill-chip {
  background: rgba(25, 118, 210, 0.12);
}

.btn-danger {
  appearance: none;
  border: 1px solid rgba(198, 40, 40, 0.35);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--danger);
  background: #fff;
  cursor: pointer;
}

.btn-danger:hover {
  background: rgba(198, 40, 40, 0.08);
}

.btn-danger:disabled,
.btn-secondary:disabled,
.card-toolbar .btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.back-link {
  margin: 0 0 10px !important;
}

.back-link a {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
}

.readonly-value {
  width: 100%;
  min-height: 42px;
  padding: 11px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  font-size: 15px;
  background: #f9fbfc;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.card-input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
  color: var(--text-primary);
}

.card-input:disabled,
.card-input.is-empty {
  background: #eef1f4;
  color: var(--text-tertiary);
  cursor: not-allowed;
}

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

.workspace-head h1 {
  margin: 0;
}

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

.card-toolbar .btn-primary {
  margin-top: 0;
}

.candidate-form .card-input:not(:disabled):not([readonly]) {
  background: #fff;
  color: var(--text-primary);
  cursor: text;
}

.candidate-form select.card-input {
  cursor: pointer;
}

.btn-secondary {
  appearance: none;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  background: #fff;
  cursor: pointer;
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

.modal-card-wide {
  width: min(100%, 640px);
}

.account-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.role-select {
  min-width: 140px;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
}

.th-actions,
.td-actions {
  width: 96px;
  text-align: center;
  white-space: nowrap;
}

.td-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
}

.td-actions-wide {
  width: auto;
  min-width: 140px;
}

.btn-icon {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #fff;
  color: var(--text-secondary);
  cursor: pointer;
}

.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--accent);
  border-color: var(--accent);
}

.btn-icon:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.dir-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.dir-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: #fff;
  text-decoration: none;
  color: inherit;
}

.dir-card:hover {
  border-color: var(--accent);
}

.dir-card strong {
  font-size: 16px;
}

.dir-card span {
  font-size: 14px;
  color: var(--text-secondary);
}

.template-body {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  min-height: 360px;
  white-space: pre;
}

.placeholders-help {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: #fff;
}

.placeholders-help summary {
  cursor: pointer;
  font-weight: 600;
}

.placeholders-help code {
  display: inline-block;
  margin: 2px 4px 2px 0;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--bg-hover, #f3f4f6);
  font-size: 12px;
}

.btn-tiny {
  margin-top: 0;
  padding: 8px 12px;
  font-size: 13px;
}


.features-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 8px;
}

.feature-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}

.feature-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.modal-actions a.btn-secondary {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}


.roles-root {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.role-card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 16px 18px;
}

.role-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.role-card h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.role-code {
  margin: 0 0 6px !important;
  font-size: 13px;
  color: var(--text-tertiary) !important;
}

.role-desc {
  margin: 0 !important;
  max-width: 60ch;
}

.role-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.role-status {
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 5ch;
}

.btn-save-role {
  min-width: 120px;
  padding: 10px 14px;
  font-size: 14px;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px 12px;
}

.feature-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  color: var(--text-primary);
  user-select: none;
}

.feature-row input {
  margin-top: 2px;
  accent-color: var(--accent);
}

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

  .sidebar {
    position: static;
    height: auto;
    overflow: visible;
    border-right: none;
    border-bottom: 1px solid var(--border-soft);
  }

  .sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
  }

  .sidebar-top .sidebar-project {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
  }

  .sidebar-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    appearance: none;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: #fff;
    color: #111;
    cursor: pointer;
    padding: 0;
  }

  .sidebar-menu-toggle:hover {
    background: var(--bg-hover);
  }

  .sidebar-menu-icon-open {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 18px;
  }

  .sidebar-menu-icon-open span {
    display: block;
    height: 2px;
    width: 100%;
    border-radius: 2px;
    background: currentColor;
  }

  .sidebar-menu-icon-close {
    display: none;
    font-size: 28px;
    line-height: 1;
    font-weight: 400;
  }

  .sidebar.nav-open .sidebar-menu-icon-open {
    display: none;
  }

  .sidebar.nav-open .sidebar-menu-icon-close {
    display: block;
  }

  .sidebar > h2,
  .sidebar .side-nav,
  .sidebar .sidebar-footer {
    display: none;
  }

  .sidebar.nav-open > h2,
  .sidebar.nav-open .side-nav,
  .sidebar.nav-open .sidebar-footer {
    display: flex;
  }

  .sidebar.nav-open > h2 {
    display: block;
    margin-top: 10px;
  }

  .side-nav {
    overflow: visible;
    flex: none;
    margin-bottom: 8px;
  }

  .sidebar.nav-open .sidebar-footer {
    margin-top: 8px;
    flex-direction: column;
  }
}

/* ——— Публичная анкета кандидата ——— */

.form-page {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.form-header {
  margin-bottom: 24px;
}

.form-header h1 {
  margin: 14px 0 8px;
  font-size: 28px;
}

.form-lead {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.45;
  max-width: 62ch;
}

.candidate-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-section {
  background: var(--bg-main);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 18px 18px 8px;
}

.anketa-incomplete-banner {
  margin: 0 0 14px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #ffebee;
  border: 1px solid #ef9a9a;
  color: #c62828;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.field.is-incomplete .card-input:not(:disabled):not([readonly]),
.skills-table select.card-input.is-incomplete {
  background: #ffebee !important;
  border-color: #ef9a9a;
}

.field.is-incomplete .card-input:not(:disabled):not([readonly]):focus,
.skills-table select.card-input.is-incomplete:focus {
  outline: 2px solid rgba(198, 40, 40, 0.25);
  border-color: #e57373;
}

.form-section h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}

.field-span-2 {
  grid-column: 1 / -1;
}

.field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  background: #fff;
  color: var(--text-primary);
}

.skills-table-wrap {
  margin-bottom: 10px;
}

.skills-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: fixed;
}

.skills-table th,
.skills-table td {
  border-bottom: 1px solid var(--border-soft);
  padding: 10px 8px;
  text-align: left;
  vertical-align: middle;
}

.skills-table th:first-child,
.skills-table td:first-child {
  width: 40%;
  word-break: break-word;
}

.skills-table th {
  color: var(--text-secondary);
  font-weight: 600;
}

.skills-table select {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
}

@media (max-width: 640px) {
  .skills-table {
    font-size: 13px;
  }

  .skills-table th,
  .skills-table td {
    padding: 8px 4px;
  }

  .skills-table th:first-child,
  .skills-table td:first-child {
    width: 38%;
  }

  .skills-table select {
    padding: 8px 6px;
    font-size: 13px;
  }
}

.btn-submit {
  align-self: flex-start;
  min-width: 180px;
}

.submit-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
}

.consent-note {
  margin: 0;
  max-width: 42ch;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-secondary);
}

.consent-note a {
  color: var(--accent);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: wait;
}

.work-docs-toolbar .btn-primary:disabled {
  background: #b0b6bd;
  color: #fff;
  opacity: 1;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.work-docs-toolbar .btn-primary:disabled:hover {
  background: #b0b6bd;
}

/* Модалка логин/пароль после отправки */
.modal[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
}

.modal-card h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.modal-hint {
  margin: 0 0 18px;
  color: var(--text-secondary);
  font-size: 14px;
}

.creds-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(23, 131, 255, 0.06);
  border: 1px solid rgba(23, 131, 255, 0.15);
}

.creds-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.creds-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.creds-value {
  font-size: 20px;
  letter-spacing: 0.02em;
  word-break: break-all;
}

.policy-body {
  background: var(--bg-main);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 22px 24px;
  line-height: 1.55;
  color: var(--text-primary);
}

.policy-body h2 {
  margin: 22px 0 10px;
  font-size: 18px;
}

.policy-body h2:first-child {
  margin-top: 0;
}

.policy-body p,
.policy-body ul {
  margin: 0 0 12px;
  color: var(--text-secondary);
}

.policy-body ul {
  padding-left: 1.2em;
}

.policy-body a {
  color: var(--accent);
}

.policy-back {
  margin-top: 20px;
}

.thanks-card {
  text-align: center;
}

.thanks-title {
  margin: 16px 0 10px;
  font-size: 24px;
  line-height: 1.25;
}

.thanks-text {
  margin: 0;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.45;
}

.field-hint {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.photo-preview {
  margin-top: 12px;
}

.photo-preview img {
  display: block;
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
}

.person-photo {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: #f3f5f8;
  flex-shrink: 0;
}

.person-photo-btn {
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
  border-radius: 12px;
  line-height: 0;
}

.person-photo-btn:hover .person-photo {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.photo-lightbox .modal-backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.photo-lightbox-card {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 960px);
  max-height: 90vh;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-lightbox-card img {
  max-width: 92vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  background: #111;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.media-lightbox-frame {
  width: min(92vw, 960px);
  height: min(88vh, 860px);
  border: none;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.emp-doc-thumb.is-clickable {
  cursor: zoom-in;
}

.photo-lightbox-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 999px;
  background: #fff;
  color: #222;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.photo-lightbox-close:hover {
  background: #f3f5f8;
}

.person-photo-placeholder {
  width: 96px;
  height: 96px;
  border-radius: 12px;
  border: 1px dashed var(--border-soft);
  background: #f3f5f8;
  color: var(--text-secondary);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
  flex-shrink: 0;
}

.person-photo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.person-photo-wrap .btn-tiny {
  width: 100%;
  max-width: 120px;
}

.person-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.person-head-text {
  min-width: 0;
}

.thanks-cabinet a {
  color: var(--accent);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

.thanks-cabinet a:hover {
  text-decoration: underline;
}

.form-success {
  display: none;
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(23, 131, 255, 0.08);
  color: #0b4ea2;
  font-size: 14px;
  white-space: pre-line;
  line-height: 1.45;
}

.form-success.visible {
  display: block;
}

.form-ok {
  margin: 0 0 12px;
  color: #1a7a3a;
  font-size: 14px;
}

.field-check {
  display: flex;
  align-items: center;
}

.check-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
}

.check-label input[type="checkbox"] {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.card-input.is-readonly {
  background: #f3f5f8;
  color: var(--text-secondary);
}

.form-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-start;
}

/* «Сохранить» — fixed вверху экрана, без панели */
.card-toolbar .btn-save-anketa {
  margin: 0;
  min-width: 120px;
}

.card-toolbar .btn-save-anketa:disabled {
  background: #c5ccd6;
  border-color: #c5ccd6;
  color: #fff;
  opacity: 1;
  cursor: not-allowed;
}

.card-toolbar .btn-save-anketa.is-ready:not(:disabled) {
  background: var(--accent, #1783ff);
  border-color: var(--accent, #1783ff);
  color: #fff;
  cursor: pointer;
}

.workspace-head:has(.btn-save-anketa) .card-toolbar {
  position: fixed;
  top: 16px;
  right: 24px;
  z-index: 40;
  width: auto;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.workspace-head:has(.btn-save-anketa) {
  padding-right: 140px;
}

@media (max-width: 720px) {
  .workspace-head:has(.btn-save-anketa) .card-toolbar {
    top: 14px;
    right: 68px; /* слева от кнопки меню ☰ */
  }

  .workspace-head:has(.btn-save-anketa) {
    padding-right: 0;
    padding-top: 0;
  }
}

.docs-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.doc-card {
  padding: 16px 18px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: #fff;
}

.doc-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.doc-card h2 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
}

.doc-file-meta {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.doc-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.work-docs-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-bottom: 20px;
}

.work-docs-toolbar[hidden] {
  display: none;
}

.work-docs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.work-doc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: #fff;
}

.work-doc-row .doc-card-actions {
  margin-top: 0;
  flex-shrink: 0;
}

.work-doc-main {
  min-width: 0;
}

.work-doc-title {
  font-weight: 600;
  word-break: break-word;
}

.work-doc-meta {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-secondary);
}

.form-subsection {
  margin: 18px 0 10px;
  font-size: 15px;
  font-weight: 600;
}

.emp-docs-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.emp-doc-item {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: #fff;
}

.emp-doc-item.is-empty {
  opacity: 0.75;
}

.emp-doc-thumb {
  width: 88px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f5f8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.emp-doc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.emp-doc-thumb-empty,
.emp-doc-thumb-file,
.emp-doc-thumb-loading {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  padding: 6px;
}

.emp-doc-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.emp-doc-info strong {
  font-size: 14px;
}

.emp-doc-info span {
  font-size: 13px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.emp-doc-actions {
  display: flex;
  gap: 6px;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: #fff;
  color: var(--text-primary);
  cursor: pointer;
}

.btn-icon:hover {
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .field-span-2 {
    grid-column: auto;
  }

  .emp-doc-item {
    grid-template-columns: 72px minmax(0, 1fr);
    column-gap: 14px;
    row-gap: 10px;
  }

  .emp-doc-thumb {
    width: 72px;
    height: 60px;
  }

  .emp-doc-info {
    padding-left: 2px;
    min-width: 0;
  }

  .emp-doc-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}
