/* ==============================================================================
   affiliate.css: MyFxFirm Affiliates
   Navy canvas, lime accent, white work panel with a dark detail card.
   Montserrat, light weights for figures.
   ============================================================================== */

:root {
  --af-bg: #0a1226;
  --af-bg-top: #14234a;
  --af-ink: #0a1224;
  --af-text: #f2f5fb;
  --af-muted: #8a95ad;
  --af-line: rgba(255, 255, 255, 0.10);

  /* Brand Blue Palette matching Landing Page */
  --af-blue-grad: linear-gradient(135deg, #60a5fa 0%, #3b82f6 50%, #2563eb 100%);
  --af-blue-grad-h: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
  --af-blue: #3b82f6;
  --af-blue-light: #60a5fa;
  --af-blue-dark: #2563eb;
  --af-blue-deep: #1d4ed8;
  --af-blue-glow: 0 4px 18px rgba(59, 130, 246, 0.45);

  --af-dark: #121a2f;
  --af-tile: #1a243d;
  --af-bar: #2b3350;
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Montserrat', -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: var(--af-text);
  background:
    radial-gradient(1200px 520px at 50% -140px, rgba(46, 78, 150, 0.45), transparent 70%),
    linear-gradient(180deg, #0d1832 0%, #0a1226 380px, #0a1124 100%);
  background-color: var(--af-bg);
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, p { margin: 0; }
a { color: inherit; text-decoration: none; }
i, em { font-style: normal; }

:focus-visible { outline: 2px solid var(--af-blue); outline-offset: 2px; }

.af-page {
  max-width: 1720px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 44px 56px;
}

/* ==================== TOP BAR ==================== */
.af-top { display: flex; align-items: center; gap: 24px; }

.af-brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.af-brand svg { width: 28px; height: 28px; color: #fff; }

.af-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 auto;
  padding: 6px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 10px 30px -14px rgba(0, 0, 0, 0.6);
  overflow-x: auto;
  scrollbar-width: none;
}
.af-nav::-webkit-scrollbar { display: none; }
.af-nav a {
  white-space: nowrap;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  color: #1a2236;
  transition: background 0.15s ease;
}
.af-nav a:hover { background: #eef1f6; }
.af-nav a.active {
  background: var(--af-blue-grad);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.af-top-right { display: flex; align-items: center; gap: 10px; }
.af-me { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: #243050; border: 2px solid rgba(255, 255, 255, 0.85); }

.af-circle-btn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.af-circle-btn svg { width: 18px; height: 18px; }
.af-circle-btn:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.3); }

/* ==================== TITLE ROW ==================== */
.af-title-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 28px 0 24px; }
.af-title-left { display: flex; align-items: center; gap: 18px; }
.af-title-left h1 { font-size: 56px; font-weight: 300; line-height: 1.05; letter-spacing: -0.015em; }
.af-title-right { display: flex; align-items: center; gap: 12px; }

.af-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 46px;
  padding: 0 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.2s ease,
              background 0.25s ease !important;
  will-change: transform, box-shadow;
}
.af-pill-btn:hover {
  transform: translateY(-1.5px);
}
.af-pill-btn:active {
  transform: scale(0.97) translateY(1px) !important;
  transition-duration: 0.1s !important;
}

/* Liquid Sheen Shimmer Effect across Blue Buttons */
.af-lime::after, .af-blue-btn::after {
  content: "";
  position: absolute;
  top: -60%;
  left: -70%;
  width: 240%;
  height: 220%;
  background: linear-gradient(60deg, transparent 35%, rgba(255, 255, 255, 0.3) 50%, transparent 65%);
  transform: rotate(25deg) translateY(-120%);
  transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.af-lime:hover::after, .af-blue-btn:hover::after {
  transform: rotate(25deg) translateY(120%);
}
.af-pill-btn svg { width: 17px; height: 17px; }
.af-outline { background: rgba(255, 255, 255, 0.03); border-color: rgba(255, 255, 255, 0.2); color: #fff; font-weight: 500; }
.af-outline:hover { background: rgba(255, 255, 255, 0.09); }
.af-lime, .af-blue-btn {
  background: var(--af-blue-grad);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 24px -4px rgba(59, 130, 246, 0.6);
}
.af-lime:hover, .af-blue-btn:hover {
  filter: brightness(1.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 12px 30px -4px rgba(59, 130, 246, 0.8);
}
.af-lime:disabled, .af-blue-btn:disabled {
  background: #252e42;
  color: #64748b;
  cursor: default;
  box-shadow: none;
  filter: none;
}
.af-white { background: #fff; color: var(--af-ink); }
.af-white:hover { background: #eef1f6; }

/* ==================== CARDS ==================== */
.af-card {
  position: relative;
  border-radius: 32px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025));
  border: 1px solid var(--af-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  min-width: 0;
}

.af-stats { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 24px; }

.af-kpis { display: grid; grid-template-columns: 1fr 1fr 0.65fr; gap: 36px; padding: 32px 36px 28px; }
.af-kpi { display: flex; flex-direction: column; min-width: 0; }
.af-kpi-label { font-size: 13.5px; font-weight: 400; color: #cfd6e6; }
.af-kpi-val { margin-top: 8px; font-size: 42px; font-weight: 300; line-height: 1.1; letter-spacing: -0.01em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.af-kpi-val i { font-size: 20px; color: var(--af-muted); margin-right: 4px; vertical-align: 0.55em; }
.af-kpi-val em { font-size: 20px; color: var(--af-muted); margin-left: 6px; }

.af-bar-wrap { margin-top: 28px; }
.af-bar-labels { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 12.5px; font-weight: 400; color: #e4e9f4; }
.af-bar { height: 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.af-bar span {
  display: block;
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.6);
  transition: width 0.5s ease;
}

.af-faces { display: flex; margin-top: 20px; }
.af-faces img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: #2b3556;
  border: 2px solid #1a2442;
  margin-left: -8px;
}
.af-faces img:first-child { margin-left: 0; }

/* Referral Link & 10% Discount Code Boxes inside KPI Cards */
.af-ref-box {
  margin-top: 18px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(10, 18, 38, 0.55);
  border: 1px solid rgba(96, 165, 250, 0.22);
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.af-ref-box:hover {
  border-color: rgba(96, 165, 250, 0.48);
  background: rgba(15, 26, 54, 0.72);
}
.af-ref-box-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #93c5fd;
}
.af-ref-box-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.af-ref-box-row code {
  font-family: 'Plus Jakarta Sans', 'Montserrat', monospace;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.af-ref-mini-btn {
  flex-shrink: 0;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.4);
  background: rgba(59, 130, 246, 0.2);
  color: #dbeafe;
  font-size: 10.5px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}
.af-ref-mini-btn:hover {
  background: #3b82f6;
  color: #ffffff;
}
.af-ref-rule-note {
  cursor: default;
}
.af-ref-rule-desc {
  font-size: 11.5px;
  color: #cfd6e6;
  line-height: 1.35;
}
.af-ref-rule-desc b {
  color: #60a5fa;
  font-weight: 600;
}

/* ---- Payout card ---- */
.af-payout { display: flex; flex-direction: column; justify-content: space-between; padding: 30px 28px 24px 34px; overflow: hidden; }
.af-payout-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.af-payout-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.af-chip {
  height: 32px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  font-size: 12.5px;
  font-weight: 500;
  color: #e4e9f4;
  margin-top: 6px;
}
.af-chip:hover { background: rgba(255, 255, 255, 0.12); }
.af-arrow { border-radius: 50%; }

.af-payout-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 26px; }
.af-rails { display: flex; align-items: flex-end; }
.af-rail {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 3px;
  width: 112px;
  height: 68px;
  padding: 0 0 14px 16px;
  text-align: left;
  border: 0;
  border-radius: 18px 18px 0 0;
  background: rgba(255, 255, 255, 0.06);
  color: #cfd6e6;
  transition: height 0.18s ease, background 0.15s ease;
}
.af-rail b { font-size: 13.5px; font-weight: 600; }
.af-rail span { font-size: 11px; font-weight: 400; opacity: 0.75; }
.af-rail:hover { background: rgba(255, 255, 255, 0.11); }
.af-rail.active {
  height: 92px;
  background: linear-gradient(145deg, #3b82f6 0%, #1d4ed8 100%);
  color: #ffffff;
  border: 1px solid rgba(96, 165, 250, 0.6);
  border-bottom: 0;
  box-shadow: 0 10px 26px -4px rgba(59, 130, 246, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.af-rail.active b { color: #ffffff; }
.af-rail.active span { color: #dbeafe; opacity: 0.95; }
.af-payout-bottom .af-pill-btn { height: 50px; padding: 0 28px; font-size: 13.5px; }

/* ==================== FILTERS ==================== */
.af-filters { display: flex; align-items: center; gap: 14px; margin: 32px 0 24px; }
.af-filters-label { display: inline-flex; align-items: center; gap: 10px; margin-right: 6px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.af-filters-label b {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  font-size: 11px;
  font-weight: 600;
}

.af-select {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  height: 50px;
  padding: 0 44px 0 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--af-line);
  transition: border-color 0.15s ease;
}
.af-select:focus-within { border-color: rgba(59, 130, 246, 0.7); }
.af-select select, .af-select input {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  outline: 0;
  padding: 0;
  font-size: 13px;
  font-weight: 400;
  color: #aab3c8;
  cursor: pointer;
}
.af-select input { cursor: text; color: #fff; }
.af-select input::placeholder { color: #6e7a95; }
.af-select input::-webkit-search-cancel-button { display: none; }
.af-select select.set { color: #fff; }
.af-date select { color: #fff; font-weight: 500; }
.af-select > svg { position: absolute; right: 18px; width: 15px; height: 15px; color: #cfd6e6; pointer-events: none; }
select option { background: #0f1a36; color: #fff; }

/* ==================== WHITE PANEL ==================== */
.af-panel {
  position: relative;
  padding: 0 24px 24px;
  border-radius: 40px;
  background: #fff;
  color: var(--af-ink);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.7);
}

.af-panel-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  padding: 0 8px;
}

.af-list-head h2 {
  font-size: 16px;
  font-weight: 600;
  color: #1d2438;
}

/* Notched tab bar */
.af-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  padding: 0 36px 14px;
  background: #0a1225;
  border-radius: 0 0 32px 32px;
}
.af-notch::before, .af-notch::after {
  content: "";
  position: absolute;
  top: 0;
  width: 25px;
  height: 24px;
  pointer-events: none;
}
.af-notch::before { right: calc(100% - 1px); background: radial-gradient(circle at 0 100%, transparent 23px, #0a1225 24px); }
.af-notch::after  { left: calc(100% - 1px);  background: radial-gradient(circle at 100% 100%, transparent 23px, #0a1225 24px); }

.af-tabs { display: flex; gap: 10px; }
.af-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: #232b40;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.af-tabs button b {
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 11px;
  font-weight: 600;
}
.af-tabs button:hover { background: #2d364e; }
.af-tabs button.active {
  background: var(--af-blue-grad);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}
.af-tabs button.active b {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.af-panel-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.af-panel-grid { display: grid; grid-template-columns: minmax(380px, 460px) minmax(0, 1fr); gap: 24px; align-items: stretch; }

/* ---- List ---- */
.af-list-col { display: flex; flex-direction: column; min-width: 0; }
.af-light-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #dfe3ec;
  color: #1d2438;
  transition: background 0.15s ease;
}
.af-light-btn svg { width: 17px; height: 17px; }
.af-light-btn:hover { background: #f1f3f8; }

.af-list { display: flex; flex-direction: column; gap: 10px; max-height: 480px; overflow-y: auto; padding: 0 4px 2px 0; scrollbar-width: thin; scrollbar-color: #cdd3e0 transparent; }

.af-row {
  width: 100%;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  height: 70px;
  padding: 0 18px 0 14px;
  text-align: left;
  border: 0;
  border-radius: 22px;
  background: #f3f4f7;
  color: var(--af-ink);
  transition: background 0.15s ease;
}
.af-row:hover { background: #e9ebf1; }
.af-row img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: #d7dbe6; }
.af-row-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.af-row-id { font-size: 14px; font-weight: 600; }
.af-row-id i { font-weight: 400; color: #6c7488; margin-right: 3px; }
.af-row-sub { font-size: 12px; color: #7b8497; margin-top: 2px; }
.af-row-chip {
  height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid #dfe3ec;
  background: #fff;
  font-size: 11.5px;
  font-weight: 500;
  color: #2b3349;
}
.af-row-chip.cleared {
  background: repeating-linear-gradient(135deg, #e3e6ee 0 3px, #f4f5f8 3px 7px);
}
.af-row-amt { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 88px; text-align: right; }
.af-row-amt i { font-size: 12px; color: #7b8497; margin-right: 2px; vertical-align: 0.35em; }

.af-row.active { background: #0f1830; color: #fff; }
.af-row.active .af-row-sub { color: #94a0ba; }
.af-row.active .af-row-id i { color: #94a0ba; }
.af-row.active .af-row-chip { background: #fff; border-color: #fff; color: var(--af-ink); }
.af-row.active .af-row-amt i { color: #94a0ba; }

.af-empty { padding: 36px 12px; text-align: center; font-size: 14px; color: #6c7488; }

/* ---- Detail ---- */
.af-detail {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 0;
  padding: 26px 26px 20px;
  border-radius: 34px;
  background: var(--af-dark);
  color: #fff;
  min-width: 0;
}
.af-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.af-dh-block { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.af-dh-label { font-size: 13px; color: var(--af-muted); }
.af-dh-id { display: flex; align-items: center; gap: 14px; }
.af-dh-id i { font-size: 38px; font-weight: 300; color: var(--af-muted); }
.af-dh-id strong { font-size: 44px; font-weight: 300; letter-spacing: -0.01em; line-height: 1; }
.af-status-pill {
  height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 12px;
  font-weight: 500;
}
.af-status-pill.cleared { background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.10) 0 3px, transparent 3px 7px); }
.af-dh-pkg { font-size: 34px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.05; }
.af-dh-sub { font-size: 12px; color: var(--af-muted); }
.af-dh-person { display: flex; align-items: center; gap: 12px; }
.af-dh-person img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #2b3556; }
.af-dh-person span { display: flex; flex-direction: column; line-height: 1.3; }
.af-dh-person strong { font-size: 14px; font-weight: 600; }
.af-dh-person em { font-size: 11.5px; color: var(--af-muted); }

.af-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; flex: 1; min-height: 110px; }
.af-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  padding: 18px 36px 18px 20px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--af-tile);
}
.af-tile-val { font-size: 24px; font-weight: 400; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.af-tile-val i { font-size: 13px; color: var(--af-muted); margin-right: 3px; vertical-align: 0.5em; }
.af-tile-val b { font-weight: 400; }
.af-tile-lbl { font-size: 12px; color: var(--af-muted); line-height: 1.3; }
.af-tile-arrow { position: absolute; top: 16px; right: 16px; width: 16px; height: 16px; color: #aeb7cd; }
.af-tile-add {
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 18px 20px;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0 5px, rgba(255, 255, 255, 0.015) 5px 10px);
  color: #fff;
  transition: background 0.15s ease;
}
.af-tile-add:hover { background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.09) 0 5px, rgba(255, 255, 255, 0.03) 5px 10px); }
.af-plus { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, 0.10); }
.af-plus svg { width: 18px; height: 18px; }

.af-detail-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 16px 14px 24px;
  border-radius: 26px;
  background: #2a3249;
}
.af-foot-cols { display: flex; gap: 36px; flex-wrap: wrap; }
.af-foot-cols span { display: block; font-size: 12px; color: #a3aec6; }
.af-foot-cols strong { font-size: 24px; font-weight: 400; font-variant-numeric: tabular-nums; }
.af-foot-cols i { font-size: 13px; color: #a3aec6; margin-right: 3px; vertical-align: 0.45em; }
.af-foot-cols b { font-weight: 400; }
.af-foot-actions { display: flex; align-items: center; gap: 12px; }
.af-dark-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #1a2136;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  transition: background 0.15s ease;
}
.af-dark-btn svg { width: 18px; height: 18px; }
.af-dark-btn:hover { background: #232c46; }
.af-foot-actions .af-pill-btn { height: 44px; padding: 0 28px; }

/* ==================== TOAST ==================== */
.af-toasts { position: fixed; right: 24px; bottom: 24px; z-index: 100; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.af-toast {
  max-width: 380px;
  padding: 13px 18px;
  border-radius: 16px;
  background: #fff;
  color: var(--af-ink);
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: 0 16px 40px -14px rgba(0, 0, 0, 0.7);
  border-left: 5px solid var(--af-blue);
  animation: afToastIn 0.2s ease both;
}
.af-toast.hide { opacity: 0; transform: translateY(6px); transition: opacity 0.25s ease, transform 0.25s ease; }
@keyframes afToastIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1240px) {
  .af-stats { grid-template-columns: minmax(0, 1fr); }
  .af-filters { flex-wrap: wrap; }
  .af-filters-label { width: 100%; }
  .af-select { flex: 1 1 200px; }
}

@media (max-width: 1060px) {
  .af-panel { padding-top: 14px; }
  .af-panel-header { flex-wrap: wrap; height: auto; padding: 6px 0 14px; gap: 14px; }
  .af-notch { position: static; transform: none; padding: 0; background: transparent; order: 3; width: 100%; display: flex; justify-content: center; }
  .af-notch::before, .af-notch::after { display: none; }
  .af-panel-grid { grid-template-columns: minmax(0, 1fr); }
  .af-detail { margin-top: 12px; }
}

@media (max-width: 820px) {
  .af-page { padding: 16px 16px 48px; }
  .af-top { flex-wrap: wrap; gap: 14px; }
  .af-brand { order: 1; }
  .af-top-right { order: 2; margin-left: auto; }
  .af-nav { order: 3; width: 100%; margin: 0; }
  .af-title-row { flex-wrap: wrap; margin: 22px 0 18px; }
  .af-title-left h1 { font-size: 40px; }
  .af-kpis { grid-template-columns: minmax(0, 1fr); gap: 26px; padding: 22px; }
  .af-payout { padding-left: 20px; }
  .af-payout-top { padding-right: 18px; }
  .af-payout-bottom { flex-wrap: wrap; }
  .af-payout-bottom .af-pill-btn { margin: 0 18px 18px 0; }
  .af-rail { width: 96px; }
  .af-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .af-notch { padding: 0 14px 10px; }
  .af-tabs button { padding: 0 11px; font-size: 11px; }
  .af-panel { border-radius: 30px; padding: 74px 10px 10px; }
  .af-dh-id strong { font-size: 32px; }
}

@media (max-width: 520px) {
  .af-nav a { padding: 10px 16px; }
  .af-title-right { width: 100%; }
  .af-title-right .af-outline { flex: 1; }
  .af-row { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .af-row-chip { display: none; }
  .af-foot-cols { gap: 22px; }
}
