/* TRELLAN: the people screens. Report 258.

   Page-specific rules for this area only, after trellan.css and
   trellan-shell.css. Scope every rule to the page (its own class or
   `.t-<kind>` wrapper); do not restyle shared components here.
   See planning/trellan-screen-guide.md. */

/* ══ Report 260: the people area ═════════════════════════════════════
   Boards in qa/by-page.json "people": a person's record (staff, imported,
   supervising broker, own), activate, offboard, request offboarding, add a
   person, qualifying brokers, property managers, groups, a group, add
   people, edit / new group, audiences. Every page carries `.tr-people` on
   its `ui-page`. Look only. */

/* The page head: the older pages' h1 is 600; the back link is Leaf. */
.ui-page.tr-people .ui-page-head h1, .ui-page.tr-people .ui-title {
  font-family: var(--font-display); font-weight: 300; letter-spacing: 2px;
  text-transform: uppercase; color: var(--ink);
}
/* The back link is the shared one (trellan.css 6.2, report 263). */
.ui-page.tr-people .ui-page-head__sub, .ui-page.tr-people .of-head__line { color: var(--gray); }

/* Labels over fields and facts: 11 px caps. */
.ui-page.tr-people .prof-readonly dt, .ui-page.tr-people .of-facts dt,
.ui-page.tr-people .aud-fields > label, .ui-page.tr-people .pm-bulk > label,
.ui-page.tr-people .prof-grid > label, .ui-page.tr-people .lic-grid > label {
  font-family: var(--font-display); font-weight: 500; font-size: 11px;
  letter-spacing: 2.4px; text-transform: uppercase; color: var(--gray);
}
.ui-page.tr-people .prof-grid > label > *, .ui-page.tr-people .lic-grid > label > *,
.ui-page.tr-people .aud-fields > label > *, .ui-page.tr-people .pm-bulk > label > * {
  font-family: var(--font-sans); font-weight: 400; letter-spacing: 0; text-transform: none;
}
.ui-page.tr-people .prof-readonly dd, .ui-page.tr-people .of-facts dd { font-size: 15px; color: var(--ink); }

/* Card titles: Poppins 300 caps, as the boards ("DETAILS", "GROUPS"). */
.ui-page.tr-people .card-title, .ui-page.tr-people .ui-card__title {
  font-family: var(--font-display); font-weight: 300; font-size: 20px;
  letter-spacing: 2px; text-transform: uppercase; color: var(--ink);
}
.ui-page.tr-people .ui-card { padding: 24px; }

/* ── A person's record (people/detail.html) ─────────────────────────────
   The facts are a Mist strip over the tabs, not a column on the right.
   The tabs and what each shows are unchanged (report 251). */
.ui-page.tr-people.person-page .of-detail { grid-template-columns: minmax(0, 1fr); gap: 16px; }
.ui-page.tr-people.person-page .of-detail__aside { order: -1; position: static; }
.ui-page.tr-people.person-page .of-facts {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px 24px; padding: 18px 20px; background: var(--mist); border-color: var(--mist);
}
@media (max-width: 720px) {
  .ui-page.tr-people.person-page .of-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; padding: 16px; }
  .ui-page.tr-people.person-page .of-facts__row:first-child { grid-column: 1 / -1; }
}
.ui-page.tr-people.person-page .of-facts dd { overflow-wrap: anywhere; }
.ui-page.tr-people.person-page .card-edit { min-height: 32px; }

/* ── The Overview tab: a summary card per section (report 263) ────────
   people-detail-staff and its variants: two columns (Details | License,
   CE | Other compliance), Groups across, then Journeys | History. One
   column on a phone. `people/_overview.html` draws the cards. */
.ui-page.tr-people.person-page .pr-overview.is-on {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start;
}
.ui-page.tr-people.person-page .pr-overview > #personIntake,
.ui-page.tr-people.person-page .pr-overview > .ov-wide { grid-column: 1 / -1; }
.ui-page.tr-people.person-page .pr-overview > .ui-card { margin: 0; min-width: 0; }
/* Departments is not on the boards; it keeps its place after History. */
.ui-page.tr-people.person-page .pr-overview > #personFirmRoles { order: 1; }
@media (max-width: 900px) {
  .ui-page.tr-people.person-page .pr-overview.is-on { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
.ov-card__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px;
}
.ov-card__head .card-title { margin: 0; }
.ov-card__link, .ov-card__more a { font-size: 14px; color: var(--leaf); }
.ov-card__more { margin: 14px 0 0; }
/* Details keeps its Edit fold at the foot of the card; its button sits at
   the top right, as on the other cards. */
.ui-page.tr-people.person-page .person-details { position: relative; }
.ui-page.tr-people.person-page .person-details > .card-title {
  min-height: 44px; display: flex; align-items: center; margin: 0 0 16px; padding-right: 96px;
}
.ui-page.tr-people.person-page .person-details > .card-edit-box > summary {
  position: absolute; top: 24px; right: 24px; list-style: none;
}
.ui-page.tr-people.person-page .person-details > .card-edit-box > summary::-webkit-details-marker { display: none; }
/* A license: number · state, the type and CE rules, the expiry chip. */
.ov-lic { padding: 14px 16px; border: 1px solid var(--hairline); margin-bottom: 12px; }
.ov-lic__name { margin: 0; font-weight: 700; color: var(--ink); }
.ov-lic__meta { margin: 2px 0 8px; font-size: 13px; color: var(--gray); }
.ov-facts { margin: 0; }
/* CE: the hours, the renewal, the bar, the key, Next up. */
.ov-ce + .ov-ce { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--hairline); }
.ov-ce__line { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 16px; flex-wrap: wrap; margin: 0 0 10px; }
.ov-ce__hours { font-size: 17px; color: var(--ink); font-weight: 700; }
.ov-ce__renews { font-size: 13px; color: var(--gray); }
.ov-ce__key { margin: 8px 0 0; }
.ov-ce__next { margin: 14px 0 0; padding: 12px 14px; background: var(--mist); color: var(--charcoal); font-size: 14px; }
.ov-ce__next strong { color: var(--ink); }
/* A list of rows: a name and its chip or note, under hairlines. */
.ov-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hairline); }
.ov-list__row {
  display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap;
  padding: 10px 0; border-bottom: 1px solid var(--hairline);
}
.ov-list__row--stack { flex-direction: column; align-items: flex-start; gap: 2px; }
.ov-list__name, .ov-list__text { color: var(--ink); }
.ov-list__note { font-size: 13px; color: var(--gray); }

/* ── Activate, request offboarding: one narrow card ─────────────────── */
.ui-page.tr-people [data-activate], .ui-page.tr-people [data-request] { max-width: 760px; }
.ui-page.tr-people [data-activate] .prof-readonly { margin-top: 0; }
.ui-page.tr-people [data-request] { display: flex; flex-direction: column; gap: 8px; }
.ui-page.tr-people [data-request] > p { margin: 8px 0 0; }

/* ── Offboard (people/offboard.html) ────────────────────────────────────
   Each consequence: the pill in its own column, the heading and detail
   beside it. "If this was a mistake" on Mist; Confirm with the Problem
   rule, and its removal button outlined in brick. */
.ui-page.tr-people .off-list { border-top: 1px solid var(--ink); }
.ui-page.tr-people .off-row {
  display: grid; grid-template-columns: 110px minmax(0, 1fr); column-gap: 16px; row-gap: 2px;
  padding: 12px 0; border-top: 1px solid var(--hairline);
}
.ui-page.tr-people .off-row:first-child { border-top: 0; padding-top: 12px; }
.ui-page.tr-people .off-row__head { display: contents; }
.ui-page.tr-people .off-row__head > .ui-pill { grid-column: 1; grid-row: 1 / span 2; align-self: start; justify-self: start; }
.ui-page.tr-people .off-row__head > strong { grid-column: 2; color: var(--ink); }
.ui-page.tr-people .off-row__detail { grid-column: 2; color: var(--charcoal); }
.ui-page.tr-people div.ui-card:not(:has(.off-list)):has(+ form.ui-card) { background: var(--mist); border-color: var(--mist); }
.ui-page.tr-people form.ui-card:has(.ui-btn--danger) { box-shadow: inset 3px 0 0 var(--alert-dot); }
.ui-page.tr-people form.ui-card .ui-btn--danger { border: 1px solid var(--alert-dot); }
@media (max-width: 560px) {
  .ui-page.tr-people .off-row { display: block; }
  .ui-page.tr-people .off-row__head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 4px; }
}

/* ── Property managers: "Set the people you tick to" in one Mist row ── */
.ui-page.tr-people .pm-bulk {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px;
  padding: 14px 16px; margin-bottom: 16px; background: var(--mist); border: 1px solid var(--hairline);
}
.ui-page.tr-people .pm-bulk > label { display: flex; flex-direction: column; gap: 6px; flex: 0 1 260px; min-width: 0; }
.ui-page.tr-people .pm-bulk select { width: 100%; }

/* ── Add people to a group: hairline rows, a ticked row on Mist ─────── */
.ui-page.tr-people .group-add__list { gap: 0; border-top: 1px solid var(--hairline); }
.ui-page.tr-people .group-add__list > li { border-bottom: 1px solid var(--hairline); }
.ui-page.tr-people .group-add__list .group-choice { padding: 12px 10px; border: 0; background: transparent; align-items: center; }
.ui-page.tr-people .group-add__list .group-choice:hover { background: var(--mist); }
.ui-page.tr-people .group-add__list .group-choice:has(input:checked) { background: var(--mist); }
.ui-page.tr-people .group-add__meta { display: block; color: var(--gray); font-size: 13px; }

/* ── A group (groups/detail.html): About and the supervisors on top,
   the members under them, full width (the board). ───────────────────── */
.ui-page.tr-people.group-page .of-detail { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; align-items: stretch; }
.ui-page.tr-people.group-page .of-detail__aside { display: contents; }
.ui-page.tr-people.group-page .of-detail__aside > .of-facts { grid-column: 1; grid-row: 1; }
.ui-page.tr-people.group-page .of-detail__aside > .group-page__supervisors { grid-column: 2; grid-row: 1; }
.ui-page.tr-people.group-page .of-detail__main { grid-column: 1 / -1; grid-row: 2; }
.ui-page.tr-people.group-page .of-detail__aside > .group-page__retire { grid-column: 1 / -1; grid-row: 3; }
@media (max-width: 760px) {
  .ui-page.tr-people.group-page .of-detail { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .ui-page.tr-people.group-page .of-detail__aside > .group-page__supervisors { grid-column: 1; grid-row: 2; }
  .ui-page.tr-people.group-page .of-detail__main { grid-row: 3; }
  .ui-page.tr-people.group-page .of-detail__aside > .group-page__retire { grid-row: 4; background: var(--mist); padding: 16px; border-top: 0; }
  .ui-page.tr-people .group-page__retire .ui-hint { flex: 1 1 100%; }
}
.ui-page.tr-people.group-page .of-facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; padding: 20px 24px;
}
.ui-page.tr-people.group-page .of-facts__row:last-child:nth-child(3) { grid-column: 1 / -1; }
.ui-page.tr-people .group-page__supervisors { border: 1px solid var(--hairline); background: #FFFFFF; padding: 20px 24px; }
.ui-page.tr-people .group-page__supervisors > .ui-label {
  font-weight: 300; font-size: 20px; letter-spacing: 2px; color: var(--ink); margin: 0 0 12px;
}
.ui-page.tr-people .group-page__supervisors .ui-list { list-style: none; padding: 0; margin: 0 0 12px; }
.ui-page.tr-people .group-page__supervisors .ui-list > li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--hairline); color: var(--ink); font-weight: 600;
}
.ui-page.tr-people .group-page__supervisors form:not([style]) { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; align-items: end; }
.ui-page.tr-people .group-page__supervisors form:not([style]) > label { grid-column: 1 / -1; }
.ui-page.tr-people .group-page__remove .ui-btn--quiet, .ui-page.tr-people .group-page__supervisors .ui-btn--quiet { color: var(--alert-fg); }

/* ── Audiences: the five fields bottom-aligned (decision 7), so a long
   label never pushes its field down. ───────────────────────────────── */
.ui-page.tr-people .aud-fields { align-items: end; }
.ui-page.tr-people .aud-fields > label { justify-content: flex-end; min-width: 0; }

@media (max-width: 720px) {
  .ui-page.tr-people .ui-card { padding: 16px; }
  .ui-page.tr-people .pm-bulk > label { flex: 1 1 100%; }
  .ui-page.tr-people .pm-bulk .ui-btn--commit { flex: 1 1 100%; }
}
/* Retire: one line under the members, the hint left and the button right. */
.ui-page.tr-people .group-page__retire {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  padding-top: 16px; border-top: 1px solid var(--hairline);
}
.ui-page.tr-people .group-page__retire .ui-hint { margin: 0; color: var(--gray); }
.ui-page.tr-people .group-page__retire .of-danger {
  font-family: var(--font-display); font-weight: 500; font-size: 12px; letter-spacing: 2px; text-transform: uppercase;
}
/* "Request offboarding…" is the quiet danger in the head, as Offboard. */
.ui-page.tr-people [data-request-offboarding] { color: var(--alert-fg); }
.ui-page.tr-people [data-request-offboarding]:hover { background: var(--alert-bg); color: var(--alert-fg); }
.ui-page.tr-people.person-page [data-imported] { font-weight: 600; color: var(--ink); }
.ui-page.tr-people .group-page__retire .ui-hint { flex: 1 1 320px; text-align: left; }
/* Phone: the long head buttons ("Transfer to another supervising broker…")
   wrap inside the window instead of pushing it sideways. */
@media (max-width: 720px) {
  .ui-page.tr-people .of-head__actions { min-width: 0; max-width: 100%; }
  .ui-page.tr-people .of-head__actions .ui-btn { white-space: normal; text-align: center; height: auto; min-height: 44px; padding-top: 10px; padding-bottom: 10px; line-height: 1.3; max-width: 100%; }
}

/* ══ Report 266: the People list v2 (people-v2, m-people-v2) ══════════
   The head, then the role chips with the two pages' links at the right,
   the search and four equal selects, one "Needs attention" line, the
   count line, the table. On a phone: the buttons stack, the chips scroll
   in one row, search and "Filters" share a row, the attention box, the
   count with "Sort by", two-line rows, the two links at the foot. */
.ui-page.people-page .of-head { margin-bottom: 20px; }
.ui-page.people-page .of-head__text { flex: 1 1 100%; }
.ui-page.people-page .of-head__line { margin: 6px 0 0; color: var(--gray); }
.ui-page.people-page .of-head__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.ui-page.people-page .people-requests { gap: 8px; padding-left: 0; padding-right: 0; }
.ui-page.people-page .people-requests:hover { background: transparent; text-decoration: underline; }
.people-requests__n {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 6px; box-sizing: border-box;
  background: var(--ink); color: #FFFFFF;
  font-family: var(--font-sans); font-size: 12px; font-weight: 700; letter-spacing: 0;
}

/* The chip row: the chips left, the two pages' links right. */
.people-chiprow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 20px; }
.people-chiprow .people-views { margin: 0; flex: 0 1 auto; }
.people-chiprow .people-views .of-chip { font-weight: 600; }
.people-chiprow .of-chip__n { font-weight: 700; font-variant-numeric: tabular-nums; }
.people-pages { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; }
.people-pages--row { margin-left: auto; }
.people-pages--foot { display: none; }
.people-pages__link { color: var(--leaf); text-decoration: underline; min-height: 36px; display: inline-flex; align-items: center; }

/* Search, then the selects, every select the same width. */
.ui-page.people-page .of-toolbar { margin: 0 0 16px; gap: 10px; }
.ui-page.people-page .of-toolbar > .of-search { flex: 2 1 260px; height: 44px; }
.ui-page.people-page .of-toolbar > .of-select { flex: 1 1 0; min-width: 150px; height: 44px; }

/* Needs attention: the amber chip, then the links. */
.people-attn { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 20px; font-size: 14px; }
.people-attn__chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px;
  background: var(--warn-bg); color: var(--warn-fg); font-size: 12px; font-weight: 600;
}
.people-attn__chip::before { content: ""; width: 8px; height: 8px; background: var(--warn-dot); }
.people-attn__link { color: var(--leaf); text-decoration: underline; }
.people-attn__link strong { font-weight: 400; }
.people-attn__dot { color: var(--stone); }

/* "Never asked is not No", in the filtered view only. */
.ui-page.people-page .people-pm {
  display: block; margin: 0 0 16px; padding: 12px 16px; border-radius: 0;
  background: var(--mist); color: var(--charcoal); font-size: 14px;
}

/* The count line. The "Sort by" select is the phone's; a desktop sorts
   by the column headers. */
.people-count { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; }
.people-count__words { font-size: 14px; color: var(--gray); }
.people-count__sort { display: none; }
.ui-page.people-page .people-count .of-toolbar__go { height: 40px; min-height: 40px; }

@media (max-width: 720px) {
  .ui-page.people-page .of-head { gap: 16px; }
  .ui-page.people-page .of-head__line { font-size: 14px; }
  /* The dark button first and full width; the other two under it. */
  .ui-page.people-page .of-head__actions { flex-direction: column; align-items: stretch; gap: 8px; width: 100%; }
  .ui-page.people-page .of-head__actions > [data-request-onboarding] { order: -2; min-height: 48px; margin-bottom: 8px; }
  .ui-page.people-page .of-head__actions > [data-panel] { order: -1; }
  .ui-page.people-page .of-head__actions .ui-btn { width: 100%; justify-content: center; }

  /* The chips scroll in one row, to the window's edge. */
  .people-chiprow { margin: 0 -16px 16px; }
  .people-chiprow .people-views { flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; padding: 0 16px; scrollbar-width: none; }
  .people-chiprow .people-views .of-chip { flex: none; white-space: nowrap; height: 40px; }
  .people-pages--row { display: none; }
  .people-pages--foot { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; }

  /* Search and "Filters" on one row (the shared fold, report 263). */
  .ui-page.people-page .of-fold + .of-toolbar > .of-search { flex: 1 1 0; min-width: 0; }
  .ui-page.people-page .of-fold + .of-toolbar > .of-fold__btn { flex: 0 0 auto !important; padding: 0 14px; }
  .ui-page.people-page .of-fold + .of-toolbar > .of-select { flex: 1 1 100%; min-width: 0; }

  /* Needs attention: a box, one link a line. */
  .people-attn { flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px 14px; background: var(--warn-bg); margin-bottom: 16px; }
  .people-attn__chip {
    padding: 0; background: none; font-family: var(--font-display); font-weight: 500;
    font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  }
  .people-attn__chip::before { display: none; }
  .people-attn__dot { display: none; }
  .people-attn__link { display: block; padding: 6px 0; font-size: 15px; }

  .people-count__by { display: none; }
  .people-count__sort { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink); }
  .people-count__sort .of-select { height: 40px; flex: none; width: 120px; font-size: 14px; }

  /* Two-line rows under an ink rule: the name, then role · supervising
     broker · office, then the status chip. The email stays in the panel. */
  .ui-page.people-page .of-list { border: 0; border-top: 1px solid var(--ink); }
  .ui-page.people-page .of-row { padding: 12px 28px 12px 48px; line-height: 1.35; }
  .ui-page.people-page .of-row:has(> .of-row__main .of-row__avatar) > .of-row__main { margin: 0 0 2px -48px; align-items: flex-start; }
  .ui-page.people-page .of-row__sub { display: none; }
  .ui-page.people-page .of-row__title { font-weight: 600; }
  .ui-page.people-page .of-row__cell { font-size: 13px; color: var(--gray); }
  .ui-page.people-page .of-row__cell--pill { display: block; width: fit-content; margin: 4px 0 0; }
  .ui-page.people-page .of-row__chev { right: 0; top: 14px; }
}
