/* HeyAmigo 2026 — unified backend UI stylesheet
   Single stylesheet replacing the legacy CSS. Includes modern dashboard/auth
   components plus legacy-compatibility selectors so any not-yet-restyled view
   still renders cleanly. */

@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
	--ink: #11294a;
	--blue: #173b66;
	--yellow: #ffd35a;
	--cream: #fbf9f3;
	--pale: #eaf1f6;
	--line: #d9e2e8;
	--muted: #53677a;
	--white: #fff;
	--navy: #102a4b;
	--navy-2: #284869;
	--ok: #1d694a;
	--ok-bg: #e2f4eb;
	--warn: #87601b;
	--warn-bg: #fff0d2;
	--err: #a32020;
	--err-bg: #fdecec;
	--radius: 14px;
	--radius-sm: 9px;
	--shadow: 0 8px 30px rgba(7, 24, 47, 0.08);
}

* {
	box-sizing: border-box;
}
html {
	scroll-behavior: smooth;
}
body {
	margin: 0;
	background: var(--cream);
	color: var(--ink);
	font:
		16px/1.6 "DM Sans",
		Arial,
		sans-serif;
	-webkit-font-smoothing: antialiased;
}
a {
	color: inherit;
	text-decoration: none;
}
a:hover {
	text-decoration: underline;
}
img {
	max-width: 100%;
	display: block;
}
h1,
h2,
h3,
h4 {
	margin-top: 0;
	font-family: Manrope, "DM Sans", sans-serif;
	letter-spacing: -0.03em;
	line-height: 1.18;
	color: var(--ink);
}
h1 {
	font-size: 2.1rem;
	font-weight: 800;
	margin-bottom: 16px;
}
h2 {
	font-size: 1.6rem;
	font-weight: 800;
	margin-bottom: 14px;
}
h3 {
	font-size: 1.15rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	margin-bottom: 10px;
}
h4 {
	font-size: 1rem;
	font-weight: 800;
	letter-spacing: -0.015em;
	margin: 0;
}
p {
	color: var(--muted);
	margin-top: 0;
}
small {
	color: var(--muted);
}
hr {
	border: 0;
	border-top: 1px solid var(--line);
	margin: 22px 0;
}

/* focus visibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
	outline: 3px solid #2c75ba;
	outline-offset: 2px;
}

/* ---------- brand ---------- */
.brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
}
.brand-logo {
	height: 30px;
	width: auto;
	display: block;
}
.dash-mobile .brand-logo {
	height: 26px;
}

/* ---------- buttons ---------- */
.button,
.navButton a,
input[type="submit"],
input[type="button"],
input[type="reset"],
button.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	border: 0;
	border-radius: var(--radius-sm);
	padding: 12px 20px;
	min-height: 46px;
	background: var(--yellow);
	color: var(--navy);
	font:
		800 0.95rem "DM Sans",
		sans-serif;
	line-height: 1.2;
	cursor: pointer;
	box-shadow: 0 3px 0 #d3a72e;
	transition:
		transform 0.18s,
		box-shadow 0.18s;
}
.button:hover,
.navButton a:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
button.button:hover {
	text-decoration: none;
	transform: translateY(-2px);
	box-shadow: 0 5px 0 #d3a72e;
}
.button.dark {
	background: var(--ink);
	color: #fff;
	box-shadow: 0 3px 0 #07182f;
}
.button.dark:hover {
	box-shadow: 0 5px 0 #07182f;
}
.button.outline,
.text-button {
	background: transparent;
	color: var(--blue);
	box-shadow: none;
	border: 1px solid var(--line);
	font-weight: 800;
}
.button.outline:hover,
.text-button:hover {
	background: var(--pale);
	transform: none;
	box-shadow: none;
}
button.text-button {
	border: 1px solid var(--line);
}
.navButton {
	margin: 0 0 10px;
}
.navButton a {
	background: var(--blue);
	color: #fff;
	box-shadow: 0 3px 0 #0d2743;
}
.navButton a:hover {
	box-shadow: 0 5px 0 #0d2743;
}
#cancel a {
	color: var(--muted);
	font-weight: 700;
	font-size: 0.9rem;
}

/* ---------- alerts ---------- */
.successAlert,
.warningAlert,
.errorAlert,
.noticeAlert {
	border-radius: 12px;
	padding: 13px 16px;
	font-weight: 600;
	font-size: 0.92rem;
	margin: 0 0 16px;
	border: 1px solid transparent;
}
.successAlert {
	background: var(--ok-bg);
	color: var(--ok);
	border-color: #bfe6d5;
}
.warningAlert {
	background: var(--warn-bg);
	color: var(--warn);
	border-color: #f0d87e;
}
.errorAlert {
	background: var(--err-bg);
	color: var(--err);
	border-color: #f3c6c6;
}
.noticeAlert {
	background: var(--pale);
	color: var(--blue);
	border-color: #c9dbe8;
}
.errorText {
	color: var(--err);
	font-weight: 700;
	font-size: 0.85rem;
}
#sysmsg {
	background: var(--pale);
	border: 1px solid #c9dbe8;
	border-radius: 12px;
	padding: 12px 16px;
	color: var(--blue);
	font-weight: 600;
	margin: 0 0 18px;
}
#sysmsg p {
	margin: 0;
	color: inherit;
}
.trick {
	clear: both;
}

/* ---------- forms ---------- */
fieldset {
	border: 0;
	padding: 0;
	margin: 0 0 18px;
}
label {
	display: inline-block;
	font-weight: 700;
	font-size: 0.85rem;
	color: #294964;
	margin-bottom: 6px;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
input[type="tel"],
input[type="search"],
input[type="file"],
select,
textarea {
	display: block;
	width: 100%;
	border: 1px solid #cbd9e1;
	border-radius: var(--radius-sm);
	padding: 11px 12px;
	font: inherit;
	color: #193a5a;
	background: #fff;
}
textarea {
	min-height: 90px;
}
select {
	appearance: none;
	background-image: linear-gradient(45deg, transparent 50%, #6a8191 50%),
		linear-gradient(135deg, #6a8191 50%, transparent 50%);
	background-position:
		calc(100% - 18px) 50%,
		calc(100% - 13px) 50%;
	background-size:
		5px 5px,
		5px 5px;
	background-repeat: no-repeat;
	padding-right: 34px;
}
input[type="checkbox"],
input[type="radio"] {
	-webkit-appearance: none;
	appearance: none;
	position: relative;
	display: inline-block;
	width: 18px;
	height: 18px;
	flex: none;
	margin: 0 8px 0 0;
	vertical-align: -3px;
	border: 1.5px solid #b9ceda;
	border-radius: 5px;
	background: #fff;
	cursor: pointer;
	transition:
		background 0.15s,
		border-color 0.15s;
}
input[type="radio"] {
	border-radius: 50%;
}
input[type="checkbox"]:hover,
input[type="radio"]:hover {
	border-color: var(--blue);
}
input[type="checkbox"]:checked,
input[type="radio"]:checked {
	background: var(--blue);
	border-color: var(--blue);
}
input[type="checkbox"]:checked::after {
	content: "";
	position: absolute;
	left: 5px;
	top: 1px;
	width: 5px;
	height: 9px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}
input[type="radio"]:checked::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #fff;
	transform: translate(-50%, -50%);
}
input[type="checkbox"]:disabled,
input[type="radio"]:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}
fieldset > div,
form > div {
	margin-bottom: 14px;
}
fieldset.navigation {
	border-top: 1px solid var(--line);
	padding-top: 16px;
	margin-top: 6px;
}
.swapLabelFieldOrder {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}
.swapLabelFieldOrder label {
	margin: 0;
}

/* ---------- auth layout ---------- */
.auth-shell {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--cream);
}
.auth-top {
	display: flex;
	align-items: center;
	gap: 22px;
	padding: 18px 32px;
	border-bottom: 1px solid var(--line);
	background: var(--white);
}
.auth-top .auth-links {
	margin-left: auto;
	display: flex;
	gap: 20px;
	align-items: center;
	font-weight: 700;
	font-size: 0.94rem;
}
.auth-top .auth-links a.current {
	color: #386d9f;
}
.auth-main {
	flex: 1;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 46px 20px 80px;
}
.auth-main #mainContent {
	max-width: 640px;
	width: 100%;
	margin: 0;
}
.auth-main #mainContent h2 {
	margin-bottom: 8px;
}
.auth-main > #sysmsg {
	max-width: 640px;
	margin: 0 auto 18px;
	width: 100%;
}
.secondary-placeholder {
	display: none !important;
}
.auth-card {
	width: min(560px, 100%);
	background: var(--white);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 34px;
	box-shadow: var(--shadow);
}
.auth-card.wide {
	width: min(760px, 100%);
}
.auth-card h2 {
	margin-bottom: 6px;
}
.auth-card > p {
	font-size: 0.92rem;
}
.auth-switch {
	margin-top: 18px;
	font-size: 0.9rem;
	color: var(--muted);
}
.choice-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin-top: 8px;
}
a.choice {
	display: block;
	border: 1px solid var(--line);
	border-radius: 14px;
	padding: 22px;
	background: var(--white);
	transition:
		transform 0.15s,
		box-shadow 0.15s;
}
a.choice:hover {
	text-decoration: none;
	transform: translateY(-2px);
	box-shadow: var(--shadow);
}
a.choice strong {
	display: block;
	font:
		800 1.15rem Manrope,
		sans-serif;
	color: var(--ink);
	margin-bottom: 6px;
}
a.choice span {
	display: block;
	color: var(--muted);
	font-size: 0.9rem;
}
@media (max-width: 560px) {
	.choice-grid {
		grid-template-columns: 1fr;
	}
}

/* ---------- dashboard shell ---------- */
.dashboard {
	background: #f3f6f7;
}
.dash-shell {
	display: grid;
	grid-template-columns: 248px minmax(0, 1fr);
	min-height: 100vh;
}
.dash-sidebar {
	background: var(--navy);
	color: #eaf3f8;
	padding: 26px 17px;
	display: flex;
	flex-direction: column;
	gap: 26px;
}
.dash-sidebar .brand {
	color: #fff;
	padding: 5px 10px;
}
.dash-sidebar nav {
	display: grid;
	gap: 5px;
}
.dash-sidebar nav a,
.dash-sidebar .side-link {
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 11px 14px;
	border-radius: 10px;
	color: #c1d2e0;
	font-size: 0.92rem;
	font-weight: 700;
}
.dash-sidebar nav a:hover,
.dash-sidebar nav a.current,
.dash-sidebar nav a.active,
.dash-sidebar .side-link:hover {
	background: var(--navy-2);
	color: #fff;
	text-decoration: none;
}
.dash-sidebar .side-label {
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: #86a7bf;
	font-weight: 800;
	margin: 0 10px 8px;
}
.side-bottom {
	margin-top: auto;
	border-top: 1px solid #35506d;
	padding: 20px 10px 0;
	color: #c2d1df;
	font-size: 0.84rem;
}
.side-bottom a {
	color: #dcecf5;
	font-weight: 800;
}
.side-bottom a.muted {
	color: #b4cad9;
	font-weight: 600;
}
.dash-main {
	min-width: 0;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}
.dash-top {
	height: 74px;
	background: #fff;
	border-bottom: 1px solid #dce5e9;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 40px;
	gap: 20px;
}
.crumb {
	color: #587088;
	font-size: 0.9rem;
}
.top-right {
	display: flex;
	align-items: center;
	gap: 16px;
	font-size: 0.9rem;
	font-weight: 700;
}
.avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #d9e8ef;
	display: grid;
	place-items: center;
	color: #174571;
	font-weight: 800;
}
.dash-content {
	padding: 34px 40px 80px;
	max-width: 1450px;
	width: 100%;
	margin: 0 auto;
	flex: 1;
}
.dash-title {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 26px;
}
.dash-title h1 {
	font-size: 2rem;
	margin: 4px 0 6px;
}
.dash-title p {
	color: #657b8d;
	margin: 0;
}
.dash-title .navButton {
	margin: 0;
	flex-shrink: 0;
}
.dash-mobile {
	display: none;
}

/* ---------- legacy content containers -> modern panels ---------- */
#content {
	min-width: 0;
}
#mainContent {
	min-width: 0;
}
#mainContent > h3:first-child,
#mainContent > h2:first-child {
	margin-top: 0;
}
#content:has(#secondaryContent:not(.secondary-placeholder)) {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 22px;
	align-items: start;
}
#content:has(#secondaryContent:not(.secondary-placeholder)) > #mainContent {
	grid-column: 1;
	grid-row: 1;
}
#content:has(#secondaryContent:not(.secondary-placeholder))
	> #secondaryContent {
	grid-column: 2;
	grid-row: 1;
}
#secondaryContent {
	background: var(--white);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 20px;
	box-shadow: var(--shadow);
}
#secondaryContent .navButton a {
	display: block;
	text-align: center;
}
#secondaryContent #help h3 {
	margin-top: 0;
}
#secondaryContent ol {
	padding-left: 18px;
	color: var(--muted);
	font-size: 0.9rem;
}
#secondaryContent ol li {
	margin-bottom: 8px;
}
/* generic page card when a view has only #mainContent */
#mainContent {
	background: var(--white);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 26px;
	box-shadow: var(--shadow);
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}
#mainContent form,
#mainContent table {
	margin: 20px 0;
}

/* ---------- tables ---------- */
table {
	border-collapse: collapse;
	width: 100%;
	font-size: 0.9rem;
	text-align: left;
}
table th {
	text-transform: uppercase;
	letter-spacing: 0.07em;
	font-size: 0.7rem;
	color: #7890a0;
	font-weight: 800;
	border-bottom: 1px solid #e3eaee;
	padding: 12px 10px;
}
table td {
	border-bottom: 1px solid #edf1f3;
	padding: 14px 10px;
	vertical-align: middle;
	color: var(--ink);
}
table tr:last-child td {
	border-bottom: none;
}
table td h4 {
	font-size: 0.95rem;
}
.data-table {
	width: 100%;
}
.summary {
	font-weight: 700;
	color: var(--ink);
}
.summary .earnt {
	color: var(--ok);
	font-weight: 800;
}
#newsletters td,
#adStats td,
#invoices td,
#chooseAds td {
	font-size: 0.9rem;
}

/* ---------- status pills ---------- */
.status,
.pill {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 100px;
	font-size: 0.74rem;
	font-weight: 800;
	background: #e9eef2;
	color: #64798a;
}
.status.active,
.status.approved {
	background: var(--ok-bg);
	color: var(--ok);
}
.status.paused,
.status.pending {
	background: var(--warn-bg);
	color: var(--warn);
}
.status.draft {
	background: #e9eef2;
	color: #64798a;
}

/* ---------- status toggle switch (Active / Paused link) ---------- */
a.statusToggle {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	text-decoration: none;
	font-size: 0.8rem;
	font-weight: 800;
	color: var(--muted);
	white-space: nowrap;
}
a.statusToggle:hover {
	text-decoration: none;
}
a.statusToggle .statusToggle-track {
	position: relative;
	flex-shrink: 0;
	width: 44px;
	height: 24px;
	border-radius: 100px;
	background: #cbd7e0;
	transition: background 0.18s ease;
}
a.statusToggle .statusToggle-knob {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(7, 24, 47, 0.35);
	transition: transform 0.18s ease;
}
a.statusToggle.active .statusToggle-track {
	background: var(--yellow);
}
a.statusToggle.active .statusToggle-knob {
	transform: translateX(20px);
}
a.statusToggle.active .statusToggle-label {
	color: var(--navy);
}
a.statusToggle.paused .statusToggle-label {
	color: var(--warn);
}
a.statusToggle:hover .statusToggle-track {
	filter: brightness(0.94);
}
a.statusToggle:focus-visible .statusToggle-track {
	outline: 2px solid var(--blue);
	outline-offset: 2px;
}

/* ---------- panels / metrics (available to restyled views) ---------- */
.panel {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 24px;
	margin-bottom: 20px;
	box-shadow: var(--shadow);
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}
.panel-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 18px;
}
.panel-head h2 {
	font-size: 1.2rem;
	margin: 0;
}
.panel-head p {
	color: #6b8292;
	font-size: 0.85rem;
	margin: 4px 0 0;
}
.metric-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
	margin-bottom: 20px;
}
.metric {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 20px;
	min-height: 120px;
}
.metric span {
	color: #667f91;
	font-size: 0.85rem;
	font-weight: 700;
}
.metric strong {
	display: block;
	font:
		800 1.8rem/1.2 Manrope,
		sans-serif;
	margin: 12px 0 3px;
	letter-spacing: -0.05em;
}
.metric small {
	color: #6a8191;
	font-size: 0.75rem;
}
.dash-columns {
	display: grid;
	grid-template-columns: minmax(0, 1.55fr) minmax(290px, 0.85fr);
	gap: 20px;
}
.dash-columns > div {
	min-width: 0;
}
.empty-inline {
	background: #f7fafb;
	border: 1px dashed #b9ceda;
	border-radius: 11px;
	padding: 18px;
	color: #5a7283;
	font-size: 0.88rem;
}
.task-list {
	display: grid;
	gap: 12px;
}
.task {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 12px;
	border: 1px solid #e2e9ed;
	border-radius: 10px;
}
.task .circle {
	width: 25px;
	height: 25px;
	flex: none;
	border: 1px solid #90b1c5;
	border-radius: 50%;
	display: grid;
	place-items: center;
	color: #2c759b;
	font-size: 0.75rem;
}
.task strong {
	display: block;
	font-size: 0.88rem;
}
.task span {
	display: block;
	color: #7890a0;
	font-size: 0.78rem;
	margin-top: 3px;
}
.section-kicker {
	text-transform: uppercase;
	letter-spacing: 0.14em;
	font-size: 0.74rem;
	font-weight: 800;
	color: #547c98;
	margin-bottom: 6px;
}
.insight {
	background: var(--pale);
	border-radius: 11px;
	padding: 16px;
	margin-top: 16px;
	color: #31566f;
	font-size: 0.87rem;
}
.insight strong {
	display: block;
	color: #163c5e;
	margin-bottom: 4px;
}
.filter-row {
	display: flex;
	gap: 9px;
	margin: 0 0 16px;
	flex-wrap: wrap;
}
.pill.selected {
	background: var(--blue);
	color: #fff;
	border: 1px solid var(--blue);
}
.prototype-note {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	background: #fff5ce;
	color: #6c530b;
	border: 1px solid #f0d87e;
	padding: 6px 11px;
	border-radius: 100px;
	font-weight: 800;
	font-size: 0.72rem;
	letter-spacing: 0.04em;
	margin-bottom: 10px;
}
.mini-label {
	text-transform: uppercase;
	letter-spacing: 0.1em;
	font-size: 0.7rem;
	font-weight: 800;
	color: #6b8292;
}

/* ---------- sub navigation ---------- */
ul.navigation {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
#accountMenu {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	border-bottom: 1px solid var(--line);
	padding-bottom: 14px;
	margin-bottom: 20px;
}
#accountMenu li a {
	display: inline-block;
	padding: 8px 14px;
	border-radius: 100px;
	font-weight: 700;
	font-size: 0.88rem;
	color: var(--blue);
	background: var(--pale);
}
#accountMenu li a:hover {
	background: #dbe8f1;
	text-decoration: none;
}
#accountMenu li.current a,
#accountMenu li a.current {
	background: var(--blue);
	color: #fff;
}
#steps {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	list-style: none;
	margin: 0 0 22px;
	padding: 0;
}
#steps li {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 700;
	font-size: 0.85rem;
	color: var(--muted);
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 100px;
	padding: 8px 14px;
}
#steps li.current {
	background: var(--blue);
	color: #fff;
	border-color: var(--blue);
}

/* ---------- ad preview / choose ads (publisher) ---------- */
.adsWrapper {
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 18px;
	margin: 12px 0;
	background: #fff;
}
.adBlockTitle {
	font-weight: 800;
	color: var(--blue);
}
.adPreview {
	margin: 12px 0;
	padding: 12px;
	background: #f7fafb;
	border-radius: 10px;
	overflow-x: auto;
}
/* do not restyle the advertiser ad snippet HTML shown in the preview */
.adPreview table,
.adPreview thead,
.adPreview tbody,
.adPreview tr,
.adPreview td,
.adPreview th {
	border: 0;
	padding: 0;
	background: transparent;
}
.adsSource {
	display: grid;
	gap: 12px;
}
.adsSource textarea.advert {
	font-family: ui-monospace, Menlo, Consolas, monospace;
	font-size: 0.8rem;
	min-height: 120px;
}
.versionTitle {
	font-weight: 700;
	font-size: 0.85rem;
	color: #294964;
}
.zclipWrapper {
	margin-top: 8px;
}
.zclipWrapper a.copyClipboard {
	display: inline-block;
	background: var(--pale);
	color: var(--blue);
	border-radius: 8px;
	padding: 8px 12px;
	font-weight: 800;
	font-size: 0.82rem;
}
.zclipWrapper a.copyClipboard:hover {
	background: #dbe8f1;
	text-decoration: none;
}
.bidding {
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 16px;
	margin: 12px 0;
}
.rejectReason {
	margin-top: 10px;
}
.displayAd {
	width: 100%;
	max-width: none;
	border: 1px solid var(--line);
	border-radius: 12px;
	border-collapse: separate;
	border-spacing: 0;
	overflow: hidden;
}
.displayAd td {
	border: 0;
	vertical-align: top;
	padding: 0 18px;
}
.displayAd tr.group td {
	padding-top: 18px;
	padding-bottom: 6px;
	font-family: Manrope, "DM Sans", sans-serif;
	font-weight: 800;
	font-size: 1.05rem;
	letter-spacing: -0.02em;
	color: var(--ink);
}
.displayAd tr.option td {
	padding-top: 6px;
	padding-bottom: 6px;
	vertical-align: middle;
}
.displayAd tr.option td:first-child {
	width: 1%;
	white-space: nowrap;
	padding-right: 0;
}
.displayAd tr.example td {
	padding-bottom: 20px;
}
.displayAd tr.example td:first-child {
	width: 1%;
	padding: 0;
}
.displayAd img {
	display: block;
	margin-top: 8px;
	max-width: 100%;
	height: auto;
}
.selectDate {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
}

/* ---------- account payment / billing forms ---------- */
.month,
.year {
	display: inline-block;
	width: auto;
	min-width: 120px;
	margin: 0 8px 0 0;
}
.gateway-option {
	display: flex;
	align-items: center;
	gap: 14px;
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 12px 16px;
	background: #fff;
	cursor: pointer;
	margin-bottom: 10px;
	transition:
		border-color 0.15s,
		box-shadow 0.15s;
}
.gateway-option:hover {
	border-color: var(--blue);
}
.gateway-option:has(input:checked) {
	border-color: var(--blue);
	box-shadow: 0 0 0 2px #dbe8f1;
	background: #f7fbfd;
}
.gateway-option input {
	width: 18px;
	height: 18px;
	margin: 0;
}
.gateway-option img {
	display: block;
	height: 26px;
	width: auto;
}
fieldset.navigation img {
	display: block;
	margin-top: 12px;
	max-width: 280px;
	height: auto;
}
.verificationNumbers p {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin: 8px 0 0;
	font-size: 0.8rem;
	color: var(--muted);
}
.verificationNumbers p img {
	display: inline-block;
	height: 24px;
	width: auto;
}

/* ---------- misc legacy helpers ---------- */
.tocContainer textarea {
	background: #f7fafb;
	font-size: 0.82rem;
	color: var(--muted);
}
.categoriesList {
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 12px;
	background: #fff;
}

/* ---------- category browser (newsletter / ad setup) ---------- */
#cyta {
	font-weight: 700;
	color: var(--ink);
	margin-bottom: 10px;
}
#categorySelector {
	margin-bottom: 14px;
}
#selectBoxes {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 12px;
	width: auto !important;
}
#selectBoxes select {
	display: block;
	width: auto;
	flex: 1 1 200px;
	min-width: 170px;
	height: auto;
	padding: 8px 10px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: #fff;
	color: var(--ink);
}
#categoryContainer .tip {
	font-size: 0.85rem;
	color: var(--muted);
	margin: 12px 0;
}
#selectCategory {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: var(--radius-sm);
	padding: 11px 20px;
	min-height: 44px;
	background: var(--yellow);
	color: var(--navy);
	font:
		800 0.95rem "DM Sans",
		sans-serif;
	cursor: pointer;
	box-shadow: 0 3px 0 #d3a72e;
	transition:
		transform 0.18s,
		box-shadow 0.18s;
}
#selectCategory:hover {
	transform: translateY(-2px);
	box-shadow: 0 5px 0 #d3a72e;
}
#categoriesList {
	list-style: none;
	padding: 0;
	margin: 16px 0 0;
	display: grid;
	gap: 8px;
}
#categoriesList li {
	background: var(--pale);
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 9px 12px;
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 700;
	color: var(--ink);
}
#categoriesList li a {
	color: var(--err);
	font-weight: 800;
	font-size: 0.82rem;
}
#box {
	position: fixed;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #07182fc2;
	z-index: 9999;
	padding: 20px;
}
#box .modal {
	background: #fff;
	border-radius: 16px;
	padding: 28px;
	max-width: 520px;
	width: 100%;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
#box .modal h2 {
	margin: 4px 0 8px;
}
#box .modal ul {
	padding-left: 18px;
	color: var(--muted);
}
#box .close {
	display: inline-block;
	margin-bottom: 10px;
	color: var(--blue);
	font-weight: 800;
	font-size: 0.9rem;
}
.errorBox {
	position: absolute;
	background: var(--err);
	color: #fff;
	font-size: 0.78rem;
	font-weight: 700;
	padding: 9px 12px;
	border-radius: 9px;
	z-index: 50;
	max-width: 260px;
	box-shadow: 0 10px 28px rgba(7, 24, 47, 0.28);
}
.errorBox h4 {
	color: #fff;
	font-size: 0.66rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	margin: 0 0 4px;
	opacity: 0.85;
}
.errorBox p {
	color: #fff;
	font-size: 0.8rem;
	font-weight: 600;
	margin: 0;
	line-height: 1.3;
}
.helpContent {
	display: none;
}
.helpContent.open {
	display: inline;
}

/* ---------- footer ---------- */
#footer {
	border-top: 1px solid var(--line);
	padding: 20px 40px;
	color: var(--muted);
	font-size: 0.85rem;
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	align-items: center;
	justify-content: space-between;
}
#footer p {
	margin: 0;
}
#footer ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 18px;
}
.auth-footer {
	border-top: 1px solid var(--line);
	padding: 20px 32px;
	color: var(--muted);
	font-size: 0.85rem;
	display: flex;
	gap: 18px;
	justify-content: space-between;
	flex-wrap: wrap;
}

/* ---------- invoices / popup (own entry points) ---------- */
.invoice-doc {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 28px;
	max-width: 820px;
	margin: 0 auto;
	font-family: ui-monospace, Menlo, Consolas, monospace;
	font-size: 0.85rem;
	white-space: pre-wrap;
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
	.metric-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.dash-columns {
		grid-template-columns: 1fr;
	}
	.dash-content {
		padding: 28px 24px;
	}
	.dash-top {
		padding: 0 24px;
	}
	#content:has(#secondaryContent:not(.secondary-placeholder)) {
		grid-template-columns: 1fr;
	}
	#content:has(#secondaryContent:not(.secondary-placeholder)) > #mainContent,
	#content:has(#secondaryContent:not(.secondary-placeholder))
		> #secondaryContent {
		grid-column: 1;
		grid-row: auto;
	}
}
@media (max-width: 700px) {
	.dash-shell {
		display: block;
	}
	.dash-sidebar {
		display: none;
		position: static;
	}
	.dash-sidebar.mobile-open {
		display: flex;
	}
	.dash-sidebar .brand {
		display: none;
	}
	.dash-mobile {
		display: flex;
		align-items: center;
		justify-content: space-between;
		background: var(--navy);
		color: #fff;
		padding: 14px 18px;
	}
	.dash-mobile .brand {
		font-size: 1.2rem;
	}
	.dash-mobile button {
		border: 1px solid #7895ab;
		background: none;
		color: #fff;
		border-radius: 7px;
		padding: 7px 11px;
		font-weight: 700;
	}
	.dash-top {
		height: 60px;
		padding: 0 18px;
	}
	.dash-top .top-right span {
		display: none;
	}
	.dash-content {
		padding: 22px 18px;
	}
	.dash-title {
		display: block;
	}
	.dash-title .navButton {
		margin-top: 16px;
	}
	.dash-title h1 {
		font-size: 1.7rem;
	}
	.metric-grid {
		grid-template-columns: 1fr;
		gap: 10px;
	}
	#mainContent,
	#secondaryContent {
		padding: 18px;
	}
	.auth-card {
		padding: 24px;
	}
	#footer {
		padding: 18px;
	}

	/* stacked tables on mobile (rows become cards) */
	#mainContent,
	#secondaryContent,
	.panel {
		overflow-x: visible;
	}
	table thead {
		display: none;
	}
	table,
	table tbody,
	table tr,
	table td {
		display: block;
		width: 100%;
	}
	table tr {
		border: 1px solid var(--line);
		border-radius: 12px;
		padding: 12px 14px;
		margin-bottom: 12px;
		background: #fff;
	}
	table td {
		border: 0;
		padding: 5px 0;
		font-size: 0.9rem;
	}
	table td + td {
		border-top: 1px solid #f0f4f6;
	}
	table td:empty {
		display: none;
	}
	table td h4 {
		margin: 0;
	}
	/* keep the copyable ad snippet intact (never stack it) */
	.adPreview table {
		display: table;
	}
	.adPreview tbody {
		display: table-row-group;
	}
	.adPreview tr {
		display: table-row;
	}
	.adPreview td,
	.adPreview th {
		display: table-cell;
		border: 0;
		padding: 0;
	}
}

/* =====================================================================
   Legacy view compatibility
   These selectors existed in the pre-2026 stylesheet and are still used
   by views that have not been individually restyled. Keep them grouped
   here so the rest of the file stays free of legacy noise.
   ===================================================================== */

/* ---------- secondary / back buttons ---------- */
#back,
input[type="button"]#back,
input[type="button"].button-secondary {
	background: transparent;
	color: var(--blue);
	border: 1px solid var(--line);
	box-shadow: none;
}
#back:hover,
input[type="button"]#back:hover {
	background: var(--pale);
	transform: none;
	box-shadow: none;
}
input[type="submit"].right,
input[type="button"].right {
	float: none;
}

/* ---------- spend meter ---------- */
.spent,
.clicks,
.price,
.budget,
.totalSpent {
	white-space: nowrap;
}
img.percentImage,
.percentImage {
	display: block;
	background: #fff url(/images/percentImage_back.png) top left no-repeat;
	background-position: 1px 0;
	padding: 0;
	margin: 5px 0 0;
}

/* ---------- newsletter admin table statuses ---------- */
#newsletters td.awaitingVerification,
td.awaitingVerification {
	color: var(--muted);
	font-style: italic;
}
#newsletters td.adsAvailable a {
	font-weight: 800;
}
.totalSpent {
	color: var(--ok);
	font-weight: 800;
}

/* ---------- rating cells ---------- */
td.ratePositive,
td.rateNeutral,
td.rateNegative,
#ratingKey td.ratePositive,
#ratingKey td.rateNeutral,
#ratingKey td.rateNegative {
	text-align: center;
	font-weight: 800;
	white-space: nowrap;
}
td.ratePositive {
	color: var(--ok);
}
td.rateNeutral {
	color: var(--muted);
}
td.rateNegative {
	color: var(--err);
}
td.rateNegative input,
td.ratePositive input,
td.rateNeutral input {
	margin: 0 4px 0 0;
}
input.comment {
	min-width: 200px;
	color: var(--muted);
}

/* ---------- ad setup: filter bar ---------- */
.filter.panel {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 20px 30px;
}
.filter h4 {
	font-style: normal;
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #6b8292;
	margin: 0 0 8px;
}
.filter .filter-result {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 14px 18px;
	margin: 0;
}
.filter .filter-result h4 {
	flex-basis: 100%;
	width: 100%;
}
.filter .sendDate {
	display: flex;
	flex-direction: column;
}
.filter .subscribersApprox,
.filter .sendOutInterval {
	display: flex;
	flex-direction: column;
	margin: 0;
}
.filter .subscribersApprox select,
.filter .sendOutInterval select {
	width: auto;
	min-width: 180px;
}
.filter .selectDate {
	display: flex;
	gap: 14px;
}
.filter .dateFrom,
.filter .dateTo {
	display: flex;
	flex-direction: column;
}
.filter .sendDate input[type="date"] {
	width: auto;
}
.filter input[type="submit"] {
	width: auto;
}

/* ---------- ad setup: newsletter + bidding blocks ---------- */
.newsletter-list {
	display: grid;
	gap: 16px;
}
.newsletter-brief {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 6px 22px;
	background: #f7fafb;
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 14px 16px;
}
.newsletter-brief p {
	margin: 0;
}
.newsletter-brief p label {
	display: block;
	margin-bottom: 2px;
}
.newsletter-brief .newsletter-url {
	grid-column: 1 / -1;
}
.newsletter-brief .newsletter-url label {
	display: inline-block;
	margin-right: 6px;
}
.newsletter-campaign {
	display: grid;
	gap: 12px;
}
.newsletter-campaign h4 {
	margin-bottom: 10px;
}
.newsletter-campaign h4 em {
	font-weight: 400;
	color: var(--muted);
}
.newsletter-campaign .newsletter-ppc,
.newsletter-campaign .newsletter-total {
	margin-bottom: 12px;
}
.newsletter-campaign .newsletter-ppc input[type="text"],
.newsletter-campaign .newsletter-total input[type="text"] {
	max-width: 220px;
}

/* ---------- publisher: choose ads ---------- */
#chooseAds td {
	vertical-align: top;
}
#chooseAds td.adPreview {
	background: transparent;
	border-radius: 0;
	padding: 14px 10px;
}
#chooseAds td.bidding {
	border: 0;
	border-radius: 0;
	padding: 14px 10px;
}
#chooseAds td.bidding ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
#chooseAds td.bidding ul ul.rejectReason {
	padding-left: 20px;
	margin-top: 6px;
}
#chooseAds td.bidding li {
	padding: 3px 0;
}
#chooseAds td.price,
#chooseAds td.budget {
	white-space: nowrap;
}
#chooseAds thead td {
	text-transform: uppercase;
	letter-spacing: 0.07em;
	font-size: 0.7rem;
	color: #7890a0;
	font-weight: 800;
	border-bottom: 1px solid #e3eaee;
	padding: 12px 10px;
}

/* ---------- campaign date selects (create + edit) ---------- */
label[for="sendOutDate"] {
	display: block;
}
select[name^="sendOutDate"] {
	display: inline-block;
	width: auto;
	min-width: 92px;
	margin: 0 8px 8px 0;
}

/* ---------- misc legacy breadcrumb / links ---------- */
h2.trails,
.trails {
	font-size: 1.15rem;
	margin-bottom: 16px;
}
.trails a {
	color: var(--blue);
	font-weight: 800;
}
a.toggleStatus {
	display: inline-block;
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--blue);
}
a.toggleStatus:hover {
	text-decoration: underline;
}
.matchNow {
	padding: 8px 14px;
	min-height: 0;
	font-size: 0.82rem;
	box-shadow: 0 2px 0 #d3a72e;
	white-space: nowrap;
}
.matchNow:hover {
	box-shadow: 0 4px 0 #d3a72e;
}
table tr td.cat {
	font-weight: 800;
	background: #f7fafb;
}
.optional label {
	font-weight: 400;
	color: var(--muted);
}
.amexcard {
	display: inline-block;
	height: 22px;
	width: auto;
}

/* ---------- compact multi-column admin tables ---------- */
#campaigns td,
#campaignsEnded td,
#unmatched td,
#newsletterStats td,
#rateNewsletters td,
#adStats td,
#newsletters td {
	padding-left: 6px;
	padding-right: 6px;
	white-space: normal;
}
#newsletters td.awaitingVerification {
	white-space: normal;
}
td.action,
td.action a {
	white-space: nowrap;
}
