/**
 * TaskBuilder - frontend Dashboard ([wppm_dashboard], e.g. /dashboard/)
 * Scoped to .wppm-fd. Same look as the admin dashboard (wppm-dashboard-saas.css), with a few
 * resets because theme styles for headings, lists and links vary.
 * Status colors come inline from Settings.
 */
.wppm-fd,
.wppm-fd *,
.wppm-fd *::before,
.wppm-fd *::after {
  box-sizing: border-box;
}
.wppm-fd-wrap {
  container-type: inline-size;
}
.wppm-fd {
  --fd-primary: #4f46e5;
  --fd-primary-dark: #4338ca;
  --fd-primary-light: #eef2ff;
  --fd-ink: #111827;
  --fd-muted: #6b7280;
  --fd-border: #e5e7eb;
  --fd-bg: #f8fafc;
  --fd-surface: #ffffff;
  --fd-radius: 14px;
  --fd-shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 24px -12px rgba(16,24,40,.10);
  --fd-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  border-radius: var(--fd-radius);
  background: var(--fd-bg);
  color: var(--fd-ink);
  font: 14px/1.5 var(--fd-font);
}
/* Themes often force underlines (and border / box-shadow underlines) on content links */
.wppm-fd a,
.wppm-fd a * {
  border-bottom: 0 !important;
  box-shadow: none;
  text-decoration: none !important;
}
.wppm-fd ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.wppm-fd li {
  margin: 0;
}
.wppm-fd .dashicons {
  width: 16px;
  height: 16px;
  font-size: 16px;
  line-height: 1;
}

/* ---------- Header ---------- */
.wppm-fd-header {
  margin-bottom: 18px;
}
.wppm-fd-date {
  color: var(--fd-primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.wppm-fd .wppm-fd-title {
  margin: 4px 0 2px;
  padding: 0;
  border: none;
  color: var(--fd-ink);
  font: 700 26px/1.25 var(--fd-font);
  letter-spacing: -0.02em;
}
.wppm-fd .wppm-fd-subtitle {
  margin: 0;
  color: var(--fd-muted);
  font-size: 13.5px;
}

/* ---------- Quick links ---------- */
.wppm-fd-quick {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.wppm-fd .wppm-fd-quick-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--fd-border);
  border-radius: 12px;
  background: var(--fd-surface);
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
  color: var(--fd-ink);
  transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease, background-color .12s ease;
}
.wppm-fd .wppm-fd-quick-item:hover {
  border-color: #c7d2fe;
  box-shadow: var(--fd-shadow);
  color: var(--fd-ink);
  transform: translateY(-1px);
}
.wppm-fd .wppm-fd-quick-item:focus-visible {
  outline: none;
  border-color: var(--fd-primary);
  box-shadow: 0 0 0 3px var(--fd-primary-light);
}
.wppm-fd .wppm-fd-quick-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--fd-primary-light);
  color: var(--fd-primary);
  font-size: 18px;
}
.wppm-fd-quick-text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}
.wppm-fd-quick-label {
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.wppm-fd-quick-hint {
  overflow: hidden;
  color: var(--fd-muted);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.wppm-fd .wppm-fd-quick-go {
  flex: none;
  color: #cbd5e1;
  transition: color .12s ease, transform .12s ease;
}
.wppm-fd .wppm-fd-quick-item:hover .wppm-fd-quick-go {
  color: var(--fd-primary);
  transform: translateX(2px);
}
.wppm-fd .wppm-fd-quick-item.is-primary {
  border-color: var(--fd-primary);
  background: var(--fd-primary);
  color: #fff;
}
.wppm-fd .wppm-fd-quick-item.is-primary:hover {
  border-color: var(--fd-primary-dark);
  background: var(--fd-primary-dark);
  color: #fff;
}
.wppm-fd .wppm-fd-quick-item.is-primary .wppm-fd-quick-icon {
  background: rgba(255,255,255,.18);
  color: #fff;
}
.wppm-fd .wppm-fd-quick-item.is-primary .wppm-fd-quick-hint {
  color: rgba(255,255,255,.8);
}
.wppm-fd .wppm-fd-quick-item.is-primary .wppm-fd-quick-go {
  color: #fff;
}

/* ---------- Stat tiles ---------- */
.wppm-fd-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.wppm-fd-stat {
  --tone: #4f46e5;
  --tone-bg: #eef2ff;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--fd-border);
  border-radius: var(--fd-radius);
  background: var(--fd-surface);
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.wppm-fd-stat.is-sky   { --tone: #0284c7; --tone-bg: #e0f2fe; }
.wppm-fd-stat.is-amber { --tone: #d97706; --tone-bg: #fef3c7; }
.wppm-fd-stat.is-rose  { --tone: #dc2626; --tone-bg: #fee2e2; }
.wppm-fd .wppm-fd-stat-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--tone-bg);
  color: var(--tone);
  font-size: 20px;
}
.wppm-fd-stat-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.wppm-fd-stat-value {
  color: var(--fd-ink);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.wppm-fd-stat.has-alert .wppm-fd-stat-value {
  color: #dc2626;
}
.wppm-fd-stat-label {
  overflow: hidden;
  color: var(--fd-muted);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ---------- Cards ---------- */
.wppm-fd-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.wppm-fd-card {
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--fd-border);
  border-radius: var(--fd-radius);
  background: var(--fd-surface);
  box-shadow: var(--fd-shadow);
}
.wppm-fd-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.wppm-fd .wppm-fd-card-head h3 {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 0;
  border: none;
  color: var(--fd-ink);
  font: 700 15px/1.3 var(--fd-font);
  letter-spacing: 0;
  text-transform: none;
}
.wppm-fd .wppm-fd-card-head h3 .dashicons {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--fd-primary-light);
  color: var(--fd-primary);
  font-size: 15px;
}
.wppm-fd .wppm-fd-viewall {
  padding: 4px 8px;
  border-radius: 7px;
  color: var(--fd-primary);
  font-size: 12.5px;
  font-weight: 600;
}
.wppm-fd .wppm-fd-viewall:hover {
  background: var(--fd-primary-light);
  color: var(--fd-primary-dark);
}
.wppm-fd-count {
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11.5px;
  font-weight: 600;
}
.wppm-fd .wppm-fd-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 6px 0 2px;
  padding: 18px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  color: var(--fd-muted);
  font-size: 13px;
}

/* My tasks rows: status-colored accent, title + project, status badge, due date */
.wppm-fd-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 14px;
  border-bottom: 1px solid #eef2f7;
  box-shadow: inset 3px 0 0 var(--fd-accent, #cbd5e1);
}
.wppm-fd-row:last-child {
  border-bottom: none;
}
.wppm-fd-row:hover,
.wppm-fd-project:hover {
  background: #f8faff;
}
.wppm-fd-row-main,
.wppm-fd-project-main {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}
.wppm-fd .wppm-fd-row-title {
  overflow: hidden;
  color: var(--fd-ink);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.wppm-fd a.wppm-fd-row-title:hover {
  color: var(--fd-primary);
  text-decoration: underline !important;
}
.wppm-fd-row-sub {
  overflow: hidden;
  color: var(--fd-muted);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.wppm-fd-badge {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}
.wppm-fd-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.wppm-fd-due {
  flex: none;
  min-width: 58px;
  color: #334155;
  font-size: 12.5px;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.wppm-fd-due.is-overdue {
  color: #dc2626;
  font-weight: 600;
}
.wppm-fd-due.is-today {
  color: #b45309;
  font-weight: 600;
}
.wppm-fd-muted {
  flex: none;
  min-width: 58px;
  color: var(--fd-muted);
  text-align: right;
}

/* Project statistics: stacked bar + legend */
.wppm-fd-bar {
  display: flex;
  gap: 3px;
  height: 12px;
  margin: 6px 0 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #f1f5f9;
}
.wppm-fd-bar span {
  min-width: 6px;
  border-radius: 999px;
}
.wppm-fd-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}
.wppm-fd-legend li:last-child {
  border-bottom: none;
}
.wppm-fd-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.wppm-fd-legend-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: #334155;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.wppm-fd-legend-num {
  color: var(--fd-ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Recent projects: name + tasks done, progress, status, due */
.wppm-fd-project {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 10px;
  border-bottom: 1px solid #eef2f7;
}
.wppm-fd-project:last-child {
  border-bottom: none;
}
.wppm-fd-progress {
  flex: 0 0 140px;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}
.wppm-fd-progress span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--fd-primary);
}
.wppm-fd-percent {
  flex: 0 0 36px;
  color: #334155;
  font-size: 12.5px;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- Narrow (container) ---------- */
@container (max-width: 860px) {
  .wppm-fd-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .wppm-fd-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .wppm-fd-progress {
    flex-basis: 90px;
  }
}
@container (max-width: 560px) {
  .wppm-fd {
    padding: 16px 14px;
  }
  .wppm-fd .wppm-fd-title {
    font-size: 21px;
  }
  .wppm-fd-quick {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .wppm-fd-quick-hint,
  .wppm-fd .wppm-fd-quick-go {
    display: none;
  }
  .wppm-fd-stat {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 14px;
  }
  .wppm-fd-row,
  .wppm-fd-project {
    flex-wrap: wrap;
    row-gap: 6px;
  }
  .wppm-fd-row-main,
  .wppm-fd-project-main {
    flex-basis: 100%;
  }
  .wppm-fd-progress {
    flex: 1 1 auto;
  }
  .wppm-fd-due,
  .wppm-fd-muted {
    min-width: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .wppm-fd .wppm-fd-quick-item,
  .wppm-fd .wppm-fd-quick-go {
    transition: none;
  }
  .wppm-fd .wppm-fd-quick-item:hover {
    transform: none;
  }
}

/* =====================================================================
   [wppm_my_tasks] on the frontend: the wp-admin My Tasks screen (wppm-my-tasks-saas.css)
   inside a theme's content area.
   ===================================================================== */
.wppm-mt-front {
  container-type: inline-size;
}
.wppm-mt-front .wppm-mt {
  margin: 0;
}
/* Themes underline content links; task rows and tabs are links */
.wppm-mt-front a,
.wppm-mt-front a * {
  border-bottom: 0 !important;
  box-shadow: none;
  text-decoration: none !important;
}
.wppm-mt-front .wppm-mt-row.is-done .wppm-mt-task-name {
  text-decoration: line-through !important;
}
.wppm-mt-front h1.wppm-mt-title {
  margin-top: 0;
  padding: 0;
  border: none;
}
/* The admin stylesheet sizes the stat tiles by window width; here the content area decides */
@container (max-width: 900px) {
  .wppm-mt-front .wppm-mt-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@container (max-width: 640px) {
  .wppm-mt-front .wppm-mt-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Clickable stat tiles (link to Projects / My Tasks tabs) */
.wppm-fd .wppm-fd-stat.is-link {
  position: relative;
  color: inherit;
  cursor: pointer;
  transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.wppm-fd .wppm-fd-stat.is-link:hover {
  border-color: #c7d2fe;
  box-shadow: var(--fd-shadow);
  transform: translateY(-1px);
}
.wppm-fd .wppm-fd-stat.is-link:focus-visible {
  outline: none;
  border-color: var(--fd-primary);
  box-shadow: 0 0 0 3px var(--fd-primary-light);
}
.wppm-fd .wppm-fd-stat-go {
  margin-left: auto;
  flex: none;
  color: #cbd5e1;
  transition: color .12s ease, transform .12s ease;
}
.wppm-fd .wppm-fd-stat.is-link:hover .wppm-fd-stat-go {
  color: var(--tone);
  transform: translateX(2px);
}
@container (max-width: 560px) {
  .wppm-fd .wppm-fd-stat-go {
    position: absolute;
    top: 14px;
    right: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .wppm-fd .wppm-fd-stat.is-link,
  .wppm-fd .wppm-fd-stat-go {
    transition: none;
  }
  .wppm-fd .wppm-fd-stat.is-link:hover {
    transform: none;
  }
}
