/* Persistencia visual y distribución compacta del editor de etiquetas. */
.smartprint-label-canvas img.sp-qr-image{display:block;padding:0!important;margin:0!important;border:0!important;border-radius:0!important;object-fit:contain;object-position:center}
.sp-qr-help{margin:4px 0;line-height:1.45;font-size:12px;color:#465d76}
.sp-editable-wrap.sp-qr-ink{overflow:visible!important;background:transparent}
.sp-editable-wrap.sp-qr-ink > .sp-qr-image{position:absolute;inset:0!important;width:100%!important;height:100%!important}
.sp-qr-loading{display:grid;place-items:center;width:100%;height:100%;font-size:11px;color:#465d76;background:white;text-align:center}
.sp-editable-wrap > .sp-block,
.sp-editable-wrap > .sp-block * {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  box-sizing: border-box;
}

.sp-editable-wrap.sp-editable-image > .sp-image {
  display: block;
  object-fit: contain;
  object-position: center;
}

.smartprint-editor-toolbar {
  padding: 9px 12px;
  border-radius: 12px;
}

.smartprint-visual-editor {
  grid-template-columns: minmax(205px, 260px) minmax(380px, 1fr) minmax(205px, 260px);
  gap: 10px;
  align-items: stretch;
  margin-top: 8px;
}

.smartprint-editor-tools,
.smartprint-block-panel {
  padding: 11px;
  border-radius: 12px;
}

.smartprint-editor-tools .smartprint-gallery {
  margin: 0;
}

.smartprint-editor-tools {
  position: relative;
  overflow: visible;
}

.smartprint-editor-tools .field {
  margin: 0 0 7px;
}

.smartprint-editor-tools .field label {
  margin-bottom: 3px;
}

.sp-label-placement small{display:block;margin-top:4px;color:#465d76;font-size:11px;line-height:1.35;overflow-wrap:anywhere}

.smartprint-editor-tools .field input,
.smartprint-editor-tools .field select {
  min-height: 34px;
  padding: 6px 8px;
}

.smartprint-add-menus {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.smartprint-add-menu {
  position: relative;
}

.smartprint-add-menu > summary {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #a9c8ec;
  border-radius: 9px;
  background: #f5f9ff;
  color: #0759b8;
  font-weight: 750;
  cursor: pointer;
  list-style: none;
}

.smartprint-add-menu > summary::-webkit-details-marker {
  display: none;
}

.smartprint-add-popover {
  display: none;
  position: absolute;
  z-index: 40;
  bottom: calc(100% + 5px);
  left: 0;
  width: min(440px, calc(100vw - 40px));
  max-height: min(430px, calc(100vh - 120px));
  overflow: auto;
  padding: 10px;
  border: 1px solid #b9cde5;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 32px #17365b2b;
}

.smartprint-add-menu[open] > .smartprint-add-popover {
  display: block;
}

.smartprint-add-popover .smartprint-gallery-group,
.smartprint-field-popover .smartprint-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 6px;
}

.smartprint-add-popover button {
  min-width: 0;
  min-height: 34px;
  padding: 6px 8px;
  text-align: left;
}

.smartprint-field-popover h4 {
  margin: 0 0 8px;
}

.smartprint-editor-stage {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
  padding: 8px;
  border-radius: 12px;
}

.smartprint-editor-hint {
  margin-bottom: 5px;
  font-size: .75rem;
}

.smartprint-editor-stage .smartprint-preview {
  min-height: 0;
  max-height: none;
  height: 100%;
  padding: 8px;
  overflow: hidden;
  align-items: center;
}

.smartprint-editor-stage .smartprint-label-canvas.editable {
  width: auto;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}

@media (min-width: 981px) {
  .smartprint-shell.suite-admin-scroll-shell > .basic-content.suite-admin-scroll-content:has(.smartprint-editor-page) {
    height: calc(100vh - 68px) !important;
    max-height: calc(100vh - 68px) !important;
    padding: 8px 12px 14px !important;
    overflow: hidden !important;
  }
  html:has(.smartprint-editor-page),
  .smartprint-shell:has(.smartprint-editor-page) {
    height: 100vh;
    overflow: hidden;
  }

  .smartprint-shell .basic-content:has(.smartprint-editor-page) {
    width: 100% !important;
    max-width: none !important;
    height: calc(100vh - 68px) !important;
    max-height: calc(100vh - 68px) !important;
    padding: 7px 12px 42px !important;
    box-sizing: border-box;
    overflow: hidden;
  }

  #smartprint-content:has(.smartprint-editor-page) {
    height: 100%;
    min-height: 0;
  }

  .smartprint-shell .basic-content:has(.smartprint-editor-page) > .suite-welcome,
  .smartprint-shell .basic-content:has(.smartprint-editor-page) > .notice,
  .smartprint-shell .basic-content:has(.smartprint-editor-page) > .smartprint-tabs {
    display: none;
  }

  .smartprint-editor-page {
    height: 100%;
    overflow: hidden;
  }

  .smartprint-visual-editor {
    height: calc(100% - 58px);
    min-height: 0;
  }

  .smartprint-editor-tools,
  .smartprint-block-panel {
    height: 100%;
    max-height: none;
    box-sizing: border-box;
  }
}

@media (max-width: 980px) {
  .smartprint-visual-editor {
    grid-template-columns: 220px minmax(400px, 1fr);
  }

  .smartprint-block-panel {
    grid-column: 1 / -1;
    max-height: none;
  }
}

@media (max-width: 820px) {
  .smartprint-visual-editor {
    grid-template-columns: 1fr;
  }
}
/* Editor-only guides are never part of the serialized/printed document. */
.smartprint-label-canvas.editable.sp-guides-enabled{background-image:linear-gradient(to right,#126bba14 1px,transparent 1px),linear-gradient(to bottom,#126bba14 1px,transparent 1px);background-size:var(--sp-grid-x) var(--sp-grid-y)}
.sp-safe-zone{position:absolute;border:1px dashed #e79018;box-shadow:0 0 0 500px #ef971615;pointer-events:none;z-index:1}
.sp-alignment-guide{position:absolute;z-index:12;pointer-events:none;background:#dd3ab2}
.sp-alignment-guide.x{top:0;bottom:0;width:1px}.sp-alignment-guide.y{left:0;right:0;height:1px}
.sp-editable-wrap.sp-outside-safe{outline:2px dashed #d93c3c}
.sp-guide-controls{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:5px 14px;margin:5px 0;font-size:11px;color:#465d76}
.sp-guide-controls label{display:flex;align-items:center;gap:5px}.sp-guide-controls input{width:15px;height:15px;min-height:0}
@media print{.sp-safe-zone,.sp-alignment-guide,.sp-guide-controls{display:none!important}.smartprint-label-canvas.editable{background-image:none!important}}

.sp-editable-wrap.sp-text-overflow{outline:2px solid #dc2626!important;background:#fef2f2}

.smartprint-catalog-filters{display:flex;gap:10px;margin:16px 0;flex-wrap:wrap}
.smartprint-template-cards .btn-row{display:flex;flex-wrap:wrap;gap:8px}
.smartprint-template-cards .btn.danger,.sp-confirm-card .btn.danger{background:#b42332;color:white;border-color:#b42332}
.sp-confirm-overlay{position:fixed;inset:0;background:#0e234b80;z-index:100000;display:grid;place-items:center;padding:20px}
.sp-confirm-card{width:min(480px,100%);padding:24px;background:white;border-radius:16px;box-shadow:0 12px 60px #0004;color:#16324f}
.sp-confirm-card h3{margin-top:0}.sp-confirm-card p{line-height:1.5;overflow-wrap:anywhere}.sp-confirm-card .btn-row{display:flex;justify-content:flex-end;gap:10px}

.smartprint-catalog .smartprint-template-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(280px,100%),1fr));gap:14px}
.smartprint-catalog .smartprint-template-cards article{min-width:0;display:flex;flex-direction:column;padding:18px}
.smartprint-catalog .smartprint-template-cards article h4{overflow-wrap:anywhere;margin:10px 0;font-size:16px;line-height:1.4}
.smartprint-catalog .smartprint-template-cards article .btn-row{margin-top:auto}
.smartprint-catalog .smartprint-catalog-filters .btn{flex:0 1 auto;min-width:130px}
.smartprint-catalog .smartprint-status.published{background:#e2f6ec;color:#14633e;padding:5px 10px;border-radius:20px}
.smartprint-catalog .smartprint-status.draft{background:#fff1d6;color:#805608;padding:5px 10px;border-radius:20px}
.smartprint-kpis button.card{font:inherit;color:inherit;text-align:left;cursor:pointer;border:1px solid #dce5ef}
