/* === Заголовок страницы === */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: 1.5rem;
  line-height: 1.2;
}

.page-header p {
  font-size: 0.92rem;
  line-height: 1.5;
  margin-top: 0.25rem;
  color: var(--text-muted);
}

.page-header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.client-clinic-line {
  margin-top: 0.35rem;
  font-size: var(--fs-lg);
  color: var(--text-muted);
}

.balance-inline {
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-number--draft {
  color: #94a3b8;
}

.stat-number--sent {
  color: #fbbf24;
}

.stat-number--review {
  color: var(--primary-light);
}

.stat-number--ready {
  color: #34d399;
}

.stat-number--in-work {
  color: #60a5fa;
}

.stat-number--muted {
  color: var(--text-muted);
}

.stats-grid.doctor-dashboard-stats-grid {
  grid-template-columns: repeat(5, 1fr);
  margin-bottom: 0;
}

.panel-card--admin-queue {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.35);
}

.admin-queue-item-line {
  font-size: var(--fs-md);
  color: var(--text);
  margin: 0.2rem 0;
}

.panel-card--queue-intro {
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(59, 130, 246, 0.06);
  border-color: rgba(59, 130, 246, 0.25);
}

.queue-panel-title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.queue-panel-intro {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 52rem;
  line-height: 1.45;
}

.flex-wrap-gap-sm {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.queue-count-badge {
  opacity: 0.9;
  font-weight: 600;
}

.text-muted-85 {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.text-muted-82 {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.filter-bar--flush-bottom {
  margin-bottom: 0;
}

.filter-bar--spaced-top {
  margin-top: 0.75rem;
}

.filter-divider {
  width: 0;
  min-height: 1.25rem;
  align-self: center;
  border-left: 1px solid var(--border);
  margin: 0 4px;
}

.cursor-pointer {
  cursor: pointer;
}

.cursor-default {
  cursor: default;
}

.request-actions--mt {
  margin-top: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.flex-wrap-gap-xs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.doctor-row-muted {
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.doctor-row-ready {
  display: flex;
  flex-wrap: wrap;
  color: #34d399;
  font-size: var(--fs-sm);
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.text-danger-inline {
  color: #ef4444;
  margin-left: 0.5rem;
}

.card-actions-end {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
  align-items: center;
}

.row-loading-muted {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.modal--doctor-request {
  width: 820px;
  max-width: 95vw;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 3rem);
}

/* Увеличенная модалка врача: 1400px ширина + почти вся высота экрана.
   На ultrawide не растягивается «лентой», на FHD/ноутбуках занимает
   почти весь viewport (1400px ≈ 73% от 1920 → нормальный «большой диалог»). */
.modal--doctor-request.modal--doctor-fullscreen {
  width: min(1400px, calc(100vw - 2rem));
  max-width: none;
  height: calc(100vh - 4rem);
  max-height: none;
  padding: 1.25rem 1.5rem;
  border-radius: 10px;
}
@media (max-width: 768px) {
  /* Оверлей по умолчанию имеет padding: 2rem 1rem — это 64px сверху+снизу,
     которые на мобилке съедали высоту, и низ модалки с кнопками уезжал за
     viewport. На мобилке оверлей почти прижимаем к краям. */
  .modal-overlay {
    padding: 0.25rem;
  }
  .modal--doctor-request.modal--doctor-fullscreen {
    width: calc(100vw - 0.5rem);
    /* 100dvh = dynamic viewport (учитывает скрывающийся тулбар Safari).
       Fallback на 100vh для старых браузеров. Минус 0.5rem на padding оверлея. */
    height: calc(100vh - 0.5rem);
    height: calc(100dvh - 0.5rem);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    /* Защита от горизонтального overflow: длинные кнопки (Завершить проверку,
       Отправить на проверку) с .btn-lg + white-space:nowrap при тесном
       viewport-е тянули контейнер вправо, отчего модалку можно было свайпать. */
    overflow-x: hidden;
  }
  /* «×» в шапке остаётся видимой, а ДУБЛИРУЮЩАЯ кнопка «Закрыть» в подвале
     прячется — место узкое. Маркер-класс modal-footer-close-btn на template. */
  .modal--doctor-request .modal-footer-close-btn {
    display: none;
  }
  /* Footer на мобилке — CSS GRID, не flex-wrap. Grid предсказуемо распределяет
     колонки: secondary-кнопки автоматом в 2 колонки (Сохранить + Вернуть),
     success-кнопка span обоих колонок (всю ширину). Без проблем с min-content
     нативного flex-wrap, который не давал кнопкам с white-space:nowrap
     сжаться ниже текстовой ширины. */
  .modal--doctor-request .modal-footer--split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    /* Перезаписываем flex-end justification из десктоп-rules */
    justify-content: stretch;
  }
  .modal--doctor-request .modal-footer--split > * {
    /* min-width:0 на КАЖДОМ потомке grid: иначе nowrap-кнопки распирали
       колонку, и текст «Завершить проверку» вылезал вправо. */
    min-width: 0;
    max-width: 100%;
  }
  .modal--doctor-request .modal-footer--split > .btn {
    justify-content: center;
    padding-left: 0.4rem;
    padding-right: 0.4rem;
    /* Если текст всё-таки длиннее кнопки — ellipsis вместо overflow вправо. */
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* Success-кнопка (Завершить проверку / Отправить на проверку) — на всю ширину. */
  .modal--doctor-request .modal-footer--split > .btn-success,
  .modal--doctor-request .modal-footer--split > .btn-success.btn-lg {
    grid-column: 1 / -1;
  }
  /* Порядок кнопок в первой строке: «Вернуть в очередь» слева, «Сохранить» справа.
     HTML-порядок обратный (Сохранить в отдельном шаблоне выше) — order перебивает. */
  .modal--doctor-request .modal-footer--split > .btn-footer-release {
    order: 1;
  }
  .modal--doctor-request .modal-footer--split > .btn-footer-save {
    order: 2;
  }
  /* Loading-индикатор «Загрузка…» — тоже на всю ширину, отдельной строкой. */
  .modal--doctor-request .modal-footer--split > .modal-footer-loading {
    grid-column: 1 / -1;
    margin-right: 0;
    text-align: center;
  }
  /* Защитный пояс от любого horizontal overflow вглубь модалки: ни инпуты,
     ни textarea, ни meta-strip не должны выходить за viewport. */
  .modal--doctor-request .modal-body--scroll {
    overflow-x: hidden;
    max-width: 100%;
  }
  .modal--doctor-request textarea.form-input,
  .modal--doctor-request input.form-input,
  .modal--doctor-request select.form-input {
    max-width: 100%;
    box-sizing: border-box;
  }
  /* Подсказка про Ctrl+V / Cmd+V на мобилке бесполезна — буфера в привычном
     виде нет, а зона занимает ценное место. Скрываем и саму зону, и инлайн-хинт. */
  .modal--doctor-request .doctor-paste-zone,
  .modal--doctor-request .upload-queue-toolbar .form-label-hint {
    display: none;
  }
}

.modal-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
}

.btn-unlock-sm {
  padding: var(--btn-compact-padding-y) var(--btn-compact-padding-x);
  font-size: var(--btn-compact-font-size);
  min-height: var(--btn-compact-min-height);
}

.modal-body--scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 10px;
  margin-top: 15px;
  /* iOS: первые пиксели скролла больше не «тянут» нижний тулбар Safari/Chrome —
     gesture изолируется внутри контейнера. touch-action запрещает горизонтальные
     свайпы, которые иначе передавались бы в системный gesture-recognizer. */
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.form-label-hint {
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.7;
}

.form-label-hint--sm {
  font-size: var(--fs-xs);
}

.form-label-accent {
  color: var(--primary-light);
}

.form-error-text {
  color: #ef4444;
  font-size: 0.82rem;
  margin-top: 4px;
}

.text-link-primary {
  color: var(--primary-light);
}

.textarea-resize-y {
  resize: vertical;
}

/* Жёсткие min-height для textarea Описание/Заключение.
   Нужно потому, что rows-attr может быть сплющен flex-контейнером модалки.
   `field-sizing: content` (auto-rost) включается только на десктопах
   (см. media-query ниже). На touch отключён намеренно: без внутреннего скролла
   textarea iOS Safari при выделении текста прокручивает родителя (модал),
   что воспринимается как «скролл улетает вверх модалки». */
textarea.form-input.textarea-xxl {
  min-height: 35rem !important;
  resize: vertical;
}
textarea.form-input.textarea-xl {
  min-height: 26rem !important;
  resize: vertical;
}
@media (hover: hover) and (pointer: fine) {
  /* Auto-grow только для устройств с точным указателем (мышь / трекпад /
     стилус) — там нет проблемы с iOS-selection. На touch остаётся обычный
     textarea с внутренним скроллом. */
  textarea.form-input.textarea-xxl,
  textarea.form-input.textarea-xl {
    field-sizing: content;
  }
}
textarea.form-input.textarea-lg {
  min-height: 36rem !important;
  resize: vertical;
}
textarea.form-input.textarea-md {
  min-height: 22rem !important;
  resize: vertical;
}

.form-group--mt {
  margin-top: 1rem;
}

.form-group--mt-lg {
  margin-top: 1.25rem;
}

.cloud-links-box {
  font-size: var(--fs-sm);
  padding: 10px;
  background: var(--bg-dark);
  border-radius: 6px;
  border: 1px solid var(--border);
}

.conclusion-empty-hint {
  color: var(--text-muted);
  margin: 0;
}

.upload-queue-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.alert--upload-info {
  margin-top: 8px;
  background: rgba(59, 130, 246, 0.06);
  color: var(--text-muted);
  font-size: 0.82rem;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.upload-queue-panel--mt {
  margin-top: 10px;
}

.upload-queue-row-inner {
  flex: 1;
  min-width: 0;
}

.upload-queue-row-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  align-items: center;
}

.upload-queue-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-status-muted {
  color: var(--text-muted);
  white-space: nowrap;
}

.upload-status-success {
  color: #16a34a;
  font-weight: 600;
  white-space: nowrap;
}

.upload-status-nowrap {
  white-space: nowrap;
}

.upload-status-pct {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.icon--success-green {
  color: #16a34a;
}

.icon--dim {
  opacity: 0.5;
}

.modal-footer--split {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  align-items: center;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  padding: 0.75rem 0 0;
  margin-top: 0.75rem;
}

.modal-footer-loading {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  margin-right: auto;
}

.modal-overlay--toast-layer {
  z-index: calc(var(--z-modal) + 1);
}

/* Универсальная confirm-модалка поверх других модалок */
.modal-overlay--stacked {
  z-index: calc(var(--z-modal) + 2);
}

.modal-confirm {
  max-width: 480px;
}

.modal-confirm__body {
  margin: 0 0 1rem 0;
  line-height: 1.55;
  color: var(--text);
  font-size: var(--fs-lg);
}

.modal-confirm .alert {
  margin-bottom: 1rem;
}

.modal-confirm .icon--danger {
  color: var(--danger);
}

.modal-confirm .icon--info {
  color: var(--primary);
}

.modal--info-compact {
  width: 400px;
  max-width: 90vw;
  padding: 1.5rem;
  text-align: center;
}

.modal-info-title {
  margin-bottom: 1rem;
}

.modal-info-text {
  margin-bottom: 1.5rem;
  white-space: pre-wrap;
}

.loading-state-center {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  justify-content: center;
}

.input-hidden {
  display: none !important;
}

.page-header--mb-lg {
  margin-bottom: 2rem;
}

.request-card--flex {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.request-header--plain {
  border-bottom: none;
  padding-bottom: 0;
}

.admin-dashboard-filters__field--end {
  display: flex;
  align-items: flex-end;
}

.admin-dashboard-filters__field--end-wrap {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.clinic-card-head-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.min-w-0 {
  min-width: 0;
}

.clinic-logo-40 {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--secondary-bg);
}

.clinic-meta-aside {
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.with-icon--justify-end {
  justify-content: flex-end;
}

.clinic-contact-block {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  row-gap: 0.35rem;
}

/* Между блоками контактов — больше воздуха; внутри — иконка плотно к своему тексту; фон группирует пару */
.clinic-contact-block > .with-icon:not(:last-child) {
  margin-inline-end: 1.35rem;
}

.clinic-contact-block > .with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  max-width: 100%;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: var(--secondary-bg);
  border: 1px solid var(--border);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.clinic-meta-aside .with-icon {
  gap: 0.32rem;
}

.clinic-card-head-row .req-pet-info .with-icon {
  gap: 0.28rem;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: var(--secondary-bg);
  border: 1px solid var(--border);
}

.balance-section {
  margin-top: 0.75rem;
}

.balance-section__title {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.25rem;
}

.balance-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.balance-chip {
  font-size: var(--fs-sm);
  padding: 4px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}

.btn-fill {
  flex: 1;
}

.type-tag--id {
  background: var(--secondary-bg);
  color: var(--text);
}

.type-tag--template {
  background: #e0f2fe;
  color: #0369a1;
  font-size: var(--fs-xs);
}

.with-icon--ml-4 {
  margin-left: 4px;
}

.text-balance-pos {
  color: #34d399;
}

.text-balance-neg {
  color: #f87171;
}

/* --- Админка: классы вместо инлайнов (admin_dashboard.html) --- */
.clinic-admin-toolbar--mt-1-5 {
  margin-top: 1.5rem;
}

.clinic-admin-toolbar--mb-1 {
  margin-bottom: 1rem;
}

.icon--chevron-muted {
  flex-shrink: 0;
  opacity: 0.7;
}

/* Admin chat dropdown (clinic card) */
.admin-chat-dropdown-wrap { position: relative; display: inline-block; }
.admin-chat-dropdown {
  position: absolute; bottom: 100%; left: 0;
  z-index: var(--z-dropdown); min-width: 200px; max-height: 220px;
  overflow-y: auto; margin-bottom: 4px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,.12);
  padding: 4px 0;
}
.admin-chat-dropdown__empty {
  padding: 8px 12px; color: var(--text-secondary); font-size: .8rem;
}
.admin-chat-dropdown__item {
  display: block; width: 100%; text-align: left;
  padding: 6px 12px; border: none; background: none;
  cursor: pointer; font-size: .85rem; color: var(--text);
}
.admin-chat-dropdown__item:hover { background: var(--secondary-bg); }

.admin-combobox-loading {
  padding: 0.5rem;
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.admin-filter-divider {
  width: 0;
  align-self: stretch;
  border-left: 1px solid var(--border);
  margin: 0 6px;
}

.filter-btn--archive {
  color: #b45309;
}

.admin-archive-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
  width: 100%;
}

.admin-archive-search-grow {
  flex: 1 1 320px;
  min-width: min(100%, 260px);
  max-width: 640px;
}

.admin-archive-flex-spacer {
  flex: 1 0 8px;
}

.admin-loading-inline {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-bottom: 0.35rem;
}

.requests-grid--mt-1-5 {
  margin-top: 1.5rem;
}

.empty-state--grid-full {
  grid-column: 1 / -1;
  margin-top: 1rem;
}

.status-badge--self-start {
  align-self: flex-start;
}

.user-inactive-note {
  margin-left: 6px;
  opacity: 0.9;
  font-size: 0.72rem;
}

.user-clinic-row {
  margin-top: 0.5rem;
  font-size: var(--fs-sm);
}

.text-clinic-muted {
  color: var(--text-muted);
}

.text-danger-sm {
  color: #ef4444;
  font-size: 0.8rem;
}

.staff-spec-chips--mt {
  margin-top: 0.5rem;
}

.staff-spec-missing {
  font-size: 0.7rem;
  color: #ef4444;
}

.admin-password-details {
  margin-top: 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--secondary-bg);
}

.admin-password-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.65rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  user-select: none;
}

.admin-password-summary::-webkit-details-marker {
  display: none;
}

.admin-password-summary::after {
  content: '';
  display: inline-block;
  width: 0.4em;
  height: 0.4em;
  margin-left: auto;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform var(--transition);
  flex-shrink: 0;
}

.admin-password-details[open] .admin-password-summary::after {
  transform: rotate(-135deg);
  margin-top: 0.2em;
}

.admin-password-summary:hover {
  background: rgba(79, 70, 229, 0.04);
}

.admin-password-summary:focus-visible {
  outline: 2px solid rgba(79, 70, 229, 0.45);
  outline-offset: 2px;
}

.admin-password-details__body {
  padding: 0 0.65rem 0.65rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  border-top: 1px solid var(--border);
}

.admin-password-code {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 3px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 500;
}

.admin-password-missing {
  margin: 0.35rem 0 0;
  font-style: italic;
  max-width: 36rem;
}

.req-pet-info--tight {
  margin-top: 2px;
}

.btn-archive-warning {
  color: #b45309;
}

.admin-archive-page {
  margin-top: 1rem;
}

.admin-intro-text {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.loading-state-padded {
  padding: 1rem;
  color: var(--text-muted);
}

.empty-state--compact {
  padding: 1.5rem;
}

.request-card--archived-user {
  opacity: 0.85;
  border-color: rgba(180, 83, 9, 0.25);
}

.archived-name-tag {
  font-size: var(--fs-xs);
  color: #b45309;
  margin-left: 4px;
}

.status-badge--dim {
  opacity: 0.7;
}

.clinic-line-muted {
  margin-top: 0.5rem;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.request-actions--archive-footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.admin-filter-pills-row--flush {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  margin-bottom: 0.65rem;
}

.admin-dashboard-filters--stats-cols {
  grid-template-columns: 1fr auto auto auto;
}

.admin-hidden {
  display: none !important;
}

.form-input--date-wide {
  min-width: 10.5rem;
}

.admin-stats-reset-wrap {
  display: flex;
  align-items: flex-end;
}

.archived-inline-label {
  margin-left: 8px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-weight: 500;
}

.spec-badges-row {
  margin-top: 0.5rem;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.spec-badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  background: #dbeafe;
  color: #1e40af;
  border-radius: 4px;
}

.stats-doc-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
}

.stat-tile {
  text-align: center;
  padding: 0.45rem 0.65rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.stat-tile--wide {
  grid-column: 1 / -1;
  padding: 0.5rem 0.65rem;
}

.stat-tile__value--lg {
  font-size: 1.6rem;
  font-weight: 700;
  color: #6366f1;
}

.stat-tile__value {
  font-size: 1.5rem;
  font-weight: 700;
}

.stat-tile__value--amber {
  color: #fbbf24;
}

.stat-tile__value--violet {
  color: #a78bfa;
}

.stat-tile__label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.stat-tile__sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
  opacity: 0.92;
}

.stat-tile__sub--by-type {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 6px;
}

.stat-tile__by-type-prefix {
  opacity: 0.7;
  margin-right: 2px;
}

.spec-badge--count b {
  font-weight: 700;
}

.doctor-stats-summary {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.doctor-stats-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Компактная строка «У меня сейчас» на дашборде врача — операционная сводка
   текущей загрузки. Показывается только когда есть >0 в работе или на проверке. */
.doctor-current-load {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 14px;
  margin-bottom: 12px;
}
.doctor-current-load__label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.doctor-stats-pill__label {
  opacity: 0.8;
}

.doctor-stats-pill__value {
  font-weight: 700;
  font-size: 0.95rem;
  color: #6366f1;
  font-variant-numeric: tabular-nums;
}

.doctor-stats-pill--amber .doctor-stats-pill__value {
  color: #fbbf24;
}

.doctor-stats-pill--violet .doctor-stats-pill__value {
  color: #8b5cf6;
}

.stats-by-type-table {
  display: grid;
  grid-template-columns: 1fr max-content max-content;
  align-items: baseline;
  column-gap: 18px;
  row-gap: 2px;
  margin-top: 12px;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
}

.requests-grid--doctor-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .requests-grid--doctor-stats {
    grid-template-columns: 1fr;
  }
}

.stats-by-type-row {
  display: contents;
}

.stats-by-type-row > * {
  padding: 4px 0;
  border-bottom: 1px solid rgba(99, 102, 241, 0.12);
}

.stats-by-type-row:last-child > * {
  border-bottom: none;
}

.stats-by-type-row--total > * {
  border-top: 2px solid rgba(99, 102, 241, 0.35);
  border-bottom: none !important;
  padding-top: 7px !important;
  margin-top: 2px;
}

.stats-by-type-row--total .stats-by-type-row__label {
  font-weight: 700;
  font-size: 0.86rem;
}

.stats-by-type-row--total .stats-by-type-row__num {
  font-size: 1rem;
  color: #6366f1;
}

.stats-by-type-row__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.stats-by-type-row__cell {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  justify-self: end;
}

.stats-by-type-row__sub {
  opacity: 0.75;
  margin-right: 6px;
}

.stats-by-type-row__num {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  min-width: 1.4em;
  display: inline-block;
  text-align: right;
}

.my-stats-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
}
.my-stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.my-stats-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-color);
}
.my-stats-range {
  display: inline-flex;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2px;
  gap: 0;
}
.my-stats-range-btn {
  padding: 4px 12px;
  font-size: 0.8rem;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 500;
  line-height: 1.3;
  transition: background 0.15s, color 0.15s;
}
.my-stats-range-btn:hover {
  color: var(--text-color);
}
.my-stats-range-btn.active {
  background: var(--primary);
  color: #fff;
}
.my-stats-metrics {
  margin-top: 0;
}

.stat-clinic-count {
  font-size: 1.5rem;
  font-weight: 700;
  color: #34d399;
}

.stat-clinic-label {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.admin-summary-stack {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.admin-summary-heading {
  margin-bottom: 1rem;
}

.admin-table-scroll {
  overflow-x: auto;
}

.stats-summary-table {
  width: 100%;
  border-collapse: collapse;
}

.stats-summary-table th,
.stats-summary-table td {
  padding: 0.5rem;
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

.stats-summary-table th:first-child {
  text-align: left;
}

.stats-summary-table td:first-child {
  font-weight: 600;
}

.stats-summary-table td:not(:first-child) {
  text-align: center;
}

.doctor-summary-month {
  margin-bottom: 1.5rem;
}

.doctor-summary-month-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.doctor-summary-grid {
  display: grid;
  gap: 0.5rem;
}

.doctor-summary-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  padding: 0.5rem;
  background: var(--bg-dark);
  border-radius: 6px;
  font-size: var(--fs-md);
  font-variant-numeric: tabular-nums;
}

.doctor-summary-name {
  min-width: 140px;
  font-weight: 600;
}

.doctor-summary-meta {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.admin-pagination-bar--mt-sm {
  margin-top: 0.5rem;
}

.admin-pagination-bar--mt-md {
  margin-top: 0.75rem;
}

.admin-lead-text {
  color: var(--text-muted);
  font-size: var(--fs-md);
  margin-bottom: 1rem;
  max-width: 840px;
}

.admin-meta-line {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.admin-table-region {
  overflow: auto;
  max-height: calc(100vh - 260px);
  margin-bottom: 2rem;
}

.admin-orders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.admin-orders-table thead tr {
  text-align: left;
  border-bottom: 2px solid var(--border);
}

.admin-orders-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 2;
  box-shadow: inset 0 -2px 0 var(--border);
}

.admin-orders-table tbody tr {
  border-bottom: 1px solid var(--border);
}

.admin-td {
  padding: 8px;
}

.admin-td--nowrap {
  white-space: nowrap;
}

/* Вертикальные разделители между колонками с датами/метриками
   (Создана | Врачам | Клиенту | Обработка) — чтобы три даты подряд
   не сливались визуально. Граница проходит слева от каждой такой колонки. */
.admin-orders-table th.admin-col-divider,
.admin-orders-table td.admin-col-divider {
  border-left: 1px solid var(--border-light, #e5e7eb);
}

.admin-th-actions {
  padding: 8px;
  text-align: right;
}

.admin-orders-table td.admin-td--actions {
  text-align: right;
  white-space: nowrap;
}

.btn--ml-6 {
  margin-left: 6px;
}

.empty-state--mt-1 {
  margin-top: 1rem;
}

.admin-section-title {
  margin-bottom: 0.75rem;
}

.loading-state-audit {
  display: flex;
  padding: 1rem;
  color: var(--text-muted);
  justify-content: center;
}

.admin-audit-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Базовая карточка для админских модулей — визуально повторяет .request-card,
   но отделена, чтобы будущие правки клиентского .request-card не протекали в админку. */
.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
}

.admin-card:hover {
  border-color: var(--primary-light);
  background: var(--surface-2);
}

.admin-card--compact {
  padding: 10px 12px;
}

.admin-audit-card {
  padding: 10px 12px;
}

.admin-audit-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.audit-action--delete {
  color: #dc2626;
}

.audit-action--pdf {
  color: #d97706;
}

.audit-action--default {
  color: #2563eb;
}

.admin-audit-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.admin-audit-pre {
  margin-top: 8px;
  padding: 10px;
  background: var(--bg-dark);
  border-radius: 8px;
  font-size: 0.72rem;
  overflow: auto;
  max-height: 280px;
  white-space: pre-wrap;
}

.admin-audit-empty {
  color: var(--text-muted);
  font-size: var(--fs-md);
}

.admin-transactions-table-wrap {
  overflow: auto;
  max-height: calc(100vh - 280px);
  -webkit-overflow-scrolling: touch;
}

.admin-transactions-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 2;
  box-shadow: inset 0 -2px 0 var(--border);
}

@media (max-width: 640px) {
  .admin-table-region,
  .admin-transactions-table-wrap {
    max-height: none;
    overflow-x: auto;
    overflow-y: visible;
  }
  .admin-orders-table thead th,
  .admin-transactions-table thead th {
    position: static;
  }
}

/* Явные колонки + fixed layout: thead/tbody не «плывут»; collectstatic обязателен для nginx (/staticfiles/). */
.admin-transactions-table {
  width: 100%;
  min-width: 960px;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.admin-tx-col--id { width: 3.25rem; }
.admin-tx-col--date { width: 9.75rem; }
.admin-tx-col--clinic { width: 20%; min-width: 7.5rem; }
.admin-tx-col--rtype { width: 8rem; }
.admin-tx-col--op { width: 7.5rem; }
.admin-tx-col--amount { width: 5.5rem; }
.admin-tx-col--bal { width: 4.25rem; }
.admin-tx-col--comment { width: auto; min-width: 10rem; }
.admin-tx-col--admin { width: 9rem; }

.admin-transactions-table thead tr {
  background: var(--bg-dark);
  text-align: left;
}

.admin-transactions-table th {
  padding: 8px 10px;
  white-space: nowrap;
  color: var(--text-muted);
  font-weight: 600;
}

.admin-transactions-table th.admin-th--right {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.admin-transactions-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  overflow: hidden;
}

.admin-transactions-table td.admin-td--right {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.tx-row--add {
  background: rgba(16, 185, 129, 0.025);
}

.tx-row--spend {
  background: rgba(239, 68, 68, 0.025);
}

.tx-action-type--add {
  color: #10b981;
  font-weight: 600;
}

.tx-action-type--spend {
  color: #ef4444;
  font-weight: 600;
}

.tx-amount--add {
  color: #10b981;
}

.tx-amount--spend {
  color: #ef4444;
}

.admin-td--comment {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.admin-tx-payment-ref {
  display: block;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  color: var(--text, #1e293b);
}

.admin-transactions-footer {
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.admin-pagination-bar--flush {
  margin: 0;
}

.admin-tx-td-muted {
  color: var(--text-muted);
}

.admin-tx-td-clinic {
  font-weight: 500;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.admin-tx-amount-cell {
  font-weight: 700;
}

.admin-tx-balance-after {
  font-weight: 600;
}

.modal--admin-order {
  width: min(920px, 96vw);
  max-height: 90vh;
  overflow-y: auto;
}

.admin-order-readonly-meta {
  margin-bottom: 1rem;
  padding: 12px 14px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  line-height: 1.45;
}

.admin-order-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px 16px;
}

.admin-order-meta-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.admin-order-interest-zones {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.admin-interest-zones-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.admin-order-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group--full-row {
  grid-column: 1 / -1;
}

.visually-hidden-form {
  display: none;
}

.sr-only-file-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}

.alert--mb-1 {
  margin-bottom: 1rem;
}

.modal--narrow {
  width: 460px;
  max-width: 94vw;
}

.modal-footer--end {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 1.25rem;
}

.modal-footer--end-tight {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.modal-footer--end-sm {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 1rem;
}

.admin-order-files-panel {
  grid-column: 1 / -1;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.12);
}

.admin-order-files-intro {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.admin-order-pdf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.admin-order-files-columns {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.admin-file-list-title {
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.92rem;
}

.admin-file-list {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  font-size: 0.88rem;
  max-height: 180px;
  overflow-y: auto;
}

.admin-file-list__item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.admin-file-list__item .btn {
  margin-left: auto;
}

.link-break-all {
  word-break: break-all;
}

.form-label-hint {
  color: var(--text-muted);
  font-weight: 400;
}

.text-muted {
  color: var(--text-muted);
}

.mb-12 {
  margin-bottom: 12px;
}

.form-hint-sm {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.form-hint-sm--block {
  display: block;
  margin-top: 4px;
}

.clinic-logo-preview-wrap {
  margin-bottom: 8px;
}

.clinic-logo-preview {
  max-height: 56px;
  max-width: 180px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--secondary-bg);
  padding: 4px;
}

.form-label--checkbox-row {
  margin-top: 10px;
  font-weight: normal;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.balance-modal-intro {
  margin-bottom: 1rem;
}

.balance-current-box {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--secondary-bg);
  border-radius: 8px;
}

.balance-current-title {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.balance-chips-row--modal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0.5rem;
}

.balance-chip--modal {
  font-size: var(--fs-md);
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}

.balance-confirm-box {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.balance-confirm-title {
  font-size: var(--fs-lg);
}

.balance-confirm-body {
  margin-top: 0.75rem;
  font-size: var(--fs-md);
  line-height: 1.8;
}

.balance-confirm-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.form-row-password {
  display: flex;
  gap: 0.5rem;
}

.form-row-password .form-input {
  flex: 1;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
}

.form-label-muted-sm {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.interest-zones-grid--mt {
  margin-top: 0.35rem;
}

.staff-spec-chips--tight {
  margin-top: 0.25rem;
}

.form-hint-danger {
  font-size: 0.8rem;
  color: #ef4444;
}

.checkbox-hidden {
  display: none;
}

.admin-transactions-table .admin-td--nowrap {
  white-space: nowrap;
}

/* === Статистика === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.stat-card {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  transition: border-color var(--transition), background var(--transition);
}

.stat-card:hover {
  border-color: var(--primary-light);
  background: var(--surface-2);
}

.stat-number {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Сводные KPI: единое выравнивание (админ / клиент / врач) */
.stats-grid--kpi .stat-card {
  border: 1px solid var(--border);
  text-align: left;
}

/* === Карточки заявок === */
.requests-grid {
  display: grid;
  gap: 1rem;
}

.request-card {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
  overflow: visible;
}

.request-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.request-card.status-PENDING::before { background: var(--warning); }
.request-card.status-IN_PROGRESS::before { background: var(--primary-light); }
.request-card.status-COMPLETED::before { background: var(--success); }

.request-card:hover {
  border-color: var(--primary-light);
  background: var(--surface-2);
}

.request-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.875rem;
  gap: 1rem;
}

.request-id {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.request-description {
  font-size: var(--fs-lg);
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.request-description-clamped {
  margin-top: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.request-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.request-meta-soft {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.request-meta-strong {
  margin-top: 0.5rem;
  color: #3730a3;
  font-weight: 700;
  font-size: 0.84rem;
}

.request-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Карточка клиники: сетка кнопок перебивает базовый .request-actions (он объявлен выше по коду) */
.request-actions.request-actions--card-footer {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: stretch;
  flex-wrap: nowrap;
  margin-top: auto;
  border-top: none;
}

@media (max-width: 520px) {
  .request-actions.request-actions--card-footer {
    grid-template-columns: 1fr;
  }
}

.request-actions.request-actions--staff-footer {
  margin-top: auto;
  justify-content: flex-start;
  align-items: center;
}

/* === Бейджи статусов === */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* SLA-плашка по типу заявки. Считается от sent_at до дедлайна по типу.
   Используется в админской таблице «Заявки» и в карточках очереди врача.
   Три состояния: ok (запас > порога предупреждения), warning (приближается),
   overdue (просрочено). У клиента не показывается. */
.sla-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.3;
}

.sla-badge--ok {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.sla-badge--warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.sla-badge--overdue {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  font-weight: 700;
}

/* В карточке врача стэк со статусом и SLA-плашкой — вертикальный, по правому краю. */
.doctor-card-status-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

/* СОХРАНЕНА: нейтрально-серый, без синевы — чтобы не сливался с IN_WORK (индиго). */
.badge-DRAFT {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #e5e7eb;
}

.badge-SENT,
.badge-PENDING {
  background: #fff7ed;
  color: #b45309;
  border: 1px solid #fed7aa;
}

.badge-IN_WORK,
.badge-IN_PROGRESS,
.badge-REVIEW {
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}

.badge-AWAITING_REVIEW {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-READY,
.badge-COMPLETED {
  background: #ecfdf5;
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* === Документы / бланки === */
.documents-list {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.document-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.875rem;
  font-size: 0.8rem;
}

.document-item a {
  color: var(--primary-light);
  text-decoration: none;
  font-weight: 500;
}

.document-item a:hover {
  text-decoration: underline;
}

.document-item .doc-meta {
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

/* === Модальное окно === */
/* Блокировка скролла страницы при открытой модалке (JS: классы на html и body) */
html.modal-scroll-lock {
  overflow: hidden;
}

body.modal-scroll-lock {
  /* Раньше тут было position: fixed для сохранения позиции скролла, но это
     ломало ввод Cyrillic на Samsung Internet (Android): при открытой
     виртуальной клавиатуре IME не мог корректно поставить курсор, символы
     вставлялись в позицию 0 → весь текст реверсился. overflow:hidden на html
     и так блокирует скролл фона, position:fixed body не нужен. */
  overflow: hidden;
  overscroll-behavior: none;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* Выше липкой шапки страницы и чат-FAB */
  z-index: var(--z-modal);
  isolation: isolate;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  backdrop-filter: blur(4px);
}

/* При открытой модалке убираем «просвечивающие» липкие блоки (все дашборды) */
body.modal-scroll-lock .navbar {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

/* Кабинет клиента: дополнительно убираем липкие блоки списка */
body.client-theme.modal-scroll-lock .sticky-header,
body.client-theme.modal-scroll-lock .sticky-controls {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

/* Длинная форма / просмотр: заголовок и крестик не скроллятся, контент — внутри колонки */
body.client-theme .modal-form.modal-form--flex {
  display: flex;
  flex-direction: column;
  max-height: min(92vh, 920px);
  /* dvh учитывает мобильную клавиатуру — модалка сжимается, поле скроллится в видимую зону.
     Поддерживается Chrome 108+, Safari 16+, Samsung Internet 22+; старые браузеры используют vh fallback. */
  max-height: min(92dvh, 920px);
  overflow: hidden;
  margin: auto;
}

body.client-theme .modal-form--flex > .modal-header {
  position: relative;
  top: auto;
  flex-shrink: 0;
  z-index: 3;
}

body.client-theme .modal-scroll-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.client-theme .modal-form--flex .modal-footer-sticky {
  position: relative;
  bottom: auto;
  flex-shrink: 0;
  z-index: 4;
  margin: 0.75rem -2rem -2rem;
}

.modal {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 720px;
  padding: 2rem;
  /* box-shadow removed for strict style */
  animation: slideUp 0.2s ease;
  margin: auto;
  flex-shrink: 0;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  position: sticky;
  top: -2rem; /* Компенсация padding оверлея */
  background: var(--bg-card);
  z-index: 1020;
  padding: 1.5rem 2rem 1rem 2rem;
  margin: -2rem -2rem 1.5rem -2rem;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}

/* Заголовок + тип заявки: колонка, иначе h3.with-icon и type-badge (оба inline-flex) встают в одну строку и наезжают */
.modal-header > div:first-child {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  min-width: 0;
  flex: 1;
}

.modal-header h3.with-icon {
  display: flex;
  align-items: center;
  gap: 0.45em;
  margin: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
}

.modal-header .type-badge-header.with-icon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0;
}

.modal-close {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.modal-close:hover { background: var(--secondary-bg); color: var(--danger); border-color: var(--danger); transform: rotate(90deg); }

/* === SVG-иконки (спрайт #i-*) === */
.icon {
  display: inline-block;
  vertical-align: -0.15em;
  width: 1.12em;
  height: 1.12em;
  flex-shrink: 0;
  color: inherit;
}
.icon--sm { width: 0.95em; height: 0.95em; }
.icon--md { width: 1.25em; height: 1.25em; }
.icon--lg { width: 1.5em; height: 1.5em; }
.icon--xl { width: 3rem; height: 3rem; }
.icon--2xl { width: 3.5rem; height: 3.5rem; }
.icon--title { width: 1.65rem; height: 1.65rem; }
.icon--type { width: 2.25rem; height: 2.25rem; }
.icon--spin {
  animation: icon-spin 0.75s linear infinite;
  transform-origin: center;
}
@keyframes icon-spin {
  to { transform: rotate(360deg); }
}
.with-icon {
  display: inline-flex;
  align-items: center;
  /* rem: предсказуемый отступ; не переопределять .btn — см. .btn.with-icon ниже */
  gap: 0.45rem;
}
/* .with-icon объявлен после .btn и перебивал gap кнопок (0.4em давало «слипание») */
.btn.with-icon {
  gap: var(--btn-gap);
}
.page-header h1.with-icon {
  display: flex;
  align-items: center;
  gap: 0.45em;
}
.modal-close .icon {
  width: 1.1em;
  height: 1.1em;
}
.empty-state .empty-icon {
  font-size: unset;
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
}
.empty-state .empty-icon .icon {
  opacity: 0.45;
  color: var(--text-muted);
}
.login-logo .logo-icon {
  font-size: unset;
}
.login-logo .logo-icon .icon {
  width: 2rem;
  height: 2rem;
  color: #fff;
}
.navbar-brand .icon { color: var(--primary-light); }
.user-badge > .icon:first-of-type { color: var(--primary-light); }
.status-badge.with-icon { gap: 0.35em; }
.type-badge-header.with-icon { gap: 0.35em; align-items: center; }
.balance-bar .with-icon { gap: 0.25em; }
.type-icon { display: flex; align-items: center; justify-content: center; }
.modal-hero-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}
.modal-hero-icon .icon { opacity: 0.75; color: var(--text-muted); }
.toast-icon { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
.alert.with-icon { display: flex; align-items: flex-start; gap: 0.5rem; }
.alert.with-icon .icon { flex-shrink: 0; margin-top: 0.1em; }

/* Специализации врача: те же цвета в списке сотрудников и в модалках */
.staff-spec-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.staff-spec--xray { background: #dbeafe; color: #1e40af; }
.staff-spec--ct { background: #fef3c7; color: #92400e; }
.staff-spec--mri { background: #ede9fe; color: #5b21b6; }
.staff-spec--reptile { background: #d1fae5; color: #065f46; }
.staff-spec--bird { background: #e0f2fe; color: #0369a1; }
.staff-spec-tag {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  display: inline-block;
}
.staff-spec-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}
.staff-spec-chip input[type="checkbox"] {
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: currentColor;
}
.staff-spec-chip--on {
  border-color: currentColor;
  /* box-shadow removed for strict style */
}

/* Многозонные CT/MRI: блок описания+заключения для одной зоны */
.doctor-zone-hint {
  padding: 0.75rem 1rem;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--text);
}
.doctor-zone-block {
  padding: 0.75rem 1rem 1rem;
  margin-top: 1.25rem;
  border: 1.5px solid var(--border);
  border-left: 4px solid var(--primary, #2563eb);
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.03);
}
.doctor-zone-title {
  margin: 0 0 0.6rem 0;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--primary, #2563eb);
  text-transform: none;
}
.form-label--mt {
  margin-top: 0.65rem;
}

/* Тег режима «проверка» — пунктирная рамка, чтобы отличать от «описания» (без рамки) */
.staff-spec-tag--review {
  outline: 1px dashed currentColor;
  outline-offset: -1px;
}

/* Матрица «описание / проверка» в форме создания/редактирования врача */
.doctor-spec-matrix {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  background: var(--surface-2, #f8fafc);
}
.doctor-spec-matrix__row {
  display: grid;
  grid-template-columns: minmax(7.5rem, 1.2fr) 1fr 1fr;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px dashed rgba(0,0,0,0.06);
}
.doctor-spec-matrix__row:last-child { border-bottom: none; }
.doctor-spec-matrix__type {
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
  width: max-content;
}
.doctor-spec-matrix__cell {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  font-size: var(--fs-sm);
  cursor: pointer;
  border: 1.5px solid var(--border);
  user-select: none;
  background: #fff;
  transition: border-color 0.15s ease;
}
.doctor-spec-matrix__cell input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
  accent-color: var(--primary, #2563eb);
}
.doctor-spec-matrix__cell--on {
  border-color: var(--primary, #2563eb);
  background: rgba(37, 99, 235, 0.08);
}
.form-label-hint--block {
  display: block;
  margin: 0.15rem 0 0.4rem 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Часовой пояс в админке — список с поиском */
select.form-input.form-select-timezone {
  font-size: var(--fs-lg);
  padding: 0.45rem 0.75rem;
  line-height: 1.35;
}
select.form-input.form-select-timezone[size] {
  min-height: 12rem;
  max-height: min(40vh, 22rem);
  overflow-y: auto;
}
.timezone-picker-group .timezone-search-input {
  margin-bottom: 0.35rem;
}
.timezone-search-meta {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

/* Текущий выбранный часовой пояс — заметная плашка над поиском */
.timezone-selected-pill {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(52, 211, 153, 0.45);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(52, 211, 153, 0.08) 100%);
  /* box-shadow removed for strict style */
}
.timezone-selected-pill__badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #ecfdf5;
  background: #059669;
}
.timezone-selected-pill__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.timezone-selected-pill__label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}
.timezone-selected-pill__id code {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.2);
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
}

select.form-input.form-select-timezone option:checked {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.35) 0%, rgba(52, 211, 153, 0.2) 100%);
  font-weight: 600;
}

/* === Фильтры === */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-bar.filter-bar--align-end {
  align-items: flex-end;
}

/* Выпадающий список с поиском (фильтр клиники в админке) */
.admin-combobox {
  position: relative;
  min-width: 240px;
  max-width: 420px;
}
.admin-combobox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: transparent;
}
.admin-combobox-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  text-align: left;
  cursor: pointer;
  font-size: var(--fs-md);
}
.admin-combobox-trigger__text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-combobox-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 1100;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
.admin-combobox-panel input[type="search"] {
  width: 100%;
  font-size: 0.88rem;
  position: sticky;
  top: 0;
  z-index: 1;
  margin-bottom: 0.35rem;
  background: var(--bg-card);
  /* box-shadow removed for strict style */
}
.admin-combobox-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.admin-combobox-list li {
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.88rem;
  line-height: 1.35;
}
.admin-combobox-list li:hover,
.admin-combobox-list li:focus {
  background: var(--secondary-bg);
  outline: none;
}
.admin-combobox-list li.is-all {
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.2rem;
  padding-bottom: 0.5rem;
  border-radius: 0;
}
/* Комбобокс клиники внутри модального окна (выше оверлея модалки) */
.modal-form .admin-combobox {
  max-width: none;
  width: 100%;
}
.modal-form .admin-combobox-backdrop {
  z-index: 1001;
}
.modal-form .admin-combobox-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 1100;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.admin-combobox-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 0;
  padding-top: 0.25rem;
}

/* Прогресс загрузки файлов в модалке заявки (админ) */
.admin-order-file-upload-progress {
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  background: var(--secondary-bg);
  border: 1px solid var(--border);
}
.admin-order-file-upload-progress__row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
  line-height: 1.3;
}
.admin-order-file-upload-progress__name {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}
.admin-order-file-upload-progress__meta {
  flex-shrink: 0;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.admin-order-file-upload-progress__pct {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.admin-order-file-upload-progress__bar {
  height: 6px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
}
.admin-order-file-upload-progress__fill {
  height: 100%;
  background: var(--primary, #6366f1);
  border-radius: 4px;
  transition: width 0.12s ease-out;
}

.filter-btn {
  padding: var(--btn-sm-padding-y) 1rem;
  min-height: var(--btn-sm-min-height);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  box-sizing: border-box;
}

.filter-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.filter-btn.active {
  background: var(--surface-2);
  border-color: var(--primary);
  color: var(--primary);
}

.filter-quick {
  font-size: 0.78rem;
  padding: 0.35rem 0.75rem;
}

.controls-card,
.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
  /* box-shadow removed for strict style */
}

.section-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border: none;
  color: var(--text);
  font-weight: 600;
  font-size: var(--fs-lg);
  cursor: pointer;
  padding: 0.15rem 0;
}

.section-toggle-chevron {
  color: var(--text-muted);
  font-size: var(--fs-md);
}

.section-body {
  margin-top: 0.75rem;
}

.control-search {
  flex: 1;
  min-width: 220px;
  max-width: 360px;
}

.control-select {
  width: 170px;
}

.advanced-filters {
  border-top: 1px solid var(--border);
  margin-top: 0.8rem !important;
  padding-top: 0.8rem;
}

.filter-toggle-btn {
  margin-left: auto;
}

/* === Пустое состояние === */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius);
}

.empty-state h3 {
  color: var(--text);
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-muted);
  font-size: var(--fs-md);
  margin-bottom: 1.5rem;
}

/* === Загрузка файла === */
.file-upload-area {
  border: 1.5px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: #fafbff;
}

.file-upload-area:hover {
  border-color: #818cf8;
  background: #f5f7ff;
}

.file-upload-area input[type="file"] {
  display: none;
}

/* Чтобы drag не «терялся» при наведении на текст/иконку внутри зоны */
.file-upload-area > * {
  pointer-events: none;
}

.file-upload-shell {
  position: relative;
  border-radius: var(--radius-sm);
}

.file-upload-area--busy {
  pointer-events: none;
  opacity: 0.74;
}

.file-upload-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.52);
  border-radius: var(--radius-sm);
  pointer-events: none;
  z-index: 2;
}

body.client-theme .file-upload-overlay {
  background: rgba(248, 250, 252, 0.88);
  backdrop-filter: blur(3px);
}

.file-upload-overlay-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-md);
  font-weight: 600;
  color: #f1f5f9;
}

body.client-theme .file-upload-overlay-inner {
  color: #1d4ed8;
}

.upload-queue-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: rgba(30, 41, 59, 0.45);
}

body.client-theme .upload-queue-panel {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.upload-queue-heading {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.attached-file-item.upload-queue-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.upload-queue-row + .upload-queue-row {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.upload-progress-track {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}

.upload-progress-fill {
  height: 100%;
  background: #3b82f6;
  border-radius: 4px;
  transition: width 0.22s ease;
  min-width: 0;
}

.upload-progress-fill--done {
  background: #16a34a;
}

.upload-progress-queued {
  width: 100%;
  height: 100%;
  background: #cbd5e1;
  border-radius: 4px;
  opacity: 0.92;
}

.upload-progress-indeterminate {
  width: 42%;
  height: 100%;
  background: #3b82f6;
  border-radius: 4px;
  animation: uploadIndeterminateSlide 1.05s ease-in-out infinite alternate;
}

@keyframes uploadIndeterminateSlide {
  0% { transform: translateX(0); }
  100% { transform: translateX(138%); }
}

/* === Анимации === */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Vue transition for list */
.list-enter-active, .list-leave-active {
  transition: all 0.3s ease;
}
.list-enter-from {
  opacity: 0;
  transform: translateY(-10px);
}
.list-leave-to {
  opacity: 0;
  transform: translateX(20px);
}

/* === Адаптивность === */
@media (max-width: 640px) {
  .navbar { padding: 0 1rem; }
  .container { padding: 1rem; }
  .login-card { padding: 2rem 1.5rem; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .request-header { flex-direction: column; }
}

/* === Логаут кнопка === */
.btn-logout {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: var(--btn-sm-font-size);
  font-weight: var(--btn-font-weight);
  padding: var(--btn-sm-padding-y) var(--btn-padding-x);
  min-height: var(--btn-sm-min-height);
}

.btn-logout:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: #cbd5e1;
  transform: none;
}

/* === Разделитель === */
.divider {
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
}

/* === Скролл === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* === Тег типа заявки === */
.type-tag {
  display: inline-block;
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 6px;
}

/* === Дополнительная инфо о питомце === */
.req-pet-info {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-top: 4px;
}
.req-pet-info.with-icon {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.req-details-row {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

.requests-grid-compact {
  gap: 0.7rem;
}

.requests-grid-compact .request-card {
  border: 1px solid var(--border);
  padding: 1rem;
}

.requests-grid-compact .request-header {
  margin-bottom: 0.55rem;
}

.requests-grid-compact .request-description {
  display: none;
}

.requests-grid-compact .next-step-hint {
  margin-top: 0.4rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.74rem;
}

.requests-grid-compact .req-details-row {
  margin-top: 0.4rem;
  gap: 0.8rem;
  font-size: 0.74rem;
}

.requests-grid-compact .request-actions {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
}

/* === Выбор типа заявки === */
.type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

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

.type-card {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.type-card:hover {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.06);
  transform: translateY(-3px);
  /* box-shadow removed for strict style */
}

.type-card-no-balance {
  opacity: 0.65;
  border-color: #fca5a5 !important;
  background: #fff5f5 !important;
  color: #991b1b !important;
}
.type-card-no-balance .type-label {
  color: #374151 !important;
}
.type-card-no-balance:hover {
  border-color: #ef4444 !important;
  background: #fee2e2 !important;
  /* box-shadow removed for strict style */
  transform: none !important;
}

.type-icon {
  font-size: 2.8rem;
  line-height: 1;
}

.type-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.type-badge-header {
  font-size: var(--fs-sm);
  color: var(--primary-light);
  margin-top: 0;
}

.type-badge-header .icon--type {
  flex-shrink: 0;
}

/* === Широкое модальное окно === */
.modal-wide {
  max-width: 760px;
}

/* Форма-модалка: скролл внутри самой модалки, а не в overlay */
.modal-form {
  max-height: none;
  overflow: visible;
  background: var(--bg-card);
  border-radius: var(--radius);
  width: 100%;
  max-width: 600px;
  position: relative;
}

/* На мобильных modal-form получает ограничение высоты и внутренний скролл */

/* === Сетка полей формы === */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.form-col-2 {
  grid-column: 1 / -1;  /* занимает всю ширину */
}

/* Чтобы липкий футер модалки не перекрывал зону drag-and-drop (длинные формы, напр. КТ) */
body.client-theme .client-request-form-grid {
  padding-bottom: max(6rem, 120px);
}

@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-col-2 { grid-column: auto; }
}

.req-mark {
  color: var(--danger);
  margin-left: 2px;
}

/* === Кнопки формы === */
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  gap: 0.75rem;
  flex-wrap: wrap;
}

.modal-footer-sticky {
  position: sticky;
  bottom: -2rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  margin: 1rem -2rem -2rem;
  padding: 1rem 2rem;
  z-index: 3;
}

.form-actions-right {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-left: auto;
}

/* Футер модалки заявки (клиент): статус сверху, кнопки одной линией */
.client-form-footer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: stretch;
}

.client-form-footer-status {
  min-height: 1.5rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: var(--fs-sm);
}

.client-form-footer-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
}

.client-form-footer-actions > .btn {
  flex-shrink: 0;
}

.client-form-footer-spacer {
  flex: 1 1 auto;
  min-width: 0;
}

.client-form-footer-actions-right {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-left: auto;
  min-width: 0;
}

.client-form-footer-btn {
  min-height: var(--btn-min-height);
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.client-form-footer-btn .with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Иконка «корзина» в карточке заявки: квадратная зона нажатия */
.btn-delete.with-icon {
  padding: var(--btn-sm-padding-y);
  min-width: var(--btn-sm-min-height);
  justify-content: center;
}

/* === Прикреплённые файлы === */
.attached-files {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.attached-file-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
}

.attached-file-item a {
  color: var(--primary-light);
  text-decoration: none;
}
.attached-file-item a:hover { text-decoration: underline; }

.upload-progress {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* === Просмотр заявки === */
.view-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.5rem;
  margin-top: 1rem;
}

.view-col-2 { grid-column: 1 / -1; }

@media (max-width: 600px) {
  .view-grid { grid-template-columns: 1fr; }
  .view-col-2 { grid-column: auto; }
}

.view-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 300;
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
}

.view-label {
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.next-step-hint {
  margin-top: 0.5rem;
  font-size: 0.79rem;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
}

.owner-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 0.4rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.owner-chip.mine {
  color: #065f46;
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.35);
}

.owner-chip.other {
  color: #7c2d12;
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.3);
}

.card-details {
  margin-top: 0.55rem;
  border-top: 1px dashed var(--border);
  padding-top: 0.5rem;
}

.card-details summary {
  cursor: pointer;
  list-style: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.card-details summary::-webkit-details-marker {
  display: none;
}

.card-details summary::before {
  content: "▸ ";
}

.card-details[open] summary::before {
  content: "▾ ";
}

.inline-actions-menu {
  position: relative;
}

.inline-actions-menu summary {
  list-style: none;
}

.inline-actions-menu summary::-webkit-details-marker {
  display: none;
}

.inline-actions-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 170px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  /* box-shadow removed for strict style */
  z-index: 100;
}

/* Поднимаем карточку при открытом PDF-меню, чтобы выпадающий список был поверх соседних карточек */
.request-card:has(.inline-actions-menu[open]) {
  z-index: 50;
}

/* === Статус DRAFT (серый) и SENT / REVIEW / READY === */
.request-card.status-DRAFT::before { background: var(--border); }
.request-card.status-SENT::before  { background: var(--warning); }
.request-card.status-IN_WORK::before { background: var(--primary-light); }
.request-card.status-AWAITING_REVIEW::before { background: #fbbf24; }
.request-card.status-REVIEW::before { background: var(--primary-light); }
.request-card.status-READY::before { background: var(--success); }

.badge-DRAFT {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}
.badge-SENT {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.badge-REVIEW {
  background: rgba(129, 140, 248, 0.15);
  color: var(--primary-light);
  border: 1px solid rgba(129, 140, 248, 0.3);
}
.badge-AWAITING_REVIEW {
  background: rgba(251, 191, 36, 0.15);
  color: #fcd34d;
  border: 1px solid rgba(251, 191, 36, 0.3);
}
.badge-READY {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Карточка заявки с превышением целевого времени ответа */
.request-card.response-exceeded {
  border-color: #ef4444;
  /* box-shadow removed for strict style */
}

/* Карточка автора: его заявка ушла на проверку — read-only.
   Приглушённый фон + лёгкая desaturation, чтобы визуально отличалась
   от активных заявок. Цветная полоска статуса слева остаётся (видно AWAITING_REVIEW). */
.request-card--readonly-author {
  background: var(--card-bg-muted, rgba(148, 163, 184, 0.06));
  opacity: 0.85;
  filter: saturate(0.85);
}
.request-card--readonly-author:hover {
  opacity: 0.95;
}

