/*
 * WMS Shell v2
 * Extensión reversible del tema aprobado para login.php e index.php.
 */

/* Login */
body.wms-login-v2 {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 18%, rgba(22, 114, 236, 0.24), transparent 31%),
    radial-gradient(circle at 85% 78%, rgba(255, 152, 0, 0.15), transparent 28%),
    var(--wms2-navy-950) !important;
}

body.wms-login-v2 #appCapsule {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: none;
  min-height: 100vh;
  padding: 24px !important;
  background: transparent;
  border: 0;
  box-shadow: none;
}

body.wms-login-v2 #div_login {
  position: relative;
  width: min(450px, 100%);
  margin: 0 !important;
  padding: 24px 30px 22px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-top: 5px solid var(--wms2-orange);
  border-radius: 12px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
}

body.wms-login-v2 #div_login::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 70px;
  pointer-events: none;
  content: "";
  background: linear-gradient(180deg, rgba(238, 245, 255, 0.9), rgba(255, 255, 255, 0));
}

body.wms-login-v2 #div_login > .section {
  position: relative;
  z-index: 1;
}

body.wms-login-v2 #div_login > .section:first-child .form-links {
  min-height: 30px;
  margin-top: 0 !important;
}

body.wms-login-v2 #div_login > .section:first-child .form-links a {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  min-height: 36px;
  padding: 5px 9px;
  color: var(--wms2-navy-800) !important;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 650;
}

body.wms-login-v2 #div_login > .section:first-child .form-links a:hover {
  color: var(--wms2-blue) !important;
  background: var(--wms2-soft-blue);
}

body.wms-login-v2 #div_login > .section:first-child > .form-image {
  width: 175px;
  max-width: 52%;
  height: auto;
  margin-top: 4px;
  margin-bottom: 2px;
}

body.wms-login-v2 #div_login h4 {
  margin: 3px 0 4px;
  color: var(--wms2-navy-900);
  font-size: 20px;
  font-weight: 750;
}

body.wms-login-v2 #div_login .section.mt-1.mb-5 {
  margin-bottom: 12px !important;
}

body.wms-login-v2 #div_login .form-group.boxed {
  margin-bottom: 12px;
}

body.wms-login-v2 #div_login .form-control {
  min-height: 50px;
  padding-right: 42px;
  background: #f9fbfd;
  border-color: #c8d1de;
}

body.wms-login-v2 #div_login .form-control:focus {
  background: #fff;
}

body.wms-login-v2 #div_login .form-button-group {
  position: static;
  right: auto;
  left: auto;
  width: 100%;
  max-width: none;
  padding: 8px 0 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}

body.wms-login-v2 #btnIngresar {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  color: #fff;
  background: var(--wms2-navy-800) !important;
  border: 1px solid var(--wms2-navy-800) !important;
  border-bottom: 3px solid var(--wms2-orange) !important;
  border-radius: 7px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

body.wms-login-v2 #btnIngresar:hover,
body.wms-login-v2 #btnIngresar:focus-visible {
  background: var(--wms2-blue) !important;
  border-color: var(--wms2-blue) !important;
  border-bottom-color: var(--wms2-orange) !important;
}

body.wms-login-v2 #div_login > .section:last-child {
  padding-top: 8px;
  border-top: 1px solid var(--wms2-border);
}

body.wms-login-v2 #div_login > .section:last-child .form-image {
  width: 104px !important;
  height: auto;
}

/* Menú principal */
body.wms-home-v2 #appCapsule {
  padding-bottom: 22px;
}

body.wms-home-v2 #appCapsule > .section:first-child .profile-stats {
  min-height: 68px;
}

body.wms-home-v2 #appCapsule > .section:first-child .profile-stats strong {
  font-size: 21px;
}

body.wms-home-v2 .nav-tabs .nav-link {
  min-height: 66px;
}

body.wms-home-v2 .tab-content > .tab-pane {
  padding: 4px 10px 12px;
}

body.wms-home-v2 .tab-content > .tab-pane > h3 {
  margin: 12px 8px 4px !important;
  color: var(--wms2-navy-900);
  font-size: 19px;
  font-weight: 750;
}

body.wms-home-v2 .tab-content > .tab-pane > hr {
  margin: 8px 8px 10px;
  border-top-color: var(--wms2-border);
}

body.wms-home-v2 .tab-content > .tab-pane > .row {
  margin: 0;
}

body.wms-home-v2 .btn_mod {
  flex: 0 0 33.333333%;
  max-width: 33.333333%;
  padding: 5px !important;
  cursor: pointer;
}

body.wms-home-v2 .btn_mod .card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 132px;
  margin: 0 !important;
  padding: 6px !important;
  background: #fff;
  border: 1px solid var(--wms2-border);
  border-bottom: 3px solid #c7d2df;
  border-radius: 9px;
  box-shadow: 0 3px 10px rgba(7, 23, 45, 0.07);
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

body.wms-home-v2 .btn_mod:hover .card,
body.wms-home-v2 .btn_mod:focus-within .card {
  border-color: #9dbde8;
  border-bottom-color: var(--wms2-orange);
  box-shadow: 0 7px 18px rgba(7, 23, 45, 0.12);
  transform: translateY(-2px);
}

body.wms-home-v2 .btn_mod:active .card {
  box-shadow: 0 2px 5px rgba(7, 23, 45, 0.1);
  transform: translateY(0);
}

body.wms-home-v2 .btn_mod .card img {
  width: 102px !important;
  height: 102px !important;
  max-width: 100%;
  object-fit: contain;
}

body.wms-home-v2 #ModalPersonales .modal-body .login-form {
  max-width: 720px;
  margin-right: auto;
  margin-left: auto;
}

@media (min-width: 768px) {
  body.wms-login-v2 #appCapsule {
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  body.wms-home-v2 .btn_mod {
    flex: 0 0 20%;
    max-width: 20%;
    padding: 7px !important;
  }

  body.wms-home-v2 .btn_mod .card {
    min-height: 150px;
  }

  body.wms-home-v2 .btn_mod .card img {
    width: 118px !important;
    height: 118px !important;
  }
}

@media (max-width: 420px) {
  body.wms-login-v2 #appCapsule {
    align-items: flex-start;
    padding: 12px !important;
  }

  body.wms-login-v2 #div_login {
    margin-top: max(10px, env(safe-area-inset-top)) !important;
    padding: 17px 18px 16px;
    border-radius: 10px;
  }

  body.wms-login-v2 #div_login > .section:first-child > .form-image {
    width: 146px;
  }

  body.wms-home-v2 .tab-content > .tab-pane {
    padding-right: 4px;
    padding-left: 4px;
  }

  body.wms-home-v2 .btn_mod {
    padding: 4px !important;
  }

  body.wms-home-v2 .btn_mod .card {
    min-height: 118px;
    padding: 4px !important;
  }

  body.wms-home-v2 .btn_mod .card img {
    width: 90px !important;
    height: 90px !important;
  }
}

/* Configuración local */
body.wms-config-v2 {
  min-height: 100vh;
  background: #f1f5f9 !important;
}

body.wms-config-v2 .wms-config-header {
  border-bottom: 3px solid var(--wms2-orange);
}

body.wms-config-v2 .wms-config-header .pageTitle img {
  width: auto;
  height: 32px;
}

body.wms-config-v2 .wms-config-header-label {
  color: var(--wms2-navy-800);
  font-size: 12px;
  font-weight: 750;
}

body.wms-config-v2 #appCapsule {
  min-height: calc(100vh - 56px);
  padding: 28px 16px 22px !important;
}

body.wms-config-v2 .wms-config-section {
  width: min(620px, 100%);
  margin: 0 auto !important;
}

/* La capa global de UI alinea la primera sección al inicio con una regla
   más específica. En Configuración la anulamos para conservar la tarjeta
   centrada dentro del área de trabajo en pantallas amplias. */
body.wms-ui-v2.wms-config-v2 #appCapsule > .wms-config-section {
  width: min(620px, 100%);
  margin-right: auto !important;
  margin-left: auto !important;
  padding-right: 0;
  padding-left: 0;
}

body.wms-config-v2 .wms-config-card {
  padding: 28px !important;
  background: #fff;
  border: 1px solid var(--wms2-border);
  border-top: 5px solid var(--wms2-navy-800);
  border-radius: 11px;
  box-shadow: 0 12px 30px rgba(7, 23, 45, 0.1);
}

body.wms-config-v2 .wms-config-intro {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--wms2-border);
}

body.wms-config-v2 .wms-config-kicker {
  color: var(--wms2-orange);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

body.wms-config-v2 .wms-config-intro h1 {
  margin: 5px 0 6px;
  color: var(--wms2-navy-900);
  font-size: 24px;
  font-weight: 780;
}

body.wms-config-v2 .wms-config-intro p {
  margin: 0;
  color: #5f6f82;
  font-size: 14px;
  line-height: 1.45;
}

body.wms-config-v2 .form-group.boxed {
  margin-bottom: 15px;
}

body.wms-config-v2 .form-group.boxed .label {
  margin-bottom: 6px;
  color: var(--wms2-navy-800);
  font-size: 13px;
  font-weight: 700;
}

body.wms-config-v2 .form-control {
  min-height: 50px;
  background: #f9fbfd;
  border-color: #c8d2df;
}

body.wms-config-v2 .form-control:focus {
  background: #fff;
}

body.wms-config-v2 .wms-config-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

body.wms-config-v2 .wms-config-actions .btn {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin: 0;
  font-weight: 700;
  cursor: pointer;
}

body.wms-config-v2 .wms-config-actions .btn-success {
  background: var(--wms2-navy-800) !important;
  border-color: var(--wms2-navy-800) !important;
  border-bottom: 3px solid var(--wms2-orange) !important;
}

body.wms-config-v2 .wms-config-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 18px;
  padding: 11px 12px;
  color: #4f6176;
  background: var(--wms2-soft-blue);
  border-left: 3px solid var(--wms2-blue);
  border-radius: 5px;
  font-size: 12px;
}

body.wms-config-v2 .wms-config-note ion-icon {
  flex: 0 0 auto;
  color: var(--wms2-blue);
  font-size: 19px;
}

body.wms-config-v2 .content-footer {
  color: #78889b;
}

@media (max-width: 575.98px) {
  body.wms-config-v2 .wms-config-header-label {
    display: none;
  }

  body.wms-config-v2 #appCapsule {
    padding: 14px 10px 18px !important;
  }

  body.wms-config-v2 .wms-config-card {
    padding: 20px 16px !important;
    border-radius: 8px;
  }

  body.wms-config-v2 .wms-config-intro h1 {
    font-size: 21px;
  }

  body.wms-config-v2 .wms-config-actions {
    grid-template-columns: 1fr;
  }
}
