/* Shared presentation only. Business status colours, data, permissions and
   actions remain owned by each page. No text-based or DOM-data inference. */
:root {
  --erp-page-bg: #f3f5f8;
  --erp-page-bg-texture: linear-gradient(#f3f5f8, #f3f5f8);
  --erp-surface: #ffffff;
  --erp-surface-strong: #ffffff;
  --erp-surface-muted: #f5f7fa;
  --erp-surface-glass: rgba(255, 255, 255, 0.98);
  --erp-border: #e0e5ec;
  --erp-border-strong: #c5cdd8;
  --erp-table-row-odd-bg: #ffffff;
  --erp-table-row-even-bg: #f8fafc;
  --erp-table-row-hover-bg: #edf4ff;
  --erp-table-row-divider: #e5eaf0;
  --erp-table-body-font-size: 14px;
  --erp-product-image-bg: #ffffff;
  --erp-product-image-border: #d8e0ea;
  --erp-product-image-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

/* rc-table needs these cells to measure column widths. Keep them in layout,
   but don't apply ordinary row padding (which made a blank 22px first row). */
.ant-table-wrapper .ant-table-tbody > tr.ant-table-measure-row > td {
  padding: 0 !important;
  border: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  line-height: 0 !important;
  box-shadow: none !important;
}

/* Selection must win over both zebra rules and fixed-cell hover backgrounds.
   Do not recolour text/tags: losses and warning/error statuses remain visible. */
.ant-table-wrapper .ant-table-tbody > tr.ant-table-row-selected:nth-child(n) > td,
.ant-table-wrapper .ant-table-tbody > tr.ant-table-row-selected:nth-child(n):hover > td {
  background: #e8f1ff !important;
}
.ant-table-wrapper .ant-table-tbody > tr.ant-table-row-selected > td:first-child {
  box-shadow: inset 3px 0 0 #1677ff;
}
.ant-table-wrapper .ant-table-thead > tr > th.ant-table-column-has-sorters:hover {
  background: #eaf1fa !important;
}
.ant-table-wrapper .ant-table-filter-trigger.active {
  background: #e6f0ff;
  border-radius: 4px;
}
.ant-table-wrapper .ant-table-thead > tr > th {
  background: var(--erp-surface-muted) !important;
}
.ant-table-wrapper .ant-table-resize-handle-line {
  border-inline-end-color: #b8c4d3 !important;
}
.ant-table-wrapper .ant-table-resize-handle:hover .ant-table-resize-handle-line {
  border-inline-end-color: #1677ff !important;
}

/* Optical hierarchy: page > work area > supporting explanation. */
.layout-content-main :where(.page-header, .poizon-page-header, .page-hero, .warehouse-toolbar) {
  gap: 12px;
}
.layout-content-main :where(.erp-page-title, .page-title, .page-header h1, .poizon-page-header h1) {
  line-height: 1.4 !important;
}
.layout-content-main :where(.erp-filter-label, .ant-form-item-label > label) {
  font-weight: 600;
}
.layout-content-main :where(.table-operations, .erp-filter-bar) {
  background: var(--erp-surface);
  border-color: var(--erp-border);
}
.layout-content-main .erp-action-bar {
  background: var(--erp-surface-muted);
}
.layout-content-main .page-summary-strip article {
  background: var(--erp-surface);
  border-color: var(--erp-border);
}
.layout-content-main :where(.ant-statistic-content, .metric-value, .page-summary-strip strong) {
  font-variant-numeric: tabular-nums;
}
.layout-content-main .ant-card-head-title {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

/* Existing help/confirmation content is neither hidden nor clamped. */
.layout-content-main details > summary,
.ant-modal details > summary {
  cursor: pointer;
  line-height: 1.6;
  padding-block: 4px;
}
.layout-content-main :where(button, a, summary, [role="button"]):focus-visible,
.ant-modal :where(button, a, summary, [role="button"]):focus-visible,
.ant-drawer :where(button, a, summary, [role="button"]):focus-visible {
  outline: 2px solid #1677ff;
  outline-offset: 3px;
}

/* Dense platform pages: tighten spacing, not information or warning visibility. */
.layout-content-main .poizon-page {
  gap: 12px;
}
.layout-content-main .poizon-sync-strip {
  padding: 10px 14px;
}
.layout-content-main .execution-metric-row .ant-card {
  height: 100%;
}
.layout-content-main .execution-metric-row .ant-card-body {
  padding: 10px 12px !important;
}
.layout-content-main .execution-metric-row .metric-label {
  margin-bottom: 4px;
}
.layout-content-main .execution-metric-row .metric-value {
  font-size: 24px;
  line-height: 1.3;
}
.layout-content-main .execution-metric-row .execution-board__latest {
  font-size: 16px;
  overflow-wrap: anywhere;
}
.layout-content-main .execution-diagnostic-detail {
  margin-top: 4px;
  font-size: 13px;
  color: var(--erp-muted);
}
.layout-content-main .execution-diagnostic-detail[open] > summary {
  margin-bottom: 6px;
}
.layout-content-main .execution-board__filters {
  padding: 12px;
  background: var(--erp-surface-muted);
  border: 1px solid var(--erp-border);
  border-radius: 8px;
}
.layout-content-main .execution-filter-summary {
  padding-block: 8px;
}
.layout-content-main .execution-board__retry-alert.ant-alert-with-description {
  padding: 12px 14px;
}

/* MY context is secondary to quantities and actions. Keep all four definitions. */
.layout-content-main .my-warehouse-page .my-context-strip {
  gap: 0;
  border: 1px solid var(--erp-border);
  border-radius: 8px;
  background: var(--erp-surface);
}
.layout-content-main .my-warehouse-page .my-context-strip article {
  padding: 10px 14px;
  background: transparent;
  border-inline-end: 1px solid var(--erp-border);
  border-radius: 0;
}
.layout-content-main .my-warehouse-page .my-context-strip article:last-child {
  border-inline-end: 0;
}
.layout-content-main .my-warehouse-page .my-context-strip strong {
  font-size: 15px;
}
.layout-content-main .my-warehouse-page .toolbar-panel {
  border: 1px solid var(--erp-border);
  border-radius: 8px;
  padding: 12px;
  background: var(--erp-surface);
}

/* Never force nowrap on amounts or IDs globally: narrow columns and dialog
   tables must stay scrollable; domain components own their line breaks. */
@media (max-width: 1100px) {
  .layout-content-main :where(.page-header, .poizon-page-header, .page-hero) {
    flex-wrap: wrap;
  }
  .layout-content-main :where(.page-header, .poizon-page-header, .page-hero) > * {
    min-width: 0;
    max-width: 100%;
  }
  .layout-content-main .execution-board__filters .ant-space-item {
    max-width: 100%;
  }
  .layout-content-main .execution-board__filters :where(.ant-input-affix-wrapper, .ant-select) {
    max-width: 100%;
  }
}
@media (max-width: 760px) {
  .layout-content-main .my-warehouse-page .my-context-strip article {
    border-inline-end: 0;
  }
  .layout-content-main .erp-action-bar .ant-btn {
    min-height: 32px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ant-table-wrapper .ant-table-tbody > tr > td {
    transition: none;
  }
}
