/* ==========================================================================
   AFFILIATEWP — DASHBOARD, LOGIN, AND REGISTRATION BRANDING
   Rebuilt to match the reference layout exactly: one clean bordered card,
   plain-text tabs (bold when active, gray otherwise, no pill/segment
   background), consistent table styling reused across every tab, bordered
   summary boxes for paired stats, and two distinct button styles — solid
   blue for copy/add actions, plain gray-outline for save/settings actions.
   Targets AffiliateWP's own stable frontend markup so it applies no matter
   which page the affiliate area / login / registration form end up on.
   ========================================================================== */

/* ---------------------------------------------------------- shared surface */
#affwp-affiliate-dashboard,
.affwp-form,
.vg-affiliate-wrap,
.vg-affiliate-apply {
  color: var(--text);
  font-family: var(--font-body);
  max-width: 960px;
  margin: 0 auto;
}

#affwp-login-form,
#affwp-register-form {
  color: var(--text);
  font-family: var(--font-body);
  max-width: 440px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 36px clamp(20px, 4vw, 36px) 40px;
}

#affwp-affiliate-dashboard {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 clamp(20px, 4vw, 36px) 36px;
}

#affwp-affiliate-dashboard h1,
#affwp-affiliate-dashboard h2,
#affwp-affiliate-dashboard h3,
#affwp-affiliate-dashboard h4,
.affwp-form h3 {
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--text);
  margin: 0 0 16px;
}

/* --------------------------------------------------------------- tab nav */
/* Plain-text tabs matching the reference: no pill/segment background,
   generous spacing, bold+dark for the active tab, gray for the rest. */
#affwp-affiliate-dashboard .affwp-tabs,
ul.affwp-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  list-style: none;
  margin: 0 0 28px;
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--border);
}
#affwp-affiliate-dashboard .affwp-tabs li,
ul.affwp-tabs li { margin: 0; }
#affwp-affiliate-dashboard .affwp-tabs li a,
ul.affwp-tabs li a {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}
#affwp-affiliate-dashboard .affwp-tabs li a:hover { color: var(--text); }
#affwp-affiliate-dashboard .affwp-tabs li.active a,
#affwp-affiliate-dashboard .affwp-tabs li a.active,
ul.affwp-tabs li.active a {
  color: var(--text);
  font-weight: 700;
}

@media (max-width: 700px) {
  #affwp-affiliate-dashboard .affwp-tabs,
  ul.affwp-tabs {
    gap: 16px 22px;
    padding: 16px 0 14px;
  }
}

/* ------------------------------------------------------- section headers */
/* "Your current coupons" / "Coupons" / "Statistics" style row headers,
   with the primary action button (Add Additional Code) aligned right. */
.vg-affiliate-area-content h2,
#affwp-affiliate-dashboard .affwp-tab-content > p:first-child + h2 {
  font-size: 18px;
}
#affwp-affiliate-dashboard .affwp-tab-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ------------------------------------------------------------------ tables */
/* The dominant visual language across Statistics, Referrals, Payouts,
   Visits, Coupons, and Network tabs. */
#affwp-affiliate-dashboard table,
.affwp-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 28px;
  font-size: 13.5px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
#affwp-affiliate-dashboard table caption,
.affwp-table caption {
  text-align: left;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  padding-bottom: 10px;
}
#affwp-affiliate-dashboard table thead th,
.affwp-table thead th {
  text-align: left;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
  padding: 12px 14px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
#affwp-affiliate-dashboard table tbody td,
.affwp-table tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
#affwp-affiliate-dashboard table tbody tr:last-child td,
.affwp-table tbody tr:last-child td {
  border-bottom: none;
}
#affwp-affiliate-dashboard table tbody tr:hover td,
.affwp-table tbody tr:hover td {
  background: var(--bg-card);
}
#affwp-affiliate-dashboard table .paid,
#affwp-affiliate-dashboard table .active {
  color: var(--blue);
  font-weight: 600;
}
#affwp-affiliate-dashboard table .pending { color: #b8860b; font-weight: 600; }
#affwp-affiliate-dashboard table .rejected,
#affwp-affiliate-dashboard table .unpaid { color: #c0392b; font-weight: 600; }

/* pagination links under tables */
#affwp-affiliate-dashboard .affwp-tablenav a,
#affwp-affiliate-dashboard .affwp-pagination a {
  color: var(--blue);
  text-decoration: none;
  font-size: 13px;
}

/* ------------------------------------------------ bordered summary boxes */
/* Payouts-style paired stat boxes ("Unpaid earnings" / "Lifetime paid")
   and any other simple label+value box AffiliateWP renders as a div
   rather than a table row. */
#affwp-affiliate-dashboard .affwp-tab-content ul:not(.affwp-tabs),
#affwp-affiliate-dashboard-stats,
.vg-affwp-stat-boxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
}
#affwp-affiliate-dashboard .affwp-tab-content ul:not(.affwp-tabs) li,
#affwp-affiliate-dashboard-stats li,
.vg-affwp-stat-boxes > * {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
  font-size: 13px;
  color: var(--text-muted);
}
#affwp-affiliate-dashboard .affwp-tab-content ul:not(.affwp-tabs) li strong,
#affwp-affiliate-dashboard-stats li strong {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-top: 6px;
}

/* --------------------------------------------- affiliate / network link box */
/* "Your Affiliate Link" and "Your Network Link" boxes: bordered card,
   heading + help icon, description, input + primary buttons, share row. */
#affwp-affiliate-dashboard .affwp-referral-url,
#affwp-affiliate-dashboard #referral-url-wrapper,
.vg-affwp-link-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 22px;
  margin: 0 0 24px;
}
#affwp-affiliate-dashboard .affwp-referral-url-inner,
#affwp-affiliate-dashboard .affwp-referral-url {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
#affwp-affiliate-dashboard .affwp-referral-url input,
#affwp-affiliate-dashboard #referral-url,
#affwp-affiliate-dashboard .affwp-network-url input {
  flex: 1;
  min-width: 220px;
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 11px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
}

/* ------------------------------------------------------- network cards */
/* "Your Network" recruited-affiliate cards (avatar + star + stats). */
#affwp-affiliate-dashboard .affwp-network-list,
.vg-affwp-network-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
#affwp-affiliate-dashboard .affwp-network-card,
.vg-affwp-network-card {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
  min-width: 200px;
}

/* --------------------------------------------------------- forms + fields */
.affwp-form-fields p,
#affwp-affiliate-dashboard .affwp-form-fields p,
#affwp-affiliate-dashboard form p {
  margin: 0 0 18px;
}
.affwp-form-fields label,
#affwp-affiliate-dashboard label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
#affwp-affiliate-dashboard .description,
.affwp-form-fields .description {
  display: block;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 6px;
}
.affwp-form-fields input[type="text"],
.affwp-form-fields input[type="email"],
.affwp-form-fields input[type="password"],
.affwp-form-fields input[type="url"],
.affwp-form-fields select,
.affwp-form-fields textarea,
#affwp-affiliate-dashboard input[type="text"],
#affwp-affiliate-dashboard input[type="email"],
#affwp-login-form input[type="text"],
#affwp-login-form input[type="password"],
#affwp-register-form input[type="text"],
#affwp-register-form input[type="email"],
#affwp-register-form input[type="password"],
#affwp-register-form input[type="url"] {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 11px 14px;
  font-family: var(--font-body);
  font-size: 14px;
}
.affwp-form-fields input:focus,
#affwp-affiliate-dashboard input:focus,
#affwp-login-form input:focus,
#affwp-register-form input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-dim);
}
/* checkbox rows (e.g. "Enable New Referral Notifications") */
#affwp-affiliate-dashboard input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-right: 8px;
  vertical-align: middle;
  accent-color: var(--blue);
}

/* ------------------------------------------------------------------ buttons */
/* PRIMARY — solid blue, used for copy-link / add-code style actions. */
#affwp-affiliate-dashboard .copy-referral-url,
#affwp-affiliate-dashboard .affwp-referral-url button,
#affwp-affiliate-dashboard .affwp-add-coupon,
#affwp-affiliate-dashboard a.button-primary,
#affwp-affiliate-dashboard button.button-primary,
#affwp-affiliate-dashboard input[type="submit"].button-primary,
#affwp-login-form input[type="submit"],
#affwp-register-form input[type="submit"],
.affwp-form input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--blue);
  color: var(--on-blue);
  border: none;
  border-radius: var(--radius-btn);
  padding: 11px 22px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
#affwp-affiliate-dashboard .copy-referral-url:hover,
#affwp-affiliate-dashboard .affwp-referral-url button:hover,
#affwp-affiliate-dashboard a.button-primary:hover,
#affwp-affiliate-dashboard button.button-primary:hover,
#affwp-login-form input[type="submit"]:hover,
#affwp-register-form input[type="submit"]:hover {
  background: var(--blue-light);
}

/* SECONDARY — plain gray-outline, used for Save/Settings-style form
   submits (e.g. "Save Profile Settings"), matching the reference exactly. */
#affwp-affiliate-dashboard input[type="submit"]:not(.button-primary),
#affwp-affiliate-dashboard button:not(.button-primary):not(.copy-referral-url),
#affwp-affiliate-dashboard .button:not(.button-primary) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-btn);
  padding: 10px 20px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}
#affwp-affiliate-dashboard input[type="submit"]:not(.button-primary):hover,
#affwp-affiliate-dashboard button:not(.button-primary):not(.copy-referral-url):hover,
#affwp-affiliate-dashboard .button:not(.button-primary):hover {
  border-color: var(--blue);
  color: var(--blue);
}

/* share icon row */
#affwp-affiliate-dashboard .affwp-share-icons,
.vg-affwp-share-icons {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}
#affwp-affiliate-dashboard .affwp-share-icons a {
  color: var(--text-muted);
  transition: var(--transition);
}
#affwp-affiliate-dashboard .affwp-share-icons a:hover { color: var(--blue); }

/* ----------------------------------------------------------------- notices */
.affwp-notice,
.affwp-alert,
#affwp-affiliate-dashboard .affwp-errors,
#affwp-login-form .affwp-errors,
#affwp-register-form .affwp-errors {
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 13px;
  margin: 0 0 20px;
  border: 1px solid var(--border);
}
.affwp-notice.success,
.affwp-alert-success {
  background: var(--blue-dim);
  border-color: var(--blue-dim-2);
  color: var(--blue);
}
.affwp-notice.error,
.affwp-alert-error,
#affwp-affiliate-dashboard .affwp-errors,
#affwp-login-form .affwp-errors,
#affwp-register-form .affwp-errors {
  background: rgba(192, 57, 43, 0.08);
  border-color: rgba(192, 57, 43, 0.3);
  color: #c0392b;
}
.affwp-notice.error ul,
.affwp-alert-error ul,
#affwp-affiliate-dashboard .affwp-errors ul,
#affwp-login-form .affwp-errors ul,
#affwp-register-form .affwp-errors ul {
  margin: 0;
  padding-left: 18px;
}

@media (max-width: 700px) {
  #affwp-affiliate-dashboard {
    padding: 0 18px 28px;
  }
  #affwp-affiliate-dashboard table,
  .affwp-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  #affwp-affiliate-dashboard .affwp-tab-content ul:not(.affwp-tabs),
  #affwp-affiliate-dashboard-stats {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
  }
  #affwp-affiliate-dashboard .affwp-referral-url,
  #affwp-affiliate-dashboard #referral-url-wrapper {
    padding: 16px 18px;
  }
}
