/* Shared form dialogs; tenant detail keeps its separate drawer geometry. */
dialog:not(.detail-drawer) {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
  padding: 0;
  border: 1px solid var(--edge);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 24px 80px #17233930;
  overflow: auto;
}
dialog::backdrop { background: #1b29454d; }
#admin-dialog { width: min(560px, calc(100vw - 32px)); }
.dialog-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 22px 26px; border-bottom: 1px solid var(--edge);
}
.dialog-head h3 { margin: 0; font-size: 20px; line-height: 1.4; font-weight: 600; }
.dialog-head button {
  display: grid; place-items: center; flex: 0 0 32px;
  width: 32px; height: 32px; padding: 0; border: 0;
  border-radius: 6px; background: #f3f5f8; color: #728098; font-size: 22px;
}
.dialog-head button:hover { background: var(--soft); color: var(--brand); }
.form-section { padding: 22px 26px; border-bottom: 1px solid var(--edge); }
.form-section h4 { margin: 0 0 18px; font-size: 14px; font-weight: 600; }
.form-section p { font-size: 13px; color: var(--muted); line-height: 1.7; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.form-grid label { min-width: 0; font-size: 13px; font-weight: 500; line-height: 1.5; }
.form-grid input, .form-grid select {
  display: block; width: 100%; min-width: 0; height: 42px;
  margin-top: 8px; border: 1px solid #dfe5ee; border-radius: 6px;
  padding: 0 12px; background: #fff; color: var(--ink); font-weight: 400;
}
.form-grid input:focus, .form-grid select:focus { border-color: var(--brand); }
.form-grid input:disabled { color: #7f8b9f; background: #f5f7fa; }
.form-grid small { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.6; }
.form-grid select[multiple] { height: 124px; padding: 6px; }
.form-grid select[multiple] option { padding: 8px 10px; border-radius: 4px; }
.span-2 { grid-column: 1 / -1; }
.dialog-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 18px 26px; background: #f8fafc;
  border-top: 1px solid var(--edge);
}
.dialog-actions > button {
  min-width: 82px; height: 40px; min-height: 40px; padding: 0 18px;
  border: 1px solid #dfe5ee; border-radius: 6px; background: #fff; color: #4d5c73;
}
.dialog-actions .primary { color: #fff; background: var(--brand); border-color: var(--brand); }
form > .form-error { margin: 0; padding: 12px 26px; }
form > .form-error:empty { display: none; }
.actions { display: flex; align-items: center; gap: 6px; }
.actions button, [data-admin-edit] { border: 0; border-radius: 5px; background: var(--soft); padding: 7px 10px; color: var(--brand); }
.actions .danger { color: #b64d4d; background: #fff1f1; }
.boundary .secondary { margin-top: 14px; }
@media (max-width: 600px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .span-2 { grid-column: auto; }
  .dialog-head, .form-section, .dialog-actions { padding-left: 20px; padding-right: 20px; }
  dialog:not(.detail-drawer) { max-height: calc(100dvh - 24px); }
}
.tenant-creating{display:inline-flex;align-items:center;gap:7px;color:#3268dc;font-weight:600;white-space:nowrap}.tenant-creating i{width:13px;height:13px;border:2px solid #dce7fd;border-top-color:#3268dc;border-radius:50%;animation:tenant-spin .8s linear infinite}tr[data-creating]{background:#f7faff}.tenant-create-failed{color:#b33f3f;font-weight:600}@keyframes tenant-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.tenant-creating i{animation:none;border-top-color:#3268dc}}
