/* プロジェクト機能 Phase 1 CSS (2026-07-01) */

/* Todayビューのタスク行に注入されるバッジ */
.proj-badge-wrap {
  display: inline-flex;
  margin-left: 8px;
  vertical-align: middle;
}
.proj-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  vertical-align: middle;
}
.proj-badge-name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.proj-badge-unassigned {
  background: #f3f4f6;
  color: #6b7280;
  font-size: 11px;
  padding: 2px 8px;
}

/* Projectsページ グリッド */
.proj-grid-v2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
@media (max-width: 640px) {
  .proj-grid-v2 { grid-template-columns: 1fr; }
}

.proj-card {
  border-radius: 12px;
  padding: 20px 22px;
  cursor: pointer;
  transition: transform 0.1s ease-out, box-shadow 0.15s;
}
.proj-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.proj-card-unassigned {
  background: #fef3c7 !important;
  border: 1px dashed #f59e0b !important;
}
.proj-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.proj-card-emoji {
  font-size: 22px;
  line-height: 1;
}
.proj-card-name {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}
.proj-card-goal {
  font-size: 13px;
  color: #4b5563;
  margin-bottom: 14px;
  line-height: 1.5;
}
.proj-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: #374151;
}
.proj-stat {
  background: rgba(255,255,255,0.7);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 500;
}
.proj-stat b {
  color: #111827;
  font-weight: 800;
  font-size: 15px;
  margin-right: 3px;
}
.proj-stat-warn {
  background: #fee2e2 !important;
  color: #991b1b !important;
}
.proj-stat-warn b {
  color: #991b1b !important;
}

/* プロジェクト詳細エリア */
.proj-detail-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px 28px;
  margin-top: 24px;
}
.proj-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.proj-detail-emoji {
  font-size: 28px;
}
.proj-detail-name {
  font-size: 22px;
  font-weight: 700;
}
.proj-detail-goal {
  font-size: 14px;
  color: #4b5563;
  margin-bottom: 24px;
}
.proj-detail-group {
  margin-bottom: 20px;
}
.proj-detail-label {
  font-size: 14px;
  font-weight: 700;
  color: #374151;
  margin-bottom: 8px;
}
.proj-detail-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.proj-detail-list li {
  padding: 10px 14px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 15px;
  color: #111827;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.proj-detail-list li:last-child { border-bottom: none; }
.proj-detail-due {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}

/* projects.js minimal 用スタイル 2026-07-01 */
.proj-simple-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.proj-simple-card {
  border-radius: 12px;
  padding: 20px 22px;
}
.proj-simple-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.proj-simple-emoji { font-size: 22px; }
.proj-simple-name { font-size: 17px; font-weight: 700; }
.proj-simple-count { font-size: 13px; color: #4b5563; margin-bottom: 12px; }
.proj-simple-count b { font-size: 17px; color: #111827; font-weight: 800; margin-right: 4px; }
.proj-simple-tasklist {
  list-style: none; padding: 0; margin: 0;
  background: rgba(255,255,255,0.6); border-radius: 8px;
}
.proj-simple-tasklist li {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  font-size: 14px;
  color: #111827;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.proj-simple-tasklist li:last-child { border-bottom: none; }
.proj-simple-due { font-size: 12px; color: #6b7280; }

/* 旧要素を強制非表示 */
.project-linked-tasks, .project-list-expand-inner, .project-list-expand, .project-list-item, .proj-summary-bar {
  display: none !important;
}

/* projects.js minimal 用リストスタイル上書き 2026-07-01 */
.proj-simple-tasklist { padding-left: 0 !important; margin-top: 8px !important; }
.proj-simple-tasklist li { list-style: none !important; padding: 8px 12px !important; margin: 0 !important; }
.proj-simple-tasklist li span:first-child { flex: 1; }

/* ============================================================
   Stripe風 KPI + テーブル (Case C - 2026-07-01 redesign)
   ============================================================ */

.proj-empty {
  text-align: center;
  padding: 48px;
  color: #6b7280;
  font-size: 14px;
}

/* ── ラッパー */
.proj-dash {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 4px 0 32px;
}

/* ── 合計サマリー（最上段） */
.proj-dash-summary {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 4px 4px 0;
}
.proj-dash-summary-num {
  font-size: 34px;
  font-weight: 800;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
}
.proj-dash-summary-label {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

/* ── KPIカードグリッド（上部・数字ダッシュ） */
.proj-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
@media (max-width: 900px) {
  .proj-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .proj-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}

.proj-kpi {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px 18px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease-out;
  display: flex;
  flex-direction: column;
  gap: 8px;
  outline: none;
}
.proj-kpi:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}
.proj-kpi:focus-visible {
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.25);
}
.proj-kpi-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 20px;
}
.proj-kpi-emoji {
  font-size: 15px;
  line-height: 1;
}
.proj-kpi-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  letter-spacing: -0.005em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.proj-kpi-num {
  font-size: 30px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-top: 2px;
}
.proj-kpi-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #64748b;
  font-weight: 500;
}
.proj-kpi-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── プロジェクト詳細セクション（下部・テーブル） */
.proj-sections {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}

.proj-section {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px 22px;
  scroll-margin-top: 20px;
  transition: box-shadow 0.3s ease;
}
.proj-section-flash {
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.25);
}

.proj-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}
.proj-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.proj-section-emoji {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}
.proj-section-name {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
}
.proj-section-meta {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-shrink: 0;
}
.proj-section-count {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
}
.proj-section-count-label {
  font-size: 11.5px;
  color: #94a3b8;
  font-weight: 500;
}

/* ── テーブル */
.proj-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: fixed;
}
.proj-tbl tr {
  border-bottom: 1px solid #f1f5f9;
}
.proj-tbl tr:last-child { border-bottom: none; }
.proj-tbl td {
  padding: 11px 8px;
  vertical-align: middle;
  color: #0f172a;
}
.proj-tbl-status {
  width: 18px;
  padding-left: 0 !important;
  padding-right: 0 !important;
  text-align: center;
}
.proj-tbl-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  vertical-align: middle;
}
.proj-tbl-title {
  padding-left: 10px !important;
  line-height: 1.5;
  word-break: break-word;
}
.proj-tbl-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  vertical-align: middle;
  white-space: nowrap;
}
.proj-tbl-due {
  width: 90px;
  text-align: right;
  color: #64748b;
  font-size: 12.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding-right: 4px !important;
}
.proj-tbl-empty {
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  padding: 20px 8px !important;
}

/* モバイル: テーブル → ブロック化 */
@media (max-width: 600px) {
  .proj-section { padding: 16px 14px; }
  .proj-tbl-due {
    width: 60px;
    font-size: 12px;
  }
  .proj-tbl-title {
    font-size: 13.5px;
    padding-left: 8px !important;
  }
  .proj-tbl td {
    padding: 10px 4px;
  }
  .proj-tbl-badge {
    display: inline-block;
    margin-left: 6px;
    font-size: 10.5px;
    padding: 1px 6px;
  }
}
