/* ============================================================
   Hub "Ma fan base" — design system + sections
   File: /css/hub.css
   Used by: /forms.html
   Convention: BEM-like (.hub-section, .hub-section__title, etc.)
   ============================================================ */

:root {
  --hub-bg: #ffffff;
  --hub-bg-2: #f7f7f5;
  --hub-card: #ffffff;
  --hub-ink: #0a0a0a;
  --hub-muted: #5c5c56;
  --hub-soft: #8a8a82;
  --hub-line: #ececea;
  --hub-line-soft: #f4f4f2;
  --hub-accent: #ffef00;
  --hub-success: #16a34a;
  --hub-info: #3b82f6;
  --hub-warn: #f59e0b;
  --hub-danger: #dc2626;
  --hub-radius: 22px;
  --hub-radius-sm: 12px;
  --hub-shadow-sm: 0 1px 2px rgba(0,0,0,.04), 0 4px 14px rgba(0,0,0,.04);
  --hub-shadow: 0 2px 4px rgba(0,0,0,.05), 0 14px 36px rgba(0,0,0,.06);
}

/* ── Layout ──────────────────────────────────────────────── */
body.hub {
  font-family: 'Radikal Light', -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--hub-ink);
  line-height: 1.5;
  background: var(--hub-bg);
  min-height: 100vh;
}

.hub-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px 80px;
}

@media (max-width: 980px) { .hub-container { padding: 0 20px 60px; } }
@media (max-width: 540px) { .hub-container { padding: 0 16px 60px; } }

/* ── Hero ────────────────────────────────────────────────── */
.hub-hero {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 36px 0 12px;
}

.hub-hero__text { flex: 1; min-width: 0; }

.hub-hero__illu {
  height: 96px;
  width: auto;
  flex-shrink: 0;
  margin-top: -8px;
  user-select: none;
  pointer-events: none;
  transform: rotate(4deg);
  transition: transform .3s ease;
}

.hub-hero__illu:hover { transform: rotate(0deg) scale(1.05); }

@media (max-width: 720px) { .hub-hero__illu { height: 72px; } }
@media (max-width: 480px) { .hub-hero__illu { display: none; } }

.hub-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1.5px solid rgba(0,0,0,.15);
  background: #fff;
  color: var(--hub-ink);
  text-decoration: none;
  flex-shrink: 0;
  margin-top: 6px;
  transition: all .15s;
}

.hub-back:hover { background: var(--hub-ink); color: #fff; border-color: var(--hub-ink); transform: translateX(-2px); }

.hub-hero__title {
  font-family: 'FreshMango', sans-serif;
  font-size: 44px;
  font-weight: 400;
  line-height: .95;
  position: relative;
  display: inline-block;
  letter-spacing: -.01em;
}

.hub-hero__title::after {
  content: '';
  position: absolute;
  left: 3px;
  right: -4px;
  bottom: 6px;
  height: 10px;
  background: var(--hub-accent);
  z-index: -1;
  border-radius: 3px;
  transform: rotate(-1.5deg);
}

.hub-hero__sub {
  color: var(--hub-muted);
  font-size: 14.5px;
  margin-top: 8px;
  max-width: 540px;
}

@media (max-width: 980px) { .hub-hero__title { font-size: 36px; } }
@media (max-width: 540px) { .hub-hero__title { font-size: 30px; } }

/* ── Section common (each section = a card with shadow) ──── */
.hub-section {
  margin-top: 24px;
  background: var(--hub-card);
  border: 1px solid var(--hub-line);
  border-radius: var(--hub-radius);
  padding: 26px 28px 28px;
  box-shadow: var(--hub-shadow-sm);
  transition: box-shadow .25s ease;
}

.hub-section:hover { box-shadow: var(--hub-shadow); }

.hub-section--no-divider { /* legacy alias, no-op now */ }

.hub-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.hub-section__title {
  font-family: 'Radikal Black', sans-serif;
  font-size: 20px;
  letter-spacing: -.015em;
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
}

.hub-section__count {
  color: var(--hub-soft);
  font-family: 'Radikal Light', sans-serif;
  font-size: 14px;
  font-weight: 400;
}

.hub-section__action {
  font-family: 'Radikal Bold', sans-serif;
  font-size: 13px;
  color: var(--hub-ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  transition: opacity .15s;
}

.hub-section__action:hover { opacity: .65; }

@media (max-width: 980px) {
  .hub-section { margin-top: 18px; padding: 22px 20px 24px; }
}
@media (max-width: 540px) {
  .hub-section { padding: 20px 16px 22px; border-radius: 16px; }
}

/* ── Buttons ─────────────────────────────────────────────── */
.hub-btn {
  border: 0;
  border-radius: 12px;
  padding: 13px 22px;
  font-family: 'Radikal Black', sans-serif;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s;
}

.hub-btn--primary {
  background: var(--hub-ink);
  color: #fff;
  box-shadow: 0 8px 20px rgba(0,0,0,.16);
}

.hub-btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(0,0,0,.2); }

.hub-btn--accent {
  background: var(--hub-accent);
  color: var(--hub-ink);
  box-shadow: 0 8px 20px rgba(255,239,0,.35);
}

.hub-btn--accent:hover { transform: translateY(-2px); }

.hub-btn--ghost {
  background: #fff;
  color: var(--hub-ink);
  border: 1.5px solid rgba(0,0,0,.6);
}

.hub-btn--ghost:hover { background: var(--hub-bg-2); border-color: var(--hub-ink); }

/* ── Onboarding banner ───────────────────────────────────── */
.hub-onboarding {
  display: none;
  background: linear-gradient(135deg, #fffbcc 0%, #fff7a8 100%);
  border: 1.5px solid #f5e043;
  border-radius: var(--hub-radius);
  padding: 22px 26px;
  margin-top: 12px;
  position: relative;
  overflow: hidden;
}

.hub-onboarding[data-visible="true"] { display: block; }

.hub-onboarding__title {
  font-family: 'Radikal Black', sans-serif;
  font-size: 18px;
  margin-bottom: 4px;
}

.hub-onboarding__sub {
  color: var(--hub-muted);
  font-size: 14px;
  margin-bottom: 16px;
}

.hub-onboarding__steps {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hub-step {
  flex: 1;
  min-width: 220px;
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--hub-ink);
  transition: all .15s;
}

.hub-step:hover { background: #fff; transform: translateY(-1px); }

.hub-step[data-done="true"] { opacity: .55; }

.hub-step__num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--hub-ink);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Radikal Black', sans-serif;
  font-size: 13px;
  flex-shrink: 0;
}

.hub-step[data-done="true"] .hub-step__num { background: var(--hub-success); }

.hub-step__text { font-family: 'Radikal Bold', sans-serif; font-size: 13.5px; }

/* ── Quick actions ───────────────────────────────────────── */
.hub-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 24px;
}

@media (max-width: 980px) { .hub-actions { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .hub-actions { grid-template-columns: 1fr; } }

.hub-action {
  background: var(--hub-bg-2);
  border: 1px solid transparent;
  border-radius: var(--hub-radius-sm);
  padding: 18px;
  text-decoration: none;
  color: var(--hub-ink);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all .2s;
  cursor: pointer;
}

.hub-action:hover {
  background: #fff;
  border-color: var(--hub-ink);
  transform: translateY(-2px);
}

.hub-action__icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hub-action__icon svg { width: 22px; height: 22px; stroke-width: 2; fill: none; stroke: currentColor; }

.hub-action--form .hub-action__icon { background: #fff7a8; color: #6b5d00; }
.hub-action--landing .hub-action__icon { background: #d1fae5; color: #065f46; }
.hub-action--write .hub-action__icon { background: #dbeafe; color: #1e40af; }
.hub-action--stats .hub-action__icon { background: #ede9fe; color: #6d28d9; }
.hub-action--automation .hub-action__icon { background: #fef3c7; color: #92400e; }

.hub-action__title { font-family: 'Radikal Black', sans-serif; font-size: 15px; }

.hub-action__sub { color: var(--hub-muted); font-size: 13px; }

/* ── KPIs (bento) ────────────────────────────────────────── */
.hub-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 14px;
}

@media (max-width: 880px) { .hub-kpis { grid-template-columns: repeat(2, 1fr); } }

.hub-kpi {
  background: var(--hub-bg-2);
  border: 1px solid transparent;
  border-radius: var(--hub-radius-sm);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background .2s, border-color .2s;
}

.hub-kpi:hover {
  background: #fff;
  border-color: var(--hub-line);
}

.hub-kpi__label {
  font-family: 'Radikal Bold', sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--hub-soft);
}

.hub-kpi__value {
  font-family: 'Radikal Black', sans-serif;
  font-size: 32px;
  line-height: .95;
  letter-spacing: -.02em;
}

.hub-kpi__delta {
  font-family: 'Radikal Bold', sans-serif;
  font-size: 12px;
  color: var(--hub-success);
}

.hub-kpi__delta--neg { color: var(--hub-warn); }

/* ── List sections (forms / landings) ────────────────────── */
.hub-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 720px) { .hub-list { grid-template-columns: 1fr; } }

.hub-list-card {
  background: var(--hub-bg-2);
  border: 1px solid transparent;
  border-radius: var(--hub-radius-sm);
  display: flex;
  align-items: stretch;
  gap: 0;
  transition: background .2s, border-color .2s;
  overflow: hidden;
}

.hub-list-card:hover {
  background: #fff;
  border-color: var(--hub-line);
}

.hub-list-card__main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--hub-ink);
}

.hub-list-card__cover {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--hub-bg-2);
  flex-shrink: 0;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hub-list-card__cover svg { width: 22px; height: 22px; color: var(--hub-soft); }

.hub-list-card__body { min-width: 0; flex: 1; }

.hub-list-card__quick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  text-decoration: none;
  color: var(--hub-soft);
  background: transparent;
  border: none;
  border-left: 1px solid var(--hub-line);
  flex-shrink: 0;
  cursor: pointer;
  font: inherit;
  transition: background .15s, color .15s;
}

.hub-list-card__quick:focus { outline: none; }
.hub-list-card__quick:focus-visible { outline: 2px solid var(--hub-ink); outline-offset: -2px; }

.hub-list-card__quick svg { width: 18px; height: 18px; }

.hub-list-card__quick:hover {
  background: var(--hub-ink);
  color: #fff;
}

.hub-list-card:hover .hub-list-card__quick {
  border-left-color: var(--hub-line);
}

.hub-list-card__title {
  font-family: 'Radikal Bold', sans-serif;
  font-size: 14.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hub-list-card__meta {
  color: var(--hub-soft);
  font-size: 12.5px;
  margin-top: 2px;
}

/* ── Summary cards (CRM / Messages) ──────────────────────── */
.hub-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 8px;
}

@media (max-width: 880px) { .hub-summary { grid-template-columns: 1fr; } }

.hub-summary-card {
  background: var(--hub-bg-2);
  border: 1px solid transparent;
  border-radius: var(--hub-radius-sm);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: background .2s, border-color .2s;
}

.hub-summary-card:hover { background: #fff; border-color: var(--hub-line); }

.hub-summary-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hub-summary-card__title {
  font-family: 'Radikal Black', sans-serif;
  font-size: 16px;
}

.hub-summary-card__big {
  font-family: 'Radikal Black', sans-serif;
  font-size: 38px;
  line-height: 1;
}

.hub-summary-card__delta { font-family: 'Radikal Bold', sans-serif; font-size: 13px; color: var(--hub-success); }

.hub-summary-card__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hub-summary-card__list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--hub-muted);
}

.hub-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: 'Radikal Bold', sans-serif;
  font-size: 11px;
  flex-shrink: 0;
}

.hub-summary-card__cta {
  margin-top: 8px;
  align-self: flex-start;
}

/* ── Stats ───────────────────────────────────────────────── */
.hub-stats {
  /* No own card style — section already provides the frame */
}

.hub-stats__row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 720px) { .hub-stats__row { grid-template-columns: repeat(2, 1fr); } }

.hub-stats__cell {
  padding: 12px;
  border-radius: var(--hub-radius-sm);
  background: var(--hub-bg-2);
}

.hub-stats__cell-label {
  font-family: 'Radikal Bold', sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--hub-soft);
  margin-bottom: 4px;
}

.hub-stats__cell-value {
  font-family: 'Radikal Black', sans-serif;
  font-size: 24px;
  line-height: 1;
}

.hub-funnel { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--hub-line-soft); }

.hub-funnel__title {
  font-family: 'Radikal Bold', sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--hub-soft);
  margin-bottom: 12px;
}

.hub-funnel__bars { display: flex; flex-direction: column; gap: 8px; }

.hub-funnel__bar {
  display: grid;
  grid-template-columns: 110px 1fr 60px;
  gap: 10px;
  align-items: center;
}

.hub-funnel__bar-label { font-size: 13px; color: var(--hub-ink); font-family: 'Radikal Bold', sans-serif; }

.hub-funnel__bar-track {
  height: 28px;
  background: var(--hub-bg-2);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.hub-funnel__bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffef00 0%, #ffea00 100%);
  border-radius: 8px;
  transition: width .6s cubic-bezier(.5,1.6,.4,1);
}

.hub-funnel__bar-value {
  font-family: 'Radikal Bold', sans-serif;
  font-size: 13px;
  text-align: right;
}

/* ── Empty state ─────────────────────────────────────────── */
.hub-empty {
  text-align: center;
  padding: 28px 18px;
  background: var(--hub-bg-2);
  border: 1.5px dashed var(--hub-line);
  border-radius: var(--hub-radius-sm);
  color: var(--hub-muted);
}

.hub-empty__icon { color: var(--hub-soft); margin-bottom: 10px; display: inline-flex; }

.hub-empty__icon svg { width: 30px; height: 30px; stroke-width: 1.6; fill: none; stroke: currentColor; }

.hub-empty__title { font-family: 'Radikal Bold', sans-serif; font-size: 14px; color: var(--hub-ink); margin-bottom: 4px; }

.hub-empty__text { font-size: 13px; max-width: 340px; margin: 0 auto 12px; }

/* ── Skeleton (loading) ──────────────────────────────────── */
.hub-skeleton {
  background: linear-gradient(90deg, var(--hub-bg-2) 25%, #efefec 50%, var(--hub-bg-2) 75%);
  background-size: 200% 100%;
  border-radius: 8px;
  animation: hubShimmer 1.4s infinite;
  display: inline-block;
}

@keyframes hubShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Toast ───────────────────────────────────────────────── */
.hub-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--hub-ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-family: 'Radikal Bold', sans-serif;
  font-size: 13px;
  z-index: 5000;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  animation: hubToastIn .3s ease;
}

.hub-toast--err { background: var(--hub-danger); }

@keyframes hubToastIn {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ── Submissions modal (mails reçus) ─────────────────────── */
.hub-modal__overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 20, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: hubModalIn .15s ease;
}

@keyframes hubModalIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.hub-modal {
  background: #fff;
  border-radius: var(--hub-radius);
  width: 100%;
  max-width: 760px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}

.hub-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--hub-line);
}

.hub-modal__title {
  font-family: 'Radikal Bold', sans-serif;
  font-size: 17px;
  color: var(--hub-ink);
}

.hub-modal__sub {
  color: var(--hub-soft);
  font-size: 13px;
  margin-top: 2px;
}

.hub-modal__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.hub-modal__actions .hub-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
}

.hub-modal__close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--hub-soft);
  padding: 6px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}

.hub-modal__close:hover { background: var(--hub-bg-2); color: var(--hub-ink); }

.hub-modal__body {
  overflow-y: auto;
  padding: 4px 0;
}

.hub-modal__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.hub-modal__table thead th {
  position: sticky;
  top: 0;
  background: var(--hub-bg-2);
  text-align: left;
  font-family: 'Radikal Bold', sans-serif;
  color: var(--hub-soft);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 10px 22px;
  border-bottom: 1px solid var(--hub-line);
}

.hub-modal__table tbody td {
  padding: 12px 22px;
  border-bottom: 1px solid var(--hub-line);
  color: var(--hub-ink);
  vertical-align: top;
}

.hub-modal__table tbody tr:last-child td { border-bottom: none; }
.hub-modal__table tbody tr:hover td { background: var(--hub-bg-2); }

@media (max-width: 600px) {
  .hub-modal__table thead { display: none; }
  .hub-modal__table tbody td {
    display: block;
    padding: 6px 18px;
    border-bottom: none;
  }
  .hub-modal__table tbody tr {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--hub-line);
  }
}
