/*
=============================================================
ZENTY EMITE 2.0 — CREAR BOLETA / DISEÑO POS PROFESIONAL
Versión 17.2.0

Solo reorganiza y moderniza la interfaz del formulario de boletas.
No modifica CAF, folios, XML, TED, firma, PDF ni endpoints existentes.
=============================================================
*/

:root {
  --zpos-primary: #0f766e;
  --zpos-primary-dark: #115e59;
  --zpos-primary-soft: #e9fbf8;
  --zpos-secondary-soft: #eef7ff;
  --zpos-ink: #17343b;
  --zpos-muted: #668087;
  --zpos-line: #dce8ea;
  --zpos-line-strong: #c9dcdf;
  --zpos-surface: #ffffff;
  --zpos-surface-soft: #f7fafb;
  --zpos-danger: #dc3545;
  --zpos-warning: #b7791f;
  --zpos-shadow: 0 14px 36px rgba(24, 57, 66, 0.075);
  --zpos-radius: 18px;
  --zpos-radius-sm: 11px;
}

body.zenty-boletas-page.zenty-pos-layout .app-content {
  padding: clamp(0.75rem, 1.25vw, 1.15rem);
}

body.zenty-boletas-page.zenty-pos-layout .page-stack {
  gap: 0.85rem;
}

/* Encabezado superior del paso: se compacta para dar espacio al área de trabajo. */
body.zenty-boletas-page.zenty-pos-layout .welcome-panel.compact-panel {
  min-height: 0;
  padding: 0.78rem 1rem;
  border-radius: 16px;
}

body.zenty-boletas-page.zenty-pos-layout .welcome-panel.compact-panel h2 {
  margin-bottom: 0.12rem;
  font-size: clamp(1.05rem, 1.45vw, 1.35rem);
}

body.zenty-boletas-page.zenty-pos-layout .welcome-panel.compact-panel p {
  max-width: 1080px;
  font-size: 0.76rem;
}

/* El contenedor principal deja de verse como una sola tarjeta gigante. */
body.zenty-boletas-page.zenty-pos-layout .content-grid.two-columns-wide > .panel-card:first-child {
  overflow: visible;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.zenty-boletas-page.zenty-pos-layout .content-grid.two-columns-wide > .panel-card:first-child > .panel-card-header {
  margin: 0 0 0.72rem;
  padding: 0.72rem 0.9rem;
  border: 1px solid var(--zpos-line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 8px 24px rgba(24, 57, 66, 0.055);
}

body.zenty-boletas-page.zenty-pos-layout .content-grid.two-columns-wide > .panel-card:first-child > .panel-card-header h3 {
  font-size: 1.05rem;
}

body.zenty-boletas-page.zenty-pos-layout .admin-form {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(350px, 0.82fr);
  grid-template-rows: auto auto auto auto auto;
  gap: 0;
  min-width: 0;
}

/* =========================================================
   FRANJA SUPERIOR: CLIENTE A LA IZQUIERDA / EMISOR A LA DERECHA
   ========================================================= */

body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-column: 1 / -1;
  grid-row: 1;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.82rem 0.95rem;
  min-width: 0;
  margin: 0 0 0.9rem;
  padding: 3.7rem 1rem 1rem;
  isolation: isolate;
}

/* Dos tarjetas de fondo sin mover ningún campo React. */
body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid::before,
body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset-block: 0;
  width: calc(50% - 0.45rem);
  border: 1px solid var(--zpos-line);
  border-radius: var(--zpos-radius);
  background: rgba(255, 255, 255, 0.985);
  box-shadow: var(--zpos-shadow);
  pointer-events: none;
}

body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid::before {
  left: 0;
}

body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid::after {
  right: 0;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-zone-title {
  position: absolute;
  z-index: 2;
  top: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  color: var(--zpos-ink);
  pointer-events: none;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-zone-title::before {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--zpos-primary-soft);
  color: var(--zpos-primary);
  font-family: "bootstrap-icons";
  font-size: 0.92rem;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-zone-title strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.1;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-zone-title small {
  display: block;
  margin-top: 0.16rem;
  color: var(--zpos-muted);
  font-size: 0.64rem;
  line-height: 1.15;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-zone-title--client {
  left: 1rem;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-zone-title--client::before {
  content: "\f4e1";
}

body.zenty-boletas-page.zenty-pos-layout .zenty-zone-title--emitter {
  left: calc(50% + 0.55rem);
}

body.zenty-boletas-page.zenty-pos-layout .zenty-zone-title--emitter::before {
  content: "\f1ad";
}

body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid > label {
  position: relative;
  z-index: 1;
  gap: 0.32rem;
  align-self: end;
  min-width: 0;
  color: #38535a;
  font-size: 0.7rem;
  font-weight: 560;
}

body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid > label > input,
body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid > label > select {
  min-height: 40px;
  padding-inline: 0.72rem;
  border-color: var(--zpos-line-strong);
  border-radius: 10px;
  background: #fff;
  font-size: 0.8rem;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-field-rut {
  grid-column: 1 / 4;
  grid-row: 1;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-field-reason {
  grid-column: 4 / 7;
  grid-row: 1;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-field-commune {
  grid-column: 1 / 4;
  grid-row: 2;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-field-payment {
  grid-column: 4 / 7;
  grid-row: 2;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-field-company {
  grid-column: 7 / 10;
  grid-row: 1;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-field-dte {
  grid-column: 10 / 13;
  grid-row: 1;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-field-date {
  grid-column: 7 / 10;
  grid-row: 2;
}

body.zenty-boletas-page.zenty-pos-layout .soft-info-box {
  display: none !important;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-emitter-status {
  position: absolute;
  z-index: 3;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: calc(25% - 0.55rem);
  min-height: 40px;
  padding: 0.52rem 0.65rem;
  border: 1px solid #bfe8e1;
  border-radius: 10px;
  background: linear-gradient(135deg, #effcf9, #e8f7ff);
  color: var(--zpos-primary-dark);
  pointer-events: none;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-emitter-status i {
  flex: 0 0 auto;
  font-size: 1rem;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-emitter-status strong,
body.zenty-boletas-page.zenty-pos-layout .zenty-emitter-status span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-emitter-status strong {
  font-size: 0.67rem;
  font-weight: 650;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-emitter-status span {
  margin-top: 0.1rem;
  font-size: 0.61rem;
}

/* =========================================================
   ÁREA DE TRABAJO: DETALLE A LA IZQUIERDA / STOCK A LA DERECHA
   ========================================================= */

body.zenty-boletas-page.zenty-pos-layout .items-block {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  margin: 0 0.8rem 0;
  padding: 0.95rem 0.95rem 0.75rem;
  border: 1px solid var(--zpos-line);
  border-bottom: 0;
  border-radius: var(--zpos-radius) var(--zpos-radius) 0 0;
  background: #fff;
  box-shadow: var(--zpos-shadow);
}

body.zenty-boletas-page.zenty-pos-layout .items-block .section-title-row {
  margin: 0 0 0.78rem;
  padding: 0 0 0.72rem;
  border-bottom: 1px solid #e8eff1;
}

body.zenty-boletas-page.zenty-pos-layout .items-block .section-title-row h4 {
  font-size: 0.96rem;
  font-weight: 650;
}

body.zenty-boletas-page.zenty-pos-layout .item-editor {
  grid-template-columns: minmax(190px, 2.25fr) minmax(72px, 0.72fr) minmax(115px, 1fr) minmax(92px, 0.82fr) minmax(68px, 0.65fr) auto auto;
  gap: 0.58rem;
  margin-bottom: 0.62rem;
  padding: 0.68rem;
  border-color: #dfeaec;
  border-radius: 12px;
  background: #fbfdfd;
}

body.zenty-boletas-page.zenty-pos-layout .item-editor label {
  font-size: 0.64rem;
  font-weight: 560;
}

body.zenty-boletas-page.zenty-pos-layout .item-editor input {
  min-height: 38px;
  font-size: 0.77rem;
}

body.zenty-boletas-page.zenty-pos-layout .item-editor .checkbox-line {
  align-self: end;
  min-height: 38px;
  border-color: #d8e5e7;
  background: #fff;
}

/* Observación, totales y botón forman visualmente el pie de la misma tarjeta. */
body.zenty-boletas-page.zenty-pos-layout .admin-form > label:not(.zenty-payment-field) {
  grid-column: 1;
  grid-row: 3;
  min-width: 0;
  margin: 0 0.8rem 0;
  padding: 0.15rem 0.95rem 0.8rem;
  border-right: 1px solid var(--zpos-line);
  border-left: 1px solid var(--zpos-line);
  background: #fff;
  color: #3c565d;
  font-size: 0.69rem;
  font-weight: 560;
}

body.zenty-boletas-page.zenty-pos-layout .admin-form > label:not(.zenty-payment-field) textarea {
  min-height: 70px;
  resize: vertical;
  border-radius: 10px;
  font-size: 0.78rem;
}

body.zenty-boletas-page.zenty-pos-layout .totals-box {
  grid-column: 1;
  grid-row: 4;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.58rem;
  min-width: 0;
  margin: 0 0.8rem 0;
  padding: 0.78rem 0.95rem;
  border: 1px solid var(--zpos-line);
  border-top: 0;
  border-bottom: 0;
  border-radius: 0;
  background: #fff;
}

body.zenty-boletas-page.zenty-pos-layout .totals-box > div {
  min-width: 0;
  padding: 0.65rem 0.72rem;
  border: 1px solid #dfebed;
  border-radius: 10px;
  background: var(--zpos-surface-soft);
}

body.zenty-boletas-page.zenty-pos-layout .totals-box > div span {
  font-size: 0.63rem;
}

body.zenty-boletas-page.zenty-pos-layout .totals-box > div strong {
  font-size: 0.9rem;
}

body.zenty-boletas-page.zenty-pos-layout .totals-box .total-final {
  border-color: #9fd9d0;
  background: linear-gradient(135deg, #eafbf7, #f4fffd);
}

body.zenty-boletas-page.zenty-pos-layout .admin-form > button[type="submit"] {
  grid-column: 1;
  grid-row: 5;
  min-height: 46px;
  margin: 0 0.8rem 0 0;
  border: 1px solid var(--zpos-primary-dark);
  border-radius: 0 0 var(--zpos-radius) var(--zpos-radius);
  background: linear-gradient(135deg, var(--zpos-primary), #0d9488);
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.18);
  font-size: 0.82rem;
  font-weight: 650;
}

body.zenty-boletas-page.zenty-pos-layout .admin-form > button[type="submit"]::before {
  content: "\f4ca";
  margin-right: 0.45rem;
  font-family: "bootstrap-icons";
}

/* Panel lateral de productos. */
body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock {
  grid-column: 2;
  grid-row: 2 / 6;
  align-self: stretch;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--zpos-line);
  border-radius: var(--zpos-radius);
  background: #fff;
  box-shadow: var(--zpos-shadow);
}

body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1rem 0.78rem;
  border-bottom: 1px solid #e7eff1;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__title {
  display: flex;
  align-items: center;
  gap: 0.62rem;
  min-width: 0;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--zpos-primary-soft);
  color: var(--zpos-primary);
  font-size: 0.95rem;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__header h4 {
  margin: 0;
  color: var(--zpos-ink);
  font-size: 0.94rem;
  font-weight: 650;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__header p {
  margin: 0.18rem 0 0;
  color: var(--zpos-muted);
  font-size: 0.65rem;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__refresh {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--zpos-line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--zpos-primary);
}

body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  padding: 0.78rem 0.9rem;
  background: #f8fbfc;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__search {
  min-width: 0;
  min-height: 40px;
  padding: 0 0.75rem;
  border: 1px solid var(--zpos-line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--zpos-ink);
  font-size: 0.76rem;
  outline: none;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__search:focus {
  border-color: #61bfb2;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}

body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__search-button {
  min-height: 40px;
  padding: 0 0.82rem;
  border: 1px solid #183e47;
  border-radius: 10px;
  background: #173b44;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__status {
  min-height: 31px;
  padding: 0.48rem 0.92rem;
  border-top: 1px solid #edf2f3;
  border-bottom: 1px solid #edf2f3;
  color: var(--zpos-muted);
  font-size: 0.65rem;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__table-wrap {
  max-height: 430px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #bbd6d8 transparent;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__table th,
body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__table td {
  padding: 0.68rem 0.58rem;
  border-bottom: 1px solid #e8eff1;
  text-align: left;
  vertical-align: middle;
  font-size: 0.67rem;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__table th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: linear-gradient(135deg, #0f8b80, #10a294);
  color: #fff;
  font-size: 0.59rem;
  font-weight: 620;
  letter-spacing: 0.02em;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__table th:nth-child(1) { width: 20%; }
body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__table th:nth-child(2) { width: 40%; }
body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__table th:nth-child(3) { width: 13%; }
body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__table th:nth-child(4) { width: 17%; }
body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__table th:nth-child(5) { width: 10%; text-align: center; }

body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__table tbody tr {
  transition: background 0.16s ease;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__table tbody tr:hover {
  background: #f2fbf9;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__code,
body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__code {
  color: #405d64;
  font-weight: 620;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__name {
  color: var(--zpos-ink);
}

body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__stock {
  font-variant-numeric: tabular-nums;
  color: #1672d8;
  font-weight: 650;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__stock.is-low {
  color: var(--zpos-warning);
}

body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__stock.is-out {
  color: var(--zpos-danger);
}

body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__price {
  color: #314e55;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__add {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin: 0 auto;
  border: 1px solid #78cdbf;
  border-radius: 9px;
  background: #fff;
  color: var(--zpos-primary);
  transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__add:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--zpos-primary);
  color: #fff;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__add:disabled {
  border-color: #d7e1e3;
  color: #aab8bb;
  cursor: not-allowed;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__empty {
  padding: 2rem 1rem;
  color: var(--zpos-muted);
  text-align: center;
  font-size: 0.72rem;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__footer {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.7rem 0.9rem;
  border-top: 1px solid #e8eff1;
  background: #fbfdfd;
  color: var(--zpos-muted);
  font-size: 0.63rem;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__footer a {
  color: var(--zpos-primary);
  font-weight: 620;
  text-decoration: none;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-inline-selected-product {
  grid-column: 1 / -1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.15rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: #e9fbf4;
  color: #08705f;
  font-size: 0.6rem;
  font-weight: 620;
}

/* Historial: permanece abajo y ocupa todo el ancho. */
body.zenty-boletas-page.zenty-pos-layout .content-grid.two-columns-wide > .panel-card.muted-card {
  margin-top: 0;
  border-radius: var(--zpos-radius);
}

body.zenty-boletas-page.zenty-pos-layout .content-grid.two-columns-wide > .panel-card.muted-card .panel-card-header {
  margin-bottom: 0.65rem;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1280px) {
  body.zenty-boletas-page.zenty-pos-layout .admin-form {
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  }

  body.zenty-boletas-page.zenty-pos-layout .item-editor {
    grid-template-columns: minmax(190px, 2fr) minmax(70px, 0.7fr) minmax(105px, 0.9fr) minmax(88px, 0.75fr) minmax(62px, 0.58fr) auto;
  }

  body.zenty-boletas-page.zenty-pos-layout .item-editor > button {
    grid-column: -2 / -1;
  }
}

@media (max-width: 1080px) {
  body.zenty-boletas-page.zenty-pos-layout .admin-form {
    display: block;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: repeat(4, auto);
    gap: 0.78rem;
    padding-top: 3.65rem;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid::before,
  body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid::after {
    width: 100%;
    height: calc(50% - 0.42rem);
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid::before {
    inset: 0 0 auto;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid::after {
    inset: auto 0 0;
  }

  body.zenty-boletas-page.zenty-pos-layout .zenty-zone-title--emitter {
    top: calc(50% + 0.45rem);
    left: 1rem;
  }

  body.zenty-boletas-page.zenty-pos-layout .zenty-field-rut { grid-column: 1 / 4; grid-row: 1; }
  body.zenty-boletas-page.zenty-pos-layout .zenty-field-reason { grid-column: 4 / 7; grid-row: 1; }
  body.zenty-boletas-page.zenty-pos-layout .zenty-field-commune { grid-column: 1 / 4; grid-row: 2; }
  body.zenty-boletas-page.zenty-pos-layout .zenty-field-payment { grid-column: 4 / 7; grid-row: 2; }
  body.zenty-boletas-page.zenty-pos-layout .zenty-field-company { grid-column: 1 / 4; grid-row: 3; margin-top: 3.65rem; }
  body.zenty-boletas-page.zenty-pos-layout .zenty-field-dte { grid-column: 4 / 7; grid-row: 3; margin-top: 3.65rem; }
  body.zenty-boletas-page.zenty-pos-layout .zenty-field-date { grid-column: 1 / 4; grid-row: 4; }

  body.zenty-boletas-page.zenty-pos-layout .zenty-emitter-status {
    right: 1rem;
    bottom: 1rem;
    width: calc(50% - 1.4rem);
  }

  body.zenty-boletas-page.zenty-pos-layout .items-block,
  body.zenty-boletas-page.zenty-pos-layout .admin-form > label:not(.zenty-payment-field),
  body.zenty-boletas-page.zenty-pos-layout .totals-box,
  body.zenty-boletas-page.zenty-pos-layout .admin-form > button[type="submit"] {
    margin-right: 0;
  }

  body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock {
    margin-top: 0.9rem;
  }
}

@media (max-width: 760px) {
  body.zenty-boletas-page.zenty-pos-layout .welcome-panel.compact-panel p {
    display: none;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid {
    display: block;
    padding: 3.6rem 0.78rem 0.78rem;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid::before,
  body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid::after {
    display: none;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid {
    border: 1px solid var(--zpos-line);
    border-radius: var(--zpos-radius);
    background: #fff;
    box-shadow: var(--zpos-shadow);
  }

  body.zenty-boletas-page.zenty-pos-layout .zenty-zone-title--emitter {
    display: none;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid > label {
    margin-bottom: 0.7rem;
  }

  body.zenty-boletas-page.zenty-pos-layout .zenty-field-company {
    margin-top: 0.2rem;
    padding-top: 0.85rem;
    border-top: 1px solid #e5edef;
  }

  body.zenty-boletas-page.zenty-pos-layout .zenty-emitter-status {
    position: static;
    width: 100%;
    margin-top: 0.2rem;
  }

  body.zenty-boletas-page.zenty-pos-layout .items-block {
    margin-top: 0.85rem;
  }

  body.zenty-boletas-page.zenty-pos-layout .item-editor {
    grid-template-columns: 1fr 1fr;
  }

  body.zenty-boletas-page.zenty-pos-layout .item-editor > label:first-child,
  body.zenty-boletas-page.zenty-pos-layout .item-editor .zenty-selected-product,
  body.zenty-boletas-page.zenty-pos-layout .item-editor .zenty-inline-selected-product {
    grid-column: 1 / -1;
  }

  body.zenty-boletas-page.zenty-pos-layout .totals-box {
    grid-template-columns: 1fr 1fr;
  }

  body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__toolbar {
    grid-template-columns: 1fr;
  }

  body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__search-button {
    width: 100%;
  }

  body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__table-wrap {
    max-height: 380px;
  }
}

@media (max-width: 520px) {
  body.zenty-boletas-page.zenty-pos-layout .item-editor,
  body.zenty-boletas-page.zenty-pos-layout .totals-box {
    grid-template-columns: 1fr;
  }

  body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__table th:nth-child(1),
  body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__table td:nth-child(1) {
    display: none;
  }

  body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__table th:nth-child(2) { width: 48%; }
  body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__table th:nth-child(3) { width: 16%; }
  body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__table th:nth-child(4) { width: 24%; }
  body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__table th:nth-child(5) { width: 12%; }
}

/* =========================================================
   CORRECCIÓN 17.1 — COMPATIBILIDAD CON ESTILOS COMPACTOS
   Los estilos previos usan !important. Estas reglas fijan la
   grilla final sin alterar el formulario ni sus eventos React.
   ========================================================= */

body.zenty-boletas-page.zenty-pos-layout .admin-form {
  display: grid !important;
  grid-template-columns:
    minmax(0, 1.15fr)
    minmax(270px, 0.52fr)
    minmax(360px, 0.72fr) !important;
  grid-template-rows: auto auto auto auto !important;
  gap: 14px !important;
  align-items: start !important;
  align-content: start !important;
}

body.zenty-boletas-page.zenty-pos-layout .admin-form > .form-grid {
  grid-column: 1 / -1 !important;
  grid-row: 1 !important;
  grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(2, auto) !important;
  column-gap: 16px !important;
  row-gap: 12px !important;
  margin: 0 !important;
  padding: 64px 16px 16px !important;
}

body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid::before,
body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid::after {
  width: calc(50% - 7px) !important;
}

body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid > label {
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  align-self: end !important;
}

body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid > .zenty-field-rut {
  grid-column: 1 / 4 !important;
  grid-row: 1 !important;
}

body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid > .zenty-field-reason {
  grid-column: 4 / 7 !important;
  grid-row: 1 !important;
}

body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid > .zenty-field-commune {
  grid-column: 1 / 4 !important;
  grid-row: 2 !important;
}

body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid > .zenty-field-payment {
  grid-column: 4 / 7 !important;
  grid-row: 2 !important;
}

body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid > .zenty-field-company {
  grid-column: 7 / 10 !important;
  grid-row: 1 !important;
}

body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid > .zenty-field-dte {
  grid-column: 10 / 13 !important;
  grid-row: 1 !important;
}

body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid > .zenty-field-date {
  grid-column: 7 / 10 !important;
  grid-row: 2 !important;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-emitter-status {
  right: 16px !important;
  bottom: 16px !important;
  width: calc(25% - 13px) !important;
  min-width: 0 !important;
}

body.zenty-boletas-page.zenty-pos-layout .admin-form > .items-block {
  grid-column: 1 / 3 !important;
  grid-row: 2 !important;
  margin: 0 !important;
  padding: 14px !important;
  border: 1px solid var(--zpos-line) !important;
  border-radius: var(--zpos-radius) !important;
}

body.zenty-boletas-page.zenty-pos-layout .admin-form > label:not(.zenty-payment-field) {
  grid-column: 1 !important;
  grid-row: 3 !important;
  align-self: stretch !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 14px !important;
  border: 1px solid var(--zpos-line) !important;
  border-radius: var(--zpos-radius) !important;
  background: #fff !important;
  box-shadow: var(--zpos-shadow) !important;
}

body.zenty-boletas-page.zenty-pos-layout .admin-form > label:not(.zenty-payment-field) textarea {
  display: block !important;
  width: 100% !important;
  height: 116px !important;
  min-height: 116px !important;
  margin-top: 6px !important;
  resize: vertical !important;
}

body.zenty-boletas-page.zenty-pos-layout .admin-form > .totals-box {
  grid-column: 2 !important;
  grid-row: 3 !important;
  align-self: stretch !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  border: 1px solid var(--zpos-line) !important;
  border-radius: var(--zpos-radius) !important;
  background: #fff !important;
  box-shadow: var(--zpos-shadow) !important;
}

body.zenty-boletas-page.zenty-pos-layout .admin-form > .totals-box > div,
body.zenty-boletas-page.zenty-pos-layout .admin-form > .totals-box > div:nth-child(2n),
body.zenty-boletas-page.zenty-pos-layout .admin-form > .totals-box > div:nth-last-child(-n + 2) {
  min-height: 38px !important;
  padding: 8px 12px !important;
  border-right: 0 !important;
  border-bottom: 1px solid #e5edef !important;
  border-radius: 0 !important;
  background: #fff !important;
}

body.zenty-boletas-page.zenty-pos-layout .admin-form > .totals-box > div:last-child {
  border-bottom: 0 !important;
}

body.zenty-boletas-page.zenty-pos-layout .admin-form > .totals-box .total-final {
  background: linear-gradient(135deg, #e9fbf7, #f4fffd) !important;
}

body.zenty-boletas-page.zenty-pos-layout .admin-form > .totals-box .total-final span,
body.zenty-boletas-page.zenty-pos-layout .admin-form > .totals-box .total-final strong {
  color: var(--zpos-primary-dark) !important;
}

body.zenty-boletas-page.zenty-pos-layout .admin-form > button[type="submit"],
body.zenty-boletas-page.zenty-pos-layout .admin-form > .btn-primary.w-100 {
  grid-column: 1 / 3 !important;
  grid-row: 4 !important;
  width: 100% !important;
  min-height: 48px !important;
  margin: 0 !important;
  border-radius: 13px !important;
}

body.zenty-boletas-page.zenty-pos-layout .admin-form > .zenty-inline-stock {
  grid-column: 3 !important;
  grid-row: 2 / 5 !important;
  align-self: stretch !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-inline-stock__table-wrap {
  max-height: 360px !important;
}

body.zenty-boletas-page.zenty-pos-layout .item-editor {
  grid-template-columns:
    minmax(200px, 2.2fr)
    minmax(72px, 0.65fr)
    minmax(118px, 1fr)
    minmax(92px, 0.78fr)
    minmax(70px, 0.62fr)
    minmax(78px, 0.66fr)
    38px !important;
}

/* Historial siempre debajo y a todo el ancho. */
body.zenty-boletas-page.zenty-pos-layout .content-grid.two-columns-wide {
  grid-template-columns: minmax(0, 1fr) !important;
}

body.zenty-boletas-page.zenty-pos-layout .content-grid.two-columns-wide > .panel-card,
body.zenty-boletas-page.zenty-pos-layout .content-grid.two-columns-wide > .panel-card.muted-card {
  grid-column: 1 / -1 !important;
  width: 100% !important;
}

@media (max-width: 1320px) {
  body.zenty-boletas-page.zenty-pos-layout .admin-form {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 0.62fr) !important;
    grid-template-rows: auto auto auto auto auto !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form > .items-block {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form > label:not(.zenty-payment-field) {
    grid-column: 1 !important;
    grid-row: 3 !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form > .totals-box {
    grid-column: 1 !important;
    grid-row: 4 !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form > .totals-box > div,
  body.zenty-boletas-page.zenty-pos-layout .admin-form > .totals-box > div:nth-child(2n),
  body.zenty-boletas-page.zenty-pos-layout .admin-form > .totals-box > div:nth-last-child(-n + 2) {
    border-right: 1px solid #e5edef !important;
    border-bottom: 0 !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form > .totals-box > div:last-child {
    border-right: 0 !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form > button[type="submit"],
  body.zenty-boletas-page.zenty-pos-layout .admin-form > .btn-primary.w-100 {
    grid-column: 1 !important;
    grid-row: 5 !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form > .zenty-inline-stock {
    grid-column: 2 !important;
    grid-row: 2 / 6 !important;
  }
}

@media (max-width: 1050px) {
  body.zenty-boletas-page.zenty-pos-layout .admin-form {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form > .form-grid {
    grid-column: 1 !important;
    grid-row: auto !important;
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(4, auto) !important;
    padding: 64px 16px 16px !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid::before,
  body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid::after {
    width: 100% !important;
    height: calc(50% - 7px) !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid::before {
    inset: 0 0 auto !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid::after {
    inset: auto 0 0 !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .zenty-zone-title--emitter {
    top: calc(50% + 9px) !important;
    left: 16px !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid > .zenty-field-rut {
    grid-column: 1 / 4 !important;
    grid-row: 1 !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid > .zenty-field-reason {
    grid-column: 4 / 7 !important;
    grid-row: 1 !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid > .zenty-field-commune {
    grid-column: 1 / 4 !important;
    grid-row: 2 !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid > .zenty-field-payment {
    grid-column: 4 / 7 !important;
    grid-row: 2 !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid > .zenty-field-company {
    grid-column: 1 / 4 !important;
    grid-row: 3 !important;
    margin-top: 64px !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid > .zenty-field-dte {
    grid-column: 4 / 7 !important;
    grid-row: 3 !important;
    margin-top: 64px !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid > .zenty-field-date {
    grid-column: 1 / 4 !important;
    grid-row: 4 !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .zenty-emitter-status {
    right: 16px !important;
    bottom: 16px !important;
    width: calc(50% - 24px) !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form > .items-block,
  body.zenty-boletas-page.zenty-pos-layout .admin-form > label:not(.zenty-payment-field),
  body.zenty-boletas-page.zenty-pos-layout .admin-form > .totals-box,
  body.zenty-boletas-page.zenty-pos-layout .admin-form > button[type="submit"],
  body.zenty-boletas-page.zenty-pos-layout .admin-form > .btn-primary.w-100,
  body.zenty-boletas-page.zenty-pos-layout .admin-form > .zenty-inline-stock {
    grid-column: 1 !important;
    grid-row: auto !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form > .zenty-inline-stock {
    height: auto !important;
  }
}

@media (max-width: 700px) {
  body.zenty-boletas-page.zenty-pos-layout .admin-form > .form-grid {
    display: flex !important;
    flex-direction: column !important;
    padding: 58px 12px 12px !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid::before,
  body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid::after {
    display: none !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form > .form-grid {
    border: 1px solid var(--zpos-line) !important;
    border-radius: var(--zpos-radius) !important;
    background: #fff !important;
    box-shadow: var(--zpos-shadow) !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .zenty-zone-title--emitter {
    display: none !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .zenty-emitter-status {
    position: static !important;
    order: 99 !important;
    width: 100% !important;
    margin-top: 4px !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid > .zenty-field-company {
    margin-top: 10px !important;
    padding-top: 14px !important;
    border-top: 1px solid #e5edef !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form > .totals-box {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .item-editor {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .item-editor > label:first-child,
  body.zenty-boletas-page.zenty-pos-layout .item-editor .zenty-inline-selected-product {
    grid-column: 1 / -1 !important;
  }
}


/* =========================================================
   V17.3 — SELECTOR PROFESIONAL CON CHECK PARA TIPO DE BOLETA
   Mantiene el <select> original conectado a React y solamente
   reemplaza su presentación visual por opciones seleccionables.
   ========================================================= */

body.zenty-boletas-page.zenty-pos-layout .zenty-field-dte {
  align-self: stretch;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-field-dte > select.zenty-native-dte-select {
  position: absolute !important;
  inline-size: 1px !important;
  block-size: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-dte-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.48rem;
  width: 100%;
  min-width: 0;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-dte-option {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 0.48rem;
  min-width: 0;
  min-height: 54px;
  padding: 0.48rem 0.48rem 0.48rem 0.55rem;
  border: 1px solid #cedfe2;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfd 100%);
  color: #365159;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(26, 59, 68, 0.035);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-dte-option:hover {
  border-color: #7bcfc5;
  background: #f5fffd;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.09);
}

body.zenty-boletas-page.zenty-pos-layout .zenty-dte-option:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.17);
  outline-offset: 2px;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-dte-option.is-active {
  border-color: #0f8f84;
  background: linear-gradient(135deg, #e9fbf8 0%, #f4fffd 100%);
  color: #0f5f59;
  box-shadow:
    0 0 0 2px rgba(15, 143, 132, 0.11),
    0 8px 18px rgba(15, 118, 110, 0.08);
}

body.zenty-boletas-page.zenty-pos-layout .zenty-dte-option__icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #eef7f7;
  color: #52757b;
  font-size: 0.82rem;
  transition: background 160ms ease, color 160ms ease;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-dte-option.is-active .zenty-dte-option__icon {
  background: #d7f5f0;
  color: #0f766e;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-dte-option__copy {
  display: block;
  min-width: 0;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-dte-option__copy strong,
body.zenty-boletas-page.zenty-pos-layout .zenty-dte-option__copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-dte-option__copy strong {
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.12;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-dte-option__copy small {
  margin-top: 0.16rem;
  color: #71888e;
  font-size: 0.56rem;
  font-weight: 450;
  line-height: 1.08;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-dte-option__check {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border: 1.5px solid #b8ccd0;
  border-radius: 50%;
  background: #fff;
  color: transparent;
  font-size: 0.65rem;
  transition: all 160ms ease;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-dte-option.is-active .zenty-dte-option__check {
  border-color: #0f766e;
  background: #0f766e;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.11);
}

body.zenty-boletas-page.zenty-pos-layout .zenty-field-company > select {
  min-height: 54px;
  border-radius: 12px;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-field-date > input {
  min-height: 44px;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-emitter-status {
  min-height: 44px;
  border-radius: 12px;
}

@media (max-width: 1260px) {
  body.zenty-boletas-page.zenty-pos-layout .zenty-dte-option {
    grid-template-columns: 24px minmax(0, 1fr) 18px;
    gap: 0.36rem;
    padding-inline: 0.42rem;
  }

  body.zenty-boletas-page.zenty-pos-layout .zenty-dte-option__icon {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 760px) {
  body.zenty-boletas-page.zenty-pos-layout .zenty-dte-choice {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.zenty-boletas-page.zenty-pos-layout .zenty-dte-option {
    min-height: 58px;
  }
}

@media (max-width: 430px) {
  body.zenty-boletas-page.zenty-pos-layout .zenty-dte-choice {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   V17.4 — TIPO DE BOLETA MÁS CLARO Y PROFESIONAL
   - Empresa emisora en una fila completa.
   - Selector DTE amplio, sin textos cortados.
   - Check visible y estado Seleccionada/Seleccionar.
   - Ambiente SII separado de la empresa para evitar duplicidad.
   ========================================================= */

@media (min-width: 1051px) {
  body.zenty-boletas-page.zenty-pos-layout .admin-form > .form-grid {
    grid-template-rows: repeat(3, auto) !important;
    row-gap: 12px !important;
    padding-bottom: 16px !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid > .zenty-field-company {
    grid-column: 7 / 13 !important;
    grid-row: 1 !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid > .zenty-field-dte {
    grid-column: 7 / 13 !important;
    grid-row: 2 !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid > .zenty-field-date {
    grid-column: 7 / 10 !important;
    grid-row: 3 !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .zenty-client-status {
    position: absolute !important;
    z-index: 3 !important;
    left: 16px !important;
    bottom: 16px !important;
    width: calc(50% - 24px) !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .zenty-emitter-status {
    right: 16px !important;
    bottom: 16px !important;
    width: calc(25% - 13px) !important;
  }
}

body.zenty-boletas-page.zenty-pos-layout .zenty-field-dte {
  align-self: stretch !important;
  gap: 0 !important;
  font-size: 0 !important;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-dte-selector-head {
  display: flex !important;
  align-items: baseline !important;
  justify-content: space-between !important;
  gap: 12px !important;
  width: 100% !important;
  margin: 0 0 7px !important;
  color: #25464e !important;
  font-size: 0.72rem !important;
  line-height: 1.25 !important;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-dte-selector-head strong {
  color: #17383f !important;
  font-size: 0.75rem !important;
  font-weight: 650 !important;
  white-space: nowrap !important;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-dte-selector-head small {
  color: #6e858b !important;
  font-size: 0.62rem !important;
  font-weight: 430 !important;
  text-align: right !important;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-dte-choice {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
  width: 100% !important;
  min-width: 0 !important;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-dte-option {
  position: relative !important;
  display: grid !important;
  grid-template-columns: 28px minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 10px !important;
  min-width: 0 !important;
  min-height: 70px !important;
  padding: 10px 12px !important;
  overflow: hidden !important;
  border: 1px solid #cddde0 !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  color: #29474e !important;
  text-align: left !important;
  cursor: pointer !important;
  box-shadow: 0 4px 12px rgba(25, 54, 62, 0.035) !important;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease !important;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-dte-option:hover {
  border-color: #70c8be !important;
  background: #f8fffd !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.09) !important;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-dte-option.is-active {
  border-color: #0f8f84 !important;
  background: linear-gradient(135deg, #e9fbf8 0%, #f7fffd 100%) !important;
  box-shadow: 0 0 0 2px rgba(15, 143, 132, 0.11), 0 8px 18px rgba(15, 118, 110, 0.08) !important;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-dte-option__check {
  display: grid !important;
  place-items: center !important;
  width: 26px !important;
  height: 26px !important;
  border: 2px solid #afc5c9 !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  color: transparent !important;
  font-size: 0.76rem !important;
  box-shadow: none !important;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-dte-option.is-active .zenty-dte-option__check {
  border-color: #0f766e !important;
  background: #0f766e !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.10) !important;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-dte-option__copy {
  display: block !important;
  min-width: 0 !important;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-dte-option__copy strong,
body.zenty-boletas-page.zenty-pos-layout .zenty-dte-option__copy small {
  display: block !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-dte-option__copy strong {
  color: #17383f !important;
  font-size: 0.78rem !important;
  font-weight: 660 !important;
  line-height: 1.2 !important;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-dte-option__copy small {
  margin-top: 4px !important;
  color: #6d858b !important;
  font-size: 0.61rem !important;
  font-weight: 450 !important;
  line-height: 1.2 !important;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-dte-option__side {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  gap: 7px !important;
  min-width: 70px !important;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-dte-option__code {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 23px !important;
  padding: 3px 8px !important;
  border-radius: 999px !important;
  background: #eef4f5 !important;
  color: #436168 !important;
  font-size: 0.58rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  white-space: nowrap !important;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-dte-option__state {
  color: #789095 !important;
  font-size: 0.56rem !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-dte-option.is-active .zenty-dte-option__code {
  background: #d7f4ef !important;
  color: #0f6f67 !important;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-dte-option.is-active .zenty-dte-option__state {
  color: #0f766e !important;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-field-company > select {
  min-height: 46px !important;
  border-radius: 12px !important;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-client-status,
body.zenty-boletas-page.zenty-pos-layout .zenty-emitter-status {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-height: 46px !important;
  padding: 9px 12px !important;
  border-radius: 12px !important;
  pointer-events: none !important;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-client-status {
  border: 1px solid #d8e5e7 !important;
  background: #f7fafb !important;
  color: #49656c !important;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-client-status i,
body.zenty-boletas-page.zenty-pos-layout .zenty-emitter-status i {
  flex: 0 0 auto !important;
  font-size: 1rem !important;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-client-status strong,
body.zenty-boletas-page.zenty-pos-layout .zenty-client-status span,
body.zenty-boletas-page.zenty-pos-layout .zenty-emitter-status strong,
body.zenty-boletas-page.zenty-pos-layout .zenty-emitter-status span {
  display: block !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-client-status strong,
body.zenty-boletas-page.zenty-pos-layout .zenty-emitter-status strong {
  font-size: 0.66rem !important;
  font-weight: 650 !important;
}

body.zenty-boletas-page.zenty-pos-layout .zenty-client-status span,
body.zenty-boletas-page.zenty-pos-layout .zenty-emitter-status span {
  margin-top: 2px !important;
  font-size: 0.59rem !important;
  font-weight: 450 !important;
}

@media (max-width: 1050px) and (min-width: 701px) {
  body.zenty-boletas-page.zenty-pos-layout .admin-form > .form-grid {
    grid-template-rows: repeat(6, auto) !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid > .zenty-field-company {
    grid-column: 1 / 7 !important;
    grid-row: 4 !important;
    margin-top: 64px !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid > .zenty-field-dte {
    grid-column: 1 / 7 !important;
    grid-row: 5 !important;
    margin-top: 0 !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .admin-form .form-grid > .zenty-field-date {
    grid-column: 1 / 4 !important;
    grid-row: 6 !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .zenty-client-status {
    position: relative !important;
    left: auto !important;
    bottom: auto !important;
    grid-column: 1 / 7 !important;
    grid-row: 3 !important;
    width: 100% !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .zenty-emitter-status {
    width: calc(50% - 24px) !important;
  }
}

@media (max-width: 700px) {
  body.zenty-boletas-page.zenty-pos-layout .zenty-field-rut { order: 1 !important; }
  body.zenty-boletas-page.zenty-pos-layout .zenty-field-reason { order: 2 !important; }
  body.zenty-boletas-page.zenty-pos-layout .zenty-field-commune { order: 3 !important; }
  body.zenty-boletas-page.zenty-pos-layout .zenty-field-payment { order: 4 !important; }
  body.zenty-boletas-page.zenty-pos-layout .zenty-client-status { order: 5 !important; }
  body.zenty-boletas-page.zenty-pos-layout .zenty-field-company { order: 6 !important; }
  body.zenty-boletas-page.zenty-pos-layout .zenty-field-dte { order: 7 !important; }
  body.zenty-boletas-page.zenty-pos-layout .zenty-field-date { order: 8 !important; }
  body.zenty-boletas-page.zenty-pos-layout .zenty-emitter-status { order: 9 !important; }

  body.zenty-boletas-page.zenty-pos-layout .zenty-client-status,
  body.zenty-boletas-page.zenty-pos-layout .zenty-emitter-status {
    position: static !important;
    width: 100% !important;
    margin: 4px 0 8px !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .zenty-dte-selector-head {
    display: block !important;
  }

  body.zenty-boletas-page.zenty-pos-layout .zenty-dte-selector-head small {
    display: block !important;
    margin-top: 3px !important;
    text-align: left !important;
  }
}

@media (max-width: 560px) {
  body.zenty-boletas-page.zenty-pos-layout .zenty-dte-choice {
    grid-template-columns: 1fr !important;
  }
}
