/*
 * HSMS - Hospital Safety Management System
 * メインスタイルシート
 */

/* =============================
   基本レイアウト
   ============================= */
:root {
  --hsms-primary: #0d6efd;
  --hsms-sidebar-width: 250px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  background-color: #f5f6fa;
  min-height: 100vh;
}

/* =============================
   ナビバー
   ============================= */
.navbar-brand {
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* =============================
   カード系
   ============================= */
.card {
  border-radius: 0.5rem;
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.1);
}

.card-header {
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

/* =============================
   テーブル
   ============================= */
.table th {
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
}

.table td {
  font-size: 0.9rem;
  vertical-align: middle;
}

tr.cursor-pointer {
  cursor: pointer;
}

tr.cursor-pointer:hover {
  background-color: rgba(13, 110, 253, 0.04);
}

/* =============================
   バッジ（重症度・状態）
   ============================= */
.badge {
  font-weight: 500;
}

.badge-severity-1, .badge-severity-2 {
  background-color: #198754 !important;
  color: #fff;
}

.badge-severity-3, .badge-severity-4 {
  background-color: #ffc107 !important;
  color: #212529;
}

.badge-severity-5, .badge-severity-6 {
  background-color: #fd7e14 !important;
  color: #fff;
}

.badge-severity-7, .badge-severity-8 {
  background-color: #dc3545 !important;
  color: #fff;
}

.badge-status-draft   { background-color: #6c757d !important; }
.badge-status-open    { background-color: #0dcaf0 !important; color: #212529; }
.badge-status-review  { background-color: #ffc107 !important; color: #212529; }
.badge-status-confirmed { background-color: #0d6efd !important; }
.badge-status-closed  { background-color: #198754 !important; }

/* =============================
   フォーム
   ============================= */
.form-label {
  font-weight: 600;
  font-size: 0.875rem;
}

.form-text {
  font-size: 0.8rem;
}

/* =============================
   ダッシュボードカード
   ============================= */
.stat-card .display-6 {
  font-weight: 700;
}

.quick-action-card {
  transition: transform 0.15s ease;
}

.quick-action-card:hover {
  transform: translateY(-2px);
}

/* =============================
   通知ベル
   ============================= */
.notification-bell .badge {
  position: absolute;
  top: -4px;
  right: -6px;
  font-size: 0.65rem;
  min-width: 18px;
}

/* =============================
   タイムライン
   ============================= */
.timeline-item {
  position: relative;
  padding-left: 2rem;
  padding-bottom: 1rem;
  border-left: 2px solid #dee2e6;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 0.25rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0d6efd;
}

.timeline-item:last-child {
  border-left-color: transparent;
}

/* =============================
   モバイル対応
   ============================= */
@media (max-width: 768px) {
  .card-body {
    padding: 0.75rem;
  }

  .display-6 {
    font-size: 1.5rem;
  }

  .table-responsive {
    font-size: 0.85rem;
  }

  .breadcrumb {
    font-size: 0.8rem;
  }
}

/* =============================
   音声入力ボタン
   ============================= */
.voice-input-btn {
  border: none;
  background: none;
  color: #6c757d;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  transition: color 0.15s ease, background 0.15s ease;
}

.voice-input-btn:hover {
  color: #dc3545;
  background: rgba(220, 53, 69, 0.1);
}

.voice-input-btn.recording {
  color: #dc3545;
  animation: voice-pulse 1s infinite;
}

@keyframes voice-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* =============================
   カメラ撮影ボタン
   ============================= */
.camera-btn {
  border: 2px dashed #dee2e6;
  background: #f8f9fa;
  border-radius: 0.5rem;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease;
  color: #6c757d;
}

.camera-btn:hover {
  border-color: #0d6efd;
  color: #0d6efd;
}

/* =============================
   印刷
   ============================= */
@media print {
  .navbar, .breadcrumb, .btn, footer {
    display: none !important;
  }

  .card {
    border: 1px solid #dee2e6;
    box-shadow: none;
  }

  body {
    background: #fff;
  }
}

/* =============================
   アニメーション
   ============================= */
.fade-in {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =============================
   HTMX ローディング
   ============================= */
.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator {
  display: inline-block;
}

.htmx-request.htmx-indicator {
  display: inline-block;
}

/* =============================
   期限超過ハイライト
   ============================= */
tr.overdue-row {
  background-color: rgba(220, 53, 69, 0.05) !important;
}

tr.overdue-row td {
  color: #dc3545;
}

/* =============================
   フィルターパネル
   ============================= */
.filter-panel {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
}
