/* ===== СОВРЕМЕННЫЙ ДИЗАЙН НА ОСНОВЕ PRONT.HTML ===== */

/* Импорт шрифтов */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* CSS переменные для цветовой схемы */
:root {
  /* Основные цвета */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  
  /* Акцентные цвета (из pront.html) */
  --primary-50: #fff8e1;
  --primary-100: #ffecb3;
  --primary-200: #ffe082;
  --primary-300: #ffd54f;
  --primary-400: #ffca28;
  --primary-500: #ffc107;
  --primary-600: #ffb300;
  --primary-700: #ffa000;
  --primary-800: #ff8f00;
  --primary-900: #ff6f00;
  
  --secondary-50: #fffde7;
  --secondary-100: #fff9c4;
  --secondary-200: #fff59d;
  --secondary-300: #fff176;
  --secondary-400: #ffee58;
  --secondary-500: #ffeb3b;
  --secondary-600: #fdd835;
  --secondary-700: #fbc02d;
  --secondary-800: #f9a825;
  --secondary-900: #f57f17;
  
  /* Текст */
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  
  /* Границы и тени */
  --border-primary: #e2e8f0;
  --border-accent: var(--primary-300);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Анимации */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

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

/* Основные стили */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 50%, #fbbf24 100%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* Контейнеры */
  .container {
  max-width: 1400px;
  margin: 0 auto;
    padding: 20px;
}

/* Заголовки */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
}

h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  }

  /* Шапка: жёлтая полоса с заголовком + белая полоса с навигацией и пользователем */
  .header {
    margin-bottom: 30px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
  }

  .header-top {
    background: var(--primary-500);
    padding: 16px 24px;
    text-align: center;
    border-radius: 16px 16px 0 0;
  }

  .header-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
  }

  .header-bar {
    background: #fff;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    border: 1px solid var(--border-primary);
    border-top: none;
    border-radius: 0 0 16px 16px;
  }

  .header-nav {
    display: flex;
    gap: 8px;
    align-items: center;
  }

  .header-nav--left {
    flex-shrink: 0;
  }

  .header-nav--right {
    flex-shrink: 0;
  }

  .header-user {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1 1 auto;
    justify-content: center;
  }

  .nav-btn {
  padding: 12px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 14px;
    cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  }

  .nav-btn:hover {
  background: var(--primary-50);
  border-color: var(--primary-300);
  color: var(--primary-700);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  }

  .nav-btn.active {
  background: var(--primary-500);
  color: #1e293b;
  border-color: var(--primary-500);
  box-shadow: var(--shadow-md);
}

/* Кнопки */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: var(--primary-500);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: var(--primary-600);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

.btn-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--primary-300);
  color: var(--primary-700);
  transform: translateY(-1px);
}

/* Формы */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.form-input {
    width: 100%;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  color: var(--text-primary);
    font-size: 16px;
  transition: all var(--transition-normal);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.1);
  background: var(--bg-secondary);
}

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

/* Карточки */
.card {
  background: var(--bg-secondary);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-primary);
  overflow: hidden;
  transition: all var(--transition-normal);
  padding: 16px;
  margin-bottom: 16px;
}

/* Для блока «Активные заказы» позволяем выпадающим меню выходить за рамки карточки */
.main-orders-card {
  overflow: visible;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.card-header {
  padding: 0 0 12px 0;
  border-bottom: 1px solid var(--border-primary);
  margin-bottom: 16px;
}

.card-body {
  padding: 0;
  overflow: visible;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* Таблицы */
.table-container {
  background: var(--bg-secondary);
  border-radius: 16px;
  overflow: visible;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-primary);
}

.table {
    width: 100%;
    border-collapse: collapse;
  background: transparent;
}

.table th {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 16px 20px;
    text-align: left;
  border-bottom: 1px solid var(--border-primary);
}

.table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-primary);
  color: var(--text-primary);
  font-size: 14px;
}

.table tbody tr {
  transition: all var(--transition-fast);
}

.table tbody tr:hover {
  background: var(--primary-50);
  transform: translateX(4px);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* Подсветка строки заказа при переходе из модалки «Заказ уже в очереди» */
.table tbody tr.stats-order-highlight {
  background: var(--primary-100);
  box-shadow: inset 0 0 0 2px var(--primary-400);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* Этапы выполнения заказов */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
    font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-active {
  background: var(--primary-100);
  color: var(--primary-800);
  border: 1px solid var(--primary-200);
}

.status-in-progress {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.status-completed {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.status-refused {
  background: #fecaca;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* Комментарии */
.comments-dialog {
  max-width: 300px;
  font-size: 12px;
  line-height: 1.4;
}

.comment-item {
  margin-bottom: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  border-left: 3px solid var(--border-primary);
  background: var(--bg-tertiary);
  position: relative;
}

.comment-item.courier-comment {
  border-left-color: var(--primary-400);
  background: var(--primary-50);
}

.comment-item.admin-comment {
  border-left-color: #3b82f6;
  background: #eff6ff;
}

.comment-time {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}

.comment-author {
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 4px;
}

.comment-text {
  color: var(--text-secondary);
  margin-top: 2px;
  display: block;
}

.edit-comment-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 10px;
  opacity: 0;
  transition: all var(--transition-fast);
}

.comment-item:hover .edit-comment-btn {
  opacity: 1;
}

.edit-comment-btn:hover {
  color: var(--primary-600);
}

.no-comments {
  color: var(--text-muted);
  font-style: italic;
  font-size: 11px;
}

.add-comment-btn {
  background: var(--primary-500);
  border: none;
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-top: 4px;
  display: inline-block;
}

.add-comment-btn:hover {
  background: var(--primary-600);
  transform: translateY(-1px);
}

/* Сетка дашборда */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.dashboard-block {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-primary);
}

.dashboard-block h3 {
  margin-bottom: 20px;
  color: var(--primary-700);
  font-size: 1.25rem;
  font-weight: 700;
}

/* Статистические карточки */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-primary);
  transition: all var(--transition-normal);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-card-header {
    display: flex;
  justify-content: space-between;
    align-items: center;
  margin-bottom: 16px;
}

.stat-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-card-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.stat-card-change {
  font-size: 12px;
  color: var(--text-muted);
}

/* Кнопки действий */
.action-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-take {
  background: #10b981;
  color: white;
  border: none;
  padding: 6px 12px;
    border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

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

.btn-complete {
  background: #ef4444;
    color: white;
    border: none;
  padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.btn-complete:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

.btn-refuse {
  background: var(--primary-400);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.btn-refuse:hover {
  background: var(--primary-500);
  transform: translateY(-1px);
}

.btn-comment {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
    font-weight: 500;
  transition: all var(--transition-fast);
}

.btn-comment:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

/* Стили для страниц */
.page {
  display: none;
}

.page.active {
  display: block;
  }

  /* Информация о пользователе в середине шапки */
  .header-user .user-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
  }

  .header-user .user-role {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-500);
    color: #1e293b;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
  }

  .header-user .user-role::before {
    content: '';
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
  }

  .btn-logout {
  background: #ef4444;
    color: white;
    border: none;
  padding: 6px 12px;
  border-radius: 8px;
    font-size: 12px;
  font-weight: 500;
    cursor: pointer;
  transition: all var(--transition-fast);
  }

  .btn-logout:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

/* Календарь */
.calendar-container {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-primary);
  margin-bottom: 24px;
  }

  .calendar-header {
    margin-bottom: 20px;
  }

  .calendar-nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
  }

  .calendar-nav-container h3 {
    margin: 0;
    flex: 1;
    text-align: center;
  }

.calendar-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-700);
  }



/* Новый календарь в виде таблицы */
.calendar-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-secondary);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.calendar-table th {
  background: var(--primary-100);
  color: var(--primary-800);
  font-weight: 600;
    font-size: 14px;
  text-align: center;
  padding: 12px 8px;
  border: 1px solid var(--primary-200);
}

.calendar-table td {
  padding: 0;
  border: 1px solid var(--border-primary);
  width: 14.28%; /* 100% / 7 дней */
  height: 40px;
  position: relative;
  vertical-align: top;
  }

  .calendar-day {
    display: flex;
    align-items: center;
    justify-content: center;
  width: 100%;
  height: 100%;
    cursor: pointer;
  transition: all var(--transition-fast);
    font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-secondary);
  }

  .calendar-day:hover {
  background: var(--primary-50);
  color: var(--primary-700);
  }

  .calendar-day.selected {
  background: var(--primary-500);
    color: white;
  font-weight: 600;
  }

  .calendar-day.has-orders {
  background: var(--secondary-100);
  color: var(--secondary-800);
  font-weight: 600;
  }

  .calendar-day.has-orders.selected {
  background: var(--primary-600);
    color: white;
  }

  .calendar-day.other-month {
  color: var(--text-muted);
  background: var(--bg-tertiary);
  }

  .calendar-day.other-month:hover {
  background: var(--primary-50);
  color: var(--primary-600);
}

.calendar-day.today {
  background: var(--primary-200);
  color: var(--primary-800);
  font-weight: 700;
}

.calendar-day.today.selected {
  background: var(--primary-600);
  color: white;
}

/* Индикатор заказов */
.calendar-day::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary-400);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.calendar-day.has-orders::after {
  opacity: 1;
}

.calendar-day.selected::after {
  background: white;
}

/* Переключатель режима календаря: Выборочно / Период */
.calendar-mode-toggle {
  display: flex;
  background: var(--bg-tertiary);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 16px;
  border: 1px solid var(--border-primary);
}

.calendar-mode-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: transparent;
  color: var(--text-secondary);
}

.calendar-mode-btn:hover {
  color: var(--primary-700);
}

.calendar-mode-btn.active {
  background: var(--bg-secondary);
  color: var(--primary-600);
  box-shadow: var(--shadow-sm);
}

/* Переключатель режимов статистики: заказы / QR-код */
.stats-mode-toggle {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 16px auto 20px;
  padding: 4px;
  max-width: 420px;
  background: var(--bg-tertiary);
  border-radius: 999px;
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-sm);
}

.stats-mode-toggle .calendar-mode-btn {
  flex: 1 1 0;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
}

.stats-mode-toggle .calendar-mode-btn.active {
  background: var(--primary-500);
  color: #1e293b;
  box-shadow: var(--shadow-md);
}

/* Подсветка периода в календаре */
.calendar-day.in-range {
  background: var(--primary-100);
  color: var(--primary-700);
}

.calendar-day.in-range.has-orders {
  background: var(--primary-150, var(--primary-100));
  color: var(--primary-800);
}

.calendar-day.range-start {
  border-radius: 8px 0 0 8px;
}

.calendar-day.range-end {
  border-radius: 0 8px 8px 0;
}

.calendar-day.in-range:not(.range-start):not(.range-end) {
  border-radius: 0;
}

/* Контролы календаря */
.calendar-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  align-items: center;
}

.calendar-controls select {
  padding: 8px 12px;
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.calendar-controls select:focus {
  outline: none;
  border-color: var(--primary-400);
  box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.1);
}

/* Выбранные даты */
  .selected-dates {
    margin-top: 20px;
  padding: 16px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  border: 1px solid var(--border-primary);
  }

  .selected-dates h4 {
  margin-bottom: 12px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  }

  #selectedDatesList {
  margin-bottom: 12px;
    min-height: 20px;
  }

  .selected-date {
    display: inline-block;
  background: var(--primary-500);
    color: white;
    padding: 4px 8px;
  border-radius: 6px;
    margin: 2px;
    font-size: 12px;
  font-weight: 500;
}

.btn-clear-selection {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
    cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-clear-selection:hover {
  background: var(--primary-100);
  border-color: var(--primary-300);
  color: var(--primary-700);
}

/* Экспорт */
.export-container {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-primary);
  margin-bottom: 24px;
}

.export-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-700);
  margin-bottom: 20px;
}

.export-controls {
  display: flex;
  gap: 16px;
  align-items: end;
  flex-wrap: wrap;
}

.export-controls .form-group {
  margin-bottom: 0;
  min-width: 200px;
}

/* Анимации */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-fadeIn {
  animation: fadeIn 0.6s ease;
}

.animate-slideIn {
  animation: slideIn 0.4s ease;
}

/* Адаптивность */
  @media (max-width: 768px) {
  .container {
    padding: 16px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.5rem;
    }
    
    .header-bar {
      flex-wrap: wrap;
      justify-content: center;
      gap: 12px;
    }
    .header-nav {
      flex-wrap: wrap;
      justify-content: center;
    }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .table-container {
    overflow-x: auto;
  }
  
  .table {
    min-width: 600px;
  }
}

/* Специальные стили для инфометра */
.infometer-f11 {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 50%, #fbbf24 100%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  padding: 20px;
  box-sizing: border-box;
  overflow: hidden;
}

.infometer-f11 .queue-container {
  background: var(--bg-secondary);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-primary);
  border-radius: 24px;
  padding: 30px;
  box-shadow: var(--shadow-xl);
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  justify-content: flex-start; /* Выравниваем содержимое по верху */
  align-items: stretch; /* Растягиваем по ширине */
}

.infometer-f11 .queue-header {
    text-align: center;
  margin-bottom: 30px;
  flex-shrink: 0;
}

.infometer-f11 .queue-title {
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 10px;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.infometer-f11 .queue-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.infometer-f11 .table-container {
  flex: 0 0 auto; /* Контейнер не растягивается по высоте */
  overflow: visible; /* Убираем overflow: auto */
  border-radius: 12px;
  border: 1px solid var(--border-primary);
  background: white;
  width: 100%; /* Контейнер занимает всю ширину */
  margin: 0; /* Убираем центрирование */
  height: fit-content; /* Высота подстраивается под содержимое */
}

/* Специальные стили для F11 режима с большими шрифтами */
.infometer-f11 .table {
  width: 100%; /* Таблица занимает всю ширину контейнера */
  border-collapse: collapse;
  font-size: 2.5rem; /* Уменьшенный размер шрифта */
}

.infometer-f11 .table th {
  background: var(--primary-100);
  color: var(--primary-800);
  font-weight: 700;
  padding: 1.5rem 1.2rem;
  border-bottom: 3px solid var(--primary-300);
  text-align: left;
  font-size: 2.5rem;
}

.infometer-f11 .table td {
  padding: 1.5rem 1.2rem;
  border-bottom: 2px solid var(--border-primary);
  vertical-align: middle;
  font-size: 2.5rem;
  font-weight: 600;
  height: 4.5rem; /* Уменьшенная высота строк */
  min-height: 4.5rem;
  max-height: 4.5rem;
}

.infometer-f11 .table tbody tr:hover {
  background: var(--primary-50);
}

.infometer-f11 .table .live-timer {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.infometer-f11 .table .status {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 0.4rem;
  font-weight: 600;
  font-size: 2rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.infometer-f11 .table .status-active {
  background: var(--primary-200);
  color: var(--primary-800);
}

.infometer-f11 .table .status-in_progress {
  background: var(--secondary-200);
  color: var(--secondary-800);
}

.infometer-f11 .table td:first-child {
  font-weight: 700;
  color: var(--primary-600);
}

/* Оптимальная ширина колонок - пропорционально по всей ширине */
.infometer-f11 .table th:nth-child(1),
.infometer-f11 .table td:nth-child(1) {
  width: 25%; /* Номер заказа - 25% от ширины */
  text-align: center;
}

.infometer-f11 .table th:nth-child(2),
.infometer-f11 .table td:nth-child(2) {
  width: 50%; /* Время - 50% от ширины */
  text-align: center;
}

.infometer-f11 .table th:nth-child(3),
.infometer-f11 .table td:nth-child(3) {
  width: 25%; /* Этап выполнения - 25% от ширины */
  text-align: center;
}


.infometer-f11 .f11-controls {
  margin-top: 30px;
  text-align: center;
  flex-shrink: 0;
  flex-grow: 0; /* Кнопка не растягивается */
}

/* Дополнительные стили для компактности в F11 режиме */
.infometer-f11 .queue-container {
  padding: 15px;
}

.infometer-f11 .queue-header {
      margin-bottom: 15px;
    }

.infometer-f11 .queue-title {
  font-size: 1.8rem;
  margin-bottom: 6px;
}

.infometer-f11 .queue-subtitle {
  font-size: 0.9rem;
}

/* Скрытие элементов в F11 режиме */
.f11-hidden {
  display: none !important;
}

/* Показать элементы только в F11 режиме */
.f11-only {
  display: none;
}

.infometer-f11 .f11-only {
  display: block;
}

/* Стили для новых элементов */
.block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.block-header h3 {
  margin-bottom: 0;
}

/* Кнопка для перехода на страницу заказа */
.btn-order-link {
  background: var(--primary-500);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all var(--transition-fast);
  text-decoration: none;
  display: inline-block;
}

.btn-order-link:hover {
  background: var(--primary-600);
  transform: translateY(-1px);
  color: white;
  text-decoration: none;
}

/* Увеличенная кнопка "взять" */
.btn-take-large {
  background: var(--primary-500);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.btn-take-large:hover {
  background: var(--primary-600);
  transform: translateY(-1px);
}

/* Кнопка "выдать" */
.btn-give-away {
  background: var(--primary-500);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all var(--transition-fast);
  text-decoration: none;
  display: inline-block;
}

.btn-give-away:hover {
  background: var(--primary-600);
  transform: translateY(-1px);
  color: white;
  text-decoration: none;
}

/* Кнопка "История чата" (вкладка Статистика) */
.btn-chat-history {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all var(--transition-fast);
}
.btn-chat-history:hover {
  background: var(--bg-tertiary);
  border-color: var(--primary-300);
}

/* Улучшенные кнопки календаря */
.calendar-nav {
  background: var(--primary-500);
  border: 2px solid var(--primary-500);
  color: white;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.calendar-nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, var(--primary-400), var(--primary-600));
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: 0;
}

.calendar-nav svg {
  position: relative;
  z-index: 1;
  transition: transform var(--transition-fast);
}

.calendar-nav:hover {
  border-color: var(--primary-600);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.calendar-nav:hover::before {
  opacity: 1;
}

.calendar-nav:hover svg {
  transform: scale(1.1);
}

.calendar-nav:active {
  transform: translateY(0);
  box-shadow: var(--shadow-md);
}

.calendar-nav:active svg {
  transform: scale(0.95);
}

/* Стили для страницы входа */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 50%, #fbbf24 100%);
}

.login-form, .register-form {
  background: var(--bg-secondary);
  border-radius: 20px;
  padding: 40px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-primary);
  width: 100%;
  max-width: 400px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: fadeIn 0.6s ease;
}

.login-form h1, .register-form h1 {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary-700);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.login-form h2, .register-form h2 {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.login-form .form-group, .register-form .form-group {
  margin-bottom: 20px;
}

.login-form label, .register-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.login-form input, .register-form input, .register-form select {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-secondary);
  border: 2px solid var(--border-primary);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 16px;
  transition: all var(--transition-normal);
  box-sizing: border-box;
}

.login-form input:focus, .register-form input:focus, .register-form select:focus {
  outline: none;
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.1);
  background: var(--bg-secondary);
}

.login-form input::placeholder, .register-form input::placeholder {
  color: var(--text-muted);
}

.login-form .btn-primary, .register-form .btn-primary {
  width: 100%;
  padding: 16px 24px;
  background: var(--primary-500);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all var(--transition-normal);
  margin-top: 10px;
}

.login-form .btn-primary:hover, .register-form .btn-primary:hover {
  background: var(--primary-600);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.login-links {
  text-align: center;
  margin-top: 20px;
}

.login-links p {
  color: var(--text-secondary);
  font-size: 14px;
}

.login-links a {
  color: var(--primary-600);
  text-decoration: none;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.login-links a:hover {
  color: var(--primary-700);
  text-decoration: underline;
}

/* Анимация появления */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Адаптивность для мобильных устройств */
@media (max-width: 480px) {
  .login-container {
    padding: 16px;
  }
  
  .login-form, .register-form {
    padding: 30px 20px;
  }
  
  .login-form h1, .register-form h1 {
    font-size: 2rem;
  }
  
  .login-form h2, .register-form h2 {
    font-size: 1.3rem;
  }
}

/* Дополнительные утилиты */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.flex { display: flex; }
.flex-column { flex-direction: column; }
.flex-center { justify-content: center; align-items: center; }
.flex-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

/* Кнопка удаления */
.btn-delete {
  background: #ef4444;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-delete:hover {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

.btn-delete:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

/* ===== УПРАВЛЕНИЕ ПОЛЬЗОВАТЕЛЯМИ ===== */

/* Таблица пользователей */
.current-user {
  background-color: var(--primary-50) !important;
  border-left: 4px solid var(--primary-500);
}

.telegram-id {
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-family: monospace;
  color: var(--text-secondary);
}

/* Бейджи ролей */
.badge {
  display: inline-block;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 12px;
  letter-spacing: 0.5px;
}

.badge-danger {
  background: #fee2e2;
  color: #dc2626;
}

.badge-warning {
  background: #fef3c7;
  color: #d97706;
}

.badge-info {
  background: #dbeafe;
  color: #2563eb;
}

.badge-secondary {
  background: #f1f5f9;
  color: #64748b;
}

/* Кнопки управления пользователями */
.btn-change-role {
  background: #fbbf24;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  margin: 2px;
  transition: all var(--transition-fast);
}

.btn-change-role:hover {
  background: #f59e0b;
  transform: translateY(-1px);
}

.btn-reset-password {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  margin: 2px;
  transition: all var(--transition-fast);
}

.btn-reset-password:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.btn-remove-telegram {
  background: #6b7280;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  margin: 2px;
  transition: all var(--transition-fast);
}

.btn-remove-telegram:hover {
  background: #4b5563;
  transform: translateY(-1px);
}

.btn-delete-user {
  background: #ef4444;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  margin: 2px;
  transition: all var(--transition-fast);
}

.btn-delete-user:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

/* ===== МОДАЛЬНЫЕ ОКНА ===== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { 
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to { 
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

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

.modal-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.modal-body {
  padding: 20px 24px;
}

.modal-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border-primary);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Формы в модальных окнах */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 14px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  font-size: 14px;
  transition: all var(--transition-fast);
  box-sizing: border-box;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.1);
}

/* Алерты в модальных окнах */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

.alert-danger {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.alert-warning {
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #fde68a;
}

.alert-info {
  background: #dbeafe;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

/* Загрузка */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-style: italic;
}

/* Заголовки карточек в верхнем регистре (как на макете) */
.card-title--uppercase {
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.card-header--with-action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.btn-add-notification {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  background: #1e293b;
  color: white;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
  white-space: nowrap;
}
.btn-add-notification:hover {
  background: #334155;
  transform: translateY(-1px);
}
.btn-add-notification__icon {
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-add-notification__icon svg {
  display: block;
}

/* Модальное окно «Добавить уведомление» */
.notification-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.notification-modal[aria-hidden="true"] {
  display: none;
}
.notification-modal[aria-hidden="false"] {
  display: flex;
}
.notification-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
}
.notification-modal__box {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-primary);
}
.notification-modal__title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}
.notification-modal__subtitle {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.notification-modal__form .form-group {
  margin-bottom: 16px;
}
.notification-modal__textarea {
  resize: vertical;
  min-height: 80px;
}
.notification-modal__actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* Список уведомлений в очередь (модал) */
.notifications-list {
  max-height: 320px;
  overflow-y: auto;
  margin: 16px 0;
}
.notifications-list-empty {
  margin: 0;
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}
.notifications-list-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-primary);
}
.notifications-list-item:last-child {
  border-bottom: none;
}
.notifications-list-item__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.notifications-list-item__added {
  font-size: 12px;
  color: var(--text-secondary);
}
.notifications-list-item__text {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.4;
}
.notifications-list-delete {
  font-size: 13px;
}

/* Всплывающее уведомление (имитация из очереди) */
.notification-popup {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.notification-popup[aria-hidden="true"] {
  display: none;
}
.notification-popup[aria-hidden="false"] {
  display: flex;
}
.notification-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(6px);
}
.notification-popup__card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  border: 2px solid var(--primary-400);
  text-align: center;
}
.notification-popup__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary-500);
  color: #1e293b;
  margin-bottom: 16px;
}
.notification-popup__icon svg {
  display: block;
}
.notification-popup__order-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: #1e293b;
  color: white;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}
.notification-popup__heading {
  margin: 0 0 12px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}
.notification-popup__message {
  padding: 14px 16px;
  background: var(--bg-tertiary);
  border-radius: 10px;
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 12px;
  min-height: 48px;
  text-align: left;
}
.notification-popup__added-by {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--text-secondary);
}
.notification-popup__ok {
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  background: var(--primary-500);
  color: #1e293b;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}
.notification-popup__ok:hover {
  background: var(--primary-400);
  transform: translateY(-1px);
}

/* Всплывающее сообщение в приложении (вместо alert браузера) */
.app-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  max-width: calc(100vw - 32px);
  padding: 14px 20px;
  background: #1e293b;
  color: white;
  font-size: 14px;
  line-height: 1.4;
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  z-index: 1300;
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
}
.app-toast.app-toast--visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
}

/* Колонка Чат в таблице */
.table-col-chat {
  width: 56px;
  text-align: center;
}
.table-cell-chat {
  text-align: center;
  vertical-align: middle;
}
/* Жёлтая кнопка-иконка чата (как на макете) */
.btn-chat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: var(--primary-500);
  color: #1e293b;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
  box-shadow: var(--shadow-sm);
}
.btn-chat-icon:hover {
  background: var(--primary-400);
  transform: scale(1.05);
}
.btn-chat-icon:active {
  transform: scale(0.98);
}
.btn-chat-icon svg {
  display: block;
}

/* Обёртка кнопки чата с бейджем непрочитанных */
.chat-btn-wrap {
  position: relative;
  display: inline-flex;
}
.chat-unread-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  color: #fff;
  background: var(--danger-500, #dc2626);
  border-radius: 10px;
  display: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.chat-unread-badge.chat-unread-badge--visible {
  display: inline-block;
}
.welcomer-btn-chat .chat-unread-badge,
.welcomer-order-card .chat-btn-wrap .chat-unread-badge {
  top: -2px;
  right: -2px;
}

/* ===== ОКНО ЧАТА (модальное по центру экрана) ===== */
.chat-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}
.chat-overlay[aria-hidden="true"] {
  display: none;
}
.chat-overlay[aria-hidden="false"] {
  pointer-events: auto;
}
.chat-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.chat-panel {
  position: relative;
  width: 100%;
  max-width: 880px;
  max-height: 90vh;
  background: var(--bg-secondary);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.32);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-radius: 20px;
  overflow: hidden;
}
.chat-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px;
  background: var(--primary-500);
  color: #1e293b;
}
.chat-panel__title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-panel__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}
.chat-panel__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
}
.chat-panel__subtitle {
  margin: 2px 0 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.85;
}
.chat-panel__close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.chat-panel__close:hover {
  background: rgba(0, 0, 0, 0.15);
}
.chat-panel__messages {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 16px;
  background: var(--bg-tertiary);
  font-size: 14px;
}
.chat-panel__footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-primary);
}
.chat-panel__input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border-primary);
  border-radius: 16px;
  background: var(--bg-tertiary);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.chat-panel__input:focus {
  outline: none;
  border-color: var(--primary-400);
  box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.2);
}
.chat-panel__input::placeholder {
  color: var(--text-muted);
}
.chat-panel__send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--primary-500);
  color: #1e293b;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
  flex-shrink: 0;
}
.chat-panel__send:hover {
  background: var(--primary-400);
  transform: scale(1.06);
}
.chat-panel__send:active {
  transform: scale(0.96);
}
.chat-panel__send svg {
  display: block;
}
/* Сообщения в чате — пузыри с аватаром */
.chat-panel__messages .msg-row {
  display: flex;
  align-items: flex-end;
  margin-bottom: 10px;
  gap: 8px;
}
.chat-panel__messages .msg-row--me {
  flex-direction: row-reverse;
}
.chat-panel__messages .msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.chat-panel__messages .msg-avatar--placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--border-primary);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}
.chat-panel__messages .msg-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.chat-panel__messages .msg-bubble.msg-bubble--me {
  flex-direction: row-reverse;
  background: var(--primary-200);
  color: var(--text-primary);
  border-bottom-right-radius: 4px;
}
.chat-panel__messages .msg-bubble.msg-bubble--other {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}
.chat-panel__messages .msg-body {
  min-width: 0;
}
.chat-panel__messages .msg-sender {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-600);
  margin-bottom: 2px;
}
.chat-panel__messages .msg-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.chat-panel__readonly-notice {
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border-primary);
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* ===== ПРОФИЛЬ ===== */
.profile-card-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.profile-section {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-primary);
}
.profile-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.profile-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}
.profile-section-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 12px 0;
}
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
.profile-stat-item {
  background: var(--bg-tertiary);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}
.profile-stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-500);
}
.profile-stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}
.profile-avatar-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.profile-avatar-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border-primary);
}
.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-avatar-placeholder {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-muted);
}
.profile-avatar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.btn-avatar-upload {
  margin: 0;
  cursor: pointer;
}
.profile-avatar-size-error {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--danger, #c53030);
  min-height: 1.25em;
}
.profile-role-value {
  font-size: 1rem;
  color: var(--text-primary);
  margin: 0;
}
.profile-edit-form {
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.profile-toggles {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.profile-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.profile-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.profile-toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--bg-tertiary);
  border-radius: 24px;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}
.profile-toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform var(--transition-fast);
}
.profile-toggle input:checked + .profile-toggle-slider {
  background: var(--primary-500);
}
.profile-toggle input:checked + .profile-toggle-slider::before {
  transform: translateX(20px);
}
.profile-toggle-label {
  font-size: 14px;
  color: var(--text-primary);
}

/* Фильтры в блоке «Заказы за выбранный период» (вкладка Статистика) */
.stats-orders-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 16px;
}
.stats-orders-filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.stats-orders-search {
  min-width: 200px;
}
.stats-orders-status-select {
  min-width: 160px;
}

/* ===== КАРТОЧКИ ТАБЛИЦ ДЛЯ ТЕЛЕФОНА (общие) ===== */
.table-cards {
  display: none;
}
.table-cards-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 24px 16px;
  font-size: 14px;
}
.table-card {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-primary);
}
.table-card__info {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-primary);
}
.table-card__info-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.table-card__info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}
.table-card__field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.table-card__field--full {
  grid-column: 1 / -1;
}
.table-card__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.table-card__value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.table-card__order-num {
  color: var(--primary-600);
  font-size: 18px;
}
.order-num-link {
  color: inherit;
  font-weight: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: opacity var(--transition-fast);
}
.order-num-link:hover {
  opacity: 0.8;
  text-decoration: none;
  color: inherit;
}
.table-card__timer {
  font-variant-numeric: tabular-nums;
}
.table-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.table-card__actions.action-buttons .btn-take-large,
.table-card__actions.action-buttons .btn-complete,
.table-card__actions.action-buttons .btn-refuse,
.table-card__actions.action-buttons .btn-delete,
.table-card__actions.action-buttons .btn-order-link,
.table-card__actions.action-buttons .btn-chat,
.table-card__actions.action-buttons .btn-give-away,
.table-card__actions.action-buttons .btn-chat-history,
.table-card__actions.action-buttons .welcomer-btn {
  flex: 1 1 auto;
  min-width: 0;
}

/* В карточках активных заказов (главная, телефон): все кнопки одного размера, как «Чат» */
.table-card--main .table-card__actions .btn-take-large,
.table-card--main .table-card__actions .btn-delete,
.table-card--main .table-card__actions .btn-order-link,
.table-card--main .table-card__actions .btn-complete,
.table-card--main .table-card__actions .btn-refuse {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 12px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.table-card--main .table-card__actions .btn-order-link {
  text-decoration: none;
}

/* ===== РЕЖИМ ВЕЛКОМЕРА: КАРТОЧКИ ДЛЯ ТЕЛЕФОНА ===== */
.welcomer-cards {
  display: none;
}
.welcomer-cards-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 24px 16px;
  font-size: 14px;
}
.welcomer-order-card {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-primary);
}
/* Модуль 1: информация о заказе */
.welcomer-order-card__info {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-primary);
}
.welcomer-order-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.welcomer-order-card__external-badges {
  display: flex;
  gap: 8px;
}
.welcomer-order-card__external-badges--stack {
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.welcomer-order-card__external-badges--stack .welcomer-storage {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-500);
}
.welcomer-order-card__external-badges--stack .welcomer-picking {
  font-size: 13px;
  font-weight: 600;
  color: #ef4444;
}
.welcomer-refresh-btn {
  align-self: center;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: var(--primary-500);
  padding: 0 2px;
  line-height: 1;
}
.welcomer-refresh-btn:hover {
  color: var(--primary-700);
}
.welcomer-picking {
  align-self: center;
  font-size: 13px;
  font-weight: 600;
  color: #ef4444;
}
.welcomer-storage {
  align-self: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-500);
}
.welcomer-order-card__info-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #0ea5e9;
}
.welcomer-order-card__info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}
.welcomer-order-card__field--time {
  text-align: right;
  align-items: flex-end;
}
.welcomer-order-card__field--time .welcomer-order-card__value {
  text-align: right;
}
.welcomer-order-card__field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.welcomer-order-card__field-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}
.welcomer-order-card__field--status-row {
  justify-content: flex-start;
  flex-wrap: nowrap;
  flex-direction: row;
  align-items: center;
  gap: 24px;
}
.welcomer-order-card__field--status-row .welcomer-btn-refresh--inline {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  font-size: 1.1em;
}
.welcomer-status-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 0 1 auto;
}
.welcomer-order-card__field--full {
  grid-column: 1 / -1;
}
.welcomer-order-card__field--full .welcomer-order-card__status,
.welcomer-order-card__field--full .welcomer-order-card__car {
  margin-right: 10px;
}
.welcomer-order-card__stage-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.welcomer-order-card__stage-bar {
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
}
.welcomer-order-card__stage-bar--status {
  color: #fff;
}
.welcomer-order-card__stage-bar--status.welcomer-order-card__stage-bar--active {
  background: var(--primary-500);
  color: #1e293b;
}
.welcomer-order-card__stage-bar--status.welcomer-order-card__stage-bar--in_progress {
  background: #3b82f6;
  color: #fff;
}
.welcomer-order-card__stage-bar--car {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
}
.welcomer-order-card__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.welcomer-order-card__value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.welcomer-order-card__value--status {
  font-size: 14px;
  font-weight: 700;
}
.welcomer-order-card__order-num {
  color: var(--primary-600);
  font-size: 20px;
}
.welcomer-order-card__timer {
  font-variant-numeric: tabular-nums;
}
.welcomer-badge {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 120px;
  padding: 8px 10px;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-primary);
}
.welcomer-badge__label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}
.welcomer-badge__value {
  font-size: 13px;
  font-weight: 600;
  word-break: break-word;
}
.welcomer-badge--green {
  background: #ecfdf3;
  border-color: #4ade80;
  color: #166534;
}
.welcomer-badge--red {
  background: #fef2f2;
  border-color: #f97373;
  color: #991b1b;
}
.welcomer-badge--blue {
  background: #eff6ff;
  border-color: #60a5fa;
  color: #1d4ed8;
}
.welcomer-badge--control {
  margin-top: 6px;
  max-width: 220px;
}
.welcomer-order-card__who {
  color: var(--text-primary);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.welcomer-order-card__who-icon {
  display: inline-flex;
  color: var(--text-muted);
}
.welcomer-order-card__who-icon svg {
  display: block;
}
.welcomer-order-card__status {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: white;
}
.welcomer-order-card__status--active {
  background: var(--primary-500);
  color: #1e293b;
}
.welcomer-order-card__status--in_progress {
  background: #3b82f6;
  color: white;
}
.welcomer-order-card__car {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
}
/* Модули 2–4: три кнопки внизу */
.welcomer-order-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.welcomer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
  flex: 1;
  min-width: 0;
}
.welcomer-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}
.welcomer-btn-icon svg {
  display: block;
}
.welcomer-btn-take {
  background: var(--primary-500);
  color: #1e293b;
}
.welcomer-btn-take:hover {
  background: var(--primary-400);
}
.welcomer-btn-delete {
  background: #ef4444;
  color: white;
}
.welcomer-btn-delete:hover {
  background: #dc2626;
}
.welcomer-btn-chat {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
}
.welcomer-btn-chat:hover {
  background: var(--bg-tertiary);
  border-color: var(--primary-300);
}
.welcomer-btn-chat-full {
  flex: 1 1 100%;
}
.welcomer-btn-refresh {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
  font-size: 1.2em;
  padding: 8px 12px;
  min-width: 44px;
}
.welcomer-btn-refresh:hover {
  background: var(--bg-tertiary);
  border-color: var(--primary-300);
}
.welcomer-btn-refresh--inline {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
}
.welcomer-btn-complete {
  background: var(--primary-500);
  color: #1e293b;
}
.welcomer-btn-complete:hover {
  background: var(--primary-400);
}
.welcomer-btn-refuse {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
}
.welcomer-btn-refuse:hover {
  background: var(--bg-tertiary);
  border-color: var(--text-muted);
}

.welcomer-btn-qr {
  background: var(--primary-100);
  color: var(--primary-800);
  border-radius: 999px;
}

.welcomer-btn-qr:hover {
  background: var(--primary-200);
  color: var(--primary-900);
}

/* Меню действий (три точки) в таблицах */
.actions-main {
  display: flex;
  align-items: center;
  gap: 8px;
}

.actions-menu {
  position: relative;
  z-index: auto;
}

.actions-menu.open {
  z-index: 9999;
}

.btn-actions-more {
  border: none;
  background: var(--bg-secondary);
  border-radius: 999px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  position: relative;
  z-index: 0;
}

.btn-actions-more:hover {
  background: var(--bg-tertiary);
  color: var(--primary-700);
}

.btn-actions-more-dots {
  font-size: 18px;
  line-height: 1;
}

.actions-menu-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  transform: translateY(6px);
  min-width: 170px;
  padding: 6px;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-primary);
  display: none;
  z-index: 9999;
}

.actions-menu.open .actions-menu-dropdown {
  display: block;
}

.actions-menu-dropdown .btn-complete,
.actions-menu-dropdown .btn-refuse,
.actions-menu-dropdown .btn-delete,
.actions-menu-dropdown .btn-qr-inline {
  width: 100%;
  justify-content: center;
  text-align: center;
  margin: 2px 0;
  background: #ffffff;
  color: var(--text-primary);
  box-shadow: none;
  border-radius: 10px;
  border: 1px solid var(--border-primary);
}

.actions-menu-dropdown .btn-complete:hover,
.actions-menu-dropdown .btn-refuse:hover,
.actions-menu-dropdown .btn-delete:hover,
.actions-menu-dropdown .btn-qr-inline:hover {
  background: var(--primary-500);
  color: #1e293b;
  box-shadow: var(--shadow-sm);
  border-color: var(--primary-500);
}

/* Строка таблицы с открытым меню должна быть выше остальных */
table tbody tr.row-has-open-menu {
  position: relative;
  z-index: 5000;
}

/* ===== АДАПТИВ: КОМПЬЮТЕР И ТЕЛЕФОН ===== */
@media (max-width: 768px) {
  .container {
    padding: 12px;
  }
  .header-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 16px;
  }
  .header-user {
    order: -1;
    justify-content: center;
  }
  .header-nav {
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
  }
  .nav-btn {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 12px;
    font-size: 14px;
  }
  /* Скрыть вкладку «Инфометр» на телефоне */
  #infometerLink {
    display: none !important;
  }
  .table-container {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
  }
  .table {
    font-size: 13px;
  }
  .table th,
  .table td {
    padding: 8px 6px;
  }
  .action-buttons {
    flex-wrap: wrap;
    gap: 6px;
  }
  .action-buttons .btn-take-large,
  .action-buttons .btn-complete,
  .action-buttons .btn-refuse,
  .action-buttons .btn-order-link,
  .action-buttons .btn-delete,
  .action-buttons .btn-chat {
    font-size: 12px;
    padding: 6px 10px;
  }
  .card {
    margin-bottom: 16px;
  }
  .chat-panel {
    max-width: calc(100% - 24px);
    max-height: 90vh;
  }
  .chat-panel__messages {
    padding: 12px;
  }
  /* Режим велкомера: на телефоне показываем карточки вместо таблицы */
  .welcomer-card .welcomer-table-wrap {
    display: none !important;
  }
  .welcomer-card .welcomer-cards {
    display: block !important;
  }
  .welcomer-card-body {
    padding: 16px !important;
  }
  /* Главная: активные заказы — карточки на телефоне */
  .main-orders-card .main-orders-table-wrap {
    display: none !important;
  }
  .main-orders-card .table-cards {
    display: block !important;
  }
  .main-orders-card .table-card-body {
    padding: 16px !important;
  }
  /* Статистика: заказы за период — карточки на телефоне */
  .stats-orders-card .stats-orders-table-wrap {
    display: none !important;
  }
  .stats-orders-card .table-cards {
    display: block !important;
  }
  .stats-orders-card .table-card-body {
    padding: 16px !important;
  }
}

/* Скрыть вкладку «Режим велкомера» на компьютере; показывать только на телефоне */
@media (min-width: 769px) {
  #welcomerPageBtn {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .container { padding: 8px; }
  .header-title { font-size: 1.25rem; }
  .header-top { padding: 12px 16px; }
  .nav-btn { font-size: 13px; padding: 8px 10px; }
  .form-input, .btn { padding: 10px 14px; }
}
