/* === Общие стили === */
body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", sans-serif;
  background-color: #f4f6f9;
  color: #333;
}

h1, h2, h3 {
  margin-top: 0;
}

a {
  color: #3498db;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* === Боковое меню === */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 190px;
  height: 100vh;
  background-color: #2c3e50;
  color: white;
  padding: 15px;
  font-size: 13.5px;
  box-shadow: 2px 0 5px rgba(0,0,0,0.1);
  overflow-y: auto;
}

.sidebar h3 {
  font-size: 16px;
  margin-bottom: 12px;
}

/* Информация о пользователе */
.sidebar .user-info {
  background: rgba(255, 255, 255, 0.1);
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 15px;
  text-align: center;
}

.sidebar .user-name {
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 3px;
}

.sidebar .user-role {
  font-size: 11px;
  color: #bdc3c7;
  text-transform: uppercase;
}

/* Разделители меню */
.sidebar .menu-separator {
  color: #7f8c8d;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  margin: 15px 0 8px 0;
  padding: 0 5px;
  border-bottom: 1px solid #34495e;
  padding-bottom: 5px;
}

.sidebar ul {
  list-style: none;
  padding: 0;
}

.sidebar li {
  margin-bottom: 8px;
}

.sidebar li a {
  color: #ecf0f1;
  display: block;
  padding: 5px 8px;
  font-size: 13.5px;
  line-height: 1.3;
  border-radius: 4px;
  transition: background 0.2s;
}

.sidebar li a:hover,
.sidebar li a.active {
  background-color: #1abc9c;
  font-weight: bold;
}

.sidebar li.toggleable > a::after {
  content: " ▾";
  float: right;
  font-size: 12px;
  margin-left: 4px;
}
.sidebar li.toggleable.open > a::after {
  content: " ▴";
}
.sidebar ul.submenu {
  display: none;
  padding-left: 12px;
  margin-top: 4px;
  list-style: none;
}
.sidebar li.toggleable.open > ul.submenu {
  display: block;
}
.sidebar .alert-count {
  color: red;
  font-weight: bold;
  font-size: 12px;
  margin-left: 4px;
}

/* === Контент справа от меню === */
.content,
.main-content {
  margin-left: 220px;
  padding: 30px;
  min-height: 100vh;
  box-sizing: border-box;
}

.content {
  max-width: 1200px;
  border-left: 1px solid #e1e1e1;
}

.main-content {
  width: calc(100% - 220px);
  background: #f8f9fa;
}

/* === Контейнеры для современных страниц === */
.pricing-container,
.warehouse-container,
.upload-container,
.stats-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0;
}

/* === Заголовки страниц === */
.pricing-header,
.warehouse-header,
.upload-header,
.stats-header {
  margin: -30px -30px 30px -30px;
  padding: 25px 30px;
  border-radius: 0;
}

/* === Карточки === */
.stat-card,
.info-card,
.form-box {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  overflow: hidden;
}

/* === Вкладки === */
.tabs-container {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  overflow: hidden;
}

/* === Элементы форм === */
label {
  display: inline-block;
  margin-bottom: 6px;
  font-weight: 500;
}

select,
input[type="text"],
input[type="number"],
textarea {
  padding: 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-bottom: 12px;
  font-size: 14px;
  box-sizing: border-box;
}

textarea {
  width: 100%;
  resize: vertical;
}

/* === Кнопки === */
button,
.btn {
  background-color: #3498db;
  border: none;
  color: white;
  padding: 8px 14px;
  font-size: 14px;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 5px;
  margin-right: 5px;
  transition: background 0.2s;
}
button:hover,
.btn:hover {
  background-color: #2980b9;
}

.btn-green {
  color: green;
  font-weight: bold;
  background: none;
  border: none;
  cursor: pointer;
}

.btn-red {
  color: red;
  font-weight: bold;
  background: none;
  border: none;
  cursor: pointer;
}

/* === Таблицы === */
.styled-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 14px;
  background-color: #fff;
  border: 1px solid #ddd;
}
.styled-table th,
.styled-table td {
  border: 1px solid #ccc;
  padding: 8px 12px;
  text-align: left;
}
.styled-table th {
  background-color: #f4f4f4;
}
.styled-table td a {
  color: #2c3e50;
  text-decoration: underline;
  word-break: break-word;
}
.styled-table td a:hover {
  color: #1a252f;
}

/* === Поисковая форма и пагинация === */
.search-form {
  margin: 20px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.search-input {
  padding: 8px;
  width: 250px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.pagination {
  margin-top: 20px;
}
.pagination a {
  margin-right: 8px;
  color: #3498db;
  text-decoration: none;
}
.pagination strong {
  margin-right: 8px;
}

/* === Мультизагрузка (карточки) === */
.row {
  background: #fff;
  border: 1px solid #ddd;
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 8px;
  max-width: 100%;
  overflow-x: auto;
}

.row strong {
  display: block;
  font-size: 16px;
  margin-bottom: 10px;
}

.row-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 15px;
  width: 100%;
}

.row-fields select,
.row-fields input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.drag-handle {
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.drag-handle i {
  font-size: 20px;
  color: #7f8c8d;
  cursor: grab;
  padding: 0 6px;
}
.drag-handle:hover i {
  color: #2c3e50;
}

.sortable-ghost {
  background-color: #ecf0f1;
  opacity: 0.7;
  border: 2px dashed #3498db;
  transition: all 0.2s ease;
}

/* === Select2 фиксированная ширина === */
.select2-container {
  width: 100% !important;
}

/* === Блок весов === */
.weights-container {
  margin-top: 10px;
  padding: 10px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  max-width: 400px;
}

.weights-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #ddd;
  padding-bottom: 6px;
  margin-bottom: 8px;
  font-weight: bold;
  color: #2c3e50;
}

.weight-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px dotted #eee;
  font-size: 15px;
}
.weight-row:last-child {
  border-bottom: none;
}
.no-price {
  color: #888;
  font-style: italic;
}

/* === Прочее оформление === */
.success {
  color: #27ae60;
  margin-top: 10px;
}
.error {
  color: #c0392b;
  margin-top: 10px;
}

.stats p {
  margin: 6px 0;
}

.stats-box {
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 8px rgba(0,0,0,0.05);
  line-height: 1.6;
  font-size: 16px;
}

.info-block {
  white-space: pre-wrap;
  font-size: 13.5px;
  line-height: 1.4;
  max-width: 320px;
}

.nowrap {
  white-space: nowrap;
  font-size: 13px;
  color: #555;
}

.center {
  text-align: center;
}

.issued-to-others {
  background-color: #fff3cd;
  color: #333;
}

/* === Статусы заказов === */
.status-paid {
  color: green;
  font-weight: bold;
}
.status-failed {
  color: red;
  font-weight: bold;
}
.status-coupon {
  color: #e67e22;
  font-weight: bold;
}
.status-issued-me {
  color: green;
  font-weight: bold;
  font-size: 13px;
}
.status-issued-other {
  color: #888;
  font-size: 13px;
  font-style: italic;
}

/* === Адаптивность === */
@media (max-width: 768px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
  }

  .content,
  .main-content {
    margin-left: 0;
    padding: 15px;
    width: 100%;
    max-width: 100%;
    border-left: none;
  }

  .row-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-input {
    width: 100%;
  }

  .styled-table th,
  .styled-table td {
    font-size: 13px;
    padding: 6px;
  }

  /* === Адаптивные контейнеры === */
  .pricing-container,
  .warehouse-container,
  .upload-container,
  .stats-container {
    padding: 0;
  }

  .pricing-header,
  .warehouse-header,
  .upload-header,
  .stats-header {
    margin: -15px -15px 20px -15px;
    padding: 20px 15px;
  }
}
