/* 
  Платформа заявок и бланков — главный CSS файл
  Кастомные стили без внешних зависимостей
*/

/* Vue: скрыть корень приложения до компиляции шаблона (иначе мелькают «[[ ... ]]», жёлтые/синие цифры статистики) */
[v-cloak] {
  display: none !important;
}

@font-face {
  font-family: 'Muller';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/muller/Muller-Light.otf') format('opentype');
}

@font-face {
  font-family: 'Muller';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/muller/Muller-Medium.otf') format('opentype');
}

/* === CSS переменные (строгий корпоративный стиль) === */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --primary-alpha: rgba(37, 99, 235, 0.1);
  --primary-alpha-strong: rgba(37, 99, 235, 0.25);
  --accent: #0f172a;
  --success: #16a34a;
  --success-light: #34d399;
  --success-alpha: rgba(16, 185, 129, 0.12);
  --warning: #d97706;
  --warning-dark: #92400e;
  --warning-bg: #fef3c7;
  --warning-border: #fde68a;
  --warning-alpha: rgba(245, 158, 11, 0.14);
  --danger: #dc2626;
  --danger-light: #ef4444;
  --danger-bg: #fef2f2;
  --danger-alpha: rgba(239, 68, 68, 0.1);
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --bg-dark: #f1f5f9;
  --border: #cbd5e1;
  --border-light: #e2e8f0;
  --text: #0f172a;
  --text-muted: #475569;
  --text-secondary: #64748b;
  --text-on-light: #1e293b;
  --secondary-bg: #f1f5f9;
  --surface-2: #e2e8f0;
  --info: #0284c7;
  --shadow: none;
  --radius: 4px;
  --radius-sm: 2px;
  --radius-lg: 16px;
  --transition: 0.1s ease;
  /* Z-index scale */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 1000;
  --z-modal: 10000;
  --z-chat-fab: 9000;
  --z-chat-panel: 9001;
  /* Кнопки: единая шкала (default / sm / compact) */
  --btn-font-weight: 500;
  --btn-letter-spacing: 0.02em;
  --btn-radius: 4px;
  --btn-gap: 6px;
  --btn-padding-y: 0.5rem;
  --btn-padding-x: 1rem;
  --btn-font-size: 0.875rem;
  --btn-line-height: 1.5;
  --btn-min-height: 2.25rem;
  --btn-sm-padding-y: 0.375rem;
  --btn-sm-padding-x: 0.75rem;
  --btn-sm-font-size: 0.8125rem;
  --btn-sm-min-height: 1.875rem;
  --btn-compact-padding-y: 0.25rem;
  --btn-compact-padding-x: 0.5rem;
  --btn-compact-font-size: var(--fs-xs);
  --btn-compact-min-height: 1.5rem;
  /* Типографика: единая шкала мелких размеров */
  --fs-xs: 0.75rem;
  --fs-sm: 0.85rem;
  --fs-md: 0.9rem;
  --fs-lg: 0.95rem;
}

/* === Сброс стилей === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-weight: 400;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6,
.navbar-brand,
.btn,
.role-pill,
.user-badge .role-pill,
.stat-number,
.filter-btn {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

/* Клиентский кабинет: чуть теплее фон (класс сохранён для шаблонов и кастомизаций) */
body.client-theme {
  --bg: #f8fafc;
  --surface-2: #f1f5f9;
}

/* === Зона 2: Search & Filter UI === */
.search-wrapper {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-wrapper .control-search {
  padding-right: 2.5rem;
  width: 100%;
}

.search-clear-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface-2);
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  opacity: 0.6;
  transition: opacity 0.2s;
  padding: 0;
}

.search-clear-btn:hover {
  opacity: 1;
  background: var(--border);
}

.search-clear-btn svg {
  width: 12px;
  height: 12px;
}

/* Чипсы активных фильтров */
.active-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.75rem;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text);
  cursor: default;
}

.filter-chip__remove {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.filter-chip__remove:hover {
  color: var(--danger);
}

.filter-chip--active {
  background: rgba(37, 99, 235, 0.1);
  border-color: var(--primary-light);
  color: var(--primary);
}

.sticky-header {
  position: sticky;
  top: 64px; /* Точно = navbar height */
  z-index: 90;
  background: var(--bg);
  padding: 1.5rem 0 1rem;
  transition: padding 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 0;
}

.sticky-header.is-stuck {
  padding: 0.75rem 0;
  min-height: 56px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.sticky-header.is-stuck h1 {
  font-size: 1.5rem;
  margin-bottom: 0;
}

.sticky-header.is-stuck p {
  display: none; /* Скрываем описание при скролле для экономии места */
}

.sticky-controls {
  position: sticky;
  top: 120px; /* navbar 64px + stuck header ~56px */
  z-index: 85;
  background: var(--bg);
  padding-top: 0.5rem;
  padding-bottom: 1rem;
}

/* Floating Action Button (FAB) */
.fab-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: none; /* Скрыто по умолчанию, показываем на мобилках */
}

@media (max-width: 768px) {
  .fab-container {
    display: block;
  }
  
  .sticky-header {
    top: 52px; /* Высота мобильного navbar */
  }

  .sticky-controls {
    top: 108px; /* navbar 52 + stuck header 56 */
  }
}

/* Скрытый заголовок-призрак для отслеживания скролла */
.scroll-anchor {
  position: absolute;
  top: 0;
  height: 1px;
  width: 1px;
  pointer-events: none;
  visibility: hidden;
}


/* === Шапка (навигация) === */
.navbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

/* Компенсация высоты фикс-навбара, чтобы контент не уходил под него */
body {
  padding-top: 64px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
}

.navbar-brand span {
  color: var(--primary);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.navbar .btn-margin-end {
  margin-right: 0.5rem;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 0.875rem;
}

.user-badge .role-pill {
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* === Основной контейнер === */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 1.6rem;
}

/* === Страница профиля === */
.profile-page {
  max-width: 640px;
  margin: 2rem auto;
}

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

.profile-card-spaced {
  margin-bottom: 1.5rem;
}

.profile-card-title {
  margin-bottom: 1rem;
}

.profile-name-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

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

.profile-meta-row {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.profile-meta-item {
  flex: 1;
  min-width: 140px;
  padding: 10px;
  background: var(--bg-dark);
  border-radius: 8px;
  font-size: var(--fs-sm);
}

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

.profile-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.profile-sound-hint {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.profile-actions-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.password-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

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

.profile-back-footer {
  text-align: center;
  margin-top: 1.5rem;
}

/* === Страница входа === */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg);
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem;
  width: 100%;
  max-width: 420px;
  /* box-shadow removed for strict style */
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo .logo-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.login-logo h1 {
  font-size: 1.5rem;
  color: var(--text);
}

.login-logo p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* === Формы === */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
  margin-bottom: 0.5rem;
}

.form-input,
select.form-input,
textarea.form-input {
  font-family: 'Muller', 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-weight: 300;
}

.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  font-size: var(--fs-lg);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-input:hover {
  border-color: #cbd5e1;
}

.form-input:focus {
  border-color: #6366f1;
  /* box-shadow removed for strict style */
}

/* Inline-валидация: подсвечиваем поле с ошибкой */
.form-input.is-invalid,
.admin-combobox-trigger.is-invalid {
  border-color: var(--danger);
  background: rgba(220, 38, 38, 0.04);
}

.form-input.is-invalid:focus,
.admin-combobox-trigger.is-invalid:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.form-error {
  color: var(--danger);
  font-size: 0.8rem;
  margin: 4px 0 0 0;
}

/* Нередактируемые поля — визуально отличаются */
.form-input.input-readonly,
.form-input:disabled {
  background: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
  border-style: dashed;
  opacity: 0.95;
}
.form-input.input-readonly::placeholder,
.form-input:disabled::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

/* === Кнопки ===
   Соглашение по классам: .btn [.btn-sm | .btn-compact] .btn-{variant} [.with-icon]
   Порядок в HTML: btn → размер → вариант → модификаторы. */
/* === Кнопки === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--btn-gap);
  padding: var(--btn-padding-y) var(--btn-padding-x);
  border-radius: var(--btn-radius);
  font-size: var(--btn-font-size);
  font-weight: var(--btn-font-weight);
  letter-spacing: var(--btn-letter-spacing);
  line-height: var(--btn-line-height);
  min-height: var(--btn-min-height);
  cursor: pointer;
  border: 1px solid var(--border);
  transition: background var(--transition), border-color var(--transition), color var(--transition), opacity var(--transition);
  text-decoration: none;
  white-space: nowrap;
  box-sizing: border-box;
  background: var(--surface-2);
  color: var(--text);
}

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

.btn:focus:not(:focus-visible) {
  outline: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff !important;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-secondary {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--border);
}

.btn-success {
  background: var(--success);
  color: #fff !important;
  border-color: var(--success);
}

.btn-success:hover:not(:disabled) {
  background: #116630;
  border-color: #116630;
}

.btn-warning {
  background: var(--warning);
  border-color: var(--warning);
  color: #fff !important;
}

.btn-warning:hover:not(:disabled) {
  background: #92400e;
  border-color: #92400e;
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff !important;
}

.btn-danger:hover:not(:disabled) {
  background: #991b1b;
  border-color: #991b1b;
}

/* Деструктивное действие в плотных списках/таблицах — не перетягивает внимание */
.btn-danger-outline {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.btn-danger-outline:hover:not(:disabled) {
  background: var(--danger);
  color: #fff;
}

.btn-danger-outline.with-icon svg {
  color: currentColor;
}

.btn-danger-outline:disabled {
  opacity: 0.5;
}

/* Вторичное обводное действие (файлы, третичные действия) — спокойнее, чем .btn-secondary */
.btn-outline-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: #64748b;
  font-weight: 500;
}

.btn-outline-secondary:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #475569;
}

.btn-compact.btn-outline-secondary {
  font-weight: 500;
}

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

.btn-lg {
  padding: 0.65rem 1.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  min-height: 2.8rem;
}

/* Узкая кнопка в строках таблиц / списков документов */
.btn-compact {
  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);
  font-weight: 600;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

/* === Алерты === */
.alert {
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: var(--fs-md);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1.25rem;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.alert-info {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: var(--text);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--text);
}

/* === Заголовок страницы === */
.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) {
  .modal--doctor-request.modal--doctor-fullscreen {
    width: calc(100vw - 1rem);
    height: calc(100vh - 2rem);
    padding: 0.75rem 1rem;
  }
}

.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;
}

.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-контейнером модалки. */
textarea.form-input.textarea-xxl {
  min-height: 70rem !important;
  resize: vertical;
}
textarea.form-input.textarea-xl {
  min-height: 52rem !important;
  resize: vertical;
}
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-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-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-ellipsis {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.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;
}

.badge-DRAFT {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.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;
  overflow: hidden;
  width: 100%;
  left: 0;
  right: 0;
  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);
  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 */
}

/* === Уведомления (колокольчик) === */
.notifications-wrapper .btn-icon {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  position: relative;
  padding: 6px;
  border-radius: 8px;
  transition: background var(--transition);
}
.notifications-wrapper .btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
}

.badge-notification {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger, #ef4444);
  color: white;
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
  line-height: 1.4;
  pointer-events: none;
  /* box-shadow removed for strict style */
  animation: notifPulse 2s ease-in-out infinite;
}

@keyframes notifPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.notifications-dropdown {
  position: absolute;
  top: 44px;
  right: 0;
  width: 360px;
  background: #fff;
  border-radius: var(--radius);
  /* box-shadow removed for strict style */
  border: 1px solid var(--border);
  z-index: 1000;
  overflow: hidden;
  animation: slideUp 0.2s ease;
}

.notifications-dropdown-header {
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: var(--fs-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
}

.notifications-dropdown-header .btn-mark-all {
  background: none;
  border: none;
  color: var(--primary-light);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background var(--transition);
}
.notifications-dropdown-header .btn-mark-all:hover {
  background: rgba(129, 140, 248, 0.15);
}

.notifications-dropdown-body {
  max-height: 340px;
  overflow-y: auto;
}

.notification-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: var(--fs-md);
}

.notification-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
  color: var(--text);
}
.notification-item:hover {
  background: #f8fafc;
}
.notification-item:last-child {
  border-bottom: none;
}

.notification-item-verb {
  font-size: 0.88rem;
  margin-bottom: 4px;
  color: var(--text);
  line-height: 1.4;
}

.notification-item-time {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* === Блок балансов (клиентский дашборд) === */
.balance-bar {
  background: var(--bg-card);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: var(--fs-sm);
  border: 1px solid var(--border);
  align-items: center;
  color: var(--text);
}
.balance-bar strong {
  color: var(--text-muted);
  padding-right: 4px;
}

.balance-bar .balance-type-icon :is(svg, .icon) {
  width: 1.05em;
  height: 1.05em;
  vertical-align: -0.125em;
}

/* Кабинет врача: единая сетка полей и зона вставки скриншотов */
/* Meta strip в модалке заявки */
.doctor-modal-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: .125rem 1.25rem;
  padding: .5rem .75rem;
  margin-bottom: 1rem;
  background: #f8fafc;
  border-radius: var(--radius);
  font-size: .75rem;
  color: var(--text-muted);
}
.doctor-modal-meta-strip .meta-item {
  display: inline;
  white-space: nowrap;
}
.doctor-modal-meta-strip .meta-label {
  font-weight: 500;
}
.doctor-modal-meta-strip .meta-label::after { content: ': '; }
.doctor-modal-meta-strip .meta-value {
  font-weight: 600;
  color: var(--text);
}

/* Comments list */
.doctor-comments-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.doctor-comment-item {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .5rem .75rem;
}
.doctor-comment-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .25rem;
  font-size: .75rem;
}
.doctor-comment-author { font-weight: 600; color: var(--text); }
.doctor-comment-role {
  font-size: .65rem;
  font-weight: 600;
  background: #e2e8f0;
  color: #475569;
  padding: 1px 6px;
  border-radius: 8px;
}
.doctor-comment-date { color: var(--text-muted); margin-left: auto; }
.doctor-comment-text { font-size: .85rem; white-space: pre-wrap; }

.doctor-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 640px) {
  .doctor-form-grid {
    grid-template-columns: 1fr;
  }
}
.doctor-modal-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 12px;
  line-height: 1.45;
}
.doctor-paste-zone {
  padding: 12px;
  background: var(--bg-dark);
  border: 1px dashed var(--border);
  border-radius: 8px;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  cursor: pointer;
  outline: none;
  position: relative;
  min-height: 48px;
  display: flex;
  align-items: center;
}
.doctor-paste-zone--loading {
  border-color: var(--primary-light);
  background: rgba(99, 102, 241, 0.08);
}
.doctor-paste-zone__hint {
  line-height: 1.4;
  font-size: 0.78rem;
  opacity: 0.6;
}
.doctor-paste-zone__status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  font-weight: 600;
  color: var(--primary-dark);
}

/*
 * Миниатюры в модалке врача: flex + фикс. размер; номер на overflow:visible,
 * обрезка только в .doctor-thumb-tile-crop (иначе бейдж 1,2,3… скрывается).
 */
#doctor-app {
  --doctor-thumb-size: 56px;
  --doctor-thumb-tile-w: 88px;
}
#doctor-app .doctor-thumb-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: flex-start;
  max-width: 100%;
}
#doctor-app .doctor-thumb-tile {
  width: var(--doctor-thumb-tile-w);
  max-width: var(--doctor-thumb-tile-w);
  min-width: 0;
  flex: 0 0 var(--doctor-thumb-tile-w);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  overflow: hidden;
}
#doctor-app .doctor-thumb-tile-visual {
  position: relative;
  width: var(--doctor-thumb-size);
  height: var(--doctor-thumb-size);
  flex-shrink: 0;
  line-height: 0;
  overflow: visible;
}
#doctor-app .doctor-thumb-tile-crop {
  width: var(--doctor-thumb-size);
  height: var(--doctor-thumb-size);
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #0a0a0a;
  box-sizing: border-box;
}
#doctor-app .doctor-thumb-tile-crop > a {
  display: block;
  width: var(--doctor-thumb-size);
  height: var(--doctor-thumb-size);
  overflow: hidden;
  line-height: 0;
}
#doctor-app .doctor-thumb-tile-num {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 4;
  min-width: 1.15em;
  padding: 2px 6px;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
  border-radius: 4px;
  text-align: center;
  /* box-shadow removed for strict style */
  pointer-events: none;
}
#doctor-app .doctor-thumb-tile-num--blank {
  background: #4f46e5;
  color: #fff;
}
#doctor-app .doctor-thumb-tile-num--client_ref {
  background: #475569;
  color: #fff;
}
#doctor-app .doctor-thumb-tile-crop img.doctor-conclusion-thumb {
  width: var(--doctor-thumb-size) !important;
  height: var(--doctor-thumb-size) !important;
  max-width: var(--doctor-thumb-size) !important;
  max-height: var(--doctor-thumb-size) !important;
  min-width: 0 !important;
  object-fit: cover;
  display: block;
  box-sizing: border-box;
  border: none;
  border-radius: 0;
}
#doctor-app .doctor-thumb-tile-crop a.doctor-conclusion-thumb--doc {
  width: var(--doctor-thumb-size) !important;
  height: var(--doctor-thumb-size) !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
}

#doctor-app .doctor-conclusion-remove-x {
  position: absolute;
  top: 3px;
  right: 3px;
  z-index: 7;
  width: 18px;
  height: 18px;
  padding: 0;
  margin: 0;
  border: 1px solid rgba(220, 38, 38, 0.55);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.92);
  color: #b91c1c;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  font-size: 10px;
  font-weight: 800;
  /* box-shadow removed for strict style */
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

#doctor-app .doctor-conclusion-remove-x:hover:not(:disabled) {
  background: rgba(254, 226, 226, 0.98);
  border-color: #dc2626;
  color: #991b1b;
}

/* Глобальные ссылки (не наследуют цвет у body-текста) */
a {
  color: var(--primary);
}

a:hover {
  color: var(--primary-dark);
}

/* Админ-кабинет: без скачков при смене вкладок */
.admin-header-actions {
  position: relative;
  min-height: 44px;
  min-width: 240px;
  flex-shrink: 0;
  align-self: center;
}

/* ===================================================================
   Админ-кабинет: вкладки навигации — модерный дизайн
   =================================================================== */

/* Обёртка вкладок — липнет к экрану при прокрутке */
.admin-tabs-bar {
  display: flex;
  gap: 0;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 64px; /* высота navbar */
  z-index: 50;
  background: var(--bg);
  padding-top: 0.5rem;
  margin-top: -0.5rem;
  flex-wrap: wrap;
  row-gap: 0;
}

/* Кнопка-вкладка: заменяет filter-btn для вкладок */
.admin-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 10px 10px 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  margin-bottom: -2px;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--fs-md);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.admin-tab-btn .icon {
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  opacity: 0.88;
}

.admin-tab-btn:hover {
  background: #f1f5f9;
  color: var(--primary);
}

.admin-tab-btn:hover .icon {
  opacity: 1;
}

.admin-tab-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  font-weight: 700;
  border-color: var(--border);
  border-bottom: 2px solid var(--primary);
  margin-bottom: -2px;
  /* box-shadow removed for strict style */
}

.admin-tab-btn.active .icon {
  opacity: 1;
  color: var(--primary);
}

/* Мобильная адаптация вкладок: горизонтальный скролл вместо переноса */
@media (max-width: 640px) {
  .admin-tabs-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-right: 24px;
  }
  .admin-tabs-bar::-webkit-scrollbar {
    display: none;
  }
  .admin-tabs-bar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 2px;
    width: 24px;
    background: linear-gradient(to left, var(--bg), transparent);
    pointer-events: none;
  }
  .admin-tab-btn {
    scroll-snap-align: start;
    flex-shrink: 0;
  }
}

/* Кнопка сброса фильтров — выделяется среди других */
.btn-filter-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: var(--btn-min-height);
  padding: var(--btn-padding-y) var(--btn-padding-x);
  border-radius: var(--btn-radius);
  border: 1.5px dashed var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: var(--btn-font-size);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  white-space: nowrap;
  box-sizing: border-box;
}

.btn-filter-reset:hover:not(:disabled) {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(220, 38, 38, 0.05);
}

.btn-filter-reset:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.admin-header-action-slot {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 1rem;
  align-items: center;
  white-space: nowrap;
}


/* ===================================================================
   Кабинет админа: унифицированная панель поиска/фильтров (redesign)
   =================================================================== */

/* Основной контейнер-карточка для фильтров */
.clinic-admin-toolbar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 1.1rem 1.25rem 1.15rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  /* box-shadow removed for strict style */
  position: relative;
  /* visible: иначе выпадающие панели комбобоксов (город и т.д.) обрезаются */
  overflow: visible;
}

/* Декоративная полоска сверху — сигнал что это «зона фильтрации» */
.clinic-admin-toolbar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #4f46e5 0%, #818cf8 50%, #06b6d4 100%);
  border-radius: var(--radius) var(--radius) 0 0;
}

/* У админки нет .sticky-header у page-header: общий .sticky-controls (для клиента/врача)
   даёт sticky + z-index:85 и top:135px — при прокрутке панель перекрывает таблицу;
   отрицательный margin-top тянет блок вверх. Оставляем карточку фильтров в потоке. */
.clinic-admin-toolbar.sticky-controls {
  position: relative;
  top: auto;
  margin-top: 0;
  z-index: auto;
}

/* Заголовок секции фильтров */
.clinic-admin-toolbar__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.clinic-admin-toolbar__title::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

/* Обёртка поля поиска с иконкой внутри */
.search-field-wrap {
  position: relative;
  flex: 3 1 300px;
  min-width: 0;
}

.search-field-wrap .search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
  transition: color var(--transition);
}

.search-field-wrap .form-input {
  width: 100%;
  padding-left: 2.5rem;
  min-width: 0;
}

.search-field-wrap:focus-within .search-icon {
  color: var(--primary);
}

/* Устаревший класс — алиас для обратной совместимости */
.clinic-admin-toolbar__search-wrap {
  flex: 3 1 420px;
  min-width: min(100%, 300px);
  max-width: 100%;
}

.clinic-admin-toolbar__search-wrap .form-input {
  width: 100%;
  min-width: 0;
}

/* Единая сетка фильтров в кабинете администратора */
.admin-dashboard-filters {
  display: grid;
  grid-template-columns: minmax(min(100%, 280px), 1.8fr) repeat(auto-fill, minmax(145px, 1fr));
  gap: 0.65rem 0.85rem;
  align-items: end;
  width: 100%;
}

.admin-dashboard-filters__search {
  min-width: 0;
}

/* search-field-wrap внутри grid-ячейки занимает всю ширину */
.admin-dashboard-filters__search .search-field-wrap {
  flex: none;
  width: 100%;
}

.admin-dashboard-filters__search .form-input {
  width: 100%;
}

.admin-dashboard-filters__field .form-input,
.admin-dashboard-filters__field .admin-combobox-trigger {
  width: 100%;
}

.admin-dashboard-filters__field--clinic {
  min-width: min(100%, 280px);
  max-width: 440px;
}

/* Одна строка: поиск + город + шаблон + баланс + сброс (как раньше по компактности) */
.admin-dashboard-filters--clinics {
  grid-template-columns:
    minmax(160px, 1.85fr)
    minmax(140px, 1.05fr)
    minmax(96px, 0.8fr)
    minmax(96px, 0.8fr)
    auto;
  align-items: end;
  /* Нельзя overflow-x: auto/scroll на этом же блоке: в браузерах тогда overflow-y
     вычисляется как auto и режет абсолютно позиционированную панель «Город». */
  overflow: visible;
  padding-bottom: 2px;
}

.admin-dashboard-filters--clinics .admin-dashboard-filters__field {
  min-width: 0;
}

.admin-dashboard-filters--clinics .admin-combobox {
  width: 100%;
  max-width: none;
  min-width: 0;
  position: relative;
  z-index: 1;
}

/* Открытая панель — над соседними селектами в одной строке сетки */
.admin-dashboard-filters--clinics .admin-combobox:has(.admin-combobox-panel) {
  z-index: 30;
}

.admin-dashboard-filters--clinics .admin-dashboard-filters__field--end {
  justify-self: end;
}

@media (max-width: 640px) {
  .admin-dashboard-filters--clinics {
    grid-template-columns: 1fr;
  }
  .admin-dashboard-filters--clinics .admin-dashboard-filters__search {
    grid-column: auto;
  }
  .admin-dashboard-filters--clinics .admin-dashboard-filters__field--end {
    justify-self: stretch;
  }
}

.admin-dashboard-filters--users {
  grid-template-columns: minmax(min(100%, 280px), 1.85fr) minmax(240px, 1fr);
}

.admin-dashboard-filters--transactions {
  grid-template-columns: minmax(min(100%, 280px), 1.75fr) repeat(auto-fill, minmax(145px, 1fr));
}

/* Заявки: строка фильтров; ниже — подсказка про сортировку по колонкам + кнопки */
.admin-dashboard-filters--orders {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.admin-dashboard-filters--orders .admin-dashboard-filters__row {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) repeat(3, minmax(0, 1fr));
  gap: 0.65rem 0.85rem;
  align-items: end;
}

.admin-dashboard-filters--orders .admin-dashboard-filters__row--orders-toolbar {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.admin-orders-sort-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  min-width: 0;
}

.admin-dashboard-filters--orders .admin-dashboard-filters__field--orders-actions {
  justify-content: flex-end;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .admin-dashboard-filters--orders .admin-dashboard-filters__row:first-child {
    grid-template-columns: 1fr 1fr;
  }
  .admin-dashboard-filters--orders .admin-dashboard-filters__search {
    grid-column: 1 / -1;
  }
  .admin-dashboard-filters--orders .admin-dashboard-filters__row--orders-toolbar {
    grid-template-columns: 1fr;
  }
  .admin-dashboard-filters--orders .admin-dashboard-filters__field--orders-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .admin-dashboard-filters--orders .admin-dashboard-filters__row {
    grid-template-columns: 1fr;
  }
  .admin-dashboard-filters--orders .admin-dashboard-filters__search {
    grid-column: auto;
  }
}

/* Строка pills-фильтров (роли, статусы, и т.д.) — оформлена как отдельная секция */
.admin-filter-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
  align-items: center;
  margin-top: 0.65rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

/* Метка группы pills */
.admin-filter-pills-row > span:first-child {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 0.1rem;
  white-space: nowrap;
}

/* Разделители в строке pills */
.admin-filter-pills-row > span[style*="border-left"] {
  opacity: 0.5;
}

@media (max-width: 640px) {
  .admin-dashboard-filters {
    grid-template-columns: 1fr;
  }
  .search-field-wrap {
    flex: 1 1 100%;
  }
}

/* Пагинация списков в кабинете администратора */
.admin-orders-table th.admin-orders-th--sortable {
  padding: 8px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  vertical-align: bottom;
}
.admin-orders-table th.admin-orders-th--sortable:hover {
  background: var(--secondary-bg);
}
.admin-orders-table .admin-orders-sort-ind {
  font-weight: 600;
  opacity: 0.85;
}

.admin-orders-table th.admin-orders-th--num,
.admin-orders-table td.admin-td--num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.admin-pagination-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1rem;
  margin-top: 1rem;
  padding: 0.65rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}

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

.admin-tab-panel-wrap {
  min-height: min(68vh, 820px);
}

.tab-fade-enter-active,
.tab-fade-leave-active {
  transition: opacity 0.2s ease;
}

.tab-fade-enter-from,
.tab-fade-leave-to {
  opacity: 0;
}

/* Mobile adjustments */
@media (max-width: 920px) {
  .container {
    padding: 1rem;
  }

  .page-header {
    align-items: flex-start;
  }

  .page-header > div:last-child {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    box-sizing: border-box;
  }

  .page-header > div:last-child .balance-bar {
    flex: 1 1 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .page-header > div:last-child > .btn,
  .page-header > div:last-child > a.btn {
    flex: 1 1 auto;
    min-width: 0;
  }

  .admin-header-actions {
    min-width: 0;
    width: 100%;
    align-self: stretch;
  }

  .admin-header-action-slot {
    position: static;
    transform: none;
    justify-content: flex-start;
  }

  .admin-tab-panel-wrap {
    min-height: min(55vh, 640px);
  }

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

/* ===== Зоны интереса ===== */
.interest-zones-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.zone-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.83rem;
  background: var(--surface-2);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  user-select: none;
  line-height: 1.4;
}

.zone-checkbox-label:hover:not(.zone-disabled) {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
}

.zone-checkbox-label.zone-checked {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--primary);
  color: var(--primary-light);
  font-weight: 500;
}

.zone-checkbox-label.zone-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.zone-checkbox-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* Список бланков по зонам (клиентская карточка) — каждый на своей строке */
.doc-zone-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
.doc-zone-list__btn {
  justify-content: flex-start;
  text-align: left;
  align-self: flex-start;
}

.zone-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary-light);
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid rgba(99, 102, 241, 0.25);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.zone-tag--on {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

@media (max-width: 640px) {
  /* Шапка: два ряда, чтобы «Профиль» и «Выйти» не уезжали за экран */
  .navbar {
    padding: 10px 12px;
    height: auto;
    min-height: 52px;
    flex-wrap: wrap;
    row-gap: 10px;
    box-sizing: border-box;
    max-width: 100%;
  }

  .navbar-brand {
    font-size: var(--fs-md);
    gap: 6px;
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .navbar-right {
    flex: 1 1 100%;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
  }

  .user-badge .username-text {
    display: none;
  }

  .user-badge {
    padding: 5px 10px;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
    max-width: calc(100% - 5.5rem);
    overflow: hidden;
  }

  .user-badge .role-pill {
    flex-shrink: 0;
  }

  .btn-logout {
    padding: var(--btn-sm-padding-y) 0.75rem;
    font-size: var(--btn-compact-font-size);
    min-height: auto;
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* Сводка врача: не сжимать 5 колонок в «0 0» на телефоне */
  .doctor-dashboard-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  /* #1 Overlay: уменьшаем отступы — модалка ближе к верху экрана */
  .modal-overlay {
    padding: 0.5rem;
  }

  .modal {
    padding: 1rem;
    border-radius: 10px;
    max-width: 100%;
    width: 100%;
  }

  /* Футер модалок на мобильном: sticky, не теряется при скролле длинных форм */
  .modal-footer--end-tight,
  .modal-footer--end,
  .modal-footer--end-sm {
    position: sticky;
    bottom: -1rem;
    background: var(--bg-card);
    margin: 1rem -1rem -1rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    z-index: 2;
  }

  /* #2 Header: корректируем padding/margin под padding модалки 1rem */
  .modal-header {
    padding: 1rem 1rem 0.75rem 1rem;
    margin: -1rem -1rem 1rem -1rem;
    top: -1rem;
    gap: 0.75rem;
  }

  /* #3 Модалка врача: padding и высота */
  .modal--doctor-request {
    padding: 1rem;
    max-height: calc(100vh - 2rem);
  }

  .modal-form {
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    margin-bottom: 0;
  }

  /* Клиент: flex-модалка не должна терять ограничение высоты из-за правила выше */
  body.client-theme .modal-form.modal-form--flex {
    max-height: min(90vh, 920px);
    overflow: hidden;
    margin: auto;
  }

  /* Подгоняем sticky-футер под мобильный padding модалки */
  .modal-footer-sticky {
    bottom: -1rem;
    margin: 0.75rem -1rem -1rem;
    padding: 0.75rem 1rem;
  }

  body.client-theme .modal-form--flex .modal-footer-sticky {
    bottom: auto;
    margin: 0.75rem -1rem -1rem;
  }

  .btn {
    width: auto;
  }

  /* Кнопки в модалках не растягиваем на всю ширину */
  .client-form-footer-btn {
    min-width: 0;
  }

  /* Футер формы: кнопки в колонку только на узких экранах */
  @media (max-width: 600px) {
    .client-form-footer-actions {
      flex-direction: column;
      align-items: stretch;
    }

    .client-form-footer-actions-right {
      flex-direction: column;
      align-items: stretch;
      margin-left: 0;
    }

    .client-form-footer-actions-right .btn {
      width: 100%;
      justify-content: center;
    }
  }

  /* #5 Footer врача: кнопки в колонку на мобильных */
  .modal-footer--split {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .modal-footer--split .btn {
    width: 100%;
    justify-content: center;
  }

  /* #7 Toast: убираем min-width на узких экранах */
  #toast-container {
    right: 8px;
    left: 8px;
    top: 12px;
  }
  .toast {
    min-width: 0;
    max-width: 100%;
  }
}

@media (max-width: 400px) {
  .doctor-dashboard-stats-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Toast-уведомления (window.showToast в base.html) */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: calc(var(--z-modal) + 100);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 260px;
  max-width: 400px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: var(--fs-md);
  color: #fff;
  /* box-shadow removed for strict style */
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.toast--success { background: var(--success); }
.toast--error { background: var(--danger); }
.toast--warning { background: var(--warning); }
.toast--info { background: var(--info); }

.toast .toast-icon {
  flex-shrink: 0;
  color: #fff;
}

.toast-message {
  flex: 1;
  min-width: 0;
}

.toast-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0 0 0 8px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.toast-close .icon {
  width: 1.1rem;
  height: 1.1rem;
  color: #fff;
}

/* === Списки и анимации (Zone 4) === */

.list-enter-active,
.list-leave-active {
  transition: all 0.3s ease;
}

.list-enter-from,
.list-leave-to {
  opacity: 0;
  transform: translateY(15px);
}

.list-leave-active {
  position: absolute;
}

/* Скелеты загрузки */
@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-box {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite linear;
  border-radius: 4px;
  color: transparent !important;
  pointer-events: none;
}
.skeleton-box * {
  visibility: hidden;
}

/* Скопировано Tooltip */
.tooltip-copiable {
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tooltip-copiable:hover {
  color: var(--primary);
}
.tooltip-copiable::after {
  content: "Скопировать";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: var(--text);
  color: #fff;
  padding: 4px 8px;
  font-size: var(--fs-xs);
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
  z-index: 100;
}
.tooltip-copiable:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.tooltip-copiable.copied::after {
  content: "Скопировано!";
  background: var(--success);
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Zone 4: Mobile List Layout */
@media (max-width: 768px) {
  .request-card {
    padding: 1.25rem 1rem;
  }
  .request-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .request-header .status-badge {
    align-self: flex-start;
  }
  .request-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .request-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .req-details-row {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}


/* Navbar chat button */
.chat-nav-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: .35rem;
  border-radius: var(--radius);
  transition: color .15s;
}
.chat-nav-btn:hover { color: var(--primary); }

/* ===========================================================================
   Чат-виджет (JivoSite-like)
   =========================================================================== */

/* FAB */
.chat-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: var(--z-chat-fab);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37,99,235,.4);
  transition: transform .2s, box-shadow .2s;
}
.chat-fab:hover { transform: scale(1.1); box-shadow: 0 6px 24px rgba(37,99,235,.5); }
.chat-fab.active { background: var(--text-muted); box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.chat-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  background: var(--danger);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 2px solid #fff;
}

/* Slide animation */
.chat-slide-enter-active, .chat-slide-leave-active { transition: opacity .2s, transform .2s; }
.chat-slide-enter-from, .chat-slide-leave-to { opacity: 0; transform: translateY(20px) scale(.95); }

/* Panel */
.chat-panel {
  position: fixed;
  bottom: calc(1.5rem + 60px + 1rem);
  right: 1.5rem;
  z-index: var(--z-chat-panel);
  width: 400px;
  height: 560px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0,0,0,.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.chat-panel-header {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--border);
  background: var(--primary);
  color: #fff;
  min-height: 48px;
  flex-wrap: nowrap;
}
.chat-panel-header .chat-panel-title { color: #fff; }
.chat-header-icon { opacity: .8; flex-shrink: 0; }
.chat-panel-title {
  font-weight: 600;
  font-size: .88rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-back-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.8);
  cursor: pointer;
  padding: .25rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
}
.chat-back-btn:hover { color: #fff; }
.chat-close-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.7);
  cursor: pointer;
  padding: .25rem;
  margin-left: auto;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
}
.chat-close-btn:hover { color: #fff; }

.chat-status-pill {
  font-size: .65rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.4;
}
.chat-status--OPEN   { background: rgba(255,255,255,.2); color: #fff; }
.chat-status--TAKEN  { background: var(--warning-bg); color: var(--warning-dark); }
.chat-status--CLOSED { background: rgba(255,255,255,.15); color: rgba(255,255,255,.7); }
/* Variant for room list (white background) */
.chat-status-pill--list.chat-status--OPEN   { background: var(--border-light); color: var(--text-muted); }
.chat-status-pill--list.chat-status--TAKEN  { background: var(--warning-bg); color: var(--warning-dark); }
.chat-status-pill--list.chat-status--CLOSED { background: var(--secondary-bg); color: var(--text-secondary); }

/* Chat badge variants (admin table) */
.badge { display: inline-block; font-size: .7rem; font-weight: 600; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.badge--warning { background: var(--warning-bg); color: var(--warning-dark); }
.badge--info    { background: #dbeafe; color: #1e40af; }
.badge--default { background: var(--border-light); color: var(--text-muted); }
.badge--muted   { background: var(--secondary-bg); color: var(--text-secondary); }
.badge--group   { background: #10b981; color: #fff; }

/* Плавающая кнопка «наверх» */
.scroll-to-top-btn {
  position: fixed;
  right: 1.25rem;
  bottom: 5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--primary, #4f46e5);
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.scroll-to-top-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, .22);
}
.scroll-to-top-btn .icon {
  width: 22px;
  height: 22px;
}
@media (max-width: 600px) {
  .scroll-to-top-btn {
    right: 0.75rem;
    bottom: 4.5rem;
    width: 40px;
    height: 40px;
  }
}

/* ── Админ: таблица чатов (Чат-центр) ── */
.admin-chat-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.admin-chat-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: .875rem;
}
.admin-chat-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--secondary-bg, #f3f4f6);
  color: var(--text-secondary, #4b5563);
  font-weight: 600;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  text-align: left;
  padding: .55rem .6rem;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  white-space: nowrap;
  vertical-align: middle;
}
.admin-chat-table tbody td {
  padding: .55rem .6rem;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-chat-table tbody tr:hover {
  background: var(--hover-bg, rgba(99, 102, 241, .04));
}
.admin-chat-col--id       { width: 60px; }
.admin-chat-col--type     { width: 100px; }
.admin-chat-col--title    { width: auto; }
.admin-chat-col--status   { width: 110px; }
.admin-chat-col--assignee { width: 180px; }
.admin-chat-col--last     { width: 170px; }
.admin-chat-col--actions  { width: 320px; }

.admin-chat-td--num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-chat-th--num { text-align: right; }
.admin-chat-td--title { font-weight: 500; }
.admin-chat-td--assignee,
.admin-chat-td--last { color: var(--text-secondary, #4b5563); }

.admin-chat-th--sortable {
  cursor: pointer;
  user-select: none;
}
.admin-chat-th--sortable:hover { background: var(--hover-bg, rgba(99, 102, 241, .06)); }
.admin-chat-sort-ind { font-weight: 700; opacity: .8; }
.admin-chat-th--actions { text-align: right; }
.admin-chat-td--actions { text-align: right; }

.admin-chat-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .35rem;
}
.admin-chat-actions .btn { flex: 0 0 auto; }

@media (max-width: 900px) {
  .admin-chat-table { min-width: 960px; }
}

/* Chat tabs */
.chat-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-light);
  padding: 0 .75rem;
  flex-shrink: 0;
}
.chat-tab {
  flex: 1;
  padding: .5rem .25rem;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  text-align: center;
  position: relative;
  transition: color .15s, border-color .15s;
}
.chat-tab:hover { color: var(--text-on-light); }
.chat-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.chat-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  font-size: .6rem;
  font-weight: 700;
  background: var(--danger-light);
  color: #fff;
  border-radius: 8px;
  padding: 0 4px;
  margin-left: 4px;
  vertical-align: middle;
}
/* Pool avatar */
.chat-room-avatar--channel { background: #8b5cf6; }
.chat-room-avatar--group { background: var(--success); }
.chat-room-avatar--pool { background: var(--warning); }
.chat-room-pool-label { font-size: .7rem; color: var(--warning); font-style: italic; }

/* Body */
.chat-panel-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* Welcome / Start form */
.chat-start-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.25rem;
}
.chat-welcome {
  text-align: center;
  margin-bottom: 1.5rem;
}
.chat-welcome-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-alpha);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto .75rem;
}
.chat-welcome-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 .35rem;
}
.chat-welcome-text {
  font-size: .85rem;
  color: var(--text-secondary);
  margin: 0;
}
.chat-form-fields {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  flex: 1;
}
.chat-start-btn {
  margin-top: auto;
  padding: .7rem 1rem;
  font-size: .95rem;
}

/* Center state (loading/empty) */
.chat-center-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: 2rem 1rem;
  color: var(--text-secondary);
}
.chat-center-state p { margin: 0; font-size: .9rem; }
.chat-empty { text-align: center; color: var(--text-muted); padding: 2rem 1rem; }
.chat-empty-icon { opacity: .5; color: var(--text-muted, #94a3b8); }

/* Room list */
.chat-room-list {
  flex: 1;
  overflow-y: auto;
  padding-top: .25rem;
}
.chat-room-item {
  display: flex;
  gap: .75rem;
  padding: .75rem 1rem;
  cursor: pointer;
  transition: background .1s;
  border-bottom: 1px solid var(--border);
}
.chat-room-item:hover { background: var(--bg); }
.chat-room-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-alpha);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-room-info { flex: 1; min-width: 0; }
.chat-room-item-top {
  display: flex;
  align-items: center;
  gap: .35rem;
  min-width: 0;
}
.chat-room-title {
  font-weight: 500;
  font-size: .9rem;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-room-time {
  font-size: .7rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.chat-room-bottom {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: 2px;
}
.chat-room-preview {
  font-size: .8rem;
  color: var(--text-secondary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-unread-badge {
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  flex-shrink: 0;
}

/* Conversation */
.chat-conversation {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.chat-typing-bar {
  font-size: .75rem;
  color: var(--text-secondary);
  padding: .25rem 1rem;
  font-style: italic;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: .75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  background: var(--bg);
}
.chat-messages-start {
  text-align: center;
  font-size: .75rem;
  color: var(--text-secondary);
  padding: .5rem 0 1rem;
  opacity: .6;
}
.chat-loading {
  text-align: center;
  padding: .75rem 0;
}
.chat-date-sep {
  text-align: center;
  padding: .75rem 0 .5rem;
}
.chat-date-sep span {
  font-size: .7rem;
  color: var(--text-secondary);
  background: var(--border-light);
  padding: 2px 10px;
  border-radius: 10px;
}

/* Message */
.chat-msg {
  max-width: 78%;
  align-self: flex-start;
  animation: chatMsgIn .15s ease-out;
}
@keyframes chatMsgIn { from { opacity: 0; transform: translateY(4px); } }
.chat-msg--own { align-self: flex-end; }
.chat-msg--pending { opacity: .7; }
.chat-msg--system {
  align-self: center;
  max-width: 85%;
}
.chat-msg--system .chat-msg-bubble {
  background: var(--secondary-bg);
  color: var(--text-muted);
  font-size: .75rem;
  text-align: center;
  padding: .3rem .75rem;
  box-shadow: none;
  border: none;
  border-radius: 12px;
}
.chat-msg-author {
  font-size: .7rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 2px;
  padding-left: .75rem;
}
.chat-msg-bubble {
  background: var(--bg-card);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 4px;
  padding: .5rem .75rem;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
  border: 1px solid var(--border-light);
}
.chat-msg--own .chat-msg-bubble {
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-lg) var(--radius-lg) 4px var(--radius-lg);
  border-color: transparent;
}
.chat-msg--failed .chat-msg-bubble {
  border-color: var(--danger);
  background: var(--danger-bg);
}
.chat-msg-text {
  font-size: .9rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-msg-file {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .6rem;
  margin-top: .35rem;
  min-width: 200px;
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border-light, #e2e8f0);
  background: rgba(15, 23, 42, .04);
  color: inherit;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.chat-msg-text + .chat-msg-file { margin-top: .5rem; }
.chat-msg-bubble > .chat-msg-file:first-child { margin-top: 0; }
.chat-msg-file:hover { background: rgba(15, 23, 42, .07); border-color: rgba(15, 23, 42, .15); text-decoration: none; }
.chat-msg-file-icon { flex-shrink: 0; color: var(--primary); width: 22px; height: 22px; }
.chat-msg-file-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.chat-msg-file-name { font-size: .82rem; font-weight: 600; color: var(--text-strong, #0f172a); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-msg-file-size { font-size: .7rem; color: var(--text-secondary, #64748b); }
.chat-msg-file-download { flex-shrink: 0; color: var(--text-secondary, #64748b); width: 16px; height: 16px; }
.chat-msg-file:hover .chat-msg-file-download { color: var(--primary); }
/* Own message (синий фон) — инвертируем цвета карточки */
.chat-msg--own .chat-msg-file {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.25);
}
.chat-msg--own .chat-msg-file:hover {
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.4);
}
.chat-msg--own .chat-msg-file-icon,
.chat-msg--own .chat-msg-file-name { color: #fff; }
.chat-msg--own .chat-msg-file-size,
.chat-msg--own .chat-msg-file-download { color: rgba(255,255,255,.8); }
.chat-msg--own .chat-msg-file:hover .chat-msg-file-download { color: #fff; }
.chat-msg-footer {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-top: .15rem;
}
.chat-msg-time { font-size: .65rem; color: var(--text-secondary); }
.chat-msg--own .chat-msg-time { color: rgba(255,255,255,.65); }
.chat-msg-status { display: inline-flex; }
.chat-msg-error { font-size: .7rem; color: var(--danger); }
.chat-retry-btn {
  background: none; border: none;
  color: var(--primary); cursor: pointer;
  font-size: .7rem; text-decoration: underline; padding: 0;
}

/* Closed bar */
.chat-closed-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .75rem 1rem;
  font-size: .85rem;
  color: var(--text-secondary);
  background: var(--secondary-bg);
  border-top: 1px solid var(--border);
}

/* Input bar */
.chat-input-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .35rem;
  padding: .6rem .75rem;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}
.chat-input-row {
  display: flex;
  align-items: center;
  gap: .4rem;
}
.chat-attach-btn.is-disabled { opacity: .5; pointer-events: none; }
.chat-attach-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  padding: 0;
  flex-shrink: 0;
  border-radius: 50%;
  transition: color .15s, background .15s;
}
.chat-attach-btn:hover { color: var(--primary); background: var(--primary-alpha); }
.chat-input-wrap { flex: 1; position: relative; }
.chat-input {
  width: 100%;
  resize: none;
  min-height: 38px;
  max-height: 100px;
  font-size: .9rem;
  font-family: inherit;
  padding: .45rem .75rem;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  outline: none;
  transition: border-color .15s;
  background: var(--bg);
}
.chat-input:focus { border-color: var(--primary); background: var(--bg-card); }
.chat-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--border-light);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.chat-send-btn.active, .chat-send-btn:hover:not(:disabled) {
  background: var(--primary);
  color: #fff;
}
.chat-send-btn:disabled { cursor: default; opacity: .5; }

.chat-close-text-btn {
  border: 1px solid rgba(255,255,255,.4);
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: .7rem;
  font-weight: 600;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  margin-left: auto;
}
.chat-close-text-btn:hover { background: rgba(255,255,255,.3); }

/* Spinner */
.chat-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: chatSpin .6s linear infinite;
}
.chat-spinner--lg { width: 28px; height: 28px; border-width: 3px; }
.chat-spinner--xs { width: 10px; height: 10px; border-width: 1.5px; }
@keyframes chatSpin { to { transform: rotate(360deg); } }

/* WS reconnect */
.chat-reconnect-bar {
  display: flex; align-items: center; gap: .5rem;
  padding: .4rem .75rem; font-size: .75rem;
  background: var(--warning-bg); color: var(--warning-dark); border-bottom: 1px solid var(--warning-border);
}

/* Room info panel */
.chat-room-info-panel {
  padding: .5rem .75rem; font-size: .78rem;
  background: var(--bg-secondary, #f8fafc); border-bottom: 1px solid var(--border, #e2e8f0);
  max-height: 320px; overflow-y: auto;
}
.chat-room-info-row { padding: .15rem 0; }
.chat-info-label { font-weight: 600; color: var(--text-muted, #64748b); margin-right: .25rem; }
.chat-room-members-list { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .25rem; }
.chat-member-tag {
  display: inline-block; padding: .1rem .4rem; border-radius: 4px;
  background: var(--primary-alpha, rgba(59,130,246,.1)); font-size: .7rem;
}
.chat-panel-title--clickable { cursor: pointer; }
.chat-panel-title--clickable:hover { opacity: .8; }
.chat-chevron-icon { opacity: .5; margin-left: 2px; flex-shrink: 0; }
.chat-member-remove-btn {
  background: none; border: none; cursor: pointer; font-size: .85rem;
  color: var(--danger, #ef4444); padding: 0 0 0 3px; line-height: 1; opacity: .6;
}
.chat-member-remove-btn:hover { opacity: 1; }
.chat-add-member { position: relative; }
.chat-add-member-input {
  width: 100%; padding: .3rem .5rem; border: 1px solid var(--border, #e2e8f0);
  border-radius: 4px; font-size: .75rem;
}
.chat-add-member-dropdown {
  position: static; margin-top: .25rem;
  background: var(--bg-card, #fff); border: 1px solid var(--border, #e2e8f0);
  border-radius: 4px; max-height: 150px; overflow-y: auto; box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.chat-add-member-option {
  padding: .35rem .5rem; cursor: pointer; font-size: .75rem;
}
.chat-add-member-option:hover { background: var(--primary-alpha, rgba(59,130,246,.08)); }

/* New chat steps */
.chat-new-chat-btn {
  margin: .6rem .75rem .5rem;
  width: calc(100% - 1.5rem);
}
.chat-new-chat-steps { padding: .5rem .75rem; display: flex; flex-direction: column; gap: .5rem; }
.chat-step-title { font-size: .85rem; font-weight: 600; margin: 0; }
.chat-step-back-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: none;
  border: none;
  padding: .3rem .5rem;
  margin: 0 0 .25rem;
  font-size: .8rem;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  border-radius: var(--radius, 8px);
}
.chat-step-back-btn:hover { color: var(--text-strong, #0f172a); background: rgba(0,0,0,.04); }
.chat-step-back-btn .icon { width: 14px; height: 14px; }

/* Search */
.chat-search-input {
  width: 100%; padding: .4rem .6rem; border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius, 8px); font-size: .8rem; margin-bottom: .5rem;
  background: var(--bg-card, #fff);
}
.chat-search-input:focus { border-color: var(--primary); outline: none; }
/* Поиск в корне списка чатов — с боковыми отступами (внутри шагов мастера */
/* `.chat-new-chat-steps` сам даёт padding, там дополнительные отступы не нужны). */
.chat-room-list > .chat-search-input {
  width: calc(100% - 1.5rem);
  margin: 0 .75rem .5rem;
}

/* Upload progress */
.chat-upload-progress {
  position: relative; height: 28px; background: #f1f5f9;
  border-radius: var(--radius, 8px); overflow: hidden; margin: .25rem 0;
}
.chat-upload-progress-bar {
  position: absolute; top: 0; left: 0; height: 100%;
  background: var(--primary, #3b82f6); transition: width .2s;
}
.chat-upload-progress-text {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; font-size: .7rem; font-weight: 600; color: #334155;
}

/* Pool take bar */
.chat-pool-take-bar {
  display: flex; align-items: center; justify-content: center;
  padding: .75rem; border-top: 1px solid var(--border, #e2e8f0);
  background: var(--bg-card, #fff);
}
.chat-return-pool-btn {
  background: none; border: none; cursor: pointer; padding: 2px 4px;
  color: rgba(255,255,255,.7); border-radius: 4px; line-height: 1;
  transition: color .15s, background .15s;
}
.chat-return-pool-btn:hover {
  color: #fff; background: rgba(255,255,255,.15);
}
.chat-mute-toggle {
  background: none; border: 1px solid var(--border, #e2e8f0);
  cursor: pointer; padding: .25rem .5rem; border-radius: 4px;
  font-size: .72rem; display: inline-flex; align-items: center; gap: .3rem;
  color: var(--text, #1e293b); margin-left: .25rem;
}
.chat-mute-toggle:hover { background: var(--bg-secondary, #f1f5f9); }
.chat-muted-icon {
  opacity: .6; margin-left: 4px; vertical-align: middle;
  color: var(--text-muted, #94a3b8);
}
.chat-add-member-empty {
  padding: .5rem; color: var(--text-muted, #94a3b8);
  font-size: .72rem; text-align: center;
}

/* Char counter */
.chat-char-counter {
  position: absolute; bottom: 2px; right: 6px;
  font-size: .6rem; color: var(--text-muted, #94a3b8);
}
.chat-char-limit { color: var(--danger, #ef4444); font-weight: 600; }

/* Slide-down transition */
.chat-slide-down-enter-active, .chat-slide-down-leave-active { transition: all .2s ease; }
.chat-slide-down-enter-from, .chat-slide-down-leave-to { max-height: 0; opacity: 0; overflow: hidden; }
.chat-slide-down-enter-to, .chat-slide-down-leave-from { max-height: 320px; opacity: 1; }

/* Pool filters (chip bar) */
.chat-pool-filters {
  display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .4rem;
  padding: .25rem .75rem 0; align-items: center;
}
.chat-pool-filter-chip {
  background: var(--bg-card, #fff); border: 1px solid var(--border, #e2e8f0);
  color: var(--text, #1e293b); border-radius: 999px;
  padding: .2rem .6rem; font-size: .7rem; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.chat-pool-filter-chip:hover { background: var(--bg-secondary, #f1f5f9); }
.chat-pool-filter-chip--active {
  background: var(--primary, #3b82f6); border-color: var(--primary, #3b82f6);
  color: #fff;
}
.chat-pool-filter-reset {
  background: none; border: none; cursor: pointer; color: var(--text-muted, #94a3b8);
  padding: .1rem .3rem; display: inline-flex; align-items: center; justify-content: center;
}
.chat-pool-filter-reset:hover { color: var(--danger, #ef4444); }

/* Room item: request type tag + helpers count */
.chat-room-type-tag {
  font-size: .68rem; padding: .08rem .4rem;
  background: var(--primary-alpha, rgba(59,130,246,.12));
  color: var(--primary, #3b82f6); border-radius: 4px;
  font-weight: 500;
}
.chat-room-helpers-count {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: .65rem; color: var(--text-muted, #94a3b8);
  margin-left: auto;
}

/* Helpers block in room info */
.chat-helpers-block { flex-direction: column; align-items: flex-start; gap: .35rem; }
.chat-helpers-hint {
  font-size: .68rem; color: var(--text-muted, #94a3b8); font-style: italic;
}
.chat-helpers-empty {
  font-size: .7rem; color: var(--text-muted, #94a3b8);
}
.chat-helpers-list {
  display: flex; flex-wrap: wrap; gap: .3rem;
}
.chat-helper-tag {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .15rem .4rem; border-radius: 4px;
  background: rgba(34, 197, 94, .12); color: #15803d;
  font-size: .7rem;
}
.chat-helper-remove-btn {
  background: none; border: none; cursor: pointer; font-size: .85rem;
  color: #15803d; padding: 0 0 0 2px; line-height: 1; opacity: .6;
}
.chat-helper-remove-btn:hover { opacity: 1; color: var(--danger, #ef4444); }
.chat-add-helper { width: 100%; }

/* Mobile */
@media (max-width: 640px) {
  .chat-fab { bottom: 1rem; right: 1rem; width: 52px; height: 52px; }
  .chat-panel {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%; max-height: 100%;
    border-radius: 0; border: none;
  }
  .chat-tab { font-size: .65rem; white-space: nowrap; padding: .4rem .25rem; }
  .chat-room-info-panel { max-height: 40vh; }
  .chat-input-bar { padding: .75rem; }
}

/* ── UX полировка по ролям (B2–B8) ────────────────────────────── */

/* B2: «застрявшие» заявки в админке */
.status-badge--stale {
  box-shadow: 0 0 0 1px var(--warning, #f59e0b) inset;
}
.status-badge--critical {
  box-shadow: 0 0 0 2px var(--danger, #ef4444) inset;
}

/* B3: адекватная ширина и высота textarea на планшетах/ноутах */
@media (max-width: 1000px) {
  .modal--admin-order { width: min(920px, 94vw); }
  .modal-form { max-width: 94vw; }
  textarea.form-input.textarea-xxl { min-height: 40rem; }
}

/* B4: таблица заказов в админке — горизонтальный скролл на узких экранах */
@media (max-width: 1100px) {
  .admin-table-region { overflow-x: auto; }
  .admin-orders-table { min-width: 960px; }
}

/* B5: «обязательно» в формах клиента — звёздочка заметнее */
.req-mark {
  color: var(--danger, #ef4444);
  font-weight: 700;
  margin-left: 3px;
  font-size: 1.05em;
}

/* B6: видимый focus-ring для icon-only кнопок по клавиатуре */
.search-clear-btn:focus-visible,
.chat-close-btn:focus-visible,
.chat-back-btn:focus-visible,
.chat-attach-btn:focus-visible,
.chat-step-back-btn:focus-visible,
.doctor-conclusion-remove-x:focus-visible,
.admin-combobox-toggle:focus-visible,
.modal-close:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}

/* B8: адекватный touch-target на мобиле для кнопок-фильтров */
@media (max-width: 600px) {
  .filter-btn { min-height: 38px; }
}

/* ── Admin orders: компактный тулбар (поиск сверху, фильтры + иконки) ── */
.admin-orders-toolbar {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: .75rem;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius, 8px);
  margin-bottom: 1rem;
}
.admin-orders-toolbar__search {
  flex: none;
  width: 100%;
}
.admin-orders-toolbar__search .form-input {
  width: 100%;
  padding-left: 2.5rem;
}
.admin-orders-toolbar__row {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
}
.admin-orders-toolbar__select {
  flex: 1 1 150px;
  min-width: 140px;
}
.admin-orders-toolbar__actions {
  display: flex;
  gap: .35rem;
  margin-left: auto;
}
.admin-orders-toolbar__meta {
  margin: 0;
  font-size: .8rem;
  color: var(--text-muted, #6b7280);
}
@media (max-width: 640px) {
  .admin-orders-toolbar__actions { margin-left: 0; }
}

/* ── Admin orders: компактная двухэтажная верстка ячеек ────────── */
.admin-cell-stack {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  line-height: 1.25;
}
.admin-cell-stack__main { font-size: .875rem; color: var(--text, #1e293b); }
.admin-cell-stack__sub  { font-size: .75rem;  color: var(--text-muted, #6b7280); }
.admin-cell-stack__ssub { font-size: .7rem;   color: var(--text-muted, #9ca3af); }

/* В стек-ячейке бейдж статуса идёт как __sub, не растягивается на всю ячейку */
.admin-cell-stack .status-badge {
  align-self: flex-start;
}

/* Икон-кнопки действий: компактный квадратик, не прилипают впритык */
.admin-orders-table--compact .admin-td--actions .btn-icon {
  padding: .35rem .45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.admin-orders-table--compact .admin-td--actions .btn-icon .icon {
  margin: 0;
}
