/* POSFIELD Customers — styles scoped to .pfc (nothing global). At integration they take the app's tokens
   (var(--surface), var(--border), …) where present; the fallbacks keep the isolated harness usable on its own. */
.pfc { --pfc-bg: var(--bg-card, #ffffff); --pfc-line: var(--border, #dde1e8); --pfc-text: var(--text, #18202b); --pfc-muted: var(--text-dim, #5d6878);
  --pfc-accent: var(--primary, #1f4fd8); --pfc-warn-bg: #fff3d6; --pfc-warn: #8a5a00; --pfc-bad: #b42318; --pfc-chip: #eef0f4;
  color: var(--pfc-text); font: inherit; }
@media (prefers-color-scheme: dark) {
  .pfc:not([data-theme="light"]) { --pfc-bg: var(--bg-card, #171c24); --pfc-line: var(--border, #2a3140); --pfc-text: var(--text, #e7ebf1); --pfc-muted: var(--text-dim, #9aa5b5);
    --pfc-accent: var(--primary, #7c9cff); --pfc-warn-bg: #3a2e12; --pfc-warn: #f2c66d; --pfc-bad: #ff8a80; --pfc-chip: #252b36; }
}
.pfc * { box-sizing: border-box; }
.pfc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.pfc-title { margin: 0; font-size: 18px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pfc-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.pfc-input { font: inherit; color: var(--pfc-text); background: var(--pfc-bg); border: 1px solid var(--pfc-line); border-radius: 8px; padding: 9px 11px; width: 100%; }
.pfc-tools .pfc-input { flex: 1 1 260px; width: auto; min-width: 0; }
textarea.pfc-input { min-height: 72px; resize: vertical; }
.pfc-btn { font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--pfc-line); background: var(--pfc-bg); color: var(--pfc-text); padding: 8px 12px; min-height: 40px; }
.pfc-btn[disabled] { opacity: .45; cursor: default; }
.pfc-primary { background: var(--pfc-accent); border-color: var(--pfc-accent); color: #fff; }
.pfc-danger { color: var(--pfc-bad); }
.pfc-check { display: inline-flex; align-items: center; gap: 6px; color: var(--pfc-muted); font-size: 13px; }
.pfc-muted { color: var(--pfc-muted); }
.pfc-rows { display: grid; gap: 6px; }
.pfc-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; text-align: start;
  font: inherit; color: var(--pfc-text); background: var(--pfc-bg); border: 1px solid var(--pfc-line); border-radius: 10px; padding: 10px 12px; cursor: pointer; min-height: 44px; }
.pfc-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pfc-row-name { font-weight: 700; }
.pfc-badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--pfc-chip); color: var(--pfc-muted); }
.pfc-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.pfc-form { display: grid; gap: 10px; max-width: 560px; }
.pfc-field { display: grid; gap: 4px; font-size: 13px; color: var(--pfc-muted); }
.pfc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.pfc-error { color: var(--pfc-bad); min-height: 1.2em; margin: 0; }
.pfc-warning { background: var(--pfc-warn-bg); color: var(--pfc-warn); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; }
.pfc-warning p { margin: 0; }
.pfc-dup { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pfc-notice { border: 1px dashed var(--pfc-line); border-radius: 10px; padding: 12px; color: var(--pfc-muted); }
.pfc-contact { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0 0 8px; }
.pfc-contact dt { color: var(--pfc-muted); }
.pfc-contact dd { margin: 0; overflow-wrap: anywhere; }
.pfc-notes { background: var(--pfc-chip); border-radius: 10px; padding: 8px 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.pfc-notes h3, .pfc-panel h3 { font-size: 14px; margin: 0 0 6px; }
.pfc-notes p { margin: 0; }
.pfc-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }
.pfc-stat { border: 1px solid var(--pfc-line); border-radius: 10px; padding: 10px; display: grid; gap: 2px; }
.pfc-stat span { color: var(--pfc-muted); font-size: 12.5px; }
.pfc-stat strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.pfc-panel { border: 1px solid var(--pfc-line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.pfc-line { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 6px 0; border-top: 1px solid var(--pfc-line); font-variant-numeric: tabular-nums; }
.pfc-line:first-of-type { border-top: 0; }
.pfc-mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
/* selector */
.pfc-selector { position: relative; display: grid; gap: 6px; }
.pfc-options { display: grid; gap: 2px; }
.pfc-option { text-align: start; font: inherit; color: var(--pfc-text); background: var(--pfc-bg); border: 1px solid var(--pfc-line); border-radius: 8px; padding: 8px 10px; cursor: pointer; min-height: 40px; }
.pfc-quick { color: var(--pfc-accent); font-weight: 600; }
.pfc-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--pfc-chip); border-radius: 999px; padding: 4px 4px 4px 12px; max-width: 100%; }
.pfc-chip[hidden] { display: none; }
.pfc-chip-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pfc-chip-clear { font: inherit; border: 0; background: transparent; color: var(--pfc-muted); cursor: pointer; width: 32px; height: 32px; border-radius: 50%; }
@media (max-width: 640px) {
  .pfc-row { grid-template-columns: minmax(0, 1fr) auto; }
  .pfc-row-city { display: none; }
  .pfc-row-phone { grid-column: 1; grid-row: 2; color: var(--pfc-muted); font-size: 13px; }
}

/* POSFIELD-INTEGRATION-NEXT: inside the app the customer book follows the APP's theme (body.dark-mode and the app's own
   tokens --bg-2 / --border / --text / --text-dim / --primary), never the device's colour scheme. The rules above are the
   standalone harness's; these win inside the app (higher specificity) in light AND dark. */
body .pfc, body .pfc:not([data-theme="light"]) { --pfc-bg: var(--bg-2, #ffffff); --pfc-line: var(--border, #dde1e8); --pfc-text: var(--text, #18202b);
  --pfc-muted: var(--text-dim, #5d6878); --pfc-accent: var(--primary, #1f4fd8); --pfc-warn-bg: #fff3d6; --pfc-warn: #8a5a00; --pfc-bad: #b42318; --pfc-chip: #eef0f4; }
body.dark-mode .pfc, body.dark-mode .pfc:not([data-theme="light"]) { --pfc-warn-bg: #3a2e12; --pfc-warn: #f2c66d; --pfc-bad: #ff8a80; --pfc-chip: #252b36; }
