/* Manager reports page (vMgr=a). The mail itself stays light: it is how managers see it. */
.manager-report-host { min-width:0; width:100%; max-width:100%; }
.manager-report-workspace { display:grid; gap:20px; min-width:0; max-width:100%; }
.manager-report-workspace > * { min-width:0; }
.mr-icon { flex:none; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.mr-period-controls { display:flex; flex-wrap:wrap; align-items:center; gap:12px; }
.mr-period-select select, .mr-population-select select, .mr-sort-select select { width:auto; min-height:40px; height:40px; padding:0 12px; border:1px solid var(--border-strong); border-radius:8px; color:var(--strong); background:var(--surface); font:inherit; font-size:15px; font-weight:500; }

.mr-pipeline { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)) auto; align-items:stretch; overflow:hidden; border:1px solid var(--border); border-radius:8px; background:var(--surface); }
.mr-pipeline-cell { display:flex; align-items:center; gap:14px; min-width:0; padding:16px 20px; border-right:1px solid var(--border); }
.mr-pipeline-cell.is-accent .mr-icon { color:var(--accent); }
.mr-pipeline-cell.is-warning .mr-icon { color:var(--warn-fg); }
.mr-pipeline-cell.is-muted .mr-icon { color:var(--text); }
.mr-pipeline-copy { display:grid; gap:2px; min-width:0; }
.mr-pipeline-copy strong { color:var(--strong); font-size:15px; line-height:22px; font-weight:600; }
.mr-pipeline-copy span { color:var(--text); font-size:14px; line-height:20px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.mr-pipeline-action { display:flex; align-items:center; padding:0 20px; }
.mr-pipeline-action .primary-button { display:inline-flex; align-items:center; gap:8px; white-space:nowrap; }
.mr-delivery-note { align-items:center; margin:0; font-size:15px; line-height:22px; }
.mr-delivery-note .mr-icon, .manager-report-blocked .mr-icon { width:20px; height:20px; }
.manager-report-blocked { margin:0; }
.manager-report-status { min-height:20px; margin:0; color:var(--text); font-size:14px; }
.manager-report-status:empty { display:none; }

.mr-columns { display:grid; grid-template-columns:minmax(300px,380px) minmax(0,1fr); gap:24px; align-items:start; }
.mr-card { display:flex; flex-direction:column; min-width:0; overflow:hidden; border:1px solid var(--border); border-radius:8px; background:var(--surface); }
.mr-list-head { display:grid; gap:12px; padding:16px 16px 12px; border-bottom:1px solid var(--border); }
/* The search input draws its own 3:1 border and focus ring (0.4.158); the icon sits inside its left padding. */
.mr-search { position:relative; display:flex; align-items:center; color:var(--text); }
.mr-search > svg { position:absolute; left:12px; pointer-events:none; }
.mr-search input[type="search"], .mr-search input[type="search"]:focus { flex:1; width:100%; min-width:0; min-height:40px; height:40px; padding:0 12px 0 38px; border:1px solid var(--field-border); border-radius:8px; box-shadow:none; color:var(--strong); background:var(--surface); font:inherit; font-size:15px; }
.mr-search input::placeholder { color:var(--placeholder); }
.mr-filters { display:flex; flex-wrap:wrap; gap:6px; }
.mr-filter { display:inline-flex; align-items:center; gap:6px; height:32px; padding:0 12px; border:1px solid var(--border); border-radius:100px; color:var(--strong); background:var(--surface); font:inherit; font-size:14px; font-weight:500; cursor:pointer; }
.mr-filter[aria-pressed="true"] { border-color:var(--accent); color:var(--tint-text); background:var(--tint); font-weight:600; }
.mr-filter-count { color:var(--text); font-weight:400; font-variant-numeric:tabular-nums; }
.mr-list { display:flex; flex-direction:column; min-width:0; }
.mr-manager { display:flex; align-items:center; gap:12px; width:100%; min-height:64px; padding:8px 16px; border:0; border-bottom:1px solid var(--border); color:var(--strong); background:transparent; font:inherit; text-align:left; cursor:pointer; }
.mr-manager:hover { background:var(--surface-subtle); }
.mr-manager[aria-current="true"] { background:var(--tint); box-shadow:inset 4px 0 0 var(--accent); }
.mr-manager:focus-visible { outline:3px solid var(--accent); outline-offset:-3px; }
.mr-avatar { display:inline-flex; flex:none; align-items:center; justify-content:center; width:36px; height:36px; border-radius:100%; color:var(--strong); background:var(--surface-muted); font-size:12px; font-weight:600; }
.mr-manager-copy { display:grid; flex:1; gap:2px; min-width:0; }
.mr-manager-copy strong, .mr-manager-copy span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mr-manager-copy strong { font-size:15px; line-height:22px; font-weight:600; }
.mr-manager-copy span { color:var(--text); font-size:13px; line-height:18px; }
.mr-manager .chip { flex:none; }
/* On the tinted selected row a tinted chip would blend in: keep its outline visible. */
.mr-manager[aria-current="true"] .chip { box-shadow:inset 0 0 0 1px currentColor; }
.mr-list-foot { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; padding:12px 16px; color:var(--text); font-size:13px; line-height:18px; font-variant-numeric:tabular-nums; }
.mr-paging { display:flex; gap:12px; }
.mr-empty { margin:0; padding:24px 16px; color:var(--text); }

.mr-receives-head { display:flex; flex-wrap:wrap; align-items:center; gap:12px; padding:14px 20px; border-bottom:1px solid var(--border); }
.mr-receives-head h2 { flex:1; min-width:180px; margin:0; color:var(--strong); font-size:18px; line-height:24px; font-weight:600; }
.mr-receives-head .secondary-button { display:inline-flex; align-items:center; gap:8px; white-space:nowrap; }
.manager-report-mail-metadata { display:grid; grid-template-columns:96px minmax(0,1fr); gap:8px 16px; margin:0; padding:16px 24px; border-bottom:1px solid var(--border); font-size:14px; line-height:20px; }
.manager-report-mail-metadata dt { color:var(--text); }
.manager-report-mail-metadata dd { min-width:0; margin:0; color:var(--strong); overflow-wrap:anywhere; }
.manager-report-mail-metadata dt:nth-of-type(3) + dd { font-weight:600; }
.mr-to, .mr-attachment { display:inline-flex; flex-wrap:wrap; align-items:center; gap:8px; }
.mr-attachment .mr-icon { color:var(--text); }
/* The mail canvas keeps the light mail colours in both themes. */
.mr-mail-canvas { padding:16px; color:#212224; background:#f1f3f3; }
.mr-mail-canvas iframe { display:block; width:100%; max-width:960px; height:680px; margin:0 auto; border:1px solid #e5e7e8; border-radius:8px; background:#fff; color-scheme:light; }
.mr-plain { max-width:960px; max-height:620px; margin:0 auto; overflow:auto; padding:24px; border:1px solid #e5e7e8; border-radius:8px; color:#212224; background:#fff; font:13px/20px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space:pre-wrap; overflow-wrap:anywhere; }
.mr-mail-message { display:flex; flex-direction:column; align-items:center; gap:10px; max-width:640px; margin:0 auto; padding:48px 32px; border:1px solid #e5e7e8; border-radius:8px; color:#212224; background:#fff; text-align:center; }
.mr-mail-message p { max-width:46ch; margin:0; color:#4d575d; font-size:15px; line-height:22px; }
.mr-mail-message strong { font-size:18px; line-height:24px; font-weight:600; }
.mr-mail-message.is-blocked .mr-icon { color:#8a3c0b; }
.mr-mail-message .primary-button { margin-top:8px; }
.mr-receives-foot { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px 16px; padding:14px 20px; border-top:1px solid var(--border); }
.mr-receives-foot p { margin:0; }
.mr-receives > .mr-details { margin:0 20px; }
.mr-receives > .mr-details:last-child { margin-bottom:16px; }

.mr-details { border-top:1px solid var(--border); padding-top:12px; }
.manager-report-workspace > div > .mr-details { padding:0; border:1px solid var(--border); border-radius:8px; background:var(--surface); }
.manager-report-workspace > div > .mr-details > summary { min-height:48px; padding:13px 18px; }
.manager-report-workspace > div > .mr-details > :not(summary) { margin-inline:18px; }
.manager-report-workspace > div > .mr-details > :last-child { margin-bottom:18px; }
.mr-details summary { color:var(--strong); font-weight:600; cursor:pointer; }
.mr-details[open] > summary { margin-bottom:12px; }
.manager-report-workspace label { display:flex; flex-direction:column; gap:.4rem; }
.manager-report-workspace .mr-search, .manager-report-workspace .mr-period-select, .manager-report-workspace .mr-population-select { flex-direction:row; }
.mr-details input, .mr-details select, .mr-details textarea { max-width:100%; padding:.6rem; border:1px solid var(--border-strong); border-radius:8px; color:var(--strong); background:var(--surface); font:inherit; }
.mr-details input[type=checkbox] { align-self:start; }
.manager-report-settings { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; padding:0 0 1rem; }
.manager-report-settings fieldset, .manager-report-settings > p { grid-column:1/-1; }
.manager-report-settings fieldset { display:flex; flex-wrap:wrap; gap:1rem; padding:1rem; border:1px solid var(--border); border-radius:8px; }
.mr-roster { display:grid; gap:10px; justify-items:start; }
.mr-roster h3 { margin:0; font-size:17px; }
.mr-entra { display:grid; gap:8px; justify-items:start; max-width:100%; }
.mr-entra p { margin:0; }
.mr-entra-complete { margin-top:16px; }
.mr-entra-complete h4 { margin:0; font-size:15px; }
.mr-population-note { margin:0; }
.mr-entra-status { margin:0; color:var(--strong); font-size:14px; line-height:20px; overflow-wrap:anywhere; }
.mr-entra-status.is-warning { color:var(--warn-fg); }
.mr-entra-status:empty { display:none; }
.mr-scope-hint { display:block; margin:4px 0 0; color:var(--warn-fg); font-size:14px; line-height:20px; font-weight:400; overflow-wrap:anywhere; }
.mr-scope-hint[hidden] { display:none; }
.mr-blocker-actions { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin-top:8px; }
.mr-blocker-actions p { margin:0; }
.manager-report-table-scroll { overflow-x:auto; max-width:100%; margin:0 0 12px; }
.manager-report-table-scroll table { width:100%; border-collapse:collapse; font-size:14px; }
.manager-report-table-scroll th, .manager-report-table-scroll td { padding:10px 12px; border-bottom:1px solid var(--border); text-align:left; vertical-align:top; }
.manager-report-table-scroll th { color:var(--text); background:var(--bg); font-weight:600; white-space:nowrap; }
.manager-report-table-scroll .numeric { text-align:right; font-variant-numeric:tabular-nums; }
.manager-report-table-scroll td { white-space:pre-line; }
.manager-report-table-scroll table[aria-label="People and coverage"] { min-width:760px; }
.manager-report-table-scroll table[aria-label="People and coverage"] td:first-child { min-width:140px; white-space:nowrap; }
.manager-report-workspace button:focus-visible, .manager-report-workspace summary:focus-visible, .manager-report-workspace input:focus-visible, .manager-report-workspace select:focus-visible { outline:3px solid var(--accent); outline-offset:3px; }

.view-actions .mr-period-controls { flex-wrap:nowrap; justify-content:flex-end; }
#manager-report-period-controls:not([hidden]) { display:flex; flex:0 1 auto; align-items:center; min-width:0; max-width:100%; }
.mr-attachment { flex-wrap:nowrap; align-items:flex-start; }
.mr-attachment > span { min-width:0; overflow-wrap:anywhere; }
.mr-attachment .mr-icon { margin-top:2px; }

@media (max-width:1280px) {
  .mr-pipeline { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .mr-pipeline-cell:nth-child(2n) { border-right:0; }
  .mr-pipeline-cell { border-bottom:1px solid var(--border); }
  .mr-pipeline-action { grid-column:1/-1; padding:12px 20px; }
}
@media (max-width:1100px) {
  .mr-columns { grid-template-columns:minmax(0,1fr); }
}
@media (max-width:660px) {
  .view-actions:has(#manager-report-period-controls:not([hidden])) { flex-wrap:wrap; }
  #manager-report-period-controls:not([hidden]) { flex:1 1 100%; }
  .mr-pipeline { grid-template-columns:minmax(0,1fr); }
  .mr-pipeline-cell { border-right:0; padding:12px 16px; }
  .mr-pipeline-action { padding:12px 16px; }
  .mr-pipeline-action .primary-button { width:100%; justify-content:center; }
  .mr-mail-canvas { padding:12px; }
  .mr-mail-canvas iframe { height:520px; }
  .manager-report-mail-metadata { grid-template-columns:minmax(0,1fr); gap:2px; padding:12px 16px; }
  .manager-report-mail-metadata dd { margin-bottom:8px; }
  .mr-receives-head { padding:12px 16px; }
  .mr-receives > .mr-details { margin:0 16px; }
  .manager-report-settings { grid-template-columns:1fr; }
  .mr-period-controls, .view-actions .mr-period-controls { width:100%; flex-wrap:wrap; justify-content:flex-start; }
  .mr-period-select, .mr-period-select select, .mr-population-select, .mr-population-select select { flex:1; min-width:0; width:100%; }
}

/* 0.4.161: week steps and the automation settings dialog. */
.mr-period-step { width:44px; height:44px; border:1px solid var(--field-border); background:var(--surface); }
.mr-period-step[hidden] { display:none; }
.mr-period-step:disabled { color:var(--muted); cursor:not-allowed; opacity:.6; }
.mr-period-step svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.mr-automation-open { min-height:44px; }
.mr-automation { width:min(560px, calc(100vw - 32px)); }
.mr-automation-body { display:grid; gap:12px; }
.mr-automation-body .secondary-button { justify-self:start; min-height:44px; }
.mr-automation-switches { display:grid; gap:8px; }
.mr-switch { display:flex; align-items:center; gap:12px; min-height:44px; padding:8px 12px; border:1px solid var(--field-border); border-radius:8px; color:var(--strong); background:var(--surface); font:inherit; font-weight:500; text-align:left; cursor:pointer; }
.mr-switch:disabled { color:var(--text); cursor:not-allowed; }
.mr-switch-track { position:relative; flex:none; width:36px; height:20px; border:1px solid var(--field-border); border-radius:999px; background:var(--surface-muted); }
.mr-switch-track::after { content:""; position:absolute; top:2px; left:2px; width:14px; height:14px; border-radius:50%; background:var(--field-border); transition:transform .15s; }
.mr-switch[aria-checked="true"] .mr-switch-track { background:var(--accent); border-color:var(--accent); }
.mr-switch[aria-checked="true"] .mr-switch-track::after { transform:translateX(16px); background:var(--surface); }
.mr-automation-body { padding:0 24px 24px; }
.mr-period-controls select { min-height:44px; height:44px; }
@media (max-width:720px) {
  .mr-period-select, .mr-population-select { flex:1 1 180px; }
  .mr-period-select select, .mr-population-select select { min-width:120px; }
}
.mr-automation .icon-button { width:44px; height:44px; }
/* The header controls wrap instead of squeezing a select (0.4.161 added the week steps and Automation settings). */
.view-actions .mr-period-controls { flex-wrap:wrap; }
.mr-period-controls > label, .mr-period-controls > button { flex-shrink:0; }
.mr-automation-open { white-space:nowrap; }

/* 0.4.168: include people who used AI without credits. The 44 px box is the touch target; the text wraps. */
.manager-report-workspace .mr-no-credit-choice { display:flex; flex-direction:row; justify-content:flex-start; text-align:left; align-items:center; gap:8px; flex:1 1 100%; min-width:0; max-width:100%; min-height:44px; color:var(--strong); }
.manager-report-workspace .mr-no-credit-choice[hidden] { display:none; }
.mr-no-credit-choice input { flex:none; width:22px; height:22px; margin:0; accent-color:var(--accent); }
.mr-no-credit-choice span { min-width:0; overflow-wrap:anywhere; }

/* 0.4.170: the period (kind, steps, period) and the list scope (population, Automation settings) wrap as two groups. */
.mr-control-group { display:flex; flex-wrap:nowrap; align-items:center; justify-content:flex-end; gap:12px; min-width:0; max-width:100%; }
.mr-control-group > label, .mr-control-group > button { flex-shrink:0; }
@media (max-width:660px) {
  .mr-control-group { flex:1 1 100%; flex-wrap:wrap; justify-content:flex-start; }
  .mr-control-group > label { flex:1 1 160px; flex-shrink:1; }
  .mr-control-group > :is(.mr-kind-select, .mr-population-select) { flex-basis:100%; }
  .mr-control-group > .mr-period-select { flex:1 1 0; min-width:0; }
}
/* 0.4.191: report settings as cards (10 px radius, 1 px border, no shadow), two per row on wide screens. */
.manager-report-settings { grid-template-columns:repeat(3,minmax(0,1fr)); align-items:stretch; }
.mr-settings-card { display:grid; gap:12px; align-content:start; min-width:0; padding:16px 18px; border:1px solid var(--border); border-radius:10px; background:var(--surface); }
.mr-settings-card h3 { margin:0; color:var(--strong); font-size:16px; line-height:24px; }
.mr-settings-card p { margin:0; }
.mr-settings-card fieldset { padding:0; border:0; }
.mr-settings-card fieldset legend { padding:0; font-weight:600; }
.manager-report-settings > .primary-button, .manager-report-settings > .secondary-button, .manager-report-settings > p { grid-column:1/-1; justify-self:start; }
.mr-roster.mr-settings-card { margin-top:16px; justify-items:stretch; }
/* A checkbox sits before its label, on one line. */
.mr-details .mr-settings-card label:has(> input[type=checkbox]) { display:flex; flex-direction:row-reverse; justify-content:flex-end; align-items:center; gap:10px; min-height:44px; color:var(--strong); }
.mr-settings-card fieldset { display:grid; gap:0; }
@media (max-width:1100px) { .manager-report-settings { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:760px) { .manager-report-settings { grid-template-columns:1fr; } }
.mr-details .mr-settings-card input[type=checkbox] { flex:none; align-self:center; width:20px; height:20px; margin:0; padding:0; }
/* The directory card: readable line length, the complete directory as its own block under a divider. */
.mr-roster.mr-settings-card > p { max-width:90ch; }
.mr-roster.mr-settings-card .mr-entra-complete { width:100%; margin-top:8px; padding-top:16px; border-top:1px solid var(--border); }
.mr-roster.mr-settings-card .mr-entra-complete h4 { font-size:16px; line-height:24px; }
.mr-roster.mr-settings-card label:has(> input[type=file]) { display:grid; gap:6px; width:100%; color:var(--strong); font-weight:600; }

/* 0.4.208: one row for who a report lists and the no-credit choice; a readiness note under the counts;
   a titled preview header with the period; the test delivery box and the waiting reasons inside the card. */
.mr-scope-row { display:flex; flex-wrap:wrap; align-items:center; gap:4px 24px; min-width:0; }
.manager-report-workspace .mr-scope-row .mr-no-credit-choice { flex:0 1 auto; }
.mr-readiness-note { margin:-8px 0 0; font-size:14px; line-height:20px; }
.mr-readiness-note[hidden] { display:none; }
.mr-receives-titles { display:grid; flex:1; gap:2px; min-width:180px; }
.mr-receives-titles h2 { flex:none; min-width:0; overflow-wrap:anywhere; }
.mr-receives-sub { margin:0; color:var(--text); font-size:14px; line-height:20px; }
.mr-mail-status { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; padding:14px 24px; border-bottom:1px solid var(--border); }
.mr-mail-status p { flex:1 1 100%; margin:0; font-size:14px; line-height:20px; overflow-wrap:anywhere; }
.mr-waiting { display:grid; gap:6px; padding:14px 24px; border-bottom:1px solid var(--border); background:var(--warn-bg); color:var(--warn-fg); font-size:14px; line-height:20px; }
.mr-waiting p { margin:0; color:inherit; }
.mr-waiting ul { margin:0; padding-left:20px; }
@media (max-width:660px) {
  .mr-mail-status, .mr-waiting { padding:12px 16px; }
  .mr-mail-status button { flex:1 1 100%; }
}
