/* Membrete de la empresa (logo + datos) en facturas, estados de cuenta y reportes, y la página /settings/branding. */
.membrete{display:flex;align-items:flex-start;gap:14px;text-align:left}
.membrete-logo{display:block;max-height:72px;max-width:220px;width:auto;height:auto;object-fit:contain;flex:none}
.membrete-datos{display:flex;flex-direction:column;gap:1px;min-width:0}
.membrete-datos span{overflow-wrap:anywhere}
.membrete-nombre{font-weight:700;color:var(--txt)}
/* En fila (reportes): logo a la izquierda, datos en letra chica. */
.membrete-fila{align-items:center;font-size:12px;color:var(--suave)}
.membrete-fila .membrete-nombre{font-size:14px}
.membrete-fila .membrete-logo{max-height:56px;max-width:200px}
/* Solo al imprimir (la pantalla ya muestra el nombre de la empresa arriba). */
.membrete-imp{display:none}
/* Vista de imprimir de los reportes (exportar_imprimir): membrete centrado arriba del título. */
.rep-cabecera .membrete{justify-content:center;margin:0 auto 10px;width:max-content;max-width:100%}
.rep-cabecera .membrete-fila{font-size:12px}
/* Factura / nota de crédito: el logo arriba de los datos del emisor. */
.vt-emisor.membrete{flex-direction:column;gap:8px}
.vt-emisor .membrete-logo{max-height:80px;max-width:240px}
/* Pantallas con window.print (antigüedad, WIP): membrete arriba de la hoja. */
.membrete-hoja{margin:0 0 12px;padding-bottom:10px;border-bottom:1px solid var(--borde)}
@media print{
  .membrete-imp{display:flex!important}
  .membrete-logo{max-height:64px}
  .membrete{-webkit-print-color-adjust:exact;print-color-adjust:exact}
}

/* Página /settings/branding */
.mb-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:14px;margin-bottom:14px}
.mb-grid .card+.card{margin-top:0}
.mb-card p{margin:0 0 10px}
.mb-logo-caja{display:flex;align-items:center;justify-content:center;min-height:120px;padding:14px;margin-bottom:14px;border:1px dashed var(--borde);border-radius:var(--radio);
  background:repeating-conic-gradient(#f3f5fa 0 25%,#fff 0 50%) 0 0/16px 16px}
.mb-logo-caja img{max-width:100%;max-height:160px;height:auto}
.mb-subir{display:flex;flex-direction:column;gap:10px;margin-bottom:10px}
.mb-subir label{display:flex;flex-direction:column;gap:6px;font-weight:500}
.mb-subir small{font-weight:400;color:var(--suave)}
.mb-subir input[type=file]{padding:8px;border:1px solid var(--borde);border-radius:10px;background:var(--panel);width:100%}
.mb-datos{display:flex;flex-direction:column;gap:2px;padding:12px 14px;margin-bottom:10px;border:1px solid var(--borde);border-radius:var(--radio)}
.mb-falta{color:var(--suave)}
.mb-ein{display:flex;flex-direction:column;gap:10px;margin-top:6px}
.mb-check{display:flex;align-items:center;gap:10px;font-weight:500;cursor:pointer}
.mb-check input{width:20px;height:20px;flex:none;margin:0}
.mb-muestras{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:16px}
.mb-muestra-tit{margin-bottom:6px;text-transform:uppercase;letter-spacing:.04em}
.mb-muestra{border:1px solid var(--borde);border-radius:var(--radio);padding:18px;background:#fff;box-shadow:0 1px 3px rgba(15,29,61,.06)}
.mb-muestra-factura{display:flex;justify-content:space-between;gap:14px;flex-wrap:wrap}
.mb-muestra-factura .membrete{flex-direction:column;gap:8px;font-size:13px;color:var(--suave)}
.mb-muestra-factura .membrete-nombre{font-size:17px}
.mb-muestra-doc{display:flex;flex-direction:column;align-items:flex-end;gap:2px}
.mb-muestra-doc b{font-size:18px;letter-spacing:.06em}
.mb-muestra-rep{text-align:center}
.mb-muestra-rep .membrete{justify-content:center;margin:0 auto 8px;width:max-content;max-width:100%}
.mb-muestra-titulo{font-weight:700;font-size:16px}
@media screen and (max-width:860px){
  .mb-card,.mb-card p,.mb-datos,.mb-check,.mb-subir label{font-size:16px}
  .mb-card .btn,.mb-subir input[type=file]{min-height:44px;font-size:16px}
  .mb-card .botones{justify-content:stretch}.mb-card .botones .btn{flex:1;justify-content:center}
  .mb-card a{display:inline-block;min-height:24px}
  .mb-check{min-height:44px}
  .mb-muestra-rep .membrete{width:auto}
  .mb-muestra-rep .membrete,.rep-cabecera .membrete-fila{flex-direction:column;align-items:center;text-align:center;gap:8px}
  .mb-muestra-doc{align-items:flex-start}
}
/* Tarjeta-enlace en Ajustes → Empresa */
.mb-enlace{display:flex;align-items:center;gap:12px;margin-top:14px;text-decoration:none;color:var(--txt);min-height:44px}
.mb-enlace>span:first-of-type{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}
.mb-enlace .icono{color:var(--acento)}
.mb-enlace-ir{font-size:22px;color:var(--suave)}
.mb-enlace:hover{border-color:var(--acento)}
@media (max-width:860px){.mb-enlace b{font-size:16px}.mb-enlace small{font-size:14px}}
