/* EBS base styles. Mobile first; works on phones, tablets and desktops (NF-05, D029).
   Colours and type follow the Enplan brand standards (D042): Helvetica with Arial as the fallback, and the
   document greens. The logo greens (#29B403, #229408, #C6D32B) belong to the logo artwork only. */
:root {
  --colour-primary: #0F801D;  /* Document Green: header rule, links, Heading 1, table headers, chart series */
  --colour-light: #D9EAD3;    /* Light Green: total rows, selected rows */
  --colour-zebra: #F2F2F2;    /* Zebra Grey: alternate data rows */
  --colour-border: #BFBFBF;   /* Border Grey: borders and rules */
  --colour-text: #000000;     /* body text stays black */
  --colour-muted: #5f6368;    /* labels and hints */
  --colour-slate: #2F3A40;    /* Slate Grey: "EBS" beside the logo (D087), as in the intro */
  --colour-bg: #ffffff;
  --colour-red: #b3261e;      /* PO-13 over 90% and overruns (D033) */
  --colour-orange: #9a5100;   /* PO-13 over 80%; dark enough to read on zebra and selected rows */
  --radius: 6px;
  --tap: 44px; /* minimum touch target */
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
/* D086: the EBS 2.0 intro dissolves into the page it goes on to. Every page opts in here; page-reveal.js skips the
   transition unless the page was opened from the intro, so ordinary navigation is unchanged. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 1.4s; animation-timing-function: ease-in-out; }
body {
  margin: 0;
  font-family: Helvetica, Arial, sans-serif; /* plain Helvetica, never Helvetica Neue (D042) */
  font-size: 16px;
  line-height: 1.5;
  color: var(--colour-text);
  background: var(--colour-bg);
}
a { color: var(--colour-primary); }

/* The colour logo sits on white only, so the header is white with a Document Green rule under it (D042). */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .25rem 1rem;
  padding: 0 1rem;
  background: #fff;
  border-bottom: 4px solid var(--colour-primary);
}
.site-header a, .site-header .link-button { color: var(--colour-primary); font-weight: bold; text-decoration: none; }
.site-header a:hover, .site-header .link-button:hover { text-decoration: underline; }
/* D087: the logo and EBS 2.0 sit on one text line, so EBS can share the baseline of the logo's "nplan". */
.brand { display: block; min-height: var(--tap); white-space: nowrap; }
.site-header a.brand:hover { text-decoration: none; }
/* The master file has the clear space built in. At 64px high the drawn logo is about 107px wide, above the
   100px screen minimum for the logo without tagline. */
/* D087: in the master file at 64px high, the baseline of "nplan" is 18.64px above the bottom of the image and the
   "l" is 26.3px tall (measured 2026-11-22). Lowering the image by 18.64px puts that baseline on the text baseline,
   whatever font the computer uses. */
.brand img { display: inline-block; height: 64px; width: auto; vertical-align: -18.64px; }
/* D087: EBS 2.0 in the intro's colours (D086): regular-weight Slate Grey EBS (Greg: bold was too heavy beside the
   logo), its capitals as tall as the "l" in the logo
   (Helvetica and Arial capitals are .717em, so 26.3px / .717 = 36.7px), with a superscript Document Green 2.0 in the
   intro's proportions. */
.brand-name {
  margin-left: .75rem; padding-left: .75rem; border-left: 1px solid var(--colour-border);
  font-size: 36.7px; font-weight: normal; letter-spacing: .04em; line-height: 1; color: var(--colour-slate);
}
.brand-version { margin-left: .3em; font-size: .42em; vertical-align: .95em; font-weight: bold; color: var(--colour-primary); }
.site-user { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; }
.site-user .user-name { color: var(--colour-muted); }
.site-user form { margin: 0; }
.site-user .link-button { min-height: var(--tap); display: inline-flex; align-items: center; }
.menu-toggle { font-weight: bold; }

/* D048: the menu in a column on the left. Main content still comes first in the page so screen
   readers reach it first; the grid places the menu on the left. */
.layout { display: block; }
/* D059: a light menu column in the style Greg chose (Microsoft 365 admin centre as inspiration): Zebra Grey
   background, a line icon beside each group and stand-alone item, sub-items indented under the group name,
   and a thin Document Green bar on the current page. */
.site-menu { background: var(--colour-zebra); border-top: 1px solid var(--colour-border); padding: .75rem .5rem; font-size: .9375rem; }
.menu-section + .menu-section { margin-top: .25rem; }
.menu-heading {
  margin: 0; padding: 0 .75rem; font-weight: normal; color: var(--colour-text);
}
.site-menu .icon { flex: none; width: 20px; height: 20px; color: var(--colour-text); }
/* Group headings open and close their list (D048): icon, name, then a chevron on the right. */
summary.menu-heading {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: .75rem;
  min-height: var(--tap); border-radius: var(--radius); border-left: 3px solid transparent;
}
summary.menu-heading::-webkit-details-marker { display: none; }
summary.menu-heading::after {
  content: ""; width: .45rem; height: .45rem; margin: 0 .35rem 0 auto; flex: none;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform .15s; /* points down when closed */
}
.menu-group[open] > summary.menu-heading::after { transform: translateY(2px) rotate(-135deg); } /* up when open */
summary.menu-heading:hover { background: rgba(0, 0, 0, .05); }
summary.menu-heading:focus-visible { outline: 2px solid var(--colour-primary); outline-offset: 1px; }
.menu-group[open] > ul { margin-bottom: .35rem; }
.site-menu ul { list-style: none; margin: 0; padding: 0; }
.site-menu a {
  display: flex; align-items: center; gap: .75rem; min-height: 2.5rem; padding: .25rem .75rem;
  border-radius: var(--radius); border-left: 3px solid transparent;
  color: var(--colour-text); font-weight: bold; text-decoration: none; /* built screens stand out from greyed ones */
}
.site-menu a.with-icon { min-height: var(--tap); font-weight: normal; }
.site-menu a:hover { background: rgba(0, 0, 0, .05); }
.site-menu a:focus-visible { outline: 2px solid var(--colour-primary); outline-offset: 1px; }
/* Sub-items line up with the group name, past the icon. */
.menu-group ul a, .menu-group .menu-later { padding-left: calc(.75rem + 3px + 20px + .75rem - 3px); }
/* Screens not built yet: greyed out, not links (D048). */
.menu-later {
  display: flex; align-items: center; min-height: 2.25rem; padding: .15rem .75rem;
  border-left: 3px solid transparent; color: #666666; cursor: default; /* 5.0:1 on Zebra Grey */
}
.site-menu a[aria-current="page"] {
  background: #fff; border-left-color: var(--colour-primary); color: var(--colour-text);
}
.site-menu a[aria-current="page"] .icon { color: var(--colour-primary); }
.site-menu .count { margin-left: auto; }
/* Phones and small tablets: the menu opens from the Menu button (menu.js). */
@media (max-width: 899px) {
  .menu-js .site-menu { display: none; }
  .menu-js .site-menu.open {
    display: block; position: fixed; z-index: 20; top: 0; left: 0; bottom: 0;
    width: min(18rem, 85vw); overflow-y: auto; border-top: 0; border-right: 1px solid var(--colour-border);
    box-shadow: 6px 0 18px rgba(0, 0, 0, .15); padding-top: 1.25rem;
  }
  .menu-where { display: none; }
  .menu-close { width: 100%; margin-bottom: 1rem; }
}
@media (min-width: 900px) {
  .layout.with-menu { display: grid; grid-template-columns: 17.5rem minmax(0, 1fr); align-items: start; }
  .layout.with-menu > main { grid-column: 2; grid-row: 1; }
  .site-menu {
    grid-column: 1; grid-row: 1;
    position: sticky; top: 0; min-height: calc(100vh - 68px); max-height: 100vh; overflow-y: auto;
    border-top: 0; border-right: 1px solid var(--colour-border); padding: 1rem .5rem;
  }
  .menu-toggle, .menu-close { display: none !important; }
}

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 1rem; }
.container.wide { max-width: 1680px; }
h1 { margin: .25rem 0 1rem; color: var(--colour-primary); }

.card { background: #fff; border: 1px solid var(--colour-border); border-radius: var(--radius); padding: 1.25rem; }
.narrow { max-width: 28rem; margin: 2rem auto; }

.button, button {
  font: inherit;
  min-height: var(--tap);
  padding: .5rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--colour-primary);
  background: #fff;
  color: var(--colour-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.button.primary, button.primary { background: var(--colour-primary); color: #fff; }
.button.block, button.block { width: 100%; }
.link-button { background: none; border: 0; padding: 0; min-height: auto; }

.lead { font-size: 1.125rem; }

/* Wide tables scroll inside their own area, never the page (NF-05). */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; background: #fff; }
th, td { padding: .5rem .65rem; border-bottom: 1px solid var(--colour-border); text-align: left; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.messages { list-style: none; padding: 0; }
.messages li { padding: .75rem 1rem; border-radius: var(--radius); background: #fff; border: 1px solid var(--colour-border); margin-bottom: .5rem; }

@media (min-width: 768px) {
  .container { padding: 1.5rem 2rem; }
}

/* Forms */
label, .label { display: block; font-size: .875rem; color: var(--colour-muted); margin-bottom: .25rem; }
select, input[type="date"], input[type="text"], input[type="search"], input[type="number"], input[type="email"] {
  font: inherit; width: 100%; min-height: var(--tap); padding: .4rem .6rem;
  border: 1px solid var(--colour-border); border-radius: var(--radius); background: #fff;
}
.filters { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: flex-end; }
.field { flex: 1 1 10rem; min-width: 0; }
.field.grow { flex: 3 1 16rem; }
.filters:not(.range) .range-only { display: none; }
.muted { color: var(--colour-muted); }
.errorlist { list-style: none; padding: 0; margin: .25rem 0 0; color: var(--colour-red); font-size: .875rem; }
.hint { color: var(--colour-muted); font-size: .875rem; margin: .5rem 0 1rem; }
.summary { margin: 0; }
.report-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .5rem 1rem; margin: 1.25rem 0 .75rem;
}
#report { transition: opacity .15s; }
body.loading #report { opacity: .5; }
.empty { padding: 1rem 0; color: var(--colour-muted); }
.actions { margin: 1rem 0; }

/* Totals */
.totals { margin-bottom: 1rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .75rem; }
.total { background: #fff; border: 1px solid var(--colour-border); border-radius: var(--radius); padding: .75rem 1rem; }
.total span { display: block; font-size: .875rem; color: var(--colour-muted); }
.total strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.total.grand { border-color: var(--colour-primary); }

/* People filter: a dropdown of tick boxes */
#people-filter:not(.field) { display: none; }
.dropdown { position: relative; }
.dropdown summary {
  list-style: none; cursor: pointer; min-height: var(--tap); padding: .4rem 2rem .4rem .6rem;
  border: 1px solid var(--colour-border); border-radius: var(--radius); background: #fff;
  display: flex; align-items: center; position: relative; white-space: nowrap;
}
.dropdown summary::-webkit-details-marker { display: none; }
.dropdown summary::after {
  content: ""; position: absolute; right: .8rem; top: 50%; width: .45rem; height: .45rem;
  border-right: 2px solid var(--colour-muted); border-bottom: 2px solid var(--colour-muted);
  transform: translateY(-70%) rotate(45deg);
}
.dropdown[open] summary { border-color: var(--colour-primary); }
.dropdown-panel {
  position: absolute; z-index: 10; top: calc(100% + .25rem); left: 0; min-width: 100%; width: max-content;
  max-width: min(22rem, 90vw); background: #fff; border: 1px solid var(--colour-border);
  border-radius: var(--radius); box-shadow: 0 6px 18px rgba(0, 0, 0, .12); padding: .5rem 0;
}
.dropdown-tools { display: flex; gap: 1rem; padding: .25rem .9rem .5rem; border-bottom: 1px solid var(--colour-border); }
.dropdown-tools .link-button { color: var(--colour-primary); font-size: .875rem; min-height: 2rem; }
.ticks { max-height: 18rem; overflow-y: auto; padding: .25rem 0; }
.ticks label {
  display: flex; align-items: center; gap: .6rem; min-height: 2.5rem; padding: 0 .9rem;
  font-size: 1rem; color: var(--colour-text); margin: 0; cursor: pointer;
}
.ticks label:hover { background: var(--colour-zebra); }
.ticks input { width: 1.15rem; height: 1.15rem; accent-color: var(--colour-primary); flex: none; }

/* Tables (D042): header rows bold white on Document Green, zebra rows from the second data row,
   totals on Light Green, Border Grey rules. */
thead th { background: var(--colour-primary); color: #fff; font-weight: bold; position: sticky; top: 0; border-bottom-color: var(--colour-primary); }
tr.groups th { text-align: center; border-bottom: 1px solid rgba(255, 255, 255, .5); }
tbody tr:nth-child(even) td { background: var(--colour-zebra); }
tr.selected td, tbody tr.selected:nth-child(even) td { background: var(--colour-light); }
.card.flush { padding: 0; overflow: hidden; }
.table-wrap.card.flush { overflow-x: auto; }
.report-table { font-size: .9375rem; }
.report-table .group-start { border-left: 1px solid var(--colour-border); }
.report-table thead .group-start { border-left-color: rgba(255, 255, 255, .5); }
tfoot th, tfoot td { font-weight: bold; background: var(--colour-light); border-top: 2px solid var(--colour-border); border-bottom: 0; }
a.sort { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: .3rem; }
a.sort::after { content: "\2195"; color: inherit; opacity: .75; font-size: .8em; }
a.sort.ascending::after { content: "\25B2"; opacity: 1; }
a.sort.descending::after { content: "\25BC"; opacity: 1; }
a.sort:hover { text-decoration: underline; }
tr.clickable { cursor: pointer; }
tbody tr.clickable:hover td { background: var(--colour-light); }
td.red, dd.red { color: var(--colour-red); font-weight: bold; }
td.orange, dd.orange { color: var(--colour-orange); font-weight: bold; }
.flag { font-size: .75rem; font-weight: normal; }

/* PO Tracker */
.split { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: start; }
.details { display: grid; grid-template-columns: auto 1fr; gap: .25rem 1rem; margin: 0 0 1rem; }
.details dt { color: var(--colour-muted); }
.details dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.pie {
  width: min(14rem, 100%); aspect-ratio: 1; border-radius: 50%; margin: 0 auto;
  background: conic-gradient(var(--colour-primary) 0 var(--spent), var(--colour-light) var(--spent) 100%);
}
/* Over the PO value: the full pie, with the overrun as a red ring outside it (D033). */
.pie.over {
  width: min(16rem, 100%);
  background:
    radial-gradient(closest-side, var(--colour-primary) 0 77.5%, #fff 78% 85.5%, transparent 86%),
    conic-gradient(var(--colour-red) 0 var(--over), var(--colour-border) var(--over) 100%);
}
.legend { list-style: none; padding: 0; display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.key { display: inline-block; width: .9rem; height: .9rem; border-radius: 2px; margin-right: .4rem; vertical-align: middle; }
.key.spent { background: var(--colour-primary); }
.key.remaining { background: var(--colour-light); border: 1px solid var(--colour-border); }
.key.over { background: var(--colour-red); }

/* Side by side only when the screen is wide enough beside the menu column (D048). */
@media (min-width: 1280px) {
  .split { grid-template-columns: 2fr 1fr; }
}

/* Screen readers only */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Timesheet Entry (TE-22): a table with a column per day on tablets and desktops,
   one card per line on phones. */
.ts-week { margin-bottom: .5rem; }
.ts-week .field { flex: 0 1 14rem; }
.ts-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.ts-panel { margin-bottom: 1rem; border: 2px solid var(--colour-primary); }
.ts-panel h2 { margin-top: 0; font-size: 1.15rem; }
.ts-table td, .ts-table th { vertical-align: top; }
.ts-table .ts-code { min-width: 21rem; white-space: normal; }
.ts-table .ts-code select { min-width: 21rem; }
.ts-table .ts-day { min-width: 7.5rem; white-space: normal; }
.ts-day input[type="number"], .ts-day textarea { display: block; }
.ts-day input[type="number"] {
  font: inherit; width: 100%; min-height: var(--tap); padding: .3rem .4rem; text-align: right;
  border: 1px solid var(--colour-border); border-radius: var(--radius); background: #fff;
  font-variant-numeric: tabular-nums;
}
.ts-day textarea {
  font: inherit; font-size: .8125rem; width: 100%; margin-top: .25rem; padding: .25rem .4rem;
  border: 1px solid var(--colour-border); border-radius: var(--radius); resize: vertical;
}
.ts-day input:disabled, .ts-day textarea:disabled, .ts-code select:disabled { background: var(--colour-zebra); color: var(--colour-text); }
.ts-line-total { font-weight: bold; padding-top: 1rem; }
.ts-table tbody tr:nth-child(even) td { background: #fff; } /* inputs need a plain background */
.ts-table tr.deleted td { opacity: .45; }
.ts-table tr.deleted .ts-delete { opacity: 1; }
.ts-table tfoot td.red { color: var(--colour-red); }
.ts-delete-label { display: inline-flex; align-items: center; gap: .35rem; min-height: var(--tap); color: var(--colour-text); font-size: .875rem; margin: 0; cursor: pointer; }
.marks { list-style: none; padding: 0; margin: 0; font-size: .8125rem; white-space: nowrap; }
.marks .yes, .marks .client-approved { color: var(--colour-primary); font-weight: bold; }
.marks .no, .marks .client-not_received { color: var(--colour-muted); }
.marks .client-rejected { color: var(--colour-red); font-weight: bold; } /* TE-19, F-17 */
.marks .source { color: var(--colour-text); font-weight: bold; margin-bottom: .15rem; } /* TE-24 */

@media (max-width: 899px) {
  .ts-wrap { overflow: visible; border: 0; background: none; }
  .ts-table, .ts-table tbody, .ts-table tfoot, .ts-table tr, .ts-table td, .ts-table th { display: block; width: 100%; }
  .ts-table thead { display: none; }
  .ts-table { background: none; }
  .ts-table tr.ts-line {
    background: #fff; border: 1px solid var(--colour-border); border-radius: var(--radius);
    padding: .75rem; margin-bottom: 1rem;
  }
  .ts-table td, .ts-table th { border: 0; padding: .35rem 0; white-space: normal; }
  .ts-table td[data-label]::before {
    content: attr(data-label); display: block; font-size: .8125rem; color: var(--colour-muted); margin-bottom: .15rem;
  }
  .ts-table .ts-code, .ts-table .ts-code select { min-width: 0; width: 100%; }
  .ts-table .ts-code::before { display: none !important; }
  .ts-day { display: grid !important; grid-template-columns: 9rem 1fr; gap: .25rem .5rem; align-items: start; border-top: 1px solid var(--colour-zebra) !important; }
  .ts-day::before { grid-column: 1; align-self: center; margin: 0 !important; color: var(--colour-text) !important; font-size: .9375rem !important; }
  .ts-day input[type="number"] { grid-column: 2; }
  .ts-day textarea { grid-column: 1 / -1; margin-top: 0; }
  .ts-day .errorlist { grid-column: 1 / -1; }
  .ts-line-total, .ts-status { display: flex !important; justify-content: space-between; align-items: baseline; text-align: left; }
  .ts-line-total::before, .ts-status::before { margin: 0 !important; }
  .ts-table tfoot tr { background: var(--colour-light); border-radius: var(--radius); padding: .75rem; }
  .ts-table tfoot th { padding-top: 0; color: var(--colour-primary); }
  .ts-table tfoot td { display: flex; justify-content: space-between; background: none; border: 0; padding: .15rem 0; }
  .ts-table tfoot td:empty { display: none; }
  .ts-table tfoot td::before { margin: 0 !important; color: var(--colour-text) !important; }
  .ts-table tfoot .ts-week-total { font-weight: bold; border-top: 1px solid var(--colour-border); margin-top: .25rem; padding-top: .35rem; }
}

/* Expense Claims (EX-16): list and claim side by side on wide screens, stacked on phones. */
.ex-split { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
.ex-split > * { min-width: 0; } /* a wide table scrolls in its box instead of widening the page */
.ex-heading { margin: 0; font-size: 1.15rem; }
.ex-claim .ex-heading { margin-bottom: .75rem; }
.ex-form { display: grid; gap: .75rem; }
.ex-form textarea { font: inherit; width: 100%; padding: .4rem .6rem; border: 1px solid var(--colour-border); border-radius: var(--radius); }
.ex-form input[type="number"] {
  font: inherit; width: 100%; min-height: var(--tap); padding: .4rem .6rem;
  border: 1px solid var(--colour-border); border-radius: var(--radius); background: #fff;
}
.ex-form input:disabled, .ex-form select:disabled, .ex-form textarea:disabled { background: var(--colour-zebra); color: var(--colour-text); }
.ex-form input[type="file"] { font: inherit; width: 100%; min-height: var(--tap); }
.ex-check { display: flex; align-items: center; gap: .5rem; min-height: var(--tap); font-size: 1rem; color: var(--colour-text); }
.ex-check input { width: 1.15rem; height: 1.15rem; accent-color: var(--colour-primary); }
.ex-marks { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-bottom: 1rem; }
.ex-receipt p { margin: .25rem 0; }
/* EX-09: receipt previews */
.ex-preview { margin: .5rem 0; border: 1px solid var(--colour-border); border-radius: var(--radius); background: var(--colour-zebra); padding: .5rem; }
.ex-preview img { display: block; max-width: 100%; max-height: 28rem; margin: 0 auto; }
.ex-preview iframe { display: block; width: 100%; height: 28rem; border: 0; background: #fff; }
@media (min-width: 1280px) {
  .ex-split { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
}

/* --- Approvals (AP-01, AP-21, D057) --- */
/* D058: anything waiting for approval is red. White on the red is 6.5:1. */
.count { display: inline-block; min-width: 1.5em; padding: 0 .4em; border-radius: 1em; background: var(--colour-red); color: #fff; font-size: .75rem; font-weight: bold; text-align: center; line-height: 1.5; }
.ap-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 .5rem; border-bottom: 1px solid var(--colour-border); }
.ap-tabs a { padding: .6rem 1rem; min-height: var(--tap); text-decoration: none; color: var(--colour-text); border-bottom: 3px solid transparent; }
.ap-tabs a[aria-current="page"] { border-bottom-color: var(--colour-primary); font-weight: bold; }
.ap-group { margin-bottom: 1.25rem; }
.ap-group h2 { margin-top: 0; font-size: 1.15rem; }
.ap-code { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; margin: 0 0 1rem; font-size: .875rem; }
.ap-code dt { color: var(--colour-muted); }
.ap-code dd { margin: 0; overflow-wrap: anywhere; }
.ap-line { border-top: 1px solid var(--colour-border); padding: .75rem 0; }
.ap-line-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem; }
.ap-line-head h3 { margin: 0; font-size: 1rem; }
.ap-line-head .marks { display: flex; flex-wrap: wrap; gap: .1rem .75rem; }
/* One grid holds the hours: days across on wide screens (grid flows by column, 4 rows: day,
   submitted, approved, note) and days down on phones (flows by row, 4 columns). */
.ap-grid { display: grid; grid-template-columns: 5.5rem 4.5rem 5.5rem minmax(0, 1fr); grid-auto-flow: row; gap: 0; margin: .5rem 0; font-size: .875rem; }
.ap-cell { padding: .3rem .4rem; border-bottom: 1px solid var(--colour-zebra); min-width: 0; overflow-wrap: anywhere; }
.ap-head, .ap-label { font-weight: bold; color: var(--colour-muted); }
.ap-cell input { width: 100%; min-height: 2.25rem; }
.ap-cell.differs, .ap-diff { color: var(--colour-orange); font-weight: bold; }
form.inline { display: inline; }
.ap-failed { border-color: var(--colour-red); margin-bottom: 1rem; }
.ap-email { margin-bottom: 1rem; }
.ap-email .field { margin-bottom: .75rem; }
.ap-email input[type="text"], .ap-email textarea { width: 100%; }
@media (min-width: 900px) {
  .ap-grid { grid-template-rows: repeat(4, auto); grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(5.5rem, 1fr); }
  .ap-grid > .ap-cell:nth-child(-n+4) { min-width: 6rem; }
}
@media (max-width: 899px) {
  .ap-claims, .ap-claims tbody, .ap-claims tr, .ap-claims td { display: block; width: 100%; }
  .ap-claims thead { display: none; }
  .ap-claims tr { border-top: 1px solid var(--colour-border); padding: .5rem 0; }
  .ap-claims td { border: 0; padding: .2rem 0; }
  .ap-claims td[data-label]::before { content: attr(data-label) ": "; color: var(--colour-muted); }
}
.ap-tabs .count { margin-left: .25rem; }
.ap-line.waiting { border-left: 4px solid var(--colour-red); padding-left: .75rem; }
.ap-claims tr.waiting td:first-child { box-shadow: inset 4px 0 0 var(--colour-red); }
.alert-waiting { border: 2px solid var(--colour-red); margin-bottom: 1.25rem; }
.alert-waiting h2 { margin: 0 0 .5rem; font-size: 1.15rem; color: var(--colour-red); }
.alert-waiting ul { margin: 0; padding-left: 1.25rem; }
.alert-waiting a { color: var(--colour-red); font-weight: bold; }
.ap-claim-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
/* AP-26 (D061): a two-way switch, Waiting for approval or All entries. */
.ap-show { display: inline-flex; margin: .5rem 0 .25rem; border: 1px solid var(--colour-primary); border-radius: var(--radius); overflow: hidden; }
.ap-show a { display: inline-flex; align-items: center; min-height: var(--tap); padding: .25rem 1rem; color: var(--colour-primary); text-decoration: none; font-weight: bold; }
.ap-show a + a { border-left: 1px solid var(--colour-primary); }
.ap-show a[aria-current="true"] { background: var(--colour-primary); color: #fff; }
.ap-week { font-weight: bold; color: var(--colour-text); background: var(--colour-zebra); border-radius: var(--radius); padding: 0 .5rem; }

/* --- Master Cost Codes (MC-13, D065) --- */
.mc-layout { display: grid; gap: 1.25rem; }
@media (min-width: 1100px) { .mc-layout { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; } .mc-detail { position: sticky; top: 1rem; } }
.mc-filters { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: flex-end; margin-bottom: .5rem; }
.mc-filters fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: center; }
.mc-filters legend { font-size: .875rem; color: var(--colour-muted); padding: 0; margin-bottom: .15rem; }
.mc-check { display: inline-flex; align-items: center; gap: .35rem; min-height: var(--tap); }
.mc-check input { width: 1.15rem; height: 1.15rem; accent-color: var(--colour-primary); }
.mc-table { width: 100%; }
.mc-table td, .mc-table th { white-space: normal; }
.mc-table td a { font-weight: bold; text-decoration: none; }
.mc-table tr.selected td { background: var(--colour-light); }
.mc-tag { display: inline-block; font-size: .75rem; font-weight: bold; padding: 0 .4rem; border-radius: var(--radius); background: var(--colour-zebra); border: 1px solid var(--colour-border); }
.mc-detail h2 { margin-top: 0; font-size: 1.15rem; }
.mc-dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .5rem 1.25rem; margin: 0 0 1rem; }
.mc-dl dt { color: var(--colour-muted); font-size: .875rem; }
.mc-dl dd { margin: 0; overflow-wrap: anywhere; }
.mc-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .75rem 1rem; }
.mc-fields .field.wide { grid-column: 1 / -1; }
.mc-fields input:not([type="checkbox"]), .mc-fields select { width: 100%; }
@media (max-width: 899px) {
  .mc-table, .mc-table tbody, .mc-table tr, .mc-table td { display: block; width: 100%; }
  .mc-table thead { display: none; }
  .mc-table tr { border-top: 1px solid var(--colour-border); padding: .5rem .75rem; }
  .mc-table td { border: 0; padding: .1rem 0; }
}
/* MC-13: Enplan details left, client details right, in both viewing and editing. */
.mc-sides { display: grid; gap: 1rem 1.5rem; }
@media (min-width: 700px) { .mc-sides { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.mc-side { border: 1px solid var(--colour-border); border-radius: var(--radius); padding: .75rem 1rem 1rem; margin: 0; min-width: 0; }
.mc-side legend { font-weight: bold; color: var(--colour-primary); padding: 0 .35rem; }
.mc-side .mc-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mc-side .mc-wbs1, .mc-side .mc-wbs2, .mc-side .mc-wbs3, .mc-side .mc-wbs4 { grid-column: span 1; }
.mc-fields select[multiple] { min-height: 6rem; }
/* Read-only boxes keep the edit look, just quieter. */
.mc-fields input:disabled, .mc-fields select:disabled { background: var(--colour-zebra); color: var(--colour-text); opacity: 1; -webkit-text-fill-color: var(--colour-text); }
.mc-label { display: block; font-size: .875rem; color: var(--colour-muted); margin-bottom: .25rem; }
.mc-readonly { min-height: var(--tap); padding: .4rem .6rem; border: 1px solid var(--colour-border); border-radius: var(--radius); background: var(--colour-zebra); }
.mc-side + .mc-side .mc-fields { grid-template-columns: minmax(0, 1fr); } /* client details: one column */
/* MC-07: linked POs as a tick list. */
.mc-po-filter { margin-bottom: .35rem; }
.mc-po-list { max-height: 14rem; overflow-y: auto; border: 1px solid var(--colour-border); border-radius: var(--radius); padding: .25rem .5rem; background: #fff; }
.mc-po-list > div > div, .mc-po-list li { list-style: none; }
.mc-po-list label { display: flex; align-items: center; gap: .5rem; min-height: 2.25rem; margin: 0; font-size: .9375rem; color: var(--colour-text); cursor: pointer; }
.mc-po-list input { width: 1.15rem; height: 1.15rem; flex: none; accent-color: var(--colour-primary); }
.mc-po-list ul, .mc-po-list > div { margin: 0; padding: 0; }

/* --- Cost Code Assignment (CA-10, D070) --- */
.ca-panel { margin: 1rem 0; }
.ca-panel h2 { margin-top: 0; font-size: 1.15rem; }
.ca-table { width: 100%; }
.ca-table td, .ca-table th { white-space: normal; vertical-align: middle; }
.ca-table tr.on td { background: var(--colour-light); }
.ca-table input[type="text"] { width: 7.5rem; }
.ca-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
#person-search { margin-bottom: .35rem; }
@media (max-width: 899px) {
  .ca-table, .ca-table tbody, .ca-table tr, .ca-table td { display: block; width: 100%; }
  .ca-table thead { display: none; }
  .ca-table tr { border-top: 1px solid var(--colour-border); padding: .5rem .75rem; }
  .ca-table td { border: 0; padding: .15rem 0; }
  .ca-table td[data-label]::before { content: attr(data-label) ": "; color: var(--colour-muted); }
}

/* --- Timesheet Administration (TA-12, D072) --- */
.tad-status { font-size: .875rem; font-weight: bold; }
.tad-status.ok { color: var(--colour-primary); }
.tad-status.error { color: var(--colour-red); }
.tad-add select { width: auto; max-width: 100%; }
.ap-line.tad-locked { opacity: .95; }

/* CW-02: short pickers with space under them. On wide screens they use the same two columns as the project list and
   details below (.mc-layout), so Week ending lines up with the list and Type with the details (Greg, 2026-11-22). */
.cw-pick { gap: .5rem 1.5rem; margin-bottom: 1.5rem; }
.cw-pick-col { display: contents; } /* narrower screens: one row of Week ending, Type, then the tick box */
.cw-pick .mc-check { order: 1; }
.cw-pick .field { flex: 0 1 12rem; }
@media (min-width: 1100px) {
  .cw-pick { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: 1.25rem; }
  .cw-pick-col { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem 1.5rem; }
  .cw-pick .mc-check { order: 0; }
}

/* CW-04 (D081): people with no timesheet submitted for the week, as the Power App's "Not Submitted". */
.cw-people tr.missing td:first-child, .cw-projects tr.missing td:first-child { box-shadow: inset 4px 0 0 var(--colour-red); }
.cw-missing-mark, .cw-missing-note { color: var(--colour-red); }
/* Client Weekly Approvals: a button that cannot be used yet is grey, with the reason in red beside it. */
.cw-reports button:disabled { background: var(--colour-zebra); color: var(--colour-muted); border-color: var(--colour-border); cursor: not-allowed; }
.cw-reason { color: var(--colour-red); font-size: .875rem; align-self: center; }
.cw-email-actions { align-items: center; }
/* D091: warning before re-sending a report the client already answered. */
.cw-reissue { color: var(--colour-orange); border-left: 4px solid var(--colour-orange); padding: .5rem .75rem; margin: .75rem 0; background: var(--colour-zebra); }
/* CW-13, CW-16 (D088): the client's page. A large tick or cross confirms the answer; Reject is red, as in the email. */
.cw-client-result { font-size: 1.75rem; font-weight: bold; margin: 0 0 .5rem; }
.cw-client-result.approved { color: var(--colour-primary); }
.cw-client-result.rejected { color: var(--colour-red); }
button.cw-reject { background: var(--colour-red); border-color: var(--colour-red); color: #fff; }
.ts-actions form { margin: 0; }
/* CW-16 (D089): the client's page stands alone: the logo on white with the green rule, nothing else from EBS. */
.client-header { padding: .25rem 1rem; background: #fff; border-bottom: 4px solid var(--colour-primary); }
.client-header img { display: block; height: 64px; width: auto; }
.client-main { max-width: 40rem; margin: 0 auto; padding: 1.5rem 1rem; }
.client-reports { padding-left: 1.25rem; }
.cw-client-notice { color: var(--colour-orange); }
/* While the answer is recorded: a bar that fills over the wait (D089). */
.client-progress { height: 6px; border-radius: 3px; background: var(--colour-zebra); overflow: hidden; margin: .75rem 0; }
.client-progress span { display: block; height: 100%; width: 15%; background: var(--colour-primary); }
.client-progress.running span { width: 0; animation: client-progress var(--wait, 7s) linear forwards; }
@keyframes client-progress { to { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .client-progress.running span { animation: none; width: 100%; } }
