/* Shared QCOS reference theme. Presentation only; retain layouts and status semantics.
 * Legacy selectors use !important, so this isolated final presentation layer must override them.
 */
body.layout-erp.layout-pro .app-main, body.layout-erp.layout-pro .app-content, body.layout-erp.layout-pro .erp-body { background: #fff !important; }
body.layout-erp.layout-pro .app-content { padding: 22px 28px !important; }
body.layout-erp.layout-pro .sidebar { background: #f3f6fa !important; border-right: 0 !important; width: 250px; flex-basis: 250px; }
body.layout-erp.layout-pro .sidebar-brand { padding: 26px 24px 20px !important; display: block !important; }
body.layout-erp.layout-pro .brand-mark { display: none !important; }
body.layout-erp.layout-pro .brand-text { font-size: 36px !important; font-weight: 800 !important; color: #1677ff !important; letter-spacing: -1px; line-height: 1.15; }
body.layout-erp.layout-pro .brand-sub { font-size: 16px !important; color: #43516a !important; letter-spacing: 0; }
body.layout-erp.layout-pro .sidebar-nav { padding: 6px 10px !important; }
body.layout-erp.layout-pro .sidebar-nav .nav-role-label { display: none !important; }
body.layout-erp.layout-pro .sidebar-nav .nav-item { min-height: 52px !important; margin: 5px 0 !important; padding: 12px 18px !important; color: #344563 !important; font-size: 17px !important; border-radius: 6px !important; border: 0 !important; background: transparent !important; }
body.layout-erp.layout-pro .sidebar-nav .nav-item.active { color: #fff !important; background: #1677ff !important; box-shadow: 0 3px 8px #1677ff15 !important; }
body.layout-erp.layout-pro .sidebar-nav .nav-item.active::before { display: none !important; }
body.layout-erp.layout-pro .sidebar-nav .nav-item-icon { width: 22px !important; height: 22px !important; color: inherit !important; }
body.layout-erp.layout-pro .qcos-global-header { min-height: 60px; padding: 0 28px; background: #fff !important; box-shadow: none; border-bottom: 1px solid #e5eaf1; }
body.layout-erp.layout-pro .qcos-global-context { font-size: 15px; color: #43516a; }
body.layout-erp.layout-pro .qcos-global-context-dot { display: none; }
body.layout-erp.layout-pro .qcos-global-context-sep { background: none; width: auto; }
body.layout-erp.layout-pro .qcos-global-context-sep::after { content: '/'; color: #8a95a7; }
@media (max-width: 1100px) {
body.layout-erp.layout-pro .sidebar { width: 215px; flex-basis: 215px; }
body.layout-erp.layout-pro .sidebar-nav .nav-item { font-size: 15px !important; padding: 10px 12px !important; }
body.layout-erp.layout-pro .app-content { padding: 18px !important; }
}
@media (max-width: 700px) {
body.layout-erp.layout-pro .sidebar { width: 100% !important; height: auto !important; min-height: 0 !important; flex: 0 0 auto !important; padding: 8px !important; position: relative !important; }
body.layout-erp.layout-pro .sidebar-brand { padding: 8px !important; }
body.layout-erp.layout-pro .brand-text { font-size: 26px !important; }
body.layout-erp.layout-pro .sidebar-nav { display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important; height: 52px !important; min-height: 0 !important; max-height: 52px !important; overflow-x: auto !important; overflow-y: hidden !important; }
body.layout-erp.layout-pro .sidebar-nav .nav-section.is-current-module, body.layout-erp.layout-pro .sidebar-nav .nav-section.is-current-module > div { display: contents !important; }
body.layout-erp.layout-pro .sidebar-nav .nav-item { flex: 0 0 auto; min-width: max-content; min-height: 40px !important; margin: 0 4px !important; }
}

body.layout-erp.layout-pro {
  --ai-bg: #fff;
  --ai-card: #fff;
  --ai-card-strong: #fff;
  --ai-line: #e0e6ef;
  --ai-line-strong: #d6deea;
  --ai-blue: #1677ff;
  --ai-electric: #1677ff;
  --ai-text: #182439;
  --ai-sub: #64728a;
  --ai-muted: #68778e;
  --ai-soft: #f5f8fc;
  --ai-radius-card: 6px;
  --ai-radius-panel: 6px;
  --ai-shadow-card: none;
  --ai-shadow-hover: 0 2px 6px rgb(24 36 57 / 0.06);
  --ai-glow: none;
  --text-title: #121d32;
  --text-body: #182439;
  --text-muted: #64728a;
  --text-placeholder: #738198;
  --erp-primary: #1677ff;
  --erp-canvas: #fff;
  --erp-surface: #fff;
  --erp-border: #e0e6ef;
  --erp-radius: 6px;
  --erp-radius-lg: 6px;
  --erp-shadow: none;
  --erp-sidebar-w: 250px;
  --qcos-blue: #1677ff;
}
body.layout-erp.layout-pro .app-main .page {
  background: #fff !important;
  color: #182439;
  font-size: 14px;
}
body.layout-erp.layout-pro .app-page-head {
  background: #fff !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
body.layout-erp.layout-pro .app-page-title { font-size: 28px !important; color: #121d32; }
body.layout-erp.layout-pro .app-page-desc { font-size: 15px !important; color: #64728a !important; }
body.layout-erp.layout-pro .app-page-head-icon { display: none !important; }
body.layout-erp.layout-pro .erp-main-chrome { box-shadow: none !important; background: #fff !important; border-radius: 0 !important; }

/* Shared primitives; product-specific proportions are maintained by its own sheet. */
body.layout-erp.layout-pro .app-main .page:not(#page-products) :is(.card, .table-wrap, .compact-help-details, .qod-card, .of-surface-card, .ped-card, .ped-side-card, .stats-side-card, .oqc-panel, .crm-panel, .iqc-workspace-card, .ins-registry-panel, .msa-registry-panel, .kb-registry-panel, .ua-registry-panel, .k3sync-panel, .isp-global-panel, .isp-category-panel, .isp-product-panel, .pfc-fields-panel, .pfc-preview-panel) {
  background: #fff !important;
  border-color: #e0e6ef !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
body.layout-erp.layout-pro .app-main .page:not(#page-products) :is(.filter-row, .tq-filter-panel, .mdmp-filter-panel, .sampling-filter-panel, .pcc-filter-panel, .sor-filter-panel, .tagtpl-filter-panel, .fc-toolbar, .crm-toolbar, .completed-toolbar, .stats-page-toolbar, .itr-filter) {
  background: #f7f9fc !important;
  border: 1px solid #e0e6ef !important;
  border-radius: 6px !important;
  box-shadow: none !important;
}
body.layout-erp.layout-pro .app-main .page:not(#page-products) :is(.task-command-hero, .qcos-subpage-hero, .entry-hero, .ct-hero, .tq-hero, .qod-hero, .sor-hero, .order-flow-hero, .qt-hero, .oqc-hero, .flow-overview-hero, .fc-ledger-hero, .reporttpl-hero, .stats-cpk-hero, .stats-merge-hero, .mdmp-hero, .ai-review-hero, .itr-hero, .sampling-hero, .tagtpl-hero, .pcc-hero, .ex-hero, .mdm-status-hero, .mdp-hero, .iqc-hero, .ins-hero, .msa-hero, .msa-detail-hero, .crm-hero, .ar-hero, .kb-hero, .k3sync-hero, .offline-import-hero, .qc-go-live-hero, .test-center-hero, .scp-hero, .mytask-hero, .completed-hero, .pfc-hero, .isp-hero, .ua-hero) {
  background: #fff !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 8px 0 18px !important;
  min-height: 74px !important;
  color: #182439 !important;
}
body.layout-erp.layout-pro .app-main .page:not(#page-products) .task-command-hero::before,
body.layout-erp.layout-pro .app-main .page:not(#page-products) .task-command-hero::after,
body.layout-erp.layout-pro .app-main .page:not(#page-products) .task-command-hero-kicker {
  display: none !important;
}
body.layout-erp.layout-pro .app-main .page:not(#page-products) :is(.task-command-hero, .qcos-subpage-hero) h2 {
  font-size: 28px !important;
  font-weight: 700 !important;
  color: #121d32 !important;
  letter-spacing: 0 !important;
  margin: 0 0 8px !important;
}
body.layout-erp.layout-pro .app-main .page:not(#page-products) :is(.task-command-hero, .qcos-subpage-hero) p {
  font-size: 15px !important;
  line-height: 1.5 !important;
  color: #64728a !important;
}
body.layout-erp.layout-pro .app-main .page:not(#page-products) :is(.qod-hero-panel, .ped-title-panel) {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
}

/* KPI numbers and semantic status accents remain; remove decorative surfaces only. */
body.layout-erp.layout-pro .app-main .page:not(#page-products) :is(.tq-kpi, .mdmp-kpi, .ai-review-kpi, .mytask-kpi, .completed-kpi, .pcc-kpi, .mdp-kpi, .of-kpi, .qt-kpi, .fc-ledger-kpi, .stats-cpk-kpi, .stats-merge-kpi, .sampling-kpi, .tagtpl-kpi, .mdm-status-kpi, .ins-kpi, .msa-kpi, .crm-kpi, .ar-kpi, .kb-kpi, .offline-import-kpi, .ua-kpi) {
  background: #fff !important;
  border: 1px solid #e0e6ef !important;
  border-radius: 6px !important;
  box-shadow: none !important;
}
body.layout-erp.layout-pro .app-main .page:not(#page-products) :is(.tq-kpi, .mdmp-kpi, .ai-review-kpi, .mytask-kpi, .completed-kpi, .pcc-kpi, .mdp-kpi, .of-kpi, .qt-kpi, .fc-ledger-kpi, .stats-cpk-kpi, .stats-merge-kpi, .sampling-kpi, .tagtpl-kpi, .mdm-status-kpi, .ins-kpi, .msa-kpi, .crm-kpi, .ar-kpi, .kb-kpi, .offline-import-kpi, .ua-kpi)[aria-pressed='true'] {
  background: #edf5ff !important;
  border-color: #1677ff !important;
}
body.layout-erp.layout-pro .app-main .page:not(#page-products) :is(.muted-text, .hint, .help-text) {
  color: #64728a !important;
  font-size: 13px !important;
  line-height: 1.5;
}
body.layout-erp.layout-pro .app-main .page:not(#page-products) :is(.card, .table-wrap) h3 {
  color: #182439 !important;
  font-size: 18px !important;
}

body.layout-erp.layout-pro .app-main .page:not(#page-products) .btn {
  border-radius: 5px !important;
  font-size: 14px !important;
  min-height: 36px;
  box-shadow: none !important;
}
body.layout-erp.layout-pro .app-main .page:not(#page-products) .btn-primary {
  background: #1677ff !important;
  border-color: #1677ff !important;
  color: #fff !important;
}
body.layout-erp.layout-pro .app-main .page:not(#page-products) .btn-ghost {
  background: #fff !important;
  border: 1px solid #dbe2ed !important;
  color: #344563 !important;
}
body.layout-erp.layout-pro .app-main .page:not(#page-products) .btn-ghost:is(.active, .is-active, [aria-selected='true'], [aria-pressed='true']) {
  background: #edf5ff !important;
  border-color: #1677ff !important;
  color: #095ec9 !important;
}
body.layout-erp.layout-pro .app-main .page:not(#page-products) .btn:disabled { opacity: 0.5 !important; cursor: not-allowed; }
body.layout-erp.layout-pro .app-main .page:not(#page-products) .qcos-op-link { font-size: 14px !important; min-height: 32px; padding: 6px 8px; }

/* Exclude measurement instruments, checkboxes and sliders from standard input sizing. */
body.layout-erp.layout-pro .app-main .page:not(#page-products) :is(input[type='search'], input[type='text'], input:not([type]), input[type='email'], input[type='date'], input[type='datetime-local'], select, textarea) {
  border-color: #d6deea !important;
  border-radius: 5px !important;
  background: #fff !important;
  color: #182439 !important;
  box-shadow: none !important;
  font-size: 14px !important;
}
body.layout-erp.layout-pro .app-main .page:not(#page-products) :is(input, textarea)::placeholder { color: #738198 !important; opacity: 1; }
body.layout-erp.layout-pro .app-main .page:not(#page-products) :is(button, input, select, textarea, summary, a):focus-visible {
  outline: 2px solid #1677ff !important;
  outline-offset: 2px;
}
body.layout-erp.layout-pro .app-main .page:not(#page-products) .data-table {
  font-size: 14px !important;
  border-spacing: 0;
}
body.layout-erp.layout-pro .app-main .page:not(#page-products) .data-table thead th {
  color: #26334a !important;
  background: #f5f7fa !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  padding: 12px 14px;
  border-bottom-color: #e0e6ef !important;
}
body.layout-erp.layout-pro .app-main .page:not(#page-products) .data-table tbody td {
  color: #182439;
  font-size: 14px !important;
  border-bottom-color: #e8edf4 !important;
  padding: 12px 14px;
}
body.layout-erp.layout-pro .app-main .page:not(#page-products) .data-table td small {
  font-size: 12px !important;
  color: #64728a;
}
body.layout-erp.layout-pro .app-main .page:not(#page-products) .data-table :is(.badge, .status-pill) {
  font-size: 12px !important;
  line-height: 1.5;
}
@media (max-width: 700px) {
  body.layout-erp.layout-pro .qcos-global-header { padding: 8px 14px; }
  body.layout-erp.layout-pro .app-main .page:not(#page-products) :is(.task-command-hero, .qcos-subpage-hero) { flex-wrap: wrap; gap: 12px; }
  body.layout-erp.layout-pro .app-main .page:not(#page-products) :is(.task-command-hero, .qcos-subpage-hero) h2 { font-size: 24px !important; }
  body.layout-erp.layout-pro .app-main .page:not(#page-products) .table-wrap { overflow-x: auto; }
}

/* Dynamic surfaces used by dashboards, task lists, and empty states. */
body.layout-erp.layout-pro .app-main .page:not(#page-products) :is(.qod-kpi, .fo-kpi, .fo-kpi-card, .fo-card, .fo-flow-panel, .tq-results-workspace, .mytask-empty-state, .entry-empty-modern, .sampling-empty-state, .ai-review-empty-state, .offline-import-columns, .stats-kv, .stats-merge-body, .stats-merge-pending) {
  background: #fff !important;
  border-radius: 6px !important;
  border-color: #e0e6ef !important;
  box-shadow: none !important;
}
body.layout-erp.layout-pro .app-main .page:not(#page-products) :is(.qod-kpi, .fo-kpi, .fo-kpi-card)[aria-pressed='true'] {
  background: #edf5ff !important;
  border-color: #1677ff !important;
}
body.layout-erp.layout-pro .app-main .page:not(#page-products) :is(.qod-kpi, .fo-kpi)::after { display: none !important; }
body.layout-erp.layout-pro .app-main .page:not(#page-products) :is(.qod-list-block, .qod-list-item, .qod-priority-item, .fo-stage-box, .ct-gate-check, .qod-hero-panel) {
  border-radius: 6px !important;
  box-shadow: none !important;
}
body.layout-erp.layout-pro .app-main .page:not(#page-products) :is(.task-bulk-bar, .itr-table-head, .sampling-table-head, .mdm-status-section-head, .stats-merge-workspace-head, .ai-review-overview-bar, .ai-review-table-head, .avl-filter-bar) {
  background: #f7f9fc !important;
  border-radius: 6px !important;
  box-shadow: none !important;
}
body.layout-erp.layout-pro .app-main .page:not(#page-products) .fo-hero { background: #fff !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important; }
body.layout-erp.layout-pro .app-main .page:not(#page-products) .fo-hero::before,
body.layout-erp.layout-pro .app-main .page:not(#page-products) .fo-hero::after,
body.layout-erp.layout-pro .app-main .page:not(#page-products) .mdmp-filter-panel::before { display: none !important; }
body.layout-erp.layout-pro .app-main .page:not(#page-products) :is(.itr-template-token, .itr-rule-cell, .itr-row-actions) { background-image: none !important; border-radius: 0 !important; }
body.layout-erp.layout-pro .app-main .page:not(#page-products) .fc-task-table { border-radius: 0 !important; }
body.layout-erp.layout-pro .app-main .page:not(#page-products) :is(input, select, textarea):disabled { background: #f3f5f8 !important; color: #8994a6 !important; cursor: not-allowed; }
body.layout-erp.layout-pro .sidebar-nav .nav-item.active .nav-item-icon { color: #fff !important; }
body.layout-erp.layout-pro .sidebar-nav .nav-item.active:is(:hover, :focus) { color: #fff !important; background: #0967e3 !important; }

/* Match dialog surfaces without changing overlays, positioning, or close behavior. */
body.layout-erp.layout-pro .modal:not(#login-modal) :is(.modal-content, .modal-card),
body.layout-erp.layout-pro .modal-overlay :is(.modal-content, .modal-card),
body.layout-erp.layout-pro :is(.mdmp-drawer-panel, .prod-detail-drawer) {
  background: #fff !important;
  border-radius: 8px !important;
  border-color: #e0e6ef !important;
  box-shadow: 0 16px 48px rgb(24 36 57 / 0.15) !important;
}
body.layout-erp.layout-pro .modal:not(#login-modal) :is(.modal-head, .modal-header, .modal-footer, .modal-foot) {
  background: #fff !important;
  border-color: #e0e6ef !important;
  box-shadow: none !important;
}
body.layout-erp.layout-pro .modal:not(#login-modal) .btn { border-radius: 5px !important; font-size: 14px !important; box-shadow: none !important; }
body.layout-erp.layout-pro .modal:not(#login-modal) .btn-primary { color: #fff !important; background: #1677ff !important; border-color: #1677ff !important; }
body.layout-erp.layout-pro .app-main .page:not(#page-products) :is(.tq-task-table, .qc-task-table, .sor-detail-table) { font-size: 14px !important; }
body.layout-erp.layout-pro .app-main .page:not(#page-products) :is(.tq-task-table, .qc-task-table, .sor-detail-table) th {
  background: #f5f7fa !important; color: #26334a !important; font-size: 14px !important; font-weight: 600;
}
body.layout-erp.layout-pro .app-main .page:not(#page-products) :is(.tq-task-table, .qc-task-table, .sor-detail-table) td { font-size: 14px !important; }
body.layout-erp.layout-pro .app-main .page:not(#page-products) .task-card { border-radius: 6px !important; box-shadow: none !important; }

/* Keep complete action groups inside ledger cells after increasing control sizes. */
body.layout-erp.layout-pro .app-main #page-users-admin .ua-table { table-layout: auto; }
body.layout-erp.layout-pro .app-main #page-users-admin .ua-table td.table-actions {
  display: table-cell !important;
  min-width: 168px;
  white-space: nowrap;
  overflow: visible;
}
body.layout-erp.layout-pro .app-main .page:not(#page-products) .qcos-subpage-hero::after { display: none !important; }
