body {
  font-family: Arial, sans-serif;
  margin: 20px;
  background-color: #fafafa;
  color: #333;
}

h1 {
  text-align: center;
  margin-bottom: 20px;
}

input#searchInput {
  width: 100%;
  max-width: 400px;
  padding: 10px;
  margin: 0 auto 20px;
  display: block;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

table {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  border-collapse: collapse;
  background: white;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

th, td {
  padding: 12px 15px;
  border-bottom: 1px solid #ddd;
  vertical-align: middle;
  text-align: left;
}

td img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto;
}

tr:hover {
  background-color: #f1f1f1;
  cursor: pointer;
}

.department-row td {
  background-color: #e0e0e0;
  font-weight: bold;
  font-size: 1.1em;
  padding: 10px;
  text-align: left;
}

/* Модален прозорец */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.5);
}

.modal-content {
  background-color: #fff;
  margin: 8% auto;
  padding: 25px 30px;
  border-radius: 10px;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  text-align: left;
  overflow-y: auto;
  max-height: 75vh;
  font-size: 16px;
  line-height: 1.6;
  color: #333;
}

.modal-content img {
  display: block;
  margin: 0 auto 20px auto;
  width: 130px;
  height: 130px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.modal-content h2 {
  text-align: center;
  margin-bottom: 15px;
  font-weight: 700;
  font-size: 1.8em;
  color: #222;
}

.modal-content h3 {
  margin-top: 20px;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 1.2em;
  color: #444;
  border-bottom: 1px solid #ddd;
  padding-bottom: 4px;
}

.modal-content p {
  margin-bottom: 15px;
  word-wrap: break-word;
}

/* Респонсив */
@media (max-width: 600px) {
  table, thead, tbody, th, td, tr {
    display: block;
  }
  thead tr {
    display: none;
  }
  tr {
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 10px;
  }
  td {
    padding-left: 50%;
    position: relative;
    border: none;
    border-bottom: 1px solid #eee;
    text-align: left;
  }
  td::before {
    position: absolute;
    top: 12px;
    left: 15px;
    width: 45%;
    white-space: nowrap;
    font-weight: bold;
    color: #555;
  }
  td:nth-of-type(1)::before { content: ""; }
  td:nth-of-type(2)::before { content: "Титла и Имена"; }
  td:nth-of-type(3)::before { content: "Отделение"; }
}
