/* Job Demand screens. Everything shared (colors, type, buttons, tables, charts) comes from
 * kit/; this file lays out the board and maps demand levels onto kit tokens. */

/* Demand levels come straight from the server (JD.Level). */
.pill.high   { --status: var(--success); --i: var(--icon-up); }
.pill.normal { --status: var(--neutral); --i: var(--icon-quiet); }
.pill.low    { --status: var(--warning); --i: var(--icon-down); }
.pill.held   { --status: var(--info);    --i: var(--icon-lock); }

/* The board is a smaller panel than the staff view. */
.shell.board { inset: 10vh 18vw auto; max-height: 80vh; }

.you { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.you-text { display: flex; flex-direction: column; gap: .1429rem; }
.you-text strong { font-size: var(--fs-md); font-weight: 650; }

.job-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: var(--sp-3); }
.job { display: flex; flex-direction: column; gap: var(--sp-2); }
.job.mine { border-color: var(--line-strong); }
.job .head { display: flex; align-items: center; gap: var(--sp-2); }
.job .head h2 { margin: 0; font-size: var(--fs-md); font-weight: 650; flex: 1; min-width: 0;
                overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job .mult { font-size: var(--fs-2xl); font-weight: 650; font-stretch: var(--stretch-display); line-height: 1;
             font-variant-numeric: tabular-nums; }
.job .mult small { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; font-stretch: var(--stretch-body);
                   margin-left: var(--sp-2); }
.job .pay { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.job .meta { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.job .bar { height: .4286rem; background: var(--data-track); border-radius: var(--radius); position: relative; overflow: hidden; }
.job .bar .fill { position: absolute; top: 0; bottom: 0; background: var(--data-in); border-radius: var(--radius);
                  transform-origin: left; animation: grow-x var(--dur-slow) var(--ease-out); }
.job .bar .fill.below { background: var(--data-out); }
.job .bar .mid { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink-2); }

.rules { margin: var(--sp-4) 0 0; font-size: var(--fs-sm); max-width: 90ch; }
.card .rules { margin: 0; }

#b-alerts .i { --i: var(--icon-info); }
#b-alerts[aria-pressed="false"] .i { --i: var(--icon-quiet); }

/* Staff view */
.table-wrap { overflow-x: auto; }
#a-jobs tbody tr { cursor: pointer; }
#a-jobs tbody tr.focus td { box-shadow: inset 0 -2px 0 var(--accent); }
#a-jobs td:first-child:not(.empty-cell) { font-weight: 600; white-space: nowrap; }
#a-jobs td { white-space: nowrap; }

.legend { display: inline-flex; gap: var(--sp-3); margin-left: auto; color: var(--ink-2); font-size: var(--fs-sm);
          font-weight: 400; font-stretch: var(--stretch-body); }
.legend > span { display: inline-flex; align-items: center; gap: var(--sp-1); }
.sw { display: inline-block; width: .7143rem; height: .7143rem; border-radius: var(--radius); }
.sw.head { background: var(--data-in); }
.sw.target { background: var(--data-line); }
.sw.mult { background: var(--data-out); }
.sw.base { background: var(--line-strong); }

.line-chart .head.area { fill: var(--data-in); opacity: .12; }
.line-chart .head.stroke { stroke: var(--data-in); }
.line-chart .target.stroke { stroke: var(--data-line); stroke-dasharray: 6 4; opacity: .7; }
.line-chart .mult.stroke { stroke: var(--data-out); }
.line-chart .baseline { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.tooltip .series { display: flex; align-items: center; gap: var(--sp-2); }
.tooltip .series b { margin-left: auto; padding-left: var(--sp-3); }

@media (max-width: 1400px) { .shell.board { inset: 6vh 8vw auto; max-height: 88vh; } }
@media (max-width: 900px) { .shell.board { inset: 2vh 2vw auto; max-height: 96vh; } }
