:root {
	--dark: blueviolet;
	--lite: lavender;
	--white: white;
	--text: #666;
	--grey: lightgrey;
	--button: limegreen;
	
	--thin: 1px solid var(--dark);
	--thick: 2px solid var(--dark);
	--dots: 2px dotted var(--dark);
	
	--small: 0.8em;
	--large: 1.4em;
	
	--mono: 'Courier New', Courier, monospace;
	--system: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;

	--gap: .5rem;
	--bevel: .5rem;
	
	--border-radius: .25rem;
	--background: white;
	--foreground: black;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	background-color: var(--white);
	color: var(--text);
	font-family: var(--system);
	width: 100vw;
	min-width: 320px;
	max-width: 960px;
	margin: 0 auto;
	display: grid;
	position: relative;
	grid-template-columns: auto 1fr;
	grid-template-rows: auto 1fr auto;
	grid-template-areas: "head head" "nav nav" "aside main" "aside foot";
}

h1 {
	display: inline-block;
	flex-grow: 0;
	font-size: 1.8rem;
}

a {
	color: var(--text);
	/* text-decoration: none; */
}

ul, menu, nav {
	list-style: none;
	margin: 0;
	padding: 0;
}

header, menu, footer {
	border-radius: var(--bevel);
	background-color: var(--white);
	margin: var(--gap);
	/* padding: 1rem; */
}

header {
	grid-area: head;
	display: flex;
	align-items:center;
	justify-content: space-between;
	position: relative;
}

#openMenu {
	display: none;
	cursor: pointer;
	width: 2rem;
	height: 2rem;
	background-image: url('../img/menu.svg');
	background-size: cover;
}

#closeMenu {
	display: none;
	cursor: pointer;
	height: 3rem;
}

.hide {
	display: none;
}

.show {
	display: flex !important;
}

menu {
	grid-area: menu;
	display: flex;
	flex-grow: 1;
	justify-content: space-around;
}

menu a {
	display: block;
	font-size: 1.2rem;
	line-height: 2rem;
	text-align: right;
	text-decoration: none;
}

menu a:hover {
	text-decoration: underline;
}



aside {
	grid-area: aside;
	width: min(240px, 33vw);
}


main {
	grid-area: main;
	display: flex;
	flex-direction: column;
}

footer {
	grid-area: foot;
	/* grid-column: 1/3; */
	/* grid-row: 2; */
}

.wide {
	grid-column: span 2;
}

.card {
	/* background-color: #fcfcfc; */
	border: 1px solid var(--grey);
	border-radius: 0 0 var(--border-radius) var(--border-radius);
	border-top: 0;
	margin: .5rem;
	margin-top: 0;
	padding: 1rem;
	padding-top: 0;
	overflow: hidden;
}

h2 {
	/* background-color: #f0f0f0; */
	border: 1px solid var(--grey);
	border-radius: var(--border-radius) var(--border-radius) 0 0;
	/* color: white; */
	font-size: 18px;
	margin:.5rem;
	margin-bottom: 0;
	padding: .5rem 1rem;
}

nav {
	grid-area: nav;
	background-color: #f0f0f0;
	border: 1px solid var(--grey);
	border-radius: var(--border-radius);
	/* color: white; */
	display: flex;
	align-items: center;
	font-size: 18px;
	font-weight: normal;
	margin:.5rem;
	margin-bottom: 0;
	padding: 0 .25rem;
}

nav a {
	background-color: #fff;
	border: 1px solid var(--grey);
	border-radius: var(--border-radius);
	display: flex;
	align-items: center;
	padding: .25rem .5rem;
	margin: .25rem;
	font-size: 16px;
	text-decoration: none;
}

nav .sep {
	margin: 0 .25rem;
}

form {
	display: flex;
	flex-direction: column;
	/* padding: 0 .5rem .5rem .5rem; */
}

label {
	display: flex;
	/* justify-content: center; */
	/* align-items: center; */
	border: 1px solid grey;
	border-radius: .25rem;
	position: relative;
	margin: 1rem 0;
	line-height: 2rem;
	font-size: .9em;
}

label span {
	background-color: var(--background);
	display: inline-block;
	padding: 0 .25rem;
	position: absolute;
	/* left: .5rem; */
	/* top: -1rem; */
	margin: -.8rem .5rem;
	line-height: 1em;
}

input, textarea, select {
	flex-basis: 0;
	background: transparent;
	border: 0;
	/* outline: 0; */
	border-radius: .25rem;
	color: var(--foreground);
	flex-grow: 1;
	width: 0;
	height: 2rem;
	padding: .25rem .5rem;
}

label input[type=checkbox] {
	flex-grow: 0;
	margin: 0 .5rem 0 1rem;
}

textarea {
	min-height: 4rem;
	resize: vertical;
}

button, .button {
	background-color: blueviolet;
	color: white;
	font-size: 1rem;
	border: 1px solid rgb(96, 29, 158);
	border-radius: .2rem;
	/* display: inline-block; */
	/* align-self:right; */
	/* width: 100%; */
	/* height: 2rem; */
	margin-top: .5rem;
	padding: .25rem .5rem;
	cursor: pointer;
}

label button {
	/* flex-grow: 0; */
	margin: .2rem;
	padding: 0 .4rem;
}

.row {
	display: flex;
	align-items: center;
	gap: .5rem;
}

.row > * {
	flex-grow: 1;
	flex-basis: 0;
}

.col {
	display: flex;
	flex-direction: column;
	/* gap: 1rem; */
}

.status {
	background-color: var(--grey);
	border: 1px solid #000;
	display: inline-block;
	width: 18px;
	height: 18px;
	border-radius: 100%;
}

.status.out {
	background-color: salmon;
	border-color: lightcoral;
}

.status.low {
	background-color: gold;
	border-color: goldenrod;
}

.status.max {
	background-color: lightgreen;
	border-color: limegreen;
}

table {
	border-collapse: collapse;
	/* margin: 1rem; */
	margin-bottom: .5rem;
	font-size: 0.9em;
	width: 100%;
	/* min-width: 420px; */
}

th {
	/* background-color: #F0F0F0; */
	/* border: 1px solid var(--grey); */
	/* text-align: left; */
	padding: .5rem;
}

th:first-child {
	/* border-left: 1px solid var(--grey); */
	/* border-radius: .25rem 0 0 0; */
	text-align: left;
}

th:last-child {
	/* border-right: 1px solid var(--grey); */
	/* border-radius: 0 .25rem 0 0; */
}
tr {
	border-bottom: 1px solid #ddd;
}

tr:nth-of-type(odd) {
	/* background-color: #F3F3F3; */
}

tr:last-child {
	border-bottom: 2px solid #ddd;
}

td {
	text-align: center;
	/* padding: .5rem; */
}

td:first-child {
	text-align: left;
}

@media (max-width: 720px) {
	body {
		grid-template-columns: auto;
		grid-template-areas: "head" "nav" "aside" "main" "foot";
	}
	
	h1 {
		flex-grow: 1;
		text-align: center;
	}
	
	aside {
		width: 100%;
		padding-right: 1rem;
	}
	
	menu {
		background-color: var(--white);
		border: var(--thin);
		border-radius: var(--bevel);
		display: none;
		flex-grow: 0;
		flex-direction: column;
		position: absolute;
		top: 0;
		right: 0;
		/* width: 100%; */
		/* height: 100%; */
		z-index: 100;
	}
	
	#openMenu {
		display: inline-block;
	}
	
	#closeMenu {
		display: block;
	}
}
