/* Shahr Vam v530 — focused UI polish: referral table + right-sidebar motion.
   Loaded after the stable bundle so it can safely correct legacy table geometry. */

/* --- Credit-referral table: dense, aligned, full-width managerial layout --- */
body[data-page="sales-operations"] .sm240-referrals-section{
  overflow:hidden!important;
  padding:9px 10px 10px!important;
}
body[data-page="sales-operations"] .sm240-referrals-section>header{
  margin-bottom:7px!important;
}
body[data-page="sales-operations"] .sm240-referrals-table-wrap{
  box-sizing:border-box!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  overflow-x:auto!important;
  overflow-y:visible!important;
  border:1px solid rgba(115,162,199,.35)!important;
  border-radius:12px!important;
  background:rgba(255,255,255,.55)!important;
  scrollbar-gutter:stable;
}
body[data-page="sales-operations"] .sm240-referrals-table{
  width:100%!important;
  min-width:900px!important;
  table-layout:fixed!important;
  border-collapse:separate!important;
  border-spacing:0!important;
  font-size:11.5px!important;
}
body[data-page="sales-operations"] .sm240-referrals-table col.sm240-ref-col-index{width:52px!important}
body[data-page="sales-operations"] .sm240-referrals-table col.sm240-ref-col-customer{width:28%!important}
body[data-page="sales-operations"] .sm240-referrals-table col.sm240-ref-col-sent{width:150px!important}
body[data-page="sales-operations"] .sm240-referrals-table col.sm240-ref-col-topic{width:auto!important}
body[data-page="sales-operations"] .sm240-referrals-table col.sm240-ref-col-status{width:160px!important}
body[data-page="sales-operations"] .sm240-referrals-table col.sm240-ref-col-actions{width:126px!important}
body[data-page="sales-operations"] .sm240-referrals-table thead th{
  box-sizing:border-box!important;
  height:38px!important;
  padding:7px 9px!important;
  background:#0d3157!important;
  color:#fff!important;
  border-inline-start:1px solid rgba(255,255,255,.12)!important;
  border-bottom:0!important;
  font-size:10.8px!important;
  font-weight:800!important;
  line-height:1.35!important;
  text-align:center!important;
  white-space:nowrap!important;
  vertical-align:middle!important;
}
body[data-page="sales-operations"] .sm240-referrals-table thead th:first-child{border-start-start-radius:10px!important}
body[data-page="sales-operations"] .sm240-referrals-table thead th:last-child{border-start-end-radius:10px!important;border-inline-start:0!important}
body[data-page="sales-operations"] .sm240-referrals-table tbody tr{
  height:60px!important;
  min-height:60px!important;
  background:rgba(255,255,255,.72)!important;
  transition:background-color .16s ease,box-shadow .16s ease!important;
}
body[data-page="sales-operations"] .sm240-referrals-table tbody tr:nth-child(even){background:rgba(244,249,252,.88)!important}
body[data-page="sales-operations"] .sm240-referrals-table tbody tr:hover{
  background:#f0f7fb!important;
  box-shadow:inset -3px 0 0 rgba(22,118,200,.45)!important;
}
body[data-page="sales-operations"] .sm240-referrals-table tbody td{
  box-sizing:border-box!important;
  height:60px!important;
  padding:6px 9px!important;
  border-bottom:1px solid rgba(115,162,199,.24)!important;
  border-inline-start:0!important;
  vertical-align:middle!important;
  color:#0d3157!important;
  overflow:hidden!important;
  text-align:center!important;
}
body[data-page="sales-operations"] .sm240-referrals-table tbody tr:last-child td{border-bottom:0!important}
body[data-page="sales-operations"] .sm240-referrals-table :is(.sm240-referral-index,.tiam-row-number-cell){
  width:52px!important;min-width:52px!important;max-width:52px!important;
  padding-inline:5px!important;
  text-align:center!important;
  color:rgba(13,49,87,.68)!important;
  font-variant-numeric:tabular-nums;
}
body[data-page="sales-operations"] .sm240-referrals-table thead .sm240-referral-index{color:#fff!important}
body[data-page="sales-operations"] .sm240-referral-customer{text-align:right!important;direction:rtl!important}
body[data-page="sales-operations"] .sm240-referral-customer-main{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  grid-template-areas:"name phone" "meta phone"!important;
  align-items:center!important;
  column-gap:10px!important;
  row-gap:2px!important;
  min-width:0!important;
}
body[data-page="sales-operations"] .sm240-referral-customer-main>b{
  grid-area:name!important;
  display:block!important;
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-size:12.2px!important;
  font-weight:800!important;
  line-height:1.45!important;
  color:#0b2d50!important;
}
body[data-page="sales-operations"] .sm240-referral-customer-main>small{
  grid-area:meta!important;
  display:block!important;
  margin:0!important;
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  color:rgba(13,49,87,.56)!important;
  font-size:9.8px!important;
  line-height:1.4!important;
}
body[data-page="sales-operations"] .sm240-referral-contact{
  grid-area:phone!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-width:104px!important;
  max-width:118px!important;
  padding:3px 7px!important;
  border:1px solid rgba(115,162,199,.34)!important;
  border-radius:7px!important;
  background:rgba(239,247,252,.82)!important;
  color:#214f73!important;
  font-size:10.3px!important;
  line-height:1.3!important;
  direction:ltr!important;
  unicode-bidi:isolate!important;
  white-space:nowrap!important;
}
body[data-page="sales-operations"] .sm240-referral-date{
  display:grid!important;
  place-items:center!important;
  gap:2px!important;
  direction:ltr!important;
  unicode-bidi:isolate!important;
}
body[data-page="sales-operations"] .sm240-referral-date>b{font-size:10.8px!important;font-weight:750!important;color:#173f63!important}
body[data-page="sales-operations"] .sm240-referral-date>small{margin:0!important;font-size:9.8px!important;color:rgba(13,49,87,.55)!important}
body[data-page="sales-operations"] .sm240-referral-topic{text-align:center!important}
body[data-page="sales-operations"] .sm240-referrals-table .sm240-reason{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-size:11px!important;
  line-height:1.45!important;
  color:#173f63!important;
}
body[data-page="sales-operations"] .sm240-referral-status .so-badge,
body[data-page="sales-operations"] .sm240-referral-status :is(.badge,.sm148-badge){
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  max-width:146px!important;
  min-height:25px!important;
  padding:3px 9px!important;
  border-radius:999px!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-size:10px!important;
  font-weight:800!important;
}
body[data-page="sales-operations"] .sm240-referral-actions-cell{overflow:visible!important;text-align:center!important}
body[data-page="sales-operations"] .sm240-referrals-table .sm240-row-actions{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:5px!important;
  padding:3px!important;
  border:1px solid rgba(115,162,199,.28)!important;
  border-radius:9px!important;
  background:rgba(245,250,253,.72)!important;
  white-space:nowrap!important;
}
body[data-page="sales-operations"] .sm240-referrals-table .sm240-icon-action{
  width:29px!important;height:29px!important;min-width:29px!important;
  border-radius:8px!important;
  transition:transform .14s ease,background-color .14s ease,border-color .14s ease,box-shadow .14s ease!important;
}
body[data-page="sales-operations"] .sm240-referrals-table .sm240-icon-action:hover:not(:disabled){
  transform:translateY(-1px)!important;
  box-shadow:0 3px 8px rgba(13,49,87,.10)!important;
}
body[data-page="sales-operations"] .sm240-referrals-table .sm240-open-case-action{
  border-color:rgba(13,49,87,.30)!important;
  background:#0d3157!important;
  color:#fff!important;
}
body[data-page="sales-operations"] .sm240-referrals-table .sm240-open-case-action:hover:not(:disabled){background:#17466f!important;border-color:#17466f!important}
@media (max-width:1180px){
  body[data-page="sales-operations"] .sm240-referrals-table{min-width:840px!important}
  body[data-page="sales-operations"] .sm240-referrals-table col.sm240-ref-col-customer{width:250px!important}
  body[data-page="sales-operations"] .sm240-referrals-table col.sm240-ref-col-sent{width:132px!important}
  body[data-page="sales-operations"] .sm240-referrals-table col.sm240-ref-col-status{width:142px!important}
}

/* --- Right sidebar motion: restrained, fast, and respectful of reduced-motion --- */
body.tiam-right-sidebar-mode #app-shell>.sidebar{
  isolation:isolate!important;
}
body.tiam-right-sidebar-mode .tiam-sidebar-brand{
  position:relative!important;
  overflow:hidden!important;
}
body.tiam-right-sidebar-mode .tiam-sidebar-brand::after{
  content:"";
  position:absolute;
  inset-inline:-35%;
  bottom:-1px;
  height:1px;
  background:linear-gradient(90deg,transparent,rgba(214,170,80,.8),transparent);
  transform:translateX(42%);
  opacity:.65;
  animation:tiamBrandSweep 4.8s ease-in-out infinite;
  pointer-events:none;
}
body.tiam-right-sidebar-mode .tiam-sidebar-brand b{
  letter-spacing:-.15px!important;
}
body.tiam-right-sidebar-mode #main-nav :is(.nav-item,.side-nav-trigger){
  position:relative!important;
  overflow:hidden!important;
  transition:background-color .17s ease,border-color .17s ease,color .17s ease,box-shadow .17s ease,translate .17s ease!important;
}
body.tiam-right-sidebar-mode .tiam-sidebar-motion-ready #main-nav :is(.nav-item,.side-nav-trigger):not([hidden]):not(.permission-hidden):not([aria-hidden="true"]){
  animation:tiamSidebarItemIn .28s cubic-bezier(.2,.75,.25,1) both;
  animation-delay:calc(min(var(--tiam-nav-order,0),12) * 22ms);
}
body.tiam-right-sidebar-mode #main-nav :is(.nav-item,.side-nav-trigger)::after{
  content:"";
  position:absolute;
  inset-inline-end:0;
  top:7px;
  bottom:7px;
  width:3px;
  border-radius:999px;
  background:#d6aa50;
  opacity:0;
  transform:scaleY(.35);
  transition:opacity .18s ease,transform .18s ease;
  pointer-events:none;
}
body.tiam-right-sidebar-mode #main-nav :is(.nav-item,.side-nav-trigger):hover{
  translate:-3px 0!important;
}
body.tiam-right-sidebar-mode #main-nav .nav-item.active,
body.tiam-right-sidebar-mode #main-nav .side-nav-group.current>.side-nav-trigger,
body.tiam-right-sidebar-mode #main-nav .side-nav-trigger[aria-expanded="true"]{
  box-shadow:none!important;
}
body.tiam-right-sidebar-mode #main-nav .nav-item.active::after,
body.tiam-right-sidebar-mode #main-nav .side-nav-group.current>.side-nav-trigger::after,
body.tiam-right-sidebar-mode #main-nav .side-nav-trigger[aria-expanded="true"]::after{
  opacity:1;
  transform:scaleY(1);
}
body.tiam-right-sidebar-mode #main-nav .side-nav-trigger>i{
  transition:transform .2s ease,color .2s ease!important;
  transform-origin:center!important;
}
body.tiam-right-sidebar-mode #main-nav .side-nav-trigger[aria-expanded="true"]>i,
body.tiam-right-sidebar-mode #main-nav .side-nav-group.open>.side-nav-trigger>i{
  transform:rotate(180deg)!important;
  color:#efd38d!important;
}
body.tiam-right-sidebar-mode #main-nav .side-nav-panel{
  display:grid!important;
  max-height:0!important;
  margin-block:0!important;
  padding-block:0!important;
  opacity:0!important;
  visibility:hidden!important;
  overflow:hidden!important;
  translate:0 -4px!important;
  transition:max-height .24s cubic-bezier(.2,.75,.25,1),opacity .18s ease,translate .22s ease,margin .22s ease,padding .22s ease!important;
}
body.tiam-right-sidebar-mode #main-nav .side-nav-group.open>.side-nav-panel{
  max-height:440px!important;
  margin:2px 0 4px!important;
  padding:3px 8px 3px 0!important;
  opacity:1!important;
  visibility:visible!important;
  translate:0 0!important;
}
body.tiam-right-sidebar-mode #main-nav .side-nav-panel .nav-item:hover{translate:-2px 0!important}
@keyframes tiamSidebarItemIn{from{opacity:0;translate:8px 0}to{opacity:1;translate:0 0}}
@keyframes tiamBrandSweep{0%,68%{transform:translateX(42%);opacity:0}76%{opacity:.7}100%{transform:translateX(-42%);opacity:0}}
@media (prefers-reduced-motion:reduce){
  body.tiam-right-sidebar-mode .tiam-sidebar-brand::after{animation:none!important;opacity:0!important}
  body.tiam-right-sidebar-mode .tiam-sidebar-motion-ready #main-nav :is(.nav-item,.side-nav-trigger){animation:none!important}
  body.tiam-right-sidebar-mode #main-nav :is(.nav-item,.side-nav-trigger),
  body.tiam-right-sidebar-mode #main-nav .side-nav-panel,
  body.tiam-right-sidebar-mode #main-nav .side-nav-trigger>i{transition:none!important;translate:0 0!important}
}
