/**
 * Estilos extraídos de atributos style="" (MAE).
 * Cargar después de app.css vía header.php.
 */

.mae-table-muted {
  background-color: #fafafa;
  color: #333;
}

.mae-tr-factura-total {
  font-weight: bold;
  color: #000;
}

.mae-link-cursor-pointer {
  cursor: pointer;
}

/*
 * Pie sidebar — modal licencia (usa <button>: los UA no heredan color/fondo como un <a>)
 */
.sidebar .sidebar-footer button.mae-footer-licencia-trigger {
  -webkit-appearance: none;
  appearance: none;
  display: inline;
  margin: 0;
  padding: 0;
  width: auto;
  min-height: 0;
  vertical-align: baseline;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  text-align: center;
  color: #ffffff;
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  border-radius: 0;
  box-shadow: none !important;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.sidebar .sidebar-footer button.mae-footer-licencia-trigger:hover,
.sidebar .sidebar-footer button.mae-footer-licencia-trigger:focus {
  color: #ffffff;
  outline: none;
  text-decoration: underline;
  opacity: 0.92;
}

.sidebar .sidebar-footer button.mae-footer-licencia-trigger:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 2px;
}

/* Sin modal abierto: no permitir que un backdrop huérfano bloquee la página */
body:not(:has(.modal.in)) > .modal-backdrop {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.mae-modal-body-license {
  max-height: 500px;
  overflow-y: auto;
  text-align: justify;
}

/* Formulario asesor (editar): respiro inferior dentro del panel */
.mae-as-panel-body--padded-bottom {
  padding-bottom: 2.75rem !important;
}

.mae-as-actions .btn {
  display: block;
  width: 100%;
}

.mae-as-actions .btn + .btn {
  margin-top: 0.75rem;
}

/* Impresiones (facturar/refacturar): misma anchura y alineación en columna */
.mae-impresiones-btn-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.mae-impresiones-btn-stack > .btn,
.mae-impresiones-btn-stack > a.btn {
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 !important;
  display: block;
}

.mae-impresiones-btn-stack > .alert {
  margin-bottom: 0;
}

/* Banner saldo cuotas (header, junto al userbox) */
.mae-saldo-banner {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  margin-right: 0.75rem;
  padding: 0.35rem 0.65rem;
  font-size: 12px;
  line-height: 1.2;
  border-radius: 4px;
  background: #e8f4fc;
  border: 1px solid #b8d4e8;
  color: #1a3a52;
  max-width: min(220px, 42vw);
  box-sizing: border-box;
}

.mae-saldo-banner__label {
  white-space: nowrap;
}

.mae-saldo-banner--low {
  background: #fde8e8;
  border-color: #e57373;
  color: #b71c1c;
}

@media (max-width: 767px) {
  .mae-saldo-banner {
    max-width: 100%;
    margin-right: 0;
    margin-bottom: 0.35rem;
    justify-content: center;
  }
}
