/* Modax MES PFE: a landscape tablet on the floor first. Touch targets of at least 44 points, one accent colour. */
.pfe {
  --bg: #f4f5f7; --surface: #ffffff; --surface-2: #eef0f3; --border: #d9dde3; --border-strong: #b9c0ca;
  --text: #17202b; --muted: #5d6876; --accent: #0b5cad; --accent-bg: #e3eefa; --on-accent: #ffffff;
  --ok: #1d6b3a; --ok-bg: #e2f3e8; --wa: #8a5a00; --wa-bg: #fbf0d9; --no: #a12828; --no-bg: #fbe4e4;
  --radius: 8px;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 15px; color: var(--text);
  background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; box-sizing: border-box;
  width: 100%; overflow-x: hidden;
}
.pfe *, .pfe *::before, .pfe *::after { box-sizing: inherit; }
.pfe.pfe-busy { cursor: progress; }
.pfe button { font: inherit; cursor: pointer; }
.pfe-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 16px; min-height: 48px;
  background: var(--surface); border-bottom: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.pfe-bar-left, .pfe-bar-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pfe-brand { font-weight: 600; color: var(--text); }
.pfe-worker { color: var(--text); font-weight: 500; }
.pfe-time { font-variant-numeric: tabular-nums; }
.pfe-link { background: none; border: 0; color: var(--accent); padding: 10px 6px; min-height: 44px; }
.pfe-banner-box { padding: 0 16px; }
.pfe-banner { margin-top: 10px; padding: 10px 14px; border-radius: var(--radius); font-size: 14px; }
.pfe-error { background: var(--no-bg); color: var(--no); }
.pfe-note { background: var(--ok-bg); color: var(--ok); }
.pfe-warn { background: var(--wa-bg); color: var(--wa); }
.pfe-offline { background: var(--wa-bg); color: var(--wa); font-weight: 500; }
.pfe-body { flex: 1; padding: 12px 16px 16px; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.pfe-message { max-width: 560px; margin: 40px auto; text-align: center; }
.pfe-message h1 { font-size: 24px; font-weight: 600; margin: 0 0 12px; }
.pfe-message p { color: var(--muted); line-height: 1.5; }
.pfe-code { font-size: 48px; font-weight: 600; letter-spacing: 6px; font-variant-numeric: tabular-nums; margin: 16px 0; }
.pfe-btn { min-height: 48px; padding: 10px 18px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font-size: 15px; }
.pfe-btn:active, .pfe-key:active { transform: translateY(1px); }
.pfe-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pfe-buttons { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; }
.pfe-message .pfe-buttons { grid-template-columns: minmax(200px, 280px); justify-content: center; }
/* sign-in */
.pfe-signin { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.pfe-badge { background: var(--surface); border: 1px dashed var(--border-strong); border-radius: 14px; padding: 24px 16px; text-align: center; }
.pfe-badge h1 { font-size: 22px; margin: 6px 0; font-weight: 600; }
.pfe-badge-icon { font-size: 30px; }
.pfe-hint { color: var(--muted); font-size: 14px; margin: 6px 0 10px; }
.pfe-pad-value { font-size: 26px; min-height: 36px; letter-spacing: 3px; font-variant-numeric: tabular-nums; margin-bottom: 8px; }
.pfe-pad { display: grid; grid-template-columns: repeat(3, 64px); gap: 8px; justify-content: center; }
.pfe-key { height: 56px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); font-size: 20px; }
.pfe-key.pfe-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pfe-running { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px; overflow: auto; min-width: 0; }
.pfe-signin > * { min-width: 0; }
.pfe-caption { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
/* lists */
.pfe-list { display: flex; flex-direction: column; min-height: 0; min-width: 0; flex: 1; }
.pfe-split > * { min-width: 0; }
.pfe-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 10px; overflow-x: auto; }
.pfe-tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 12px 16px; min-height: 48px; color: var(--muted); font-size: 15px; white-space: nowrap; }
.pfe-tab.pfe-on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.pfe-searchbox { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.pfe-input { flex: 1; min-height: 46px; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); font-size: 16px; background: var(--surface); color: var(--text); width: 100%; }
.pfe-filter { flex: 0 0 auto; width: auto; min-width: 140px; }
.pfe-picture { display: block; max-width: 100%; max-height: 140px; border-radius: var(--radius); margin: 4px 0 8px; object-fit: contain; background: var(--surface-2); }
.pfe-subhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.pfe-subhead h2 { font-size: 18px; margin: 0; }
.pfe-subhead .pfe-buttons { margin: 0; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); min-width: 140px; }
.pfe-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-height: 0; }
.pfe-split.pfe-with-panel { grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); }
.pfe-listbox { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; }
.pfe-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pfe-table th { text-align: left; font-weight: 500; color: var(--muted); padding: 10px 10px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); white-space: nowrap; }
.pfe-table td { padding: 12px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.pfe-table .pfe-r { text-align: right; font-variant-numeric: tabular-nums; }
.pfe-pick { cursor: pointer; }
.pfe-pick:hover td { background: var(--surface-2); }
.pfe-selected td { background: var(--accent-bg) !important; }
.pfe-state-short td:first-child { box-shadow: inset 3px 0 0 var(--no); }
.pfe-state-warning td:first-child { box-shadow: inset 3px 0 0 var(--wa); }
.pfe-pill { display: inline-block; font-size: 12px; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pfe-ok { background: var(--ok-bg); color: var(--ok); } .pfe-wa { background: var(--wa-bg); color: var(--wa); }
.pfe-no { background: var(--no-bg); color: var(--no); } .pfe-ac { background: var(--accent-bg); color: var(--accent); }
.pfe-ne { background: var(--surface-2); color: var(--muted); }
.pfe-empty, .pfe-foot { padding: 18px; color: var(--muted); font-size: 14px; }
.pfe-foot { padding: 10px 12px; font-size: 13px; }
.pfe-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; overflow: auto; }
.pfe-panel-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.pfe-panel h2 { font-size: 17px; margin: 4px 0 8px; }
.pfe-lines { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 8px 0 0; font-size: 14px; }
.pfe-lines dt { color: var(--muted); }
.pfe-lines dd { margin: 0; white-space: pre-line; }
/* forms */
.pfe-shade { position: fixed; inset: 0; background: rgba(15, 20, 28, 0.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.pfe-form { background: var(--surface); border-radius: 14px; padding: 20px; width: min(520px, 100%); max-height: 100%; overflow: auto; }
.pfe-form h2 { margin: 0 0 14px; font-size: 20px; }
.pfe-field { display: grid; gap: 6px; margin-bottom: 12px; font-size: 14px; color: var(--muted); }
.pfe-field .pfe-input { color: var(--text); }
.pfe-unit { font-size: 13px; }
.pfe-scan { position: fixed; left: -1000px; top: 0; width: 10px; height: 10px; opacity: 0; }
@media (max-width: 760px) {
  .pfe-signin, .pfe-split.pfe-with-panel { grid-template-columns: minmax(0, 1fr); }
  .pfe-table td { max-width: 160px; }
}
