/* Console: team pages (Settings → People, Connections, Usage & costs, Team settings). Shared building blocks are in
   console.css; markup in settings-nav.tsx, people-ui.tsx, lists-routes.tsx, context-card.tsx and pages.tsx. */

/* ---- Shell ---- */
.cx-team .cx-titlerow { align-items: flex-end; }
.cx-rename-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--cx-r); background: transparent; color: var(--c-ink-3); cursor: pointer; }
.cx-rename-btn:hover, .cx-rename-btn[aria-expanded='true'] { color: var(--c-ink); background: var(--cx-row-hover); }
.cx-rename-btn:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.cx-rename { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.cx-rename[hidden] { display: none; }
.cx-rename .cx-input { width: 280px; max-width: 100%; height: 30px; }
/* The page starts at the level bar: .c-main's own top padding comes off, as on Your profile (console-profile.css). */
.c-main:has(> .cx-team) { padding-top: 0; }

/* app.js turns selects into its own menu (c-goo, rounded pills in theme.css): square them on the Console pages, as
   .cx-input is. Connections and App usage (.is-legacy) keep their look. */
.cx-team > :not(.is-legacy) .is-field .c-goo-btn { border-radius: var(--cx-r); }
.cx-team > :not(.is-legacy) .c-goo-menu, .cx-team > :not(.is-legacy) .c-goo-item { border-radius: var(--cx-r); }
.cx-team > :not(.is-legacy) .is-field.is-open .c-goo-btn { box-shadow: 0 0 0 1px var(--c-accent); }

/* Selects in the head and toolbars (team picker, Sort) after app.js turns them into its own menu (c-goo): square and as
   compact as the buttons beside them. Selects inside forms and the older pages keep the theme.css look. */
.cx-team :is(.cx-head, .cx-toolbar) .c-goo.is-field { min-width: 0; }
.cx-team :is(.cx-head, .cx-toolbar) .is-field .c-goo-btn { height: 30px; min-width: 150px; padding: 0 6px 0 10px; border: 1px solid var(--cx-line-2); border-radius: var(--cx-r); background: var(--c-surface); font: 600 12.5px var(--font-body); box-shadow: none; }
.cx-team :is(.cx-head, .cx-toolbar) .is-field .c-goo-btn:hover { border-color: color-mix(in srgb, var(--c-ink) 35%, var(--cx-line-2)); }
.cx-team :is(.cx-head, .cx-toolbar) .is-field.is-open .c-goo-btn { border-color: var(--c-accent); box-shadow: 0 0 0 1px var(--c-accent); }
.cx-team :is(.cx-head, .cx-toolbar) .is-field .c-goo-chev { width: 16px; height: 16px; transform: none; }
.cx-team :is(.cx-head, .cx-toolbar) .is-field.is-open .c-goo-chev { transform: rotate(180deg); }
.cx-team :is(.cx-head, .cx-toolbar) .c-goo-menu { border-radius: var(--cx-r); }
.cx-team-body.c-set { display: block; max-width: none; margin: 0; }
.cx-team-body.c-set.is-legacy { display: grid; gap: 28px; }
.cx-nowrap { white-space: nowrap; }
.cx-dash { color: var(--c-ink-3); }

/* ---- People → Members ---- */
.cx-people.c-ppl { display: block; }
.cx-people-note { margin: 0 0 12px; }
.cx-people-bar .cx-search { width: 260px; }
.cx-people-bar .cx-select { min-width: 180px; }
.cx-people-table .cx-sort { color: inherit; text-decoration: none; }
.cx-people-table .cx-sort:hover, .cx-people-table .cx-sort[aria-current] { color: var(--c-ink); }
.cx-you { color: var(--c-ink-3); font-weight: 400; }
.cx-people-bar > .cx-help { margin-left: 4px; }
.cx-people-chip { text-decoration: none; }
.cx-people-table .cx-col-who { width: 30%; }
.cx-people-table td { white-space: nowrap; }
.cx-people-table td:first-child { white-space: normal; }
.cx-people-table tr[data-ppl-row] { cursor: pointer; }
.cx-people-table tr[data-ppl-row]:focus-visible { outline: 2px solid var(--c-accent); outline-offset: -2px; }
.cx-people-table tr.is-sel td { background: color-mix(in srgb, var(--c-accent) 9%, transparent); }
.cx-people-table tr.is-off .cx-pri, .cx-people-table tr.is-off .cx-people-role { color: var(--c-ink-3); }
.cx-who-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.cx-who-t .cx-pri { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-who-t .cx-sub:empty { display: none; }
.cx-people-role { color: var(--c-ink); font-weight: 600; }
.cx-people-wait { color: var(--c-warn); font-weight: 600; }
.cx-people-until { color: var(--c-warn); }
.cx-people-off { color: var(--c-ink-3); }
.cx-people-lists .cx-tag { margin-block: 0; }
.cx-people-table .is-end .cx-btn + .cx-btn { margin-left: 6px; }
.cx-more { color: var(--c-ink-3); font-size: 15px; letter-spacing: 1px; }
tr[data-ppl-row]:hover .cx-more { color: var(--c-ink); }
/* Avatars: one deep tone per person (c-ppl-av-N sets --t in theme.css), white letters in every theme. */
.cx-team .cx-av[class*='c-ppl-av-'] { background: color-mix(in srgb, var(--t, var(--c-accent)) 68%, #000); color: #fff; }
.cx-team .c-ppl-av { overflow: hidden; }
.cx-team .c-ppl-av img { width: 100%; height: 100%; object-fit: cover; }

/* Pager: "1–50 of 121" and ‹ 1 2 3 › */
.cx-pages { display: flex; align-items: center; gap: 2px; }
.cx-pages a, .cx-pages span { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 3px; color: var(--c-ink-3); font: 600 12px var(--font-mono); text-decoration: none; }
.cx-pages a:hover { color: var(--c-ink); background: var(--cx-row-hover); }
.cx-pages a[aria-current='page'] { color: var(--c-ink); background: color-mix(in srgb, var(--c-ink) 9%, transparent); }
.cx-pages a:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 1px; }
.cx-pages span[aria-hidden] { opacity: .5; }


/* Add people pop-up and the side panel: kept as they are, squared to match. */
.cx-team .c-mem-dialog { border-radius: 6px; }
.cx-team .c-ppl-drawer { border-radius: 0; }

/* ---- People → Lists ---- */
.cx-lists-new { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; }
.cx-lists-new .cx-input { width: 280px; max-width: 100%; height: 30px; }
.cx-lists-table .cx-tag, .cx-list-table .cx-tag { margin-left: 8px; }
.cx-lists-table .cx-sub { display: inline; margin-left: 6px; }
.cx-lists-help { margin: 10px 0 0; max-width: 90ch; }
.cx-list-head { margin: 2px 0 16px; }
.cx-list-title { margin: 0 0 4px; font: 800 20px/1.2 var(--font-display); letter-spacing: -.01em; }
.cx-list-head .cx-help { margin: 0; max-width: 110ch; }
.cx-list-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.cx-list-search { display: flex; gap: 6px; margin: 0; }
.cx-list-search .cx-input { width: 200px; height: 26px; font-size: 12.5px; }
.cx-col-check { width: 44px; }
.cx-list-block { display: grid; gap: 10px; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--cx-line); }
.cx-list-block:last-child { border-bottom: 0; margin-bottom: 0; }
.cx-list-block > .cx-btn { justify-self: start; }
.cx-list-block .cx-help { margin: 0; }
.cx-list-block .c-chips:empty { display: none; }
.cx-list-admins { list-style: none; margin: 0; padding: 0; border: 1px solid var(--cx-line); border-radius: var(--cx-r); background: var(--c-surface); }
.cx-list-admins .cx-lrow { min-height: 40px; padding: 0 6px 0 12px; justify-content: flex-start; }
.cx-list-admins .cx-lrow-t { flex: 1; min-width: 0; font-size: 13px; }

/* ---- Team settings ---- */
.cx-team-cols { gap: 36px; }
.cx-team-cols .cx-section { grid-template-columns: 190px minmax(0, 1fr); gap: 20px; }
.cx-fields.is-1 { grid-template-columns: minmax(0, 1fr); }
.cx-field > label .cx-code { margin-left: 6px; text-transform: none; }
.cx-names { margin: 0; }
.cx-names .cx-input:disabled { color: var(--c-ink-3); background: var(--cx-head-bg); cursor: not-allowed; }
.cx-names-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0 0; }
.cx-ctx .cx-textarea { min-height: 170px; }
.cx-ctx .cx-textarea[readonly] { background: var(--cx-head-bg); }
.cx-ctx-body[hidden] { display: none; }
.cx-ctx-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.cx-ctx-count { font-variant-numeric: tabular-nums; }
.cx-ctx-count.is-near { color: var(--c-warn); }
.cx-ctx-msg { font-size: 12px; color: var(--c-ink-3); }
.cx-ctx-msg.is-ok { color: var(--c-ok); }
.cx-ctx-msg.is-bad { color: var(--c-danger); }
.cx-ctx-note { margin: 6px 0 0; }
.cx-ctx-draft { display: grid; gap: 10px; margin-top: 12px; padding: 12px; border: 1px solid var(--cx-line); border-radius: var(--cx-r); background: var(--c-surface); }
.cx-ctx-draft[hidden] { display: none; }
.cx-ctx-draft .cx-help { margin: 0; }
.cx-ctx-draft > .cx-btn { justify-self: start; }
.cx-ctx-closed { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.cx-ctx-preview { margin: 0; color: var(--c-ink-2); }

/* The activity log in the right column is ActivityCard in compact mode (activity-routes.tsx, console-org.css). */

@media (max-width: 1100px) {
  .cx-team-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .cx-list-grid { grid-template-columns: minmax(0, 1fr); }
  .cx-team-cols .cx-section { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 720px) {
  .cx-people-bar { gap: 8px; }
  .cx-people-bar .cx-grow { display: none; }
  .cx-people-bar .cx-search { order: 3; flex: 1 1 100%; width: 100%; }
  .cx-people-bar .cx-people-seg { order: 0; }
  /* Phones: Member, Role, Access and the row's buttons; Lists and Last sign-in are in the side panel. */
  .cx-people-table :is(.cx-col-lists, .cx-col-seen) { display: none; }
  .cx-people-bar > .cx-help { display: none; }
  .cx-people-bar .cx-select { order: 2; min-width: 0; margin-left: auto; }
  .cx-people-bar .cx-input, .cx-people-bar .cx-select, .cx-rename .cx-input, .cx-lists-new .cx-input, .cx-list-search .cx-input, .cx-ctx .cx-textarea, .cx-names .cx-input { font-size: 16px; }
  .cx-team .cx-actions { width: 100%; }
  .cx-list-search { flex: 1 1 100%; }
  /* Phones: List, People and Owner fit without scrolling sideways (List admins is on the list's page), so the New list row does too. */
  .cx-lists-table .cx-col-admins { display: none; }
  .cx-lists-new .cx-input { flex: 1 1 100%; width: 100%; height: 40px; }
  .cx-lists-new .cx-btn { min-height: 40px; }
  .cx-list-search .cx-input { flex: 1; width: auto; }
  .cx-names-foot { flex-direction: column; align-items: stretch; }
}
