/* Affiliate area. Everything lives under .unid-aff so it cannot leak into the theme; fonts and colours are inherited. */
.unid-aff { --aff-border: #e5e7eb; --aff-muted: #6b7280; --aff-accent: #116347; --aff-bg: #f9fafb; margin: 0 0 2rem; }
.unid-aff * { box-sizing: border-box; }

.unid-aff-message { margin: 0 0 1rem; }
.unid-aff-notice { margin: 0 0 1rem; padding: .7rem 1rem; border-radius: 6px; border: 1px solid var(--aff-border); }
.unid-aff-notice--ok { background: #f0fdf4; border-color: #86efac; }
.unid-aff-notice--error { background: #fef2f2; border-color: #fca5a5; }

/* tabs */
.unid-aff-tabs { list-style: none; margin: 0 0 1.5rem; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 1px solid var(--aff-border); }
.unid-aff-tab a { display: block; padding: .6rem 1rem; text-decoration: none; color: inherit; border: 1px solid transparent; border-bottom: 0; border-radius: 6px 6px 0 0; margin-bottom: -1px; }
.unid-aff-tab a:hover { background: var(--aff-bg); }
.unid-aff-tab.is-active a { font-weight: 600; background: #fff; border-color: var(--aff-border); color: var(--aff-accent); }

.unid-aff h4 { margin: 1.5rem 0 .75rem; }
.unid-aff h4:first-child { margin-top: 0; }
.unid-aff .description { color: var(--aff-muted); margin: 0 0 1rem; }

/* cards + forms */
.unid-aff-card { border: 1px solid var(--aff-border); border-radius: 8px; background: #fff; margin: 0 0 1.25rem; overflow: hidden; }
.unid-aff-card__head { padding: 1rem 1.25rem; border-bottom: 1px solid var(--aff-border); }
.unid-aff-card__head h3 { margin: 0 0 .15rem; font-size: 1.1rem; }
.unid-aff-card__head p { margin: 0; color: var(--aff-muted); }
.unid-aff-card__body { padding: 1rem 1.25rem; }
.unid-aff-card__foot { padding: .75rem 1.25rem; background: var(--aff-bg); border-top: 1px solid var(--aff-border); }
.unid-aff-link { display: flex; gap: .5rem; padding: 1rem 1.25rem; flex-wrap: wrap; }
.unid-aff-link__input { flex: 1 1 260px; min-width: 0; }
.unid-aff label { display: block; margin: .75rem 0 .25rem; font-weight: 500; }
.unid-aff label.unid-aff-check { display: inline-flex; gap: .5rem; align-items: center; font-weight: 400; margin: 0; }
.unid-aff input[type="text"], .unid-aff input[type="url"], .unid-aff input[type="email"], .unid-aff input[type="date"], .unid-aff select { width: 100%; max-width: 520px; }
.unid-aff .unid-aff-link__input { max-width: none; }
.unid-aff-filter { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0 0 1rem; }
.unid-aff-filter select, .unid-aff-filter input[type="date"] { width: auto; }
.unid-aff-filter label { display: inline-flex; gap: .35rem; align-items: center; margin: 0; font-weight: 400; }
.unid-aff-range-custom { display: inline-flex; gap: .5rem; }
.unid-aff-inline { display: inline; margin: 0; }
.unid-aff-linkbtn { background: none; border: 0; padding: 0; color: var(--aff-accent); text-decoration: underline; cursor: pointer; font: inherit; }


/* buttons: the theme gives a bare .button no visible style (AffiliateWP used to ship its own); brand green, white text */
.unid-aff .button, .unid-aff input.button, .unid-aff button.button {
	display: inline-block; padding: .6rem 1.2rem; border: 1px solid var(--aff-accent); border-radius: 6px;
	background: var(--aff-accent); color: #fff; font: inherit; font-weight: 500; line-height: 1.2; cursor: pointer; text-decoration: none; box-shadow: none;
}
.unid-aff .button:hover, .unid-aff input.button:hover, .unid-aff button.button:hover { background: #0c4a35; border-color: #0c4a35; color: #fff; }
.unid-aff .button:focus-visible, .unid-aff .unid-aff-linkbtn:focus-visible, .unid-aff-tab a:focus-visible { outline: 2px solid var(--aff-accent); outline-offset: 2px; }
.unid-aff input[type="text"], .unid-aff input[type="url"], .unid-aff input[type="email"], .unid-aff input[type="date"], .unid-aff select { padding: .55rem .7rem; font: inherit; }

/* tables (stack on small screens, like the old page) */
.unid-aff-table { width: 100%; border-collapse: collapse; margin: 0 0 1.25rem; }
.unid-aff-table th, .unid-aff-table td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--aff-border); vertical-align: top; }
.unid-aff-table thead th { background: var(--aff-bg); font-size: .85rem; color: #374151; white-space: nowrap; }
.unid-aff-table td { word-break: break-word; }
.unid-aff-empty { color: var(--aff-muted); text-align: center !important; }
@media (max-width: 640px) {
	.unid-aff-table thead { display: none; }
	.unid-aff-table, .unid-aff-table tbody, .unid-aff-table tr, .unid-aff-table td { display: block; width: 100%; }
	.unid-aff-table tr { border: 1px solid var(--aff-border); border-radius: 6px; margin: 0 0 .75rem; }
	.unid-aff-table td { border-bottom: 1px solid var(--aff-border); display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
	.unid-aff-table td:last-child { border-bottom: 0; }
	.unid-aff-table td::before { content: attr(data-th); font-weight: 600; text-align: left; color: #374151; }
	.unid-aff-table td.unid-aff-empty::before { content: none; }
	.unid-aff-table td.unid-aff-empty { display: block; text-align: center; }
}

/* payouts summary */
.unid-aff-summary { display: flex; flex-wrap: wrap; gap: 1rem; margin: 0 0 1.25rem; }
.unid-aff-summary > div { flex: 1 1 200px; border: 1px solid var(--aff-border); border-radius: 8px; padding: .9rem 1.1rem; background: #fff; }
.unid-aff-summary span { display: block; color: var(--aff-muted); font-size: .85rem; }
.unid-aff-summary strong { font-size: 1.4rem; }

/* graph */
.unid-aff-graph { width: 100%; height: auto; max-height: 320px; border: 1px solid var(--aff-border); border-radius: 8px; background: #fff; }
.unid-aff-graph text { font-size: 11px; fill: var(--aff-muted); }
.unid-aff-graph .grid { stroke: var(--aff-border); stroke-width: 1; }
.unid-aff-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 1rem; margin: .5rem 0 0; padding: 0; font-size: .85rem; }
.unid-aff-legend span { display: inline-block; width: .8rem; height: .8rem; border-radius: 2px; margin-right: .35rem; vertical-align: -1px; }

/* pager */
.unid-aff-pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin: 0 0 1rem; }
.unid-aff-pager span { color: var(--aff-muted); }
