/* --- ОБЁРТКА ВСЕГО БЛОКА: МЕНЮ + ТАБЛИЦА --- */
.dm-table-container {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
  overflow-x: auto;
}

/* --- МЕНЮ СЛЕВА --- */
.dm-sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 140px;
  position: sticky;
  top: 80px;
  align-self: flex-start;
  background: #fafafa;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.dm-type-menu-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dm-type-menu-form button {
  padding: 6px 10px;
  width: 100%;
  background-color: #2c2c2c;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s ease;
  text-align: center;
}

.dm-type-menu-form button:hover {
  background-color: #f0f0f0;
}

.dm-type-menu-form button.active {
  background-color: #0073aa;
  color: white;
  border-color: #0073aa;
}

/* --- ОБЁРТКА ТАБЛИЦЫ --- */
.spedytor-table-wrapper {
  flex-grow: 1;
  overflow: auto;
  border: 1px solid #ccc;
  -webkit-overflow-scrolling: touch;
}

/* --- ТАБЛИЦА --- */
.dm-table-container .spedytor-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-family: Arial, sans-serif;
  font-size: 12px;
}

.dm-table-container .spedytor-table th,
.dm-table-container .spedytor-table td {
  padding: 4px;
  font-size: 12px;
  border: 1px solid #ddd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
  min-width: 60px;
  text-align: left;
  background-color: inherit;
}

.dm-table-container .spedytor-table th {
  background-color: #444;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 3;
}

.spedytor-table th:first-child,
.spedytor-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background-color: #f9f9f9;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
}

.spedytor-table thead th:first-child {
  z-index: 4;
  background-color: #444;
  color: #fff;
}

/* --- ЧЕРЕДОВАНИЕ СТРОК --- */
.spedytor-table tbody tr:nth-child(odd) {
  background-color: #f0f0f0;
}

.spedytor-table tbody tr:nth-child(even) {
  background-color: #fff;
}

.spedytor-table tbody tr:hover td {
  background-color: #ffe6ea;
  box-shadow: inset 0 1px 0 #cc0033, inset 0 -1px 0 #cc0033;
  transition: background-color 0.05s ease, box-shadow 0.05s ease;
}

.spedytor-table tbody tr.unprocessed td,
.spedytor-table tbody tr.unprocessed td a {
  color: #4b4949;
}

/* --- КНОПКА УДАЛЕНИЯ --- */
.spedytor-table .dm-delete-btn {
  padding: 2px 4px;
  font-size: 12px;
  line-height: 1;
  border: 1px solid #aaa;
  background-color: #f8d7da;
  color: #a00;
  border-radius: 4px;
  cursor: pointer;
}

.spedytor-table .dm-delete-btn:hover {
  background-color: #f1b0b7;
}

/* --- ФИЛЬТР ФОРМА --- */
.dm-filter-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.dm-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
}

.dm-filter-form select,
.dm-filter-form input[type="submit"] {
  padding: 6px 10px;
  font-size: 14px;
}

.dm-filter-button {
  background-color: #0073aa;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}

.dm-filter-button:hover {
  background-color: #005f8d;
}

/* --- ФОРМА ДОБАВЛЕНИЯ --- */
#dm-form-container {
  max-width: 600px;
  margin: 0 auto;
}

.dm-form-scroll {
  max-height: 500px;
  overflow-y: auto;
  border: 1px solid #ccc;
  padding: 10px;
  margin: 15px 0;
  background: #fafafa;
}

#dm-add-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#dm-add-form input,
#dm-add-form select,
#dm-add-form button {
  padding: 8px;
  font-size: 1em;
  border: 1px solid #aaa;
  border-radius: 4px;
}

#dm-add-form button {
  background-color: #0073aa;
  color: #fff;
  cursor: pointer;
  border: none;
}

#dm-add-form button:hover {
  background-color: #005f8d;
}

.dm-success {
  color: green;
  margin-top: 10px;
}

/* --- МОДАЛЬНОЕ ОКНО --- */
.dm-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
}

.dm-modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 20px;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}


.dm-close {
  position: absolute;
  top: 10px;
  right: 16px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.dm-close:hover {
  color: red;
}

th.sortable {
  cursor: pointer;
}

th.sortable.asc::after {
  content: " ▲";
}

th.sortable.desc::after {
  content: " ▼";
}


/* --- АДАПТИВНОСТЬ --- */
@media (max-width: 768px) {
  .dm-table-container {
    flex-direction: column;
  }

  .dm-sidebar-menu {
    position: static;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 15px;
    border: none;
    padding: 0;
  }

  .dm-type-menu-form {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .dm-type-menu-form button {
    min-width: 60px;
    font-size: 12px;
    padding: 4px 6px;
  }

  .spedytor-table-wrapper {
    max-height: none;
    overflow-x: auto;
    width: 100%;
  }

  .spedytor-table {
    font-size: 10px;
  }

  .spedytor-table th,
  .spedytor-table td {
    padding: 3px 2px;
    min-width: 40px;
    max-width: 100px;
  }
}

.spedytor-table tbody tr.unprocessed td {
  color: #A52A2A !important;
  opacity: 0.5;
}



.dm-inline-input {
    width: 96%;
    padding: 2px 4px;
    font-size: 14px;
    border: 1px solid #888;
    border-radius: 4px;
}
.dm-editable {
    cursor: pointer;
}
.dm-editable:hover {
    background: #eef6ff !important;
}

/* ✅ Выровнять сумму по правому краю */
.spedytor-table td[data-field="amount"] {
    text-align: right !important;
    padding-right: 10px;
}

/* ===== Заголовок задач ===== */
.dm-tasks-title {
    margin: 0 0 10px 0 !important;
    padding: 0 !important;
    font-size: 28px !important;
    font-weight: 700 !important;
}

/* ===== Таблица задач ===== */
.dm-tasks-table {
    width: 100% !important;
    max-width: 900px !important;        /* ⇐ реально широкая таблица */
    margin: 5px 0 0 0 !important;
    border-collapse: collapse !important;
    background: #fff !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15) !important;
    font-family: Arial, sans-serif !important;
}

/* Узкие строки */
.dm-tasks-table tr {
    height: 34px !important;
}

/* Полосы */
.dm-tasks-table tr:nth-child(even) {
    background: #f3f3f3 !important;
}

/* Ячейки */
.dm-tasks-table td {
    padding: 6px 12px !important;
    font-size: 14px !important;
    border-bottom: 1px solid #ddd !important;
}

/* Последняя строка */
.dm-tasks-table tr:last-child td {
    border-bottom: none !important;
}

/* Левая колонка (текст) */
.dm-tasks-table td:first-child {
    width: 82% !important;
    font-weight: 600 !important;
}

/* Правая колонка (чекбокс) */
.dm-tasks-table td:last-child {
    width: 18% !important;
    text-align: center !important;
}

/* Чекбокс */
.dm-task-check {
    width: 22px !important;
    height: 22px !important;
    transform: scale(1.1) !important;
    cursor: pointer !important;
    accent-color: #007bff !important;
}

/* Hover строки */
.dm-tasks-table tr:hover {
    background: #e4f0ff !important;
}

