.system-footer {
  box-sizing: border-box;
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  clear: both;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 18px;
  padding: 18px 24px;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
  border-top: 1px solid #d9e0ea;
  background: #f5f7fb;
  color: #6b7280;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.system-footer > span {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.system-footer a {
  color: #0f7c80;
  font-weight: 700;
  text-decoration: none;
}

.system-footer a:hover,
.system-footer a:focus {
  text-decoration: underline;
}

body:not(.sales-module) #base,
body:not(.sales-module) #content {
  height: auto;
}

body:not(.sales-module) #base {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

body:not(.sales-module) #content {
  flex: 1 0 auto;
  min-height: 0;
}

/* El tema saca las secciones del flujo desde 769 px. El pie debe seguirlas. */
body.full-content:not(.sales-module) #content > section {
  position: relative;
  top: auto;
  bottom: auto;
  left: auto;
  right: auto;
  overflow: visible;
}

/* El boton PWA es flotante: reservar su espacio solo cuando esta presente. */
body:has(> .pwa-install-button) .system-footer {
  padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 1099px) {
  .system-footer {
    flex-direction: column;
    gap: 4px;
    padding-top: 14px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
}

.sales-module #system-footer {
  display: none;
}

@media print {
  .system-footer {
    display: none;
  }
}
