/* ========================================
   КОМПОНЕНТЫ: КНОПКИ
   ======================================== */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-add { background: #2ecc71; color: white; }
.btn-edit { background: #f39c12; color: white; }
.btn-delete { background: #e74c3c; color: white; }
.btn-save { background: #2ecc71; color: white; }
.btn-cancel { background: #95a5a6; color: white; }

/* Кнопка экспорта в Excel — тот же стиль что у .btn */
.btn-export-excel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  background: #27ae60;
  color: white;
  border: none;
  border-radius: 4px;
  font: inherit;
  font-size: 14px;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
  gap: 6px;
}

.btn-export-excel:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.btn-view {
  padding: 8px 16px;
  border: 1px solid #ddd;
  background: #f8f9fa;
  cursor: pointer;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s;
}

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

.btn-view.active {
  background: #f1c40f;
  color: white;
  border-color: #f1c40f;
}

.btn-archive {
  background: #95a5a6;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-archive:hover {
  background: #7f8c8d;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* ========================================
   КОМПОНЕНТЫ: ТАБЛИЦЫ
   ======================================== */
.table-container {
  flex: 1;
  overflow: auto;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: white;
  margin-bottom: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 15px;
  text-align: left;
  white-space: nowrap;
}

th {
  background-color: #f1c40f;
  color: #2c3e50;
  position: sticky;
  top: 0;
  z-index: 10;
  transition: background-color 0.2s ease;
}

th:hover {
  background-color: #e0af0d;
  cursor: pointer;
}

tr.selected {
  background-color: #fff9c4 !important;
}

tr:hover:not(.selected) {
  background-color: #f9f9f9;
}

/* ========================================
   КОМПОНЕНТЫ: ФОРМЫ И SELECT
   ======================================== */
.edit-input {
  padding: 6px;
  border: 1px solid #f1c40f;
  border-radius: 3px;
  width: 100%;
}

/* Кастомный комбобокс */
.custom-select {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 100%;
}

.select-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  min-height: 36px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.arrow {
  transition: transform 0.2s;
  color: #7f8c8d;
  font-size: 14px;
  flex-shrink: 0;
  margin-left: 10px;
}

.select-header.active .arrow {
  transform: rotate(-180deg);
}

.select-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: auto;
  width: 100%;
  background: white;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  margin-top: -1px;
  display: none;
}

.select-search {
  padding: 6px;
  border-bottom: 1px solid #eee;
}

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

.options-list {
  max-height: 200px;
  overflow-y: auto;
}

.option {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.option:hover {
  background: #f9f9f9;
}

.option.selected {
  background: #e3f2fd;
  color: #1976d2;
}

/* ========================================
   КОМПОНЕНТЫ: КАЛЕНДАРЬ
   ======================================== */
.date-picker {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  padding: 12px;
  margin-top: 4px;
  min-width: 280px;
}

.custom-date-picker {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 200px;
}

.custom-date-picker input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  background: white;
}

.date-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-weight: bold;
  color: #2c3e50;
}

.date-picker-nav {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.date-picker-nav:hover {
  background: #f1f1f1;
}

.date-picker table {
  width: 100%;
  border-collapse: collapse;
}

.date-picker th,
.date-picker td {
  padding: 6px;
  text-align: center;
  font-size: 14px;
}

.date-picker th {
  color: #7f8c8d;
  font-weight: normal;
}

.date-picker td {
  cursor: pointer;
  border-radius: 4px;
}

.date-picker td:hover:not(.disabled) {
  background: #f1c40f;
  color: white;
}

.date-picker td.selected {
  background: #3498db;
  color: white;
}

.date-picker td.disabled {
  color: #ccc;
  cursor: default;
}

/* ========================================
   КОМПОНЕНТЫ: ОБЩИЕ БЛОКИ
   ======================================== */
.filters,
.add-form,
.reports-list,
.objects-list {
  background: white;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Action-panel — кнопки в строку */
.action-panel {
  background: white;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* Кнопка-назад (отдельный блок) */
.back-navigation {
  background: white;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.back-btn {
  background: #95a5a6;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  font-size: 14px;
}

.back-btn:hover {
  background: #7f8c8d;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.top-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.filters h3 {
  margin-bottom: 10px;
}

/* ========================================
   КОМПОНЕНТЫ: ЭЛЕМЕНТЫ СДАЧИ ПРОДУКЦИИ
   ======================================== */
.delivery-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.current-done {
  font-weight: bold;
  color: #27ae60;
  min-width: 40px;
  text-align: right;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 4px;
}

.qty-btn {
  width: 24px;
  height: 24px;
  border: 1px solid #ccc;
  background: white;
  cursor: pointer;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.qty-btn:hover {
  background: #f1c40f;
  transform: scale(1.1);
}

.qty-input {
  width: 50px;
  padding: 4px;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 3px;
}

.save-btn {
  background: #2ecc71;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.save-btn:hover {
  background: #27ae60;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(46, 204, 113, 0.3);
}

/* ========================================
   КОМПОНЕНТЫ: ВСПОМОГАТЕЛЬНЫЕ
   ======================================== */
.top-section {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.view-toggle {
  background: white;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  display: flex;
  justify-content: flex-start;
}

.toggle-buttons {
  display: flex;
  gap: 12px;
}
