:root {
  --rmm-motion-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --rmm-motion-duration: 0.92s;
  --rmm-motion-ui-duration: 0.28s;
}

html.rmm-motion-enabled .rmm-motion-reveal {
  opacity: 0;
  translate: 0 24px;
  scale: 1;
  transition:
    opacity var(--rmm-motion-duration) var(--rmm-motion-ease),
    translate var(--rmm-motion-duration) var(--rmm-motion-ease),
    scale var(--rmm-motion-duration) var(--rmm-motion-ease);
  transition-delay: var(--rmm-motion-delay, 0ms);
  will-change: opacity, translate, scale;
}

html.rmm-motion-enabled .rmm-motion-reveal[data-motion="left"] {
  translate: -28px 0;
}

html.rmm-motion-enabled .rmm-motion-reveal[data-motion="right"] {
  translate: 28px 0;
}

html.rmm-motion-enabled .rmm-motion-reveal[data-motion="scale"] {
  translate: 0 12px;
  scale: 0.975;
}

html.rmm-motion-enabled .rmm-motion-reveal.is-visible {
  opacity: 1;
  translate: 0 0;
  scale: 1;
  will-change: auto;
}

.rmm-motion-media {
  overflow: hidden;
}

.rmm-motion-media img {
  transition: transform 1.05s var(--rmm-motion-ease);
}

.rmm-motion-media:hover img,
.rmm-motion-media:focus-within img {
  transform: scale(1.025);
}

.front-secretary-feature-header,
.secretary-action-title,
.records-header {
  position: relative;
  overflow: hidden;
}

.front-secretary-feature-header::after,
.secretary-action-title::after,
.records-header::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: #d4af37;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.05s var(--rmm-motion-ease) 0.22s;
}

.rmm-motion-reveal.is-visible .front-secretary-feature-header::after,
.rmm-motion-reveal.is-visible.secretary-action-section .secretary-action-title::after,
.rmm-motion-reveal.is-visible.records-header::after {
  transform: scaleX(1);
}

.front-announcement-float:not([hidden]) {
  animation: rmmNoticeEnter 0.42s var(--rmm-motion-ease) both;
}

.announcement-detail-modal:not([hidden]) .announcement-detail-backdrop {
  animation: rmmBackdropIn 0.18s ease-out both;
}

.announcement-detail-modal:not([hidden]) .announcement-detail-dialog {
  animation: rmmDialogIn 0.28s var(--rmm-motion-ease) both;
}

.announcement-page .page-head-badge i {
  animation: rmmBulletinPulse 2.8s ease-in-out infinite;
}

html.rmm-motion-enabled .owner-office-navbar,
html.rmm-motion-enabled .sidebar,
html.rmm-motion-enabled main {
  animation: rmmOfficeShellIn 0.72s var(--rmm-motion-ease) both;
}

html.rmm-motion-enabled .sidebar {
  animation-delay: 40ms;
}

html.rmm-motion-enabled main {
  animation-delay: 80ms;
}

html.rmm-motion-enabled .form-control,
html.rmm-motion-enabled .form-select,
html.rmm-motion-enabled input,
html.rmm-motion-enabled select,
html.rmm-motion-enabled textarea {
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease;
  transition-duration: var(--rmm-motion-ui-duration);
}

html.rmm-motion-enabled .btn,
html.rmm-motion-enabled button,
html.rmm-motion-enabled .nav-link,
html.rmm-motion-enabled .dropdown-item {
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    translate 0.18s ease,
    opacity 0.18s ease;
  transition-duration: var(--rmm-motion-ui-duration);
}

html.rmm-motion-enabled main .btn:hover,
html.rmm-motion-enabled main button:hover {
  translate: 0 -1px;
}

html.rmm-motion-enabled .card,
html.rmm-motion-enabled .admin-content .card,
html.rmm-motion-enabled .dashboard-card,
html.rmm-motion-enabled .summary-card,
html.rmm-motion-enabled .metric-card,
html.rmm-motion-enabled .stat-card,
html.rmm-motion-enabled .section-card,
html.rmm-motion-enabled .panel-card,
html.rmm-motion-enabled .control-card,
html.rmm-motion-enabled .decision-card,
html.rmm-motion-enabled .operations-strip article,
html.rmm-motion-enabled .filter-card,
html.rmm-motion-enabled .ereport-card,
html.rmm-motion-enabled .barangay-filter-card,
html.rmm-motion-enabled .scanner-card,
html.rmm-motion-enabled .subsidy-card,
html.rmm-motion-enabled .inventory-card,
html.rmm-motion-enabled .farmer-record-row,
html.rmm-motion-enabled .story-item,
html.rmm-motion-enabled .secretary-item,
html.rmm-motion-enabled .poster-item,
html.rmm-motion-enabled .payment-metric,
html.rmm-motion-enabled .activity-summary article,
html.rmm-motion-enabled .outstanding-summary article,
html.rmm-motion-enabled .inventory-grid article,
html.rmm-motion-enabled .tax-cards > *,
html.rmm-motion-enabled .tax-rule-cards > *,
html.rmm-motion-enabled .church-giving-grid > *,
html.rmm-motion-enabled .activity-panel,
html.rmm-motion-enabled .outstanding-panel,
html.rmm-motion-enabled .module-table,
html.rmm-motion-enabled .tax-panel {
  transition:
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    translate 0.22s ease,
    background-color 0.22s ease;
  transition-duration: 0.34s;
}

html.rmm-motion-enabled .payment-metric:hover,
html.rmm-motion-enabled .decision-card:hover,
html.rmm-motion-enabled .operations-strip article:hover,
html.rmm-motion-enabled .filter-card:hover,
html.rmm-motion-enabled .ereport-card:hover,
html.rmm-motion-enabled .barangay-filter-card:hover,
html.rmm-motion-enabled .scanner-card:hover,
html.rmm-motion-enabled .subsidy-card:hover,
html.rmm-motion-enabled .inventory-card:hover,
html.rmm-motion-enabled .farmer-record-row:hover,
html.rmm-motion-enabled .story-item:hover,
html.rmm-motion-enabled .secretary-item:hover,
html.rmm-motion-enabled .poster-item:hover,
html.rmm-motion-enabled .activity-summary article:hover,
html.rmm-motion-enabled .outstanding-summary article:hover,
html.rmm-motion-enabled .inventory-grid article:hover,
html.rmm-motion-enabled .tax-cards > *:hover,
html.rmm-motion-enabled .tax-rule-cards > *:hover,
html.rmm-motion-enabled .church-giving-grid > *:hover {
  translate: 0 -2px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

html.rmm-motion-enabled .table tbody tr,
html.rmm-motion-enabled table tbody tr {
  transition:
    background-color 0.16s ease,
    box-shadow 0.16s ease;
}

.modal.show .modal-dialog {
  animation: rmmDialogIn 0.46s var(--rmm-motion-ease) both;
}

.custom-modal.show .custom-modal-dialog,
.rmm-support-modal:not([hidden]) .rmm-support-dialog {
  animation: rmmDialogIn 0.46s var(--rmm-motion-ease) both;
}

.custom-modal.show .custom-modal-backdrop,
.rmm-support-modal:not([hidden]) .rmm-support-backdrop {
  animation: rmmBackdropIn 0.3s ease-out both;
}

.modal-backdrop.show {
  background: rgba(15, 23, 42, 0.56);
  opacity: 1;
  backdrop-filter: blur(3px);
  animation: rmmModalBackdropIn 0.3s ease-out both;
}

@keyframes rmmNoticeEnter {
  from { opacity: 0; transform: translateY(-10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes rmmOfficeShellIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes rmmBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes rmmModalBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes rmmDialogIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes rmmBulletinPulse {
  0%, 100% { transform: scale(1); opacity: 0.78; }
  50% { transform: scale(1.12); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html.rmm-motion-enabled .rmm-motion-reveal,
  .rmm-motion-media img,
  .front-secretary-feature-header::after,
  .secretary-action-title::after,
  .records-header::after {
    opacity: 1 !important;
    translate: 0 0 !important;
    scale: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .front-announcement-float,
  .announcement-detail-backdrop,
  .announcement-detail-dialog,
  .announcement-page .page-head-badge i,
  .owner-office-navbar,
  .sidebar,
  main,
  .modal.show .modal-dialog,
  .modal-backdrop.show,
  .custom-modal.show .custom-modal-dialog,
  .custom-modal.show .custom-modal-backdrop,
  .rmm-support-modal:not([hidden]) .rmm-support-dialog,
  .rmm-support-modal:not([hidden]) .rmm-support-backdrop {
    animation: none !important;
  }
}
