/* ============================================================================
   Chamanke Workspace — the shared people picker
   ----------------------------------------------------------------------------
   Replaces the browser's native <datalist> dropdown, which drew itself with OS
   chrome, ignored the theme and clipped longer names. Everything here is
   scoped to .pp-*, driven by the theme tokens so it works in light and dark,
   and uses logical properties so it flips in Arabic/RTL.

   The panel is position:fixed and appended to <body> on purpose: most of these
   fields sit inside modals, and a panel inside the modal would be clipped by
   its scroll area. z-index clears the highest modal layer in the app (10001).
   ============================================================================ */

.pp-panel {
  position: fixed; z-index: 10050;
  max-height: 280px; overflow-y: auto; min-width: 240px; max-width: 360px;
  background: var(--bg-card); color: var(--text-primary);
  border: 1px solid var(--border-primary); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg, 0 12px 32px rgba(0,0,0,0.28));
  padding: 5px; font-size: 0.88rem;
  /* a hair of motion so it reads as "opened", not "flashed" */
  animation: ppIn 0.11s ease-out;
}
@keyframes ppIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

.pp-row, .pp-new {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 9px; border-radius: var(--radius-md);
  cursor: pointer; white-space: nowrap;
}
.pp-row.is-active, .pp-new:hover { background: var(--bg-card-hover); }
.pp-row.is-current { font-weight: 700; }

/* Initials, tinted from the name itself so a face keeps the same colour
   everywhere it appears. */
.pp-av {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.02em;
  background: hsl(var(--pp-h, 210) 55% 42%); color: #fff;
}
.pp-av-new { background: var(--bg-input); color: var(--text-tertiary); font-size: 0.95rem; }

.pp-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pp-name b { color: var(--accent); font-weight: 800; }   /* the matched part */
.pp-name i { font-style: normal; color: var(--text-tertiary); font-size: 0.8rem; }
.pp-tick { color: var(--success); font-weight: 800; }

.pp-new { border-top: 1px solid var(--border-primary); border-radius: 0 0 var(--radius-md) var(--radius-md); margin-top: 3px; }
.pp-none { padding: 14px 10px; text-align: center; color: var(--text-tertiary); font-size: 0.84rem; }

/* ---- project rows: a square badge, and the client under the name -------------
   The client line is what keeps two similar names apart (Diesel (DNO) vs
   Diesel (HKN)), so it is always shown when the project has one. */
.pp-prow { align-items: center; }
.pp-badge {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.66rem; font-weight: 800; letter-spacing: 0.02em;
  background: hsl(var(--pp-h, 210) 45% 94%); color: hsl(var(--pp-h, 210) 55% 32%);
  border: 1px solid hsl(var(--pp-h, 210) 40% 82%);
}
[data-theme="dark"] .pp-badge { background: hsl(var(--pp-h, 210) 35% 22%); color: hsl(var(--pp-h, 210) 70% 80%); border-color: hsl(var(--pp-h, 210) 30% 32%); }
.pp-badge-site { background: var(--bg-input); color: var(--text-tertiary); border-color: var(--border-primary); font-size: 0.9rem; }
.pp-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.pp-sub { font-size: 0.74rem; font-weight: 500; color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; }
.pp-create .pp-name { white-space: normal; }
.pp-create .pp-name b { color: var(--text-primary); }

@media (max-width: 768px) {
  .pp-panel { max-width: calc(100vw - 32px); max-height: 240px; }
}

/* ---- attribution note at the foot of entry forms ---------------------------
   Deliberately quiet: it is a record of fact, not a call to action, so it sits
   in muted type above the buttons and never competes with the form. */
.audit-note {
  display: flex; flex-direction: column; gap: 3px;
  margin: 14px 0 0; padding: 9px 12px;
  background: var(--bg-primary); border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  font-size: 0.8rem; line-height: 1.5; color: var(--text-secondary);
}
/* one fact per line — "Added by …" and "Last edited by …" never run together */
.audit-note .an-line { display: flex; align-items: flex-start; gap: 8px; }
.audit-note b { color: var(--text-primary); font-weight: 700; }
.audit-note .an-ico { flex: 0 0 1.1em; text-align: center; font-size: 0.85rem; line-height: 1.45; opacity: 0.8; }
.audit-note .an-when { color: var(--text-tertiary); white-space: nowrap; }
.audit-note .an-muted { color: var(--text-tertiary); font-style: italic; }
