/* History orders: products are text lines, never thumbnails. */
body.admin-body .history-product-thumbs {
  display: none !important;
}

body.admin-body .history-product-text {
  display: grid !important;
  gap: 3px !important;
  width: 100% !important;
  min-width: 0 !important;
  color: #160c20 !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
}

body.admin-body .history-product-text > span {
  display: block !important;
  min-width: 0 !important;
  overflow-wrap: anywhere !important;
}

body.admin-body .history-orders-row > [data-mobile-label="Producto"] {
  min-width: 0 !important;
}

body.admin-body main.orders-screen .history-orders-board .history-date-cell {
  display: grid !important;
  gap: 2px !important;
  justify-items: end !important;
  text-align: right !important;
}

body.admin-body main.orders-screen .history-orders-board .history-date-cell span,
body.admin-body main.orders-screen .history-orders-board .history-date-cell small {
  display: block !important;
  line-height: 1.12 !important;
}

body.admin-body main.orders-screen .history-orders-board .history-product-thumbs {
  display: none !important;
}

body.admin-body main.orders-screen .history-orders-board .history-product-text {
  display: grid !important;
}

@media (min-width: 761px) {
  body.admin-body main.orders-screen .history-orders-board .history-orders-head,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row {
    grid-template-columns: 90px 145px minmax(160px, .9fr) minmax(280px, 1.45fr) 125px 170px !important;
    align-items: center !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row > [data-mobile-label="Producto"] {
    display: block !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-product-text {
    font-size: 13px !important;
  }
}

@media (max-width: 1280px) {
  body.admin-body main.orders-screen .history-orders-board .history-orders-head,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row {
    display: grid !important;
    grid-template-columns: 42px 72px minmax(72px, .9fr) minmax(180px, 1.65fr) 78px 96px !important;
    gap: 5px !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    grid-auto-flow: column !important;
    grid-auto-columns: 0 !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row {
    min-height: 72px !important;
    padding: 8px 5px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row > div {
    display: block !important;
    grid-column: auto !important;
    grid-row: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 0 !important;
    overflow: hidden !important;
    text-align: left !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row > div::before {
    content: none !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-product-text {
    gap: 1px !important;
    font-size: 10px !important;
    line-height: 1.12 !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-money,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-date-cell span,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-date-cell small {
    font-size: 9px !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-date-cell {
    justify-self: stretch !important;
    text-align: right !important;
  }
}

@media (max-width: 430px) {
  body.admin-body main.orders-screen .history-orders-board .history-orders-head,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row {
    grid-template-columns: 30px 46px minmax(48px, .8fr) minmax(112px, 1.65fr) 46px 48px !important;
    gap: 4px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-product-text {
    font-size: 7.8px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-money,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-date-cell span,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-date-cell small {
    font-size: 7.2px !important;
  }
}

/* Ultima capa admin: mobile limpio, texto ligero y filas sin montarse. */
body.admin-body,
body.admin-body * {
  font-weight: 400 !important;
}

body.admin-body h1,
body.admin-body h2,
body.admin-body h3,
body.admin-body .button.primary,
body.admin-body .orders-tabs a.active {
  font-weight: 600 !important;
}

body.admin-body .stock-summary-card {
  display: none !important;
}

body.admin-body .stock-board {
  grid-template-columns: minmax(0, 1fr) !important;
}

body.admin-body .stock-inline-form button {
  display: grid !important;
  place-items: center !important;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  font-size: 0 !important;
}

body.admin-body .stock-inline-form button svg {
  width: 15px !important;
  height: 15px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

body.admin-body .client-product-lines {
  display: grid !important;
  gap: 2px !important;
  min-width: 0 !important;
}

body.admin-body .client-product-lines span,
body.admin-body .client-product-lines small {
  display: block !important;
  color: #180c22 !important;
  font-size: 10px !important;
  line-height: 1.12 !important;
  overflow-wrap: anywhere !important;
}

body.admin-body .manual-order-card {
  width: min(860px, 96vw) !important;
}

body.admin-body .manual-steps {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

body.admin-body .manual-delivery-choice,
body.admin-body .manual-payment-choice {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
}

body.admin-body .manual-payment-choice {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

body.admin-body .manual-delivery-choice button,
body.admin-body .manual-payment-choice label {
  display: grid !important;
  place-items: center !important;
  min-height: 44px !important;
  padding: 10px 12px !important;
  border: 1px solid var(--theme-border) !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: var(--theme-secondary-text) !important;
  font-size: 13px !important;
  cursor: pointer !important;
}

body.admin-body .manual-delivery-choice button.active,
body.admin-body .manual-payment-choice label:has(input:checked) {
  background: var(--brand-dark) !important;
  color: var(--theme-on-secondary) !important;
}

body.admin-body .manual-payment-choice input {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body.admin-body .manual-store-note {
  margin: 0 !important;
  padding: 12px 14px !important;
  border: 1px dashed var(--theme-border) !important;
  border-radius: 12px !important;
  background: var(--theme-surface) !important;
  color: var(--theme-secondary-text) !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
}

@media (max-width: 760px) {
  body.admin-body .stock-table-panel thead {
    display: none !important;
  }

  body.admin-body .manual-order-modal {
    padding: 10px !important;
    place-items: end center !important;
  }

  body.admin-body .manual-order-card {
    width: 100% !important;
    max-height: 92vh !important;
    border-radius: 18px 18px 0 0 !important;
  }

  body.admin-body .manual-order-card > header {
    padding: 16px 16px 12px !important;
  }

  body.admin-body .manual-order-card h2 {
    font-size: 20px !important;
  }

  body.admin-body .manual-steps {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    padding: 12px 10px 10px !important;
  }

  body.admin-body .manual-steps button {
    gap: 5px !important;
    font-size: 9px !important;
    text-align: center !important;
    justify-items: center !important;
  }

  body.admin-body .manual-steps button::before {
    left: calc(50% + 15px) !important;
    top: 14px !important;
  }

  body.admin-body .manual-steps span {
    width: 30px !important;
    height: 30px !important;
    font-size: 9px !important;
  }

  body.admin-body .manual-step {
    padding: 14px !important;
  }

  body.admin-body .manual-grid,
  body.admin-body .manual-add-grid,
  body.admin-body .manual-delivery-choice,
  body.admin-body .manual-payment-choice {
    grid-template-columns: 1fr !important;
  }

  body.admin-body .manual-product-results button {
    grid-template-columns: 40px minmax(0, 1fr) auto !important;
    gap: 8px !important;
  }

  body.admin-body .manual-product-results img {
    width: 40px !important;
    height: 40px !important;
  }

  body.admin-body .stock-table-panel table,
  body.admin-body .stock-table-panel tbody,
  body.admin-body .stock-table-panel tr {
    display: block !important;
    width: 100% !important;
  }

  body.admin-body .stock-table-panel tr {
    display: grid !important;
    grid-template-columns: minmax(92px, 1fr) 50px 44px 72px 32px !important;
    gap: 5px !important;
    align-items: center !important;
    min-height: 68px !important;
    padding: 8px 5px !important;
    border-bottom: 1px solid var(--theme-border) !important;
  }

  body.admin-body .stock-table-panel td {
    display: block !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    font-size: 8.5px !important;
    line-height: 1.08 !important;
  }

  body.admin-body .stock-table-panel td::before {
    content: none !important;
  }

  body.admin-body .stock-table-panel td[data-label="Producto"] {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    min-width: 0 !important;
    font-size: 8px !important;
    line-height: 1.05 !important;
    overflow-wrap: anywhere !important;
  }

  body.admin-body .stock-table-panel td[data-label="Producto"] .thumb {
    flex: 0 0 34px !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: 7px !important;
    object-fit: cover !important;
  }

  body.admin-body .stock-badge {
    padding: 4px 5px !important;
    font-size: 7.5px !important;
  }

  body.admin-body .stock-inline-form {
    display: inline-grid !important;
    grid-template-columns: 28px 28px !important;
    gap: 4px !important;
    align-items: center !important;
  }

  body.admin-body .stock-inline-form input,
  body.admin-body .stock-inline-form button {
    width: 28px !important;
    min-width: 28px !important;
    height: 28px !important;
  }

  body.admin-body .stock-inline-form input {
    padding: 0 !important;
    font-size: 8px !important;
    text-align: center !important;
  }

  body.admin-body .stock-inline-form button svg {
    width: 13px !important;
    height: 13px !important;
  }

  body.admin-body .history-orders-board {
    margin: 0 !important;
    border-radius: 14px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-headline {
    display: grid !important;
    gap: 10px !important;
    padding: 14px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-headline h2 {
    font-size: 24px !important;
    line-height: 1.05 !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-headline > strong {
    justify-self: stretch !important;
    padding: 9px 12px !important;
    border-radius: 999px !important;
    background: var(--theme-surface) !important;
    color: var(--theme-primary-text) !important;
    font-size: 12px !important;
    text-align: left !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-table {
    overflow-x: auto !important;
    padding: 0 10px 12px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-head,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row {
    display: grid !important;
    grid-template-columns: 44px 74px 74px minmax(140px, 1fr) 72px 66px !important;
    min-width: 540px !important;
    justify-items: start !important;
    align-items: center !important;
    gap: 8px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-head {
    padding: 11px 8px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-head strong {
    color: #6d6070 !important;
    font-size: 8.5px !important;
    line-height: 1.1 !important;
    text-align: left !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-order-id-head,
  body.admin-body main.orders-screen .history-orders-board .history-order-id-head span {
    font-weight: 500 !important;
    text-align: left !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row {
    min-height: 70px !important;
    padding: 10px 8px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row > div {
    display: block !important;
    justify-self: start !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: #170c20 !important;
    font-size: 9.5px !important;
    line-height: 1.13 !important;
    text-align: left !important;
    overflow-wrap: anywhere !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row > div::before {
    content: none !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-product-thumbs {
    display: none !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-product-text {
    display: grid !important;
    gap: 1px !important;
    color: #160c20 !important;
    font-size: 9px !important;
    line-height: 1.12 !important;
    text-align: left !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-product-text span {
    display: block !important;
    text-align: left !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-money {
    font-size: 9.5px !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-date-cell,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row > [data-mobile-label="Precio"] {
    justify-self: end !important;
    text-align: right !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-date-cell span,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-date-cell small {
    display: block !important;
    max-width: none !important;
    font-size: 8.5px !important;
    line-height: 1.12 !important;
    text-align: right !important;
    white-space: nowrap !important;
  }

  body.admin-body .client-ledger-title {
    gap: 10px !important;
    padding: 10px !important;
  }

  body.admin-body .client-ledger-title h2 {
    font-size: 15px !important;
    line-height: 1.08 !important;
  }

  body.admin-body .client-ledger-title p span,
  body.admin-body .client-ledger-title > strong {
    font-size: 11px !important;
  }

  body.admin-body .client-ledger-table {
    overflow-x: auto !important;
  }

  body.admin-body .client-ledger-head,
  body.admin-body .client-ledger-row {
    display: grid !important;
    grid-template-columns: 38px 72px 72px minmax(138px, 1fr) 56px 96px !important;
    min-width: 510px !important;
    gap: 6px !important;
    align-items: start !important;
  }

  body.admin-body .client-ledger-head strong {
    font-size: 8px !important;
    line-height: 1.05 !important;
  }

  body.admin-body .client-ledger-row {
    padding: 9px 6px !important;
  }

  body.admin-body .client-ledger-row > div {
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    font-size: 9px !important;
    line-height: 1.1 !important;
    overflow-wrap: anywhere !important;
  }

  body.admin-body .client-ledger-row > div::before {
    content: none !important;
  }

  body.admin-body .client-product-lines span,
  body.admin-body .client-product-lines small {
    font-size: 8.5px !important;
    line-height: 1.08 !important;
  }

  body.admin-body .client-ledger-row [data-mobile-label="Precio"] strong {
    font-size: 9px !important;
    white-space: nowrap !important;
  }

  body.admin-body .client-ledger-detail {
    min-height: 30px !important;
    padding: 0 10px !important;
    font-size: 9px !important;
  }
}

@media (max-width: 390px) {
  body.admin-body .stock-table-panel tr {
    grid-template-columns: minmax(82px, 1fr) 42px 38px 62px 28px !important;
    gap: 4px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-head,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row {
    grid-template-columns: 38px 60px 58px minmax(122px, 1fr) 58px 58px !important;
    min-width: 460px !important;
    gap: 6px !important;
  }

  body.admin-body .client-ledger-head,
  body.admin-body .client-ledger-row {
    grid-template-columns: 34px 62px 60px minmax(124px, 1fr) 50px 84px !important;
    min-width: 458px !important;
    gap: 5px !important;
  }
}

@media (min-width: 761px) and (max-width: 1280px) {
  body.admin-body main.orders-screen .history-orders-board .history-orders-head,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row {
    grid-template-columns: 58px 86px 130px minmax(300px, 1fr) 96px 126px !important;
    gap: 8px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row {
    min-height: 78px !important;
    padding: 10px 12px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-product-text {
    font-size: 12px !important;
    line-height: 1.18 !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-money,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-date-cell span,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-date-cell small {
    font-size: 11px !important;
  }
}

/* Mobile history table: compact columns and shorter rows. */
@media (max-width: 760px) {
  body.admin-body main.orders-screen .history-orders-board {
    overflow: hidden !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-table {
    width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-head,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row {
    display: grid !important;
    grid-template-columns: 42px 58px 76px minmax(120px, 1fr) 54px 58px !important;
    gap: 4px !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-head {
    min-height: 30px !important;
    padding: 5px 6px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-head strong {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 0 !important;
    max-width: 100% !important;
    color: var(--theme-secondary-text) !important;
    font-size: 7px !important;
    font-weight: 800 !important;
    line-height: 1.05 !important;
    letter-spacing: 0 !important;
    text-align: center !important;
    text-transform: uppercase !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-head strong:first-child {
    width: 32px !important;
    justify-self: start !important;
    word-break: break-all !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row {
    min-height: 54px !important;
    padding: 6px 6px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row > div {
    display: block !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: #160c20 !important;
    font-size: 8.5px !important;
    font-weight: 500 !important;
    line-height: 1.05 !important;
    text-align: left !important;
    overflow: hidden !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row > div::before {
    content: none !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row > [data-mobile-label="#Pedido"] strong,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-money {
    color: var(--theme-secondary-text) !important;
    font-size: 8.2px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row > [data-mobile-label="Tipo de Entrega"],
  body.admin-body main.orders-screen .history-orders-board .history-orders-row > [data-mobile-label="Cliente"] {
    overflow-wrap: anywhere !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-product-text {
    display: grid !important;
    gap: 0 !important;
    color: #160c20 !important;
    font-size: 8px !important;
    font-weight: 500 !important;
    line-height: 1.04 !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-product-text > span {
    display: block !important;
    overflow: hidden !important;
    text-overflow: clip !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-date-cell {
    display: grid !important;
    gap: 1px !important;
    justify-items: end !important;
    text-align: right !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-date-cell span,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-date-cell small {
    display: block !important;
    max-width: 100% !important;
    font-size: 7.2px !important;
    font-weight: 500 !important;
    line-height: 1.05 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }
}

@media (max-width: 430px) {
  body.admin-body main.orders-screen .history-orders-board .history-orders-head,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row {
    grid-template-columns: 34px 48px 58px minmax(104px, 1fr) 42px 44px !important;
    gap: 3px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-head {
    padding-inline: 4px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-head strong {
    font-size: 6.2px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-head strong:first-child {
    width: 28px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row {
    min-height: 50px !important;
    padding: 5px 4px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row > div {
    font-size: 7.4px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-product-text {
    font-size: 7px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row > [data-mobile-label="#Pedido"] strong,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-money {
    font-size: 7.2px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-date-cell span,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-date-cell small {
    font-size: 6.5px !important;
  }
}

@media (max-width: 380px) {
  body.admin-body main.orders-screen .history-orders-board .history-orders-head,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row {
    grid-template-columns: 30px 42px 50px minmax(88px, 1fr) 38px 40px !important;
    gap: 2px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-head strong {
    font-size: 5.8px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-head strong:first-child {
    width: 25px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row {
    min-height: 48px !important;
    padding-inline: 3px !important;
  }
}

/* Final responsive history polish: bold header, lighter rows, aligned date. */
@media (max-width: 760px) {
  body.admin-body main.orders-screen .history-orders-board .history-orders-head,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row {
    grid-template-columns: 38px 54px 70px minmax(110px, 1fr) 48px 68px !important;
    gap: 3px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-head {
    min-height: 28px !important;
    padding: 4px 6px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-head strong {
    font-size: 6.8px !important;
    font-weight: 800 !important;
    line-height: 1.02 !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-order-id-head,
  body.admin-body main.orders-screen .history-orders-board .history-order-id-head span {
    display: block !important;
    color: var(--theme-secondary-text) !important;
    font-weight: 900 !important;
    text-align: left !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row {
    min-height: 46px !important;
    padding: 5px 6px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row *,
  body.admin-body main :is(.client-ledger-row, .delivery-board-row, .production-order-row, .district-table-row, .hero-banner-row, .celebration-admin-row, .marquee-admin-row, .google-review-admin-row, .payment-method-row, .tiktok-admin-card) *,
  body.admin-body main table tbody td,
  body.admin-body main table tbody td * {
    font-weight: 400 !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row > div {
    font-size: 7.2px !important;
    line-height: 1.03 !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row > [data-mobile-label="#Pedido"] strong,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-money {
    font-size: 7.2px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-product-text {
    gap: 0 !important;
    font-size: 6.9px !important;
    font-weight: 400 !important;
    line-height: 1.03 !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row > [data-mobile-label="Precio"] {
    justify-self: end !important;
    text-align: right !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-date-cell {
    align-self: center !important;
    justify-self: end !important;
    justify-items: end !important;
    text-align: right !important;
    overflow: hidden !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-date-cell span,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-date-cell small {
    max-width: 68px !important;
    color: #160c20 !important;
    font-size: 6.4px !important;
    font-weight: 400 !important;
    line-height: 1.04 !important;
    text-align: right !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}

@media (max-width: 430px) {
  body.admin-body main.orders-screen .history-orders-board .history-orders-head,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row {
    grid-template-columns: 32px 44px 54px minmax(86px, 1fr) 40px 58px !important;
    gap: 2px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-head strong {
    font-size: 5.8px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row {
    min-height: 44px !important;
    padding: 4px 4px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row > div,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row > [data-mobile-label="#Pedido"] strong,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-money {
    font-size: 6.5px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-product-text {
    font-size: 6.2px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-date-cell span,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-date-cell small {
    max-width: 58px !important;
    font-size: 5.9px !important;
  }
}

@media (max-width: 380px) {
  body.admin-body main.orders-screen .history-orders-board .history-orders-head,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row {
    grid-template-columns: 29px 40px 48px minmax(78px, 1fr) 36px 52px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row {
    min-height: 42px !important;
    padding-inline: 3px !important;
  }
}

/* Final mobile alignment: centered columns with visible date. */
@media (max-width: 760px) {
  body.admin-body main.orders-screen .history-orders-board .history-orders-head,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row {
    grid-template-columns: 38px 52px 64px minmax(92px, 1fr) 52px 76px !important;
    justify-items: center !important;
    align-items: center !important;
    gap: 3px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-head strong,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row > div {
    justify-self: center !important;
    text-align: center !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-order-id-head,
  body.admin-body main.orders-screen .history-orders-board .history-order-id-head span {
    text-align: center !important;
    font-weight: 900 !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row {
    min-height: 44px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-product-text,
  body.admin-body main.orders-screen .history-orders-board .history-product-text > span {
    text-align: center !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row > [data-mobile-label="Precio"],
  body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-date-cell {
    justify-self: center !important;
    justify-items: center !important;
    text-align: center !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-date-cell span,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-date-cell small {
    max-width: 76px !important;
    text-align: center !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
}

@media (max-width: 430px) {
  body.admin-body main.orders-screen .history-orders-board .history-orders-head,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row {
    grid-template-columns: 31px 42px 48px minmax(74px, 1fr) 40px 62px !important;
    gap: 2px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-date-cell span,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-date-cell small {
    max-width: 62px !important;
  }
}

/* Capa final: historial y seguimiento con productos en texto centrado. */
body.admin-body main.orders-screen .history-orders-board .history-product-thumbs {
  display: none !important;
}

body.admin-body main.orders-screen .history-orders-board .history-orders-head,
body.admin-body main.orders-screen .history-orders-board .history-orders-row {
  align-items: center !important;
}

body.admin-body main.orders-screen .history-orders-board .history-orders-head strong,
body.admin-body main.orders-screen .history-orders-board .history-orders-row > div {
  align-self: center !important;
  justify-self: center !important;
  text-align: center !important;
}

body.admin-body main.orders-screen .history-orders-board .history-orders-row {
  min-height: 78px !important;
}

body.admin-body main.orders-screen .history-orders-board .history-orders-row > [data-mobile-label="Producto"] {
  display: grid !important;
  min-height: 100% !important;
  place-items: center !important;
}

body.admin-body main.orders-screen .history-orders-board .history-product-text {
  display: grid !important;
  width: 100% !important;
  max-width: 190px !important;
  align-content: center !important;
  justify-items: center !important;
  gap: 2px !important;
  color: #160c20 !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  line-height: 1.16 !important;
  text-align: center !important;
}

body.admin-body main.orders-screen .history-orders-board .history-product-text > span {
  display: block !important;
  width: 100% !important;
  max-width: 170px !important;
  color: inherit !important;
  font-size: inherit !important;
  font-weight: 400 !important;
  line-height: inherit !important;
  text-align: center !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-money,
body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-date-cell,
body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-date-cell span,
body.admin-body main.orders-screen .history-orders-board .history-orders-row .history-date-cell small {
  justify-self: center !important;
  justify-items: center !important;
  text-align: center !important;
}

body.admin-body .client-ledger-head,
body.admin-body .client-ledger-row {
  align-items: center !important;
}

body.admin-body .client-ledger-head strong,
body.admin-body .client-ledger-row > div {
  align-self: center !important;
  justify-self: center !important;
  text-align: center !important;
}

body.admin-body .client-product-lines {
  display: grid !important;
  width: 100% !important;
  max-width: 180px !important;
  align-content: center !important;
  justify-items: center !important;
  gap: 2px !important;
  text-align: center !important;
}

body.admin-body .client-product-lines span,
body.admin-body .client-product-lines small {
  display: block !important;
  max-width: 160px !important;
  color: #160c20 !important;
  font-size: 10px !important;
  font-weight: 400 !important;
  line-height: 1.15 !important;
  text-align: center !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

@media (max-width: 760px) {
  body.admin-body main.orders-screen .history-orders-board .history-orders-head,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row {
    grid-template-columns: 38px 56px 64px minmax(104px, 1.15fr) 52px 72px !important;
    min-width: 520px !important;
    gap: 3px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row {
    min-height: 70px !important;
    padding-block: 8px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-product-text {
    max-width: 112px !important;
    gap: 1px !important;
    font-size: 7.2px !important;
    line-height: 1.08 !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-product-text > span {
    max-width: 106px !important;
  }

  body.admin-body .client-ledger-head,
  body.admin-body .client-ledger-row {
    grid-template-columns: 38px 72px 76px minmax(118px, 1.2fr) 58px 88px !important;
    min-width: 540px !important;
    align-items: center !important;
    justify-items: center !important;
    gap: 4px !important;
  }

  body.admin-body .client-ledger-row {
    min-height: 88px !important;
    padding-block: 8px !important;
  }

  body.admin-body .client-product-lines {
    max-width: 122px !important;
    gap: 1px !important;
  }

  body.admin-body .client-product-lines span,
  body.admin-body .client-product-lines small {
    max-width: 116px !important;
    font-size: 7.4px !important;
    line-height: 1.08 !important;
  }
}

@media (max-width: 430px) {
  body.admin-body main.orders-screen .history-orders-board .history-orders-head,
  body.admin-body main.orders-screen .history-orders-board .history-orders-row {
    grid-template-columns: 32px 44px 48px minmax(82px, 1.2fr) 40px 58px !important;
    min-width: 440px !important;
    gap: 2px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-orders-row {
    min-height: 66px !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-product-text {
    max-width: 88px !important;
    font-size: 6.4px !important;
    line-height: 1.05 !important;
  }

  body.admin-body main.orders-screen .history-orders-board .history-product-text > span {
    max-width: 84px !important;
  }

  body.admin-body .client-ledger-head,
  body.admin-body .client-ledger-row {
    grid-template-columns: 32px 62px 62px minmax(96px, 1.2fr) 46px 74px !important;
    min-width: 456px !important;
  }

  body.admin-body .client-product-lines {
    max-width: 98px !important;
  }

  body.admin-body .client-product-lines span,
  body.admin-body .client-product-lines small {
    max-width: 94px !important;
    font-size: 6.8px !important;
  }
}

/* Vista mobile tipo tabla para el historial por cliente. */
@media (max-width: 760px) {
  body.admin-body .client-ledger-list {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    padding-bottom: 10px !important;
    -webkit-overflow-scrolling: touch !important;
  }

  body.admin-body .client-ledger-list::-webkit-scrollbar {
    height: 6px !important;
  }

  body.admin-body .client-ledger-list::-webkit-scrollbar-thumb {
    border-radius: 999px !important;
    background: rgba(var(--theme-primary-rgb), 0.28) !important;
  }

  body.admin-body .client-ledger-card {
    min-width: 1080px !important;
    overflow: hidden !important;
    border: 1px solid rgba(var(--theme-primary-rgb), 0.24) !important;
    border-top: 5px solid var(--brand-primary) !important;
    border-radius: 18px !important;
    background: #fff !important;
  }

  body.admin-body .client-ledger-title {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 18px !important;
    padding: 22px 22px 18px !important;
    border-bottom: 1px solid rgba(var(--theme-primary-rgb), 0.16) !important;
    text-align: left !important;
  }

  body.admin-body .client-ledger-title h2 {
    margin: 0 !important;
    color: var(--theme-secondary-text) !important;
    font-family: "Cinzel", Georgia, "Times New Roman", serif !important;
    font-size: 34px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-align: left !important;
    white-space: nowrap !important;
  }

  body.admin-body .client-ledger-title p {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 18px !important;
    margin-top: 10px !important;
    color: #5f5268 !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    text-align: left !important;
  }

  body.admin-body .client-ledger-title p span,
  body.admin-body .client-ledger-title > strong {
    white-space: nowrap !important;
  }

  body.admin-body .client-ledger-title > strong {
    display: inline-flex !important;
    min-width: 96px !important;
    height: 44px !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid rgba(var(--theme-primary-rgb), 0.36) !important;
    border-radius: 999px !important;
    background: var(--theme-surface) !important;
    color: var(--theme-secondary-text) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-align: center !important;
  }

  body.admin-body .client-ledger-table {
    width: 100% !important;
    overflow: visible !important;
    border-radius: 0 !important;
  }

  body.admin-body .client-ledger-head,
  body.admin-body .client-ledger-row {
    display: grid !important;
    grid-template-columns: 68px 190px 170px 300px 150px 190px !important;
    min-width: 0 !important;
    width: 100% !important;
    align-items: center !important;
    justify-items: center !important;
    gap: 0 !important;
  }

  body.admin-body .client-ledger-head {
    min-height: 48px !important;
    padding: 0 18px !important;
    border-bottom: 1px solid rgba(var(--theme-primary-rgb), 0.18) !important;
    background: var(--theme-surface) !important;
  }

  body.admin-body .client-ledger-head strong {
    color: var(--theme-secondary-text) !important;
    font-size: 9px !important;
    font-weight: 500 !important;
    line-height: 1.15 !important;
    text-align: center !important;
    text-transform: uppercase !important;
    letter-spacing: .08em !important;
  }

  body.admin-body .client-ledger-row {
    min-height: 82px !important;
    padding: 10px 18px !important;
    border-bottom: 1px solid rgba(var(--theme-primary-rgb), 0.16) !important;
    background: #fff !important;
  }

  body.admin-body .client-ledger-row > div {
    display: grid !important;
    width: 100% !important;
    min-height: 100% !important;
    align-content: center !important;
    justify-items: center !important;
    padding: 0 7px !important;
    color: #160c20 !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 1.18 !important;
    text-align: center !important;
  }

  body.admin-body .client-ledger-row > div::before {
    content: none !important;
    display: none !important;
  }

  body.admin-body .client-ledger-row > div:first-child strong {
    color: var(--theme-secondary-text) !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
  }

  body.admin-body .client-product-lines {
    width: 100% !important;
    max-width: 260px !important;
    align-content: center !important;
    justify-items: center !important;
    gap: 2px !important;
  }

  body.admin-body .client-product-lines span,
  body.admin-body .client-product-lines small {
    max-width: 250px !important;
    color: #160c20 !important;
    font-size: 10.5px !important;
    font-weight: 400 !important;
    line-height: 1.12 !important;
    text-align: center !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  body.admin-body .client-ledger-row [data-mobile-label="Precio"] strong {
    color: var(--theme-secondary-text) !important;
    font-size: 19px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  body.admin-body .client-ledger-detail {
    display: inline-flex !important;
    width: auto !important;
    min-width: 112px !important;
    height: 38px !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 18px !important;
    border: 1px solid rgba(var(--theme-primary-rgb), 0.38) !important;
    border-radius: 999px !important;
    background: #fff !important;
    color: var(--theme-secondary-text) !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    text-align: center !important;
    white-space: nowrap !important;
  }
}
