/* Container styling */
.affwp-form {
    max-width: 100%;
    font-family: var(--e-global-typography-579f1cd-font-family), Sans-serif;
    color: #313135;
    padding: 0;
    margin-bottom: 0 !important;
}

.affwp-form fieldset {
    padding: 0;
}

.affwp-form fieldset legend {
    font-family: var(--e-global-typography-text-font-family), Sans-serif;
    font-size: var(--e-global-typography-text-font-size);
    line-height: var(--e-global-typography-text-line-height);
    color: var(--e-global-color-ccb449c);
}

/* Field wrap/spacing */
.affwp-form p {
    margin-bottom: 20px;
}

.affwp-form p:last-child {
    margin-bottom: 0 !important;
}

/* Label styling */
.affwp-form label {
    display: block;
    font-size: 16px;
    font-weight: 400;
    color: #141d26;
    margin-bottom: 8px;
}

/* Input and Textarea styling */
.affwp-form input[type="text"],
.affwp-form input[type="email"],
.affwp-form input[type="password"],
.affwp-form input[type="url"],
.affwp-form select,
.affwp-form textarea {
    width: 100%;
    background-color: #ffffff;
    color: #141d26;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #bfc3c8;
    font-size: 16px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.affwp-form input:focus,
.affwp-form textarea:focus {
    outline: none;
    border-color: #327D66;
}

/* Submit Button styling */
.affwp-form input[type="submit"] {
    background-color: #327D66;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
    display: inline-block;
    width: auto;
}

.affwp-form input[type="submit"]:hover {
    background-color: #2a6956;
    opacity: 0.9;
}

/* Checkbox and Radio labels */
.affwp-form .affwp-send-notifications-wrap label {
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
}

.affwp-form input[type="checkbox"] {
    vertical-align: middle;
}

/* Label styling to match the Create Post widget */
.affwp-form label,
#affwp-affiliate-dashboard h3 {
    font-family: var(--e-global-typography-579f1cd-font-family), Sans-serif;
    font-size: var(--e-global-typography-579f1cd-font-size);
    font-weight: var(--e-global-typography-579f1cd-font-weight);
    line-height: var(--e-global-typography-579f1cd-line-height);
    color: var(--e-global-color-ccb449c);
}

/* Ensure labels for checkboxes/radios stay next to the input */
.affwp-form .affwp-send-notifications-wrap label,
.affwp-form input[type="checkbox"] + label,
.affwp-form input[type="radio"] + label {
    display: inline-flex;
    margin-bottom: 0;
    margin-left: 8px;
    cursor: pointer;
}

/* Optional: vertical rhythm for paragraph wraps */
.affwp-form p {
    margin-bottom: 24px !important;
}

/* Container for the TOS */
.affwp-tos {
    display: flex !important;
    align-items: center;
    cursor: pointer;
    font-size: 15px;
    line-height: 1.4;
    user-select: none;
    position: relative;
    padding-left: 0;
}

/* Checkbox Hover state */
.affwp-tos input[type="checkbox"]:hover {
    border-color: #327D66;
    background-color: #f8f8f8;
}

/* Link styling inside TOS */
.affwp-tos a {
    color: #327D66;
    text-decoration: underline;
    font-weight: 600;
    transition: opacity 0.2s;
}

.affwp-tos a:hover {
    opacity: 0.8;
}

/* Vertical spacing for the TOS paragraph */
p.affwp-tos-wrap {
    margin-top: 20px;
    margin-bottom: 20px;
}

/* Custom checkbox rendering */
.affwp-tos input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    display: inline-grid !important;
    place-content: center;
    width: 22px;
    height: 22px;
    border: 2px solid #bfc3c8;
    border-radius: 6px;
    background-color: #fff;
    margin-right: 12px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    flex-shrink: 0;
    position: relative;
}

.affwp-tos input[type="checkbox"]::before {
    content: "";
    width: 12px;
    height: 12px;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    background-color: #ffffff !important;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.affwp-tos input[type="checkbox"]:checked::before {
    transform: scale(1) rotate(20deg);
}

.affwp-tos input[type="checkbox"]:checked {
    background-color: #327D66 !important;
    border-color: #327D66 !important;
}

/* Hide default h4 headings inside dashboard */
#affwp-affiliate-dashboard h4 {
    display: none !important;
}

/* Card: strip border and shadow */
.affwp-card {
    border: 0 !important;
    box-shadow: none !important;
}

.affwp-card .affwp-card__header,
.affwp-card .affwp-card__content {
    padding: 0;
}

/* ── Affiliate Link Section ── */
.affwp-card__header.affwp-affiliate-link__header {
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.affwp-card__header h3 {
    margin: 0 0 5px 0 !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #141d26 !important;
}

.affwp-card__header p {
    margin: 0 !important;
    font-size: 14px;
    color: #797a88;
}

.affwp-affiliate-link__display {
    display: flex !important;
    gap: 10px;
    align-items: stretch;
    background: #f8f8f8;
    padding: 8px;
    border-radius: 12px;
    border: 1px solid #dadfe4;
}

.affwp-affiliate-link__input {
    flex-grow: 1;
    background: transparent !important;
    border: none !important;
    padding: 10px 12px !important;
    font-family: monospace;
    font-size: 14px !important;
    color: #327D66 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.affwp-affiliate-link-copy-link {
    background-color: #327D66 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 0 20px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.affwp-affiliate-link-copy-link:hover {
    background-color: #2a6956 !important;
    transform: translateY(-1px);
}

.affwp-card__tooltip svg {
    width: 20px;
    height: 20px;
    color: #bfc3c8;
}

.affwp-card__content,
.affwp-card__footer {
    margin-top: 20px;
}

.affwp-card__footer {
    padding: 0 !important;
}


/* ============================================================
   GRAPHS SECTION — Filter bar (select + datepicker + button)
   ============================================================ */

/* Wrapper row */
#affwp-affiliate-dashboard-graphs .tablenav.top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 0;
    border: none;
    background: none;
}

/* Remove WP-admin tablenav pseudo-elements if any */
#affwp-affiliate-dashboard-graphs .tablenav.top::after,
#affwp-affiliate-dashboard-graphs .tablenav.top::before {
    display: none;
}

/* Date range select dropdown */
#affwp-affiliate-dashboard-graphs select.affwp-graphs-date-options {
    background-color: #ffffff;
    color: #141d26;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #bfc3c8;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s;
    height: auto;
    min-width: 140px;
    box-sizing: border-box;
    appearance: auto;
}

#affwp-affiliate-dashboard-graphs select.affwp-graphs-date-options:focus {
    outline: none;
    border-color: #327D66;
}

/* Custom date range inputs (datepicker) */
#affwp-affiliate-dashboard-graphs #affwp-date-range-options {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

#affwp-affiliate-dashboard-graphs .affwp-search-date {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #797a88;
}

#affwp-affiliate-dashboard-graphs .affwp-search-date span {
    color: #797a88;
    font-size: 13px;
    white-space: nowrap;
}

#affwp-affiliate-dashboard-graphs input.affwp-datepicker {
    background-color: #ffffff;
    color: #141d26;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #bfc3c8;
    font-size: 14px;
    font-family: inherit;
    width: 130px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

#affwp-affiliate-dashboard-graphs input.affwp-datepicker:focus {
    outline: none;
    border-color: #327D66;
}

/* Filter submit button */
#affwp-affiliate-dashboard-graphs input#submit.button,
#affwp-graphs-filter input[type="submit"].button {
    background-color: #327D66 !important;
    color: #ffffff !important;
    padding: 10px 22px !important;
    border-radius: 10px !important;
    border: none !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.15s;
    display: inline-block;
    height: auto;
    line-height: normal;
    box-shadow: none !important;
}

#affwp-affiliate-dashboard-graphs input#submit.button:hover,
#affwp-graphs-filter input[type="submit"].button:hover {
    background-color: #2a6956 !important;
    transform: translateY(-1px);
}


/* ============================================================
   TABLES — All AffiliateWP dashboard tables
   Targets: .affwp-table, .affwp-table-responsive, and
   specific section tables by ID
   ============================================================ */

/* Base table reset & layout */
#affwp-affiliate-dashboard .affwp-table,
#affwp-affiliate-dashboard table.affwp-table-responsive {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #dadfe4;
    font-size: 14px;
    font-family: inherit;
    color: #141d26;
    background-color: #ffffff;
}

/* Table header row */
#affwp-affiliate-dashboard .affwp-table thead,
#affwp-affiliate-dashboard table.affwp-table-responsive thead {
    background-color: #f0f4f2;
}

#affwp-affiliate-dashboard .affwp-table thead th,
#affwp-affiliate-dashboard table.affwp-table-responsive thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #327D66;
    border-bottom: 1px solid #dadfe4;
    white-space: nowrap;
    border-width: 1px !important;
}

/* Table body rows */
#affwp-affiliate-dashboard .affwp-table tbody tr,
#affwp-affiliate-dashboard table.affwp-table-responsive tbody tr {
    transition: background-color 0.15s ease;
    border-width: 1px !important;
}

#affwp-affiliate-dashboard .affwp-table tbody tr:nth-child(even),
#affwp-affiliate-dashboard table.affwp-table-responsive tbody tr:nth-child(even) {
    background-color: #f8faf9;
}

#affwp-affiliate-dashboard .affwp-table tbody tr:hover,
#affwp-affiliate-dashboard table.affwp-table-responsive tbody tr:hover {
    background-color: #edf4f0;
}

/* Table body cells */
#affwp-affiliate-dashboard .affwp-table tbody td,
#affwp-affiliate-dashboard table.affwp-table-responsive tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #edf0f3;
    color: #313135;
    vertical-align: middle;
    line-height: 1.5;
    border-width: 1px !important;
}

/* Remove border on last row */
#affwp-affiliate-dashboard .affwp-table tbody tr:last-child td,
#affwp-affiliate-dashboard table.affwp-table-responsive tbody tr:last-child td {
    border-bottom: none;
}

/* Empty state message row */
#affwp-affiliate-dashboard .affwp-table td.affwp-table-no-data,
#affwp-affiliate-dashboard table.affwp-table-responsive td.affwp-table-no-data,
#affwp-affiliate-dashboard .affwp-table tbody td[colspan] {
    text-align: center;
    color: #797a88;
    font-style: italic;
    padding: 24px 16px;
}

/* Status badges inside table cells */
#affwp-affiliate-dashboard .affwp-table .status,
#affwp-affiliate-dashboard table.affwp-table-responsive .status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

/* Status colour variants — scoped to affwp */
#affwp-affiliate-dashboard .affwp-table .status-paid,
#affwp-affiliate-dashboard .affwp-table td.paid .status,
#affwp-affiliate-dashboard table.affwp-table-responsive .status-paid {
    background-color: #e6f4ef;
    color: #327D66;
}

#affwp-affiliate-dashboard .affwp-table .status-pending,
#affwp-affiliate-dashboard table.affwp-table-responsive .status-pending {
    background-color: #fef9ec;
    color: #b07d1a;
}

#affwp-affiliate-dashboard .affwp-table .status-rejected,
#affwp-affiliate-dashboard table.affwp-table-responsive .status-rejected {
    background-color: #fdecea;
    color: #c0392b;
}

#affwp-affiliate-dashboard .affwp-table .status-unpaid,
#affwp-affiliate-dashboard table.affwp-table-responsive .status-unpaid {
    background-color: #eef1f5;
    color: #5a6778;
}

/* Referrals table specific */
#affwp-affiliate-dashboard-referrals.affwp-table thead th,
#affwp-affiliate-dashboard-referrals.affwp-table tbody td {
    /* inherits from base — column widths handled naturally */
}

/* Payouts table specific — slightly tighter text */
#affwp-affiliate-dashboard-payouts thead th {
    font-size: 11px;
}

/* Visits table specific */
#affwp-affiliate-dashboard-visits table.affwp-table-responsive thead th.visit-url {
    width: 40%;
}

/* Custom links table */
#affwp-custom-links-table {
    margin-top: 12px;
}

/* Statistics tables (referral-counts, earnings-stats, campaign-stats) */
#affwp-affiliate-dashboard-referral-counts .affwp-table-responsive thead th,
#affwp-affiliate-dashboard-earnings-stats .affwp-table-responsive thead th,
#affwp-affiliate-dashboard-campaign-stats .affwp-table-responsive thead th {
    font-size: 12px;
}

#affwp-affiliate-dashboard-referral-counts .affwp-table-responsive tbody td,
#affwp-affiliate-dashboard-earnings-stats .affwp-table-responsive tbody td,
#affwp-affiliate-dashboard-campaign-stats .affwp-table-responsive tbody td {
    font-size: 16px;
    font-weight: 600;
    color: #141d26;
}

/* Graph legend table (inside flot canvas area) — keep minimal */
#affwp-affiliate-dashboard-graphs .legend table {
    border: none !important;
    background: transparent !important;
    border-radius: 0 !important;
    font-size: 12px;
    color: #313135;
}

#affwp-affiliate-dashboard-graphs .legend table td {
    padding: 3px 6px !important;
    border: none !important;
    background: transparent !important;
}

/* Graph canvas wrapper */
#affwp-affiliate-dashboard-graphs .affwp-graph {
   width: 100% !important;
}

table.affwp-table td, table.affwp-table th
{
    border: 1px solid rgba(0, 0, 0, .03);
}

table.affwp-table {
    margin: 0 !important;
}
#affwp-affiliate-dashboard {
    display: flex;
    flex-direction: column;
    gap: 32px;
}
table.affwp-table.affwp-custom-links-table {
    margin-top: 32px !important;
}
.affwp-creatives-filters,
.affwp-creatives-list-action {
    display: none!important;
}
.affwp-creative-last-updated {
    opacity: 1 !important;
}