/* small helpers */
.table-responsive .sticky-top { top: 0; z-index: 5; }
code { background: rgba(0,0,0,0.05); padding: 0.1rem 0.2rem; border-radius: 0.2rem; }

/* 祝日の背景色 */
.bg-holiday {
  background-color: #ffcdd2 !important; /* 薄い赤 */
}
.badge.bg-holiday {
  background-color: #ef5350 !important; /* 赤 */
  color: white !important;
}

/* 注意セルのスタイル */
.note-cell {
  transition: background-color 0.15s ease;
}
.note-cell:hover {
  background-color: rgba(220, 53, 69, 0.2) !important;
}
.note-cell[title] {
  cursor: help;
}

/* 月次勤務状況テーブル */
.work-table {
  font-size: 0.8rem;
}
.work-table th {
  font-size: 0.75rem;
  padding: 0.3rem 0.4rem;
  white-space: nowrap;
}
.work-table td {
  padding: 0.25rem 0.4rem;
  vertical-align: middle;
}
.work-table .form-select-sm,
.work-table .form-control-sm {
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
}
.work-table .badge {
  font-size: 0.65rem;
}
.work-table .btn-sm {
  font-size: 0.7rem;
}
.work-table .actual-preview {
  font-size: 0.65rem;
}

/* 日付ごとの背景色 */
.work-table tbody tr.date-odd,
.work-table tbody tr.date-odd td {
  background-color: #ffffff !important;
}
.work-table tbody tr.date-even,
.work-table tbody tr.date-even td {
  background-color: #d4e8fc !important;
}
.work-table tbody tr.date-odd:hover,
.work-table tbody tr.date-odd:hover td {
  background-color: #f5f5f5 !important;
}
.work-table tbody tr.date-even:hover,
.work-table tbody tr.date-even:hover td {
  background-color: #b8d4f0 !important;
}

/* 日別集計テーブル */
.summary-table {
  font-size: 0.7rem;
}
.summary-table th,
.summary-table td {
  padding: 0.2rem 0.3rem;
  min-width: 38px;
}
.summary-table th:first-child,
.summary-table td:first-child {
  min-width: 80px;
  position: sticky;
  left: 0;
  background-color: #f8f9fa;
  z-index: 2;
}
.summary-table tbody td:first-child {
  background-color: #fff;
}
.summary-table tr.table-info td:first-child {
  background-color: #cff4fc;
}

/* 集計表の日付リンク */
.summary-table .date-link {
  color: #0d6efd;
  font-weight: 600;
}
.summary-table .date-link:hover {
  color: #0a58ca;
  text-decoration: underline !important;
}

/* ==============================================
   勤務希望登録ページ レスポンシブスタイル
   ============================================== */

/* 勤務希望テーブル - 基本スタイル */
.shift-table {
  font-size: 0.85rem;
}
.shift-table th {
  font-size: 0.8rem;
  padding: 0.4rem 0.5rem;
  white-space: nowrap;
  background-color: #f8f9fa;
}
.shift-table td {
  padding: 0.35rem 0.5rem;
  vertical-align: middle;
}
.shift-table .form-select-sm {
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
}

/* 凡例 - モバイル用レイアウト */
.legend-box {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

/* PC表示 (768px以上) */
@media (min-width: 768px) {
  .shift-table .form-select-sm {
    min-width: 220px;
  }
  .shift-mobile-card {
    display: none !important;
  }
  .shift-desktop-table {
    display: block !important;
  }
}

/* タブレット・スマホ表示 (768px未満) */
@media (max-width: 767.98px) {
  /* テーブルを非表示、カード表示に切り替え */
  .shift-desktop-table {
    display: none !important;
  }
  .shift-mobile-card {
    display: block !important;
  }
  
  /* 勤務希望カード */
  .shift-card {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0.6rem;
    background: #fff;
  }
  .shift-card.weekend {
    background-color: #fff3cd;
  }
  .shift-card.confirmed {
    background-color: #e8f5e9;
    border-color: #4caf50;
  }
  
  /* カードヘッダー（日付行） */
  .shift-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid #eee;
  }
  .shift-card-date {
    font-weight: 600;
    font-size: 0.9rem;
  }
  .shift-card-status {
    font-size: 0.7rem;
  }
  
  /* セレクトボックス */
  .shift-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
  }
  .shift-card-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
  }
  .shift-card-label {
    font-size: 0.7rem;
    color: #666;
    min-width: 50px;
    flex-shrink: 0;
  }
  .shift-card-select {
    flex: 1;
    font-size: 0.75rem !important;
    padding: 0.3rem 0.4rem !important;
    height: auto !important;
  }
  .shift-card-confirmed-text {
    flex: 1;
    font-size: 0.7rem;
    color: #666;
    background: #f5f5f5;
    padding: 0.3rem 0.5rem;
    border-radius: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  /* AI入力セクション調整 */
  .ai-section .d-flex {
    flex-direction: column;
  }
  .ai-section textarea {
    font-size: 0.85rem;
  }
  .ai-section button {
    width: 100%;
    margin-top: 0.5rem;
  }
  
  /* ヘッダー部分調整 */
  .shift-page-header {
    flex-direction: column;
    gap: 0.5rem;
  }
  .shift-page-header h1 {
    font-size: 1.2rem;
  }
  
  /* 締切タイマー調整 */
  #deadlineTimer {
    font-size: 0.75rem;
    padding: 0.5rem !important;
  }
  #deadlineTimer #countdown {
    font-size: 1rem !important;
    display: block;
    margin-top: 0.25rem;
  }
  
  /* 凡例調整 */
  .alert-info.small {
    font-size: 0.7rem;
    padding: 0.5rem !important;
  }
  
  /* 保存ボタン固定 */
  .shift-save-btn-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 0.75rem;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 100;
  }
  .shift-save-btn-container .btn {
    width: 100%;
    font-size: 1rem;
    padding: 0.6rem;
  }
  
  /* 下部の余白確保（固定ボタン分） */
  .shift-form-container {
    padding-bottom: 70px;
  }
}

/* 小さいスマホ (576px未満) */
@media (max-width: 575.98px) {
  .shift-card {
    padding: 0.5rem;
  }
  .shift-card-date {
    font-size: 0.85rem;
  }
  .shift-card-label {
    font-size: 0.65rem;
    min-width: 45px;
  }
  .shift-card-select {
    font-size: 0.7rem !important;
  }
  .shift-card-confirmed-text {
    font-size: 0.65rem;
  }
}


/* 要望ツールチップ */
.request-tooltip .tooltip-inner {
  max-width: 320px;
  text-align: left;
  white-space: pre-line;
}
