/* ============================================================
   MinpaQ v3 — シンプルモダン配色（白・黒・グレー・淡い水色）
   青 / 紫 完全排除済み
   ============================================================ */
:root {
  --accent:       #38bdf8;
  --accent-dark:  #0ea5e9;
  --accent-muted: #e0f2fe;
  --surface:      #ffffff;
  --surface-2:    #f8fafc;
  --surface-3:    #f1f5f9;
  --border:       #e2e8f0;
  --border-dark:  #cbd5e1;
  --text:         #0f172a;
  --text-2:       #334155;
  --text-muted:   #64748b;
  --sidebar-bg:   #0f172a;
  --sidebar-2:    #1e293b;
  --sidebar-text: #f1f5f9;
  --sidebar-muted:#64748b;
  --success:      #059669;
  --warning:      #d97706;
  --danger:       #dc2626;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg:    0 20px 48px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
  --radius:       10px;
  --radius-sm:    7px;
  --radius-lg:    14px;
}

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

body {
  font-family: -apple-system, 'Hiragino Sans', 'Meiryo', 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--surface-3);
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ======= アプリレイアウト ======= */
#app-layout { display: flex; height: 100vh; overflow: hidden; }

/* ======= サイドバー ======= */
#sidebar {
  width: 236px; min-width: 236px;
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  height: 100vh; overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,0.04);
}

#sidebar-logo {
  padding: 20px 16px 16px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(14,165,233,0.4);
}

.logo-text { font-size: 16px; font-weight: 700; color: var(--sidebar-text); letter-spacing: -0.4px; }

.sidebar-section { padding: 10px 8px 4px; }

.sidebar-section-label {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--sidebar-muted);
  padding: 0 8px; margin-bottom: 4px;
}

.sidebar-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 7px;
  cursor: pointer; font-size: 13px;
  color: var(--sidebar-muted);
  transition: all 0.14s; margin-bottom: 1px;
  position: relative;
}
.sidebar-item:hover { background: rgba(255,255,255,0.06); color: var(--sidebar-text); }
.sidebar-item.active {
  background: rgba(56,189,248,0.12);
  color: var(--accent);
}
.sidebar-item.active::before {
  content: '';
  position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 2px; height: 16px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.sidebar-item .icon { width: 16px; text-align: center; font-size: 14px; flex-shrink: 0; }
.sidebar-item .badge {
  margin-left: auto; font-size: 10px; font-weight: 600;
  background: rgba(255,255,255,0.07); color: var(--sidebar-muted);
  padding: 1px 6px; border-radius: 8px;
}

.project-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

.sidebar-footer {
  margin-top: auto;
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  background: rgba(0,0,0,0.1);
}

.sidebar-footer .avatar-clickable {
  cursor: pointer;
  transition: opacity 0.15s;
}
.sidebar-footer .avatar-clickable:hover { opacity: 0.8; }

/* ======= メインコンテンツ ======= */
#main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

/* ======= ヘッダー ======= */
#header {
  height: 52px; min-height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 20px; gap: 12px;
  position: relative; z-index: 100;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}

.header-title { font-size: 14px; font-weight: 600; color: var(--text); }

.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }

/* 通知ベル */
.notification-bell {
  position: relative; width: 34px; height: 34px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; background: transparent; border: none;
  color: var(--text-muted); font-size: 16px;
  transition: all 0.12s;
}
.notification-bell:hover { background: var(--surface-3); color: var(--text); }

.notification-badge {
  position: absolute; top: 3px; right: 3px;
  width: 15px; height: 15px;
  background: var(--danger); border-radius: 50%;
  font-size: 9px; font-weight: 700; color: white;
  display: flex; align-items: center; justify-content: center;
  animation: pulseBadge 2s infinite;
}
@keyframes pulseBadge { 0%,100%{transform:scale(1)} 50%{transform:scale(1.2)} }

/* 通知ドロップダウン */
.notification-dropdown {
  position: absolute; top: 52px; right: 14px;
  width: 350px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 1000; display: none; overflow: hidden;
}
.notification-dropdown.open { display: block; }
.notification-dropdown-header {
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; font-weight: 600;
}
.notification-item {
  padding: 9px 14px; border-bottom: 1px solid var(--surface-3);
  cursor: pointer; transition: background 0.1s;
}
.notification-item:hover { background: var(--surface-2); }
.notification-item.unread { background: var(--accent-muted); }
.notification-item .notif-title { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.notification-item .notif-msg { font-size: 11px; color: var(--text-muted); }

/* ヘッダーアバタークリッカブル */
.header-avatar {
  cursor: pointer;
  transition: opacity 0.15s;
  border-radius: 50%;
}
.header-avatar:hover { opacity: 0.75; }

/* ======= タブバー ======= */
.tab-bar {
  display: flex; background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 18px;
}
.tab-btn {
  padding: 11px 14px; font-size: 13px; font-weight: 500;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  cursor: pointer; white-space: nowrap;
  display: flex; align-items: center; gap: 5px;
  transition: all 0.12s; background: none; border-left: none;
  border-right: none; border-top: none;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent-dark); border-bottom-color: var(--accent-dark); }

/* ======= コンテンツエリア ======= */
.content-area { flex: 1; overflow-y: auto; padding: 18px; }

/* ======= プロジェクト一覧テーブル ======= */
.project-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--surface);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.project-table thead tr {
  background: var(--surface-2);
  border-bottom: 2px solid var(--border-dark);
}
.project-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.project-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.project-table tbody tr:last-child td { border-bottom: none; }
.project-table tbody tr {
  cursor: pointer;
  transition: background 0.1s;
}
.project-table tbody tr:hover { background: var(--surface-2); }
.project-table .col-name { font-weight: 600; color: var(--text); }
.project-table .col-progress { min-width: 100px; }

/* ======= Asanaスタイル タスクテーブル ======= */
.task-table-container {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.task-table-header {
  display: flex; align-items: center;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition: background 0.1s;
}
.task-table-header:hover { background: var(--accent-muted); }

/* カラムヘッダー行 */
.task-col-header {
  display: flex; align-items: center;
  padding: 6px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-dark);
  font-size: 10px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  position: sticky; top: 0; z-index: 5;
}

.task-col-name   { flex: 1; min-width: 0; }
.task-col-assignee { width: 90px; flex-shrink: 0; text-align: center; position: relative; }
.task-col-due    { width: 80px; flex-shrink: 0; }
.task-col-prio   { width: 70px; flex-shrink: 0; }
.task-col-hours  { width: 70px; flex-shrink: 0; text-align: center; }
.task-col-status { width: 80px; flex-shrink: 0; }
.task-col-stage  { width: 88px; flex-shrink: 0; }
.task-col-comment{ width: 46px; flex-shrink: 0; text-align: center; }

/* タスク行（Asana風） */
.task-row {
  display: flex; align-items: center;
  padding: 6px 14px; gap: 6px;
  border-bottom: 1px solid var(--surface-3);
  transition: background 0.08s; position: relative;
}
.task-row:hover { background: var(--accent-muted); }
.task-row:last-child { border-bottom: none; }
.task-row.completed .task-title-text { text-decoration: line-through; color: var(--text-muted); }
.task-row.child-task  { padding-left: 38px; background: #fdfdfe; }
.task-row.grandchild-task { padding-left: 60px; background: #fcfcfe; }

/* チェックボックス */
.task-checkbox {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid var(--border-dark);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; transition: all 0.15s;
}
.task-checkbox:hover { border-color: var(--accent-dark); }
.task-checkbox.checked { background: var(--success); border-color: var(--success); }
.task-checkbox.checked::after { content: '✓'; color: white; font-size: 9px; font-weight: 700; }
.task-checkbox.locked { border-color: var(--border); background: var(--surface-3); cursor: not-allowed; }
.task-checkbox.locked::after { content: '🔒'; font-size: 8px; }

/* ツリー展開ボタン */
.task-expand-btn {
  width: 14px; height: 14px; display: flex; align-items: center;
  justify-content: center; font-size: 9px; color: var(--text-muted);
  cursor: pointer; flex-shrink: 0; transition: transform 0.2s;
  background: none; border: none; padding: 0;
}
.task-expand-btn.expanded { transform: rotate(90deg); }
.task-expand-btn.no-children { opacity: 0; pointer-events: none; }

.task-title-text {
  flex: 1; min-width: 0;
  font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text-2); cursor: pointer;
}
.task-title-text:hover { color: var(--accent-dark); }

/* コメント数バッジ */
.comment-count-badge {
  font-size: 11px; color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 2px;
  white-space: nowrap; justify-content: center; cursor: pointer;
  border: 1px solid var(--border); border-radius: 10px; padding: 2px 7px;
  background: var(--surface); transition: all .12s;
}
.comment-count-badge:hover { background: var(--accent-muted); border-color: var(--accent-dark); }
.comment-count-badge.has-comments { color: var(--accent-dark); font-weight: 700; background: var(--accent-muted); border-color: var(--accent-dark); }

/* バッジ類 */
.priority-badge { font-size: 10px; padding: 1px 6px; border-radius: 4px; font-weight: 600; white-space: nowrap; }
.priority-urgent { background: #fee2e2; color: var(--danger); }
.priority-high   { background: #fef3c7; color: var(--warning); }
.priority-medium { background: var(--surface-3); color: var(--text-muted); }
.priority-low    { background: #d1fae5; color: var(--success); }

.status-badge { font-size: 10px; padding: 2px 7px; border-radius: 8px; font-weight: 500; white-space: nowrap; }
.status-pending     { background: var(--surface-3); color: var(--text-muted); }
.status-in_progress { background: var(--accent-muted); color: var(--accent-dark); }
.status-completed   { background: #d1fae5; color: var(--success); }
.status-blocked     { background: #fee2e2; color: var(--danger); }

/* ステージバッジ */
.stage-badge { font-size: 10px; padding: 2px 7px; border-radius: 8px; font-weight: 500; white-space: nowrap; }
.stage-not_started { background: var(--surface-3); color: var(--text-muted); }
.stage-in_review   { background: #fef3c7; color: var(--warning); }
.stage-approved    { background: #d1fae5; color: var(--success); }
.stage-done        { background: var(--accent-muted); color: var(--accent-dark); }

/* タスク行: 直接編集できるコントロール */
.task-title-wrap { flex: 1; min-width: 0; display: flex; align-items: center; gap: 5px; }
.task-rename-btn {
  flex-shrink: 0; border: none; background: none; cursor: pointer; padding: 2px 4px;
  color: var(--text-muted); font-size: 10px; opacity: 0; transition: opacity .12s;
}
.task-row:hover .task-rename-btn { opacity: 1; }
.task-rename-btn:hover { color: var(--accent-dark); }
.task-inline-rename-input { font-size: 13px; padding: 3px 6px; width: 100%; }

.task-subtask-add-btn {
  flex-shrink: 0; border: none; background: none; cursor: pointer; padding: 2px 4px;
  color: var(--text-muted); font-size: 10px; opacity: 0; transition: opacity .12s;
}
.task-row:hover .task-subtask-add-btn { opacity: 1; }
.task-subtask-add-btn:hover { color: var(--accent-dark); }

.subtask-quickadd-row { background: var(--surface-2); }
.subtask-quickadd-input { font-size: 12px; padding: 4px 8px; flex: 1; }

/* タスク移動 */
.task-move-wrap { position: relative; flex-shrink: 0; }
.task-move-btn {
  border: none; background: none; cursor: pointer; padding: 2px 4px; width: 16px;
  color: var(--text-muted); font-size: 11px; opacity: 0; transition: opacity .12s;
}
.task-row:hover .task-move-btn { opacity: 1; }
.task-move-btn:hover { color: var(--accent-dark); }
.move-popover {
  position: absolute; top: 100%; left: 0; background: white; border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,0.12); padding: 6px; z-index: 30; min-width: 170px;
}
.move-popover-item {
  display: flex; align-items: center; gap: 7px; padding: 6px 8px; border-radius: 6px;
  cursor: pointer; font-size: 12px; white-space: nowrap;
}
.move-popover-item:hover { background: var(--surface-2); }
.move-popover-divider { height: 1px; background: var(--border); margin: 4px 0; }
.move-popover-label { font-size: 10px; color: var(--text-muted); padding: 2px 8px 4px; }

/* 一括選択 */
.bulk-select-checkbox { flex-shrink: 0; width: 14px; height: 14px; cursor: pointer; }
.bulk-action-bar {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px; margin-bottom: 8px;
  background: var(--accent-muted); border: 1px solid var(--accent-dark); border-radius: 8px;
  font-size: 13px; font-weight: 600; color: var(--accent-dark);
}

select.status-select, select.stage-select, select.priority-select {
  border: none; cursor: pointer; font-family: inherit; appearance: none;
  -webkit-appearance: none; text-align: center; width: 100%;
}
select.priority-select { font-size: 11px; font-weight: 700; padding: 2px 4px; border-radius: 5px; }
.priority-select.priority-urgent { background: #fee2e2; color: var(--danger); }
.priority-select.priority-high   { background: #fef3c7; color: var(--warning); }
.priority-select.priority-medium { background: #e2e8f0; color: #475569; }
.priority-select.priority-low    { background: #dcfce7; color: var(--success); }

.due-date-input {
  font-size: 11px; border: 1px solid var(--border); border-radius: 6px;
  padding: 2px 4px; width: 100%; background: white; cursor: pointer; color: var(--text);
}
.due-date-input.due-date-overdue { border-color: var(--danger); color: var(--danger); }
.due-date-input.due-date-today   { border-color: var(--warning); color: var(--warning); }

.hours-input {
  width: 52px; font-size: 11px; border: 1px solid var(--border); border-radius: 6px;
  padding: 2px 4px; text-align: center;
}

/* 担当者ポップオーバー */
.assignee-popover {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  background: white; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12); padding: 6px; z-index: 30;
  min-width: 160px; max-height: 220px; overflow-y: auto;
}
.assignee-popover-item {
  display: flex; align-items: center; gap: 7px; padding: 6px 8px; border-radius: 6px;
  cursor: pointer; font-size: 12px; white-space: nowrap;
}
.assignee-popover-item:hover { background: var(--surface-2); }
.assignee-popover-item.selected { background: var(--accent-muted); }

.avatar {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: white; flex-shrink: 0;
  cursor: pointer; transition: opacity 0.15s;
}
.avatar:hover { opacity: 0.8; }
.avatar-lg { width: 32px; height: 32px; font-size: 13px; }
.avatar-sm { width: 18px; height: 18px; font-size: 9px; }

.due-date-badge { font-size: 11px; white-space: nowrap; padding: 1px 5px; border-radius: 4px; }
.due-date-overdue  { color: var(--danger); background: #fee2e2; }
.due-date-today    { color: var(--warning); background: #fef3c7; }
.due-date-upcoming { color: var(--text-muted); }

.restricted-badge { font-size: 10px; color: var(--danger); }

/* ======= ボタン ======= */
.btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 13px; border-radius: 7px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  border: none; transition: all 0.14s; white-space: nowrap;
  text-decoration: none; letter-spacing: -0.1px;
}
.btn-primary { background: var(--accent-dark); color: white; box-shadow: 0 1px 3px rgba(14,165,233,0.25); }
.btn-primary:hover { background: #0284c7; box-shadow: 0 2px 6px rgba(14,165,233,0.35); transform: translateY(-1px); }
.btn-secondary { background: white; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--border-dark); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-danger { background: #fee2e2; color: var(--danger); border: 1px solid #fecaca; }
.btn-danger:hover { background: #fecaca; }
.btn-sm  { padding: 4px 9px; font-size: 12px; border-radius: 6px; }
.btn-xs  { padding: 2px 7px; font-size: 11px; border-radius: 5px; }
.btn-icon{ padding: 6px 7px; }
.btn-success { background: #d1fae5; color: var(--success); border: 1px solid #a7f3d0; }
.btn-success:hover { background: #a7f3d0; }

/* ======= モーダル ======= */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,0.4);
  display: none; align-items: center; justify-content: center;
  z-index: 500; padding: 20px;
  backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  width: 100%; max-width: 540px; max-height: 90vh;
  overflow-y: auto; box-shadow: var(--shadow-lg);
  animation: modalIn 0.22s cubic-bezier(.34,1.26,.64,1);
  border: 1px solid rgba(0,0,0,0.06);
}
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 860px; }
@keyframes modalIn { from{opacity:0;transform:translateY(16px) scale(0.97)} to{opacity:1;transform:none} }
.modal-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; background: var(--surface); z-index: 10;
}
.modal-header h2, .modal-header h3 { font-size: 15px; font-weight: 700; color: var(--text); }
.modal-close {
  background: var(--surface-3); border: none; font-size: 15px; cursor: pointer;
  color: var(--text-muted); padding: 4px 7px; border-radius: 6px;
  transition: all 0.12s;
}
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-body { padding: 20px 22px; }
.modal-footer {
  padding: 14px 22px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 7px;
  position: sticky; bottom: 0; background: var(--surface);
}

/* ======= フォーム ======= */
.form-group { margin-bottom: 16px; }
.form-label {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  margin-bottom: 5px; display: block;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.form-input {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--border); border-radius: 7px;
  font-size: 13px; color: var(--text); background: white;
  font-family: inherit; transition: border-color 0.14s, box-shadow 0.14s;
  outline: none;
}
.form-input:focus {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.1);
}
.form-input::placeholder { color: #cbd5e1; }
select.form-input { cursor: pointer; }
textarea.form-input { min-height: 72px; resize: vertical; }

/* 検索・フィルタバー */
.search-filter-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 18px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.search-input-wrap { position: relative; min-width: 220px; flex: 1; max-width: 360px; }
.search-input-wrap i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 12px; }
.search-input-wrap input { padding-left: 30px; }
.search-filter-bar select.form-input { width: auto; min-width: 110px; padding: 7px 10px; font-size: 12px; }
.search-filter-bar .filter-clear-btn { font-size: 12px; color: var(--text-muted); cursor: pointer; padding: 4px 8px; }
.search-filter-bar .filter-clear-btn:hover { color: var(--text); }

/* プロジェクト情報パネル */
.project-info-panel {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px;
  padding: 14px 18px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.project-info-label { font-size: 11px; color: var(--text-muted); margin-bottom: 3px; }
.project-info-value {
  font-size: 13px; color: var(--text); cursor: pointer; padding: 3px 6px; margin: -3px -6px;
  border-radius: 5px; min-height: 18px; transition: background .12s;
}
.project-info-value:hover { background: var(--surface-2); }
.project-info-empty { color: var(--border-dark); }
.project-info-edit-input { font-size: 13px; padding: 4px 6px; }

/* インライン編集フィールド */
.inline-edit-field {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 8px; border-radius: 6px; cursor: pointer;
  transition: background 0.12s; min-height: 32px;
}
.inline-edit-field:hover { background: var(--surface-2); }
.inline-edit-field select,
.inline-edit-field input[type="date"] {
  border: 1px solid var(--border-dark); border-radius: 5px;
  padding: 4px 7px; font-size: 12px; background: white;
  font-family: inherit; cursor: pointer;
}

/* マルチセレクト担当者 */
.assignee-multi {
  display: flex; flex-wrap: wrap; gap: 6px;
  border: 1px solid var(--border); border-radius: 7px;
  padding: 6px 10px; min-height: 40px; cursor: pointer;
  background: white; transition: border-color 0.12s;
}
.assignee-multi:focus-within { border-color: var(--accent-dark); box-shadow: 0 0 0 2px rgba(14,165,233,0.12); }
.assignee-chip {
  display: flex; align-items: center; gap: 5px;
  background: var(--accent-muted); color: var(--accent-dark);
  border-radius: 12px; padding: 2px 8px; font-size: 11px; font-weight: 600;
}
.assignee-chip .chip-remove { cursor: pointer; opacity: 0.6; font-size: 12px; }
.assignee-chip .chip-remove:hover { opacity: 1; }

/* @メンション入力 */
.mention-suggestion-list {
  position: absolute; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  z-index: 800; max-height: 160px; overflow-y: auto;
  min-width: 180px;
}
.mention-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 11px; cursor: pointer; font-size: 12px;
  transition: background 0.08s;
}
.mention-item:hover, .mention-item.active { background: var(--accent-muted); }

/* ======= 詳細パネル (右スライド) ======= */
#task-detail-panel {
  width: 400px; min-width: 400px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; right: 0; top: 0; bottom: 0;
  z-index: 300; overflow-y: auto;
  box-shadow: -4px 0 20px rgba(0,0,0,0.07);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
}
#task-detail-panel.open { transform: translateX(0); }

/* メンバー詳細パネル */
#member-detail-panel {
  width: 340px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  position: fixed; right: 0; top: 0; bottom: 0;
  z-index: 300; overflow-y: auto;
  box-shadow: -4px 0 20px rgba(0,0,0,0.07);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
}
#member-detail-panel.open { transform: translateX(0); }

.detail-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  position: sticky; top: 0; background: var(--surface); z-index: 10;
}
.detail-close-btn {
  background: none; border: none; font-size: 18px; cursor: pointer;
  color: var(--text-muted); padding: 3px; line-height: 1; flex-shrink: 0;
}
.detail-close-btn:hover { color: var(--text); }
.detail-section { padding: 14px 18px; border-bottom: 1px solid var(--surface-3); }
.detail-section h3 {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 9px;
}
.detail-field { display: flex; align-items: flex-start; margin-bottom: 9px; gap: 8px; }
.detail-field-label { font-size: 12px; color: var(--text-muted); width: 76px; flex-shrink: 0; padding-top: 4px; }
.detail-field-value { font-size: 13px; flex: 1; min-width: 0; }

/* ======= ダッシュボード ======= */
.stat-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s;
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-number { font-size: 30px; font-weight: 800; line-height: 1; margin-bottom: 4px; letter-spacing: -1px; }
.stat-label { font-size: 12px; color: var(--text-muted); }
.progress-bar { height: 5px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; transition: width 0.6s ease; }

/* 個人ダッシュ統計グリッド */
.personal-dash-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.personal-dash-chart-card {
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 18px;
  display: flex;
  flex-direction: column;
}
.personal-chart-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  max-height: 200px;
}

/* ======= カンバンボード ======= */
.kanban-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; min-height: 400px; }
.kanban-col {
  background: var(--surface-2); border-radius: 10px;
  border: 1px solid var(--border); overflow: hidden;
}
.kanban-col-header {
  padding: 10px 14px; font-size: 12px; font-weight: 600;
  color: var(--text-2); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 7px;
}
.kanban-col-header .col-count {
  font-size: 10px; background: var(--surface-3); border-radius: 8px;
  padding: 1px 6px; color: var(--text-muted);
}
.kanban-col-body { padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 200px; }
.kanban-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; cursor: pointer;
  transition: box-shadow 0.14s, transform 0.14s; font-size: 12px;
  box-shadow: var(--shadow-sm);
}
.kanban-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kanban-card-title { font-weight: 500; color: var(--text); margin-bottom: 5px; line-height: 1.4; }
.kanban-card-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.kanban-card-project {
  font-size: 10px; color: var(--text-muted);
  background: var(--surface-3); padding: 1px 6px;
  border-radius: 6px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 120px;
}

/* ======= カレンダー ======= */
.calendar-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 1px; background: var(--border); border-radius: 10px; overflow: hidden; }
.calendar-day-header { background: var(--surface-2); padding: 7px; text-align: center; font-size: 11px; font-weight: 600; color: var(--text-muted); }
.calendar-day { background: var(--surface); min-height: 90px; padding: 5px; }
.calendar-day.other-month { background: var(--surface-2); }
.calendar-day.today { background: #f0faff; }
.calendar-day-number { font-size: 11px; font-weight: 500; color: var(--text-muted); margin-bottom: 3px; }
.calendar-day.today .calendar-day-number {
  background: var(--accent-dark); color: white; width: 20px; height: 20px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px;
}
.calendar-task-bar {
  font-size: 10px; padding: 2px 5px; border-radius: 3px; margin-bottom: 2px;
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: white; font-weight: 500;
}
.calendar-task-bar:hover { opacity: 0.82; }

/* ======= コンフェッティ（クールカラー専用） ======= */
.confetti-piece {
  position: absolute; border-radius: 2px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0%   { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(800deg); opacity: 0; }
}

/* ======= ログイン ======= */
#login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #0f172a 0%, #1e293b 50%, #0c3a5c 100%);
}
.login-card {
  background: var(--surface); border-radius: 20px; padding: 40px;
  width: 100%; max-width: 400px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.28), 0 0 0 1px rgba(255,255,255,0.04);
  animation: fadeIn 0.35s ease;
}
.login-logo { text-align: center; margin-bottom: 30px; }
.login-logo .logo-circle {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  border-radius: 18px; display: flex; align-items: center; justify-content: center;
  font-size: 28px; margin: 0 auto 12px;
  box-shadow: 0 8px 24px rgba(14,165,233,0.35);
}
.login-logo h1 { font-size: 24px; font-weight: 800; color: var(--text); margin-bottom: 4px; letter-spacing: -0.5px; }
.login-logo p { font-size: 13px; color: var(--text-muted); }

/* ======= ユーザー管理 ======= */
.user-card {
  display: flex; align-items: center; gap: 11px; padding: 11px 14px;
  background: var(--surface); border-radius: 9px;
  border: 1px solid var(--border); margin-bottom: 7px;
  cursor: pointer; transition: box-shadow 0.12s;
}
.user-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.07); }
.role-badge { font-size: 11px; padding: 2px 8px; border-radius: 6px; font-weight: 600; }
.role-admin  { background: var(--accent-muted); color: var(--accent-dark); }
.role-leader { background: #fef3c7; color: var(--warning); }
.role-member { background: #d1fae5; color: var(--success); }

/* メンバー詳細パネル内 */
.member-detail-stat {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 0; border-bottom: 1px solid var(--surface-3);
  font-size: 13px;
}
.member-detail-stat:last-child { border-bottom: none; }

/* 生成されたパスワード表示 */
.generated-password-box {
  background: var(--surface-2);
  border: 1px solid var(--border-dark);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: monospace; font-size: 14px;
  font-weight: 700; color: var(--text);
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}

/* ======= テンプレート管理 ======= */
.template-list-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 18px;
  display: flex; align-items: center; gap: 12px; margin-bottom: 8px;
  transition: box-shadow 0.12s; cursor: default;
}
.template-list-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.06); }
.template-builtin-tag {
  font-size: 10px; background: var(--surface-3); color: var(--text-muted);
  padding: 2px 7px; border-radius: 6px;
}

/* テンプレートタスクツリー行 */
.tmpl-task-row {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 10px; border-radius: 6px;
  border: 1px solid var(--border); margin-bottom: 4px;
  background: white; font-size: 12px;
}
.tmpl-task-row.level-1 { margin-left: 16px; }
.tmpl-task-row.level-2 { margin-left: 32px; background: var(--surface-2); }

/* ======= Google Drive / ファイル管理タブ ======= */
.gdrive-panel {
  background: var(--surface); border-left: 1px solid var(--border);
  width: 280px; min-width: 280px; overflow-y: auto;
  display: flex; flex-direction: column;
  transition: width 0.25s ease;
}
.gdrive-panel.collapsed { width: 0; min-width: 0; overflow: hidden; }

.gdrive-toggle-btn {
  position: absolute; left: -18px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 6px 0 0 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; cursor: pointer; color: var(--text-muted);
  transition: background 0.12s;
}
.gdrive-toggle-btn:hover { background: var(--surface-2); }

.gdrive-panel-header {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 7px; justify-content: space-between;
  flex-shrink: 0;
}
.gdrive-file-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 14px; border-bottom: 1px solid var(--surface-3);
  text-decoration: none; color: var(--text); font-size: 12px; transition: background 0.1s;
}
.gdrive-file-item:hover { background: var(--surface-2); }
.gdrive-input-row { display: flex; gap: 7px; padding: 10px 14px; border-bottom: 1px solid var(--border); }

/* ファイル管理タブ内のビュー */
.files-tab-content {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
}

/* Google Calendar 連携エリア */
.gcal-section {
  padding: 14px; border-bottom: 1px solid var(--border);
}
.gcal-section h4 {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 8px;
}
.gcal-status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; padding: 2px 8px; border-radius: 6px;
  font-weight: 600;
}
.gcal-connected { background: #d1fae5; color: var(--success); }
.gcal-disconnected { background: var(--surface-3); color: var(--text-muted); }

/* ======= 空のステート ======= */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.45; }
.empty-state h3 { font-size: 16px; font-weight: 600; margin-bottom: 7px; color: var(--text-2); }
.empty-state p { font-size: 13px; }

/* ======= アニメーション ======= */
@keyframes fadeIn  { from{opacity:0;transform:translateY(4px)}  to{opacity:1;transform:none} }
@keyframes slideIn { from{opacity:0;transform:translateX(10px)} to{opacity:1;transform:none} }
@keyframes slideInRight { from{opacity:0;transform:translateX(-10px)} to{opacity:1;transform:none} }
.fade-in  { animation: fadeIn  0.22s ease; }
.slide-in { animation: slideIn 0.25s ease; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ======= トースト ======= */
#toast-container { position: fixed; bottom: 22px; right: 22px; z-index: 9999; display: flex; flex-direction: column; gap: 7px; }
.toast {
  background: var(--sidebar-bg); color: var(--sidebar-text);
  padding: 10px 14px; border-radius: 9px; font-size: 13px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.14);
  animation: slideIn 0.25s ease, fadeOut 0.28s ease 2.7s forwards;
  display: flex; align-items: center; gap: 7px; max-width: 320px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
@keyframes fadeOut { to { opacity:0; transform: translateY(6px); } }

/* ======= ツールチップ ======= */
[data-tip] { position: relative; }
[data-tip]::before {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%); background: #0f172a; color: white;
  font-size: 11px; padding: 3px 8px; border-radius: 5px; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity 0.12s; z-index: 999;
}
[data-tip]:hover::before { opacity: 1; }

/* ======= スピナー ======= */
.spinner {
  width: 26px; height: 26px; border: 2px solid var(--border);
  border-top-color: var(--accent-dark); border-radius: 50%;
  animation: spin 0.8s linear infinite; display: inline-block;
}

/* ======= 情報バナー / 警告 ======= */
.info-banner {
  background: var(--accent-muted);
  border: 1px solid var(--accent);
  border-radius: 8px; padding: 10px 14px;
  font-size: 12px; color: var(--text-2);
  display: flex; align-items: flex-start; gap: 8px;
}

/* ======= セクション折りたたみ ======= */
.section-toggle { font-size: 10px; color: var(--text-muted); transition: transform 0.2s; flex-shrink: 0; }
.section-toggle.expanded { transform: rotate(90deg); }
.section-name { font-size: 13px; font-weight: 600; flex: 1; color: var(--text); }
.section-stats { font-size: 11px; color: var(--text-muted); }

.section-body { display: none; }
.section-body.expanded { display: block; }

/* ======= プロジェクト作成モーダル ======= */
.template-option-card {
  border: 2px solid var(--border);
  border-radius: 8px; padding: 10px 14px;
  cursor: pointer; transition: all 0.12s;
  font-size: 13px; display: flex; align-items: center; gap: 8px;
}
.template-option-card:hover { border-color: var(--accent); background: var(--accent-muted); }
.template-option-card.selected { border-color: var(--accent-dark); background: var(--accent-muted); }
.template-option-check {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-dark);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 9px;
}
.template-option-card.selected .template-option-check {
  background: var(--accent-dark); border-color: var(--accent-dark); color: white;
}

/* ======= 生成パスワード表示エリア ======= */
.new-member-result {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-top: 14px;
}
.new-member-result h4 { font-size: 13px; font-weight: 700; margin-bottom: 10px; color: var(--text); }

/* ======= レスポンシブ ======= */
@media (max-width: 1100px) {
  .kanban-board { grid-template-columns: repeat(2,1fr); }
  .task-col-hours, .task-col-stage { display: none; }
}
@media (max-width: 900px) {
  .task-col-comment { display: none; }
  .personal-dash-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 640px) {
  #sidebar { display: none; }
  .content-area { padding: 10px; }
  #task-detail-panel { width: 100%; min-width: 100%; }
  #member-detail-panel { width: 100%; }
  .notification-dropdown { width: 290px; right: -8px; }
  .kanban-board { grid-template-columns: 1fr; }
  .task-col-assignee, .task-col-prio, .task-col-hours, .task-col-stage { display: none; }
}
