/* Work Metrics page (local test app; URL /JobHistory). Colors: categorical slots 1–5 of the validated chart palette. */
.jh-intro { color: #555; max-width: 900px; }
.jh-muted { color: #6b7280; font-weight: 400; }
.jh-error, .jh-bad { color: #a93226; }
.jh-good { color: #1d7a46; }
.jh-section { border: 1px solid #d5dbe1; border-radius: 16px; padding: 16px 18px; background: #fff; margin-bottom: 22px; }
.jh-section h3 { margin: 18px 0 8px 0; }
.jh-section h3:first-child { margin-top: 0; }

.jh-filters { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 14px; }
.jh-filters label { display: flex; align-items: center; gap: 6px; font-size: 14px; color: #444; }
.jh-filters input[type=date] { padding: 6px; border: 1px solid #c9d3dd; border-radius: 6px; font: inherit; }
.jh-boards { display: flex; gap: 6px; }
.jh-boards button { margin: 0; padding: 6px 14px; background: #fff; color: #143642; border: 1px solid #c9d3dd; border-radius: 8px; font-weight: 700; display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.jh-boards button span { font-size: 11px; font-weight: 400; color: #6b7280; }
.jh-boards button.on { background: #143642; color: #fff; border-color: #143642; }
.jh-boards button.on span { color: #d1d5db; }
.jh-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.jh-presets button { margin: 0; padding: 5px 10px; font-size: 13px; }
.jh-small { margin: 0; padding: 4px 10px; font-size: 13px; }

.jh-metrics.jh-loading { opacity: .5; }
.jh-range { font-weight: 700; margin: 4px 0 10px 0; }
.jh-warnings { background: #fef5e7; color: #7a4a00; border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-bottom: 12px; }
.jh-warnings div + div { margin-top: 4px; }

.jh-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.jh-tile { position: relative; border: 1px solid #e1e6eb; border-radius: 10px; padding: 10px 12px 10px 14px; background: #fafbfc; }
.jh-key { position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 3px 3px 0; }
.jh-tile-label { font-size: 12px; color: #52514e; }
.jh-tile-value { font-size: 24px; font-weight: 600; color: #0b0b0b; }
.jh-tile-sub { font-size: 12px; color: #6b7280; }

.jh-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 8px; }
@media (max-width: 760px) { .jh-charts { grid-template-columns: minmax(0, 1fr); } }
.jh-chart { margin: 0; border: 1px solid #e1e6eb; border-radius: 10px; padding: 10px 12px; background: #fcfcfb; min-width: 0; }
.jh-chart.jh-wide { grid-column: 1 / -1; }
.jh-chart figcaption { font-weight: 700; font-size: 15px; color: #0b0b0b; margin-bottom: 4px; }
.jh-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: #52514e; margin-bottom: 4px; }
.jh-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.jh-legend b { display: inline-block; width: 14px; height: 2px; border-radius: 1px; margin-right: 5px; vertical-align: 3px; }
.jh-svg { width: 100%; height: auto; display: block; overflow: visible; }
.jh-svg .jh-grid { stroke: #ecebe8; stroke-width: 1; }
.jh-svg .jh-base { stroke: #c9c8c2; stroke-width: 1; }
.jh-svg .jh-axis { font-size: 12px; fill: #6b6a65; font-variant-numeric: tabular-nums; }
.jh-svg .jh-label { font-size: 11px; fill: #0b0b0b; font-weight: 600; }
.jh-svg .jh-cross { stroke: #9a9993; stroke-width: 1; }
.jh-svg .jh-hit { cursor: crosshair; outline: none; }
.jh-svg .jh-hit:focus { stroke: #143642; stroke-width: 1; }
.jh-empty { margin: 30px 0; text-align: center; }
.jh-tip { position: fixed; z-index: 2000; background: #fff; border: 1px solid #d5dbe1; border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.14); padding: 10px 14px; font-size: 14px; line-height: 1.5; pointer-events: none; max-width: 380px; }
.jh-tip-title { color: #143642; font-weight: 700; margin-bottom: 4px; }
.jh-tip-row i.jh-sw { width: 12px; height: 12px; border-radius: 3px; }
.jh-tip-row .jh-tip-sub { color: #6b7280; margin-left: auto; padding-left: 12px; font-variant-numeric: tabular-nums; }
.jh-tip-row { display: flex; align-items: center; gap: 6px; color: #52514e; }
.jh-tip-row i { width: 12px; height: 2px; border-radius: 1px; flex: none; }
.jh-tip-row strong { color: #0b0b0b; font-variant-numeric: tabular-nums; }

.jh-months th { white-space: nowrap; }
.jh-months td { white-space: nowrap; font-variant-numeric: tabular-nums; }
.jh-months tr > th:first-child { text-align: left; font-weight: 600; color: #444; background: #fafbfc; }

.jh-drop { border: 2px dashed #c9d3dd; border-radius: 12px; padding: 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.jh-drop.over { border-color: #143642; background: #eef3f8; }
.jh-drop p { margin: 0; flex-basis: 100%; }
.jh-drop button { margin: 0; }
.jh-help { margin: 10px 0; font-size: 14px; color: #444; }
.jh-help summary { cursor: pointer; font-weight: 600; }
.jh-results { list-style: none; padding: 0; font-size: 14px; }
.jh-results li { padding: 4px 0; }
.jh-results li.ok { color: #1d4d33; }
.jh-results li.bad { color: #a93226; }
.jh-cov { margin-bottom: 16px; }
.jh-cov h4 { margin: 8px 0 6px 0; }
.jh-snaps { font-size: 13px; margin: 6px 0 0 0; }
.jh-uploads summary { cursor: pointer; font-weight: 600; margin: 8px 0; }
.jh-check { border-top: 1px solid #e1e6eb; padding-top: 8px; margin-top: 10px; }
.jh-check h4 { margin: 6px 0; }
.jh-check details summary { cursor: pointer; margin: 8px 0; font-size: 14px; }
.jh-section .table-container.jh-months-wrap { max-height: none; }
.jh-months tr > th:first-child { position: sticky; left: 0; z-index: 1; }
.jh-months th:hover { background-color: #eef2f6; color: inherit; }

.jh-fold > summary { cursor: pointer; list-style: none; }
.jh-fold > summary::-webkit-details-marker { display: none; }
.jh-fold > summary h3 { display: inline-block; margin: 0; }
.jh-fold > summary::before { content: '▸'; display: inline-block; width: 1.1em; color: #6b7280; }
.jh-fold[open] > summary::before { content: '▾'; }
.jh-section .jh-fold { margin-top: 14px; }
.jh-compare-pick { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 6px 0 10px 0; font-size: 14px; }
.jh-board-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 8px 0; }
.jh-board-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: #444; }
.jh-board-form input, .jh-board-form select { padding: 7px; border: 1px solid #c9d3dd; border-radius: 6px; font: inherit; font-weight: 400; }

/* Month-by-month table: a narrow label column whose labels wrap */
.jh-months tr > th:first-child { white-space: normal; width: 190px; min-width: 150px; max-width: 190px; line-height: 1.3; vertical-align: top; }
/* Month columns only as wide as their figures (the table no longer stretches to the full width) */
.jh-months { width: auto; }
.jh-months td { white-space: normal; min-width: 84px; max-width: 150px; }

/* Terminal picker and views */
.jh-termbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 4px 0 16px 0; }
.jh-term-pick { display: flex; align-items: center; gap: 8px; font-weight: 700; color: #143642; }
.jh-term-pick select { padding: 6px 10px; border: 1px solid #c9d3dd; border-radius: 8px; font: inherit; font-weight: 700; background: #fff; }
.jh-views { display: flex; gap: 6px; flex-wrap: wrap; }
.jh-views button { margin: 0; padding: 7px 14px; background: #fff; color: #143642; border: 1px solid #c9d3dd; border-radius: 8px; font-weight: 700; }
.jh-views button.on { background: #143642; color: #fff; border-color: #143642; }
#jhSep.jh-loading { opacity: .5; }
.jh-boards { flex-wrap: wrap; }

.jh-unconf { border: 1px solid #f0d9a8; background: #fffaf0; border-radius: 10px; padding: 10px 12px; margin-bottom: 16px; }
.jh-unconf h4 { margin: 0 0 8px 0; }
.jh-unconf select, .jh-unconf input { padding: 3px 6px; border: 1px solid #c9d3dd; border-radius: 6px; font: inherit; font-size: 13px; }

.jh-nowrap { white-space: nowrap; }
.jh-byterm tr.on td { background: var(--jh-sel, rgba(42,120,214,.10)); }
.jh-compare-term { margin: 4px 0 8px; font-size: 14px; }
.jh-compare-term .jh-compare-pick { margin: 4px 0 0 0; }
.jh-cmp-mode { margin: 14px 0 6px; }
.jh-jobs { flex-basis: 100%; }
.jh-jobs button { padding: 4px 12px; font-size: 13px; }

.jh-dm-types { flex-wrap: wrap; margin: 10px 0; }
.jh-dm-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.jh-dm-group { border: 1px solid #d9dee5; border-radius: 10px; padding: 8px 12px 10px; margin: 0; background: #fff; }
.jh-dm-group legend { font-weight: 700; font-size: 14px; padding: 0 4px; }
.jh-dm-all { display: flex; gap: 6px; margin: 2px 0 6px; }
.jh-dm-item { display: block; font-size: 14px; padding: 2px 0; }
.jh-dm-save { margin-top: 12px; align-items: center; }
.jh-months tr.jh-total th, .jh-months tr.jh-total td { border-top: 2px solid #d6d4cf; }
/* Time splits: a 100% bar and its list */
.jh-split-bar { display: flex; height: 18px; border-radius: 4px; overflow: hidden; gap: 2px; margin: 6px 0 10px; }
.jh-split-bar i { display: block; height: 100%; min-width: 2px; }
.jh-split-list { width: 100%; border-collapse: collapse; font-size: 14px; }
.jh-split-list td { padding: 3px 4px; border-bottom: 1px solid #ecebe8; }
.jh-split-list td:nth-child(2) { text-align: right; font-weight: 600; white-space: nowrap; }
.jh-split-list td:nth-child(3) { text-align: right; white-space: nowrap; font-size: 13px; }
.jh-key-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
/* Headcount: why they joined / left, roster check, corrections */
.jh-why { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.jh-why ul { margin: 4px 0 0; padding-left: 18px; }
.jh-why h4 { margin: 0; }
@media (max-width: 760px) { .jh-why { grid-template-columns: 1fr; } }
.jh-diff { color: #b3261e; font-weight: 600; }
.jh-moves input[type=text] { width: 100%; min-width: 120px; }
.jh-moves tr.jh-editing td { background: #fbf7ec; }
/* Who holds each turn */
.jh-holders td { font-size: 12px; vertical-align: top; min-width: 96px; }
.jh-holders .jh-hold-st { color: #6b6a66; font-size: 11px; }
.jh-holders .jh-hold-snap { color: #b3261e; font-size: 11px; font-weight: 600; }
.jh-holders td.jh-mismatch { background: #fbe9e7; }
.jh-holders td.jh-dup { background: #fff1d6; }
.jh-holders th.jh-snapcol { background: #eef3fb; }
.jh-mismatch-key { background: #fbe9e7; padding: 0 4px; }
.jh-dup-key { background: #fff1d6; padding: 0 4px; }
.jh-hold-spans td { font-size: 12px; background: #fafaf8; }
/* Settings: charts and extra tiles per metric */
.jh-dm-group.jh-dm-wide { grid-column: 1 / -1; }
.jh-dm-charts td { padding: 4px 8px; vertical-align: middle; }
.jh-dm-charts select { min-width: 150px; }

/* ── Work Metrics bar: a darker navy bar fixed under the site menu, its sections on the right ── */
.wm-bar {
    position: fixed; top: var(--app-nav-h, 64px); left: 0; right: 0; z-index: 899;
    box-sizing: border-box; padding: 0 40px; background: #233140; box-shadow: 0 4px 12px rgba(0,0,0,.35);
    display: flex; flex-wrap: wrap; align-items: center; gap: 0 28px;
}
.wm-title { font-family: 'Roboto Slab', Georgia, serif; font-weight: 800; font-size: 20px; color: #fff; padding: 12px 0; }
.wm-spacer { flex: 1 1 0; }
.wm-tabs { display: flex; flex-wrap: wrap; align-self: stretch; }
.wm-tabs button, .wm-tabs button:hover {
    margin: 0; min-height: 44px; padding: 14px 14px 11px; border: 0; border-bottom: 3px solid transparent; border-radius: 0;
    background: transparent; color: #c3cdd6; font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; box-shadow: none; transform: none;
}
.wm-tabs button:hover { color: #fff; }
.wm-tabs button.on { color: #fff; font-weight: 700; border-bottom-color: var(--brick, #c0392b); }
.wm-tabs button:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
body.wm-on { padding-top: calc(var(--app-nav-h, 64px) + var(--wm-bar-h, 50px) + 36px); }

/* Section heading, with the craft switch beside it on Boards and the pickers on the right */
.wm-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin: 0 0 18px 0; }
.wm-head h2 { margin: 0; }
.wm-craft { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; }
.wm-craft[hidden] { display: none; }
.wm-craft-label { color: #5f6b76; font-weight: 500; cursor: pointer; user-select: none; }
.wm-craft-label.on { color: var(--navy, #2c3e50); font-weight: 700; }
.wm-switch, .wm-switch:hover {
    width: 52px; height: 28px; min-height: 28px; margin: 0; padding: 3px; border: 0; border-radius: 14px; cursor: pointer;
    display: flex; align-items: center; justify-content: flex-start; background: var(--navy, #2c3e50); box-shadow: none;
}
.wm-switch[aria-checked="true"], .wm-switch[aria-checked="true"]:hover { justify-content: flex-end; background: var(--brick, #c0392b); }
.wm-switch span { display: block; width: 22px; height: 22px; border-radius: 11px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.wm-switch:focus-visible { outline: 2px solid var(--navy, #2c3e50); outline-offset: 2px; }

/* Phones and narrow windows: no bar title, the tabs scroll sideways */
@media (max-width: 900px) {
    .wm-bar { padding: 0 8px; flex-wrap: nowrap; }
    .wm-title, .wm-bar > .wm-spacer { display: none; }
    .wm-tabs { flex-wrap: nowrap; overflow-x: auto; flex: 1 1 auto; scrollbar-width: none; }
    .wm-tabs button { flex: 0 0 auto; padding: 12px 12px 9px; }
    body.wm-on { padding-top: calc(var(--app-nav-h, 60px) + var(--wm-bar-h, 46px) + 16px); }
    .wm-head { gap: 10px 18px; }
    .wm-head > .wm-spacer { flex: 1 0 100%; height: 0; }   /* pickers start their own line */
}
