.ui-open { overflow: hidden; }
.ui-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(4px);
}
.ui-dialog {
  width: min(460px, 100%);
  overflow: hidden;
  border: 1px solid #dfe6f1;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.34);
  animation: ui-in 0.15s ease-out;
}
@keyframes ui-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.ui-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid #eef2f8;
}
.ui-title { font-size: 17px; font-weight: 800; color: #172033; }
.ui-close {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #f1f5fb;
  color: #64748b;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.ui-close:hover { background: #e5ecf8; color: #172033; }
.ui-form { margin: 0; }
.ui-body { display: grid; gap: 14px; padding: 20px; }
.ui-message { color: #475569; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.ui-field { display: grid; gap: 6px; }
.ui-field > span { color: #64748b; font-size: 13px; }
.ui-field input {
  width: 100%;
  border: 1px solid #dbe3ef;
  border-radius: 9px;
  padding: 10px 12px;
  background: #fff;
  color: #172033;
  font: inherit;
}
.ui-field input:focus {
  outline: 3px solid #d7e5ff;
  border-color: #2768d9;
}
.ui-error { min-height: 18px; color: #c0392b; font-size: 12px; }
.ui-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid #eef2f8;
  background: #f8fafd;
}
.ui-btn {
  min-width: 84px;
  border: 0;
  border-radius: 9px;
  padding: 9px 15px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.ui-btn-cancel { background: #e8eef7; color: #334155; }
.ui-btn-cancel:hover { background: #dde6f3; }
.ui-btn-primary { background: #2768d9; color: #fff; }
.ui-btn-primary:hover { background: #1f57b9; }
.ui-btn-danger { background: #c0392b; color: #fff; }
.ui-btn-danger:hover { background: #a93226; }
.ui-btn:disabled { opacity: 0.6; cursor: default; }
.ui-copy-row { display: flex; gap: 8px; align-items: stretch; }
.ui-copy-row .ui-copy-input {
  flex: 1;
  min-width: 0;
  border: 1px solid #dbe3ef;
  border-radius: 9px;
  padding: 10px 12px;
  background: #f8fafd;
  color: #172033;
  font: 13px/1.5 Consolas, "Microsoft YaHei", monospace;
}
.ui-copy-row .ui-btn { min-width: 100px; white-space: nowrap; }
.tenant-tools { display: flex; gap: 8px; align-items: center; }
.pager { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; color: #64748b; font-size: 13px; }
.pager button { padding: 7px 11px; font-size: 12px; }
.pager button:disabled { opacity: 0.45; cursor: default; }
.pager select { padding: 7px 9px; border: 1px solid #dbe3ef; border-radius: 7px; background: #fff; }
.impersonation-banner { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 16px; background: #fff7ed; border-bottom: 1px solid #fed7aa; color: #9a3412; font-size: 13px; }
.impersonation-banner button { padding: 5px 10px; border: 1px solid #fdba74; border-radius: 7px; background: #fff; color: #9a3412; font-size: 12px; cursor: pointer; }
.tenant-batch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; margin-bottom: 10px; border: 1px solid #e3e9f2; border-radius: 9px; background: #f8fafd; font-size: 13px; }
.tenant-batch span { color: #64748b; }
.tenant-batch select { padding: 7px 9px; border: 1px solid #dbe3ef; border-radius: 7px; background: #fff; }
.tenant-batch button { padding: 7px 10px; border: 0; border-radius: 7px; background: #e8eef7; color: #334155; font-size: 12px; font-weight: 700; cursor: pointer; }
.tenant-batch button.danger { background: #c0392b; color: #fff; }
.tenant-select { display: inline-flex; align-items: center; margin-right: 8px; vertical-align: middle; }
#tdDelete { background: #c0392b; color: #fff; border: 0; border-radius: 7px; padding: 7px 10px; font-weight: 700; cursor: pointer; }
.admin-form { display: grid; gap: 12px; }
.admin-form > label { display: grid; gap: 6px; color: #64748b; font-size: 13px; }
.admin-form input, .admin-form select {
  width: 100%;
  border: 1px solid #dbe3ef;
  border-radius: 9px;
  padding: 9px 11px;
  background: #fff;
  color: #172033;
  font: inherit;
}
.admin-form input:focus, .admin-form select:focus { outline: 3px solid #d7e5ff; border-color: #2768d9; }
.admin-form .model-check { display: flex; grid-template-columns: none; align-items: center; gap: 8px; color: #334155; }
.admin-form .model-check input { width: auto; }
.admin-form .ui-actions { margin: 2px -20px -20px; }
.panel .admin-form .ui-actions { margin: 0; padding: 0; border: 0; background: transparent; justify-content: flex-start; }
.model-meta { display: block; color: #718096; font-size: 12px; margin-top: 4px; }
.model-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-form textarea {
  width: 100%;
  border: 1px solid #dbe3ef;
  border-radius: 9px;
  padding: 9px 11px;
  background: #fff;
  color: #172033;
  font: inherit;
  resize: vertical;
}
.admin-form textarea:focus { outline: 3px solid #d7e5ff; border-color: #2768d9; }
.config-checklist { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.config-quick { display: flex; flex-wrap: wrap; gap: 10px; }
.config-quick button { background: #e8eef7; color: #334155; }
.check-item { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid #e3e9f2; border-radius: 10px; background: #fbfdff; }
.check-item .check-dot { width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; flex: none; }
.check-item.done .check-dot { background: #21a66f; }
.check-item .check-text { flex: 1; min-width: 0; }
.check-item b { display: block; font-size: 13px; }
.check-item small { display: block; color: #718096; font-size: 12px; margin-top: 2px; }
.check-item button { padding: 6px 10px; font-size: 12px; }
@media (max-width: 760px) { .config-checklist { grid-template-columns: 1fr; } }
