/* Бейдж источника заявки в виджете «Заявки на участие» (рядом с именем игрока) */
.badge-source {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 999px;
  letter-spacing: .06em;
  text-transform: uppercase;
  vertical-align: middle;
  white-space: nowrap;
  margin-left: 0;
  /* «Форма» — акцентный teal-тинт: бейдж не сливается с ФИО рядом */
  color: var(--teal);
  background: color-mix(in srgb, var(--teal) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--teal) 35%, transparent);
}
/* «Вступление» — нейтрально-синий тинт, чтобы отличать от «Формы» */
.badge-source--join {
  color: var(--info, #17a2b8);
  background: color-mix(in srgb, var(--info, #17a2b8) 12%, transparent);
  border-color: color-mix(in srgb, var(--info, #17a2b8) 35%, transparent);
}
@supports not (color: color-mix(in srgb, red 10%, transparent)) {
  .badge-source { color: var(--teal); background: rgba(32, 201, 151, .12); border-color: rgba(32, 201, 151, .35); }
  .badge-source--join { background: rgba(23, 162, 184, .12); border-color: rgba(23, 162, 184, .35); }
}

/* ── Модалка «Данные заявки» (клик по имени form-заявки) ── */
.app-modal-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  box-sizing: border-box;
  animation: appModalFade .22s cubic-bezier(.16,1,.3,1);
}
@keyframes appModalFade { from { opacity: 0 } to { opacity: 1 } }
.app-modal {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-md, 14px);
  box-shadow: var(--shadow-lg, 0 20px 50px rgba(15,23,42,.25));
  width: 100%; max-width: 540px;
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: appModalPop .22s cubic-bezier(.16,1,.3,1);
}
@keyframes appModalPop { from { opacity: 0; transform: scale(.96) translateY(8px) } to { opacity: 1; transform: none } }
.app-modal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 14px 20px;
  border-bottom: 1px solid var(--surface-border);
  background: linear-gradient(135deg, rgba(13,148,136,.06) 0%, rgba(37,99,235,.05) 100%);
  flex: none;
}
.app-modal-title {
  flex: 1; min-width: 0;
  font-family: 'Outfit', sans-serif;
  font-weight: 700; font-size: 16px; color: var(--text);
  overflow-wrap: anywhere; line-height: 1.3;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
}
.app-modal-close {
  flex: none; width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: var(--r-sm, 8px);
  font-size: 22px; line-height: 1; color: var(--text-muted); cursor: pointer;
  transition: background var(--transition, .15s), color var(--transition, .15s);
}
.app-modal-close:hover { background: var(--surface-hover); color: var(--text) }
.app-modal-close:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px }
.app-modal-body { padding: 8px 20px 18px; overflow-y: auto; overscroll-behavior: contain }
.app-modal-row {
  display: grid; grid-template-columns: minmax(120px, 38%) 1fr;
  gap: 4px 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--surface-border);
  font-size: 14px; line-height: 1.45;
}
.app-modal-row:last-child { border-bottom: none }
.app-modal-label { color: var(--text-muted); overflow-wrap: anywhere }
.app-modal-value { color: var(--text); font-weight: 600; overflow-wrap: anywhere; min-width: 0 }
.app-modal-value a { color: var(--teal); text-decoration: underline }
.app-modal-empty { color: var(--text-muted); padding: 14px 0; font-size: 14px }
@media (max-width: 560px) {
  .app-modal-overlay { padding: 12px; align-items: flex-end }
  .app-modal { max-height: calc(100dvh - 24px); border-radius: var(--r-md) var(--r-md) 0 0 }
  .app-modal-row { grid-template-columns: 1fr; gap: 2px }
}

/* Shared applicant identity: role is independent of application source. */
.app-person { min-width: 0; }
.app-person-name { min-width: 0; overflow-wrap: anywhere; }
.app-person-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.app-person-badges:empty { display: none; }
.app-referee-badge {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  padding: 3px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 1.15;
  color: var(--warn-text, #a16207); background: var(--warn-bg, rgba(245,158,11,.12));
  border: 1px solid color-mix(in srgb, currentColor 28%, transparent);
}
.app-referee-badge svg { flex: none; }
.app-view-data {
  display: inline; font: inherit; color: inherit; background: none; border: 0; padding: 0;
  text-align: left; cursor: pointer; text-decoration: underline; text-decoration-style: dotted;
  text-underline-offset: 3px; overflow-wrap: anywhere; max-width: 100%;
}
.app-view-data:hover { color: var(--teal); }
.app-view-data:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 3px; }
@media (prefers-reduced-motion: reduce) { .app-modal-overlay, .app-modal { animation: none; } }


/* Linked staff are visually separate from the applicant's name. */
.app-staff-line {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 5px;
  margin-top: 4px; min-width: 0;
}
.app-staff-label { color: var(--text-muted); font-size: 11.5px; font-weight: 600; }
.app-staff-chip {
  display: inline-flex; align-items: center; max-width: 100%; min-width: 0;
  border: 1px solid var(--surface-border); border-radius: 6px;
  padding: 2px 7px; font-size: 11.5px; font-weight: 600; line-height: 1.35;
  color: var(--text); background: var(--surface-hover); overflow-wrap: anywhere;
}
.app-staff-line--details { margin: 0; }
.app-staff-line--details .app-staff-chip { font-size: 13px; padding: 3px 8px; }
