:root {
	--system-ui: system-ui, Roboto, Helvetica, Arial, sans-serif;
}

html {
	scroll-behavior: smooth;
}

body {
	background: #f8f8f8;
	/* font-family: var(--system-ui); */
}

a,
select {
	color: #0075eb;

	&:hover {
		color: #004f9f;
	}
}

a:hover {
	text-decoration: underline;
	text-underline-offset: 2px;
}

p {
	margin: 0.2rem 0 1rem 0;
}

h1 {
	font-weight: bold;

	@media screen and (min-width: 880px) {
		
	}
}

h2.columns-header {
	font-weight: bold;
	text-transform: uppercase;
	letter-spacing: 0.1rem;
	color: rgba(0, 0, 0, 0.5);
	
}

aside h2 {
	
	font-weight: bold;
	margin: 0 0 0.4rem 0;
	line-height: 1.1;
}

h5 {
	font-weight: bold;
	margin: 0 0 0.4rem 0;
	
}

h6 {
	
	font-weight: bold;
	margin: 0 0 0.4rem 0;
}

.notes {
	background: rgba(0, 0, 0, 0.04);
	border-radius: 8px;
	padding: 20px;
	color: #333;
	display: flex;
	gap: 64px;
	position: relative;
	margin-bottom: 24px;

	& .notes-nav {
		width: 50%;

		& .nav-jump-links {
			display: block;
			
			padding: 6px 0;
			margin-top: 2px;
			line-height: 1.2;
		}

		& .nav-section {
			display: block;
			color: rgba(0, 0, 0, 0.4);
			margin-top: 1.5rem;
			
		}
	}

	& .notes-body {
		padding: 24px 0;
	}

	& .notes-section {
		display: flex;
		gap: 64px;
		border-top: 1px solid rgba(0, 0, 0, 0.2);
		padding-top: 32px;
		margin-bottom: 2rem;
		position: relative;
	}

	& h5:after {
		content: ".";
		background: #333;
		width: 160px;
		height: 2px;
		color: transparent;
		position: absolute;
		top: 0;
		left: 0;
	}

	& .notes-note {
		width: 50%;
	}

	& .notes-details {
		width: 50%;
	}

	& h2 {
		margin-top: 16px;
	}

	& h3 {
		text-transform: uppercase;
		
		font-weight: bold;
		margin: 0;
	}

	& h6 {
		color: teal;
	}

	& p {
		margin-bottom: 1rem;
	}

	& blockquote {
		font-size: 1.1rem;
	}

	& i {
		background: white;
		padding: 0 4px;
		font-family: monospace;
		border-radius: 4px;
		color: darkgoldenrod;
		font-style: normal;
		/* white-space: nowrap; */
	}

	& code {
		font-size: inherit;
	}

	& blockquote {
		background: #283336;
		border-top: 2px solid rgba(0, 0, 0, 0.1);
		padding: 20px;
		margin-bottom: 10px;
		
		border-radius: 5px;
		color: rgba(255, 255, 255, 0.6);

		& code {
			
			background: rgba(255, 255, 255, 0.2);
			color: #fff;
		}

		& i {
			
			background: rgba(255, 255, 255, 0.2);
			color: aquamarine;
		}

		& h6 {
			
			text-transform: uppercase;
			letter-spacing: 0.1rem;
			color: gold;
		}
	}
}

code {
	
	background: white;
	padding: 0 4px;
	border-radius: 4px;
	color: cadetblue;
	/* white-space: nowrap; */
}

hr {
	margin: 3rem 0;
	border-color: rgba(0, 0, 0, 0.2);
}

main {
	display: flex;
	flex-direction: column;
	gap: 24px;
	width: 100%;
	/*max-width: 1600px;*/
	margin: auto;
	padding: 0 24px 16px;

	.columns-2,
	.columns-3 {
		display: grid;
		grid-gap: 24px;
		grid-template-columns: minmax(0, 1fr);
		grid-auto-rows: auto;
	}
}

@media screen and (min-width: 880px) {
	main {

		.columns-2,
		.columns-3 {
			flex: 0 0 50%;
			grid-template-columns: repeat(2, minmax(0, 1fr));
		}
	}
}

@media screen and (min-width: 1200px) {
	main {
		.columns-3 {
			flex: 0 0 50%;
			grid-template-columns: repeat(3, minmax(0, 1fr));
		}
	}
}

.col-span-2 {
	grid-column: span 1;

	@media screen and (min-width: 1200px) {
		grid-column: span 2;
	}
}

.banner {
	background: #0075eb;
	width: 100%;
	

	.banner-body {
		display: flex;
		justify-content: space-between;
		align-items: center;
		gap: 16px;
		width: 100%;
		max-width: 1600px;
		margin: auto;
		padding: 16px 22px;
		position: relative;
		font-weight: 600;
	}

	& .section {
		display: flex;
		gap: 16px;
	}

	.navigation-title-image {
		margin: -2px 8px 0 8px;
		display: inline-block;
	}

	& .link-list {
		display: flex;
		gap: 16px;
	}

	.external-link {
		&::after {
			content: " ↗";
		}
	}

	& a {
		color: #fff;
		display: inline-block;
		padding: 4px 2px;
	}

	& span {
		display: inline-block;
		padding: 4px 2px;
	}
}

.link-dashboards {
	
	padding: 12px 0;
	margin: 0 0 2rem 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.15);

	& div {
		margin: 0 auto;
		padding: 0 12px;
		max-width: 1600px;
	}

	& a {
		color: #333;
		padding: 12px;
		margin-right: 8px;
		/* white-space: nowrap; */
	}

	& a:hover {
		text-decoration: none;
	}

	& a.active {
		border-bottom: 3px solid cornflowerblue;
		color: #000;
	}
}

.banner-body {
	
	color: rgba(0, 0, 0, 0.5);

	h1 {
		
		background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill-opacity='1.0' fill='white'%3E%3Cpath d='M16.5 3C19.5376 3 22 5.5 22 9C22 16 14.5 20 12 21.5C10.0226 20.3135 4.91699 17.563 2.86894 13.001L1 13V11L2.21045 11.0009C2.07425 10.3633 2 9.69651 2 9C2 5.5 4.5 3 7.5 3C9.35997 3 11 4 12 5C13 4 14.64 3 16.5 3ZM16.5 5C15.4241 5 14.2593 5.56911 13.4142 6.41421L12 7.82843L10.5858 6.41421C9.74068 5.56911 8.5759 5 7.5 5C5.55906 5 4 6.6565 4 9C4 9.68542 4.09035 10.3516 4.26658 11.0004L6.43381 11L8.5 7.55635L11.5 12.5563L12.4338 11H17V13H13.5662L11.5 16.4437L8.5 11.4437L7.56619 13L5.10789 13.0006C5.89727 14.3737 7.09304 15.6681 8.64514 16.9029C9.39001 17.4955 10.1845 18.0485 11.0661 18.6038C11.3646 18.7919 11.6611 18.9729 12 19.1752C12.3389 18.9729 12.6354 18.7919 12.9339 18.6038C13.8155 18.0485 14.61 17.4955 15.3549 16.9029C18.3337 14.533 20 11.9435 20 9C20 6.64076 18.463 5 16.5 5Z'%3E%3C/path%3E%3C/svg%3E");
		padding-left: 26px;
		background-repeat: no-repeat;
		background-position: 0 50%;
		background-size: 22px;

		span {
			color: #fff;
		}
	}
}

.date-updated {
	width: 100%;
	margin-top: 6px;
	
}

@media screen and (min-width: 880px) {
	.date-updated {
		text-align: right;
		margin-top: -3em;
		padding-bottom: 1.5rem;
	}
}

.spacer {
	margin-top: 2rem;
}

.card-data {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	min-width: 0;
	padding: 16px 20px 20px;

	background: #ffffff;
	border: 1px solid #cbcbcb;
	border-radius: 8px;

	&&.blank {
		background: rgba(0, 0, 0, 0.05);
		border: none;
	}

	.chart {
		height: 260px;
		margin: -8px;
	}

	& h2 {
		/* font-size: 1.5rem; */
		font-weight: 700;
		margin-right: 24px;
	}

	& h3 {
		/* font-size: 1.2rem; */
		font-weight: 700;
		margin-right: 24px;
	}

	& h4 {
		/* font-size: 1rem; */
		font-weight: 700;
		margin-top: 18px;
	}

	.figures {
		margin: 12px 0 0 0;

		& .large-num {
			/* font-size: 2rem; */
			font-weight: 700;
			margin: 0;
		}

		& .detail p {
			/* font-size: 0.9rem; */
			margin: 0 0 1rem 0;
		}
	}
}

.info {
	display: flex;
	position: absolute;
	top: 16px;
	right: 16px;
	justify-content: center;
	align-items: center;
	background: #999;
	width: 18px;
	height: 18px;
	color: #fff;
	/* font-size: 0.8rem; */
	font-weight: 800;
	border-radius: 100px;
	cursor: pointer;
	text-align: left;

	&::before {
		content: "?";
	}

	.info-hover-text {
		display: none;
		white-space: normal;
		flex-direction: column;
		gap: 6px;
		position: absolute;
		right: 32px;
		background: #222;
		width: 200px;
		/* font-size: 0.75rem; */
		font-weight: 400;
		padding: 8px 10px;
		border-radius: 6px;
		color: #eee;
		opacity: 0;
		animation: fadeIn 190ms;

		/* triangle */
		&:after {
			content: "";
			position: absolute;
			top: 50%;
			right: -6px;
			transform: translateY(-50%);
			width: 0;
			height: 0;
			border-top: 6px solid transparent;
			border-bottom: 6px solid transparent;
			border-left: 6px solid #222;
		}

		>p>span {
			font-weight: 800;
			color: #fff;
		}
	}

	&:hover {
		.info-hover-text {
			display: flex;
			opacity: 1;
		}
	}
}

.table-wrap {
	overflow-x: scroll;
	width: calc(100% + 20px);
	padding-right: 20px;
}

.table-scroll-message {
	text-align: right;
	margin: 24px 0 8px;
	/* font-size: 0.8rem; */
	text-transform: uppercase;
}

table {
	width: 100%;
	/* width: calc(100% - 20px); */
	margin: 36px 0 18px 0;
	/* font-size: 0.9rem; */

	& tr {
		border-bottom: 1px solid rgb(224, 224, 224);
	}

	& tbody {
		& .totals {
			background: #fff8d7;
		}

		& tr {
			&:hover:not(.totals) {
				background: #f8f8f8;
			}

			&:last-child {
				border-bottom: none;
			}
		}
	}

	& th,
	& td {
		text-align: left;
		font-weight: 400;
		padding: 6px 12px;
		border-right: 1px solid rgb(224, 224, 224);
		/* white-space: nowrap; */

		&:last-child {
			border-right: none;
		}
	}

	& th {
		font-weight: 700;
	}

	& .head-bg {
		background: #eee;
	}

	& .number {
		text-align: right;
	}

	&.relaxed {

		& th,
		& td {
			padding: 12px 0px;
			/* font-size: 1rem; */
			font-weight: 600;
		}

		& .secondary {
			color: #717171;
			padding-left: 12px;
			border-top: 1px solid #eee;
		}
	}
}

.cohort {
	margin: 24px 0;
	display: flex;
	flex-direction: row wrap;
	gap: 24px;
}

.cohort-quarter {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 8px;
	width: 120px;
}

.cohort-detail {
	/* font-size: 0.9rem; */

	& b {
		display: block;
		/* white-space: nowrap; */
	}

	& .text-grey {
		margin-top: 1em;
		/* font-size: 0.85em; */
	}
}

.cohort-bar {
	display: flex;
	overflow: hidden;
	gap: 2px;
	color: #fff;
	font-weight: 700;
	flex-direction: column;
	height: 340px;
	border-radius: 4px;
	margin: 0 0 8px 0;

	& .segment {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 3.5em;
		/* font-size: 0.9em; */
		text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
	}
}

.key {
	gap: 16px;
	margin-top: 12px;

	@media screen and (min-width: 880px) {
		display: flex;
		justify-content: flex-end;
		align-items: center;
	}

	& div {
		display: flex;
		align-items: center;
		gap: 6px;
	}

	&.key-per-row {
		flex-direction: column;
		align-items: start;
		gap: 4px;
	}
}

.key-color-box {
	display: inline-flex;
	width: 18px;
	height: 18px;
	content: "";
	border-radius: 2px;
	justify-content: center;
	align-items: center;
	position: relative;
	top: -1px;
	text-align: center;
	line-height: 16px;
}

.key-text {
	/* font-size: 0.92em; */

	@media screen and (min-width: 880px) {
		display: flex;
		align-items: center;
		justify-content: center;
	}
}

.warning {
	color: #ff3355;
	background: rgba(255, 51, 85, 0.1);
	border: 1px solid rgba(255, 51, 85, 0.3);
	border-right: 1px solid rgb(224, 224, 224);
	border-left-width: 0px;

	&::before {
		content: "⚠️ ";
		color: #ff3355;
	}

	&.warning-key {
		border-width: 1px;
	}
}

.expiry {
	background: #ffffe8;
	color: #c89900;
	border: 1px solid rgba(255, 221, 51, 0.75);
	border-right: 1px solid rgb(224, 224, 224);
	border-left-width: 0;
	/* display: flex; */
	gap: 8px;
	justify-content: space-between;
	content: "Risk of expiring meds";

	&.expiry-key {
		color: #d7ba27;
		border-width: 1px;
	}
}

.expiry-text {
	display: flex;
	justify-content: space-between;

	&::before {
		content: "Risk of expiring meds";
	}
}

.facility-list {
	& li {
		padding: 6px 0 0 0;
	}
}

.text-center th {
	text-align: center;
}

.text-right {
	text-align: right;
}

.label-small {
	/* font-size: 0.8rem; */
	line-height: 1.2;
}

.coverage {
	display: flex;
	margin-top: 32px;
}

.coverage p {
	padding: 2px 8px;
	/* line-break: anywhere; */
	overflow-wrap: break-word;
	hyphens: auto;
}

.coverage p.label-small {
	font-size: .8em;
}

.coverage-column {
	border-right: 1px solid rgba(0, 0, 0, 0.1);
	flex: 1;
}

.coverage-bar {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	height: 260px;
	margin-bottom: 4px;
}

.coverage-bar-fill {
	position: relative;
	background: #dae0e1;
	/* font-size: 1.2rem; */
	font-weight: bold;
	color: #6d7070;
}

.coverage-number {
	position: absolute;
	top: -1.75em;
	padding-left: 8px;
}

.coverage-estimated {
	text-align: center;
	margin-top: 4px;
}

.facilities-without-bp-monitor {
	/* font-size: 0.9rem; */
}

/* Text */

.bold {
	font-weight: 700;
}

.text-grey {
	color: #888;
}

.bp-controlled {
	color: #3bb231;
}

.bp-controlled-bg {
	background: #3bb231;
}

.bp-uncontrolled {
	color: #eeab00;
}

.bp-uncontrolled-bg {
	background: #eeab00;
}

.bp-uncontrolled-dark {
	color: #c08b00;
}

.bp-uncontrolled-dark-bg {
	background: #c08b00;
}

.three-month-ltfu {
	color: #ed6300;
}

.three-month-ltfu-bg {
	background: #ed6300;
}

.twelve-month-ltfu {
	color: #ff3355;
}

.twelve-month-ltfu-bg {
	background: #ff3355;
}

.under-care {
	color: #b51bdc;
}

.under-care-bg {
	background: #b51bdc;
}

.registrations {
	color: #007ee4;
}

.registrations-bg {
	background: #007ee4;
}

.step-one-drugs {
	background: #222;
}

.step-two-drugs {
	background: #d8db56;
}

.step-three-drugs {
	background: #18d6a8;
}

/* Display options */
.desktop-only {
	@media screen and (max-width: 880px) {
		display: none;
	}
}

.mobile-only {
	@media screen and (min-width: 880px) {
		display: none;
	}
}

/* Table sort */

th[role="columnheader"] div {
	display: flex;
	justify-content: space-between;
	gap: 8px;
}

th[role="columnheader"] div:not(.no-sort) {
	cursor: pointer;
	/* white-space: nowrap; */
}

th[role="columnheader"] div:not(.no-sort):after {
	content: "";
	/* float: right; */
	margin-top: 9px;
	border-bottom: none;
	border-width: 4px 4px 0;
	border-color: #404040 transparent;
	opacity: 0.25;
	-ms-user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	user-select: none;
}

th.text-right[role="columnheader"] div {
	flex-direction: row-reverse;
}

th.text-right[role="columnheader"] div:not(.no-sort):after {
	/* float: left; */
}

th[aria-sort="ascending"] div:not(.no-sort):after {
	border-width: 0 4px 4px;
	border-style: solid;
	border-color: #0035bc transparent;
	opacity: 1;
	margin-bottom: 8px;
}

th[aria-sort="descending"] div:not(.no-sort):after {
	border-bottom: none;
	border-width: 4px 4px 0;
	border-color: transparent #0035bc;
	opacity: 1;
}

th[aria-sort]:not(.no-sort) div:after {
	visibility: visible;
	opacity: 0.8;
	border-color: #0035bc transparent;
	margin-top: 9px;
}

th[aria-sort]:not(.no-sort) {
	background: #d9e3ff;
	color: #0035bc;
	outline: 1px solid #4b7eff;
	outline-offset: -1px;
}

th[role="columnheader"] div:not(.no-sort):hover:after {
	visibility: visible;
	opacity: 1;
}

.hidden {
	display: none !important;
}