/* setting-setting.css?v=26 */

/* Импорт централизованных переменных */
@import url("variables.css?v=26");

/* 1. Глобальные стили */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

/* 3. Скрываем мобильные карточки по умолчанию */
.card-list {
  display: none;
}

/* 4. Выделение текста */
::selection {
  background: var(--color-accent-primary);
  color: var(--color-bg-primary);
}
::-moz-selection {
  background: var(--color-accent-primary);
  color: var(--color-bg-primary);
}

/* 5. Фон страницы и типографика */
html {
  background-color: var(--color-bg-primary);
}
body {
  color: var(--color-text-primary);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  align-items: center;
}

h1,
.page-title {
  text-align: center;
  margin: 20px 0;
  color: var(--color-text-primary);
  font-weight: 600;
}

h1 {
  font-size: 1.8rem;
}

/* 6. Поисковая панель */
.search-div {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 16px 0;
  padding: 0 16px;
}
.search-div input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--color-text-secondary);
  border-radius: 8px;
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  transition: border-color .2s, box-shadow .2s;
}
.search-div input:focus {
  outline: none;
  border-color: var(--color-accent-primary);
  box-shadow: var(--shadow-accent);
}
.search-div .button_search {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: var(--color-accent-primary);
  color: var(--color-bg-primary);
  cursor: pointer;
  font-size: 0.9rem;
}
.container {
  display: flex;
  flex-direction: column;
  align-items: center;
}
/* 7. Оформление формы */
form {
  width: 100%;
  max-width: 800px;
  margin: 0 auto 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
}
form label {
  width: 100%;
  max-width: 500px;
  font-size: 1.2rem;
  color: var(--color-text-primary);
}
form input.form_type,
form select {
  width: 100%;
  max-width: 500px;
  height: 40px;
  padding: 0 12px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-bg-secondary);
  border-radius: 8px;
  font-size: 1rem;
  color: var(--color-text-primary);
  transition: border-color .2s, box-shadow .2s;
}
form input.form_type:focus,
form select:focus {
  outline: none;
  border-color: var(--color-accent-primary);
  box-shadow: var(--shadow-accent);
}

.button_form {
  width: 100%;
  max-width: 300px;
  height: 40px;
  background: var(--color-accent-primary);
  border: 1px solid var(--color-accent-primary);
  border-radius: 8px;
  color: var(--color-bg-primary);
  font-size: 1rem;
  cursor: pointer;
  transition: background .2s;
}
.button_form:hover {
  background: var(--color-accent-primary);
}

/* 8. Таблица чекбоксов */
.table_checkbox {
  width: 100%;
  max-width: 500px;
  margin: 10px auto 20px;
  border-collapse: collapse;
}
.table_checkbox td {
  padding: 8px;
  border-bottom: 1px solid var(--color-bg-secondary);
  color: var(--color-text-primary);
}
.table_checkbox input[type="checkbox"] {
  accent-color: var(--color-accent-primary);
  cursor: pointer;
  width: 18px;
  height: 18px;
}

/* 9. Кнопки-иконки */
.icon-btn {
  width: 20px;
  height: 20px;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  transition: color .2s;
  margin: 0px;
}
.icon-btn i {
  font-size: 16px;
  color: var(--color-text-secondary);
}
.icon-btn:hover i {
  color: var(--color-accent-primary);
}

/* 10. Метки ролей */
.span_roles {
  display: inline-block;
  margin: 2px;
  padding: 4px 8px;
  background: var(--color-bg-primary);
  color: var(--color-text-secondary);
  border-radius: 8px;
  font-size: 0.875rem;
}

/* 11. Десктоп — таблица */
@media (min-width: 900px) {
  .card-list {
    display: none;
  }
  #data-table {
    display: table;
    width: calc(100% - 32px);
    margin: 0 auto 30px;
    border-collapse: collapse;
    table-layout: fixed;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border-primary);
    border-radius: 8px;
    overflow: hidden;
  }
  #data-table thead {
    background: var(--color-bg-header);
  }
  #data-table th,
  #data-table td {
    padding: 12px 16px;
    color: var(--color-text-primary);
    border-bottom: 1px solid var(--color-border-primary);
    border-right: 1px solid var(--color-border-primary);
    background: var(--color-bg-secondary);
    text-align: left;
  }
  #data-table th.th_filter {
    color: var(--color-text-secondary);
    cursor: pointer;
  }
  #data-table th:last-child,
  #data-table td:last-child {
    border-right: none;
  }
  #data-table tr:last-child td {
    border-bottom: none;
  }
  /* Ширины колонок */
  #data-table th:nth-child(1),
  #data-table td:nth-child(1) { width: 15%; }
  #data-table th:nth-child(2),
  #data-table td:nth-child(2) { width: 15%; }
  #data-table th:nth-child(3),
  #data-table td:nth-child(3) { width: 60%; }
  #data-table th:nth-child(4),
  #data-table td:nth-child(4) { width: 10%; }
  /* Действия не переносятся */
  td.update {
    white-space: nowrap;
  }
  .form_deleted {
    width: 20px;
    height: 20px;
    margin: 0;
    padding: 0;
  }
  .cpan_dell {
    display: flex;
    justify-content: space-around;
    height: 20px;
    width: 100%;
  }
  .icon-btn i {
    font-size: 20px;
  }
}

/* 12. Мобильная версия — карточки */
@media (max-width: 899px) {
  /* Скрываем десктопную таблицу */
  #data-table {
    display: none;
  }
  /* Контейнер иконок действий */
  .card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0 0;
  }
  /* Показываем карточки */
  .card-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 16px;
    margin-bottom: 20px;
    width: 100%;
  }
  .card-item {
    background: var(--color-bg-secondary);
    border-radius: 12px;
    box-shadow: var(--shadow-medium);
    padding: 12px;
    position: relative;
  }
  .card-item p {
    margin: 6px 0;
    font-size: 0.875rem;
    color: var(--color-text-primary);
  }
  .card-item p strong {
    font-weight: 600;
    margin-right: 8px;
  }
  .card-item p:last-child {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
  }
  .card-checkbox {
    position: absolute;
    top: 12px;
    right: 12px;
    accent-color: var(--color-accent-primary);
    width: 18px;
    height: 18px;
    cursor: pointer;
  }
  .form_deleted {
    width: 20px;
    height: 20px;
    margin: 0;
    padding: 0;
  }
  .cpan_dell {
    display: flex;
    justify-content: space-around;
  }
  .icon-btn i {
    font-size: 20px;
  }
}


/*  Desktop: стилизация таблиц rates */
@media (min-width: 900px) {
  .rates-table {
    display: table;
    width: calc(100% - 32px);
    margin: 0 auto 30px;
    border-collapse: collapse;
    table-layout: fixed;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border-primary);
    border-radius: 8px;
    overflow: hidden;
  }
  .rates-table thead {
    background: var(--color-bg-header);
  }
  .rates-table th,
  .rates-table td {
    padding: 12px 16px;
    color: var(--color-text-primary);
    border-bottom: 1px solid var(--color-border-primary);
    border-right: 1px solid var(--color-border-primary);
    background: var(--color-bg-secondary);
    text-align: left;
  }
  .rates-table th:last-child,
  .rates-table td:last-child {
    border-right: none;
  }
  .rates-table tr:last-child td {
    border-bottom: none;
  }
  /* если в ячейках есть кнопки действий */
  .rates-table td .icon-btn {
    margin: 0;
  }
}

/*  Mobile: оставляем как есть, или скрываем, если не нужно */
@media (max-width: 899px) {
  .rates-table {
    width: 100%;
    margin-bottom: 16px;
  }
}
