/* Shared, opt-in interaction layer for reusable workspaces. */
[data-workspace-layout="true"] {
  --workspace-lift-distance: -2px;
  --workspace-lift-shadow: 0 10px 24px rgba(63, 72, 95, .14);
  --workspace-lift-border: #cfc8ff;
  --workspace-focus-ring: rgba(99, 85, 232, .24);
}

[data-workspace-layout="true"] [data-workspace-interaction="lift"] {
  position: relative;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

[data-workspace-layout="true"] [data-workspace-interaction="lift"]:hover:not(:disabled) {
  z-index: 2;
  transform: translateY(var(--workspace-lift-distance));
  border-color: var(--workspace-lift-border);
  box-shadow: var(--workspace-lift-shadow);
}

[data-workspace-layout="true"] [data-workspace-interaction="lift"]:focus-visible {
  z-index: 3;
  outline: 3px solid var(--workspace-focus-ring);
  outline-offset: 2px;
}

[data-workspace-layout="true"] [data-workspace-interaction="lift"]:active:not(:disabled) {
  transform: translateY(-1px);
  transition-duration: 80ms;
}

[data-workspace-layout="true"] [data-workspace-interaction="lift"]:disabled {
  cursor: default;
}

[data-workspace-layout="true"] [data-workspace-interaction="row"] {
  transition: background-color 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

[data-workspace-layout="true"] [data-workspace-interaction="row"]:hover {
  position: relative;
  z-index: 1;
  border-color: var(--workspace-lift-border);
  background: rgba(99, 85, 232, .055);
  box-shadow: 0 6px 16px rgba(63, 72, 95, .08);
}

[data-workspace-layout="true"] .data-workspace-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
}

[data-workspace-layout="true"] .data-workspace-tabs button {
  position: relative;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

[data-workspace-layout="true"] .data-workspace-tabs button:focus-visible {
  outline: 3px solid var(--workspace-focus-ring);
  outline-offset: 2px;
}

[data-workspace-layout="true"] .data-workspace-tabs button[aria-selected="true"]::after {
  position: absolute;
  right: 10px;
  bottom: -2px;
  left: 10px;
  height: 2px;
  border-radius: 2px;
  background: #6355e8;
  content: '';
}

@media (prefers-reduced-motion: reduce) {
  [data-workspace-layout="true"] [data-workspace-interaction="lift"],
  [data-workspace-layout="true"] [data-workspace-interaction="row"] {
    transition: none;
  }

  [data-workspace-layout="true"] [data-workspace-interaction="lift"]:hover:not(:disabled),
  [data-workspace-layout="true"] [data-workspace-interaction="lift"]:active:not(:disabled) {
    transform: none;
  }

  [data-workspace-page="true"].store-concept-page .store-concept-metric[data-workspace-interaction="lift"]:hover:not(:disabled) {
    transform: none !important;
  }
}

/* Store deletion confirmation. The modal is mounted on body, so it is scoped
 * by the active page rather than by the workspace layout container. */
body[data-active-page="organization"] .store-delete-modal-backdrop {
  position: fixed;
  z-index: 1500;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(22, 30, 45, .46);
  backdrop-filter: blur(3px);
}

body[data-active-page="organization"] .store-delete-modal {
  width: min(460px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 32px));
  overflow: auto;
  border: 1px solid #e6eaf0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(24, 34, 51, .22), 0 3px 12px rgba(24, 34, 51, .1);
  color: #172238;
}

body[data-active-page="organization"] .store-delete-modal-head {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 32px;
  gap: 12px;
  align-items: start;
  padding: 24px 24px 18px;
}

body[data-active-page="organization"] .store-delete-modal-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  background: #fff0f1;
  color: #c64e5d;
}

body[data-active-page="organization"] .store-delete-modal-mark .store-ui-icon {
  width: 21px;
  height: 21px;
}

body[data-active-page="organization"] .store-delete-modal-head h2 {
  margin: 1px 0 6px;
  color: #172238;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
}

body[data-active-page="organization"] .store-delete-modal-head p {
  margin: 0;
  color: #7d889b;
  font-size: 13px;
  line-height: 1.65;
}

body[data-active-page="organization"] .store-delete-modal-close {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #9aa4b4;
  cursor: pointer;
}

body[data-active-page="organization"] .store-delete-modal-close:hover,
body[data-active-page="organization"] .store-delete-modal-close:focus-visible {
  background: #f4f6f9;
  color: #546177;
  outline: none;
}

body[data-active-page="organization"] .store-delete-modal-close .store-ui-icon {
  width: 18px;
  height: 18px;
}

body[data-active-page="organization"] .store-delete-modal-body {
  display: grid;
  gap: 14px;
  padding: 0 24px 20px;
}

body[data-active-page="organization"] .store-delete-modal-info {
  display: grid;
  gap: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid #e9edf2;
  border-radius: 11px;
  background: #fafbfc;
}

body[data-active-page="organization"] .store-delete-modal-detail {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) minmax(0, 1.7fr);
  gap: 14px;
  align-items: center;
  min-height: 42px;
  padding: 8px 13px;
}

body[data-active-page="organization"] .store-delete-modal-detail + .store-delete-modal-detail {
  border-top: 1px solid #edf0f4;
}

body[data-active-page="organization"] .store-delete-modal-detail dt {
  color: #8b95a5;
  font-size: 12px;
}

body[data-active-page="organization"] .store-delete-modal-detail dd {
  overflow: hidden;
  margin: 0;
  color: #2d394e;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-active-page="organization"] .store-delete-modal-warning,
body[data-active-page="organization"] .store-delete-modal-related {
  border-radius: 11px;
}

body[data-active-page="organization"] .store-delete-modal-warning {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 12px 13px;
  border: 1px solid #f4d9dc;
  background: #fff7f7;
  color: #9d4b56;
}

body[data-active-page="organization"] .store-delete-modal-warning .store-ui-icon {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin-top: 1px;
}

body[data-active-page="organization"] .store-delete-modal-warning p,
body[data-active-page="organization"] .store-delete-modal-related p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
}

body[data-active-page="organization"] .store-delete-modal-related {
  overflow: hidden;
  border: 1px solid #f1d5d9;
  background: #fff8f8;
}

body[data-active-page="organization"] .store-delete-modal-related ul {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

body[data-active-page="organization"] .store-delete-modal-related li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  padding: 7px 13px;
  border-bottom: 1px solid #f4e2e4;
  color: #9d4b56;
  font-size: 12px;
}

body[data-active-page="organization"] .store-delete-modal-related li > span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

body[data-active-page="organization"] .store-delete-modal-related li .store-ui-icon {
  width: 15px;
  height: 15px;
}

body[data-active-page="organization"] .store-delete-modal-related li strong {
  color: #713943;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

body[data-active-page="organization"] .store-delete-modal-related p {
  padding: 10px 13px 11px;
  color: #a46e76;
}

body[data-active-page="organization"] .store-delete-modal-error {
  min-height: 18px;
  margin: -4px 0 0;
  color: #bd3f4e;
  font-size: 12px;
  line-height: 1.5;
}

body[data-active-page="organization"] .store-delete-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid #edf0f4;
}

body[data-active-page="organization"] .store-delete-modal-foot button {
  min-width: 92px;
  min-height: 36px;
  padding: 0 15px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  transition: background-color .15s ease, border-color .15s ease, opacity .15s ease;
}

body[data-active-page="organization"] .store-delete-modal-cancel {
  border: 1px solid #dfe4eb;
  background: #fff;
  color: #66738a;
}

body[data-active-page="organization"] .store-delete-modal-cancel:hover,
body[data-active-page="organization"] .store-delete-modal-cancel:focus-visible {
  border-color: #c4ccd8;
  background: #f7f9fb;
  outline: none;
}

body[data-active-page="organization"] .store-delete-modal-confirm {
  border: 1px solid #c94f5d;
  background: #c94f5d;
  color: #fff;
}

body[data-active-page="organization"] .store-delete-modal-confirm:hover,
body[data-active-page="organization"] .store-delete-modal-confirm:focus-visible {
  border-color: #b94250;
  background: #b94250;
  outline: none;
}

body[data-active-page="organization"] .store-delete-modal-related-button {
  border: 1px solid #6156d8;
  background: #6156d8;
  color: #fff;
}

body[data-active-page="organization"] .store-delete-modal-related-button:hover,
body[data-active-page="organization"] .store-delete-modal-related-button:focus-visible {
  border-color: #5147c7;
  background: #5147c7;
  outline: none;
}

body[data-active-page="organization"] .store-delete-modal-foot button:disabled {
  cursor: wait;
  opacity: .56;
}

body[data-active-page="organization"] .store-delete-modal[data-state="submitting"] .store-delete-modal-head,
body[data-active-page="organization"] .store-delete-modal[data-state="submitting"] .store-delete-modal-body {
  opacity: .72;
}

body[data-theme="dark"][data-active-page="organization"] .store-delete-modal {
  border-color: #384354;
  background: #202938;
  color: #ecf1f8;
}

body[data-theme="dark"][data-active-page="organization"] .store-delete-modal-head h2,
body[data-theme="dark"][data-active-page="organization"] .store-delete-modal-detail dd {
  color: #ecf1f8;
}

body[data-theme="dark"][data-active-page="organization"] .store-delete-modal-head p,
body[data-theme="dark"][data-active-page="organization"] .store-delete-modal-detail dt {
  color: #aeb9c9;
}

body[data-theme="dark"][data-active-page="organization"] .store-delete-modal-info {
  border-color: #394556;
  background: #273243;
}

body[data-theme="dark"][data-active-page="organization"] .store-delete-modal-detail + .store-delete-modal-detail {
  border-top-color: #394556;
}

body[data-theme="dark"][data-active-page="organization"] .store-delete-modal-cancel {
  border-color: #4a5668;
  background: #273243;
  color: #c3cedc;
}

body[data-theme="dark"][data-active-page="organization"] .store-delete-modal-cancel:hover,
body[data-theme="dark"][data-active-page="organization"] .store-delete-modal-cancel:focus-visible {
  background: #303d50;
}

body[data-theme="dark"][data-active-page="organization"] .store-delete-modal-foot,
body[data-theme="dark"][data-active-page="organization"] .store-delete-modal-related li {
  border-top-color: #394556;
  border-bottom-color: #493b43;
}

@media (max-width: 560px) {
  body[data-active-page="organization"] .store-delete-modal-backdrop {
    padding: 12px;
  }

  body[data-active-page="organization"] .store-delete-modal-head {
    grid-template-columns: 34px minmax(0, 1fr) 30px;
    gap: 9px;
    padding: 18px 18px 14px;
  }

  body[data-active-page="organization"] .store-delete-modal-mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }

  body[data-active-page="organization"] .store-delete-modal-head h2 {
    font-size: 18px;
  }

  body[data-active-page="organization"] .store-delete-modal-body {
    padding: 0 18px 16px;
  }

  body[data-active-page="organization"] .store-delete-modal-foot {
    padding: 14px 18px 18px;
  }

  body[data-active-page="organization"] .store-delete-modal-foot button {
    flex: 1;
    min-width: 0;
  }
}

/* The store page already has feature-specific hover colors. This adapter only
 * adds the common lift motion while keeping those colors intact. */
[data-workspace-page="true"].store-concept-page .store-concept-metric[data-workspace-interaction="lift"]:hover:not(:disabled) {
  transform: translateY(var(--workspace-lift-distance)) !important;
  border-color: var(--workspace-lift-border) !important;
  box-shadow: var(--workspace-lift-shadow) !important;
}

/* Store Management uses the Formula History frame verbatim. These aliases
 * intentionally live in the reusable workspace layer so the real history
 * page keeps its existing selectors and event contract untouched. */
[data-workspace-page="true"].store-history-page {
  max-width: none;
  min-width: 0;
  overflow-x: hidden;
  padding: 30px 28px 56px;
  background: #fff;
}

[data-workspace-page="true"].store-history-page .history-workspace {
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 0 !important;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid #e1e5eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(31, 42, 64, .035);
}

[data-workspace-page="true"].store-history-page .history-store-org.history-org-panel {
  position: relative;
  top: auto;
  min-height: 0;
  box-sizing: border-box;
  border: 0;
  border-right: 1px solid #e8ebf0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

[data-workspace-page="true"].store-history-page .store-history-add {
  display: none;
}

[data-workspace-page="true"].store-history-page .history-main {
  gap: 0;
  background: transparent;
}

[data-workspace-page="true"].store-history-page .history-main > .history-filter-panel,
[data-workspace-page="true"].store-history-page .history-main > .history-panel {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

[data-workspace-page="true"].store-history-page .history-main > .history-filter-panel {
  padding: 22px 24px;
}

[data-workspace-page="true"].store-history-page .store-history-filter-grid {
  grid-template-columns: minmax(260px, 1.8fr) minmax(160px, 1fr) minmax(160px, 1fr);
  gap: 14px 12px;
}

[data-workspace-page="true"].store-history-page .store-history-filter-grid .history-keyword-filter {
  grid-column: auto;
}

[data-workspace-page="true"].store-history-page .store-history-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0 14px 14px;
  background: #fff;
}

[data-workspace-page="true"].store-history-page .store-history-summary .history-kpi {
  min-height: 126px;
  padding: 21px 22px;
  border: 1px solid #edf0f5;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(22, 34, 54, .035);
}

[data-workspace-page="true"].store-history-page .history-kpi-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

[data-workspace-page="true"].store-history-page .store-history-kpi-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid #dedbf9;
  border-radius: 8px;
  background: #f3f1ff;
  color: #6658df;
}

[data-workspace-page="true"].store-history-page .store-history-kpi-icon::before,
[data-workspace-page="true"].store-history-page .store-history-kpi-icon::after {
  display: none;
  content: none;
}

[data-workspace-page="true"].store-history-page .store-history-kpi-icon .store-ui-icon {
  width: 17px;
  height: 17px;
}

[data-workspace-page="true"].store-history-page .store-history-kpi-icon.device {
  border-color: #d2e1fa;
  background: #edf4ff;
  color: #4d79cc;
}

[data-workspace-page="true"].store-history-page .store-history-kpi-icon.formula {
  border-color: #dedbf9;
  background: #f3f1ff;
  color: #6658df;
}

[data-workspace-page="true"].store-history-page .store-history-kpi-icon.invite {
  border-color: #d2e8df;
  background: #edf8f3;
  color: #258a65;
}

[data-workspace-page="true"].store-history-page .store-history-kpi-icon.store {
  border-color: #ecdcbf;
  background: #fff7e9;
  color: #b27a2c;
}

[data-workspace-page="true"].store-history-page .store-history-summary .history-kpi strong {
  margin: 13px 0 0;
  color: #202b3d;
  font-size: 31px;
  font-weight: 700;
  line-height: 1.05;
}

[data-workspace-page="true"].store-history-page .store-history-summary .history-kpi strong em {
  margin-left: 5px;
  color: #818b9b;
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
}

[data-workspace-page="true"].store-history-page .history-panel-head {
  min-height: 62px;
  padding: 10px 20px;
}

[data-workspace-page="true"].store-history-page .store-history-tabs button[aria-selected="true"] {
  background: #eceaf8;
  color: #493dbd;
  font-weight: 600;
}

[data-workspace-page="true"].store-history-page .store-history-result {
  margin-left: auto;
  color: #778295;
  font-size: 11px;
  white-space: nowrap;
}

[data-workspace-page="true"].store-history-page .store-history-table-wrap {
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
}

[data-workspace-page="true"].store-history-page .store-history-table {
  min-width: 1120px;
}

[data-workspace-page="true"].store-history-page .store-history-table th:first-child,
[data-workspace-page="true"].store-history-page .store-history-table td:first-child {
  width: 44px;
  min-width: 44px;
  padding-inline: 10px;
}

[data-workspace-page="true"].store-history-page .store-history-table td {
  height: 68px;
}

[data-workspace-page="true"].store-history-page .store-history-organization-cell {
  display: flex;
  min-width: 190px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

[data-workspace-page="true"].store-history-page .store-history-organization-cell strong,
[data-workspace-page="true"].store-history-page .store-history-organization-cell small {
  display: block;
  overflow: hidden;
  max-width: 230px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-workspace-page="true"].store-history-page .store-history-organization-cell strong {
  color: #253044;
  font-size: 13px;
}

[data-workspace-page="true"].store-history-page .store-history-organization-cell small {
  margin-top: 5px;
  color: #7c8798;
  font-size: 11px;
}

[data-workspace-page="true"].store-history-page .history-row-expander,
[data-workspace-page="true"].store-history-page .history-row-view {
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #8a95a7;
  cursor: pointer;
}

[data-workspace-page="true"].store-history-page .history-row-expander {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

[data-workspace-page="true"].store-history-page .history-row-expander .store-ui-icon {
  width: 15px;
  height: 15px;
}

[data-workspace-page="true"].store-history-page .history-row-view {
  width: 30px;
  height: 30px;
  border: 1px solid #dfe3e9;
  border-radius: 7px;
  color: #6658df;
}

[data-workspace-page="true"].store-history-page .history-row-view .store-ui-icon {
  width: 16px;
  height: 16px;
}

[data-workspace-page="true"].store-history-page .history-pagination {
  min-height: 68px;
}

[data-workspace-page="true"].store-history-page .history-pagination > span:last-child {
  font-size: 12px;
  white-space: nowrap;
}

[data-workspace-page="true"].store-history-page .history-pagination nav b {
  display: grid;
  min-width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid #5b4ed1;
  border-radius: 7px;
  background: #5b4ed1;
  color: #fff;
  font-size: 12px;
}

[data-theme="dark"] [data-workspace-page="true"].store-history-page {
  background: #0f1621;
  color: #d7e0ed;
}

[data-theme="dark"] [data-workspace-page="true"].store-history-page .history-workspace {
  border-color: #2b374a;
  background: #111a28;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .24);
}

[data-theme="dark"] [data-workspace-page="true"].store-history-page .history-store-org.history-org-panel,
[data-theme="dark"] [data-workspace-page="true"].store-history-page .history-main > .history-filter-panel,
[data-theme="dark"] [data-workspace-page="true"].store-history-page .history-main > .history-panel,
[data-theme="dark"] [data-workspace-page="true"].store-history-page .store-history-summary {
  border-color: #2b374a;
  background: #111a28;
}

[data-theme="dark"] [data-workspace-page="true"].store-history-page .store-history-summary .history-kpi,
[data-theme="dark"] [data-workspace-page="true"].store-history-page .store-history-organization-cell,
[data-theme="dark"] [data-workspace-page="true"].store-history-page .history-pagination {
  background: #151f2e;
}

[data-theme="dark"] [data-workspace-page="true"].store-history-page .store-history-summary .history-kpi {
  border-color: #2b374a;
}

[data-theme="dark"] [data-workspace-page="true"].store-history-page .store-history-summary .history-kpi strong,
[data-theme="dark"] [data-workspace-page="true"].store-history-page .store-history-organization-cell strong {
  color: #e5edf8;
}

[data-theme="dark"] [data-workspace-page="true"].store-history-page .history-filter-grid label > span,
[data-theme="dark"] [data-workspace-page="true"].store-history-page .history-kpi-label,
[data-theme="dark"] [data-workspace-page="true"].store-history-page .store-history-result {
  color: #94a2b7;
}

[data-theme="dark"] [data-workspace-page="true"].store-history-page .history-filter-grid select,
[data-theme="dark"] [data-workspace-page="true"].store-history-page .history-keyword-filter > div,
[data-theme="dark"] [data-workspace-page="true"].store-history-page .history-org-search input,
[data-theme="dark"] [data-workspace-page="true"].store-history-page .history-pagination select,
[data-theme="dark"] [data-workspace-page="true"].store-history-page .history-pagination nav button {
  border-color: #2b394e;
  background: #151f2e;
  color: #d7e0ed;
}

[data-theme="dark"] [data-workspace-page="true"].store-history-page .history-table th,
[data-theme="dark"] [data-workspace-page="true"].store-history-page .history-table td,
[data-theme="dark"] [data-workspace-page="true"].store-history-page .store-history-table th,
[data-theme="dark"] [data-workspace-page="true"].store-history-page .store-history-table td {
  border-color: #28364b;
}

[data-theme="dark"] [data-workspace-page="true"].store-history-page .store-history-table th {
  background: #111925;
  color: #94a2b7;
}

[data-theme="dark"] [data-workspace-page="true"].store-history-page .store-history-table td {
  color: #aab6c7;
}

[data-theme="dark"] [data-workspace-page="true"].store-history-page .store-history-table .store-history-owner {
  color: #aab6c7;
}

[data-theme="dark"] [data-workspace-page="true"].store-history-page .store-history-table .store-history-phone {
  color: #8493aa;
}

@media (max-width: 1460px) {
  [data-workspace-page="true"].store-history-page .history-workspace { grid-template-columns: 280px minmax(0, 1fr); }
}

@media (max-width: 1080px) {
  [data-workspace-page="true"].store-history-page { padding: 26px 22px 44px; }
  [data-workspace-page="true"].store-history-page .history-workspace { grid-template-columns: 1fr; }
  [data-workspace-page="true"].store-history-page .history-store-org.history-org-panel { border-right: 0; border-bottom: 1px solid #e8ebf0; }
  [data-workspace-page="true"].store-history-page .store-history-filter-grid { grid-template-columns: 1fr 1fr; }
  [data-workspace-page="true"].store-history-page .store-history-filter-grid .history-keyword-filter { grid-column: 1 / -1; }
  [data-workspace-page="true"].store-history-page .store-history-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  [data-workspace-page="true"].store-history-page { padding: 20px 14px 36px; }
  [data-workspace-page="true"].store-history-page .history-main > .history-filter-panel { padding: 18px; }
  [data-workspace-page="true"].store-history-page .store-history-filter-grid,
  [data-workspace-page="true"].store-history-page .store-history-summary { grid-template-columns: 1fr; }
  [data-workspace-page="true"].store-history-page .store-history-filter-grid .history-keyword-filter { grid-column: auto; }
  [data-workspace-page="true"].store-history-page .history-filter-heading { align-items: flex-start; flex-direction: column; gap: 14px; }
  [data-workspace-page="true"].store-history-page .history-filter-actions { width: 100%; }
  [data-workspace-page="true"].store-history-page .history-filter-actions button { width: 100%; }
  [data-workspace-page="true"].store-history-page .store-history-result { margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  [data-workspace-page="true"].store-history-page .store-history-summary .history-kpi[data-workspace-interaction="lift"]:hover:not(:disabled) { transform: none !important; }
}

/* Store Management keeps the Formula History geometry after its content was
 * swapped for store data. This block is scoped to the store page so the real
 * history page does not inherit any of these aliases. */
[data-workspace-page="true"].store-history-page .history-workspace {
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 0 !important;
  align-items: stretch;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e1e5eb;
  border-radius: 10px;
  background: #fff;
}

[data-workspace-page="true"].store-history-page .history-main {
  display: flex;
  min-width: 0;
  max-width: 100%;
  container-type: inline-size;
  flex-direction: column;
  gap: 16px;
}

[data-workspace-page="true"].store-history-page .history-main > .history-filter-panel,
[data-workspace-page="true"].store-history-page .history-main > .history-panel {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

[data-workspace-page="true"].store-history-page .history-main > .history-filter-panel {
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  padding: 22px 24px;
}

[data-workspace-page="true"].store-history-page .history-filter-heading h3::before {
  background: #2c2c2c;
  -webkit-mask: url("../assets/icons/store-operations-center.svg?v=1") center / contain no-repeat;
  mask: url("../assets/icons/store-operations-center.svg?v=1") center / contain no-repeat;
}

[data-workspace-page="true"].store-history-page .store-history-filter-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1.55fr) repeat(4, minmax(0, 1fr)) max-content !important;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  column-gap: 12px;
  row-gap: 0;
}

[data-workspace-page="true"].store-history-page .store-history-filter-grid > *,
[data-workspace-page="true"].store-history-page .store-history-filter-grid > .history-search-actions > * {
  min-width: 0;
  max-width: 100%;
}

[data-workspace-page="true"].store-history-page .store-history-filter-grid > .history-search-actions {
  display: contents;
}

[data-workspace-page="true"].store-history-page .store-history-filter-grid > .history-search-actions > .history-keyword-filter {
  grid-column: 1;
}

[data-workspace-page="true"].store-history-page .store-history-filter-grid > .history-search-actions > .history-date-range {
  grid-column: 2;
}

[data-workspace-page="true"].store-history-page .store-history-filter-grid > .history-search-actions > .history-filter-actions {
  grid-column: 7;
  width: max-content;
  justify-content: flex-start;
}

[data-workspace-page="true"].store-history-page .store-history-filter-grid > label:nth-of-type(1) { grid-column: 3; }
[data-workspace-page="true"].store-history-page .store-history-filter-grid > label:nth-of-type(2) { grid-column: 4; }
[data-workspace-page="true"].store-history-page .store-history-filter-grid > label:nth-of-type(3) { grid-column: 5; }
[data-workspace-page="true"].store-history-page .store-history-filter-grid > label:nth-of-type(4) { grid-column: 6; }

[data-workspace-page="true"].store-history-page .history-filter-grid label > span {
  display: none;
}

[data-workspace-page="true"].store-history-page .history-filter-heading {
  align-items: center;
  margin-bottom: 20px;
}

[data-workspace-page="true"].store-history-page .history-filter-heading h3 {
  font-size: 18px;
  font-weight: 700;
}

[data-workspace-page="true"].store-history-page .history-search-actions > .history-keyword-filter,
[data-workspace-page="true"].store-history-page .history-search-actions > .history-date-range {
  width: 100%;
  max-width: none;
  flex: 0 0 auto;
}

[data-workspace-page="true"].store-history-page .history-date-range > div {
  min-width: 0;
}

[data-workspace-page="true"].store-history-page .history-date-trigger > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-workspace-page="true"].store-history-page .history-filter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

[data-workspace-page="true"].store-history-page .history-filter-actions .secondary-btn {
  height: 42px;
  margin: 0;
  border-radius: 7px;
}

[data-workspace-page="true"].store-history-page .history-filter-actions .history-reset-icon {
  width: 42px;
  min-width: 42px;
  padding: 0;
}

[data-workspace-page="true"].store-history-page .history-filter-actions [data-store-export] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding-inline: 18px;
  max-width: max-content;
}

[data-workspace-page="true"].store-history-page .history-filter-actions [data-store-export] > svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[data-workspace-page="true"].store-history-page .store-history-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0 14px 0;
  background: transparent;
}

[data-workspace-page="true"].store-history-page .store-history-summary .history-kpi {
  min-height: 108px;
  padding: 16px 18px 17px;
  border: 1px solid #dfe4ea;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(22, 34, 54, .035);
}

[data-workspace-page="true"].store-history-page .store-history-summary .history-kpi[data-workspace-interaction="lift"]:hover:not(:disabled) {
  z-index: 2;
  transform: translateY(-2px);
  border-color: #cfc8ff;
  box-shadow: 0 10px 24px rgba(63, 72, 95, .14);
}

[data-workspace-page="true"].store-history-page .store-history-summary .history-kpi strong {
  margin: 0;
  padding-left: 0;
  color: #3a4658;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.12;
}

[data-workspace-page="true"].store-history-page .history-kpi-metric {
  display: flex;
  min-width: 0;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-left: 37px;
}

[data-workspace-page="true"].store-history-page .history-kpi-secondary {
  color: #687487;
  white-space: nowrap;
}

[data-workspace-page="true"].store-history-page .history-panel-head {
  min-height: 62px;
  padding: 10px 17px;
}

[data-workspace-page="true"].store-history-page .store-history-tabs button[aria-selected="true"] {
  background: #efedff;
  color: #6253d9;
  font-weight: 650;
}

[data-workspace-page="true"].store-history-page .history-panel-head > [data-store-top-pagination] {
  order: 2;
  min-width: 0;
  margin-left: auto;
}

[data-workspace-page="true"].store-history-page [data-store-top-pagination] .history-pagination {
  min-height: 0;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
}

[data-workspace-page="true"].store-history-page [data-store-top-pagination] .history-pagination nav button {
  height: 32px;
  min-width: 32px;
}

[data-workspace-page="true"].store-history-page [data-store-top-pagination] .history-page-picker-trigger {
  height: 32px;
  min-width: 64px;
}

[data-workspace-page="true"].store-history-page .store-history-table-wrap {
  max-height: calc(100vh - 320px);
  overflow-x: auto;
  overflow-y: visible;
}

[data-workspace-page="true"].store-history-page .store-history-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
}

[data-workspace-page="true"].store-history-page .store-history-table th:first-child,
[data-workspace-page="true"].store-history-page .store-history-table td:first-child {
  width: 3%;
  min-width: 0;
  padding-inline: 10px;
}

[data-workspace-page="true"].store-history-page .store-history-table th,
[data-workspace-page="true"].store-history-page .store-history-table td {
  box-sizing: border-box;
  min-width: 0;
  padding-inline: 10px;
  overflow-wrap: anywhere;
}

[data-workspace-page="true"].store-history-page .store-history-table th:first-child,
[data-workspace-page="true"].store-history-page .store-history-table td:first-child {
  width: 4% !important;
  padding-inline: 6px;
}

[data-workspace-page="true"].store-history-page .store-history-table th:not(:first-child),
[data-workspace-page="true"].store-history-page .store-history-table td:not(:first-child) {
  width: calc(96% / 7) !important;
}

[data-workspace-page="true"].store-history-page .store-history-table[data-store-has-actions="true"] th:not(:first-child):not([data-store-actions-heading]),
[data-workspace-page="true"].store-history-page .store-history-table[data-store-has-actions="true"] td:not(:first-child):not(.store-history-actions) {
  width: calc(84% / 7) !important;
}

[data-workspace-page="true"].store-history-page .store-history-table[data-store-has-actions="true"] th[data-store-actions-heading],
[data-workspace-page="true"].store-history-page .store-history-table[data-store-has-actions="true"] td.store-history-actions {
  width: 12% !important;
}

[data-workspace-page="true"].store-history-page .store-history-table th[data-store-owner-heading],
[data-workspace-page="true"].store-history-page .store-history-table td.store-history-owner-cell {
  width: 14% !important;
}

[data-workspace-page="true"].store-history-page .store-history-table:not([data-store-has-actions="true"]) th:not(:first-child):not([data-store-owner-heading]),
[data-workspace-page="true"].store-history-page .store-history-table:not([data-store-has-actions="true"]) td:not(:first-child):not(.store-history-owner-cell) {
  width: calc(82% / 6) !important;
}

[data-workspace-page="true"].store-history-page .store-history-table[data-store-has-actions="true"] th:not(:first-child):not([data-store-owner-heading]):not([data-store-actions-heading]),
[data-workspace-page="true"].store-history-page .store-history-table[data-store-has-actions="true"] td:not(:first-child):not(.store-history-owner-cell):not(.store-history-actions) {
  width: calc(70% / 6) !important;
}

/* Place record text under the header label, after the header icon and gap,
 * instead of aligning it with the icon box itself. */
[data-workspace-page="true"].store-history-page .store-history-table tbody td:not(:first-child) {
  padding-left: 37px !important;
}

/* Nudge only the customer and device columns right while keeping each
 * column's header label and record value aligned with one another. */
[data-workspace-page="true"].store-history-page .store-history-table th:nth-child(4) .history-table-heading,
[data-workspace-page="true"].store-history-page .store-history-table td:nth-child(4) .history-customer-cell,
[data-workspace-page="true"].store-history-page .store-history-table th:nth-child(6) .history-table-heading,
[data-workspace-page="true"].store-history-page .store-history-table td:nth-child(6) .history-device-cell {
  transform: translateX(16px);
}

[data-workspace-page="true"].store-history-page .store-history-table thead th {
  height: 44px !important;
  padding-block: 0 !important;
  vertical-align: middle;
}

[data-workspace-page="true"].store-history-page .store-history-table thead {
  z-index: 2;
}

[data-workspace-page="true"].store-history-page .store-history-table thead .history-table-heading {
  line-height: 18px;
}

[data-workspace-page="true"].store-history-page .store-history-table .history-table-heading-icon--inventory {
  --history-heading-icon: url("../assets/icons/inventory-management.svg?v=1");
}

[data-workspace-page="true"].store-history-page .store-history-table tbody {
  /* Leave a one-pixel buffer below the compact header so a hovered row can
   * physically lift without crossing into the header's paint area. */
  transform: translateY(1px);
}

[data-workspace-page="true"].store-history-page .store-history-table td {
  height: 56px;
  padding-block: 8px;
  vertical-align: middle !important;
}

[data-workspace-page="true"].store-history-page .store-history-table .history-record-date,
[data-workspace-page="true"].store-history-page .store-history-table .history-record-time {
  display: block;
  color: #647087;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

[data-workspace-page="true"].store-history-page .store-history-org-context {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #929cab;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody td.store-history-actions {
  padding-left: 10px !important;
  padding-right: 10px !important;
  text-align: left;
  white-space: nowrap;
}

[data-workspace-page="true"].store-history-page .store-history-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  margin: 2px 4px 2px 0;
  padding: 0 5px;
  border: 1px solid #edc9cf;
  border-radius: 5px;
  background: #fff8f8;
  color: #c55663;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}

[data-workspace-page="true"].store-history-page .store-history-action:hover,
[data-workspace-page="true"].store-history-page .store-history-action:focus-visible {
  border-color: #d96b76;
  background: #fff0f1;
  color: #ad3e4d;
  outline: none;
}

[data-workspace-page="true"].store-history-page .store-history-action:disabled {
  cursor: wait;
  opacity: .55;
}

[data-workspace-page="true"].store-history-page .store-history-table .history-customer-cell,
[data-workspace-page="true"].store-history-page .store-history-table .history-org-cell,
[data-workspace-page="true"].store-history-page .store-history-table .history-operator-cell,
[data-workspace-page="true"].store-history-page .store-history-table .store-history-owner,
[data-workspace-page="true"].store-history-page .store-history-table .store-history-phone,
[data-workspace-page="true"].store-history-page .store-history-table .history-device-cell,
[data-workspace-page="true"].store-history-page .store-history-table .history-inventory-cell {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-workspace-page="true"].store-history-page .store-history-table .history-device-cell,
[data-workspace-page="true"].store-history-page .store-history-table .history-operator-cell,
[data-workspace-page="true"].store-history-page .store-history-table .history-inventory-cell {
  color: #586579;
}

[data-workspace-page="true"].store-history-page .store-history-table .history-inventory-code {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

[data-workspace-page="true"].store-history-page .store-history-table .history-customer-cell,
[data-workspace-page="true"].store-history-page .store-history-table .history-device-code,
[data-workspace-page="true"].store-history-page .store-history-table .history-inventory-code {
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.35 !important;
}

[data-workspace-page="true"].store-history-page .store-history-table .store-history-owner-contact {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

[data-workspace-page="true"].store-history-page .store-history-table .store-history-owner {
  color: #586579;
}

[data-workspace-page="true"].store-history-page .store-history-table .store-history-phone {
  color: #929cab;
  font-size: 11px;
}

[data-workspace-page="true"].store-history-page .store-history-table th[data-store-owner-heading] .history-table-heading {
  gap: 4px;
  font-size: 10px;
}

[data-workspace-page="true"].store-history-page .store-history-table .history-badge {
  width: max-content;
  max-width: none;
  padding: 5px 8px;
  white-space: nowrap;
}

[data-workspace-page="true"].store-history-page .store-table-expand {
  position: relative;
  left: 0;
  display: inline-grid;
  width: 22px;
  height: 28px;
  place-items: center;
  border: 0;
  background: transparent;
  color: #8290a5;
  cursor: default;
  font-size: 20px;
  line-height: 1;
  user-select: none;
}

[data-workspace-page="true"].store-history-page .history-org-arrow,
[data-workspace-page="true"].store-history-page .store-tree-toggle {
  cursor: default;
}

[data-workspace-page="true"].store-history-page .store-table-expand.expanded {
  transform: rotate(90deg);
  color: #8f86d9;
}

[data-workspace-page="true"].store-history-page .store-table-expand:hover {
  background: transparent !important;
  color: #8290a5;
  cursor: default;
}

[data-workspace-page="true"].store-history-page .store-table-expand.expanded:hover {
  color: #8f86d9;
}

[data-workspace-page="true"].store-history-page .store-history-record-row[data-store-expand] {
  cursor: pointer;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody td:nth-child(3) {
  padding-left: 37px !important;
}

[data-workspace-page="true"].store-history-page .history-page-picker {
  position: relative;
}

[data-workspace-page="true"].store-history-page .history-page-picker-menu,
[data-workspace-page="true"].store-history-page .history-filter-select-menu {
  z-index: 80;
}

@media (max-width: 1280px) {
  [data-workspace-page="true"].store-history-page .store-history-filter-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: stretch;
    row-gap: 12px;
  }

  [data-workspace-page="true"].store-history-page .store-history-filter-grid > .history-search-actions > .history-keyword-filter,
  [data-workspace-page="true"].store-history-page .store-history-filter-grid > .history-search-actions > .history-date-range,
  [data-workspace-page="true"].store-history-page .store-history-filter-grid > .history-search-actions > .history-filter-actions,
  [data-workspace-page="true"].store-history-page .store-history-filter-grid > label:nth-of-type(1),
  [data-workspace-page="true"].store-history-page .store-history-filter-grid > label:nth-of-type(2),
  [data-workspace-page="true"].store-history-page .store-history-filter-grid > label:nth-of-type(3),
  [data-workspace-page="true"].store-history-page .store-history-filter-grid > label:nth-of-type(4) {
    grid-column: auto;
  }
}

/* Use the same compact multi-row rhythm as Formula History when the
 * available main column is narrower than the full desktop rail. The
 * container query is scoped to Store Management so the existing history
 * page remains untouched. */
@container (min-width: 900px) and (max-width: 1599px) {
  [data-workspace-page="true"].store-history-page .store-history-filter-grid {
    grid-template-columns: minmax(180px, 1.55fr) minmax(180px, 1.2fr) repeat(2, minmax(120px, 1fr)) !important;
    align-items: center;
    column-gap: 10px;
    row-gap: 10px;
  }

  [data-workspace-page="true"].store-history-page .store-history-filter-grid > .history-search-actions > .history-keyword-filter {
    grid-column: 1 / -1;
    grid-row: 1;
    width: 100%;
  }

  [data-workspace-page="true"].store-history-page .store-history-filter-grid > .history-search-actions > .history-date-range {
    grid-column: 1 / span 2;
    grid-row: 2;
    width: 100%;
  }

  [data-workspace-page="true"].store-history-page .store-history-filter-grid > label:nth-of-type(1) {
    grid-column: 3;
    grid-row: 2;
  }

  [data-workspace-page="true"].store-history-page .store-history-filter-grid > label:nth-of-type(2) {
    grid-column: 4;
    grid-row: 2;
  }

  [data-workspace-page="true"].store-history-page .store-history-filter-grid > label:nth-of-type(3) {
    grid-column: 1;
    grid-row: 3;
  }

  [data-workspace-page="true"].store-history-page .store-history-filter-grid > label:nth-of-type(4) {
    grid-column: 2;
    grid-row: 3;
  }

  [data-workspace-page="true"].store-history-page .store-history-filter-grid > .history-search-actions > .history-filter-actions {
    grid-column: 3 / span 2;
    grid-row: 3;
    width: 100%;
    justify-content: flex-end;
  }
}

@container (min-width: 700px) and (max-width: 899px) {
  [data-workspace-page="true"].store-history-page .store-history-filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    align-items: center;
    column-gap: 10px;
    row-gap: 10px;
  }

  [data-workspace-page="true"].store-history-page .store-history-filter-grid > .history-search-actions > .history-keyword-filter {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  [data-workspace-page="true"].store-history-page .store-history-filter-grid > .history-search-actions > .history-date-range {
    grid-column: 1 / span 2;
    grid-row: 2;
  }

  [data-workspace-page="true"].store-history-page .store-history-filter-grid > label:nth-of-type(1) { grid-column: 3; grid-row: 2; }
  [data-workspace-page="true"].store-history-page .store-history-filter-grid > label:nth-of-type(2) { grid-column: 4; grid-row: 2; }
  [data-workspace-page="true"].store-history-page .store-history-filter-grid > label:nth-of-type(3) { grid-column: 1; grid-row: 3; }
  [data-workspace-page="true"].store-history-page .store-history-filter-grid > label:nth-of-type(4) { grid-column: 2; grid-row: 3; }

  [data-workspace-page="true"].store-history-page .store-history-filter-grid > .history-search-actions > .history-filter-actions {
    grid-column: 3 / span 2;
    grid-row: 3;
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 1100px) {
  [data-workspace-page="true"].store-history-page .history-workspace {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  [data-workspace-page="true"].store-history-page .store-history-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  [data-workspace-page="true"].store-history-page .history-workspace {
    grid-template-columns: 1fr;
  }

  [data-workspace-page="true"].store-history-page .history-store-org.history-org-panel {
    border-right: 0;
    border-bottom: 1px solid #e8ebf0;
  }
}

@media (max-width: 620px) {
  [data-workspace-page="true"].store-history-page .store-history-summary {
    grid-template-columns: 1fr;
  }

  [data-workspace-page="true"].store-history-page .history-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  [data-workspace-page="true"].store-history-page .history-panel-head > [data-store-top-pagination] {
    width: 100%;
    margin-left: 0;
  }

  [data-workspace-page="true"].store-history-page [data-store-top-pagination] .history-pagination {
    justify-content: flex-end;
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-workspace-page="true"].store-history-page .store-history-summary .history-kpi[data-workspace-interaction="lift"]:hover:not(:disabled) {
    transform: none;
  }
}

/* Store filters keep the operations controls at their original sizes. The
 * action group moves into the removed device-filter slot below. */
@media (min-width: 901px) {
  [data-workspace-page="true"].store-history-page .store-history-filter-grid {
    grid-template-columns: minmax(0, 1.8fr) minmax(130px, 1fr) minmax(130px, 1fr) max-content !important;
    grid-auto-flow: column;
    align-items: center;
    column-gap: 8px;
    row-gap: 0;
  }

  [data-workspace-page="true"].store-history-page .store-history-filter-grid > .history-search-actions > .history-keyword-filter {
    grid-column: 1;
    grid-row: 1;
  }

  [data-workspace-page="true"].store-history-page .store-history-filter-grid > label:nth-of-type(1) {
    grid-column: 2;
    grid-row: 1;
  }

  [data-workspace-page="true"].store-history-page .store-history-filter-grid > label:nth-of-type(2) {
    grid-column: 3;
    grid-row: 1;
  }

  [data-workspace-page="true"].store-history-page .store-history-filter-grid > .history-search-actions > .history-filter-actions {
    grid-column: 6 !important;
    grid-row: 1 !important;
    width: max-content;
    justify-content: flex-start;
  }
}

/* Keep the Store Management frame anchored to the viewport instead of
 * collapsing to the natural height of its single data row. This removes the
 * large blank area below the workspace while leaving Formula History alone. */
[data-workspace-page="true"].store-history-page {
  min-height: calc(100dvh - 70px);
  box-sizing: border-box;
}

[data-workspace-page="true"].store-history-page .history-workspace {
  min-height: calc(100dvh - 120px);
}

/* The Store Management workspace is full-bleed below the top bar. The
 * workspace border used to create an extra top/left frame around the page;
 * the organization/content boundary is the only divider kept here. */
[data-workspace-page="true"].store-history-page {
  min-height: calc(100dvh - 70px);
  padding: 0;
  background: #fff;
}

[data-workspace-page="true"].store-history-page .history-workspace {
  min-height: calc(100dvh - 70px);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

[data-workspace-page="true"].store-history-page .history-store-org.history-org-panel {
  border: 0;
  border-right: 1px solid #e8ebf0;
  border-radius: 0;
}

@media (max-width: 900px) {
  [data-workspace-page="true"].store-history-page .history-store-org.history-org-panel {
    border-right: 0;
    border-bottom: 1px solid #e8ebf0;
  }
}

/* Store Management has five operational KPIs. Keep them on one desktop row
 * and let the equal-width cards compress before the layout wraps. */
[data-workspace-page="true"].store-history-page .store-history-summary {
  min-width: 0;
}

[data-workspace-page="true"].store-history-page .store-history-summary .history-kpi {
  min-width: 0;
}

[data-workspace-page="true"].store-history-page .store-history-summary .history-kpi-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-workspace-page="true"].store-history-page .history-kpi-inventory:before {
  background: #4d79cc;
}

[data-workspace-page="true"].store-history-page .history-kpi-inventory .history-kpi-icon {
  background: #edf4ff;
}

[data-workspace-page="true"].store-history-page .history-kpi-inventory .history-kpi-icon:before {
  background: #4d79cc;
  -webkit-mask-image: url("../assets/icons/inventory-management.svg");
  mask-image: url("../assets/icons/inventory-management.svg");
}

[data-workspace-page="true"].store-history-page .history-kpi-customer:before {
  background: #258a65;
}

[data-workspace-page="true"].store-history-page .history-kpi-customer .history-kpi-icon {
  background: #edf8f3;
}

[data-workspace-page="true"].store-history-page .history-kpi-customer .history-kpi-icon:before {
  background: #258a65;
  -webkit-mask-image: url("../assets/icons/customer-profiles.svg");
  mask-image: url("../assets/icons/customer-profiles.svg");
}

@media (min-width: 901px) {
  [data-workspace-page="true"].store-history-page .history-workspace {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  [data-workspace-page="true"].store-history-page .store-history-summary {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    padding-inline: 10px;
  }

  [data-workspace-page="true"].store-history-page .store-history-summary .history-kpi {
    padding-inline: 14px;
  }
}

@media (min-width: 621px) and (max-width: 900px) {
  [data-workspace-page="true"].store-history-page .store-history-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Use the supplied storefront glyph directly for the Store KPI card. */
[data-workspace-page="true"].store-history-page .store-history-summary .history-kpi-dye .history-kpi-icon {
  border: 1px solid #e2e3e5 !important;
  background: #f7f7f5 url("../assets/icons/store-kpi.svg") center / 76% 76% no-repeat !important;
}

[data-workspace-page="true"].store-history-page .store-history-summary .history-kpi-dye .history-kpi-icon:before {
  display: none;
}

/* Use the supplied device-list glyph while retaining the gray icon frame. */
[data-workspace-page="true"].store-history-page .store-history-summary .history-kpi-developer-onefive .history-kpi-icon {
  border: 1px solid #e2e3e5 !important;
  background: #f7f7f5 url("../assets/icons/device-kpi.svg") center / 76% 76% no-repeat !important;
}

[data-workspace-page="true"].store-history-page .store-history-summary .history-kpi-developer-onefive .history-kpi-icon:before {
  display: none;
}

/* Use the supplied flask glyph for the Completed Formula KPI. */
[data-workspace-page="true"].store-history-page .store-history-summary .history-kpi-developer-twelve .history-kpi-icon {
  border: 1px solid #e2e3e5 !important;
  background: #f7f7f5 url("../assets/icons/formula-kpi.svg") center / 76% 76% no-repeat !important;
}

[data-workspace-page="true"].store-history-page .store-history-summary .history-kpi-developer-twelve .history-kpi-icon:before {
  display: none;
}

/* Use the supplied inventory glyph for the Inventory KPI. */
[data-workspace-page="true"].store-history-page .store-history-summary .history-kpi-inventory .history-kpi-icon {
  border: 1px solid #e2e3e5 !important;
  background: #f7f7f5 url("../assets/icons/inventory-kpi.svg") center / 76% 76% no-repeat !important;
}

[data-workspace-page="true"].store-history-page .store-history-summary .history-kpi-inventory .history-kpi-icon:before {
  display: none;
}

/* Use the supplied customer glyph for the Customer KPI. */
[data-workspace-page="true"].store-history-page .store-history-summary .history-kpi-customer .history-kpi-icon {
  border: 1px solid #e2e3e5 !important;
  background: #f7f7f5 url("../assets/icons/customer-kpi.svg") center / 76% 76% no-repeat !important;
}

[data-workspace-page="true"].store-history-page .store-history-summary .history-kpi-customer .history-kpi-icon:before {
  display: none;
}

/* Keep KPI values light and quiet so the cards read as a balanced summary. */
[data-workspace-page="true"].store-history-page .store-history-summary .history-kpi strong {
  color: #596579;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0;
}

[data-workspace-page="true"].store-history-page .store-history-summary .history-kpi {
  min-height: 84px;
  padding-block: 12px;
}

[data-workspace-page="true"].store-history-page .store-history-summary .history-kpi-metric {
  align-items: baseline;
  justify-content: flex-start;
  gap: 6px;
}

/* Keep the Store page pagination compact after removing the view tabs. */
[data-workspace-page="true"].store-history-page .history-panel-head {
  min-height: 48px;
  padding: 6px 12px;
}

[data-workspace-page="true"].store-history-page .store-history-list-hint {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  margin: 0 auto 0 4px;
  color: #8a95a7;
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}

[data-workspace-page="true"].store-history-page .store-history-list-hint::before {
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: #aaa2e5;
  content: '';
}

@media (max-width: 620px) {
  [data-workspace-page="true"].store-history-page .store-history-list-hint {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
  }
}

[data-workspace-page="true"].store-history-page [data-store-top-pagination] .history-pagination {
  gap: 6px;
  min-height: 0;
  padding: 0;
  font-size: 12px;
}

[data-workspace-page="true"].store-history-page [data-store-top-pagination] .history-page-size-fixed,
[data-workspace-page="true"].store-history-page [data-store-top-pagination] .history-page-total {
  font-size: 12px;
}

[data-workspace-page="true"].store-history-page [data-store-top-pagination] .history-pagination nav {
  gap: 4px;
}

[data-workspace-page="true"].store-history-page [data-store-top-pagination] .history-pagination nav button {
  min-width: 30px;
  height: 30px;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 12px;
}

[data-workspace-page="true"].store-history-page [data-store-top-pagination] .history-page-picker-trigger {
  min-width: 54px;
  height: 30px;
  gap: 7px;
  padding-inline: 8px;
  font-size: 12px;
}

/* Compact the Store page search row without changing Formula History. */
@media (min-width: 901px) {
  [data-workspace-page="true"].store-history-page .store-history-filter-grid {
    grid-template-columns: minmax(100px, 1.1fr) minmax(175px, 1fr) minmax(80px, .6fr) minmax(95px, .7fr) minmax(95px, .7fr) max-content !important;
    grid-auto-flow: column;
    column-gap: 8px;
  }

  [data-workspace-page="true"].store-history-page .store-history-filter-grid > .history-search-actions > .history-keyword-filter {
    grid-column: 1;
    grid-row: 1;
  }

  [data-workspace-page="true"].store-history-page .store-history-filter-grid > .history-search-actions > .history-date-range {
    grid-column: 2;
    grid-row: 1;
  }

  [data-workspace-page="true"].store-history-page .store-history-filter-grid > label:nth-of-type(1) {
    grid-column: 4;
    grid-row: 1;
  }

  [data-workspace-page="true"].store-history-page .store-history-filter-grid > label:nth-of-type(2) {
    grid-column: 5;
    grid-row: 1;
  }

  [data-workspace-page="true"].store-history-page .store-history-filter-grid > .history-search-actions > .history-filter-actions {
    grid-column: 6 !important;
    grid-row: 1 !important;
    width: max-content;
    max-width: none;
    transform: translateX(-105px);
  }

  [data-workspace-page="true"].store-history-page .history-keyword-filter > div,
  [data-workspace-page="true"].store-history-page .history-date-trigger,
  [data-workspace-page="true"].store-history-page .history-filter-select-trigger,
  [data-workspace-page="true"].store-history-page .history-filter-actions .secondary-btn {
    height: 36px;
    border-radius: 6px;
    font-size: 12px;
  }

  [data-workspace-page="true"].store-history-page .history-keyword-filter > div {
    gap: 6px;
    padding-inline: 10px;
  }

  [data-workspace-page="true"].store-history-page .history-keyword-filter > div input {
    height: 32px;
    font-size: 12px;
  }

  [data-workspace-page="true"].store-history-page .history-date-range > div {
    gap: 6px;
  }

  [data-workspace-page="true"].store-history-page .store-history-quick-range {
    grid-column: 3;
    grid-row: 1;
    min-width: 0;
  }

  [data-workspace-page="true"].store-history-page .store-history-quick-range .history-filter-select-trigger {
    width: 100%;
  }

  [data-workspace-page="true"].store-history-page .history-date-trigger {
    min-width: 0;
    padding-inline: 6px;
  }

  [data-workspace-page="true"].store-history-page .history-filter-panel .history-search-icon {
    width: 16px;
    height: 16px;
  }

  [data-workspace-page="true"].store-history-page .history-filter-select-trigger {
    padding-inline: 10px;
  }

  [data-workspace-page="true"].store-history-page .history-filter-select-trigger > i {
    margin-left: 6px;
  }

  [data-workspace-page="true"].store-history-page .history-filter-actions {
    gap: 6px;
  }

  [data-workspace-page="true"].store-history-page .history-filter-actions .history-reset-icon {
    width: 36px;
    min-width: 36px;
  }

  [data-workspace-page="true"].store-history-page .history-filter-actions [data-store-export] {
    gap: 5px;
    padding-inline: 12px;
  }

  [data-workspace-page="true"].store-history-page .history-filter-actions [data-store-export] > svg {
    width: 14px;
    height: 14px;
    flex-basis: 14px;
  }
}

@media (min-width: 1281px) {
  [data-workspace-page="true"].store-history-page .store-history-filter-grid {
    grid-template-columns: minmax(190px, 300px) minmax(220px, 280px) minmax(90px, 120px) minmax(105px, 150px) minmax(105px, 150px) max-content !important;
    column-gap: 6px;
    justify-content: start;
  }

  [data-workspace-page="true"].store-history-page .history-keyword-filter > div,
  [data-workspace-page="true"].store-history-page .history-date-trigger,
  [data-workspace-page="true"].store-history-page .history-filter-select-trigger,
  [data-workspace-page="true"].store-history-page .history-filter-actions .secondary-btn {
    height: 34px;
    border-radius: 6px;
    font-size: 12px;
  }

  [data-workspace-page="true"].store-history-page .history-keyword-filter > div {
    gap: 5px;
    padding-inline: 9px;
  }

  [data-workspace-page="true"].store-history-page .history-keyword-filter > div input {
    height: 30px;
    font-size: 12px;
  }

  [data-workspace-page="true"].store-history-page .history-date-range > div {
    gap: 5px;
  }

  [data-workspace-page="true"].store-history-page .history-date-trigger {
    padding-inline: 5px;
  }

  [data-workspace-page="true"].store-history-page .history-filter-select-trigger {
    padding-inline: 8px;
  }

  [data-workspace-page="true"].store-history-page .history-filter-select-trigger > i {
    margin-left: 5px;
  }

  [data-workspace-page="true"].store-history-page .history-filter-actions {
    gap: 5px;
  }

  [data-workspace-page="true"].store-history-page .history-filter-actions .history-reset-icon {
    width: 34px;
    min-width: 34px;
  }

  [data-workspace-page="true"].store-history-page .history-filter-actions [data-store-export] {
    gap: 4px;
    padding-inline: 9px;
  }

  [data-workspace-page="true"].store-history-page .store-history-filter-grid > .history-search-actions > .history-filter-actions {
    transform: translateX(-111px);
  }
}

/* Keep the primary store action in the same compact row as the filters. */
[data-workspace-page="true"].store-history-page .history-filter-actions .store-history-add-store {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 36px;
  min-width: 0;
  margin: 0;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

[data-workspace-page="true"].store-history-page .store-history-add-store .store-ui-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

@media (min-width: 901px) and (max-width: 1280px) {
  [data-workspace-page="true"].store-history-page .store-history-filter-grid {
    grid-template-columns: minmax(90px, .85fr) minmax(145px, 1.3fr) minmax(58px, .55fr) minmax(80px, .75fr) minmax(80px, .75fr) max-content !important;
    column-gap: 6px;
  }

  [data-workspace-page="true"].store-history-page .history-filter-actions [data-store-export] {
    gap: 4px;
    padding-inline: 9px;
  }

  [data-workspace-page="true"].store-history-page .history-filter-actions .store-history-add-store {
    gap: 4px;
    padding-inline: 9px;
    font-size: 11px;
  }

  [data-workspace-page="true"].store-history-page .store-history-quick-range .history-filter-select-trigger {
    padding-inline: 6px;
    font-size: 11px;
  }
}

/* Pull the KPI strip and list upward while keeping the search row in place. */
[data-workspace-page="true"].store-history-page .history-main {
  gap: 8px;
}

[data-workspace-page="true"].store-history-page .history-main > .history-filter-panel {
  padding-bottom: 12px;
}

[data-workspace-page="true"].store-history-page .store-history-date-picker {
  position: relative;
  min-width: 0;
}

[data-workspace-page="true"].store-history-page .store-history-date-picker .history-date-trigger {
  width: 100%;
}

[data-workspace-page="true"].store-history-page .store-history-date-picker .history-date-menu {
  z-index: 90;
}

[data-workspace-page="true"].store-history-page .store-history-date-picker[data-year-open="true"] .history-date-menu {
  z-index: 91;
}

/* Store rows are intentionally flat. Disable the shared row-lift adapter and
 * the previous purple cell outline here; Formula History keeps its own hover
 * treatment because this selector is scoped to the Store page only. */
[data-workspace-page="true"].store-history-page .store-history-table tbody {
  transform: none !important;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-workspace-interaction="row"]:not(.store-row-flip):not(.store-row-entering):not(.store-row-entered):not(.store-row-collapsing),
[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-workspace-interaction="row"]:not(.store-row-flip):not(.store-row-entering):not(.store-row-entered):not(.store-row-collapsing):hover,
[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-workspace-interaction="row"]:not(.store-row-flip):not(.store-row-entering):not(.store-row-entered):not(.store-row-collapsing):focus-within {
  z-index: auto !important;
  transform: none !important;
  filter: none !important;
  box-shadow: none !important;
  background: transparent !important;
  transition: none !important;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-workspace-interaction="row"]:not(.store-row-flip):not(.store-row-entering):not(.store-row-entered):not(.store-row-collapsing) > td,
[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-workspace-interaction="row"]:not(.store-row-flip):not(.store-row-entering):not(.store-row-entered):not(.store-row-collapsing):hover > td,
[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-workspace-interaction="row"]:not(.store-row-flip):not(.store-row-entering):not(.store-row-entered):not(.store-row-collapsing):focus-within > td {
  position: static !important;
  z-index: auto !important;
  background: transparent !important;
  border-bottom-color: #f0f2f6 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* Smooth hierarchy expansion: FLIP the rows that move and fade new/removed
 * child rows without changing the table's column geometry. */
[data-workspace-page="true"].store-history-page .store-table-expand {
  transform-origin: center;
  transition: transform 90ms cubic-bezier(.2, .9, .25, 1), color 80ms ease;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody > tr.store-row-flip {
  will-change: transform;
  transform: translateY(var(--store-flip-y, 0px)) !important;
  transition: transform 90ms cubic-bezier(.2, .9, .25, 1) !important;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody > tr.store-row-entering,
[data-workspace-page="true"].store-history-page .store-history-table tbody > tr.store-row-collapsing {
  will-change: opacity, transform;
  opacity: 0 !important;
  transform: translateY(-5px) !important;
  transition: opacity 80ms ease, transform 90ms cubic-bezier(.2, .9, .25, 1) !important;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody > tr.store-row-entering.store-row-entered {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

@media (prefers-reduced-motion: reduce) {
  [data-workspace-page="true"].store-history-page .store-table-expand,
  [data-workspace-page="true"].store-history-page .store-history-table tbody > tr.store-row-flip,
  [data-workspace-page="true"].store-history-page .store-history-table tbody > tr.store-row-entering,
  [data-workspace-page="true"].store-history-page .store-history-table tbody > tr.store-row-collapsing {
    transition: none !important;
  }
}

/* Store operations: keep the record table inside the page while reserving
 * enough width for a complete owner/phone value. The phone itself is rendered
 * as two lines below so an international prefix cannot truncate the number. */
[data-workspace-page="true"].store-history-page .store-history-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important;
  overflow-y: visible;
}

[data-workspace-page="true"].store-history-page .store-history-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
}

[data-workspace-page="true"].store-history-page .store-history-table th,
[data-workspace-page="true"].store-history-page .store-history-table td {
  box-sizing: border-box;
  min-width: 0;
}

[data-workspace-page="true"].store-history-page .store-history-table th:first-child,
[data-workspace-page="true"].store-history-page .store-history-table td:first-child {
  width: 4% !important;
}

[data-workspace-page="true"].store-history-page .store-history-table th:nth-child(2),
[data-workspace-page="true"].store-history-page .store-history-table td:nth-child(2) {
  width: 12% !important;
}

[data-workspace-page="true"].store-history-page .store-history-table th:nth-child(3),
[data-workspace-page="true"].store-history-page .store-history-table td:nth-child(3) {
  width: 13% !important;
}

[data-workspace-page="true"].store-history-page .store-history-table th:nth-child(4),
[data-workspace-page="true"].store-history-page .store-history-table td:nth-child(4) {
  width: 8% !important;
}

[data-workspace-page="true"].store-history-page .store-history-table th[data-store-owner-heading],
[data-workspace-page="true"].store-history-page .store-history-table td.store-history-owner-cell {
  width: 22% !important;
}

[data-workspace-page="true"].store-history-page .store-history-table th:nth-child(6),
[data-workspace-page="true"].store-history-page .store-history-table td:nth-child(6) {
  width: 13% !important;
}

[data-workspace-page="true"].store-history-page .store-history-table th:nth-child(7),
[data-workspace-page="true"].store-history-page .store-history-table td:nth-child(7) {
  width: 8% !important;
}

[data-workspace-page="true"].store-history-page .store-history-table th:nth-child(8),
[data-workspace-page="true"].store-history-page .store-history-table td:nth-child(8) {
  width: 7% !important;
}

[data-workspace-page="true"].store-history-page .store-history-table th[data-store-actions-heading],
[data-workspace-page="true"].store-history-page .store-history-table td.store-history-actions {
  width: 13% !important;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody td:not(:first-child) {
  padding-left: 12px !important;
  padding-right: 8px !important;
}

[data-workspace-page="true"].store-history-page .store-history-table th:nth-child(4) .history-table-heading,
[data-workspace-page="true"].store-history-page .store-history-table td:nth-child(4) .history-customer-cell,
[data-workspace-page="true"].store-history-page .store-history-table th:nth-child(6) .history-table-heading,
[data-workspace-page="true"].store-history-page .store-history-table td:nth-child(6) .history-device-cell {
  transform: none;
}

[data-workspace-page="true"].store-history-page .store-history-table .store-history-owner-contact {
  min-width: 0;
  gap: 2px;
}

[data-workspace-page="true"].store-history-page .store-history-table .store-history-owner,
[data-workspace-page="true"].store-history-page .store-history-table .store-history-phone {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

[data-workspace-page="true"].store-history-page .store-history-table .store-history-phone {
  display: grid;
  gap: 1px;
  line-height: 14px;
}

[data-workspace-page="true"].store-history-page .store-history-table .store-history-phone span {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(4),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(4),
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(6),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(6),
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(7),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(7),
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(8),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(8) {
    display: none !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table th:first-child,
  [data-workspace-page="true"].store-history-page .store-history-table td:first-child {
    width: 7% !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(2),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(2) {
    width: 19% !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(3),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(3) {
    width: 27% !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table th[data-store-owner-heading],
  [data-workspace-page="true"].store-history-page .store-history-table td.store-history-owner-cell {
    width: 31% !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table th[data-store-actions-heading],
  [data-workspace-page="true"].store-history-page .store-history-table td.store-history-actions {
    width: 16% !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table thead th,
  [data-workspace-page="true"].store-history-page .store-history-table tbody td {
    padding-left: 8px !important;
    padding-right: 6px !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table .history-table-heading {
    gap: 3px;
    font-size: 9px;
  }

  [data-workspace-page="true"].store-history-page .store-history-table .history-table-heading-icon {
    width: 12px;
    height: 12px;
    flex-basis: 12px;
  }

  [data-workspace-page="true"].store-history-page .store-history-action {
    max-width: 100%;
    padding-inline: 3px;
    font-size: 9px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* Store operations table: owner and contact phone are separate fields. Keep
 * both visible in the requested order without reintroducing page scrolling. */
[data-workspace-page="true"].store-history-page .store-history-table-wrap {
  overflow-x: hidden !important;
}

[data-workspace-page="true"].store-history-page .store-history-table col:nth-child(1) { width: 4% !important; }
[data-workspace-page="true"].store-history-page .store-history-table col:nth-child(2) { width: 11% !important; }
[data-workspace-page="true"].store-history-page .store-history-table col:nth-child(3) { width: 11% !important; }
[data-workspace-page="true"].store-history-page .store-history-table col:nth-child(4) { width: 7% !important; }
[data-workspace-page="true"].store-history-page .store-history-table col:nth-child(5) { width: 14% !important; }
[data-workspace-page="true"].store-history-page .store-history-table col:nth-child(6) { width: 18% !important; }
[data-workspace-page="true"].store-history-page .store-history-table col:nth-child(7) { width: 11% !important; }
[data-workspace-page="true"].store-history-page .store-history-table col:nth-child(8) { width: 7% !important; }
[data-workspace-page="true"].store-history-page .store-history-table col:nth-child(9) { width: 6% !important; }
[data-workspace-page="true"].store-history-page .store-history-table col:nth-child(10) { width: 11% !important; }

[data-workspace-page="true"].store-history-page .store-history-table th:nth-child(1),
[data-workspace-page="true"].store-history-page .store-history-table td:nth-child(1) { width: 4% !important; }
[data-workspace-page="true"].store-history-page .store-history-table th:nth-child(2),
[data-workspace-page="true"].store-history-page .store-history-table td:nth-child(2) { width: 11% !important; }
[data-workspace-page="true"].store-history-page .store-history-table th:nth-child(3),
[data-workspace-page="true"].store-history-page .store-history-table td:nth-child(3) { width: 11% !important; }
[data-workspace-page="true"].store-history-page .store-history-table th:nth-child(4),
[data-workspace-page="true"].store-history-page .store-history-table td:nth-child(4) { width: 7% !important; }
[data-workspace-page="true"].store-history-page .store-history-table th:nth-child(5),
[data-workspace-page="true"].store-history-page .store-history-table td:nth-child(5) { width: 14% !important; }
[data-workspace-page="true"].store-history-page .store-history-table th:nth-child(6),
[data-workspace-page="true"].store-history-page .store-history-table td:nth-child(6) { width: 18% !important; }
[data-workspace-page="true"].store-history-page .store-history-table th:nth-child(7),
[data-workspace-page="true"].store-history-page .store-history-table td:nth-child(7) { width: 11% !important; }
[data-workspace-page="true"].store-history-page .store-history-table th:nth-child(8),
[data-workspace-page="true"].store-history-page .store-history-table td:nth-child(8) { width: 7% !important; }
[data-workspace-page="true"].store-history-page .store-history-table th:nth-child(9),
[data-workspace-page="true"].store-history-page .store-history-table td:nth-child(9) { width: 6% !important; }
[data-workspace-page="true"].store-history-page .store-history-table th:nth-child(10),
[data-workspace-page="true"].store-history-page .store-history-table td:nth-child(10) { width: 11% !important; }

[data-workspace-page="true"].store-history-page .store-history-table .store-history-owner,
[data-workspace-page="true"].store-history-page .store-history-table .store-history-phone {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

[data-workspace-page="true"].store-history-page .store-history-table .store-history-phone {
  display: grid;
  gap: 1px;
  line-height: 14px;
}

[data-workspace-page="true"].store-history-page .store-history-table .store-history-phone span {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

[data-workspace-page="true"].store-history-page .store-history-table .store-history-phone-empty {
  color: #929cab;
}

[data-workspace-page="true"].store-history-page .store-history-table th[data-store-phone-heading] .history-table-heading {
  gap: 4px;
}

[data-workspace-page="true"].store-history-page .store-history-table .history-table-heading-icon--phone {
  --history-heading-icon: url("../assets/icons/contact-phone.svg?v=1");
}

[data-workspace-page="true"].store-history-page .store-history-table .history-table-heading-icon--action {
  --history-heading-icon: url("../assets/icons/action-settings.svg?v=1");
}

@media (max-width: 720px) {
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(4),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(4),
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(7),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(7),
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(8),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(8),
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(9),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(9) {
    display: none !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(6),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(6) {
    display: table-cell !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(1) { width: 7% !important; }
  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(2) { width: 18% !important; }
  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(3) { width: 25% !important; }
  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(4),
  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(7),
  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(8),
  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(9) { display: none; }
  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(5) { width: 25% !important; }
  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(6) { width: 32% !important; }
  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(10) { width: 18% !important; }

  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(1),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(1) { width: 7% !important; }
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(2),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(2) { width: 18% !important; }
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(3),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(3) { width: 25% !important; }
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(5),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(5) { width: 25% !important; }
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(6),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(6) { width: 32% !important; }
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(10),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(10) { width: 18% !important; }
}

/* Final spacing contract for the full store ledger. The fixed column weights
 * leave equal breathing room around each field and protect device/inventory
 * values from the minimum-content sizing of the table algorithm. */
[data-workspace-page="true"].store-history-page .store-history-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
}

[data-workspace-page="true"].store-history-page .store-history-table col:nth-child(1) { width: 4% !important; }
[data-workspace-page="true"].store-history-page .store-history-table col:nth-child(2) { width: 10% !important; }
[data-workspace-page="true"].store-history-page .store-history-table col:nth-child(3) { width: 10% !important; }
[data-workspace-page="true"].store-history-page .store-history-table col:nth-child(4) { width: 10% !important; }
[data-workspace-page="true"].store-history-page .store-history-table col:nth-child(5) { width: 7% !important; }
[data-workspace-page="true"].store-history-page .store-history-table col:nth-child(6) { width: 12% !important; }
[data-workspace-page="true"].store-history-page .store-history-table col:nth-child(7) { width: 13% !important; }
[data-workspace-page="true"].store-history-page .store-history-table col:nth-child(8) { width: 10% !important; }
[data-workspace-page="true"].store-history-page .store-history-table col:nth-child(9) { width: 6% !important; }
[data-workspace-page="true"].store-history-page .store-history-table col:nth-child(10) { width: 7% !important; }
[data-workspace-page="true"].store-history-page .store-history-table col:nth-child(11) { width: 11% !important; }

[data-workspace-page="true"].store-history-page .store-history-table th,
[data-workspace-page="true"].store-history-page .store-history-table td {
  box-sizing: border-box;
  width: auto !important;
  min-width: 0;
  max-width: 0 !important;
  padding-left: 8px !important;
  padding-right: 8px !important;
}

[data-workspace-page="true"].store-history-page .store-history-table th:first-child,
[data-workspace-page="true"].store-history-page .store-history-table td:first-child {
  padding-left: 6px !important;
  padding-right: 6px !important;
}

[data-workspace-page="true"].store-history-page .store-history-table th:nth-child(4) .history-table-heading,
[data-workspace-page="true"].store-history-page .store-history-table th:nth-child(6) .history-table-heading,
[data-workspace-page="true"].store-history-page .store-history-table td:nth-child(6) .history-device-cell {
  transform: none !important;
}

[data-workspace-page="true"].store-history-page .store-history-table .history-table-heading {
  width: 100%;
  min-width: 0;
  gap: 5px;
  flex-wrap: wrap;
  white-space: normal;
  overflow-wrap: anywhere;
}

[data-workspace-page="true"].store-history-page .store-history-table .history-table-heading-icon {
  flex: 0 0 16px;
}

@media (max-width: 720px) {
  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(1) { width: 6% !important; }
  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(2) { width: 13% !important; }
  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(3) { width: 20% !important; }
  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(4) { width: 19% !important; }
  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(5),
  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(8),
  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(9),
  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(10) { display: none; }
  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(6) { width: 16% !important; }
  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(7) { width: 16% !important; }
  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(11) { width: 10% !important; }
  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(3),
  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(4),
  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(6),
  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(7),
  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(11) { display: table-column !important; }

  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(5),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(5),
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(8),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(8),
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(9),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(9),
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(10),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(10) {
    display: none !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(4),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(4),
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(6),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(6),
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(7),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(7),
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(11),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(11) { display: table-cell !important; }

  [data-workspace-page="true"].store-history-page .store-history-table .history-table-heading {
    gap: 3px;
    font-size: 9px;
  }

  [data-workspace-page="true"].store-history-page .store-history-table .history-table-heading-icon {
    flex-basis: 12px;
    width: 12px;
    height: 12px;
  }
}

/* Keep the gray list container and column boundaries fixed. Header labels and
 * row values use their own cell padding as the shared horizontal reference;
 * no blanket visual translation is applied across the ledger. */
@media (min-width: 721px) {
  [data-workspace-page="true"].store-history-page .store-history-table {
    position: static;
    left: auto;
  }

  [data-workspace-page="true"].store-history-page .store-history-table th:not(:first-child) > .history-table-heading,
  [data-workspace-page="true"].store-history-page .store-history-table td:not(:first-child) > * {
    transform: none !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(4) .history-table-heading {
    flex-wrap: nowrap;
    gap: 3px !important;
    white-space: nowrap;
  }

  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(4) .history-table-heading-icon {
    width: 14px !important;
    height: 14px !important;
    flex: 0 0 14px !important;
  }

  /* The row date shares the same cell padding as its create-time heading. */
  [data-workspace-page="true"].store-history-page .store-history-table tbody td:nth-child(2) > time {
    display: block;
    transform: none !important;
  }
}

/* Contact editing follows the approved high-fidelity proposal: the edit
 * action is purple/neutral, while the type-specific delete action remains
 * pale red and keeps its existing wording. */
[data-workspace-page="true"].store-history-page .store-history-action-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  flex-wrap: nowrap;
}

[data-workspace-page="true"].store-history-page .store-history-action {
  gap: 4px;
}

[data-workspace-page="true"].store-history-page .store-history-action--edit {
  border-color: #b7aff3;
  background: #faf9ff;
  color: #5b4fd1;
}

[data-workspace-page="true"].store-history-page .store-history-action--edit:hover,
[data-workspace-page="true"].store-history-page .store-history-action--edit:focus-visible {
  border-color: #8679e7;
  background: #f0eeff;
  color: #4c3fc0;
  outline: none;
}

body[data-active-page="organization"] .store-contact-edit-modal-backdrop {
  z-index: 1400;
  background: rgba(22, 30, 45, .46);
  backdrop-filter: blur(2px);
}

body[data-active-page="organization"] .store-contact-edit-modal {
  width: min(520px, calc(100vw - 32px));
  max-height: min(620px, calc(100vh - 32px));
  padding: 24px;
  border-radius: 16px;
}

body[data-active-page="organization"] .store-contact-edit-modal .org-modal-head {
  margin-bottom: 22px;
}

body[data-active-page="organization"] .org-form-modal .org-modal-title-group {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-width: 0;
}

body[data-active-page="organization"] .org-form-modal .org-modal-title-icon {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  margin-top: -1px;
  color: #172238;
  fill: currentColor;
}

body[data-active-page="organization"] .org-form-modal .org-form-label-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
}

body[data-active-page="organization"] .org-form-modal .org-form-type-icon,
body[data-active-page="organization"] .org-form-modal .org-form-name-icon,
body[data-active-page="organization"] .org-form-modal .org-form-owner-icon,
body[data-active-page="organization"] .org-form-modal .org-form-phone-icon,
body[data-active-page="organization"] .org-form-modal .org-form-agent-icon,
body[data-active-page="organization"] .org-form-modal .org-form-chain-icon {
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  color: #2c2c2c;
  fill: currentColor;
}

body[data-active-page="organization"] .store-contact-edit-modal .org-modal-head h3 {
  color: #172238;
  font-size: 22px;
  line-height: 1.35;
}

body[data-active-page="organization"] .store-contact-edit-modal .org-modal-head p {
  margin-top: 7px;
  font-size: 13px;
}

body[data-active-page="organization"] .store-contact-edit-modal .org-modal-head button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  padding: 0;
}

body[data-active-page="organization"] .store-contact-edit-modal .org-modal-head button .store-ui-icon {
  width: 18px;
  height: 18px;
}

body[data-active-page="organization"] .store-contact-edit-modal form > label {
  margin: 0 0 17px;
  color: #526078;
  font-size: 13px;
}

body[data-active-page="organization"] .store-contact-edit-modal form > label > span {
  display: block;
  margin-bottom: 7px;
}

body[data-active-page="organization"] .store-contact-edit-modal .org-modal-error {
  min-height: 18px;
  margin-top: -3px;
}

body[data-active-page="organization"] .store-contact-edit-modal .org-modal-actions {
  margin-top: 5px;
  padding-top: 16px;
  border-top: 1px solid #edf0f4;
}

@media (max-width: 720px) {
  [data-workspace-page="true"].store-history-page .store-history-action-group {
    gap: 3px;
    flex-wrap: wrap;
  }

  [data-workspace-page="true"].store-history-page .store-history-table tbody td.store-history-actions {
    white-space: normal !important;
  }

  body[data-active-page="organization"] .store-contact-edit-modal-backdrop {
    padding: 12px;
  }

  body[data-active-page="organization"] .store-contact-edit-modal {
    width: 100%;
    max-height: calc(100vh - 24px);
    padding: 20px;
  }

  body[data-active-page="organization"] .store-contact-edit-modal .org-modal-head h3 {
    font-size: 18px;
  }
}

/* Keep a hierarchy arrow in the disclosure rail instead of letting it sit on
 * top of the left-shifted creation time. Narrow desktop tables need a small
 * extra offset because the fixed 4% disclosure rail becomes very compact. */
@media (min-width: 721px) {
  [data-workspace-page="true"].store-history-page .store-history-table .store-table-expand {
    left: 0;
  }
}

/* The store ledger has eleven columns after the owner, phone, and action
 * columns are added at runtime. Keep one explicit desktop grid so every
 * header and record cell lands on the same column boundary. */
@media (min-width: 721px) {
  [data-workspace-page="true"].store-history-page .store-history-table-wrap {
    overflow-x: auto !important;
    overscroll-behavior-inline: contain;
    scrollbar-gutter: stable;
  }

  [data-workspace-page="true"].store-history-page .store-history-table {
    min-width: 1220px !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(1),
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(1),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(1) {
    width: 4% !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(2),
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(2),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(2) {
    width: 10% !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(3),
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(3),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(3) {
    width: 11% !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(4),
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(4),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(4) {
    width: 8% !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(5),
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(5),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(5) {
    width: 9% !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(6),
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(6),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(6) {
    width: 10% !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(7),
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(7),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(7) {
    width: 10% !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(8),
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(8),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(8) {
    width: 9% !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(9),
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(9),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(9) {
    width: 7% !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(10),
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(10),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(10) {
    width: 8% !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(11),
  [data-workspace-page="true"].store-history-page .store-history-table th[data-store-actions-heading],
  [data-workspace-page="true"].store-history-page .store-history-table td.store-history-actions {
    width: 13% !important;
  }
}

/* Action labels may be longer than the available cell at intermediate widths.
 * Wrap the group and its buttons so every control stays inside the card. */
[data-workspace-page="true"].store-history-page .store-history-action-group {
  display: flex;
  width: 100%;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  box-sizing: border-box;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody td.store-history-actions {
  white-space: normal !important;
  overflow-wrap: anywhere;
}

[data-workspace-page="true"].store-history-page .store-history-action {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

/* English copy is intentionally compact in tight controls. Keep the full
 * label available through the input title/accessible name, and let table
 * headings wrap instead of clipping at the cell edge. */
html[lang="en-US"] [data-workspace-page="true"].store-history-page .history-keyword-filter > span,
html[lang="en-US"] [data-workspace-page="true"].store-history-page .history-keyword-filter input,
html[lang="en-US"] [data-workspace-page="true"].store-history-page .history-filter-select-trigger > span,
html[lang="en-US"] [data-workspace-page="true"].store-history-page .history-date-trigger > span {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* Invite codes stay readable in the ledger: show the complete value and keep
 * regenerate control attached to the same store row. */
[data-workspace-page="true"].store-history-page .store-history-table .history-table-heading-icon--invite {
  --history-heading-icon: url("../assets/icons/invite-user-plus.svg?v=1");
}

[data-workspace-page="true"].store-history-page .store-history-invite-cell {
  display: block;
  min-width: 0;
  max-width: 100%;
}

[data-workspace-page="true"].store-history-page .store-history-invite-code {
  min-width: 0;
  max-width: 100%;
  color: #586579;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .3px;
  line-height: 18px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

[data-workspace-page="true"].store-history-page .store-history-invite-empty {
  display: block;
  min-width: 0;
  max-width: 100%;
  color: #929cab;
  text-align: left;
}

[data-workspace-page="true"].store-history-page .store-history-action--invite {
  border-color: #b7aff3;
  background: #faf9ff;
  color: #5b4fd1;
}

[data-workspace-page="true"].store-history-page .store-history-action--invite:hover,
[data-workspace-page="true"].store-history-page .store-history-action--invite:focus-visible {
  border-color: #8679e7;
  background: #f0eeff;
  color: #4c3fc0;
  outline: none;
}

body[data-active-page="organization"] .store-inspector-invite-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

body[data-active-page="organization"] .store-inspector-invite-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid #b7aff3;
  border-radius: 7px;
  background: #faf9ff;
  color: #5b4fd1;
  cursor: pointer;
  font-size: 11px;
}

body[data-active-page="organization"] .store-inspector-invite-action:hover,
body[data-active-page="organization"] .store-inspector-invite-action:focus-visible {
  border-color: #8679e7;
  background: #f0eeff;
  color: #4c3fc0;
  outline: none;
}

body[data-active-page="organization"] .store-inspector-invite-action .store-ui-icon {
  width: 13px;
  height: 13px;
}

body[data-active-page="organization"] .store-invite-modal-backdrop {
  position: fixed;
  z-index: 1450;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(22, 30, 45, .46);
  backdrop-filter: blur(2px);
}

body[data-active-page="organization"] .store-invite-modal-backdrop-inner {
  width: min(460px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid #e0e5ef;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(38, 47, 83, .22);
}

body[data-active-page="organization"] .store-invite-modal-head {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 30px;
  gap: 12px;
  align-items: start;
  padding: 22px 22px 18px;
  border-bottom: 1px solid #edf0f4;
}

body[data-active-page="organization"] .store-invite-modal-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  background: #eeecff;
  color: #6256d3;
}

body[data-active-page="organization"] .store-invite-modal-mark .store-ui-icon {
  width: 20px;
  height: 20px;
}

body[data-active-page="organization"] .store-invite-modal-head h2 {
  margin: 0;
  color: #172238;
  font-size: 18px;
  line-height: 1.35;
}

body[data-active-page="organization"] .store-invite-modal-head p {
  margin: 6px 0 0;
  color: #6d7890;
  font-size: 12px;
  line-height: 1.55;
}

body[data-active-page="organization"] .store-invite-modal-close {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #8792a5;
  cursor: pointer;
}

body[data-active-page="organization"] .store-invite-modal-close:hover,
body[data-active-page="organization"] .store-invite-modal-close:focus-visible {
  background: #f2f4f8;
  color: #3f4e68;
  outline: none;
}

body[data-active-page="organization"] .store-invite-modal-body {
  padding: 20px 22px 10px;
}

body[data-active-page="organization"] .store-invite-modal-body dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

body[data-active-page="organization"] .store-invite-modal-body dl div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f2f6;
}

body[data-active-page="organization"] .store-invite-modal-body dt {
  color: #7a8699;
  font-size: 12px;
}

body[data-active-page="organization"] .store-invite-modal-body dd {
  margin: 0;
  color: #273653;
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

body[data-active-page="organization"] .store-invite-modal-code {
  color: #5549c6 !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .4px;
}

body[data-active-page="organization"] .store-invite-modal-warning {
  margin: 16px 0 0;
  color: #9a681d;
  font-size: 12px;
  line-height: 1.6;
}

body[data-active-page="organization"] .store-invite-modal-error {
  min-height: 18px;
  margin: 10px 0 0;
  color: #c44e58;
  font-size: 12px;
}

body[data-active-page="organization"] .store-invite-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 15px 22px 20px;
  border-top: 1px solid #edf0f4;
}

body[data-active-page="organization"] .store-invite-modal-foot button {
  min-height: 34px;
  padding: 0 13px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
}

body[data-active-page="organization"] .store-invite-modal-cancel {
  border: 1px solid #dce2ec;
  background: #fff;
  color: #5c6a80;
}

body[data-active-page="organization"] .store-invite-modal-confirm {
  border: 1px solid #6458d6;
  background: #6458d6;
  color: #fff;
}

body[data-active-page="organization"] .store-invite-modal-confirm:hover,
body[data-active-page="organization"] .store-invite-modal-confirm:focus-visible {
  background: #5549c6;
  outline: none;
}

body[data-theme="dark"][data-active-page="organization"] .store-history-invite-code {
  color: #aab6c7;
}

body[data-theme="dark"][data-active-page="organization"] .store-invite-modal-backdrop-inner {
  border-color: #34425a;
  background: #172130;
}

body[data-theme="dark"][data-active-page="organization"] .store-invite-modal-head,
body[data-theme="dark"][data-active-page="organization"] .store-invite-modal-foot,
body[data-theme="dark"][data-active-page="organization"] .store-invite-modal-body dl div {
  border-color: #2b3950;
}

body[data-theme="dark"][data-active-page="organization"] .store-invite-modal-head h2,
body[data-theme="dark"][data-active-page="organization"] .store-invite-modal-body dd {
  color: #eef2f8;
}

body[data-theme="dark"][data-active-page="organization"] .store-invite-modal-head p,
body[data-theme="dark"][data-active-page="organization"] .store-invite-modal-body dt {
  color: #94a2b8;
}

body[data-theme="dark"][data-active-page="organization"] .store-invite-modal-cancel {
  border-color: #42516a;
  background: #1d293b;
  color: #c6d0df;
}

@media (max-width: 720px) {
  body[data-active-page="organization"] .store-inspector-invite-actions {
    align-items: stretch;
    flex-direction: column;
  }

  body[data-active-page="organization"] .store-inspector-invite-action,
  body[data-active-page="organization"] .store-inspector-more {
    justify-content: center;
  }

  body[data-active-page="organization"] .store-invite-modal-backdrop {
    padding: 12px;
  }

  body[data-active-page="organization"] .store-invite-modal-backdrop-inner {
    width: 100%;
  }

  body[data-active-page="organization"] .store-invite-modal-head,
  body[data-active-page="organization"] .store-invite-modal-body,
  body[data-active-page="organization"] .store-invite-modal-foot {
    padding-left: 17px;
    padding-right: 17px;
  }
}

html[lang="en-US"] [data-workspace-page="true"].store-history-page .history-table-heading {
  display: flex !important;
  min-width: 0 !important;
  max-width: 100% !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  overflow-wrap: anywhere !important;
}

/* Final store-ledger alignment contract. The table owns one grid, while the
 * heading and record content inside each cell share the same left padding.
 * Narrow desktop layouts scroll inside the table wrapper instead of widening
 * the page; mobile keeps the existing column visibility rules. */
[data-workspace-page="true"].store-history-page .store-history-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto !important;
  overscroll-behavior-inline: contain;
}

[data-workspace-page="true"].store-history-page .store-history-table {
  width: 100% !important;
  table-layout: fixed !important;
}

@media (min-width: 721px) {
  [data-workspace-page="true"].store-history-page .store-history-table {
    min-width: 1220px !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table th,
  [data-workspace-page="true"].store-history-page .store-history-table td {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table th:first-child,
  [data-workspace-page="true"].store-history-page .store-history-table td:first-child {
    padding-left: 6px !important;
    padding-right: 6px !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table thead .history-table-heading,
  [data-workspace-page="true"].store-history-page .store-history-table th:not(:first-child) > .history-table-heading {
    display: flex !important;
    align-items: center;
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    transform: none !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table .history-table-heading-icon {
    width: 16px !important;
    height: 16px !important;
    flex: 0 0 16px !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table tbody td:not(:first-child):not(.store-history-actions) > * {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    transform: none !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table .store-history-owner-contact {
    display: flex;
  }

  [data-workspace-page="true"].store-history-page .store-history-table .store-history-phone {
    display: grid;
  }
}

@media (max-width: 720px) {
  [data-workspace-page="true"].store-history-page .store-history-table {
    min-width: 0 !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table th:not(:first-child) > .history-table-heading,
  [data-workspace-page="true"].store-history-page .store-history-table td:not(:first-child) > * {
    transform: none !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table thead .history-table-heading {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
}

/* The action column is part of the same table grid. It must never float over
 * the data columns: on compact workspaces the whole grid is compressed, and
 * on wide workspaces the wrapper can still scroll if the content requires it. */
[data-workspace-page="true"].store-history-page .store-history-table th[data-store-actions-heading],
[data-workspace-page="true"].store-history-page .store-history-table td.store-history-actions {
  position: static !important;
  right: auto !important;
  z-index: auto !important;
  background: inherit !important;
  box-shadow: none !important;
}

[data-workspace-page="true"].store-history-page .store-history-table th[data-store-actions-heading] {
  background: inherit !important;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-workspace-interaction="row"]:not(.store-row-flip):not(.store-row-entering):not(.store-row-entered):not(.store-row-collapsing) > td.store-history-actions {
  position: static !important;
  right: auto !important;
  z-index: auto !important;
  background: inherit !important;
  box-shadow: none !important;
}

[data-theme="dark"] [data-workspace-page="true"].store-history-page .store-history-table td.store-history-actions {
  background: inherit !important;
  box-shadow: none !important;
}

[data-theme="dark"] [data-workspace-page="true"].store-history-page .store-history-table th[data-store-actions-heading] {
  background: inherit !important;
}

[data-theme="dark"] [data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-workspace-interaction="row"]:not(.store-row-flip):not(.store-row-entering):not(.store-row-entered):not(.store-row-collapsing) > td.store-history-actions {
  background: inherit !important;
  box-shadow: none !important;
}

/* At the viewport where the navigation and organization tree already use
 * most of the width, keep all eleven columns in one visible grid. The action
 * cell gets a deliberate compact width, so its controls wrap inside the row
 * instead of forcing a second layout or covering inventory data. */
@media (min-width: 721px) and (max-width: 1800px) {
  [data-workspace-page="true"].store-history-page .store-history-table {
    min-width: 0 !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(1),
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(1),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(1) {
    width: 3.5% !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(2),
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(2),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(2) {
    width: 9.5% !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(3),
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(3),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(3) {
    width: 13% !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(4),
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(4),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(4) {
    width: 7% !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(5),
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(5),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(5) {
    width: 7.5% !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(6),
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(6),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(6) {
    width: 9% !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(7),
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(7),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(7) {
    width: 10% !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(8),
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(8),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(8) {
    width: 11% !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(9),
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(9),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(9) {
    width: 6.5% !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(10),
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(10),
  [data-workspace-page="true"].store-history-page .store-history-table td:nth-child(10) {
    width: 8% !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table col:nth-child(11),
  [data-workspace-page="true"].store-history-page .store-history-table th[data-store-actions-heading],
  [data-workspace-page="true"].store-history-page .store-history-table td.store-history-actions {
    width: 15% !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table th,
  [data-workspace-page="true"].store-history-page .store-history-table td {
    padding: 8px 6px !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table .history-table-heading {
    gap: 4px !important;
    font-size: 11px !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table .history-table-heading-icon {
    width: 14px !important;
    height: 14px !important;
    flex-basis: 14px !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table .store-history-action-group {
    gap: 4px;
  }

  [data-workspace-page="true"].store-history-page .store-history-table .store-history-action {
    padding: 5px 6px !important;
    border-radius: 6px;
    font-size: 10px !important;
    line-height: 1.2;
  }

  [data-workspace-page="true"].store-history-page .store-history-table .store-history-org-context {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* The selected agent shows chain parents first; expanded stores stay directly
 * below their parent with a restrained hierarchy guide and type badge. */
[data-workspace-page="true"].store-history-page .store-history-table .store-history-store-cell {
  position: relative;
  min-width: 0;
  padding-left: calc(var(--store-row-depth, 0) * 18px);
}

[data-workspace-page="true"].store-history-page .store-history-table .store-history-store-name {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

[data-workspace-page="true"].store-history-page .store-history-table .store-history-row-type {
  flex: 0 0 auto;
  padding: 2px 5px;
  border: 1px solid #e2ddff;
  border-radius: 4px;
  background: #f8f7ff;
  color: #6a5cdb;
  font-size: 9px;
  line-height: 14px;
  white-space: nowrap;
}

[data-workspace-page="true"].store-history-page .store-history-table .store-history-row-type--store {
  border-color: #e2e8ef;
  background: #f8fafc;
  color: #718096;
}

[data-workspace-page="true"].store-history-page .store-history-table .store-history-tree-guide {
  position: absolute;
  top: -8px;
  bottom: -8px;
  left: calc((var(--store-row-depth, 1) - 1) * 18px + 7px);
  width: 12px;
  border-left: 1px solid #dfe4ed;
}

[data-workspace-page="true"].store-history-page .store-history-table .store-history-tree-guide::after {
  position: absolute;
  top: 50%;
  left: 0;
  width: 10px;
  border-top: 1px solid #dfe4ed;
  content: '';
}

[data-workspace-page="true"].store-history-page .store-history-table .store-table-expand {
  cursor: pointer;
}

[data-workspace-page="true"].store-history-page .store-history-table .store-table-expand:hover,
[data-workspace-page="true"].store-history-page .store-history-table .store-table-expand:focus-visible {
  border-radius: 5px;
  background: #f2f0ff !important;
  color: #6255d8;
  outline: none;
}

/* Only expandable chain records are interactive rows. Stores remain flat so
 * the hierarchy is readable without making every child row look selectable. */
[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-store-expand] {
  position: relative;
  z-index: 1;
  cursor: pointer;
  transition: transform 140ms cubic-bezier(.2, .8, .2, 1), box-shadow 140ms ease !important;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-store-expand] > td {
  position: static !important;
  background: #fff !important;
  border-top: 1px solid transparent !important;
  border-bottom: 1px solid transparent !important;
  box-shadow: none !important;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-store-expand] > td:first-child {
  border-left: 1px solid transparent !important;
  border-radius: 11px 0 0 11px !important;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-store-expand] > td:last-child {
  border-right: 1px solid transparent !important;
  border-radius: 0 11px 11px 0 !important;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-store-expand]:hover,
[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-store-expand]:focus-within {
  z-index: 3 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 7px 16px rgba(91, 79, 190, .11) !important;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-store-expand]:hover > td,
[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-store-expand]:focus-within > td {
  background: #fcfbff !important;
  border-top-color: #ebe7ff !important;
  border-bottom-color: #ebe7ff !important;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-store-expand][aria-expanded="true"] {
  z-index: 2 !important;
  box-shadow: 0 4px 14px rgba(101, 86, 202, .09) !important;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-store-expand][aria-expanded="true"] > td {
  background: #faf8ff !important;
  border-top-color: #d9d2ff !important;
  border-bottom-color: #d9d2ff !important;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-store-expand][aria-expanded="true"] > td:first-child {
  border-left-color: #d9d2ff !important;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-store-expand][aria-expanded="true"] > td:last-child {
  border-right-color: #d9d2ff !important;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-store-expand][aria-expanded="true"]:hover {
  box-shadow: 0 8px 18px rgba(101, 86, 202, .13) !important;
}

@media (prefers-reduced-motion: reduce) {
  [data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-store-expand] {
    transition: none !important;
  }
}

/* The base ledger reset has intentionally high specificity. Repeat the
 * interaction state with the same row guards so this chain-only treatment
 * actually wins without changing the flat store rows. */
[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-workspace-interaction="row"][data-store-expand]:not(.store-row-flip):not(.store-row-entering):not(.store-row-entered):not(.store-row-collapsing) {
  position: relative !important;
  z-index: 1 !important;
  cursor: pointer;
  transform: none !important;
  filter: none !important;
  box-shadow: none !important;
  background: transparent !important;
  transition: transform 140ms cubic-bezier(.2, .8, .2, 1), box-shadow 140ms ease !important;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-workspace-interaction="row"][data-store-expand]:not(.store-row-flip):not(.store-row-entering):not(.store-row-entered):not(.store-row-collapsing) > td {
  position: static !important;
  background: #fff !important;
  border-top: 1px solid transparent !important;
  border-bottom: 1px solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-workspace-interaction="row"][data-store-expand]:not(.store-row-flip):not(.store-row-entering):not(.store-row-entered):not(.store-row-collapsing) > td:first-child {
  border-left: 1px solid transparent !important;
  border-radius: 11px 0 0 11px !important;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-workspace-interaction="row"][data-store-expand]:not(.store-row-flip):not(.store-row-entering):not(.store-row-entered):not(.store-row-collapsing) > td:last-child {
  border-right: 1px solid transparent !important;
  border-radius: 0 11px 11px 0 !important;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-workspace-interaction="row"][data-store-expand]:not(.store-row-flip):not(.store-row-entering):not(.store-row-entered):not(.store-row-collapsing):hover,
[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-workspace-interaction="row"][data-store-expand]:not(.store-row-flip):not(.store-row-entering):not(.store-row-entered):not(.store-row-collapsing):focus-within {
  z-index: 3 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 7px 16px rgba(91, 79, 190, .11) !important;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-workspace-interaction="row"][data-store-expand]:not(.store-row-flip):not(.store-row-entering):not(.store-row-entered):not(.store-row-collapsing):hover > td,
[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-workspace-interaction="row"][data-store-expand]:not(.store-row-flip):not(.store-row-entering):not(.store-row-entered):not(.store-row-collapsing):focus-within > td {
  background: #fcfbff !important;
  border-top-color: #ebe7ff !important;
  border-bottom-color: #ebe7ff !important;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-workspace-interaction="row"][data-store-expand][aria-expanded="true"]:not(.store-row-flip):not(.store-row-entering):not(.store-row-entered):not(.store-row-collapsing) {
  z-index: 2 !important;
  box-shadow: 0 4px 14px rgba(101, 86, 202, .09) !important;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-workspace-interaction="row"][data-store-expand][aria-expanded="true"]:not(.store-row-flip):not(.store-row-entering):not(.store-row-entered):not(.store-row-collapsing) > td {
  background: #faf8ff !important;
  border-top-color: #d9d2ff !important;
  border-bottom-color: #d9d2ff !important;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-workspace-interaction="row"][data-store-expand][aria-expanded="true"]:not(.store-row-flip):not(.store-row-entering):not(.store-row-entered):not(.store-row-collapsing) > td:first-child {
  border-left-color: #d9d2ff !important;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-workspace-interaction="row"][data-store-expand][aria-expanded="true"]:not(.store-row-flip):not(.store-row-entering):not(.store-row-entered):not(.store-row-collapsing) > td:last-child {
  border-right-color: #d9d2ff !important;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-workspace-interaction="row"][data-store-expand][aria-expanded="true"]:not(.store-row-flip):not(.store-row-entering):not(.store-row-entered):not(.store-row-collapsing):hover {
  box-shadow: 0 8px 18px rgba(101, 86, 202, .13) !important;
}

/* Keep the invite heading, chain rows, and expanded store rows on one shared
 * left axis. Expanded stores use the guide as decoration only; it must not
 * move the store name or any other cell value. */
@media (min-width: 721px) {
  [data-workspace-page="true"].store-history-page .store-history-table th:nth-child(4) > .history-table-heading,
  [data-workspace-page="true"].store-history-page .store-history-table tbody td:nth-child(4):not(.store-history-actions) > .store-history-invite-cell {
    transform: none !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table .store-history-store-cell {
    padding-left: 0 !important;
  }

  [data-workspace-page="true"].store-history-page .store-history-table .store-history-tree-guide {
    left: -9px !important;
  }
}

/* Keep the expanded records aligned without drawing a tree connector. */
[data-workspace-page="true"].store-history-page .store-history-tree-guide,
[data-workspace-page="true"].store-history-page .store-history-tree-guide::after {
  display: none !important;
  content: none !important;
}

/* Reuse Formula History's opened-record option frame for chain rows. The
 * shared detail-open state keeps the same stacking, white surface, half-pixel
 * purple inset, and 8px outer corners; child store rows remain untouched. */
[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-workspace-interaction="row"][data-store-expand].detail-open:not(.store-row-flip):not(.store-row-entering):not(.store-row-entered):not(.store-row-collapsing) {
  position: relative !important;
  z-index: 8 !important;
  transform: translateZ(0) !important;
  filter: drop-shadow(0 4px 9px rgba(104, 93, 187, .05)) !important;
  box-shadow: none !important;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-workspace-interaction="row"][data-store-expand].detail-open:not(.store-row-flip):not(.store-row-entering):not(.store-row-entered):not(.store-row-collapsing) > td {
  position: relative !important;
  z-index: 9 !important;
  background: #fff !important;
  border-top: 0 !important;
  border-bottom: 1px solid #f0f2f6 !important;
  box-shadow: inset 0 .5px 0 rgba(133, 121, 232, .38), inset 0 -.5px 0 rgba(133, 121, 232, .38) !important;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-workspace-interaction="row"][data-store-expand].detail-open:not(.store-row-flip):not(.store-row-entering):not(.store-row-entered):not(.store-row-collapsing) > td:first-child {
  border-radius: 8px 0 0 8px !important;
  box-shadow: inset .5px 0 0 rgba(133, 121, 232, .38), inset 0 .5px 0 rgba(133, 121, 232, .38), inset 0 -.5px 0 rgba(133, 121, 232, .38) !important;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-workspace-interaction="row"][data-store-expand].detail-open:not(.store-row-flip):not(.store-row-entering):not(.store-row-entered):not(.store-row-collapsing) > td:last-child {
  border-radius: 0 8px 8px 0 !important;
  box-shadow: inset -.5px 0 0 rgba(133, 121, 232, .38), inset 0 .5px 0 rgba(133, 121, 232, .38), inset 0 -.5px 0 rgba(133, 121, 232, .38) !important;
}

body[data-theme="dark"] [data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-workspace-interaction="row"][data-store-expand].detail-open:not(.store-row-flip):not(.store-row-entering):not(.store-row-entered):not(.store-row-collapsing) > td {
  background: #000 !important;
}

/* The previous chain-hover rule is more specific than the shared frame. Keep
 * an opened row on Formula History's neutral shadow even while the pointer is
 * still over the clicked record. */
[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-workspace-interaction="row"][data-store-expand].detail-open:hover:not(.store-row-flip):not(.store-row-entering):not(.store-row-entered):not(.store-row-collapsing) {
  box-shadow: none !important;
}

/* Hover keeps the lift, but the record surface stays white. Only the purple
 * inset outline communicates the interaction; no lavender fill is used. */
[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-workspace-interaction="row"][data-store-expand]:not(.detail-open):not(.store-row-flip):not(.store-row-entering):not(.store-row-entered):not(.store-row-collapsing):is(:hover, :focus-within) > td {
  position: relative !important;
  z-index: 3 !important;
  background: #fff !important;
  border-top: 0 !important;
  border-bottom: 1px solid #f0f2f6 !important;
  box-shadow: inset 0 1px 0 #a49def, inset 0 -1px 0 #a49def !important;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-workspace-interaction="row"][data-store-expand]:not(.detail-open):not(.store-row-flip):not(.store-row-entering):not(.store-row-entered):not(.store-row-collapsing):is(:hover, :focus-within) > td:first-child {
  border-radius: 8px 0 0 8px !important;
  box-shadow: inset 1px 0 0 #a49def, inset 0 1px 0 #a49def, inset 0 -1px 0 #a49def !important;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-workspace-interaction="row"][data-store-expand]:not(.detail-open):not(.store-row-flip):not(.store-row-entering):not(.store-row-entered):not(.store-row-collapsing):is(:hover, :focus-within) > td:last-child {
  border-radius: 0 8px 8px 0 !important;
  box-shadow: inset -1px 0 0 #a49def, inset 0 1px 0 #a49def, inset 0 -1px 0 #a49def !important;
}

/* Keep the lifted top outline in a separate paint band below the sticky
 * heading, and give the runtime action heading the same surface as its peers. */
@media (min-width: 721px) {
  [data-workspace-page="true"].store-history-page .store-history-table tbody {
    transform: translateY(3px) !important;
  }
}

[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-workspace-interaction="row"][data-store-expand]:not(.detail-open):not(.store-row-flip):not(.store-row-entering):not(.store-row-entered):not(.store-row-collapsing):is(:hover, :focus-within) {
  z-index: 8 !important;
}

[data-workspace-page="true"].store-history-page .store-history-table tbody > tr[data-workspace-interaction="row"][data-store-expand]:not(.detail-open):not(.store-row-flip):not(.store-row-entering):not(.store-row-entered):not(.store-row-collapsing):is(:hover, :focus-within) > td {
  z-index: 9 !important;
}

[data-workspace-page="true"].store-history-page .store-history-table thead th[data-store-actions-heading] {
  background: #fafbfc !important;
}

body[data-theme="dark"] [data-workspace-page="true"].store-history-page .store-history-table thead th[data-store-actions-heading] {
  background: #1b2432 !important;
}

/* The agent delete control sits under the collapse control in the narrow tree
 * header. Let its label keep one line instead of inheriting the table action
 * wrapping rules. */
body[data-active-page="organization"] .history-store-org .history-org-actions .store-history-action--delete-agent {
  width: max-content !important;
  min-width: max-content !important;
  max-width: none !important;
  white-space: nowrap !important;
  overflow-wrap: normal !important;
  word-break: keep-all !important;
}

/* Keep the two organization-header controls on the same vertical axis. The
 * delete control used to be absolutely positioned and sized from its label,
 * which made its right edge drift away from the collapse control. */
body[data-active-page="organization"] .history-store-org .history-org-head.has-agent-delete {
  margin-bottom: 50px !important;
}

body[data-active-page="organization"] .history-store-org .history-org-head.has-agent-delete .history-org-actions {
  align-items: flex-end !important;
  gap: 6px !important;
}

body[data-active-page="organization"] .history-store-org .history-org-head.has-agent-delete .history-org-actions .store-history-action--delete-agent {
  position: absolute !important;
  top: calc(100% + 6px) !important;
  right: -4px !important;
  bottom: auto !important;
  left: auto !important;
  margin-right: 4px !important;
}

/* Keep the store ledger compact at a readable one-step scale.  This only
 * changes row typography; column widths, row geometry, headers, and action
 * hit areas remain unchanged. */
[data-workspace-page="true"].store-history-page .store-history-table tbody > tr > td {
  font-size: 12px !important;
}

[data-workspace-page="true"].store-history-page .store-history-table .history-record-date,
[data-workspace-page="true"].store-history-page .store-history-table .history-record-time,
[data-workspace-page="true"].store-history-page .store-history-table .store-history-org-context,
[data-workspace-page="true"].store-history-page .store-history-table .store-history-phone {
  font-size: 10px !important;
}

[data-workspace-page="true"].store-history-page .store-history-table .store-history-invite-code,
[data-workspace-page="true"].store-history-page .store-history-table .store-history-invite-empty,
[data-workspace-page="true"].store-history-page .store-history-table .store-history-owner,
[data-workspace-page="true"].store-history-page .store-history-table .store-history-phone-empty {
  font-size: 11px !important;
}

[data-workspace-page="true"].store-history-page .store-history-table .history-customer-cell,
[data-workspace-page="true"].store-history-page .store-history-table .history-device-code,
[data-workspace-page="true"].store-history-page .store-history-table .history-inventory-code {
  font-size: 13px !important;
}

[data-workspace-page="true"].store-history-page .store-history-table .history-formula-cell,
[data-workspace-page="true"].store-history-page .store-history-table .history-formula-cell strong,
[data-workspace-page="true"].store-history-page .store-history-table .history-formula-cell small {
  font-size: 10px !important;
}

[data-workspace-page="true"].store-history-page .store-history-table .store-history-action {
  font-size: 9px !important;
}

/* Shared organization-tree contract for non-store-management pages.
 *
 * The inventory tree is the reference geometry: a 240px desktop rail, 38px
 * search control, 54px row rhythm, 30px icon track, and 12/10px node copy.
 * Keep every selector behind its active-page guard so the Store Management
 * implementation remains completely outside this reuse contract.
 */
body[data-active-page="history"] .history-page .history-workspace,
body[data-active-page="permissions"] .permission-history-page .permission-history-workspace,
body[data-active-page="devices"] .device-ops-page.device-history-page .device-history-workspace {
  grid-template-columns: 240px minmax(0, 1fr) !important;
  gap: 0 !important;
}

/* Inventory and device workspaces keep a visible breathing space after the
 * organization divider. Customer Archive intentionally keeps a separate
 * zero-gap state and is not included here. */
body[data-active-page="devices"] .device-ops-page.device-history-page .device-history-workspace {
  column-gap: 16px !important;
  row-gap: 0 !important;
}

body[data-active-page="inventory"] .inventory-ops-page .inventory-directory-layout {
  column-gap: 16px !important;
}

body[data-active-page="customers"] .customer-org-page .customer-org-layout {
  /* Keep the three named areas in sync with ui-recovery.css. The detail
   * track is zero-width until a customer is opened, so the directory can
   * occupy the full remaining workspace without an implicit blank column. */
  grid-template-areas: "sidebar list detail" !important;
  grid-template-columns: var(--customer-sidebar-width) minmax(0, 1fr) 0 !important;
  column-gap: 0 !important;
  row-gap: 0 !important;
}

body[data-active-page="customers"] .customer-org-page .customer-org-layout.is-sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr) 0 !important;
  column-gap: 0 !important;
}

body[data-active-page="customers"] .customer-org-page .customer-org-layout.is-list-shifted {
  grid-template-columns: var(--customer-sidebar-folded-width) minmax(0, 1fr) var(--customer-detail-width) !important;
  column-gap: 16px !important;
}

body[data-active-page="history"] .history-store-org,
body[data-active-page="permissions"] .permission-org-panel,
body[data-active-page="customers"] .customer-org-tree {
  box-sizing: border-box;
  font-family: var(--font-ui) !important;
}

body[data-active-page="customers"] .customer-org-tree {
  padding: clamp(14px, 1.15vw, 18px) !important;
}

body[data-active-page="devices"] .device-history-org-panel,
body[data-active-page="inventory"] .inventory-org-panel {
  box-sizing: border-box;
  padding: 0 !important;
  font-family: var(--font-ui) !important;
}

body[data-active-page="history"] .history-store-org .history-org-head,
body[data-active-page="permissions"] .permission-org-panel .history-org-head,
body[data-active-page="customers"] .customer-org-tree .org-tree-head,
body[data-active-page="devices"] .device-history-org-panel .device-org-head,
body[data-active-page="inventory"] .inventory-org-head {
  min-height: 31px !important;
  margin-bottom: 12px !important;
  padding: 0 !important;
  border: 0 !important;
  align-items: center !important;
}

body[data-active-page="devices"] .device-history-org-panel .device-org-head,
body[data-active-page="inventory"] .inventory-org-head {
  padding-top: 16px !important;
  padding-right: 12px !important;
  padding-left: 12px !important;
}

body[data-active-page="history"] .history-store-org .history-org-head h3,
body[data-active-page="permissions"] .permission-org-panel .history-org-head h3,
body[data-active-page="customers"] .customer-org-tree .org-tree-head h3,
body[data-active-page="devices"] .device-history-org-panel .device-org-head h3,
body[data-active-page="inventory"] .inventory-org-head h3 {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 !important;
  color: #202a3c !important;
  font-size: 15px !important;
  font-weight: 650 !important;
  line-height: 19px !important;
  letter-spacing: 0 !important;
  text-shadow: none !important;
}

body[data-active-page="history"] .history-store-org .history-org-head h3::before,
body[data-active-page="permissions"] .permission-org-panel .history-org-head h3::before,
body[data-active-page="customers"] .customer-org-tree .org-tree-head h3::before,
body[data-active-page="devices"] .device-history-org-panel .device-org-head h3::before,
body[data-active-page="inventory"] .inventory-org-head h3::before {
  content: "" !important;
  display: block !important;
  width: 19px !important;
  height: 19px !important;
  flex: 0 0 19px !important;
  margin: 0 !important;
  background: #2c2c2c !important;
  -webkit-mask: url("../assets/icons/organization-structure.svg?v=3") center / contain no-repeat !important;
  mask: url("../assets/icons/organization-structure.svg?v=3") center / contain no-repeat !important;
}

body[data-active-page="history"] .history-store-org .history-org-head small,
body[data-active-page="permissions"] .permission-org-panel .history-org-head small,
body[data-active-page="customers"] .customer-org-tree .org-tree-head small,
body[data-active-page="devices"] .device-history-org-panel .device-org-head small,
body[data-active-page="inventory"] .inventory-org-head small {
  margin-top: 5px !important;
  color: #929cac !important;
  font-size: 10px !important;
  font-weight: 400 !important;
  line-height: 15px !important;
}

body[data-theme="dark"][data-active-page="history"] .history-store-org .history-org-head h3::before,
body[data-theme="dark"][data-active-page="permissions"] .permission-org-panel .history-org-head h3::before,
body[data-theme="dark"][data-active-page="customers"] .customer-org-tree .org-tree-head h3::before,
body[data-theme="dark"][data-active-page="devices"] .device-history-org-panel .device-org-head h3::before,
body[data-theme="dark"][data-active-page="inventory"] .inventory-org-head h3::before {
  background: #f4f7fd !important;
}

body[data-active-page="history"] .history-store-org .history-org-actions button,
body[data-active-page="permissions"] .permission-org-panel .history-org-actions button,
body[data-active-page="customers"] .customer-org-tree .org-tree-head button,
body[data-active-page="devices"] .device-history-org-panel .device-org-head button,
body[data-active-page="inventory"] .inventory-org-head button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  min-width: 62px !important;
  width: auto !important;
  height: 31px !important;
  min-height: 31px !important;
  padding: 0 8px !important;
  border: 1px solid var(--line) !important;
  border-radius: 7px !important;
  background: #fff !important;
  box-shadow: none !important;
  color: #687386 !important;
  font-family: var(--font-ui) !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  line-height: 16px !important;
  letter-spacing: 0 !important;
  white-space: nowrap !important;
  font-synthesis: none !important;
}

body[data-active-page="history"] .history-store-org .history-org-search,
body[data-active-page="permissions"] .permission-org-panel .history-org-search,
body[data-active-page="customers"] .customer-org-tree .org-tree-search,
body[data-active-page="devices"] .device-history-org-panel .device-org-search,
body[data-active-page="inventory"] .inventory-org-search {
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  height: 38px !important;
  min-height: 38px !important;
  border-radius: 8px !important;
  padding: 0 10px !important;
  gap: 7px !important;
}

body[data-active-page="history"] .history-store-org .history-org-search,
body[data-active-page="permissions"] .permission-org-panel .history-org-search,
body[data-active-page="customers"] .customer-org-tree .org-tree-search {
  margin: 0 0 8px !important;
}

body[data-active-page="devices"] .device-history-org-panel .device-org-search,
body[data-active-page="inventory"] .inventory-org-search {
  margin: 12px !important;
}

body[data-active-page="history"] .history-store-org .history-org-search input,
body[data-active-page="permissions"] .permission-org-panel .history-org-search input,
body[data-active-page="customers"] .customer-org-tree .org-tree-search input,
body[data-active-page="devices"] .device-history-org-panel .device-org-search input,
body[data-active-page="inventory"] .inventory-org-search input {
  box-sizing: border-box !important;
  height: 36px !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  color: #435067 !important;
  font-family: var(--font-ui) !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 18px !important;
  letter-spacing: 0 !important;
}

body[data-active-page="history"] .history-store-org .history-org-tree,
body[data-active-page="permissions"] .permission-org-panel .history-org-tree,
body[data-active-page="customers"] .customer-org-tree .org-tree-list,
body[data-active-page="devices"] .device-history-org-panel .device-org-tree,
body[data-active-page="inventory"] .inventory-org-tree {
  max-height: min(620px, calc(100dvh - 300px)) !important;
}

body[data-active-page="history"] .history-store-org .history-org-node,
body[data-active-page="permissions"] .permission-org-panel .history-org-node,
body[data-active-page="customers"] .customer-org-tree .org-tree-row,
body[data-active-page="devices"] .device-history-org-panel .device-org-row,
body[data-active-page="inventory"] .inventory-org-row {
  box-sizing: border-box !important;
  min-height: 54px !important;
  gap: 8px !important;
  margin: 3px 0 !important;
  padding: 9px 7px !important;
  border-radius: 8px !important;
}

body[data-active-page="history"] .history-store-org .history-org-node.depth-1,
body[data-active-page="permissions"] .permission-org-panel .history-org-node.depth-1,
body[data-active-page="customers"] .customer-org-tree .org-tree-row.depth-1 {
  padding-left: 25px !important;
}

body[data-active-page="history"] .history-store-org .history-org-node.depth-2,
body[data-active-page="permissions"] .permission-org-panel .history-org-node.depth-2,
body[data-active-page="customers"] .customer-org-tree .org-tree-row.depth-2 {
  padding-left: 43px !important;
}

body[data-active-page="history"] .history-store-org .history-org-node.depth-3,
body[data-active-page="permissions"] .permission-org-panel .history-org-node.depth-3,
body[data-active-page="customers"] .customer-org-tree .org-tree-row.depth-3 {
  padding-left: 61px !important;
}

body[data-active-page="history"] .history-store-org .history-org-node.depth-4,
body[data-active-page="permissions"] .permission-org-panel .history-org-node.depth-4,
body[data-active-page="customers"] .customer-org-tree .org-tree-row.depth-4 {
  padding-left: 79px !important;
}

body[data-active-page="devices"] .device-history-org-panel .device-org-row,
body[data-active-page="inventory"] .inventory-org-row {
  padding-left: calc(7px + var(--org-depth, 0) * 18px) !important;
  grid-template-columns: 12px 30px minmax(0, 1fr) auto !important;
}

body[data-active-page="history"] .history-store-org .history-org-arrow,
body[data-active-page="permissions"] .permission-org-panel .history-org-arrow,
body[data-active-page="customers"] .customer-org-tree .org-toggle,
body[data-active-page="devices"] .device-history-org-panel .device-org-toggle,
body[data-active-page="inventory"] .inventory-org-toggle {
  width: 12px !important;
  flex: 0 0 12px !important;
  font-size: 17px !important;
  line-height: 12px !important;
}

body[data-active-page="history"] .history-store-org .history-org-icon,
body[data-active-page="permissions"] .permission-org-panel .history-org-icon,
body[data-active-page="customers"] .customer-org-tree .org-node-icon,
body[data-active-page="devices"] .device-history-org-panel .device-org-icon,
body[data-active-page="inventory"] .inventory-org-icon {
  box-sizing: border-box !important;
  width: 30px !important;
  height: 30px !important;
  flex: 0 0 30px !important;
  border-radius: 7px !important;
}

/* Agent rows use the same crown artwork as Inventory. Inventory emits this
 * node as .headquarters, while the other trees emit .agent. */
body[data-active-page="history"] .history-store-org .history-org-icon:is(.agent, .headquarters),
body[data-active-page="permissions"] .permission-org-panel .history-org-icon:is(.agent, .headquarters),
body[data-active-page="customers"] .customer-org-tree .org-node-icon:is(.agent, .headquarters),
body[data-active-page="devices"] .device-history-org-panel .device-org-icon:is(.agent, .headquarters),
body[data-active-page="inventory"] .inventory-org-icon:is(.agent, .headquarters) {
  width: 24px !important;
  height: 24px !important;
  flex-basis: 24px !important;
  align-self: flex-start !important;
  margin-top: -2px !important;
  border-radius: 0 !important;
  background: #2c2c2c !important;
  color: #2c2c2c !important;
  -webkit-mask: url("../assets/icons/organization-headquarters.svg?v=1") center / contain no-repeat !important;
  mask: url("../assets/icons/organization-headquarters.svg?v=1") center / contain no-repeat !important;
  font-size: 0 !important;
}

body[data-active-page="history"] .history-store-org .history-org-icon:is(.agent, .headquarters)::before,
body[data-active-page="history"] .history-store-org .history-org-icon:is(.agent, .headquarters)::after,
body[data-active-page="permissions"] .permission-org-panel .history-org-icon:is(.agent, .headquarters)::before,
body[data-active-page="permissions"] .permission-org-panel .history-org-icon:is(.agent, .headquarters)::after,
body[data-active-page="customers"] .customer-org-tree .org-node-icon:is(.agent, .headquarters)::before,
body[data-active-page="customers"] .customer-org-tree .org-node-icon:is(.agent, .headquarters)::after,
body[data-active-page="devices"] .device-history-org-panel .device-org-icon:is(.agent, .headquarters)::before,
body[data-active-page="devices"] .device-history-org-panel .device-org-icon:is(.agent, .headquarters)::after,
body[data-active-page="inventory"] .inventory-org-icon:is(.agent, .headquarters)::before,
body[data-active-page="inventory"] .inventory-org-icon:is(.agent, .headquarters)::after {
  content: none !important;
  display: none !important;
}

body[data-active-page="history"] .history-store-org .history-org-name strong,
body[data-active-page="permissions"] .permission-org-panel .history-org-name strong,
body[data-active-page="customers"] .customer-org-tree .org-tree-name strong,
body[data-active-page="devices"] .device-history-org-panel .device-org-name strong,
body[data-active-page="inventory"] .inventory-org-node strong {
  font-family: var(--font-ui) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 18px !important;
}

body[data-active-page="history"] .history-store-org .history-org-name small,
body[data-active-page="permissions"] .permission-org-panel .history-org-name small,
body[data-active-page="customers"] .customer-org-tree .org-tree-name small,
body[data-active-page="devices"] .device-history-org-panel .device-org-name small,
body[data-active-page="inventory"] .inventory-org-node small {
  margin-top: 2px !important;
  font-family: var(--font-ui) !important;
  font-size: 10px !important;
  font-weight: 400 !important;
  line-height: 15px !important;
}

body[data-active-page="history"] .history-store-org .history-org-node em,
body[data-active-page="permissions"] .permission-org-panel .history-org-node em,
body[data-active-page="customers"] .customer-org-tree .org-tree-row em,
body[data-active-page="devices"] .device-history-org-panel .device-org-row em,
body[data-active-page="inventory"] .inventory-org-row em {
  font-size: 10px !important;
  font-weight: 400 !important;
}

/* Customer Archive does not show the organization-node total in the tree
 * heading; nudge its plain search placeholder slightly away from the edge. */
body[data-active-page="customers"] .customer-org-tree .org-tree-head small {
  display: none !important;
}

body[data-active-page="customers"] .customer-org-tree .org-tree-search input {
  padding-left: 4px !important;
}

@media (max-width: 900px) {
  body[data-active-page="history"] .history-page .history-workspace,
  body[data-active-page="permissions"] .permission-history-page .permission-history-workspace,
  body[data-active-page="devices"] .device-ops-page.device-history-page .device-history-workspace,
  body[data-active-page="customers"] .customer-org-page .customer-org-layout {
    grid-template-columns: 1fr !important;
  }

  body[data-active-page="history"] .history-store-org .history-org-tree,
  body[data-active-page="permissions"] .permission-org-panel .history-org-tree,
  body[data-active-page="customers"] .customer-org-tree .org-tree-list,
  body[data-active-page="devices"] .device-history-org-panel .device-org-tree,
  body[data-active-page="inventory"] .inventory-org-tree {
    max-height: 360px !important;
  }
}

@media (max-width: 1080px) {
  body[data-active-page="customers"] .customer-org-page .customer-org-layout {
    grid-template-columns: 1fr !important;
  }
}

/* Device table bands must reach the organization rail. This override lives
 * after the shared device column-gap contract so it cannot be reset by the
 * later-loaded workspace layout rules. The 16px main inset preserves the
 * existing filter/KPI/tab geometry while the table wrapper uses that space to
 * meet the organization divider. */
@media (min-width: 901px) {
  body[data-active-page="devices"] .device-ops-page.device-history-page .device-history-workspace {
    column-gap: 0 !important;
  }

  body[data-active-page="devices"] .device-ops-page.device-history-page .device-history-main {
    box-sizing: border-box;
    padding-left: 16px !important;
  }

  body[data-active-page="devices"] .device-ops-page.device-history-page .device-history-panel > [data-device-tab-panel="devices"] > .device-history-table-wrap {
    left: 0 !important;
    width: calc(100% + 40px) !important;
    margin-left: -16px !important;
    margin-right: -24px !important;
  }
}
