/* P15: the shared Filters pattern, Schedule colours and separators, Schedule & MTOs polish, inline number detail, Learning by course. */
:root{--hv-worked:#1c5aa6;--hv-scheduled:#a4510a}

/* Filters: two or three controls inline, the rest behind one button with a count, active filters as chips. */
.filter-bar{display:flex;flex-wrap:wrap;gap:10px 14px;align-items:flex-end;margin:8px 0}
.filter-inline{display:flex;flex-wrap:wrap;gap:10px 14px;align-items:flex-end;flex:1 1 auto;min-width:0}
.filter-inline .scope-controls{display:flex;flex-wrap:wrap;gap:10px 14px;align-items:flex-end}
.filter-button{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 16px;border:1px solid var(--line);border-radius:999px;background:var(--surface);color:var(--ink);font:inherit;font-weight:650;cursor:pointer}
.filter-button:hover{border-color:var(--ink)}
.filter-button[aria-expanded=true]{background:var(--ink);color:#fff;border-color:var(--ink)}
.filter-button:focus-visible,.filter-chip:focus-visible{outline:2px solid var(--info);outline-offset:2px}
.filter-chips{list-style:none;display:flex;flex-wrap:wrap;gap:6px;margin:0 0 8px;padding:0}
.filter-chips[hidden],.filter-panel[hidden]{display:none!important}
.filter-chip{display:inline-flex;align-items:center;gap:8px;min-height:32px;padding:2px 12px;border:1px solid var(--line);border-radius:999px;background:var(--info-bg);color:var(--info);font:inherit;font-size:.8125rem;font-weight:650;cursor:pointer}
.filter-chip:hover{background:#d3e6f8}
.filter-panel{border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);padding:14px;margin:0 0 14px;display:grid;gap:12px}
.filter-panel .scope-controls{display:flex;flex-wrap:wrap;gap:10px 14px;align-items:flex-end}
.filter-panel .scope-controls:empty{display:none}
@media(max-width:560px){.filter-button{width:100%;justify-content:center}.filter-inline>*{flex:1 1 100%}}

/* Worked and Scheduled: two colours, always the same two. Blue circle-free square = worked, orange round = scheduled. */
.hv-worked{color:var(--hv-worked)}.hv-scheduled{color:var(--hv-scheduled)}
.hv-two-row th.hv-kind.hv-worked,.hv-two-row td.hv-worked{color:var(--hv-worked)}.hv-two-row th.hv-kind.hv-scheduled,.hv-two-row td.hv-scheduled{color:var(--hv-scheduled)}
.hv-two-row th.hv-kind.hv-worked,.hv-two-row th.hv-kind.hv-scheduled{font-weight:700}
.hv-legend{display:flex;flex-wrap:wrap;gap:6px 18px;margin:6px 0 10px;font-size:.8125rem}
.hv-key{display:inline-flex;align-items:center;gap:6px;font-weight:700}
.hv-key i{display:inline-block;width:12px;height:12px;background:currentColor;border-radius:2px}.hv-key.hv-scheduled i{border-radius:50%}
/* P35: the heavy black rules mark the grouped Worked / Scheduled blocks only (two header rows, .hv-two-row). Every flat table keeps the thin grey rule. */
.schedule-centered.hv-two-row>table tr.schedule-group-start>th,.schedule-centered.hv-two-row>table tr.schedule-group-start>td{border-top:3px solid #000}
.schedule-centered.hv-two-row>table>tbody>tr:last-child>th,.schedule-centered.hv-two-row>table>tbody>tr:last-child>td,.schedule-centered.hv-two-row>table>tfoot>tr:last-child>*{border-bottom:3px solid #000}
.schedule-centered.hv-two-row>table td.history-total,.schedule-centered.hv-two-row>table th.history-total{border-left:3px solid #000}
.schedule-centered td[data-heat]{color:#14202b}

/* Schedule & MTOs: shorter rows, day headers that look tappable. */
.sm-tables{gap:2px 24px}   /* P27f: two tables side by side again (stack below 900px, report-tables.css) */
.sm-table th,.sm-table td{height:24px;padding:0 3px}
.sm-table th:first-child{width:40px}
.sm-day{min-height:44px;padding:4px 1px;gap:2px}
.sm-table thead th .sm-day{cursor:pointer;transition:background .15s ease}
.sm-table thead th .sm-day:hover,.sm-table thead th .sm-day:focus-visible{background:rgba(255,255,255,.2);box-shadow:inset 0 -3px 0 #fff;color:#fff}
.sm-hint{display:inline-flex;align-items:center;gap:6px;margin:4px 0 8px;font-size:.875rem;font-weight:650;color:var(--info)}
@keyframes sm-pulse{0%,100%{background:transparent}50%{background:rgba(255,255,255,.3)}}
@media(prefers-reduced-motion:no-preference){.sm-day.sm-pulse{animation:sm-pulse 1.2s ease-in-out 3}}
.sm-chart-wrap{position:relative}
.sm-tooltip{position:absolute;z-index:5;max-width:260px;padding:6px 10px;border-radius:8px;background:#14202b;color:#fff;font-size:.8125rem;line-height:1.35;pointer-events:none}
.sm-tooltip[hidden]{display:none}
.sm-hit{fill:transparent;pointer-events:all;cursor:pointer}
[data-sm-shift]{outline:none}[data-sm-shift]:focus-visible .sm-shift,[data-sm-shift]:hover .sm-shift{stroke-width:11;opacity:1}
.sm-shift-hint{margin:6px 0 0}

/* Number detail in place. */
.schedule-detail-host{margin-top:16px}
.schedule-detail{border:1px solid var(--line);border-radius:var(--r-lg);background:var(--surface);padding:14px}
.schedule-detail-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.schedule-detail-head h3{margin:0;font-size:1rem;outline:none}
.schedule-detail-status{margin:8px 0;color:var(--muted);font-size:.875rem}
.schedule-detail-table{max-height:50vh;overflow:auto}

/* Learning by course, direct labor face line. */
.learning-required{display:inline-flex;align-items:center;gap:8px;min-height:44px;font-weight:650}
.learning-required input{width:20px;height:20px}
.learning-course>th{font-weight:700}
.learning-asof{display:inline-block;padding:1px 8px;border-radius:999px;background:var(--warn-bg);color:var(--warn);font-size:.8125rem;font-weight:650}
.learning-figure small{color:var(--muted)}
.direct-face{margin:0 0 6px;font-weight:650}.direct-face-estimate{color:var(--warn)}.direct-face-link{margin:0 0 10px}
.snapshot-detail-row>td{background:var(--bg);padding:10px 14px}
.snapshot-detail-row dl{display:grid;grid-template-columns:max-content 1fr;gap:4px 14px;margin:0}.snapshot-detail-row dt{color:var(--muted)}.snapshot-detail-row dd{margin:0}
.hint-line{margin:6px 0;color:var(--muted);font-size:.875rem}
.learning-course-table td.numeric,.learning-course-table thead th:not(:first-child){text-align:right}
.learning-course-table td.learning-person-note{color:var(--muted);font-size:13px}
.schedule-centered.hv-two-row tbody td.numeric.hv-worked{color:var(--hv-worked)}.schedule-centered.hv-two-row tbody td.numeric.hv-scheduled{color:var(--hv-scheduled)}
.schedule-centered.hv-two-row tbody td.hv-var{color:#14202b}
.detail-below-row>td{padding:0;text-align:left;white-space:normal;font-weight:400}
.detail-below-row .schedule-detail{margin:8px 0;max-width:100%}
.tc-detail .schedule-detail-head{flex-wrap:wrap}
.tc-since{white-space:nowrap}
.tc-numbers{display:flex;gap:24px;margin:8px 0}.tc-numbers div{display:flex;flex-direction:column}.tc-numbers strong{font-size:1.4rem}.tc-numbers span{color:var(--muted);font-size:.875rem}
.tc-groups{max-height:60vh;overflow:auto}
.tc-store h4{margin:12px 0 4px;font-size:1rem}
.tc-person{margin:6px 0 10px 8px}.tc-person-name{margin:0;font-weight:600}
.tc-day{margin:4px 0 0 8px}.tc-day-name{margin:0;color:var(--muted);font-size:.875rem}
.tc-edits{list-style:none;margin:2px 0 0;padding:0}.tc-edit{margin:0 0 8px;padding-left:10px;border-left:2px solid var(--line)}
.tc-edit p{margin:0}.tc-edit-head{font-weight:500}.tc-edit-line{color:var(--muted);font-size:.9rem}
.tc-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:2px}.tc-chip{display:inline-block;padding:1px 8px;border:1px solid var(--line);border-radius:999px;font-size:.78rem;color:var(--muted);background:var(--surface)}
.tc-about{margin-top:10px}.tc-about summary{cursor:pointer;color:var(--muted);font-size:.875rem}
.tc-note{margin:6px 0 0;color:var(--muted);font-size:.875rem}.tc-count{color:var(--muted);font-weight:400}

/* P21: the number you tapped in a Snapshot Trend. The total it came from is outlined; premium lines get their own titled block. */
.report-grid .history-total.drill-target,.history-table .history-total.drill-target{outline:3px solid #1f6f50;outline-offset:-3px;background:#e4f2ea!important}
.drill-note{margin:0 0 10px;font-size:.95rem;padding:8px 12px;border-left:3px solid #1f6f50;background:#f1f8f4;border-radius:0 6px 6px 0}
.premium-drill{margin:0 0 20px;padding:14px 16px;border:1px solid #1f6f50;border-radius:10px;background:var(--surface)}
.premium-drill>h4{margin:0 0 4px;font-size:1.05rem}.premium-drill>h4:focus{outline:2px solid #1f6f50;outline-offset:2px}
.premium-drill h5{font-size:1rem;margin:16px 0 8px}
/* Report card (P27d): metric name left, period toggle right, Filters inside the card. See report-card.js. */
.report-card{border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);padding:16px 18px;margin:0 0 18px}
.report-card-head{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:10px 16px;margin:0 0 6px}
.report-card-title{margin:0;font-size:20px;letter-spacing:-.02em;flex:1 1 auto;min-width:0;min-height:44px;display:flex;align-items:center}/* P29-19: 44px = the toggle buttons, so the title midline sits on the Daily/Weekly row even when the Custom From/Through row makes the toggle block taller */
.report-card-period{flex:0 1 auto;max-width:100%;margin-left:auto}
.period-toggle{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:flex-end;gap:8px 12px}
.period-toggle-options{display:flex;flex-wrap:wrap;gap:6px}
.period-toggle-options button{min-height:44px}
.period-custom-form{display:flex;flex-wrap:wrap;align-items:flex-end;gap:8px 12px;flex:1 0 100%;justify-content:flex-end}
.period-custom-form[hidden]{display:none!important}
.period-custom-form label{display:block;font-size:14px;margin-bottom:4px}
.filter-bar-header{margin:4px 0 8px}
.by-store-history{margin:1.25rem 0 18px;border-top:1px solid var(--line);padding-top:.75rem}.by-store-history>h3{margin:0 0 8px;padding:10px;min-height:44px;display:flex;align-items:center;font-size:1rem;font-weight:650}/* P29-22: same rhythm as the Stores - selected dates summary (.by-store, tokens.css) */
@media(max-width:560px){.report-card{padding:12px}.report-card-period,.period-toggle,.period-toggle-options{width:100%}.period-toggle-options button{flex:1 1 auto}.period-custom-form{justify-content:flex-start}}

/* P27e: Week / Fiscal period selects that sit inside a Filters panel (report-period.js). */
.period-panel{display:flex;flex-wrap:wrap;gap:12px;align-items:end}
.period-panel label{display:block;font-size:13px;margin-bottom:6px}
.period-panel select{min-height:44px;max-width:100%}

/* P27j: Direct labor Daily and Fiscal */
.dl-est{text-decoration:underline dotted;cursor:help;font-weight:650}
.dl-todate{display:inline-block;margin-left:4px;padding:1px 8px;border-radius:999px;border:1px solid var(--line,currentColor);font-size:.78em;font-weight:650;white-space:nowrap}
.dl-estimate-flag{display:inline-block;margin-left:4px;color:var(--warn);font-size:.82em;font-weight:650;white-space:nowrap}
.dl-grain-table td[title],.dl-grain-table td[data-fiscal-pct]{cursor:help}
.dl-grain-table .dl-grain-table{margin:0}
