/* Home / Money Dashboard — aligné sur le design system Workers (light + dark).
   Toutes les couleurs viennent des tokens globaux (style.css).
   Full-bleed sur mobile, centré et max-width sur desktop. */

/* ---------- Full-bleed sur la home ---------- */
.app-content.is-dashboard,
main.app-content:has(.wg-dashboard) {
  padding-left: 0;
  padding-right: 0;
  padding-top: 0;
}

.wg-dashboard {
  --wg-radius: var(--r-lg);
  --wg-radius-lg: var(--r-xl);
  --wg-gap: 16px;

  background: var(--bg);
  color: var(--text);
  padding: 16px var(--gutter) 24px;
  display: flex;
  flex-direction: column;
  gap: var(--wg-gap);
  font-family: var(--font);
  width: 100%;
  max-width: var(--site-width-md);
  margin: 0 auto;
}

/* Large : grille 2 colonnes pour occuper la hauteur */
@media (min-width: 1200px) {
  .wg-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .wg-hero, .wg-activity { grid-column: 1 / -1; }
}

.wg-dashboard * { box-sizing: border-box; }

/* ---------- HERO ---------- */
.wg-hero {
  position: relative;
  border-radius: var(--wg-radius-lg);
  padding: 26px 22px 24px;
  background: var(--grad);
  overflow: hidden;
  border: 1px solid transparent;
  box-shadow: var(--e2), var(--glow);
  color: #fff;
}
.wg-hero__halo {
  position: absolute;
  top: -90px; right: -90px;
  width: 280px; height: 280px;
  background: radial-gradient(closest-side, rgba(255,255,255,0.28), rgba(255,255,255,0));
  filter: blur(20px);
  pointer-events: none;
}
.wg-hero__inner { position: relative; }
.wg-hero__greeting {
  font-size: 14px;
  color: rgba(255,255,255,0.82);
  margin: 0 0 8px;
  font-weight: 500;
}
.wg-hero__amount {
  font-family: var(--display);
  font-size: clamp(44px, 13vw, 60px);
  line-height: 1;
  font-weight: 700;
  color: #fff;
  margin: 0;
  letter-spacing: -0.02em;
  display: flex; align-items: baseline; gap: 4px;
  font-variant-numeric: tabular-nums;
}
.wg-hero__amount-currency {
  font-size: 0.45em; color: rgba(255,255,255,0.85); font-weight: 600;
}
.wg-hero__subtitle {
  margin: 6px 0 16px;
  color: rgba(255,255,255,0.82);
  font-size: 15px;
  font-weight: 500;
}
.wg-hero__chip {
  display: inline-block;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.22);
  color: #fff;
  padding: 9px 14px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  backdrop-filter: blur(8px);
}
.wg-hero__cta {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff;
  color: var(--primary-ink);
  border: 0;
  padding: 13px 22px;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,0.35);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.wg-hero__cta:active { transform: scale(0.98); }

/* ---------- CARD BASE ---------- */
.wg-goal, .wg-week, .wg-shift, .wg-opps, .wg-activity {
  background: var(--surface);
  border: 1px solid var(--border-c);
  border-radius: var(--wg-radius);
  padding: 18px;
  box-shadow: var(--e1);
  color: var(--text);
}
.wg-goal h2, .wg-week h2, .wg-shift h2, .wg-opps h2, .wg-activity h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-family: var(--font);
}

/* ---------- GOAL ---------- */
.wg-goal__header { display: flex; justify-content: space-between; align-items: baseline; }
.wg-goal__target { color: var(--text-2); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.wg-goal__remaining {
  margin: 10px 0 14px;
  font-size: 15px;
  color: var(--text-2);
}
.wg-goal__remaining strong {
  font-size: clamp(22px, 6vw, 28px);
  color: var(--text);
  font-weight: 700;
  font-family: var(--display);
  font-variant-numeric: tabular-nums;
  margin-right: 4px;
}
.wg-goal__bar {
  position: relative;
  height: 10px;
  background: var(--surface-3);
  border-radius: var(--r-full);
  overflow: visible;
}
.wg-goal__bar-pending, .wg-goal__bar-secured {
  position: absolute; inset: 0 auto 0 0;
  border-radius: var(--r-full);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.wg-goal__bar-pending { background: var(--primary-tint); }
.wg-goal__bar-secured { background: var(--money); }
.wg-goal__tier {
  position: absolute; top: 50%;
  width: 8px; height: 8px; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--border-strong);
}
.wg-goal__tier.is-reached { background: var(--money); }
.wg-goal__stats {
  display: flex; gap: 12px; margin-top: 16px;
  min-width: 0;
  }
.wg-goal__stat {
  flex: 1;
  background: var(--surface-2);
  padding: 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-c);
  min-width: 0;
}
.wg-goal__stat-value {
  display: block;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.wg-goal__stat-label {
  display: block;
  color: var(--text-3);
  font-size: 12px;
  margin-top: 2px;
}
.wg-goal__stat.is-secured .wg-goal__stat-value { color: var(--money-ink); }
.wg-goal__stat.is-pending .wg-goal__stat-value { color: var(--primary-ink); }
.wg-goal__cta {
  margin-top: 14px;
  width: 100%;
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary-ink);
  padding: 12px;
  border-radius: var(--r-md);
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  font-family: var(--font);
}
.wg-goal__cta:active { background: var(--primary-tint); }

/* ---------- WEEK STRIP ---------- */
.wg-week__header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.wg-week__total {
  font-family: var(--display);
  font-size: 18px; font-weight: 700; color: var(--money-ink);
  font-variant-numeric: tabular-nums;
}
.wg-week__strip {
  display: flex; justify-content: space-between; gap: 4px;
  width: 100%; padding: 0; border: 0; background: transparent; cursor: pointer;
}
.wg-week__pill {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 6px 0;
}
.wg-week__pill-label {
  font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em;
}
.wg-week__pill-dot {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface-3); border: 1px solid var(--border-c);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.wg-week__pill.is-filled .wg-week__pill-dot {
  background: var(--money);
  border-color: var(--money);
}

/* ---------- NEXT SHIFT ---------- */
.wg-shift__header { margin-bottom: 12px; }
.wg-shift__card {
  background: var(--surface-2);
  padding: 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-c);
}
.wg-shift__top { display: flex; align-items: center; gap: 12px; }
.wg-shift__meta { flex: 1; min-width: 0; }
.wg-shift__job { margin: 0; font-weight: 700; color: var(--text); font-size: 15px; }
.wg-shift__company { margin: 2px 0 0; color: var(--text-2); font-size: 13px; }
.wg-shift__amount {
  font-family: var(--display);
  font-weight: 700; color: var(--money-ink); font-size: 20px;
  font-variant-numeric: tabular-nums;
}
.wg-shift__when {
  margin: 10px 0 12px; color: var(--text-2); font-size: 13px;
  display: flex; gap: 4px; flex-wrap: wrap;
}
.wg-shift__date { text-transform: capitalize; color: var(--text); font-weight: 600; }
.wg-shift__actions { display: flex; gap: 8px; }
.wg-shift__btn {
  flex: 1;
  padding: 10px 12px;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  border: 1px solid var(--border-c);
  transition: transform 0.1s ease;
  font-family: var(--font);
}
.wg-shift__btn:active { transform: scale(0.98); }
.wg-shift__btn.is-primary {
  background: var(--primary);
  color: var(--on-primary);
  border-color: transparent;
}
.wg-shift__btn.is-ghost {
  background: transparent;
  color: var(--text);
}

/* ---------- OPPORTUNITIES ---------- */
.wg-opps__header {
  display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px;
}
.wg-opps__link {
  background: transparent; border: 0; color: var(--primary-ink); font-weight: 600;
  font-size: 13px; cursor: pointer; padding: 4px 8px; font-family: var(--font);
}
.wg-opps__grid { display: grid; gap: 12px; }
.wg-opp {
  background: var(--surface-2);
  border: 1px solid var(--border-c);
  border-radius: var(--r-md);
  padding: 14px;
}
.wg-opp__head { display: flex; justify-content: space-between; align-items: center; }
.wg-opp__match {
  background: var(--money-tint);
  color: var(--money-ink);
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 700;
}
.wg-opp__gain {
  margin: 10px 0 6px;
  display: flex; align-items: baseline; gap: 6px;
}
.wg-opp__gain-value {
  font-family: var(--display);
  font-size: clamp(20px, 5.5vw, 26px); font-weight: 700; color: var(--money-ink);
  font-variant-numeric: tabular-nums;
}
.wg-opp__gain-unit { font-size: 12px; color: var(--text-3); }
.wg-opp__job { margin: 4px 0 2px; font-weight: 700; font-size: 14px; color: var(--text); }
.wg-opp__company { margin: 0 0 10px; color: var(--text-2); font-size: 12px; }
.wg-opp__tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.wg-opp__tag {
  background: var(--surface-3);
  color: var(--text-2);
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 500;
}
.wg-opp__cta {
  width: 100%;
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary-ink);
  padding: 10px;
  border-radius: var(--r-md);
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font);
}
.wg-opp__cta:active { background: var(--primary-tint); }

/* ---------- ACTIVITY ---------- */
.wg-activity__list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.wg-activity__row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.wg-activity__dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.wg-activity__dot.is-green { background: var(--money); }
.wg-activity__dot.is-purple { background: var(--primary); }
.wg-activity__dot.is-amber { background: var(--opp-solid); }
.wg-activity__label { flex: 1; color: var(--text);   min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  }
.wg-activity__when { color: var(--text-3); font-size: 12px; }

/* ---------- SKELETONS ---------- */
.wg-skel {
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: wg-skel 1.4s ease-in-out infinite;
  border-radius: var(--r-md);
}
@keyframes wg-skel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.wg-skel--hero { height: 220px; border-radius: var(--r-xl); }
.wg-skel--card { height: 140px; border-radius: var(--r-lg); }

@media (prefers-reduced-motion: reduce) {
  .wg-skel { animation: none; }
  .wg-goal__bar-pending, .wg-goal__bar-secured { transition: none; }
}

/* ── Ça n'attend que toi : propositions à accepter en 1 tap ─────────────── */
.wg-accepts { margin: 0 0 var(--spacing-lg, 16px); }

.wg-accepts__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-md, 12px) var(--spacing-sm, 8px);
}

.wg-accepts__header h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.wg-accepts__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary, #fff);
  font-size: 0.75rem;
  font-weight: 700;
}

.wg-accepts__rail {
  display: flex;
  gap: var(--spacing-md, 12px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px var(--spacing-md, 12px) 8px;
  scrollbar-width: none;
}
.wg-accepts__rail::-webkit-scrollbar { display: none; }

.wg-accept {
  flex: 0 0 100%;
  scroll-snap-align: start;
  background: var(--surface);
  border: 1px solid var(--border-c);
  border-radius: var(--r-lg, 16px);
  padding: var(--spacing-lg, 16px);
  box-shadow: var(--e1);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md, 12px);
  transition: opacity 0.26s ease, transform 0.26s ease;
}
@media (min-width: 768px) { .wg-accept { flex-basis: calc(50% - 6px); } }

.wg-accept--leaving { opacity: 0; transform: translateX(-16px) scale(0.97); }

.wg-accept__row { display: flex; align-items: center; gap: 12px; }

.wg-accept__meta { flex: 1 1 auto; min-width: 0; }

.wg-accept__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wg-accept__company {
  margin: 2px 0 0;
  font-size: 0.8125rem;
  color: var(--text-grey);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wg-accept__pay { text-align: right; flex: 0 0 auto; }
.wg-accept__pay-amount {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
}
.wg-accept__pay-unit { font-size: 0.75rem; color: var(--text-grey); }

.wg-accept__signals { display: flex; flex-wrap: wrap; gap: 8px; }

.wg-accept__chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}
.wg-accept__chip--match {
  background: var(--primary-tint);
  color: var(--primary);
}
.wg-accept__chip--fit {
  background: var(--success-tint, rgba(46, 204, 113, 0.12));
  color: var(--success, #1faa6b);
}

.wg-accept__actions { display: flex; gap: 8px; }

.wg-accept__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 10px 16px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.wg-accept__btn:active { transform: scale(0.97); }
.wg-accept__btn:disabled { opacity: 0.6; cursor: wait; }

.wg-accept__btn--primary {
  flex: 1 1 auto;
  background: var(--primary);
  color: var(--on-primary, #fff);
  box-shadow: var(--e1);
}
.wg-accept__btn--primary:hover { box-shadow: var(--e2); }

.wg-accept__btn--ghost {
  flex: 0 0 auto;
  background: transparent;
  color: var(--text-grey);
  border-color: var(--border-c);
}
.wg-accept__btn--ghost:hover { color: var(--text); border-color: var(--border-strong); }

/* Objectif du mois : note discrète sous la phrase de reste. */
.wg-goal__hint {
  margin: -4px 0 10px; font-size: 12px; color: var(--text-2);
}
/* Mise en évidence brève des propositions après le CTA de l'objectif. */
.wg-accepts.is-highlight { box-shadow: 0 0 0 2px var(--primary) inset; border-radius: var(--r-lg); }
@media (prefers-reduced-motion: no-preference) {
  .wg-accepts { transition: box-shadow 0.25s ease; }
}
