/* ERP-only additions on top of the vendored M3 "Enterprise · Clean" theme
   (static/vendor/m3). Reuse M3 classes first; only add what M3 lacks. */
.erp-filters { display:flex; flex-wrap:wrap; align-items:flex-end; gap:12px; margin:0 0 16px; }
.erp-filters .form-field { min-width:160px; margin:0; }
.erp-actions { display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
.erp-actions form { margin:0; }
.erp-pager { display:flex; align-items:center; gap:12px; margin-top:12px; }
.erp-muted { color:var(--text-3); font-size:13px; }
.erp-check-grid { display:flex; flex-wrap:wrap; gap:6px 18px; }
.erp-scope-list { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:12px; }
.erp-chip-remove { border:0; background:none; color:inherit; cursor:pointer; padding:0 0 0 4px; font:inherit; }
.erp-copy { width:100%; padding:8px; border:1px solid var(--border); border-radius:var(--radius); }
.erp-plain { border:0; padding:0; margin:0; min-width:0; }
.erp-matrix td { white-space:normal; }
.erp-cell { display:inline-flex; align-items:center; gap:4px; margin:2px 16px 2px 0; }
.erp-json { white-space:normal; font-size:12px; max-width:320px; word-break:break-word; }
.login-lang { display:flex; justify-content:center; gap:8px; margin-top:16px; }
.login-lang form { margin:0; }
.login-lang button { border:0; background:none; color:var(--text-2); cursor:pointer; font:inherit; font-size:12px; }
.login-lang button.active { color:var(--accent); font-weight:600; }
.qr svg { width:200px; height:200px; display:block; margin:12px auto; }
.inline-form { display:inline; }
.erp-stat-row { display:flex; flex-wrap:wrap; gap:12px; margin:0 0 16px; }
.erp-stat { display:flex; flex-direction:column; gap:2px; min-width:200px; padding:10px 14px; border:1px solid var(--border); border-radius:var(--radius-lg); background:var(--panel); color:var(--text); text-decoration:none; box-shadow:var(--shadow); }
.erp-stat strong { font-size:22px; line-height:1.2; }
.erp-stat-label, .erp-stat-meta { font-size:12px; color:var(--text-2); display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.erp-attachment { display:flex; flex-wrap:wrap; align-items:center; gap:12px; padding:8px 0; border-bottom:1px solid var(--border); }
.erp-attachment > div { display:flex; flex-direction:column; flex:1; min-width:200px; }
.erp-attachment-thumb { max-height:96px; max-width:160px; border:1px solid var(--border); border-radius:var(--radius); object-fit:contain; }
/* Count chips — IAGSupply admin view-filter.tsx (tones map to M3 theme tokens) */
.erp-chips { display:flex; flex-wrap:wrap; gap:6px; margin:0 0 12px; }
.erp-chip { display:inline-flex; gap:6px; align-items:center; padding:3px 9px; border-radius:var(--chip-radius); font-size:12px; font-weight:600; text-decoration:none; background:var(--surface); color:var(--text-2); }
.erp-chip.tone-good { background:var(--good-soft); color:var(--good); }
.erp-chip.tone-warn { background:var(--warn-soft); color:var(--warn); }
.erp-chip.tone-bad { background:var(--bad-soft); color:var(--bad); }
.erp-chip.tone-accent { background:var(--accent-soft); color:var(--accent); }
.erp-chip.active { background:var(--accent); color:#fff; }
td.num { text-align:right; }
.erp-hit { display:flex; flex-wrap:wrap; gap:10px; align-items:baseline; padding:6px 0; border-bottom:1px solid var(--border); }
.search-groups { display:grid; gap:12px; }
.erp-topsearch { flex:1; max-width:420px; margin:0 16px; }
.erp-topsearch input { width:100%; padding:7px 10px; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); font:inherit; }
/* Scan input — IAGSupply scan-console brief */
.erp-scan-input { font-size:28px !important; padding:14px 16px !important; letter-spacing:.04em; }
.erp-scan-banner { min-height:64px; margin:12px 0; border-radius:var(--radius-lg); }
.erp-scan-banner.flash-ok { animation: erp-flash-ok .6s; }
.erp-scan-banner.flash-bad { animation: erp-flash-bad .9s; }
@keyframes erp-flash-ok { from { background:var(--good-soft); } to { background:transparent; } }
@keyframes erp-flash-bad { from { background:var(--bad-soft); } to { background:transparent; } }
.erp-scan-result { display:flex; gap:16px; align-items:center; padding:12px 16px; border:1px solid var(--border); border-radius:var(--radius-lg); background:var(--panel); }
.erp-scan-result .big { font-size:34px; line-height:1; }
.erp-scan-session-head { display:flex; gap:8px; align-items:center; }
.erp-scan-list { list-style:none; padding:0; margin:8px 0; max-height:320px; overflow:auto; font-family:var(--font-mono); }
.erp-scan-list li { padding:4px 8px; border-bottom:1px solid var(--border); }
.erp-scan-list li.bad { color:var(--bad); }
.erp-section-edit { margin-left:auto; }
.erp-section-edit[open] { width:100%; margin-top:8px; }
.panel-head { flex-wrap:wrap; }
.erp-address-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:10px; margin:12px 0; }
.erp-address { border:1px solid var(--border); border-radius:var(--radius); padding:8px 10px; font-size:13px; }
.erp-req-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:8px 16px; }
.erp-req-grid dt { color:var(--text-3); font-size:12px; }
.erp-req-grid dd { margin:0; }
.erp-card-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(340px,1fr)); gap:12px; }
/* M7 warehouse: IMEI lookup and small filter forms */
.erp-lookup { display:inline-flex; align-items:center; gap:8px; margin:0; }
.erp-lookup input, .erp-filter input { min-height:38px; padding:6px 10px; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); font:inherit; width:15rem; max-width:100%; }
.erp-filter { display:flex; flex-wrap:wrap; align-items:flex-end; gap:10px; margin:0 0 14px; }
/* M9 shell: "replaces sheet" tag, collapsible nav group, key hints (prototype .sheet-tag / .kbd) */
.sheet-tag { margin:0 0 10px; font-size:12px; color:var(--muted, #6b7280); }
.sheet-tag b { font-weight:600; color:var(--text, #111827); }
details.nav-collapse > summary { cursor:pointer; list-style:none; }
details.nav-collapse > summary::-webkit-details-marker { display:none; }
details.nav-collapse > summary::after { content:"▸"; margin-left:6px; font-size:10px; }
details.nav-collapse[open] > summary::after { content:"▾"; }
.kbd { font-family:ui-monospace, SFMono-Regular, Menlo, monospace; font-size:10px; border:1px solid var(--border); border-bottom-width:2px; border-radius:4px; padding:1px 5px; background:var(--surface); }
/* M9 home: work list rows and today strip (prototype .task-row / .stat) */
.erp-home-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(320px, 1fr)); gap:16px; margin-bottom:16px; }
.task-list { display:flex; flex-direction:column; }
.task-row { display:flex; gap:12px; align-items:center; padding:10px 16px; border-top:1px solid var(--border); color:inherit; text-decoration:none; }
.task-row:hover, .task-row:focus { background:var(--surface); }
.task-row .t-n { min-width:2.5em; font-weight:700; font-size:16px; text-align:right; }
.task-row .t-t { flex:1; }
.task-row .t-go { color:var(--muted, #6b7280); }
.task-row .t-w { font-size:11px; color:var(--muted, #6b7280); }
.task-row.tone-warn .t-n { color:#b45309; }
.task-row.tone-bad .t-n { color:#b91c1c; }
.erp-today .tone-good strong { color:#15803d; }
.erp-today .tone-bad strong { color:#b91c1c; }
/* M9 scan console: key hints, session stats, error queue */
.erp-scan-keys { margin:4px 0 8px; font-size:12px; color:var(--muted, #6b7280); }
.erp-scan-stats { display:grid; grid-template-columns:repeat(5, minmax(0, 1fr)); gap:8px; margin:10px 0; }
.erp-scan-stats > div { border:1px solid var(--border); border-radius:var(--radius); padding:6px 10px; display:flex; flex-direction:column; }
.erp-scan-stats span { font-size:11px; color:var(--muted, #6b7280); }
.erp-scan-stats strong { font-size:18px; }
.erp-scan-stats .good strong { color:#15803d; }
.erp-scan-stats .bad strong { color:#b91c1c; }
.erp-scan-errors { border:1px solid #fecaca; background:#fef2f2; border-radius:var(--radius); padding:8px 10px; margin-bottom:10px; }
[data-scan-row]:focus { outline:2px solid var(--accent, #4f46e5); outline-offset:-2px; }
/* M9 carton fill bar (prototype .progress with a minimum marker) */
.erp-progress { position:relative; height:12px; max-width:420px; background:var(--surface); border:1px solid var(--border); border-radius:99px; overflow:visible; margin-top:6px; }
.erp-progress > i { display:block; height:100%; background:var(--accent, #4f46e5); border-radius:99px; transition:width .2s ease; }
.erp-progress-min { position:absolute; top:-4px; bottom:-4px; width:2px; background:#b45309; }
/* M9 IMEI drawer (prototype .drawer / .scrim) */
.erp-scrim { position:fixed; inset:0; background:rgba(17,24,39,.35); z-index:80; }
.erp-drawer { position:fixed; top:0; right:0; bottom:0; width:min(440px, 100vw); background:#fff; z-index:81; box-shadow:-8px 0 24px rgba(0,0,0,.12); overflow:auto; }
.erp-drawer-head { display:flex; align-items:flex-start; gap:12px; justify-content:space-between; padding:16px 18px; border-bottom:1px solid var(--border); }
.erp-drawer-head h2 { margin:2px 0; }
.erp-drawer-body { padding:14px 18px; }
.erp-drawer-timeline { list-style:none; padding:0; margin:6px 0 14px; display:flex; flex-direction:column; gap:6px; font-size:12.5px; }
/* M11 quotes: builder (lines + side panel), grid cells */
.quote-layout { display:grid; grid-template-columns:minmax(0,1fr) 320px; gap:16px; align-items:start; }
@media (max-width: 1100px) { .quote-layout { grid-template-columns:minmax(0,1fr); } }
.quote-cell { width:6.5rem; min-height:32px; padding:4px 8px; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); font:inherit; text-align:right; font-variant-numeric:tabular-nums; }
.quote-cell.wide { width:12rem; text-align:left; }
.quote-totals { display:flex; flex-wrap:wrap; gap:8px 24px; align-items:baseline; }
.quote-grid th.cg, .quote-grid td.cg { border-left:1px solid var(--border); }
.quote-grid thead tr:first-child th { text-align:center; }
/* M12 orders: status steps (canvas OrderDetail) */
.erp-steps { display:flex; flex-wrap:wrap; gap:4px; margin:0 0 12px; padding:0; list-style:none; }
.erp-steps li { padding:4px 10px; border:1px solid var(--border); border-radius:999px; font-size:12px; color:var(--muted, #5a6475); background:var(--surface); }
.erp-steps li.done { color:inherit; border-color:var(--border); background:var(--surface-alt, #eef0f4); }
.erp-steps li.now { color:#fff; background:var(--accent, #3949ab); border-color:var(--accent, #3949ab); font-weight:600; }
.erp-kv { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:8px 16px; margin:0; }
.erp-kv dt { font-size:12px; color:var(--muted, #5a6475); } .erp-kv dd { margin:0; }
/* M14 shortfall board (canvas Shortfall) */
tr.erp-group td { background:var(--surface-alt, #eef0f4); }
tr.erp-req td { background:#ecfeff; color:#155e75; font-size:12px; }
/* M15 shipping queue lanes (canvas ShippingQueue) */
.erp-lanes { display:grid; grid-template-columns:repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap:14px; align-items:start; }
.erp-lane-item { padding:10px 12px; border-top:1px solid var(--border); display:flex; flex-direction:column; gap:4px; }
.erp-lane-row { display:flex; justify-content:space-between; align-items:center; gap:8px; flex-wrap:wrap; }
.erp-pre { white-space:pre-wrap; overflow-x:auto; font-size:12.5px; margin:0; }

/* ---- M30 UX polish (canvas erp.css tokens) ---------------------------------------------------------------- */
/* a bare .btn is a visible secondary button; one .primary per screen carries the main action */
.btn:not(.primary):not(.danger):not(.secondary):not(.ghost) { background:#fff; border-color:var(--border-strong); color:var(--text); }
.btn:not(.primary):not(.danger):not(.secondary):not(.ghost):hover { border-color:var(--accent); color:var(--accent); }
/* home tiles: a small line icon beside the label, never a full-size glyph */
.erp-stat-label svg { width:16px; height:16px; flex:0 0 16px; fill:none; stroke:currentColor; stroke-width:1.8; }
.erp-stat-row { display:grid; grid-template-columns:repeat(auto-fit, minmax(170px, 1fr)); gap:10px; }
/* tables: readable 12px mixed-case headers and about 34px rows (canvas --erp-row-h 30px) */
main th { font-size:12px; font-weight:500; text-transform:none; letter-spacing:0; padding:7px 10px; }
main td { padding:6px 10px; }
/* chips keep the text as written (labels, not shouted codes) */
.chip { text-transform:none; letter-spacing:0; font-size:10.5px; }
/* readable muted text and a solid focus ring */
.erp-muted, .hint, .empty-state p { color:var(--text-2); }
:focus-visible { outline:2px solid var(--accent); outline-offset:1px; }
.erp-today-zero { color:var(--text-2); font-size:12px; margin:4px 0 10px; }
.nav-collapse > summary .nav-count { margin-left:auto; font:10px var(--font-mono, monospace); color:var(--text-2); }
.erp-today-zero span + span::before { content:"· "; }
.erp-today-zero:empty { display:none; }

/* ---- M30 phone layer for warehouse scan flows (canvas .phone boards) ------------------------------------- */
@media (max-width: 600px) {
  .topbar { flex-wrap:nowrap; gap:6px; min-height:52px; padding:4px 8px; }
  .topbar .user-copy { display:none; }
  body.phone-flow .topbar .lang-dropdown { display:none; }
  .topbar .erp-topsearch { flex:1; min-width:0; }
  .topbar .erp-topsearch input { width:100%; min-width:0; }
  body.phone-flow main { padding:12px 12px 96px; }
  body.phone-flow .page-head p, body.phone-flow .eyebrow { font-size:12px; }
  body.phone-flow .page-head h1 { font-size:18px; }
  body.phone-flow .erp-stat-row { grid-template-columns:1fr 1fr; }
  body.phone-flow .phone-actions { position:fixed; left:0; right:0; bottom:0; z-index:50; display:grid; grid-auto-flow:column; grid-auto-columns:1fr;
    gap:10px; padding:10px 12px calc(10px + env(safe-area-inset-bottom)); background:#fff; border-top:1px solid var(--border); }
  body.phone-flow .phone-actions .btn { min-height:48px; width:100%; }
  body.phone-flow .phone-actions form { display:contents; }
  body.phone-flow table thead { display:none; }
  body.phone-flow table tr { display:flex; flex-wrap:wrap; gap:4px 10px; padding:8px 4px; border-bottom:1px solid var(--border); }
  body.phone-flow table td { border:0; padding:0; }
  body.phone-flow input[name="code"], body.phone-flow input[name="imei"], body.phone-flow input.mono[autofocus] { min-height:52px; font-size:18px; border:2px solid var(--accent); }
}
.phone-step { display:flex; gap:10px; align-items:center; padding:10px 12px; border:1px solid var(--border); border-radius:8px; background:#fff; margin-bottom:10px; }
.phone-step i { width:26px; height:26px; border-radius:50%; display:grid; place-items:center; background:var(--accent-soft); color:var(--accent); font-style:normal; font-weight:600; }
.scan-any-tiles { display:grid; grid-template-columns:repeat(auto-fit, minmax(140px,1fr)); gap:10px; margin-top:12px; }
.scan-any-tiles a { display:flex; flex-direction:column; gap:4px; padding:14px; border:1px solid var(--border); border-radius:8px; background:#fff; font-weight:600; }

/* M33: styled file picker (core/_file_input.html); the native input stays focusable for keyboards and screen readers */
.erp-file { display:inline-flex; align-items:center; gap:8px; flex-wrap:wrap; }
.erp-file input[type=file]:focus-visible + label { outline:2px solid var(--accent, #2f5bea); outline-offset:2px; }
