/* ===== СОВРЕМЕННЫЙ ДИЗАЙН НА ОСНОВЕ 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 {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  border-radius: 16px;
  padding: 20px 30px;
  margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
  }

.header h1 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
}


  .navigation {
    display: flex;
  gap: 8px;
  align-items: 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: white;
  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;
}

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

.card-title {
  font-size: 0.8875rem;
  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: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-primary);
}

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

/* Настройка ширины колонок для таблицы заказов */
.orders-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
  table-layout: fixed !important;
}

/* Дополнительное правило для принудительного применения размеров */
.table-container .orders-table {
  table-layout: fixed !important;
}

.table-container .orders-table th,
.table-container .orders-table td {
  box-sizing: border-box !important;
}

/* Принудительное переопределение для всех таблиц с классом orders-table */
table.orders-table {
  table-layout: fixed !important;
  width: 100% !important;
}

table.orders-table th,
table.orders-table td {
  box-sizing: border-box !important;
}

/* Дублируем правила для класса .table на случай если используется этот класс */
.table.orders-table th:nth-child(1) { width: 9% !important; }  /* ORDER # - увеличили на 10% еще раз */
.table.orders-table th:nth-child(2) { width: 8% !important; } /* CAR NUMBER - уменьшили на 5% еще раз */
.table.orders-table th:nth-child(3) { width: 10% !important; } /* STATUS - уменьшили на 10% */
.table.orders-table th:nth-child(4) { width: 11% !important; }  /* COURIER - без изменений */
.table.orders-table th:nth-child(5) { width: 25.5% !important; } /* COMMENTS - уменьшили на 10% еще еще раз */
.table.orders-table th:nth-child(6) { width: 8% !important; }  /* WAIT TIME - увеличили на 5% еще раз */
.table.orders-table th:nth-child(7) { width: 8% !important; }  /* WORK TIME - увеличили на 5% еще раз */
.table.orders-table th:nth-child(8) { width: 8% !important; }  /* TOTAL TIME - увеличили на 5% еще раз */
.table.orders-table th:nth-child(9) { width: 7.7% !important; } /* ACTIONS - увеличили на 10% еще раз */

.table.orders-table td:nth-child(1) { width: 9% !important; }  /* ORDER # - увеличили на 10% еще раз */
.table.orders-table td:nth-child(2) { width: 8% !important; } /* CAR NUMBER - уменьшили на 5% еще раз */
.table.orders-table td:nth-child(3) { width: 10% !important; } /* STATUS - уменьшили на 10% */
.table.orders-table td:nth-child(4) { width: 11% !important; }  /* COURIER - без изменений */
.table.orders-table td:nth-child(5) { width: 25.5% !important; } /* COMMENTS - уменьшили на 10% еще еще раз */
.table.orders-table td:nth-child(6) { width: 8% !important; }  /* WAIT TIME - увеличили на 5% еще раз */
.table.orders-table td:nth-child(7) { width: 8% !important; }  /* WORK TIME - увеличили на 5% еще раз */
.table.orders-table td:nth-child(8) { width: 8% !important; }  /* TOTAL TIME - увеличили на 5% еще раз */
.table.orders-table td:nth-child(9) { width: 7.7% !important; } /* ACTIONS - увеличили на 10% еще раз */

.orders-table th:nth-child(1) { width: 9% !important; }  /* ORDER # - увеличили на 10% еще раз */
.orders-table th:nth-child(2) { width: 8% !important; } /* CAR NUMBER - уменьшили на 5% еще раз */
.orders-table th:nth-child(3) { width: 10% !important; } /* STATUS - уменьшили на 10% */
.orders-table th:nth-child(4) { width: 11% !important; }  /* COURIER - без изменений */
.orders-table th:nth-child(5) { width: 25.5% !important; } /* COMMENTS - уменьшили на 10% еще еще раз */
.orders-table th:nth-child(6) { width: 8% !important; }  /* WAIT TIME - увеличили на 5% еще раз */
.orders-table th:nth-child(7) { width: 8% !important; }  /* WORK TIME - увеличили на 5% еще раз */
.orders-table th:nth-child(8) { width: 8% !important; }  /* TOTAL TIME - увеличили на 5% еще раз */
.orders-table th:nth-child(9) { width: 7.7% !important; } /* ACTIONS - увеличили на 10% еще раз */

.orders-table td:nth-child(1) { width: 9% !important; }  /* ORDER # - увеличили на 10% еще раз */
.orders-table td:nth-child(2) { width: 8% !important; } /* CAR NUMBER - уменьшили на 5% еще раз */
.orders-table td:nth-child(3) { width: 10% !important; } /* STATUS - уменьшили на 10% */
.orders-table td:nth-child(4) { width: 11% !important; }  /* COURIER - без изменений */
.orders-table td:nth-child(5) { width: 25.5% !important; } /* COMMENTS - уменьшили на 10% еще еще раз */
.orders-table td:nth-child(6) { width: 8% !important; }  /* WAIT TIME - увеличили на 5% еще раз */
.orders-table td:nth-child(7) { width: 8% !important; }  /* WORK TIME - увеличили на 5% еще раз */
.orders-table td:nth-child(8) { width: 8% !important; }  /* TOTAL TIME - увеличили на 5% еще раз */
.orders-table td:nth-child(9) { width: 7.7% !important; } /* ACTIONS - увеличили на 10% еще раз */

/* Центрирование всего содержимого таблицы ordersTable */
.orders-table th,
.orders-table td {
  text-align: center;
  vertical-align: middle;
}

/* Специальные стили для столбца действий */
.orders-table th:nth-child(9),
.orders-table td:nth-child(9) {
  text-align: center;
  vertical-align: middle;
  padding: 8px 4px;
  min-width: 100px;
}

/* Специальные стили для колонки комментариев */
.orders-table th:nth-child(5),
.orders-table td:nth-child(5) {
  overflow: visible;
  position: relative;
  text-align: center;
  vertical-align: middle;
}

.orders-table td:nth-child(5) {
  padding: 12px 10px; /* 1см отступ */
}

.orders-table th:nth-child(5) {
  padding: 16px 10px; /* 1см отступ для заголовка */
}

/* Контейнер для комментариев */
.comments-container {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.table th {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 12px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border-primary);
  border-right: 1px solid var(--border-primary);
  overflow: visible;
  white-space: normal;
  word-wrap: break-word;
  line-height: 1.2;
  min-height: 50px;
  vertical-align: top;
}

.table th:last-child {
  border-right: none;
}

.table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-primary);
  border-right: 1px solid var(--border-primary);
  color: var(--text-primary);
  font-size: 14px;
  overflow: hidden;
  word-wrap: break-word;
  position: relative;
  vertical-align: top;
}

.table td:last-child {
  border-right: none;
}

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

/* Статусы заказов */
.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;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.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;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.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;
  text-align: center;
}

.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: #d1fae5;
  color: #065f46;
  border: 1px solid #10b981;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.btn-complete:hover {
  background: #a7f3d0;
  color: #047857;
  border-color: #059669;
  transform: translateY(-1px);
}

.btn-refuse {
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #f59e0b;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.btn-refuse:hover {
  background: #fde68a;
  color: #b45309;
  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-right {
    display: flex;
    align-items: center;
    gap: 20px;
  }

  .user-info {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-secondary);
    padding: 12px 20px;
    border-radius: 24px;
    border: 1px solid var(--border-primary);
    box-shadow: var(--shadow-sm);
    font-size: 1.1rem;
  }

  .user-name {
    font-weight: 600;
  color: var(--text-primary);
  }

  .user-role {
  background: var(--primary-500);
    color: white;
  padding: 4px 8px;
  border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
  }

  .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-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 {
      flex-direction: column;
    gap: 20px;
    padding: 16px;
    }
    
    .navigation {
    flex-wrap: wrap;
      justify-content: center;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .table-container {
    overflow-x: auto;
  }
  
  .table {
    min-width: 800px;
  }
  
  /* Адаптивность для таблицы статистики */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Уменьшаем размеры на мобильных устройствах */
  @media (max-width: 480px) {
    .table th,
    .table td {
      padding: 6px 8px;
      font-size: 11px;
    }
    
    /* Адаптивные ширины для мобильных устройств */
    #statsOrdersTable th:nth-child(1),
    #statsOrdersTable td:nth-child(1) {
      width: 30px; /* № */
    }
    
    #statsOrdersTable th:nth-child(2),
    #statsOrdersTable td:nth-child(2) {
      width: 100px; /* № заказа */
    }
    
    #statsOrdersTable th:nth-child(3),
    #statsOrdersTable td:nth-child(3) {
      width: 80px; /* Администратор */
    }
    
    #statsOrdersTable th:nth-child(4),
    #statsOrdersTable td:nth-child(4) {
      width: 80px; /* Статус */
    }
    
    #statsOrdersTable th:nth-child(5),
    #statsOrdersTable td:nth-child(5) {
      width: 80px; /* Курьер */
    }
    
    #statsOrdersTable th:nth-child(6),
    #statsOrdersTable td:nth-child(6) {
      width: 60px; /* Номер машины */
    }
    
    #statsOrdersTable th:nth-child(7),
    #statsOrdersTable td:nth-child(7) {
      width: 150px; /* Комментарии */
    }
    
    #statsOrdersTable th:nth-child(8),
    #statsOrdersTable td:nth-child(8) {
      width: 100px; /* Время взятия */
    }
    
    #statsOrdersTable th:nth-child(9),
    #statsOrdersTable td:nth-child(9) {
      width: 100px; /* Время выдачи */
    }
    
    #statsOrdersTable th:nth-child(10),
    #statsOrdersTable td:nth-child(10) {
      width: 100px; /* Статус заказа */
    }
    
    #statsOrdersTable th:nth-child(11),
    #statsOrdersTable td:nth-child(11) {
      width: 80px; /* Действия */
    }
    
    .order-status {
      font-size: 9px;
      padding: 2px 4px;
    }
    
    .btn-give-away {
      font-size: 10px;
      padding: 4px 8px;
    }
  }
}

/* Специальные стили для инфометра */
.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;
}

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

.header-buttons .btn {
  font-size: 12px;
  padding: 8px 12px;
}

/* Кнопка для перехода на страницу заказа */
.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;
}

/* Стили для кликабельного номера заказа */
.table td a[href*="magportal.lemanapro.ru"] {
  color: var(--primary-600);
  text-decoration: none;
  font-weight: 700;
  transition: all var(--transition-fast);
  cursor: pointer;
  display: inline-block;
  padding: 2px 4px;
  border-radius: 4px;
}

.table td a[href*="magportal.lemanapro.ru"]:hover {
  color: var(--primary-700);
  background: var(--primary-50);
  text-decoration: none;
  transform: scale(1.05);
}

/* Центрирование заголовков таблицы ordersTable */
#ordersTable thead th {
  text-align: center;
  vertical-align: middle;
}

/* Центрирование заголовков и ячеек таблицы statsOrdersTable */
#statsOrdersTable thead th {
  text-align: center;
  vertical-align: middle;
  font-size: 0.6875rem;
}

#statsOrdersTable tbody td {
  text-align: center;
  vertical-align: middle;
  font-size: 0.6375rem;
}

/* Динамические строки - подстраиваются под содержимое */
#statsOrdersTable tbody tr {
  height: auto;
  min-height: 40px;
}

#statsOrdersTable tbody td {
  height: auto;
  min-height: 40px;
  padding: 8px 4px;
  vertical-align: middle;
  word-wrap: break-word;
  word-break: break-word;
}

/* Увеличение ширины столбца № в таблице статистики */
#statsOrdersTable thead th:first-child,
#statsOrdersTable tbody td:first-child {
  width: 60px;
  min-width: 60px;
}

/* Выравнивание столбца Действия */
#statsOrdersTable thead th:last-child {
  vertical-align: middle;
  text-align: center;
}

/* Столбец Комментарии - разрешаем многострочный текст */
#statsOrdersTable tbody td:nth-child(7) {
  white-space: normal;
  line-height: 1.3;
  text-align: center;
}

/* Увеличение карточки с таблицей статистики заказов на 20% */
.stats-card {
  transform: scale(1.2);
  transform-origin: top left;
  margin-bottom: 20%;
  position: relative;
  left: 50%;
  transform: scale(1.2) translateX(-50%);
  display: none; /* Скрываем по умолчанию */
}

/* Показываем карточку когда есть выбранные даты */
.stats-card.visible {
  display: block;
}

/* Исправляем hover эффект для увеличенной карточки статистики */
.stats-card:hover {
  transform: scale(1.2) translateX(-50%) translateY(-2px);
  box-shadow: var(--shadow-xl);
}

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

.btn-take-large:hover {
  background: #fdba74;
  color: #9a3412;
  transform: translateY(-1px);
}

/* Кнопка "выдать" */
.btn-give-away {
  background: #fed7aa;
  color: #c2410c;
  border: 1px solid #fb923c;
  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;
  white-space: nowrap;
  text-align: center;
}

.btn-give-away:hover {
  background: #fdba74;
  color: #9a3412;
  transform: translateY(-1px);
  text-decoration: none;
}

/* Контейнер для кнопок в столбце действий таблицы статистики */
#statsOrdersTable td:last-child {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  vertical-align: middle;
  text-align: center;
}

/* Унификация размеров кнопок в таблице статистики */
#statsOrdersTable .btn-give-away,
#statsOrdersTable .btn-delete {
  min-width: 80px;
  width: 80px;
  padding: 6px 8px;
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Специальные цвета для кнопок в таблице статистики */
#statsOrdersTable .btn-give-away {
  background: #fed7aa;
  color: #c2410c;
  border: 1px solid #fb923c;
}

#statsOrdersTable .btn-give-away:hover {
  background: #fdba74;
  color: #9a3412;
}

#statsOrdersTable .btn-delete {
  background: #fecaca;
  color: #dc2626;
  border: 1px solid #f87171;
}

#statsOrdersTable .btn-delete:hover {
  background: #fca5a5;
  color: #b91c1c;
}

/* Кнопка удаления в таблице статистики */
.table td .btn-delete {
  background: #fecaca;
  color: #dc2626;
  border: 1px solid #f87171;
  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;
  white-space: nowrap;
  text-align: center;
}

.table td .btn-delete:hover {
  background: #fca5a5;
  color: #b91c1c;
  transform: translateY(-1px);
  text-decoration: none;
}

/* Стили для модального окна удаления заказа */
.order-info-display {
  margin: 20px 0;
  padding: 15px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  border-left: 4px solid var(--primary-500);
}

.order-details h4 {
  margin: 0 0 15px 0;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
}

.order-details p {
  margin: 8px 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.4;
}

.order-details strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Улучшенные кнопки календаря */
.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: #fecaca;
  color: #dc2626;
  border: 1px solid #f87171;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all var(--transition-fast);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-delete:hover {
  background: #fca5a5;
  color: #b91c1c;
  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);
}

/* ===== КНОПКА ШЕСТЕРЕНКИ И ВЫПАДАЮЩЕЕ МЕНЮ ===== */

/* Кнопка шестеренки */
.btn-gear {
  background: var(--primary-500);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
}

.btn-gear:hover {
  background: var(--primary-600);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-gear:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}


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

/* Таблица пользователей */
.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;
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

.badge-light {
  background: #f8f9fa;
  color: #6c757d;
}

/* Кнопки управления пользователями */
.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-footer .btn-primary {
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 500;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.modal-footer .btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.modal-footer .btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* Кнопки удаления в модальных окнах */
.modal-footer .btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 500;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.modal-footer .btn-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.modal-footer .btn-danger:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* Старые стили модальных окон удалены - используются новые стили ниже */

/* Формы в модальных окнах */
.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);
}

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

/* Стили для отображения информации о пользователе */
.user-info-display {
  background: #f8f9fa;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 4px solid var(--primary-500);
}

.user-info-display p {
  margin: 0 0 8px 0;
  font-size: 14px;
}

.user-info-display p:first-child {
  color: #666;
  font-size: 14px;
  margin-bottom: 8px;
}

.user-info-display p:nth-child(2) {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.user-info-display p:last-child {
  margin-bottom: 0;
}

/* Сетка действий пользователя */
.user-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

/* Кнопки действий */
.action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.action-btn .action-icon {
  font-size: 20px;
  width: 24px;
  text-align: center;
}

/* Стили для разных типов кнопок действий */
.action-btn.btn-change-role {
  border-color: var(--primary-300);
  color: var(--primary-700);
}

.action-btn.btn-change-role:hover {
  background: var(--primary-50);
  border-color: var(--primary-500);
}

.action-btn.btn-reset-password {
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.action-btn.btn-reset-password:hover {
  background: #dbeafe;
  border-color: #3b82f6;
}

.action-btn.btn-move-user {
  border-color: #ddd6fe;
  color: #7c3aed;
}

.action-btn.btn-move-user:hover {
  background: #ede9fe;
  border-color: #8b5cf6;
}

.action-btn.btn-delete-user {
  border-color: #fecaca;
  color: #dc2626;
}

.action-btn.btn-delete-user:hover {
  background: #fee2e2;
  border-color: #ef4444;
}

/* Кнопка шестеренки в таблице */
.btn-gear {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.btn-gear:hover {
  background: #f1f3f4;
  transform: scale(1.1);
}

/* ===== МОДАЛЬНЫЕ ОКНА КОММЕНТАРИЕВ ===== */

/* Стили для отображения заказа */
.order-display {
  background: #f8f9fa;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #495057;
}

/* Стили для textarea */
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  min-height: 100px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.form-textarea::placeholder {
  color: #6c757d;
  font-style: italic;
}

/* Алерты в модальных окнах */
.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;
}

/* Стили для столбца статуса заказа */
.table td:nth-child(10) {
  text-align: center;
  font-weight: 500;
  width: 120px;
  min-width: 120px;
  max-width: 120px;
}

.table th:nth-child(10) {
  text-align: center;
  width: 120px;
  min-width: 120px;
  max-width: 120px;
}

/* Стили для столбца действий */
.table td:nth-child(11) {
  text-align: center;
  width: 100px;
  min-width: 100px;
  max-width: 100px;
}

.table th:nth-child(11) {
  text-align: center;
  width: 100px;
  min-width: 100px;
  max-width: 100px;
}

/* Распределение ширины столбцов для таблицы статистики */
#statsOrdersTable th:nth-child(1),
#statsOrdersTable td:nth-child(1) {
  width: 50px; /* № */
}

#statsOrdersTable th:nth-child(2),
#statsOrdersTable td:nth-child(2) {
  width: 120px; /* № заказа */
}

#statsOrdersTable th:nth-child(3),
#statsOrdersTable td:nth-child(3) {
  width: 100px; /* Администратор */
}

#statsOrdersTable th:nth-child(4),
#statsOrdersTable td:nth-child(4) {
  width: 100px; /* Статус */
}

#statsOrdersTable th:nth-child(5),
#statsOrdersTable td:nth-child(5) {
  width: 100px; /* Курьер */
}

#statsOrdersTable th:nth-child(6),
#statsOrdersTable td:nth-child(6) {
  width: 80px; /* Номер машины */
}

#statsOrdersTable th:nth-child(7),
#statsOrdersTable td:nth-child(7) {
  width: 200px; /* Комментарии */
}

#statsOrdersTable th:nth-child(8),
#statsOrdersTable td:nth-child(8) {
  width: 140px; /* Время взятия */
}

#statsOrdersTable th:nth-child(9),
#statsOrdersTable td:nth-child(9) {
  width: 140px; /* Время выдачи */
}

#statsOrdersTable th:nth-child(10),
#statsOrdersTable td:nth-child(10) {
  width: 120px; /* Статус заказа */
}

#statsOrdersTable th:nth-child(11),
#statsOrdersTable td:nth-child(11) {
  width: 100px; /* Действия */
}

/* ===== СТРАНИЦА ПРОФИЛЯ ===== */

/* Контейнер профиля */
.profile-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 600px;
  margin: 0 auto;
}

/* Информация о пользователе */
.profile-info {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 24px;
  background: var(--bg-tertiary);
  border-radius: 16px;
  border: 1px solid var(--border-primary);
}

/* Аватар */
.profile-avatar {
  flex-shrink: 0;
}

.avatar-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  border: 3px solid white;
}

.avatar-circle span {
  font-size: 32px;
  color: white;
}

/* Детали профиля */
.profile-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-details h3 {
  margin: 0 0 8px 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profile-field span {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

.orders-count {
  background: var(--primary-100);
  color: var(--primary-800);
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 16px;
  display: inline-block;
  border: 1px solid var(--primary-200);
}

/* Кнопки управления профилем */
.profile-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.profile-actions .btn {
  min-width: 180px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Стили для кнопки уведомлений в профиле */
.profile-actions .btn-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #10b981;
}

.profile-actions .btn-success:hover {
  background: #a7f3d0;
  border-color: #059669;
  color: #047857;
}

.profile-actions .btn-danger {
  background: #fecaca;
  color: #dc2626;
  border: 1px solid #ef4444;
}

.profile-actions .btn-danger:hover {
  background: #fca5a5;
  border-color: #dc2626;
  color: #b91c1c;
}

.profile-actions .btn-warning {
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #f59e0b;
}

.profile-actions .btn-warning:hover {
  background: #fde68a;
  border-color: #d97706;
  color: #b45309;
}

/* Компактные настройки уведомлений в профиле */
.notification-settings-compact {
  margin-top: 20px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-primary);
}

.notification-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 80px;
}

/* Компактный Toggle Switch */
.toggle-switch-small {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.toggle-input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 22px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-input:checked + .toggle-slider {
  background-color: #10b981;
}

.toggle-input:checked + .toggle-slider:before {
  transform: translateX(18px);
}

.toggle-input:disabled + .toggle-slider {
  background-color: #e5e7eb;
  cursor: not-allowed;
}

.toggle-input:disabled + .toggle-slider:before {
  background-color: #f3f4f6;
}

/* Компактный статус уведомлений */
.notification-status-small {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 4px;
  min-width: 60px;
  text-align: center;
}

.notification-status-small.enabled {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #10b981;
}

.notification-status-small.disabled {
  background: #fecaca;
  color: #dc2626;
  border: 1px solid #ef4444;
}

.notification-status-small.unavailable {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

.notification-status-small.checking {
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #f59e0b;
}

/* Адаптивность для профиля */
@media (max-width: 768px) {
  .profile-info {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .profile-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .profile-actions .btn {
    width: 100%;
    max-width: 300px;
  }
}

/* Стили для статусов заказов */
.order-status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.order-status.allowed-for-picking {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.order-status.picking-in-progress {
  background: #fce7f3;
  color: #be185d;
  border: 1px solid #f9a8d4;
}

.order-status.picked {
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #fde68a;
}

.order-status.unknown {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.order-status.loading {
  background: #f8fafc;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
  font-style: italic;
}

.order-status.error {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

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

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 10000;
  animation: modalFadeIn 0.3s ease;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

/* Старая система модальных окон */
.modal-content {
  background: var(--bg-secondary);
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s ease;
  border: 1px solid var(--border-primary);
  position: relative;
}

/* Стили для старой системы модальных окон */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-primary);
  background: var(--bg-tertiary);
  border-radius: 12px 12px 0 0;
}

.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: 4px;
  border-radius: 6px;
  transition: all var(--transition-fast);
  line-height: 1;
}

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

.modal-body {
  padding: 24px;
}

/* Стили для отображения информации о пользователе в модальных окнах */
.user-info-display {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.user-info-display p {
  margin: 4px 0;
  color: var(--text-primary);
}

.user-info-display p:first-child {
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* Сетка действий пользователя */
.user-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

/* Кнопки действий пользователя */
.action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  background: var(--bg-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
}

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

.action-btn .action-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

/* Специфичные стили для разных типов кнопок */
.action-btn.btn-change-role {
  border-color: var(--primary-200);
  background: var(--primary-50);
}

.action-btn.btn-change-role:hover {
  border-color: var(--primary-400);
  background: var(--primary-100);
}

.action-btn.btn-reset-password {
  border-color: #bfdbfe;
  background: #dbeafe;
  color: #1d4ed8;
}

.action-btn.btn-reset-password:hover {
  border-color: #3b82f6;
  background: #bfdbfe;
}

.action-btn.btn-move-user {
  border-color: #ddd6fe;
  background: #ede9fe;
  color: #7c3aed;
}

.action-btn.btn-move-user:hover {
  border-color: #8b5cf6;
  background: #ddd6fe;
}

.action-btn.btn-delete-user {
  border-color: #fecaca;
  background: #fee2e2;
  color: #dc2626;
}

.action-btn.btn-delete-user:hover {
  border-color: #ef4444;
  background: #fecaca;
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 20px 24px;
  border-top: 1px solid var(--border-primary);
  background: var(--bg-tertiary);
  border-radius: 0 0 12px 12px;
}

/* Стили для ошибок в формах */
.form-error {
  color: #dc2626;
  font-size: 14px;
  margin-top: 6px;
  display: none;
}

.form-error.show {
  display: block;
}

.form-group.error .form-input {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Анимации для модальных окон */
@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Дополнительные стили для лучшего позиционирования */
.modal-content {
  margin: auto;
  transform-origin: center;
}

/* Улучшенная анимация для мобильных устройств */
@media (max-width: 768px) {
  @keyframes modalSlideIn {
    from {
      opacity: 0;
      transform: translateY(-20px) scale(0.95);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }
}

/* Адаптивность для мобильных устройств - только для старой системы модальных окон */
@media (max-width: 768px) {
  .modal.show {
    padding: 10px;
  }
  
  .modal-content {
    width: 100%;
    max-width: none;
    max-height: 95vh;
    border-radius: 12px;
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 16px 20px;
  }
  
  .modal-footer {
    flex-direction: column;
    gap: 10px;
  }
  
  .modal-footer .btn {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
  }
  
  .modal-header h3 {
    font-size: 16px;
  }
  
  .modal .form-input {
    font-size: 16px; /* Предотвращает зум на iOS */
    padding: 14px 16px;
  }
}

@media (max-width: 480px) {
  .modal.show {
    padding: 5px;
  }
  
  .modal-content {
    max-height: 98vh;
    border-radius: 8px;
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 12px 16px;
  }
  
  .modal-header h3 {
    font-size: 15px;
  }
  
  .modal-close {
    width: 28px;
    height: 28px;
    font-size: 20px;
  }
}

/* ===== СТИЛИ ДЛЯ УВЕДОМЛЕНИЙ ===== */

/* Анимации для уведомлений */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Стили для внутренних уведомлений */
.in-page-notification {
  font-family: var(--font-family);
  border-left: 4px solid var(--primary-500);
}

.notification-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.notification-icon {
  font-size: 18px;
}

.notification-title {
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.notification-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

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

.notification-body {
  color: var(--text-secondary);
  line-height: 1.4;
}

.notification-body strong {
  color: var(--text-primary);
}

/* Улучшенные стили для комментариев пользователей */
.user-comment {
  position: relative;
  transition: all 0.3s ease;
  margin-bottom: 6px;
  border-radius: 6px;
  padding: 8px 12px;
}

.user-comment:hover {
  transform: translateX(2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.user-comment .comment-author {
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.user-comment .comment-text {
  margin-top: 4px;
  line-height: 1.4;
}

/* Новый формат комментариев */
.comment-inline {
  display: block;
  margin-bottom: 4px;
  position: relative;
  min-height: auto;
}

.comment-inline .comment-block {
  border-radius: 6px;
  padding: 8px;
  position: relative;
  transition: all 0.2s ease;
  margin-bottom: 4px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  word-wrap: break-word;
  white-space: normal;
}

.comment-inline .comment-block:hover {
  transform: translateY(-1px);
}

/* Цветовые схемы для комментариев под стиль сайта - теперь цвета задаются через inline стили в JavaScript */

/* Новая структура комментария - текст под именем */
.comment-inline .comment-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.comment-inline .comment-author-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.comment-inline .comment-author {
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
  min-width: fit-content;
}

/* Цвета авторов теперь задаются через inline стили в JavaScript */

.comment-inline .comment-text {
  font-size: 12px;
  color: #374151;
  word-wrap: break-word;
  white-space: normal;
  overflow-wrap: break-word;
  hyphens: auto;
  margin: 0;
  line-height: 1.4;
  max-width: 100%;
  overflow: hidden;
}

.comment-inline .comment-time {
  padding: 1.5px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  font-family: monospace;
}

/* Цвета времени теперь задаются через inline стили в JavaScript */

/* Tooltip для полного текста */
.comment-inline .comment-block[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #2C2C2C;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: normal;
  word-wrap: break-word;
  max-width: 300px;
  z-index: 1000;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  margin-bottom: 5px;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
  .comment-inline {
    margin-bottom: 4px;
  }
  
  .comment-inline .comment-block {
    padding: 6px 10px;
    min-height: 38px;
    border-radius: 8px;
    min-width: 220px;
  }
  
  .comment-inline .comment-author-section {
    gap: 3px;
  }
  
  .comment-inline .comment-author {
    font-size: 11px;
  }
  
  .comment-inline .comment-text {
    font-size: 11px;
    line-height: 1.3;
    margin: 0;
    max-width: 100%;
    overflow: hidden;
    word-wrap: break-word;
  }
  
  .comment-inline .comment-time {
    bottom: 4px;
    right: 8px;
    padding: 1px 4px;
    font-size: 8px;
    min-width: 30px;
  }
  
  .comment-inline .edit-comment-btn {
    top: 4px;
    right: 8px;
    font-size: 9px;
    padding: 1px 4px;
    height: 16px;
  }
  
  /* Ширина колонок на мобильных */
  .orders-table th:nth-child(5),
  .orders-table td:nth-child(5) {
    width: 32%; /* Уменьшили еще еще больше пропорционально */
  }
}

/* Анимация появления новых комментариев */
@keyframes newCommentPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 var(--primary-500);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 0 0 10px transparent;
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 transparent;
  }
}

.new-comment {
  animation: newCommentPulse 2s ease-in-out;
}

/* ===== СТИЛИ ДЛЯ МОДАЛЬНОГО ОКНА КОММЕНТАРИЕВ ===== */

/* Специальные стили для модального окна комментариев */
#addCommentModal .modal-content {
  max-width: 600px;
  width: 100%;
}

#addCommentModal .modal-body {
  padding: 24px;
}

#addCommentModal .form-group {
  margin-bottom: 20px;
}

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

#addCommentModal textarea.form-control {
  width: 100%;
  min-height: 120px;
  padding: 12px 16px;
  border: 2px solid var(--border-primary);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  transition: all var(--transition-fast);
  background: var(--bg-primary);
  color: var(--text-primary);
}

#addCommentModal textarea.form-control:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#addCommentModal textarea.form-control::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

#addCommentModal select.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-primary);
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

#addCommentModal select.form-control:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#addCommentModal .form-help {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

#addCommentModal #commentCharCount {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

#addCommentModal #commentCharCount.warning {
  color: #f59e0b;
}

#addCommentModal #commentCharCount.danger {
  color: #ef4444;
}

/* Стили для кнопок в модальном окне комментариев */
#addCommentModal .modal-footer {
  padding: 20px 24px;
  gap: 12px;
}

#addCommentModal .btn {
  padding: 12px 24px;
  font-weight: 600;
  border-radius: 8px;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  font-size: 14px;
}

#addCommentModal .btn-primary {
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
  color: white;
  box-shadow: var(--shadow-sm);
}

#addCommentModal .btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

#addCommentModal .btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

#addCommentModal .btn-primary:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

#addCommentModal .btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 2px solid var(--border-primary);
}

#addCommentModal .btn-secondary:hover {
  background: var(--bg-primary);
  border-color: var(--primary-300);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
  #addCommentModal .modal-content {
    max-width: 95vw;
    margin: 10px;
  }
  
  #addCommentModal .modal-body {
    padding: 20px;
  }
  
  #addCommentModal textarea.form-control {
    min-height: 100px;
    font-size: 16px; /* Предотвращает зум на iOS */
  }
  
  #addCommentModal select.form-control {
    font-size: 16px; /* Предотвращает зум на iOS */
  }
  
  #addCommentModal .modal-footer {
    flex-direction: column;
    padding: 16px 20px;
  }
  
  #addCommentModal .btn {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  #addCommentModal .modal-content {
    max-width: 98vw;
    margin: 5px;
  }
  
  #addCommentModal .modal-body {
    padding: 16px;
  }
  
  #addCommentModal .modal-footer {
    padding: 12px 16px;
  }
}

