/* Un'unica palette per planning, mobile, legenda e modelli di turno. */
:where(.planner-shift.work,.planning-mobile-assignment.work,.legend-work,
  .shift-quick button[data-shift-quick],.shift-quick button[data-shift-split],
  .shift-quick button[data-preset-type="work"],.quick-presets-dialog section[data-preset-type="work"]){
  --shift-bg:#1d4ed8;--shift-fg:#fff;--shift-border:#1e40af;
}
:where(.planner-shift.rest,.planning-mobile-assignment.rest,.legend-rest,
  .shift-quick button[data-shift-kind="rest"],.shift-quick button[data-rest-half],
  .shift-quick button[data-custom-rest],.shift-quick button[data-preset-type="rest"],
  .quick-presets-dialog section[data-preset-type="rest"]){
  --shift-bg:#fbbf24;--shift-fg:#422006;--shift-border:#b45309;
}
:where(.planner-shift.holiday,.planning-mobile-assignment.holiday,.legend-holiday){
  --shift-bg:#15803d;--shift-fg:#fff;--shift-border:#166534;
}
:where(.planner-shift.permission,.planning-mobile-assignment.permission,.legend-permission){
  --shift-bg:#b45309;--shift-fg:#fff;--shift-border:#92400e;
}
:where(.planner-shift.sick,.planning-mobile-assignment.sick,.legend-sick){
  --shift-bg:#b91c1c;--shift-fg:#fff;--shift-border:#991b1b;
}
:where(.planner-shift.training,.planning-mobile-assignment.training,.legend-training,
  .shift-quick button[data-preset-type="training"],.quick-presets-dialog section[data-preset-type="training"]){
  --shift-bg:#6d28d9;--shift-fg:#fff;--shift-border:#5b21b6;
}
:where(.planner-shift.transfer,.planning-mobile-assignment.transfer,.legend-transfer,
  .shift-quick button[data-preset-type="transfer"],.quick-presets-dialog section[data-preset-type="transfer"]){
  --shift-bg:#0f766e;--shift-fg:#fff;--shift-border:#115e59;
}

.planner-shift:not(.cancelled):is(.work,.rest,.holiday,.permission,.sick,.training,.transfer),
.planning-mobile-assignment:not(.cancelled):is(.work,.rest,.holiday,.permission,.sick,.training,.transfer),
.planning-legend span{
  background:var(--shift-bg);color:var(--shift-fg);border-color:var(--shift-border);
  box-shadow:inset 0 0 0 1px var(--shift-border);
}
.planning-mobile-assignment:not(.cancelled):is(.work,.rest,.holiday,.permission,.sick,.training,.transfer){
  border-left-color:var(--shift-border);
}
.planning-mobile-assignment:not(.cancelled) .planning-mobile-type{
  color:var(--shift-border);background:rgba(255,255,255,.94);
}
.shift-quick button:not([data-edit-presets]){
  background:var(--shift-bg);color:var(--shift-fg);border-color:var(--shift-border);
  box-shadow:inset 0 0 0 1px var(--shift-border);
}
.shift-quick button:not([data-edit-presets]) small{color:var(--shift-fg);opacity:.95}
.shift-quick button[data-shift-quick]::before,.shift-quick button[data-shift-split]::before{
  content:'Lavoro';font-size:.75rem;font-weight:900;text-transform:uppercase;letter-spacing:.035em;
}
.shift-quick .quick-type-label{color:var(--shift-fg);font-size:.75rem;font-weight:900;text-transform:uppercase;letter-spacing:.035em}
.shift-quick button:hover:not(:disabled),.shift-quick button:focus-visible{
  outline:2px solid var(--shift-border,#1d4ed8);outline-offset:2px;
}
.quick-presets-dialog section[data-preset-type]{
  border-left:5px solid var(--shift-border);background:color-mix(in srgb,var(--shift-bg) 9%,white);
}
.quick-presets-dialog .quick-type-label{
  display:inline-block;justify-self:start;margin-top:7px;padding:4px 9px;
  border-radius:999px;background:var(--shift-bg);color:var(--shift-fg);
  font-size:.75rem;font-weight:900;text-transform:uppercase;
}

.planner-shift.absent,.planning-mobile-assignment.absent,.legend-absent,[data-preset-type="absent"],[data-shift-kind="absent"] {--shift-bg:#f1f5f9;--shift-fg:#475569;--shift-border:#94a3b8;background:#f1f5f9;color:#475569;border-color:#94a3b8;}

.planning-mobile-assignment em,.planner-shift .planning-card-state.changed {background:#fff3cd;color:#5c3b00;border:1px solid #e0b54b;border-radius:6px;padding:4px 8px;font-weight:800;font-style:normal;line-height:1.4;display:inline-block;opacity:1;}

/* r342: compact labels, with the existing shift palette shown as a small dot. */
#view-shifts .planning-legend{gap:6px 12px;align-items:center;margin:8px 0;flex-wrap:wrap}
#view-shifts .planning-legend span{display:inline-flex;align-items:center;gap:6px;padding:3px 0;background:transparent;color:#475569;border:0;border-radius:0;box-shadow:none;font-size:.8125rem;font-weight:650;line-height:1.4;white-space:nowrap}
#view-shifts .planning-legend span::before{content:"";width:7px;height:7px;flex:0 0 7px;border-radius:50%;background:var(--shift-bg);box-shadow:inset 0 0 0 1px var(--shift-border)}
#view-shifts .planner-filters-visible .planner-filters{padding:10px 12px;gap:10px}
#view-shifts .planning-show-cancelled{font-size:.8125rem;line-height:1.4}
