/* ============================================================
   1on1 Connect - メインスタイルシート
   Kakeai UIを意識したクリーン＆ウォームデザイン
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:       #4A90D9;
  --primary-dark:  #2E6DAF;
  --primary-light: #EBF4FD;
  --teal:          #2DBD9B;
  --teal-light:    #E6F7F3;
  --accent:        #E84B8A;
  --accent-light:  #FDEEF5;
  --amber:         #F5A623;
  --amber-light:   #FEF6E6;
  --purple:        #9B59B6;
  --purple-light:  #F3EAF8;

  --bg:            #F4F6F9;
  --surface:       #FFFFFF;
  --surface-alt:   #F8FAFB;
  --border:        #E8ECF0;
  --border-strong: #CDD3DA;

  --text-primary:  #1A202C;
  --text-secondary:#4A5568;
  --text-muted:    #8A97A8;
  --text-on-primary:#FFFFFF;

  --sidebar-w:     240px;
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     16px;
  --radius-xl:     20px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:     0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg:     0 8px 24px rgba(0,0,0,.10), 0 2px 8px rgba(0,0,0,.06);
  --transition:    0.18s ease;
}

html { font-size: 15px; }
body {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   サイドバー
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
  scrollbar-width: thin;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
}
.logo-text {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.nav-section {
  padding: 16px 8px 8px;
}
.nav-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 10px;
  margin-bottom: 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 400;
  transition: background var(--transition), color var(--transition);
  position: relative;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .7; }
.nav-item:hover { background: var(--bg); color: var(--text-primary); }
.nav-item:hover svg { opacity: 1; }
.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 500;
}
.nav-item.active svg { opacity: 1; }
.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  display: none;
}
.nav-badge.show { display: inline-block; }

.sidebar-footer {
  margin-top: auto;
  padding: 12px 8px;
  border-top: 1px solid var(--border);
}
.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
}
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 12.5px; font-weight: 500; color: var(--text-primary); truncate: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-muted); }
.logout-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.logout-btn:hover { background: var(--border); color: var(--text-primary); }
.logout-btn svg { width: 16px; height: 16px; }

/* ============================================================
   メインコンテンツ
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  padding: 24px 28px;
  position: relative;
}

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.sidebar-toggle svg { width: 20px; height: 20px; }

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.3);
  z-index: 99;
}

/* ============================================================
   ページヘッダー
   ============================================================ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 3px; }

/* ============================================================
   カード
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title { font-size: 14.5px; font-weight: 600; color: var(--text-primary); }
.card-body { padding: 20px; }

/* ============================================================
   KPIカード
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kpi-label { font-size: 11.5px; color: var(--text-muted); font-weight: 500; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .5px; }
.kpi-value { font-size: 30px; font-weight: 700; font-family: 'DM Sans', sans-serif; color: var(--text-primary); line-height: 1.1; }
.kpi-unit { font-size: 14px; font-weight: 400; color: var(--text-secondary); margin-left: 3px; }
.kpi-trend { font-size: 11.5px; margin-top: 6px; }
.kpi-up { color: var(--teal); }
.kpi-down { color: var(--accent); }
.kpi-dot {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  margin-bottom: 10px;
}

/* ============================================================
   ボタン
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn svg { width: 16px; height: 16px; }

.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(74,144,217,.3); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(74,144,217,.4); }

.btn-teal { background: var(--teal); color: #fff; box-shadow: 0 2px 8px rgba(45,189,155,.3); }
.btn-teal:hover { background: #26a889; }

.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); border-color: var(--border-strong); }

.btn-danger { background: #E74C3C; color: #fff; }
.btn-danger:hover { background: #c0392b; }

.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

/* ============================================================
   フォーム
   ============================================================ */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74,144,217,.1);
}
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 100px; line-height: 1.6; }

/* ============================================================
   トピックセレクター（Kakeai風）
   ============================================================ */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.topic-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--surface);
  user-select: none;
}
.topic-chip:hover { border-color: var(--primary); background: var(--primary-light); }
.topic-chip.selected { border-color: var(--primary); background: var(--primary-light); }
.topic-chip input[type=checkbox] { display: none; }
.topic-icon { font-size: 18px; line-height: 1; }
.topic-label { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.topic-chip.selected .topic-label { color: var(--primary); }

/* 期待対応チップ */
.response-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.response-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface);
  transition: all var(--transition);
  user-select: none;
}
.response-chip:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-light); }
.response-chip.selected { border-color: var(--teal); background: var(--teal-light); color: var(--teal); }
.response-chip input[type=radio] { display: none; }

/* ============================================================
   セッションカード（タイムライン）
   ============================================================ */
.session-list { display: flex; flex-direction: column; gap: 10px; }
.session-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}
.session-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary); transform: translateY(-1px); }
.session-date-block { text-align: center; min-width: 48px; }
.session-month { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
.session-day { font-size: 26px; font-weight: 700; font-family: 'DM Sans', sans-serif; color: var(--text-primary); line-height: 1; }
.session-info { flex: 1; min-width: 0; }
.session-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.session-meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.session-topic-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.topic-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 500;
}
.session-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ステータスバッジ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 100px;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; display: inline-block; }
.badge-scheduled { background: var(--primary-light); color: var(--primary); }
.badge-in-progress { background: var(--amber-light); color: #B07A1A; }
.badge-completed { background: var(--teal-light); color: #1A8A6B; }
.badge-cancelled { background: #F0F0F0; color: var(--text-muted); }

/* ============================================================
   TODO リスト
   ============================================================ */
.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.todo-item:last-child { border-bottom: none; }
.todo-check {
  width: 18px; height: 18px;
  border: 2px solid var(--border-strong);
  border-radius: 5px;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all var(--transition);
  appearance: none;
  position: relative;
  background: var(--surface);
}
.todo-check:checked {
  background: var(--teal);
  border-color: var(--teal);
}
.todo-check:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 2px;
  width: 6px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}
.todo-content { flex: 1; min-width: 0; }
.todo-title { font-size: 13.5px; font-weight: 500; color: var(--text-primary); }
.todo-title.done { text-decoration: line-through; color: var(--text-muted); }
.todo-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.priority-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.priority-high { background: #E74C3C; }
.priority-medium { background: var(--amber); }
.priority-low { background: var(--teal); }

/* ============================================================
   満足度スター
   ============================================================ */
.star-rating { display: flex; gap: 4px; }
.star { font-size: 24px; cursor: pointer; color: #DDE2E8; transition: color var(--transition), transform var(--transition); }
.star:hover, .star.active { color: var(--amber); transform: scale(1.15); }

/* ============================================================
   アラート・通知
   ============================================================ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  margin-bottom: 16px;
}
.alert-info { background: var(--primary-light); color: var(--primary-dark); border: 1px solid #C4DEFA; }
.alert-success { background: var(--teal-light); color: #1A8A6B; border: 1px solid #A8E8D5; }
.alert-warning { background: var(--amber-light); color: #8A6A18; border: 1px solid #F9D98C; }
.alert-error { background: var(--accent-light); color: #9A1F4E; border: 1px solid #F5B8D4; }

/* ============================================================
   モーダル
   ============================================================ */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,20,40,.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.show { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(.95) translateY(8px); } to { opacity: 1; transform: none; } }
.modal-header {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: var(--bg);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
}
.modal-close:hover { background: var(--border); color: var(--text-primary); }
.modal-body { padding: 20px 22px; }
.modal-footer {
  padding: 14px 22px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   テーブル
   ============================================================ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .5px;
  text-transform: uppercase;
  border-bottom: 1.5px solid var(--border);
  background: var(--surface-alt);
}
tbody td { padding: 13px 14px; border-bottom: 1px solid var(--border); color: var(--text-secondary); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg); }

/* ============================================================
   空状態
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 24px;
  text-align: center;
  color: var(--text-muted);
}
.empty-icon { font-size: 48px; margin-bottom: 14px; opacity: .5; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-desc { font-size: 13px; }

/* ============================================================
   ログインページ
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  background: linear-gradient(135deg, #EBF4FD 0%, #E6F7F3 50%, #F4F6F9 100%);
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 40px 40px;
  width: 100%;
  max-width: 420px;
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 28px;
}
.login-logo .logo-text { font-size: 20px; font-family: 'DM Sans', sans-serif; font-weight: 600; }
.login-title { font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 6px; }
.login-subtitle { font-size: 13px; color: var(--text-muted); text-align: center; margin-bottom: 28px; }

/* ============================================================
   チャートエリア
   ============================================================ */
.chart-wrap {
  position: relative;
  height: 200px;
}

/* ============================================================
   グリッドレイアウト
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ============================================================
   ユーティリティ
   ============================================================ */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.text-sm { font-size: 12.5px; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-teal { color: var(--teal); }
.text-accent { color: var(--accent); }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* 進捗バー */
.progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--primary), var(--teal)); transition: width .6s ease; }

/* スクロールバー */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   レスポンシブ
   ============================================================ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .main-content { margin-left: 0; padding: 60px 16px 16px; }
  .sidebar-toggle { display: flex; }
  .overlay.show { display: block; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .topic-grid { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .login-card { padding: 28px 22px; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .topic-grid { grid-template-columns: 1fr; }
}

/* ローディングスピナー */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* フェードイン */
.fade-in { animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ヒントカード（マネジャー向け） */
.hint-card {
  background: linear-gradient(135deg, var(--primary-light), var(--teal-light));
  border: 1px solid #C4DEFA;
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}
.hint-title { font-size: 12px; font-weight: 700; color: var(--primary); letter-spacing: .5px; text-transform: uppercase; margin-bottom: 8px; }
.hint-body { font-size: 13.5px; color: var(--text-secondary); line-height: 1.7; }
