/* ORIK V793 — PostgreSQL baseline UI/performance polish
   Responsive rules follow content needs and maintain 44px touch targets.
   This file intentionally loads AFTER V788 runtime/login styles. */

:root{
  --v793-logo-bg:#ffffff;
  --v793-logo-border:#dfe7ee;
  --v793-logo-shadow:0 14px 36px rgba(0,0,0,.18);
  --v793-touch:44px;
}

/* ARAD logo: user requirement — white surface everywhere, including splash/AFK/login. */
#splash .arad-splash-full-v772,
img[src*="arad-smart-panel-v772"],
img[src*="arad-dashboard-v760"]{
  background:var(--v793-logo-bg)!important;
}
#splash .arad-splash-full-v772{
  width:min(620px,72vw)!important;
  max-height:38vh!important;
  padding:14px 20px!important;
  border:1px solid rgba(223,231,238,.95)!important;
  border-radius:20px!important;
  box-shadow:var(--v793-logo-shadow)!important;
  filter:none!important;
}
.idle-brand-row-v771>span:has(img[src*="arad-dashboard-v760"]){
  background:#fff!important;
  border:1px solid var(--v793-logo-border)!important;
  border-radius:16px!important;
  padding:7px!important;
  box-shadow:0 10px 26px rgba(0,0,0,.18)!important;
}
.idle-brand-row-v771 img[src*="arad-dashboard-v760"]{
  background:#fff!important;
  border:0!important;
  border-radius:10px!important;
}

/* Login gets the ARAD identity explicitly, on a guaranteed white surface. */
.login-arad-brand-v793{
  display:flex;
  width:min(100%,260px);
  min-height:74px;
  margin:0 auto 12px;
  align-items:center;
  justify-content:center;
  padding:10px 14px;
  background:#fff;
  border:1px solid var(--v793-logo-border);
  border-radius:16px;
  box-shadow:0 10px 28px rgba(0,0,0,.16);
}
.login-arad-brand-v793 img{
  display:block;
  width:100%;
  max-width:220px;
  height:58px;
  object-fit:contain;
  background:#fff!important;
}
.login-company-mark-v770{margin-top:0!important}

/* Shared topbar: predictable sizing, no overlap. */
html body.cinema-v781 .topbar{
  min-width:0;
}
html body.cinema-v781 .topbar>*{
  min-width:0;
}
html body.cinema-v781 .topbar>.top-actions{
  position:static!important;
  z-index:auto!important;
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
  flex-wrap:wrap!important;
  max-width:100%!important;
}
html body.cinema-v781 .topbar>.top-actions :is(button,a,.report-button,.sds-btn){
  min-height:var(--v793-touch)!important;
  min-width:var(--v793-touch)!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  white-space:nowrap!important;
}
html body.cinema-v781 .profile-actions{
  position:relative!important;
  z-index:2!important;
  min-height:var(--v793-touch)!important;
}
html body.cinema-v781 :is(.account-menu-toggle,.topbar-logout-v783,.nav-menu-v781){
  min-width:var(--v793-touch)!important;
  min-height:var(--v793-touch)!important;
}
html body.cinema-v781 :is(.report-button,.account-menu-toggle,.topbar-logout-v783,.nav-menu-v781):focus-visible{
  outline:2px solid var(--orik-focus,#55b7ff)!important;
  outline-offset:2px!important;
}

/* Desktop keeps the established layout. */
@media (min-width:1200px){
  html body.cinema-v781 .topbar{
    display:grid!important;
    direction:ltr!important;
    grid-template-columns:auto auto minmax(280px,440px) minmax(220px,1fr)!important;
    grid-template-areas:"profile actions search headline"!important;
    align-items:center!important;
    column-gap:12px!important;
    row-gap:8px!important;
  }
  html body.cinema-v781 .topbar>*{direction:rtl!important}
  html body.cinema-v781 .topbar>.profile-actions{grid-area:profile!important;justify-self:start!important}
  html body.cinema-v781 .topbar>.top-actions{grid-area:actions!important;justify-self:start!important}
  html body.cinema-v781 .topbar>.header-search-v781{grid-area:search!important;width:100%!important;max-width:440px!important}
  html body.cinema-v781 .topbar>.headline{grid-area:headline!important;justify-self:stretch!important}
}

/* Tablet: actions get their own row, so print can never sit behind account controls. */
@media (min-width:801px) and (max-width:1199px){
  html body.cinema-v781 .topbar{
    display:grid!important;
    direction:ltr!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    grid-template-areas:
      "headline profile"
      "search actions"!important;
    align-items:center!important;
    gap:10px 12px!important;
  }
  html body.cinema-v781 .topbar>*{direction:rtl!important}
  html body.cinema-v781 .topbar>.headline{
    grid-area:headline!important;
    justify-self:stretch!important;
  }
  html body.cinema-v781 .topbar>.profile-actions{
    grid-area:profile!important;
    justify-self:start!important;
    margin:0!important;
  }
  html body.cinema-v781 .topbar>.header-search-v781{
    grid-area:search!important;
    display:flex!important;
    width:100%!important;
    max-width:none!important;
    justify-self:stretch!important;
  }
  html body.cinema-v781 .topbar>.top-actions{
    grid-area:actions!important;
    justify-self:start!important;
    align-self:stretch!important;
  }
  html body.page-debtors.cinema-v781 .topbar>.top-actions .report-button{
    min-width:160px!important;
  }
}

/* Phones: headline/account stay compact, page actions become a safe full-width row. */
@media (max-width:800px){
  html body.cinema-v781 .topbar{
    display:grid!important;
    direction:ltr!important;
    grid-template-columns:auto minmax(0,1fr) auto!important;
    grid-template-areas:
      "menu headline profile"
      "actions actions actions"!important;
    gap:10px!important;
    align-items:center!important;
    padding-bottom:12px!important;
  }
  html body.cinema-v781 .topbar>*{direction:rtl!important}
  html body.cinema-v781 .topbar>.nav-menu-v781{
    grid-area:menu!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    margin:0!important;
  }
  html body.cinema-v781 .topbar>.headline{
    grid-area:headline!important;
    min-width:0!important;
  }
  html body.cinema-v781 .topbar>.headline h1{
    font-size:18px!important;
    line-height:1.45!important;
  }
  html body.cinema-v781 .topbar>.headline p{
    white-space:normal!important;
    line-height:1.65!important;
  }
  html body.cinema-v781 .topbar>.profile-actions{
    grid-area:profile!important;
    justify-self:end!important;
    margin:0!important;
    padding:4px!important;
    gap:5px!important;
  }
  html body.cinema-v781 .topbar>.header-search-v781{display:none!important}
  html body.cinema-v781 .topbar>.top-actions{
    grid-area:actions!important;
    width:100%!important;
    justify-self:stretch!important;
  }
  html body.cinema-v781 .topbar>.top-actions>*{
    flex:1 1 160px!important;
  }
  html body.page-debtors.cinema-v781 .topbar>.top-actions .report-button{
    width:100%!important;
    flex:1 1 100%!important;
  }
}

/* Very narrow phones: logout remains available inside account menu, free topbar space. */
@media (max-width:520px){
  html body.cinema-v781 .profile-label-v781{display:none!important}
  html body.cinema-v781 .topbar-logout-v783{display:none!important}
  html body.cinema-v781 .topbar{
    grid-template-columns:var(--v793-touch) minmax(0,1fr) var(--v793-touch)!important;
  }
  .login-arad-brand-v793{
    width:100%;
    min-height:68px;
    padding:8px 12px;
  }
  .login-arad-brand-v793 img{height:52px}
}

/* Receivables: component-level responsive cleanup. */
body.page-debtors .receivable-summary,
body.page-debtors .receivable-toolbar,
body.page-debtors .receivable-v684-panel,
body.page-debtors .debtors-full{
  min-width:0!important;
  max-width:100%!important;
}
body.page-debtors .receivable-sms-link{
  min-height:var(--v793-touch)!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:0 14px!important;
  border:1px solid #1f5b63!important;
  border-radius:9px!important;
  background:#0a2a31!important;
  color:#baf7ea!important;
  text-decoration:none!important;
  text-align:center!important;
}
body.page-debtors .receivable-toolbar form :is(input,button),
body.page-debtors .chart-range-selector :is(select,input,button){
  min-height:var(--v793-touch)!important;
}
body.page-debtors .receivable-v684-chart-scroll{
  width:100%!important;
  max-width:100%!important;
  overflow-x:auto!important;
  overscroll-behavior-inline:contain;
  -webkit-overflow-scrolling:touch;
  scrollbar-gutter:stable;
}
body.page-debtors .debtor-full-row.debtor-balance-only-full{
  min-width:0!important;
}
body.page-debtors .debtor-full-row.debtor-balance-only-full>*{
  min-width:0!important;
}
body.page-debtors .debtor-full-row.debtor-balance-only-full b{
  overflow-wrap:anywhere;
}

@media (max-width:1000px){
  body.page-debtors .receivable-summary{
    grid-template-columns:1fr 1fr!important;
  }
  body.page-debtors .receivable-total-card{
    grid-column:1/-1!important;
    grid-row:auto!important;
  }
  body.page-debtors .receivable-toolbar{
    grid-template-columns:1fr 1fr!important;
  }
  body.page-debtors .receivable-toolbar form,
  body.page-debtors .receivable-sms-link{
    grid-column:1/-1!important;
  }
}
@media (max-width:700px){
  body.page-debtors .receivable-summary,
  body.page-debtors .receivable-toolbar,
  body.page-debtors .chart-range-selector,
  body.page-debtors .custom-range-inline.show{
    grid-template-columns:1fr!important;
  }
  body.page-debtors .receivable-toolbar form{
    grid-template-columns:1fr!important;
  }
  body.page-debtors .receivable-toolbar form button,
  body.page-debtors .chart-range-selector button{
    width:100%!important;
  }
  body.page-debtors .receivable-fixed-detail{
    grid-template-columns:1fr 1fr!important;
  }
  body.page-debtors .receivable-v684-chart{
    min-width:max(620px,calc(var(--periods) * 58px))!important;
    height:260px!important;
  }
}
@media (max-width:460px){
  body.page-debtors .receivable-fixed-detail{
    grid-template-columns:1fr!important;
  }
  body.page-debtors .debtor-full-row.debtor-balance-only-full{
    grid-template-columns:32px minmax(0,1fr)!important;
    gap:6px!important;
    padding:10px 8px!important;
  }
  body.page-debtors .debtor-full-row.debtor-balance-only-full strong{
    grid-column:2!important;
    text-align:right!important;
  }
}

/* Do not let the responsive screen rules leak into print. */
@media print{
  .login-arad-brand-v793{box-shadow:none!important}
  body.page-debtors .topbar{display:none!important}
}
