/* PortuFlow / motion system 1.23.27 — shared by authenticated pages and login. */
:root {
  --pf-motion-fast: 155ms;
  --pf-motion-normal: 235ms;
  --pf-motion-ease: cubic-bezier(.2, .7, .2, 1);
  --pf-skeleton-base: #d9e3ee;
  --pf-skeleton-highlight: #f8fbff;
}
@keyframes pf-skeleton-wave {
  from { background-position: 125% 0; }
  to { background-position: -125% 0; }
}
@keyframes pf-content-appear {
  from { opacity: .72; }
  to { opacity: 1; }
}
@keyframes pf-dialog-appear {
  from { opacity: .32; }
  to { opacity: 1; }
}
@keyframes pf-list-row-in {
  from { opacity: .52; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pf-panel-in {
  from { opacity: .65; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pf-progress-slide {
  from { transform: translateX(-110%); }
  to { transform: translateX(390%); }
}
.pf-motion-enabled .pf-skeleton-line,
.pf-motion-enabled .pf-loading-placeholder::before,
.pf-motion-enabled .pf-loading-placeholder::after {
  display: block;
  height: 15px;
  border-radius: 5px;
  background: linear-gradient(95deg, var(--pf-skeleton-base) 25%, var(--pf-skeleton-highlight) 45%, var(--pf-skeleton-base) 65%);
  background-size: 210% 100%;
  animation: pf-skeleton-wave 1.25s ease-in-out infinite;
}
.pf-motion-enabled .pf-skeleton-row { pointer-events: none; }
.pf-motion-enabled .pf-skeleton-row td { height: 47px; vertical-align: middle; }
.pf-motion-enabled .pf-skeleton-line { min-width: 25px; max-width: 240px; }
/* For custom views that render a textual Cargando placeholder. Preserve text for screen readers. */
.pf-motion-enabled .pf-loading-placeholder {
  min-height: 43px;
  font-size: 0 !important;
  line-height: 0 !important;
  padding: 7px 10px;
  margin: 0;
}
.pf-motion-enabled .pf-loading-placeholder::before { content: ''; width: 74%; margin-bottom: 9px; }
.pf-motion-enabled .pf-loading-placeholder::after { content: ''; width: 42%; }
.pf-motion-enabled #loading.pf-loading-placeholder { max-width: 480px; }
/* Stable Skeleton shared by listados, reports and custom tables with aria-busy.
   Purely visual: overlays existing cells and never creates new rows, padding,
   headers, margins or page height. This is the calendar 1.23.37 principle. */
.pf-motion-enabled tbody.pf-stable-busy > tr:not(.pf-skeleton-row) > td:not([colspan]) {
  position: relative;
  color: transparent !important;
}
.pf-motion-enabled tbody.pf-stable-busy > tr:not(.pf-skeleton-row) > td:not([colspan]) > * {
  visibility: hidden !important;
}
.pf-motion-enabled tbody.pf-stable-busy > tr:not(.pf-skeleton-row) > td:not([colspan])::after {
  content: '';
  position: absolute;
  left: 11px;
  top: 50%;
  width: min(69%, 180px);
  height: 13px;
  border-radius: 4px;
  transform: translateY(-50%);
  pointer-events: none;
  background: linear-gradient(95deg, var(--pf-skeleton-base) 25%, var(--pf-skeleton-highlight) 45%, var(--pf-skeleton-base) 65%);
  background-size: 210% 100%;
  animation: pf-skeleton-wave 1.25s ease-in-out infinite;
}
.pf-motion-enabled tbody.pf-stable-busy { pointer-events: none; }
/* A text-only loading state must not inject a two-row block that shifts the UI. */
.pf-motion-enabled .pf-loading-placeholder {
  position: relative;
  min-height: 18px;
  padding: 0;
  overflow: hidden;
}
.pf-motion-enabled .pf-loading-placeholder::before {
  position: absolute;
  top: 3px;
  left: 0;
  width: min(68%, 380px);
  height: 12px;
  margin: 0;
}
.pf-motion-enabled .pf-loading-placeholder::after { display: none; }

/* Already loaded data remains visible during refresh; no blank-page flashing. */
.pf-motion-enabled :is(.pf-grid-table tbody, .legacy-rental-jobs-results-list).pf-refreshing { opacity: .76; pointer-events: none; transition: opacity 160ms ease-out; }
/* A short, visible per-row entrance is easier to perceive than a tbody opacity change.
   Animate transform/opacity only; never alter table geometry or data rendering. */
.pf-motion-enabled .pf-grid-table tbody.pf-row-arrive > tr {
  animation: pf-list-row-in var(--pf-motion-normal) var(--pf-motion-ease) both;
}
.pf-motion-enabled .pf-grid-table tbody.pf-row-arrive > tr:nth-child(2) { animation-delay: 22ms; }
.pf-motion-enabled .pf-grid-table tbody.pf-row-arrive > tr:nth-child(3) { animation-delay: 40ms; }
.pf-motion-enabled .pf-grid-table tbody.pf-row-arrive > tr:nth-child(4) { animation-delay: 55ms; }
.pf-motion-enabled .pf-grid-table tbody.pf-row-arrive > tr:nth-child(5) { animation-delay: 66ms; }
/* Global progress indicator: also visible while retaining old rows during refresh. */
.pf-motion-enabled .pf-grid-scroll { position: relative; }
.pf-motion-enabled [aria-busy="true"] > .pf-grid-scroll::before {
  content: ''; pointer-events: none;
  position: sticky; display: block; top: 0; z-index: 6;
  height: 3px; width: 26%; margin-bottom: -3px;
  border-radius: 3px;
  background: var(--pf-ui-primary, #2d72db);
  animation: pf-progress-slide 1.12s ease-in-out infinite;
}
.pf-motion-enabled :is(.pf-filter-popover, .pf-filter-panel, .top-dropdown-menu, .user-menu):not([hidden]) {
  animation: pf-panel-in var(--pf-motion-fast) var(--pf-motion-ease) both;
}
.pf-motion-enabled #page:not([hidden]) { animation: pf-content-appear var(--pf-motion-normal) ease-out both; }
.pf-motion-enabled dialog[open] { animation: pf-dialog-appear var(--pf-motion-normal) ease-out both; }
.pf-motion-enabled :is(.customer-tab-panel, .portuflow-related-panel, .pf-served-tab-panel):not([hidden]) {
  animation: pf-content-appear var(--pf-motion-normal) ease-out both;
}
.pf-motion-enabled :is(.notice, .field-error:not(:empty)) { animation: pf-content-appear var(--pf-motion-fast) ease-out both; }
.pf-motion-enabled :is(.button, button, a) { transition-property: background-color, border-color, color, box-shadow; transition-duration: var(--pf-motion-fast); }
.pf-motion-enabled :is(.button, button):focus-visible { outline-offset: 2px; }
/* Existing form save state; never hide the validation or disable controls beyond the app rules. */
.pf-motion-enabled form[aria-busy="true"] button[type="submit"]::after {
  content: ''; display:inline-block; width: 11px; height:11px; margin-left:9px; vertical-align:middle;
  border:2px solid currentColor; border-top-color:transparent; border-radius:50%;
  animation: pf-button-spin .8s linear infinite;
}
@keyframes pf-button-spin { to { transform: rotate(360deg); } }
html[data-theme="dark"], body[data-theme="dark"], body.theme-dark {
  --pf-skeleton-base: #36495d;
  --pf-skeleton-highlight: #607891;
}
@media (prefers-reduced-motion: reduce) {
  .pf-motion-enabled *, .pf-motion-enabled *::before, .pf-motion-enabled *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
@media print {
  .pf-motion-enabled *, .pf-motion-enabled *::before, .pf-motion-enabled *::after { animation: none !important; }
}

/* Highly visible, yet restrained focus/hover feedback for UI controls. */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .pf-motion-enabled :is(button, .button):not(:disabled):not([aria-disabled="true"]):hover {
    filter: brightness(1.045);
  }
}
.pf-motion-enabled :is(button, .button):active:not(:disabled) { filter: brightness(.96); }
