/*
 * SC_REG_0.10D42A — Admin visual regression corrections
 * Presentation-only overrides for the D40/D41/D42 admin experience.
 * No routes, identifiers, form behaviour, API calls or authentication logic.
 */

@keyframes nx-d42a-surface-fade {
  from { opacity: .86; }
  to { opacity: 1; }
}

/* Keep the white access card visually stable in light and dark theme modes. */

.admin-page.admin-locked .login-card input:not([type="checkbox"]):not([type="hidden"]),
.admin-page.admin-locked .login-card input:not([type="checkbox"]):not([type="hidden"]):hover {
  border-color: #c8d9d8 !important;
  background: #f4f8f8 !important;
  color: #173c3d !important;
  -webkit-text-fill-color: #173c3d !important;
  caret-color: #2f7475;
  box-shadow:
    inset 0 0 0 1000px #f4f8f8,
    0 1px 2px rgba(16, 24, 40, .04) !important;
}

.admin-page.admin-locked .login-card input:not([type="checkbox"]):not([type="hidden"])::placeholder {
  color: #5a7374 !important;
  -webkit-text-fill-color: #5a7374 !important;
  opacity: 1;
}

.admin-page.admin-locked .login-card input:not([type="checkbox"]):not([type="hidden"]):focus,
.admin-page.admin-locked .login-card input:not([type="checkbox"]):not([type="hidden"]):focus-visible {
  border-color: #397978 !important;
  outline: 0;
  background: #ffffff !important;
  color: #173c3d !important;
  -webkit-text-fill-color: #173c3d !important;
  box-shadow:
    inset 0 0 0 1000px #ffffff,
    0 0 0 3px rgba(57, 121, 120, .17) !important;
}

.admin-page.admin-locked .login-card input:-webkit-autofill,
.admin-page.admin-locked .login-card input:-webkit-autofill:hover,
.admin-page.admin-locked .login-card input:-webkit-autofill:focus,
.admin-page.admin-locked .login-card input:-webkit-autofill:active {
  border-color: #c8d9d8 !important;
  -webkit-box-shadow:
    0 0 0 1000px #f4f8f8 inset,
    0 1px 2px rgba(16, 24, 40, .04) !important;
  box-shadow:
    0 0 0 1000px #f4f8f8 inset,
    0 1px 2px rgba(16, 24, 40, .04) !important;
  -webkit-text-fill-color: #173c3d !important;
  caret-color: #2f7475;
}

.admin-page.admin-locked .login-otp-digit,
.admin-page.admin-locked .login-otp-digit:focus {
  transform: none !important;
  font-weight: 850;
}

/* Use one calm, readable navigation language in the dark event workspace. */

html[data-theme="dark"] .admin-page .workspace-nav-context strong,
html[data-theme="dark"] .admin-page .workspace-nav-item,
html[data-theme="dark"] .admin-page .workspace-nav-item:hover,
html[data-theme="dark"] .admin-page .workspace-nav-item.active {
  color: #f3f6f7;
}

html[data-theme="dark"] .admin-page .workspace-nav-context div span,
html[data-theme="dark"] .admin-page .workspace-nav-group > p {
  color: #c2ccd1;
}

html[data-theme="dark"] .admin-page .workspace-nav-icon img {
  opacity: .76;
  filter: brightness(0) invert(1);
}

html[data-theme="dark"] .admin-page .workspace-nav-item.active .workspace-nav-icon img,
html[data-theme="dark"] .admin-page .workspace-nav-item:hover .workspace-nav-icon img {
  opacity: 1;
}

html[data-theme="dark"] .nx-d42-enabled .admin-page .workspace-nav-item.active .workspace-nav-icon {
  border-color: rgba(114, 185, 186, .34);
  background: rgba(114, 185, 186, .13);
}

.nx-motion-enabled .admin-page .workspace-nav-item,
.nx-motion-enabled .admin-page .workspace-nav-item:hover {
  transform: none;
}

.nx-motion-enabled .admin-page .workspace-nav-item.active .workspace-nav-icon {
  animation: none !important;
}

.nx-motion-enabled .admin-page .workspace-nav-item.active::after {
  display: none !important;
}

/* A single opacity transition replaces competing panel/card transforms. */

.nx-d42-enabled .admin-page .workspace-panel.nx-d42-panel-enter,
.nx-motion-enabled .admin-page .workspace-panel.nx-view-enter,
.nx-motion-enabled .admin-page .modal-backdrop.nx-view-enter {
  animation: nx-d42a-surface-fade 160ms ease-out both !important;
}

.nx-motion-enabled .admin-page .workspace-panel :is(.panel, .status-panel).nx-reveal,
.nx-motion-enabled .admin-page .workspace-panel :is(.panel, .status-panel).nx-reveal.nx-visible,
.nx-motion-enabled .admin-page .modal-card.nx-reveal,
.nx-motion-enabled .admin-page .modal-card.nx-reveal.nx-visible {
  opacity: 1 !important;
  transform: none !important;
  transition: border-color 180ms ease, box-shadow 180ms ease !important;
}

/* Restore control-centre icons to the intended bottom-right anchor. */

.nx-motion-enabled .admin-page #module-grid .module-card > .module-icon {
  position: absolute !important;
  z-index: 3;
  right: 18px;
  bottom: 17px;
  width: 50px;
  height: 50px;
  margin: 0;
}

.nx-motion-enabled .admin-page #module-grid .module-icon::before {
  display: none;
}

.nx-motion-enabled .admin-page #module-grid .module-clickable:hover .module-icon {
  transform: translateY(-2px) scale(1.04);
}

/* Ratio graphics show data only: no centre dot and no decorative dot matrix. */

.nx-motion-enabled .admin-page .nx-metric-ratio i,
.nx-motion-enabled .admin-page .nx-metric-neutral {
  display: none !important;
}

.nx-motion-enabled .admin-page .nx-metric-percent {
  color: var(--ink) !important;
  font-size: 11.5px;
  font-weight: 850;
  letter-spacing: -.01em;
}

.nx-motion-enabled .admin-page .nx-metric-ratio {
  right: 14px;
  width: 52px;
  height: 52px;
}

.nx-motion-enabled .admin-page .nx-metric-ratio::after {
  width: 38px;
  height: 38px;
  border-color: color-mix(in srgb, var(--nx-metric-tone) 18%, var(--line));
  background: var(--surface-strong);
}

.nx-motion-enabled .admin-page :where(.metric, .metric-card, .summary-card)[data-nx-metric="true"]::after {
  opacity: .38;
}

.nx-motion-enabled .admin-page :where(.metric, .metric-card, .summary-card)[data-nx-metric="true"]:has(> .nx-metric-neutral) {
  padding-right: 16px !important;
}

.nx-motion-enabled .admin-page :where(.metric, .metric-card, .summary-card)[data-nx-metric="true"]:has(> .nx-metric-neutral)::after {
  opacity: .18;
}

@media (max-width: 980px) {
  html[data-theme="dark"] .admin-page .workspace-nav-group > p {
    color: #c2ccd1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nx-d42-enabled .admin-page .workspace-panel.nx-d42-panel-enter,
  .nx-motion-enabled .admin-page .workspace-panel.nx-view-enter,
  .nx-motion-enabled .admin-page .modal-backdrop.nx-view-enter {
    animation: none !important;
  }
}
