/* Canonical loaders. z-index sits above the sidebar and below native dialogs.
   Boot overlay is above modals only while the application is starting.
   Page and button loaders stay inside the shell. */
:root {
  color-scheme: only light;
  --hr-z-sidebar: 40;
  --hr-z-page-loader: 5;
  --hr-z-modal: 1000;
  --hr-z-app-loader: 1150;
  --hr-z-toast: 1100;
}

html,
body {
  background: var(--ui-page-bg, #f9fafb);
}

.hr-app-loader {
  position: fixed;
  inset: 0;
  z-index: var(--hr-z-app-loader);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom));
  background: var(--ui-page-bg, #f9fafb);
  color: #111827;
  opacity: 1;
  visibility: visible;
  transition: opacity 180ms ease, visibility 0s linear 180ms;
}

.hr-app-loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.hr-app-loader__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  max-width: 360px;
}

.hr-app-loader__mark {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1b61d1;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.hr-app-loader__name {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.hr-app-loader__text,
.hr-app-loader__phase {
  margin: 0;
}

.hr-app-loader__phase {
  color: #4b5563;
  font-size: 14px;
}

.hr-app-loader__ring,
.hr-inline-loader,
.hr-page-loader__ring,
.ui-btn.is-loading::after {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(27, 97, 209, 0.2);
  border-top-color: #1b61d1;
  border-radius: 50%;
  animation: hr-spin 0.8s linear infinite;
}

.ui-btn.is-loading::after {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

.hr-app-loader__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

#page-mount.is-loading {
  position: relative;
  min-height: 160px;
}

.hr-page-loader {
  position: absolute;
  inset: 0;
  z-index: var(--hr-z-page-loader);
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--ui-page-bg, #f9fafb) 88%, transparent);
}

.hr-inline-loader {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-width: 2px;
  vertical-align: middle;
}

.hr-slow-note {
  margin: 8px 0 0;
  color: #4b5563;
  font-size: 13px;
}

#hr-issue-dialog.ui-modal-overlay {
  z-index: 1160;
  overflow: auto;
  align-items: flex-start;
}

#hr-issue-dialog[hidden] {
  display: none;
}

.hr-issue-drop {
  border: 1px dashed var(--ui-border, #d1d5db);
  border-radius: var(--ui-radius-md, 12px);
  padding: 12px;
  text-align: center;
}

.hr-issue-drop.is-hot {
  border-color: var(--ui-primary, #1b61d1);
}

.ui-table-wrap:has(.hr-help-table) {
  overflow-x: auto;
}

.hr-help-table {
  width: 100%;
  min-width: 720px;
}

@keyframes hr-spin {
  to { transform: rotate(360deg); }
}

@keyframes ui-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .hr-app-loader,
  .hr-app-loader__ring,
  .hr-inline-loader,
  .hr-page-loader__ring,
  .ui-btn.is-loading::after {
    animation: none;
    transition: none;
  }
}
