* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f5f7fb;
  color: #2f3042;
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 250px;
  height: 100vh;
  background: #2f3042;
  color: #ffffff;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  height: 70px;
  display: flex;
  align-items: center;
  padding: 0 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #3a7ca5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-right: 10px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-text strong {
  font-size: 16px;
}

.brand-text small {
  color: #85c7f2;
  font-size: 10px;
  text-transform: uppercase;
}

.sidebar-menu {
  padding: 15px 10px;
  overflow-y: auto;
  flex: 1;
}

.menu-title {
  color: #7e81b6;
  font-size: 11px;
  font-weight: bold;
  margin: 24px 12px 8px;
  letter-spacing: 0.5px;
}

.menu-link {
  width: 100%;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: #b6c0cf;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  text-decoration: none;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
}

.menu-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.menu-link.active {
  background: rgba(18, 115, 234, 0.15);
  color: #ffffff;
  border-left: 3px solid #85c7f2;
}

.menu-icon {
  width: 22px;
  text-align: center;
}

.menu-arrow {
  margin-left: auto;
  transition: transform 0.2s;
}

.menu-toggle.open .menu-arrow {
  transform: rotate(90deg);
}

.submenu {
  display: none;
  margin-left: 22px;
  padding-left: 15px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.submenu.open {
  display: block;
}

.submenu a {
  display: block;
  padding: 9px 10px;
  color: #aeb9c8;
  text-decoration: none;
  font-size: 13px;
  border-radius: 6px;
}

.submenu a:hover {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-user {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-user strong,
.sidebar-user small {
  display: block;
}

.sidebar-user small {
  color: #8fa0b5;
  margin-top: 3px;
}

.portal-wrapper {
  margin-left: 250px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 70px;
  background: white;
  border-bottom: 1px solid #e6ebf2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  position: sticky;
  top: 0;
  z-index: 900;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.sidebar-button {
  border: 0;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
}

.search-box {
  width: 330px;
  height: 42px;
  border-radius: 8px;
  background: #f1f4f9;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
}

.search-box input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
}

.topbar-month {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-month small,
.topbar-user small {
  display: block;
  color: #8a96a8;
}

.topbar-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e8f1ff;
  color: #3a7ca5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portal-content {
  padding: 30px;
  flex: 1;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 26px;
}

.page-header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
}

.page-header p {
  color: #77849a;
  margin-top: 6px;
}

.month-selector label {
  display: block;
  color: #77849a;
  font-size: 12px;
  margin-bottom: 5px;
}

.month-selector select {
  width: 200px;
  border: 1px solid #dae1ec;
  border-radius: 8px;
  padding: 11px;
  background: white;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 26px;
}

.stat-card {
  min-height: 145px;
  background: white;
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 8px 24px rgba(19, 33, 68, 0.07);
  display: flex;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.preparation::before {
  background: #3a7ca5;
}
.route::before {
  background: #7e81b6;
}
.delivered::before {
  background: #3a7ca5;
}
.returned::before {
  background: #85c7f2;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-title {
  font-weight: 600;
  margin-bottom: 10px;
}

.preparation .stat-title {
  color: #3a7ca5;
}
.route .stat-title {
  color: #7e81b6;
}
.delivered .stat-title {
  color: #3a7ca5;
}
.returned .stat-title {
  color: #3a7ca5;
}

.stat-info strong {
  font-size: 29px;
  margin-bottom: 8px;
}

.stat-info small {
  color: #91a0b5;
}

.stat-icon {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: #f0f4f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 25px;
  color: #aeb8c5;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 22px;
}

.panel {
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(19, 33, 68, 0.06);
  padding: 22px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.panel-header h2 {
  margin: 0;
  font-size: 17px;
}

.panel-header span {
  display: block;
  margin-top: 5px;
  color: #8e9bae;
  font-size: 12px;
}

.btn-outline {
  background: white;
  border: 1px solid #3a7ca5;
  color: #3a7ca5;
  border-radius: 7px;
  padding: 8px 14px;
  cursor: pointer;
}

.table-responsive {
  overflow-x: auto;
}

.portal-table {
  width: 100%;
  border-collapse: collapse;
}

.portal-table th {
  text-align: left;
  padding: 11px;
  color: #6c788d;
  font-size: 12px;
  border-bottom: 1px solid #edf0f5;
}

.portal-table td {
  padding: 12px;
  border-bottom: 1px solid #edf0f5;
  font-size: 13px;
}

.empty-row {
  text-align: center;
  color: #99a5b5;
  padding: 35px !important;
}

.summary-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.summary-item {
  border: 1px solid #e8edf4;
  padding: 17px;
  border-radius: 10px;
  display: flex;
  gap: 15px;
  align-items: center;
}

.summary-icon {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
}

.summary-icon.blue {
  color: #3a7ca5;
  background: #eaf3ff;
}

.summary-icon.purple {
  color: #7e81b6;
  background: #f2ebff;
}

.summary-icon.green {
  color: #3a7ca5;
  background: #e9fbf3;
}

.summary-item strong {
  display: block;
  font-size: 13px;
}

.summary-item span {
  display: block;
  margin-top: 4px;
  font-size: 21px;
}

.portal-footer {
  padding: 18px 30px;
  display: flex;
  justify-content: space-between;
  color: #9aa5b5;
  font-size: 12px;
}

@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .portal-wrapper {
    margin-left: 0;
  }

  .search-box {
    width: 220px;
  }

  .topbar-month {
    display: none;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
}

/* =========================================================
   PALETA CORPORATIVA LOGINET
   Referencia:
   #ED314C  rojo
   #2F3042  azul/gris oscuro
   #000000  negro
   #85C7F2  azul claro
   #3A7CA5  azul medio
   #FFFFFF  blanco
   #EFF0D1  amarillo muy claro
   #E7D8C9  beige
   #DCDCDD  gris claro
   #0F43B1  azul intenso
   #FF95A5  rosa
   #7E81B6  violeta
   ========================================================= */

:root {
  --lg-red: #ed314c;
  --lg-dark: #2f3042;
  --lg-black: #000000;
  --lg-sky: #85c7f2;
  --lg-blue: #3a7ca5;
  --lg-white: #ffffff;
  --lg-soft-yellow: #eff0d1;
  --lg-beige: #e7d8c9;
  --lg-gray: #dcdcdd;
  --lg-deep-blue: #0f43b1;
  --lg-pink: #ff95a5;
  --lg-violet: #7e81b6;
}

.sidebar {
  background: linear-gradient(180deg, var(--lg-dark) 0%, #252638 100%);
}

.brand-icon,
.auth-logo-mark {
  background: linear-gradient(135deg, var(--lg-deep-blue), var(--lg-sky));
}

.menu-link.active {
  background: rgba(133, 199, 242, 0.13);
  border-left-color: var(--lg-sky);
}

.preparation::before {
  background: var(--lg-deep-blue);
}
.route::before {
  background: var(--lg-violet);
}
.delivered::before {
  background: var(--lg-blue);
}
.returned::before {
  background: var(--lg-red);
}

.preparation .stat-title {
  color: var(--lg-deep-blue);
}
.route .stat-title {
  color: var(--lg-violet);
}
.delivered .stat-title {
  color: var(--lg-blue);
}
.returned .stat-title {
  color: var(--lg-red);
}

.btn-outline {
  border-color: var(--lg-blue);
  color: var(--lg-deep-blue);
}

.topbar-logout {
  color: var(--lg-dark);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.topbar-logout:hover {
  background: rgba(237, 49, 76, 0.08);
  color: var(--lg-red);
}

/* LOGIN / MFA */
.auth-body {
  min-height: 100vh;
  background: #f7f8fb;
}

.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 42%) 1fr;
}

.auth-brand-panel {
  color: var(--lg-white);
  background:
    linear-gradient(145deg, rgba(15, 67, 177, 0.97), rgba(47, 48, 66, 0.98)),
    var(--lg-dark);
  display: flex;
  align-items: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
}

.auth-brand-panel::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  right: -180px;
  bottom: -140px;
  background: rgba(133, 199, 242, 0.14);
}

.auth-brand-content {
  max-width: 470px;
  position: relative;
  z-index: 2;
}

.auth-logo-mark {
  width: 62px;
  height: 62px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 27px;
  font-weight: 800;
  margin-bottom: 24px;
}

.auth-brand-content h1 {
  margin: 0;
  font-size: 38px;
  letter-spacing: 2px;
}

.auth-brand-content > p {
  color: var(--lg-sky);
  margin: 5px 0 0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.auth-line {
  width: 58px;
  height: 4px;
  border-radius: 4px;
  background: var(--lg-red);
  margin: 34px 0;
}

.auth-brand-content h2 {
  font-size: 29px;
  line-height: 1.25;
  margin: 0 0 15px;
}

.auth-brand-content span {
  color: #e3ebf7;
  line-height: 1.7;
}

.auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.auth-card {
  width: min(100%, 430px);
}

.auth-card h2 {
  color: var(--lg-dark);
  font-size: 30px;
  margin: 0 0 8px;
}

.auth-subtitle {
  color: #788397;
  line-height: 1.6;
  margin: 0 0 30px;
}

.auth-card label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--lg-dark);
  margin: 18px 0 8px;
}

.auth-input {
  height: 50px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 15px;
  background: var(--lg-white);
  border: 1px solid var(--lg-gray);
  border-radius: 10px;
}

.auth-input:focus-within {
  border-color: var(--lg-sky);
  box-shadow: 0 0 0 3px rgba(133, 199, 242, 0.2);
}

.auth-input i {
  color: var(--lg-blue);
}

.auth-input input {
  border: 0;
  outline: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  font-size: 15px;
}

.auth-submit {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 10px;
  color: white;
  background: linear-gradient(90deg, var(--lg-deep-blue), var(--lg-blue));
  font-size: 15px;
  font-weight: 700;
  margin-top: 25px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.auth-submit:hover {
  filter: brightness(0.96);
}

.auth-alert {
  background: rgba(237, 49, 76, 0.08);
  color: #b52239;
  border: 1px solid rgba(237, 49, 76, 0.23);
  border-radius: 9px;
  padding: 12px 14px;
  margin-bottom: 18px;
  display: flex;
  gap: 9px;
  align-items: center;
}

.auth-security {
  color: #7f8998;
  font-size: 12px;
  text-align: center;
  margin-top: 25px;
}

.auth-security i {
  color: var(--lg-blue);
}

.auth-mobile-brand {
  display: none;
}

.mfa-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  color: white;
  background: var(--lg-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 27px;
  margin-bottom: 24px;
}

.otp-input {
  width: 100%;
  height: 62px;
  border: 1px solid var(--lg-gray);
  border-radius: 11px;
  text-align: center;
  letter-spacing: 12px;
  padding-left: 12px;
  font-size: 27px;
  font-weight: 700;
  outline: 0;
  color: var(--lg-dark);
}

.otp-input:focus {
  border-color: var(--lg-sky);
  box-shadow: 0 0 0 3px rgba(133, 199, 242, 0.2);
}

.auth-test {
  background: var(--lg-soft-yellow);
  color: var(--lg-dark);
  border-radius: 9px;
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 18px;
}

.auth-back {
  margin-top: 22px;
  display: block;
  text-align: center;
  color: var(--lg-blue);
  text-decoration: none;
  font-size: 13px;
}

@media (max-width: 850px) {
  .auth-layout {
    display: block;
  }

  .auth-brand-panel {
    display: none;
  }

  .auth-form-panel {
    min-height: 100vh;
    padding: 28px;
  }

  .auth-mobile-brand {
    display: block;
    color: var(--lg-dark);
    font-weight: 800;
    margin-bottom: 42px;
  }

  .auth-mobile-brand span {
    display: block;
    color: var(--lg-blue);
    font-size: 11px;
    margin-top: 3px;
    text-transform: uppercase;
  }
}

/* LOGOS OFICIALES LOGINET */
.sidebar-brand {
  justify-content: center;
  padding: 8px 16px;
  height: 86px;
}

.sidebar-logo {
  display: block;
  width: 150px;
  max-height: 68px;
  object-fit: contain;
  border-radius: 4px;
}

.auth-company-logo {
  display: block;
  width: min(285px, 92%);
  height: auto;
  object-fit: contain;
  margin-bottom: 14px;
  border-radius: 5px;
}

.auth-mobile-brand img {
  display: block;
  width: 190px;
  max-width: 80%;
  height: auto;
  margin-bottom: 8px;
}

/* ===== V4: refinamiento login, soporte y pantallas API ===== */
.auth-brand-panel {
  background:
    radial-gradient(
      circle at 18% 18%,
      rgba(237, 49, 76, 0.16),
      transparent 24%
    ),
    radial-gradient(
      circle at 88% 88%,
      rgba(133, 199, 242, 0.14),
      transparent 30%
    ),
    linear-gradient(145deg, #2f3042 0%, #252638 58%, #1f2030 100%);
}

.auth-company-logo {
  width: min(315px, 95%);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
}

.auth-line {
  background: var(--lg-red);
  width: 72px;
}

.auth-benefits {
  display: grid;
  gap: 12px;
  margin-top: 34px;
}

.auth-benefits > div {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #eef1f7;
  font-size: 13px;
}

.auth-benefits i {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  color: white;
  background: rgba(237, 49, 76, 0.9);
}

.login-kicker,
.eyebrow {
  color: var(--lg-red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.4px;
  margin-bottom: 10px;
}

.auth-card {
  background: rgba(255, 255, 255, 0.96);
  padding: 38px;
  border-radius: 20px;
  box-shadow: 0 22px 60px rgba(47, 48, 66, 0.1);
  border: 1px solid rgba(47, 48, 66, 0.06);
}

.auth-submit {
  background: linear-gradient(90deg, var(--lg-red), #d92541);
  box-shadow: 0 10px 24px rgba(237, 49, 76, 0.2);
}

.auth-input:focus-within {
  border-color: rgba(237, 49, 76, 0.55);
  box-shadow: 0 0 0 3px rgba(237, 49, 76, 0.08);
}

.auth-input i {
  color: var(--lg-red);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.status-prep {
  color: #0f43b1;
  background: rgba(133, 199, 242, 0.2);
}
.table-action {
  color: var(--lg-deep-blue);
  text-decoration: none;
}

.support-strip {
  margin-top: 24px;
  background: linear-gradient(105deg, #2f3042, #35364b);
  color: white;
  border-radius: 14px;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 10px 28px rgba(47, 48, 66, 0.12);
}
.support-copy {
  display: flex;
  align-items: center;
  gap: 14px;
}
.support-copy strong,
.support-copy span {
  display: block;
}
.support-copy span {
  margin-top: 4px;
  color: #cdd3df;
  font-size: 12px;
}
.support-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--lg-red);
  font-size: 20px;
}
.support-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.support-btn {
  min-height: 40px;
  padding: 0 15px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
}
.support-btn.whatsapp {
  background: #fff;
  color: #157347;
}
.support-btn.chat {
  background: var(--lg-red);
  color: white;
}
.support-btn.is-mapped {
  opacity: 0.72;
}

.filter-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-inline select {
  border: 1px solid #dfe4ec;
  border-radius: 8px;
  padding: 10px 12px;
  background: white;
}
.btn-primary {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--lg-red);
  color: white;
  font-weight: 700;
  cursor: pointer;
}
.context-card {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: #e7eaf0;
  border: 1px solid #e7eaf0;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 22px;
}
.context-card > div {
  background: white;
  padding: 15px 17px;
}
.context-card small,
.context-card strong {
  display: block;
}
.context-card small {
  color: #8994a5;
  font-size: 11px;
  margin-bottom: 5px;
}
.context-card strong {
  color: var(--lg-dark);
  font-size: 14px;
}
.page-alert {
  background: rgba(237, 49, 76, 0.08);
  border: 1px solid rgba(237, 49, 76, 0.2);
  color: #b52239;
  padding: 12px 14px;
  border-radius: 9px;
  margin-bottom: 16px;
  display: flex;
  gap: 9px;
  align-items: center;
}
.placeholder-feature {
  text-align: center;
  padding: 70px 30px;
}
.placeholder-icon {
  width: 70px;
  height: 70px;
  border-radius: 18px;
  background: rgba(237, 49, 76, 0.09);
  color: var(--lg-red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin: 0 auto 18px;
}
.placeholder-feature p {
  max-width: 600px;
  margin: 10px auto 0;
  color: #7c8797;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .support-strip {
    align-items: flex-start;
    flex-direction: column;
  }
  .context-card {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 520px) {
  .auth-card {
    padding: 28px 22px;
    box-shadow: none;
    border: 0;
  }
  .context-card {
    grid-template-columns: 1fr;
  }
}

/* ==============================
   V5 - SELECTOR DE CUENTA / PERIODO
   ============================== */
.dashboard-page-header {
  align-items: flex-end;
  gap: 24px;
}

.dashboard-filters {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-field label {
  color: #7a8497;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.45px;
}

.filter-field select,
.dashboard-filters select,
.preparation-filter select {
  min-height: 42px;
  border: 1px solid #dfe4ed;
  border-radius: 9px;
  background: #fff;
  color: var(--lg-dark);
  padding: 0 36px 0 12px;
  outline: 0;
}

.account-filter-field select {
  min-width: 270px;
  max-width: 360px;
}

.filter-year select {
  min-width: 92px;
}

.dashboard-consult-btn {
  min-height: 42px;
}

.account-banner {
  background: linear-gradient(
    90deg,
    rgba(15, 67, 177, 0.06),
    rgba(133, 199, 242, 0.1)
  );
  border: 1px solid rgba(58, 124, 165, 0.18);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.account-banner-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--lg-deep-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.account-banner-copy {
  flex: 1;
}

.account-banner small,
.topbar-account small {
  display: block;
  color: #8791a2;
  font-size: 11px;
  margin-bottom: 3px;
}

.account-banner strong {
  color: var(--lg-dark);
  font-size: 14px;
}

.account-banner-period {
  text-align: right;
}

.topbar-account {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-right: 16px;
  border-right: 1px solid #e8ebf0;
}

.topbar-account i {
  color: var(--lg-blue);
}

.topbar-account strong {
  display: block;
  font-size: 12px;
  color: var(--lg-dark);
}

.stat-link {
  text-decoration: none;
  color: inherit;
}

.stat-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(19, 33, 68, 0.11);
}

.summary-text-value {
  font-size: 15px !important;
  font-weight: 700;
  color: var(--lg-dark);
}

.dashboard-api-alert {
  margin-bottom: 22px;
}

@media (max-width: 1050px) {
  .dashboard-page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-filters {
    justify-content: flex-start;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .dashboard-filters,
  .preparation-filter {
    width: 100%;
  }

  .dashboard-filters .filter-field,
  .dashboard-filters select,
  .dashboard-consult-btn,
  .preparation-filter select,
  .preparation-filter button {
    width: 100%;
    max-width: none;
  }

  .account-banner {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .account-banner-period {
    width: 100%;
    text-align: left;
    padding-left: 56px;
  }

  .topbar-account {
    display: none;
  }
}

/* =========================================================
   V9 - DataTables compacto + Sidebar contraíble
   Agregar al final de assets/css/portal.css
   ========================================================= */

/* Toolbar de tabla */
.datatable-toolbar {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.datatable-left {
  display: flex;
  align-items: center;
}

.datatable-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

/* Selector de registros */
.dataTables_wrapper .dataTables_length {
  float: none !important;
  margin: 0 !important;
}

.dataTables_wrapper .dataTables_length label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #526078;
  white-space: nowrap;
}

.dataTables_wrapper .dataTables_length select {
  min-width: 64px;
  height: 30px;
  padding: 3px 22px 3px 7px;
  border: 1px solid #d8dee8;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
}

/* Buscar */
.dataTables_wrapper .dataTables_filter {
  float: none !important;
  margin: 0 !important;
}

.dataTables_wrapper .dataTables_filter input {
  width: 175px;
  height: 30px;
  margin-left: 0 !important;
  padding: 5px 9px;
  border: 1px solid #d8dee8;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  outline: none;
}

.dataTables_wrapper .dataTables_filter input:focus {
  border-color: #85c7f2;
  box-shadow: 0 0 0 2px rgba(133, 199, 242, 0.14);
}

/* Botones Excel / PDF */
div.dt-buttons {
  float: none !important;
  display: flex;
  gap: 5px;
  margin: 0 !important;
}

div.dt-buttons .dt-button.dt-export-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  min-height: 30px !important;
  padding: 5px 9px !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  background-image: none !important;
  color: #fff !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}

div.dt-buttons .dt-button.dt-export-btn i {
  font-size: 13px !important;
  line-height: 1 !important;
}

div.dt-buttons .dt-button.dt-excel-btn {
  background: #3a7ca5 !important;
}

div.dt-buttons .dt-button.dt-pdf-btn {
  background: #ed314c !important;
}

div.dt-buttons .dt-button.dt-export-btn:hover {
  filter: brightness(0.95);
}

/* Pie */
.datatable-footer {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  float: none !important;
  margin: 0 !important;
  padding-top: 0 !important;
}

.dataTables_wrapper .dataTables_info {
  color: #7d899b !important;
  font-size: 11px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  min-width: 30px;
  height: 30px;
  padding: 5px 8px !important;
  margin: 0 1px !important;
  border-radius: 6px !important;
  font-size: 11px;
}

/* =========================================================
   Sidebar desktop contraíble
   ========================================================= */

.sidebar {
  transition:
    width 0.22s ease,
    transform 0.22s ease;
}

.portal-wrapper {
  transition: margin-left 0.22s ease;
}

body.sidebar-collapsed .sidebar {
  width: 72px;
}

body.sidebar-collapsed .portal-wrapper {
  margin-left: 72px;
}

body.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding-left: 10px;
  padding-right: 10px;
}

body.sidebar-collapsed .sidebar-brand .brand-text,
body.sidebar-collapsed .sidebar .menu-title,
body.sidebar-collapsed .sidebar .menu-link > span:not(.menu-icon),
body.sidebar-collapsed .sidebar .menu-arrow,
body.sidebar-collapsed .sidebar .sidebar-user > div:not(.user-avatar) {
  display: none !important;
}

body.sidebar-collapsed .sidebar .menu-link {
  justify-content: center;
  gap: 0;
  padding-left: 8px;
  padding-right: 8px;
}

body.sidebar-collapsed .sidebar .menu-icon {
  width: auto;
  font-size: 17px;
}

body.sidebar-collapsed .sidebar .submenu {
  display: none !important;
}

body.sidebar-collapsed .sidebar-user {
  justify-content: center;
  padding-left: 8px;
  padding-right: 8px;
}

/* En móvil mantiene comportamiento de panel lateral */
@media (max-width: 768px) {
  body.sidebar-collapsed .sidebar {
    width: 250px;
    transform: translateX(-100%);
  }

  body.sidebar-collapsed .sidebar.mobile-open {
    transform: translateX(0);
  }

  body.sidebar-collapsed .portal-wrapper {
    margin-left: 0;
  }

  .datatable-toolbar {
    align-items: stretch;
  }

  .datatable-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }

  .dataTables_wrapper .dataTables_filter {
    flex: 1;
  }

  .dataTables_wrapper .dataTables_filter input {
    width: 100%;
  }
}

.kardex-filter-card {
  margin: 0 0 18px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid #e2e7ef;
  border-radius: 12px;
}
.kardex-filter-grid {
  display: grid;
  grid-template-columns: minmax(230px, 1.4fr) minmax(180px, 0.8fr) minmax(
      185px,
      0.8fr
    ) minmax(145px, 0.55fr) minmax(145px, 0.55fr) auto;
  gap: 12px;
  align-items: end;
}
.kardex-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #6f7d91;
  text-transform: uppercase;
}
.kardex-field select,
.kardex-field input {
  width: 100%;
  height: 39px;
  padding: 7px 10px;
  border: 1px solid #dce3ec;
  border-radius: 8px;
  background: #fff;
  color: #2f3042;
}
.kardex-button-field .btn-primary {
  height: 39px;
  white-space: nowrap;
}
@media (max-width: 1180px) {
  .kardex-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .kardex-filter-grid {
    grid-template-columns: 1fr;
  }
}

.vencimiento-cell {
    text-align: center;
}

.vencimiento-indicator {
    display: inline-block;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    vertical-align: middle;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, .04);
}

.venc-verde {
    background: #22c55e;
}

.venc-naranja {
    background: #f59e0b;
}

.venc-rojo {
    background: #ef4444;
}

.venc-neutral {
    background: #94a3b8;
}

/* ============================================
   SOPORTE FLOTANTE
   ============================================ */

.support-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;

    z-index: 9998;

    font-family: inherit;
}


.support-floating-button {
    position: relative;

    width: 58px;
    height: 58px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 50%;

    background: #f22f4f;
    color: #ffffff;

    font-size: 23px;

    cursor: pointer;

    box-shadow:
        0 12px 30px
        rgba(47, 48, 66, .28);

    transition:
        transform .2s ease,
        box-shadow .2s ease,
        background .2s ease;
}


.support-floating-button:hover {
    transform: translateY(-2px);

    box-shadow:
        0 16px 34px
        rgba(47, 48, 66, .34);
}


.support-widget.is-open
.support-floating-button {
    transform: rotate(0deg);
}


.support-notification {
    position: absolute;

    right: 4px;
    top: 3px;

    width: 10px;
    height: 10px;

    border-radius: 50%;

    background: #22c55e;

    border: 2px solid #ffffff;
}


/* PANEL */

.support-panel {
    position: absolute;

    right: 0;
    bottom: 72px;

    width: 340px;

    background: #ffffff;

    border:
        1px solid
        #e5e9f0;

    border-radius: 16px;

    box-shadow:
        0 20px 50px
        rgba(47, 48, 66, .20);

    overflow: hidden;

    opacity: 0;

    visibility: hidden;

    transform:
        translateY(10px)
        scale(.98);

    transform-origin:
        bottom right;

    transition:
        opacity .20s ease,
        transform .20s ease,
        visibility .20s ease;
}


.support-widget.is-open
.support-panel {
    opacity: 1;

    visibility: visible;

    transform:
        translateY(0)
        scale(1);
}


/* CABECERA */

.support-panel-header {
    display: flex;

    align-items: flex-start;

    justify-content:
        space-between;

    gap: 12px;

    padding: 18px;

    background: #2f3042;

    color: #ffffff;
}


.support-panel-title {
    display: flex;

    align-items: center;

    gap: 12px;
}


.support-panel-icon {
    width: 42px;
    height: 42px;

    display: flex;

    align-items: center;
    justify-content: center;

    flex: 0 0 42px;

    border-radius: 11px;

    background: #f22f4f;

    font-size: 19px;
}


.support-panel-title strong {
    display: block;

    margin-bottom: 3px;

    font-size: 15px;
}


.support-panel-title span {
    display: block;

    color: #c8ccda;

    font-size: 11px;

    line-height: 1.4;
}


.support-close {
    width: 32px;
    height: 32px;

    display: flex;

    align-items: center;
    justify-content: center;

    border: 0;

    border-radius: 8px;

    background:
        rgba(255, 255, 255, .08);

    color: #ffffff;

    cursor: pointer;
}


.support-close:hover {
    background:
        rgba(255, 255, 255, .16);
}


/* OPCIONES */

.support-panel-body {
    padding: 10px;
}


.support-option {
    width: 100%;

    display: flex;

    align-items: center;

    gap: 12px;

    padding: 12px;

    border: 0;

    border-radius: 10px;

    background: transparent;

    color: #2f3042;

    text-decoration: none;

    text-align: left;

    cursor: pointer;

    box-sizing: border-box;

    transition:
        background .18s ease;
}


.support-option:hover {
    background: #f5f7fa;
}


.support-option-icon {
    width: 40px;
    height: 40px;

    display: flex;

    align-items: center;
    justify-content: center;

    flex: 0 0 40px;

    border-radius: 10px;

    font-size: 19px;
}


.support-whatsapp
.support-option-icon {
    background: #e9f9f0;

    color: #168a4b;
}


.support-chat
.support-option-icon {
    background: #fff0f3;

    color: #f22f4f;
}


.support-option-content {
    flex: 1;
}


.support-option-content strong {
    display: block;

    margin-bottom: 3px;

    font-size: 13px;
}


.support-option-content span {
    display: block;

    color: #7c8496;

    font-size: 11px;
}


.support-option > .bi-chevron-right {
    color: #a9b0be;

    font-size: 12px;
}


/* FOOTER DEL PANEL */

.support-panel-footer {
    display: flex;

    align-items: center;
    justify-content: center;

    gap: 6px;

    padding: 9px 12px;

    border-top: 1px solid #edf0f5;

    background: #fafbfc;

    color: #8a91a2;

    font-size: 10px;
}


/* RESPONSIVE */

@media (max-width: 576px) {

    .support-widget {
        right: 14px;
        bottom: 14px;
    }

    .support-panel {
        position: fixed;

        left: 14px;
        right: 14px;
        bottom: 84px;

        width: auto;
    }

    .support-floating-button {
        width: 54px;
        height: 54px;
    }
}