    body { font-family: Arial, sans-serif; margin: 40px; background: #f9f9f9; }
    .top-buttons { margin-bottom: 20px; display: flex; flex-direction: column; gap: 10px; }
    .top-buttons button { padding: 10px 16px; background: #28a745; color: white; border: none; border-radius: 6px; cursor: pointer; text-align: left; }
    .top-buttons button:hover { background: #218838; }
    .back-btn { padding: 8px 16px; background: #007bff; color: white; border: none; border-radius: 6px; cursor: pointer; margin-bottom: 20px; }
    .back-btn:hover { background: #0056b3; }
    #api-result { display: inline-block; margin-left: 20px; font-weight: bold; font-size: 18px; }
    .login-box, .users-box { max-width: 400px; padding: 20px; background: #fff; border-radius: 12px; box-shadow: 0 2px 6px rgba(0,0,0,0.1); }
    .login-box h2, .users-box h2 { margin-top: 0; }
    label { display: block; margin: 10px 0 5px; }
    input { width: 100px; padding: 8px; margin-bottom: 15px; border: 1px solid #ccc; border-radius: 6px; }
    button.login-btn { width: 100%; padding: 10px; background: #007bff; font-size: 16px; }
    button.login-btn:hover { background: #0056b3; }
    .error { color: red; margin-top: -10px; margin-bottom: 10px; }
    ul { list-style: none; padding: 0; }
    li { background: #f0f0f0; margin: 5px 0; padding: 8px; border-radius: 6px; }
	ul { list-style: none; padding-left: 20px; }
    .tree-node { cursor: pointer; color: #007bff; font-weight: bold; }
    .tree-node:hover { text-decoration: underline; }
    input[type="text"] { width: 100px; padding: 4px; border: 1px solid #ccc; border-radius: 4px; }
	table.users-table {
	  width: 100%;
	  border-collapse: collapse;
	  margin-top: 10px;
	}

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

	table.users-table th {
	  background: #f0f0f0;
	}

	table.users-table input[type="text"],
	table.users-table input[type="password"],
	table.users-table select {
	  width: 90%; /* чтобы не наезжало на соседний столбец */
	  padding: 4px;
	  box-sizing: border-box;
	}

	table.users-table td:last-child {
	  width: 120px; /* столбец Действия */
	}
	#new-password, #new-username, #new-role {
	  width: 120px; /* или 150px по желанию */
	  padding: 4px;
	  margin-right: 8px;
	  box-sizing: border-box;
	}
.add-user-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.add-user-form input {
  flex: 1;
  min-width: 120px;
  padding: 6px 10px;
  font-size: 14px;
}

.add-user-form button {
  padding: 7px 15px;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s ease;
}

.add-user-form button:hover {
  background: #45a049;
}
}

.users-table button.delete-btn {
  padding: 4px 8px;       /* уменьшаем padding */
  font-size: 12px;        /* уменьшаем шрифт */
  background: #dc3545;    /* красная кнопка */
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;    /* текст не переносится */
}

.users-table button.delete-btn:hover {
  background: #c82333;
}

table.users-table td,
table.users-table th {
  vertical-align: middle; /* выравниваем содержимое по центру */
}

table.users-table input[type="password"] {
  padding: 4px 6px;
  box-sizing: border-box;
  height: 28px;       /* одинаковая высота со строкой */
}

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  width: 350px;
}
.modal-actions {
  margin-top: 10px;
  text-align: right;
}
.modal-actions button {
  margin-left: 10px;
}


.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 15px 0;
}

.search-form input {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  min-width: 150px;
  font-size: 14px;
}

.search-form button {
  padding: 7px 15px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.search-form button:hover {
  background: #0056b3;
}


.modal-overlay {
    position: fixed;
    left: 0; top: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-window {
    background: white;
    padding: 20px;
    border-radius: 5px;
    width: 420px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-window input {
    width: 100%;
    margin-bottom: 10px;
}

.edit-btn {
    cursor: pointer;
    background: #007BFF;
    color: white;
    border: none;
    padding: 2px 5px;
    border-radius: 4px;
}

.edit-btn:hover { background: #0056c0; }




/* ================== Стили для таблицы клиентов ================== */

.clients-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.clients-table th,
.clients-table td {
  border: 1px solid #bbb;
  padding: 8px;
  text-align: left;
  vertical-align: middle;
}

.clients-table th {
  background: #e0e0e0;
  cursor: pointer;
}

.clients-table th:hover {
  background: #d0d0d0;
}

.clients-table td input[type="text"],
.clients-table td input[type="password"],
.clients-table td select {
  width: 90%;
  padding: 4px;
  box-sizing: border-box;
}

.clients-table td:last-child {
  width: 120px;
}

.clients-table button.edit-btn {
  cursor: pointer;
  background: #007BFF;
  color: white;
  border: none;
  padding: 4px 6px;
  border-radius: 4px;
}

.clients-table button.edit-btn:hover {
  background: #0056c0;
}

.clients-table button.delete-btn {
  padding: 4px 8px;
  font-size: 12px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}

.clients-table button.delete-btn:hover {
  background: #c82333;
}

/* Пагинация */
#clients-pagination {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

#clients-pagination button {
  padding: 6px 12px;
  border: none;
  border-radius: 5px;
  background: #007bff;
  color: white;
  cursor: pointer;
}

#clients-pagination button:disabled {
  background: #bbb;
  cursor: default;
}

#clients-pagination span {
  font-weight: bold;
}


/* Фиксированная ширина столбца Status */
.clients-table th:nth-child(2),
.clients-table td:nth-child(2) {
    min-width: 100px;       /* минимальная ширина столбца */
    width: auto;            /* автоматически подстраивается под содержимое */
    white-space: normal;    /* перенос строк, чтобы весь текст был виден */
}


/* Фиксированная ширина столбца Contractor */
/* Столбец Contractor — показываем весь текст */
.clients-table th:nth-child(4),
.clients-table td:nth-child(4) {
    min-width: 400px;       /* минимальная ширина столбца */
    width: auto;            /* автоматически подстраивается под содержимое */
    white-space: normal;    /* перенос строк, чтобы весь текст был виден */
}


.clients-table {
    border-collapse: collapse;
    width: 100%;
    border: 1px solid #000; /* рамка таблицы 1px */
}

.clients-table th,
.clients-table td {
    border: 1px solid #000; /* базовая граница */
	padding-top: 2px;
    padding-bottom: 2px;
    line-height: 1.0;  /* уменьшает высоту строки */
}

/* увеличенная линия между строками */
.clients-table tr {
    border-bottom: 2px solid #000;
}

.clients-table th {
    font-family: arial;
    font-size: 8pt;
}


/* === Выравнивание высоты полей и кнопок поиска под кнопку "Назад" === */

.search-form input,
.search-form select,
.search-form button {
    height: 36px;                 /* одинаковая высота */
    padding: 8px 12px;            /* как у back-btn */
    font-size: 14px;
    border-radius: 6px;
    box-sizing: border-box;
}

/* Чтобы кнопки были визуально одинаковы с "Назад" */
.search-form button {
    padding: 8px 16px;            /* как у back-btn */
    display: flex;
    align-items: center;
}



/* ================== Стили для таблицы сотрудников ================== */
/* Общие стили таблицы */
.employees-table {
    border: 1px solid black;       /* рамка таблицы */
    border-collapse: collapse;
}

.employees-table th,
.employees-table td {
    border: 2px solid black;       /* линии между ячейками толще */
    padding: 4px;
}

/* Настройка ширины столбцов */
.employees-table th:nth-child(2),
.employees-table td:nth-child(2) { /* id - уменьшено вдвое */
    min-width: 40px;
    width: auto;
}

.employees-table th:nth-child(3),
.employees-table td:nth-child(3) { /* fio - уменьшено на треть */
    min-width: 266px;
    width: auto;
    white-space: normal;
}

.employees-table th:nth-child(4),
.employees-table td:nth-child(4), /* phone */
.employees-table th:nth-child(5),
.employees-table td:nth-child(5)  /* phone2 */ {
    min-width: 120px; /* помещается номер без переноса */
    white-space: nowrap;
}

.employees-table th:nth-child(11),
.employees-table td:nth-child(11), /* sberbank_number */
.employees-table th:nth-child(12),
.employees-table td:nth-child(12), /* sberbank_name */
.employees-table th:nth-child(16),
.employees-table td:nth-child(16)  /* comment */ {
    min-width: 400px; /* увеличено вдвое */
    width: auto;
    white-space: normal;
}
