/* iDive — Dashboard module styles. Scoped `ffdb-`. Uses brand tokens from
   styles.css (--primary cyan, --secondary teal, --accent amber, --navy). Never edit styles.css. */

.ffdb-wrap { max-width: 1080px; margin: 0 auto; padding: 104px 20px 72px; }  /* top clears the fixed 72px site header */
.ffdb-wrap h1, .ffdb-wrap h2, .ffdb-wrap h3 { font-family: 'Josefin Sans', sans-serif; color: var(--navy, #0f172a); }

/* ── Login ─────────────────────────────────────────────────────────────── */
.ffdb-auth { min-height: calc(100vh - 72px); display: flex; align-items: flex-start; justify-content: center; padding: 104px 20px 56px; background: linear-gradient(160deg, var(--primary-soft, #ecfeff), #fff 60%); }
/* hide the card until the auth check resolves (no sign-in flash for logged-in users) */
body.ffdb-login .ffdb-auth .ffdb-card { opacity: 0; }
body.ffdb-login.ffdb-ready .ffdb-auth .ffdb-card { opacity: 1; transition: opacity .2s ease; }
/* Auth gate for the dashboards themselves: hide the content until the /me (and,
   for the creator dashboard, /referral/stats) check confirms the visitor belongs
   here. Prevents the dashboard flashing before a logged-out visitor is redirected
   to login. JS adds .ffdb-ready once confirmed (with a safety-net timeout). */
body.ffdb-app .ffdb-app-wrap,
body.ffdb-customer .ffdb-wrap { opacity: 0; }
body.ffdb-app.ffdb-ready .ffdb-app-wrap,
body.ffdb-customer.ffdb-ready .ffdb-wrap { opacity: 1; transition: opacity .18s ease; }
.ffdb-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--border, rgba(6,182,212,.16)); border-radius: 20px; padding: 34px 30px; box-shadow: 0 18px 50px -28px rgba(15,23,42,.35), 0 8px 32px rgba(6,95,120,.08); }
.ffdb-card .ffdb-logo { text-align: center; margin-bottom: 10px; }
.ffdb-card .ffdb-logo img { height: 40px; width: auto; display: inline-block; }
.ffdb-card .ffdb-logo i { color: var(--secondary, #0d9488); font-size: 1.8rem; }

/* mobile: header is ~60px — tighten the top clearance + side padding */
@media (max-width: 900px) {
  .ffdb-wrap { padding: 84px 16px 56px; }
  .ffdb-auth { min-height: calc(100vh - 60px); padding: 84px 16px 40px; }
  .ffdb-card { padding: 28px 20px; }
}
.ffdb-card h1 { font-size: 1.55rem; text-align: center; margin: 6px 0 2px; }
.ffdb-card .ffdb-sub { text-align: center; color: #5b6b73; font-size: .82rem; margin: 0 0 22px; }

.ffdb-field { margin-bottom: 14px; }
.ffdb-field label { display: block; font-size: .82rem; font-weight: 600; color: var(--deep, #164e63); margin-bottom: 5px; }
.ffdb-field input { width: 100%; padding: 12px 14px; border: 1px solid #d4dee2; border-radius: 12px; font: inherit; box-sizing: border-box; }
.ffdb-field input:focus { outline: none; border-color: var(--primary, #06b6d4); box-shadow: 0 0 0 3px rgba(6,182,212,.18); }
#ffdb-otp { letter-spacing: .5em; text-align: center; font-size: 1.3rem; font-weight: 700; }

/* Primary action — iDive signature gradient (designplan §1) */
.ffdb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 13px 18px; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; color: #fff; font: inherit; font-weight: 700; cursor: pointer; transition: var(--transition, all .25s cubic-bezier(.4,0,.2,1));
  background: linear-gradient(135deg, rgba(16,185,129,.96) 0%, rgba(6,182,212,.96) 50%, rgba(29,78,216,.96) 100%);
  box-shadow: 0 6px 18px rgba(29,78,216,.30), 0 3px 10px rgba(16,185,129,.18), inset 0 1px 0 rgba(255,255,255,.26); }
.ffdb-btn:hover { background: linear-gradient(135deg,#0ea371 0%,#0891b2 50%,#1e40af 100%);
  box-shadow: 0 12px 26px rgba(29,78,216,.42), 0 5px 14px rgba(16,185,129,.22), inset 0 1px 0 rgba(255,255,255,.32); }
.ffdb-btn:disabled { opacity: .6; cursor: default; box-shadow: none; }
@media (prefers-reduced-motion: no-preference) { .ffdb-btn:hover:not(:disabled) { transform: translateY(-1px); } }
.ffdb-btn-link { background: none; border: 0; color: var(--secondary, #0d9488); cursor: pointer; font: inherit; padding: 8px; width: 100%; text-align: center; }

.ffdb-msg { min-height: 20px; margin: 12px 0 0; font-size: .88rem; text-align: center; color: #5b6b73; }
.ffdb-msg.is-err { color: var(--coral, #e84545); }
.ffdb-msg.is-ok { color: var(--secondary-hover, #0f766e); }

.ffdb-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: #9aa7ad; font-size: .8rem; }
.ffdb-divider::before, .ffdb-divider::after { content: ''; flex: 1; height: 1px; background: #e3eaed; }
#ffdb-google-btn { display: flex; justify-content: center; min-height: 44px; }
.ffdb-google-off { color: #9aa7ad; font-size: .82rem; text-align: center; margin: 0; }
.ffdb-fineprint { margin: 22px 0 0; font-size: .74rem; color: #9aa7ad; text-align: center; line-height: 1.5; }

/* ── Dashboard header / stat tiles ─────────────────────────────────────── */
.ffdb-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.ffdb-top h1 { font-size: 1.7rem; margin: 0; }
.ffdb-top .ffdb-actions { display: flex; gap: 10px; align-items: center; }
.ffdb-pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; border-radius: 999px; font-weight: 700; font-size: .85rem; text-decoration: none; }
.ffdb-pill-amber { background: rgba(245,158,11,.14); color: var(--accent-hover, #d97706); }
.ffdb-pill-ghost { background: #eef3f5; color: var(--deep, #164e63); }

.ffdb-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 30px; }
.ffdb-tile { border-radius: 18px; padding: 22px; color: #fff; position: relative; overflow: hidden; border: 1px solid rgba(255,255,255,.18); box-shadow: 0 6px 18px rgba(15,23,42,.10), inset 0 1px 0 rgba(255,255,255,.22); transition: var(--transition, all .25s cubic-bezier(.4,0,.2,1)); }
.ffdb-tile i { position: absolute; right: 14px; top: 14px; font-size: 2.4rem; color: #fff; opacity: .5; }
.ffdb-tile .ffdb-tile-num { font-family: 'Josefin Sans', sans-serif; font-size: 2.1rem; font-weight: 700; line-height: 1.1; }
.ffdb-tile .ffdb-tile-label { font-size: .82rem; opacity: .94; margin-top: 4px; }
/* the three tiles echo the "Plan with Laila" gradient stops: green · blue · dark blue */
.ffdb-tile-impact { background: linear-gradient(135deg, #10b981, #059669); }
.ffdb-tile-points { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.ffdb-tile-rank { background: linear-gradient(135deg, #1d4ed8, #1e3a8a); }
@media (prefers-reduced-motion: no-preference) {
  .ffdb-tile:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(15,23,42,.16), inset 0 1px 0 rgba(255,255,255,.28); }
}

/* ── Panels ────────────────────────────────────────────────────────────── */
.ffdb-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; align-items: start; }
.ffdb-panel { background: #fff; border: 1px solid var(--border, rgba(6,182,212,.16)); border-radius: 18px; padding: 20px 22px; margin-bottom: 22px; box-shadow: 0 8px 32px rgba(6,95,120,.06); transition: var(--transition, all .25s cubic-bezier(.4,0,.2,1)); }
@media (prefers-reduced-motion: no-preference) {
  .ffdb-panel:hover { transform: translateY(-3px); border-color: var(--primary, #06b6d4); box-shadow: 0 14px 28px rgba(6,182,212,.14), 0 6px 14px rgba(15,23,42,.06); }
}
.ffdb-panel h2 { font-size: 1.12rem; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.ffdb-panel h2 i { color: var(--secondary, #0d9488); }
.ffdb-empty { color: #8a979d; font-size: .9rem; }
.ffdb-empty a { color: var(--primary-hover, #0891b2); }

.ffdb-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.ffdb-table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: #93a2a8; padding: 0 10px 8px; }
.ffdb-table td { padding: 11px 10px; border-top: 1px solid #eef3f5; }
.ffdb-r { text-align: right; }
.ffdb-pts { color: var(--accent-hover, #d97706); font-weight: 700; }
.ffdb-badge { font-size: .72rem; padding: 3px 9px; border-radius: 999px; background: #eef3f5; color: #5b6b73; text-transform: capitalize; }
.ffdb-badge.is-paid { background: rgba(34,197,94,.15); color: #15803d; }
.ffdb-badge.is-requested { background: rgba(245,158,11,.15); color: #b45309; }
.ffdb-badge.is-pending, .ffdb-badge.is-approved { background: rgba(6,182,212,.14); color: #0e7490; }
.ffdb-badge.is-accrued { background: rgba(99,102,241,.13); color: #4338ca; }

.ffdb-ledger { list-style: none; margin: 0; padding: 0; }
.ffdb-ledger li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid #eef3f5; font-size: .88rem; }
.ffdb-ledger li:first-child { border-top: 0; }
.ffdb-ledger-note { color: var(--navy, #0f172a); }
.ffdb-ledger-date { color: #9aa7ad; font-size: .78rem; }
.ffdb-ledger-delta { font-weight: 700; min-width: 56px; text-align: right; }
.ffdb-ledger-delta.is-pos { color: #15803d; }
.ffdb-ledger-delta.is-neg { color: var(--coral, #e84545); }

/* ── Leaderboard ───────────────────────────────────────────────────────── */
.ffdb-lb-tabs { display: inline-flex; gap: 4px; background: #eef3f5; padding: 4px; border-radius: 999px; margin-bottom: 14px; }
.ffdb-lb-tabs button { border: 1px solid transparent; background: none; padding: 7px 16px; border-radius: 999px; font: inherit; font-size: .82rem; font-weight: 600; color: #5b6b73; cursor: pointer; transition: var(--transition, all .25s cubic-bezier(.4,0,.2,1)); }
.ffdb-lb-tabs button:hover:not(.is-active) { color: var(--primary, #06b6d4); }
/* active segment = iDive signature gradient (designplan §1/§4) */
.ffdb-lb-tabs button.is-active { color: #fff; border-color: rgba(255,255,255,.28);
  background: linear-gradient(135deg, rgba(16,185,129,.96) 0%, rgba(6,182,212,.96) 50%, rgba(29,78,216,.96) 100%);
  box-shadow: 0 4px 12px rgba(29,78,216,.16), 0 2px 6px rgba(16,185,129,.08), inset 0 1px 0 rgba(255,255,255,.28); }
.ffdb-lb { list-style: none; margin: 0; padding: 0; }
.ffdb-lb li { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 9px 8px; border-radius: 10px; font-size: .9rem; }
.ffdb-lb li.is-me { background: rgba(6,182,212,.1); }
.ffdb-lb-rank { font-weight: 700; color: var(--secondary, #0d9488); text-align: center; }
.ffdb-lb-name em { color: var(--primary-hover, #0891b2); font-style: normal; font-weight: 600; }
.ffdb-lb-val { font-weight: 700; color: var(--navy, #0f172a); }
.ffdb-lb-you { margin: 12px 0 0; font-size: .85rem; color: #5b6b73; }

/* ── P2: rewards, influencer codes, commissions ────────────────────────── */
.ffdb-btn-sm { width: auto; padding: 8px 16px; font-size: .85rem; margin-top: 12px; }
.ffdb-hint { color: #6b7a80; font-size: .85rem; margin: 0 0 14px; }
.ffdb-hint code { background: #eef3f5; padding: 1px 6px; border-radius: 6px; font-size: .82em; }
.ffdb-pct { font-size: .72rem; font-weight: 700; color: var(--accent-hover, #d97706); background: rgba(245,158,11,.14); padding: 3px 10px; border-radius: 999px; margin-left: auto; }
.ffdb-stats-4 { grid-template-columns: repeat(4, 1fr); }

.ffdb-rewards { display: grid; gap: 12px; }
.ffdb-reward { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 15px; border: 1px solid var(--border, rgba(6,182,212,.16)); border-radius: 14px; transition: var(--transition, all .25s cubic-bezier(.4,0,.2,1)); }
@media (prefers-reduced-motion: no-preference) {
  .ffdb-reward:hover { transform: translateY(-2px); border-color: var(--primary, #06b6d4); box-shadow: 0 10px 22px rgba(6,182,212,.12), 0 4px 10px rgba(15,23,42,.05); }
}
.ffdb-reward-info { display: flex; flex-direction: column; }
.ffdb-reward-title { font-weight: 700; color: var(--navy, #0f172a); }
.ffdb-reward-desc { font-size: .82rem; color: #6b7a80; }
.ffdb-reward-act { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.ffdb-reward-cost { font-weight: 700; color: var(--accent-hover, #d97706); font-size: .9rem; }
.ffdb-reward-act .ffdb-btn-sm { margin-top: 0; }

.ffdb-code { padding: 12px 14px; border: 1px solid var(--border, rgba(6,182,212,.16)); border-radius: 14px; margin-bottom: 12px; transition: var(--transition, all .25s cubic-bezier(.4,0,.2,1)); }
@media (prefers-reduced-motion: no-preference) {
  .ffdb-code:hover { border-color: var(--primary, #06b6d4); box-shadow: 0 10px 22px rgba(6,182,212,.12), 0 4px 10px rgba(15,23,42,.05); }
}
.ffdb-code-main { display: flex; align-items: center; gap: 10px; }
.ffdb-code-tag { font-family: 'Josefin Sans', sans-serif; font-weight: 700; color: var(--secondary, #0d9488); background: rgba(13,148,136,.12); padding: 4px 10px; border-radius: 8px; white-space: nowrap; }
.ffdb-code-url { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid #d4dee2; border-radius: 9px; font: inherit; font-size: .82rem; color: #5b6b73; background: #f9fbfc; transition: var(--transition, all .25s cubic-bezier(.4,0,.2,1)); }
.ffdb-code-url:focus { outline: none; border-color: var(--primary, #06b6d4); box-shadow: 0 0 0 3px rgba(6,182,212,.18); }
.ffdb-code-meta { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: .78rem; color: #93a2a8; }
.ffdb-copy { margin-left: auto; border: 1px solid #d4dee2; background: #fff; border-radius: 8px; padding: 5px 11px; font: inherit; font-size: .78rem; cursor: pointer; color: var(--deep, #164e63); transition: var(--transition, all .25s cubic-bezier(.4,0,.2,1)); }
.ffdb-copy:hover { border-color: var(--primary, #06b6d4); color: var(--primary, #06b6d4); }
.ffdb-copy:focus-visible { outline: none; border-color: var(--primary, #06b6d4); box-shadow: 0 0 0 3px rgba(6,182,212,.18); }

@media (max-width: 820px) {
  .ffdb-stats, .ffdb-stats-4 { grid-template-columns: 1fr; }
  .ffdb-grid { grid-template-columns: 1fr; }
}
@media (min-width: 821px) and (max-width: 1000px) { .ffdb-stats-4 { grid-template-columns: repeat(2, 1fr); } }

/* ═══════════════════════════════════════════════════════════════════════════
   AFFILIATE / CREATOR DASHBOARD (body.ffdb-app) — sidebar SaaS layout.
   Brand tokens from styles.css: --primary cyan, --secondary teal, --accent amber,
   --navy, --deep, --primary-soft. Scoped under .ffdb-app so it never touches the
   simpler customer dashboard.
   ═══════════════════════════════════════════════════════════════════════════ */
.ffdb-app .ffdb-app-wrap {
  max-width: 1240px; margin: 0 auto; padding: 96px 20px 64px;
  display: grid; grid-template-columns: 248px 1fr; gap: 24px; align-items: start;
}
body.ffdb-app { background: linear-gradient(170deg, var(--primary-soft, #ecfeff) 0%, #f7fbfc 38%, #fff 100%); }

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.ffdb-side {
  position: sticky; top: 96px; align-self: start;
  background: #fff; border: 1px solid var(--border, rgba(6,182,212,.16)); border-radius: 20px;
  padding: 18px 14px; box-shadow: 0 18px 50px -34px rgba(15,23,42,.4);
  display: flex; flex-direction: column; gap: 6px;
}
.ffdb-side-id { display: flex; align-items: center; gap: 11px; padding: 6px 8px 16px; border-bottom: 1px solid #eef3f5; margin-bottom: 8px; }
.ffdb-side-avatar { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; display: grid; place-items: center; font-family: 'Josefin Sans', sans-serif; font-weight: 700; font-size: 1.2rem; color: #fff; text-transform: uppercase; background: linear-gradient(135deg, var(--secondary, #0d9488), var(--primary, #06b6d4)); }
.ffdb-side-meta { display: flex; flex-direction: column; min-width: 0; }
.ffdb-side-name { font-family: 'Josefin Sans', sans-serif; font-weight: 700; color: var(--navy, #0f172a); font-size: 1rem; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ffdb-side-role { font-size: .72rem; color: var(--secondary-hover, #0f766e); font-weight: 600; margin-top: 2px; }
.ffdb-side-role i { color: var(--secondary, #0d9488); }
.ffdb-side-nav { display: flex; flex-direction: column; gap: 3px; }
.ffdb-navlink {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 11px 13px; border: 0; border-radius: 12px; background: none; cursor: pointer;
  font: inherit; font-size: .9rem; font-weight: 600; color: var(--deep, #164e63);
  text-decoration: none; transition: background .18s ease, color .18s ease;
}
.ffdb-navlink i { width: 18px; text-align: center; color: #7c95a0; transition: color .18s ease; }
.ffdb-navlink:hover { background: #f1f7f9; }
.ffdb-navlink.is-active { background: linear-gradient(135deg, rgba(13,148,136,.12), rgba(6,182,212,.12)); color: var(--navy, #0f172a); }
.ffdb-navlink.is-active i { color: var(--secondary, #0d9488); }
.ffdb-side-foot { margin-top: 10px; padding-top: 10px; border-top: 1px solid #eef3f5; display: flex; flex-direction: column; gap: 3px; }
.ffdb-navlink-ghost { font-weight: 600; color: #64798a; }

/* ── Main column ──────────────────────────────────────────────────────────── */
.ffdb-app-main { min-width: 0; }
.ffdb-app-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.ffdb-app-top h1 { font-size: 1.7rem; margin: 0; }
.ffdb-app-sub { margin: 4px 0 0; color: #5b6b73; font-size: .9rem; }
.ffdb-app-topact { display: flex; align-items: center; gap: 10px; }
.ffdb-margin-badge { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; background: rgba(245,158,11,.14); color: var(--accent-hover, #d97706); font-size: .82rem; font-weight: 600; }
.ffdb-margin-badge strong { font-size: .95rem; }
.ffdb-pill-tab { background: linear-gradient(135deg, var(--secondary, #0d9488), var(--primary, #06b6d4)); color: #fff; border: 0; cursor: pointer; }
.ffdb-pill-tab:hover { filter: brightness(1.05); }

/* ── Tabs ─────────────────────────────────────────────────────────────────── */
.ffdb-tabpanel { display: none; animation: ffdbfade .25s ease; }
.ffdb-tabpanel.is-active { display: block; }
@keyframes ffdbfade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── KPI tiles ────────────────────────────────────────────────────────────── */
.ffdb-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.ffdb-kpis-3 { grid-template-columns: repeat(3, 1fr); }
.ffdb-kpi { display: flex; align-items: center; gap: 13px; background: #fff; border: 1px solid var(--border, rgba(6,182,212,.16)); border-radius: 16px; padding: 16px 17px; box-shadow: 0 14px 36px -30px rgba(15,23,42,.45); }
.ffdb-kpi-ic { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.05rem; color: #fff; }
.ffdb-kpi-a .ffdb-kpi-ic { background: linear-gradient(135deg,#0d9488,#0891b2); }
.ffdb-kpi-b .ffdb-kpi-ic { background: linear-gradient(135deg,#0891b2,#1e40af); }
.ffdb-kpi-c .ffdb-kpi-ic { background: linear-gradient(135deg,#06b6d4,#0d9488); }
.ffdb-kpi-d .ffdb-kpi-ic { background: linear-gradient(135deg,#6366f1,#0891b2); }
.ffdb-kpi-e .ffdb-kpi-ic { background: linear-gradient(135deg,#f59e0b,#d97706); }
.ffdb-kpi-f .ffdb-kpi-ic { background: linear-gradient(135deg,#ec4899,#f59e0b); }
.ffdb-kpi-num { font-family: 'Josefin Sans', sans-serif; font-weight: 700; font-size: 1.45rem; color: var(--navy, #0f172a); line-height: 1; }
.ffdb-kpi-label { font-size: .76rem; color: #6b7c84; margin-top: 4px; }

/* ── Panels & grid ────────────────────────────────────────────────────────── */
.ffdb-app .ffdb-panel { background: #fff; border: 1px solid var(--border, rgba(6,182,212,.16)); border-radius: 18px; padding: 20px 22px; margin-bottom: 20px; box-shadow: 0 16px 44px -34px rgba(15,23,42,.4); }
.ffdb-app-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.ffdb-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.ffdb-app .ffdb-panel h2 { font-size: 1.06rem; margin: 0 0 4px; display: flex; align-items: center; gap: 9px; }
.ffdb-app .ffdb-panel h2 i { color: var(--secondary, #0d9488); }
.ffdb-chip { font-size: .72rem; font-weight: 700; color: var(--secondary-hover, #0f766e); background: rgba(13,148,136,.1); padding: 4px 10px; border-radius: 999px; }
.ffdb-link-btn, .ffdb-btn-ghost { background: none; border: 0; color: var(--secondary, #0d9488); font: inherit; font-weight: 600; cursor: pointer; font-size: .85rem; }
.ffdb-link-btn:hover, .ffdb-btn-ghost:hover { text-decoration: underline; }

/* ── Margin split playground ──────────────────────────────────────────────── */
.ffdb-play { background: linear-gradient(165deg, #fff 0%, #f3fbfb 100%); }
.ffdb-field-label { display: block; font-size: .8rem; font-weight: 600; color: var(--deep, #164e63); margin: 14px 0 5px; }
.ffdb-select { width: 100%; padding: 11px 13px; border: 1px solid #d4dee2; border-radius: 11px; font: inherit; background: #fff; box-sizing: border-box; }
.ffdb-select:focus { outline: none; border-color: var(--primary, #06b6d4); box-shadow: 0 0 0 3px rgba(6,182,212,.16); }
.ffdb-splitbar { display: flex; height: 16px; border-radius: 999px; overflow: hidden; margin: 18px 0 14px; background: #e7eef0; box-shadow: inset 0 1px 3px rgba(0,0,0,.06); }
.ffdb-splitbar span { display: block; height: 100%; transition: width .25s cubic-bezier(.4,0,.2,1); }
.ffdb-splitbar-disc { background: linear-gradient(90deg,#f59e0b,#ec4899); }
.ffdb-splitbar-pay  { background: linear-gradient(90deg,#0d9488,#06b6d4); }
.ffdb-splitbar-rest { background: transparent; }
.ffdb-split-rows { display: flex; flex-direction: column; gap: 8px; }
.ffdb-split-row { display: flex; align-items: center; justify-content: space-between; font-size: .88rem; font-weight: 600; color: var(--deep, #164e63); }
.ffdb-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.ffdb-dot-disc { background: #f59e0b; }
.ffdb-dot-pay { background: var(--secondary, #0d9488); }
.ffdb-stepper { display: inline-flex; align-items: center; gap: 0; border: 1px solid #d4dee2; border-radius: 9px; overflow: hidden; }
.ffdb-stepper button { width: 30px; height: 30px; border: 0; background: #f1f7f9; color: var(--deep,#164e63); font-size: 1.1rem; cursor: pointer; line-height: 1; }
.ffdb-stepper button:hover { background: #e3eef1; }
.ffdb-stepper output { min-width: 46px; text-align: center; font-weight: 700; }
.ffdb-pay-out { font-weight: 800; color: var(--secondary-hover, #0f766e); }
.ffdb-range { width: 100%; -webkit-appearance: none; appearance: none; height: 6px; border-radius: 999px; background: #dbe6e9; margin: 6px 0 2px; }
.ffdb-range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--secondary, #0d9488); box-shadow: 0 2px 8px rgba(13,148,136,.4); cursor: pointer; }
.ffdb-range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--secondary, #0d9488); cursor: pointer; }
.ffdb-preview { margin: 16px 0 14px; padding: 14px 16px; border-radius: 14px; background: rgba(6,182,212,.07); border: 1px dashed rgba(6,182,212,.3); }
.ffdb-preview-line { font-size: .84rem; color: var(--deep,#164e63); margin-bottom: 10px; }
.ffdb-preview-split { display: flex; gap: 12px; }
.ffdb-preview-cell { flex: 1; text-align: center; background: #fff; border-radius: 11px; padding: 11px 8px; }
.ffdb-preview-val { display: block; font-family: 'Josefin Sans', sans-serif; font-weight: 700; font-size: 1.3rem; color: #d97706; }
.ffdb-preview-pay { color: var(--secondary-hover, #0f766e); }
.ffdb-preview-cap { font-size: .72rem; color: #6b7c84; }
.ffdb-play-act { display: flex; align-items: center; gap: 12px; }
.ffdb-play-act .ffdb-btn { width: auto; }
.ffdb-inline-msg { font-size: .82rem; font-weight: 600; }
.ffdb-inline-msg.is-ok { color: var(--secondary-hover, #0f766e); }
.ffdb-inline-msg.is-err { color: var(--coral, #e84545); }

/* ── Performance chart (inline SVG bars) ──────────────────────────────────── */
.ffdb-chart { width: 100%; min-height: 200px; }
.ffdb-chart svg { width: 100%; height: auto; display: block; }
.ffdb-legend { display: flex; gap: 14px; font-size: .76rem; color: #6b7c84; }
.ffdb-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.ffdb-sw-clicks { background: #93c5e8; }
.ffdb-sw-orders { background: var(--secondary, #0d9488); }
.ffdb-chart-foot { text-align: right; font-size: .74rem; color: #9aa7ad; margin: 6px 0 0; }

/* ── Campaign link cards ──────────────────────────────────────────────────── */
.ffdb-codecard { border: 1px solid var(--border, rgba(6,182,212,.16)); border-radius: 14px; padding: 15px 16px; margin-bottom: 13px; background: #fff; }
.ffdb-codecard-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.ffdb-codecard-label { font-family: 'Josefin Sans', sans-serif; font-weight: 700; color: var(--navy,#0f172a); font-size: 1rem; }
.ffdb-codecard-tag { font-size: .72rem; font-weight: 700; letter-spacing: .04em; color: var(--secondary-hover,#0f766e); background: rgba(13,148,136,.1); padding: 3px 9px; border-radius: 7px; }
.ffdb-codecard-splits { display: flex; gap: 7px; }
.ffdb-splitpill { font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.ffdb-splitpill-disc { background: rgba(245,158,11,.15); color: #b45309; }
.ffdb-splitpill-pay { background: rgba(13,148,136,.13); color: var(--secondary-hover,#0f766e); }
.ffdb-code-urlrow { display: flex; gap: 8px; margin: 12px 0 10px; }
.ffdb-code-url { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid #dbe6e9; border-radius: 10px; background: #f7fbfc; font: inherit; font-size: .82rem; color: var(--deep,#164e63); }
.ffdb-iconbtn { border: 1px solid #dbe6e9; background: #fff; border-radius: 10px; padding: 0 13px; cursor: pointer; color: var(--secondary,#0d9488); font-size: .85rem; white-space: nowrap; }
.ffdb-iconbtn:hover { background: #f1f7f9; }
.ffdb-iconbtn-wa { color: #25d366; }
.ffdb-codecard-stats { display: flex; gap: 18px; flex-wrap: wrap; font-size: .8rem; color: #6b7c84; align-items: center; }
.ffdb-codecard-stats b { color: var(--navy,#0f172a); }
.ffdb-codecard-edit { margin-left: auto; }
.ffdb-newcode { border: 1px dashed rgba(6,182,212,.35); border-radius: 14px; padding: 16px; margin-bottom: 16px; background: rgba(6,182,212,.04); }
.ffdb-newcode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ffdb-newcode-act { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.ffdb-newcode-act .ffdb-btn { width: auto; }
.ffdb-opt { color: #9aa7ad; font-weight: 400; }

/* ── Payouts ──────────────────────────────────────────────────────────────── */
.ffdb-balance { text-align: center; padding: 14px 0 6px; }
.ffdb-balance-num { font-family: 'Josefin Sans', sans-serif; font-weight: 700; font-size: 2.2rem; color: var(--secondary-hover,#0f766e); line-height: 1; }
.ffdb-balance-cap { font-size: .8rem; color: #6b7c84; margin-top: 4px; }
.ffdb-app textarea { width: 100%; padding: 11px 13px; border: 1px solid #d4dee2; border-radius: 11px; font: inherit; box-sizing: border-box; resize: vertical; }
.ffdb-app textarea:focus { outline: none; border-color: var(--primary,#06b6d4); box-shadow: 0 0 0 3px rgba(6,182,212,.16); }
.ffdb-app .ffdb-field input { width: 100%; padding: 11px 13px; border: 1px solid #d4dee2; border-radius: 11px; font: inherit; box-sizing: border-box; }
.ffdb-app .ffdb-field input:focus { outline: none; border-color: var(--primary,#06b6d4); box-shadow: 0 0 0 3px rgba(6,182,212,.16); }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .ffdb-app .ffdb-app-wrap { grid-template-columns: 1fr; }
  .ffdb-side { position: static; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .ffdb-side-id { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; flex: 1 1 100%; }
  .ffdb-side-nav { flex-direction: row; flex-wrap: wrap; flex: 1 1 100%; }
  .ffdb-navlink { width: auto; }
  .ffdb-side-foot { flex-direction: row; border-top: 0; padding-top: 0; margin-top: 0; }
  .ffdb-app-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .ffdb-kpis, .ffdb-kpis-3 { grid-template-columns: 1fr 1fr; }
  .ffdb-newcode-grid { grid-template-columns: 1fr; }
}
@media (max-width: 460px) { .ffdb-kpis, .ffdb-kpis-3 { grid-template-columns: 1fr; } }

/* ── Glass dropdown (anchored under the field) — used for the affiliate audience
   select. Same frosted look as the homepage hero dropdown, but it opens inline
   right below the trigger instead of as a bottom sheet. JS: enhanceGlassSelect(). */
.ffgd { position: relative; }
.ffgd-panel {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(240,251,254,.88));
  backdrop-filter: blur(18px) saturate(180%); -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid rgba(255,255,255,.6); border-radius: 14px;
  box-shadow: 0 18px 44px -16px rgba(6,95,120,.45);
  padding: 6px; max-height: 264px; overflow-y: auto;
  opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}
.ffgd.ffgd-open .ffgd-panel { opacity: 1; transform: translateY(0); pointer-events: auto; }
.ffgd-option {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; text-align: left; background: transparent; border: 0; cursor: pointer;
  padding: 11px 12px; border-radius: 10px; font: inherit; color: var(--navy, #0c4a6e);
}
.ffgd-option:hover, .ffgd-option:focus-visible { background: rgba(6,182,212,.12); outline: none; }
.ffgd-option[aria-selected="true"] { background: rgba(6,182,212,.16); font-weight: 600; }
.ffgd-check { width: 18px; height: 18px; color: var(--primary, #06b6d4); opacity: 0; flex-shrink: 0; }
.ffgd-option[aria-selected="true"] .ffgd-check { opacity: 1; }
.ffgd-panel::-webkit-scrollbar { width: 8px; }
.ffgd-panel::-webkit-scrollbar-thumb { background: rgba(6,182,212,.45); border-radius: 8px; }
