/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */
* {
  box-sizing: border-box;
}

:root {
  --brand-primary: #752f69;
  --brand-primary-dark: #5d2554;
  --brand-primary-soft: #f3e9f1;
  --brand-gray: #adafb2;
  --surface: #ffffff;
  --page-bg: #f7f7f8;
  --text: #1d1f22;
  --muted: #62666b;
  --border: #dcdee1;
  --border-soft: #eceef0;
  --table-header: #f2f2f4;
  --success-bg: #e8f5ed;
  --success-text: #1f6f3e;
  --warning-bg: #fff4d8;
  --warning-text: #8a5a00;
  --danger-bg: #fbe8e8;
  --danger-text: #9f1f1f;
  --info-bg: #e7f0fb;
  --info-text: #245b90;
}

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

a {
  color: var(--brand-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(117, 47, 105, 0.28);
  outline-offset: 2px;
}

.app-shell__header {
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 28px;
  min-height: 58px;
  padding: 0 28px;
}

.app-shell__brand {
  color: var(--brand-primary);
  font-size: 18px;
  font-weight: 800;
}

.app-shell__nav {
  align-items: center;
  display: flex;
  gap: 18px;
}

.app-shell__nav-link {
  color: var(--muted);
  font-weight: 700;
}

.app-shell__session {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-left: auto;
}

.app-shell__session span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.app-shell__admin-menu {
  position: relative;
}

.app-shell__admin-menu summary {
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.app-shell__admin-menu summary::-webkit-details-marker {
  display: none;
}

.app-shell__admin-menu summary::after {
  content: "v";
  display: inline-block;
  font-size: 12px;
  margin-left: 5px;
}

.app-shell__admin-menu[open] summary::after {
  transform: rotate(180deg);
}

.app-shell__admin-menu-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(29, 31, 34, 0.12);
  display: grid;
  min-width: 180px;
  padding: 6px;
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  z-index: 20;
}

.app-shell__admin-menu-panel a {
  border-radius: 5px;
  color: var(--text);
  font-weight: 700;
  padding: 8px 10px;
}

.app-shell__admin-menu-panel a:hover {
  background: var(--brand-primary-soft);
  text-decoration: none;
}

.app-shell__main {
  margin: 0 auto;
  max-width: 1920px;
  padding: 28px 40px;
  width: 100%;
}

.page-heading {
  align-items: flex-start;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-heading h1 {
  font-size: 30px;
  line-height: 1.15;
  margin: 4px 0 0;
}

.page-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.page-heading__meta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  min-width: 120px;
  padding: 12px 14px;
  text-align: right;
}

.page-heading__meta span,
.metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.page-heading__meta strong {
  font-size: 24px;
  line-height: 1;
}

.eyebrow {
  color: var(--brand-primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0;
  text-transform: uppercase;
}

.subtle,
.muted {
  color: var(--muted);
}

.subtle {
  margin: 8px 0 0;
}

.button {
  align-items: center;
  background: var(--brand-primary);
  border: 1px solid var(--brand-primary);
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 700;
  min-height: 38px;
  padding: 8px 14px;
}

.button:hover {
  text-decoration: none;
}

.button--secondary {
  background: var(--surface);
  color: var(--brand-primary);
}

.button--danger {
  background: var(--danger-text);
  border-color: var(--danger-text);
}

.button--small {
  border-radius: 5px;
  font-size: 12px;
  min-height: 30px;
  padding: 5px 9px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.link-button {
  background: transparent;
  border: 0;
  color: var(--brand-primary);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0;
}

.link-button:hover {
  text-decoration: underline;
}

.filter-bar {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.filter-bar__row {
  align-items: end;
  display: grid;
  gap: 14px;
}

.filter-bar__row--primary {
  grid-template-columns: minmax(220px, 320px) minmax(170px, 230px) minmax(140px, 180px) minmax(140px, 180px) minmax(260px, 1fr);
}

.filter-bar__row--secondary {
  grid-template-columns:
    minmax(95px, 130px)
    repeat(4, minmax(70px, 105px))
    repeat(2, minmax(115px, 145px))
    minmax(85px, 105px)
    minmax(170px, auto)
    minmax(240px, auto);
  justify-content: start;
}

.filter-bar__actions {
  align-items: center;
  display: flex;
  gap: 14px;
}

.filter-bar__actions .button {
  min-width: 120px;
}

.po-filter-bar__row {
  grid-template-columns: minmax(150px, 190px) minmax(220px, 320px) minmax(220px, 1fr) minmax(105px, 130px);
}

.po-combination-form {
  display: grid;
  gap: 14px;
}

.po-combination-toolbar {
  align-items: center;
  display: flex;
  gap: 20px;
  justify-content: space-between;
}

.po-combination-toolbar strong,
.po-combination-toolbar span {
  display: block;
}

.po-combination-toolbar span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.po-combination-toolbar > .button {
  width: auto;
}

.po-combination-date-choices {
  align-items: center;
  border: 0;
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 0;
}

.po-combination-date-choices legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 4px;
}

.po-combination-date-option {
  align-items: center;
  display: flex;
  font-weight: 700;
  gap: 6px;
}

.po-combination-date-option input,
.purchase-order-selection-column input {
  accent-color: var(--brand-primary);
  height: 16px;
  min-height: 16px;
  padding: 0;
  width: 16px;
}

.po-combination-date-option span {
  color: var(--text);
  font-size: 14px;
  margin: 0;
}

.purchase-order-selection-column {
  text-align: center;
  width: 46px;
}

.purchase-order-combination-audit {
  margin-bottom: 20px;
}

.case-pack-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.case-pack-note--warning {
  color: var(--warning-text, #8a5200);
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.field-note {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

input,
select,
textarea {
  background: var(--surface);
  border: 1px solid var(--brand-gray);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

.auth-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 80px auto 0;
  max-width: 420px;
  padding: 26px;
}

.auth-panel h1 {
  font-size: 30px;
  line-height: 1.15;
  margin: 4px 0 22px;
}

.auth-panel__note {
  color: var(--muted);
  line-height: 1.45;
  margin: -12px 0 20px;
}

.auth-form,
.record-form {
  display: grid;
  gap: 16px;
}

.auth-form__secondary-action {
  font-size: 13px;
  font-weight: 700;
}

.panel--form {
  max-width: 560px;
}

.checkbox-field {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  gap: 8px;
  min-height: 38px;
}

.multi-select-menu {
  position: relative;
}

.multi-select-menu summary {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--brand-gray);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  list-style: none;
  min-height: 38px;
  padding: 8px 10px;
  user-select: none;
}

.multi-select-menu summary::-webkit-details-marker {
  display: none;
}

.multi-select-menu summary::after {
  content: "v";
  color: var(--muted);
  font-size: 14px;
  margin-left: 8px;
}

.multi-select-menu[open] summary {
  border-color: var(--brand-primary);
}

.multi-select-menu__panel {
  background: var(--surface);
  border: 1px solid var(--brand-gray);
  border-radius: 6px;
  box-shadow: 0 12px 30px rgba(29, 31, 34, 0.14);
  left: 0;
  max-height: 260px;
  min-width: 170px;
  overflow-y: auto;
  padding: 6px;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 25;
}

.multi-select-menu__option {
  align-items: center;
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  font-size: 14px;
  font-weight: 600;
  gap: 8px;
  min-height: 32px;
  padding: 6px;
}

.multi-select-menu__option:hover {
  background: var(--brand-primary-soft);
}

.multi-select-menu__option input {
  accent-color: var(--brand-primary);
  height: 15px;
  min-height: 15px;
  width: 15px;
}

.vendor-picker {
  position: relative;
}

.vendor-picker__menu {
  background: var(--surface);
  border: 1px solid var(--brand-gray);
  border-radius: 6px;
  box-shadow: 0 12px 30px rgba(29, 31, 34, 0.14);
  left: 0;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
}

.vendor-picker__option {
  align-items: baseline;
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 2px;
  padding: 8px;
  text-align: left;
  width: 100%;
}

.vendor-picker__option[hidden] {
  display: none;
}

.vendor-picker__option:hover,
.vendor-picker__option:focus {
  background: var(--brand-primary-soft);
  outline: none;
}

.vendor-picker__option span {
  font-weight: 800;
}

.vendor-picker__option small {
  color: var(--muted);
}

.checkbox-field input {
  accent-color: var(--brand-primary);
  height: 16px;
  min-height: 16px;
  width: 16px;
}

.panel,
.empty-state {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
}

.panel h2,
.empty-state h2 {
  font-size: 18px;
  line-height: 1.2;
  margin: 0 0 12px;
}

.panel-heading-row {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.panel-heading-row h2 {
  margin-bottom: 0;
}

.empty-state {
  max-width: 760px;
}

.empty-state p {
  color: var(--muted);
  margin: 0;
}

.run-summary {
  align-items: center;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 20px;
}

.run-summary code {
  background: var(--brand-primary-soft);
  border-radius: 6px;
  color: var(--brand-primary-dark);
  font-weight: 800;
  padding: 8px 10px;
}

.po-selection-form {
  display: grid;
  gap: 10px;
}

.po-selection-toolbar {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 12px 14px;
}

.po-selection-toolbar strong {
  display: block;
  font-size: 14px;
}

.po-selection-toolbar span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 3px;
}

.sku-overview-grid {
  align-items: stretch;
  display: grid;
  gap: 14px;
  grid-template-areas:
    "context action"
    "feedback feedback"
    "product metrics";
  grid-template-columns: 1fr 1fr;
  margin-bottom: 20px;
}

.sku-overview-grid .sku-po-selection-form {
  display: grid;
  grid-area: action;
  margin: 0;
}

.sku-context-panel {
  align-items: center;
  background: #fcf8fb;
  border-color: #eaddeb;
  display: flex;
  grid-area: context;
  min-height: 86px;
  padding: 16px 18px;
}

.sku-product-panel {
  background: #fdfdfd;
  grid-area: product;
}

.sku-context-panel__grid {
  align-items: center;
  display: grid;
  gap: 18px 34px;
  grid-template-columns: minmax(120px, max-content) minmax(0, 1fr);
  margin: 0;
  width: 100%;
}

.sku-context-panel__grid div {
  min-width: 0;
}

.sku-context-panel__grid dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.sku-context-panel__grid dd {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
  margin: 5px 0 0;
}

.sku-context-panel__grid .assortment-summary__entry {
  gap: 8px;
}

.sku-context-panel__grid .assortment-summary__mapping {
  font-size: 20px;
}

.sku-context-panel__grid .assortment-summary__dates {
  color: var(--text);
  font-size: 15px;
  margin-top: 4px;
}

.sku-po-selection-toolbar {
  align-items: center;
  background: #fcf8fb;
  border-color: #eaddeb;
  height: 100%;
}

.sku-po-selection-toolbar__summary,
.sku-po-selection-toolbar__controls {
  align-items: center;
  display: flex;
  gap: 10px;
}

.sku-po-selection-toolbar__summary {
  min-width: 280px;
}

.sku-po-selection-toolbar__controls label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.sku-po-selection-toolbar__controls span {
  margin-top: 0;
  min-width: 56px;
}

.sku-draft-po-panel {
  margin-bottom: 20px;
}

.allocation-group {
  border-top: 1px solid var(--border);
  display: grid;
  gap: 12px;
  padding: 16px 0;
}

.allocation-group:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.allocation-group__header {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(260px, 1fr) repeat(4, minmax(95px, 130px));
}

.allocation-group__header span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 3px;
}

.allocation-warning {
  color: var(--danger-text);
}

.allocation-muted-qty {
  color: var(--muted);
  display: inline-block;
  font-weight: 800;
  min-width: 56px;
  text-align: right;
}

.allocation-add-store {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(240px, 360px) minmax(84px, 110px) max-content;
  justify-content: end;
}

.allocation-add-store .field {
  display: grid;
  gap: 5px;
}

.allocation-add-store label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.allocation-add-store select,
.allocation-add-store input {
  min-height: 40px;
}

.allocation-add-store__qty .quantity-input {
  width: 100%;
}

.allocation-row--warehouse {
  background: var(--brand-primary-soft);
}

.allocation-row--warehouse:hover {
  background: var(--brand-primary-soft);
}

.allocation-row--warehouse td:first-child {
  border-left: 4px solid var(--brand-primary);
}

.data-table--allocations th:nth-child(2),
.data-table--allocations th:nth-child(3),
.data-table--allocations th:nth-child(4),
.data-table--allocations th:nth-child(5),
.data-table--allocations th:nth-child(6),
.data-table--allocations td:nth-child(2),
.data-table--allocations td:nth-child(3),
.data-table--allocations td:nth-child(4),
.data-table--allocations td:nth-child(5),
.data-table--allocations td:nth-child(6) {
  text-align: right;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-x: auto;
}

.data-table {
  border-collapse: collapse;
  min-width: 1560px;
  width: 100%;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--border-soft);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: var(--table-header);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.data-table tbody tr:hover {
  background: #fbfbfc;
}

.data-table tbody tr.data-table__row--recent-past-due,
.data-table tbody tr.data-table__row--recent-past-due:hover {
  background: #fff8db;
}

.data-table tbody tr.data-table__row--stale-past-due,
.data-table tbody tr.data-table__row--stale-past-due:hover {
  background: #ffece0;
}

.data-table td strong {
  display: block;
  font-weight: 800;
}

.data-table td span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 4px;
}

.data-table code {
  color: var(--text);
  font-size: 12px;
}

.assortment-summary {
  display: grid;
  gap: 8px;
  min-width: 128px;
}

.assortment-summary__entry {
  display: grid;
  gap: 2px;
}

.data-table td .assortment-summary__mapping {
  font-size: 13px;
  line-height: 1.2;
}

.data-table td .assortment-summary__dates {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  margin-top: 0;
  white-space: nowrap;
}

.selection-column {
  text-align: center;
  width: 54px;
}

.line-select {
  accent-color: var(--brand-primary);
  height: 16px;
  min-height: 16px;
  width: 16px;
}

.quantity-input {
  max-width: 96px;
  min-height: 32px;
  padding: 6px 8px;
  width: 88px;
}

.quantity-input::-webkit-inner-spin-button,
.quantity-input::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}

.quantity-input[type="number"] {
  appearance: textfield;
}

.line-maintenance-form {
  align-items: center;
  display: flex;
  gap: 8px;
}

.sort-link {
  color: inherit;
}

.sort-link--active {
  color: var(--brand-primary);
}

.pill {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  min-height: 24px;
  padding: 3px 9px;
  white-space: nowrap;
}

.pill--neutral {
  background: var(--table-header);
  color: var(--muted);
}

.pill--success {
  background: var(--success-bg);
  color: var(--success-text);
}

.pill--warning {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.pill--danger {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.pill--info {
  background: var(--info-bg);
  color: var(--info-text);
}

.metric-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 20px;
}

.metric-grid--po-detail {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric-grid--sku-overview {
  grid-area: metrics;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  height: 100%;
  margin-bottom: 0;
}

.metric-grid--sku-overview .metric {
  align-content: center;
  background: #fcf8fb;
  border-color: #eaddeb;
  min-height: 0;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 16px;
}

.metric strong {
  font-size: 24px;
  line-height: 1;
}

.metric small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric-edit-form {
  align-items: center;
  display: flex;
  gap: 8px;
}

.metric-edit-form input[type="text"] {
  min-height: 34px;
  min-width: 120px;
  width: 150px;
}

.detail-grid,
.chart-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 20px;
}

.panel--full {
  grid-column: 1 / -1;
}

.sku-evidence-summary {
  background: #fbfcfd;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sku-evidence-summary__section {
  min-width: 0;
}

.sku-evidence-summary__section h2 {
  font-size: 20px;
  margin-top: 0;
}

.sku-evidence-summary .definition-grid {
  gap: 8px 12px;
  grid-template-columns: minmax(105px, 0.8fr) minmax(0, 1fr);
}

.sku-evidence-summary .definition-grid dt,
.sku-evidence-summary .definition-grid dd {
  font-size: 14px;
  line-height: 1.25;
}

.collapsible-panel {
  padding: 0;
}

.collapsible-panel__summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  list-style: none;
  padding: 18px;
}

.collapsible-panel__summary::-webkit-details-marker {
  display: none;
}

.collapsible-panel__summary h2 {
  margin: 0;
}

.collapsible-panel__summary span {
  color: var(--brand-primary);
  font-size: 13px;
  font-weight: 800;
}

.collapsible-panel__summary::after {
  color: var(--muted);
  content: "Show";
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.collapsible-panel[open] .collapsible-panel__summary {
  border-bottom: 1px solid var(--border-soft);
}

.collapsible-panel[open] .collapsible-panel__summary::after {
  content: "Hide";
}

.collapsible-panel > :not(summary) {
  margin-left: 18px;
  margin-right: 18px;
}

.collapsible-panel > :last-child {
  margin-bottom: 18px;
}

.sku-stock-heatmap__legend {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 800;
  gap: 8px 14px;
  justify-content: flex-end;
}

.sku-stock-heatmap__legend span {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.sku-stock-heatmap__legend-swatch {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  display: inline-block;
  height: 14px;
  width: 14px;
}

.panel-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin: -4px 0 14px;
}

.recommendation-feedback-panel {
  display: grid;
  gap: 1rem;
  grid-area: feedback;
}

.recommendation-feedback-panel__heading {
  align-items: start;
  display: flex;
  justify-content: space-between;
}

.recommendation-feedback-panel__heading h2,
.recommendation-feedback-panel__heading .panel-note {
  margin: 0;
}

.recommendation-feedback-form {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.recommendation-feedback-form > .button {
  width: auto;
}

.recommendation-feedback-choices {
  border: 0;
  display: flex;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}

.recommendation-feedback-choices legend {
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.recommendation-feedback-choice {
  cursor: pointer;
  position: relative;
}

.recommendation-feedback-choice input {
  opacity: 0;
  position: absolute;
}

.recommendation-feedback-choice span {
  background: var(--page-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  display: block;
  font-weight: 700;
  padding: 0.55rem 0.85rem;
}

.recommendation-feedback-choice input:checked + span {
  background: var(--brand-primary-soft);
  border-color: var(--brand-primary);
  color: var(--brand-primary-dark);
}

.recommendation-feedback-choice input:focus-visible + span {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.recommendation-feedback-reason {
  min-width: min(20rem, 100%);
}

.feedback-summary-filter {
  align-items: end;
  display: flex;
  gap: 10px;
}

.feedback-summary-filter .button {
  width: auto;
}

.feedback-reason-summary {
  margin-top: 20px;
}

.sku-stock-heatmap__required-dot {
  background: #d8f0df;
  border: 1px solid #8dcb9d;
  border-radius: 999px;
  display: inline-block;
  height: 12px;
  width: 12px;
}

.sku-stock-heatmap-wrap {
  padding-bottom: 4px;
}

.sku-stock-heatmap {
  display: grid;
  gap: 4px;
  grid-template-columns: minmax(118px, 150px) repeat(var(--heatmap-week-count), minmax(0, 1fr));
  min-width: 0;
}

.sku-stock-heatmap__corner,
.sku-stock-heatmap__week,
.sku-stock-heatmap__store,
.sku-stock-heatmap__cell {
  min-height: 24px;
}

.sku-stock-heatmap__week {
  align-items: end;
  color: var(--muted);
  display: flex;
  font-size: 10px;
  font-weight: 800;
  justify-content: center;
  overflow: visible;
  text-transform: uppercase;
}

.sku-stock-heatmap__week span {
  transform: rotate(-45deg);
  transform-origin: center;
  white-space: nowrap;
}

.sku-stock-heatmap__store {
  align-items: center;
  border-radius: 5px;
  color: var(--text);
  display: flex;
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  padding-right: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sku-stock-heatmap__store--required {
  background: #d8f0df;
  color: #13592c;
  padding-left: 8px;
}

.sku-stock-heatmap__store--warehouse {
  padding-left: 8px;
}

.sku-stock-heatmap__store--pdc-a {
  background: #d8f0df;
  color: #13592c;
}

.sku-stock-heatmap__store--pdc-b {
  background: #ffe8a6;
  color: #6f4a00;
}

.sku-stock-heatmap__store--pdc-c {
  background: #f6b7a7;
  color: #7d1f0f;
}

.sku-stock-heatmap__cell {
  align-items: center;
  border-radius: 4px;
  color: var(--text);
  display: flex;
  font-size: 11px;
  font-weight: 900;
  justify-content: center;
  line-height: 1;
  min-width: 0;
}

.sku-stock-heatmap__cell--warehouse-current {
  font-size: 12px;
  grid-column: span var(--heatmap-week-count);
  justify-content: flex-start;
  padding: 0 10px;
}

.sku-stock-heatmap__cell--healthy {
  background: #d8f0df;
  color: #13592c;
}

.sku-stock-heatmap__cell--partial {
  background: #ffe8a6;
  color: #6f4a00;
}

.sku-stock-heatmap__cell--low {
  background: #f6b7a7;
  color: #7d1f0f;
}

.sku-stock-heatmap__cell--zero {
  background: #8f1d1d;
  color: #ffffff;
}

.sku-stock-heatmap__cell--no-data {
  background: #eceef1;
  color: #6a6f76;
}

.definition-grid {
  display: grid;
  gap: 10px 18px;
  grid-template-columns: minmax(130px, 0.45fr) minmax(0, 1fr);
  margin: 0;
}

.definition-grid dt {
  color: var(--muted);
  font-weight: 800;
}

.definition-grid dd {
  margin: 0;
}

.table-wrap--embedded {
  border-color: var(--border-soft);
  border-radius: 6px;
  margin-top: 10px;
}

.data-table--compact {
  min-width: 620px;
}

.data-table--compact th,
.data-table--compact td {
  padding: 8px 10px;
}

.data-table--purchase-orders {
  border-collapse: separate;
  border-spacing: 0 10px;
  min-width: 1180px;
}

.table-wrap--purchase-orders {
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow-x: auto;
}

.data-table--purchase-orders th {
  background: transparent;
  border-bottom: 0;
  padding: 0 12px 5px;
}

.data-table--purchase-orders td {
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
  border-top: 1px solid var(--border-soft);
  padding: 15px 12px;
}

.data-table--purchase-orders tr td:first-child {
  border-left: 1px solid var(--border-soft);
  border-radius: 8px 0 0 8px;
}

.data-table--purchase-orders tr td:last-child {
  border-radius: 0 8px 8px 0;
  border-right: 1px solid var(--border-soft);
}

.purchase-order-row--grouped td {
  background: #fff;
  border-top-color: var(--border);
}

.purchase-order-row--child td {
  background: #fbfbfc;
  border-bottom-color: transparent;
  border-top-color: transparent;
  color: var(--muted);
  padding-bottom: 10px;
  padding-top: 10px;
}

.purchase-order-row--child td:first-child {
  border-left: 4px solid var(--brand-primary-soft);
  padding-left: 20px;
}

.table-toggle-button {
  background: transparent;
  border: 0;
  color: var(--brand-primary);
  cursor: pointer;
  display: block;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  margin: 5px 0 0;
  padding: 0;
  text-align: left;
}

.table-toggle-button:hover {
  text-decoration: underline;
}

.chart-panel {
  min-height: 0;
}

.chart-frame {
  height: 260px;
  max-height: 260px;
  min-height: 260px;
  position: relative;
}

.chart-frame--timeline {
  overflow: hidden;
}

.chart-frame__timeline-grid {
  display: grid;
  grid-template-columns: minmax(118px, 150px) minmax(0, 1fr);
  height: 100%;
  min-width: 0;
  width: 100%;
}

.chart-frame__axis-label {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  font-weight: 800;
  padding-right: 8px;
}

.chart-frame__canvas {
  min-height: 0;
  min-width: 0;
  position: relative;
}

.chart-frame canvas {
  display: block;
  height: 100% !important;
  width: 100% !important;
}

.flash {
  border-radius: 8px;
  font-weight: 700;
  margin-bottom: 18px;
  padding: 12px 14px;
}

.flash--notice {
  background: var(--success-bg);
  color: var(--success-text);
}

.flash--alert {
  background: var(--danger-bg);
  color: var(--danger-text);
}

@media (max-width: 860px) {
  .app-shell__header,
  .page-heading,
  .run-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .app-shell__main {
    padding: 22px 18px;
  }

  .app-shell__session {
    margin-left: 0;
  }

  .app-shell__admin-menu-panel {
    left: 0;
    right: auto;
  }

  .page-heading__meta {
    text-align: left;
  }

  .page-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-grid,
  .metric-grid--sku-overview,
  .detail-grid,
  .chart-grid,
  .sku-evidence-summary,
  .filter-bar__row--primary,
  .filter-bar__row--secondary,
  .po-filter-bar__row {
    grid-template-columns: 1fr;
  }

  .panel-heading-row {
    display: grid;
    justify-content: stretch;
  }

  .sku-stock-heatmap__legend {
    justify-content: flex-start;
  }

  .po-selection-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .po-combination-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .po-combination-date-choices {
    align-items: flex-start;
  }

  .sku-overview-grid {
    grid-template-areas:
      "context"
      "action"
      "feedback"
      "product"
      "metrics";
    grid-template-columns: 1fr;
  }

  .sku-context-panel__grid {
    grid-template-columns: 1fr;
  }

  .sku-po-selection-toolbar__controls {
    flex-wrap: wrap;
  }
}
