/* SESNAT app shell responsivo v=20260718f — todas as páginas autenticadas */

html { -webkit-text-size-adjust: 100%; }

body.app-shell {
  overflow-x: hidden !important;
  background-color: #f6f7fb !important;
}

/* Header */
body.app-shell .top-header {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 0.75rem !important;
  padding: clamp(0.75rem, 3vw, 1.25rem) clamp(1rem, 4vw, 2.5rem) !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

body.app-shell .logo-menu {
  height: auto !important;
  max-height: 40px !important;
  max-width: min(200px, 55vw) !important;
  width: auto !important;
}

body.app-shell .account-btn {
  white-space: nowrap !important;
  font-size: 14px !important;
}

/* Main layout */
body.app-shell main.ls-main,
body.app-shell .ls-main {
  padding-left: clamp(1rem, 4vw, 5rem) !important;
  padding-right: clamp(1rem, 4vw, 5rem) !important;
  padding-top: 1rem !important;
  padding-bottom: 2rem !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  place-self: stretch !important;
}

body.app-shell main.ls-main > .container,
body.app-shell .ls-main > .container {
  display: block !important;
  width: 100% !important;
  max-width: 1140px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
}

/* Tables — never blow out mobile */
body.app-shell .box-table {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box !important;
  padding: 12px !important;
}

body.app-shell .ls-table,
body.app-shell table.table,
body.app-shell table.ls-table {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0;
}

/* Forms */
body.app-shell .ls-form .row {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0.75rem !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

body.app-shell .ls-form .ls-label,
body.app-shell .ls-form .col-3,
body.app-shell .ls-form [class*="col-"] {
  float: none !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

body.app-shell input[type="text"],
body.app-shell input[type="email"],
body.app-shell input[type="password"],
body.app-shell input[type="number"],
body.app-shell select,
body.app-shell textarea,
body.app-shell .ls-field,
body.app-shell .desc-field {
  max-width: 100% !important;
  box-sizing: border-box !important;
  font-size: 16px !important;
}

body.app-shell img {
  max-width: 100%;
  height: auto;
}

/* Tab wrappers / reforma */
body.app-shell .tab-wrapper,
body.app-shell .container-fluid.tab-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

body.app-shell .nav-pills {
  flex-wrap: wrap !important;
}

/* Buttons */
body.app-shell .btn-primary,
body.app-shell a.ls-btn-primary-danger,
body.app-shell .btn-res,
body.app-shell .btn-desc {
  box-sizing: border-box !important;
}

@media screen and (max-width: 991.98px) {
  body.app-shell main.ls-main,
  body.app-shell .ls-main {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  body.app-shell .ls-form .ls-label,
  body.app-shell .ls-form .col-3,
  body.app-shell .ls-form .col-sm-3,
  body.app-shell .ls-form .col-md-3,
  body.app-shell .ls-form [class*="col-"] {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  body.app-shell input[type="text"],
  body.app-shell input[type="email"],
  body.app-shell input[type="password"],
  body.app-shell select,
  body.app-shell textarea {
    width: 100% !important;
  }
}

@media screen and (max-width: 575.98px) {
  body.app-shell .top-header {
    padding: 0.75rem 1rem !important;
  }

  body.app-shell .content-header-description,
  body.app-shell .desc-header {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  body.app-shell .btn-res,
  body.app-shell .btn-desc,
  body.app-shell a.ls-btn-primary-danger,
  body.app-shell .btn-primary {
    width: 100% !important;
    text-align: center !important;
    float: none !important;
  }

  body.app-shell .ls-table,
  body.app-shell table.table {
    min-width: 0;
  }
}

/* Auth pages that share header but not app shell layout */
body.cadastro-page.app-shell main.ls-main { /* no-op guard */ }
