/* Admin page: under the title, the choice between its two views. Overview: the three figures in a row (the words,
   the figure large, a line under it), then the chart of a running total under a rule, the table of jobs outside the
   team, and the footnote. People: the view's two choices, four figures, the funnel as a table with a bar of ink for
   each step, the chart of active people, retention as a grid whose cells deepen with their share, what people use as
   four short lists, and the table of people; one person: their steps as a line that is ink as far as they got, their
   figures, their days as a grid, and their records as tables. Sections under rules, no boxes. Ink only: a share is a
   depth of ink, never a hue. Every rule is under the page, so nothing here reaches another page or a dialog. Tokens
   from styles.css only. */

.page[data-page="admin"] .admin-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-content: start; }
.page[data-page="admin"] .admin-figures {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 40px;
}
.page[data-page="admin"] .admin-figure { display: grid; gap: 2px; min-width: 0; align-content: start; }
.page[data-page="admin"] .admin-figure-label { color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.page[data-page="admin"] .admin-figure-value {
  font-size: 28px; font-weight: 600; line-height: 1.2; letter-spacing: -.012em; color: var(--ink); white-space: nowrap;
}
.page[data-page="admin"] .admin-figure-sub { color: var(--ink-3); font-size: 12.5px; line-height: 1.5; }
.page[data-page="admin"] .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; }
.page[data-page="admin"] .admin-chart { padding: 12px 0 0; }
.page[data-page="admin"] .admin-chart .chart-head { margin-bottom: 6px; }
.page[data-page="admin"] .admin-jobs { margin-top: 12px; }
.page[data-page="admin"] .admin-deleted { color: var(--ink-3); font-size: 12.5px; }

/* the figures need about 200px each: side by side only where they have it */
@media (max-width: 699px) {
  .page[data-page="admin"] .admin-figures { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .page[data-page="admin"] .admin-body { gap: 28px; }
}

/* the head: the title and its line, then the two views as tabs */
.page[data-page="admin"] .admin-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }

/* ---------------------------------------------------------------- People: the list */

.page[data-page="admin"] .admin-choices { gap: 6px 28px; }
.page[data-page="admin"] .admin-figures[data-count="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* five (the Plans view, with how the provider's events arrive): in a row where each has its room, else three and two */
.page[data-page="admin"] .admin-figures[data-count="5"] { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px 32px; }

/* a share: a bar of ink on a quiet track, as wide as its cell */
.page[data-page="admin"] .admin-bar {
  display: block; height: 6px; min-width: 48px; background: var(--paper-3); border-radius: var(--radius-cap); overflow: hidden;
}
.page[data-page="admin"] .admin-bar > i { display: block; height: 100%; width: var(--w); background: var(--ink); border-radius: var(--radius-cap); }

/* the funnel: the step, its bar taking the room that is left, then its figures */
.page[data-page="admin"] .admin-funnel td.admin-step { font-weight: 550; white-space: nowrap; }
.page[data-page="admin"] .admin-funnel th.admin-step-bar, .page[data-page="admin"] .admin-funnel td.admin-step-bar { width: 36%; min-width: 96px; }
.page[data-page="admin"] .admin-stopped { font-variant-numeric: tabular-nums; }
.page[data-page="admin"] .admin-gap { margin-top: 14px; color: var(--ink-2); max-width: 80ch; }
.page[data-page="admin"] .admin-gap + .admin-gap { margin-top: 4px; }

/* retention: a cell's ink deepens with its share; past the middle its figure is set in the paper's colour */
.page[data-page="admin"] .admin-retention th[scope="row"] {
  position: static; height: 40px; padding: 0 12px 0 0; vertical-align: middle; font-size: 13.5px; font-weight: 500;
  font-stretch: 100%; line-height: inherit; color: var(--ink); white-space: nowrap; text-align: left;
  border-bottom: 1px solid var(--rule);
}
.page[data-page="admin"] .admin-retention tbody tr:last-child th { border-bottom: 0; }
.page[data-page="admin"] .admin-retention .admin-week { min-width: 68px; }
.page[data-page="admin"] .admin-cell { border-left: 2px solid var(--paper); }
.page[data-page="admin"] .admin-cell[data-depth="0"] { color: var(--ink-3); }
.page[data-page="admin"] .admin-cell[data-depth="1"] { background: color-mix(in oklab, var(--ink) 8%, var(--paper)); }
.page[data-page="admin"] .admin-cell[data-depth="2"] { background: color-mix(in oklab, var(--ink) 18%, var(--paper)); }
.page[data-page="admin"] .admin-cell[data-depth="3"] { background: color-mix(in oklab, var(--ink) 30%, var(--paper)); }
.page[data-page="admin"] .admin-cell[data-depth="4"] { background: color-mix(in oklab, var(--ink) 62%, var(--paper)); color: var(--paper); font-weight: 550; }
.page[data-page="admin"] .admin-cell[data-depth="5"] { background: color-mix(in oklab, var(--ink) 84%, var(--paper)); color: var(--paper); font-weight: 550; }

/* what they use: four short lists side by side, each a name, its bar and its count */
.page[data-page="admin"] .admin-tallies { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 40px; padding-top: 12px; }
.page[data-page="admin"] .admin-tally-title { font-size: 13px; font-weight: 550; color: var(--ink-2); margin-bottom: 10px; }
.page[data-page="admin"] .admin-tally-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.page[data-page="admin"] .admin-tally-list li {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(48px, 1fr) minmax(2ch, max-content); align-items: center;
  gap: 12px; font-size: 13.5px;
}
.page[data-page="admin"] .admin-tally-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page[data-page="admin"] .admin-tally-count { text-align: right; color: var(--ink-2); }

/* the table of people */
.page[data-page="admin"] .admin-line { display: flex; align-items: baseline; gap: 14px; font-size: 12.5px; color: var(--ink-3); min-height: 20px; }
.page[data-page="admin"] .admin-people td.admin-person { min-width: min(30ch, 60vw); }
.page[data-page="admin"] .admin-person-name { font-weight: 550; white-space: nowrap; }
.page[data-page="admin"] .admin-person-under { display: flex; flex-wrap: wrap; gap: 0 12px; }
.page[data-page="admin"] .admin-tag { font-size: 12px; font-weight: 500; font-stretch: var(--label-stretch); color: var(--ink-3); white-space: nowrap; }
.page[data-page="admin"] .admin-tag[data-tone="warn"] { color: var(--warn); }

/* ---------------------------------------------------------------- Plans */

/* a row a workspace: its plan, what it used of its limit with the share as a meter, its state, and what an operator
   must look at, which wears the cross and the tone of what went wrong wherever the row is read */
.page[data-page="admin"] .admin-figure[data-tone="bad"] .admin-figure-value { color: var(--bad); }
.page[data-page="admin"] .admin-figure[data-tone="warn"] .admin-figure-value { color: var(--warn); }
/* what a workspace tried that its plan does not include: a mark for a conversation, quieter than every fact beside it */
.page[data-page="admin"] .admin-plans :is(.admin-plan-tried, .admin-plan-fold-tried) { color: var(--ink-3); }
/* and under the plan it breaks between its words ("Tried several processes, / Nov 13") rather than widen the column */
.page[data-page="admin"] .admin-plans .admin-plan-tried { white-space: normal; text-wrap: balance; }
.page[data-page="admin"] .admin-plan-fold-tried { grid-column: 1 / -1; font-size: 12.5px; }
.page[data-page="admin"] .admin-count { font-size: 12.5px; color: var(--ink-3); }
.page[data-page="admin"] .admin-plans td.admin-plan-id { font-size: 12.5px; }
.page[data-page="admin"] .admin-plan-name { font-weight: 550; white-space: nowrap; }
/* "with 20 add-ons" is one thing: it never breaks at its hyphen */
.page[data-page="admin"] .admin-plan-with { white-space: nowrap; }
.page[data-page="admin"] .admin-plan-id-wide {
  display: inline-block; max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom;
}
/* the Owner to write to, under the workspace's id: their address, cut like the id where it is long */
.page[data-page="admin"] .admin-plans .admin-plan-who { display: block; max-width: 28ch; font-size: 12.5px; }
.page[data-page="admin"] .admin-plans td.admin-plan-id:has(> .cell-sub) { padding-top: 9px; padding-bottom: 9px; height: auto; line-height: 1.4; }
.page[data-page="admin"] .admin-plan-fold-owner { grid-column: 1 / -1; font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
/* the address is a way to a person, quieter than the plan it stands beside */
.page[data-page="admin"] .admin-plans .admin-plan-owner > a { color: var(--ink-2); }
.page[data-page="admin"] .admin-plans .admin-plan-who { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* what stands under a neighbour's fact only where the table has five columns */
.page[data-page="admin"] .admin-plans .admin-plan-mid { display: none; }
.page[data-page="admin"] .admin-plans td.admin-plan-used:has(> .cell-sub) { line-height: 1.4; }
.page[data-page="admin"] .admin-plans :is(th, td).admin-plan-share { padding-left: 0; }
.page[data-page="admin"] .admin-plan-meter { display: inline-flex; align-items: baseline; gap: 10px; }
.page[data-page="admin"] .admin-plan-meter .meter { align-self: center; }
.page[data-page="admin"] .admin-plan-meter .fig { min-width: 4ch; text-align: right; }
.page[data-page="admin"] .admin-plans td:has(> .cell-sub) { padding-top: 9px; padding-bottom: 9px; height: auto; line-height: 1.4; }
.page[data-page="admin"] .admin-plan-word { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.page[data-page="admin"] .admin-plan-word[data-tone="warn"] { color: var(--warn); font-weight: 550; }
.page[data-page="admin"] .admin-plan-word[data-tone="bad"] { color: var(--bad); font-weight: 550; }
.page[data-page="admin"] .admin-plans td.admin-plan-problem { white-space: normal; min-width: 22ch; max-width: 44ch; }
.page[data-page="admin"] .admin-plans td.admin-plan-problem .cell-sub { text-wrap: pretty; }
/* the table by its own room (a container query, so an open nav counts as a narrower window does). Under 1,240px,
   five columns: how the plan is billed and the cycle's end stand under the plan, and the share's meter under what
   was used. Five columns need about 925px of it, so under 940px the columns have no room: no column is ever cut at
   its end. A workspace is then a block (admin-plans.js folded) with no heading over it: its id, the plan and how it
   is billed with what it used at the line's end, its state with the share used at the line's end, then what must be
   looked at with its sentence; the words on the left edge, the figures on the right one. */
.page[data-page="admin"] .admin-plans { container-type: inline-size; }
.page[data-page="admin"] .admin-plans .cell-fold { display: none; }
.page[data-page="admin"] .admin-plan-fold {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 3px 24px; padding: 3px 0 2px;
  font-size: 13.5px; font-weight: 400; line-height: 1.45; color: var(--ink); white-space: normal;
}
.page[data-page="admin"] .admin-plan-fold-id { grid-column: 1 / -1; overflow-wrap: anywhere; }
.page[data-page="admin"] .admin-plan-fold-used { justify-self: end; white-space: nowrap; }
.page[data-page="admin"] .admin-plan-fold-plan { color: var(--ink-2); }
.page[data-page="admin"] .admin-plan-fold-plan > b { font-weight: 550; color: var(--ink); }
.page[data-page="admin"] .admin-plan-fold-share { justify-self: end; }
.page[data-page="admin"] .admin-plan-fold-state { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 16px; color: var(--ink-2); }
.page[data-page="admin"] .admin-plan-fold-problem { grid-column: 1 / -1; display: grid; gap: 1px; padding-top: 3px; max-width: 70ch; }
.page[data-page="admin"] .admin-plan-fold-problem .cell-sub { margin-top: 0; text-wrap: pretty; }
/* under a flag's own sentence, that its workspace was deleted or is not active: a second thing to do, in ink */
.page[data-page="admin"] .admin-plans .admin-plan-also { color: var(--ink-2); }
@container (min-width: 940px) and (max-width: 1239px) {
  .page[data-page="admin"] .admin-plans :is(th, td).admin-plan-full { display: none; }
  .page[data-page="admin"] .admin-plans .admin-plan-mid { display: block; }
  .page[data-page="admin"] .admin-plans td.admin-plan-problem { min-width: 20ch; max-width: 36ch; }
  .page[data-page="admin"] .admin-plan-id-wide { max-width: 22ch; }
}
@container (max-width: 939px) {
  .page[data-page="admin"] .admin-plans :is(th, td).admin-plan-wide, .page[data-page="admin"] .admin-plan-id-wide,
  .page[data-page="admin"] .admin-plans .admin-plan-who { display: none; }
  .page[data-page="admin"] .admin-plans .cell-fold, .page[data-page="admin"] .admin-plans .cell-fold > .cell-fact { display: block; margin: 0; white-space: normal; }
  .page[data-page="admin"] .admin-plans td.admin-plan-id { height: auto; padding: 9px 0 10px; }
  /* a block names its own facts: a lone heading over a column of blocks would name nothing */
  .page[data-page="admin"] .admin-plans thead { display: none; }
}

/* ---------------------------------------------------------------- People: one person */

.page[data-page="admin"] .admin-back { font-size: 13px; margin-bottom: 6px; }
.page[data-page="admin"] .admin-person-title { overflow-wrap: anywhere; }
.page[data-page="admin"] .admin-person-sub .facts { display: flex; flex-wrap: wrap; gap: 2px 18px; }

/* the steps: one line, ink as far as they got and a hairline after, a mark where each step begins */
.page[data-page="admin"] .admin-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.page[data-page="admin"] .admin-step-item {
  position: relative; display: grid; gap: 1px; align-content: start; padding: 14px 16px 0 0; border-top: 2px solid var(--rule-2);
}
.page[data-page="admin"] .admin-step-item[data-done="yes"] { border-top-color: var(--ink); }
.page[data-page="admin"] .admin-step-mark {
  position: absolute; top: -6px; left: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--paper);
  border: 2px solid var(--rule-2);
}
.page[data-page="admin"] .admin-step-item[data-done="yes"] .admin-step-mark { background: var(--ink); border-color: var(--ink); }
.page[data-page="admin"] .admin-step-name { font-size: 13.5px; font-weight: 550; line-height: 1.35; }
.page[data-page="admin"] .admin-step-item[data-done="no"] .admin-step-name { color: var(--ink-3); font-weight: 500; }
.page[data-page="admin"] .admin-step-when { font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }

/* their days: a grid of squares, a column a week, beside the totals by where the requests came from */
.page[data-page="admin"] .admin-activity-body { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 20px 56px; align-items: start; padding-top: 12px; }
.page[data-page="admin"] .admin-heat-wrap { display: grid; gap: 10px; max-width: 34ch; }
.page[data-page="admin"] .admin-heat { display: grid; grid-template-rows: repeat(7, 13px); grid-auto-flow: column; grid-auto-columns: 13px; gap: 3px; }
.page[data-page="admin"] .admin-day { display: block; background: var(--paper-3); }
.page[data-page="admin"] .admin-day[data-depth="none"] { background: none; }
.page[data-page="admin"] .admin-day[data-depth="1"] { background: color-mix(in oklab, var(--ink) 22%, var(--paper)); }
.page[data-page="admin"] .admin-day[data-depth="2"] { background: color-mix(in oklab, var(--ink) 40%, var(--paper)); }
.page[data-page="admin"] .admin-day[data-depth="3"] { background: color-mix(in oklab, var(--ink) 58%, var(--paper)); }
.page[data-page="admin"] .admin-day[data-depth="4"] { background: color-mix(in oklab, var(--ink) 78%, var(--paper)); }
.page[data-page="admin"] .admin-day[data-depth="5"] { background: var(--ink); }
.page[data-page="admin"] .admin-refused { color: var(--bad); font-weight: 550; }
.page[data-page="admin"] .admin-job { color: var(--ink-3); font-size: 12.5px; }
.page[data-page="admin"] .panel > .note { margin-top: 10px; }

@media (max-width: 1099px) {
  .page[data-page="admin"] .admin-tallies { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page[data-page="admin"] .admin-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 22px; }
}
@media (max-width: 1279px) {
  .page[data-page="admin"] .admin-figures[data-count="5"] { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 40px; }
}
@media (max-width: 899px) {
  .page[data-page="admin"] .admin-figures[data-count="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 32px; }
  .page[data-page="admin"] .admin-figures[data-count="5"] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 32px; }
  .page[data-page="admin"] .admin-activity-body { grid-template-columns: minmax(0, 1fr); }
}
/* a phone: the steps down the page, the line beside them */
@media (max-width: 699px) {
  .page[data-page="admin"] .admin-figures:is([data-count="4"], [data-count="5"]) { grid-template-columns: minmax(0, 1fr); }
  .page[data-page="admin"] .admin-tallies { grid-template-columns: minmax(0, 1fr); }
  .page[data-page="admin"] .admin-steps { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  .page[data-page="admin"] .admin-step-item { border-top: 0; border-left: 2px solid var(--rule-2); padding: 0 0 16px 18px; }
  .page[data-page="admin"] .admin-step-item[data-done="yes"] { border-left-color: var(--ink); }
  .page[data-page="admin"] .admin-step-item:last-child { padding-bottom: 0; }
  .page[data-page="admin"] .admin-step-mark { top: 4px; left: -6px; }
  .page[data-page="admin"] .admin-person-name { white-space: normal; overflow-wrap: anywhere; }
  /* the bars repeat the figures beside them: on a phone the figures keep the room */
  .page[data-page="admin"] .admin-funnel th.admin-step-bar, .page[data-page="admin"] .admin-funnel td.admin-step-bar { display: none; }
}
