/* Врачи (docs/design/admin/Adm_Doctors.dc.html): список с порядком (.doc-row) и форма врача. */
@layer pages {
  /* .doc-row: ручка | ссылка во фрейм (фото, имя, статус) | кнопки «Выше / Ниже» */
  .admin-doctor-list { overflow: hidden; }
  .admin-doctor-row {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px;
    padding-left: 12px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
  }
  .admin-doctor-row:last-child { border-bottom: 0; }
  .admin-doctor-row:hover { background: var(--soft-2); }
  .admin-doctor-row:has([aria-current="true"]) { background: var(--soft); }
  .admin-doctor-row__link {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 12px 8px 12px 4px;
    color: var(--ink);
    font-size: 16px;
    line-height: 1.4;
    text-decoration: none;
  }
  .admin-doctor-row__photo { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; background: var(--ph-a); }
  .admin-doctor-row__text { min-width: 0; }
  .admin-doctor-row__name { display: block; font-weight: 600; }
  .admin-doctor-row__sub { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
  .admin-doctor-row__moves { display: flex; padding-right: 2px; }
  .admin-doctor-row .admin-icon-button { width: 32px; height: 32px; }

  .admin-doctor-detail { display: flex; flex-direction: column; gap: 16px; min-width: 0; scroll-margin-top: 16px; }
  .admin-doctor-detail__title { font-size: 20px; }
  .admin-doctor-detail__site { font-size: 15px; }

  .admin-doctor-form { display: flex; flex-direction: column; gap: 20px; }
  .admin-doctor-form__main { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 20px; align-items: start; }
  .admin-doctor-form__fields { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
  /* «О враче» у главного врача — десять абзацев: поле прокручивается, а не растягивает страницу */
  .admin-doctor-form .admin-editor .lexxy-editor__content { max-height: 420px; overflow-y: auto; }
  .admin-doctor-form__prices { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 240px)); }

  /* Фото 4:5; пустое состояние — .admin-drop на всю рамку */
  .admin-doctor-photo { display: flex; flex-direction: column; gap: 8px; }
  .admin-doctor-photo__frame { position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--r-img); background: var(--ph-a); }
  .admin-doctor-photo__frame > img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
  .admin-doctor-photo__frame:has(.admin-drop:not([hidden])) .admin-doctor-photo__replace { display: none; }
  .admin-doctor-photo__frame:has(:focus-visible) { outline: 3px solid var(--focus); }
  .admin-doctor-photo__file { overflow-wrap: anywhere; }
  .admin-doctor-photo__file:empty { display: none; }
  .admin-doctor-photo__remove { align-self: flex-start; }

  /* Вместо переключателя «Показывать на сайте» у главного врача */
  .admin-switch-note { display: flex; align-items: flex-start; gap: 10px; margin: 0; font-size: 16px; line-height: 1.45; color: var(--ink-3); }
  .admin-switch-note .icon { flex: none; margin-top: 2px; }

  /* «Удалить врача»: шаги перед удалением (.todo-row) */
  .admin-doctor-steps { gap: 0; }
  .admin-doctor-steps__lead { padding-bottom: 6px; color: var(--ink-2); }
  .admin-doctor-step { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
  .admin-doctor-step:first-of-type { border-top: 0; }
  .admin-doctor-step__n { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--sand); color: var(--sand-ink); font-size: 14px; font-weight: 700; }
  .admin-doctor-step__body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
  .admin-doctor-step__body > b { font-size: 17px; line-height: 1.4; }
  .admin-doctor-step__act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 15px; }
  .admin-doctor-step__select { flex: 1 1 200px; max-width: 360px; width: auto; min-width: 0; min-height: 44px; font-size: 16px; cursor: pointer; }
  .admin-doctor-step__links { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: 16px; }
  .admin-doctor-step__links .link { display: inline-flex; align-items: center; min-height: 44px; }
  .admin-doctor-steps__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--line); }
  .admin-doctor-steps__foot form { display: contents; }
  .admin-doctor-steps__hint { flex: 1 1 260px; }

  @media (max-width: 820px) {
    .admin-doctor-row { grid-template-columns: 20px minmax(0, 1fr) auto; padding-left: 8px; }
    /* Статус под именем: в узкой строке ему не хватает места справа */
    .admin-doctor-row__link { grid-template-columns: 44px minmax(0, 1fr); row-gap: 6px; }
    .admin-doctor-row__link > .admin-status { grid-column: 2; justify-self: start; }
    .admin-doctor-row__photo { width: 44px; height: 44px; }
    .admin-doctor-row .admin-icon-button { width: 44px; height: 44px; }
    .admin-doctor-form__main { grid-template-columns: minmax(0, 1fr); }
    .admin-doctor-photo { max-width: 280px; }
    .admin-doctor-step__act .btn, .admin-doctor-step__select { width: 100%; min-width: 0; max-width: none; }
    .admin-doctor-steps__foot .btn { width: 100%; }
  }
}
