/*
  Bootstrap integration bridge.
  Bootstrap 5.3.3 is loaded before the existing Spark stylesheet. This file adds
  Spark-branded Bootstrap helper classes without replacing the custom app UI.
*/

:root {
  --bs-body-font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bs-body-color: var(--ink, #10131f);
  --bs-body-bg: var(--surface-soft, #f6f8fb);
  --bs-border-color: var(--line, #dde3ea);
  --bs-border-radius: var(--radius, 8px);
  --bs-border-radius-lg: 16px;
  --bs-border-radius-xl: 22px;
  --spark-gradient: linear-gradient(135deg, var(--blue, #4361ee), var(--pink, #f72585) 54%, var(--coral, #fb7756));
  --spark-text: var(--ink, #10131f);
  --spark-muted: var(--muted, #667085);
  --spark-border: var(--line, #dde3ea);
  --spark-surface: var(--surface, #ffffff);
  --spark-soft: var(--surface-soft, #f6f8fb);
  --spark-success: #047857;
  --spark-success-bg: #dcfce7;
  --spark-warning: #92400e;
  --spark-warning-bg: #fef3c7;
  --spark-danger: #991b1b;
  --spark-danger-bg: #fee2e2;
}

.btn-spark-primary,
.btn-spark-secondary {
  --bs-btn-padding-x: 1rem;
  --bs-btn-padding-y: .72rem;
  --bs-btn-border-radius: 14px;
  --bs-btn-font-weight: 900;
  min-height: 44px;
  border-width: 1px;
  box-shadow: 0 16px 32px rgba(247, 37, 133, .18);
}

.btn-spark-primary {
  --bs-btn-color: #ffffff;
  --bs-btn-bg: transparent;
  --bs-btn-border-color: transparent;
  --bs-btn-hover-color: #ffffff;
  --bs-btn-hover-bg: transparent;
  --bs-btn-hover-border-color: transparent;
  --bs-btn-active-color: #ffffff;
  --bs-btn-active-bg: transparent;
  --bs-btn-active-border-color: transparent;
  background: var(--spark-gradient);
}

.btn-spark-primary:hover,
.btn-spark-primary:focus-visible {
  filter: saturate(1.08) brightness(1.01);
  transform: translateY(-1px);
}

.btn-spark-secondary {
  --bs-btn-color: var(--spark-text);
  --bs-btn-bg: #ffffff;
  --bs-btn-border-color: var(--spark-border);
  --bs-btn-hover-color: var(--spark-text);
  --bs-btn-hover-bg: #f8fafc;
  --bs-btn-hover-border-color: #cfd8e6;
  --bs-btn-active-color: var(--spark-text);
  --bs-btn-active-bg: #eef2f7;
  --bs-btn-active-border-color: #cfd8e6;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.btn-spark-primary:disabled,
.btn-spark-secondary:disabled,
.btn-spark-primary[aria-disabled="true"],
.btn-spark-secondary[aria-disabled="true"] {
  opacity: .62;
  transform: none;
  box-shadow: none;
  cursor: not-allowed;
}

.badge-spark-success,
.badge-spark-warning,
.badge-spark-danger {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: .35rem .7rem;
  font-weight: 900;
  line-height: 1;
}

.badge-spark-success {
  background: var(--spark-success-bg);
  color: var(--spark-success);
}

.badge-spark-warning {
  background: var(--spark-warning-bg);
  color: var(--spark-warning);
}

.badge-spark-danger {
  background: var(--spark-danger-bg);
  color: var(--spark-danger);
}

.card-spark,
.surface-spark,
.shell-spark {
  border: 1px solid var(--spark-border);
  background: var(--spark-surface);
  color: var(--spark-text);
  box-shadow: 0 18px 42px rgba(15, 23, 42, .07);
}

.card-spark {
  border-radius: 22px;
  padding: 1.25rem;
}

.surface-spark {
  border-radius: 18px;
  padding: 1rem;
}

.shell-spark {
  border-radius: 28px;
  padding: clamp(1rem, 2vw, 1.75rem);
}

.nav-spark {
  --bs-nav-link-color: var(--spark-muted);
  --bs-nav-link-hover-color: var(--pink, #f72585);
  --bs-nav-pills-link-active-color: var(--pink, #f72585);
  --bs-nav-pills-link-active-bg: #fff1f7;
  gap: .35rem;
}

.nav-spark .nav-link {
  border-radius: 14px;
  font-weight: 900;
}

.form-spark .form-label {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
  color: #344054;
  font-weight: 900;
}

.form-spark .required-mark,
.form-spark .optional-mark {
  display: inline-flex !important;
  width: max-content !important;
  max-width: max-content;
  margin-left: 0;
  white-space: nowrap;
}

.form-spark .form-control,
.form-spark .form-select {
  min-height: 48px;
  border-color: var(--spark-border);
  border-radius: 14px;
  color: var(--spark-text);
  font-weight: 750;
  font-size: 16px;
  background-color: #ffffff;
}

.form-spark .form-control:focus,
.form-spark .form-select:focus {
  border-color: color-mix(in srgb, var(--pink, #f72585) 56%, var(--spark-border));
  box-shadow: 0 0 0 .22rem rgba(247, 37, 133, .12);
}

.form-spark textarea.form-control {
  min-height: 140px;
  resize: vertical;
}

.form-spark .input-group .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.form-spark .input-group .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  box-shadow: none;
}

.form-spark .form-control[type="file"] {
  padding: .72rem .9rem;
  line-height: 1.4;
}

.form-spark .form-control[type="file"]::file-selector-button {
  border: 0;
  border-radius: 10px;
  margin-right: .75rem;
  padding: .48rem .75rem;
  background: #fff1f7;
  color: var(--pink, #f72585);
  font-weight: 900;
}

.form-spark .form-check {
  margin: 0;
  min-height: 44px;
  padding-left: 0;
}

.form-spark .form-check-input {
  width: 1.12rem;
  height: 1.12rem;
  margin-top: .18rem;
  margin-left: 0;
  border-color: var(--spark-border);
}

.form-spark .form-check-input:checked {
  background-color: var(--pink, #f72585);
  border-color: var(--pink, #f72585);
}

.form-spark .form-check-input:focus {
  border-color: color-mix(in srgb, var(--pink, #f72585) 56%, var(--spark-border));
  box-shadow: 0 0 0 .22rem rgba(247, 37, 133, .12);
}

.form-spark .form-text {
  color: var(--spark-muted);
  font-weight: 750;
}

.form-spark .invalid-feedback,
.form-spark .invalid-feedback.d-block {
  color: var(--spark-danger);
  font-weight: 850;
  margin-top: .35rem;
}

.form-spark .invalid-feedback[data-state="loading"],
.form-spark .form-text[data-state="loading"] {
  color: var(--spark-muted);
}

.form-spark .invalid-feedback[data-state="success"],
.form-spark .form-text[data-state="success"] {
  color: var(--spark-success);
}

.form-spark .invalid-feedback[data-state="error"],
.form-spark .form-text[data-state="error"] {
  color: var(--spark-danger);
}

.form-spark.was-validated .form-control:invalid,
.form-spark.was-validated .form-select:invalid,
.form-spark .form-control.is-invalid,
.form-spark .form-select.is-invalid {
  border-color: var(--spark-danger);
  box-shadow: 0 0 0 .18rem rgba(153, 27, 27, .08);
}

.form-spark.was-validated .form-control:valid,
.form-spark.was-validated .form-select:valid,
.form-spark .form-control.is-valid,
.form-spark .form-select.is-valid {
  border-color: color-mix(in srgb, var(--spark-success) 42%, var(--spark-border));
}

/* Part 5 admin bridge: Bootstrap table/form primitives, Spark presentation. */
.spark-catalog-layout {
  align-items: start;
}

.spark-editor-drawer,
.spark-product-editor,
.spark-product-editor section,
.spark-product-editor label,
.spark-product-editor .form-control,
.spark-product-editor .form-select,
.spark-product-editor .input-group,
.spark-product-editor .spark-form-grid,
.spark-product-editor .spark-choice-grid,
.spark-product-editor .spark-derived-status-grid,
.spark-product-editor .spark-simple-unit-list,
.spark-product-editor .spark-simple-unit {
  min-width: 0;
  max-width: 100%;
}

.spark-product-editor {
  overflow-x: hidden;
  container: spark-product-editor / inline-size;
}

.spark-product-editor .form-control,
.spark-product-editor .form-select {
  width: 100%;
}

.spark-product-editor [data-admin-product-sku],
.spark-editor-head p {
  overflow-wrap: anywhere;
}

.spark-editor-head p {
  margin-bottom: 0;
}

.table-spark {
  width: 100%;
  max-width: 100%;
  overflow-x: auto !important;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.table-spark .spark-product-head,
.table-spark .spark-product-row {
  width: max(100%, 820px);
  grid-template-columns: 28px minmax(260px, 1.4fr) minmax(92px, .45fr) minmax(136px, .55fr) minmax(112px, .45fr) 40px;
}

.table-spark .spark-orders-head,
.table-spark .spark-order-row {
  width: max(100%, 860px);
}

.table-spark.customer-table .spark-product-head,
.table-spark .spark-customer-row,
.table-spark.spark-document-table .spark-product-head,
.table-spark .spark-document-row {
  width: max(100%, 760px);
}

.table-spark .spark-product-cell,
.table-spark .spark-stock-cell,
.table-spark .spark-visible,
.table-spark .spark-product-cell > *,
.table-spark .spark-customer-row > *,
.table-spark .spark-document-row > *,
.table-spark .spark-order-row > * {
  min-width: 0;
}

.table-spark .spark-product-cell strong,
.table-spark .spark-product-cell small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-spark .spark-product-cell strong,
.table-spark .spark-visible,
.table-spark .spark-status {
  line-height: 1.25;
}

.table-spark .spark-visible {
  white-space: nowrap;
}

.table-spark strong,
.table-spark small,
.table-spark span,
.table-spark em {
  overflow-wrap: anywhere;
}

.table-spark .spark-status {
  max-width: 100%;
  white-space: normal;
}

.spark-wide-search.form-spark .form-control,
.spark-order-toolbar.form-spark label .form-control {
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-weight: inherit;
}

.spark-order-toolbar.form-spark .form-select {
  min-height: 48px;
  border-radius: 8px;
}

.spark-catalog-filter-panel.row {
  margin-right: 0;
  margin-left: 0;
}

.spark-catalog-filter-panel.row > * {
  width: auto;
  padding-right: 0;
  padding-left: 0;
}

.currency-input.input-group {
  flex-wrap: nowrap;
  width: 100%;
}

.currency-input.input-group .input-group-text {
  min-height: 42px;
  border: 0;
  background: transparent;
  color: var(--spark-muted);
  font-weight: 950;
}

.form-spark .currency-input.input-group .form-control {
  min-height: 40px;
  border: 0;
  border-radius: 0 var(--radius, 8px) var(--radius, 8px) 0;
  padding-left: 7px;
  box-shadow: none;
}

.form-spark .currency-input.input-group .form-control:focus {
  box-shadow: none;
}

.form-spark .spark-choice.form-check,
.form-spark .checkbox-label.form-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  column-gap: .6rem;
}

.form-spark .spark-choice.form-check {
  overflow: visible;
}

.form-spark .spark-choice.form-check > * {
  min-width: 0;
}

.form-spark .spark-choice.form-check small {
  display: block;
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.35;
}

.spark-catalog-main .spark-page-title > div,
.spark-mobile-catalog-screen .spark-page-title > div {
  flex: 0 0 auto;
}

.spark-catalog-main .spark-page-title h1,
.spark-mobile-catalog-screen .spark-page-title h1 {
  width: max-content;
  white-space: nowrap !important;
}

.spark-work-tabs.d-flex,
.spark-work-filters.d-flex {
  max-width: 100%;
}

.spark-work-tabs.d-flex > button,
.spark-work-filters.d-flex > button {
  flex: 0 0 auto;
}

@container spark-product-editor (max-width: 520px) {
  .spark-product-editor .spark-form-grid.two,
  .spark-product-editor .spark-choice-grid,
  .spark-product-editor .spark-derived-status-grid {
    grid-template-columns: 1fr;
  }

  .spark-product-editor .spark-choice.form-check {
    padding: 13px 14px;
  }
}

@media (min-width: 1541px) {
  .spark-catalog-layout {
    grid-template-columns: minmax(820px, 1fr) minmax(500px, 540px);
  }
}

@media (min-width: 1181px) and (max-width: 1540px) {
  .spark-catalog-layout {
    grid-template-columns: minmax(0, 1fr) minmax(390px, 430px);
  }

  .spark-editor-drawer .spark-form-grid.two,
  .spark-editor-drawer .spark-choice-grid,
  .spark-editor-drawer .spark-derived-status-grid {
    grid-template-columns: 1fr;
  }

  .table-spark .spark-product-head,
  .table-spark .spark-product-row {
    width: max(100%, 840px);
    grid-template-columns: 26px minmax(240px, 1.35fr) minmax(90px, .42fr) minmax(132px, .5fr) minmax(110px, .45fr) 38px;
  }
}

@media (min-width: 901px) and (max-width: 1180px) {
  .table-spark .spark-product-head,
  .table-spark .spark-product-row {
    width: max(100%, 840px);
    grid-template-columns: 26px minmax(240px, 1.35fr) minmax(90px, .42fr) minmax(132px, .5fr) minmax(110px, .45fr) 38px;
  }
}

@media (min-width: 1181px) and (max-width: 1366px) {
  .spark-catalog-layout {
    grid-template-columns: minmax(0, 1fr) minmax(380px, 410px);
  }
}

@media (max-width: 767px) {
  .spark-catalog-main .spark-page-title,
  .spark-mobile-catalog-screen .spark-page-title {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .spark-catalog-main .spark-page-title .spark-filter-button,
  .spark-mobile-catalog-screen .spark-page-title .spark-filter-button {
    width: auto;
    justify-content: center;
    white-space: nowrap;
  }

  .table-spark .spark-product-head,
  .table-spark .spark-orders-head {
    display: none;
  }

  .table-spark .spark-product-row,
  .table-spark .spark-order-row,
  .table-spark .spark-customer-row,
  .table-spark .spark-document-row {
    width: 100%;
    min-width: 0;
  }

  .spark-catalog-filter-panel.row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .spark-mobile-catalog-screen .spark-wide-search {
    width: 100%;
  }

  .spark-mobile-catalog-screen .spark-filter-tabs.mobile-filter-tabs {
    max-width: 100%;
    padding: 0 2px 4px;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap !important;
  }

  .spark-mobile-catalog-screen .spark-mobile-summary-chips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .spark-mobile-catalog-screen .spark-mobile-summary-chips button {
    min-width: 0;
  }
}

@media (max-width: 820px) {
  .spark-mobile-editor-screen {
    padding-bottom: calc(120px + env(safe-area-inset-bottom));
  }

  .spark-product-editor-mobile {
    padding-bottom: calc(112px + env(safe-area-inset-bottom));
  }

  .spark-product-editor > .btn.primary.spark-mobile-save-button {
    position: sticky;
    left: auto;
    right: auto;
    width: 100%;
    bottom: calc(94px + env(safe-area-inset-bottom));
    margin-top: 16px;
  }
}

/* Part 3 shell bridge: Bootstrap utilities assist layout, Spark keeps the look. */
.shell-spark-min,
.site-header,
.site-header > *,
.v2-customer-app,
.v2-customer-app > *,
.spark-command-app,
.spark-command-app > *,
.spark-command-content {
  min-width: 0;
}

.site-header.container-fluid {
  max-width: none;
}

.mobile-dropdown,
.v2-app-main,
.spark-command-main,
.spark-command-content {
  overflow-x: clip;
}

.mobile-dropdown {
  overscroll-behavior: contain;
}

.v2-app-actions,
.header-actions {
  row-gap: .5rem;
}

@supports not (overflow: clip) {
  .mobile-dropdown,
  .v2-app-main,
  .spark-command-main,
  .spark-command-content {
    overflow-x: hidden;
  }
}

/* Part 3.1 shell polish: state-aware mobile menu and narrow-screen guardrails. */
.mobile-dropdown [hidden],
.mobile-menu-actions[hidden] {
  display: none !important;
}

.mobile-nav a,
.mobile-nav-button {
  min-width: 0;
}

.mobile-nav-button {
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius, 8px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #202633;
  background: transparent;
  text-align: left;
  text-decoration: none;
  font-weight: 850;
}

.mobile-nav-button:hover,
.mobile-nav-button:focus-visible {
  background: #f4f7fb;
  outline: 2px solid rgba(247, 37, 133, .22);
  outline-offset: 2px;
}

body.mobile-menu-open {
  touch-action: none;
}

body.mobile-menu-open .mobile-dropdown {
  touch-action: auto;
}

.mobile-dropdown {
  max-width: calc(100vw - 14px);
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.spark-command-nav-item:focus,
.spark-command-nav-item:focus-visible,
.spark-command-metric:focus-visible,
.spark-dashboard-work-row:focus-visible,
.spark-mobile-admin-nav button:focus-visible,
.spark-mobile-more-sheet button:focus-visible {
  outline: 2px solid rgba(247, 37, 133, .28);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(247, 37, 133, .08);
}

.spark-command-nav-item:focus:not(:focus-visible) {
  outline: 2px solid rgba(247, 37, 133, .2);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(247, 37, 133, .06);
}

.spark-command-nav-item.active:focus,
.spark-command-nav-item.active:focus-visible {
  outline-color: rgba(247, 37, 133, .34);
  box-shadow: inset 3px 0 0 #f72f87, 0 0 0 4px rgba(247, 37, 133, .08);
}

@media (max-width: 767px) {
  html,
  body,
  .view,
  .v2-customer-app,
  .v2-app-main,
  .v2-customer-catalog,
  .portal-page,
  .catalog-app-page {
    max-width: 100%;
    overflow-x: clip;
  }

  .compact-customer-topbar.v2-app-topbar,
  .compact-customer-brand,
  .compact-customer-store,
  .compact-customer-actions,
  .v2-customer-catalog .catalog-app-head,
  .v2-customer-catalog .catalog-search-bar {
    min-width: 0;
    max-width: 100%;
  }

  .v2-customer-app .v2-app-main {
    padding-bottom: calc(132px + env(safe-area-inset-bottom));
  }

  .v2-customer-app .catalog-app-page.v2-customer-catalog,
  .v2-customer-app .portal-page {
    padding-bottom: calc(142px + env(safe-area-inset-bottom));
  }

  .v2-customer-app .portal-page.customer-home-v2 {
    padding-bottom: calc(220px + env(safe-area-inset-bottom));
  }



  .v2-customer-catalog .catalog-applied-filters,
  .v2-customer-catalog .catalog-availability-row,
  .catalog-route-bar,
  .flavor-family-row {
    width: auto;
    max-width: none;
    margin-inline: -12px;
    padding-inline: 16px;
    scroll-padding-inline: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .v2-customer-catalog .catalog-applied-filters::before,
  .v2-customer-catalog .catalog-applied-filters::after,
  .v2-customer-catalog .catalog-availability-row::before,
  .v2-customer-catalog .catalog-availability-row::after,
  .flavor-family-row::before,
  .flavor-family-row::after {
    content: "";
    flex: 0 0 1px;
  }

  .v2-customer-catalog .catalog-applied-filters > *,
  .v2-customer-catalog .catalog-availability-row .chip,
  .flavor-family-row .chip {
    flex: 0 0 auto;
  }

  .catalog-app-grid {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .catalog-search-bar input {
    min-width: 0;
    max-width: 100%;
    text-overflow: ellipsis;
  }

  .v2-bottom-nav {
    min-height: calc(76px + env(safe-area-inset-bottom));
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
}

@supports not (overflow: clip) {
  @media (max-width: 767px) {
    html,
    body,
    .view,
    .v2-customer-app,
    .v2-app-main,
    .v2-customer-catalog,
    .portal-page,
    .catalog-app-page {
      overflow-x: hidden;
    }
  }
}

.spark-system-note {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
}

.spark-system-note strong,
.spark-system-note span,
.spark-system-note small {
  display: block;
}

.spark-system-note span {
  color: #475467;
  line-height: 1.5;
}

.spark-system-note small {
  color: #667085;
  font-weight: 750;
}

/* Admin CSS repair: table columns and editor cards should not crush text. */
@media (min-width: 821px) {
  .spark-product-table.table-spark {
    overflow-x: auto;
  }

  .spark-product-table.table-spark .spark-product-head,
  .spark-product-table.table-spark .spark-product-row {
    width: max(100%, 900px);
    grid-template-columns:
      28px
      minmax(250px, 1.38fr)
      minmax(96px, 0.46fr)
      minmax(152px, 0.66fr)
      minmax(132px, 0.58fr)
      56px;
  }

  .spark-product-table .spark-row-actions {
    min-width: 44px;
    justify-self: end;
  }

  .spark-product-table.customer-table.table-spark > .spark-customer-head,
  .spark-product-table.customer-table.table-spark > .spark-customer-row {
    width: max(100%, 1010px);
    grid-template-columns:
      minmax(250px, 1.25fr)
      minmax(280px, 1.2fr)
      minmax(160px, 0.75fr)
      minmax(150px, 0.65fr)
      minmax(100px, 0.45fr);
    column-gap: 18px;
  }

  .spark-product-table.customer-table.table-spark > .spark-customer-head > span {
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
  }
}

.spark-product-table .spark-row-menu-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  letter-spacing: 1px;
}

.spark-product-table .spark-visible {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.spark-product-editor .spark-catalog-choice-grid {
  grid-template-columns: 1fr;
}

.spark-product-editor .spark-choice.form-check {
  min-width: 0;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 4px 10px;
  align-items: start;
  padding: 14px;
  overflow: hidden;
}

.spark-product-editor .spark-choice.form-check > .form-check-input {
  grid-column: 1;
  grid-row: 1 / span 2;
  margin: 1px 0 0;
}

.spark-product-editor .spark-choice.form-check > .spark-choice-title {
  grid-column: 2;
  min-width: 0;
  font-weight: 900;
  line-height: 1.2;
  overflow-wrap: normal;
  word-break: normal;
}

.spark-product-editor .spark-choice.form-check > small {
  grid-column: 2;
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: normal;
}

@container spark-product-editor (min-width: 640px) {
  .spark-product-editor .spark-catalog-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .spark-product-editor .spark-preview-card {
    grid-column: 1 / -1;
  }
}

/* Admin customers hub: customer account, approval, and documents in one workspace. */
.spark-customer-workspace,
.spark-customer-workspace *,
.spark-mobile-customers-screen,
.spark-mobile-customer-detail {
  min-width: 0;
}

.spark-customer-workspace .spark-page-title {
  align-items: flex-end;
  gap: 18px;
}

.spark-customer-search,
.spark-customer-mobile-search {
  width: min(100%, 480px);
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--spark-border);
  border-radius: 16px;
  background: var(--spark-surface);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .05);
}

.spark-customer-search input,
.spark-customer-mobile-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--spark-text);
  font: inherit;
  font-size: 16px;
  font-weight: 800;
}

.spark-customer-search input::placeholder,
.spark-customer-mobile-search input::placeholder {
  color: color-mix(in srgb, var(--spark-muted) 72%, white);
}

.spark-customer-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.spark-customer-stats article {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--spark-border);
  border-radius: 18px;
  background: var(--spark-surface);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .04);
}

.spark-customer-stats span,
.spark-customer-summary-strip small {
  display: block;
  color: var(--spark-muted);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.spark-customer-stats strong {
  display: block;
  margin-top: 6px;
  color: var(--spark-text);
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1;
}

.spark-customer-stats small {
  display: block;
  margin-top: 7px;
  color: var(--spark-muted);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.spark-customer-filter-strip {
  display: flex;
  gap: 10px;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 4px 2px 12px;
  scrollbar-width: none;
}

.spark-customer-filter-strip::-webkit-scrollbar {
  display: none;
}

.spark-customer-filter-strip button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--spark-border);
  border-radius: 14px;
  background: var(--spark-surface);
  color: var(--spark-text);
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .035);
}

.spark-customer-filter-strip button.active {
  border-color: var(--pink, #f72585);
  background: color-mix(in srgb, var(--pink, #f72585) 10%, white);
  color: var(--pink, #f72585);
}

.spark-customer-filter-strip button:focus-visible,
.spark-customer-account-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue, #4361ee) 45%, transparent);
  outline-offset: 3px;
}

.spark-customer-workspace-grid {
  display: grid;
  grid-template-columns: minmax(330px, .42fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.spark-customer-list-panel {
  overflow: hidden;
  padding: 0;
}

.spark-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--spark-border);
}

.spark-section-head h2 {
  margin: 0;
  color: var(--spark-text);
  font-size: 20px;
  line-height: 1.1;
}

.spark-section-head p {
  margin: 5px 0 0;
  color: var(--spark-muted);
  font-weight: 800;
}

.spark-customer-account-list {
  display: grid;
}

.spark-customer-account-card {
  width: 100%;
  min-height: 86px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border: 0;
  border-bottom: 1px solid var(--spark-border);
  background: var(--spark-surface);
  color: var(--spark-text);
  text-align: left;
  cursor: pointer;
}

.spark-customer-account-card:hover,
.spark-customer-account-card.active {
  background: linear-gradient(90deg, color-mix(in srgb, var(--pink, #f72585) 10%, white), white 82%);
}

.spark-customer-account-card:last-child {
  border-bottom: 0;
}

.spark-customer-account-copy,
.spark-customer-account-meta {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.spark-customer-account-copy strong {
  color: var(--spark-text);
  font-size: 17px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.spark-customer-account-copy small,
.spark-customer-account-copy em,
.spark-customer-account-meta small {
  color: var(--spark-muted);
  font-style: normal;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.spark-customer-account-meta {
  justify-items: end;
  text-align: right;
}

.spark-customer-account-meta svg {
  color: color-mix(in srgb, var(--spark-muted) 70%, white);
}

.spark-customer-profile-panel {
  min-width: 0;
}

.spark-customer-detail-shell {
  display: grid;
  gap: 16px;
}

.spark-customer-hero {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--spark-border);
  border-radius: 20px;
  background: var(--spark-surface);
  box-shadow: 0 18px 42px rgba(15, 23, 42, .05);
}

.spark-customer-hero h2 {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0;
  color: var(--spark-text);
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.08;
}

.spark-customer-hero p,
.spark-customer-hero small {
  display: block;
  margin: 6px 0 0;
  color: var(--spark-muted);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.spark-customer-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.spark-customer-summary-strip span {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--spark-border);
  border-radius: 16px;
  background: var(--spark-surface);
}

.spark-customer-summary-strip strong {
  display: block;
  margin-top: 5px;
  color: var(--spark-text);
  font-size: 18px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.customer-detail-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.customer-detail-grid .spark-info-card,
.customer-detail-grid .spark-info-row,
.customer-detail-grid .spark-info-row strong {
  min-width: 0;
}

.customer-detail-grid .spark-info-row {
  grid-template-columns: minmax(92px, .62fr) minmax(0, 1fr);
}

.customer-detail-grid .spark-info-row strong {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.spark-customer-documents-panel {
  display: grid;
  gap: 14px;
}

.spark-customer-documents-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.spark-customer-documents-heading h3 {
  margin: 0;
}

.spark-customer-documents-heading p {
  margin: 5px 0 0;
  color: var(--spark-muted);
  font-weight: 800;
}

.spark-customer-document-list {
  display: grid;
  gap: 10px;
}

.spark-customer-document-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--spark-border);
  border-radius: 16px;
  background: var(--spark-surface);
}

.spark-customer-document-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.spark-customer-document-copy strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spark-customer-document-copy small {
  color: var(--spark-muted);
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.spark-customer-document-actions {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.customer-actions {
  flex-wrap: wrap;
}

.customer-actions .btn {
  min-width: 148px;
}

.spark-mobile-customers-screen,
.spark-mobile-customer-detail {
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}

.spark-customer-mobile-search {
  width: 100%;
  margin: 12px 0;
}

.spark-mobile-muted {
  margin: 8px 4px 0;
  color: var(--spark-muted);
  font-weight: 800;
}

@media (max-width: 1320px) {
  .spark-customer-workspace-grid {
    grid-template-columns: minmax(300px, .45fr) minmax(0, 1fr);
  }

  .customer-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .spark-customer-workspace-grid {
    grid-template-columns: 1fr;
  }

  .spark-customer-account-list {
    max-height: 520px;
    overflow: auto;
  }
}

@media (max-width: 820px) {
  .spark-customer-workspace .spark-page-title {
    align-items: stretch;
  }

  .spark-customer-search {
    width: 100%;
  }

  .spark-customer-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .spark-customer-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .spark-customer-filter-strip {
    margin-inline: -4px;
    padding-inline: 4px 24px;
  }

  .spark-customer-hero {
    grid-template-columns: 54px minmax(0, 1fr);
    padding: 16px;
  }

  .spark-customer-document-row {
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: start;
  }

  .spark-customer-document-copy strong {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .spark-customer-document-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .spark-customer-document-actions .btn,
  .customer-actions .btn {
    flex: 1 1 120px;
  }
}


/* 2026-07-08 admin catalog image clarity: larger thumbnails in product lists and editor panels. */
.spark-product-table .spark-product-cell {
  grid-template-columns: 64px minmax(0, 1fr);
  column-gap: 14px;
}

.spark-product-table .spark-product-cell img {
  width: 64px;
  height: 64px;
  border-radius: 13px;
  background: #f1f5f9;
}

.spark-product-table .spark-product-row {
  min-height: 92px;
}

.spark-product-editor .spark-editor-head {
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 16px;
}

.spark-product-editor .spark-editor-head img {
  width: 92px;
  height: 92px;
  border-radius: 18px;
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px #e2e8f0;
}

@media (max-width: 1180px) and (min-width: 821px) {
  .spark-product-table.table-spark .spark-product-head,
  .spark-product-table.table-spark .spark-product-row {
    width: max(100%, 900px);
    grid-template-columns:
      26px
      minmax(270px, 1.45fr)
      minmax(90px, .42fr)
      minmax(132px, .5fr)
      minmax(110px, .45fr)
      44px;
  }
}

@media (max-width: 820px) {
  .spark-product-table .spark-product-cell {
    grid-template-columns: 108px minmax(0, 1fr);
  }

  .spark-product-table .spark-product-cell img {
    width: 108px;
    height: 108px;
    border-radius: 16px;
  }

  .spark-product-editor .spark-editor-head {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .spark-product-editor .spark-editor-head img {
    width: 88px;
    height: 88px;
  }
}

@media (max-width: 390px) {
  .spark-product-table .spark-product-cell {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .spark-product-table .spark-product-cell img {
    width: 96px;
    height: 96px;
  }
}
