:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  background: #f6f8f7;
  color: #202b2d;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; }

button, input, select { font: inherit; }

button { cursor: pointer; }

button:disabled { cursor: wait; opacity: .65; }

a { color: #245b73; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-header {
  background: #fff;
  border-bottom: 1px solid #dce3e1;
}

.app-header__inner, .main-content {
  width: min(1240px, calc(100% - 48px));
  margin-inline: auto;
}

.app-header__inner {
  min-height: 66px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.header-actions { display: flex; align-items: center; gap: 20px; }
.header-signout { padding: 5px 0; border: 0; background: none; color: #245b73; font-size: 13px; }
.header-signout:hover { text-decoration: underline; }

.app-title { display: flex; align-items: center; gap: 12px; min-width: 0; }

.app-title__mark {
  display: block;
  width: 18px;
  height: 18px;
  flex: none;
  border: 5px solid #29775f;
  border-radius: 4px;
  box-shadow: 8px 0 0 -3px #e49c5a;
}

.app-title h1 { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.3; }

.service-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #5d6b6d;
  font-size: 13px;
  white-space: nowrap;
}

.service-status__dot { width: 7px; height: 7px; border-radius: 50%; background: #aeb8b7; }
.service-status--active .service-status__dot { background: #278565; }
.service-status--inactive .service-status__dot { background: #c3524d; }

.main-content { padding: 34px 0 80px; }

.login-layout { width: min(420px, calc(100% - 40px)); margin: 72px auto; }
.login-layout h2 { margin: 0 0 24px; font-size: 25px; line-height: 1.25; }
.login-form { display: grid; gap: 18px; }
.login-field { display: grid; gap: 7px; color: #334447; font-size: 14px; font-weight: 600; }
.login-field input { width: 100%; height: 44px; padding: 9px 12px; border: 1px solid #cbd6d3; border-radius: 6px; background: #fff; color: #202b2d; }
.login-field input:focus { outline: none; border-color: #28765e; box-shadow: 0 0 0 3px #d8eee5; }
.login-form .button { min-height: 44px; }
.login-error { margin: 0; color: #a33431; font-size: 14px; }

.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.page-heading h2 { margin: 0 0 4px; font-size: 26px; line-height: 1.2; font-weight: 700; }
.page-heading__count { margin: 0; color: #6e7b7c; font-size: 14px; }

.button {
  min-height: 38px;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .15s, border-color .15s;
}

.button--primary { background: #246b55; color: #fff; }
.button--primary:hover:not(:disabled) { background: #195840; }
.button--secondary { background: #fff; color: #334447; border-color: #cbd6d3; }
.button--secondary:hover:not(:disabled) { background: #f2f5f4; }
.button--danger { background: #b2443e; color: #fff; }
.button--danger:hover:not(:disabled) { background: #92342f; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  margin-top: 28px;
  margin-bottom: 14px;
}

.search-field { width: min(360px, 100%); }
.status-filter select { height: 40px; min-width: 150px; padding: 8px 10px; border: 1px solid #cbd6d3; border-radius: 6px; background: #fff; color: #334447; }
.search-field input {
  width: 100%;
  height: 40px;
  padding: 9px 13px;
  border: 1px solid #cbd6d3;
  border-radius: 6px;
  background: #fff;
  color: #202b2d;
  outline: none;
}

.search-field input:focus, .field input:focus {
  border-color: #28765e;
  box-shadow: 0 0 0 3px #d8eee5;
}

.search-field input::placeholder, .field input::placeholder { color: #8a9898; }
.toolbar__result { color: #748284; font-size: 13px; }
.toolbar__result { margin-left: auto; }

.room-list { border-top: 1px solid #dce3e1; }
.room-list__head, .room-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 90px 110px 130px 260px;
  align-items: center;
  column-gap: 18px;
}

.room-list__head {
  min-height: 40px;
  color: #788588;
  font-size: 12px;
  font-weight: 600;
}

.room-list__head span:last-child { text-align: right; }

.room-row {
  min-height: 70px;
  padding: 12px 0;
  border-top: 1px solid #e2e8e6;
  background: transparent;
}

.room-row__name { min-width: 0; color: #243135; font-size: 14px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.room-row__id, .room-row__checked { color: #697779; font-size: 13px; }
.room-row__status { font-size: 12px; font-weight: 600; color: #68787a; }
.room-row__status--started { color: #207452; }
.room-row__status--closed { color: #64717a; }
.room-row__actions { display: flex; justify-content: flex-end; align-items: center; gap: 4px; }
.room-row__actions a, .room-row__actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 6px;
  border: 0;
  border-radius: 4px;
  background: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}

.room-row__actions button { color: #28765e; }
.room-row__actions .room-row__delete { color: #a54640; }
.room-row__actions button:hover, .room-row__actions a:hover { background: #e9f0ed; text-decoration: underline; }
.room-row__actions button:focus-visible, .room-row__actions a:focus-visible { outline: 2px solid #28765e; outline-offset: 2px; }
.room-row--disabled { opacity: .63; }

.empty-state { margin: 42px 0; color: #697779; font-size: 14px; text-align: center; }
.list-error { margin: 16px 0; padding: 10px 14px; border: 1px solid #eac6c2; border-radius: 6px; background: #fff3f1; color: #9c3f3a; font-size: 14px; }

.dialog {
  width: min(540px, calc(100% - 28px));
  max-height: calc(100vh - 36px);
  padding: 0;
  border: 1px solid #d0d9d7;
  border-radius: 8px;
  box-shadow: 0 20px 60px #20362f33;
  color: #243135;
}

.dialog--small { width: min(440px, calc(100% - 28px)); }
.dialog::backdrop { background: #15252388; }
.dialog__heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 24px 15px; border-bottom: 1px solid #e2e8e6; }
.dialog__heading h2 { margin: 0; font-size: 19px; line-height: 1.3; }
.dialog__close { width: 30px; height: 30px; flex: none; border: 0; border-radius: 4px; background: transparent; color: #68797b; font-size: 26px; line-height: 1; }
.dialog__close:hover { background: #f0f4f2; }
.dialog__body { display: grid; gap: 18px; padding: 22px 24px 12px; }
.dialog__message { margin: 0; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.field { display: grid; gap: 7px; min-width: 0; font-size: 13px; font-weight: 600; }
.field input { width: 100%; height: 42px; padding: 9px 11px; border: 1px solid #cbd6d3; border-radius: 6px; outline: none; color: #243135; background: #fff; font-size: 14px; font-weight: 400; }
.field input[type="url"] { font-size: 13px; }
.form-error { margin: -5px 0 0; color: #ad4540; font-size: 13px; line-height: 1.4; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 9px; padding: 16px 24px 22px; }

.toast { position: fixed; right: 24px; bottom: 24px; max-width: min(380px, calc(100% - 48px)); padding: 12px 16px; border: 1px solid #b9dacd; border-radius: 6px; background: #eaf7f0; color: #23533e; box-shadow: 0 8px 24px #233a2a1a; font-size: 14px; z-index: 20; }

@media (max-width: 780px) {
  .app-header__inner, .main-content { width: min(100% - 28px, 680px); }
  .app-header__inner { min-height: 60px; }
  .main-content { padding-top: 28px; }
  .page-heading h2 { font-size: 23px; }
  .room-list__head { display: none; }
  .room-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; padding: 16px 0; }
  .room-row__name { grid-column: 1 / -1; }
  .room-row__id { grid-column: 1; }
  .room-row__status { grid-column: 1; }
  .room-row__checked { grid-column: 1; }
  .room-row__actions { grid-column: 2; grid-row: 2 / 5; align-self: center; flex-wrap: wrap; gap: 8px 12px; max-width: 175px; }
}

@media (max-width: 520px) {
  .app-header__inner { align-items: flex-start; flex-direction: column; justify-content: center; gap: 5px; padding: 12px 0; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 17px; }
  .page-heading .button { width: 100%; }
  .toolbar { align-items: flex-start; flex-direction: column; gap: 8px; margin-top: 24px; }
  .search-field { width: 100%; }
  .status-filter { width: 100%; }
  .status-filter select { width: 100%; }
  .room-row__actions { grid-column: 1 / -1; grid-row: auto; justify-content: flex-start; max-width: none; margin-top: 5px; }
  .dialog__heading { padding-inline: 18px; }
  .dialog__body { padding-inline: 18px; }
  .dialog__actions { padding-inline: 18px; }
}
