/* Unbilled Worklist Tracker - additions to app.css. */
/* Colour key carried over from the workbook: who owns which columns. */
:root {
  --c-info: var(--brand-navy); --c-ic: #2e75b6; --c-cs: #375623; --c-reg: #c55a11; --c-him: #7030a0; --c-bill: #bf8f00; --c-rej: #c00000; --c-grey: #595959; --c-done: #00b050;
  --ok-bg: #c6efce; --ok-ink: #006100; --amber-bg: #ffeb9c; --amber-ink: #7a4400; --grey-bg: #e1e4e8; --grey-ink: #404040; --bad-bg: #ffc7ce; --bad-ink: #9c0006; --row-done: #eceef1; --row-warn: #fde9e9;
}
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.g-info { background: var(--c-info); } .g-ic { background: var(--c-ic); } .g-cs { background: var(--c-cs); } .g-reg { background: var(--c-reg); } .g-him { background: var(--c-him); }
.g-bill { background: var(--c-bill); } .g-rej { background: var(--c-rej); } .g-grey { background: var(--c-grey); } .g-done { background: var(--c-done); }
.sidemenu a { padding: 8px 12px; gap: 9px; font-size: 13.5px; }
.sidemenu .count { margin-left: auto; font-size: 12px; color: var(--sidebar-fg-2); font-variant-numeric: tabular-nums; }
.sidemenu .menu-head { padding: 12px 14px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--sidebar-fg-2); }
.sidemenu .dot { box-shadow: 0 0 0 1px var(--sidebar-fg-2); } .sidemenu .g-info { background: var(--sidebar-accent); } /* team colours stay readable on navy */
.banner.demo { background: #ffe08a; color: #4a3500; }
.content { padding: 14px 18px; }

/* status chips */
.chip-s { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--grey-bg); color: var(--grey-ink); }
.s-ok { background: var(--ok-bg); color: var(--ok-ink); } .s-amber { background: var(--amber-bg); color: var(--amber-ink); } .s-bad { background: var(--bad-bg); color: var(--bad-ink); } .s-grey { background: var(--grey-bg); color: var(--grey-ink); }

/* worklist grid */
.wl { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 0; }
.wl-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 10px; border-bottom: 1px solid var(--line-2); }
.wl-bar .spacer { flex: 1; } .wl-bar .input[type=search] { width: 230px; }
.chips { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chips .btn.on { background: var(--sel); border-color: var(--brand); color: var(--text); }
.chips .chip { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.chips .seg { display: inline-flex; } .chips .seg .btn { border-radius: 0; } .chips .seg .btn + .btn { margin-left: -1px; }
.chips .seg .btn:first-child { border-radius: var(--radius) 0 0 var(--radius); } .chips .seg .btn:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.chips .n { font-variant-numeric: tabular-nums; color: var(--text-2); }
.mi-row { display: flex; gap: 16px; justify-content: space-between; } .mi-row small { color: var(--text-2); font-variant-numeric: tabular-nums; }
.wl-count { color: var(--muted); font-size: 13px; white-space: nowrap; }
.wl-bulk { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 6px 10px; background: var(--sel); border-bottom: 1px solid var(--line); font-size: 13.5px; }
.wl-wrap { position: relative; overflow: auto; max-height: calc(100vh - 236px); min-height: 180px; }
.wl table { border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 13px; }
.wl th, .wl td { padding: 0 8px; height: 30px; border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; background: var(--surface); }
.wl thead th { position: sticky; top: 0; z-index: 3; height: 34px; padding: 0; color: #fff; font-weight: 600; background: var(--c-info); border-right-color: rgba(255, 255, 255, .25); border-bottom: 0; }
.wl th.g-ic { background: var(--c-ic); } .wl th.g-cs { background: var(--c-cs); } .wl th.g-reg { background: var(--c-reg); } .wl th.g-him { background: var(--c-him); } .wl th.g-bill { background: var(--c-bill); }
.wl th.g-rej { background: var(--c-rej); } .wl th.g-grey { background: var(--c-grey); } .wl th.g-done { background: var(--c-done); }
.wl .th-in { display: flex; align-items: stretch; height: 34px; }
.wl .th-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: left; font: inherit; font-weight: 600; color: inherit; background: none; border: 0; padding: 0 4px 0 8px; cursor: pointer; white-space: nowrap; }
.wl .th-filter { flex: none; width: 22px; font: inherit; font-size: 11px; color: inherit; background: none; border: 0; cursor: pointer; opacity: .75; padding: 0; }
.wl .th-filter:hover, .wl .th-label:hover { background: rgba(255, 255, 255, .16); }
.wl .th-filter.on { opacity: 1; background: #fff; color: #1c2733; border-radius: 3px; margin: 7px 3px; width: 18px; }
.wl .th-label:focus-visible, .wl .th-filter:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
.wl .frozen { position: sticky; z-index: 2; } .wl thead .frozen { z-index: 4; } .wl .frozen.last { border-right: 2px solid var(--line); }
.wl tbody tr:hover td { background: var(--hover); } .wl tbody tr.selected td { background: var(--sel); }
.wl tr.done td { background: var(--row-done); color: var(--muted); } .wl tr.warn td { background: var(--row-warn); }
.wl td.ctr { text-align: center; } .wl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.wl td.sel, .wl th.sel { width: 34px; padding: 0; text-align: center; }
.wl input[type=checkbox] { width: 15px; height: 15px; margin: 0; vertical-align: middle; accent-color: var(--brand); cursor: pointer; } .wl input[type=checkbox]:disabled { cursor: default; }
.wl .cell-sel { font: inherit; font-size: 12.5px; font-weight: 600; width: 100%; height: 22px; padding: 0 2px; border: 1px solid transparent; border-radius: 10px; background: var(--grey-bg); color: var(--grey-ink); cursor: pointer; }
.wl .cell-sel.s-ok { background: var(--ok-bg); color: var(--ok-ink); } .wl .cell-sel.s-amber { background: var(--amber-bg); color: var(--amber-ink); } .wl .cell-sel.s-bad { background: var(--bad-bg); color: var(--bad-ink); }
.wl .cell-sel.empty { background: transparent; border-color: var(--line); color: var(--muted); font-weight: 400; }
.wl .cell-sel option { background: var(--surface); color: var(--text); font-weight: 400; }
.wl .cell-edit { display: block; width: calc(100% + 8px); height: 24px; line-height: 22px; font: inherit; text-align: left; color: inherit; background: none; border: 1px solid transparent; border-radius: 4px; padding: 0 4px; margin: 0 -4px; cursor: text; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl .cell-edit:hover, .wl .cell-edit:focus-visible { border-color: var(--brand); background: var(--surface); outline: none; }
.wl .cell-input { position: absolute; z-index: 2; min-height: 30px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--brand); border-radius: 4px; padding: 3px 6px; box-shadow: var(--shadow); resize: vertical; outline: 1px solid var(--brand); white-space: pre-wrap; }
.wl input.cell-input { height: 30px; }
.wl .cell-link { font-weight: 600; text-decoration: none; } .wl .cell-link:hover { text-decoration: underline; }
.wl-foot { display: flex; gap: 10px; align-items: center; justify-content: flex-end; padding: 7px 10px; border-top: 1px solid var(--line-2); font-size: 13px; flex-wrap: wrap; }
.pick-pop { position: fixed; z-index: 80; width: 300px; max-width: calc(100vw - 16px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; display: grid; gap: 8px; }
.pick-pop .input { width: 100%; }
.pk-list { max-height: 300px; overflow: auto; border: 1px solid var(--line-2); border-radius: 4px; padding: 2px; font-size: 13px; }
.pk-row { display: flex; gap: 8px; align-items: center; min-height: 28px; padding: 0 6px; border-radius: 4px; cursor: pointer; }
.pk-row.active { background: var(--hover); outline: 2px solid var(--brand); outline-offset: -2px; }
.pk-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .pk-label small { color: var(--muted); }
.pk-n { color: var(--muted); font-variant-numeric: tabular-nums; }
.pk-two { padding-block: 3px; } .pk-label .pk-sub { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.pk-box { flex: none; width: 15px; height: 15px; border: 1px solid var(--border-2); border-radius: 3px; background: var(--surface); display: grid; place-items: center; font-size: 11px; line-height: 1; color: var(--brand-ink); }
.pk-row[aria-selected=true] .pk-box { background: var(--brand); border-color: var(--brand); } .pk-row[aria-selected=true] .pk-box::after { content: '✓'; }
.pk-row[aria-selected=true]:not(:has(.pk-box)) { font-weight: 600; }
.pk-group { padding: 6px 6px 2px; font-size: 12px; font-weight: 600; color: var(--muted); }
.pk-none { padding: 6px; color: var(--muted); }
.cell-pick { cursor: pointer; }

/* summary, analysis */
.tiles-stat { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 220px)); gap: 12px; margin-bottom: 14px; }
.stat { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; color: var(--text); text-decoration: none; border-top: 3px solid var(--c-info); }
.stat .lbl { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.stat .val { font-size: 26px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; } .stat .sub { font-size: 12.5px; color: var(--muted); }
.sum-table td, .sum-table th { padding: 7px 10px; } .sum-table td.num, .sum-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pct { display: flex; align-items: center; gap: 8px; justify-content: flex-end; } .pct .meter { width: 90px; margin: 0; flex: none; } .pct .meter span { background: var(--brand); border-radius: 4px; }
/* Two cards share a row when both fit at their content width and stack otherwise; a card wider than the row shrinks and its table scrolls. */
.two-col { display: flex; flex-wrap: wrap; gap: 0 14px; align-items: flex-start; }
.two-col > * { flex: 0 1 auto; min-width: 0; }
.card h2 { margin-bottom: 10px; }
.help-doc { max-width: 900px; } .help-doc h2 { margin: 18px 0 8px; } .help-doc dl { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 6px 16px; margin: 0; } .help-doc dt { font-weight: 600; } .help-doc dd { margin: 0; line-height: 1.45; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 22px; } .kv .wide { grid-column: 1 / -1; } .kv .input { width: 100%; }
.kv .ro { padding: 4px 0; min-height: 26px; white-space: pre-wrap; overflow-wrap: anywhere; }
.team-box { border: 1px solid var(--line); border-left: 4px solid var(--c-grey); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 10px; }
.team-box.t-ic { border-left-color: var(--c-ic); } .team-box.t-cs { border-left-color: var(--c-cs); } .team-box.t-reg { border-left-color: var(--c-reg); } .team-box.t-him { border-left-color: var(--c-him); } .team-box.t-bill { border-left-color: var(--c-bill); } .team-box.t-rej { border-left-color: var(--c-rej); }
.team-box > .row { margin-bottom: 8px; } .team-dates { margin-left: auto; font-size: 13px; } .team-box h4 { margin: 0; font-size: 14px; }
@media (max-width: 900px) { .kv, .help-doc dl { grid-template-columns: minmax(0, 1fr); } .two-col { display: block; } }

/* top-bar find */
.find { position: relative; }
.find-input { width: 270px; }
.find-pop { position: absolute; z-index: 60; top: calc(100% + 4px); right: 0; width: 460px; max-width: calc(100vw - 20px); max-height: 70vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px; }
.find-row { padding: 7px 10px; border-radius: 4px; cursor: pointer; }
.find-row[aria-selected=true] { background: var(--hover); }
.find-main { display: flex; gap: 12px; justify-content: space-between; align-items: baseline; }
.find-where { font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.find-sub { font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.find-none { padding: 7px 10px; color: var(--text-2); font-size: 13px; }
@media (max-width: 1280px) { .find-input { width: 200px; } }

/* links on the Summary */
.card-head { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 10px; } .card-head h2 { margin: 0; }
.owner-pick, .person-pick { min-width: 180px; padding: 3px 6px; text-align: left; cursor: pointer; }
.save-state { align-self: center; margin-right: 4px; font-size: 13px; color: var(--muted); } .save-state.bad { color: var(--danger); }
.sent-back { margin: -2px 0 8px; font-size: 13px; }
.send-back fieldset { border: 0; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; } .send-back legend { padding: 0; margin-bottom: 6px; }
.send-back .input { width: 100%; } .field-error { color: var(--danger); font-size: 13px; }
.rules { max-width: 720px; } .rules td { vertical-align: middle; } .rules th.num, .rules td.num { text-align: right; font-variant-numeric: tabular-nums; } .rules td:first-child .input { width: 100%; }

/* Summary tabs */
a.tab { text-decoration: none; } a.tab:hover { color: var(--text); }
nav.tabs-head { margin-bottom: 14px; } .sum-tools { margin: 0 0 12px; flex-wrap: wrap; } .sum-tools:empty { display: none; }
.team-detail { margin-top: 18px; } .team-detail > .card-head h2 { font-size: 18px; }
.acc td.bad, .acc td.bad a { color: var(--danger); font-weight: 700; }
.acc tr.sel td { background: var(--sel); }
.acc td.weeks span + span { margin-left: 10px; }
.acc + .acc { margin-top: 12px; }
.acc th, .acc td:first-child { white-space: nowrap; }

/* short lists in cards and dialogs: the sheets' grid, sized to its rows */
.wl.compact .wl-wrap { max-height: none; min-height: 0; }
.wl.compact { width: max-content; max-width: 100%; }
.wl.compact table { table-layout: auto; }
.wl.compact thead th { height: auto; vertical-align: bottom; }
.wl.compact .th-in { height: auto; min-height: 34px; }
.wl.compact .th-label { white-space: normal; padding-top: 5px; padding-bottom: 5px; overflow: visible; }
.wl th.num .th-label { text-align: right; }
.wl.compact td.wrap { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 160px; height: auto; padding-top: 6px; padding-bottom: 6px; }
.wl.compact .wl-bar { padding: 6px 8px; }
.wl.compact .empty { padding: 14px; }
.wl td a { text-decoration: none; font-weight: 600; } .wl td a:hover { text-decoration: underline; }
.wl td .name { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; }
.wl tr.sub td { color: var(--muted); } .wl tr.sub td:first-child { padding-left: 30px; }
.wl tr.total td { font-weight: 700; border-top: 2px solid var(--line); }
.wl td .input { height: 24px; padding: 0 4px; font-size: 13px; }
.wl td .pct .meter { width: 70px; }
.modal .wl.compact .wl-wrap { max-height: 60vh; }
