/* Per-set discount overrides */
.admin-dialog {
  width: min(1160px, calc(100% - 28px));
}

.hero__stats > div {
  min-width: 190px;
}

.field-help {
  display: block;
  margin-top: -2px;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.discounted-price-cell {
  display: grid;
  justify-items: start;
  gap: 4px;
  min-width: 112px;
}

.discount-note {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  background: #eef4ff;
  color: #2457b3;
  font-size: 0.67rem;
  font-weight: 800;
  white-space: nowrap;
}

.discount-note[hidden] {
  display: none;
}

.admin-inventory-table {
  min-width: 1040px;
}

.admin-inventory-table th:last-child,
.admin-inventory-table td:last-child {
  min-width: 275px;
}

.discount-override-control {
  display: grid;
  grid-template-columns: auto minmax(105px, 125px);
  align-items: center;
  gap: 8px 12px;
  border-radius: 12px;
  padding: 8px;
  transition: background 150ms ease, box-shadow 150ms ease;
}

.discount-override-active .discount-override-control {
  background: #f5f8ff;
  box-shadow: inset 0 0 0 1px #d7e5ff;
}

.switch--compact {
  gap: 8px;
}

.switch--compact .switch__track {
  width: 40px;
  height: 24px;
}

.switch--compact .switch__track::after {
  width: 18px;
  height: 18px;
}

.switch--compact input:checked + .switch__track::after {
  transform: translateX(16px);
}

.switch--compact .switch__label {
  min-width: 62px;
  font-size: 0.75rem;
}

.override-rate-field {
  display: block;
}

.discount-override-input {
  min-height: 38px;
  padding-left: 10px;
  padding-right: 32px;
  font-variant-numeric: tabular-nums;
}

.discount-override-input:disabled {
  border-color: #eaecf0;
  background: #f2f4f7;
  color: #98a2b3;
  cursor: not-allowed;
  box-shadow: none;
}

.discount-override-summary {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.discount-override-active .discount-override-summary {
  color: #2457b3;
  font-weight: 750;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Keep native checkbox focus inside the visible switch instead of at its
   unanchored static position deep in the scrolling table. */
.switch {
  position: relative;
}

.switch > input[type="checkbox"] {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  pointer-events: auto;
}

.switch > input[type="checkbox"]:disabled {
  cursor: not-allowed;
}

/* Explicit viewport geometry prevents native dialog focus scrolling from
   changing the apparent size or position of the admin panel. */
.admin-dialog[open] {
  position: fixed;
  inset: 14px;
  width: min(1160px, calc(100% - 28px));
  height: min(860px, calc(100dvh - 28px));
  max-width: none;
  max-height: none;
  margin: auto;
  overflow: hidden;
}

.admin-dialog,
.admin-dialog__shell,
.admin-panel,
.admin-editor-form {
  overscroll-behavior: none;
  scroll-behavior: auto;
}

@media (max-width: 700px) {
  .admin-inventory-table {
    display: table;
    min-width: 1040px;
  }

  .admin-inventory-table thead {
    display: table-header-group;
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
  }

  .admin-inventory-table tbody {
    display: table-row-group;
    padding: 0;
  }

  .admin-inventory-table tr {
    display: table-row;
    margin: 0;
    border: 0;
    border-radius: 0;
    padding: 0;
  }

  .admin-inventory-table th,
  .admin-inventory-table td {
    display: table-cell;
    border-bottom: 1px solid var(--line);
    padding: 12px 14px;
  }

  .admin-inventory-table td:first-child {
    grid-row: auto;
  }

  .admin-inventory-table td:not(:first-child)::before {
    display: none;
  }

  .admin-toolbar {
    align-items: stretch;
  }

  .admin-discount-field {
    width: 100%;
  }

  .admin-dialog[open] {
    inset: 6px;
    width: calc(100% - 12px);
    height: calc(100dvh - 12px);
  }
}
