/* ==========================================================================
   GELEX HUB — Projects (work-projects) — Enterprise redesign
   Card đầy đủ thông tin: status dot, progress lớn, avatar stack, KPI.
   ========================================================================== */

/* Shell */
.wp-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--content-pad-y) var(--content-pad-x) 100px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Header enterprise */
.wp-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 0;
}
.wp-head-left { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wp-head h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.wp-sub { font-size: 12.5px; color: var(--text-3); }
.wp-kpi-row { display: flex; gap: 8px; flex-wrap: wrap; }
.wp-kpi {
  display: flex; align-items: baseline; gap: 5px;
  padding: 6px 11px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  color: var(--text-3);
}
.wp-kpi b { font-size: 15px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.wp-kpi.accent b { color: var(--brand); }
.wp-kpi.danger { border-color: #fecaca; background: #fef2f2; }
.wp-kpi.danger b { color: var(--danger); }

/* Toolbar enterprise */
.wp-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-wrap: wrap;
}
.wp-search {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 160px;
  max-width: 320px;
}
.wp-search svg { color: var(--text-3); flex: none; }
.wp-search input {
  flex: 1;
  height: 30px;
  min-width: 0;
  padding: 0 4px;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--text);
}
.wp-search input::placeholder { color: var(--text-3); }
.wp-role-select {
  height: 30px;
  padding: 0 26px 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.wp-admin-btn { margin-left: auto; }

/* Read-only hint */
.wp-readonly-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--text-3);
  padding: 0 2px;
}
.wp-readonly-hint svg { flex: none; opacity: 0.7; }

/* Grid */
.wp-grid {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

/* Card enterprise đầy đủ thông tin */
.wp-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px 14px;
  border-radius: var(--radius);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: transform var(--ease) 140ms, box-shadow var(--ease) 140ms, border-color var(--ease) 140ms;
  position: relative;
  overflow: hidden;
}
.wp-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-strong);
}
.wp-card.is-overdue { border-left: 3px solid var(--danger); }
.wp-card.is-done { opacity: 0.75; }

/* ---------- Sức khỏe dự án (health) ----------
   Suy ra từ tiến độ vs thời gian: xanh = lành mạnh, vàng = chậm so với lịch,
   đỏ = quá hạn/rủi ro, xám = đã kết thúc. Thể hiện bằng viền trên mảnh. */
.wp-card.is-health-red { border-top: 3px solid var(--danger); }
.wp-card.is-health-yellow { border-top: 3px solid #f59e0b; }
.wp-card.is-health-green { border-top: 3px solid #10b981; }
.wp-card.is-health-done { border-top: 3px solid var(--border-strong); }
.wp-health-chip {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.wp-health-green { background: #ecfdf5; color: #047857; }
.wp-health-yellow { background: #fffbeb; color: #b45309; }
.wp-health-red { background: #fef2f2; color: var(--danger); }
.wp-health-done { background: var(--surface-sunken); color: var(--text-3); }

/* Progress 2 lớp: fill đậm = % việc xong, lớp mờ = % thời gian đã trôi */
.wp-card-progress { position: relative; }
.wp-card-progress-time {
  position: absolute; inset: 0 auto 0 0;
  height: 100%;
  background: var(--border-strong);
  border-radius: 999px;
  opacity: 0.55;
}
.wp-card.is-health-yellow .wp-card-progress-fill { background: #f59e0b; }
.wp-card.is-health-red .wp-card-progress-fill { background: var(--danger); }

/* Mini-stat "còn N việc" */
.wp-card-remain { color: var(--text-3); }
.wp-card-remain::before { content: "·"; margin-right: 6px; color: var(--border-strong); }

/* KPI là nút lọc nhanh */
button.wp-kpi { cursor: pointer; font: inherit; transition: border-color var(--ease) 120ms, background var(--ease) 120ms; }
button.wp-kpi:hover { border-color: var(--border-strong); }
button.wp-kpi.is-active { border-color: var(--brand-border); background: var(--brand-soft); color: var(--brand-dark); }
button.wp-kpi.is-active b { color: var(--brand-dark); }
button.wp-kpi.danger.is-active { border-color: #fecaca; background: #fef2f2; }

/* Skeleton loading */
.wp-card.wp-skel { pointer-events: none; gap: 12px; }
.wp-skel-line, .wp-skel-bar {
  display: block;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--surface-sunken) 25%, #e8e8ea 50%, var(--surface-sunken) 75%);
  background-size: 200% 100%;
  animation: wpShimmer 1.2s ease-in-out infinite;
}
.wp-skel-line { height: 11px; }
.wp-skel-line.w-80 { width: 80%; }
.wp-skel-line.w-60 { width: 60%; }
.wp-skel-line.w-40 { width: 40%; }
.wp-skel-bar { height: 6px; border-radius: 999px; }
@keyframes wpShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Card top: status + code */
.wp-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.wp-card-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
}
.wp-status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-3);
  flex: none;
}
.wp-status-dot.st-doing, .wp-status-dot.st-in_progress { background: var(--brand); }
.wp-status-dot.st-review { background: #f59e0b; }
.wp-status-dot.st-done, .wp-status-dot.st-completed { background: #10b981; }
.wp-status-dot.st-pending, .wp-status-dot.st-pause { background: #94a3b8; }
.wp-status-dot.st-bad, .wp-status-dot.st-cancelled { background: var(--danger); }
.wp-card-code {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-3);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* Title */
.wp-card-title {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  letter-spacing: -0.005em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Progress row */
.wp-card-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wp-card-progress {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.wp-card-progress-fill {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
  transition: width var(--ease) 250ms;
}
.wp-card.is-done .wp-card-progress-fill { background: #10b981; }
.wp-card-progress-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  min-width: 34px;
  text-align: right;
}

/* Meta row */
.wp-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-3);
  flex-wrap: wrap;
}
.wp-card-tasks b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.wp-card-due { color: var(--text-3); }
.wp-card-due.is-overdue { color: var(--danger); font-weight: 600; }

/* Footer: avatar stack + team count + "của bạn" badge */
.wp-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  margin-top: 2px;
}
.wp-card-team {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.wp-avatar-stack {
  display: flex;
  align-items: center;
}
.wp-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--brand), var(--brand-dark));
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  border: 2px solid var(--surface-raised);
  margin-left: -7px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.wp-card:hover .wp-avatar { border-color: var(--surface-raised); }
.wp-avatar:first-child { margin-left: 0; }
.wp-avatar-more {
  background: var(--surface-sunken);
  color: var(--text-2);
  border-color: var(--border-strong);
  font-size: 9.5px;
}
.wp-card-team-count { font-size: 11px; color: var(--text-3); }
.wp-card-mine {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  color: var(--brand-dark);
  background: var(--brand-soft);
  padding: 2px 8px;
  border-radius: 999px;
  flex: none;
}

.wp-empty {
  grid-column: 1 / -1;
  padding: 48px 12px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}
.wp-empty .emoji { font-size: 22px; display: block; margin-bottom: 6px; opacity: 0.7; }

/* "Tải thêm" button */
.wp-load-more {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-dim);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--ease) 140ms;
}
.wp-load-more:hover { background: var(--surface-2); color: var(--text); }
.wp-load-more[disabled] { opacity: 0.5; cursor: default; }

/* ---------- Chi tiết dự án (enterprise redesign) ---------- */
.wpd-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--content-pad-y) var(--content-pad-x) 100px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Breadcrumb */
.wpd-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
  margin: 0;
}
.wpd-breadcrumb a, .wpd-breadcrumb button {
  color: var(--text-3);
  background: none;
  border: none;
  font: inherit;
  font-size: 12px;
  padding: 3px 6px;
  cursor: pointer;
  border-radius: var(--radius-xs);
  text-decoration: none;
  transition: background var(--ease) 120ms, color var(--ease) 120ms;
}
.wpd-breadcrumb a:hover, .wpd-breadcrumb button:hover { color: var(--brand); background: var(--surface-sunken); }
.wpd-breadcrumb .crumb-sep { color: var(--text-3); opacity: 0.5; }
.wpd-breadcrumb .crumb-current { color: var(--text); font-weight: 500; max-width: 400px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Hero header card */
.wpd-hero {
  padding: 20px 24px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wpd-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.wpd-hero-status {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-sunken);
  color: var(--text-2);
}
.wpd-hero-status.st-doing, .wpd-hero-status.st-in_progress { background: var(--brand-soft); color: var(--brand-dark); }
.wpd-hero-status.st-review { background: #fef3c7; color: #b45309; }
.wpd-hero-status.st-done, .wpd-hero-status.st-completed { background: #ecfdf5; color: #047857; }
.wpd-hero-status.st-pending, .wpd-hero-status.st-pause { background: #f1f5f9; color: #64748b; }
.wpd-hero-status.st-bad, .wpd-hero-status.st-cancelled { background: #fef2f2; color: var(--danger); }
.wpd-oneoffice-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.wpd-oneoffice-link:hover { color: var(--brand-dark); }
.wpd-hero-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 2px 0 0;
}
.wpd-hero-code {
  font-size: 11.5px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--text-3);
}
.wpd-hero-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.wpd-hero-progress {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.wpd-hero-progress-fill {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
}
.wpd-hero-progress-fill.is-done { background: #10b981; }
.wpd-hero-progress-num {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  min-width: 40px;
  text-align: right;
}
.wpd-hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-3);
  padding-top: 10px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.wpd-hero-meta-item { display: inline-flex; align-items: center; gap: 3px; }
.wpd-hero-meta-item b { color: var(--text); font-weight: 700; }
.wpd-hero-meta-item.is-overdue { color: var(--danger); font-weight: 600; }
.wpd-hero-meta-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); opacity: 0.4; }
.wpd-hero-meta-team { display: inline-flex; align-items: center; gap: 7px; }
.wpd-hero-meta-team .wp-avatar-stack { display: flex; }

/* Tabs enterprise (underline) */
.wpd-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin: 0;
}
.wpd-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px 11px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-3);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: -1px;
  transition: color var(--ease) 120ms, border-color var(--ease) 120ms;
}
.wpd-tab:hover { color: var(--text); }
.wpd-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.wpd-tab svg { flex: none; }

/* Tab content cards */
.wpd-pane { display: flex; flex-direction: column; gap: 14px; }
.wpd-card {
  padding: 16px 18px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wpd-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wpd-card h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* KPI grid (tab Tổng quan) */
.wpd-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.wpd-kpi {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 16px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.wpd-kpi-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.wpd-kpi-lbl { font-size: 11.5px; color: var(--text-3); }
.wpd-kpi.accent .wpd-kpi-num { color: var(--brand); }
.wpd-kpi.danger { border-color: #fecaca; background: #fef2f2; }
.wpd-kpi.danger .wpd-kpi-num { color: var(--danger); }

/* ---------- Timeline mốc chính (tab Tổng quan) ---------- */
.wpd-timeline {
  display: flex;
  flex-direction: column;
  position: relative;
  padding-left: 6px;
}
.wpd-milestone {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 4px;
  position: relative;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--ease) 100ms;
}
.wpd-milestone:hover { background: var(--surface-sunken); }
/* Đường dọc nối các mốc */
.wpd-milestone::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.wpd-milestone:first-child::before { top: 14px; }
.wpd-milestone:last-child::before { bottom: auto; height: 14px; }
.wpd-milestone-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex: none;
  border: 2px solid var(--surface-raised);
  box-shadow: 0 0 0 1px var(--border-strong);
  background: var(--text-3);
  position: relative;
  z-index: 1;
  margin-left: 3px;
}
.wpd-milestone.is-upcoming .wpd-milestone-dot { background: var(--brand); box-shadow: 0 0 0 1px var(--brand-border); }
.wpd-milestone.is-late .wpd-milestone-dot { background: var(--danger); box-shadow: 0 0 0 1px #fecaca; }
.wpd-milestone.is-done .wpd-milestone-dot { background: #10b981; box-shadow: 0 0 0 1px #a7f3d0; }
.wpd-milestone-date {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  min-width: 52px;
  font-variant-numeric: tabular-nums;
  flex: none;
}
.wpd-milestone-title {
  font-size: 12.5px;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wpd-milestone.is-done .wpd-milestone-title { color: var(--text-3); text-decoration: line-through; }
.wpd-milestone.is-late .wpd-milestone-date { color: var(--danger); }
.wpd-milestone-tag {
  flex: none;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-sunken);
  color: var(--text-3);
}
.wpd-milestone.is-late .wpd-milestone-tag { background: #fef2f2; color: var(--danger); }
.wpd-milestone.is-upcoming .wpd-milestone-tag { background: var(--brand-soft); color: var(--brand-dark); }
.wpd-milestone.is-done .wpd-milestone-tag { background: #ecfdf5; color: #047857; }

/* Status bar chart */
.wpd-status-bars { display: flex; flex-direction: column; gap: 8px; }
.wpd-status-bar { display: flex; align-items: center; gap: 10px; }
.wpd-status-bar-label { font-size: 12px; color: var(--text-2); min-width: 110px; }
.wpd-status-bar-track { flex: 1; height: 7px; background: var(--border); border-radius: 999px; overflow: hidden; }
.wpd-status-bar-fill { display: block; height: 100%; border-radius: 999px; transition: width var(--ease) 250ms; }
.wpd-status-bar-num { font-size: 12px; font-weight: 700; color: var(--text); min-width: 24px; text-align: right; font-variant-numeric: tabular-nums; }

/* Mô tả */
.wpd-descr { font-size: 13px; color: var(--text-2); line-height: 1.6; white-space: pre-wrap; }

/* Info grid */
.wpd-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.wpd-info-item { display: flex; flex-direction: column; gap: 2px; }
.wpd-info-lbl { font-size: 10.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.wpd-info-val { font-size: 13px; color: var(--text); }
.wpd-info-val.is-overdue { color: var(--danger); font-weight: 600; }

/* Task list (tab Việc) */
.wpd-task-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-raised);
}
.wpd-task-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 14px;
  height: 48px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--ease) 100ms;
}
.wpd-task-row:last-child { border-bottom: none; }
.wpd-task-row:hover { background: var(--surface-sunken); }
.wpd-task-row.is-done .wpd-task-title { text-decoration: line-through; color: var(--text-3); }
.wpd-task-row.is-overdue { background: #fef7f7; }
.wpd-task-row.is-overdue:hover { background: #fee2e2; }
.wpd-task-row.is-overdue .wpd-task-due { color: var(--danger); font-weight: 600; }
.wpd-task-icon {
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  flex: none;
}
.wpd-task-row:hover .wpd-task-icon { color: var(--brand-dark); }
.wpd-task-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wpd-task-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wpd-task-meta { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--text-3); }
.wpd-task-meta > * { flex: none; }
.wpd-task-prio { width: 6px; height: 6px; border-radius: 50%; }
.wpd-task-code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 10.5px; }
.wpd-task-recog { color: #d97706; font-weight: 700; font-size: 11px; }
.wpd-task-progress-wrap { display: flex; align-items: center; gap: 6px; flex: none; }
.wpd-task-progress { width: 50px; height: 5px; background: var(--border); border-radius: 999px; overflow: hidden; }
.wpd-task-progress-fill { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.wpd-task-progress-num { font-size: 10.5px; color: var(--text-3); font-variant-numeric: tabular-nums; min-width: 28px; text-align: right; }
.wpd-task-due { font-size: 11.5px; color: var(--text-3); flex: none; font-variant-numeric: tabular-nums; min-width: 60px; text-align: right; }
.wpd-status {
  flex: none;
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.wpd-status.st-doing, .wpd-status.st-in_progress { background: var(--brand-soft); color: var(--brand-dark); }
.wpd-status.st-review { background: #fef3c7; color: #b45309; }
.wpd-status.st-done, .wpd-status.st-completed { background: #ecfdf5; color: #047857; }
.wpd-status.st-pending, .wpd-status.st-pause { background: #f1f5f9; color: #64748b; }
.wpd-status.st-bad, .wpd-status.st-cancelled { background: #fef2f2; color: var(--danger); }

/* Quick-add task toolbar */
.wpd-tasks-toolbar { display: flex; flex-direction: column; gap: 4px; }

/* Member list (tab Thành viên) */
.wpd-member-list { display: flex; flex-direction: column; gap: 0; }
.wpd-member {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.wpd-member:last-child { border-bottom: none; }
.wpd-member-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--brand), var(--brand-dark));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.wpd-member-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.wpd-member-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.wpd-member-title { font-size: 11.5px; color: var(--text-3); }
.wpd-member-code { font-size: 10.5px; font-family: ui-monospace, "SF Mono", Menlo, monospace; color: var(--text-3); }
.wpd-member-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.wpd-member-actions select {
  height: 28px;
  padding: 0 22px 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  color: var(--text);
  background: var(--surface-sunken);
  cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2.5'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 6px center;
}
.wpd-member-del {
  width: 26px; height: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--text-3);
  font-size: 14px; line-height: 1;
  cursor: pointer;
  transition: background var(--ease) 120ms, color var(--ease) 120ms, border-color var(--ease) 120ms;
}
.wpd-member-del:hover { background: #fef2f2; color: var(--danger); border-color: #fecaca; }

/* Role pill */
.wpd-role-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-sunken);
  color: var(--text-3);
}
.wpd-role-pill.brand { background: var(--brand-soft); color: var(--brand-dark); }
.wpd-role-pill.blue { background: #eff6ff; color: #2563eb; }
.wpd-role-pill.slate { background: #f1f5f9; color: #475569; }
.wpd-role-pill.gray { background: #f1f5f9; color: #94a3b8; }

/* Add member form */
.wpd-add-member { border-style: dashed; }
.wpd-add-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wpd-add-row input, .wpd-add-row select {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
}
.wpd-add-row input { flex: 1; min-width: 160px; }
.wpd-add-row input:focus, .wpd-add-row select:focus { outline: none; border-color: var(--brand-border); box-shadow: 0 0 0 3px var(--brand-soft); }
.wpd-add-btn {
  height: 32px;
  padding: 0 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.wpd-add-btn:hover { background: var(--brand-dark); }
.wpd-add-hint { font-size: 11px; color: var(--text-3); line-height: 1.5; }

/* History (tab Nhật ký) */
.wpd-history-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-raised);
}
.wpd-history-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.wpd-history-row:last-child { border-bottom: none; }
.wpd-hist-actor { font-weight: 600; color: var(--text); min-width: 80px; }
.wpd-hist-trans { color: var(--text-2); font-size: 11.5px; }
.wpd-hist-meta { color: var(--text-3); flex: 1; min-width: 120px; }
.wpd-hist-meta em { color: var(--text-3); font-style: italic; }
.wpd-hist-task { color: var(--brand-dark); font-weight: 500; }
.wpd-history-time { color: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.wpd-add-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wpd-add-row input[type="text"] { flex: 1; min-width: 160px; height: 34px; padding: 0 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12.5px; }
.wpd-add-row select { height: 34px; padding: 0 9px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12px; background: var(--surface); }
.wpd-add-row button { height: 34px; padding: 0 14px; border: none; border-radius: var(--radius-sm); background: var(--brand); color: #fff; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.wpd-add-row button:hover { background: var(--brand-dark); }
.wpd-add-hint { font-size: 10.5px; color: var(--text-faint); margin-top: 8px; }

/* ---------- T7: nhật ký dự án ---------- */
.wpd-history-list { display: flex; flex-direction: column; }
.wpd-history-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 4px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12.5px;
}
.wpd-hist-actor { font-weight: 600; color: var(--text); min-width: 90px; }
.wpd-hist-trans { color: var(--text-dim); }
.wpd-hist-meta { color: var(--text-dim); flex: 1; min-width: 120px; }
.wpd-hist-meta em { color: var(--text-faint); font-style: italic; }
.wpd-hist-task { color: var(--brand-dark); font-weight: 500; }
.wpd-history-time { color: var(--text-faint); font-size: 11px; font-variant-numeric: tabular-nums; }

@media (max-width: 720px) {
  .wpd-history-row { flex-direction: column; align-items: flex-start; gap: 3px; }
  .wpd-add-row { flex-direction: column; align-items: stretch; }
  .wpd-add-row input, .wpd-add-row select { width: 100%; }
}
