/* Lightweight system motion. Kept screen-only and disabled for users who
   request reduced motion so daily ERP work remains fast and comfortable. */
@media screen and (prefers-reduced-motion: no-preference) {
  :root {
    --ss-motion-fast: 150ms;
    --ss-motion-base: 240ms;
    --ss-motion-slow: 420ms;
    --ss-motion-ease: cubic-bezier(.2, .8, .2, 1);
  }

  @keyframes ss-rise-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }

  @keyframes ss-soft-pop {
    0% { opacity: 0; transform: scale(.97); }
    100% { opacity: 1; transform: scale(1); }
  }

  @keyframes ss-status-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 139, 67, .24); }
    50% { box-shadow: 0 0 0 5px rgba(0, 139, 67, 0); }
  }

  body.tailwind-erp .content > :where(section, article, .dashboard-section-heading, form):not(.print-only):not(.pos-receipt):not(.result-sheet):not(.score-sheet-document):not(.broadsheet-document):not(.id-card-sheet):not(.certificate-sheet) {
    animation: ss-rise-in var(--ss-motion-slow) var(--ss-motion-ease) both;
  }

  body.tailwind-erp .content > :nth-child(2) { animation-delay: 35ms; }
  body.tailwind-erp .content > :nth-child(3) { animation-delay: 70ms; }
  body.tailwind-erp .content > :nth-child(4) { animation-delay: 105ms; }
  body.tailwind-erp .content > :nth-child(5) { animation-delay: 140ms; }
  body.tailwind-erp .content > :nth-child(n + 6) { animation-delay: 170ms; }

  body.tailwind-erp :where(.button, .btn, button, .icon-button, .nav-section-title, .sidebar-nav a, .dashboard-feature-links a, .executive-action-card, .activity-item, .settings-tiles a) {
    transition: transform var(--ss-motion-fast) var(--ss-motion-ease), box-shadow var(--ss-motion-fast) var(--ss-motion-ease), background-color var(--ss-motion-fast) ease, border-color var(--ss-motion-fast) ease, color var(--ss-motion-fast) ease !important;
  }

  body.tailwind-erp :where(.button, .btn, button, .icon-button):active { transform: scale(.97) !important; }
  body.tailwind-erp :where(.panel, .dashboard-feature-card, .admin-health-card, .executive-action-card, .kpi-grid > article, .stats-grid > article):hover { transform: translateY(-2px); }
  body.tailwind-erp .sidebar-nav a:hover .nav-icon,
  body.tailwind-erp .dashboard-feature-links a:hover .icon,
  body.tailwind-erp .button:hover .icon { transform: scale(1.08); }
  body.tailwind-erp :where(.nav-icon, .button .icon, .icon-button .icon, .kpi-icon, .action-icon, .health-icon, .feature-icon) { transition: transform var(--ss-motion-fast) var(--ss-motion-ease), color var(--ss-motion-fast) ease, background-color var(--ss-motion-fast) ease; }

  body.tailwind-erp .sidebar-nav a.active .nav-indicator,
  body.tailwind-erp .offline-status:not(:empty) { animation: ss-status-pulse 2.5s ease-in-out infinite; }
  body.tailwind-erp :where(.swal-lite, .modal, dialog, .ai-assistant-panel) { animation: ss-soft-pop var(--ss-motion-base) var(--ss-motion-ease) both; }
  body.tailwind-erp table tbody tr:nth-child(-n + 12) { animation: ss-rise-in var(--ss-motion-base) var(--ss-motion-ease) both; }
  body.tailwind-erp table tbody tr:nth-child(2) { animation-delay: 25ms; }
  body.tailwind-erp table tbody tr:nth-child(3) { animation-delay: 50ms; }
  body.tailwind-erp table tbody tr:nth-child(4) { animation-delay: 75ms; }
  body.tailwind-erp table tbody tr:nth-child(5) { animation-delay: 100ms; }

  body.login-page :where(.login-hero, .login-panel, .login-card),
  body.developer-login-page :where(.developer-login-brand-panel, .developer-login-form) {
    animation: ss-soft-pop 520ms var(--ss-motion-ease) both;
  }
}

@media screen and (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  *, *::before, *::after { animation: none !important; transition: none !important; transform: none !important; }
}
