/* Direction 2, "Grid": a Swiss editorial look. White, black type, one cobalt accent, hairline
   rules instead of boxes, square corners, a fixed left column with the page list. */

:root {
	--ink: #0a0a0a;
	--mute: #6b6b6b;
	--hair: #d6d6d6;
	--soft: #f4f4f4;
	--blue: #1f3dff;
	--paid: #0f8a4c;
	--amber: #c98200;
	--f: "Helvetica Neue", Helvetica, Arial, "Segoe UI", system-ui, sans-serif;
	--map-land: #efefef;
	--map-water: #dcdde0;
	--map-park: #e5e7e5;
	--map-road: #fff;
	--map-minor: #fff;
	--map-text: #8c8c8c;
	--map-text-strong: #0a0a0a;
	--map-stop: #fff;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; margin: 0; }

body {
	background: #fff;
	color: var(--ink);
	display: grid;
	font: 14px/1.4 var(--f);
	grid-template-columns: 216px minmax(0, 1fr);
	-webkit-font-smoothing: antialiased;
}

body.bare { display: block; grid-template-columns: minmax(0, 1fr); }

a { color: inherit; }

/* the left column */

#side {
	border-right: 1px solid var(--ink);
	display: flex;
	flex-direction: column;
	height: 100dvh;
	padding: 22px 0 18px;
	position: sticky;
	top: 0;
}

#side .brand {
	display: block;
	font-size: 19px;
	font-weight: 800;
	letter-spacing: -0.03em;
	line-height: 1.05;
	padding: 0 20px 18px;
	text-decoration: none;
}

#side .brand i {
	background: var(--blue);
	display: block;
	height: 10px;
	margin-bottom: 12px;
	width: 28px;
}

#side .sect {
	border-top: 1px solid var(--ink);
	color: var(--mute);
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.12em;
	padding: 10px 20px 6px;
	text-transform: uppercase;
}

#side nav a {
	border-bottom: 1px solid var(--hair);
	display: flex;
	font-size: 14px;
	gap: 10px;
	padding: 8px 20px;
	text-decoration: none;
}

#side nav a b {
	color: var(--mute);
	font-size: 11px;
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	padding-top: 2px;
	width: 16px;
}

#side nav a:hover { background: var(--soft); }

#side nav a.on {
	box-shadow: inset 3px 0 0 var(--blue);
	font-weight: 700;
}

#side nav a.on b { color: var(--blue); }

#side .foot {
	border-top: 1px solid var(--ink);
	font-size: 13px;
	margin-top: auto;
	padding: 12px 20px 0;
}

#side .foot a { display: block; padding: 2px 0; }

#menu {
	background: none;
	border: 1px solid var(--ink);
	display: none;
	font: 600 13px var(--f);
	height: 30px;
	padding: 0 12px;
}

/* the page */

main {
	display: flex;
	flex-direction: column;
	height: 100dvh;
	min-width: 0;
	overflow: hidden;
	padding: 22px 32px 24px;
}

.top {
	align-items: flex-end;
	border-bottom: 2px solid var(--ink);
	display: flex;
	flex-wrap: wrap;
	gap: 10px 16px;
	margin-bottom: 18px;
	padding-bottom: 12px;
}

.top .tools {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-left: auto;
}

h1 {
	font-size: 42px;
	font-weight: 800;
	letter-spacing: -0.04em;
	line-height: 0.95;
	margin: 0;
}

h2 {
	border-bottom: 1px solid var(--ink);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.12em;
	margin: 0 0 8px;
	padding-bottom: 6px;
	text-transform: uppercase;
}

.lbl {
	color: var(--mute);
	display: block;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.num {
	font-variant-numeric: tabular-nums;
	font-weight: 800;
	letter-spacing: -0.04em;
	line-height: 0.9;
}

.mute { color: var(--mute); }
.blue { color: var(--blue); }
.warn { color: var(--amber); }
.ok { color: var(--paid); }
.r { text-align: right; }

/* the 12 column grid */

.g {
	column-gap: 28px;
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	row-gap: 18px;
}

.s2 { grid-column: span 2; }
.s3 { grid-column: span 3; }
.s4 { grid-column: span 4; }
.s5 { grid-column: span 5; }
.s6 { grid-column: span 6; }
.s7 { grid-column: span 7; }
.s8 { grid-column: span 8; }
.s9 { grid-column: span 9; }
.s12 { grid-column: span 12; }

.fill {
	flex: 1;
	min-height: 0;
}

.g.fill > * {
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.scroll {
	flex: 1;
	min-height: 0;
	overflow: auto;
}

/* controls: small flat rectangles */

.btn {
	align-items: center;
	background: #fff;
	border: 1px solid var(--ink);
	border-radius: 0;
	color: var(--ink);
	cursor: pointer;
	display: inline-flex;
	font: 600 13px var(--f);
	height: 32px;
	justify-content: center;
	padding: 0 14px;
	text-decoration: none;
	white-space: nowrap;
}

.btn:hover { background: var(--soft); }

.btn.pri {
	background: var(--blue);
	border-color: var(--blue);
	color: #fff;
}

.btn.pri:hover { background: #1630d9; }

.btn.dark {
	background: var(--ink);
	color: #fff;
}

.btn.sm {
	font-size: 12px;
	height: 26px;
	padding: 0 10px;
}

.btn.wide { width: 100%; }

.seg {
	border: 1px solid var(--ink);
	display: inline-flex;
	flex-wrap: wrap;
}

.seg > * {
	background: #fff;
	border: 0;
	border-right: 1px solid var(--ink);
	color: var(--ink);
	cursor: pointer;
	font: 600 13px var(--f);
	height: 30px;
	line-height: 30px;
	padding: 0 14px;
	text-decoration: none;
	white-space: nowrap;
}

.seg > *:last-child { border-right: 0; }
.seg > *.on { background: var(--ink); color: #fff; }

.f { display: block; margin-bottom: 12px; }
.f .lbl { margin-bottom: 4px; }

input[type=text], input[type=password], input[type=date], input[type=time],
input[type=number], input[type=datetime-local], select {
	background: #fff;
	border: 0;
	border-bottom: 1px solid var(--ink);
	border-radius: 0;
	color: var(--ink);
	font: 15px var(--f);
	height: 34px;
	outline: none;
	padding: 0 2px;
	width: 100%;
}

input:focus, select:focus { border-bottom: 2px solid var(--blue); }

.box-in {
	border: 1px solid var(--ink) !important;
	padding: 0 10px !important;
}

.check {
	align-items: center;
	display: flex;
	font-size: 14px;
	gap: 8px;
	margin: 4px 0 12px;
}

.check input { accent-color: var(--blue); height: 16px; margin: 0; width: 16px; }

.row {
	display: grid;
	gap: 0 20px;
	grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr));
}

/* tables */

.tbl {
	border-collapse: collapse;
	font-variant-numeric: tabular-nums;
	width: 100%;
}

.tbl th {
	background: #fff;
	border-bottom: 1px solid var(--ink);
	color: var(--mute);
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.1em;
	padding: 6px 10px 6px 0;
	position: sticky;
	text-align: left;
	text-transform: uppercase;
	top: 0;
}

.tbl td {
	border-bottom: 1px solid var(--hair);
	padding: 8px 10px 8px 0;
	vertical-align: top;
}

.tbl th.r, .tbl td.r { padding-left: 10px; padding-right: 0; text-align: right; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--soft); }
.tbl tr.sel td { box-shadow: inset 0 -2px 0 var(--blue); }
.tbl td b { font-weight: 700; }

.sq {
	display: inline-block;
	height: 10px;
	margin-right: 8px;
	vertical-align: 0;
	width: 10px;
}

.tag {
	border: 1px solid currentColor;
	display: inline-block;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 16px;
	padding: 0 5px;
	text-transform: uppercase;
}

/* the drawn map */

.map {
	background: var(--map-land);
	border: 1px solid var(--ink);
	flex: 1;
	min-height: 0;
	overflow: hidden;
	position: relative;
}

.map svg { font-family: var(--f); }

/* a list of plain rows with rules */

.list > * {
	border-bottom: 1px solid var(--hair);
	display: block;
	padding: 9px 0;
	text-decoration: none;
}

.big-link {
	align-items: baseline;
	border-bottom: 1px solid var(--ink);
	display: flex;
	font-size: 24px;
	font-weight: 700;
	justify-content: space-between;
	letter-spacing: -0.03em;
	padding: 12px 0;
	text-decoration: none;
}

.big-link:hover { color: var(--blue); }
.big-link span { font-size: 20px; }

.kpi {
	border-left: 1px solid var(--ink);
	padding: 0 0 0 14px;
}

.kpi .num { display: block; font-size: 44px; margin-top: 6px; }

/* phones */

@media (max-width: 820px) {
	body { display: block; }

	#side {
		background: #fff;
		border-bottom: 1px solid var(--ink);
		border-right: 0;
		flex-direction: row;
		flex-wrap: wrap;
		height: auto;
		padding: 0;
		z-index: 20;
	}

	#side .brand {
		align-items: center;
		display: flex;
		flex: 1;
		font-size: 17px;
		gap: 10px;
		padding: 12px 16px;
	}

	#side .brand i { height: 14px; margin: 0; width: 14px; }
	#menu { display: block; margin: 9px 16px 0 0; }

	#side .sect, #side nav, #side .foot { display: none; width: 100%; }
	#side.open .sect, #side.open nav, #side.open .foot { display: block; }
	#side.open .foot { padding-bottom: 12px; }

	main {
		height: auto;
		min-height: calc(100dvh - 50px);
		overflow: visible;
		padding: 14px 16px 20px;
	}

	h1 { font-size: 32px; }
	.top { margin-bottom: 14px; padding-bottom: 10px; }
	.top .tools { margin-left: 0; }

	.g { column-gap: 0; grid-template-columns: minmax(0, 1fr); row-gap: 18px; }
	.g > * { grid-column: auto !important; }
	.g.fill > * { min-height: auto; }
	.scroll { overflow: visible; }
	.map { flex: none; height: 300px; }
	.big-link { font-size: 20px; padding: 10px 0; }
	.kpi .num { font-size: 34px; }
	.tbl .hide-p { display: none; }
	.row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
