/**
 * Batchline Affiliates portal styles.
 *
 * Built for a phone first: everything is a single column until there is room
 * for more, and every table sits in its own horizontal scroller so the page
 * itself never slides sideways under a thumb.
 */
.bla-portal {
	--bla-green: #1E5B41;
	--bla-lime: #7FA82B;
	--bla-cream: #F4F6F2;
	--bla-ink: #151B17;
	--bla-muted: #5d6b60;
	--bla-line: #d7ded6;
	--bla-amber: #9A6414;
	--bla-bad: #9E3324;

	color: var(--bla-ink);
}

.bla-portal h2 {
	margin: 0 0 .2rem;
	font-size: 1.3rem;
}

.bla-portal h3 {
	margin: 0 0 .6rem;
	font-size: 1.05rem;
}

.bla-head {
	margin-bottom: 1rem;
}

.bla-status {
	display: inline-block;
	margin: 0;
	padding: .1rem .55rem;
	border-radius: 10px;
	font-size: .72rem;
	letter-spacing: .04em;
	text-transform: uppercase;
	background: var(--bla-cream);
	border: 1px solid var(--bla-line);
}

.bla-status--active {
	background: #e4efe8;
	border-color: var(--bla-green);
	color: var(--bla-green);
}

.bla-status--paused {
	background: #f6eddc;
	border-color: var(--bla-amber);
	color: var(--bla-amber);
}

.bla-status--closed {
	background: #f7e4e1;
	border-color: var(--bla-bad);
	color: var(--bla-bad);
}

.bla-note {
	margin: .6rem 0;
	font-size: .85rem;
	color: var(--bla-muted);
}

.bla-note--warn {
	color: var(--bla-amber);
	font-weight: 600;
}

.bla-empty {
	color: var(--bla-muted);
	font-style: italic;
}

/* ---------------------------------------------------------------- month */

.bla-month {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	align-items: center;
	margin: 0 0 1rem;
}

.bla-month select {
	padding: .35rem .5rem;
	border: 1px solid var(--bla-line);
	border-radius: 3px;
	background: #fff;
	min-height: 2.4rem;
}

/* ---------------------------------------------------------------- tiles */

.bla-tiles {
	display: flex;
	flex-wrap: wrap;
	gap: .6rem;
	margin: 0 0 1.4rem;
}

.bla-tile {
	flex: 1 1 130px;
	padding: .8rem .9rem;
	background: #fff;
	border: 1px solid var(--bla-line);
	border-left: 3px solid var(--bla-green);
	border-radius: 4px;
}

.bla-tiles--small .bla-tile {
	flex: 1 1 100px;
	border-left-color: var(--bla-lime);
}

.bla-tile b {
	display: block;
	font-size: 1.25rem;
	line-height: 1.2;
	font-variant-numeric: tabular-nums;
}

.bla-tile span {
	display: block;
	margin-top: .15rem;
	font-size: .68rem;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: var(--bla-muted);
}

/* ------------------------------------------------------------- sections */

.bla-section {
	margin: 0 0 1.8rem;
	padding: 1rem 1.1rem 1.2rem;
	background: #fff;
	border: 1px solid var(--bla-line);
	border-radius: 4px;
}

/* ---------------------------------------------------------------- chart */

.bla-chart {
	margin: 0;
}

.bla-chart svg {
	display: block;
	width: 100%;
	height: 180px;
}

.bla-legend {
	display: flex;
	flex-wrap: wrap;
	gap: .4rem 1rem;
	align-items: center;
	margin-top: .5rem;
	font-size: .78rem;
	color: var(--bla-muted);
}

.bla-key {
	display: inline-block;
	width: .7rem;
	height: .7rem;
	margin-right: .3rem;
	border-radius: 2px;
	vertical-align: -1px;
}

.bla-key--a {
	background: var(--bla-green);
}

.bla-key--b {
	background: var(--bla-lime);
}

.bla-scale {
	margin-left: auto;
}

/* --------------------------------------------------------------- tables */

.bla-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.bla-table {
	width: 100%;
	border-collapse: collapse;
	font-size: .88rem;
	font-variant-numeric: tabular-nums;
}

.bla-table th,
.bla-table td {
	padding: .45rem .6rem;
	border-bottom: 1px solid var(--bla-line);
	text-align: left;
	vertical-align: top;
	white-space: nowrap;
}

.bla-table thead th {
	font-size: .7rem;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--bla-muted);
}

.bla-table .bla-r {
	text-align: right;
}

.bla-table tfoot th {
	text-transform: none;
	font-size: .85rem;
}

.bla-pill {
	display: inline-block;
	padding: .05rem .45rem;
	border-radius: 10px;
	font-size: .7rem;
	background: var(--bla-cream);
	border: 1px solid var(--bla-line);
}

.bla-pill--paid {
	background: #e4efe8;
	border-color: var(--bla-green);
	color: var(--bla-green);
}

.bla-pill--void {
	background: #f7e4e1;
	border-color: var(--bla-bad);
	color: var(--bla-bad);
}

/* ------------------------------------------------------------- referral */

.bla-referral {
	display: flex;
	flex-direction: column;
	gap: .25rem;
	margin: 0 0 .8rem;
}

.bla-referral label {
	font-size: .72rem;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--bla-muted);
}

.bla-referral input {
	width: 100%;
	padding: .5rem;
	border: 1px solid var(--bla-line);
	border-radius: 3px;
	background: var(--bla-cream);
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: .85rem;
}

/* ------------------------------------------------------------ statement */

.bla-statement__head {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	justify-content: space-between;
	margin-bottom: 1rem;
	padding-bottom: .8rem;
	border-bottom: 2px solid var(--bla-green);
}

.bla-statement__meta p {
	margin: 0 0 .2rem;
	font-size: .85rem;
	color: var(--bla-muted);
}

.bla-actions {
	margin-top: 1rem;
}

@media print {
	.bla-noprint,
	.woocommerce-MyAccount-navigation {
		display: none !important;
	}

	.bla-statement {
		font-size: 11pt;
	}

	.bla-table th,
	.bla-table td {
		white-space: normal;
	}
}

@media screen and (max-width: 600px) {
	.bla-tile {
		flex: 1 1 45%;
	}

	.bla-tile b {
		font-size: 1.05rem;
	}

	.bla-section {
		padding: .8rem .7rem 1rem;
	}
}
