/* One motion language in every cabinet. No blur, text scaling or permanent
   compositing layers. Float physics and clinical viewers keep their own motion. */
body.crm-premium{--motion-fast:140ms;--motion-control:220ms;--motion-ease:cubic-bezier(.2,.75,.25,1)}
body.crm-premium.crm-motion-ready .view.is-visible{animation:none}
@media screen and (prefers-reduced-motion:no-preference){
body.crm-premium button:not(.orb-hit):not(.mat-orbit button):not(.reels-scene-preview button),
body.crm-premium :is(.button,.auth-primary,.auth-secondary,.admin-primary,.admin-secondary,.admin-logout,
 .icon-button,.board-tool,.review-card-open,.review-card-request,.message-icon-action,.message-send,.messages-back,
 .feed-primary,.feed-secondary,.filter-tab,.profile-type,.contract-tabs button,.contract-workspace-tabs button,
 .cn-panel button,.oc-tabs button,.ak-editor button,.pg-tools button,.pg-inspector button,.s3-tools button,
 .s3-inspector button,.s3-head button,.lab-tools button,.studio-tools button){
 transition:background-color var(--motion-control) var(--motion-ease),border-color var(--motion-control) var(--motion-ease),
 color var(--motion-control) var(--motion-ease),box-shadow var(--motion-control) var(--motion-ease),opacity var(--motion-fast) ease!important;
}
body.crm-premium :is(.metric-card,.order-tile,.client-tile,.contract-row,.emp-order,.city-tile,.mat-group,.feed-post){
 transition:border-color 260ms var(--motion-ease),box-shadow 260ms var(--motion-ease),background-color 260ms var(--motion-ease)!important;
}
body.crm-premium :is(input:not([type=range]):not([type=checkbox]):not([type=radio]),select,textarea){
 transition:border-color var(--motion-control) ease,box-shadow var(--motion-control) ease,background-color var(--motion-control) ease!important;
}
body.crm-premium :is(.nav-icon,.metric-icon,.button>[data-icon],.review-category-art),
body.crm-premium .review-card-names h4::before{
 transition:transform 260ms var(--motion-ease),color var(--motion-control) ease,box-shadow var(--motion-control) ease;
}
body.crm-premium :is(.step,.side-step,.profile-type-symbol,.contract-step-number,.review-flow-step b){
 transition:background-color 240ms ease,border-color 240ms ease,color 240ms ease,box-shadow 240ms ease;
}
@media(hover:hover) and (prefers-reduced-motion:no-preference){
 body.crm-premium #crm-navigation .nav-item:hover .nav-icon{transform:translateY(-1px)}
 body.crm-premium .metric-card:hover .metric-icon{transform:translateY(-2px);box-shadow:inset 0 1px #fff,0 6px 12px -3px #397fb32e}
 body.crm-premium .button:hover:enabled>[data-icon]{transform:translateX(1px)}
 body.crm-premium.employee .mat-gallery:not(.focus-mode) .review-tile-cover:hover .review-category-art{transform:translateY(-2px)}
}
body.crm-premium :is(.button,.auth-primary,.auth-secondary,.admin-primary,.admin-secondary,.icon-button,.board-tool,
 .review-card-open,.message-icon-action,.message-send,.feed-primary,.feed-secondary):active:enabled:not([aria-disabled=true]){
 box-shadow:inset 0 2px 4px #244a6c20,0 1px 2px #244a6c0a!important;transition-duration:80ms!important;
}
body.crm-premium :is(.button,.auth-primary,.admin-primary,.review-card-open,.message-icon-action,.filter-tab):focus-visible{
 outline:2px solid #3984c4;outline-offset:3px;
}
body.crm-premium details[open]>:not(summary){animation:ors-disclosure 220ms var(--motion-ease)}
body.crm-premium dialog[open]::backdrop{animation:ors-backdrop 200ms ease-out}
/* Native dialog closing remains immediate unless discrete transitions are supported. */
@supports(transition-behavior:allow-discrete){
 body.crm-premium dialog{transition:opacity 160ms ease-out,display 160ms allow-discrete,overlay 160ms allow-discrete}
 body.crm-premium dialog:not([open]){opacity:0}
 body.crm-premium dialog[open]{opacity:1}
}
@keyframes ors-disclosure{from{opacity:0}to{opacity:1}}
@keyframes ors-backdrop{from{opacity:0}to{opacity:1}}
}
@media(prefers-reduced-motion:reduce){
 body.crm-premium,body.crm-premium *,body.crm-premium *::before,body.crm-premium *::after,body.crm-premium dialog::backdrop{
  animation:none!important;transition:none!important;scroll-behavior:auto!important;
 }
}
@media print{body.crm-premium *,body.crm-premium *::before,body.crm-premium *::after{animation:none!important;transition:none!important}}

/* Section-specific polish. These effects animate chrome, accents and status
   indicators only; text, source images, canvases and data cards keep their
   geometry so the interface stays calm while the section feels alive. */
@media screen and (prefers-reduced-motion:no-preference){
  @keyframes ors-heading-glint{0%,58%{transform:translateX(-125%);opacity:0}66%{opacity:.42}84%,100%{transform:translateX(125%);opacity:0}}
  @keyframes ors-card-glint{0%,72%{transform:translateX(-135%);opacity:0}78%{opacity:.3}92%,100%{transform:translateX(135%);opacity:0}}
  @keyframes ors-blue-breathe{0%,100%{box-shadow:inset 0 1px #fff,0 4px 10px #397fb31a}50%{box-shadow:inset 0 1px #fff,0 5px 15px #397fb33a}}
  @keyframes ors-status-beat{0%,100%{box-shadow:0 0 0 0 #3e9bc000}45%{box-shadow:0 0 0 5px #3e9bc01b}70%{box-shadow:0 0 0 0 #3e9bc000}}
  @keyframes ors-online-pulse{0%,100%{opacity:.55;transform:scale(.86)}45%{opacity:1;transform:scale(1)}70%{opacity:.72;transform:scale(.94)}}
  @keyframes ors-chart-spark{0%,100%{opacity:.45;transform:scale(.96)}48%{opacity:1;transform:scale(1.04)}}
  @keyframes ors-tab-sweep{0%,100%{transform:scaleX(.45);opacity:.25}50%{transform:scaleX(1);opacity:.9}}

  /* Every page heading gets one restrained light sweep. */
  body.crm-premium :is(.app-shell .view>.page-heading,.emp-head,.admin-head,.auth-card) {position:relative;overflow:hidden}
  body.crm-premium :is(.app-shell .view>.page-heading,.emp-head,.admin-head,.auth-card)::after{
    content:"";position:absolute;inset:0 auto 0 -35%;width:32%;pointer-events:none;
    background:linear-gradient(105deg,transparent,#fff9,transparent);transform:translateX(-125%);
    animation:ors-heading-glint 9s cubic-bezier(.2,.7,.2,1) infinite;opacity:0;
  }

  /* Partner dashboard: numbers lead the eye, status columns stay gently active. */
  body.crm-premium:not(.employee) #view-dashboard .metric-card{position:relative;overflow:hidden}
  body.crm-premium:not(.employee) #view-dashboard .metric-card::after{
    content:"";position:absolute;inset:0 auto 0 -45%;width:28%;pointer-events:none;
    background:linear-gradient(105deg,transparent,#fff8,transparent);transform:translateX(-135%);
    animation:ors-card-glint 8s cubic-bezier(.2,.7,.2,1) infinite;opacity:0;
  }
  body.crm-premium:not(.employee) #view-dashboard .metric-card:nth-child(2)::after{animation-delay:1.1s}
  body.crm-premium:not(.employee) #view-dashboard .metric-card:nth-child(3)::after{animation-delay:2.2s}
  body.crm-premium:not(.employee) #view-dashboard .status-column:hover{box-shadow:inset 0 1px #fff,0 8px 18px -10px #397fb34a}
  body.crm-premium:not(.employee) #view-dashboard .status-column strong{transition:color 220ms ease}

  /* Orders: the selected filter and the order accent are easy to read at a glance. */
  body.crm-premium:not(.employee) #view-orders .filter-tab.is-active{animation:ors-blue-breathe 3.8s ease-in-out infinite}
  body.crm-premium:not(.employee) #view-orders .orders-toolbar:focus-within{box-shadow:0 0 0 3px #70a8d522;border-radius:16px}
  body.crm-premium:not(.employee) #view-orders .orders-entry{position:relative;overflow:hidden}
  body.crm-premium:not(.employee) #view-orders .orders-entry::after{
    content:"";position:absolute;inset:8px auto 8px 0;width:3px;border-radius:4px;
    background:linear-gradient(#55a5da,#2775bf);transform:scaleY(.2);transform-origin:center;
    opacity:.35;transition:transform 260ms var(--motion-ease),opacity 260ms ease;
  }
  body.crm-premium:not(.employee) #view-orders .orders-entry:hover::after,
  body.crm-premium:not(.employee) #view-orders .orders-entry:focus-within::after{transform:scaleY(1);opacity:1}

  /* Clients and contracts use small icon/edge cues instead of moving content. */
  body.crm-premium:not(.employee) #view-clients .client-tile:hover .client-preview,
  body.crm-premium:not(.employee) #view-clients .client-tile:focus-within .client-preview{box-shadow:0 0 0 4px #4c9bd51c,0 7px 16px -8px #397fb34d}
  body.crm-premium:not(.employee) #view-contracts .contract-row{position:relative;overflow:hidden}
  body.crm-premium:not(.employee) #view-contracts .contract-row::after{
    content:"";position:absolute;inset:0 auto 0 -30%;width:20%;pointer-events:none;
    background:linear-gradient(105deg,transparent,#e7f4ffb8,transparent);transform:translateX(-135%);
    animation:ors-card-glint 10s 1.8s cubic-bezier(.2,.7,.2,1) infinite;opacity:0;
  }
  body.crm-premium:not(.employee) #view-contracts .contract-row:hover::before{box-shadow:inset 0 1px #fff,0 0 0 4px #4c9bd51a,0 6px 14px -8px #397fb34d}

  /* Analytics: the report tile and tab underline communicate state without flashing. */
  body.crm-premium:not(.employee) #view-analytics .empty-workspace{position:relative;overflow:hidden}
  body.crm-premium:not(.employee) #view-analytics .empty-icon{animation:ors-chart-spark 4.8s ease-in-out infinite}
  body.crm-premium:not(.employee) .finance-tabs button[aria-pressed=true]::after,
  body.crm-premium:not(.employee) .oc-tabs button[aria-pressed=true]::after{
    content:"";display:block;height:2px;margin-top:5px;border-radius:4px;background:#3e9bc0;
    transform-origin:center;animation:ors-tab-sweep 2.8s ease-in-out infinite;
  }

  /* Messages: online presence and the active thread get a quiet pulse. */
  body.crm-premium .messages-online i{animation:ors-online-pulse 2.8s ease-in-out infinite}
  body.crm-premium :is(.message-thread-item[aria-selected=true],.messages-filter.is-active){animation:ors-blue-breathe 4.2s ease-in-out infinite}
  body.crm-premium .messages-conversation-head{box-shadow:inset 0 -1px #d8e4ec,0 4px 14px -12px #397fb34d}
  body.crm-premium .message-send:hover:enabled{box-shadow:inset 0 1px #fff,0 0 0 4px #4c9bd51b,0 5px 12px -6px #397fb34d!important}

  /* Feed: tabs and media cards receive a single direction cue. */
  body.crm-premium:not(.employee) #view-feed .feed-mode-tabs button[aria-pressed=true]::after,
  body.crm-premium:not(.employee) #view-feed .feed-tabs button.is-active::after{
    content:"";display:block;height:2px;margin-top:5px;border-radius:4px;background:#3e9bc0;
    transform-origin:center;animation:ors-tab-sweep 3.2s ease-in-out infinite;
  }
  body.crm-premium:not(.employee) #view-feed .feed-post{position:relative}
  body.crm-premium:not(.employee) #view-feed .feed-post:hover{box-shadow:inset 0 1px #fff,0 12px 24px -17px #397fb34d}

  /* Print wizard: current step and file slots make the next action obvious. */
  body.crm-premium:not(.employee) #view-print .step.is-current,
  body.crm-premium:not(.employee) #view-print .step[aria-current=step]{animation:ors-blue-breathe 3.8s ease-in-out infinite}
  body.crm-premium:not(.employee) #view-print .wizard-file-toolbar:focus-within{box-shadow:0 0 0 3px #70a8d522;border-radius:14px}
  body.crm-premium:not(.employee) #view-print :is(.upload-card,.command-card,.contract-gate):hover{box-shadow:inset 0 1px #fff,0 9px 20px -13px #397fb34d}

  /* Employee home and reference pages. */
  body.crm-premium.employee #home-summary .emp-metrics>:is(div,button),
  body.crm-premium.employee .cities-card,
  body.crm-premium.employee .emp-list,
  body.crm-premium.employee .contracts-panel{position:relative;overflow:hidden}
  body.crm-premium.employee #home-summary .emp-metrics>:is(div,button)::after,
  body.crm-premium.employee .cities-card::after,
  body.crm-premium.employee .emp-list::after,
  body.crm-premium.employee .contracts-panel::after{
    content:"";position:absolute;inset:0 auto 0 -32%;width:20%;pointer-events:none;
    background:linear-gradient(105deg,transparent,#fff9,transparent);transform:translateX(-135%);
    animation:ors-card-glint 10s cubic-bezier(.2,.7,.2,1) infinite;opacity:0;
  }
  body.crm-premium.employee #home-summary .emp-metrics>:is(div,button):nth-child(2)::after{animation-delay:1.4s}
  body.crm-premium.employee #home-summary .emp-metrics>:is(div,button):nth-child(3)::after{animation-delay:2.8s}
  body.crm-premium.employee .city-tile:hover{box-shadow:inset 0 1px #fff,0 9px 20px -12px #397fb34d}
  body.crm-premium.employee #late-notice:not([hidden]){animation:ors-status-beat 2.4s ease-in-out infinite}
  body.crm-premium.employee .emp-order[aria-pressed=true]{animation:ors-blue-breathe 4s ease-in-out infinite}
  body.crm-premium.employee .cities-editor .city-row:hover{box-shadow:0 5px 12px -9px #397fb34d}

  /* Employee review workspace: checked materials and current step stay legible. */
  body.crm-premium.employee .review-flow-step.is-current b{animation:ors-blue-breathe 3.8s ease-in-out infinite}
  body.crm-premium.employee .mat-group[data-review-state=done]{animation:ors-status-beat 4.8s ease-in-out infinite}
  body.crm-premium.employee #detail .review-status.is-ready{animation:ors-status-beat 4.8s ease-in-out infinite}
  body.crm-premium.employee .review-card-open:hover:enabled{box-shadow:inset 0 1px #fff,0 0 0 4px #4c9bd51b,0 5px 12px -6px #397fb34d!important}

  /* Dialogs and the built-in laboratory use a brighter frame around controls. */
  body.crm-premium :is(dialog,.modal-card,.cn-panel,.message-context-menu,.feed-compose,.feed-sheet) .modal-head,
  body.crm-premium :is(dialog,.modal-card,.cn-panel,.message-context-menu,.feed-compose,.feed-sheet) .oc-kicker{position:relative}
  body.crm-premium :is(dialog,.modal-card,.cn-panel,.message-context-menu,.feed-compose,.feed-sheet) .modal-head::after{
    content:"";position:absolute;left:0;right:0;bottom:-1px;height:1px;background:linear-gradient(90deg,#4c9bd500,#4c9bd580,#4c9bd500);
    transform-origin:center;animation:ors-tab-sweep 4.8s ease-in-out infinite;pointer-events:none
  }
  body.crm-premium.employee #lab-tools button:hover{box-shadow:inset 0 1px #fff,0 0 0 3px #4c9bd51b,0 4px 9px -6px #397fb34d}
}

/* Final interaction pass: active destinations, form focus and progress cues
   receive a small physical response while the page content remains stable. */
@media screen and (prefers-reduced-motion:no-preference){
  @keyframes ors-nav-sheen{0%,68%{transform:translateX(-145%);opacity:0}76%{opacity:.34}94%,100%{transform:translateX(145%);opacity:0}}
  @keyframes ors-icon-bloom{0%,100%{transform:translateY(0) scale(1)}48%{transform:translateY(-1px) scale(1.035)}68%{transform:translateY(0) scale(1)}}
  @keyframes ors-progress-glow{0%,100%{box-shadow:0 0 0 0 #4c9bd500}50%{box-shadow:0 0 0 4px #4c9bd51c}}

  body.crm-premium :is(#crm-navigation .nav-item.is-active,.emp-sidebar nav button[aria-pressed=true]){
    position:relative;overflow:hidden
  }
  body.crm-premium :is(#crm-navigation .nav-item.is-active,.emp-sidebar nav button[aria-pressed=true])::after{
    content:"";position:absolute;inset:0 auto 0 -28%;width:24%;pointer-events:none;
    background:linear-gradient(105deg,transparent,#fff9,transparent);transform:translateX(-145%);
    animation:ors-nav-sheen 7.8s cubic-bezier(.2,.7,.2,1) infinite;opacity:0
  }
  body.crm-premium #crm-navigation .nav-item.is-active .nav-icon,
  body.crm-premium.employee .emp-sidebar nav button[aria-pressed=true]::before{animation:ors-icon-bloom 4.2s ease-in-out infinite}

  body.crm-premium :is(input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea):focus-visible{
    box-shadow:0 0 0 4px #4c9bd51c,inset 0 2px 4px #29475808,0 1px #fff!important
  }
  body.crm-premium :is(.orders-toolbar,.clients-toolbar,.profile-content,.cities-card,.messages-shell,.wizard-main,.wizard-side):focus-within{
    outline:1px solid #8abce0;outline-offset:4px;transition:outline-color 240ms ease
  }

  body.crm-premium :is(.profile-type.is-selected .profile-type-symbol,.contract-workspace-tabs button[aria-selected=true] .contract-step-number,
    .review-flow-step.is-current b){animation:ors-icon-bloom 4s ease-in-out infinite}
  body.crm-premium :is(.contract-row button,.orders-entry button,.client-tile button):hover:enabled [data-icon],
  body.crm-premium :is(.contract-row button,.orders-entry button,.client-tile button):focus-visible [data-icon]{transform:translateX(2px)}
  body.crm-premium :is(.contract-row button,.orders-entry button,.client-tile button) [data-icon]{transition:transform 240ms var(--motion-ease)}

  body.crm-premium :is(.review-progress-bar,.review-card-badge,.crm-status-badge,.quote-status,.order-status){animation:ors-progress-glow 4.6s ease-in-out infinite}
  body.crm-premium :is(.review-status.is-ready,.quote-status.is-quoted,.order-status.is-done){animation:ors-progress-glow 4.6s ease-in-out infinite}

  /* Hidden views are still kept in the DOM for instant navigation. Pause
     their decorative loops so background tabs do not spend frames painting
     sections the user cannot see. */
  body.crm-premium .view:not(.is-visible),
  body.crm-premium .view:not(.is-visible) *,
  body.crm-premium .view:not(.is-visible) *::before,
  body.crm-premium .view:not(.is-visible) *::after,
  body.crm-premium [hidden],
  body.crm-premium [hidden] *,
  body.crm-premium [hidden] *::before,
  body.crm-premium [hidden] *::after{
    animation-play-state:paused!important;
  }
  body.crm-premium :is(dialog:not([open]),.modal-layer[hidden]),
  body.crm-premium :is(dialog:not([open]),.modal-layer[hidden]) *,
  body.crm-premium :is(dialog:not([open]),.modal-layer[hidden]) *::before,
  body.crm-premium :is(dialog:not([open]),.modal-layer[hidden]) *::after{
    animation-play-state:paused!important;
  }
}
