.schedule-page .page-heading {
  align-items: center;
}
.schedule-pending {
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--warning);
  border-radius: 6px;
  background: var(--surface);
}
.schedule-pending h2 {
  margin: 0 0 9px;
  font-size: 12px;
  font-weight: 600;
}
.schedule-pending ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.schedule-pending li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 0;
}
.schedule-pending li + li {
  border-top: 1px solid var(--border);
}
.schedule-pending li > div {
  display: flex;
  flex-wrap: wrap;
  column-gap: 12px;
  row-gap: 4px;
  min-width: 0;
}
.schedule-pending strong {
  font-size: 12px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.schedule-pending span {
  font-size: 11px;
  color: var(--muted);
}
.schedule-pending button {
  white-space: nowrap;
  flex-shrink: 0;
}
.schedule-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--border);
}
.schedule-navigation,
.schedule-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.schedule-navigation {
  flex: 1 1 auto;
}
.schedule-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 33px;
  border: 1px solid var(--border);
  border-radius: 5px;
  white-space: nowrap;
}
.schedule-nav-link:hover {
  background: var(--surface-hover);
  text-decoration: none;
}
.schedule-period {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 0 5px;
  white-space: nowrap;
}
.schedule-period > span {
  color: var(--muted);
  padding: 0 3px;
}
.schedule-controls > input {
  width: 190px;
  min-width: 140px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-input);
  color: var(--text);
  padding: 7px 10px;
  font-size: 12px;
}
.schedule-controls > input::placeholder {
  color: var(--muted);
}
.schedule-controls > label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.schedule-controls > label input {
  accent-color: var(--accent);
  margin: 0;
}
.schedule-table {
  min-width: 890px;
}
.schedule-table th,
.schedule-table td {
  padding: 11px 16px;
}
.schedule-table thead th {
  font-size: 11px;
}
.schedule-table .schedule-day th {
  padding: 9px 16px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface-raised);
}
.schedule-day th > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 24px;
}
.schedule-day th > div > span {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}
.schedule-day time {
  color: var(--muted);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.schedule-day small {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
}
.schedule-day button {
  padding: 3px 0 3px 8px;
  color: var(--muted);
  font-size: 11px;
}
.schedule-today th {
  box-shadow: inset 3px 0 var(--accent);
}
.schedule-shift td {
  vertical-align: top;
  font-size: 12px;
}
.schedule-shift td:first-child {
  min-width: 160px;
}
.schedule-shift td:first-child strong {
  font-size: 12px;
  font-weight: 600;
}
.schedule-time {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.schedule-time small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}
.schedule-notes {
  min-width: 180px;
  max-width: 380px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--muted);
}
.schedule-notes small {
  display: block;
  margin-top: 5px;
}
.schedule-overtime {
  color: var(--warning);
  font-weight: 600;
}
.schedule-cancelled td {
  color: var(--muted);
}
.schedule-cancelled td:first-child strong,
.schedule-cancelled .schedule-time {
  text-decoration: line-through;
  text-decoration-color: var(--border-strong, var(--muted));
}
.schedule-cancelled-label {
  display: block;
  color: var(--red);
  font-size: 10px;
  margin-top: 4px;
}
.schedule-row-actions {
  text-align: right;
  white-space: nowrap;
  width: 1%;
}
.schedule-row-actions button {
  padding: 1px 0 3px 10px;
  font-size: 11px;
}
.schedule-row-actions .schedule-cancel {
  color: var(--muted);
  font-weight: 400;
}
.schedule-row-actions .schedule-cancel:hover {
  color: var(--red);
}
.schedule-day-empty td {
  font-size: 11px;
  color: var(--muted);
  padding: 13px 16px 17px;
}
.schedule-empty {
  color: var(--muted);
  font-size: 12px;
  padding: 30px 16px !important;
}
.schedule-summary {
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.schedule-week + .schedule-week {
  border-top: 1px solid var(--border);
}
.schedule-week-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border);
}
.schedule-week-heading h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .02em;
}
dialog:has(.schedule-copy-form) { width:min(1120px,calc(100vw - 30px)); max-width:calc(100vw - 30px); }
.schedule-copy-form > p { color:var(--muted); font-size:12px; }
.schedule-copy-form .table-wrap { max-height:58vh; overflow:auto; border:1px solid var(--border); border-radius:5px; }
.schedule-copy-form .schedule-table { min-width:960px; }
.schedule-copy-form .schedule-table th { position:sticky; top:0; z-index:1; background:var(--surface-raised); }
.schedule-copy-form .schedule-table th,.schedule-copy-form .schedule-table td { padding:9px 10px; font-size:12px; vertical-align:top; }
.schedule-copy-form input:not([type=checkbox]),.schedule-copy-form textarea { border:1px solid var(--border); border-radius:4px; padding:6px 7px; font:inherit; background:var(--surface-input); color:var(--text); width:100%; min-width:0; }
.schedule-copy-form input[type=date] { min-width:125px; }
.schedule-copy-form input[type=time] { min-width:85px; margin-top:5px; }
.schedule-copy-form textarea { min-width:155px; min-height:67px; resize:vertical; }
.schedule-copy-form input[type=checkbox] { accent-color:var(--accent); }
.schedule-copy-form td small { display:block; margin-top:5px; color:var(--warning); font-size:10px; }
.schedule-copy-form .schedule-form-actions { margin-top:16px; }
.schedule-copy-form .field { display:block; position:relative; margin:0; }
.schedule-copy-form .field > span { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.schedule-copy-form .schedule-table th { text-transform:none; letter-spacing:0; font-weight:500; }
.schedule-copy-form .schedule-table th:nth-child(1) { width:42px; }
.schedule-copy-form .schedule-table th:nth-child(2) { width:150px; }
.schedule-copy-form .schedule-table th:nth-child(3),.schedule-copy-form .schedule-table th:nth-child(4) { width:170px; }
.schedule-copy-form .schedule-table th:nth-child(5) { width:92px; }
.schedule-copy-form .schedule-table td:nth-child(5) input { width:72px; }
.schedule-week-heading > button { flex-shrink:0; font-size:11px; }
@media(max-width:700px) { .schedule-week-heading { flex-wrap:wrap; } .schedule-week-heading > button { margin-left:auto; } }
.schedule-week-heading > span {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.schedule-roster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  margin: 0 0 16px;
}
.schedule-roster h2 { margin: 0; font-size: 12px; font-weight: 600; }
.schedule-roster p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.schedule-roster-people { display: flex; flex-wrap: wrap; gap: 7px; }
.schedule-person {
  padding: 7px 10px;
  font-size: 11px;
  background: var(--surface);
  border-color: var(--border);
  cursor: grab;
}
.schedule-person:active { cursor: grabbing; }
.schedule-person[aria-pressed="true"] {
  border-color: var(--employee-color);
  background: color-mix(in srgb, var(--employee-color) 13%, var(--surface));
}
.schedule-person:disabled { cursor: default; opacity: .8; }
.schedule-roster .schedule-roster-status { flex-basis: 100%; margin: 0; color: var(--accent); }
.schedule-roster-status:empty { display: none; }
.schedule-history { position: relative; font-size: 11px; }
.schedule-history > summary { padding: 7px 9px; cursor: pointer; color: var(--muted); }
.schedule-history-list {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: 4;
  width: min(340px, 75vw);
  max-height: 310px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  box-shadow: 0 8px 22px rgb(0 0 0 / 15%);
}
.schedule-history-list a { display: block; padding: 10px 12px; color: var(--text); text-decoration: none; }
.schedule-history-list a + a { border-top: 1px solid var(--border); }
.schedule-history-list a:hover,
.schedule-history-list a[aria-current="page"] { background: var(--surface-hover); }
.schedule-history-list strong { display: block; font-size: 11px; font-weight: 600; }
.schedule-history-list span { display: block; margin-top: 4px; font-size: 10px; color: var(--muted); }
.schedule-history-list p { padding: 12px; margin: 0; color: var(--muted); }
.schedule-grid-table {
  width: 100%;
  min-width: 1000px;
  table-layout: fixed;
  border-collapse: collapse;
}
.schedule-grid-table th,
.schedule-grid-table td {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  text-align: left;
  padding: 10px 9px;
}
.schedule-grid-table tr > :last-child { border-right: 0; }
.schedule-grid-table tbody tr:last-child > * { border-bottom: 0; }
.schedule-grid-table thead th {
  position: relative;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  padding-bottom: 9px;
}
.schedule-grid-table .schedule-employee-heading {
  width: 140px;
  padding-left: 16px;
}
.schedule-grid-table .schedule-day > span {
  display: block;
  margin-bottom: 4px;
}
.schedule-grid-table .schedule-day > time {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}
.schedule-grid-table .schedule-day > small {
  margin-left: 7px;
  color: var(--accent);
  font-size: 9px;
}
.schedule-grid-table .schedule-day > button {
  position: absolute;
  top: 6px;
  right: 5px;
  padding: 0 5px;
  font-size: 15px;
  line-height: 22px;
  color: var(--muted);
}
.schedule-grid-table .schedule-day.schedule-today {
  box-shadow: inset 0 2px var(--accent);
}
.schedule-day-captions:empty { display: none; }
.schedule-day-captions small {
  display: block;
  color: var(--warning);
  font-size: 9px;
  line-height: 1.4;
  margin-top: 5px;
  overflow-wrap: anywhere;
}
.schedule-grid-table .schedule-employee {
  padding: 13px 12px 12px 16px;
  background: var(--surface);
  white-space: normal;
  overflow: hidden;
  position: sticky;
  left: 0;
  z-index: 1;
  box-shadow: 1px 0 var(--border);
}
.schedule-employee strong {
  font-size: 11px;
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
}
.schedule-employee-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 7px 2px 0;
  border-radius: 2px;
  background: var(--employee-color);
}
.schedule-grid-table td { position: relative; height: 70px; padding-bottom: 27px; }
.schedule-grid-table .schedule-drop-target {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}
.schedule-cell-add {
  position: absolute;
  bottom: 4px;
  right: 6px;
  padding: 0 5px;
  font-size: 14px;
  line-height: 19px;
  color: var(--muted);
  opacity: 0;
}
td:hover > .schedule-cell-add,
.schedule-cell-add:focus-visible { opacity: 1; }
@media (hover: none) { .schedule-cell-add { opacity: 1; } }
.schedule-grid-table .schedule-has-shift {
  background: color-mix(in srgb, var(--employee-color) 9%, var(--surface));
}
.schedule-grid-shift {
  border-left: 2px solid var(--employee-color);
  padding: 0 0 0 7px;
}
.schedule-grid-shift + .schedule-grid-shift { margin-top: 10px; }
.schedule-grid-shift .schedule-time {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: normal;
}
.schedule-grid-shift .schedule-time small {
  font-size: 9px;
  font-weight: 400;
  margin-top: 3px;
}
.schedule-grid-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 6px;
  font-size: 9px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
}
.schedule-grid-shift .schedule-notes {
  min-width: 0;
  max-width: none;
  font-size: 10px;
  line-height: 1.4;
  margin: 5px 0 0;
}
.schedule-grid-shift .schedule-row-actions {
  display: flex;
  gap: 8px;
  text-align: left;
  width: auto;
  white-space: normal;
  margin-top: 6px;
}
.schedule-grid-shift .schedule-row-actions button {
  padding: 0;
  font-size: 9px;
  line-height: 1.4;
}
.schedule-off {
  color: var(--muted);
  font-size: 10px;
  opacity: .65;
}
.schedule-grid-shift.schedule-cancelled { opacity: .65; }
.schedule-grid-shift.schedule-cancelled .schedule-time { text-decoration: line-through; }
.schedule-continuation-label {
  display: block;
  font-size: 9px;
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 3px;
}
.schedule-form {
  min-width: min(570px, 75vw);
}
.schedule-form .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.schedule-form .schedule-dates {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
}
.schedule-form textarea {
  resize: vertical;
  min-height: 68px;
}
.schedule-duration {
  margin: -3px 0 17px;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.schedule-employee-field {
  position: relative;
}
.schedule-employee-field > small {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  color: var(--muted);
}
.schedule-employee-results {
  position: absolute;
  z-index: 2;
  top: 65px;
  left: 0;
  right: 0;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  box-shadow: 0 8px 22px rgb(0 0 0 / 10%);
  max-height: 220px;
  overflow-y: auto;
}
.schedule-employee-results[hidden] {
  display: none;
}
.schedule-employee-results button {
  display: block;
  width: 100%;
  padding: 10px 11px;
  border: 0;
  border-radius: 0;
  font-size: 12px;
  text-align: left;
  background: transparent;
}
.schedule-employee-results button + button {
  border-top: 1px solid var(--border);
}
.schedule-employee-results button:hover {
  background: var(--surface-hover);
}
.schedule-employee-results strong {
  font-weight: 500;
}
.schedule-form-message {
  margin: 14px 0;
  color: var(--warning);
  font-size: 12px;
  line-height: 1.6;
}
.schedule-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.schedule-form-actions > span {
  flex: 1;
}
.schedule-form-actions > [data-schedule-discard] {
  padding-left: 0;
}
.schedule-cancel-form {
  min-width: min(400px, 70vw);
}
.schedule-cancel-form > p {
  font-size: 13px;
  line-height: 1.7;
  margin-top: 0;
  margin-bottom: 18px;
}
.schedule-access {
  padding: 18px;
  font-size: 13px;
}
.schedule-access a {
  color: var(--accent);
  font-size: 12px;
}
@media (max-width: 700px) {
  .schedule-page .page-heading {
    align-items: start;
  }
  .schedule-toolbar {
    padding: 12px;
  }
  .schedule-controls {
    width: 100%;
  }
  .schedule-controls > input {
    flex: 1;
  }
  .schedule-period {
    font-size: 11px;
    padding: 0;
  }
  .schedule-navigation {
    gap: 6px;
  }
  .schedule-form,
  .schedule-cancel-form {
    min-width: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .schedule-page *,
  .schedule-form * {
    scroll-behavior: auto;
  }
}
