/* Responsive administrative shell: desktop sidebar becomes an accessible mobile drawer.
   Loaded after admin.css/admin-mobile.css so old media queries cannot trap the content. */
html{max-width:100%;scroll-behavior:smooth}
body{max-width:100%;overflow-x:clip}
.app-shell{min-width:0}
.main-content{min-width:0}
.panel,.module-panel,.lower-grid,.stats-grid,.gm-pix-panel{min-width:0}
.admin-mobile-top,.admin-mobile-shade{display:none}
.product-row>div{min-width:0;flex:1}
.product-row small{overflow-wrap:anywhere}
.product-row .product-open{min-height:36px}
.product-status.test-ready{background:#eef4ff;color:#3f58b8;border-radius:7px;padding:6px 8px;font-size:10px;font-weight:700}
.product-logo.gamelife{background:#f1edff;color:#6b4bdb}
.product-logo.obras{background:#fff0e4;color:#bb6628}
.product-tab .gamelife{background:#f1edff;color:#6b4bdb}
.product-tab .obras{background:#fff0e4;color:#bb6628}
.sidebar :is(a,button),.admin-mobile-top button{touch-action:manipulation}
@media (max-width:1024px){
 .preview-bar{min-height:30px;height:auto;padding:7px 12px;flex-wrap:wrap;text-align:center;gap:5px}
 .admin-mobile-top{
  position:sticky;top:0;z-index:90;display:flex;align-items:center;justify-content:space-between;gap:12px;
  width:100%;padding:10px 16px;background:#0d1a38;color:#fff;border-bottom:1px solid #ffffff22;
 }
 .admin-mobile-home{display:flex;align-items:center;gap:10px;min-width:0;color:white;text-decoration:none;font-size:14px;font-weight:800}
 .admin-mobile-home .brand-mark{width:35px;height:35px;flex:none;border-radius:10px;font-size:17px}
 .admin-mobile-top button{display:flex;align-items:center;gap:8px;min-height:44px;padding:9px 14px;border:1px solid #ffffff4b;background:#ffffff16;border-radius:11px;color:#fff;font:700 14px 'DM Sans',sans-serif;cursor:pointer}
 .app-shell{display:block!important;width:100%!important;min-height:calc(100dvh - 95px);min-width:0!important;grid-template-columns:none!important}
 .app-shell .sidebar{
  position:fixed!important;inset:0 auto 0 0!important;z-index:110;
  width:min(320px,88vw)!important;max-width:88vw!important;
  height:100dvh!important;min-height:0!important;
  display:flex!important;flex-direction:column!important;align-items:stretch!important;
  gap:0!important;flex-wrap:nowrap!important;overflow-x:hidden!important;overflow-y:auto!important;
  background:#0d1933!important;padding:26px 18px!important;
  border-right:1px solid #354362;box-shadow:20px 0 50px #07112555;
  transform:translateX(-105%);visibility:hidden;pointer-events:none;
  transition:transform .24s ease,visibility .24s ease;
 }
 .app-shell .sidebar .brand{display:flex!important;align-items:center!important;flex:none!important;padding:0 4px 24px!important;margin:0!important}
 .app-shell .sidebar .brand b,.app-shell .sidebar .brand small{display:block!important}
 .app-shell .sidebar .side-label{display:block!important;padding:0 12px 10px!important}
 .app-shell .sidebar .side-link{display:flex!important;align-items:center!important;flex:0 0 auto!important;margin:3px 0!important;padding:11px 12px!important;min-height:48px!important;height:auto!important;white-space:normal!important;font-size:14px!important}
 .app-shell .sidebar .side-bottom{display:flex!important;flex:none!important;align-items:center!important;gap:10px!important;margin-top:auto!important;padding:20px 4px 8px!important;border-top:1px solid #ffffff22!important}
 .app-shell .sidebar .side-bottom >div{display:block!important}
 .app-shell .sidebar .side-bottom #logout{display:inline-flex!important;align-items:center!important;min-height:44px!important}
 .admin-mobile-shade{position:fixed;inset:0;z-index:105;background:#050e22a8;backdrop-filter:blur(3px)}
 body.gm-menu-open{overflow:hidden}
 body.gm-menu-open .admin-mobile-shade{display:block}
 body.gm-menu-open .app-shell .sidebar{transform:translateX(0);visibility:visible;pointer-events:auto}
 .main-content{width:100%!important;max-width:100%!important;min-width:0!important;margin:0!important;padding:0 clamp(14px,3vw,28px) 35px!important}
 .topbar{height:auto;min-height:56px;flex-wrap:wrap;gap:10px;padding:12px 0}
 .welcome{padding:22px 0 18px}
 .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 .panel-heading{align-items:flex-start;flex-wrap:wrap}
 .panel-heading .integration-state{white-space:normal;max-width:100%;line-height:1.5}
 .lower-grid{grid-template-columns:minmax(0,1fr);gap:14px}
 .product-tabs{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
 .product-tab{min-height:46px;font-size:11px;overflow-wrap:anywhere}
 .product-list{min-width:0}
 .filter-row{flex-wrap:wrap}
 .filter-row .search-box{flex:1 0 100%;max-width:none;min-height:44px}
 .filter-row select,.filter-row .refresh-btn{min-height:44px;font-size:13px}
 .table-wrap{max-width:100%;width:100%;overflow-x:auto;overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch}
 .table-wrap>table{width:max-content;min-width:720px;max-width:none}
 .gm-billing-table{min-width:820px}
 .gm-pix-form{grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}
 .gm-pix-form label{min-width:0;max-width:100%;overflow-wrap:anywhere}
 .gm-pix-form input:not([type=checkbox]),.gm-pix-form select,.gm-pix-form textarea{min-width:0;max-width:100%;width:100%;font-size:16px;min-height:44px}
 .gm-pix-form button,.gm-billing-actions button{min-height:44px}
 .finance-product-grid,.security-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .product-row{flex-wrap:wrap;gap:10px}
 .product-row .product-open{margin-left:0}
 .module-panel,.gm-pix-panel,.lower-grid .panel,.products-panel{max-width:100%;overflow-wrap:anywhere}
 .gm-feedback,.module-placeholder{overflow-wrap:anywhere}
 .main-content :is(button,a,input,select,textarea):focus-visible,.sidebar :is(a,button):focus-visible,.admin-mobile-top button:focus-visible{outline:3px solid #8e75fa;outline-offset:3px}
}
@media (max-width:720px){
 .main-content{padding-inline:14px!important}
 .product-tabs{grid-template-columns:repeat(2,minmax(0,1fr))}
 .gm-pix-form{grid-template-columns:minmax(0,1fr)}
 .finance-product-grid,.security-grid{grid-template-columns:minmax(0,1fr)}
 .product-row{display:grid;grid-template-columns:36px minmax(0,1fr) auto;align-items:center;gap:7px 10px;padding-block:14px}
 .product-row .product-logo{grid-column:1;grid-row:1 / span 2}
 .product-row>div{grid-column:2 / 4;grid-row:1}
 .product-row .product-status{grid-column:2;grid-row:2;justify-self:start;margin:0!important}
 .product-row .product-open{grid-column:3;grid-row:2;justify-self:end;margin:0!important;white-space:normal;text-align:center}
 .product-row b{font-size:13px}
 .product-row small{font-size:11px;line-height:1.5}
 .welcome h1{font-size:clamp(24px,6vw,30px)}
 .panel-heading h2{font-size:17px}
 .module-panel,.lower-grid .panel,.products-panel{padding:16px 13px}
 .table-footer{display:flex;flex-wrap:wrap;gap:9px}
 /* Customer directory becomes readable cards instead of a desktop table.
    Other financial/billing tables retain their own horizontal scroll. */
 #clientes .table-wrap{overflow:visible;border:0;background:transparent}
 #clientes .table-wrap>table,#clientes .table-wrap>table>tbody{display:block!important;width:100%!important;min-width:0!important}
 #clientes .table-wrap>table>thead{display:none}
 #clientes .table-wrap>table>tbody>tr{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 10px;
  padding:15px;margin:0 0 10px;background:#fff;border:1px solid #e5e8f0;border-radius:13px;
  box-shadow:0 3px 10px #17264b09;min-width:0
 }
 #clientes .table-wrap>table>tbody>tr>td{display:block;padding:0!important;border:0!important;min-width:0;overflow-wrap:anywhere;font-size:12px;line-height:1.6}
 #clientes .table-wrap>table>tbody>tr>td:nth-child(1){grid-column:1/-1}
 #clientes .table-wrap>table>tbody>tr>td:nth-child(1) b{font-size:14px}
 #clientes .table-wrap>table>tbody>tr>td:nth-child(7){grid-column:1/-1;display:flex;gap:8px;flex-wrap:wrap}
 #clientes .table-wrap>table>tbody>tr>td:not([colspan]):nth-child(2)::before{content:"PRODUTO"}
 #clientes .table-wrap>table>tbody>tr>td:not([colspan]):nth-child(3)::before{content:"RESPONSÁVEL"}
 #clientes .table-wrap>table>tbody>tr>td:not([colspan]):nth-child(4)::before{content:"PLANO"}
 #clientes .table-wrap>table>tbody>tr>td:not([colspan]):nth-child(5)::before{content:"SITUAÇÃO"}
 #clientes .table-wrap>table>tbody>tr>td:not([colspan]):nth-child(6)::before{content:"CADASTRO"}
 #clientes .table-wrap>table>tbody>tr>td:not([colspan]):nth-child(n+2):nth-child(-n+6)::before{display:block;font-size:9px;font-weight:800;letter-spacing:.6px;color:#929bb0;margin-bottom:3px}
 #clientes .table-wrap>table>tbody>tr>td[colspan]{grid-column:1/-1;text-align:center}
 #clientes .row-action,#clientes select{font-size:13px;min-height:42px}
}
@media(max-width:420px){
 .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .stat-card{padding:12px}
 .stat-top{font-size:11px}
 .stat-card>small{font-size:10px;line-height:1.5}
 .product-tabs{grid-template-columns:repeat(2,minmax(0,1fr))}
 .product-tab{padding:9px 8px;gap:5px}
 .product-tab>span:nth-child(2){font-size:11px}
 .main-content{padding-inline:12px!important}
}
@media(prefers-reduced-motion:reduce){
 .app-shell .sidebar{transition:none!important}
}
