.inventory-header .cx-help{max-width:820px}
.inventory-kpis{margin-bottom:16px}
.inventory-command-tiles{margin-top:14px}
.inventory-command-tile{text-decoration:none;color:inherit;transition:transform .15s ease,border-color .15s ease}
.inventory-command-tile:hover{transform:translateY(-2px);border-color:rgba(15,118,110,.35)}
.inventory-filters{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:12px;align-items:end}
.inventory-table td,.inventory-table th,.inventory-movement-table td,.inventory-movement-table th{white-space:nowrap}
.inventory-low-list{display:grid;gap:10px;margin:0;padding-inline-start:20px}
.inventory-policy-json{direction:ltr;text-align:left;background:rgba(15,23,42,.06);border:1px solid rgba(15,23,42,.12);border-radius:14px;padding:12px;overflow:auto;max-height:260px}
.inventory-modal{max-width:820px;width:min(96vw,820px)}
.inventory-modal .cx-modal-body{display:grid;grid-template-columns:repeat(2,minmax(180px,1fr));gap:12px}
.inventory-modal textarea{min-height:90px}
.inventory-modal .cx-actions-row,.inventory-modal .inventory-full{grid-column:1/-1}
.inventory-table-wrap,.inventory-movement-table{max-height:70vh}
@media(max-width:1100px){.inventory-filters{grid-template-columns:repeat(2,minmax(150px,1fr))}}

/* Searchable inventory item pickers */
.inventory-search-field{position:relative}
.inventory-search-field .cx-input{width:100%}
.inventory-selected-item{margin-top:8px;border:1px solid rgba(15,118,110,.16);background:rgba(15,118,110,.06);border-radius:12px;padding:9px 11px;font-size:13px;color:var(--cx-muted,#64748b);display:grid;gap:4px}
.inventory-selected-item strong{color:var(--cx-text,#0f172a);font-weight:800}
.inventory-selected-item span{display:block;line-height:1.5}
.inventory-modal .cx-field.inventory-full{min-width:0}
.inventory-modal .cx-input[list]{padding-inline-start:12px}

/* Settlement intelligence and transfer follow-up */
.inventory-recommendations{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px;margin-top:12px}
.inventory-recommendation .cx-card-body{display:grid;gap:8px}
.inventory-mini-table td,.inventory-mini-table th{white-space:normal}

/* Inventory reports tabs */
.inventory-report-tabs-card .cx-card-body{display:grid;gap:14px}
.inventory-report-tabs{display:flex;flex-wrap:wrap;gap:10px;border-bottom:1px solid rgba(15,23,42,.10);padding-bottom:10px;margin-bottom:4px}
.inventory-report-tab{border:1px solid rgba(15,118,110,.18);background:rgba(255,255,255,.72);border-radius:14px;padding:10px 14px;display:grid;gap:3px;text-align:start;cursor:pointer;color:var(--cx-text,#0f172a);min-width:150px;transition:transform .14s ease,border-color .14s ease,background .14s ease}
.inventory-report-tab:hover{transform:translateY(-1px);border-color:rgba(15,118,110,.35)}
.inventory-report-tab span{font-size:12px;color:var(--cx-muted,#64748b)}
.inventory-report-tab.is-active{background:rgba(15,118,110,.10);border-color:rgba(15,118,110,.50);box-shadow:0 8px 22px rgba(15,118,110,.10)}
.inventory-report-tab-panel{display:grid;gap:14px;min-width:0}
.inventory-report-tab-heading{display:grid;gap:4px}
.inventory-report-tab-heading h3,.inventory-report-pane h3{margin:0 0 8px;font-size:16px}
.inventory-report-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:start}
.inventory-report-pane{min-width:0;border:1px solid rgba(15,23,42,.08);border-radius:16px;padding:12px;background:rgba(255,255,255,.55)}
@media(max-width:1100px){.inventory-report-grid{grid-template-columns:1fr}.inventory-report-tab{min-width:130px;flex:1}}

/* Production log global UI */
.production-page-kpis{margin-block:16px}.inventory-movement-table tr[data-clickable="true"]{cursor:pointer}.inventory-production-readonly-note{padding:10px 12px;border-radius:14px;background:rgba(124,58,237,.10);border:1px solid rgba(124,58,237,.18);color:var(--cx-text,#1f1633)}


/* Production KPI cards aligned with dashboard/global cards */
.production-page-kpis {
  margin-block: var(--cx-space-5);
  grid-auto-rows: 1fr;
}
.production-page-kpis.cx-grid-5 { grid-template-columns: repeat(5, minmax(150px, 1fr)); }
.production-page-kpis.cx-grid-4 { grid-template-columns: repeat(4, minmax(170px, 1fr)); }
.production-page-kpis .cx-kpi { min-height: 138px; padding: var(--cx-space-5); }
@media (max-width: 1280px) { .production-page-kpis.cx-grid-5,.production-page-kpis.cx-grid-4 { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width: 900px) { .production-page-kpis.cx-grid-5,.production-page-kpis.cx-grid-4 { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 640px) { .production-page-kpis.cx-grid-5,.production-page-kpis.cx-grid-4 { grid-template-columns: 1fr; } }

/* Production log columns and details */
.production-ledger-table .cx-table,.production-batch-table .cx-table{min-width:1080px;}
.production-detail-modal .cx-card{margin:0 0 12px;}

/* Production ledger tabs */
.production-ledger-tabs-card .cx-card-body{display:grid;gap:14px;}
.production-tabs-help{margin:0;padding:10px 12px;border:1px solid var(--cx-border,#e6e0f4);border-radius:14px;background:color-mix(in srgb,var(--cx-surface,#fff) 94%,#7c3aed 6%);}
.production-ledger-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
.production-ledger-tab{border:1px solid var(--cx-border,#e6e0f4);border-radius:18px;background:var(--cx-surface,#fff);padding:12px 14px;text-align:start;cursor:pointer;display:grid;gap:4px;color:var(--cx-text,#1f1633);transition:.16s ease;}
.production-ledger-tab strong{font-size:14px}.production-ledger-tab small{color:var(--cx-muted,#6b627a);font-size:11px;}
.production-ledger-tab.is-active{border-color:color-mix(in srgb,#7c3aed 60%,#db2777 40%);background:linear-gradient(135deg,rgba(124,58,237,.12),rgba(219,39,119,.08));box-shadow:0 14px 30px rgba(124,58,237,.14);}
.production-tab-panel{display:grid;gap:12px;}
.production-tab-toolbar{align-items:end;justify-content:flex-start;flex-wrap:wrap;}
.production-tab-table-wrap{padding:0;overflow:auto;}
@media(max-width:720px){.production-ledger-tabs{grid-template-columns:1fr}}

/* Live table search without apply buttons */
.production-tab-toolbar .cx-live-search-field{min-width:260px;max-width:420px;width:100%}
.production-tab-table-wrap{transition:opacity .16s ease}

/* Phase 33 — Inventory operational pages upgrade */
.inventory-page-kpis{margin:16px 0}
.inventory-page-card .cx-card-header{align-items:flex-start}
.inventory-page-card .cx-card-header h2{margin-bottom:4px}
.inventory-smart-table .cx-status-pill{white-space:nowrap}
.inventory-action-stack{display:flex;gap:8px;align-items:center;justify-content:flex-start;flex-wrap:wrap}
.inventory-insight-card{margin-top:16px}
.inventory-insight-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.inventory-insight-grid>div{border:1px solid rgba(99,102,241,.14);border-radius:16px;padding:14px;background:linear-gradient(135deg,rgba(255,255,255,.86),rgba(250,245,255,.74))}
.inventory-insight-grid strong{display:block;margin-top:5px;font-size:1.05rem;color:var(--cx-text,#111827)}
.inventory-insight-grid small{display:block;margin-top:4px;color:var(--cx-muted,#6b7280)}
.inventory-modal-kpis{margin-bottom:14px}
.inventory-detail-modal .cx-table-wrap{max-height:360px;overflow:auto}
.inventory-report-tab strong{display:block}
.inventory-report-tab span{opacity:.78}
.inventory-page-card .cx-filter-bar{border-top:1px solid rgba(99,102,241,.12)}
.inventory-movement-table tr[data-row-semantic="warn"] td:first-child,
.inventory-smart-table tr[data-row-semantic="warn"] td:first-child{box-shadow:inset -3px 0 0 rgba(245,158,11,.75)}
.inventory-movement-table tr[data-row-semantic="ok"] td:first-child,
.inventory-smart-table tr[data-row-semantic="ok"] td:first-child{box-shadow:inset -3px 0 0 rgba(16,185,129,.65)}
@media (max-width: 900px){
  .inventory-insight-grid{grid-template-columns:1fr}
  .inventory-action-stack{justify-content:flex-start}
  .inventory-page-card .cx-filter-bar{grid-template-columns:1fr}
}

/* Phase 34B — Raw Materials Health + Ledger Intelligence UI */
.inventory-intel-kpis .cx-kpi-value{letter-spacing:-.02em}
.inventory-health-card .cx-card-body{display:grid;gap:16px}
.inventory-health-strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:4px}
.inventory-health-strip>div{border:1px solid rgba(20,184,166,.16);background:linear-gradient(135deg,rgba(240,253,250,.9),rgba(255,255,255,.82));border-radius:18px;padding:14px}
.inventory-health-strip strong{display:block;margin-top:5px;font-size:1.14rem;color:var(--cx-text,#111827)}
.inventory-health-score{display:inline-flex;align-items:baseline;gap:2px;min-width:54px;justify-content:center;border-radius:999px;padding:7px 10px;background:rgba(16,185,129,.12);color:#047857;border:1px solid rgba(16,185,129,.22)}
.inventory-health-score[data-state="warn"]{background:rgba(245,158,11,.12);color:#92400e;border-color:rgba(245,158,11,.24)}
.inventory-health-score[data-state="danger"]{background:rgba(239,68,68,.12);color:#991b1b;border-color:rgba(239,68,68,.24)}
.inventory-health-score strong{font-size:1.05rem;line-height:1}
.inventory-health-score small{font-size:.72rem;opacity:.8}
.inventory-health-table td:nth-child(2),.inventory-health-table th:nth-child(2){text-align:center}
.inventory-risk-panel article h3,.inventory-ledger-intel article h3{margin:0 0 10px;font-size:1rem}
.inventory-ledger-intel .cx-card-body,.inventory-risk-panel .cx-card-body{gap:16px}
.inventory-ledger-intel article,.inventory-risk-panel article{min-width:0;border:1px solid rgba(99,102,241,.12);border-radius:18px;padding:14px;background:rgba(255,255,255,.68)}
.inventory-mini-table .cx-table{font-size:.92rem}
@media (max-width: 1100px){
  .inventory-health-strip{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width: 720px){
  .inventory-health-strip{grid-template-columns:1fr}
  .inventory-ledger-intel .cx-card-body,.inventory-risk-panel .cx-card-body{grid-template-columns:1fr}
}

/* Phase 34C — Waste/Audit/Transfer/Component intelligence + raw material modal hotfix */
.inventory-waste-intel article,
.inventory-audit-intel article,
.inventory-transfer-intel article{min-width:0;border:1px solid rgba(99,102,241,.12);border-radius:18px;padding:14px;background:rgba(255,255,255,.7)}
.inventory-wide-pane{grid-column:1/-1}
.inventory-alert-list{display:grid;gap:10px}
.inventory-alert{border-radius:14px;padding:12px;border:1px solid rgba(148,163,184,.2);background:rgba(248,250,252,.88)}
.inventory-alert strong{display:block;margin-bottom:4px}
.inventory-alert span{display:block;color:var(--cx-muted,#64748b);font-size:.92rem}
.inventory-alert[data-level="warn"]{border-color:rgba(245,158,11,.28);background:rgba(255,251,235,.88)}
.inventory-alert[data-level="danger"]{border-color:rgba(239,68,68,.28);background:rgba(254,242,242,.88)}
.inventory-alert[data-level="ok"]{border-color:rgba(16,185,129,.24);background:rgba(240,253,244,.86)}
.inventory-component-consumption-table .cx-status-pill{white-space:nowrap}
.inventory-item-modal .cx-modal-card,
.inventory-item-modal.cx-modal-card{max-width:min(760px,calc(100vw - 32px));overflow-x:hidden}
.inventory-item-form{overflow-x:hidden;max-width:100%;box-sizing:border-box}
.inventory-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:start;max-width:100%;overflow-x:hidden}
.inventory-form-grid .cx-field{min-width:0}
.inventory-form-grid .cx-input,
.inventory-form-grid .cx-select,
.inventory-form-grid select,
.inventory-form-grid input{min-width:0;max-width:100%;width:100%;box-sizing:border-box}
.inventory-modal-actions{justify-content:flex-start;gap:10px;position:sticky;bottom:0;background:linear-gradient(180deg,rgba(255,255,255,.86),#fff);padding-top:10px}
@media (max-width: 780px){
  .inventory-form-grid{grid-template-columns:1fr}
  .inventory-item-modal .cx-modal-card,
  .inventory-item-modal.cx-modal-card{max-width:calc(100vw - 18px)}
  .inventory-wide-pane{grid-column:auto}
}

/* Phase 35A/B — Inventory count Excel import foundation */
.inventory-count-sessions .cx-table-wrap{max-height:420px}
.inventory-count-import-form{overflow-x:hidden}
.inventory-count-import-steps{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.inventory-count-import-steps .cx-card{min-width:0}
.inventory-count-preview{display:grid;gap:14px;margin-top:14px}
.inventory-count-preview .cx-card{min-width:0}
.inventory-count-modal .cx-modal-card,
.inventory-count-modal.cx-modal-card{max-width:min(980px,calc(100vw - 32px));overflow-x:hidden}
.inventory-count-modal [data-count-preview-zone]{min-height:0}
@media (max-width: 820px){
  .inventory-count-import-steps{grid-template-columns:1fr}
}

.inventory-count-drop{border:1.5px dashed rgba(20,184,166,.45);border-radius:16px;padding:18px;text-align:center;background:rgba(240,253,250,.74);color:#0f766e;margin-bottom:10px}
.inventory-count-drop.is-dragover{background:rgba(204,251,241,.95);border-color:#0f766e}

/* Phase 35C — Audit Control Tabs Cleanup */
.inventory-audit-control .cx-card-body{display:grid;gap:16px}
.inventory-audit-tabs{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}
.inventory-audit-tab{border:1px solid rgba(124,58,237,.14);background:rgba(255,255,255,.78);border-radius:16px;padding:12px;text-align:right;cursor:pointer;display:grid;gap:4px;min-width:0;color:var(--cx-text,#111827)}
.inventory-audit-tab:hover{border-color:rgba(124,58,237,.32);box-shadow:0 8px 20px rgba(88,28,135,.08)}
.inventory-audit-tab.is-active{background:linear-gradient(135deg,rgba(124,58,237,.14),rgba(236,72,153,.12));border-color:rgba(124,58,237,.42);box-shadow:0 10px 26px rgba(88,28,135,.13)}
.inventory-audit-tab strong{font-size:.98rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.inventory-audit-tab small{color:var(--cx-muted,#64748b);font-size:.78rem;line-height:1.35}
.inventory-audit-tab-body{display:grid;gap:16px}
.inventory-audit-tab-stack{display:grid;gap:16px}
.inventory-audit-primary-card,
.inventory-audit-sources-card{border-color:rgba(124,58,237,.14)}
.inventory-audit-primary-card>.cx-card-header,
.inventory-audit-sources-card>.cx-card-header{align-items:flex-start}
.inventory-audit-tab-kpis{margin-bottom:14px}
.inventory-count-session-table .cx-table-wrap{max-height:520px}
.inventory-audit-sources-card .inventory-insight-card{margin-bottom:14px}
@media (max-width: 1180px){
  .inventory-audit-tabs{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (max-width: 760px){
  .inventory-audit-tabs{grid-template-columns:1fr}
  .inventory-audit-tab strong{white-space:normal}
}

/* Phase 35C2 — Count upload modal professional rebuild */
.inventory-count-modal.cx-modal{
  width:min(1120px,calc(100vw - 34px)) !important;
  max-width:min(1120px,calc(100vw - 34px)) !important;
}
.inventory-count-modal.cx-modal>.cx-modal-body{
  display:block !important;
  grid-template-columns:none !important;
  padding:0 !important;
  overflow:auto;
}
.inventory-count-modal .inventory-count-import-form{
  display:grid;
  grid-template-rows:minmax(0,1fr) auto;
  min-height:0;
  overflow:hidden;
}
.inventory-count-modal-layout{
  display:grid;
  gap:16px;
  padding:18px;
  min-width:0;
}
.inventory-count-hero{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding:18px;
  border:1px solid rgba(124,58,237,.16);
  border-radius:22px;
  background:linear-gradient(135deg,rgba(124,58,237,.12),rgba(20,184,166,.10));
}
.inventory-count-hero h3{margin:0 0 6px;font-size:1.25rem}
.inventory-count-hero p{margin:0;color:var(--cx-muted,#64748b);line-height:1.6}
.inventory-count-hero-badges{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.inventory-count-hero-badges span{
  border:1px solid rgba(124,58,237,.18);
  background:rgba(255,255,255,.76);
  border-radius:999px;
  padding:7px 10px;
  font-size:.82rem;
  white-space:nowrap;
}
.inventory-count-form-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}
.inventory-count-form-grid .cx-field{min-width:0}
.inventory-count-form-grid .cx-input,
.inventory-count-form-grid select,
.inventory-count-form-grid input{
  width:100%;
  min-width:0;
  max-width:100%;
  box-sizing:border-box;
}
.inventory-count-workflow{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
}
.inventory-count-step-card{min-width:0}
.inventory-count-step-card .cx-card-body{display:grid;gap:12px}
.inventory-count-drop{
  display:grid;
  gap:5px;
  min-height:104px;
  place-items:center;
  border:2px dashed rgba(20,184,166,.45);
  border-radius:18px;
  padding:18px;
  text-align:center;
  background:rgba(240,253,250,.78);
  color:#0f766e;
}
.inventory-count-drop strong{font-size:1rem}
.inventory-count-drop small{font-size:.86rem;opacity:.82}
.inventory-count-drop.is-dragover{background:rgba(204,251,241,.96);border-color:#0f766e}
.inventory-count-preview-zone{min-width:0}
.inventory-count-empty-preview{
  display:grid;
  gap:5px;
  place-items:center;
  min-height:130px;
  border:1px dashed rgba(148,163,184,.35);
  border-radius:18px;
  color:var(--cx-muted,#64748b);
  background:rgba(248,250,252,.72);
  text-align:center;
}
.inventory-count-empty-preview strong{color:var(--cx-text,#111827)}
.inventory-count-modal-actions{
  margin:0;
  padding:14px 18px;
  border-top:1px solid var(--cx-border,rgba(148,163,184,.22));
  background:var(--cx-surface,#fff);
  position:sticky;
  bottom:0;
  z-index:2;
  justify-content:flex-start;
}
.inventory-count-preview .cx-table-wrap{max-height:360px;overflow:auto}
@media (max-width: 980px){
  .inventory-count-form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .inventory-count-workflow{grid-template-columns:1fr}
  .inventory-count-hero{display:grid}
}
@media (max-width: 640px){
  .inventory-count-modal.cx-modal{width:calc(100vw - 18px) !important;max-width:calc(100vw - 18px) !important}
  .inventory-count-form-grid{grid-template-columns:1fr}
  .inventory-count-modal-layout{padding:12px}
  .inventory-count-modal-actions{padding:12px;display:grid}
}

/* Phase 35D — Audit Control Comparison Grid */
.inventory-audit-scope-tabs{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin:0 0 14px;
}
.inventory-audit-scope-tab{
  border:1px solid rgba(124,58,237,.18);
  background:rgba(255,255,255,.78);
  border-radius:999px;
  padding:8px 13px;
  cursor:pointer;
  color:var(--cx-text,#111827);
}
.inventory-audit-scope-tab.is-active{
  background:linear-gradient(135deg,rgba(124,58,237,.18),rgba(236,72,153,.12));
  border-color:rgba(124,58,237,.42);
  font-weight:800;
}
.inventory-audit-comparison-table .cx-table-wrap{
  max-height:62vh;
}
.inventory-audit-comparison-table td,
.inventory-audit-comparison-table th{
  vertical-align:middle;
}
.inventory-audit-number{
  appearance:none;
  border:1px solid rgba(124,58,237,.16);
  background:rgba(248,250,252,.82);
  color:var(--cx-text,#111827);
  border-radius:12px;
  padding:7px 10px;
  min-width:74px;
  cursor:pointer;
  display:inline-grid;
  gap:2px;
  place-items:center;
}
.inventory-audit-number:hover{
  border-color:rgba(124,58,237,.38);
  background:rgba(245,243,255,.92);
}
.inventory-audit-number small{
  font-size:.68rem;
  color:var(--cx-muted,#64748b);
}
.cx-btn-xs{
  padding:5px 9px;
  font-size:.78rem;
  border-radius:10px;
  margin-top:4px;
}
.inventory-count-sessions-compact .cx-table-wrap{
  max-height:320px;
}
.inventory-audit-drill.cx-modal{
  width:min(1080px,calc(100vw - 34px)) !important;
}
.inventory-audit-drill .inventory-detail-modal{
  min-width:0;
}
.inventory-audit-drill .cx-table-wrap{
  max-height:360px;
}
@media(max-width:820px){
  .inventory-audit-number{min-width:56px;padding:6px 8px}
}

/* Phase 35F/G/H — Settlement permission, final cleanup, theoretical vs actual */
.inventory-count-settle-modal.cx-modal{
  width:min(860px,calc(100vw - 34px)) !important;
}
.inventory-count-settle-form textarea.cx-input{
  min-height:110px;
}
.inventory-count-settle-form .cx-table-wrap{
  max-height:260px;
}
.inventory-count-session-table .cx-btn-xs{
  white-space:nowrap;
}
.inventory-component-consumption-table td:nth-child(3),
.inventory-component-consumption-table td:nth-child(4),
.inventory-component-consumption-table td:nth-child(5){
  text-align:center;
}
.inventory-audit-primary-card .cx-card-body{
  gap:14px;
}
.inventory-audit-tab-stack>.cx-card{
  min-width:0;
}

/* Phase 35I — Audit operational grid and source-only drilldowns */
.inventory-audit-operational-table .cx-table-wrap{
  max-height:64vh;
  overflow:auto;
}
.inventory-audit-operational-table th,
.inventory-audit-operational-table td{
  vertical-align:middle;
}
.inventory-audit-static{
  display:inline-flex;
  min-width:62px;
  justify-content:center;
  padding:7px 10px;
  border-radius:12px;
  background:rgba(248,250,252,.86);
  border:1px solid rgba(148,163,184,.18);
  color:var(--cx-text,#111827);
  font-weight:700;
}
.inventory-audit-actual-cell{
  display:inline-grid;
  gap:3px;
  justify-items:center;
}
.inventory-audit-actual-cell small{
  font-size:.68rem;
  color:var(--cx-muted,#64748b);
}
.inventory-audit-source-btn{
  appearance:none;
  border:1px solid rgba(124,58,237,.18);
  background:rgba(255,255,255,.88);
  color:var(--cx-text,#111827);
  border-radius:13px;
  padding:7px 11px;
  min-width:76px;
  cursor:pointer;
  display:inline-grid;
  gap:2px;
  place-items:center;
}
.inventory-audit-source-btn[data-state="in"]{
  border-color:rgba(16,185,129,.28);
  background:rgba(240,253,244,.9);
}
.inventory-audit-source-btn[data-state="out"]{
  border-color:rgba(245,158,11,.3);
  background:rgba(255,251,235,.92);
}
.inventory-audit-source-btn[data-state="empty"]{
  opacity:.72;
  cursor:default;
}
.inventory-audit-source-btn strong{
  font-size:.92rem;
}
.inventory-audit-source-btn small{
  font-size:.68rem;
  color:var(--cx-muted,#64748b);
}
.inventory-audit-source-btn:hover{
  box-shadow:0 8px 18px rgba(88,28,135,.09);
  transform:translateY(-1px);
}
.inventory-audit-source-details-table .cx-table-wrap{
  max-height:470px;
  overflow:auto;
}
.inventory-audit-source-drill.cx-modal{
  width:min(1120px,calc(100vw - 34px)) !important;
}
.inventory-audit-source-modal{
  min-width:0;
}
.inventory-audit-comparison-table .inventory-audit-number{
  display:none;
}
@media(max-width:900px){
  .inventory-audit-static,
  .inventory-audit-source-btn{
    min-width:54px;
    padding:6px 8px;
  }
}

/* Phase 35J — clean count template, manual count entry, consumption column, polished source modals */
.inventory-consumption-cell{
  display:grid;
  gap:3px;
  justify-items:center;
  min-width:86px;
}
.inventory-consumption-cell strong{
  color:var(--cx-text,#111827);
}
.inventory-consumption-cell span{
  color:var(--cx-muted,#64748b);
  font-size:.82rem;
}
.inventory-consumption-cell small{
  border-radius:999px;
  padding:3px 8px;
  font-size:.7rem;
  background:rgba(148,163,184,.14);
  color:#475569;
}
.inventory-consumption-cell small[data-state="ok"]{
  background:rgba(16,185,129,.13);
  color:#047857;
}
.inventory-manual-count-card .cx-card-header{
  align-items:flex-start;
}
.inventory-manual-count-table .cx-input{
  min-width:110px;
}
.inventory-manual-actual-input{
  font-weight:800;
  text-align:center;
}
.inventory-manual-count-wrap .cx-table-wrap{
  max-height:420px;
  overflow:auto;
}
.inventory-source-modal-shell{
  display:grid;
  gap:16px;
  min-width:0;
}
.inventory-source-hero{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  padding:18px;
  border-radius:22px;
  border:1px solid rgba(124,58,237,.16);
  background:linear-gradient(135deg,rgba(124,58,237,.12),rgba(20,184,166,.09));
}
.inventory-source-hero h3{
  margin:0 0 5px;
  font-size:1.22rem;
}
.inventory-source-hero p{
  margin:0;
  color:var(--cx-muted,#64748b);
}
.inventory-source-kpis{
  margin:0;
}
.inventory-source-groups{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
}
.inventory-source-groups article{
  border:1px solid rgba(148,163,184,.18);
  background:rgba(255,255,255,.78);
  border-radius:16px;
  padding:13px;
  display:grid;
  gap:4px;
}
.inventory-source-groups article span{
  color:var(--cx-muted,#64748b);
  font-size:.82rem;
}
.inventory-source-groups article strong{
  font-size:1.04rem;
  color:var(--cx-text,#111827);
}
.inventory-source-groups article small{
  color:var(--cx-muted,#64748b);
}
.inventory-source-table-card .cx-table-wrap{
  max-height:430px;
  overflow:auto;
}
.inventory-ref-btn{
  white-space:nowrap;
}
@media(max-width:980px){
  .inventory-source-groups{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:640px){
  .inventory-source-hero{display:grid}
  .inventory-source-groups{grid-template-columns:1fr}
}


/* Phase 35J2 verified cumulative marker: audit control final bundle */

/* Phase 35J3 — count entry title/modal clarity */
.inventory-manual-count-card{
  border-color:rgba(16,185,129,.24) !important;
  background:linear-gradient(180deg,rgba(240,253,244,.72),rgba(255,255,255,.86));
}
.inventory-manual-count-card .cx-card-header h3{
  color:#047857;
}
.inventory-count-modal .inventory-count-workflow{
  margin-top:4px;
}


/* Phase 35K — final audit columns and remove duplicated sessions */
.inventory-audit-final-table th:nth-child(3),
.inventory-audit-final-table th:nth-child(7){
  background:rgba(16,185,129,.09);
}
.inventory-audit-final-table .inventory-audit-actual-cell small{
  color:#64748b;
  font-size:.7rem;
}
.inventory-count-sessions-compact{
  display:none !important;
}


/* Phase 35L — professional source modal polish */
.inventory-audit-source-drill-pro.cx-modal{
  width:min(1280px,calc(100vw - 42px)) !important;
  max-width:min(1280px,calc(100vw - 42px)) !important;
}
.inventory-audit-source-drill-pro .cx-modal-body{
  padding:22px !important;
  max-height:min(78vh,760px) !important;
  overflow:auto !important;
  display:block !important;
}
.inventory-audit-source-drill-pro .inventory-source-modal-shell{
  width:100%;
  display:grid;
  gap:18px;
}
.inventory-audit-source-drill-pro .inventory-source-hero{
  min-height:96px;
  align-items:center;
  padding:22px 24px;
  border-radius:24px;
  background:
    radial-gradient(circle at top left,rgba(124,58,237,.20),transparent 34%),
    linear-gradient(135deg,rgba(255,255,255,.96),rgba(245,243,255,.92));
  box-shadow:0 18px 46px rgba(88,28,135,.11);
}
.inventory-audit-source-drill-pro .inventory-source-hero h3{
  font-size:1.35rem;
}
.inventory-audit-source-drill-pro .inventory-source-kpis{
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
}
.inventory-audit-source-drill-pro .inventory-source-group-card,
.inventory-audit-source-drill-pro .inventory-source-table-card{
  border-radius:22px;
  box-shadow:0 14px 38px rgba(15,23,42,.06);
}
.inventory-audit-source-drill-pro .inventory-source-groups{
  grid-template-columns:repeat(4,minmax(0,1fr));
}
.inventory-audit-source-drill-pro .inventory-source-groups article{
  min-height:96px;
  padding:16px;
  border-radius:18px;
}
.inventory-source-empty{
  min-height:120px;
  border:1px dashed rgba(124,58,237,.25);
  background:linear-gradient(135deg,rgba(250,245,255,.75),rgba(255,255,255,.9));
  border-radius:18px;
  display:grid;
  place-items:center;
  text-align:center;
  gap:6px;
  padding:22px;
}
.inventory-source-empty strong{
  color:#4c1d95;
  font-size:1rem;
}
.inventory-source-empty span{
  color:#64748b;
  max-width:520px;
}
.inventory-audit-source-drill-pro .inventory-audit-source-details-table .cx-table-wrap{
  max-height:430px;
  overflow:auto;
  border-radius:16px;
}
.inventory-audit-source-drill-pro .inventory-audit-source-details-table table{
  min-width:900px;
}
@media(max-width:1000px){
  .inventory-audit-source-drill-pro .inventory-source-kpis,
  .inventory-audit-source-drill-pro .inventory-source-groups{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
}
@media(max-width:640px){
  .inventory-audit-source-drill-pro.cx-modal{
    width:calc(100vw - 18px) !important;
  }
  .inventory-audit-source-drill-pro .cx-modal-body{
    padding:14px !important;
  }
  .inventory-audit-source-drill-pro .inventory-source-kpis,
  .inventory-audit-source-drill-pro .inventory-source-groups{
    grid-template-columns:1fr !important;
  }
}
