/* Late PADLARB parity layer for native panels, Admin Extra, and content CRUD.
   Inherit the shell palette, color scheme and font; keep storefront and catalog editors out. */
body.fx-shell-active .fx-shell[data-admin-reference] :is(.fx-panel, .fx-extra, .nac) {
  --admin-form-pad: 16px;
  --admin-form-radius: 10px;
  --admin-form-tint: color-mix(in srgb, var(--admin-primary) 10%, var(--admin-surface));
  min-width: 0;
  font-family: inherit;
}

/* Workspace cards and their real titles. */
body.fx-shell-active .fx-shell[data-admin-reference] :is(.fx-panel, .fx-extra__card, .nac .nac-card) {
  padding: var(--admin-form-pad);
  border: 1px solid var(--admin-line);
  border-radius: var(--admin-radius);
  background: var(--admin-surface);
  box-shadow: none;
}
body.fx-shell-active .fx-shell[data-admin-reference] .fx-panel { margin-bottom: 12px; }
body.fx-shell-active .fx-shell[data-admin-reference] :is(.fx-panel .fx-admin__section-head, .fx-extra__cardhead) {
  align-items: center;
  gap: 6px 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--admin-line);
}
body.fx-shell-active .fx-shell[data-admin-reference] :is(.fx-panel .fx-admin__section-head, .fx-extra__cardhead) :is(h2, h3) {
  margin: 0;
  color: var(--admin-ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
}
body.fx-shell-active .fx-shell[data-admin-reference] .fx-panel .fx-admin__hint { margin-top: 3px; color: var(--admin-muted); }
/* Settings already has a page title. Keep the explanatory copy as a compact intro. */
body.fx-shell-active .fx-shell[data-admin-reference][data-shell-active^="settings-"] #panel-settings-head {
  margin-bottom: 8px;
  padding: 0;
  border: 0;
  background: transparent;
}
body.fx-shell-active .fx-shell[data-admin-reference][data-shell-active^="settings-"] #panel-settings-head .fx-admin__section-head {
  margin: 0;
  padding: 0;
  border: 0;
}
body.fx-shell-active .fx-shell[data-admin-reference][data-shell-active^="settings-"] #panel-settings-head h2 {
  font-size: 13px;
  font-weight: 500;
}
body.fx-shell-active .fx-shell[data-admin-reference] .fx-panel :is(.fx-panel-card, .fx-panel-sub, .fx-brand-preview, .fx-admin__state) {
  border-color: var(--admin-line);
  border-radius: var(--admin-form-radius);
  background: var(--admin-surface-muted);
}
body.fx-shell-active .fx-shell[data-admin-reference] .fx-panel .fx-admin__form-grid { gap: 10px 14px; }
body.fx-shell-active .fx-shell[data-admin-reference] .fx-panel .fx-admin__checks label { min-height: 44px; }
body.fx-shell-active .fx-shell[data-admin-reference] .fx-panel .fx-picker__upload:focus-within {
  outline: 2px solid var(--admin-focus);
  outline-offset: 2px;
}

/* The existing controls share size, palette and keyboard focus, not DOM or behavior. */
body.fx-shell-active .fx-shell[data-admin-reference] :is(.fx-panel .fx-admin__field, .fx-extra .fx-extra__input, .fx-extra .fx-extra__textarea, .nac :is(input, select, textarea):not([type="checkbox"], [type="radio"])) {
  min-width: 0;
  max-width: 100%;
  padding-inline: 11px;
  border-color: var(--admin-line-strong);
  border-radius: var(--admin-form-radius);
  background: var(--admin-bg);
  color: var(--admin-ink);
  font-family: inherit;
  font-size: 14px;
}
body.fx-shell-active .fx-shell[data-admin-reference] :is(.fx-panel, .fx-extra, .nac) :is(input, select, textarea):focus:not([type="checkbox"], [type="radio"]) { border-color: var(--admin-focus); }
body.fx-shell-active .fx-shell[data-admin-reference] :is(.fx-panel, .fx-extra, .nac) :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--admin-focus);
  outline-offset: 2px;
}
body.fx-shell-active .fx-shell[data-admin-reference] :is(.fx-panel, .fx-extra, .nac) :is(input, textarea)::placeholder {
  color: var(--admin-muted);
  opacity: 1;
}
body.fx-shell-active .fx-shell[data-admin-reference] :is(.fx-panel .fx-admin__button, .fx-panel .fx-admin__chip, .fx-extra .fx-extra__btn, .fx-extra .fx-extra__chip, .nac button) {
  min-height: 44px;
  max-width: 100%;
  padding: 7px 12px;
  border-color: var(--admin-line);
  border-radius: var(--admin-form-radius);
  background: var(--admin-surface-muted);
  color: var(--admin-ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: anywhere;
  white-space: normal;
}
body.fx-shell-active .fx-shell[data-admin-reference] :is(.fx-panel .fx-admin__link, .fx-extra__audit-row summary) { min-height: 44px; }
/* app.css assigns anchor colors through #app. */
body.fx-shell-active #app .fx-shell[data-admin-reference] :is(.fx-panel, .fx-extra) a:is(.fx-admin__button, .fx-extra__btn) { color: var(--admin-ink); }
body.fx-shell-active .fx-shell[data-admin-reference] :is(.fx-extra .fx-extra__btn--danger, .nac button.nac-danger) { color: var(--admin-bad); }
@media (hover: hover) {
  body.fx-shell-active .fx-shell[data-admin-reference] :is(.fx-panel .fx-admin__button, .fx-panel .fx-admin__chip, .fx-extra .fx-extra__btn, .fx-extra .fx-extra__chip, .nac button):not(:disabled):hover {
    border-color: var(--admin-line-strong);
    background: color-mix(in srgb, var(--admin-ink) 6%, var(--admin-surface-muted));
  }
}
body.fx-shell-active .fx-shell[data-admin-reference] :is(.fx-panel .fx-admin__primary, .fx-panel .fx-admin__chip[aria-pressed="true"], .fx-extra .fx-extra__btn--primary, .fx-extra .fx-extra__chip[aria-pressed="true"], .nac button.nac-primary):not(:disabled) {
  border-color: var(--admin-primary);
  background: var(--admin-primary);
  color: var(--admin-on-primary);
}
body.fx-shell-active #app .fx-shell[data-admin-reference] :is(.fx-panel, .fx-extra) a:is(.fx-admin__primary, .fx-extra__btn--primary) { color: var(--admin-on-primary); }
@media (hover: hover) {
  body.fx-shell-active .fx-shell[data-admin-reference] :is(.fx-panel .fx-admin__primary, .fx-panel .fx-admin__chip[aria-pressed="true"], .fx-extra .fx-extra__btn--primary, .fx-extra .fx-extra__chip[aria-pressed="true"], .nac button.nac-primary):not(:disabled):hover {
    border-color: var(--admin-primary);
    background: color-mix(in srgb, var(--admin-primary) 92%, white);
    color: var(--admin-on-primary);
  }
}

/* Filters and grouped actions wrap without changing keyboard order. */
body.fx-shell-active .fx-shell[data-admin-reference] :is(.fx-panel .fx-panel-filter, .fx-panel .fx-admin__stock-toolbar, .fx-extra [data-fx-audit-filter]) {
  padding: 10px;
  border: 1px solid var(--admin-line);
  border-radius: var(--admin-form-radius);
  background: var(--admin-surface-muted);
}
body.fx-shell-active .fx-shell[data-admin-reference] .fx-panel .fx-admin__stock-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
}
body.fx-shell-active .fx-shell[data-admin-reference] .fx-panel .fx-admin__stock-toolbar > form {
  flex: 1 1 17rem;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  margin: 0;
}
body.fx-shell-active .fx-shell[data-admin-reference] :is(.fx-panel .fx-admin__chip, .fx-extra .fx-extra__chip) { background-color: var(--admin-surface); }
body.fx-shell-active .fx-shell[data-admin-reference] :is(.fx-panel .fx-admin__summary-cards, .fx-extra__totals) { gap: 8px; }
body.fx-shell-active .fx-shell[data-admin-reference] :is(.fx-panel .fx-admin__summary-cards > div, .fx-extra__total) {
  padding: 10px 12px;
  border-color: var(--admin-line);
  border-radius: var(--admin-form-radius);
  background: var(--admin-surface-muted);
}
body.fx-shell-active .fx-shell[data-admin-reference] :is(.fx-panel .fx-admin__summary-cards strong, .fx-extra__totalvalue) {
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* Continuous, lined result surfaces instead of detached blocks for every desktop row. */
body.fx-shell-active .fx-shell[data-admin-reference] :is(.fx-panel :is(.fx-admin__table, .fx-order-list, .fx-slip-list), .fx-extra :is(.fx-extra__tablewrap, .fx-extra__audit-list)) {
  margin-block: 4px 0;
  border: 1px solid var(--admin-line);
  border-radius: var(--admin-form-radius);
  background: var(--admin-surface);
}
body.fx-shell-active .fx-shell[data-admin-reference] .fx-panel :is(.fx-admin__table-head, .fx-users-row) {
  grid-template-columns: minmax(0, 2fr) minmax(5rem, 1fr) minmax(6rem, 1fr) minmax(6rem, auto);
  gap: 8px 12px;
  padding: 8px 12px;
  overflow-wrap: anywhere;
}
body.fx-shell-active .fx-shell[data-admin-reference] .fx-panel .fx-admin__table-head { border-radius: 9px 9px 0 0; }
body.fx-shell-active .fx-shell[data-admin-reference] :is(.fx-panel .fx-admin__table-head, .fx-extra .fx-extra__table thead th) {
  background: var(--admin-surface-muted);
  color: var(--admin-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}
body.fx-shell-active .fx-shell[data-admin-reference] :is(.fx-panel .fx-users-row, .fx-extra .fx-extra__table) { font-size: 13px; }
body.fx-shell-active .fx-shell[data-admin-reference] .fx-extra .fx-extra__table:not(.fx-extra__matrix) :is(th, td) { padding: 8px 12px; }
body.fx-shell-active .fx-shell[data-admin-reference] .fx-panel :is(.fx-order-list, .fx-slip-list) { gap: 0; }
body.fx-shell-active .fx-shell[data-admin-reference] :is(.fx-panel :is(.fx-order-row, .fx-slip-row), .fx-extra .fx-extra__audit-row) {
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--admin-line);
  border-radius: 0;
  overflow-wrap: anywhere;
}
body.fx-shell-active .fx-shell[data-admin-reference] :is(.fx-panel :is(.fx-users-row, .fx-order-row, .fx-slip-row), .fx-extra .fx-extra__audit-row):last-child { border-bottom: 0; }
body.fx-shell-active .fx-shell[data-admin-reference] .fx-panel .fx-users-row.is-selected {
  background: var(--admin-form-tint);
  box-shadow: inset 3px 0 var(--admin-primary);
}
body.fx-shell-active .fx-shell[data-admin-reference] .fx-panel .fx-slip-row[data-status="review"] {
  box-shadow: inset 3px 0 var(--admin-warn);
}
body.fx-shell-active .fx-shell[data-admin-reference] .fx-panel .fx-order-row__keys { min-width: 0; }
body.fx-shell-active .fx-shell[data-admin-reference] .fx-panel .fx-copy { flex-wrap: wrap; min-width: 0; }
body.fx-shell-active .fx-shell[data-admin-reference] .fx-panel .fx-order-row__money { text-align: end; font-variant-numeric: tabular-nums; }
body.fx-shell-active .fx-shell[data-admin-reference] .fx-extra .fx-extra__audit-row time { text-align: end; }
body.fx-shell-active .fx-shell[data-admin-reference] .fx-extra :is(.fx-extra__statuscard, .fx-extra__notice, .fx-extra__state, .fx-extra__pill) {
  border-radius: var(--admin-form-radius);
}
body.fx-shell-active .fx-shell[data-admin-reference] :is(.fx-panel .fx-admin__badge, .fx-extra .fx-extra__badge) {
  --admin-form-status: var(--admin-muted);
  max-width: 100%;
  padding: 2px 7px;
  border: 1px solid color-mix(in srgb, var(--admin-form-status) 22%, var(--admin-line));
  border-radius: 6px;
  background: color-mix(in srgb, var(--admin-form-status) 10%, var(--admin-surface));
  color: var(--admin-form-status);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.55;
  white-space: normal;
  overflow-wrap: anywhere;
}
body.fx-shell-active .fx-shell[data-admin-reference] :is(.fx-panel .fx-admin__badge[data-tone="ok"], .fx-extra .fx-extra__badge[data-fx-tone="ok"]) { --admin-form-status: var(--admin-good); }
body.fx-shell-active .fx-shell[data-admin-reference] :is(.fx-panel .fx-admin__badge[data-tone="warn"], .fx-extra .fx-extra__badge[data-fx-tone="warn"]) { --admin-form-status: var(--admin-warn); }
body.fx-shell-active .fx-shell[data-admin-reference] :is(.fx-panel .fx-admin__badge[data-tone="bad"], .fx-extra .fx-extra__badge[data-fx-tone="bad"]) { --admin-form-status: var(--admin-bad); }
body.fx-shell-active .fx-shell[data-admin-reference] .fx-extra .fx-extra__badge[data-fx-tone="info"] { --admin-form-status: var(--admin-focus); }

/* Content modules already have a shell H1. Make the editor heading a toolbar title. */
body.fx-shell-active .fx-shell[data-admin-reference] .nac {
  --nac-bg: var(--admin-bg);
  --nac-panel: var(--admin-surface);
  --nac-field: var(--admin-bg);
  --nac-text: var(--admin-ink);
  --nac-muted: var(--admin-muted);
  --nac-line: var(--admin-line);
  --nac-red: var(--admin-focus);
  --nac-soft: var(--admin-form-tint);
  padding: 0;
  background: transparent;
  color: var(--admin-ink);
  font: inherit;
}
body.fx-shell-active .fx-shell[data-admin-reference] .nac .nac-header {
  flex-flow: row wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 10px;
  padding: 10px var(--admin-form-pad);
  border: 1px solid var(--admin-line);
  border-radius: var(--admin-radius);
  background: var(--admin-surface);
}
body.fx-shell-active .fx-shell[data-admin-reference] .nac .nac-header > div:first-child { flex: 1 1 15rem; }
body.fx-shell-active .fx-shell[data-admin-reference] .nac .nac-header small { color: var(--admin-muted); font-size: 10px; font-weight: 500; }
body.fx-shell-active .fx-shell[data-admin-reference] .nac .nac-title { margin: 1px 0 3px; font-size: 15px; font-weight: 600; }
body.fx-shell-active .fx-shell[data-admin-reference] .nac :is(.nac-header p, .nac-meta, small, label) { font-size: 12px; }
body.fx-shell-active .fx-shell[data-admin-reference] .nac .nac-meta { gap: 4px 12px; color: var(--admin-muted); }
body.fx-shell-active .fx-shell[data-admin-reference] .nac :is(.nac-body, .nac-card, .nac-grid) { gap: 12px; }
body.fx-shell-active .fx-shell[data-admin-reference] .nac .nac-body > :only-child { grid-column: 1 / -1; }
body.fx-shell-active .fx-shell[data-admin-reference] .nac .nac-rows { gap: 5px; }
body.fx-shell-active .fx-shell[data-admin-reference] .nac button.nac-row { text-align: start; }
body.fx-shell-active .fx-shell[data-admin-reference] .nac button.nac-row strong { font-size: 13px; font-weight: 600; }
body.fx-shell-active .fx-shell[data-admin-reference] .nac button.nac-row[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--admin-primary) 40%, var(--admin-line));
  background: var(--admin-form-tint);
  box-shadow: inset 3px 0 var(--admin-primary);
}
body.fx-shell-active .fx-shell[data-admin-reference] .nac textarea { min-height: 110px; }
body.fx-shell-active .fx-shell[data-admin-reference] .nac .nac-status { margin-bottom: 10px; padding: 8px 12px; font-size: 13px; }
body.fx-shell-active .fx-shell[data-admin-reference] .nac .nac-status[data-tone="success"] { border-inline-start-color: var(--admin-good); }
body.fx-shell-active .fx-shell[data-admin-reference] .nac .nac-status[data-tone="error"] { border-inline-start-color: var(--admin-bad); }

@media (max-width: 719px) {
  body.fx-shell-active .fx-shell[data-admin-reference] .fx-extra .fx-extra__tablewrap:not(.fx-extra__tablewrap--matrix) { border: 0; background: transparent; }
  body.fx-shell-active .fx-shell[data-admin-reference] .fx-extra .fx-extra__table:not(.fx-extra__matrix) :is(th, td) { padding: 4px 0; }
}
@media (max-width: 599px) {
  body.fx-shell-active .fx-shell[data-admin-reference] :is(.fx-panel, .fx-extra, .nac) { --admin-form-pad: 12px; }
  body.fx-shell-active .fx-shell[data-admin-reference] .fx-panel .fx-admin__table > :is(.fx-admin__table-head, .fx-admin__table-row) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-inline: 10px;
  }
  body.fx-shell-active .fx-shell[data-admin-reference] .fx-panel .fx-admin__table-head { display: none; }
  body.fx-shell-active .fx-shell[data-admin-reference] .fx-panel .fx-admin__table-row > div:nth-child(2) { display: grid; text-align: end; }
  body.fx-shell-active .fx-shell[data-admin-reference] .fx-panel .fx-admin__table-row > div:nth-child(4) { grid-column: auto; grid-row: auto; }
  body.fx-shell-active .fx-shell[data-admin-reference] .fx-panel .fx-admin__table-row .fx-admin__row-actions { justify-self: end; }
  body.fx-shell-active .fx-shell[data-admin-reference] .nac .nac-actions { width: 100%; }
  body.fx-shell-active .fx-shell[data-admin-reference] .nac :is(input:not([type="checkbox"], [type="radio"]), select, textarea) { font-size: 16px; }
}
