/*
 * THE PRODUCT'S ONE PAGE DESIGN on Admin (manage.html), Where Everything Is Up To (cases.html) and My Tasks
 * (tasks.html). Sam, 2026-11-24: "why isnt it following a master design - every page should be the same".
 * The master is the Documents page (documents/index.html): library.css's shell and header, documents.css's
 * underlined tabs, tables and More menu. This sheet loads last on those three pages and only fits their own
 * parts to it; everything is scoped to body[data-master-page] so no other page changes.
 */

body[data-master-page] { background: #fff; }
body[data-master-page] .library-shell > main { min-width: 0; background: #fff; }

/* MORE: the page's other actions in one menu, as Documents' (its own items are styled by id in documents.css). */
body[data-master-page] .documents-actions-items { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 15rem; display: grid; padding: 0.3rem; border: 1px solid var(--line, rgba(0, 0, 0, 0.14)); border-radius: 10px; background: #fff; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12); }
body[data-master-page] .documents-actions-items > a,
body[data-master-page] .documents-actions-items > button { display: flex; align-items: center; height: auto; min-height: 36px; padding: 0.45rem 0.7rem; border: 0; border-radius: 7px; background: none; color: #344054; font: inherit; font-size: 13px; font-weight: 500; text-align: left; text-decoration: none; white-space: nowrap; cursor: pointer; }
body[data-master-page] .documents-actions-items > a:hover,
body[data-master-page] .documents-actions-items > button:hover,
body[data-master-page] .documents-actions-items > a:focus-visible,
body[data-master-page] .documents-actions-items > button:focus-visible { background: var(--surface-hover, rgba(0, 0, 0, 0.05)); outline: none; }
body[data-master-page] .documents-actions-items > a:focus-visible,
body[data-master-page] .documents-actions-items > button:focus-visible { box-shadow: inset 0 0 0 2px var(--brand, #007b77); }
body[data-master-page] .library-actions { align-items: center; }
body[data-master-page] .library-actions .search { width: clamp(280px, 32vw, 580px); }
body[data-master-page] .library-actions .ghost { height: 44px; }
@media (max-width: 1000px) {
  body[data-master-page] .library-head { flex-wrap: wrap; }
  body[data-master-page] .library-actions { justify-content: flex-end; }
}
/* On a phone library.css hides every .secondary (its own header's extra buttons). On these pages a .secondary is
   a row's, a section's or a step's own button (Start, Evidence, Save, Use the Product's Word): it stays. */
@media (max-width: 640px) {
  body[data-master-page] .secondary { display: inline-flex; align-items: center; justify-content: center; }
}
@media (max-width: 700px) {
  body[data-master-page] .library-actions { width: 100%; flex-wrap: wrap; }
  body[data-master-page] .documents-actions-items { right: auto; left: 0; }
}

/* ---- Admin, Reports' views and Registers (manage.html) ---- */
body[data-master-page="admin"] .library-shell > main { overflow: auto; padding: 30px 32px 60px; }
/* The tab groups are one row of underlined tabs: each area shows only its own (manage.js switchView). */
.management-tabs .management-tab-group,
.management-tabs .management-tab-group > div { display: contents; }
.management-tabs .management-tab-group > span { display: none; }
body[data-master-page="admin"] .view { padding-top: 4px; }
/* Registers has no tabs: its table starts where Documents' tabs would end. */
body[data-master-page="admin"] .registers-view { padding-top: 24px; }
body[data-master-page="admin"] .data-row [role=cell] > b + small { display: block; margin-top: 3px; }
/* A view's one line and its buttons, under the tabs (no eyebrow over a second big title). */
.view-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin: 0 0 16px; }
.view-intro { min-width: 0; flex: 1 1 320px; }
.view-intro h2 { margin: 0 0 4px; color: #101828; font-size: 16px; }
.view-intro p { margin: 0; max-width: 720px; color: #6c7d95; font-size: 13px; line-height: 1.45; }
.view-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
/* A view's figures: one summary line, not a row of stat cards. */
.view-summary { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0 0 18px; color: #34425a; font-size: 13px; }
.view-fact strong { color: #101828; font-size: 15px; font-variant-numeric: tabular-nums; }
.view-fact small { color: #6c7d95; font-size: 12px; }
/* A titled section with a line above it, not a boxed card. */
.view-section { min-width: 0; padding-top: 12px; border-top: 1px solid #dce5e4; }
.view-section > header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 4px; }
.view-section > header h2 { margin: 0; color: #101828; font-size: 15px; }
body[data-master-page="admin"] .stack { padding: 0 0 8px; }
body[data-master-page="admin"] .grid.two { gap: 18px 32px; }
body[data-master-page="admin"] .stack-row b { font-size: 12px; }
body[data-master-page="admin"] .stack-row small { font-size: 11px; }
/* Tables as the Documents register draws them (on a phone, manage.css's approved cards stay). */
body[data-master-page="admin"] .data-table { box-shadow: none; color: inherit; }
@media (min-width: 641px) {
  body[data-master-page="admin"] .data-table { border: 1px solid #dce5e4; border-radius: 7px; background: #fff; }
  body[data-master-page="admin"] .data-row { font-size: 12px; color: #34425a; }
  body[data-master-page="admin"] .data-row b { color: #101828; font-size: 13px; }
  body[data-master-page="admin"] .data-row.head { min-height: 38px; background: #f3f6f7; color: #34425a; font-size: 11px; font-weight: 700; letter-spacing: 0; text-transform: none; }
}
/* Registers: the list straight under the header; an open register (or a search) under its name. */
.register-section + .register-section { margin-top: 24px; }
.register-section > h2 { margin: 0 0 10px; color: #101828; font-size: 16px; }
.register-section > .stack { padding: 0; }
/* Admin's settings: sections divided by a line, each with its title, no box and no label over it.
   Script-drawn sections (notice-settings.js, terminology.js) still write a small label: it is not shown. */
.admin-landing-side { gap: 0; }
.admin-card { min-width: 0; padding: 16px 0; border-top: 1px solid #dce5e4; }
.admin-landing-side > .admin-card:first-child,
.admin-landing-side > .admin-card[hidden] + .admin-card { border-top: 0; padding-top: 0; }
.admin-card > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 6px; }
.admin-card > header > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.admin-card h2 { margin: 0; color: #101828; font-size: 15px; }
body[data-master-page="admin"] .eyebrow { display: none; }
body[data-master-page="admin"] .loading { margin-top: 40px; }
@media (max-width: 760px) {
  body[data-master-page="admin"] .library-shell > main { padding: 20px 16px 48px; }
  .view-actions { justify-content: flex-start; }
}
/* On a phone library.css hides the search: here it is how Registers is searched. */
@media (max-width: 640px) {
  body[data-master-page="admin"] .library-actions .search { display: flex; flex: 1 1 100%; width: 100%; }
}

/* ---- Where Everything Is Up To (cases.html) ---- */
body[data-master-page="cases"] .library-shell > main { padding: 30px 32px 40px; }
@media (max-width: 760px) {
  body[data-master-page="cases"] .library-shell > main { padding: 20px 16px 32px; }
}

/* ---- My Tasks (tasks.html) ---- */
/* The header and tabs across the top, then the list and the open task side by side, each scrolling on its own. */
body[data-master-page="tasks"] .library-shell > main.work-main { display: flex; flex-direction: column; min-height: 0; overflow: hidden; padding: 30px 32px 0; }
body[data-master-page="tasks"] .library-head,
body[data-master-page="tasks"] .work-status-tabs { flex: none; }
body[data-master-page="tasks"] .work-status-tabs { grid-column: auto; grid-row: auto; padding: 0; background: none; }
/* Above a phone, Documents' underlined tabs; on a phone, documents.css's own phone tabs. */
@media (min-width: 641px) {
  body[data-master-page="tasks"] .work-status-tabs { gap: 20px; margin: 23px 0 0; border-bottom: 1px solid #dce5e4; }
  body[data-master-page="tasks"] .work-status-tabs button { min-width: 95px; padding: 11px 9px 13px; border-bottom-width: 3px; color: #475467; font-size: 13px; }
  body[data-master-page="tasks"] .work-status-tabs button[aria-current="page"] { color: var(--brand); border-bottom-color: var(--brand); font-weight: 700; }
}
@media (max-width: 640px) {
  body[data-master-page="tasks"] .work-status-tabs button { padding: 0 16px; border-bottom-width: 1px; font-size: 14px; }
  body[data-master-page="tasks"] .work-status-tabs button[aria-current="page"] { color: #fff; font-weight: 700; }
}
/* My Tasks' header has only the ✦ (and Work Settings): it stays on the title's row at every width. */
body[data-master-page="tasks"] .library-head { flex-wrap: nowrap; align-items: flex-start; }
body[data-master-page="tasks"] .library-actions { width: auto; flex: none; }
.work-panes { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(290px, 360px) minmax(0, 1fr); gap: 0 24px; }
body[data-master-page="tasks"] .work-panes > .task-inbox { grid-column: 1; grid-row: 1; min-height: 0; overflow: auto; padding: 16px 0 24px; border-right: 0; background: #fff; }
body[data-master-page="tasks"] .work-panes > .task-work { grid-column: 2; grid-row: 1; min-height: 0; border-left: 1px solid #dce5e4; }
body[data-master-page="tasks"] .work-panes > .task-inbox,
body[data-master-page="tasks"] .work-panes > .task-work { box-shadow: none; }
body[data-master-page="tasks"] .work-overview { padding: 24px 0 44px 28px; }
/* The list as the Documents register's rows: one bordered table, a line between rows. */
body[data-master-page="tasks"] #task-list { flex: none; overflow: visible; border: 1px solid #dce5e4; border-radius: 7px; background: #fff; }
body[data-master-page="tasks"] #task-list > .work-row:first-child,
body[data-master-page="tasks"] #task-list > .work-register-head + .work-row { border-top: 0; }
body[data-master-page="tasks"] .work-register-head { background: #f3f6f7; border-bottom: 1px solid #dce5e4; border-radius: 7px 7px 0 0; color: #34425a; font-weight: 700; letter-spacing: 0; text-transform: none; }
body[data-master-page="tasks"] .work-empty { padding: 16px; }
body[data-master-page="tasks"] .task-inbox > .work-reading { margin: 0 0 12px; }
/* The open task's title: a section's title under the page's one h1. */
body[data-master-page="tasks"] .work-head #task-title { margin: 0; color: #101828; font-size: 20px; line-height: 1.25; letter-spacing: -0.02em; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .work-panes { grid-template-columns: minmax(240px, 36%) minmax(0, 1fr); gap: 0 16px; }
  body[data-master-page="tasks"] .work-overview { padding-left: 18px; }
}
/* Narrow: the list first (at most a third of the screen), the open task under it, the page scrolling whole. */
@media (max-width: 760px) {
  body[data-master-page="tasks"] .library-shell > main.work-main { overflow: auto; padding: 20px 16px 0; }
  .work-panes { flex: none; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; }
  body[data-master-page="tasks"] .work-panes > .task-inbox { grid-column: 1; grid-row: 1; min-height: 180px; max-height: 35vh; padding-bottom: 16px; border-bottom: 1px solid #dce5e4; }
  body[data-master-page="tasks"] .work-panes > .task-work { grid-column: 1; grid-row: 2; position: static; min-height: 45vh; border-left: 0; }
  body[data-master-page="tasks"] .work-panes > .task-inbox.task-open { display: flex; }
  body[data-master-page="tasks"] .work-overview { padding: 20px 0 32px; }
}
/* A phone: rows are cards (tasks-phone.css), so the list has no box of its own; an open task is its own screen. */
@media (max-width: 640px) {
  body[data-master-page="tasks"] #task-list { border: 0; border-radius: 0; background: transparent; }
  body[data-master-page="tasks"] .work-panes > .task-inbox { max-height: none; border-bottom: 0; padding: 8px 0 16px; }
  body[data-master-page="tasks"] #task-list.work-list { padding: 0; }
  body[data-master-page="tasks"] .library-shell > main.work-main { padding: 16px 16px 0; }
}

/* ---- On a phone, every master page (phone sweep, 25 Nov) ---- */
@media (max-width: 640px) {
  /* The page's search stays: library.css hid every header search under 640px, and only some pages had put theirs
     back (Cases' "Search name, process or step" was gone). It takes its own full-width row. */
  body[data-master-page] .library-head { flex-wrap: wrap; }
  body[data-master-page] .library-actions .search { display: flex; flex: 1 1 100%; width: 100%; min-width: 0; }
  body[data-master-page] .library-actions .search input { font-size: 16px; min-width: 0; }
  /* More opens as a bottom sheet, as on Documents and the contractor pages. Pinned to the left edge (above), a More
     button on the right (Registers) opened its list half off the screen. theme.js closes it on the dimmed page. */
  body[data-master-page] .documents-actions-menu[open] > .documents-actions-items {
    position: fixed; inset: auto 0 0 0; z-index: 80; width: 100%; min-width: 0; max-width: none;
    display: grid; gap: 0; padding: 20px 16px calc(16px + env(safe-area-inset-bottom)); border: 0; border-radius: 16px 16px 0 0; background: transparent; box-shadow: none;
  }
  body[data-master-page] .documents-actions-menu[open] > .documents-actions-items::before { content: ""; position: fixed; inset: 0; z-index: -2; background: rgba(16, 24, 40, 0.45); }
  body[data-master-page] .documents-actions-menu[open] > .documents-actions-items::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 16px 16px 0 0; background: #fff; box-shadow: 0 -8px 32px rgba(16, 24, 40, 0.18); }
  body[data-master-page] .documents-actions-items > a,
  body[data-master-page] .documents-actions-items > button { min-height: 48px; padding: 0 12px; border-radius: 10px; font-size: 16px; white-space: normal; text-align: left; }
}
