/* The calendar shares the dispatch shell and owns its month selector. */
.workspace:has(> #collectionScheduleView.active) > .topbar .topbar-actions,
.workspace:has(> #collectionScheduleView.active) > #screenDataStatus,
.workspace:has(> #collectionScheduleView.active) #dispatchContextBar [data-context="range"],
.workspace:has(> #collectionScheduleView.active) #dispatchContextBar [data-context="data"] { display: none }
#collectionScheduleView {
  --cs-ink: #17345b; --cs-muted: #526a87; --cs-line: #dce6f2; --cs-blue: #1467c4;
  --cs-worker-width: 152px; --cs-day-width: 96px;
  min-width: 0; color: var(--cs-ink);
}
#collectionScheduleView [hidden] { display: none !important }
.cs-panel { overflow: hidden; border: 1px solid var(--cs-line); border-radius: 10px; background: #fff; box-shadow: 0 3px 14px #23446d09 }
.cs-toolbar,.cs-filters,.cs-actions,.cs-month { display: flex; align-items: center; flex-wrap: wrap; gap: 6px }
.cs-toolbar,.cs-filters { padding: 9px 12px; justify-content: space-between }
.cs-toolbar { border-bottom: 1px solid var(--cs-line); background: linear-gradient(110deg,#fff,#f6f9ff) }
.cs-filters { justify-content: flex-start }
.cs-month input,.cs-filters input,.cs-filters select,.cs-field input,.cs-field select {
  box-sizing: border-box; width: auto; min-width: 0; min-height: 34px; padding: 5px 9px;
  border: 1px solid #c8d6e9; border-radius: 6px; color: var(--cs-ink); background: #fff; font: inherit;
}
.cs-month { gap: 0 }
.cs-month input { border-radius: 0; font-weight: 700; font-variant-numeric: tabular-nums }
.cs-filters input { width: min(190px,100%) }
.cs-actions button,.cs-month button,.cs-dialog button {
  min-height: 34px; padding: 4px 11px; border: 1px solid #c8d6e9; border-radius: 6px;
  background: #fff; color: var(--cs-ink); font: inherit; font-weight: 600; cursor: pointer;
}
.cs-month .cs-step { width: 33px; padding: 0; font-size: 19px; line-height: 1 }
#csPrev { border-right: 0; border-radius: 6px 0 0 6px }
#csNext { border-left: 0; border-radius: 0 6px 6px 0 }
#csToday { margin-left: 6px }
.cs-actions button:hover,.cs-month button:hover,.cs-dialog button:hover { background: #f0f6ff }
.cs-actions button,.cs-month button { font-size: 13px }
#csLeave,#csSubmit { background: #1164c7; color: #fff; border-color: #1164c7 }
#collectionScheduleView button:disabled { opacity: .46; cursor: default }
#csSummary { margin-inline-start: auto; font-size: 12px; color: var(--cs-muted); font-variant-numeric: tabular-nums }
#csStatus:not(:empty) { margin: 0; padding: 7px 12px; font-size: 13px; background: #edf5ff }
#csStatus:empty { display: none }
#csStatus.cs-error { background: #fff2e8; color: #8a4025 }
.cs-scroll {
  max-height: 70vh; min-height: 115px; overflow: auto; overscroll-behavior: contain; isolation: isolate;
  position: relative; scroll-padding-inline-start: var(--cs-worker-width); border-top: 1px solid var(--cs-line);
  scrollbar-color: #abbaCF #f4f7fc;
}
#csGrid { display: table; width: max-content; min-width: 100%; margin: 0; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 12px }
#csGrid th,#csGrid td {
  box-sizing: border-box; padding: 0; border: 0; border-right: 1px solid #e5edf5; border-bottom: 1px solid #e5edf5;
  background: #fff; color: var(--cs-ink); vertical-align: middle;
}
#csGrid thead th {
  position: sticky; top: 0; z-index: 2; width: var(--cs-day-width); min-width: var(--cs-day-width);
  height: 36px; background: #f2f6fc; font-variant-numeric: tabular-nums; text-align: center; white-space: nowrap;
}
#csGrid thead th span { margin-left: 4px; font-size: 11px; font-weight: 500 }
#csGrid th.cs-worker {
  position: sticky; left: 0; z-index: 1; width: var(--cs-worker-width); min-width: var(--cs-worker-width);
  max-width: var(--cs-worker-width); padding: 4px 9px; border-right-color: #cad7e8;
  background: #f9fbff; color: #1c3659; text-align: left; white-space: normal; overflow-wrap: anywhere;
}
#csGrid thead th.cs-worker { z-index: 3; background: #e9f0f9 }
#csGrid th.cs-sat { background: #eef5ff; color: #265eaa }
#csGrid th.cs-sun { background: #fff2f3; color: #a93f55 }
#csGrid th.cs-today { color: #fff; background: var(--cs-blue) }
#csGrid td.cs-current { box-shadow: inset 1px 0 #9bc2f6, inset -1px 0 #9bc2f6 }
#csGrid .cs-group-start:not(:first-child) > * { border-top: 1px solid #d4dfed }
.cs-worker-line { display: grid; grid-template-columns: minmax(24px,max-content) minmax(0,1fr) auto; align-items: center; gap: 6px }
.cs-rank-heading { text-align: center; color: var(--cs-muted); font-size: 10px; font-weight: 600 }
.cs-number {
  display: inline-grid; place-items: center; box-sizing: border-box; min-width: 24px; min-height: 21px; padding: 0 3px;
  border-radius: 5px; background: var(--cs-number-bg,#e8eef5); color: var(--cs-number-ink,#475c76);
  font-size: 11px; font-weight: 700; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.cs-identity { display: grid; min-width: 0; gap: 1px; line-height: 1.22 }
.cs-team,.cs-count { color: var(--cs-muted); font-size: 11px; font-weight: 500 }
.cs-team { display: block; line-height: 1.25 }
.cs-count { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums }
.cs-external-team {
  --cs-number-bg: hsl(var(--cs-team-hue) 38% 87%);
  --cs-number-ink: hsl(var(--cs-team-hue) 38% 28%);
}
#csGrid th.cs-external-team { background: hsl(var(--cs-team-hue) 40% 95%); box-shadow: inset 3px 0 hsl(var(--cs-team-hue) 33% 51%) }
#collectionScheduleView .cs-external-team .cs-team { color: var(--cs-number-ink) }
.cs-unassigned .cs-identity { grid-column: 2 }
#csGrid .cs-cell {
  display: flex; flex-direction: column; justify-content: center; align-items: stretch; gap: 2px; box-sizing: border-box;
  width: 100%; min-height: 33px; margin: 0; padding: 3px; border: 0; border-radius: 0; background: transparent;
  box-shadow: none; text-align: left; white-space: normal; cursor: pointer; color: inherit; font: inherit;
}
#csGrid td:has(.cs-cell:hover) { background: #f0f6ff }
#collectionScheduleView :focus-visible { outline: 2px solid #236dc2; outline-offset: -2px }
.cs-job,.cs-pending,.cs-off-label {
  display: block; box-sizing: border-box; border-radius: 4px; padding: 1px 4px; line-height: 17px; font-size: 11px;
  font-weight: 650; font-variant-numeric: tabular-nums;
}
.cs-job {
  max-width: calc(var(--cs-day-width) - 7px); overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  border-left: 2px solid #72a4e4; background: #e8f1ff; color: #244a78;
}
.cs-more { align-self: flex-end; padding-right: 3px; font-size: 10px; font-weight: 650; color: #3c618c; line-height: 13px }
#csGrid .cs-unassigned > * { background: #fffcf5 }
.cs-pending { background: #fff0c5; color: #77551a; text-align: center }
#csGrid td.cs-off { background: #f6f0ff }
.cs-off-label { align-self: flex-start; color: #634594; background: #e9dcfa }
.cs-dialog {
  box-sizing: border-box; width: min(450px,calc(100vw - 24px)); max-height: 85vh; overflow: auto;
  margin: auto; padding: 0; border: 1px solid var(--cs-line); border-radius: 12px; background: #fff; color: var(--cs-ink);
  box-shadow: 0 16px 60px #20375530;
}
.cs-dialog::backdrop { background: #10254261 }
.cs-dialog form { display: block; padding: 17px }
.cs-dialog-head,.cs-dialog-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px }
.cs-dialog-head h2 { font-size: 18px; margin: 0 }
.cs-dialog fieldset { display: grid; gap: 9px; margin: 13px 0; padding: 0; border: 0; min-width: 0 }
.cs-field { display: grid; gap: 4px; font-size: 13px; font-weight: 600 }
.cs-field[hidden] { display: none }
#csSubmit.cs-danger,.cs-dialog button.cs-danger { color: #93332e; border-color: #dcb7b3; background: #fff8f7 }
.cs-dialog button.cs-danger:disabled { opacity: .55 }
.cs-field input,.cs-field select { width: 100% }
.cs-field-note,.cs-detail-empty { margin: 0; color: var(--cs-muted); font-size: 13px }
.cs-detail { max-height: 34vh; overflow: auto }
.cs-detail-job { display: grid; gap: 2px; padding: 8px 0; border-top: 1px solid var(--cs-line); overflow-wrap: anywhere }
.cs-detail-job .cs-time { color: #21599b }
.cs-detail-job small,#csMessage { color: var(--cs-muted); font-size: 12px }
.cs-order-list { list-style: none; padding: 0 3px; margin: 0; overflow-y: auto; max-height: min(50vh,415px); overscroll-behavior: contain }
.cs-order-list li { display: flex; align-items: center; gap: 7px; min-height: 38px; padding: 2px 3px; border-bottom: 1px solid var(--cs-line) }
.cs-order-name { display: grid; flex: 1; min-width: 0; overflow-wrap: anywhere }
.cs-order-name small { color: var(--cs-muted); font-size: 11px }
.cs-grip { display: grid; place-items: center; width: 34px; min-height: 34px; border-radius: 4px; color: #557699; font-size: 21px; cursor: grab; touch-action: none; user-select: none }
.cs-grip:hover,.cs-order-list .cs-dragging { background: #edf4ff }
.cs-order-list [data-drop="before"] { box-shadow: inset 0 2px #3076c8 }
.cs-order-list [data-drop="after"] { box-shadow: inset 0 -2px #3076c8 }
.cs-order-list button { min-width: 34px; padding: 3px 7px }
@media (max-width: 640px) {
  #collectionScheduleView { --cs-worker-width: 124px; --cs-day-width: 96px }
  .cs-toolbar,.cs-filters { padding: 8px; gap: 7px }
  .cs-filters input { width: 139px }
  #csSummary { width: 100%; margin-left: 0 }
  #csGrid th.cs-worker { padding: 4px 6px }
  .cs-worker-line { column-gap: 4px }
  .cs-scroll { max-height: 66vh }
  .cs-actions { gap: 4px }
  .cs-actions button { padding-inline: 7px }
  .cs-actions button,.cs-month button,.cs-month input,.cs-dialog button,.cs-grip { min-height: 38px }
}
