/* Rasid v18 — responsive work registration and full-height navigation */
html,body{max-width:100%;min-height:100%;overflow-x:hidden}
body{min-width:0}
.shell{width:100%;min-height:100vh;align-items:stretch;grid-template-columns:260px minmax(0,1fr)!important;overflow:visible}
.shell>main,.shell main,#content{min-width:0;max-width:100%}
.shell>main{min-height:100vh;overflow-x:hidden}
.shell>aside{
  align-self:stretch!important;
  position:sticky!important;
  inset-block-start:0!important;
  height:100vh!important;
  min-height:100vh!important;
  max-height:100vh!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  overscroll-behavior:contain;
  background:linear-gradient(180deg,#00513a 0%,#00452f 60%,#003d2b 100%)!important;
  scrollbar-width:thin;
  scrollbar-color:rgba(255,255,255,.35) transparent;
}
.shell>aside::-webkit-scrollbar{width:6px}.shell>aside::-webkit-scrollbar-thumb{background:rgba(255,255,255,.32);border-radius:10px}
.shell>aside .logo{flex:0 0 auto}
.shell>aside #nav{display:grid!important;flex:0 0 auto!important;justify-content:initial!important;overflow:visible!important;min-height:auto!important;width:100%}
.shell>aside .aside-foot{display:grid!important;flex:0 0 auto;margin-top:auto!important;background:transparent}
.shell>aside #nav>.nav-logout{margin-top:6px!important}

/* Registration screen: lookup always first, centered, and contained */
.lab-work-form{width:100%!important;max-width:100%!important;min-width:0!important;overflow:hidden!important}
.lab-work-form>.v14-panel-body{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:16px!important;
  align-items:start!important;
}
.lab-work-form>.v14-panel-body>.license-lookup,
.lab-work-form>.license-lookup{
  order:-100!important;
  grid-column:1/-1!important;
  justify-self:center!important;
  width:min(100%,960px)!important;
  max-width:960px!important;
  min-width:0!important;
  margin:0 auto 8px!important;
  padding:22px clamp(14px,2vw,26px)!important;
  overflow:hidden!important;
  direction:rtl!important;
}
.lab-work-form .license-lookup .section-title{width:100%;text-align:center;justify-content:center;min-width:0}
.lab-work-form .license-lookup .section-title>div{width:100%;min-width:0}
.lab-work-form .license-lookup h3,.lab-work-form .license-lookup p{max-width:100%;overflow-wrap:anywhere}
.lab-work-form .license-search-row{
  width:min(100%,720px)!important;
  max-width:720px!important;
  min-width:0!important;
  margin-inline:auto!important;
  grid-template-columns:minmax(0,1fr) minmax(170px,220px)!important;
  gap:12px!important;
  align-items:end!important;
}
.lab-work-form .license-search-row>*{min-width:0!important;max-width:100%}
.lab-work-form .license-search-row label{width:100%;min-width:0}
.lab-work-form input,.lab-work-form select,.lab-work-form textarea,.lab-work-form button{max-width:100%}
.lab-work-form input,.lab-work-form select,.lab-work-form textarea{width:100%;min-width:0}
.lab-work-form .license-search-row .primary{width:100%!important;min-width:0!important;white-space:normal;line-height:1.35;margin:0!important}
.lab-work-form .license-lookup-message,.lab-work-form .license-found-card,.lab-work-form .new-license-panel{width:min(100%,760px)!important;max-width:760px!important;min-width:0!important;margin-inline:auto!important}
.lab-work-form .license-lookup-message>*{min-width:0;overflow-wrap:anywhere}
.lab-work-form .license-found-card dl{grid-template-columns:repeat(auto-fit,minmax(150px,1fr))!important}
.lab-work-form .new-license-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
.lab-work-form .layer-builder,.lab-work-form .form-actions,.lab-work-form label.full{grid-column:1/-1!important;min-width:0!important}
.layer-builder-row{max-width:100%;min-width:0;overflow:hidden;grid-template-columns:auto repeat(5,minmax(115px,1fr)) minmax(130px,.8fr) auto!important}
.layer-builder-row>*{min-width:0;max-width:100%}
#content{padding-inline:clamp(14px,2vw,26px)!important}

@media(max-width:1050px){
  .shell{grid-template-columns:220px minmax(0,1fr)!important}
  .layer-builder-row{grid-template-columns:auto repeat(3,minmax(130px,1fr))!important}
}
@media(max-width:800px){
  .lab-work-form>.v14-panel-body{grid-template-columns:1fr!important}
  .lab-work-form>.v14-panel-body>*{grid-column:1!important}
  .lab-work-form>.v14-panel-body>.license-lookup{grid-column:1!important}
  .lab-work-form .license-search-row{grid-template-columns:1fr!important}
  .lab-work-form .new-license-grid{grid-template-columns:1fr!important}
  .layer-builder-row{grid-template-columns:1fr 1fr!important}
  .layer-builder-row .layer-number,.layer-builder-row .icon-danger{grid-column:auto}
}
@media(max-width:720px){
  .shell{display:block!important}
  .shell>aside{position:relative!important;height:auto!important;min-height:auto!important;max-height:none!important;width:100%!important;overflow:visible!important;background:linear-gradient(180deg,#00513a,#003d2b)!important}
  .shell>aside #nav{overflow:visible!important}
  .lab-work-form .license-lookup{padding:16px!important}
  .layer-builder-row{grid-template-columns:1fr!important}
  #content{padding:14px!important}
}
.shell.sidebar-collapsed{grid-template-columns:86px minmax(0,1fr)!important}
.shell>aside #nav>.nav-logout{display:none!important}
@media(max-width:720px){.shell.sidebar-collapsed{display:block!important}.shell.sidebar-collapsed>aside{width:100%!important}}

/* v19 correction — keep navigation narrow on the right and extend only to viewport bottom */
:root{--rasid-ribbon-height:39px;--rasid-sidebar-width:280px}
.shell{
  grid-template-columns:minmax(0,1fr) var(--rasid-sidebar-width)!important;
  min-height:calc(100vh - var(--rasid-ribbon-height))!important;
  min-height:calc(100dvh - var(--rasid-ribbon-height))!important;
  align-items:stretch!important;
  direction:ltr!important;
}
.shell>main{grid-column:1!important;grid-row:1!important;min-width:0!important;width:auto!important}
.shell>aside{
  grid-column:2!important;
  grid-row:1!important;
  width:var(--rasid-sidebar-width)!important;
  min-width:var(--rasid-sidebar-width)!important;
  max-width:var(--rasid-sidebar-width)!important;
  height:calc(100vh - var(--rasid-ribbon-height))!important;
  min-height:calc(100vh - var(--rasid-ribbon-height))!important;
  max-height:calc(100vh - var(--rasid-ribbon-height))!important;
  height:calc(100dvh - var(--rasid-ribbon-height))!important;
  min-height:calc(100dvh - var(--rasid-ribbon-height))!important;
  max-height:calc(100dvh - var(--rasid-ribbon-height))!important;
  position:sticky!important;
  top:var(--rasid-ribbon-height)!important;
  align-self:start!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
}
.shell.sidebar-collapsed{grid-template-columns:minmax(0,1fr) 86px!important}
.shell.sidebar-collapsed>aside{width:86px!important;min-width:86px!important;max-width:86px!important}
@media(max-width:980px) and (min-width:721px){:root{--rasid-sidebar-width:230px}}
@media(max-width:720px){
  .shell{display:block!important;min-height:auto!important}
  .shell>aside{position:relative!important;top:auto!important;width:100%!important;min-width:0!important;max-width:none!important;height:auto!important;min-height:auto!important;max-height:none!important}
  .shell>main{width:100%!important}
}

/* v20 — exact centering of laboratory license lookup with zero horizontal overflow */
.lab-work-form{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  overflow-x:clip!important;
}
.lab-work-form>.license-lookup{
  grid-column:1 / -1!important;
  place-self:start center!important;
  width:min(820px,calc(100% - 32px))!important;
  max-width:820px!important;
  min-width:0!important;
  margin:0 auto 18px!important;
  left:auto!important;
  right:auto!important;
  transform:none!important;
}
.lab-work-form>.license-lookup,
.lab-work-form>.license-lookup *{
  box-sizing:border-box!important;
  max-width:100%;
}
.lab-work-form>.license-lookup h3,
.lab-work-form>.license-lookup p,
.lab-work-form>.license-lookup b,
.lab-work-form>.license-lookup span,
.lab-work-form>.license-lookup label{
  overflow-wrap:anywhere!important;
  word-break:normal!important;
  white-space:normal!important;
}
.lab-work-form>.license-lookup .license-search-row{
  width:min(100%,650px)!important;
  margin-left:auto!important;
  margin-right:auto!important;
  grid-template-columns:minmax(0,1fr) minmax(150px,210px)!important;
}
.lab-work-form>.license-lookup input,
.lab-work-form>.license-lookup button{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
}
@media(max-width:800px){
  .lab-work-form{grid-template-columns:1fr!important}
  .lab-work-form>.license-lookup{grid-column:1!important;width:calc(100% - 16px)!important;padding:16px!important}
  .lab-work-form>.license-lookup .license-search-row{grid-template-columns:1fr!important}
}
@media(max-width:420px){
  .lab-work-form>.license-lookup{width:100%!important;padding:12px!important}
}
