/* Admin 2.0 */
.admin-tabs {
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.admin-filter-bar {
  display: flex;
  align-items: end;
  gap: 10px;
  margin: 0 0 14px;
  padding: 14px;
  border-radius: var(--radius-md);
}

.admin-filter-bar label {
  min-width: 150px;
}

.admin-filter-bar .filter-grow {
  flex: 1 1 300px;
}

.admin-text-button {
  appearance: none;
  border: 0;
  padding: 0;
  color: var(--cream);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.admin-text-button:hover {
  color: var(--olive);
}

.admin-drawer[hidden] {
  display: none;
}

.admin-drawer {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(560px, 820px);
}

.admin-drawer-backdrop {
  border: 0;
  background: rgba(5, 9, 10, .74);
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.admin-drawer-panel {
  overflow-y: auto;
  max-height: 100vh;
  padding: 22px;
  border-left: 1px solid rgba(167, 170, 99, .30);
  background: var(--ink);
  box-shadow: -28px 0 70px rgba(0, 0, 0, .36);
}

.admin-drawer-head {
  position: sticky;
  z-index: 2;
  top: -22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: -22px -22px 16px;
  padding: 22px;
  border-bottom: 1px solid rgba(167, 170, 99, .18);
  background: rgba(18, 26, 27, .96);
  backdrop-filter: blur(14px);
}

.admin-drawer-head h2 {
  margin: 8px 0 0;
}

body.drawer-open {
  overflow: hidden;
}

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

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

.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(5, 9, 10, .74);
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.admin-modal-panel {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  padding: 22px;
  border: 1px solid rgba(167, 170, 99, .30);
  border-radius: 16px;
  background: var(--ink);
  box-shadow: 0 28px 70px rgba(0, 0, 0, .36);
}

.admin-modal-panel .admin-drawer-head {
  position: static;
  margin: -22px -22px 18px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

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

.admin-edit-card {
  margin: 14px 0;
}

textarea {
  width: 100%;
  border: 1px solid rgba(167, 170, 99, .20);
  border-radius: var(--radius-sm);
  outline: none;
  padding: 11px 13px;
  resize: vertical;
  color: var(--cream);
  background: rgba(18, 26, 27, .70);
  font: inherit;
}

textarea:focus {
  border-color: var(--olive);
  box-shadow: 0 0 0 3px rgba(167, 170, 99, .10);
}

.timeline {
  display: grid;
  gap: 8px;
}

.timeline-item {
  padding: 11px 13px;
  border: 1px solid rgba(167, 170, 99, .14);
  border-radius: var(--radius-sm);
  background: rgba(80, 80, 57, .16);
}

button:disabled {
  cursor: not-allowed;
  opacity: .42;
  transform: none !important;
}

@media (max-width: 1080px) {
  .admin-tabs {
    grid-template-columns: repeat(4, 1fr);
  }
  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-filter-bar {
    flex-wrap: wrap;
  }
}

@media (max-width: 720px) {
  .admin-tabs {
    grid-template-columns: repeat(2, 1fr);
  }
  .admin-filter-bar {
    display: grid;
    grid-template-columns: 1fr;
  }
  .admin-filter-bar label,
  .admin-filter-bar .filter-grow {
    min-width: 0;
  }
  .detail-grid,
  .detail-grid.two {
    grid-template-columns: 1fr;
  }
  .admin-drawer {
    grid-template-columns: 1fr;
  }
  .admin-drawer-backdrop {
    display: none;
  }
  .admin-drawer-panel {
    border-left: 0;
  }
}

.manager-registry {
  margin-bottom: 14px;
}

.compact-filter {
  margin-bottom: 12px;
  padding: 0;
  border: 0;
  background: transparent;
}

.manager-select {
  min-width: 160px;
}

.conversation-panel {
  display: flex;
  flex-direction: column;
}

.conversation-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 12px;
}

.chat-thread {
  display: grid;
  gap: 10px;
  min-height: 180px;
  margin-bottom: 14px;
}

.chat-message {
  max-width: 82%;
  padding: 12px 14px;
  border: 1px solid rgba(167, 170, 99, .18);
  border-radius: var(--radius-md);
  background: rgba(80, 80, 57, .16);
}

.chat-message.incoming {
  justify-self: start;
  border-bottom-left-radius: 5px;
}

.chat-message.outgoing {
  justify-self: end;
  border-color: rgba(167, 170, 99, .32);
  border-bottom-right-radius: 5px;
  background: rgba(167, 170, 99, .10);
}

.chat-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
  font-size: 12px;
}

.chat-meta span,
.chat-status {
  color: var(--muted);
}

.chat-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-status {
  margin-top: 7px;
  text-align: right;
  font-size: 11px;
}

.reply-box {
  position: sticky;
  bottom: -22px;
  margin: 0 -2px -22px;
  border-bottom: 0;
  background: rgba(18, 26, 27, .97);
  backdrop-filter: blur(14px);
}

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

  .chat-message {
    max-width: 94%;
  }
}

@media (max-width: 640px) {
  .summary-row {
    gap: 6px;
  }

  .summary-label {
    font-size: 15px;
  }

  .summary-row strong {
    font-size: 24px;
  }
}

.admin-tab.locked {
  opacity: .55;
  cursor: not-allowed;
}

.admin-link-button {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.management-card {
  margin-top: 4px;
}

/* Admin UI v9: flat summaries and non-sticky navigation */
.admin-tabs {
  position: static;
  top: auto;
}

.queue-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.admin-inline-summary {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 9px 20px;
}

.inline-summary-action {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 0;
  border: 0;
  color: rgba(234, 230, 210, .78);
  background: transparent;
  box-shadow: none;
  font: inherit;
}

.inline-summary-action {
  cursor: pointer;
  text-align: left;
}

.inline-summary-action span {
  font-size: 14px;
  font-weight: 650;
}

.inline-summary-action strong {
  color: var(--cream);
  font-size: 20px;
  font-weight: 850;
  line-height: 1.1;
  letter-spacing: -.025em;
}

.inline-summary-action:hover,
.inline-summary-action:focus-visible {
  color: var(--olive);
  transform: none;
  box-shadow: none;
}

.inline-summary-action:hover strong,
.inline-summary-action:focus-visible strong {
  color: var(--olive);
}

.queue-summary {
  flex: 1 1 auto;
  min-width: 0;
}

.queue-summary.admin-inline-summary {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.queue-summary .inline-summary-action {
  width: max-content;
  max-width: 100%;
}

.flat-admin-table .table-wrap,
.manager-registry .table-wrap {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.manager-registry {
  margin-bottom: 16px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

@media (max-width: 1080px) {
  .queue-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .queue-summary {
    flex: 0 0 auto;
    width: 100%;
  }
}

@media (max-width: 720px) {
  .admin-inline-summary {
    gap: 8px 14px;
  }

  .inline-summary-action span {
    font-size: 13px;
  }

  .inline-summary-action strong {
    font-size: 18px;
  }
}

/* Карточка кандидата: «Этот человек уже в системе» (другие регионы). */
.admin-drawer .related-candidates {
  margin-bottom: 14px;
  border-color: rgba(224, 166, 133, .45);
  background: rgba(224, 166, 133, .07);
}

/* Ссылка «#41» на соседнюю карточку: область нажатия выше, строка не раздвигается. */
.admin-drawer .related-candidates .admin-link-button {
  padding-block: 8px;
  margin-block: -8px;
}

.admin-drawer .related-candidates > b {
  color: #E0A685;
}

/* Окно «Реквизиты партнера»: текст как его написал партнер. */
.requisites-view {
  margin: 4px 0 10px;
  padding: 14px;
  border: 1px solid rgba(167, 170, 99, .22);
  border-radius: 12px;
  background: rgba(18, 26, 27, .6);
  color: var(--cream);
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: text;
}
