/* Schedule board additions: depot colours, job stage colours, changes of truck or depot, the Unallocated panel extras and the key.
   Loaded after office.css. Colours are deliberately muted; the cards and layout are unchanged. */

:root {
  /* Job stage colours. ONE place: the Live view uses these same names. */
  --stage-allocated: #7388ad;
  --stage-accepted: #5b3fb5;
  --stage-to-pickup: #1f8a8a;
  --stage-at-pickup: #b7860b;
  --stage-to-delivery: #2552a4;
  --stage-at-delivery: #c46a14;
  --stage-delivered: #17734a;
  --stage-warning: #b42318;

  /* One fixed colour per depot. */
  --depot-hazelmere: #8c94a3;
  --depot-projects: #d98fab;
  --depot-cranes: #c8a64a;
  --depot-karratha: #d9925f;
  --depot-porthedland: #5aa5b8;
  --depot-newman: #86a56a;
  --depot-tomprice: #9a86c2;
  --depot-bunbury: #6f9bd1;
  --depot-other: #aab0b8;

  /* Changes on a driver's day. */
  --change-truck: #8a6a2f;
  --change-depot: #7a3e7a;
}

.dep-hazelmere { --dep: var(--depot-hazelmere); }
.dep-projects { --dep: var(--depot-projects); }
.dep-cranes { --dep: var(--depot-cranes); }
.dep-karratha { --dep: var(--depot-karratha); }
.dep-porthedland { --dep: var(--depot-porthedland); }
.dep-newman { --dep: var(--depot-newman); }
.dep-tomprice { --dep: var(--depot-tomprice); }
.dep-bunbury { --dep: var(--depot-bunbury); }
.dep-other { --dep: var(--depot-other); }

/* a day cell is tinted and edged with the depot the driver works out of that day */
.cell.dep { background-color: color-mix(in srgb, var(--dep) 13%, var(--surface)); box-shadow: inset 0 2px 0 var(--dep); }
.cell.dep.weekend { background-color: color-mix(in srgb, var(--dep) 13%, var(--surface-2)); }
.cell.dep.over { background-color: var(--nf-blue-soft); }
.drv.dep { box-shadow: inset 3px 0 0 var(--dep); }
.cellhead { display: flex; gap: 6px; align-items: center; min-height: 15px; }
.deptag { background: color-mix(in srgb, var(--dep) 30%, var(--surface)); border-color: var(--dep); color: var(--text); }
.daytruck { font-size: 10.5px; font-weight: 600; color: var(--muted); }

/* sections of the schedule: a clear gap and a coloured edge */
.sect { margin-top: 12px; border-left: 4px solid var(--dep, var(--line-strong)); }
.sect.first { margin-top: 0; }

/* toolbar and key */
.toolbar { flex-wrap: wrap; }
.legend { background: var(--surface); border-bottom: 1px solid var(--line); padding: 3px 12px; font-size: 11.5px; color: var(--muted); }
.legend > summary { cursor: pointer; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; }
.lg-row { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; padding: 2px 0; }
.lg-title { font-weight: 600; min-width: 80px; }
.lg { display: inline-flex; align-items: center; gap: 5px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--dep, var(--muted)); }
.sw.stg-allocated { background: var(--stage-allocated); }
.sw.stg-accepted { background: var(--stage-accepted); }
.sw.stg-to-pickup { background: var(--stage-to-pickup); }
.sw.stg-at-pickup { background: var(--stage-at-pickup); }
.sw.stg-to-delivery { background: var(--stage-to-delivery); }
.sw.stg-at-delivery { background: var(--stage-at-delivery); }
.sw.stg-delivered { background: var(--stage-delivered); }
.sw.stg-warning { background: var(--stage-warning); }
.sw.chg-truck-sw { background: var(--change-truck); }
.sw.chg-depot-sw { background: var(--change-depot); }

/* job cards: the left edge and the tag follow the stage */
.card[data-stage="allocated"] { --stg: var(--stage-allocated); }
.card[data-stage="accepted"] { --stg: var(--stage-accepted); }
.card[data-stage="to-pickup"] { --stg: var(--stage-to-pickup); }
.card[data-stage="at-pickup"] { --stg: var(--stage-at-pickup); }
.card[data-stage="to-delivery"] { --stg: var(--stage-to-delivery); }
.card[data-stage="at-delivery"] { --stg: var(--stage-at-delivery); }
.card[data-stage="delivered"] { --stg: var(--stage-delivered); }
.card[data-stage] { border-left-color: var(--stg); }
.card[data-stage] .pill { --c: var(--stg); }
/* waiting past the free time (never on an hourly job) */
.card.dem { --stg: var(--stage-warning); border-left-color: var(--stage-warning); background: color-mix(in srgb, var(--stage-warning) 5%, var(--surface)); }
.card.dem .pill { --c: var(--stage-warning); }

/* a change of truck or depot: a slim strip among the jobs */
.chg { font-size: 11.5px; line-height: 1.3; padding: 2px 8px; border: 1px solid color-mix(in srgb, var(--chg) 40%, var(--surface)); border-left: 3px solid var(--chg);
  border-radius: 3px; background: color-mix(in srgb, var(--chg) 9%, var(--surface)); color: var(--text); cursor: grab; min-width: 0; flex-shrink: 0; }
.chg:hover { border-color: var(--chg); }
.chg-truck { --chg: var(--change-truck); }
.chg-depot { --chg: var(--change-depot); }

/* Unallocated panel */
.fmsnote { font-size: 11px; color: var(--muted); }
.behind { border: 1px solid var(--line-strong); border-left: 3px solid var(--stage-warning); border-radius: 3px; background: var(--surface); padding: 4px 8px; }
.behind > summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--stage-warning); }
.behind-body { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; max-height: 190px; overflow: auto; }
.card.brow { padding: 3px 8px; }
.unalloc select { min-width: 0; width: 100%; }
