.schedule-panel {
  transition: background-color 160ms ease, padding 160ms ease;
}

.schedule-fullscreen-button {
  color: var(--primary);
}

.schedule-fullscreen-button[hidden] {
  display: none;
}

.schedule-fullscreen-icon {
  flex: 0 0 auto;
  transition: transform 160ms ease;
}

.schedule-fullscreen-button:hover .schedule-fullscreen-icon {
  transform: scale(1.08);
}

.schedule-panel:fullscreen,
.schedule-panel.schedule-fullscreen-fallback {
  width: 100vw;
  height: 100vh;
  overflow: auto;
  border-radius: 0;
  background: var(--muted);
  padding: 24px;
}

.schedule-panel.schedule-fullscreen-fallback {
  position: fixed;
  z-index: 120;
  inset: 0;
}

.schedule-panel:fullscreen .schedule-grid,
.schedule-panel.schedule-fullscreen-fallback .schedule-grid {
  min-height: calc(100vh - 220px);
}

.schedule-panel:fullscreen .day-card,
.schedule-panel.schedule-fullscreen-fallback .day-card {
  min-height: calc(100vh - 230px);
}

.schedule-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.schedule-copy-action {
  justify-self: start;
}

.schedule-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(104px, 1fr));
  grid-column: 2;
  justify-self: center;
  min-width: 0;
  gap: 8px;
}

.schedule-nav .button {
  width: 100%;
  box-shadow: inset 0 0 0 1px rgb(15 23 42 / 0.08);
}

.schedule-nav .button:hover,
.schedule-nav .button:focus-visible {
  background: #fff;
  box-shadow: inset 0 0 0 1px rgb(11 58 120 / 0.24), 0 6px 14px rgb(15 23 42 / 0.06);
}

.schedule-toolbar .button {
  min-height: 38px;
  white-space: nowrap;
}

.schedule-publish {
  display: flex;
  flex: 0 0 auto;
  grid-column: 3;
  justify-self: end;
  margin: 0;
}

.schedule-grid {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.day-card {
  display: grid;
  min-width: 0;
  min-height: 310px;
  grid-template-rows: auto 1fr;
  border-right: 1px solid var(--border);
  background: #f8fafc;
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.day-card:last-child {
  border-right: 0;
}

.day-card.has-shifts {
  background: #fff;
}

.day-card-head {
  display: grid;
  gap: 2px;
  min-height: 84px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  padding: 12px;
}

.day-card-head span {
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.day-card-head strong {
  font-size: 26px;
  line-height: 1;
}

.day-card-head small {
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 800;
}

.day-card-body {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 8px;
  padding: 10px;
}

.day-card.drag-over {
  background: #eff6ff;
  box-shadow: inset 0 0 0 2px rgb(11 58 120 / 0.16);
}

.day-card.drag-over .day-card-body {
  background: rgb(11 58 120 / 0.035);
}

.schedule-empty {
  display: grid;
  min-height: 98px;
  place-items: center;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 800;
}

.shift-chip {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  gap: 7px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #fff;
  padding: 12px 9px 9px;
  font-size: 12px;
  line-height: 1.25;
  box-shadow: 0 8px 18px rgb(15 23 42 / 0.06), inset 0 1px 0 rgb(255 255 255 / 0.9);
  transition: box-shadow 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.shift-chip::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: var(--primary);
  content: "";
}

.shift-chip[data-shift-card] {
  cursor: grab;
  touch-action: none;
}

.shift-chip[data-shift-card]:active {
  cursor: grabbing;
}

.shift-chip:hover {
  box-shadow: 0 12px 24px rgb(15 23 42 / 0.12), inset 0 1px 0 rgb(255 255 255 / 0.9);
  transform: translateY(-1px);
}

.shift-chip.dragging,
.shift-chip.updating {
  opacity: 0.55;
  transform: scale(0.98);
}

.shift-drag-ghost {
  position: fixed;
  z-index: 50;
  width: 132px;
  pointer-events: none;
  opacity: 0.92;
  transform: translate(-50%, -50%) rotate(-1deg);
  box-shadow: 0 16px 34px rgb(15 23 42 / 0.22);
}

.shift-chip.draft {
  border-color: #f7d778;
  background: linear-gradient(180deg, #fffdf7 0%, #fff8df 100%);
}

.shift-chip.draft::before {
  background: var(--accent);
}

.shift-chip.published {
  border-color: #a7f3d0;
  background: linear-gradient(180deg, #f8fffb 0%, #ecfdf5 100%);
}

.shift-chip.published::before {
  background: var(--secondary);
}

.shift-chip strong,
.shift-chip-time,
.shift-chip-role {
  display: block;
  min-width: 0;
}

.shift-chip strong {
  color: #0f172a;
  font-size: 13px;
  line-height: 1.15;
  white-space: normal;
}

.shift-chip-time {
  align-self: flex-start;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.shift-chip-role {
  color: #334155;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.shift-chip-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.shift-chip-actions .badge {
  align-self: flex-start;
  border: 1px solid rgb(245 158 11 / 0.32);
  background: #fff;
  color: #92400e;
  padding: 3px 7px;
  font-size: 11px;
  letter-spacing: 0;
}

.shift-chip.published .badge {
  border-color: rgb(16 185 129 / 0.32);
  color: #047857;
}

.shift-card-buttons {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
  margin-left: auto;
}

.shift-icon-button {
  display: inline-grid;
  width: 26px;
  height: 26px;
  min-height: 26px;
  flex: 0 0 26px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  padding: 0;
  line-height: 1;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.shift-icon-button.edit {
  background: var(--primary);
  color: #fff;
}

.shift-icon-button.edit:hover {
  background: #082f63;
}

.shift-icon-button.delete {
  background: #fee2e2;
  color: #b91c1c;
}

.shift-icon-button.delete:hover {
  background: #fecaca;
  color: #991b1b;
}

.shift-icon-button:hover {
  transform: translateY(-1px);
}

.shift-icon-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgb(11 58 120 / 0.24);
}

.shift-icon-button.delete:focus-visible {
  box-shadow: 0 0 0 2px rgb(185 28 28 / 0.22);
}

.shift-action-icon {
  overflow: visible;
  pointer-events: none;
}

.square-pen-mark,
.delete-lid,
.delete-body,
.delete-line {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 170ms ease;
}

.shift-icon-button.edit:hover .square-pen-mark {
  animation: shift-pen-jiggle 440ms ease;
}

.shift-icon-button.delete:hover .delete-lid {
  transform: translateY(-1.1px);
}

.shift-icon-button.delete:hover .delete-body {
  transform: translateY(1px);
}

.shift-icon-button.delete:hover .delete-line {
  transform: translateY(0.5px);
}

@keyframes shift-pen-jiggle {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }

  28% {
    transform: translate(-1px, 1.5px) rotate(-1deg);
  }

  62% {
    transform: translate(1.5px, -1px) rotate(1deg);
  }
}

body.schedule-focus-mode {
  overflow: hidden;
}
