/* ============================================================
   TFE — Dashboard v2 (structure header pill-nav / hero gradient
   collapsible / panel blanc plein écran)
   Réutilise les tokens déjà déclarés dans tfe-membership.css :
   --tfe-accent, --tfe-accent-soft, --tfe-surface, --tfe-ink,
   --tfe-muted, --tfe-line, --r-lg/md/sm/pill, --sh-soft.
   Tout le contenu des vues Offers/Messages/Billing/Settings réutilise
   les classes .tfe-offer-card / .tfe-message-item / .tfe-billing-*
   / .tfe-settings-* déjà stylées — namespace "tfedash-" réservé au
   nouveau squelette (nav, hero, panel, cartes newsletter/saved).
   ============================================================ */

:root {
  --tfedash-header-h: 76px;
}

.tfedash-root {
  --tfedash-hero-rows: 1fr;
}

/* ----------------------------------------------------------------
   TOP NAV — remplace tfe-site-header : vrai header du dashboard
   (logo + pill-nav + contact/journal + notifs/compte), fond blanc,
   sticky, ombre basse.
---------------------------------------------------------------- */
.tfedash-topnav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--tfe-white);
  box-shadow: 0 1px 0 var(--tfe-line), var(--sh-soft);
  padding: 14px 20px;
}

.tfedash-topnav__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  max-width: 1400px;
  margin: 0 auto;
  justify-content: space-between;
}

.tfedash-logo {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.tfedash-logo img { display: block; height: 50px; width: auto; }

.tfedash-icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--tfe-ink);
  transition: background-color .15s, color .15s;
}

.tfedash-icon-link:hover { background: var(--tfe-surface-2); color: var(--tfe-accent); }

.tfedash-icon-link svg {
  width: 18px; height: 18px;
  stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

.tfedash-pills {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--tfe-white);
  border-radius: var(--r-pill);
  padding: 4px;
  box-shadow: var(--sh-soft);
  overflow-x: auto;
  scrollbar-width: none;
  /*flex: 1 1 auto;*/
  min-width: 0;
}

.tfedash-pills::-webkit-scrollbar { display: none; }

.tfedash-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 18px;
  border-radius: var(--r-pill);
  border: none;
  background: transparent;
  color: var(--tfe-ink-2, #2b2b2b);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}

.tfedash-pill:hover { background: var(--tfe-surface-2); color: var(--tfe-accent); }

.tfedash-pill.is-active {
  background: var(--tfe-accent);
  color: #fff;
  font-weight: 600;
}

.tfedash-pill.is-active:hover { background: var(--tfe-accent-dark); color: #fff; }

.tfedash-pill__badge {
  background: rgba(255,255,255,.35);
  color: inherit;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  min-width: 18px;
  text-align: center;
}

.tfedash-pill:not(.is-active) .tfedash-pill__badge {
  background: var(--tfe-accent);
  color: #fff;
}

.tfedash-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  position: relative;
}

.tfedash-bell,
.tfedash-account {
  display: flex;
  align-items: center;
  height: 44px;
  border: none;
  border-radius: var(--r-pill);
  background: var(--tfe-white);
  box-shadow: var(--sh-soft);
  cursor: pointer;
  color: var(--tfe-ink);
  transition: box-shadow .15s, color .15s;
}

.tfedash-bell {
  width: 44px;
  justify-content: center;
  position: relative;
}

.tfedash-bell:hover { color: var(--tfe-accent); box-shadow: var(--sh-page); }

.tfedash-bell svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.tfedash-bell__dot {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tfe-accent);
  border: 2px solid var(--tfe-white);
}

.tfedash-account {
  gap: 8px;
  padding: 0 4px 0 14px;
}

.tfedash-account:hover { box-shadow: var(--sh-page); }

.tfedash-account__grid {
  display: grid;
  grid-template-columns: repeat(2, 5px);
  gap: 3px;
}

.tfedash-account__grid i {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--tfe-ink-2, #2b2b2b);
  display: block;
}

.tfedash-account__avatar {
  width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 50%;
  background: var(--tfe-accent-soft);
  color: var(--tfe-accent);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
}

/* Dropdown compte */
.tfedash-account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--tfe-white);
  border-radius: var(--r-md);
  box-shadow: var(--sh-page);
  padding: 8px;
  z-index: 60;
  display: none;
}

.tfedash-account-menu.is-open { display: block; }

.tfedash-account-menu__header {
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--tfe-line);
  margin-bottom: 6px;
}

.tfedash-account-menu__name { font-size: 13px; font-weight: 600; color: var(--tfe-ink); }
.tfedash-account-menu__email { font-size: 11px; color: var(--tfe-muted); margin-top: 2px; }

.tfedash-account-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: none;
  background: none;
  font-size: 13px;
  color: var(--tfe-ink-2, #2b2b2b);
  cursor: pointer;
  text-align: left;
}

.tfedash-account-menu__item:hover { background: var(--tfe-surface-2); }
.tfedash-account-menu__item--danger { color: #c0392b; }

/* ----------------------------------------------------------------
   HERO — collapsible via grid-template-rows (même technique que
   l'accordéon FAQ), pour un "monte et couvre" fluide en CSS pur.
---------------------------------------------------------------- */
.tfedash-hero-wrap {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows .35s ease;
}

.tfedash-root.is-full .tfedash-hero-wrap {
  grid-template-rows: 0fr;
}

.tfedash-hero-clip {
  overflow: hidden;
  min-height: 0;
}

.tfedash-hero {
  background:
    radial-gradient(900px 480px at 10% 100%, var(--tfe-accent-soft) 0%, rgba(242,221,213,0) 65%),
    radial-gradient(800px 420px at 95% 90%, #f7e9c8 0%, rgba(247,233,200,0) 60%),
    var(--tfe-page, #e6e5e4);
  padding: 28px 20px 48px;
}

.tfedash-hero__inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: start;
}

/* Identité du membre seule à gauche ; tuiles (change plan + stats)
   groupées ensemble à droite — voir breakpoint 768px pour la 2-colonnes. */
.tfedash-greeting { align-self: center; }

.tfedash-greeting__line1 {
  font-size: 22px;
  font-weight: 300;
  color: var(--tfe-ink);
  letter-spacing: -0.01em;
}

.tfedash-greeting__line2 {
  font-size: 28px;
  font-weight: 600;
  color: var(--tfe-ink);
  letter-spacing: -0.01em;
  margin-top: 2px;
}

.tfedash-greeting__date {
  margin-top: 10px;
  font-size: 13px;
  color: var(--tfe-muted);
}

.tfedash-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tfedash-tile {
  position: relative;
  background: var(--tfe-white);
  border-radius: var(--r-lg);
  padding: 18px;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--sh-soft);
  transition: transform .15s, box-shadow .15s;
}

.tfedash-tile:hover { transform: translateY(-2px); box-shadow: var(--sh-page); }

.tfedash-tile--tall { grid-row: span 2; }

.tfedash-tile--accent {
  background: linear-gradient(135deg, var(--tfe-accent) 0%, var(--tfe-accent-dark) 100%);
  color: #fff;
}

.tfedash-tile--accent .tfedash-tile__label,
.tfedash-tile--accent .tfedash-tile__value,
.tfedash-tile--accent .tfedash-tile__icon { color: #fff; }

.tfedash-tile__head { display: flex; align-items: center; gap: 8px; }
.tfedash-tile__icon { width: 20px; height: 20px; flex: 0 0 20px; color: var(--tfe-ink); }
.tfedash-tile__icon svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tfedash-tile__label { font-size: 13px; font-weight: 500; color: var(--tfe-ink); }
.tfedash-tile__value { font-size: 30px; font-weight: 300; color: var(--tfe-ink); letter-spacing: -0.02em; }
.tfedash-tile__foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }

.tfedash-tile__go {
  width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.65);
  color: #fff;
  display: grid; place-items: center;
  transition: background-color .15s;
}

.tfedash-tile__go:hover { background: rgba(255,255,255,.18); }
.tfedash-tile__go svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ── Tuile "Change plan" / "Reactivate" — remplace l'ancien "Open jobs"
     tall tile de la maquette. Contenu libre (titre + pills), pas de
     couple label/value comme les tuiles stat. ── */
.tfedash-tile--plan {
  justify-content: flex-start;
  gap: 14px;
  border-left: 3px solid var(--tfe-accent);
}

.tfedash-tile--plan.tfedash-tile--danger { border-left-color: #c0392b; }

.tfedash-tile__plan-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--tfe-ink);
  margin: 0;
}

.tfedash-tile__plan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ----------------------------------------------------------------
   PANEL — plein-largeur, blanc, remonte pour couvrir la hero
   (sauf .tfedash-topnav, qui reste hors de ce conteneur).
---------------------------------------------------------------- */
.tfedash-panel {
  position: relative;
  z-index: 2;
  background: var(--tfe-white);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -12px 32px rgba(28,28,28,.05);
  margin-top: -24px;
  padding: 68px 32px 72px;
  min-height: 45vh;
  transition: min-height .35s ease, border-radius .35s ease;
}

.tfedash-root.is-full .tfedash-panel {
  min-height: calc(100vh - var(--tfedash-header-h));
  border-radius: 0;
}

.tfedash-panel__inner {
  max-width: 1400px;
  margin: 0 auto;
}

.tfedash-view { display: none; }
.tfedash-view.is-active {
  display: block;
  padding: 3rem 10rem;
}

/* ----------------------------------------------------------------
   OVERVIEW — toolbar (segments + recherche + filtre) et grille de
   cartes (newsletters / saved articles).
---------------------------------------------------------------- */
.tfedash-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.tfedash-segments {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 100%;
}

.tfedash-seg {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 22px;
  border-radius: var(--r-pill);
  border: 1px solid var(--tfe-line);
  background: var(--tfe-white);
  color: var(--tfe-ink-2, #2b2b2b);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}

.tfedash-seg:hover { border-color: var(--tfe-accent); color: var(--tfe-accent); }

.tfedash-seg.is-active {
  background: var(--tfe-accent);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}

.tfedash-search {
  position: relative;
  flex: 1 1 260px;
  min-width: 0;
}

.tfedash-search input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 42px;
  border-radius: var(--r-pill);
  border: 1px solid var(--tfe-line);
  background: var(--tfe-white);
  font-size: 13px;
  color: var(--tfe-ink);
}

.tfedash-search input:focus {
  outline: none;
  border-color: var(--tfe-accent);
  box-shadow: 0 0 0 3px rgba(184,72,47,.1);
}

.tfedash-search svg {
  position: absolute;
  left: 16px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px;
  stroke: var(--tfe-muted); fill: none; stroke-width: 1.9;
  pointer-events: none;
}

.tfedash-select {
  flex: 0 0 auto;
}

.tfedash-select select {
  height: 44px;
  padding: 0 34px 0 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--tfe-line);
  background: var(--tfe-white);
  font-size: 13px;
  color: var(--tfe-ink-2, #2b2b2b);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.tfedash-select select:focus { outline: none; border-color: var(--tfe-accent); }

.tfedash-result-count {
  font-size: 13px;
  color: var(--tfe-muted);
  margin-bottom: 16px;
}

/* Grille de cartes générique (newsletters + saved articles) */
.tfedash-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

/* ── Saved article card (image réelle, contrairement à la vignette
     icône des newsletters) ── */
.tfe-saved-article-card {
  position: relative;
  background: var(--tfe-surface);
  border: 1px solid var(--tfe-line);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--sh-soft);
  transition: border-color .15s;
  display: flex;
  flex-direction: column;
}

.tfe-saved-article-card:hover { border-color: var(--tfe-muted-2); }

.tfe-saved-article-thumb {
  /*height: 130px;*/
  aspect-ratio: 16/9;
  background: var(--tfe-accent-soft) center / cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: var(--tfe-accent);
}

.tfe-saved-article-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }

.tfe-saved-article-category {
  align-self: flex-start;
}

.tfe-saved-article-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--tfe-ink);
  line-height: 1.4;
  flex: 1;
}

.tfe-saved-article-date { font-size: 11px; color: var(--tfe-muted); }

.tfe-saved-article-unsave {
  position: absolute;
  top: 10px; right: 10px;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(28,28,28,.55);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.tfe-saved-article-unsave:hover { background: #c0392b; }

/* ----------------------------------------------------------------
   RESPONSIVE
---------------------------------------------------------------- */
@media (min-width: 768px) {
  .tfedash-view.is-active{ padding: 0 20px; }
  .tfedash-topnav { padding: 18px 32px; }
  .tfedash-hero { padding: 36px 32px 56px; }
  .tfedash-hero__inner { grid-template-columns: minmax(280px, .85fr) minmax(0, 1.8fr); align-items: center; }
  .tfedash-greeting__line1 { font-size: 26px; }
  .tfedash-greeting__line2 { font-size: 32px; }

  .tfedash-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tfedash-tile--tall { grid-column: 1; grid-row: 1 / span 2; }

  .tfedash-toolbar { flex-wrap: nowrap; }
  .tfedash-segments { flex: 0 0 auto; }
  .tfedash-search { flex: 1 1 320px; max-width: 480px; }
}

@media (max-width: 480px) {
  .tfedash-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tfedash-tile--tall { grid-row: span 1; min-height: 118px; }
}

@media (prefers-reduced-motion: reduce) {
  .tfedash-hero-wrap,
  .tfedash-panel { transition-duration: .01ms !important; }
}

@media screen and (max-width: 759px) {
  .tfedash-view.is-active {
    display: block;
    padding: 0;
  }
}