/* Legrotec SaaS Global UI - FIX layout v2
   Corrección: no invade .card/.grid/.table en escritorio; solo normaliza móvil y overflow. */
*{box-sizing:border-box}
html,body{max-width:100%;overflow-x:hidden}
img{max-width:100%;height:auto}

/* Evita que tablas envueltas rompan el ancho */
.lt-table-wrap,.table-wrap{width:100%;max-width:100%;overflow-x:auto;border-radius:16px}
.lt-table-wrap table,.table-wrap table{width:100%}

/* GYM: corregir cuadros inferiores y evitar scroll horizontal */
body .quick-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:18px;align-items:start;width:100%;max-width:100%}
body .quick-grid>div{min-width:0;max-width:100%}
body .quick-grid table,
body table.table{min-width:0!important;width:100%!important;max-width:100%!important}
body .container{max-width:1180px;margin-left:auto;margin-right:auto;width:100%;overflow-x:hidden}
body .topbar{max-width:100%;overflow:hidden}
body .topbar .nav{max-width:100%;overflow-x:auto;scrollbar-width:thin}
body .topbar .nav a{white-space:nowrap}

/* Core administrativo: hacer más cómoda la pantalla de empresas */
body .wrap{max-width:1450px!important;width:100%;margin-left:auto!important;margin-right:auto!important}
@media (min-width:951px){
  body .wrap>.grid{grid-template-columns:minmax(560px,.9fr) minmax(640px,1.25fr)!important;align-items:start}
  body .wrap .mods{grid-template-columns:repeat(2,minmax(230px,1fr))!important;gap:12px!important}
  body .wrap .row{grid-template-columns:1fr 1fr!important;gap:14px!important}
  body .wrap .card{min-width:0!important}
}

/* Tarjetas/estadísticas: centradas y sin desbordar */
body .grid{max-width:100%}
body .grid>.card, body .card{min-width:0}
body .stat{text-align:left}

/* Menú móvil genérico */
.lt-mobile-menu-btn{display:none;border:0;border-radius:12px;background:#eef4ff;color:#1745b5;font-weight:800;padding:10px 14px;cursor:pointer}

@media (max-width:950px){
  body .topbar{height:auto!important;min-height:64px!important;padding:12px 14px!important;align-items:flex-start!important;gap:12px!important;flex-direction:column!important}
  body .brand{width:100%;min-width:0}
  body .nav{width:100%;display:flex!important;gap:8px;overflow-x:auto;padding-bottom:4px;flex-wrap:nowrap!important}
  body .nav a{flex:0 0 auto}
  body .container,body .wrap{padding-left:14px!important;padding-right:14px!important;max-width:100%!important}
  body .hero{grid-template-columns:1fr!important;gap:16px!important}
  body .quick-grid{grid-template-columns:1fr!important;gap:16px!important}
  body .grid{grid-template-columns:1fr!important;gap:14px!important}
  body .form-row,body .row,body .mods{grid-template-columns:1fr!important;gap:12px!important}
  body .search,body .search-box{grid-template-columns:1fr!important;display:grid!important;gap:10px!important}
  body .card,body .panel{border-radius:18px!important;padding:16px!important}
  body h1{font-size:30px!important;line-height:1.15!important}
  body h2{font-size:24px!important;line-height:1.2!important}
  body .actions{display:flex;flex-direction:column;gap:10px;width:100%}
  body .actions .btn, body .btn{max-width:100%}
}

@media (max-width:560px){
  body{font-size:14px}
  body .container,body .wrap{padding-left:10px!important;padding-right:10px!important}
  body .card,body .panel{padding:14px!important;border-radius:16px!important}
  body .table th, body .table td{padding:10px 9px!important;font-size:13px!important}
  body input,body select,body textarea{font-size:15px!important;min-height:42px!important}
  body .btn,body button,input[type=submit]{min-height:42px!important}
}

@media print{.no-print,.nav,.actions,.lt-mobile-menu-btn{display:none!important}body{background:#fff!important}}
