button:disabled { cursor: wait; opacity: .55; }
.door-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.door-actions .danger-action { grid-column: 1 / -1; }
.door-actions button:disabled { cursor: not-allowed; opacity: .45; }
.door-state.long-open { color: var(--warning); }
.door-state.blocked { color: var(--danger); }
select, textarea { font: inherit; color: var(--ink); }
select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfcfe;
  padding: 11px 13px;
  outline: none;
}
select:focus, textarea:focus { border-color: #7f8be3; box-shadow: 0 0 0 3px rgba(57,73,171,.1); background: #fff; }
.toolbar-actions, .dialog-actions { display: flex; align-items: center; gap: 10px; }
#employee-dialog { width: min(610px, calc(100% - 28px)); }
.dialog-actions { justify-content: flex-end; }
.totp-qr { display: grid; place-items: center; }
.totp-qr img { width: min(230px, 75vw); aspect-ratio: 1; padding: 10px; border: 1px solid var(--line); border-radius: 15px; background: #fff; image-rendering: pixelated; }
fieldset {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}
legend { padding: 0 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
.permission-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.option-check {
  min-height: 40px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8f9fc;
}
.option-check:hover { border-color: #aeb5e7; background: #fff; }
.key-list { display: grid; gap: 8px; }
.employee-group + .employee-group { border-top: 10px solid var(--bg); }
.employee-group-heading { display: flex; align-items: center; justify-content: space-between; padding: 11px 18px; background: #eef0f8; color: #303f9f; }
.employee-group-heading span { min-width: 27px; padding: 3px 8px; border-radius: 999px; background: #fff; text-align: center; font-size: 12px; font-weight: 800; }
.key-item {
  border: 1px solid var(--line);
  background: #f8f9fc;
  border-radius: 11px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  color: var(--ink);
}
.key-item span:first-child { display: flex; flex-direction: column; }
.key-item small { color: var(--muted); margin-top: 2px; }
.key-item > span:last-child { color: var(--brand); font-size: 12px; font-weight: 700; }
@media(max-width:760px) {
  .toolbar-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .toolbar-actions button { width: 100%; }
  .dialog-actions { flex-direction: column-reverse; align-items: stretch; }
  .permission-grid { grid-template-columns: 1fr; }
}

@media(max-width:420px) {
  .door-actions { grid-template-columns: 1fr; }
  .door-actions .danger-action { grid-column: auto; }
}

.fixed-value { display: flex; flex-direction: column; gap: 4px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; background: #f6f7fb; }
.fixed-value small { color: var(--muted); }
.copy-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.row-actions, .install-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.empty.compact { padding: 28px 20px; }
.install-prompt { position: fixed; z-index: 250; right: 18px; bottom: 18px; width: min(430px, calc(100% - 28px)); display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.install-prompt p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.register-login-link { margin-top: 16px; }

@media(max-width:760px) {
  .install-prompt { left: 14px; right: 14px; bottom: 82px; width: auto; flex-direction: column; align-items: stretch; }
  .install-actions { justify-content: flex-end; }
  .row-actions { justify-content: flex-end; }
}
