#employee-add-btn[hidden] {
  display: none;
}

.cert-shell {
  display: grid;
  gap: 20px;
}

.cert-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

/* Тулбар */
.cert-toolbar__controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

/* Фильтры */
.employee-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

@media (max-width: 600px) {
  .employee-filters {
    flex-direction: column;
    align-items: stretch;
  }
  .employee-filters .cert-filter__select {
    width: 100%;
  }
}

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 0 12px;
  min-height: 42px;
  background: var(--surface);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 184, 179, 0.12);
}

.search-field__icon {
  flex-shrink: 0;
  color: var(--text-muted);
}

.search-field__input {
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  width: 100%;
  min-height: 40px;
}

.search-field__input::placeholder {
  color: var(--text-muted);
}

.search-field__clear {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.search-field__clear:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-field__clear:hover {
  background: var(--line);
  color: var(--text);
}

.cert-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

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

.pagination__info {
  padding: 0 8px;
  font-size: 0.9rem;
  color: var(--text-soft);
}

.button--icon {
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  font-size: 0.8rem;
}

@media (max-width: 760px) {
  .cert-toolbar__controls {
    flex-wrap: wrap;
  }
  .search-field {
    width: 100%;
  }
  .cert-toolbar__actions {
    width: 100%;
    justify-content: flex-end;
  }

}

@media (max-width: 900px) {
  /* Адрес — самая широкая колонка, убираем первой */
  .data-table th:nth-child(9),
  .data-table td:nth-child(9) {
    display: none;
  }
}

@media (max-width: 820px) {
  .data-table th:nth-child(8),
  .data-table td:nth-child(8) {
    display: none;
  }
}

@media (max-width: 760px) {
  .data-table th:nth-child(6),
  .data-table td:nth-child(6) {
    display: none;
  }
}

@media (max-width: 680px) {
  .data-table th:nth-child(7),
  .data-table td:nth-child(7) {
    display: none;
  }
}

@media (max-width: 600px) {
  .data-table th:nth-child(3),
  .data-table td:nth-child(3) {
    display: none;
  }
}

@media (max-width: 520px) {
  .data-table th:nth-child(4),
  .data-table td:nth-child(4) {
    display: none;
  }
}

@media (max-width: 420px) {
  .data-table th:nth-child(2),
  .data-table td:nth-child(2) {
    display: none;
  }
}

body.employee-hide-private .employee-col-private {
  display: none;
}

.table-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.table-scroll::-webkit-scrollbar {
  height: 10px;
  -webkit-appearance: none;
}

.table-scroll::-webkit-scrollbar-track {
  background: var(--surface-soft, rgba(0, 0, 0, 0.04));
  border-radius: 5px;
}

.table-scroll::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.table-scroll.is-scrollable {
  cursor: grab;
}

.table-scroll.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.data-table__head {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-soft);
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
  user-select: none;
}

.data-table__head--sortable {
  cursor: pointer;
}

.data-table__head--sortable:hover {
  color: var(--accent);
}

.data-table__sort-icon::after {
  content: '⇅';
  display: inline-block;
  margin-left: 4px;
  opacity: 0.35;
}

.data-table__head--sort-asc .data-table__sort-icon::after {
  content: '↑';
  opacity: 1;
  color: var(--accent);
}

.data-table__head--sort-desc .data-table__sort-icon::after {
  content: '↓';
  opacity: 1;
  color: var(--accent);
}

.data-table__row {
  border-bottom: 1px solid var(--line);
  transition: background 120ms ease;
  cursor: pointer;
}

.data-table__row:last-child {
  border-bottom: none;
}

.data-table tbody .data-table__row:hover {
  background: var(--surface-soft);
}

.data-table__cell {
  padding: 12px 14px;
  font-size: 0.9rem;
  color: var(--text);
  vertical-align: middle;
}

.data-table__cell--name {
  color: var(--accent-ink);
  font-weight: 600;
}

.data-table__empty {
  text-align: center;
  color: var(--text-muted);
  padding: 32px 0;
}

/* Фильтр-селекты */
.cert-filter__select {
  padding: 0 28px 0 10px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font-main);
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238ca1b4' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
}

.cert-filter__select:hover,
.cert-filter__select:focus {
  border-color: var(--accent);
  color: var(--text);
  outline: none;
}

@media (max-width: 600px) {
  .cert-toolbar__controls {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 8px;
  }

  .search-field {
    width: 100%;
    flex: none;
  }

  .cert-toolbar__actions {
    width: 100%;
    justify-content: flex-end;
    flex-shrink: unset;
  }

  .cert-card__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .data-table__head,
  .data-table__cell {
    padding: 10px 10px;
  }

  .pagination {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .pagination__buttons {
    align-self: flex-end;
  }

  .button--icon {
    min-width: 30px;
    min-height: 30px;
    font-size: 0.75rem;
  }
}

/* Карточка сотрудника */
.employee-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.employee-card__title {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.35;
  color: var(--text, #0f2232);
}

.employee-card__list { margin: 0; }

.employee-card__item {
  display: flex;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line, #e2eaf0);
}

.employee-card__item:last-child { border-bottom: none; }

.employee-card__label {
  flex: 0 0 150px;
  margin: 0;
  color: var(--text-soft, #8898aa);
  font-size: 0.9rem;
}

.employee-card__value {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.95rem;
  color: var(--text, #0f2232);
  word-break: break-word;
}

.employee-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.employee-edit-btn { margin-top: 18px; }

/* Живой поиск в модалке добавления сотрудника */
.employee-add-results {
  margin: -4px 0 14px;
  border: 1px solid var(--line, #e2eaf0);
  border-radius: var(--radius-md, 12px);
  overflow: hidden;
  background: var(--surface, #fff);
  max-height: 240px;
  overflow-y: auto;
}

.employee-add-results__item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line, #e2eaf0);
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text, #0f2232);
}

.employee-add-results__item:last-child { border-bottom: none; }
.employee-add-results__item:hover { background: var(--bg, #f5f9fb); }

.employee-add-results__meta {
  margin-left: 6px;
  font-size: 0.8rem;
  color: var(--text-soft, #8898aa);
}

.employee-add-results__empty {
  padding: 14px;
  text-align: center;
  color: var(--text-soft, #8898aa);
  font-size: 0.88rem;
}

.employee-add-divider {
  text-align: center;
  color: var(--text-soft, #8898aa);
  font-size: 0.8rem;
  margin: 2px 0 14px;
}

/* Форма редактирования */
.employee-field { display: block; margin-bottom: 10px; }

.employee-field__label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-soft, #8898aa);
  margin-bottom: 4px;
}

.employee-field__input {
  width: 100%;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--line, #e2eaf0);
  border-radius: var(--radius-md, 12px);
  font: inherit;
  font-size: 0.95rem;
  background: var(--surface, #fff);
  color: var(--text, #0f2232);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.employee-field__input:focus {
  outline: none;
  border-color: var(--accent, #17b8b3);
  box-shadow: 0 0 0 3px rgba(23, 184, 179, 0.12);
}

.employee-field__select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%238898aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.employee-edit__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

@media (max-width: 480px) {
  .employee-card__item { flex-direction: column; gap: 4px; }
  .employee-card__label { flex: none; }
}