/* ========================================
   スタッフ画面スタイル
   legacyの2カラムレイアウトを完全再現
   ======================================== */

/* スタッフセクション全体（紫グラデーション背景） */
#staff-section {
  background: linear-gradient(to bottom, #5967C2 0% 33.33%, #FFFFFF 33.33% 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

/* アプリコンテナ（中央の白い枠） */
.staff-app-container {
  width: 1024px;
  min-height: 768px;
  background: #FFFFFF;
  border-radius: 8px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ヘッダー */
.staff-header {
  height: 60px;
  background: white;
  box-shadow: none;
  border: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  flex-shrink: 0;
}

.staff-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 1 auto;
  min-width: 0;
}

.staff-header-left-text {
  display: flex;
  flex-direction: column;
  max-width: 400px;
  min-width: 0;
  flex-shrink: 1;
}

.staff-header-title {
  font-size: 20px;
  font-weight: 700;
  color: #333;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-header-subtitle {
  font-size: 12px;
  color: #666;
  margin-top: 1px;
}

.staff-header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.staff-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

/* ユニット表示（ヘッダー中央の枠付き表示） */
.unit-display-header {
  font-size: 20px;
  font-weight: bold;
  color: #1e3a8a;
  background: rgba(255, 255, 255, 0.9);
  padding: 4px 12px;
  border-radius: 4px;
  border: 1px solid #bfdbfe;
}

/* ヘッダーボタン共通 */
.btn-header {
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.btn-header:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* エラー報告ボタン */
.btn-error-report {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  color: #000000;
}

/* 回数一覧ボタン */
.btn-chart-popup {
  background: linear-gradient(to right, #1976D2 0%, #2196F3 50%, #42A5F5 100%);
  color: white;
  border: none;
}

/* 今日も頑張ったボタン（青グラデーション - legacy準拠） */
.btn-daily-motivation {
  background: linear-gradient(to right, #1565C0 0%, #1E88E5 50%, #42A5F5 100%);
  color: #ffffff;
  border: none;
}

/* 管理者ヘッダー版：影を強めてボタン感を強化（legacy準拠） */
.btn-daily-motivation-admin {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25), 0 2px 6px rgba(0, 0, 0, 0.15);
  padding: 4px 6px;
  font-size: 14px;
}

.btn-daily-motivation-admin:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.30), 0 4px 10px rgba(0, 0, 0, 0.18);
}

/* ログアウトボタン */
.btn-header-logout {
  background: linear-gradient(to right, #C62828 0%, #f44336 50%, #FF5252 100%);
  color: white;
  border: none;
  padding: 4px 6px;
  font-size: 14px;
}

/* 管理者用ボタン */
.btn-header-admin {
  background: linear-gradient(to right, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.2));
  border: 1px solid rgba(0, 0, 0, 0.15);
  color: #333;
}

/* オンライン状態インジケーター */
.online-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  color: #4CAF50;
}

.online-dot {
  width: 8px;
  height: 8px;
  background: #4CAF50;
  border-radius: 50%;
  animation: onlinePulse 2s infinite;
}

.online-dot.offline {
  background: #f44336;
  animation: none;
}

@keyframes onlinePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* 役割バッジ（legacy互換：緑背景） */
.role-badge {
  padding: 4px 12px;
  background: #e8f5e8;
  color: #2e7d32;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 500;
}

.role-badge.admin {
  background: #fff3e0;
  color: #e65100;
}

/* ========================================
   メインコンテンツ（2カラム）
   ======================================== */

.staff-content {
  flex: 1;
  display: flex;
  padding: 20px;
  gap: 20px;
  background-color: #f0f2f5;
}

.staff-left-column,
.staff-right-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* カード */
.staff-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 8px rgba(0, 0, 0, 0.15);
  padding: 20px;
}

.staff-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* スタッフ選択グリッド（2列） */
.staff-select-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.staff-select-btn {
  padding: 12px;
  border: 2px solid #e0e0e0;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

.staff-select-btn:hover {
  border-color: #2196f3;
}

.staff-select-btn.selected {
  border-color: #2196f3;
  background: #e3f2fd;
  color: #1976d2;
}

/* 治療内容ボタン（2列） */
.treatment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.treatment-btn {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.treatment-btn:hover {
  border-color: #4caf50;
}

.treatment-btn.selected {
  border-color: #4caf50;
  background: #e8f5e8;
  color: #2e7d32;
}

/* 操作ボタン（横並び） */
.action-buttons {
  display: flex;
  gap: 16px;
}

.btn-action {
  flex: 1;
  padding: 16px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  color: white;
}

.btn-action:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.btn-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 入室ボタン */
.btn-checkin {
  background: linear-gradient(to right, #2E7D32 0%, #4CAF50 50%, #66BB6A 100%);
  color: white;
}

/* 退室ボタン */
.btn-checkout {
  background: linear-gradient(to right, #C62828 0%, #f44336 50%, #FF5252 100%);
  color: white;
}

/* ========================================
   タイマー表示（右カラム）
   ======================================== */

.timer-display {
  text-align: center;
  margin: 20px 0;
}

.timer-time {
  font-family: 'Inter', sans-serif;
  font-size: 96pt;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: #333;
  line-height: 1;
  margin-bottom: 8px;
}

.timer-time.delayed {
  color: #C62828;
}

.staff-content.delayed {
  background-color: #EF5350 !important;
}

.timer-info {
  font-size: 16px;
  color: #666;
}

/* ========================================
   Dr.呼出カード（右カラム）
   ======================================== */

.doctor-call-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.doctor-call-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-doctor-call {
  padding: 12px;
  border: 2px solid #e0e0e0;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #b91c1c;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-doctor-call:hover {
  border-color: #ef4444;
}

.btn-doctor-call.active {
  border-color: #ef4444;
  background: #fee2e2;
  color: #991b1b;
}

.doctor-call-time-display {
  font-size: 16px;
  color: #e74c3c;
  font-weight: bold;
}

.doctor-call-response {
  font-size: 14px;
  color: #2e7d32;
  font-weight: 600;
  background: #e8f5e8;
  padding: 8px;
  border-radius: 6px;
}

.doctor-call-msg {
  font-size: 14px;
  color: #374151;
  font-weight: 600;
}

.doctor-call-info {
  font-size: 14px;
  color: #666;
  margin-left: 8px;
}

/* ========================================
   履歴テーブル
   ======================================== */

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.history-table th,
.history-table td {
  padding: 8px;
  border-bottom: 1px solid #e0e0e0;
  text-align: left;
}

.history-table th {
  background: #f5f5f5;
  font-weight: 600;
  color: #333;
}

.history-table .status-normal {
  color: #16a34a;
  font-weight: 600;
}

.history-table .status-delayed {
  color: #D32F2F;
  font-weight: 600;
}

/* ========================================
   レスポンシブ
   ======================================== */

@media (max-width: 1064px) {
  .staff-app-container {
    width: 100%;
    min-height: auto;
  }
}

@media (max-width: 768px) {
  #staff-section {
    padding: 0;
    align-items: flex-start;
  }

  .staff-app-container {
    border-radius: 0;
    box-shadow: none;
    min-height: 100vh;
  }

  .staff-content {
    flex-direction: column;
  }

  .staff-header {
    height: auto;
    flex-direction: column;
    gap: 8px;
    padding: 8px 16px;
    align-items: flex-start;
  }

  .staff-header-right {
    flex-wrap: wrap;
  }

  .timer-time {
    font-size: 48pt;
  }

  .staff-select-grid {
    grid-template-columns: 1fr 1fr;
  }
}
