/*
 * modern-pos-dialogs.css — skins for child dialogs opened from the POS screen
 * (delivery/tip sheet, void dialog) plus the POS `:where()` typography lock.
 * GLOBAL by necessity — `body:has(.scale-modern-pos) .mud-dialog…` / `#voidDialog`
 * target MudBlazor/Bootstrap dialogs rendered outside component scope.
 * (Distinct from modern-dialog-skins.css, which holds the payment/discount/
 * refund/report dialog skins.)
 *
 * Phase 6 split: peeled verbatim off the (post-tranche-6) end of modern-base.css
 * (was lines 3815-EOF). Loaded via index.html AFTER modern-base.css and BEFORE
 * modern-payment.css — source order is load-bearing. Do not reorder the <link>
 * tags. Tokens resolve from modern-tokens.css imported by modern-base.css.
 */

/* ── Delivery & tips dialog — redesigned 2026-07-30 to the Tips mockup:
   serif title, "Bill total" line, preset chips, amount display + summary
   next to a square-key numeric pad, and a full-width Clear button.
   Matches BOTH hosts (the dialog opens from the POS page and the payment
   page), hence the doubled :has() prefixes. */

body:has(.scale-modern-pos) .mud-dialog.delivery-tip-dialog-wrapper,
body:has(.scale-modern-payment) .mud-dialog.delivery-tip-dialog-wrapper {
  width: min(94vw, 560px) !important;
  max-width: min(94vw, 560px) !important;
  overflow: hidden;
  border-radius: 14px !important;
  background: var(--scale-bg) !important;
  box-shadow: var(--scale-shadow-sheet) !important;
  color: var(--scale-text) !important;
  font-family: var(--scale-font-sans) !important;
}

body:has(.scale-modern-pos) .mud-dialog.delivery-tip-dialog-wrapper .mud-dialog-title,
body:has(.scale-modern-payment) .mud-dialog.delivery-tip-dialog-wrapper .mud-dialog-title {
  justify-content: stretch;
  padding: 0 !important;
  color: var(--scale-text) !important;
  font-family: var(--scale-font-sans) !important;
  font-size: var(--scale-type-headline-size) !important;
  font-weight: var(--scale-type-headline-weight) !important;
  letter-spacing: var(--scale-tracking-snug);
}

/* Title: no override — the canonical sans .scale-modern-dialog-title-main style
   applies (ONE font family app-wide; the display serif is login-brand only). */

/* SDialog wraps ChildContent in an inner .s-dialog__body; target that (not the outer
   .mud-dialog-content) so the intended inset is not double-stacked with SDialog's own
   body padding. */
body:has(.scale-modern-pos) .mud-dialog.delivery-tip-dialog-wrapper .s-dialog__body,
body:has(.scale-modern-payment) .mud-dialog.delivery-tip-dialog-wrapper .s-dialog__body {
  padding: 0 16px 16px !important;
}

body:has(.scale-modern-pos) .delivery-tip-sheet,
body:has(.scale-modern-payment) .delivery-tip-sheet {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 4px;
}

/* Segmented Delivery | Tips control (same look as the split-payment tabs). */
body:has(.scale-modern-pos) .delivery-tip-segment,
body:has(.scale-modern-payment) .delivery-tip-segment {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  padding: 3px;
  border-radius: var(--scale-radius-seg);
  background: rgba(120, 120, 128, 0.16);
}

body:has(.scale-modern-pos) .delivery-tip-segment button,
body:has(.scale-modern-payment) .delivery-tip-segment button {
  /* Canonical chip/segmented-tab height — the token comment in modern-tokens.css
     explicitly names the delivery-tip tabs among its consumers. */
  height: var(--scale-chip-height);
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--scale-text-mute);
  font-family: var(--scale-font-sans);
  font-size: var(--scale-fs-14);
  font-weight: 500;
}

body:has(.scale-modern-pos) .delivery-tip-segment button.is-active,
body:has(.scale-modern-payment) .delivery-tip-segment button.is-active {
  background: var(--scale-panel);
  color: var(--scale-primary);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.10), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
  font-weight: 600;
}

/* "Bill total: 11.000 KWD" line. */
body:has(.scale-modern-pos) .delivery-tip-bill,
body:has(.scale-modern-payment) .delivery-tip-bill {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 0 2px;
}

body:has(.scale-modern-pos) .delivery-tip-bill em,
body:has(.scale-modern-payment) .delivery-tip-bill em {
  font-style: normal;
  color: var(--scale-text-soft);
  font-size: var(--scale-fs-14);
  font-weight: 500;
}

body:has(.scale-modern-pos) .delivery-tip-bill strong,
body:has(.scale-modern-payment) .delivery-tip-bill strong {
  color: var(--scale-text);
  font-family: var(--scale-font-sans);
  font-size: var(--scale-fs-18);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

body:has(.scale-modern-pos) .delivery-tip-bill small,
body:has(.scale-modern-payment) .delivery-tip-bill small {
  color: var(--scale-text-soft);
  font-size: var(--scale-fs-12);
  font-weight: 600;
  letter-spacing: var(--scale-tracking-caps);
  text-transform: uppercase;
}

/* Preset amount chips; selected = solid primary. */
body:has(.scale-modern-pos) .delivery-tip-presets,
body:has(.scale-modern-payment) .delivery-tip-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

body:has(.scale-modern-pos) .delivery-tip-presets button,
body:has(.scale-modern-payment) .delivery-tip-presets button {
  min-height: var(--scale-chip-height);
  border: 1px solid var(--scale-border);
  border-radius: var(--scale-radius-card);
  background: var(--scale-panel);
  color: var(--scale-text);
  box-shadow: var(--scale-shadow-tile);
  font-family: var(--scale-font-sans);
  font-size: var(--scale-fs-14);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

body:has(.scale-modern-pos) .delivery-tip-presets button.is-selected,
body:has(.scale-modern-payment) .delivery-tip-presets button.is-selected {
  border-color: var(--scale-primary);
  background: var(--scale-primary);
  color: var(--scale-text-on-primary);
  font-weight: 700;
}

/* Amount display + summary on the left, keypad on the right. */
body:has(.scale-modern-pos) .delivery-tip-cols,
body:has(.scale-modern-payment) .delivery-tip-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 12px;
  align-items: start;
}

body:has(.scale-modern-pos) .delivery-tip-cols.is-readonly,
body:has(.scale-modern-payment) .delivery-tip-cols.is-readonly {
  grid-template-columns: minmax(0, 1fr);
}

body:has(.scale-modern-pos) .delivery-tip-left,
body:has(.scale-modern-payment) .delivery-tip-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Big entered-amount display (mirrors the payment page amount display). */
body:has(.scale-modern-pos) .delivery-tip-amount-display,
body:has(.scale-modern-payment) .delivery-tip-amount-display {
  min-height: 64px;
  padding: 14px 16px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  border-radius: var(--scale-radius-card);
  background: var(--scale-panel);
  box-shadow: var(--scale-shadow-tile);
}

body:has(.scale-modern-pos) .delivery-tip-amount-display strong,
body:has(.scale-modern-payment) .delivery-tip-amount-display strong {
  color: var(--scale-text);
  font-family: var(--scale-font-sans);
  font-size: var(--scale-fs-26);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

body:has(.scale-modern-pos) .delivery-tip-amount-display small,
body:has(.scale-modern-payment) .delivery-tip-amount-display small {
  color: var(--scale-text-mute);
  font-size: var(--scale-fs-12);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Tip / New total summary card. */
body:has(.scale-modern-pos) .delivery-tip-summary,
body:has(.scale-modern-payment) .delivery-tip-summary {
  border-radius: var(--scale-radius-card);
  background: var(--scale-panel);
  box-shadow: var(--scale-shadow-tile);
  overflow: hidden;
}

/* Rows follow the payment page's price-summary pattern (.scale-modern-payment-
   total-row): values at weight 500, only the final total row bold; 48px rows
   like the split dialog's progress card. */
body:has(.scale-modern-pos) .delivery-tip-summary > div,
body:has(.scale-modern-payment) .delivery-tip-summary > div {
  min-height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 0.5px solid var(--scale-separator);
  /* Same family split as .scale-modern-payment-total-row: labels on the
     price alias, values on sans (identical today; diverges in one place). */
  font-family: var(--scale-font-price);
}

body:has(.scale-modern-pos) .delivery-tip-summary > div:last-child,
body:has(.scale-modern-payment) .delivery-tip-summary > div:last-child {
  border-bottom: 0;
}

body:has(.scale-modern-pos) .delivery-tip-summary span,
body:has(.scale-modern-payment) .delivery-tip-summary span {
  color: var(--scale-text);
  font-size: var(--scale-fs-15);
  font-weight: 500;
}

body:has(.scale-modern-pos) .delivery-tip-summary strong,
body:has(.scale-modern-payment) .delivery-tip-summary strong {
  color: var(--scale-text);
  font-family: var(--scale-font-sans);
  font-size: var(--scale-fs-15);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

body:has(.scale-modern-pos) .delivery-tip-summary > div:last-child strong,
body:has(.scale-modern-payment) .delivery-tip-summary > div:last-child strong {
  font-weight: 700;
}

body:has(.scale-modern-pos) .delivery-tip-summary strong.is-success,
body:has(.scale-modern-payment) .delivery-tip-summary strong.is-success {
  color: var(--scale-success);
}

/* Numeric pad: square keys (same treatment as the confirm-payment pad). */
body:has(.scale-modern-pos) .delivery-tip-keypad,
body:has(.scale-modern-payment) .delivery-tip-keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

body:has(.scale-modern-pos) .delivery-tip-keypad button,
body:has(.scale-modern-payment) .delivery-tip-keypad button {
  min-height: 0;
  height: auto;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--scale-border);
  border-radius: var(--scale-keypad-radius);
  background: var(--scale-panel);
  color: var(--scale-text);
  box-shadow: var(--scale-shadow-tile);
  font-family: var(--scale-font-sans);
  font-size: var(--scale-fs-18);
  font-weight: 600;
}

body:has(.scale-modern-pos) .delivery-tip-keypad i,
body:has(.scale-modern-payment) .delivery-tip-keypad i {
  font-size: var(--scale-fs-16);
}

/* Full-width Clear Tip / Clear Delivery. */
body:has(.scale-modern-pos) .delivery-tip-clear,
body:has(.scale-modern-payment) .delivery-tip-clear {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--scale-border);
  border-radius: var(--scale-radius-card);
  background: var(--scale-panel);
  color: var(--scale-danger);
  font-family: var(--scale-font-sans);
  font-size: var(--scale-fs-14);
  font-weight: 700;
}

body:has(.scale-modern-pos) .delivery-tip-clear:hover,
body:has(.scale-modern-payment) .delivery-tip-clear:hover {
  background: color-mix(in srgb, var(--scale-danger) 8%, var(--scale-panel));
}

body:has(.scale-modern-pos) .mud-dialog.delivery-tip-dialog-wrapper .mud-dialog-actions,
body:has(.scale-modern-payment) .mud-dialog.delivery-tip-dialog-wrapper .mud-dialog-actions {
  display: none !important;
  padding: 0 !important;
  border: 0 !important;
  background: var(--scale-bg) !important;
  box-shadow: none !important;
}

body:has(.scale-modern-pos) #voidDialog.modal {
  background: var(--scale-overlay);
  font-family: var(--scale-font-sans) !important;
}

body:has(.scale-modern-pos) #voidDialog .modal-dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  bottom: auto;
  width: min(94vw, 1280px) !important;
  max-width: min(94vw, 1280px) !important;
  height: auto;
  max-height: 92vh;
  margin: 0 !important;
  transform: translate(-50%, -50%) !important;
}

body:has(.scale-modern-pos) #voidDialog .modal-content {
  overflow: hidden;
  border: 0 !important;
  border-radius: 14px !important;
  background: var(--scale-bg) !important;
  box-shadow: var(--scale-shadow-sheet) !important;
  color: var(--scale-text) !important;
  height: auto;
  max-height: 92vh;
}

body:has(.scale-modern-pos) #voidDialog .modal-header {
  position: relative;
  justify-content: center;
  padding: 18px 18px 12px !important;
  border: 0 !important;
  background: var(--scale-bg) !important;
  color: var(--scale-text) !important;
}

body:has(.scale-modern-pos) #voidDialog .modal-header::before {
  content: none;
}

body:has(.scale-modern-pos) #voidDialog .modal-title {
  color: var(--scale-text) !important;
  font-family: var(--scale-font-sans) !important;
  font-size: var(--scale-type-headline-size);
  font-weight: var(--scale-type-headline-weight);
}

body:has(.scale-modern-pos) #voidDialog .btn-close {
  position: absolute;
  right: 14px;
  opacity: 0.7;
  filter: none !important;
}

body:has(.scale-modern-pos) #voidDialog .modal-body {
  padding: 0 16px 16px !important;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-sheet {
  display: flex;
  flex-direction: column;
  font-family: var(--scale-font-sans) !important;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-grabber-wrap {
  display: none;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-grabber {
  width: 36px;
  height: 5px;
  border-radius: 3px;
  background: rgba(120, 120, 128, 0.40);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-titlebar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  padding: 2px 16px 14px;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-title {
  margin: 0;
  color: var(--scale-text);
  font-size: var(--scale-type-headline-size);
  font-weight: var(--scale-type-headline-weight);
  line-height: var(--scale-leading-mid);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-title-action {
  min-width: 68px;
  border: 0;
  background: transparent;
  color: var(--scale-primary);
  font-size: var(--scale-type-body-size);
  font-weight: 500;
  line-height: var(--scale-leading-body);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-title-action-danger {
  color: var(--scale-danger);
  font-weight: 700;
  text-align: right;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-title-action:disabled {
  color: var(--scale-text-soft);
  cursor: default;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-body {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  padding: 16px 16px;
}

/* ===== Void items — redesigned table + reason layout ===== */
body:has(.scale-modern-pos) #voidDialog .scale-void-items-card {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 0.5px solid var(--scale-border);
  border-radius: 14px;
  background: var(--scale-panel);
  box-shadow: var(--scale-shadow-tile);
  overflow: hidden;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-reason-card {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border: 0.5px solid var(--scale-border);
  border-radius: 14px;
  background: var(--scale-panel);
  box-shadow: var(--scale-shadow-tile);
  overflow-y: auto;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-selectall {
  flex: 0 0 auto;
  padding: 12px 16px;
  border-bottom: 1px solid var(--scale-separator);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-checkbox input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-checkbox-box {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--scale-border-strong);
  background: var(--scale-bg);
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-checkbox input:checked + .scale-void-checkbox-box {
  border-color: var(--scale-primary);
  background: var(--scale-primary);
  color: var(--scale-text-on-primary);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-checkbox-box i {
  font-size: var(--scale-fs-16);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-checkbox-label {
  color: var(--scale-primary);
  font-size: var(--scale-fs-14);
  font-weight: 700;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-table {
  min-height: 0;
  overflow-y: auto;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-table-head,
body:has(.scale-modern-pos) #voidDialog .scale-void-table-row {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 116px 78px 72px 84px 72px;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-cell-product {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-table-head {
  min-height: 40px;
  border-bottom: 1px solid var(--scale-separator);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-table-head span {
  color: var(--scale-text-mute);
  font-size: var(--scale-type-footnote-size);
  font-weight: 500;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-table-row {
  min-height: 62px;
  border-bottom: 1px solid var(--scale-separator);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-table-row:last-child {
  border-bottom: 0;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-cell-product {
  color: var(--scale-text);
  font-size: var(--scale-fs-14);
  font-weight: 600;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-cell-remaining,
body:has(.scale-modern-pos) #voidDialog .scale-void-cell-price,
body:has(.scale-modern-pos) #voidDialog .scale-void-cell-net {
  color: var(--scale-text);
  font-size: var(--scale-type-subheadline-size);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-cell-net {
  color: var(--scale-text-mute);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-cell-qty {
  display: inline-grid;
  grid-template-columns: 30px minmax(20px, auto) 30px;
  align-items: center;
  justify-items: center;
  gap: 8px;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-cell-qty button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--scale-border-strong);
  border-radius: 999px;
  background: var(--scale-panel);
  color: var(--scale-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-cell-qty button:disabled {
  color: var(--scale-text-soft);
  opacity: 0.5;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-cell-qty button i {
  font-size: var(--scale-fs-16);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-cell-qty strong {
  color: var(--scale-text);
  font-size: var(--scale-fs-14);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-switch {
  width: 44px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--scale-border-strong);
  position: relative;
  cursor: pointer;
  transition: background var(--scale-duration-press) var(--scale-ease-out-ios);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-switch.is-on {
  background: var(--scale-success);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-switch:disabled {
  opacity: 0.5;
  cursor: default;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform var(--scale-duration-press) var(--scale-ease-out-ios);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-switch.is-on .scale-void-switch-knob {
  transform: translateX(18px);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-reason-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-reason-option {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--scale-border);
  border-radius: 12px;
  background: var(--scale-bg);
  color: var(--scale-text);
  font-size: var(--scale-fs-14);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-reason-option.is-active {
  border-color: var(--scale-primary);
  background: color-mix(in srgb, var(--scale-primary) 6%, var(--scale-panel));
  box-shadow: 0 0 0 1px var(--scale-primary);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-radio {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1.5px solid var(--scale-border-strong);
  background: var(--scale-bg);
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-reason-option.is-active .scale-void-radio {
  border-color: var(--scale-primary);
  background: var(--scale-primary);
  color: var(--scale-text-on-primary);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-radio i {
  font-size: var(--scale-fs-14);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-reason-detail {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-required {
  color: var(--scale-danger);
  font-style: normal;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-reason-detail textarea {
  width: 100%;
  min-height: 90px;
  padding: 12px 14px;
  border: 1px solid var(--scale-border);
  border-radius: 12px;
  outline: 0;
  background: var(--scale-bg);
  color: var(--scale-text);
  font-family: var(--scale-font-sans);
  font-size: var(--scale-type-subheadline-size);
  resize: none;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-reason-detail textarea.is-required {
  border-color: var(--scale-danger);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-items {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-kicker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-kicker-row span {
  color: var(--scale-text-soft);
  font-size: var(--scale-type-footnote-size);
  font-weight: 800;
  letter-spacing: var(--scale-tracking-caps);
  line-height: 1.35;
  text-transform: uppercase;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-kicker-row small {
  color: var(--scale-text-mute);
  font-size: var(--scale-type-caption-1-size);
  font-weight: var(--scale-type-caption-1-weight);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-list {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  border-radius: var(--scale-radius-card);
  background: var(--scale-panel);
  box-shadow: var(--scale-shadow-tile);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-line {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: var(--scale-hairline) solid var(--scale-separator);
  background: transparent;
  cursor: pointer;
  transition: background var(--scale-duration-press) var(--scale-ease-out-ios);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-line:last-child {
  border-bottom: 0;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-line.is-selected {
  background: color-mix(in srgb, var(--scale-danger) 8%, transparent);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-check {
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--scale-border-strong);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--scale-text-on-primary);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-line.is-selected .scale-void-check {
  border-color: var(--scale-danger);
  background: var(--scale-danger);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-check i {
  font-size: var(--scale-fs-13);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-line-copy {
  min-width: 0;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-line-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-line-heading span {
  min-width: 0;
  overflow: hidden;
  color: var(--scale-text);
  font-size: var(--scale-fs-14);
  font-weight: 500;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-line-heading em {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--scale-accent) 16%, transparent);
  color: var(--scale-accent);
  font-size: var(--scale-fs-9);
  font-style: normal;
  font-weight: 800;
  letter-spacing: var(--scale-tracking-caps);
  line-height: 1.45;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-line-copy small {
  display: block;
  margin-top: 2px;
  color: var(--scale-text-soft);
  font-size: var(--scale-type-caption-1-size);
  font-weight: var(--scale-type-caption-1-weight);
  font-variant-numeric: tabular-nums;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-inventory {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  padding: 3px 8px 3px 6px;
  border: 0;
  border-radius: 6px;
  background: color-mix(in srgb, var(--scale-text-soft) 14%, transparent);
  color: var(--scale-text-mute);
  font-size: var(--scale-type-caption-1-size);
  font-weight: 700;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-inventory.is-on {
  background: color-mix(in srgb, var(--scale-success) 12%, transparent);
  color: var(--scale-success);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-inventory span {
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--scale-border-strong);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-inventory.is-on span {
  border-color: var(--scale-success);
  background: var(--scale-success);
  color: var(--scale-text-on-primary);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-inventory i {
  font-size: var(--scale-fs-9);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-stepper {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-stepper button {
  width: 26px;
  height: 26px;
  border: 1px solid var(--scale-border);
  border-radius: 50%;
  background: var(--scale-panel);
  color: var(--scale-text);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-stepper button:disabled {
  cursor: default;
  opacity: 0.4;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-stepper i {
  font-size: var(--scale-fs-13);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-stepper strong {
  min-width: 22px;
  color: var(--scale-text);
  font-size: var(--scale-type-headline-size);
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-stepper span {
  min-width: 66px;
  color: var(--scale-text);
  font-size: var(--scale-type-subheadline-size);
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-line-total {
  color: var(--scale-text-soft);
  font-size: var(--scale-type-subheadline-size);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-empty {
  padding: 40px;
  color: var(--scale-text-soft);
  font-size: var(--scale-type-subheadline-size);
  text-align: center;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-summary {
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-total-card,
body:has(.scale-modern-pos) #voidDialog .scale-void-stock-card,
body:has(.scale-modern-pos) #voidDialog .scale-void-note {
  border-radius: var(--scale-radius-card);
  background: var(--scale-panel);
  box-shadow: var(--scale-shadow-tile);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-total-card {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 12px 16px;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-total-card span,
body:has(.scale-modern-pos) #voidDialog .scale-void-panel-title {
  color: var(--scale-text-soft);
  font-size: var(--scale-fs-10);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-total-card small {
  display: block;
  margin-top: 1px;
  color: var(--scale-text-mute);
  font-size: var(--scale-type-caption-1-size);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-total-card strong {
  color: var(--scale-text-soft);
  font-family: var(--scale-font-mono);
  font-size: var(--scale-fs-22);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-total-card strong.is-danger {
  color: var(--scale-danger);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-total-card strong span {
  margin-left: 4px;
  color: var(--scale-text-mute);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-stock-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: var(--scale-text);
  font-size: var(--scale-type-caption-1-size);
  font-weight: 700;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-stock-card i {
  color: var(--scale-success);
  font-size: var(--scale-fs-14);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-stock-card small {
  margin-left: auto;
  color: var(--scale-text-mute);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-panel-title {
  padding: 4px 4px 6px;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-reason-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-reason-grid button {
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: var(--scale-panel);
  color: var(--scale-text);
  box-shadow: var(--scale-shadow-tile);
  font-size: var(--scale-type-subheadline-size);
  font-weight: 700;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-reason-grid button.is-active {
  background: var(--scale-primary);
  color: var(--scale-text-on-primary);
  box-shadow: none;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-note {
  overflow: hidden;
  padding-top: 4px;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-note textarea {
  width: 100%;
  border: 0;
  outline: 0;
  resize: none;
  padding: 10px 14px;
  background: transparent;
  color: var(--scale-text);
  font-family: var(--scale-font-sans);
  font-size: var(--scale-type-body-size);
  line-height: var(--scale-leading-body);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-note textarea::placeholder {
  color: var(--scale-text-soft);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-permission {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: var(--scale-radius-card);
  background: color-mix(in srgb, var(--scale-accent) 10%, transparent);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-permission.has-error {
  animation: scale-modern-shake 320ms ease;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-permission-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--scale-accent);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-permission-heading i {
  font-size: var(--scale-fs-16);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-permission-heading span {
  font-size: var(--scale-type-footnote-size);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-permission p {
  margin: 0;
  color: var(--scale-text);
  font-size: var(--scale-type-caption-1-size);
  line-height: 1.4;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-permission input {
  width: 100%;
  height: 38px;
  border: 0;
  border-radius: 10px;
  padding: 0 12px;
  background: var(--scale-panel);
  color: var(--scale-text);
  box-shadow: var(--scale-shadow-tile);
  font-size: var(--scale-type-subheadline-size);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-pin-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-pin-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid var(--scale-border-strong);
  background: transparent;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-pin-dots span.is-filled {
  border-color: var(--scale-primary);
  background: var(--scale-primary);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-permission-error {
  color: var(--scale-danger);
  font-size: var(--scale-type-footnote-size);
  font-weight: 700;
  text-align: center;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-mini-pad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-mini-pad button {
  height: var(--scale-keypad-key-height);
  border: 0;
  border-radius: var(--scale-keypad-radius);
  background: var(--scale-panel);
  color: var(--scale-text);
  box-shadow: var(--scale-shadow-tile);
  font-size: var(--scale-type-subheadline-size);
  font-weight: 700;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-mini-pad i {
  font-size: var(--scale-fs-16);
}

body:has(.scale-modern-pos) #voidDialog .scale-void-spacer {
  flex: 1 1 auto;
  min-height: 8px;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-primary {
  min-height: 44px;
  border: 0;
  border-radius: var(--scale-radius-action-btn);
  background: var(--scale-danger);
  color: var(--scale-text-on-primary);
  font-size: var(--scale-type-subheadline-size);
  font-weight: 800;
}

body:has(.scale-modern-pos) #voidDialog .scale-void-primary:disabled {
  background: var(--scale-chip-bg);
  color: var(--scale-text-soft);
  cursor: default;
}

body:has(.scale-modern-pos) #voidDialog .mud-table,
body:has(.scale-modern-pos) #voidDialog .mud-table-container,
body:has(.scale-modern-pos) #voidDialog .mud-table-root {
  border-radius: var(--scale-radius-card);
  background: var(--scale-panel) !important;
  color: var(--scale-text) !important;
  box-shadow: var(--scale-shadow-tile);
}

body:has(.scale-modern-pos) #voidDialog .mud-table-cell {
  border-color: var(--scale-separator) !important;
  color: var(--scale-text) !important;
  font-family: var(--scale-font-sans) !important;
}

body:has(.scale-modern-pos) #voidDialog .standardTableHeader {
  color: var(--scale-text-mute) !important;
  font-size: var(--scale-type-caption-1-size) !important;
  font-weight: 800 !important;
  letter-spacing: var(--scale-tracking-caps);
  text-transform: uppercase;
}

body:has(.scale-modern-pos) #voidDialog .mud-input-control {
  color: var(--scale-text) !important;
  font-family: var(--scale-font-sans) !important;
}

body:has(.scale-modern-pos) #voidDialog .modal-footer {
  padding: 10px 0 0 !important;
  border: 0 !important;
}

body:has(.scale-modern-pos) #voidDialog .btn {
  min-height: 40px;
  border: 0 !important;
  border-radius: var(--scale-radius-action-btn) !important;
  font-family: var(--scale-font-sans) !important;
  font-weight: 800 !important;
  box-shadow: none !important;
}

body:has(.scale-modern-pos) #voidDialog .btn-success {
  background: var(--scale-primary) !important;
  color: var(--scale-text-on-primary) !important;
}

/* Modern POS typography should stay close to the V2 reference: readable, but not heavy/bold. */
.scale-modern-pos :where(
  .scale-modern-pos-nav button,
  .scale-modern-pos-location,
  .scale-modern-pos-profile,
  .scale-modern-pos-order-meta strong,
  .scale-modern-pos-order-meta em,
  .scale-modern-pos-type,
  .scale-modern-pos-search,
  .scale-modern-pos-view,
  .scale-modern-pos-chip,
  .scale-modern-pos-product__badge,
  .scale-modern-pos-product__name,
  .scale-modern-pos-product__price,
  .scale-modern-pos-product__price strong,
  .scale-modern-pos-cart-item__main strong,
  .scale-modern-pos-cart-item__main em,
  .scale-modern-pos-cart-item__qty,
  .scale-modern-pos-cart-item__price,
  .scale-modern-pos-summary strong,
  .scale-modern-pos-footer-button,
  .scale-modern-pos-pay,
  .scale-modern-more-row-copy strong,
  .scale-modern-drawer__title,
  .scale-modern-drawer__section-title,
  .scale-modern-drawer__action,
  .scale-modern-drawer__switch button
) {
  font-weight: 400 !important;
}

.scale-modern-pos :where(
  .scale-modern-pos-nav button.is-active,
  .scale-modern-pos-profile span,
  .scale-modern-pos-avatar,
  .scale-modern-pos-category.is-active span,
  .scale-modern-pos-subcategory.is-active span,
  .scale-modern-pos-summary-total,
  .scale-modern-pos-summary-total strong,
  .scale-modern-pos-pay,
  .scale-modern-drawer__section-title
) {
  font-weight: 500 !important;
}

body:has(.scale-modern-pos) #voidDialog :where(
  .scale-void-title,
  .scale-void-title-action,
  .scale-void-kicker-row span,
  .scale-void-line-heading span,
  .scale-void-line-heading em,
  .scale-void-inventory,
  .scale-void-stepper strong,
  .scale-void-stepper span,
  .scale-void-line-total,
  .scale-void-total-card span,
  .scale-void-total-card strong,
  .scale-void-stock-card,
  .scale-void-panel-title,
  .scale-void-reason-grid button,
  .scale-void-permission-heading span,
  .scale-void-permission-error,
  .scale-void-mini-pad button,
  .scale-void-primary,
  .standardTableHeader,
  .btn
) {
  font-weight: 400 !important;
}

body:has(.scale-modern-pos) #voidDialog :where(
  .scale-void-title,
  .scale-void-primary,
  .scale-void-total-card strong.is-danger,
  .scale-void-reason-grid button.is-active,
  .scale-void-permission-heading span
) {
  font-weight: 500 !important;
}

