/**
 * ファイル名: dashboard.css
 * 説明: ActionHub ダッシュボード用スタイルシート
 *
 * このファイルには以下が含まれます:
 * - ヘッダー・ナビゲーション
 * - セクションカード・レイアウト
 * - タスクカード・メモカード
 * - ステータスバッジ・カラム
 * - ダイアログ（モーダル）
 * - プロジェクトビュー
 * - トースト通知
 * - フィードバック機能
 * - 設定・ワークスペースページ
 *
 * 依存: style.css（共通スタイル）
 */

/* レイアウト */
.grid {
  display: grid;
  gap: 16px;
}

.grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 980px) {
  .grid.cols-3 {
    grid-template-columns: 1fr;
  }
}

/* タブセクションのスタイル */
#tabSection {
  margin: 0;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* タスクカード */
.card {
  background: linear-gradient(180deg, var(--card), var(--card2));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 8px;
  position: relative;
}

/* クリック可能なカード */
.card.clickable {
  cursor: pointer;
}

.card:hover {
  background: var(--bg);
}

/* 簡易表示モード：タイトル行のみでコンパクトに */
.card.compact {
  padding: 8px 12px;
  gap: 0;
}

.card.compact .row {
  gap: 8px;
}

/* メモカード専用スタイル */
.memo-card .card-header {
  display: grid;
  gap: 8px;
}

.memo-card .title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.memo-card .status-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid var(--brand);
  color: var(--brand);
}

[data-theme="dark"] .memo-card .status-badge {
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
}

.memo-card h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.memo-card .memo-content {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin: 4px 0;
}

.memo-card .card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.memo-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0;
}

.memo-card .tag {
  align-self: center;
  display: inline-block;
  white-space: nowrap; /* 改行禁止 */
  overflow: hidden; /* はみ出しを隠す */
  text-overflow: ellipsis; /* … に省略 */
  max-width: 120px; /* 好みの最大幅に調整 */
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--green);
  color: var(--green);
}

[data-theme="dark"] .memo-card .tag {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
}

/* ドロップダウンメニュー */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  min-width: 180px;
  max-width: 280px;
  z-index: 1000;
  padding: 4px 0;
}

/* ドロップダウンメニューの位置調整 */
.dropdown-menu-right {
  right: auto;
  left: 0;
}

.dropdown-menu-top {
  top: auto;
  bottom: 100%;
  margin-top: 0;
  margin-bottom: 4px;
}

/* fixed配置のドロップダウンメニュー（overflow対策） */
.dropdown-menu-fixed {
  position: fixed !important;
  z-index: 10000;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}

.dropdown-item:hover {
  background: rgba(37, 99, 235, 0.1);
}

[data-theme="dark"] .dropdown-item:hover {
  background: rgba(59, 130, 246, 0.1);
}

.dropdown-item.danger {
  color: #ef4444;
}

.dropdown-item.danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

[data-theme="dark"] .dropdown-item.danger:hover {
  background: rgba(248, 113, 113, 0.1);
}

.dropdown-item i {
  margin-right: 8px;
  width: 14px;
  text-align: center;
}

.dropdown-menu hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

/* タスク色分けボーダー（控えめな左ボーダー） */
.card.color-default {
  border-left: 3px solid var(--border);
}

.card.color-red {
  border-left: 3px solid #ef4444;
}

.card.color-orange {
  border-left: 3px solid #f97316;
}

.card.color-yellow {
  border-left: 3px solid #eab308;
}

.card.color-green {
  border-left: 3px solid #22c55e;
}

.card.color-blue {
  border-left: 3px solid #3b82f6;
}

.card.color-purple {
  border-left: 3px solid #a855f7;
}

.card.color-pink {
  border-left: 3px solid #ec4899;
}

.card .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

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

.card .meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.ah-badge {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--muted);
}

.ah-badge.infinite {
  color: var(--green);
  border-color: var(--green);
  background: rgba(16, 185, 129, .15);
}

[data-theme="dark"] .ah-badge.infinite {
  background: rgba(52, 211, 153, .15);
}

/* ステータスバッジ */
/* TODO: 黄色系 */
.ah-badge.todo {
  color: var(--yellow);
  border-color: var(--yellow);
  background: rgba(245, 158, 11, .15);
}

[data-theme="dark"] .ah-badge.todo {
  color: #fbbf24;
  background: rgba(251, 191, 36, .15);
}

/* DOING: 青系 */
.ah-badge.doing {
  color: var(--brand);
  border-color: var(--brand);
  background: rgba(59, 130, 246, .15);
}

[data-theme="dark"] .ah-badge.doing {
  color: #60a5fa;
  background: rgba(96, 165, 250, .15);
}

/* BLOCKED: 赤系 */
.ah-badge.blocked {
  color: var(--red);
  border-color: var(--red);
  background: rgba(239, 68, 68, .15);
}

[data-theme="dark"] .ah-badge.blocked {
  color: #f87171;
  background: rgba(248, 113, 113, .15);
}

/* DONE: 緑系 */
.ah-badge.done {
  color: var(--green);
  border-color: var(--green);
  background: rgba(16, 185, 129, .15);
}

[data-theme="dark"] .ah-badge.done {
  color: #34d399;
  background: rgba(52, 211, 153, .15);
}

/* プロジェクトバッジ */
.ah-badge.project-badge {
  font-weight: 500;
}

.ah-badge.project-badge i {
  margin-right: 2px;
  font-size: 12px;
}

/* 期限バッジ */
.ah-badge.due-date-badge {
  font-weight: 500;
}

.ah-badge.due-date-badge i {
  margin-right: 3px;
  font-size: 12px;
}

/* 期限超過（赤） */
.ah-badge.due-overdue {
  background: var(--red);
  color: white;
}

[data-theme="dark"] .ah-badge.due-overdue {
  background: #dc2626;
}

/* 本日期限（オレンジ・強調） */
.ah-badge.due-today {
  background: var(--orange);
  color: white;
  font-weight: 600;
}

[data-theme="dark"] .ah-badge.due-today {
  background: #ea580c;
}

/* 3日以内（黄色） */
.ah-badge.due-soon {
  background: var(--yellow);
  color: #1f2937;
}

[data-theme="dark"] .ah-badge.due-soon {
  background: #ca8a04;
  color: white;
}

/* 通常（グレー） */
.ah-badge.due-normal {
  background: var(--border);
  color: var(--text-muted);
}

[data-theme="dark"] .ah-badge.due-normal {
  background: var(--card);
}

/* 期限テキストスタイル（詳細ダイアログ用） */
.due-text-overdue {
  color: var(--red);
  font-weight: 600;
}

.due-text-today {
  color: var(--orange);
  font-weight: 600;
}

.due-text-soon {
  color: var(--yellow);
}

[data-theme="dark"] .due-text-soon {
  color: #fbbf24;
}

.due-text-normal {
  color: var(--text);
}

.next {
  font-size: 13px;
  color: var(--text);
  border-left: 3px solid var(--brand);
  padding-left: 8px;
}

.progressbar {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  height: 10px;
  overflow: hidden;
}

.progressbar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #60a5fa, #22d3ee);
  width: 0%;
}

.progress-text {
  font-size: 12px;
  color: var(--muted);
}

.columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  height: 100%; /* 親要素の高さを継承 */
}

@media (max-width: 1100px) {
  .columns {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .columns {
    grid-template-columns: 1fr;
  }
}

.col {
  display: flex;
  flex-direction: column;
  min-height: 0; /* Flexアイテムのオーバーフロー対策 */
}

.col h3 {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: .08em;
  flex-shrink: 0;
}

/* ステータス別カラムヘッダー */
[data-col="todo"] > h3 {
  color: #93c5fd;
  border-left: 3px solid #3b82f6;
  padding-left: 8px;
}

[data-col="doing"] > h3 {
  color: #60a5fa;
  border-left: 3px solid #2563eb;
  padding-left: 8px;
}

[data-col="blocked"] > h3 {
  color: #f87171;
  border-left: 3px solid #ef4444;
  padding-left: 8px;
}

[data-col="done"] > h3 {
  color: #34d399;
  border-left: 3px solid #10b981;
  padding-left: 8px;
}

.stack {
  display: grid;
  gap: 10px;
  overflow-y: auto;
  flex: 1;
  align-content: start;
}

.empty {
  color: var(--muted);
  font-size: 12px;
  padding: 8px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  text-align: center;
}

.empty p {
  margin: 0 0 12px 0;
}

.empty button {
  margin-top: 4px;
}

.tabbar {
  display: flex;
  gap: 6px;
}

.tabbar button {
  border-radius: 999px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
}

.tabbar button.active {
  color: var(--text);
  border-color: var(--brand);
  background: var(--card2);
  box-shadow: 0 0 0 3px var(--ring);
}

.tabbar button i {
  margin-right: 4px;
}

.trash-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 16px;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.trash-tab:hover {
  color: var(--text);
}

.trash-tab.active {
  color: var(--text);
  border-bottom-color: #2563eb;
}

.trash-tab i {
  margin-right: 6px;
}

/* メモステータスタブ */
.memo-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 16px;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  transition: all 0.2s;
  border-radius: 4px 4px 0 0;
}

.memo-tab:hover {
  color: var(--text);
  background: rgba(37, 99, 235, 0.05);
}

[data-theme="dark"] .memo-tab:hover {
  background: rgba(59, 130, 246, 0.05);
}

.memo-tab.active {
  color: #60a5fa;
  font-weight: 600;
  border-bottom-color: #2563eb;
  background: rgba(37, 99, 235, 0.1);
}

[data-theme="dark"] .memo-tab.active {
  background: rgba(59, 130, 246, 0.1);
}

.memo-tab strong {
  font-weight: inherit;
}

.memo-tab.active strong {
  color: #60a5fa;
}

.helper {
  font-size: 12px;
  color: var(--muted);
}

.switch {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}

/* ダイアログ（モーダル） */
.dialog {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .45);
  z-index: 2000;
}

.dialog.show {
  display: flex;
}

.dialog .panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  width: min(560px, 92vw);
  max-height: 85vh;
  overflow-y: auto;
}

.dialog .panel h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.dialog .form-group {
  margin-bottom: 16px;
}

.dialog .form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
}

.dialog .form-group label .required,
.dialog .field label .required {
  color: var(--red);
  font-size: 11px;
  font-weight: 400;
  margin-left: 4px;
}

.dialog .form-group .helper {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.dialog .actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.dialog .panel input[type="text"] {
  width: 100%;
}

/* プロジェクト詳細ダイアログ */
#projectDetailDialog .panel {
  width: min(800px, 92vw);
  max-height: 85vh;
  overflow-y: auto;
}

.project-detail-content {
  margin-top: 20px;
}

/* プロジェクト詳細情報 */
.project-detail-info {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
}

.info-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 14px;
}

.info-row:last-child {
  margin-bottom: 0;
}

.info-label {
  font-weight: 600;
  color: var(--text);
  min-width: 80px;
  flex-shrink: 0;
}

.info-value {
  color: var(--text);
  flex: 1;
}

.info-value .text-muted {
  color: var(--muted);
  font-style: italic;
}

/* プロジェクトタスクセクション */
.project-tasks-section {
  margin-top: 20px;
}

.project-tasks-section .tasks-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.project-tasks-section h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.project-tasks-section .tasks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-tasks-section .task-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.project-tasks-section .task-item:hover {
  background: rgba(0, 0, 0, 0.3);
  border-color: var(--brand);
}

.project-tasks-section .task-status-icon {
  font-size: 18px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.project-tasks-section .task-status-icon.todo {
  color: var(--muted);
}

.project-tasks-section .task-status-icon.doing {
  color: var(--brand);
}

.project-tasks-section .task-status-icon.blocked {
  color: #ef4444;
}

.project-tasks-section .task-status-icon.done {
  color: #10b981;
}

.project-tasks-section .task-info {
  flex: 1;
  min-width: 0;
}

.project-tasks-section .task-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-tasks-section .task-next-action {
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 空の状態 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state p {
  margin: 0;
  font-size: 14px;
}

/* ログ履歴 */
.log-list {
  max-height: 300px;
  overflow-y: auto;
  margin-top: 12px;
  padding: 8px;
  background: rgba(0, 0, 0, .2);
  border-radius: 10px;
}

.log-item {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.log-item:last-child {
  border-bottom: none;
}

.log-item .log-date {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
}

.log-item .log-memo {
  color: var(--text);
  white-space: pre-wrap;
  margin-bottom: 4px;
}

.log-item .log-progress {
  color: var(--brand);
  font-size: 11px;
}

/* メニュー */
.menu {
  position: absolute;
  right: 0;
  top: 36px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  z-index: 1100;
  min-width: 180px;
  display: none;
}

.menu.show {
  display: block;
}

.menu .ah-button {
  width: 100%;
  text-align: left;
  margin-bottom: 2px;
}

.menu .ah-button:last-child {
  margin-bottom: 0;
}

.menu hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 6px 0;
}

/* ローディング */
.ah-loading {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

/* アクティビティカードのホバー効果 */
.activity-card-clickable {
  transition: all 0.2s ease;
}

.activity-card-clickable:hover {
  background: var(--bg) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.activity-card-clickable:active {
  transform: translateY(0);
}

/* 色選択UI */
.color-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.color-option {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.color-option:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.color-option.selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--ring);
}

.color-option.selected::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.color-option[data-color="default"] {
  background: var(--border);
}

.color-option[data-color="red"] {
  background: #ef4444;
}

.color-option[data-color="orange"] {
  background: #f97316;
}

.color-option[data-color="yellow"] {
  background: #eab308;
}

.color-option[data-color="green"] {
  background: #22c55e;
}

.color-option[data-color="blue"] {
  background: #3b82f6;
}

.color-option[data-color="purple"] {
  background: #a855f7;
}

.color-option[data-color="pink"] {
  background: #ec4899;
}

/* ユーティリティ */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-1 {
  margin-top: 8px;
}

.mt-2 {
  margin-top: 16px;
}

.mb-1 {
  margin-bottom: 8px;
}

.mb-2 {
  margin-bottom: 16px;
}

.mr-2 {
  margin-right: 8px;
}

.my-2 {
  margin-top: 16px;
  margin-bottom: 16px;
}

/* Flexbox ユーティリティ */
.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.gap-1 {
  gap: 4px;
}

.gap-2 {
  gap: 8px;
}

.gap-3 {
  gap: 12px;
}

.gap-4 {
  gap: 16px;
}

/* テキストユーティリティ */
.text-sm {
  font-size: 13px;
}

.text-xs {
  font-size: 11px;
}

.text-muted {
  color: var(--muted);
}

.text-danger {
  color: var(--red);
}

.text-success {
  color: var(--green);
}

.text-warning {
  color: var(--yellow);
}

/* パディング・マージンユーティリティ */
.p-1 {
  padding: 8px;
}

.p-2 {
  padding: 12px;
}

.p-3 {
  padding: 16px;
}

.p-4 {
  padding: 24px;
}

.px-2 {
  padding-left: 12px;
  padding-right: 12px;
}

.py-2 {
  padding-top: 12px;
  padding-bottom: 12px;
}

/* 幅・高さユーティリティ */
.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

/* ユーザーID表示 */
.user-id-display {
  flex: 1;
  background: var(--bg);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  user-select: all;
  cursor: pointer;
  border: 1px solid var(--border);
}

/*
  ------------------------------------------------------------
  チーム管理・ユーザー設定ページ専用スタイル
  ------------------------------------------------------------
*/

/* グリッドレイアウト（サイドバー + メインコンテンツ） */
.settings-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  margin-top: 20px;
}

@media (max-width: 980px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

/* サイドバーリストアイテム */
.sidebar-list-item {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card2);
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 8px;
  font-size: 14px;
}

.sidebar-list-item:hover {
  background: var(--card);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
}

.sidebar-list-item.active {
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(96, 165, 250, .25);
  color: white;
}

/* メンバーテーブル */
.member-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.member-table th {
  text-align: left;
  padding: 10px;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.member-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.member-table tr:hover {
  background: var(--card);
}

/* 権限バッジ */
.role-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.role-badge.owner {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

[data-theme="dark"] .role-badge.owner {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.role-badge.admin {
  background: rgba(37, 99, 235, 0.15);
  color: #3b82f6;
  border: 1px solid rgba(37, 99, 235, 0.3);
}

[data-theme="dark"] .role-badge.admin {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.role-badge.member {
  background: rgba(100, 116, 139, 0.15);
  color: #64748b;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

[data-theme="dark"] .role-badge.member {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

/* アバター */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--card2);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  color: var(--muted);
}

.avatar.large {
  width: 64px;
  height: 64px;
  font-size: 24px;
}

/* 設定フォーム */
.settings-form {
  margin-top: 16px;
}

.settings-form .form-row {
  margin-bottom: 20px;
}

.settings-form label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
}

.settings-form .form-helper {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.settings-form .ah-input,
.settings-form .ah-select,
.settings-form .ah-textarea {
  width: 100%;
}

/* アラート */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 14px;
  border: 1px solid;
}

/* ライトテーマ（デフォルト） */
.alert.success {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: #059669;
}

.alert.error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #dc2626;
}

.alert.warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: #d97706;
}

.alert.info {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.3);
  color: #1d4ed8;
}

/* ダークテーマ */
[data-theme="dark"] .alert.success {
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.3);
  color: #a7f3d0;
}

[data-theme="dark"] .alert.error {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.3);
  color: #fecaca;
}

[data-theme="dark"] .alert.warning {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.3);
  color: #fde68a;
}

[data-theme="dark"] .alert.info {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

/* ナビゲーションタブ */
.nav-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.nav-tab {
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 600;
}

.nav-tab:hover {
  color: var(--text);
}

.nav-tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* テーマ選択UI */
.settings-menu {
  margin-top: 12px;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.theme-option {
  position: relative;
  cursor: pointer;
}

.theme-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--card2);
  transition: all 0.2s ease;
}

.theme-option:hover .theme-preview {
  border-color: var(--brand);
  background: var(--card);
}

.theme-option input[type="radio"]:checked + .theme-preview {
  border-color: var(--brand);
  background: var(--card);
  box-shadow: 0 0 0 3px var(--ring);
}

.theme-preview i {
  font-size: 32px;
  color: var(--brand);
}

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

.theme-desc {
  font-size: 12px;
  color: var(--muted);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/*
  ------------------------------------------------------------
  ダッシュボード専用スタイル
  ------------------------------------------------------------
*/

/* ワークスペース選択 */
.workspace-select {
  max-width: 200px;
}

/* 通知ボタン */
.notification-button {
  position: relative;
}

.notification-badge {
  display: none;
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--red);
  color: white;
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 0.625rem;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}

/* タブコンテナ */
.tab-container {
  margin: 16px 0;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

/* メモコントロール */
.memo-controls {
  margin-top: 12px;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}

/* リストコントロール */
.list-controls {
  display: flex;
  margin: 12px 0;
  gap: 12px;
  align-items: center;
}

/* タブコンテナも縮小しないように */
.tab-container {
  flex-shrink: 0;
}

/* グリッドレイアウト（スクロール可能エリア） */
.tasks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 12px;
  overflow-y: auto;
  flex: 1;
  align-content: start; /* グリッドアイテムを上詰めに */
}

.memos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 12px;
  overflow-y: auto;
  flex: 1;
  align-content: start;
  align-items: start;          /* カードを上揃え、引き伸ばし防止 */
}

.list-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
  overflow-y: auto;
  flex: 1;
  align-content: start;
}

.board-columns {
  margin-top: 12px;
  overflow-y: auto;
  flex: 1;
}

/* アクティビティリスト */
.activity-list {
  margin-top: 12px;
  overflow-y: auto;
  flex: 1;
}

/* もっと見るボタン */
.load-more-container {
  text-align: center;
  margin-top: 16px;
  display: none;
}

/* エラーメッセージ */
.error-message {
  margin-bottom: 12px;
  padding: 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--red);
  border-radius: 4px;
  color: var(--red);
}

[data-theme="dark"] .error-message {
  background: rgba(248, 113, 113, 0.1);
}

/* メモ変換ダイアログ */
.convert-memo-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  padding: 8px 0;
}

/* ダイアログメッセージ */
.dialog-message {
  margin: 16px 0;
}

/*
  ------------------------------------------------------------
  Tabler Icons アニメーション
  ------------------------------------------------------------
*/

/* Tabler Iconsのスピンアニメーション */
.ti-spin {
  animation: ti-spin 1s linear infinite;
}

@keyframes ti-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ====================================
   プロジェクトビュー
   ==================================== */

.project-controls {
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

.project-card {
  border-left: 4px solid var(--brand);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.project-card .card-header {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.project-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

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

.project-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
  flex: 1;
  min-width: 0;
}

.priority-badge {
  white-space: nowrap;
  flex-shrink: 0;
}

.project-title-row .dropdown {
  flex-shrink: 0;
}

.project-description {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin: 0.75rem 0;
  line-height: 1.5;
}

.project-progress {
  margin-top: 1rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.progress-label {
  font-size: 0.875rem;
  font-weight: 500;
}

.progress-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand);
}

.progress-bar {
  height: 8px;
  background-color: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--blue));
  transition: width 0.3s ease;
}

.project-stats {
  display: flex;
  gap: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.project-stats span {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.project-detail-info {
  margin-bottom: 2rem;
}

.info-row {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.info-label {
  font-weight: 600;
  min-width: 100px;
  color: var(--text-muted);
}

.info-value {
  flex: 1;
}

.project-tasks-section {
  margin-top: 2rem;
}

.project-tasks-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background-color: var(--bg-secondary);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.task-item:hover {
  background-color: var(--bg-hover);
}

.task-status-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.task-status-icon.todo {
  color: #6b7280;
}

.task-status-icon.doing {
  color: #3b82f6;
}

.task-status-icon.blocked {
  color: #ef4444;
}

.task-status-icon.done {
  color: #10b981;
}

.task-info {
  flex: 1;
  min-width: 0;
}

.task-item .task-title {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.task-item .task-next-action {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* プロジェクトカラードット */
.project-color-dot.color-default {
  background-color: var(--muted);
}

.project-color-dot.color-red {
  background-color: var(--red);
}

.project-color-dot.color-orange {
  background-color: var(--orange);
}

.project-color-dot.color-yellow {
  background-color: var(--yellow);
}

.project-color-dot.color-green {
  background-color: var(--green);
}

.project-color-dot.color-blue {
  background-color: var(--blue);
}

.project-color-dot.color-purple {
  background-color: var(--purple);
}

.project-color-dot.color-pink {
  background-color: var(--pink);
}

/* 優先度バッジ */
.priority-badge.priority-highest {
  background-color: var(--red);
  color: #fff;
}

.priority-badge.priority-high {
  background-color: var(--orange);
  color: #fff;
}

.priority-badge.priority-medium {
  background-color: var(--green);
  color: #fff;
}

.priority-badge.priority-low {
  background-color: var(--muted);
  color: #fff;
}

/* ブロッカーバッジ */
.ah-badge.blocker {
  background-color: var(--red);
  color: #fff;
}

/* 進捗情報の補足テキスト */
.progress-note {
  color: var(--muted);
  font-size: 12px;
}

/* ============================================================
   トースト通知
   ============================================================ */

/* トーストコンテナ */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

/* トースト */
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 250px;
  max-width: 400px;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s ease;
  pointer-events: auto;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast i {
  font-size: 20px;
  flex-shrink: 0;
}

.toast span {
  flex: 1;
  font-size: 14px;
  color: var(--text);
}

/* トーストタイプ別スタイル */
.toast-success {
  border-left: 4px solid #10b981;
}

.toast-success i {
  color: #10b981;
}

.toast-error {
  border-left: 4px solid #ef4444;
}

.toast-error i {
  color: #ef4444;
}

.toast-warning {
  border-left: 4px solid #f59e0b;
}

.toast-warning i {
  color: #f59e0b;
}

.toast-info {
  border-left: 4px solid #3b82f6;
}

.toast-info i {
  color: #3b82f6;
}

/* モバイル対応 */
@media (max-width: 600px) {
  .toast-container {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }

  .toast {
    min-width: auto;
    max-width: none;
  }
}

/* ============================================================
   フィードバックボタン・ダイアログ
   ============================================================ */

/* 画面右上固定のフィードバックボタン */
.feedback-button-fixed {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1500;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: linear-gradient(135deg, var(--orange), #d97706);
  color: white;
  border: none;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.feedback-button-fixed:active {
  transform: translateY(0);
}

.feedback-button-fixed i {
  font-size: 18px;
}

@keyframes feedbackPulse {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
  }
  50% {
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.6);
  }
}

/* フィードバックダイアログ */
#dlgFeedback .panel {
  width: min(600px, 92vw);
}

/* モバイル対応 */
@media (max-width: 600px) {
  .feedback-button-fixed {
    top: auto;
    bottom: 16px;
    right: 16px;
    padding: 12px;
  }

  .feedback-button-fixed span {
    display: none;
  }
}

/*
  ------------------------------------------------------------
  .button2 追加モディファイア
  ------------------------------------------------------------
*/

/* 全幅 */
.ah-button.block,
.ah-button2-secondary.block,
.ah-button2-primary.block,
.ah-button2-tertiary.block,
.ah-button2-danger.block {
  display: flex;
  width: 100%;
  justify-content: center;
}

/* flex: 1 */
.ah-button.flex-1,
.ah-button2-secondary.flex-1,
.ah-button2-primary.flex-1,
.ah-button2-tertiary.flex-1,
.ah-button2-danger.flex-1 {
  flex: 1;
}

/* 極小サイズ */
.ah-button.xs,
.ah-button2-secondary.xs,
.ah-button2-primary.xs,
.ah-button2-tertiary.xs,
.ah-button2-danger.xs {
  padding: 4px 8px;
  font-size: 11px;
}

/* 左寄せテキスト */
.ah-button.text-left,
.ah-button2-secondary.text-left,
.ah-button2-primary.text-left,
.ah-button2-tertiary.text-left,
.ah-button2-danger.text-left {
  justify-content: flex-start;
  text-align: left;
}

/*
  ------------------------------------------------------------
  .button3 系統: タブスタイルのボタン
  （ワークスペースのタブ切り替え等で使用）
  ------------------------------------------------------------
*/

.button3 {
  flex: 1;
  padding: 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  transition: all 0.2s ease;
}

.button3:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .button3:hover {
  background: rgba(255, 255, 255, 0.02);
}

.button3.active {
  border-bottom-color: var(--brand);
  color: var(--brand);
}

.button3 i {
  margin-right: 6px;
}

/* インラインリンクスタイル */
.ah-button.inline,
.ah-button2-secondary.inline,
.ah-button2-primary.inline,
.ah-button2-tertiary.inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* ============================================================
   オンボーディング（ウェルカムモーダル & Empty State）
   ============================================================ */

/* ウェルカムモーダル */
.welcome-slide {
  display: none;
  text-align: center;
  padding: 20px 0;
}

.welcome-slide.active {
  display: block;
  animation: fadeIn 0.5s ease;
}

.welcome-icon {
  font-size: 64px;
  color: var(--brand);
  margin-bottom: 20px;
}

.welcome-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.welcome-text {
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 30px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.welcome-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.welcome-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.welcome-dot.active {
  background: var(--brand);
  transform: scale(1.2);
}

/* リッチなEmpty State */
.empty-state-rich {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  background: var(--card-bg);
  border-radius: 16px;
  border: 2px dashed var(--border);
  margin-top: 20px;
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

[data-theme="dark"] .empty-state-icon {
  background: rgba(96, 165, 250, 0.1);
}

.empty-state-icon i {
  font-size: 40px;
  color: var(--brand);
}

.empty-state-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}

.empty-state-text {
  font-size: 15px;
  color: var(--muted);
  max-width: 400px;
  margin-bottom: 24px;
  line-height: 1.5;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
