/* 
  Платформа заявок и бланков — главный 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: #4f46e5;          /* индиго */
  --primary-dark: #3730a3;
  --primary-light: #818cf8;
  --accent: #06b6d4;           /* cyan */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #0f172a;               /* тёмный фон */
  --bg-card: #1e293b;          /* карточки */
  --bg-input: #0f172a;
  --bg-dark: #0f172a;
  --border: #334155;
  --border-color: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-color: #f1f5f9;
  --text-on-light: #1e293b;    /* тёмный текст для светлых поверхностей */
  --secondary-bg: #1e293b;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
}

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

body {
  font-family: 'Muller', 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-weight: 300;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  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;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --bg-dark: #f1f5f9;
  --border: #e2e8f0;
  --border-color: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-color: #1e293b;
  --secondary-bg: #f1f5f9;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}
body.client-theme .navbar { background: #fff; border-color: #e2e8f0; }
body.client-theme .request-card { background: #fff; border-color: #e2e8f0; }
body.client-theme .stat-card { background: #fff; border-color: #e2e8f0; }
body.client-theme .form-input { background: #fff; border-color: #e2e8f0; color: #1e293b; }
body.client-theme .form-input.input-readonly,
body.client-theme .form-input:disabled { background: #f1f5f9; color: #64748b; }
body.client-theme .modal { background: #fff; border-color: #e2e8f0; }
body.client-theme .modal-overlay { background: rgba(0,0,0,0.4); }

/* === Типографика === */
h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.5rem; font-weight: 600; }
h3 { font-size: 1.2rem; font-weight: 600; }
p { color: var(--text-muted); }

/* === Шапка (навигация) === */
.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: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

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

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

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

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(79, 70, 229, 0.15);
  border: 1px solid rgba(79, 70, 229, 0.3);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.875rem;
}

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

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

/* === Страница входа === */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: 
    radial-gradient(ellipse at 20% 50%, rgba(79, 70, 229, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
    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: var(--shadow);
}

.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: var(--text-muted);
  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);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

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

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

/* === Кнопки === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

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

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

.btn-success {
  background: var(--success);
  color: white !important;
}

a.btn-success {
  color: white !important;
  text-decoration: none;
}

a.btn-success:hover {
  color: white !important;
  background: #059669;
}

.btn-success:hover:not(:disabled) {
  background: #059669;
  transform: translateY(-1px);
}

.btn-warning {
  background: var(--warning);
  color: #1c1917;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
}

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

/* === Алерты === */
.alert {
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  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;
}

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

.page-header h1 {
  font-size: 1.75rem;
}

.page-header p {
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

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

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

.stat-card:hover {
  transform: translateY(-2px);
}

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

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

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

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

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

.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);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.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: 0.95rem;
  color: var(--text);
  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: var(--primary-light);
  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);
}

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

.badge-PENDING {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-IN_PROGRESS {
  background: rgba(129, 140, 248, 0.15);
  color: var(--primary-light);
  border: 1px solid rgba(129, 140, 248, 0.3);
}

.badge-COMPLETED {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

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

.document-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(79, 70, 229, 0.08);
  border: 1px solid rgba(79, 70, 229, 0.2);
  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: 0.75rem;
}

/* === Модальное окно === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
  overflow-y: auto;
  padding: 1.5rem 1rem;
  overscroll-behavior: contain;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 500px;
  padding: 2rem;
  box-shadow: var(--shadow);
  animation: slideUp 0.3s ease;
  margin: auto 0;
}

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

/* Заголовок + тип заявки: колонка, иначе 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%;
}

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

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--border);
  color: var(--text);
}

/* === 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;
  gap: 0.4em;
}
.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-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: 0.85rem;
  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: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

/* Часовой пояс в админке — список с поиском */
select.form-input.form-select-timezone {
  font-size: 0.95rem;
  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: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
}
.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-color);
  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;
}

.filter-btn {
  padding: 0.4rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

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

.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: 0.95rem;
  cursor: pointer;
  padding: 0.15rem 0;
}

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

.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;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
}

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

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

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

.file-upload-area:hover {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.05);
}

.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: 0.9rem;
  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;
}

.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: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.2);
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.2);
  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: rgba(79, 70, 229, 0.2);
  color: var(--primary-light);
  border: 1px solid rgba(79, 70, 229, 0.3);
  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: 0.85rem;
  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 {
  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: 0 8px 24px rgba(79, 70, 229, 0.2);
}

.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: none !important;
  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: 0.85rem;
  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: calc(100vh - 3rem);
  overflow-y: auto;
}

@media (max-width: 640px) {
  .modal-form {
    max-height: calc(100vh - 1.5rem);
  }
}

/* === Сетка полей формы === */
.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: 0.85rem;
}

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

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

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

.client-form-footer-btn {
  min-height: 2.5rem;
  min-width: 7.5rem;
  padding: 0.55rem 1rem;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

.btn-delete {
  padding: 0.7rem 1rem;
}

/* === Прикреплённые файлы === */
.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: rgba(79, 70, 229, 0.06);
  border: 1px solid rgba(79, 70, 229, 0.15);
  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;
}

.view-label {
  font-size: 0.75rem;
  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: var(--text-muted);
  background: var(--secondary-bg);
  border: 1px solid var(--border);
  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: 0 12px 30px rgba(0, 0, 0, 0.35);
  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-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-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: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

/* === Уведомления (колокольчик) === */
.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: 0 1px 4px rgba(239, 68, 68, 0.4);
  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: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  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: 0.9rem;
  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: 0.9rem;
}

.notification-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
  color: var(--text);
}
.notification-item:hover {
  background: rgba(255, 255, 255, 0.05);
}
.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: 0.75rem;
  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: 0.85rem;
  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;
}

/* Кабинет врача: единая сетка полей и зона вставки скриншотов */
.doctor-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 560px) {
  .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-color);
  border-radius: 8px;
  font-size: 0.85rem;
  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;
}
.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-color);
  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: 0 1px 4px rgba(0, 0, 0, 0.5);
  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;
}

/* =========================================================
   2026 UI refresh: minimal, calm, role-consistent
   ========================================================= */
:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #6366f1;
  --accent: #0891b2;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --bg: #f5f7fb;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --bg-dark: #eef2ff;
  --border: #e2e8f0;
  --border-color: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-color: #0f172a;
  --secondary-bg: #f8fafc;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius: 16px;
  --radius-sm: 12px;
  --transition: 0.18s ease;
}

body {
  background:
    radial-gradient(circle at 0% 0%, rgba(79, 70, 229, 0.08), transparent 42%),
    radial-gradient(circle at 100% 0%, rgba(8, 145, 178, 0.07), transparent 35%),
    var(--bg);
  color: var(--text);
}

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

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

.navbar {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
}

.navbar-brand {
  font-weight: 800;
}

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

.user-badge {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #1e1b4b;
  font-weight: 600;
  text-decoration: none;
}

.user-badge .role-pill {
  background: var(--primary);
  color: #fff;
}

.container {
  max-width: 1240px;
  padding: 1.6rem;
}

.page-header {
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.4rem;
  padding-bottom: 1rem;
}

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

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

.stats-grid {
  gap: 0.75rem;
}

.stat-card {
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  border-radius: var(--radius);
}

.stat-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

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

.request-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.request-card:hover {
  border-color: #c7d2fe;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

.request-description,
.request-meta-soft {
  color: var(--text-muted);
}

.request-meta-strong {
  color: #3730a3;
}

.type-tag {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}

.status-badge {
  border-radius: 999px;
  padding: 5px 11px;
}

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

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

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

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

.btn {
  border-radius: 10px;
  padding: 0.64rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #6366f1);
  border-color: #4f46e5;
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-dark), #4f46e5);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.24);
  transform: translateY(-1px);
}

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

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

.btn-success {
  background: #16a34a;
  color: #fff !important;
  border-color: #15803d;
}

.btn-success:hover:not(:disabled) {
  background: #15803d;
}

.btn-danger {
  background: #dc2626;
  border-color: #b91c1c;
}

.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
}

.btn-warning {
  background: #f59e0b;
  border-color: #d97706;
  color: #422006;
}

.btn-logout {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.btn-logout:hover {
  background: #fecaca;
}

.form-label {
  color: #475569;
  font-weight: 500;
}

.form-input {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
}

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

.form-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.16);
}

.form-input.input-readonly,
.form-input:disabled {
  background: #f8fafc;
  border-style: solid;
  color: #94a3b8;
}

.controls-card,
.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

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

.filter-btn:hover {
  border-color: #c7d2fe;
  color: #3730a3;
}

.filter-btn.active {
  background: #eef2ff;
  border-color: #a5b4fc;
  color: #3730a3;
}

.next-step-hint {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #475569;
}

.empty-state {
  background: #fff;
  border: 1px dashed #cbd5e1;
}

.modal-overlay {
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(5px);
}

.modal {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.2);
}

.modal-header {
  margin-bottom: 1rem;
}

.modal-close:hover {
  background: #f1f5f9;
}

.document-item,
.attached-file-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.file-upload-area {
  background: #fafbff;
  border: 1.5px dashed #cbd5e1;
}

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

.notifications-dropdown {
  background: #fff;
  border-color: var(--border);
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.18);
}

.notification-item:hover {
  background: #f8fafc;
}

.login-wrapper {
  background:
    radial-gradient(ellipse at 10% 15%, rgba(79, 70, 229, 0.16) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 10%, rgba(8, 145, 178, 0.14) 0%, transparent 45%),
    var(--bg);
}

.login-card {
  border-radius: 20px;
  border: 1px solid #dbe3f2;
  box-shadow: 0 24px 45px rgba(15, 23, 42, 0.15);
}

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

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

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

.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: 0.9rem;
    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: 0.45rem 0.75rem;
    font-size: 0.78rem;
    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;
  }

  .modal-overlay {
    padding: 0.75rem;
  }

  .modal {
    padding: 1rem;
    border-radius: 14px;
  }

  .modal-form {
    max-height: calc(100vh - 1.5rem);
  }

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

  .btn {
    width: auto;
  }

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

  /* Футер формы: кнопки переносятся */
  .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;
  }
}

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