/* Theme switch — rules needed in BOTH themes (loaded on every page by erpThemeHead(),
   config/theme.php). They used to sit in erp-dark-base.css, but the dark stylesheet is
   only loaded for dark pages since the 2026-11-02 speed work, so light pages lost them
   (moon AND sun showed in the toggle). Dark-only variants stay in erp-dark-base.css. */
@media screen {
  /* ---------- theme toggle button ---------- */
  .erp-theme-toggle {
    position: relative;
    overflow: hidden;
  }

  .erp-theme-toggle i {
    position: absolute;
    left: 50%;
    top: 50%;
    transition:
      transform 0.45s cubic-bezier(0.34, 1.4, 0.64, 1),
      opacity 0.25s ease;
  }

  .erp-theme-toggle .erp-theme-ic-moon {
    transform: translate(-50%, -50%) rotate(0deg);
    opacity: 1;
  }

  .erp-theme-toggle .erp-theme-ic-sun {
    transform: translate(-50%, 150%) rotate(-90deg);
    opacity: 0;
    color: #fbbf24;
  }

  /* Sign-in pages: the toggle floats at the top right. */
  .auth-theme-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 50;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    cursor: pointer;
  }

  /* theme switch is instant: every transition is suspended for one frame, so
     nothing (sidebar, cards, page) lags behind and fades in late */
  html.erp-theme-switching *,
  html.erp-theme-switching *::before,
  html.erp-theme-switching *::after {
    transition: none !important;
    animation-duration: 0s !important;
  }
}
