* {
  font-family: 'Inter', sans-serif;
}
  body { font-family: 'Inter', sans-serif; margin: 0; padding: 0; font-size: 10px;}
    header { padding: 10px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #ddd; position: relative; }
    button { font-size: 10px;}
    select { font-size: 10px;}
    input[type="file"] { font-size: 10px;}
    input[type="text"], textarea {
  font-size: 10px !important;
}
    /* Notification Container */
    #notification-container {
      position: fixed;
      top: 100px;
      right: 20px;
      z-index: 99999;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    /* Base Notification Styles */
    .notification {
      --notif-accent: #49a87d;
      --notif-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' viewBox='0 -960 960 960' width='24' fill='%23ffffff'%3E%3Cpath d='M400-314.46 250.46-464 296-509.54l104 104 264-264L709.54-624 400-314.46Z'/%3E%3C/svg%3E");
      color: rgba(0, 0, 0, 0.7);
      display: flex;
      font-size: 12px;
      line-height: 1.4;
      gap: 10px;
      max-width: 350px;
      background-color: white;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
      border-radius: 4px;
      padding: 12px 10px 10px;
      overflow: hidden;
      position: relative;
      transform: translateX(calc(100% + 20px));
      animation: notifSlideIn 0.3s ease forwards;
    }
    .notification.fade-out {
      animation: notifSlideOut 0.3s ease forwards;
    }
    .notification:hover {
      --animation-play-state: paused;
    }
    /* Прогресс-бар только для success */
    .notification.success::before {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 3px;
      background-color: var(--notif-accent);
      transform-origin: left;
      animation: notifCountdown 4s linear forwards;
      animation-play-state: var(--animation-play-state, running);
    }
    .notification.success:hover::before {
      animation-play-state: paused;
    }

    .notification__icon {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background-color: var(--notif-accent);
      background-image: var(--notif-icon);
      background-repeat: no-repeat;
      background-position: center;
      background-size: 18px;
      flex-shrink: 0;
    }

    .notification__body {
      flex: 1;
      min-width: 0;
    }

    .notification__header {
      margin: 0;
      font-size: 13px;
      font-weight: 600;
      color: #1a1a1a;
    }

    .notification__text {
      margin: 3px 0 0;
      word-wrap: break-word;
      color: #666;
    }

    .notification__action {
      display: flex;
      gap: 6px;
      align-items: flex-start;
    }

    .notification__btn {
      appearance: none;
      background: none;
      border: none;
      color: #999;
      font-size: 16px;
      cursor: pointer;
      padding: 0;
      line-height: 1;
      transition: color 0.2s;
    }
    .notification__btn:hover {
      color: #333;
    }

    /* Success variant */
    .notification.success {
      --notif-accent: #49a87d;
      --notif-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' viewBox='0 -960 960 960' width='24' fill='%23ffffff'%3E%3Cpath d='M400-314.46 250.46-464 296-509.54l104 104 264-264L709.54-624 400-314.46Z'/%3E%3C/svg%3E");
    }

    /* Error variant */
    .notification.error {
      --notif-accent: #e53935;
      --notif-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' viewBox='0 -960 960 960' width='24' fill='%23ffffff'%3E%3Cpath d='M480-294.5q13.73 0 23.12-9.38 9.38-9.39 9.38-23.12t-9.38-23.12q-9.39-9.38-23.12-9.38t-23.12 9.38q-9.38 9.39-9.38 23.12t9.38 23.12q9.39 9.38 23.12 9.38Zm-32.5-152h65v-228h-65v228ZM480.07-100q-78.84 0-148.21-29.92t-120.68-81.21q-51.31-51.29-81.25-120.63Q100-401.1 100-479.93q0-78.84 29.92-148.21t81.21-120.68q51.29-51.31 120.63-81.25Q401.1-860 479.93-860q78.84 0 148.21 29.92t120.68 81.21q51.31 51.29 81.25 120.63Q860-558.9 860-480.07q0 78.84-29.92 148.21t-81.21 120.68q-51.29 51.31-120.63 81.25Q558.9-100 480.07-100Z'/%3E%3C/svg%3E");
    }

    /* Warning variant */
    .notification.warning {
      --notif-accent: #fb8c00;
      --notif-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' viewBox='0 -960 960 960' width='24' fill='%23ffffff'%3E%3Cpath d='M480-294.5q13.73 0 23.12-9.38 9.38-9.39 9.38-23.12t-9.38-23.12q-9.39-9.38-23.12-9.38t-23.12 9.38q-9.38 9.39-9.38 23.12t9.38 23.12q9.39 9.38 23.12 9.38Zm-32.5-152h65v-228h-65v228ZM480-100q-78.84 0-148.21-29.92t-120.68-81.21q-51.31-51.29-81.25-120.63Q100-401.1 100-479.93q0-78.84 29.92-148.21t81.21-120.68q51.29-51.31 120.63-81.25Q401.1-860 479.93-860q78.84 0 148.21 29.92t120.68 81.21q51.31 51.29 81.25 120.63Q860-558.9 860-480.07q0 78.84-29.92 148.21t-81.21 120.68q-51.29 51.31-120.63 81.25Q558.9-100 480.07-100Z'/%3E%3C/svg%3E");
    }

    /* Info variant */
    .notification.info {
      --notif-accent: #1976d2;
      --notif-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' viewBox='0 -960 960 960' width='24' fill='%23ffffff'%3E%3Cpath d='M447.5-295h65v-228h-65v228Zm32.57-288.5q13.43 0 23-9.64t9.57-23.14q0-13.49-9.64-22.86-9.64-9.36-23.07-9.36-13.43 0-23 9.43t-9.57 22.85q0 13.72 9.64 23.22 9.64 9.5 23.07 9.5ZM480.07-100q-78.84 0-148.21-29.92t-120.68-81.21q-51.31-51.29-81.25-120.63Q100-401.1 100-479.93q0-78.84 29.92-148.21t81.21-120.68q51.29-51.31 120.63-81.25Q401.1-860 479.93-860q78.84 0 148.21 29.92t120.68 81.21q51.31 51.29 81.25 120.63Q860-558.9 860-480.07q0 78.84-29.92 148.21t-81.21 120.68q-51.29 51.31-120.63 81.25Q558.9-100 480.07-100Z'/%3E%3C/svg%3E");
    }

    @keyframes notifSlideIn {
      from { transform: translateX(calc(100% + 20px)); opacity: 0; }
      to { transform: translateX(0); opacity: 1; }
    }

    @keyframes notifSlideOut {
      from { transform: translateX(0); opacity: 1; }
      to { transform: translateX(calc(100% + 20px)); opacity: 0; }
    }

    @keyframes notifCountdown {
      from { transform: scaleX(1); }
      to { transform: scaleX(0); }
    }

/* Стили для редактируемых rebuyback полей */
.rebuyback-value.editable-rebuyback {
  cursor: pointer;
  padding: 3px 5px;
  margin-bottom: 6px;
  border-radius: 3px;
  transition: background-color 0.2s ease;
  color: #8b4513;
  font-weight: 500;
  word-break: break-word;
  line-height: 1.3;
  background-color: #fffacd;
  border: 1px solid #f0e68c;
}

.rebuyback-value.editable-rebuyback:hover {
  background-color: #f0f8ff;
  border: 1px dashed #007bff;
}

.editable-rebuyback.saving {
  background-color: #fff3cd;
  pointer-events: none;
}

.rebuyback-edit-input {
  border: 1px solid #007bff;
  border-radius: 3px;
  padding: 2px 4px;
  background-color: #fff;
  font-size: 12px;
  width: 100px;
}

.rebuyback-edit-textarea {
  width: 100%;
  min-height: 60px;
  resize: vertical;
}

.rebuyback-comment-cell .comment-content-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
}

.rebuyback-comment-cell .comment-buttons-wrapper {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.rebuyback-comment-cell .copy-icon,
.rebuyback-comment-cell .history-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.rebuyback-comment-cell .copy-icon:hover,
.rebuyback-comment-cell .history-button:hover {
  opacity: 1;
}

.rebuyback-edit-input:focus {
  outline: none;
  border-color: #0056b3;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.rebuyback-display-value {
  display: inline;
}


.page-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}


  cursor: pointer; /* Указывает на возможность клика */}
    .input-wrapper { display: flex; align-items: center; }
    .input-wrapper input { flex: 1; margin-right: 5px; }
    .save-btn { border: none; background: none; cursor: pointer; line-height: 1; }
    .modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: flex; justify-content: center; align-items: center; z-index: 1000; }
    .modal-content { background: #fff; padding: 20px; border-radius: 5px; width: 80%; max-width: 600px; }
    .modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; border-bottom: 1px solid #ddd; padding-bottom: 10px; }
    .modal-header h3 { margin: 0; }
    .close-modal { background: none; border: none; font-size: 24px; cursor: pointer; padding: 0; color: #666; }
    .close-modal:hover { color: #000; }
    .modal-body { max-height: 400px; overflow-y: auto; }
    .comment-history-item { border-bottom: 1px solid #eee; padding: 10px 0; }
    .comment-history-item:last-child { border-bottom: none; }
    .comment-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
    .comment-date { color: #666; font-size: 9px; }
    .comment-text { background: #f8f9fa; padding: 8px; border-radius: 4px; border-left: 3px solid #007bff; }
    .empty-history { text-align: center; color: #666; padding: 20px; }
    .history-button { background: none; border: none; cursor: pointer; margin-left: 8px; padding: 4px; border-radius: 3px; color: #666; transition: color 0.2s; }
    .history-button:hover { color: #007bff; }
    .comment-content-wrapper { display: flex; align-items: center; width: 100%; gap: 8px; }
    .comment-content-wrapper .editable { flex: 1; min-width: 0; }
    .comment-buttons-wrapper { display: flex; flex-direction: column; gap: 4px; opacity: 0; transition: opacity 0.2s; flex-shrink: 0; }
    .comment-cell:hover .comment-buttons-wrapper { opacity: 1; }
    .track-status-cell:hover .comment-buttons-wrapper { opacity: 1; }
    .comment-buttons-wrapper .copy-icon, .comment-buttons-wrapper .history-button { margin: 0; }
    .chat-history { max-height: 300px; overflow-y: auto; border: 1px solid #ddd; padding: 10px; margin-bottom: 10px; }
    .chat-message { margin-bottom: 5px; }
    .badge { background: red; color: white; border-radius: 50%; padding: 2px 6px; margin-left: 5px; }

    /* Wrapper для mass-actions и slide-panel */
    .mass-actions-wrapper {
      position: fixed;
      bottom: var(--mass-actions-bottom, 100px);
      left: 50%;
      transform: translateX(-50%);
      z-index: 1000;
      display: flex;
      flex-direction: column-reverse;
      align-items: center;
      gap: 8px;
      max-width: calc(100vw - 32px);
      max-height: calc(100vh - 116px);
    }

    /* Liquid Glass общий стиль */
    .liquidGlass-wrapper {
      box-shadow: 0 6px 6px rgba(0, 0, 0, 0.15), 0 0 20px rgba(0, 0, 0, 0.08);
      transition: all 0.3s ease;
    }

    .mass-actions {
      width: max-content;
      max-width: 100%;
      box-sizing: border-box;
      border-radius: 24px;
      padding: 16px;
      position: relative;
      overflow: hidden;
    }

    /* Liquid Glass слои */
    .mass-actions .liquidGlass-effect {
      position: absolute;
      z-index: 0;
      inset: 0;
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      filter: url(#glass-distortion);
      overflow: hidden;
      border-radius: 24px;
    }

    .mass-actions .liquidGlass-tint {
      z-index: 1;
      position: absolute;
      inset: 0;
      background: rgba(255, 255, 255, 0.45);
      border-radius: 24px;
    }

    .mass-actions .liquidGlass-shine {
      position: absolute;
      inset: 0;
      z-index: 2;
      overflow: hidden;
      border-radius: 24px;
      box-shadow: inset 2px 2px 1px 0 rgba(255, 255, 255, 0.5),
        inset -1px -1px 1px 1px rgba(255, 255, 255, 0.5);
    }

    .mass-actions-content {
      position: relative;
      z-index: 3;
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
    }

    /* Анимация появления панели снизу */
    .slide-up-enter-active {
      animation: slideUpIn 0.3s ease-out;
    }
    .slide-up-leave-active {
      animation: slideUpOut 0.25s ease-in;
    }
    @keyframes slideUpIn {
      from {
        opacity: 0;
        transform: translateY(100%);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }
    @keyframes slideUpOut {
      from {
        opacity: 1;
        transform: translateY(0);
      }
      to {
        opacity: 0;
        transform: translateY(100%);
      }
    }
    .mass-actions .selected-count {
      display: flex;
      flex-direction: column;
      gap: 2px;
      font-weight: 600;
      white-space: nowrap;
      min-width: 80px;
    }
    .mass-actions .select-all-pages-link {
      font-size: 12px;
      font-weight: 400;
      color: #2563eb;
      text-decoration: none;
    }
    .mass-actions .select-all-pages-link:hover {
      text-decoration: underline;
    }
    .mass-actions button { margin: 0; padding: 6px 12px; cursor: pointer; }
    .mass-actions-close {
      background: none;
      border: none;
      font-size: 20px;
      color: #666;
      cursor: pointer;
      padding: 0 4px;
      line-height: 1;
      margin-left: auto;
    }
    .mass-actions-close:hover {
      color: #333;
    }

    /* Аватарки пользователей в таблице */
    .user-with-avatar {
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .user-avatar-small {
      width: 20px;
      height: 20px;
      border-radius: 50%;
      object-fit: cover;
      flex-shrink: 0;
    }
    .user-circle-small {
      width: 20px;
      height: 20px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      font-size: 11px;
      font-weight: 600;
      flex-shrink: 0;
    }

    .order-image {
  max-width: 70px;
  max-height: 70px;
  cursor: pointer;
  border-radius: 3px;
  transition: transform 0.3s ease-in-out;
}

.sortable {
  position: relative;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.sortable:hover {
  background-color: #e0e0e0;
}

/* Показываем иконку сортировки при наведении */
.sortable:hover::after {
  content: "⇅"; /* Вы можете заменить на другой символ или использовать background-image */
  font-size: 10px;
  color: #333;
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
}

.col-100 {
  min-width: 100px;
  max-width: 100px;
  word-wrap: break-word; /* Переносит слова */
  white-space: normal;  /* Позволяет перенос строки */
}

.col-400 {
  min-width: 400px;
  max-width: 400px;
}
.col-full {
  width: auto; /* или можно не задавать */
}

.filter-selector-wrapper {
  display: flex;
  align-items: center;
}

.filter-selector-wrapper select {
  flex: 1; /* селектор занимает все доступное пространство */
}

.delete-icon {
  margin-left: 8px;
  cursor: pointer;
  font-style: normal;
  font-style: normal;
}

/* Старый loading-overlay для полного покрытия */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

/* Загрузка - спиннер по центру экрана */
.loading-overlay-body {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  pointer-events: none;
}

.spinner {
  border: 8px solid #f3f3f3;
  border-top: 8px solid #3498db;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

/* Маленький спиннер для счетчиков */
.spinner-small {
  border: 2px solid #ddd;
  border-top: 2px solid #3498db;
  border-radius: 50%;
  width: 12px;
  height: 12px;
  animation: spin 1s linear infinite;
  display: inline-block;
  margin-left: 6px; /* Такой же отступ как у .tab-count */
  vertical-align: middle;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.flatpickr-input {
  font-size: 10px !important;
}

.flatpickr-calendar {
  font-size: 10px !important;
}

.flatpickr-day {
  font-size: 10px !important;
}

.flatpickr-calendar {
  opacity: 0;
  transition: opacity 0.1s ease-in-out;
}

.flatpickr-calendar.open {
  opacity: 1;
}

.flatpickr-days, 
.flatpickr-day, 
.flatpickr-months, 
.flatpickr-weekdays {
  font-size: 10px !important; /* Уменьшает текст */
}

.flatpickr-day {
  width: 20px !important;  /* Уменьшает ширину дней */
  height: 20px !important; /* Уменьшает высоту дней */
  line-height: 20px !important;
}

.flatpickr-months .flatpickr-month {
  height: 25px !important; /* Уменьшает высоту блока с месяцем */
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
  width: 20px !important; /* Уменьшает кнопки переключения */
  height: 20px !important;
}

.styled-link {
  display: inline-block;
  padding: 5px 12px;
  border: 1px solid #0084FF;
  border-radius: 20px;
  color: #0084FF;
  text-decoration: none;
  font-weight: bold;
  font-size: 10px;
  transition: all 0.3s ease;
  text-align: center;
}

.styled-link:hover {
  background-color: #0084FF;
  color: white;
}

[v-cloak] {
  display: none;
}

/* Для ячеек заголовка */
th.sticky-col {
  position: sticky;
  left: 0;
  z-index: 16; /* самый высокий z-index для первой колонки */
  box-shadow: inset -2px 0 0 #ddd !important;
}

/* Для ячеек тела таблицы */
td.sticky-col {
  position: sticky;
  left: 0;
  z-index: 13; /* выше sticky thead/tfoot */
  background: #fff;
  box-shadow: inset -2px 0 0 #ddd !important;
}

.active-users {
  display: flex;
  gap: 5px;
  align-items: center;
}

.user-circle {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  color: #fff;
  text-align: center;
  line-height: 25px;
  font-weight: bold;
}

.user-avatar {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  object-fit: cover;
}

.user-avatar-mini {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  object-fit: cover;
}

.text-center {
  text-align: center;
}

.columns-container {
  max-height: 300px;  /* высота по вашему усмотрению */
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 5px;
  border: 1px solid #ddd;
}


.column-header {
  position: relative;
  background-color: #F9FAFB;
  text-align: left;
  cursor: grab;
  transition: background-color 0.15s ease;
}

.column-header:active {
  cursor: grabbing;
}

/* Подсветка перетаскиваемого столбца */
.column-header.dragging,
td.column-dragging {
  background-color: #e3f2fd !important;
  opacity: 0.7;
}

/* Индикатор места вставки - левая граница */
.column-header.drag-over-left,
td.column-drag-target-left {
  box-shadow: inset 4px 0 0 0 #2196f3 !important;
}

/* Индикатор места вставки - правая граница */
.column-header.drag-over-right,
td.column-drag-target-right {
  box-shadow: inset -4px 0 0 0 #2196f3 !important;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.header-label {
  flex-grow: 1;
  cursor: grab;
}

.sort-icon {
  margin: 0 2px;
}

/* Filter dropdown styling */
.filter-dropdown {
  position: fixed;
  z-index: 1100; /* выше sticky элементов таблицы */
  background: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  min-width: 250px;
  max-width: 350px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  width: 300px;
  display: flex;
  flex-direction: column;
  font-size: 10px;
}

.filter-options {
  flex-grow: 1;
}

.filter-section {
  margin-bottom: 8px;
}

.filter-section-header {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.filter-section-header i {
  margin-right: 8px;
}

.filter-section-header:hover {
  background: #f0f0f0;
}

.filter-values-container, .filter-condition-container {
  padding: 0 12px 8px 12px;
}


.clear-filter-link {
  color: #4285f4;
  cursor: pointer;
  margin-left: 8px;
}

.filter-search {
  position: relative;
  margin-bottom: 8px;
}

.filter-search input {
  width: 100%;
  padding: 6px 10px 6px 30px;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 10px;
}

.filter-search i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #777;
}

.filter-value-item:nth-child(odd) {
  background: #f9f9f9;
}

.filter-condition-container select,
.filter-condition-container input {
  width: 100%;
  padding: 6px 10px;
  margin-top: 5px;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 10px;
}

.filter-actions {
  display: flex;
  justify-content: flex-end;
  padding: 10px 12px;
  background: #f5f5f5;
  border-top: 1px solid #ddd;
  position: sticky;
  bottom: 0;
  z-index: 1;
}

.filter-actions button {
  padding: 6px 16px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 10px;
}

.filter-cancel {
  background: white;
  border: 1px solid #ddd;
  margin-right: 8px;
}

.filter-ok {
  background: #4285f4;
  border: 1px solid #3367d6;
  color: white;
}

.filter-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: #777;
}

.filter-loading-spinner {
  border: 2px solid #f3f3f3;
  border-top: 2px solid #3498db;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  animation: filter-spin 1s linear infinite;
  margin-right: 10px;
}

@keyframes filter-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.filter-values-empty {
  padding: 10px;
  text-align: center;
  color: #777;
  font-style: italic;
}

.filter-value-label {
  cursor: pointer;
  user-select: none;
  flex: 1;
}


/* Стиль для выделенного состояния */
.filter-value-item.is-blank.selected {
  background-color: #e8f0fe;
}

.filter-values-header > span {
  margin-right: 8px;
}


.select-all-link, .clear-filter-link {
  color: #4285f4;
  cursor: pointer;
  user-select: none;
  display: inline-block;
  padding: 2px 4px;
  border-radius: 2px;
  transition: background-color 0.2s ease;
}

.select-all-link:hover, .clear-filter-link:hover {
  background-color: #e8f0fe;
  text-decoration: underline;
}

.filter-values-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 11px;
  line-height: 1.4;
}

.filter-info {
  width: 100%;
  margin-top: 4px;
  color: #777;
  font-size: 11px;
}

.filter-value-item.selected:hover {
  background-color: #d2e3fc;
}

/* Стиль для выбранных чекбоксов */
.filter-value-item input[type="checkbox"]:checked + .filter-value-label {
  font-weight: 500;
  color: #1a73e8;
}

/* Улучшенные стили для кнопок сортировки в фильтре */
.filter-option {
  padding: 8px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background-color 0.15s ease;
}

/* Контейнер для sort опций на одной строке */
.filter-sort-options {
  display: flex;
}

.filter-sort-options .filter-option {
  flex: 1;
  padding: 8px 10px;
}

.filter-option:hover {
  background-color: #f1f3f4;
}

.filter-option i {
  margin-right: 12px;
  color: #5f6368;
  width: 16px;
  text-align: center;
}

.filter-option-label {
  font-size: 10px;
  color: #202124;
}

/* Стили для заголовка фильтра */
.filter-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 14px;
  border-bottom: 1px solid #e0e0e0;
}

.filter-title {
  font-weight: 500;
  color: #202124;
}

.filter-close {
  cursor: pointer;
  font-size: 18px;
  color: #5f6368;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.filter-close:hover {
  background-color: #f1f3f4;
}

/* Разделитель в фильтре */
.filter-divider {
  height: 1px;
  background: #e0e0e0;
  margin: 0;
}





/* Улучшенные стили для активных фильтров */
.active-filter {
  color: #1a73e8 !important;
}

/* Фон заголовка колонки с активным фильтром */
.column-header.has-filter {
  background-color: #e8f0fe;
}

/* Дополнительный стиль для иконки фильтра */
.filter-icon {
  cursor: pointer;
  padding: 2px 8px;
  margin-left: 2px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.filter-icon:hover {
  background-color: #f0f0f0;
}

/* Badge для количества активных фильтров */
.filter-count-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background-color: #1a73e8;
  color: white;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Стиль для активных фильтров в итоговой строке */
.active-filters-summary {
  margin: 5px 20px;
  padding: 5px 10px;
  background-color: #e8f0fe;
  border-radius: 4px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.active-filter-tag {
  display: inline-flex;
  align-items: center;
  background-color: #1a73e8;
  color: white;
  padding: 2px 8px;
  margin: 2px 4px;
  border-radius: 12px;
}

.active-filter-tag .clear-filter {
  margin-left: 4px;
  cursor: pointer;
  font-size: 10px;
}

.active-filter-tag .clear-filter:hover {
  opacity: 0.8;
}




/* Стили для отметки активных значений фильтра */
.filter-value-item.current-filter {
  background-color: #d2e3fc;
  border-left: 3px solid #1a73e8;
}


/* Улучшаем стили чекбоксов */
.filter-value-item input[type="checkbox"] {
  margin-right: 8px;
  cursor: pointer;
}

/* Улучшение для отображения (Blanks) */
.filter-value-item.is-blank.current-filter {
  background-color: #f1effd;
  border-left-color: #8e24aa;
}

.filter-value-item.is-blank .current-filter-indicator {
  color: #8e24aa;
}

/* Фиксация заголовков таблицы */
thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #f4f4f4; /* или другой нужный вам сплошной цвет */
}

/* Обеспечиваем корректное отображение ячеек заголовка */
thead th {
  color: #444F5D;
  position: relative; /* Для правильного позиционирования содержимого */
  background-color: #fff; /* или #ffffff */
  border-top: none;
}

/* Для sticky-col в заголовке нужен более высокий z-index */
thead th.sticky-col {
  z-index: 17; /* самый высокий z-index для заголовка первой колонки */
  box-shadow: inset -2px 0 0 #ddd, 0 1px 0 0 black; /* Комбинируем правую и нижнюю тени */
}

table {
  border-spacing: 0;
  width: 100%;
  font-size: 10px;
}

thead th,
tbody td {
  border-bottom: 1px solid #ddd;
  padding: 6px;
}

/* Аналогично для tfoot - фиксируем внизу */
tfoot {
  position: sticky;
  bottom: 0;
  z-index: 10;
  background: #fff;
  margin: 0;
  padding: 0;
}

/* Улучшаем стили для визуального разделения */
tbody tr:last-child td {
  border-bottom: 1px solid #e0e0e0; /* Добавляем более заметную границу перед футером */
}

/* Создаём фиксированный layout */
.main-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

/* Верхняя фиксированная панель - вкладки, фильтры, массовые действия */
.fixed-header {
  flex-shrink: 0;
  background: white;
  border-bottom: 1px solid #ddd;
}

/* Центральная скроллируемая область - только таблица */
.table-container {
  flex: 1;
  overflow: auto;
  display: block;
  position: relative;
}

.table-container {
  --mass-actions-height: 0px;
}

.table-container.has-mass-actions table {
  margin-bottom: var(--mass-actions-height);
}

/* Закрепляем заголовок таблицы при скролле */
.table-container table {
  width: 100%;
}

.table-container thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: white;
}

/* Закрепляем футер таблицы при скролле */
.table-container tfoot {
  position: sticky;
  bottom: 0;
  z-index: 10;
  background: white;
}

/* Sticky колонки в футере */
tfoot th.sticky-col,
tfoot td.sticky-col {
  position: sticky;
  left: 0;
  z-index: 17;
  background: white;
  box-shadow: inset -2px 0 0 #ddd !important;
}

tfoot th.sticky-product,
tfoot td.sticky-product {
  position: sticky;
  left: 32px;
  z-index: 15;
  background: white;
  border-right: 1px solid #ddd;
}

/* Нижняя фиксированная панель - пагинация и тоталы */
.fixed-footer {
  flex-shrink: 0;
  background: white;
}

.user-note-textarea {
  width: 100%;
  min-width: 150px;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 6px;
}

.user-note-display {
  min-height: 20px;
  padding: 2px 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.empty-note {
  color: #999;
  font-style: italic;
  font-size: 10px;
}

.file-actions {
  display: flex;
  gap: 5px;
}

.file-action-btn {
  padding: 3px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 10px;
  border: 1px solid #ccc;
}

.file-action-btn.download {
  background-color: #4CAF50;
  color: white;
}

.file-action-btn.delete {
  background-color: #f44336;
  color: white;
}


.file-upload-wrapper {
  position: relative;
  display: inline-block;
}

.file-upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  opacity: 0;
  z-index: -1;
}

.file-upload-label {
  display: inline-block;
  padding: 5px 10px;
  background-color: #2196F3;
  color: white;
  border-radius: 3px;
  cursor: pointer;
  font-size: 10px;
  text-align: center;
  user-select: none;
}

.file-btn {
  padding: 3px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 10px;
  border: 1px solid #ccc;
}

.not-uploaded {
  color: #777;
  font-style: italic;
  font-size: 10px;
}






/* Добавьте эти стили в ваш файл styles.css */

/* Контейнер для списка значений фильтра */
.filter-values-list {
  max-height: 150;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 5px 0;
  margin-top: 5px;
  border-top: 1px solid #eee;
}

/* Индикатор загрузки для ленивой загрузки значений */
.filter-values-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  background-color: #f5f5f5;
  border-radius: 3px;
  margin: 5px 0;
}

.filter-values-loading .filter-loading-spinner {
  border: 2px solid #f3f3f3;
  border-top: 2px solid #3498db;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}

/* Стиль для элемента "показать еще" */
.filter-values-more {
  padding: 10px 0;
  text-align: center;
  font-size: 10px;
  color: #666;
  background-color: #f8f8f8;
  border-radius: 3px;
  margin: 5px 0;
  cursor: pointer;
}

.filter-values-more:hover {
  background-color: #f0f0f0;
}

/* Анимация для спиннера */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Стили для элементов списка значений фильтра */
.filter-value-item {
  padding: 5px 8px;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s;
}

.filter-value-item:hover {
  background-color: #f5f5f5;
}

.filter-value-item.selected {
  background-color: #e6f7ff;
}

.filter-value-item.is-blank {
  color: #888;
  font-style: italic;
}

.filter-value-label {
  margin-left: 8px;
  cursor: pointer;
  flex: 1;
}

.current-filter-indicator {
  color: #1890ff;
  font-weight: bold;
  margin-left: 5px;
}

/* Информация о зависимых фильтрах */
.filter-dependency-info {
  font-size: 10px;
  color: #ff4d4f;
  margin-top: 5px;
  display: flex;
  align-items: center;
}

.filter-dependency-info i {
  margin-right: 5px;
}

/* Информация о выборе всех значений */
.all-values-selected-info {
  font-size: 10px;
  color: #52c41a;
  margin-top: 5px;
  display: flex;
  align-items: center;
}

.all-values-selected-info i {
  margin-right: 5px;
}


.check-status-btn {
  background-color: #008577;
  color: white;
}

.status-check-results {
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
}

.status-results-table {
  margin: 15px 0;
  max-height: 400px;
  overflow-y: auto;
}

.status-results-table table {
  width: 100%;
  border-collapse: collapse;
}

.status-results-table th, 
.status-results-table td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
}

.status-results-table th {
  background-color: #f2f2f2;
  position: sticky;
  top: 0;
}

.status-changed {
  background-color: rgba(255, 200, 200, 0.5);
}

.status-changed-text {
  color: #d32f2f;
  font-weight: bold;
}

.status-error {
  color: #ff6d00;
}

.status-checking-progress {
  margin-top: 10px;
  font-weight: bold;
}

.no-status-results {
  padding: 20px;
  text-align: center;
  color: #666;
}

.status-check-summary {
  margin-top: 15px;
  padding-top: 10px;
  border-top: 1px solid #eee;
}

.cancelled-text {
  color: red;
}


.spinner-icon {
  border: 2px solid #f3f3f3; /* светлый фон */
  border-top: 2px solid #3498db; /* цвет вращающейся части */
  border-radius: 50%;
  width: 4px;
  height: 4px;
  animation: spin 1s linear infinite;
  display: inline-block;      /* inline-block для сохранения строчного контекста */
  vertical-align: middle;     /* выравнивание по центру */
  margin-right: 5px;          /* небольшой отступ справа */
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 20px;
}

/* Левая часть с количеством отфильтрованных записей */
.pagination-left {
  flex: 1;
  display: flex;
  align-items: center;
}

.filtered-count {
  font-size: 10px;
  color: #555;
  font-weight: 500;
}

/* Центральная часть с навигацией по страницам */
.pagination-center {
  flex: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pagination-number {
  min-width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ddd;
  background: white;
  margin: 0 2px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 10px;
}

.pagination-number.active {
  background: #333;
  color: white;
  font-weight: bold;
}

.pagination-arrow {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ddd;
  background: white;
  cursor: pointer;
  border-radius: 4px;
}

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

.pagination-ellipsis {
  margin: 0 5px;
}

.goto-form {
  display: inline-block;
  margin: 0 10px;
}

.pagination-goto-input {
  width: 60px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 10px;
}

/* Правая часть с "Показать по" */
.pagination-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.pagination-right span {
  margin-right: 10px;
  font-size: 10px;
  white-space: nowrap;
}

.items-per-page-buttons {
  display: flex;
}

.items-per-page-buttons button {
  padding: 6px 10px;
  border: 1px solid #ddd;
  background: white;
  cursor: pointer;
  margin: 0 2px;
  font-size: 10px;
  border-radius: 4px;
}

.items-per-page-buttons button.active {
  background: #333;
  color: white;
  font-weight: bold;
}


.tabs {
  border-bottom: 1px solid #ddd;
  margin: 0;
  padding: 0 20px;
}

.tabs-container {
  display: flex;
  justify-content: space-between;
  align-items: center;

}

.tabs-content {
  display: flex;
  overflow-x: auto;
  overflow: hidden;
  flex-grow: 1;
  min-height: 44px; /* Фиксированная высота контента */
  align-items: flex-end; /* Прижимаем кнопки к низу */
}

.tabs-right {
  margin-left: auto;
  padding-left: 20px;
  border-left: 1px solid #eee;
}

.tabs button {
  padding: 12px 16px;
  border: none;
  border-bottom: 2px solid transparent; /* Резервируем место для подчеркивания */
  background: transparent;
  cursor: pointer;
  font-weight: 500;
  color: #666;
  position: relative;
  white-space: nowrap;
  font-size: 10px;
  min-height: 44px; /* Минимальная высота для всех кнопок */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tabs button.active {
  color: #333;
  font-weight: bold;
  border-bottom: 2px solid #333;
}

.tabs button:hover {
  background-color: rgba(0,0,0,0.05);
}

/* Стили для кнопки корзины */
.cart-button {
  border-radius: 4px 4px 0 0 !important;
  transition: all 0.2s ease;
}

.cart-button:hover {
  background-color: #efefef !important;
}

.cart-button i {
  margin-right: 4px;
}

/* Стили для бейджей с количеством */
.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #f0f1f3;
  color: #555;
  border-radius: 16px;
  padding: 1px 8px;
  font-size: 9px;
  margin-left: 6px;
  min-width: 18px; /* Минимальная ширина для предотвращения прыжков */
  height: 16px;
  line-height: 1;
  font-weight: 500;
  transition: all 0.2s ease;
}

/* Стиль для бейджей в активной вкладке */
button.active .tab-count {
  background-color: #e0e2e5;
  color: #333;
}

/* Стиль для бейджей при наведении на вкладку */
button:hover .tab-count {
  background-color: #e8eeff;
}

/* Специальный стиль для бейджа корзины */
.cart-count {
  background-color: #e8eeff;
  color: #1370E5;
}

button.active .cart-count {
  background-color: #1370E5;
  color: white;
}

/* Стиль для непрочитанных сообщений только когда count > 0 */
button:not(.active) .tab-count.unread-count[data-count-value]:not([data-count-value="0"]) {
  background-color: #ffeeee;
  color: #e53935;
  font-weight: 600;
}

/* Если число непрочитанных больше 1, делаем цвет интенсивнее */
button:not(.active) .tab-count.unread-count[data-count-value]:not([data-count-value="0"]):not([data-count-value="1"]) {
  background-color: #ffdedc;
  color: #e53935;
}

/* Если число непрочитанных больше 9, делаем бейдж еще более заметным */
button:not(.active) .tab-count.unread-count[data-count-value]:not([data-count-value="0"]):not([data-count-value="1"]):not([data-count-value="2"]):not([data-count-value="3"]):not([data-count-value="4"]):not([data-count-value="5"]):not([data-count-value="6"]):not([data-count-value="7"]):not([data-count-value="8"]):not([data-count-value="9"]) {
  background-color: #ffcccb;
  box-shadow: 0 0 0 1px rgba(229, 57, 53, 0.2);
}

/* При наведении на вкладку с непрочитанными */
button:not(.active):hover .tab-count.unread-count[data-count-value]:not([data-count-value="0"]) {
  background-color: #ffb8b5;
}

/* Для активной вкладки непрочитанных (когда count > 0) */
button.active .tab-count.unread-count[data-count-value]:not([data-count-value="0"]) {
  background-color: #e53935;
  color: white;
}

/* Для активной вкладки непрочитанных (когда count = 0) - обычный стиль как у других */
button.active .tab-count.unread-count[data-count-value="0"] {
  background-color: #e0e2e5;
  color: #333;
}



.main-button {
  display: inline-block;
  margin-right: 10px;
  padding: 6px 12px;
  font-size: 10px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background-color: #1370E5;
  border: 1px solid #1370E5;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  max-height: 40px;
}

.main-button:hover {
  background-color: #0062E0;
  border-color: #0062E0;
}


.secondary-button {
  display: inline-block;
  margin-right: 10px;
  padding: 6px 12px;
  font-size: 10px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  color: #333;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  max-height: 40px;
}

.secondary-button:hover {
  background-color: #f0f0f0;
  border-color: #ccc;
}


.remove-button {
  display: inline-block;
  margin-right: 10px;
  padding: 6px 12px;
  font-size: 10px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  color: #e53935;
  background-color: #fff0f0;
  border: 1px solid #ED6A5F;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid rgba(229, 57, 53, 0.2);
  max-height: 40px;
}

.remove-button:hover {
  background-color: #ffebee;
  color: #d32f2f;
  border-color: rgba(229, 57, 53, 0.3);
}

.rebuyback-button {
  display: inline-block;
  margin-right: 10px;
  padding: 6px 12px;
  font-size: 10px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  background-color: #ffffc7;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid #DADA7C;
  max-height: 40px;
}

.rebuyback-button:hover {
  background-color: #FFFF9D;
  border-color: #DADA7C;
}

header .nav-buttons a.logout {
  background-color: #fff0f0;
  color: #e53935;
  border: 1px solid rgba(229, 57, 53, 0.2);
}

header .nav-buttons a.logout:hover {
  background-color: #ffebee;
  color: #d32f2f;
  border-color: rgba(229, 57, 53, 0.3);
}


.link-button {
  background: transparent;
  border: none;
  color: #4285f4; /* можно задать нужный цвет текста */
  text-decoration: underline;
  cursor: pointer;
  font-size: 10px;
  padding: 6px 12px; /* по необходимости, можно и без паддингов */
  transition: color 0.2s ease;
  max-height: 40px;
}

.link-button:hover {
  color: #3367d6; /* немного затемнённый оттенок при наведении */
}



.product-cell {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.product-image {
  width: 40px;
  height: 40px;
  object-fit: cover;  /* Обрезает изображение, сохраняя пропорции */
  border-radius: 3px;
  flex-shrink: 0;     /* Предотвращает сжатие */
}
.product-details {
  display: flex;
  flex-direction: column;
}
.product-title {
  font-weight: bold;
  font-size: 10px;
  margin-bottom: 2px;
}
.product-info {
  font-weight: normal;
  font-size: 10px;
  color: #777;
  display: flex;
  align-items: center;
  gap: 2px;
}
.product-link {
  margin-left: 4px;
  color: #666;
  text-decoration: none;
  transition: color 0.2s;
}
.product-link:hover {
  color: #4285f4;
}

/* Новые стили для кликабельного названия товара */
.product-name-link {
  color: inherit; /* Наследует цвет текста от родителя (черный) */
  text-decoration: none; /* Убираем подчеркивание */
  font-weight: bold; /* Сохраняем жирный шрифт */
  transition: color 0.2s ease; /* Плавный переход при наведении */
}

.product-name-link:hover {
  color: #1370E5; /* Синий цвет при наведении */
}




/* Стили для ячеек с возможностью копирования */
.copyable-cell {
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: 100%; /* Ограничиваем максимальную ширину */
  overflow: hidden; /* Скрываем переполнение */
}

.copy-icon {
  position: relative;
  margin-left: 5px;
  opacity: 0;
  cursor: pointer;
  color: #666;
  font-size: 14px;
  transition: opacity 0.2s ease, color 0.2s ease;
  background: none;
  border: none;
  padding: 2px;
  z-index: 1;
  min-width: 20px; /* Минимальная ширина для стабильного отображения */
}

.copyable-cell:hover .copy-icon {
  opacity: 1;
}

.copy-icon:hover {
  color: #1370E5;
}

.platform-blacklisted {
  background: #fde8e8;
  color: #c0392b;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid #f5c6cb;
  white-space: nowrap;
}

/* Стиль для всплывающего уведомления о копировании */
.copy-tooltip {
  position: fixed;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  z-index: 1000;
  pointer-events: none; /* чтобы не мешало кликам */
  opacity: 0;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}

.copy-tooltip.show {
  opacity: 1;
}

/* Стили для кликабельного названия товара */
.product-name-link {
  color: inherit; /* Наследует цвет текста от родителя (черный) */
  text-decoration: none; /* Убираем подчеркивание */
  font-weight: bold; /* Сохраняем жирный шрифт */
  transition: color 0.2s ease; /* Плавный переход при наведении */
}

.product-name-link:hover {
  color: #1370E5; /* Синий цвет при наведении */
}



/* Или даже более специфичный вариант для первой строки в tfoot */
table tfoot tr:first-child td {
  border-top: 1px solid #ddd !important;
  border-bottom: 1px solid #ddd !important;
  padding-top: 10px;
  padding-bottom: 10px;
  font-weight: bold;
  text-align: left;
}












/* Стили для редактируемых полей */
.editable {
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  background-color: #F0F1F3; /* Фон в обычном состоянии */
  word-wrap: break-word; /* Разрешает перенос длинных слов */
  white-space: normal; /* Разрешает естественные переносы строк */
  max-width: 100%; /* Гарантирует, что элемент не выйдет за пределы родителя */
}

.editable:hover {
  background-color: #E8EEFF; /* Светло-голубой фон при наведении */
  border: 1px dashed rgba(19, 112, 229, 0.3);
}

.editable-active {
  border: 1px solid #1370E5 !important;
  background-color: white;
  box-shadow: 0 0 0 3px rgba(19, 112, 229, 0.1);
}

/* Стили для полей ввода при редактировании */
.edit-input {
  border: 1px solid #1370E5;
  border-radius: 4px;
  padding: 4px 6px;
  width: 100%;
  font-size: inherit;
  font-family: inherit;
  box-sizing: border-box;
  outline: none;
  box-shadow: 0 0 0 3px rgba(19, 112, 229, 0.1);
}

/* Стили для textarea при редактировании */
.edit-textarea {
  border: 1px solid #1370E5;
  border-radius: 4px;
  padding: 4px 6px;
  width: 100%;
  font-size: inherit;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
  box-sizing: border-box;
  outline: none;
  box-shadow: 0 0 0 3px rgba(19, 112, 229, 0.1);
}

/* Стили для selects при редактировании */
select.edit-select {
  border: 1px solid #1370E5;
  border-radius: 4px;
  padding: 4px 6px;
  width: 100%;
  font-size: inherit;
  font-family: inherit;
  background-color: white;
  cursor: pointer;
  box-sizing: border-box;
  outline: none;
  box-shadow: 0 0 0 3px rgba(19, 112, 229, 0.1);
}

/* Стили для заметок пользователя */
.user-note-display {
  width: 100%;
}

.user-note-content {
  display: block;
  min-height: 20px;
  line-height: 1.4;
  word-break: break-word;
}

.user-note-empty {
  display: block;
  color: #787878; /* Чуть более тёмный цвет */
  font-style: italic;
  min-height: 20px;
  background-color: #F0F1F3; /* Фон как у других редактируемых полей */
  padding: 4px 6px;
  border-radius: 4px;
}

/* Стили для редактируемой заметки */
.user-note-textarea {
  width: 100%;
  min-height: 60px;
  resize: vertical;
  border: 1px solid #1370E5;
  border-radius: 4px;
  padding: 6px;
  font-family: inherit;
  font-size: inherit;
  box-shadow: 0 0 0 3px rgba(19, 112, 229, 0.1);
  outline: none;
}






/* Стили для альтернативного варианта с кнопкой-выпадающим списком */
.dropdown-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: max-content; /* Ширина по содержимому */
  max-width: 100%;  /* Не шире родительского контейнера */
}

.dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  background-color: #F0F1F3;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  color: inherit;
  font-size: inherit;
  font-family: inherit;
}

.dropdown-trigger:hover {
  background-color: #E8EEFF;
  border-color: rgba(19, 112, 229, 0.3);
}

.dropdown-icon {
  font-size: 12px;
  color: #666;
  transition: transform 0.2s ease;
}

/* Поворот стрелки когда меню открыто */
.dropdown-wrapper:has(.dropdown-menu.open) .dropdown-icon {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  min-width: 180px;
  max-height: 300px;
  overflow-y: auto;
  background-color: white;
  border: 1px solid #1370E5;
  border-radius: 4px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  display: none;
  margin-top: 4px;
  min-width: 100%; /* Минимум равен ширине кнопки-триггера */
  width: max-content; /* Природная ширина, основанная на контенте */
  max-width: 300px; /* Предотвращает слишком длинные строки */
}

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

.dropdown-item {
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  white-space: nowrap; /* Предотвращает перенос текста */
  overflow: hidden;    /* Скрывает лишнее */
  text-overflow: ellipsis; /* Показывает многоточие для длинного текста */
}

.dropdown-item:hover {
  background-color: #E8EEFF;
}

.dropdown-item.active {
  background-color: #E8EEFF;
  font-weight: 500;
}











/* Общий контейнер фильтров */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px;
  border-radius: 8px;
  margin: 1px 10px;
  align-items: flex-end;
}

/* Отдельный элемент фильтра */
.filter-item {
  display: flex;
  flex-direction: column;
  font-size: 10px;
}

.filters form {
  margin: 0;
  padding: 0;
}

/* Лейблы для фильтров */
.filter-item label {
  font-size: 10px;
  color: #555;
  margin-bottom: 6px;
  font-weight: 500;
}

/* Общие стили для всех полей ввода */
.filter-item input[type="text"],
.filter-item select,
.filter-item .date-picker {
  padding: 8px 10px;
  border-radius: 4px;
  border: 1px solid transparent;
  background-color: #F0F1F3;
  font-size: 13px;
  transition: all 0.2s ease;
  width: 100%;
  min-height: 36px;
}

/* Состояние при наведении */
.filter-item input[type="text"]:hover,
.filter-item select:hover,
.filter-item .date-picker:hover {
  background-color: #E8EEFF;
  border-color: rgba(19, 112, 229, 0.3);
}

/* Состояние при фокусе */
.filter-item input[type="text"]:focus,
.filter-item select:focus,
.filter-item .date-picker:focus {
  background-color: white;
  border-color: #1370E5;
  outline: none;
  box-shadow: 0 0 0 3px rgba(19, 112, 229, 0.1);
}

/* Специальные стили для выпадающих списков */
.filter-item select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

/* Стили для оболочки селектора с иконкой удаления */
.filter-selector-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.filter-selector-wrapper select {
  width: 100%;
  padding-right: 30px;
}

.delete-icon {
  position: absolute;
  right: 30px;
  color: #888;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  z-index: 2;
}

.delete-icon:hover {
  opacity: 1;
  color: #d32f2f;
}

/* Стили для кнопок фильтров */
.filter-buttons {
  display: flex;
  margin-top: 10px;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  font-size: 10px;
}

.main-button {
  background-color: #1370E5;
  color: white;
  border: none;
  font-weight: 500;
}

.main-button:hover {
  background-color: #0d5fc8;
}

button.link-button {
  background: none;
  border: none;
  color: #666;
  text-decoration: underline;
  padding: 8px;
}

button.link-button:hover {
  color: #1370E5;
  text-decoration: none;
}

/* Стили для активных фильтров колонок */
.active-filters-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background-color: #f0f8ff;
  border-radius: 4px;
  align-items: center;
  margin-bottom: 16px;
  font-size: 12px;
}

.active-filter-tag {
  display: inline-flex;
  align-items: center;
  background-color: #e8eeff;
  color: #1370E5;
  border-radius: 16px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
}

.clear-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: rgba(19, 112, 229, 0.1);
  color: #1370E5;
  cursor: pointer;
  font-weight: bold;
}

.clear-filter:hover {
  background-color: rgba(19, 112, 229, 0.2);
}

/* Стиль для кнопки очистки всех фильтров */
.active-filters-summary button {
  background-color: #f2f4f8;
  border: 1px solid #ddd;
  border-radius: 4px;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
}

.active-filters-summary button:hover {
  background-color: #e0e3e9;
  color: #333;
}

/* Стили для Select2 (если используется) */
.select2-container--default .select2-selection--single {
  background-color: #F0F1F3;
  border: 1px solid transparent;
  border-radius: 4px;
  min-height: 36px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 36px;
  padding-left: 10px;
  color: #333;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 36px;
}

.select2-container--default.select2-container--open .select2-selection--single {
  background-color: white;
  border-color: #1370E5;
  box-shadow: 0 0 0 3px rgba(19, 112, 229, 0.1);
}

/* Стили для Flatpickr (календарь) */
.flatpickr-calendar {
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border: none;
}

.flatpickr-day.selected, 
.flatpickr-day.startRange, 
.flatpickr-day.endRange, 
.flatpickr-day.selected.inRange, 
.flatpickr-day.startRange.inRange, 
.flatpickr-day.endRange.inRange, 
.flatpickr-day.selected:focus, 
.flatpickr-day.startRange:focus, 
.flatpickr-day.endRange:focus, 
.flatpickr-day.selected:hover, 
.flatpickr-day.startRange:hover, 
.flatpickr-day.endRange:hover, 
.flatpickr-day.selected.prevMonthDay, 
.flatpickr-day.startRange.prevMonthDay, 
.flatpickr-day.endRange.prevMonthDay, 
.flatpickr-day.selected.nextMonthDay, 
.flatpickr-day.startRange.nextMonthDay, 
.flatpickr-day.endRange.nextMonthDay {
  background: #1370E5;
  border-color: #1370E5;
}

.flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n+1)), 
.flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n+1)), 
.flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n+1)) {
  box-shadow: -10px 0 0 #1370E5;
}

/* Стили для кнопки настройки столбцов */
button[title="Выбрать столбцы"] {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background-color: #f5f7fa !important;
  color: #666;
  margin-left: auto;
}

button[title="Выбрать столбцы"]:hover {
  background-color: #e8eeff !important;
  color: #1370E5;
}





/* Стили для закрепления столбца product_name */
.sticky-product {
  position: sticky !important;
  z-index: 12; /* выше sticky thead/tfoot */
  background: #fff;
  left: 32px; /* Ширина столбца с чекбоксами */ 
  border-right: 1px solid #ddd;
}

/* Для заголовка */
th.sticky-product {
  position: sticky !important;
  z-index: 14; /* Выше, чем z-index у td.sticky-product */
  background-color: #F9FAFB;
  border-right: 1px solid #ddd;
}

/* Обеспечиваем правильное наложение при скролле */
thead th.sticky-product {
  z-index: 15; /* Выше всех других элементов */
}


/* Используем CSS-переменную для всех ячеек */
tbody tr {
    background-color: var(--row-bg-color, transparent);
}

tbody tr td.sticky-product,
tbody tr td.sticky-col {
    background-color: inherit !important;
    z-index: 2;
    overflow: hidden;
}

.cart-info {
  margin-top: 4px;
  color: #1370E5;
  padding: 4px 10px;
  background-color: #E8EEFF;
  border-radius: 4px;
  display: inline-block;
  max-width: 100%;
}

.assigned-user {
  color: #000000;
  background-color: transparent;
  max-width: 100%;
}

/* Когда assigned-user используется с аватаркой */
.assigned-user.user-with-avatar {
  display: flex;
  align-items: center;
  gap: 6px;
}



/* Стили для меню выбора столбцов */
.icon-button {
  background: none;
  border: none;
  color: #1370E5;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  position: relative;
}

.icon-button:hover {
  background-color: rgba(19, 112, 229, 0.1);
}

.column-menu-container {
  position: absolute;
  top: 100%;
  right: 20px;
  width: auto;
  min-width: 350px;
  max-width: 550px;
  height: auto;       /* Автоматическая высота */
  max-height: 450px;  /* Фиксированная максимальная высота */
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  font-size: 10px;
  margin-top: 5px;
  overflow: hidden;  /* Скрываем переполнение контейнера */
}


.column-menu-header {
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0; /* Запрещаем сжатие заголовка */
}

.column-menu-header h3 {
  margin: 0;
  font-size: 12px; /* Меньший размер для заголовка */
}

.small-button {
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 10px; /* Меньший размер для кнопки */
  cursor: pointer;
}

.small-button:hover {
  background: #e0e0e0;
}

.column-menu-content {
  overflow-y: auto;   /* Вертикальный скролл */
  overflow-x: hidden; /* Запрещаем горизонтальный скролл */
  flex-grow: 1;       /* Растягиваем по высоте */
  max-height: 400px;  /* Максимальная высота контента */
  padding: 4px 0;
}

.column-list {
  width: 100%;
}

.column-item:hover {
  background-color: #f5f5f5;
}

.column-disabled {
  opacity: 0.6;
  background-color: #f8f8f8;
}

.eye-button {
  background: none;
  border: none;
  cursor: pointer;
  color: #555;
  font-size: 12px; /* Уменьшаем размер иконки */
  padding: 2px 4px;
  border-radius: 4px;
  margin-left: 4px;
}

.eye-button:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.fa-eye {
  color: #1370E5;
}

.fa-eye-slash {
  color: #999;
}





/* Стиль для индикатора вставки перед элементом */
.column-item.insert-before {
  border-top: 2px solid #1370E5;
  padding-top: 6px; /* компенсируем border */
  position: relative;
}

.column-item.insert-before::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #1370E5;
}

/* Стиль для индикатора вставки после элемента */
.column-item.insert-after {
  border-bottom: 2px solid #1370E5;
  padding-bottom: 6px; /* компенсируем border */
  position: relative;
}

.column-item.insert-after::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #1370E5;
}



/* Стиль для перетаскиваемого элемента */
.column-item.being-dragged {
  background-color: #f0f7ff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0.9;
  pointer-events: none;
  transition: transform 0.05s ease;
  position: fixed;
  width: auto;
  z-index: 1001;
}

/* Стиль для плейсхолдера - места, куда будет вставлен элемент */
.column-item-placeholder {
  border: 2px dashed #1370E5;
  background-color: #f0f7ff;
  border-radius: 4px;
  margin: 4px 0;
  opacity: 0.7;
  transition: all 0.2s ease;
}


/* Стиль для чекбокса границы */
.column-border-control {
  display: inline-flex;
  align-items: center;
  margin-right: 8px;
}

.column-border-control input {
  margin-right: 4px;
}

.column-border-control label {
  cursor: pointer;
  font-weight: bold;
  color: #666;
}

/* Стиль для ячеек с правой границей */
.border-right {
  border-right: 1px solid #ddd !important;
}


/* Если иконки fa-border-style и fa-border-none не доступны, создаем кастомные */
.fa-border-style:before {
  content: "|";
  font-weight: bold;
}

.fa-border-none:before {
  content: "|";
  opacity: 0.5;
}









/* Стили для области перетаскивания */
.column-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 6px 8px;
  box-sizing: border-box; /* Важно для корректного подсчета ширины */
  transition: background-color 0.2s ease;
  user-select: none; /* Предотвращаем выделение текста */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}


.drag-area {
  display: flex;
  align-items: center;
  cursor: move;
  flex-grow: 1;
  padding-right: 10px;
}

.drag-handle {
  margin-right: 8px;
  color: #999;
  font-size: 10px;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.drag-handle:active {
  cursor: grabbing;
}

/* Стили для SortableJS */
.sortable-ghost {
  opacity: 0.3;
  background-color: #f0f7ff;
}

.sortable-chosen {
  background-color: #e6f3ff;
}

.sortable-drag {
  background-color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: rotate(2deg);
}

.column-name {
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 10px; /* Добавляем отступ справа */
  max-width: 250px;    /* Ограничиваем максимальную ширину */
}

.border-button-placeholder {
  width: 28px; /* Соответствует ширине кнопки */
  display: inline-block;
}

.border-button, .eye-button {
  padding: 4px 6px; /* Уменьшаем отступы */
  margin: 0 2px;    /* Уменьшаем боковые отступы */
}

.column-controls {
  display: flex;
  align-items: center;
}

/* Стиль для кнопки переключения границы */
.border-button {
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  margin-right: 4px;
  transition: all 0.2s ease;
}

.border-button:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #333;
}

.border-button.active {
  color: #1370E5;
  background-color: rgba(19, 112, 229, 0.1);
}

/* Стиль для активной иконки границы */
.border-button.active .fa-ellipsis-v {
  color: #1370E5;
  font-weight: bold;
}

.chat-sender {
  font-weight: bold;
  color: #444;
}




/* Updated styles for nav buttons */
header .nav-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

header .nav-buttons a {
  text-decoration: none;
  color: #444;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 10px;
  transition: all 0.2s ease;
  background-color: #f5f7fa;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  position: relative;
}

header .nav-buttons a:hover {
  background-color: #e8eeff;
  color: #1370E5;
}

header .nav-buttons a.active,
header .nav-buttons a.current {
  background-color: #e8eeff;
  color: #1370E5;
  border-bottom: 2px solid #1370E5;
  font-weight: 600;
}

/* Special style for logout button */
header .nav-buttons a.logout {
  background-color: #fff0f0;
  color: #e53935;
  border: 1px solid rgba(229, 57, 53, 0.2);
}

header .nav-buttons a.logout:hover {
  background-color: #ffebee;
  color: #d32f2f;
  border-color: rgba(229, 57, 53, 0.3);
}

/* Style for the unread badge */
.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #ff4d4f;
  color: white;
  border-radius: 10px;
  min-width: 16px;
  font-size: 10px;
  font-weight: bold;
  margin-left: 6px;
  padding: 0px 10px;
  line-height: 1;
  vertical-align: middle;
  text-align: center;
  box-sizing: border-box;
}

/* Make the badge appear when it has content */
.unread-badge:not(:empty) {
  display: inline-flex;
}







/* Стили для админ-панели */
.admin-container {
  display: flex;
  flex-direction: column;
  padding: 0 20px 20px;
}

.admin-section {
  margin-top: 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.admin-section h2 {
  margin-top: 0;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
  font-size: 16px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-section h2 i {
  color: #1370E5;
}

.admin-section h3 {
  font-size: 14px;
  margin-bottom: 15px;
  color: #444;
}

/* Стили для форм */
.admin-form {
  margin-bottom: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 15px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 500;
  font-size: 12px;
  color: #555;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group select {
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 12px;
  background-color: #F0F1F3;
  transition: all 0.2s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="number"]:focus,
.form-group select:focus {
  border-color: #1370E5;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(19, 112, 229, 0.1);
  outline: none;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

/* Стили для вкладок */
.tab-button {
  padding: 12px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: 500;
  color: #666;
  position: relative;
  white-space: nowrap;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab-button i {
  font-size: 14px;
}

.tab-button.active {
  color: #333;
  font-weight: bold;
}

.tab-button.active:after {
  content: '';
  position: absolute;
  bottom: 0px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: #1370E5;
}

.tab-button:hover {
  background-color: rgba(0,0,0,0.05);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.option-item input[type="text"],
.option-item input[type="number"] {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 12px;
}

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

.action-buttons button {
  padding: 6px 10px;
  font-size: 10px;
  white-space: nowrap;
}

/* Стили для кнопок в заголовках таблицы */
.column-buttons {
  display: flex;
  justify-content: center; /* Выравнивание по центру */
  gap: 5px;
  margin-top: 5px;
}

.micro-button {
  padding: 2px 6px;
  font-size: 9px;
  border: 1px solid #ddd;
  background-color: #f8f8f8;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  display: inline-block;
  min-width: 60px; /* Минимальная ширина для кнопок */
}

.micro-button:hover {
  background-color: #f0f0f0;
  border-color: #ccc;
}

/* Стили для вкладок ролей */
.roles-tabs {
  display: flex;
  overflow-x: auto;
  border-bottom: 1px solid #ddd;
  margin-bottom: 20px;
  padding-bottom: 1px;
}

.role-tab-button {
  padding: 10px 15px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: #555;
  position: relative;
  white-space: nowrap;
}

.role-tab-button:hover {
  background-color: #f9f9f9;
}

.role-tab-button.active {
  font-weight: 600;
  color: #1370E5;
}

.role-tab-button.active:after {
  content: '';
  position: absolute;
  bottom: 0px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: #1370E5;
}

/* Стили для вкладок в опциях select-полей */
.options-tabs {
  display: flex;
  overflow-x: auto;
  border-bottom: 1px solid #ddd;
  margin-bottom: 20px;
  padding-bottom: 1px;
}

.option-tab-button {
  padding: 10px 15px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: #555;
  position: relative;
  white-space: nowrap;
}

.option-tab-button:hover {
  background-color: #f9f9f9;
}

.option-tab-button.active {
  font-weight: 600;
  color: #1370E5;
}

.option-tab-button.active:after {
  content: '';
  position: absolute;
  bottom: 0px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: #1370E5;
}

/* Стили для предупреждений по дубликатам номеров очереди */
.order-warning {
  display: none;
  color: #e53935;
  font-size: 10px;
  margin-top: 4px;
  font-weight: 500;
}

.order-warning i {
  margin-right: 4px;
}

.duplicate-order {
  border-color: #e53935 !important;
  background-color: #fff0f0 !important;
}

/* Адаптивная верстка */
@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .control-buttons {
    grid-template-columns: 1fr;
  }
  
  .options-tabs {
    flex-wrap: wrap;
  }
  
  .action-buttons {
    flex-direction: column;
  }
}



/* Обертка для элементов с подсказками */
.user-tooltip-wrapper {
  position: relative;
  display: inline-block;
  /* Убираем cursor: pointer; чтобы не было указателя-пальца */
}

/* Стили для подсказок */
.user-tooltip-wrapper[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  white-space: nowrap;
  z-index: 1000;
  pointer-events: none;
  margin-top: 5px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.1s;
}

.user-tooltip-wrapper[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
}







/* Стили для управления столбцами клиентов */
.column-selection-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 10px;
  background-color: #f8f9fa;
  border-radius: 4px;
}

.selection-info {
  color: #6c757d;
  font-style: italic;
  margin-left: auto;
}

.columns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
  max-height: 500px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid #e9ecef;
  border-radius: 4px;
}

.column-checkbox-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background-color: #fff;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.column-checkbox-item:hover {
  background-color: #f8f9fa;
  border-color: #007bff;
}

.column-checkbox-item input[type="checkbox"] {
  margin-right: 8px;
  margin-top: 0;
}

.column-label {
  font-size: 14px;
  color: #333;
  user-select: none;
}

.column-checkbox-item input[type="checkbox"]:checked + .column-label {
  color: #007bff;
  font-weight: 500;
}






.delete-button {
  background-color: #dc3545;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
  height: 36px;
}

.delete-button:hover:not(:disabled) {
  background-color: #c82333;
}

.delete-button:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
  opacity: 0.6;
}

.delete-button i {
  font-size: 14px;
}






.custom-tooltip {
  position: absolute !important;
  background-color: rgba(0, 0, 0, 0.9) !important;
  color: white !important;
  padding: 8px 12px !important;
  border-radius: 6px !important;
  font-size: 11px !important;
  z-index: 10000 !important;
  pointer-events: none !important;
  max-width: 400px !important;
  word-wrap: break-word !important;
  white-space: normal !important;
  line-height: 1.4 !important;
  text-align: left !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: opacity 0.15s ease !important;
}

.custom-tooltip.show {
  opacity: 1 !important;
  visibility: visible !important;
}








/* Выделенные строки получают единый светло-синий фон, перезаписывая все остальные стили */
tbody tr.selected {
  background-color: #e8eeff !important;
  background-image: none !important;
}

/* Все ячейки выделенных строк (кроме первого столбца) получают светло-синий фон */
tbody tr.selected td:not(.sticky-col) {
  background-color: #e8eeff !important;
  background-image: none !important;
}

/* Первый столбец полностью исключаем из выделения - оставляем оригинальный цвет */
tbody tr.selected td.sticky-col {
  /* Не применяем никаких изменений фона к первому столбцу */
}





/* ===========================================
   СТИЛИ ДЛЯ СИСТЕМЫ ПЕРЕВЫКУПОВ
   =========================================== */

/* Основные стили для подстроки истории перевыкупа */
.rebuyback-history-row {
  background-color: #FFFFE6 !important;
  border-top: none !important;
}

/* Стили для ячеек подстроки истории */
.rebuyback-cell {
  background-color: #FFFFE6 !important;
  border-top: 1px dashed #ddd !important;
  padding: 6px !important;
  font-size: 9px !important;
  vertical-align: top !important;
}

/* Информация о продукте в колонке product_name */
.rebuyback-product-info {
  line-height: 1.2;
}

.rebuyback-label {
  margin-bottom: 8px;
  padding: 3px 6px;
  border-radius: 3px;
  font-weight: bold;
}

.rebuyback-label:last-child {
  margin-bottom: 0;
}

/* Значения в ячейках истории - только для НЕредактируемых полей */
.rebuyback-value:not(.editable-rebuyback) {
  color: #8b4513;
  font-weight: 500;
  padding: 3px 5px;
  margin-bottom: 6px;
  border-radius: 3px;
  word-break: break-word;
  line-height: 1.3;
}

.rebuyback-value:last-child {
  margin-bottom: 0;
}

/* Пустые значения */
.rebuyback-empty {
  color: #ccc;
  text-align: center;
  font-style: italic;
  padding: 3px;
}

/* Стили для модального окна перевыкупа */
.rebuyback-warning {
  background-color: #fff3cd;
  border: 1px solid #ffeaa7;
  color: #856404;
  padding: 12px;
  border-radius: 4px;
  margin-bottom: 15px;
  font-size: 12px;
}

.rebuyback-info {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  padding: 12px;
  border-radius: 4px;
  margin-bottom: 15px;
}

.rebuyback-info h4 {
  margin-top: 0;
  margin-bottom: 8px;
  color: #495057;
  font-size: 12px;
}

.rebuyback-info ul {
  margin: 0;
  padding-left: 20px;
  font-size: 11px;
  color: #6c757d;
}

.rebuyback-info li {
  margin-bottom: 4px;
}

/* Дополнительные стили для детальной истории перевыкупа */
.rebuyback-entry {
  margin-bottom: 8px;
  padding: 6px;
  background-color: #f8f9fa;
  border-radius: 3px;
  border-left: 3px solid #ffc107;
}

.rebuyback-entry-header {
  color: #856404;
  font-size: 10px;
  margin-bottom: 4px;
}

.rebuyback-entry-data {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 9px;
}

.rebuyback-entry-data span {
  background-color: #e9ecef;
  padding: 2px 4px;
  border-radius: 2px;
  white-space: nowrap;
}

.rebuyback-entry-data span strong {
  color: #495057;
}

/* Обеспечиваем правильное наследование фона для sticky столбцов */
tbody tr.rebuyback-history-row td.sticky-product,
tbody tr.rebuyback-history-row td.sticky-col {
  background-color: #FFFFE6 !important;
  z-index: 2;
}






/* Стили для модального окна отмены */
.cancel-warning {
    background-color: #ffeaa7;
    border-left: 4px solid #e17055;
    padding: 10px;
    margin: 15px 0;
    border-radius: 4px;
}

.cancel-orders-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    margin: 15px 0;
}

.cancel-order-item {
    display: flex;
    flex-direction: column;
    padding: 10px;
    border-bottom: 1px solid #eee;
    gap: 10px;
}

.cancel-order-item:last-child {
    border-bottom: none;
}

.order-info {
    flex: 1;
    min-width: 0;
}

.order-info strong {
    color: #2d3436;
    display: block;
    margin-bottom: 4px;
}

.reason-select {
    flex: 1;
}

.reason-select label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: #636e72;
}

.reason-select select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.reason-select select:focus {
    outline: none;
    border-color: #0984e3;
    box-shadow: 0 0 0 2px rgba(9, 132, 227, 0.2);
}

.comment-input {
    flex: 1;
}

.comment-input label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: #636e72;
}

.comment-input textarea {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
}

.comment-input textarea:focus {
    outline: none;
    border-color: #0984e3;
    box-shadow: 0 0 0 2px rgba(9, 132, 227, 0.2);
}


/* Стили для модального окна разделения заказа */
.split-warning {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 10px;
    margin: 15px 0;
    border-radius: 4px;
}

.split-order-info {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
    border: 1px solid #dee2e6;
}

.order-details {
    font-weight: 500;
    margin-bottom: 8px;
    color: #2d3436;
}

.quantity-info {
    color: #636e72;
    font-size: 14px;
}

.split-quantity-input {
    margin: 20px 0;
}

.split-quantity-input label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2d3436;
}

.split-quantity-input input {
    width: 100px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    text-align: center;
}

.split-quantity-input input:focus {
    outline: none;
    border-color: #0984e3;
    box-shadow: 0 0 0 2px rgba(9, 132, 227, 0.2);
}

.split-explanation {
    margin-top: 12px;
    padding: 12px;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    color: #856404;
    font-size: 14px;
    line-height: 1.4;
}





/* Стили для кнопок навигации с маленькими статичными бейджами в углу */
.nav-button-with-badge {
    position: relative !important;
}

.nav-badge-corner {
    position: absolute;
    top: -2px;
    right: -6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 7px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 1px 4px;
    border-radius: 6px;
    line-height: 1;
    min-width: 20px;
    height: 10px;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.nav-badge-corner.beta {
    background-color: #22c55e;
    color: white;
}

.nav-badge-corner.old {
    background-color: #94a3b8;
    color: white;
    opacity: 0.9;
}

.nav-badge-corner.new {
    background-color: #1370E5;
    color: white;
}

/* Стили для активных состояний (только цвет, без анимаций) */
header .nav-buttons a.active.nav-button-with-badge .nav-badge-corner.beta {
    background-color: #16a34a;
    border-color: #15803d;
}

header .nav-buttons a.active.nav-button-with-badge .nav-badge-corner.old {
    background-color: #64748b;
    border-color: #475569;
    opacity: 1;
}




/* Стили для DD25 внутри product_name */
.dd25-in-product {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  margin-top: 4px;
  color: #797979;
}

.dd25-in-product .dd25-label {
  white-space: nowrap;
}

/* Стили для SKU и product_option чипов */
.product-chip {
  background-color: #f9fafb;
  color: #344054;
  width: fit-content;
  border: 1px solid #c0c0c057;
  border-radius: 6px;
  padding: 2px 4px;
}


/* Анимированная пунктирная граница при копировании */
.copy-highlight {
  position: relative;
  overflow: hidden;
  border: none;
  padding: 6px;
  border-radius: 6px;
}

.copy-highlight::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(90deg, #4285f4 50%, transparent 50%),
    linear-gradient(90deg, #4285f4 50%, transparent 50%),
    linear-gradient(0deg, #4285f4 50%, transparent 50%),
    linear-gradient(0deg, #4285f4 50%, transparent 50%);
  background-size: 
    20px 2px,
    20px 2px,
    2px 20px,
    2px 20px;
  background-position: 
    0 0,
    0 100%,
    0 0,
    100% 0;
  background-repeat: 
    repeat-x,
    repeat-x,
    repeat-y,
    repeat-y;
  animation: dashRotate 0.5s linear infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes dashRotate {
  0% {
    background-position:
      0 0,        /* верх: вправо */
      20px 100%,  /* низ: влево */
      0 20px,     /* лево: вниз */
      100% 0;     /* право: вверх */
  }
  100% {
    background-position:
      20px 0,     /* верх: вправо */
      0 100%,     /* низ: влево */
      0 0,        /* лево: вниз */
      100% 20px;  /* право: вверх */
  }
}

/* ===== Slide Panel (above mass-actions) ===== */
.slide-panel {
  width: max-content;
  min-width: 300px;
  max-width: 100%;
  max-height: calc(100vh - 130px);
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Liquid Glass слои для slide-panel */
.slide-panel .liquidGlass-effect {
  position: absolute;
  z-index: 0;
  inset: 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  filter: url(#glass-distortion);
  overflow: hidden;
  border-radius: 24px;
}

.slide-panel .liquidGlass-tint {
  z-index: 1;
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 24px;
}

.slide-panel .liquidGlass-shine {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  border-radius: 24px;
  box-shadow: inset 2px 2px 1px 0 rgba(255, 255, 255, 0.5),
    inset -1px -1px 1px 1px rgba(255, 255, 255, 0.5);
}

.slide-panel-content {
  position: relative;
  z-index: 3;
  padding: 16px 20px;
  overflow-y: scroll;
  flex: 1;
}

.slide-panel-header {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.slide-panel-body {
  margin-bottom: 12px;
}

.slide-panel-body input[type="text"],
.slide-panel-body input[type="date"],
.slide-panel-body select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 12px;
}

.slide-panel-body input[type="text"]:focus,
.slide-panel-body input[type="date"]:focus,
.slide-panel-body select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.slide-panel-body-scroll {
  overflow-y: auto;
}

.slide-panel-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.slide-panel-actions button {
  margin-right: 0;
}

/* Cancel order item in slide panel */
.cancel-order-item {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.cancel-order-item:last-child {
  border-bottom: none;
}

.cancel-order-item .order-id-label {
  font-weight: 500;
  font-size: 11px;
  color: #333;
  margin-bottom: 4px;
}

.cancel-order-item select {
  margin-bottom: 4px;
}

.cancel-order-item input[type="text"] {
  font-size: 11px;
}

/* Compact cancel order item for slide panel */
.cancel-order-item-compact {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.cancel-order-item-compact:last-child {
  border-bottom: none;
}

.cancel-order-item-compact .order-info-line {
  font-size: 11px;
  color: #333;
}

.cancel-order-item-compact .order-info-line strong {
  color: #000;
}

.cancel-order-item-compact .order-reason-row select,
.cancel-order-item-compact .order-comment-row textarea {
  width: 100%;
  padding: 6px 8px;
  font-size: 11px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.cancel-order-item-compact .order-comment-row textarea {
  resize: none;
}

/* Split order compact styles */
.split-info-compact {
  font-size: 12px;
  margin-bottom: 10px;
}

.split-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.split-input-row label {
  font-weight: 500;
}

.split-input-row input[type="number"] {
  width: 60px;
  padding: 4px 6px;
  border: 1px solid #ddd;
  border-radius: 3px;
  text-align: center;
}

.split-input-row span {
  color: #666;
}

/* Slide down transition (panel slides down into mass-actions) */
.slide-down-enter-active,
.slide-down-leave-active {
  transition: all 0.25s ease;
}

.slide-down-enter-from,
.slide-down-leave-to {
  opacity: 0;
  transform: translateY(30px);
}

.slide-down-enter-to,
.slide-down-leave-from {
  opacity: 1;
  transform: translateY(0);
}

/* Ячейка assigned с разницей времени */
.assigned-cell {
  display: flex;
  flex-direction: column;
}

/* Разница времени выкупа */
.buyback-diff {
  font-size: 9px;
  white-space: nowrap;
  margin-top: 2px;
  color: #797979;
}

/* Моргающий красный для просроченных заказов (>24ч без выкупа) */
.blink-red {
  color: #dc3545;
  animation: blinkRed 1s ease-in-out infinite;
}

@keyframes blinkRed {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}