html.xhp-auth-locked body { overflow: hidden; }

.xhp-auth-gate {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  background:
    linear-gradient(rgba(37, 99, 235, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.07) 1px, transparent 1px),
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.22), transparent 34%),
    linear-gradient(135deg, #eef6ff 0%, #f8fbff 48%, #f7fafc 100%);
  box-sizing: border-box;
}

.xhp-auth-box,
.xhp-demo-account-box,
.xhp-modal-box {
  background: #fff;
  border: 1px solid #dbe7f5;
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.13);
  box-sizing: border-box;
}

.xhp-auth-box {
  width: min(420px, calc(100vw - 32px));
  padding: 24px 30px;
}

.xhp-auth-title {
  margin: 0 0 12px;
  color: #102033;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
}

.xhp-auth-hint {
  margin: 0 0 18px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.xhp-auth-box input,
.xhp-modal-box input {
  width: 100%;
  min-height: 38px;
  padding: 9px 12px;
  margin-bottom: 12px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #fff;
  color: #102033;
  font: inherit;
  box-sizing: border-box;
  outline: none;
}

.xhp-auth-box input:focus,
.xhp-modal-box input:focus {
  border-color: #4a69bd;
  box-shadow: 0 0 0 3px rgba(74, 105, 189, 0.12);
}

.xhp-auth-box button,
.xhp-modal-actions button {
  min-height: 36px;
  border: none;
  border-radius: 8px;
  padding: 9px 15px;
  font: inherit;
  cursor: pointer;
}

.xhp-auth-box button {
  width: 100%;
  background: linear-gradient(135deg, #4a69bd, #2f80ed);
  color: #fff;
  font-size: 15px;
}

.xhp-auth-feishu-btn {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #f8fbff !important;
  color: #334155 !important;
  border: 1px solid #dbe3ee !important;
  box-shadow: none;
}

.xhp-auth-feishu-logo,
.xhp-feishu-login-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
}

.xhp-auth-feishu-logo svg { width: 20px; height: 20px; display: block; }
.xhp-feishu-login-icon svg { width: 16px; height: 16px; display: block; }

.xhp-auth-error,
.xhp-modal-error {
  display: none;
  margin: 10px 0 0;
  color: #c0392b;
  font-size: 13px;
  text-align: center;
}

.xhp-auth-error.show,
.xhp-modal-error.show { display: block; }

.xhp-demo-account-box {
  width: min(420px, calc(100vw - 32px));
  padding: 12px 14px;
  color: #64748b;
  font-size: 12px;
}

.xhp-demo-account-title {
  margin-bottom: 4px;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 700;
}

.xhp-demo-account-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  white-space: nowrap;
}

.xhp-demo-account-row strong {
  color: #0f172a;
  font-weight: 600;
}

.xhp-app-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  background:
    linear-gradient(120deg, rgba(59, 130, 246, 0.2), transparent 45%),
    linear-gradient(135deg, #0f172a 0%, #1e3a8a 58%, #075985 100%);
  color: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
}

.xhp-app-header-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
  text-align: left;
}

.xhp-app-main-title {
  margin: 0;
  color: #f8fbff;
  font-size: 1.28rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
  text-align: left;
  width: auto;
}

.xhp-app-subtitle {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  color: rgba(219, 234, 254, 0.78);
  font-size: 0.75rem;
  text-align: left;
}

.xhp-app-subtitle svg {
  display: none;
}

.xhp-user-session-bar {
  display: none;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid rgba(191, 219, 254, 0.24);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
}

.xhp-user-display-name {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding-right: 6px;
  margin-right: 2px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
}

.xhp-user-session-btn {
  min-height: 30px;
  padding: 3px 9px;
  border: 1px solid rgba(191, 219, 254, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #e0f2fe;
  font: inherit;
  font-size: 11.5px;
  line-height: 1.5;
  cursor: pointer;
}

.xhp-user-session-btn:hover {
  background: rgba(14, 165, 233, 0.24);
  border-color: rgba(125, 211, 252, 0.58);
  color: #fff;
}

.xhp-modal {
  position: fixed;
  inset: 0;
  z-index: 10002;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.xhp-modal.show { display: flex; }
.xhp-modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.48); }

.xhp-modal-box {
  position: relative;
  width: min(520px, calc(100vw - 32px));
  max-height: min(82vh, 720px);
  overflow: auto;
  padding: 22px;
}

.xhp-modal-box.wide { width: min(760px, calc(100vw - 32px)); }

.xhp-modal-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.xhp-modal-heading-row h3,
.xhp-modal-box h3 {
  margin: 0;
  color: #102033;
  font-size: 18px;
}

.xhp-modal-hint {
  color: #64748b;
  font-size: 12px;
}

.xhp-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.xhp-modal-actions .primary { background: #4a69bd; color: #fff; }
.xhp-modal-actions .secondary { background: #e2e8f0; color: #334155; }

.xhp-admin-logs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.xhp-admin-logs-table th,
.xhp-admin-logs-table td {
  padding: 8px;
  border-bottom: 1px solid #eef2f7;
  text-align: center;
  vertical-align: middle;
}

.xhp-admin-wrap {
  max-height: min(55vh, 360px);
  overflow: auto;
  margin-top: 12px;
}

.xhp-admin-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: #64748b;
  font-size: 13px;
  flex-wrap: wrap;
}

.xhp-admin-pager button:disabled { opacity: 0.45; cursor: not-allowed; }
.xhp-admin-users-add { margin-top: 18px; padding-top: 16px; border-top: 1px solid #e2e8f0; }
.xhp-admin-users-add h4 { margin: 0 0 12px; color: #334155; font-size: 14px; }

.xhp-admin-user-del-btn {
  border: none;
  background: none;
  color: #e53e3e;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  padding: 2px 8px;
}

@media (max-width: 720px) {
  .xhp-app-header {
    align-items: stretch;
    flex-direction: column;
    padding: 14px 16px;
  }
  .xhp-user-session-bar {
    justify-content: flex-start;
  }
}
