/* TSA RESPONSIVE FIT — Admin
   Layout fit only; admin functionality and visual system remain unchanged. */
html,body{width:100%;max-width:100%;overflow-x:hidden}
.layout,.workspace,.workspace main,.tab,.panel,.grid2,.row2,.row3,.checkgrid,.dashcards,.api-simple-grid{min-width:0;max-width:100%}
.layout>*{min-width:0}
.panel>*{min-width:0}
img,svg,video,canvas,iframe{max-width:100%}
input,textarea,select,button{max-width:100%;min-width:0}
textarea{max-width:100%}
pre,code{max-width:100%;overflow:auto;overflow-wrap:anywhere;white-space:pre-wrap}
.item>*{min-width:0}
.item>div:first-child{overflow-wrap:anywhere}
.actions{max-width:100%}
.filterbar{flex-wrap:wrap}
.filterbar select{flex:1 1 180px;max-width:100%}
.api-source-row>*{min-width:0}
.workspace header>*{min-width:0}

@media(max-width:900px){
  .layout{grid-template-columns:minmax(0,1fr)!important}
  aside{height:auto!important;position:relative!important;padding:14px 12px!important}
  .aside-brand{padding-bottom:12px!important}
  aside nav{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:5px!important}
  aside nav button,.logout{min-width:0!important;text-align:center!important;padding:10px 7px!important;white-space:normal!important;overflow-wrap:anywhere}
  .logout{margin:8px 0 0!important;width:100%}
  .workspace{width:100%;min-width:0}
  .workspace header{height:auto!important;min-height:68px;position:relative!important;padding:10px 18px!important;gap:10px;flex-wrap:wrap}
  .workspace header>div{flex:1 1 240px}
  .workspace header a{flex:0 0 auto;white-space:nowrap}
  .workspace main{width:100%;padding:18px!important}
  .dashcards{grid-template-columns:repeat(3,minmax(0,1fr))!important}
}

@media(max-width:760px){
  .grid2,.api-simple-grid{grid-template-columns:minmax(0,1fr)!important}
  .row2{grid-template-columns:minmax(0,1fr)!important}
  .dashcards{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .checkgrid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .panelhead,.item,.health-row,.api-main-line{flex-wrap:wrap;align-items:flex-start!important}
  .panelhead>*:first-child,.item>*:first-child,.health-row>*:first-child,.api-main-line>*:first-child{flex:1 1 220px;min-width:0}
  .item .actions{flex:1 1 100%;justify-content:flex-start}
  .api-source-row{grid-template-columns:minmax(0,1fr)!important}
  .api-source-right{text-align:left!important}
  .stock-meta-toggle{min-width:0}
}

@media(max-width:600px){
  .workspace main{padding:10px!important}
  .panel{padding:14px!important;border-radius:14px}
  aside nav{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .dashcards,.checkgrid{grid-template-columns:minmax(0,1fr)!important}
  .row3{grid-template-columns:minmax(0,1fr)!important}
  .workspace header{padding:10px 12px!important}
  .workspace header h2{font-size:clamp(18px,6vw,24px)}
  .workspace header a{font-size:12px}
  .actions{gap:6px!important}
  .actions button,.primary,.panelhead button{flex:1 1 auto;min-height:38px}
  .item{gap:8px!important}
  .api-meta{gap:6px!important}
  .api-meta span{max-width:100%;overflow-wrap:anywhere}
  .toast{left:10px!important;right:10px!important;bottom:max(10px,env(safe-area-inset-bottom))!important;text-align:center}
}

@media(max-width:380px){
  aside nav{grid-template-columns:minmax(0,1fr)!important}
  .workspace header>div{flex-basis:100%}
  .workspace header a{width:100%;text-align:center}
  .panel{padding:12px!important}
  .code{font-size:11px!important}
}
