/* NEXORA Admin Professional UI
   Visual-only layer. Loaded last and scoped to the admin shell so storefront
   screens, APIs and module behavior remain unchanged. */

html body.fx-shell-active {
  /* Capture the storefront palette above the shell and legacy local palettes. */
  --admin-bg: var(--fx-field);
  --admin-surface: var(--fx-panel);
  --admin-surface-muted: var(--fx-soft);
  --admin-ink: var(--fx-ink);
  --admin-muted: var(--fx-muted);
  --admin-line: var(--fx-line);
  --admin-line-strong: var(--fx-edge);
  --admin-primary: var(--fx-primary);
  --admin-on-primary: var(--fx-on-primary);
  --admin-gutter: 28px;
  --admin-radius: 9px;
  --admin-good: var(--fx-positive);
  --admin-bad: var(--fx-negative);
  /* enhancements.css has no warning token; use the storefront amber scale. */
  --admin-warn: var(--color-amber-900, var(--fx-primary));
  background: var(--admin-bg);
  color: var(--admin-ink);
  color-scheme: light;
}
html.dark body.fx-shell-active {
  --admin-warn: var(--color-amber-300, var(--fx-primary));
  color-scheme: dark;
}
body.fx-shell-active #app {
  background: var(--admin-bg);
  color: var(--admin-ink);
}
body.fx-shell-active .fx-shell,
body.fx-shell-active .fx-admin {
  --fx-ink: var(--admin-ink);
  --fx-muted: var(--admin-muted);
  --fx-panel: var(--admin-surface);
  --fx-soft: var(--admin-surface-muted);
  --fx-field: var(--admin-bg);
  --fx-line: var(--admin-line);
  --fx-accent: var(--admin-primary);
  accent-color: var(--admin-primary);
}
body.fx-shell-active .fx-shell {
  --fx-shell-rail: 248px;
  --fx-shell-radius: var(--admin-radius);
  --fx-shell-speed: 120ms;
  border: 0;
  font-size: 13px;
}

/* -------------------------------------------------------------- rail */
body.fx-shell-active .fx-shell__side {
  top: 0;
  height: 100dvh;
  padding: 18px 12px 16px;
  background: var(--admin-bg);
}
body.fx-shell-active .fx-shell__brand {
  min-height: 58px;
  padding: 0 8px 16px;
  border-bottom: 1px solid var(--admin-line);
}
body.fx-shell-active .fx-shell__mark {
  width: 30px;
  height: 30px;
  border-radius: 5px;
  background: var(--admin-primary);
  color: var(--admin-on-primary);
  font-size: 11px;
}
body.fx-shell-active .fx-shell__brand-name { font-size: 13px; letter-spacing: .14em; }
body.fx-shell-active .fx-shell__brand-sub { font-size: 9px; letter-spacing: .16em; }
body.fx-shell-active .fx-shell__search { margin-top: 2px; }
body.fx-shell-active .fx-shell__field {
  padding-inline: 11px;
  background: var(--admin-surface);
  font-size: 13px;
}
body.fx-shell-active .fx-shell__nav { gap: 3px; padding-top: 4px; }
body.fx-shell-active .fx-shell__group { margin: 2px 0; }
body.fx-shell-active .fx-shell__group-toggle {
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .12em;
}
body.fx-shell-active .fx-shell__items { gap: 1px; }
body.fx-shell-active .fx-shell__link {
  min-height: 44px;
  padding: 8px 10px 8px 14px;
  border-radius: 4px;
}
/* app.css sets a fixed foreground on #app a:not([style*="color"]). */
body.fx-shell-active #app :is(.fx-shell__link, .fx-shell__store-link) { color: var(--admin-ink); }
body.fx-shell-active .fx-shell__link:is([aria-current="page"], .is-active) {
  border-left-color: var(--admin-primary);
  background: var(--admin-surface-muted);
  font-weight: 600;
}
body.fx-shell-active .fx-shell__foot { font-size: 10px; }
body.fx-shell-active .fx-shell__error { border-left-color: var(--admin-bad); }

/* ------------------------------------------------------------ top bar */
body.fx-shell-active .fx-shell__top {
  top: 0;
  min-height: 58px;
  padding: 14px var(--admin-gutter);
  border-bottom: 1px solid var(--admin-line);
  background: var(--admin-surface);
}

body.fx-shell-active .fx-shell__crumb {
  color: var(--admin-muted);
  font-size: 11px;
}

body.fx-shell-active .fx-shell__crumb-sep { color: var(--admin-line-strong); }
body.fx-shell-active .fx-shell__crumb-text[aria-current="page"] { color: var(--admin-muted); }

body.fx-shell-active .fx-shell__title {
  margin-top: 3px;
  color: var(--admin-ink);
  font-size: 20px;
  font-weight: 650;
  letter-spacing: 0;
}

body.fx-shell-active .fx-shell__desc {
  color: var(--admin-muted);
  font-size: 12px;
}

body.fx-shell-active .fx-shell__action {
  min-width: 44px;
  min-height: 44px;
  font-size: 12px;
}

body.fx-shell-active #app a.fx-shell__store {
  padding-inline: 13px;
  border-color: transparent;
  background: var(--admin-primary);
  color: var(--admin-on-primary);
  font-weight: 650;
}
@media (hover: hover) {
  body.fx-shell-active #app a.fx-shell__store:hover { background: var(--admin-ink); }
}

body.fx-shell-active .fx-shell__body { min-width: 0; min-height: calc(100dvh - 72px); }
body.fx-shell-active .fx-shell .fx-shell-page {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 26px var(--admin-gutter) 48px;
}
body.fx-shell-active .fx-shell .fx-shell-page--module { padding-top: 24px; }

/* --------------------------------------------------------- base admin */
body.fx-shell-active .fx-admin {
  --fx-hover: var(--admin-surface-muted);
  --fx-control: var(--admin-line-strong);
  --fx-focus: var(--admin-primary);
  --fx-on: var(--admin-good);
  --fx-on-bg: var(--admin-surface-muted);
  --fx-off: var(--admin-muted);
  --fx-off-bg: var(--admin-surface-muted);
  --fx-error: var(--admin-bad);
  --fx-radius: var(--admin-radius);
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 22px var(--admin-gutter) 48px;
  color: var(--admin-ink);
  background: transparent;
}

/* main and plain anchors also have ID-specific storefront rules. */
body.fx-shell-active #app main.fx-admin,
body.fx-shell-active #app a.fx-admin__button { color: var(--admin-ink); }
body.fx-shell-active #app a.fx-admin__chip { color: var(--admin-muted); }
body.fx-shell-active .fx-admin h1 { font-size: 22px; font-weight: 650; }
body.fx-shell-active .fx-admin h2 { font-size: 16px; font-weight: 650; }
body.fx-shell-active .fx-admin .fx-admin__notice {
  border-color: var(--admin-line);
  border-radius: 5px;
  background: var(--admin-surface);
}
/* All six metrics share the available column, not the viewport (rail may be collapsed).
   One-pixel gutters replace the legacy nth-child spans and dividers. */
body.fx-shell-active [data-shell-active="overview"] .fx-admin { container: overview / inline-size; }
body.fx-shell-active [data-shell-active="overview"] .fx-admin__stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border-radius: 5px;
  background: var(--admin-line);
}
body.fx-shell-active [data-shell-active="overview"] .fx-admin .fx-admin__stats > div {
  grid-column: auto;
  padding: 12px;
  border: 0;
  background: var(--admin-surface);
}
body.fx-shell-active .fx-admin .fx-admin__stats dt { color: var(--admin-muted); font-size: 12px; }
body.fx-shell-active .fx-admin .fx-admin__stats dd { color: var(--admin-ink); font-size: 19px; overflow-wrap: anywhere; }
@container overview (min-width: 32rem) {
  body.fx-shell-active [data-shell-active="overview"] .fx-admin__stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@container overview (min-width: 60rem) {
  body.fx-shell-active [data-shell-active="overview"] .fx-admin__stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
body.fx-shell-active .fx-admin .fx-admin__button,
body.fx-shell-active .fx-admin .fx-admin__field:not(textarea) {
  min-height: 44px;
  border-radius: 5px;
  font-size: 13px;
}
body.fx-shell-active .fx-admin .fx-admin__button { min-width: 44px; }
body.fx-shell-active .fx-slip .fx-slip__chip:is(.is-active, [aria-pressed="true"]),
body.fx-shell-active .fx-admin .fx-admin__chip[aria-pressed="true"],
body.fx-shell-active .fx-admin .fx-admin__primary {
  border-color: var(--admin-primary);
  background: var(--admin-primary);
  color: var(--admin-on-primary);
}
@media (hover: hover) {
  body.fx-shell-active .fx-admin .fx-admin__primary:not(:disabled):hover {
    border-color: var(--admin-ink);
    background: var(--admin-ink);
  }
}
body.fx-shell-active .fx-admin .fx-admin__tab:is([aria-current="page"], [aria-selected="true"]) {
  border-bottom-color: var(--admin-primary);
  color: var(--admin-primary);
}
body.fx-shell-active .fx-admin .fx-panel-jump { background: var(--admin-bg); }
body.fx-shell-active .fx-admin .fx-panel-warn,
body.fx-shell-active .fx-admin .fx-admin__badge[data-tone="warn"],
body.fx-shell-active .fx-slip .fx-slip__badge[data-tone="warn"] {
  color: var(--admin-warn);
  background: var(--admin-surface-muted);
}
body.fx-shell-active .fx-admin .fx-panel-warn,
body.fx-shell-active .fx-admin .fx-slip-row[data-status="review"] { border-color: var(--admin-warn); }
body.fx-shell-active .fx-admin [data-sale-state="updating"] { color: var(--admin-warn); }
body.fx-shell-active .fx-admin [data-sale-state="out_of_stock"] { color: var(--admin-bad); }
body.fx-shell-active .fx-slip .fx-slip__badge[data-tone="ok"],
body.fx-shell-active .fx-slip .fx-slip__badge[data-tone="bad"] { background: var(--admin-surface-muted); }
body.fx-shell-active .fx-slip .fx-slip__badge[data-tone="ok"] { color: var(--admin-good); }
body.fx-shell-active .fx-slip .fx-slip__badge[data-tone="bad"] { color: var(--admin-bad); }

body.fx-shell-active .toast { background: var(--admin-surface); color: var(--admin-ink); border-color: var(--admin-line-strong); }
body.fx-shell-active .toast[data-kind="success"] { color: var(--admin-good); border-color: currentColor; }
body.fx-shell-active .toast[data-kind="error"] { color: var(--admin-bad); border-color: currentColor; }

/* ------------------------------------------------------- shared modules */
body.fx-shell-active .fx-extra {
  --fx-extra-panel: var(--admin-surface);
  --fx-extra-soft: var(--admin-surface-muted);
  --fx-extra-field: var(--admin-bg);
  --fx-extra-ink: var(--admin-ink);
  --fx-extra-muted: var(--admin-muted);
  --fx-extra-line: var(--admin-line);
  --fx-extra-accent: var(--admin-primary);
  --fx-extra-accent-ink: var(--admin-on-primary);
  --fx-extra-good: var(--admin-good);
  --fx-extra-bad: var(--admin-bad);
  --fx-extra-warn: var(--admin-warn);
}
body.fx-shell-active .fx-slip {
  --slip-panel: var(--admin-surface);
  --slip-soft: var(--admin-surface-muted);
  --slip-field: var(--admin-bg);
  --slip-ink: var(--admin-ink);
  --slip-muted: var(--admin-muted);
  --slip-line: var(--admin-line);
  --slip-accent: var(--admin-primary);
  --slip-control: var(--admin-line-strong);
  --slip-good: var(--admin-good);
  --slip-danger: var(--admin-bad);
  --slip-warn: var(--admin-warn);
}
body.fx-shell-active .fx-dev {
  --dev-panel: var(--admin-surface);
  --dev-soft: var(--admin-surface-muted);
  --dev-field: var(--admin-bg);
  --dev-ink: var(--admin-ink);
  --dev-muted: var(--admin-muted);
  --dev-line: var(--admin-line);
  --dev-accent: var(--admin-primary);
  --dev-accent-ink: var(--admin-on-primary);
  --dev-good: var(--admin-good);
  --dev-danger: var(--admin-bad);
  --dev-warn: var(--admin-warn);
}
body.fx-shell-active .fx-console {
  --console-panel: var(--admin-surface);
  --console-soft: var(--admin-surface-muted);
  --console-field: var(--admin-bg);
  --console-ink: var(--admin-ink);
  --console-muted: var(--admin-muted);
  --console-line: var(--admin-line);
  --console-accent: var(--admin-primary);
  --console-accent-ink: var(--admin-on-primary);
  --console-good: var(--admin-good);
  --console-danger: var(--admin-bad);
  --console-warn: var(--admin-warn);
}
body.fx-shell-active :is(.fx-extra, .fx-slip, .fx-dev, .fx-console) {
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--admin-ink);
  color-scheme: inherit;
}
body.fx-shell-active .fx-dev__secretbox { background: color-mix(in srgb, var(--dev-accent) 12%, var(--dev-field)); }
body.fx-shell-active .fx-dev__input::placeholder,
body.fx-shell-active .fx-console__input::placeholder,
body.fx-shell-active .fx-extra__input::placeholder { color: var(--admin-muted); opacity: 1; }

body.fx-shell-active .fx-extra__head,
body.fx-shell-active .fx-slip__intro,
body.fx-shell-active .fx-dev__intro,
body.fx-shell-active .fx-console__intro { display: none; }

body.fx-shell-active .fx-slip__head,
body.fx-shell-active .fx-dev__head,
body.fx-shell-active .fx-console__head {
  min-height: 38px;
  margin-bottom: 2px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--admin-line);
}

body.fx-shell-active .fx-slip__panel,
body.fx-shell-active .fx-dev__panel,
body.fx-shell-active .fx-console__panel { gap: 18px; }

body.fx-shell-active .fx-extra__card,
body.fx-shell-active .fx-slip__card,
body.fx-shell-active .fx-dev__card,
body.fx-shell-active .fx-console__card {
  border: 1px solid var(--admin-line);
  border-radius: 5px;
  background: var(--admin-surface);
  box-shadow: none;
}

body.fx-shell-active .fx-extra__cardhead,
body.fx-shell-active .fx-slip__cardhead,
body.fx-shell-active .fx-dev__cardhead,
body.fx-shell-active .fx-console__cardhead {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--admin-line);
}

body.fx-shell-active .fx-extra__title,
body.fx-shell-active .fx-slip__title,
body.fx-shell-active .fx-dev__title,
body.fx-shell-active .fx-console__title { color: var(--admin-ink); font-size: 16px; }

body.fx-shell-active .fx-extra__desc,
body.fx-shell-active .fx-slip__sub,
body.fx-shell-active .fx-dev__sub,
body.fx-shell-active .fx-console__sub { color: var(--admin-muted); }

body.fx-shell-active .fx-extra__input,
body.fx-shell-active .fx-slip__input,
body.fx-shell-active .fx-dev__input,
body.fx-shell-active .fx-console__input,
body.fx-shell-active .fx-extra__textarea {
  border-color: var(--admin-line-strong);
  border-radius: 5px;
  background: var(--admin-bg);
  color: var(--admin-ink);
}

body.fx-shell-active .fx-extra__input:focus,
body.fx-shell-active .fx-slip__input:focus,
body.fx-shell-active .fx-dev__input:focus,
body.fx-shell-active .fx-console__input:focus { border-color: var(--admin-primary); }

body.fx-shell-active .fx-extra__btn,
body.fx-shell-active .fx-slip__button,
body.fx-shell-active .fx-slip__primary,
body.fx-shell-active .fx-slip__ghost,
body.fx-shell-active .fx-dev__primary,
body.fx-shell-active .fx-dev__secondary,
body.fx-shell-active .fx-dev__ghost,
body.fx-shell-active .fx-console__primary,
body.fx-shell-active .fx-console__secondary,
body.fx-shell-active .fx-console__ghost {
  min-height: 44px;
  padding-inline: 13px;
  border-radius: 5px;
  font-size: 12px;
}
/* Slip API hard-codes this foreground; the other three consume *-accent-ink. */
body.fx-shell-active .fx-slip__primary { color: var(--admin-on-primary); }

body.fx-shell-active .fx-extra__hint,
body.fx-shell-active .fx-extra__label,
body.fx-shell-active .fx-slip__label,
body.fx-shell-active .fx-dev__label,
body.fx-shell-active .fx-console__label { color: var(--admin-muted); }

/* --------------------------------------------------------- data density */
body.fx-shell-active .fx-extra__nav { display: none; }
body.fx-shell-active .fx-extra__body { gap: 12px; }
body.fx-shell-active .fx-extra__card { padding: 18px; }
body.fx-shell-active .fx-extra__card + .fx-extra__card { margin-top: 0; }
body.fx-shell-active .fx-extra__chip,
body.fx-shell-active .fx-extra__pill {
  padding: 0 9px;
  border-radius: 4px;
  font-size: 12px;
}
body.fx-shell-active .fx-extra__pill { min-height: 32px; }
body.fx-shell-active .fx-extra__badge {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
}
body.fx-shell-active .fx-extra__tablewrap {
  border: 1px solid var(--admin-line);
  border-radius: 4px;
  background: var(--admin-surface);
}
body.fx-shell-active .fx-extra__table thead th {
  background: var(--admin-surface-muted);
  color: var(--admin-muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .02em;
  text-transform: none;
}
body.fx-shell-active .fx-extra__table td,
body.fx-shell-active .fx-extra__table th {
  border-color: var(--admin-line);
}
body.fx-shell-active .fx-extra__row:hover { background: var(--admin-surface-muted); }
body.fx-shell-active .fx-extra__statuscard {
  border-top-width: 3px;
  border-radius: 4px;
  background: var(--admin-surface);
  box-shadow: none;
}
body.fx-shell-active .fx-extra__statusgrid { gap: 10px; }
body.fx-shell-active .fx-extra__total {
  border: 1px solid var(--admin-line);
  border-radius: 4px;
  background: var(--admin-surface);
}
body.fx-shell-active .fx-extra__notice,
body.fx-shell-active .fx-extra__state {
  border-radius: 4px;
  background: var(--admin-surface-muted);
}
body.fx-shell-active .fx-extra__notice { border-left-width: 3px; }

/* Roles is an actual permission matrix, not a stack of mobile cards. */
body.fx-shell-active .fx-extra__table--matrix,
body.fx-shell-active .fx-extra__matrix {
  display: table;
  width: 100%;
  min-width: 760px;
  table-layout: fixed;
  border-collapse: collapse;
}
body.fx-shell-active .fx-extra__matrix thead { display: table-header-group; }
body.fx-shell-active .fx-extra__matrix tbody { display: table-row-group; }
body.fx-shell-active .fx-extra__matrix tr { display: table-row; }
body.fx-shell-active .fx-extra__matrix th,
body.fx-shell-active .fx-extra__matrix td { display: table-cell; }
body.fx-shell-active .fx-extra__matrix .fx-extra__row { margin: 0; padding: 0; }
body.fx-shell-active .fx-extra__matrix .fx-extra__cell::before { display: none; }
body.fx-shell-active .fx-extra__matrix .fx-extra__cell--center { text-align: center; }
body.fx-shell-active .fx-extra__matrixhead { text-align: left; }
body.fx-shell-active .fx-extra__matrix .fx-extra__checkbox { width: 18px; height: 18px; }

body.fx-shell-active .fx-extra__tablewrap--matrix {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}
body.fx-shell-active .fx-extra__matrix th:first-child,
body.fx-shell-active .fx-extra__matrix td:first-child { width: 240px; }
body.fx-shell-active .fx-extra__matrix th:not(:first-child),
body.fx-shell-active .fx-extra__matrix td:not(:first-child) { width: 260px; }
body.fx-shell-active .fx-extra__matrix thead th:not(:first-child),
body.fx-shell-active .fx-extra__matrix tfoot td:not(:first-child) { white-space: normal; }
body.fx-shell-active .fx-extra__matrix thead th:first-child,
body.fx-shell-active .fx-extra__matrix tbody th:first-child { position: sticky; left: 0; z-index: 2; }
body.fx-shell-active .fx-extra__matrix thead th:first-child { z-index: 3; }
body.fx-shell-active .fx-extra__matrix tbody th:first-child { background: var(--fx-extra-field); }
body.fx-shell-active .fx-extra__matrix .fx-extra__cell { padding: 7px 6px; }
body.fx-shell-active .fx-extra__matrix .fx-extra__cell:first-child { overflow-wrap: anywhere; }
body.fx-shell-active .fx-extra__matrix .fx-extra__hint { font-size: 10px; }
body.fx-shell-active .fx-extra__matrix .fx-extra__toggler { display: flex; min-height: 44px; align-items: center; justify-content: center; }
@media (max-width: 719px) {
  body.fx-shell-active .fx-extra__matrix { width: 760px; }
  body.fx-shell-active .fx-extra__matrixhead { text-align: center; font-size: 11px; line-height: 1.25; white-space: normal; }
  body.fx-shell-active .fx-extra__matrixhead .fx-extra__hint { display: block; }
  body.fx-shell-active .fx-extra__matrix .fx-extra__row { display: table-row; margin: 0; padding: 0; border: 0; }
  body.fx-shell-active .fx-extra__matrix .fx-extra__cell:first-child { text-align: left; }
  body.fx-shell-active .fx-extra__matrix .fx-extra__strong { font-size: 12px; line-height: 1.3; }
  body.fx-shell-active .fx-extra__matrix .fx-extra__hint { display: block; font-size: 10px; line-height: 1.2; }
}

@media (min-width: 900px) {
  body.fx-shell-active .fx-shell.is-collapsed .fx-shell__link { padding-inline: 8px; }
  body.fx-shell-active .fx-extra__body { grid-template-columns: minmax(0, 1fr); }
  body.fx-shell-active .fx-extra__tablewrap { overflow-x: auto; }
}

@media (max-width: 899.98px) {
  html body.fx-shell-active { --admin-gutter: 14px; }
  body.fx-shell-active .fx-shell__side {
    width: min(88vw, 300px);
    max-width: 300px;
  }
  body.fx-shell-active .fx-shell__top { padding: 11px var(--admin-gutter); }
  /* Keep the storefront label visible alongside the secondary icon buttons. */
  body.fx-shell-active .fx-shell__store .fx-shell__action-label { display: inline; }
  body.fx-shell-active .fx-admin,
  body.fx-shell-active .fx-shell .fx-shell-page,
  body.fx-shell-active .fx-shell .fx-shell-page--module {
    padding: 16px var(--admin-gutter) 36px;
  }
  body.fx-shell-active .fx-extra__card { padding: 14px; }
}

@media (max-width: 520px) {
  /* Burger and titles on row one, all actions in DOM order on row two. */
  body.fx-shell-active .fx-shell__top {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px 10px;
  }
  body.fx-shell-active .fx-shell__actions {
    grid-column: 1 / -1;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  body.fx-shell-active .fx-shell__store { margin-inline-end: auto; }
  body.fx-shell-active .fx-shell__title { font-size: 17px; }
  body.fx-shell-active .fx-shell__crumb { font-size: 10px; }
  body.fx-shell-active .fx-extra__card { padding: 12px; }
  body.fx-shell-active .fx-extra__tablewrap:not(.fx-extra__tablewrap--matrix) { margin-inline: -1px; }
}

@media (prefers-reduced-motion: reduce) {
  body.fx-shell-active *,
  body.fx-shell-active *::before,
  body.fx-shell-active *::after { transition: none !important; animation: none !important; }
}

body.fx-shell-active .fx-admin__color-choice { display: grid; gap: 5px; min-width: 0; }
body.fx-shell-active .fx-admin .fx-panel-filter > .fx-admin__feedback { grid-column: 1 / -1; }
body.fx-shell-active .fx-admin .fx-admin__stock-row > div,
body.fx-shell-active .fx-admin .fx-slip-row__head > *,
body.fx-shell-active .fx-admin .fx-media-card__form { min-width: 0; overflow-wrap: anywhere; }
body.fx-shell-active .fx-admin input[type="date"] { min-width: 0; max-width: 100%; }
@media (max-width: 520px) {
  body.fx-shell-active .fx-admin .fx-panel-filter { grid-template-columns: minmax(0, 1fr); }
  body.fx-shell-active .fx-admin .fx-order-row__money { justify-items: start; }
  body.fx-shell-active .fx-admin .fx-order-row { grid-template-columns: minmax(0, 1fr); }
}
/* Workspace navigation */
body.fx-shell-active .fx-workspace-nav {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 14px var(--admin-gutter) 0;
}

body.fx-shell-active .fx-workspace-nav__links {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 3px 3px 8px;
}

body.fx-shell-active #app .fx-workspace-nav__tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid var(--admin-line);
  border-radius: 9px;
  background: var(--admin-surface);
  color: var(--admin-ink);
}

body.fx-shell-active #app :is(.fx-workspace-nav__tab:hover, .fx-workspace-nav__tab[aria-current="page"]) {
  border-color: var(--admin-primary);
  color: var(--admin-primary);
}

body.fx-shell-active .fx-shell__foot .fx-shell__store-link {
  margin-bottom: 8px;
}

/* Dashboard tasks, product details and stock import use the shop palette. */
body.fx-shell-active .fx-dashboard-work {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
  margin-bottom: 18px;
}
body.fx-shell-active .fx-dashboard-group {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--admin-line);
  border-radius: var(--admin-radius);
  background: var(--admin-surface);
}
body.fx-shell-active .fx-dashboard-group h2 { margin: 0 0 8px; }
body.fx-shell-active #app .fx-dashboard-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px;
  color: var(--admin-ink);
  text-decoration: none;
}
body.fx-shell-active #app .fx-dashboard-link + .fx-dashboard-link { border-top: 1px solid var(--admin-line); }
body.fx-shell-active #app .fx-dashboard-link:hover { background: var(--admin-surface-muted); }
body.fx-shell-active .fx-dashboard-link strong { font-variant-numeric: tabular-nums; }
@container overview (min-width: 60rem) {
  body.fx-shell-active [data-shell-active="overview"] .fx-admin__stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
body.fx-shell-active .fx-admin .fx-admin__product-open {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 14px;
  width: 100%;
  padding: 13px;
  color: var(--admin-ink);
  text-align: start;
}
body.fx-shell-active .fx-admin__product-open > span:last-child { grid-area: 1 / 2 / span 2; }
body.fx-shell-active .fx-admin__product-open .fx-admin__product-meta {
  grid-column: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
body.fx-shell-active .fx-catalog-detail {
  display: grid;
  justify-items: stretch;
  gap: 14px;
}
body.fx-shell-active .fx-catalog-detail > button { justify-self: start; }
body.fx-shell-active .fx-catalog-detail__tabs { display: flex; flex-wrap: wrap; gap: 8px; }
body.fx-shell-active .fx-stock-package {
  margin-block: 6px;
  padding: 12px;
  border: 1px solid var(--admin-line);
  border-radius: var(--admin-radius);
  background: var(--admin-surface);
}
body.fx-shell-active .fx-stock-import {
  width: min(36rem, calc(100% - 28px));
  max-height: 90dvh;
  overflow: auto;
  margin: auto;
  padding: 18px;
  border: 1px solid var(--admin-line);
  border-radius: var(--admin-radius);
  background: var(--admin-surface);
  color: var(--admin-ink);
}
body.fx-shell-active .fx-stock-import::backdrop { background: rgb(0 0 0 / 55%); }
body.fx-shell-active .fx-stock-import__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
body.fx-shell-active .fx-stock-import form,
body.fx-shell-active .fx-stock-import label { display: grid; gap: 8px; }
body.fx-shell-active .fx-stock-import form { margin-top: 14px; }
body.fx-shell-active .fx-stock-import textarea { width: 100%; resize: vertical; font-size: 16px; }
body.fx-shell-active .fx-stock-import button[hidden] { display: none; }
@media (max-width: 640px) {
  body.fx-shell-active .fx-dashboard-work { grid-template-columns: minmax(0, 1fr); }
  body.fx-shell-active .fx-stock-import {
    inset: auto 0 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding-bottom: max(18px, env(safe-area-inset-bottom));
    border-radius: 16px 16px 0 0;
  }
}
