/* Compact mobile scheduling controls. Loaded after the shared design system. */
.schedule-form .form-field { margin-bottom: 16px; }
.schedule-form .sheet-body { padding-top: 16px; }
.schedule-form .field-help { font-size: .8125rem; line-height: 1.5; margin-top: 6px; }
.schedule-form .range-summary { margin: 6px 0 0; font-size: .8125rem; }
.custom-picker { position: relative; min-width: 0; }
.date-picker-trigger,
.area-picker-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; min-width: 0; min-height: 50px; padding: 11px 12px;
  border: 1px solid var(--input-line); border-radius: 11px;
  background: var(--surface); text-align: left; font-size: 1rem; line-height: 1.45;
}
.date-picker-trigger[aria-expanded="true"],
.area-picker-trigger[aria-expanded="true"] { border-color: var(--input-line); box-shadow: none; }
.date-picker-trigger[aria-expanded="true"] .picker-trigger-icon,
.area-picker-trigger[aria-expanded="true"] .picker-trigger-icon { color: var(--primary); }
.picker-trigger-value { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.date-picker-trigger .picker-trigger-value { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 8px; }
.picker-trigger-value > small { font-size: .8125rem; color: var(--muted); white-space: nowrap; font-weight: 400; }
.picker-trigger-icon { width: 19px; height: 19px; color: var(--muted); flex: none; }
.date-picker-dialog {
  position: fixed; inset: 0; width: min(calc(100vw - 24px), 400px); max-width: 400px;
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  margin: auto; padding: 12px; border: 0; border-radius: 20px;
  color: var(--ink); background: var(--surface); box-shadow: 0 16px 56px #17243b24;
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  opacity: 0; transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.date-picker-dialog.is-open { opacity: 1; transform: translateY(0); }
.date-picker-dialog.is-entering,
.date-picker-dialog.is-closing { opacity: 0; transform: translateY(12px); }
.date-picker-dialog::backdrop { background: #16233b66; opacity: 0; transition: opacity 180ms ease; }
.date-picker-dialog.is-open::backdrop { opacity: 1; }
.date-picker-dialog.is-closing::backdrop { opacity: 0; }
.date-picker-panel { margin: 0; padding: 0; border: 0; border-radius: 0; background: var(--surface); box-shadow: none; }
.area-picker-panel {
  position: fixed;
  /* Reset popover's UA inset so JavaScript owns its anchored position. */
  inset: auto;
  z-index: 60; display: flex; flex-direction: column;
  margin: 0; padding: 6px; min-width: 0; min-height: 0; max-width: calc(100vw - 24px);
  border: 1px solid var(--line); border-radius: 12px;
  color: var(--ink); background: var(--surface); box-shadow: 0 10px 28px #17243b1c;
  overflow: hidden; opacity: 0; transform: translateY(-5px); transform-origin: top center;
  transition: opacity 150ms ease, transform 150ms ease;
}
.area-picker-panel[popover]:not(:popover-open) { display: none; }
.area-picker-panel.opens-up { transform: translateY(5px); transform-origin: bottom center; }
.area-picker-panel.is-open { opacity: 1; transform: translateY(0); }
.area-picker-panel.is-closing { opacity: 0; transform: translateY(-5px); }
.area-picker-panel.opens-up.is-closing { transform: translateY(5px); }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.calendar-month { font-size: 1rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.calendar-nav {
  display: grid; place-items: center; width: 44px; height: 44px; min-width: 44px;
  padding: 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ink);
}
.calendar-nav .icon { width: 19px; height: 19px; }
.calendar-weekdays,
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; }
.calendar-week { display: contents; }
.calendar-weekdays { margin-bottom: 3px; color: var(--muted); font-size: .8125rem; text-align: center; }
.calendar-weekdays > * { display: grid; place-items: center; min-height: 28px; }
.calendar-cell { position: relative; display: grid; place-items: center; min-width: 0; height: 44px; isolation: isolate; }
.calendar-cell.is-range { background: linear-gradient(transparent 4px, var(--primary-soft) 4px, var(--primary-soft) calc(100% - 4px), transparent calc(100% - 4px)); }
.calendar-cell.is-start,
.calendar-cell.is-end,
.calendar-cell.is-single { background: transparent; }
.calendar-cell.is-start::before,
.calendar-cell.is-end::before {
  content: ""; position: absolute; top: 4px; bottom: 4px; background: var(--primary-soft); z-index: -1;
}
.calendar-cell.is-start::before { left: 50%; right: 0; }
.calendar-cell.is-end::before { left: 0; right: 50%; }
.calendar-cell.is-single::before { display: none; }
.calendar-day {
  position: relative; display: grid; place-items: center; width: min(40px, 100%); min-width: 0;
  height: 40px; min-height: 40px; padding: 0; margin: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink); font-size: .9375rem; font-weight: 500;
  font-variant-numeric: tabular-nums; touch-action: manipulation;
}
.calendar-cell.is-outside .calendar-day { color: var(--subtle); }
.calendar-cell.is-range .calendar-day { color: #234d9c; }
.calendar-cell.is-start .calendar-day,
.calendar-cell.is-end .calendar-day,
.calendar-cell.is-single .calendar-day { background: var(--primary); color: white; font-weight: 700; }
.calendar-cell.is-today .calendar-day::after {
  content: ""; position: absolute; bottom: 3px; left: calc(50% - 2px); width: 4px; height: 4px;
  border-radius: 50%; background: currentColor;
}
.calendar-day:focus-visible { outline: 0; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; z-index: 2; }
.calendar-day:disabled { opacity: .35; cursor: default; }
.calendar-status { min-height: 38px; padding: 9px 6px 7px; color: var(--muted); font-size: .8125rem; line-height: 1.5; overflow-wrap: anywhere; }
.calendar-status.is-error { color: var(--danger); }
.calendar-actions { display: flex; align-items: center; gap: 8px; padding: 7px 4px 1px; border-top: 1px solid var(--line); }
.date-picker-dialog .calendar-toolbar { position: sticky; top: -12px; z-index: 3; background: var(--surface); }
.date-picker-dialog .calendar-actions { position: sticky; bottom: -12px; z-index: 3; background: var(--surface); }
.calendar-actions button { min-height: 44px; padding: 9px 13px; border-radius: 9px; font-size: .875rem; font-weight: 600; }
.calendar-today { margin-right: auto; border: 0; color: var(--primary); background: transparent; }
.calendar-cancel { color: var(--muted); border: 1px solid var(--line); background: var(--surface); }
.calendar-apply { color: white; border: 1px solid var(--primary); background: var(--primary); min-width: 72px; }
.calendar-apply:disabled { border-color: transparent; }
.area-picker-search {
  width: 100%; min-height: 44px; padding: 9px 11px; margin: 0 0 6px; border: 1px solid var(--input-line);
  border-radius: 9px; background: var(--surface); font-size: 1rem; color: var(--ink); flex: none;
}
.area-picker-list { min-height: 0; max-height: 252px; overflow-y: auto; overscroll-behavior: contain; scroll-padding: 6px; }
.area-picker-option {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 48px;
  padding: 10px; border: 0; border-radius: 9px; background: transparent; text-align: left;
}
.area-picker-option + .area-picker-option { margin-top: 2px; }
.area-picker-option[aria-selected="true"] { color: var(--primary); background: transparent; }
.area-option-label { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: .9375rem; font-weight: 600; }
.area-option-time { flex: none; color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.area-option-check { flex: none; width: 18px; height: 18px; color: var(--primary); }
.area-option-check .icon { width: 18px; height: 18px; }
.picker-trigger-icon > .icon { width: 19px; height: 19px; }
.area-picker-empty { padding: 18px 10px; color: var(--muted); font-size: .875rem; text-align: center; }
.schedule-form .compact-area-summary {
  margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface-secondary);
}
.area-meta-row { display: flex; align-items: center; gap: 8px; min-height: 32px; margin: -6px -6px 1px 0; }
.area-meta-row > .field-label,
.area-meta-row > strong { margin: 0; font-size: .8125rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.area-reminder-inline { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; color: var(--primary); font-size: .8125rem; line-height: 1.4; font-variant-numeric: tabular-nums; }
.area-reminder-inline .icon { width: 15px; height: 15px; }
.compact-area-summary .area-content-edit { display: grid; place-items: center; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 12px; margin: 0; border: 0; border-radius: 8px; color: var(--primary); background: transparent; }
.compact-area-summary .area-content-edit .icon { width: 18px; height: 18px; }
.schedule-form .compact-area-summary .area-summary-content {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  width: 100%; min-height: 0; padding: 0; margin: 0; border: 0; border-radius: 5px;
  background: transparent; color: var(--ink); font-size: .875rem; line-height: 1.55;
  text-align: left; white-space: pre-line; overflow-wrap: anywhere;
}
.compact-area-summary .field-help { margin-top: 5px; font-size: .8125rem; line-height: 1.45; }
.schedule-form .compact-selected-people { display: flex; align-items: center; gap: 6px; margin: 6px 0; }
.schedule-form .compact-selected-people:empty { margin: 0; }
.compact-selected-people .person-chip { min-height: 44px; padding: 7px 9px; gap: 5px; border-radius: 8px; font-size: .8125rem; }
.compact-selected-people .person-chip .icon { width: 13px; height: 13px; }
.people-selected-summary { min-height: 44px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); font-size: .8125rem; }
.people-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 0; }
.people-tools .availability-notice { flex: 1; min-width: 0; padding: 5px 0; font-size: .8125rem; }
.people-filter { flex: none; min-height: 44px; padding: 8px 0 8px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: .8125rem; }
.people-filter[aria-pressed="true"] { color: var(--primary); font-weight: 650; }
.schedule-form .compact-employee-list { margin-top: 4px; max-height: 294px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.compact-employee-list .employee-item + .employee-item { border-top: 1px solid var(--line); }
.employee-line { display: flex; align-items: center; gap: 0; min-height: 48px; }
.compact-employee-list .employee-row {
  display: flex; align-items: center; flex: 1; gap: 9px; min-width: 0; min-height: 48px;
  padding: 7px 10px; margin: 0; border: 0; font-size: .875rem;
}
.compact-employee-list .employee-row > input { width: 19px; height: 19px; margin: 0; flex: none; }
.compact-employee-list .employee-info { display: block; flex: 1; min-width: 0; }
.compact-employee-list .employee-name-line { display: flex; align-items: baseline; justify-content: flex-start; gap: 7px; min-width: 0; }
.compact-employee-list .employee-name-line > strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9375rem; font-weight: 600; }
.compact-employee-list .employee-name-line > small { min-width: 0; max-width: 82px; margin: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; color: var(--muted); font-size: .8125rem; }
.employee-status {
  display: inline-flex; align-items: center; justify-content: flex-end; gap: 2px;
  min-height: 44px; min-width: 70px; flex: none; margin: 0; padding: 7px 10px 7px 4px;
  border: 0; border-radius: 7px; background: transparent; color: var(--warning); font-size: .8125rem; line-height: 1.4;
}
.employee-status .icon { width: 14px; height: 14px; }
.employee-status.is-free { color: var(--subtle); }
.employee-status.is-unknown { color: var(--muted); }
.employee-line:has(.employee-row.is-selected) { background: transparent; }
.employee-status[aria-expanded="true"] { color: var(--primary); }
.employee-assignment-panel { padding: 2px 12px 10px 38px; color: var(--muted); font-size: .8125rem; line-height: 1.55; }
.employee-assignment-panel ul { max-height: 160px; overflow: auto; margin: 0; padding-left: 16px; overscroll-behavior: contain; }
.employee-assignment-panel li { margin: 3px 0; overflow-wrap: anywhere; }
@media (max-width: 359px) {
  .date-picker-dialog { padding: 8px; }
  .date-picker-dialog .calendar-toolbar { top: -8px; }
  .date-picker-dialog .calendar-actions { bottom: -8px; }
  .date-picker-panel { padding: 0; }
  .calendar-toolbar { padding: 4px 5px 0; }
  .calendar-status { padding-left: 8px; padding-right: 8px; }
  .calendar-actions { margin: 0 4px 4px; }
  .date-picker-trigger { font-size: .9375rem; padding-left: 10px; padding-right: 10px; }
  .compact-employee-list .employee-name-line { gap: 5px; }
  .compact-employee-list .employee-name-line > small { max-width: 66px; }
  .employee-status { min-width: 66px; padding-right: 8px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .date-picker-dialog { max-height: calc(100dvh - 16px); }
  .calendar-grid .calendar-cell { height: 40px; }
  .calendar-day { height: 38px; min-height: 38px; }
  .schedule-form .compact-employee-list { max-height: 240px; }
}
@media (hover: hover) {
  .calendar-nav:hover, .calendar-today:hover, .area-picker-option:hover,
  .compact-area-summary .area-content-edit:hover, .employee-status:hover { background: transparent; color: var(--primary); }
  .area-picker-option:hover .area-option-label { text-decoration: underline; text-underline-offset: 4px; }
  .calendar-cell:not(.is-start):not(.is-end):not(.is-single) .calendar-day:hover { background: transparent; color: var(--primary); text-decoration: underline; text-underline-offset: 4px; }
}
.calendar-nav:focus-visible,
.area-content-edit:focus-visible,
.picker-trigger-icon:focus-visible { outline: 0; box-shadow: inset 0 -2px 0 currentColor; }
@media (prefers-reduced-motion: reduce) {
  .date-picker-dialog, .date-picker-dialog::backdrop, .area-picker-panel { transition: none; }
  .date-picker-dialog.is-entering, .date-picker-dialog.is-closing,
  .area-picker-panel, .area-picker-panel.opens-up, .area-picker-panel.is-closing { transform: none; }
}

/* Management roster: compact area navigation above the monthly coverage view. */
.roster-area-nav { position: relative; min-width: 0; max-width: 100%; margin-bottom: 14px; border-radius: 12px; overflow: hidden; }
.roster-area-nav::before,
.roster-area-nav::after {
  content: ""; position: absolute; top: 1px; bottom: 1px; z-index: 1; width: 18px;
  pointer-events: none; opacity: 0; transition: opacity var(--fast);
}
.roster-area-nav::before { left: 1px; background: linear-gradient(to right, var(--surface), #ffffff00); }
.roster-area-nav::after { right: 1px; background: linear-gradient(to left, var(--surface), #ffffff00); }
.roster-area-nav.has-more-left::before,
.roster-area-nav.has-more-right::after { opacity: 1; }
.roster-area-tabs {
  display: flex; flex-wrap: nowrap; align-items: stretch; gap: 1px; width: max-content; max-width: 100%; min-width: 0;
  margin: 0 0 14px; padding: 0; border: 1px solid var(--line); border-radius: 12px;
  overflow-x: auto; overflow-y: hidden; background: var(--line);
  scrollbar-width: none; overscroll-behavior-x: contain; touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch;
}
.roster-area-nav > .roster-area-tabs { margin: 0; }
.roster-area-tabs::-webkit-scrollbar { display: none; width: 0; height: 0; }
.roster-area-tab {
  position: relative; display: grid; grid-template-columns: 8px minmax(0, 1fr); align-content: center; align-items: center; gap: 2px 6px;
  flex: 0 0 auto; width: max-content; min-width: 48px; max-width: none; min-height: 48px; padding: 10px 12px;
  border: 0; border-radius: 0; background: var(--surface); color: var(--muted);
  font-size: .875rem; line-height: 1.45; text-align: left;
}
.roster-area-tab .area-marker { width: 8px; height: 8px; border-radius: 50%; opacity: .65; }
.roster-area-label { min-width: 0; white-space: nowrap; }
.roster-area-tab::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px;
  border-radius: 3px 3px 0 0; background: var(--primary); pointer-events: none;
  opacity: 0; transform: scaleX(.4); transition: opacity var(--fast), transform var(--fast);
}
.roster-area-tab[aria-selected="true"] { background: #e4edff; color: var(--primary-pressed); font-weight: 700; }
.roster-area-tab[aria-selected="true"]::after { opacity: 1; transform: scaleX(1); }
.roster-area-tab[aria-selected="true"] .area-marker { opacity: 1; transform: scale(1.2); }
.roster-area-tab:focus-visible .roster-area-label {
  text-decoration: underline; text-decoration-style: dotted; text-decoration-thickness: 2px; text-underline-offset: 4px;
}
.roster-area-tab:focus-visible { text-decoration: none; }
.roster-area-inactive { grid-column: 2; color: var(--subtle); font-size: .75rem; font-weight: 400; }
.roster-summary { display: flex; align-items: center; justify-content: flex-end; margin: 0 2px 6px; }
.roster-summary > :first-child { min-width: 0; }
.roster-summary-stats { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px 12px; font-size: .8125rem; line-height: 1.5; font-variant-numeric: tabular-nums; }
.roster-summary-stats > * { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.roster-summary-stats .icon { width: 14px; height: 14px; }
.roster-summary-stats strong { font-weight: 650; }
.roster-summary-stats .is-scheduled { color: var(--success); }
.roster-summary-stats .is-unscheduled { color: var(--muted); }
.roster-month-panel { padding: 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.roster-month-panel .month-toolbar { gap: 4px; margin-bottom: 6px; }
.roster-month-panel .month-control { min-width: 0; gap: 0; }
.roster-month-panel .month-control .icon-button { width: 44px; height: 44px; padding: 12px; }
.roster-month-panel .month-control .icon { width: 18px; height: 18px; }
.roster-month-panel .month-value { min-width: 88px; font-size: 1rem; }
.roster-month-panel .today-button { min-height: 44px; padding: 8px 4px; border: 0; background: transparent; font-size: .8125rem; }
.roster-calendar { width: 100%; min-width: 0; }
.roster-calendar-weekdays,
.roster-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); column-gap: 0; }
.roster-calendar-weekdays { margin-bottom: 2px; color: var(--muted); font-size: .8125rem; text-align: center; }
.roster-calendar-weekdays > * { display: grid; place-items: center; min-height: 28px; }
.roster-calendar-grid { row-gap: 3px; }
.roster-calendar-week { display: contents; }
.roster-calendar-cell { position: relative; min-width: 0; }
.roster-calendar-day {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  width: 100%; min-height: 60px; margin: 0; padding: 7px 0;
  border: 0; border-radius: 0; background: transparent; color: var(--ink);
  font-variant-numeric: tabular-nums; text-align: center; line-height: 1.25;
}
.roster-calendar-date { position: relative; font-size: 1rem; font-weight: 550; }
.roster-calendar-status { display: inline-flex; align-items: center; justify-content: center; gap: 2px; white-space: nowrap; font-size: .8125rem; line-height: 1.25; }
.roster-calendar-status .icon { width: 12px; height: 12px; stroke-width: 2.2; }
.roster-calendar-cell.is-scheduled .roster-calendar-status { color: var(--success); }
.roster-calendar-cell.is-unscheduled .roster-calendar-status { color: var(--subtle); }
.roster-calendar-cell.is-outside .roster-calendar-day { justify-content: flex-start; padding-top: 9px; color: #a1acbc; }
.roster-calendar-cell.is-outside .roster-calendar-date { font-weight: 400; }
.roster-calendar-cell.is-today .roster-calendar-date::after {
  content: ""; position: absolute; top: 1px; right: -7px; width: 4px; height: 4px;
  border-radius: 50%; background: var(--primary);
}
.roster-calendar-cell.is-selected .roster-calendar-date {
  color: var(--primary); font-weight: 750; text-decoration: underline;
  text-decoration-thickness: 2px; text-underline-offset: 3px;
}
.roster-calendar-day:focus-visible { text-decoration: none; }
.roster-calendar-day:focus-visible .roster-calendar-date {
  text-decoration: underline; text-decoration-style: dotted; text-decoration-thickness: 2px; text-underline-offset: 3px;
}
.roster-loading,
.roster-load-error { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 280px; padding: 24px 12px; color: var(--muted); font-size: .875rem; text-align: center; }
.roster-loading p,
.roster-load-error p { max-width: 100%; overflow-wrap: anywhere; }
.roster-load-error .field-help { margin: -4px 0 0; font-size: .8125rem; }
.roster-load-error .text-button { min-height: 44px; margin-top: 2px; }
.roster-day-detail { margin-top: 20px; }
.roster-day-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px; min-height: 44px; margin-bottom: 10px; }
.roster-day-heading > :first-child { min-width: 0; }
.roster-day-heading h2 { font-size: 1rem; line-height: 1.5; }
.roster-day-heading h2 > small { display: inline-block; margin-left: 8px; font-weight: 400; }
.roster-day-heading p,
.roster-day-heading small,
.roster-day-heading > span { color: var(--muted); font-size: .8125rem; line-height: 1.5; }
.roster-day-heading .text-button { min-height: 44px; padding: 8px 0 8px 8px; }
.roster-day-empty { padding: 22px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-align: center; }
.roster-day-empty > .icon { width: 24px; height: 24px; margin-bottom: 8px; color: var(--subtle); }
.roster-day-empty h3 { font-size: .9375rem; }
.roster-day-empty p { margin: 5px auto 0; max-width: 300px; color: var(--muted); font-size: .875rem; line-height: 1.6; }
.roster-day-empty .primary-button { margin-top: 14px; min-height: 44px; }
.roster-day-empty .text-button { margin-top: 8px; min-height: 44px; }
@media (max-width: 374px) {
  .roster-month-panel { padding-left: 4px; padding-right: 4px; }
}
@media (max-width: 359px) {
  .roster-month-panel { margin-left: -12px; margin-right: -12px; padding-left: 0; padding-right: 0; }
  .roster-month-panel .month-toolbar { padding-left: 6px; padding-right: 6px; }
  .roster-month-panel .roster-summary { padding-left: 12px; padding-right: 12px; }
}
@media (hover: hover) {
  .roster-area-tab:not([aria-selected="true"]):hover { background: var(--surface-secondary); color: var(--ink); }
  .roster-calendar-day:hover .roster-calendar-date { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
}

/* Compact management header, with navigation on the same white surface. */
.management-header { margin-bottom: 16px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); }
.management-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; }
.management-heading > :first-child { min-width: 0; }
.management-heading h1 { margin: 0; font-size: 1.5rem; line-height: 1.3; letter-spacing: -.025em; }
.management-heading p,
.management-heading small { display: block; margin: 3px 0 0; color: var(--muted); font-size: .8125rem; line-height: 1.45; }
.management-action { flex: none; margin: 0 0 0 auto; }
.management-action .primary-button,
.management-action .secondary-button,
.management-action .text-button { min-height: 44px; margin: 0; padding: 10px 12px; gap: 6px; border-radius: 10px; font-size: .875rem; line-height: 1.25; white-space: nowrap; }
.management-action .icon { width: 18px; height: 18px; }
.management-header .management-tabs { margin: 0; padding: 0 8px; border: 0; border-top: 1px solid var(--line); background: var(--surface); }
.management-header .management-tabs button { min-height: 44px; padding: 8px 6px 11px; }
.management-header .management-tabs button::after { bottom: 0; }

/* Monthly overview controls reuse the custom area picker. */
.overview-toolbar { margin-bottom: 12px; padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.overview-toolbar .month-toolbar { margin-bottom: 8px; gap: 4px; }
.overview-toolbar .month-control { gap: 0; min-width: 0; }
.overview-toolbar .month-control .icon-button { width: 44px; height: 44px; padding: 12px; }
.overview-toolbar .month-control .icon { width: 18px; height: 18px; }
.overview-toolbar .month-value { min-width: 88px; font-size: 1rem; }
.overview-toolbar .today-button { min-height: 44px; padding: 8px 4px; border: 0; background: transparent; font-size: .8125rem; }
.overview-filter-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.filter-area-picker { flex: 1; min-width: 0; max-width: 230px; }
.overview-count { flex: none; max-width: 35%; color: var(--muted); font-size: .8125rem; line-height: 1.45; text-align: right; font-variant-numeric: tabular-nums; }
.filter-area-picker .area-picker-trigger { min-height: 44px; padding: 9px 10px; gap: 8px; border-color: var(--line); border-radius: 10px; font-size: .875rem; }
.filter-area-picker .area-picker-trigger[aria-expanded="true"] { border-color: var(--line); box-shadow: none; }
.filter-area-picker .picker-trigger-value { display: block; flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.filter-area-picker .picker-trigger-icon { flex: none; }
.filter-area-picker .picker-trigger-icon .icon { width: 16px; height: 16px; }
.filter-area-picker .area-marker-all,
.area-filter-panel .area-marker-all { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 0; background: transparent; color: var(--muted); }
.filter-area-picker .area-marker-all .icon,
.area-filter-panel .area-marker-all .icon { width: 16px; height: 16px; }
.area-filter-panel { padding: 5px; border-radius: 12px; }
.area-filter-panel .area-picker-option { min-height: 44px; padding: 9px 8px; gap: 8px; border-radius: 7px; }
.area-filter-panel .area-picker-option + .area-picker-option { margin-top: 0; border-top: 1px solid #f1f3f7; }
.area-filter-panel .area-option-label { font-size: .875rem; font-weight: 500; line-height: 1.5; }
.area-filter-panel .area-picker-option[aria-selected="true"] { color: var(--ink); background: transparent; }
.area-filter-panel .area-picker-option[aria-selected="true"] .area-option-label { font-weight: 700; }
.area-filter-panel .area-option-check,
.area-filter-panel .area-option-check .icon { width: 16px; height: 16px; }

/* One scroll window contains all dates, areas and full employee names. */
.overview-scroll {
  position: relative; width: 100%; max-width: 100%; max-height: 65vh;
  max-height: min(65dvh, calc(100dvh - 180px - env(safe-area-inset-bottom)));
  overflow: auto; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); isolation: isolate; overscroll-behavior-x: contain;
  touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: #c8d1df transparent;
}
.overview-scroll:focus-visible { outline: 0; box-shadow: inset 0 -2px 0 var(--ink); }
.overview-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.overview-scroll::-webkit-scrollbar-thumb { border-radius: 6px; background: #c8d1df; }
.overview-scroll::-webkit-scrollbar-track { background: transparent; }
.overview-table { width: 100%; min-width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; color: var(--ink); background: var(--surface); font-size: .875rem; }
.overview-caption { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; }
.overview-table th,
.overview-table td { padding: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); vertical-align: top; }
.overview-table tr > :last-child { border-right: 0; }
.overview-table tbody tr:last-child > * { border-bottom: 0; }
.overview-table thead th { position: sticky; top: 0; z-index: 3; width: 112px; min-width: 112px; height: 48px; padding: 10px 8px; color: var(--muted); background: #f3f5f8; font-size: .8125rem; font-weight: 650; line-height: 1.5; text-align: center; vertical-align: middle; }
.overview-table thead th:first-child { left: 0; z-index: 5; width: 64px; min-width: 64px; }
.overview-area-name { display: block; min-width: 0; overflow-wrap: anywhere; }
.overview-area-name .area-marker { margin-right: 5px; }
.overview-area-status { display: block; margin-top: 2px; color: var(--subtle); font-size: .75rem; font-weight: 400; }
.overview-table .overview-date { position: sticky; left: 0; z-index: 2; width: 64px; min-width: 64px; padding: 8px 4px; color: var(--ink); background: var(--surface); text-align: center; font-weight: 400; vertical-align: middle; }
.overview-date time { display: flex; flex-direction: column; align-items: center; gap: 1px; font-variant-numeric: tabular-nums; }
.overview-day { font-size: 1rem; font-weight: 650; line-height: 1.3; }
.overview-weekday { color: var(--muted); font-size: .75rem; line-height: 1.4; }
.overview-today { display: block; margin-top: 3px; color: var(--primary); font-size: .75rem; font-weight: 600; line-height: 1.25; }
.overview-table .is-weekend > * { background: #f8fafc; }
.overview-table .is-today .overview-day { color: var(--primary); }
.overview-table .overview-cell { padding: 4px; }
.overview-assignment { display: block; width: 100%; min-width: 0; min-height: 44px; padding: 7px 6px; border: 0; border-radius: 6px; background: transparent; text-align: center; }
.overview-assignment + .overview-assignment { margin-top: 3px; border-top: 1px dashed var(--line); border-top-left-radius: 0; border-top-right-radius: 0; }
.overview-people { display: flex; flex-direction: column; align-items: stretch; gap: 2px; min-width: 0; }
.overview-person { display: block; white-space: normal; overflow-wrap: anywhere; font-size: .875rem; line-height: 1.5; }
.overview-missing-people { color: var(--warning); font-size: .8125rem; line-height: 1.5; }
.overview-empty { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 7px 2px; color: var(--subtle); font-size: .8125rem; line-height: 1.5; }
.overview-assignment:focus-visible { text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
@media (max-width: 359px) {
  .management-heading { gap: 8px; padding-left: 12px; padding-right: 12px; }
  .management-action .primary-button,
  .management-action .secondary-button,
  .management-action .text-button { padding-left: 10px; padding-right: 10px; }
  .overview-toolbar { padding-left: 8px; padding-right: 8px; }
  .overview-filter-row { gap: 8px; }
}
@media (hover: hover) {
  .overview-assignment:hover { color: var(--primary); }
  .overview-assignment:hover .overview-person { text-decoration: underline; text-underline-offset: 3px; }
}
