* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Arial, sans-serif;
  background: #c2dccb;
  color: #1f2a23;
}

.app {
  width: 100%;
  max-width: 600px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px;
}

.app-header {
  margin-bottom: 16px;
}

/* Строка с кнопкой входа и заголовком */

.title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.auth-panel {
  position: relative;
  flex: 0 0 auto;
  margin: 0;
}

.login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: auto;
  min-height: 40px;
  padding: 0 18px;

  border: 0;
  border-radius: 10px;

  background: #4f8a62;
  color: #ffffff;

  font-size: 16px;
  font-weight: 500;

  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.login-button:active {
  background: #437754;
}

/* Форма входа */

.login-form {
  position: absolute;
  z-index: 10;

  margin-top: 10px;

  display: flex;
  flex-direction: column;
  gap: 10px;

  width: 280px;
  padding: 14px;

  border-radius: 12px;

  background: rgba(255, 255, 255, 0.96);

  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.login-form[hidden] {
  display: none;
}

.login-form input {
  width: 100%;
  min-height: 48px;

  padding: 0 14px;

  border: 1px solid #9fc2aa;
  border-radius: 10px;

  background: #ffffff;
  color: #1f2a23;

  font-size: 17px;
  outline: none;
}

.login-form input:focus {
  border-color: #5f9270;
}

.login-submit,
.login-cancel {
  min-height: 46px;

  border: 0;
  border-radius: 10px;

  font-size: 16px;

  cursor: pointer;
  touch-action: manipulation;
}

.login-submit {
  background: #4f8a62;
  color: #ffffff;
}

.login-cancel {
  background: #e5e5e5;
  color: #555555;
}

.login-message {
  min-height: 20px;

  font-size: 14px;
  line-height: 1.4;
}

/* Заголовок */

.app-header h1 {
  margin: 0;

  font-size: 24px;
  line-height: 1.2;
}

/* Поиск */

.search-wrapper {
  position: relative;
  width: 100%;
}

#cabinet-search {
  width: 100%;
  min-height: 50px;

  padding: 0 50px 0 16px;

  border: 1px solid #9fc2aa;
  border-radius: 12px;

  background: #ffffff;
  color: #1f2a23;

  font-size: 18px;
  outline: none;

  -webkit-appearance: none;
  appearance: none;
}

#cabinet-search:focus {
  border-color: #5f9270;
}

#cabinet-search::placeholder {
  color: #819087;
}

/* Кнопка очистки поиска */

.clear-search {
  position: absolute;
  top: 50%;
  right: 7px;

  width: 40px;
  height: 40px;

  transform: translateY(-50%);

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;

  border: 0;
  border-radius: 50%;

  background: transparent;
  color: #68766d;

  font-size: 28px;
  line-height: 1;

  cursor: pointer;
  touch-action: manipulation;

  -webkit-tap-highlight-color: transparent;
}

.clear-search:hover {
  background: #edf4ef;
}

.clear-search:active {
  background: #e2ece5;
}

/* Список кабинетов */

.cabinet-list {
  max-height: calc(100vh - 145px);

  overflow-y: auto;

  border-radius: 14px;

  background: rgba(255, 255, 255, 0.3);

  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.cabinet-row {
  min-height: 56px;

  padding: 0 16px;

  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;

  border-bottom: 1px solid rgba(80, 110, 90, 0.12);

  background: #c2dccb;
  color: #1f2a23;

  cursor: pointer;
  touch-action: manipulation;

  transition:
    background-color 0.15s ease,
    color 0.15s ease;

  -webkit-tap-highlight-color: transparent;
}

.cabinet-row:first-child {
  border-radius: 14px 14px 0 0;
}

.cabinet-row:last-child {
  border-bottom: 0;
  border-radius: 0 0 14px 14px;
}

.cabinet-number {
  font-size: 19px;
  font-weight: 500;
}

.cabinet-row input[type="checkbox"] {
  width: 24px;
  height: 24px;

  margin: 0;

  cursor: pointer;
  touch-action: manipulation;

  accent-color: #4f8a62;
}

/* Дата, время и диспетчер */

.cabinet-meta {
  min-width: 0;

  overflow: hidden;

  color: #8b968f;

  font-size: 13px;
  font-weight: 400;

  text-align: left;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Ключ отсутствует — строка светлая */

.cabinet-row--inactive {
  background: #ffffff;
  color: #1f2a23;
}

.cabinet-row--inactive .cabinet-number {
  color: #1f2a23;
}

.cabinet-row--inactive .cabinet-meta {
  color: #8b968f;
}

/* Мобильные устройства */

@media (max-width: 420px) {
  .app {
    padding: 12px;
  }

  .title-row {
    gap: 8px;
  }

  .login-button {
    min-height: 38px;
    padding: 0 14px;
    font-size: 15px;
  }

  .app-header h1 {
    font-size: 21px;
  }

  .cabinet-row {
    min-height: 54px;
    padding: 0 14px;
    column-gap: 8px;
  }

  .cabinet-meta {
    font-size: 11px;
  }
}

/* Более широкие экраны */

@media (min-width: 601px) {
  .app {
    padding-top: 24px;
  }

  .cabinet-list {
    max-height: calc(100vh - 160px);
  }
}

/* Дополнительный фильтр */

#show-key-only {
  width: 22px;
  height: 22px;
  margin: 0 0 0 auto;

  cursor: pointer;
  touch-action: manipulation;

  accent-color: #4f8a62;
}

.site-link {
  color: inherit;
  text-decoration: none;
}

.site-link:hover {
  text-decoration: underline;
}

.title-star {
  color: #d4af37;
  font-size: 1em;
  margin-left: 4px;
}