/* FulfillForge — Shopify Admin / Polaris inspired */

:root {
  --p-bg: #f1f2f4;
  --p-surface: #ffffff;
  --p-border: #e1e3e5;
  --p-border-subdued: #ebebeb;
  --p-text: #202223;
  --p-text-subdued: #6d7175;
  --p-link: #005bd3;
  --p-link-hover: #004299;
  --p-primary: #303030;
  --p-primary-hover: #1a1a1a;
  --p-critical: #8e1f0b;
  --p-critical-bg: #fee9e8;
  --p-success: #0a5c36;
  --p-success-bg: #cdfee1;
  --p-warning-bg: #fff5ea;
  --p-warning-text: #7a4a00;
  --p-info-bg: #eaf4ff;
  --p-info-text: #003d6a;
  --p-radius: 8px;
  --p-radius-sm: 6px;
  --p-shadow-card: 0 1px 0 rgba(0, 0, 0, 0.05);
  --p-font: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --p-container: 62.5rem;
}

/* Layout */
.app-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--p-font);
  font-size: 0.8125rem;
  line-height: 1.25rem;
  color: var(--p-text);
  background: var(--p-bg);
  -webkit-font-smoothing: antialiased;
}

.app-main {
  padding: 1rem 1rem 2rem;
}

@media (min-width: 768px) {
  .app-main {
    padding: 1.25rem 1.5rem 2.5rem;
  }
}

.app-container {
  max-width: var(--p-container);
  margin: 0 auto;
}

.app-toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 100;
  max-width: 22rem;
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #fff;
  background: var(--p-primary);
  border-radius: var(--p-radius);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.app-toast.is-error {
  background: var(--p-critical);
}

/* Top navigation */
.app-nav {
  background: var(--p-surface);
  border-bottom: 1px solid var(--p-border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.app-nav__inner {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
  height: 3rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

@media (min-width: 768px) {
  .app-nav__inner {
    padding: 0 1.5rem;
    max-width: calc(var(--p-container) + 3rem);
  }
}

.app-nav__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--p-text);
  margin-right: 0.5rem;
}

.app-nav__logo {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--p-radius-sm);
  background: var(--p-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-nav__name {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.app-nav__links {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  flex: 1;
  overflow-x: auto;
}

.app-nav__link {
  padding: 0.375rem 0.625rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--p-text-subdued);
  text-decoration: none;
  border-radius: var(--p-radius-sm);
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}

.app-nav__link:hover {
  color: var(--p-text);
  background: #f6f6f7;
}

.app-nav__link.is-active {
  color: var(--p-text);
  background: #f1f2f4;
}

.app-nav__meta {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.app-nav__logout {
  margin: 0;
}

/* Login page */
.login-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--p-font);
  font-size: 0.8125rem;
  line-height: 1.25rem;
  color: var(--p-text);
  background: var(--p-bg);
  -webkit-font-smoothing: antialiased;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 24rem;
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  box-shadow: var(--p-shadow-card);
  padding: 2rem;
}

.login-card__brand {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-card__logo {
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 auto 0.75rem;
  border-radius: var(--p-radius-sm);
  background: var(--p-primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--p-text);
}

.login-card__subtitle {
  margin: 0.375rem 0 0;
  font-size: 0.8125rem;
  color: var(--p-text-subdued);
}

.login-card__error {
  margin-bottom: 1rem;
  padding: 0.625rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--p-critical);
  background: var(--p-critical-bg);
  border: 1px solid #fecdca;
  border-radius: var(--p-radius-sm);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.login-form__label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--p-text);
}

.login-form__input {
  width: 100%;
  padding: 0.5rem 0.625rem;
  font-size: 0.8125rem;
  font-family: inherit;
  color: var(--p-text);
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius-sm);
  box-sizing: border-box;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.login-form__input:focus {
  outline: none;
  border-color: #005bd3;
  box-shadow: 0 0 0 1px #005bd3;
}

.login-form__submit {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.5rem 0.75rem;
}

/* Page header */
.page-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .page-header {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
  }
}

.page-header__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--p-text);
}

@media (min-width: 768px) {
  .page-header__title {
    font-size: 1.375rem;
  }
}

.page-header__subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  color: var(--p-text-subdued);
  line-height: 1.4;
  max-width: 36rem;
}

.page-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.page-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.375rem;
  font-size: 0.75rem;
}

.page-breadcrumbs__link {
  color: var(--p-link);
  text-decoration: none;
}

.page-breadcrumbs__link:hover {
  color: var(--p-link-hover);
  text-decoration: underline;
}

.page-breadcrumbs__sep {
  color: var(--p-text-subdued);
}

.page-breadcrumbs__current {
  color: var(--p-text-subdued);
}

.page-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Cards */
.polaris-card {
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  box-shadow: var(--p-shadow-card);
  overflow: hidden;
}

.polaris-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--p-border-subdued);
}

.polaris-card__title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--p-text);
}

.polaris-card__subtitle {
  margin: 0.125rem 0 0;
  font-size: 0.8125rem;
  color: var(--p-text-subdued);
}

.polaris-card__body {
  padding: 1rem;
}

.polaris-card__body--flush {
  padding: 0;
}

.polaris-card__body--compact {
  padding: 0.75rem 1rem;
}

/* Stat metrics (compact) */
.metric-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .metric-row {
    grid-template-columns: repeat(5, 1fr);
  }
}

.metric-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  padding: 0.625rem 0.75rem;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.metric-card:hover {
  border-color: #c9cccf;
  background: #fafbfb;
}

.metric-card__label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--p-text-subdued);
  margin: 0;
}

.metric-card__value {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0.125rem 0 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* Index filters */
.index-filters {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--p-border-subdued);
}

.index-filters__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
}

.index-filters__search {
  flex: 1 1 12rem;
  min-width: 10rem;
}

.index-filters__field {
  flex: 0 1 auto;
  min-width: 8rem;
}

.index-filters__actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-left: auto;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.25rem;
  border-radius: var(--p-radius-sm);
  white-space: nowrap;
}

.badge-tone-neutral {
  background: #e4e5e7;
  color: #454f5b;
}

.badge-tone-info {
  background: var(--p-info-bg);
  color: var(--p-info-text);
}

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

.badge-tone-warning {
  background: var(--p-warning-bg);
  color: var(--p-warning-text);
}

.badge-tone-caution {
  background: #ffef9d;
  color: #4f4700;
}

.badge-tone-critical {
  background: var(--p-critical-bg);
  color: var(--p-critical);
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.25rem;
  color: #fff;
  background: var(--p-primary);
  border: 1px solid var(--p-primary);
  border-radius: var(--p-radius-sm);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.btn-primary:hover:not(:disabled) {
  background: var(--p-primary-hover);
  border-color: var(--p-primary-hover);
}

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

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.25rem;
  color: var(--p-text);
  background: var(--p-surface);
  border: 1px solid #babfc4;
  border-radius: var(--p-radius-sm);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s ease;
}

.btn-secondary:hover:not(:disabled) {
  background: #f6f6f7;
}

.btn-plain {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--p-link);
  background: transparent;
  border: none;
  border-radius: var(--p-radius-sm);
  cursor: pointer;
  text-decoration: none;
}

.btn-plain:hover {
  color: var(--p-link-hover);
  text-decoration: underline;
}

.btn-compact {
  padding-top: 0.3125rem;
  padding-bottom: 0.3125rem;
}

.btn-critical-outline {
  color: var(--p-critical);
  border-color: #f4a9a4;
}

.btn-critical-outline:hover {
  background: var(--p-critical-bg);
}

.btn-success-outline {
  color: var(--p-success);
  border-color: #95d4b3;
}

.btn-success-outline:hover {
  background: var(--p-success-bg);
}

/* Forms */
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--p-text);
  margin-bottom: 0.25rem;
}

.form-input,
.form-select {
  display: block;
  width: 100%;
  font-size: 0.8125rem;
  line-height: 1.25rem;
  color: var(--p-text);
  background: var(--p-surface);
  border: 1px solid #8c9196;
  border-radius: var(--p-radius-sm);
  padding: 0.375rem 0.625rem;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.form-input-compact,
.form-select-compact {
  padding-top: 0.3125rem;
  padding-bottom: 0.3125rem;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--p-link);
  box-shadow: 0 0 0 1px var(--p-link);
}

.form-input::placeholder {
  color: #8c9196;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%238c9196' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.25rem;
  padding-right: 2rem;
}

.input-with-icon {
  position: relative;
}

.input-with-icon .form-input {
  padding-left: 2rem;
}

.input-with-icon__icon {
  position: absolute;
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: #8c9196;
  pointer-events: none;
}

/* Tables */
.data-table {
  width: 100%;
  font-size: 0.8125rem;
  border-collapse: collapse;
}

.data-table thead tr {
  background: #f6f6f7;
  border-bottom: 1px solid var(--p-border);
}

.data-table th {
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--p-text-subdued);
  white-space: nowrap;
}

.data-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--p-border-subdued);
  vertical-align: middle;
}

.data-table-compact td,
.data-table-compact th {
  padding-top: 0.4375rem;
  padding-bottom: 0.4375rem;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.table-row-clickable {
  cursor: pointer;
  transition: background-color 0.1s ease;
}

.table-row-clickable:hover {
  background: #f6f6f7;
}

.table-row-clickable:hover .order-link {
  color: var(--p-link-hover);
  text-decoration: underline;
}

.order-link {
  color: var(--p-link);
  font-weight: 500;
  text-decoration: none;
}

.cell-date {
  color: var(--p-text-subdued);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.cell-sku {
  color: var(--p-text-subdued);
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
}

.cell-qty {
  font-variant-numeric: tabular-nums;
}

.cell-badge {
  white-space: nowrap;
}

.cell-thumb {
  width: 2.75rem;
}

.thumb-img {
  display: block;
  width: 2rem;
  height: 2rem;
  border-radius: var(--p-radius-sm);
  object-fit: cover;
  background: #f6f6f7;
  border: 1px solid var(--p-border-subdued);
}

.thumb-img-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #babfc4;
  font-size: 0.625rem;
}

.cell-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 12rem;
}

.cell-checkbox {
  width: 2.25rem;
  text-align: center;
}

.bulk-checkbox {
  width: 1rem;
  height: 1rem;
  accent-color: var(--p-primary);
  cursor: pointer;
}

tr.bulk-row-selected {
  background: #f1f2f4;
}

/* Bulk actions — Shopify index bulk bar */
.page-dashboard {
  padding-bottom: 4rem;
}

.bulk-toolbar {
  margin-bottom: 0;
}

.bulk-toolbar.hidden {
  display: none;
}

.bulk-toolbar:not(.hidden) {
  border-bottom: 1px solid var(--p-border);
  background: #f6f6f7;
}

.bulk-toolbar-inner {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 0.625rem 1rem;
}

.bulk-toolbar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.bulk-toolbar-count {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--p-text);
}

.bulk-toolbar-clear {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--p-link);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.bulk-toolbar-clear:hover {
  text-decoration: underline;
}

.bulk-toolbar-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bulk-action-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
}

.bulk-action-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--p-text-subdued);
  margin-right: 0.25rem;
}

.bulk-action-btn {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: var(--p-radius-sm);
  border: 1px solid #babfc4;
  background: var(--p-surface);
  color: var(--p-text);
  cursor: pointer;
  white-space: nowrap;
}

.bulk-action-btn:hover:not(:disabled) {
  background: #f6f6f7;
}

.bulk-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (min-width: 768px) {
  .bulk-toolbar-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .bulk-toolbar-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.5rem 1.5rem;
}

.empty-state--page {
  min-height: 40vh;
  justify-content: center;
}

.empty-state__icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--p-radius);
  background: #f6f6f7;
  color: #8c9196;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.empty-state__code {
  font-size: 2.5rem;
  font-weight: 600;
  color: #c9cccf;
  margin: 0 0 0.5rem;
}

.empty-state__heading {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--p-text);
}

.empty-state__message {
  margin: 0.375rem 0 0;
  font-size: 0.8125rem;
  color: var(--p-text-subdued);
  max-width: 22rem;
}

.empty-state__action {
  margin-top: 1rem;
}

/* Due date */
.due-badge {
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.125rem 0.375rem;
  border-radius: var(--p-radius-sm);
}

.due-badge-compact {
  font-size: 0.6875rem;
}

.due-badge-none {
  color: var(--p-text-subdued);
  background: #f6f6f7;
}

.due-badge-today {
  color: var(--p-info-text);
  background: var(--p-info-bg);
}

.due-badge-overdue {
  color: var(--p-critical);
  background: var(--p-critical-bg);
}

.due-date-future {
  font-size: 0.8125rem;
  color: var(--p-text-subdued);
  font-variant-numeric: tabular-nums;
}

.due-date-future-compact {
  font-size: 0.75rem;
}

.due-inline-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 7rem;
}

.due-date-input-inline {
  width: 7.5rem;
  padding: 0.25rem 0.375rem;
  font-size: 0.75rem;
}

/* Button loading */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 1rem;
  height: 1rem;
  top: 50%;
  left: 50%;
  margin: -0.5rem 0 0 -0.5rem;
  border: 2px solid rgb(255 255 255 / 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn-secondary.btn-loading::after {
  border-color: rgb(140 145 150 / 0.3);
  border-top-color: #6d7175;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Production board */
.page-production-board .metric-row--board {
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 640px) {
  .page-production-board .metric-row--board {
    grid-template-columns: repeat(4, 1fr);
  }
}

.page-production-board .board-scroll-shell {
  position: relative;
}

.page-production-board .board-scroll-track {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.page-production-board .board-column {
  flex: 0 0 14.5rem;
  scroll-snap-align: start;
}

@media (min-width: 1280px) {
  .page-production-board .board-column {
    flex: 1 0 14.5rem;
    max-width: 17rem;
  }
}

.page-production-board .kanban-column {
  background: #f6f6f7;
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 14rem);
  min-height: 16rem;
  max-height: calc(100vh - 11rem);
}

.page-production-board .kanban-column-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
  background: var(--p-surface);
  border-bottom: 1px solid var(--p-border);
  border-radius: var(--p-radius) var(--p-radius) 0 0;
}

.page-production-board .kanban-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--p-text-subdued);
  background: #f1f2f4;
  padding: 0.0625rem 0.4375rem;
  border-radius: var(--p-radius-sm);
  font-variant-numeric: tabular-nums;
}

.page-production-board .kanban-column-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.375rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.page-production-board .kanban-empty {
  border: 1px dashed var(--p-border);
  border-radius: var(--p-radius-sm);
  padding: 1rem 0.5rem;
  text-align: center;
  background: rgb(255 255 255 / 0.5);
}

.page-production-board .kanban-empty p {
  font-size: 0.75rem;
  color: #8c9196;
  margin: 0;
}

.page-production-board .kanban-card {
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius-sm);
  overflow: hidden;
  transition: border-color 0.12s ease;
}

.page-production-board .kanban-card:hover {
  border-color: #c9cccf;
}

.page-production-board .kanban-card-link {
  display: block;
  padding: 0.5rem 0.625rem;
  text-decoration: none;
  color: inherit;
}

.page-production-board .kanban-card-link:hover .order-link {
  text-decoration: underline;
}

.page-production-board .kanban-card-header {
  display: flex;
  justify-content: space-between;
  gap: 0.375rem;
  margin-bottom: 0.25rem;
}

.page-production-board .kanban-card-title {
  font-size: 0.75rem;
  color: var(--p-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-production-board .kanban-card-more {
  font-size: 0.6875rem;
  color: var(--p-text-subdued);
  margin-top: 0.125rem;
}

.page-production-board .kanban-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.125rem 0.5rem;
  margin-top: 0.375rem;
}

.page-production-board .kanban-meta-row {
  display: flex;
  gap: 0.25rem;
  min-width: 0;
}

.page-production-board .kanban-meta-row dt {
  font-size: 0.6875rem;
  color: var(--p-text-subdued);
  flex-shrink: 0;
}

.page-production-board .kanban-meta-row dd {
  font-size: 0.6875rem;
  color: var(--p-text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-production-board .kanban-card-action {
  padding: 0.375rem 0.625rem 0.5rem;
  border-top: 1px solid var(--p-border-subdued);
  background: #fafbfb;
}

.page-production-board .kanban-status-select:disabled {
  opacity: 0.6;
}

/* Order detail */
.page-order-detail .order-detail-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
}

@media (min-width: 1024px) {
  .page-order-detail .order-detail-layout {
    grid-template-columns: 1fr 20rem;
  }
}

.page-order-detail .order-detail-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.page-order-detail .order-detail-aside {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 1024px) {
  .page-order-detail .order-detail-aside {
    position: sticky;
    top: 4rem;
  }
}

.page-order-detail .order-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem 1rem;
  font-size: 0.8125rem;
}

.page-order-detail .order-meta-grid dt {
  font-size: 0.75rem;
  color: var(--p-text-subdued);
  margin-bottom: 0.125rem;
}

.page-order-detail .order-meta-grid dd {
  margin: 0;
  color: var(--p-text);
}

.page-order-detail .job-line-item {
  padding: 1rem;
  border-bottom: 1px solid var(--p-border-subdued);
}

.page-order-detail .job-line-item:last-child {
  border-bottom: none;
}

.page-order-detail .job-line-item-img {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: var(--p-radius-sm);
  object-fit: cover;
  border: 1px solid var(--p-border-subdued);
  background: #f6f6f7;
}

@media (min-width: 640px) {
  .page-order-detail .job-line-item-img {
    width: 5.5rem;
    height: 5.5rem;
  }
}

.page-order-detail .job-line-item-img-empty {
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-order-detail .job-line-field dt {
  font-size: 0.75rem;
  color: var(--p-text-subdued);
}

.page-order-detail .job-line-field dd {
  margin-top: 0.125rem;
}

.page-order-detail .job-qty-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  background: #f6f6f7;
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius-sm);
}

.page-order-detail .job-option-badge {
  font-size: 0.75rem;
  padding: 0.125rem 0.375rem;
  background: #f6f6f7;
  border-radius: var(--p-radius-sm);
  color: var(--p-text-subdued);
}

.page-order-detail .job-quick-link {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--p-link);
  text-decoration: none;
  border-radius: var(--p-radius-sm);
}

.page-order-detail .job-quick-link:hover {
  background: #f6f6f7;
  text-decoration: underline;
}

.page-order-detail .workflow-divider {
  border-top: 1px solid var(--p-border-subdued);
  padding-top: 0.75rem;
  margin-top: 0.25rem;
}

/* Settings */
.settings-icon-wrap {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--p-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.settings-icon-connected {
  background: var(--p-success-bg);
  color: var(--p-success);
}

.settings-icon-demo {
  background: #f6f6f7;
  color: var(--p-text-subdued);
  border: 1px solid var(--p-border);
}

.settings-env-table {
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius-sm);
  overflow: hidden;
  font-size: 0.8125rem;
}

.settings-env-table__head {
  padding: 0.5rem 0.75rem;
  background: #f6f6f7;
  border-bottom: 1px solid var(--p-border);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--p-text-subdued);
}

.settings-env-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--p-border-subdued);
}

@media (min-width: 640px) {
  .settings-env-row {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.settings-env-row:last-child {
  border-bottom: none;
}

.settings-banner {
  padding: 0.625rem 0.75rem;
  border-radius: var(--p-radius-sm);
  font-size: 0.8125rem;
  line-height: 1.4;
}

.settings-banner--warning {
  background: var(--p-warning-bg);
  border: 1px solid #ffcc80;
  color: var(--p-warning-text);
}

.settings-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .settings-stat-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.settings-stat-cell {
  padding: 0.5rem 0.625rem;
  background: #f6f6f7;
  border: 1px solid var(--p-border-subdued);
  border-radius: var(--p-radius-sm);
}

.settings-stat-cell dt {
  font-size: 0.75rem;
  color: var(--p-text-subdued);
}

.settings-stat-cell dd {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 0.125rem;
  font-variant-numeric: tabular-nums;
}

.polaris-card--debug {
  border-style: dashed;
  background: #fafbfb;
}

.polaris-card--debug .polaris-card__title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--p-text-subdued);
}

.code-inline {
  font-size: 0.6875rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #f1f2f4;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
}

.sync-result {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
}

.sync-result.hidden {
  display: none;
}

/* Dashboard — nested products per order row */
.cell-products {
  min-width: 14rem;
  max-width: 22rem;
  vertical-align: top;
}

.cell-order {
  min-width: 7rem;
}

.dashboard-order-customer {
  display: block;
  font-size: 0.75rem;
  color: var(--p-text-subdued);
  margin-top: 0.125rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 10rem;
}

.dashboard-products-empty {
  font-size: 0.75rem;
  color: var(--p-text-subdued);
}

.dashboard-products-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.dashboard-product-line {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  min-width: 0;
}

.dashboard-product-thumb {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--p-radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--p-border-subdued);
  background: #f6f6f7;
}

.dashboard-product-thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  color: #babfc4;
}

.dashboard-product-text {
  min-width: 0;
  flex: 1;
}

.dashboard-product-title {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--p-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 18rem;
}

.dashboard-product-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--p-text-subdued);
  margin-top: 0.0625rem;
  line-height: 1.3;
}

.dashboard-product-sku {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.6875rem;
}

.dashboard-product-sep {
  margin: 0 0.125rem;
  color: #babfc4;
}

.dashboard-product-qty {
  font-variant-numeric: tabular-nums;
}

.dashboard-product-more {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--p-link);
  padding-left: 2.25rem;
}

/* Live updates */
.live-updates-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.625rem 0.875rem;
  background: var(--p-info-bg);
  color: var(--p-info-text);
  border: 1px solid #b4d6ff;
  border-radius: var(--p-radius);
  font-size: 0.8125rem;
}

.live-updates-banner.hidden {
  display: none;
}

.live-updates-banner__text {
  font-weight: 500;
}

.settings-webhook-url {
  word-break: break-all;
}

/* Activity log */
.activity-log-empty {
  margin: 0;
  color: var(--p-text-subdued);
  font-size: 0.8125rem;
}

.activity-log-item {
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--p-border-subdued);
}

.activity-log-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.activity-log-item__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.activity-log-item__actor {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--p-text);
}

.activity-log-item__time {
  font-size: 0.6875rem;
  color: var(--p-text-subdued);
}

.activity-log-item__message {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--p-text-subdued);
  line-height: 1.4;
}
