/* 日別編集画面専用のスクロール制御 */
body.day-edit-page {
  height: 100vh;
  overflow: hidden;
  margin: 0;
  padding: 0;
  background-color: #e1e4ef;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

body.day-edit-page html {
  height: 100vh;
  overflow: hidden;
}

/* 日別編集画面でもナビゲーションを表示 */

body.day-edit-page .main-content {
  min-height: calc(100vh - 60px);
}

/* 日別情報フォームのスタイル */
.day-form-container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 10px;
  box-sizing: border-box;
  height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  background-color: #e1e4ef;
}

/* ヘッダー部分（日付ナビゲーション） */
.day-form__header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
  gap: 12px;
  flex-wrap: wrap;
}

.day-form__title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #27364d;
  margin: 0;
  text-align: center;
  letter-spacing: 0.01em;
}

/* ナビゲーションボタン */
.day-form__nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 108px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(113, 138, 179, 0.32);
  border-radius: 999px;
  color: #41546f;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 6px 18px rgba(126, 142, 170, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.day-form__nav-button:hover {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(79, 127, 224, 0.34);
  color: #2f4f8f;
  box-shadow: 0 10px 24px rgba(103, 122, 158, 0.18);
  transform: translateY(-1px);
}

.day-form__nav-button:active {
  transform: translateY(0);
  box-shadow: 0 5px 14px rgba(103, 122, 158, 0.16);
}

.day-form__nav-icon {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
}

.day-form__nav-label {
  line-height: 1;
}

.day-form__nav-button--prev {
  margin-right: 0;
}

.day-form__nav-button--next {
  margin-left: 0;
}

.day-form {
  background-color: transparent;
  padding: 0px;
  border-radius: 6px;
  position: static;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.day-edit-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.day-edit-shell__tabs {
  flex-shrink: 0;
}

.day-edit-shell__content {
  min-height: 0;
}

.day-pane {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.day-pane--full {
  padding: 16px;
}

.day-pane--map {
  padding: 16px;
  min-height: 0;
}

/* エラー表示 */
.day-form__errors {
  background-color: #f8d7da;
  color: #721c24;
  padding: 8px;
  border-radius: 3px;
  margin: 15px 15px 10px 15px;
  border: 1px solid #f5c6cb;
}

.day-form__errors h3 {
  margin: 0 0 10px 0;
  font-size: 1rem;
}

/* タブナビゲーション - Chrome風デザイン */
.tab-navigation {
  display: flex;
  gap: 12px;
  padding: 0;
  margin: 0;
  position: relative;
  align-items: flex-end;
  background: transparent;
}

.tab-navigation__button {
  flex: 1;
  position: relative;
  padding: 16px 24px 18px;
  background: #edf1f6;
  border: none;
  border-radius: 12px 12px 0 0;
  color: #4b5563;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  margin-top: 6px;
}

.tab-navigation__button-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1;
  width: 100%;
}

.tab-navigation__lock-icon {
  display: none;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
  object-fit: contain;
  flex-shrink: 0;
}

.tab-navigation__button-title {
  line-height: 1.2;
}

.tab-navigation__step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 999px;
  background: #94a3b8;
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
}

.tab-navigation__button--active .tab-navigation__step-badge {
  background: #4f7fe0;
}

.tab-navigation__button:hover:not(.tab-navigation__button--active) {
  background: #f1f4f8;
  color: #374151;
}

.tab-navigation__button[aria-disabled="true"],
.tab-navigation__button--disabled {
  background: #eef2f5;
  color: #9ca3af;
  cursor: not-allowed;
  box-shadow: inset 0 0 0 1px #d9e0e7;
}

.tab-navigation__button[aria-disabled="true"]:hover,
.tab-navigation__button--disabled:hover {
  background: #eef2f5;
  color: #9ca3af;
}

.tab-navigation__button[aria-disabled="true"] .tab-navigation__lock-icon,
.tab-navigation__button--disabled .tab-navigation__lock-icon {
  display: inline-flex;
  opacity: 0.75;
}

.tab-navigation__button[aria-disabled="true"] .tab-navigation__step-badge,
.tab-navigation__button--disabled .tab-navigation__step-badge {
  background: #b8c2cf;
}

.tab-navigation__button--disabled-by-setup {
  background: linear-gradient(180deg, #f7f9fb 0%, #eef2f5 100%);
}

.tab-navigation__button--active {
  background: white;
  color: #315fbb;
  font-weight: 600;
  padding-top: 22px;
  margin-top: 0;
}

.tab-navigation__button--active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  border-radius: 12px 12px 0 0;
  background: #4f7fe0;
}

.tab-navigation__button--active:hover {
  background: white;
  color: #315fbb;
}

/* タブコンテンツ */
.tab-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin-top: 0;
  position: relative;
}

.tab-pane {
  display: none;
  flex: 1;
  overflow-y: auto;
  background: white;
  border-radius: 0 12px 12px 12px;
  box-shadow: none;
  padding-top: 0;
  border: none;
}

.tab-pane--active {
  display: flex;
  flex-direction: column;
  animation: tabFadeIn 0.15s ease-in;
}

@keyframes tabFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.day-form__errors ul {
  margin: 0;
  padding-left: 20px;
}

/* セクション */
.day-form__section {
  margin-bottom: 15px;
  padding: 12px;
  background-color: #f8f9fa;
  border-radius: 4px;
  border-left: 3px solid #007bff;
}

.day-form__section-title {
  font-size: 1rem;
  font-weight: bold;
  color: #333;
  margin: 0 0 8px 0;
}

/* フィールド行 */
.day-form__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}

/* フィールド */
.day-form__field {
  margin-bottom: 10px;
}

.day-form__label {
  display: block;
  font-weight: bold;
  color: #333;
  margin-bottom: 3px;
  font-size: 0.85rem;
}

.day-form__input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #ced4da;
  border-radius: 3px;
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.day-form__input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.day-form__input--number {
  max-width: 80px;
}

.day-form__input[readonly] {
  background-color: #e9ecef;
  cursor: not-allowed;
}

.day-form__textarea {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #ced4da;
  border-radius: 3px;
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.day-form__textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* ボタン */
.day-form__actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 15px;
  padding-top: 10px;
  border-top: 1px solid #e9ecef;
}

/* セクション内のボタン */
.day-form__actions--in-section {
  border-top: 1px solid #fd7e14;
  margin-top: 15px;
  padding-top: 15px;
}

/* 古いCSSクラスは削除されました */

.day-form__field--room {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.day-form__label--room {
  font-size: 0.75rem;
  color: #495057;
  margin: 0;
}

.day-form__input--room {
  width: 100%;
  max-width: 60px;
  padding: 4px 6px;
  font-size: 0.85rem;
}

.accommodation-section {
  padding: 15px;
  background-color: #e9ecef;
  border-radius: 5px;
}

.accommodation-section__title {
  margin: 0 0 10px 0;
  font-size: 1rem;
  color: #333;
  font-weight: bold;
}

.day-form__button,
input[type="submit"].day-form__button,
a.day-form__button {
  padding: 8px 16px;
  border: none;
  border-radius: 3px;
  font-size: 0.9rem;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 80px;
  height: 45px;
  box-sizing: border-box;
  line-height: 1;
}

.day-form__button--primary {
  background-color: #007bff;
  color: white;
}

.day-form__button--primary:hover:not(:disabled) {
  background-color: #0056b3;
  color: white;
}

.day-form__button--primary:not(:disabled) {
  animation: button-pulse 2s infinite;
}

@keyframes button-pulse {
  0% {
    background-color: #007bff;
  }
  50% {
    background-color: #0056b3;
  }
  100% {
    background-color: #007bff;
  }
}

.day-form__button--primary:disabled {
  background-color: #6c757d;
  color: #adb5bd;
  cursor: not-allowed;
  opacity: 0.65;
  animation: none;
}

.day-form__button--secondary {
  background-color: #6c757d;
  color: white;
}

.day-form__button--secondary:hover {
  background-color: #545b62;
  color: white;
}

.day-form__button--danger {
  background-color: #dc3545;
  color: white;
}

.day-form__button--danger:hover {
  background-color: #c82333;
  color: white;
}

.day-form__button--shift {
  background-color: #28a745;
  color: white;
  margin-top: 10px;
}

.day-form__button--shift:hover {
  background-color: #218838;
  color: white;
}

/* インポートセクション */
.import-section {
  margin-bottom: 0;
  padding: 12px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 6px;
  border: 1px solid #dee2e6;
}

.import-section__title {
  font-size: 1rem;
  font-weight: bold;
  color: #495057;
  margin: 0 0 10px 0;
  text-align: center;
}

.import-section__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 0;
}

.import-dropzone {
  background: white;
  border: 2px dashed #ced4da;
  border-radius: 4px;
  padding: 8px 6px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.import-dropzone:hover {
  border-color: #007bff;
  background-color: #f8f9ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.import-dropzone--excel:hover {
  border-color: #28a745;
  background-color: #f8fff9;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.15);
}

.import-dropzone--csv:hover {
  border-color: #17a2b8;
  background-color: #f8fdff;
  box-shadow: 0 4px 12px rgba(23, 162, 184, 0.15);
}

.import-dropzone.import-dropzone--dragover {
  border-color: #007bff;
  background-color: #e7f3ff;
  border-style: solid;
}

.import-dropzone--excel.import-dropzone--dragover {
  border-color: #28a745;
  background-color: #e7f5e7;
}

.import-dropzone--csv.import-dropzone--dragover {
  border-color: #17a2b8;
  background-color: #e7f7f9;
}

.import-dropzone__content {
  width: 100%;
}

.import-dropzone__icon {
  margin-bottom: 6px;
}

.import-dropzone__svg {
  color: #6c757d;
  transition: color 0.3s ease;
  width: 24px;
  height: 24px;
}

.import-dropzone--excel .import-dropzone__svg {
  color: #28a745;
}

.import-dropzone--csv .import-dropzone__svg {
  color: #17a2b8;
}

.import-dropzone:hover .import-dropzone__svg {
  transform: scale(1.1);
}

.import-dropzone__title {
  font-size: 0.85rem;
  font-weight: bold;
  margin: 0 0 3px 0;
  color: #495057;
}

.import-dropzone--excel .import-dropzone__title {
  color: #28a745;
}

.import-dropzone--csv .import-dropzone__title {
  color: #17a2b8;
}

.import-dropzone__description {
  font-size: 0.7rem;
  color: #6c757d;
  margin: 0 0 6px 0;
}

.import-dropzone__actions {
  margin-bottom: 6px;
}

.import-dropzone__button {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 1px 2px rgba(0, 123, 255, 0.2);
}

.import-dropzone__button--excel {
  background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
  box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.import-dropzone__button--csv {
  background: linear-gradient(135deg, #17a2b8 0%, #117a8b 100%);
  box-shadow: 0 2px 4px rgba(23, 162, 184, 0.2);
}

.import-dropzone__button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.import-dropzone__button--excel:hover {
  box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.import-dropzone__button--csv:hover {
  box-shadow: 0 4px 8px rgba(23, 162, 184, 0.3);
}

.import-dropzone__hint {
  font-size: 0.65rem;
  color: #6c757d;
  margin: 2px 0 0 0;
  font-style: italic;
}

.import-dropzone__input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.import-section__divider {
  text-align: center;
  position: relative;
  margin: 20px 0;
}

.import-section__divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, #dee2e6, transparent);
}

.import-section__divider-text {
  background: #f8f9fa;
  padding: 0 20px;
  color: #6c757d;
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
}

/* layout.pngに合わせた新しいレイアウト */

/* 2カラムレイアウト */
.day-form__two-column-layout {
  display: flex;
  width: 100%;
  gap: 20px;
  box-sizing: border-box;
  flex: 1;
  overflow: hidden;
  height: 100%;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  margin-bottom: 20px;
}

.day-pane--map .day-form__two-column-layout {
  margin-bottom: 0;
}

/* 左カラム：スタッフリスト */
.day-form__left-column {
  display: flex;
  flex-direction: column;
  gap: 0px;
  background-color: transparent;
  padding: 0px;
  border-radius: 8px;
  width: 50%;
  box-sizing: border-box;
  height: 100%;
  overflow-y: auto;
}

/* 右カラム：データ管理と配置枠 */
.day-form__right-column {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 50%;
  box-sizing: border-box;
  height: 100%;
  overflow-y: auto;
}

/* シフト情報EXCELインポート */
.import-section--shift {
  border: 2px solid #28a745;
  background: linear-gradient(135deg, #f8fff9 0%, #e6f7e6 100%);
}

.import-section--shift .import-section__title {
  color: #28a745;
  font-weight: bold;
}

/* 支配人くんCSVインポート */
.import-section--csv {
  border: 2px solid #17a2b8;
  background: linear-gradient(135deg, #f8fdff 0%, #e6f7f9 100%);
}

.import-section--csv .import-section__title {
  color: #17a2b8;
  font-weight: bold;
}

/* シフト情報表示エリア */
.shift-info-section {
  border: 2px solid #007bff;
  background: linear-gradient(135deg, #f8f9ff 0%, #e6f0ff 100%);
  border-radius: 6px;
  padding: 15px;
  min-height: 200px;
}

.shift-info__title {
  font-size: 1.1rem;
  font-weight: bold;
  color: #007bff;
  margin: 0 0 10px 0;
  text-align: center;
  padding-bottom: 8px;
  border-bottom: 1px solid #007bff;
}

.shift-info__content {
  color: #495057;
  text-align: center;
  padding: 20px;
}

/* 食事数とか宿泊数とか */
.meal-stay-section {
  border: 2px solid #fd7e14;
  background: linear-gradient(135deg, #fff8f0 0%, #ffeee6 100%);
  border-radius: 6px;
  padding: 15px;
}

.meal-stay__title {
  font-size: 1.1rem;
  font-weight: bold;
  color: #fd7e14;
  margin: 0 0 15px 0;
  text-align: center;
  padding-bottom: 8px;
  border-bottom: 1px solid #fd7e14;
}

/* 仕事の枠（右カラム下部） */
.work-section {
  margin-top: 15px;
}

/* インポートセクションの基本スタイル */
.import-section {
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 0;
}

.import-section__title {
  font-size: 1.1rem;
  font-weight: bold;
  margin: 0 0 15px 0;
  text-align: center;
  padding-bottom: 8px;
  border-bottom: 1px solid currentColor;
}

/* 各セクション内のフォーム調整 */
.meal-stay-section .day-form__section {
  background: transparent;
  border: none;
  padding: 0;
  margin-bottom: 10px;
}

.meal-stay-section .day-form__section:last-child {
  margin-bottom: 0;
}

/* メインコンテンツエリアの旧スタイルを無効化 */
.day-form__main-content {
  display: none;
}

.day-form__left-section {
  display: none;
}

.day-form__right-section {
  display: none;
}

.day-form__bottom-section {
  display: none;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .day-form-container {
    padding: 5px;
  }
  
  .day-form {
    padding: 10px;
  }
  
  .day-form__title {
    font-size: 1.2rem;
    margin-bottom: 10px;
  }
  
  .day-form__two-column-layout {
    flex-direction: column;
    gap: 15px;
  }
  
  .day-form__left-column,
  .day-form__right-column {
    width: 100%;
  }
  
  .day-form__row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .day-form__actions {
    flex-direction: row;
    gap: 6px;
  }
  
  .day-form__button {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
  
  .import-section__grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .import-dropzone {
    padding: 6px 4px;
    min-height: 60px;
  }
  
  .import-section {
    padding: 8px;
  }
  
  /* モバイルでは縦並びに */
  .day-form__top-section {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .shift-info-section,
  .work-section {
    min-height: 120px;
  }

  .work-section__title,
  .shift-info__title,
  .meal-stay__title {
    font-size: 1rem;
  }

  /* データ管理セクションのモバイル対応 */
  .data-management-section {
    padding: 10px;
  }

  .data-management-section__title {
    font-size: 1rem;
  }

  .data-management-section__subtitle {
    font-size: 0.85rem;
  }

  /* 宿泊データのモバイル対応 */
  .accommodation-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .accommodation-label {
    min-width: 35px;
    font-size: 11px;
    padding: 4px 2px;
  }

.accommodation-input {
  width: 40px;
  flex: 0 0 40px;
  font-size: 12px;
  padding: 4px 2px;
}

.accommodation-select {
  min-width: 72px;
  flex: 0 0 auto;
  padding: 4px 6px;
}

.accommodation-select option {
  font-size: 12px;
}

  .csv-import-content {
    flex-direction: column;
    gap: 8px;
  }
  
  .import-dropzone--compact {
    width: 100%;
    height: 50px;
    flex-direction: row;
  }
  
  .csv-top-row {
    flex-direction: column;
    gap: 10px;
  }
  
  .meal-fields-row {
    flex-direction: column;
    gap: 8px;
  }
  
  .info-fields-horizontal {
    flex-direction: column;
    gap: 8px;
  }
  
  .import-dropzone--mini {
    width: 100%;
    justify-content: center;
  }
  
  .day-form__bottom-section {
    gap: 15px;
  }
}

/* フィールド更新時のハイライト */
.field-updated {
  background-color: #fff3cd !important;
  border-color: #ffc107 !important;
  animation: highlight 0.5s ease-in-out;
}

input.field-updated[type='time'] {
  background-color: #fff3cd !important;
  border-color: #ffc107 !important;
  -webkit-text-fill-color: #212529 !important;
  color: #212529 !important;
  appearance: none;
}

input.field-updated[type='time']::-webkit-datetime-edit,
input.field-updated[type='time']::-webkit-datetime-edit-fields-wrapper,
input.field-updated[type='time']::-webkit-datetime-edit-hour-field,
input.field-updated[type='time']::-webkit-datetime-edit-minute-field,
input.field-updated[type='time']::-webkit-datetime-edit-text,
input.field-updated[type='time']::-webkit-calendar-picker-indicator {
  background-color: #fff3cd !important;
}

@keyframes highlight {
  0% {
    background-color: #fff3cd;
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    background-color: #fff3cd;
    transform: scale(1);
  }
}

/* インポート成功メッセージ */
.import-success-message {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
  padding: 12px 20px;
  border-radius: 4px;
  margin: 10px 0;
  font-size: 14px;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.import-success-message.fade-out {
  animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* タイムテーブルページのレイアウト */
.day-form-container,
.schedule-page {
  --day-action-button-bg: #4f7cf7;
  --day-action-button-hover-bg: #3d68df;
}

.schedule-page {
  background-color: #ffffff;
  padding: 16px 20px;
  min-height: 100vh;
  box-sizing: border-box;
  color: #333333;
}

.schedule-page--embedded {
  min-height: auto;
  padding: 0;
}

.day-timetable-panel {
  padding-bottom: 48px;
}

.schedule-page__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.schedule-page__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  flex: 1 1 auto;
}

.schedule-page__print-button,
.publish-control__form button {
  background-color: var(--day-action-button-bg);
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
}

.schedule-page__print-button:hover,
.publish-control__form button:hover {
  background-color: var(--day-action-button-hover-bg);
}

.publish-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 6px 12px;
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}

.publish-control__status-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.publish-control__label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #4b5563;
}

.publish-control__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.publish-control__badge--published {
  background-color: #d1fae5;
  color: #065f46;
}

.publish-control__badge--unpublished {
  background-color: #fee2e2;
  color: #991b1b;
}

.publish-control__sync-note {
  font-size: 0.72rem;
  color: #6b7280;
}

.publish-control__form {
  margin: 0;
}

.publish-control__form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  background-color: var(--day-action-button-bg);
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.publish-control__form button:hover {
  background-color: var(--day-action-button-hover-bg);
}

.publish-control--schedule {
  margin-left: auto;
}

.schedule-page__print-hint {
  font-size: 0.75rem;
  color: #555555;
  margin: 0 0 10px;
}


.schedule-day-summary {
  margin: 12px 0 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 4px 28px;
}

.schedule-day-summary__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.schedule-day-summary__item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.8rem;
  line-height: 1.2;
  color: #343a40;
}

.schedule-day-summary__item-label {
  font-weight: 600;
  color: #495057;
}

.schedule-day-summary__item-value {
  font-weight: 700;
  color: #212529;
}

.schedule-shift-section {
  margin-top: 10px;
  margin-bottom: 18px;
}

.schedule-shift-section__title {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 700;
  color: #343a40;
}

.schedule-page__empty-message {
  font-size: 0.9rem;
  color: #666666;
  margin: 10px 0;
}

.schedule-page__empty-message--locked {
  padding: 18px 20px;
  border: 1px solid #fecaca;
  border-radius: 10px;
  background-color: #fff7f7;
  color: #991b1b;
  font-weight: 600;
}

.schedule-shift-section:first-of-type {
  margin-top: 12px;
}

.schedule-inline-list {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px 24px;
}

.schedule-inline-list + .schedule-inline-list {
  margin-top: 8px;
}

.schedule-inline-block {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 8px;
  min-width: 0;
  max-width: 100%;
  font-size: 0.85rem;
  line-height: 1.45;
}

.schedule-inline-block__label {
  font-weight: 700;
  color: #343a40;
  white-space: nowrap;
}

.schedule-inline-block__separator {
  font-weight: 600;
  color: #6b7280;
  white-space: nowrap;
}

.schedule-inline-block__content {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  min-width: 0;
}

.schedule-inline-block__entry {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}

.schedule-inline-block__time {
  font-size: 0.75rem;
  font-weight: 600;
  color: #495057;
}

.schedule-inline-block__name {
  font-size: 0.85rem;
  color: #212529;
}

.schedule-inline-block__memo {
  font-size: 0.8rem;
  color: #6b7280;
}

.schedule-inline-block__empty {
  margin: 0;
  color: #666666;
  font-size: 0.8rem;
}

.schedule-group-table {
  border-top: 1px solid #e5e7eb;
  border-left: 1px solid #e5e7eb;
  border-radius: 0;
  background-color: #ffffff;
}

.schedule-group-block + .schedule-group-block {
  margin-top: 10px;
}

.schedule-group-block__title {
  margin-bottom: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #1f2937;
}

.schedule-group-table__row {
  display: block;
  padding: 0;
  font-size: 0.8rem;
  line-height: 1.35;
  --schedule-group-row-height: 36px;
}

.schedule-group-table__group-line {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  width: 100%;
}

.schedule-group-table__cell {
  display: inline-flex;
  align-items: stretch;
  gap: 6px;
  margin: 0;
  width: max-content;
  max-width: 100%;
  min-width: 0;
  min-height: var(--schedule-group-row-height);
  padding: 6px 14px;
  background-color: transparent;
  border-right: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
  flex: 1 0 auto;
  box-sizing: border-box;
}

.schedule-group-table__job {
  display: flex;
  align-items: center;
  align-self: center;
  flex: 0 0 auto;
  font-weight: 700;
  color: #1f2937;
  white-space: nowrap;
  padding-right: 4px;
}

.schedule-group-table__entries {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 14px;
  max-width: 100%;
  min-width: 0;
  margin-left: 2px;
  padding-left: 8px;
}

.schedule-group-table__entry {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  max-width: 100%;
  min-width: 0;
  white-space: nowrap;
}

.schedule-group-table__time {
  font-size: 0.72rem;
  font-weight: 700;
  color: #4b5563;
  white-space: nowrap;
}

.schedule-group-table__name {
  color: #111827;
  white-space: nowrap;
}

.schedule-group-table__memo {
  font-size: 0.72rem;
  color: #4b5563;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.schedule-group-table__empty {
  display: inline-flex;
  align-items: center;
  min-height: 100%;
  margin: 0;
  color: #6b7280;
  font-size: 0.76rem;
}

@media (max-width: 768px) {
  .schedule-page {
    padding: 12px;
  }

  .day-pane--full,
  .day-pane--map {
    padding: 12px;
  }

  .schedule-page__header {
    gap: 6px;
  }

  .publish-control--schedule {
    margin-left: 0;
    width: 100%;
  }

  .schedule-day-summary__list {
    gap: 10px 20px;
  }

  .schedule-day-summary__item {
    font-size: 0.75rem;
  }

  .schedule-shift-section {
    margin-bottom: 0px;
  }

  .schedule-shift-section__title {
    margin-bottom: 6px;
  }

  .schedule-inline-list {
    display: block;
  }

  .schedule-inline-list + .schedule-inline-list {
    margin-top: 10px;
  }

  .schedule-inline-block {
    display: flex;
    margin-bottom: 6px;
  }

  .schedule-inline-block:last-child {
    margin-bottom: 0;
  }

  .schedule-group-table__row {
    padding: 6px 8px;
    --schedule-group-row-height: auto;
  }

  .schedule-group-table__group-line {
    display: block;
    width: auto;
  }

  .schedule-group-table__cell {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 4px;
    margin-right: 0;
    width: auto;
    max-width: none;
    min-height: 0;
    padding: 6px 0;
    border-right: none;
  }

  .schedule-group-table__job {
    padding-right: 0;
  }
}

@page {
  size: A4 portrait;
  margin: 4mm;
}

@media print {
  body {
    background-color: #ffffff;
    font-size: 12px;
  }

  body.day-edit-page {
    height: auto;
    overflow: visible;
    background-color: #ffffff;
  }

  body.day-edit-page .main-navigation,
  body.day-edit-page .flash-messages,
  body.day-edit-page .day-form__header,
  body.day-edit-page .day-edit-shell__tabs {
    display: none !important;
  }

  body.day-edit-page .main-content,
  body.day-edit-page .day-form-container,
  body.day-edit-page .day-form,
  body.day-edit-page .day-edit-shell,
  body.day-edit-page .day-edit-shell__content,
  body.day-edit-page .tab-pane,
  body.day-edit-page .tab-pane--active,
  body.day-edit-page .day-pane,
  body.day-edit-page .day-pane--full {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  body.day-edit-page .day-form-container,
  body.day-edit-page .day-pane--full,
  body.day-edit-page .tab-pane {
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
  }

  body.day-edit-page .day-form-container {
    display: block;
  }

  .schedule-page {
    padding: 0;
  }

  .day-timetable-panel {
    padding-bottom: 0;
  }

  .schedule-page__header {
    margin-bottom: 4px;
  }

  .schedule-page__print-button,
  .schedule-page__print-hint,
  .publish-control {
    display: none;
  }

  .schedule-day-summary {
    margin: 8px 0 10px;
  }

  .schedule-day-summary__list {
    gap: 3px 16px;
  }

  .schedule-shift-section {
    margin-top: 0px;
    margin-bottom: 10px;
  }

  .schedule-shift-section__title {
    margin-bottom: 4px;
    font-size: 0.95rem;
  }

  .schedule-shift-section__title {
    display: none;
  }

  .main-content {
    height: auto !important;
    overflow: visible !important;
  }

  .schedule-page__title {
    font-size: 1.05rem;
    margin-bottom: 0;
  }

  .schedule-inline-list {
    gap: 2px 18px;
  }

  .schedule-inline-list + .schedule-inline-list {
    margin-top: 4px;
  }

  .schedule-inline-block {
    gap: 1px 6px;
    font-size: 0.75rem;
    line-height: 1.35;
  }

  .schedule-inline-block__content {
    gap: 1px 10px;
  }

  .schedule-inline-block__entry {
    gap: 3px;
  }

  .schedule-inline-block__time {
    font-size: 0.7rem;
  }

  .schedule-inline-block__name {
    font-size: 0.75rem;
  }

  .schedule-inline-block__memo {
    font-size: 0.7rem;
  }

  .schedule-group-table {
    border-radius: 0;
  }

  .schedule-group-block + .schedule-group-block {
    margin-top: 10px;
  }

  .schedule-group-block__title {
    margin-bottom: 2px;
    font-size: 0.68rem;
  }

  .schedule-group-table__row {
    padding: 0;
    font-size: 0.68rem;
    line-height: 1.2;
    --schedule-group-row-height: 28px;
  }

  .schedule-group-table__group-line {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
  }

  .schedule-group-table__cell {
    display: inline-flex;
    align-items: stretch;
    gap: 3px;
    width: max-content;
    max-width: 100%;
    min-width: 0;
    white-space: nowrap;
    flex: 1 0 auto;
    min-height: var(--schedule-group-row-height);
    padding: 2px 8px;
    background-color: transparent;
    border-right: 1px solid #e5e7eb;
    box-sizing: border-box;
  }

  .schedule-group-table__job,
  .schedule-group-table__name,
  .schedule-group-table__time {
    white-space: nowrap;
  }

  .schedule-group-table__entries {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1px 10px;
    gap: 1px 6px;
    min-width: 0;
  }

  .schedule-group-table__entry {
    gap: 2px;
    white-space: nowrap;
  }

  .schedule-group-table__time {
    font-size: 0.62rem;
  }

  .schedule-group-table__memo {
    font-size: 0.6rem;
  }
}

/* ドラッグオーバー時のスタイル */
.import-dropzone--drag-over {
  background-color: #e3f2fd;
  border-color: #2196f3;
}

.import-dropzone--drag-over .import-dropzone__icon {
  color: #2196f3;
}

/* データ管理セクション */
.data-management-section {
  padding: 0px;
  border-radius: 8px 8px 0 0;
  position: relative;
  background: transparent;
}


/* 食事データセクション */
.meal-data-section {
  background-color: #ffffff;
  border-radius: 0 0 8px 8px;
  padding: 15px 15px 0 15px;
  margin-bottom: 0;
}

.meal-data-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 10px;
  padding-bottom: 5px;
  gap: 15px;
}

/* フロア凡例 */
.floor-legend {
  display: flex;
  gap: 10px;
  align-items: center;
  flex: 1;
  justify-content: flex-start;
}

.floor-legend__item {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 500;
}

.floor-legend__item--1f {
  background-color: rgba(255, 182, 193, 0.3);
  color: #d1477a;
}

.floor-legend__item--2f {
  background-color: rgba(144, 238, 144, 0.3);
  color: #228b22;
}

.floor-legend__item--4f {
  background-color: rgba(135, 206, 250, 0.3);
  color: #4682b4;
}

.floor-legend__item--5f {
  background-color: rgba(221, 160, 221, 0.3);
  color: #8b4789;
}

.floor-legend__item--outdoor {
  background-color: rgba(255, 218, 185, 0.3);
  color: #cd853f;
}

/* CSVインポートボタン */
.csv-import-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background-color: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  color: #555;
  cursor: pointer;
  transition: all 0.2s ease;
}

.csv-import-button:hover {
  background-color: #e9ecef;
  border-color: #aaa;
  color: #333;
}

.csv-import-button svg {
  flex-shrink: 0;
}

/* CSVインポートボタン成功状態 */
.csv-import-button--success {
  background-color: #d4edda !important;
  border-color: #c3e6cb !important;
  color: #155724 !important;
  animation: successPulse 0.3s ease;
}

.csv-import-button--success:hover {
  background-color: #d4edda !important;
  border-color: #c3e6cb !important;
  color: #155724 !important;
}

/* CSVインポートボタン警告状態（未保存） */
.csv-import-button--warning {
  background-color: #fff3cd !important;
  border-color: #ffeaa7 !important;
  color: #856404 !important;
  animation: successPulse 0.3s ease;
}

.csv-import-button--warning:hover {
  background-color: #fff3cd !important;
  border-color: #ffeaa7 !important;
  color: #856404 !important;
}

@keyframes successPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* 食事入力コンテナ */
.meal-inputs-container {
  display: flex;
  gap: 20px;
  width: 100%;
}

.meal-input-section {
  flex: 1;
  min-width: 0;
}

.meal-input-title {
  font-size: 14px;
  font-weight: 600;
  color: #555;
  margin: 0 0 12px 0;
}

.meal-room-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  column-gap: 12px;
  position: relative;
}

.meal-room-grid--spaced {
  margin-top: 12px;
  margin-bottom: 2px;
}

.meal-room-grid--two-columns {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.meal-room-field {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-width: 0;
  width: 100%;
}

.meal-room-label {
  font-size: 11px;
  color: #666;
  width: 48px;
  text-align: right;
  flex-shrink: 0;
  padding: 6px 4px;
  white-space: nowrap;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  box-sizing: border-box;
}

.meal-room-label--start-time {
  width: 70px;
  white-space: normal;
  text-align: right;
  justify-content: flex-end;
}

.meal-room-input {
  flex: 1;
  padding: 6px 4px;
  border: 1px solid #ddd;
  border-left: none;
  border-radius: 0 4px 4px 0;
  font-size: 13px;
  text-align: left;
  transition: all 0.2s ease;
  width: auto;
  min-width: 0;
}

.meal-room-input--start-time {
  flex: 0 0 82px;
  min-width: 82px;
  max-width: 82px;
  width: 82px;
  height: 30px;
  min-height: 30px;
  line-height: 16px;
  box-sizing: border-box;
}

select.meal-room-input.meal-room-input--start-time {
  height: 30px !important;
  min-height: 30px !important;
}

.meal-room-input:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

/* フロア別の背景色とボーダー色 */
.meal-room-field--1f .meal-room-label {
  background-color: rgba(255, 182, 193, 0.3);
  border-radius: 3px 0 0 3px;
  color: #d1477a;
  padding: 6px 6px;
  border-color: rgba(255, 182, 193, 0.3);
  border-right: none;
}

.meal-room-field--1f .meal-room-input {
  border-color: rgba(255, 182, 193, 0.5);
}

.meal-room-field--2f .meal-room-label {
  background-color: rgba(144, 238, 144, 0.3);
  border-radius: 3px 0 0 3px;
  color: #228b22;
  padding: 6px 6px;
  border-color: rgba(144, 238, 144, 0.3);
  border-right: none;
}

.meal-room-field--2f .meal-room-input {
  border-color: rgba(144, 238, 144, 0.5);
}

.meal-room-field--4f .meal-room-label {
  background-color: rgba(135, 206, 250, 0.3);
  border-radius: 3px 0 0 3px;
  color: #4682b4;
  padding: 6px 6px;
  border-color: rgba(135, 206, 250, 0.3);
  border-right: none;
}

.meal-room-field--4f .meal-room-input {
  border-color: rgba(135, 206, 250, 0.5);
}

.meal-room-field--5f .meal-room-label {
  background-color: rgba(221, 160, 221, 0.3);
  border-radius: 3px 0 0 3px;
  color: #8b4789;
  padding: 6px 6px;
  border-color: rgba(221, 160, 221, 0.3);
  border-right: none;
}

.meal-room-field--5f .meal-room-input {
  border-color: rgba(221, 160, 221, 0.5);
}

.meal-room-field--outdoor .meal-room-label {
  background-color: rgba(255, 218, 185, 0.3);
  border-radius: 3px 0 0 3px;
  color: #cd853f;
  padding: 6px 6px;
  border-color: rgba(255, 218, 185, 0.3);
  border-right: none;
}

.meal-room-field--outdoor .meal-room-input {
  border-color: rgba(255, 218, 185, 0.5);
}

/* 食事オプション（座席・うかい）の簡易レイアウト */
.meal-option-inline {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.meal-option-inline__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #555;
  cursor: pointer;
}

.meal-option-inline__checkbox {
  width: 16px;
  height: 16px;
}

.meal-option-inline__text {
  font-size: 12px;
}

/* チェックボックス変更時の強調表示 */
.meal-option-inline__text--changed {
  color: #c57a00;
  font-weight: 600;
}

/* 宿泊・その他セクション */
.accommodation-section {
  background-color: #ffffff;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
}

.accommodation-title {
  font-size: 14px;
  font-weight: 600;
  color: #555;
  margin: 0 0 15px 0;
}

.accommodation-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.accommodation-grid__row {
  display: flex;
  flex-wrap: wrap;
  column-gap: 12px;
  row-gap: 6px;
}

.accommodation-field {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-width: 0;
}

.accommodation-label {
  font-size: 11px;
  color: #666;
  text-align: right;
  flex: 0 0 auto;
  padding: 6px 10px;
  background-color: rgba(128, 128, 128, 0.2);
  border-radius: 3px 0 0 3px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  box-sizing: border-box;
  border: 1px solid rgba(128, 128, 128, 0.2);
  border-right: none;
}

.accommodation-label--toki-no-kura {
  background-color: rgba(255, 218, 185, 0.5);
  border-color: rgba(255, 218, 185, 0.8);
  color: #cd853f;
}

.accommodation-label--lunch-only {
  background-color: #e8f5e9;
  border-color: #c8e6c9;
  color: #43a047;
}

.accommodation-label--dinner-only {
  background-color: #e3f2fd;
  border-color: #bbdefb;
  color: #1e88e5;
}

.accommodation-label--compact {
  width: 64px;
  min-width: 64px;
  max-width: 64px;
  padding-left: 6px;
  padding-right: 6px;
  white-space: nowrap;
}

.meal-room-label--start-time.accommodation-label--compact {
  width: 70px;
  min-width: 70px;
  max-width: 70px;
}

.accommodation-input {
  flex: 1;
  padding: 6px 4px;
  border: 1px solid rgba(128, 128, 128, 0.2);
  border-left: none;
  border-radius: 0 4px 4px 0;
  font-size: 13px;
  text-align: left;
  width: auto;
  min-width: 0;
  transition: all 0.2s ease;
}

.accommodation-select {
  min-width: 90px;
  width: auto;
  padding: 6px 8px;
  text-align: left;
  border-left: none;
}

.accommodation-input--compact {
  width: 76px;
  min-width: 60px;
  max-width: 80px;
  flex: 0 0 72px;
}

.accommodation-input--start-time {
  width: 82px;
  min-width: 72px;
  max-width: 82px;
  flex: 0 0 82px;
}

.accommodation-label--toki-no-kura + .accommodation-input {
  border-color: rgba(255, 218, 185, 0.8);
}

.accommodation-label--lunch-only + .accommodation-input {
  border-color: rgba(103, 178, 111, 0.5);
}

.accommodation-label--dinner-only + .accommodation-input {
  border-color: rgba(100, 149, 237, 0.5);
}

/* 朝食開始時間セレクトの変更時スタイル */
.accommodation-select--changed {
  color: #c57a00;
  font-weight: 600;
}

.accommodation-input:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

/* フッターセクション */
.data-management-footer {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding-bottom: 40px;
}

.notes-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.notes-label {
  display: block;
  font-size: 13px;
  color: #666;
  margin-bottom: 6px;
}

.notes-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  resize: none;
  height: 44px;
  font-family: inherit;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.notes-textarea:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

/* アクションボタン */
.action-buttons {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  justify-content: center;
  width: 100%;
  margin-bottom: 0;
}

.action-buttons .action-button {
  flex: 0 0 auto;
  width: auto;
}

/* 最終更新日時の表示行 */
.data-management-footer__updated-at {
  margin-top: 8px;
  text-align: center;
  font-size: 12px;
  color: #666666;
}

.data-management-footer__loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  color: #2e5d8b;
  font-size: 13px;
  font-weight: 600;
}

.data-management-footer__loading[hidden] {
  display: none;
}

.data-management-footer__loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #c7dbf3;
  border-top-color: #4a90e2;
  border-radius: 50%;
  animation: data-management-spin 0.8s linear infinite;
}

.action-button {
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-button--primary {
  background-color: #4a90e2;
  color: white;
  position: relative;
}

.action-button--primary:not(:disabled):after {
  content: '↓';
  position: absolute;
  right: -20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: #4a90e2;
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(-50%);
  }
  50% {
    transform: translateY(-30%);
  }
}

/* 更新ボタンの脈動アニメーション */
.action-button--pulse {
  animation: pulse 3s infinite ease-in-out;
  box-shadow: none !important;
}

.action-button--pulse.action-button--primary {
  animation: pulse-color 3s infinite ease-in-out;
}

@keyframes pulse-color {
  0% {
    background-color: #2e5d8b;
  }
  50% {
    background-color: #5fa3f0;
  }
  100% {
    background-color: #2e5d8b;
  }
}

/* 未保存警告バナー */
.unsaved-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #fff3cd;
  border: 1px solid #ffeaa7;
  color: #856404;
  padding: 10px 15px;
  border-radius: 6px;
  margin: 0 15px 15px 15px;
  font-size: 14px;
  font-weight: 500;
  animation: slideIn 0.3s ease-out;
}

.unsaved-warning svg {
  flex-shrink: 0;
  color: #f39c12;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes data-management-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.action-button--primary:hover:not(:disabled) {
  background-color: #357abd;
}

.action-button--primary:disabled {
  background-color: #b3c8e6;
  cursor: not-allowed;
}

.action-button--loading {
  min-width: 180px;
}

.action-button--secondary {
  background-color: #f8f9fa;
  color: #555;
  border: 1px solid #ddd;
}

.action-button--secondary:hover {
  background-color: #e9ecef;
  border-color: #aaa;
  color: #333;
}

/* CSVインポートボタンのドラッグオーバースタイル */
.csv-import-button--drag-over {
  background-color: #e3f2fd !important;
  border-color: #2196f3 !important;
  color: #1976d2 !important;
}

/* データ管理メッセージ表示 */
#data-management-message {
  margin-bottom: 15px;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
}

#data-management-message.message--success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

#data-management-message.message--error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

#data-management-message.message--warning {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

/* 変更されたフィールドのスタイル */
.day-form__input--changed,
.day-form__textarea--changed {
  background-color: #fff3cd;
  border-color: #ffc107;
  box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.25);
}

/* 未保存の変更メッセージ */
.unsaved-changes-message {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
}

/* 担当配置マップヘッダー */
/* department-frames-containerの更新アニメーション */
.department-frames-container.updating {
  animation: department-update 1s ease-in-out;
  pointer-events: none;
}

@keyframes department-update {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.3;
    transform: scale(0.98);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.unsaved-changes-message::before {
  content: "⚠";
  font-size: 1.1rem;
}

.data-management-section__divider {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, #dee2e6, transparent);
  margin: 15px 0;
}

/* CSVインポート部分 */
.csv-import-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.csv-top-row {
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.meal-fields-row {
  display: flex;
  gap: 10px;
  flex: 1;
}

.csv-drop-mini {
  flex-shrink: 0;
}

.import-dropzone--mini {
  padding: 8px 12px;
  border: 2px dashed #17a2b8;
  border-radius: 4px;
  background-color: #f8fdff;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #17a2b8;
  min-width: 130px;
  height: 60px;
  min-height: unset;
  text-align: center;
  box-sizing: border-box;
}

.import-dropzone--mini:hover {
  border-color: #138496;
  background-color: #e6f7f9;
  transform: translateY(-1px);
}

.import-dropzone--mini svg {
  flex-shrink: 0;
}

.notes-field {
  display: flex;
  flex-direction: column;
}

/* 情報フィールド横並び */
.info-fields-horizontal {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.info-fields-horizontal .day-form__field {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.info-fields-horizontal .day-form__label {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
  font-size: 0.85rem;
}

.info-fields-horizontal .day-form__input {
  width: 100%;
  font-size: 0.9rem;
}

/* コンパクトなインポートエリア */
.import-dropzone--compact {
  padding: 8px;
  border: 2px dashed #ccc;
  border-radius: 4px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  width: 80px;
  height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.import-dropzone--compact:hover {
  border-color: #007bff;
  background-color: #e3f2fd;
}

.import-dropzone--compact .import-dropzone__icon {
  margin: 0;
  color: #666;
}

.import-dropzone--compact .import-dropzone__button {
  padding: 2px 8px;
  font-size: 0.75rem;
  background: none;
  border: none;
  color: #007bff;
  cursor: pointer;
  font-weight: 600;
}

/* コンパクトなフィールド */
.day-form__field--compact {
  margin-bottom: 0;
}

.day-form__label--compact {
  font-size: 11px;
  margin-bottom: 1px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.day-form__input--compact {
  padding: 2px 4px;
  font-size: 11px;
  height: 30px;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
  max-width: none;
}

.day-form__textarea--compact {
  padding: 4px 8px;
  font-size: 11px;
  min-height: 50px;
  resize: vertical;
}


/* 下段セクション */
.day-form__bottom-section {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.day-form__bottom-section .day-form__actions {
  align-self: center;
  margin-top: 10px;
}

/* シフト表示スタイル */
.shift-list {
  margin-top: 15px;
}

.shift-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background-color: white;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  margin-bottom: 6px;
  transition: all 0.2s ease;
}

.shift-item:hover {
  background-color: #f8f9fa;
  border-color: #007bff;
  transform: translateX(2px);
}

.shift-item__staff {
  font-weight: 600;
  color: #333;
  min-width: 80px;
}

.shift-item__time {
  color: #495057;
  font-size: 0.9rem;
  min-width: 120px;
}

.shift-item__duration {
  color: #17a2b8;
  font-size: 0.85rem;
  font-weight: 500;
  margin-left: auto;
}

.shift-empty {
  margin-top: 15px;
  text-align: center;
  padding: 20px;
}

.shift-empty__text {
  color: #6c757d;
  font-style: italic;
  font-size: 0.9rem;
}

/* シフト管理テーブル */
.shift-management-table {
  overflow-x: auto;
  margin-bottom: 15px;
}

.staff-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #dee2e6;
  font-size: 0.85rem;
}

.staff-table__header {
  background-color: #f8f9fa;
  padding: 8px;
  text-align: left;
  font-weight: bold;
  color: #495057;
  border-bottom: 2px solid #dee2e6;
  font-size: 0.8rem;
}

.staff-table__row {
  border-bottom: 1px solid #dee2e6;
}

.staff-table__row:hover {
  background-color: #f8f9fa;
}

.staff-table__row--existing {
  background-color: #f8f9fa;
}

.staff-table__row--new {
  background-color: #fff;
}

.staff-table__row--editing {
  background-color: #fff3cd;
}

.staff-table__cell {
  padding: 8px;
  vertical-align: middle;
  font-size: 0.8rem;
}

.shift-count {
  display: inline-block;
  color: #6c757d;
  font-size: 0.7rem;
  margin-left: 4px;
  font-weight: normal;
}

.time-input {
  width: 100%;
  max-width: 80px;
  padding: 4px;
  border: 1px solid #ced4da;
  border-radius: 3px;
  font-size: 0.8rem;
}

.time-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 1px rgba(0, 123, 255, 0.25);
}

.work-hours {
  font-weight: bold;
  color: #17a2b8;
  font-size: 0.8rem;
}

.btn-small {
  padding: 2px 6px;
  font-size: 0.7rem;
  border-radius: 2px;
  text-decoration: none;
  margin-right: 3px;
  display: inline-block;
  border: none;
  cursor: pointer;
}

.btn-small--save {
  background-color: #28a745;
  color: white;
}

.btn-small--save:hover {
  background-color: #218838;
}

.btn-small--save:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
}

.btn-small--edit {
  background-color: #007bff;
  color: white;
}

.btn-small--edit:hover {
  background-color: #0056b3;
}

.btn-small--delete {
  background-color: #dc3545;
  color: white;
}

.btn-small--delete:hover {
  background-color: #c82333;
}

.btn-small--add {
  background-color: #28a745;
  color: white;
  margin-left: 5px;
}

.btn-small--add:hover {
  background-color: #218838;
}

.shift-badge {
  display: inline-block;
  background-color: #28a745;
  color: white;
  font-size: 0.6rem;
  padding: 1px 4px;
  border-radius: 2px;
  margin-left: 4px;
  font-weight: normal;
}

.shift-badge--edit {
  background-color: #ffc107;
  color: #212529;
}

#shift-message-area {
  margin-top: 10px;
}

#shift-message-area .message {
  padding: 8px 12px;
  margin: 8px 0;
  border-radius: 4px;
  font-size: 0.8rem;
}

#shift-message-area .message--success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

#shift-message-area .message--error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* 部署配置レイアウト */
.department-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
}

/* スタッフリスト */
.staff-list {
  display: flex;
  flex-direction: column;
  gap: 0px;
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0px;
  box-sizing: border-box;
  height: 100%;
  flex: 1;
  overflow: hidden;
}

/* スタッフリスト内部スクロールコンテナ */
.staff-list__inner {
  overflow-y: auto;
  overflow-x: hidden;
  height: 100%;
}


/* スタッフグリッド */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 15px;
}


/* スタッフアイテム */
.staff-item {
  display: flex;
  align-items: center;
  padding: 6px 3px 6px 6px;
  background-color: #fff;
  border-radius: 6px;
  border: 1px solid #e9ecef;
  cursor: move;
  transition: all 0.2s ease;
  position: relative;
  min-width: 0;
}

.staff-item .staff-time {
  font-size: 9px;
  margin-left: 0;
}

.staff-item:hover {
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.staff-item.staff-item--dragging {
  opacity: 0.5;
}

/* 配置済みスタッフアイテム */
.staff-item--placed {
  background-color: #c8e6c9;
  border-color: #a5d6a7;
}

.staff-item--placed:hover {
  background-color: #a5d6a7;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

/* クリック選択機能は無効化（ドラッグ&ドロップのみ使用）
.staff-item.staff-item--selected {
  ring: 2px solid #007bff;
  background-color: #e7f3ff;
} */

/* 使用済みスタッフのスタイル */
.staff-item.staff-item--used {
  opacity: 0.5;
  cursor: not-allowed;
}

.staff-item.staff-item--used .staff-marker {
  background-color: #6c757d;
}

/* お休みスタッフのスタイル */
.staff-item.staff-item--off {
  background-color: #f8f9fa;
  cursor: pointer;
}

.staff-item.staff-item--off:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transform: none;
}

/* スタッフマーカー */
.staff-marker {
  width: 10px;
  height: 10px;
  background-color: #28a745;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 7px;
  color: white;
  font-weight: bold;
  flex-shrink: 0;
  /* 以下の設定で文字の位置調整を完全にリセット */
  padding: 0;
  margin: 0;
  line-height: 1;
  text-align: center;
  font-family: Arial, sans-serif; /* 等幅フォントで安定性向上 */
}

/* 休みの人は赤色 */
.staff-marker--off {
  background-color: #dc3545;
}

/* スタッフ情報 */
.staff-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  margin-left: 8px;
  min-width: 0;
}

.staff-item .staff-info {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: space-between;
}


.staff-name {
  font-size: 11px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
  flex: 1 1 0;
  min-width: 0;
}

.staff-times {
  display: inline-flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 3px;
  min-width: 0;
  max-width: none;
  overflow: visible;
  white-space: nowrap;
  flex: 0 0 auto;
}

.staff-time {
  background-color: #e3f2fd;
  padding: 1px 3px;
  border-radius: 3px;
  font-size: 9px;
  flex-shrink: 0;
  margin-left: 4px;
  cursor: pointer;
  color: #007bff;
  text-decoration: none;
  transition: all 0.2s;
}

.staff-time:hover {
  background-color: #bbdefb;
  color: #0056b3;
  text-decoration: none;
}

.staff-time--off {
  background-color: #ffebee;
}

/* 部署別担当配置マップ（右側） */
.department-actions {
  display: flex;
  justify-content: center;
  gap: 35px;
  margin: 30px 0 15px;
  flex-wrap: wrap;
}

.department-actions__link,
.department-actions__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  background-color: var(--day-action-button-bg);
  color: #ffffff;
  text-decoration: none;
  border: none;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.department-actions__link:hover,
.department-actions__button:hover {
  background-color: var(--day-action-button-hover-bg);
}

.department-actions__button--disabled {
  background-color: #b0bec5;
  cursor: not-allowed;
}

.department-actions__button--disabled:hover {
  background-color: #b0bec5;
}

.department-actions__button--secondary {
  background-color: #6c757d;
}

.department-actions__button--secondary:hover {
  background-color: #5a6268;
}

.auto-assign-modal {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: none;
}

.auto-assign-modal.auto-assign-modal--open {
  display: block;
}

.auto-assign-modal__backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.42);
}

.auto-assign-modal__dialog {
  position: relative;
  width: min(560px, calc(100vw - 32px));
  margin: 8vh auto 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  padding: 18px 18px 16px;
}

.auto-assign-modal__title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: #2f3e46;
}

.auto-assign-modal__description {
  margin: 0 0 12px;
  color: #495057;
  line-height: 1.6;
  font-size: 0.9rem;
}

.auto-assign-modal__section {
  border: 1px solid #e7ecef;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: #f8fafb;
}

.auto-assign-modal__label {
  margin: 0 0 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #3e4c59;
}

.auto-assign-modal__option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.88rem;
  color: #344050;
}

.auto-assign-modal__option:last-child {
  margin-bottom: 0;
}

.auto-assign-modal__option input[type="radio"],
.auto-assign-modal__option input[type="checkbox"] {
  margin: 0;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.auto-assign-modal__option span {
  line-height: 1.4;
}

.auto-assign-modal__actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.department-frames-container {
  width: 100%;
  background-color: #fff;
  border-radius: 0 0 8px 8px;
  padding: 15px;
  padding-top: 15px;
  padding-bottom: 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  margin-top: 0;
  position: relative;
}


.department-frames {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

.department-group {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d8dee9;
  border-radius: 12px;
  padding: 14px;
  background: linear-gradient(180deg, #fafbff 0%, #ffffff 100%);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.department-group + .department-group {
  margin-top: 16px;
}

.department-group__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e7eb;
}

.department-group__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #1f2937;
}

.department-group__count {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
}

.department-group__empty {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background-color: #f8fafc;
  color: #6b7280;
  font-size: 13px;
}

/* 部署フレーム */
.department-frame {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 12px;
  min-width: 0;
}

.department-frame--red {
  background-color: #fdecea;
  border-color: #f8c8c4;
}

.department-frame--green {
  background-color: #e8f5e9;
  border-color: #c8e6c9;
}

.department-frame--blue {
  background-color: #e3f2fd;
  border-color: #bbdefb;
}

.department-frame--purple {
  background-color: #f3e5f5;
  border-color: #e1bee7;
}

.department-frame--orange {
  background-color: #fff3e0;
  border-color: #ffcc80;
}

.department-frame__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.department-frame__title {
  font-size: 14px;
  font-weight: bold;
  color: #495057;
}

.department-frame__status {
  font-size: 12px;
  color: #6c757d;
}

.department-frame__recommendation {
  font-size: 10px;
  color: #888;
}

.department-frame__slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 6px;
}

/* スロット */
.slot {
  padding: 8px;
  background-color: var(--slot-bg-color, #ffeaa7);
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  min-height: 36px;
  padding: 6px;
  display: block;
  box-sizing: border-box;
  overflow: hidden;
}

.slot:hover {
  filter: brightness(0.97);
}

.slot.slot--dragover {
  background-color: #e2e8f0;
  border: 2px dashed #64b5f6;
}

.slot.slot--filled {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-right: 48px;
  cursor: move;
}

.slot.slot--filled.slot--no-label {
  padding-right: 3px;
}

.slot.slot--filled:hover {
  filter: brightness(0.97);
}

.slot__label-text {
  position: absolute;
  top: 3px;
  right: 6px;
  max-width: 55%;
  padding: 0;
  color: #6c757d;
  font-size: 9px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  z-index: 1;
}

.slot__time-group {
  position: absolute;
  right: 3px;
  bottom: 6px;
  max-width: 55%;
  display: flex;
  gap: 2px;
  align-items: center;
  justify-content: flex-end;
  z-index: 1;
}

.slot .staff-time {
  position: static;
  max-width: 100%;
  padding: 1px 3px;
  border-radius: 3px;
  background: #e3f2fd;
  color: #007bff;
  font-size: 9px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  margin: 0;
  z-index: 1;
}

.slot:not(.slot--filled) .slot__empty-text {
  position: absolute;
  display: flex;
  right: 3px;
  right: 6px;
  top: 3px;
  transform: none;
  text-align: right;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
  margin: 0;
  padding: 0;
  border-radius: 0;
  color: #6c757d;
  font-size: 9px;
  line-height: 1.2;
  white-space: nowrap;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot.slot--no-label .slot__time-group {
  position: static;
  right: auto;
  bottom: auto;
  transform: none;
  margin-left: auto;
  align-self: center;
  z-index: 1;
}

/* スタッフ配置ポップアップ */
.staff-placement-popup {
  position: fixed;
  z-index: 10000;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 12px;
  min-width: 420px;
  max-width: 520px;
  pointer-events: none;
  animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.staff-placement-popup__header {
  font-weight: bold;
  font-size: 14px;
  color: #333;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #eee;
}

.staff-placement-popup__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* 2カラムレイアウト用リスト */
.staff-placement-popup__list--2columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
}

.staff-placement-popup__item {
  font-size: 13px;
  color: #666;
  padding: 4px 8px;
  background-color: #f8f8f8;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.staff-placement-popup__item:hover {
  background-color: #f0f0f0;
}

/* 他の配置がない場合のスタイル */
.staff-placement-popup__item--empty {
  color: #999;
  font-style: italic;
  background-color: transparent;
  padding: 8px;
  text-align: center;
}

/* セクションタイトル */
.staff-placement-popup__section-title {
  font-size: 12px;
  font-weight: 600;
  color: #555;
  margin: 0 0 8px 0;
  padding-bottom: 4px;
  border-bottom: 1px solid #eee;
}

/* スキル習熟レベル表示 */
.staff-placement-popup__skills {
  margin-bottom: 8px;
}

.staff-placement-popup__skill-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  background-color: #f8f8f8;
}

.staff-placement-popup__skill-item .skill-name {
  font-weight: 500;
  color: #333;
}

.staff-placement-popup__skill-item .skill-level {
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
}

/* スキルレベル別の色分け */
.staff-placement-popup__skill-item.skill-level--none .skill-level {
  background-color: #e0e0e0;
  color: #999;
}

.staff-placement-popup__skill-item.skill-level--1 .skill-level {
  background-color: #fff3cd;
  color: #856404;
}

.staff-placement-popup__skill-item.skill-level--2 .skill-level {
  background-color: #cce5ff;
  color: #004085;
}

.staff-placement-popup__skill-item.skill-level--3 .skill-level {
  background-color: #d4edda;
  color: #155724;
}

.staff-placement-popup__skill-item.skill-level--4 .skill-level {
  background-color: #f8d7da;
  color: #721c24;
}

.staff-placement-popup__skill-item.skill-level--5 .skill-level {
  background-color: #d1ecf1;
  color: #0c5460;
}

/* 配置場所セクション */
.staff-placement-popup__placements {
  margin-bottom: 12px;
}

.slot__empty-text {
  font-size: 12px;
  color: #9e9e9e;
}

/* 部署フレームのコントロールボタン */
.department-frame__controls {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.slot-control-btn {
  width: 14px;
  height: 14px;
  border: none;
  border-radius: 50%;
  font-size: 9px;
  line-height: 1;
  padding: 0;
  box-sizing: border-box;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.slot-add-btn {
  background-color: #28a745;
  color: white;
}

.slot-add-btn:hover {
  background-color: #218838;
  transform: scale(1.05);
}

.slot-remove-btn {
  background-color: #dc3545;
  color: white;
}

.slot-remove-btn:hover {
  background-color: #c82333;
  transform: scale(1.05);
}

.slot-control-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.slot-control-btn:active {
  transform: scale(0.95);
}

/* 部署フレームヘッダーのレイアウト調整 */
.department-frame__header {
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
}

.department-frame__title {
  width: 100%;
  margin-bottom: 6px;
  text-align: left;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.department-frame__header-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.department-frame__status {
  margin-right: 8px;
}


/* モバイルでのコントロールボタン */
@media (max-width: 768px) {
  .department-frames {
    grid-template-columns: 1fr;
  }

  .department-group {
    padding: 12px;
  }

  .department-group + .department-group {
    margin-top: 12px;
  }

  .department-group__header {
    margin-bottom: 10px;
    padding-bottom: 8px;
  }

  .department-group__title {
    font-size: 14px;
  }

  .slot-control-btn {
    width: 12px;
    height: 12px;
    font-size: 8px;
  }

  .auto-assign-modal__dialog {
    width: calc(100vw - 20px);
    margin-top: 5vh;
    padding: 14px 12px;
  }

  .auto-assign-modal__actions {
    justify-content: stretch;
  }

  .auto-assign-modal__actions .department-actions__button {
    flex: 1;
  }
}

/* CSVインポート成功メッセージ */
.import-success-message {
  background-color: #d4edda;
  color: #155724;
  padding: 10px 15px;
  border-radius: 4px;
  margin-top: 10px;
  font-size: 0.85rem;
  display: inline-block;
  animation: fadeIn 0.3s ease-in;
}

.import-success-message.fade-out {
  animation: fadeOut 0.5s ease-out;
  opacity: 0;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
