/* Ticket 064: per-screen layout for the admin screens, in the look of the 30 Nov mock-up. */
/* Layout only: colours, fonts and the shell come from look.css. */

/* ---------- every page: title, muted line, filters ---------- */
main .page { max-width: 80rem; }
main .head { margin-bottom: 1rem; align-items: flex-start; }
main .page-title { font-size: 1.5rem; line-height: 2rem; font-weight: 700; letter-spacing: 0; margin: 0; }
main p.page-sub { font-size: 0.875rem; color: #71717a; margin: 0.25rem 0 1rem; max-width: 60rem; }
main .head p.page-sub { margin-bottom: 0; }

/* Filters: a plain row of selects, labels small above. */
main .filters, main section.scope.filters { background: none; border: 0; box-shadow: none; padding: 0; margin: 0 0 1rem; }
main .filters .scoperow { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
main .filters .pickerlabel { font-size: 0.75rem; color: #52525b; gap: 0.25rem; }
main .filters select, main .filters input[type="search"], main .pickrow select { min-height: 2.5rem; font-size: 0.875rem; border-radius: 2px; }
main .filters .scopenote, main .scopenote { font-size: 0.75rem; color: #71717a; margin: 0.5rem 0 0; max-width: 60rem; }
main .pickrow.filters { gap: 0.75rem; margin-bottom: 1rem; }

/* ---------- Dashboard ---------- */
/* The thin "Needs attention" strip: what is waiting, as one line of links. */
main .attention { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1rem; padding: 0.625rem 1rem; margin: 0 0 1.25rem;
  background: #fff; border: 1px solid #e4e4e7; border-radius: 2px; font-size: 0.8125rem; box-shadow: none; }
main .attention[hidden] { display: none; }
main .attention p { margin: 0; flex: 1 1 auto; }
main .attention p b { font-weight: 500; font-size: 0.75rem; color: #71717a; margin-right: 0.5rem; }
main .attention small { font-size: 0.8125rem; }
main .attention a.action { min-height: 0; padding: 0.25rem 0.75rem; font-size: 0.8125rem; }

main .figures { margin: 0 0 1.25rem; }
main .figures-h { font-size: 1rem; font-weight: 600; margin: 0 0 0.5rem; color: inherit; }
/* A joined row of figure boxes: label above, bold number below. */
main ul.figures-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; margin: 0;
  border: 1px solid #e4e4e7; background: #fff; border-radius: 2px; }
main ul.figures-row > li.card { border: 0; border-right: 1px solid #e4e4e7; border-radius: 0; box-shadow: none; background: #fff; margin: 0; min-width: 0; }
main ul.figures-row > li.card:last-child { border-right: 0; }
main ul.figures-row > li.card > a, main ul.figures-row > li.card > .card-body { display: block; padding: 0.75rem 1rem 0.75rem; }
main ul.figures-row > li.card .icon { display: none; }
main ul.figures-row > li.card > a > span:last-child, main ul.figures-row > li.card .card-body > span:last-child { display: flex; flex-direction: column-reverse; gap: 0.125rem; }
main ul.figures-row > li.card small { font-size: 0.75rem; font-weight: 400; color: #71717a; text-transform: none; letter-spacing: 0; }
main ul.figures-row > li.card b { font-size: 1.5rem; line-height: 2rem; font-weight: 700; }
main ul.figures-row > li.card.warn, main ul.figures-row > li.card.alert { border-left: 0; }
/* The long explanation stays in the page (tests and screen readers read it); it shows as a small tip on hover or focus. */
main ul.figures-row > li.card { position: relative; }
main ul.figures-row > li.card .why { display: none; }
main ul.figures-row > li.card .explain, main ul.figures-row > li.card:hover .explain, main ul.figures-row > li.card:focus-within .explain {
  position: absolute; z-index: 6; left: 0.5rem; right: 0.5rem; top: calc(100% - 0.25rem); margin: 0; padding: 0.625rem 0.75rem; width: auto;
  background: #0a0a0a; color: #fff; border: 0; border-radius: 2px; font-size: 0.75rem; line-height: 1.1rem;
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .12s ease .2s, visibility 0s linear .32s; }
main ul.figures-row > li.card:hover .explain, main ul.figures-row > li.card:focus-within .explain { opacity: 1; visibility: visible; }
main ul.figures-row .card-parts { padding: 0 1rem 0.75rem; font-size: 0.75rem; }
@media (max-width: 68rem) { main ul.figures-row { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  main ul.figures-row > li.card { border-bottom: 1px solid #e4e4e7; } }
@media (max-width: 30rem) { main ul.figures-row > li.card:nth-child(even) { border-right: 0; } main ul.figures-row > li.card { border-right: 1px solid #e4e4e7; } main ul.figures-row > li.card > a, main ul.figures-row > li.card > .card-body { padding: 0.625rem 0.75rem; } }

/* Tables with bars, panels as plain white boxes. */
main .panel { border-radius: 2px; box-shadow: none; border: 1px solid #e4e4e7; background: #fff; }
main .panel > header { padding: 0.75rem 1rem; }
main .panel > header h2 { font-size: 1rem; font-weight: 600; text-transform: none; letter-spacing: 0; }
main .split.even { grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 68rem) { main .split.even { grid-template-columns: 1fr; } }
main .bars .track { height: 6px; background: #e4e4e7; border-radius: 0; }
main .bars .track span { background: #0a0a0a; border-radius: 0; }
main .bars li.bad .track span, main .bars li.warn .track span, main .bars li .track span { background: #0a0a0a; }
main .reasons a { padding: 0.625rem 1rem; }

/* ---------- Tables: the mock-up's list table ---------- */
main table.data, main table.matrix, main table.subsum, main .pay-table, main .pay-todo-table, main .pay-report-table, main .review-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 0.8125rem; }
main table.data thead th, main table.matrix thead th, main table.subsum thead th, main .pay-table thead th, main .pay-todo-table thead th, main .pay-report-table thead th, main .review-table thead th {
  font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: #71717a; padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid #e4e4e7; background: #fff; }
main table.data tbody th, main table.subsum tbody th, main table.subsum tfoot th, main table.data td, main table.matrix td, main table.subsum td, main .pay-table td, main .pay-todo-table td, main .pay-report-table td, main .review-table td { padding: 0.5rem 0.75rem; border-bottom: 1px solid #f4f4f5; vertical-align: middle; }
main table.matrix .scroll, main .scroll { border: 1px solid #e4e4e7; border-radius: 2px; background: #fff; }
main table.subsum { width: auto; min-width: 36rem; border: 1px solid #e4e4e7; }
main td.num, main th.num { text-align: right; font-variant-numeric: tabular-nums; }
main .subsum-wrap { margin: 0 0 1.25rem; }

/* Pages that are a list: the list sits in one white box, actions row above it. */
main .actions-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; }
main .actions-row .action { min-height: 2.75rem; border-radius: 2px; }
main .pager { margin-top: 0.75rem; font-size: 0.8125rem; }
main .legend { font-size: 0.75rem; color: #71717a; }

/* Forms, cards and notices on the list pages: white, square, one border. */
main .mform, main .card:not(li), main .box, main details.addperson, main .pq-panel, main .pay-card { border-radius: 2px; box-shadow: none; border: 1px solid #e4e4e7; background: #fff; }

/* The person drawer: a white sheet, sections with small headings. */
main .drawer .sheet, .drawer .sheet { border-radius: 0; box-shadow: -8px 0 24px rgba(0,0,0,.12); }
.drawer .sheet h3, .drawer .sheet h4 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: #71717a; }

/* ---------- Sign-in, forgot, set password, second step: white card on a zinc page, logo above ---------- */
body:has(#signInForm), body:has(#forgotTitle), body:has(#setTitle) { background: #fafafa; }
.signin, .signin-card, #signInGate .panel, .gate-card { border-radius: 2px; box-shadow: none; border: 1px solid #e4e4e7; background: #fff; max-width: 26rem; margin-inline: 0; }

/* ---------- Phone ---------- */
@media (max-width: 40rem) {
  main .page-title { font-size: 1.25rem; line-height: 1.75rem; }
  main .filters .pickerlabel, main .pickrow.filters > * { flex: 1 1 100%; }
  main .filters select { width: 100%; }
  main table.subsum { min-width: 0; }
  main .attention { padding: 0.5rem 0.75rem; }
}

/* ---------- Prequalification and Payments: joined status boxes, one white list ---------- */
main .pq-pagelinks { gap: 0.5rem; }
main .pq-pagelinks .button, main .pq-pagelinks a.secondary { min-height: 2.75rem; border-radius: 2px; }
main nav.pq-states { display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 1rem; border: 1px solid #e4e4e7; background: #fff; border-radius: 2px; }
main nav.pq-states > * { flex: 1 1 8rem; min-width: 0; border: 0; border-right: 1px solid #e4e4e7; border-radius: 0; box-shadow: none; background: #fff; padding: 0.625rem 1rem;
  display: flex; flex-direction: column-reverse; align-items: flex-start; }
main nav.pq-states > *:last-child { border-right: 0; }
main nav.pq-states > * b { font-size: 1.5rem; line-height: 2rem; font-weight: 700; }
main nav.pq-states > * small, main nav.pq-states > * span { font-size: 0.75rem; color: #71717a; }
main .pay-tabs { gap: 0; border-bottom: 1px solid #e4e4e7; margin-bottom: 1rem; }
main .pay-pair { gap: 1rem; }

/* ---------- 064e: Dashboard, tighter ---------- */
main table.subsum { width: 100%; }
main .panel > header { border-bottom: 1px solid #e4e4e7; }
main .reasons a, main .bars li { padding-top: 0.5rem; padding-bottom: 0.5rem; }
main .reasons b { font-size: 1rem; }
main .bars .track { height: 4px; }
main .scopenote { margin-top: 0.25rem; }

/* ---------- 064e: Personnel, dense rows ---------- */
main table.matrix th, main table.matrix td { padding-top: 0.375rem; padding-bottom: 0.375rem; line-height: 1.25; }
main table.matrix td.s small, main table.matrix td small { display: block; font-size: 0.6875rem; line-height: 0.875rem; min-height: 0; }
main table.matrix tbody tr:hover > * { background: #fafafa; }
main table.matrix thead th { box-shadow: inset 0 -1px 0 #e4e4e7; }
main table.matrix th[scope="row"] { font-size: 0.8125rem; font-weight: 500; }
main table.matrix th[scope="row"] b { font-weight: 500; }
main table.matrix td.mono, main table.matrix td.ref { font-size: 0.75rem; color: #52525b; }

/* ---------- 064e: Reports ---------- */
main .standings .bar { height: 4px; background: #e4e4e7 !important; }
main .standings .bar > span { background: #0a0a0a; }
main .standings .standing { padding: 0.625rem 1rem; }
main .standings .top b { font-weight: 500; }
main .panel .panelnote, main .panel > p { font-size: 0.75rem; color: #71717a; }

/* ---------- 064e: Payments ---------- */
body main .pay-page p.pay-demo { background: #f4f4f5 !important; border: 1px solid #e4e4e7 !important; border-left: 1px solid #e4e4e7 !important; box-shadow: none !important; color: #0a0a0a; border-radius: 2px !important; font-weight: 500; font-size: 0.8125rem; padding: 0.5rem 1rem; margin: 0 0 1rem; }
main .pay-page .pay-for { font-size: 0.875rem; font-weight: 400; margin: 0.5rem 0; }
main .pay-page .pay-for b, main .pay-page .pay-for strong { font-weight: 600; }
main .pay-page .help, main .pay-page .body > .help { font-size: 0.75rem; color: #71717a; }
main .pay-page .panel > header h2 { font-size: 0.875rem; }
main .pay-page .panel { margin-bottom: 1rem; }
main .pay-page .body button:not(.primary):not(.pay-copy) { min-height: 2.25rem; font-size: 0.8125rem; font-weight: 500; padding: 0 0.75rem; }
main .pay-page .pay-tabs, main .pay-page nav.pay-tabs button { font-size: 0.8125rem; }
main .pay-page .pay-table td, main .pay-page .pay-todo-table td, main .pay-page .pay-report-table td { padding-top: 0.375rem; padding-bottom: 0.375rem; }
@media (max-width: 68rem) { main ul.figures-row:is(#counts, #prequalCounts, #certCounts) { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; } }
@media (max-width: 68rem) { main ul.figures-row > li.card:nth-child(n+3) { border-top: 1px solid #e4e4e7; } main ul.figures-row > li.card { border-bottom: 0; } }
@media (max-width: 68rem) { main ul#counts.figures-row:has(> li:nth-child(4)), main ul#counts.figures-row:has(> li:nth-child(5)) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- 064 polish (admin) ---------- */
/* Figures: the label above, the bold number below. look.css puts the label first with order -1, which the reversed column turned back over. */
main ul.figures-row > li.card small { order: 0; }

/* Personnel: the sign and its word, apart. */
.pay-tag::before { margin-right: 0.3em; }
/* Personnel: the filters are one row that wraps, the search among them. */
.filterblock { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem 1rem; margin: 0 0 1rem; }
.filterblock > .pickrow, .filterblock > .controls { display: contents; }
.filterblock .search-field { margin-bottom: 0; flex: 1 1 20rem; max-width: 26rem; }
.filterblock .controls > span { align-self: center; padding-bottom: 0.5rem; }
/* Marking: the empty line has the card's padding and plain muted text. */
main :is(.waiting, .questions, .standings) > li.empty { padding: 0.75rem 1.25rem; font-style: normal; margin: 0; }

/* No left stripes: the mock-up's notices are tinted boxes ruled all round in one hue. (admin.css gives each of these a 4px accent !important.) */
body :is(.pay-page .pay-said, .verdict-group.eligible, .addsub-outcome.good, .pay-page .pay-refund-block.done, .drawer .record.valid) {
  border: 1px solid var(--acc-green-line) !important; }
body :is(.held, .sf-held-one, .pt-wrong, .pay-page .pay-refund-block, .verdict-group.outstanding, .verdict-group.needs_review, .drawer .clearance, .note.bad, .removalwarn, .drawer .record.lapsed, .drawer .record.failed, .sf-fold.sf-rejected) {
  border: 1px solid var(--acc-red-line) !important; }
body :is(.sentback-banner, .verdict-group.held-here, .sf-head, .dash-notice, .addsub-outcome.bad, .pq-alert, .pay-page .pay-refund-block.owed.pay-void-block, .drawer .record.soon, .q.pending) {
  border: 1px solid var(--acc-amber-line) !important; }
body :is(.pq-next, .pic-comment, .panel.explain, .pay-page .panel.pay-chosen-list) {
  border: 1px solid var(--acc-blue-line) !important; }
/* The demonstration notice is grey, not a warning (facts 34). */
body :is(.pay-demo, .drawer .record.open) { border: 1px solid #e4e4e7 !important; }
body .pay-demo { background: #f4f4f5 !important; color: #0a0a0a; font-weight: 500; font-size: 0.8125rem; padding: 0.5rem 1rem; border-radius: 2px !important; box-shadow: none !important; }
body .drawer .record.open { border-color: var(--acc-steel-line) !important; }
body .drawer .clearance.cleared { border: 1px solid var(--acc-green-line) !important; background: var(--acc-green-tint) !important; }
main .panel li.empty { font-style: normal; }

/* ---------- 068: ink and amber, page by page ---------- */
/* Payments' To do: a count waiting for someone is ink with an orange mark, not red (nothing has failed). */
.pay-todo-list b.due { color: var(--text); }
main .pay-todo-list li:has(b.due) { box-shadow: inset 4px 0 0 var(--accent) !important; }
.pay-todo-list a span { text-decoration-color: var(--border-strong); text-underline-offset: 4px; }
.pay-todo-list a:hover span { text-decoration-color: currentColor; }
/* A stack of panels is spaced by its gap alone (the panel's own margin doubled it). */
main .stack > .panel { margin-bottom: 0; }
/* Visitors' declaration form: each label sits over its own field, a step below the one before. */
#wordingForm { display: grid; justify-items: start; gap: 0.375rem; max-width: 48rem; }
#wordingForm > * { margin: 0; }
#wordingForm :is(select, textarea) + label.field { margin-top: 0.75rem; }
#wordingForm textarea { width: 100%; }
#wordingForm button[type="submit"] { margin-top: 0.75rem; }
#wordingForm .note:empty { display: none; }
/* Tags: waiting is ink on the orange tint, edged in the orange, so it does not read as the grey of a neutral tag. */
body main :is(.pq-pill, .sf-pill, .pay-status, .pay-tag, .doc-chip, .modulecard .pill):is(.pending, .expired, .late, .unpaid, .wait):not(.unfilled),
body main .q.pending .tag, body .drawer :is(.pay-tag, .pay-status):is(.pending, .expired, .late, .unpaid) {
  background: var(--accent-tint) !important; color: var(--text) !important; border-color: var(--accent) !important; }
/* "Required" on a course card is a fact, not a fault: ink on white. */
body main .modulecard .pill.req:not(.unfilled) { background: #fff !important; color: var(--text) !important; border-color: var(--border-strong) !important; }
/* Links in tables: a light grey underline that darkens when pointed at; a table of figures should not look striped. */
main table :is(a, .linklike), main table.subsum .linklike, main table.subsum a {
  text-decoration-line: underline; text-decoration-color: var(--border-strong) !important; text-decoration-thickness: 1px !important; text-underline-offset: 4px; }
main table :is(a, .linklike):hover, main table.subsum .linklike:hover, main table.subsum a:hover { text-decoration-color: currentColor !important; }
/* The Dashboard's "Waiting for you" strip: its one button is a button (white on ink), without the dot its links carry. */
main .attention a.action { color: #fff; font-weight: 500; }
main .attention a.action::before { content: none; }
main .attention a.action:hover { text-decoration: none; background: var(--brand-hover); }
main .attention p b { color: var(--text); }
/* Per subcontractor: a count of people who did not pass is a failure, red as on "What is holding them up"; a zero is not a link and stays ink. */
main table.subsum td[data-label="Not passed"] :is(a, .linklike) { color: var(--danger); }
/* Payments: the figures that open their orders keep a light underline, so the money reads as figures. */
main .pay-page :is(.pay-money, .pay-for, .pay-sumline, #paymentsFor, #paymentsMoney) a {
  text-decoration-line: underline; text-decoration-color: var(--border-strong); text-decoration-thickness: 1px; text-underline-offset: 5px; }
main .pay-page :is(.pay-money, .pay-for, .pay-sumline, #paymentsFor, #paymentsMoney) a:hover { text-decoration-color: currentColor; }
/* Visitors' Day: the project and the date side by side, the link under them. */
main .panel > .body:has(> #visitSite) { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
main .panel > .body:has(> #visitSite) > #visitLink { flex: 1 1 100%; margin: 0; }
main .panel > .body > #visitSite, main .panel > .body > #visitDate { margin: 0; }
/* Prequalification: one ruled list, not fifty floating boxes. */
main .pq-rows { gap: 0; }
main .pq-rows > .pq-row + .pq-row { border-top-width: 0; }
/* Administrators: the projects a person is in charge of are a plain list of tick boxes, not a box drawn round them;
   a row's buttons keep their words on one line. */
main fieldset.projectpick { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 0.25rem; }
main fieldset.projectpick .projectbox { display: flex; align-items: center; gap: 0.5rem; white-space: nowrap; }
main td.row-actions .rowaction { white-space: nowrap; }
/* A note under a table is spaced off it, and set at the size of the page's other notes. */
main .panel .scroll + p.lede, main .panel .scroll + p.note { margin: 0.75rem 0 0; font-size: 0.8125rem; }
