/* App look: a copy of public-site/css/site.css (keep the two in step), then app-only styles at the end.
   The app keeps its own copy because it is also served straight from bumblebee, without the public site. */

:root {
	--navy: #0b2a5b;
	--navy-dark: #081f44;
	--page: #f5f6f8;
	--card: #fff;
	--line: #d9dde5;
	--text: #222;
	--muted: #5b6270;
	--red: #c00;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background-color: var(--page);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, Helvetica, sans-serif;
	color: var(--text);
	line-height: 1.6;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

main {
	flex: 1;
}

a {
	color: var(--navy);
}

.container {
	max-width: 1040px;
	margin: 0 auto;
	padding: 0 20px;
}

/* Header: white, so the logo's white background blends in. */
.site-header {
	background-color: #fff;
	border-bottom: 1px solid var(--line);
}
.site-header .container {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 24px;
	padding-top: 10px;
	padding-bottom: 10px;
}
.site-header img {
	display: block;
	height: 64px;
	width: auto;
}
.site-header nav a {
	margin-left: 22px;
	color: var(--navy);
	text-decoration: none;
	font-weight: 600;
	padding-bottom: 3px;
	border-bottom: 2px solid transparent;
}
.site-header nav a:first-child {
	margin-left: 0;
}
.site-header nav a:hover,
.site-header nav a[aria-current="page"] {
	border-bottom-color: var(--navy);
}

/* Home page banner. */
.banner {
	background-color: var(--navy);
	color: #fff;
	text-align: center;
	padding: 56px 0;
}
.banner h1 {
	margin: 0;
	font-size: 2em;
	font-weight: 600;
	letter-spacing: 0.01em;
	line-height: 1.25;
}

/* Home page tile buttons. */
.tiles {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 320px));
	justify-content: center;
	gap: 20px;
	padding-top: 48px;
	padding-bottom: 64px;
}
.tile {
	display: block;
	padding: 28px 24px;
	background-color: var(--card);
	border: 1px solid var(--line);
	border-radius: 8px;
	color: var(--text);
	text-decoration: none;
	transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.tile:hover,
.tile:focus-visible {
	transform: translateY(-2px);
	border-color: var(--navy);
	box-shadow: 0 6px 16px rgba(11, 42, 91, 0.12);
	outline: none;
}
.tile svg {
	width: 36px;
	height: 36px;
	color: var(--navy);
}
.tile h2 {
	margin: 12px 0 4px;
	color: var(--navy);
	font-size: 1.2em;
}
.tile p {
	margin: 0;
	color: var(--muted);
	font-size: 0.95em;
}

/* Inner pages: title strip, then content in a card. */
.page-title {
	background-color: #e8ebf1;
	border-bottom: 1px solid var(--line);
	padding: 28px 0;
}
.page-title h1 {
	margin: 0;
	color: var(--navy);
	font-size: 1.6em;
	font-weight: 600;
}
.card {
	max-width: 720px;
	margin: 36px auto 56px;
	padding: 32px;
	background-color: var(--card);
	border: 1px solid var(--line);
	border-radius: 8px;
}
.card.narrow {
	max-width: 420px;
}
.card h2 {
	margin: 0 0 6px;
	color: var(--navy);
	font-size: 1.15em;
}
.card p {
	margin: 0 0 24px;
}
.card > :last-child {
	margin-bottom: 0;
}

/* Forms. */
label {
	display: block;
	margin: 0 0 4px;
	font-size: 0.95em;
}
input[type=text], input[type=password], textarea {
	width: 100%;
	margin: 0 0 18px;
	padding: 9px 11px;
	border: 1px solid #c4c9d6;
	border-radius: 4px;
	font: inherit;
	background-color: #fff;
}
input:focus, textarea:focus {
	border-color: var(--navy);
	outline: 2px solid rgba(11, 42, 91, 0.15);
}
textarea {
	height: 160px;
	resize: vertical;
}
button {
	padding: 10px 28px;
	border: 0;
	border-radius: 4px;
	background-color: var(--navy);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
button:hover {
	background-color: var(--navy-dark);
}
button:disabled {
	background-color: #b3b3b3;
	cursor: not-allowed;
}
.req {
	color: var(--red);
}
.legend {
	margin: 0 0 12px;
	color: var(--muted);
	font-size: 0.85em;
}
.hint {
	margin: -12px 0 18px;
	color: var(--red);
	font-size: 0.85em;
}
.hp {
	position: absolute;
	left: -10000px;
}
.notice {
	margin: 0 0 24px;
	padding: 14px 16px;
	background-color: #eef0f5;
	border: 1px solid #d7dbe6;
	border-radius: 4px;
	color: #444;
	font-size: 0.95em;
}
.notice.error {
	background-color: #fbeeee;
	border-color: #e6caca;
	color: #722;
}

/* Footer. */
.site-footer {
	background-color: #1c2433;
	color: #c9ceda;
	font-size: 0.9em;
	padding: 20px 0;
}
.site-footer .container {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 4px 40px;
}
.site-footer p {
	margin: 0;
}

@media (max-width: 600px) {
	.site-header .container {
		justify-content: center;
	}
	.site-header img {
		height: 52px;
	}
	.banner {
		padding: 40px 0;
	}
	.banner h1 {
		font-size: 1.5em;
	}
	.card {
		margin: 20px auto 36px;
		padding: 22px 18px;
	}
}

/* ---- App-only styles ---- */

.center {
	text-align: center;
}
.small {
	color: var(--muted);
	font-size: 0.85em;
}
a.button {
	display: inline-block;
	padding: 10px 28px;
	border-radius: 4px;
	background-color: var(--navy);
	color: #fff;
	font-weight: 600;
	text-decoration: none;
}
a.button:hover {
	background-color: var(--navy-dark);
}
.sqrl-logo {
	display: block;
	margin: 0 auto 8px;
}
.sqrl-qr {
	display: block;
	width: 220px;
	max-width: 100%;
	margin: 8px auto 12px;
}
.sqrl-qr svg {
	display: block;
	width: 100%;
	height: auto;
}
.sqrl-help {
	margin: 0 0 10px;
	color: var(--muted);
}
.site-header form.inline {
	display: inline;
	margin-left: 22px;
}
button.link {
	padding: 0 0 3px;
	background: none;
	border: 0;
	border-bottom: 2px solid transparent;
	border-radius: 0;
	color: var(--navy);
	font-weight: 600;
}
button.link:hover {
	background: none;
	border-bottom-color: var(--navy);
}
.tile.disabled {
	opacity: 0.6;
}
.tile.disabled:hover {
	transform: none;
	border-color: var(--line);
	box-shadow: none;
}
.site-header nav a.who {
	display: inline-flex;
	flex-direction: column;
	align-items: flex-end;
	line-height: 1.25;
	vertical-align: middle;
}
.site-header nav a.who .roles {
	color: var(--muted);
	font-size: 0.75em;
	font-weight: normal;
	letter-spacing: 0.02em;
}

/* Mileage and admin pages. */
.card.wide {
	max-width: none;
}
.card h3 {
	margin: 28px 0 8px;
	color: var(--navy);
	font-size: 1.05em;
}
select, input[type=date], input[type=month] {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #c4c9d6;
	border-radius: 4px;
	font: inherit;
	background-color: #fff;
}
select:focus, input[type=date]:focus, input[type=month]:focus {
	border-color: var(--navy);
	outline: 2px solid rgba(11, 42, 91, 0.15);
}
.entry-form {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 18px 20px;
	margin-top: 16px;
}
.entry-form .field {
	min-width: 0;
}
.entry-form .span2 {
	grid-column: span 2;
}
.entry-form .wide {
	grid-column: 1 / -1;
}
@media (max-width: 600px) {
	.entry-form {
		grid-template-columns: minmax(0, 1fr);
	}
	.entry-form .span2 {
		grid-column: auto;
	}
}
.entry-form input[type=text] {
	margin: 0;
}
.entry-form input[readonly] {		/* e.g. a unit number that mileage already uses */
	background-color: #f3f4f6;
	color: var(--muted);
}
.entry-form fieldset {
	margin: 0;
	padding: 0;
	border: 0;
}
.entry-form legend, .entry-form .label {
	display: block;
	margin: 0 0 4px;
	font-size: 0.95em;
}
label.radio {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 4px;
}
.buttons {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 20px;
}
button.danger {
	background-color: #a32020;
}
button.danger:hover {
	background-color: #7f1717;
}
button.secondary {
	background-color: #fff;
	border: 1px solid var(--navy);
	color: var(--navy);
}
button.secondary:hover {
	background-color: #eef1f7;
}
button.small-button {
	padding: 4px 12px;
	font-size: 0.85em;
	white-space: nowrap;
}
.notice.ok {
	background-color: #edf6ee;
	border-color: #c9e2cc;
	color: #1f5126;
}
.notice.warn {
	background-color: #fff7dc;
	border-color: #ecd98f;
	color: #5c4700;
}
.notice p {
	margin: 0 0 8px;
}
input.link-box {
	margin: 0;
	font-family: ui-monospace, Menlo, Consolas, monospace;
	font-size: 0.85em;
}

.report-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 24px;
}
.report-head h2 {
	margin: 0;
}
.report-pick {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.report-pick select, .report-pick input {
	width: auto;
}
.report-pick button {
	padding: 8px 18px;
}
.card p.month-nav {
	display: flex;
	justify-content: space-between;
	margin: 12px 0 20px;
}
.totals {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 40px;
	margin: 0 0 20px;
}
.totals dt {
	color: var(--muted);
	font-size: 0.8em;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}
.totals dd {
	margin: 0;
	font-size: 1.25em;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}
.table-scroll {
	overflow-x: auto;
	margin: 0 0 12px;
}
table.report {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95em;
}
table.report.states {
	width: auto;
	min-width: 260px;
}
table.report th, table.report td {
	padding: 7px 10px;
	border-bottom: 1px solid var(--line);
	text-align: left;
	white-space: nowrap;
	vertical-align: middle;
}
table.report td.route {		/* a long route wraps instead of pushing the miles off the side */
	min-width: 12em;
	white-space: normal;
	overflow-wrap: anywhere;
}
table.report th {
	background-color: #eef0f5;
	color: var(--navy);
	font-size: 0.85em;
	font-weight: 600;
}
table.report .num {
	text-align: right;
	font-variant-numeric: tabular-nums;
}
table.report form {
	margin: 0;
}
table.report tr.flag {			/* a row with a problem, on every report */
	background-color: #f9c4c4;
}
table.report td.bad {
	color: var(--red);
	font-weight: 700;
}
table.report tr.current td:first-child {
	box-shadow: inset 4px 0 0 var(--navy);
}
.tag {
	display: inline-block;
	padding: 0 6px;
	border-radius: 3px;
	background-color: #e1e6f0;
	color: var(--navy);
	font-size: 0.75em;
	font-weight: 600;
	vertical-align: 1px;
}

/* Quarter report. */
.quarter-status {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 16px;
	margin: 0 0 20px;
}
.quarter-status p {
	margin: 0;
}
table.report tfoot th {
	border-bottom: none;
	background-color: transparent;
	font-size: 1em;
}
.report-columns {		/* sections side by side when there's room (the wide Quarter Report) */
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 0 56px;
}
.report-columns > div {
	min-width: 0;
	max-width: 100%;
}
table.report.fit {
	width: auto;
}
table.report.fit td, table.report.fit th {
	padding-left: 16px;
	padding-right: 16px;
}
.truck-states {
	display: flex;
	flex-wrap: wrap;
	gap: 0 40px;
}
.truck-states > div {
	min-width: 0;
}

/* IVMR: printing shows just the record. */
@media print {
	.site-header, .site-footer, .page-title, .no-print {
		display: none;
	}
	.card {
		margin: 0;
		padding: 0;
		border: none;
	}
}

/* Fuel. */
.entry-form fieldset.new-station,
.entry-form fieldset.card-statement {
	padding: 12px 16px 16px;
	border: 1px solid var(--line);
	border-radius: 6px;
}
.entry-form fieldset.card-statement p.small {
	margin: 8px 0 0;
}
.card p.paid-filter a,
.card p.paid-filter strong {
	margin-right: 12px;
	white-space: nowrap;
}
table.report tfoot td {
	border-bottom: none;
	font-weight: 600;
}
table.report tbody.subtotal td {
	background-color: #f6f7fa;
	font-weight: 600;
}
.quarter-grid {		/* the year's quarters side by side: four, two or one to a row */
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px 32px;
	align-items: start;
}
body.wide .container {		/* pages that use more of a big screen (the Fuel Report) */
	max-width: 1600px;
}
@media (min-width: 1500px) {
	.quarter-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}
@media (max-width: 760px) {
	.quarter-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}
table.report caption {
	padding: 0 0 6px;
	color: var(--navy);
	font-weight: 600;
	text-align: left;
}
table.report caption .small {
	margin-left: 8px;
	font-weight: 400;
}
table.report caption .bad {
	color: var(--red);
	font-weight: 600;
}
table.report tr.gap td {		/* the blank line between trucks (gap_row()) */
	height: 1.4em;
	padding: 0;
	background-color: transparent;
}
table.report thead + tbody tr.gap {
	display: none;
}
table.report tr.skipped td {		/* a stretch the report doesn't count */
	color: var(--muted);
	background-color: #f4f5f7;
}
table.report td.none {
	color: var(--muted);
	text-align: center;
}

/* Import Mileage (import.php) */
table.report tr.check {			/* imported, but worth a look */
	background-color: #fdf6e3;
}
table.report tr.update {		/* already entered, the import changes its route */
	background-color: #fff1a8;
}
table.report.import td.problem {
	min-width: 18em;
	white-space: normal;
}
table.report.import tr.error td.problem {
	color: var(--red);
}
textarea.mono, pre.mono, td.mono {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.9em;
}
.import-help {
	margin-top: 28px;
	padding: 4px 18px 8px;
	border: 1px solid #dde2ea;
	border-radius: 6px;
	background-color: #f8f9fb;
}
.import-help summary {
	padding: 10px 0;
	font-weight: 700;
	color: var(--navy);
	cursor: pointer;
}
.import-help figure.example {		/* a sample to read, not a box to type in */
	margin: 0 0 16px;
}
.import-help figure.example figcaption {
	margin: 0 0 4px;
	color: var(--muted);
	font-size: 0.8em;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}
.import-help pre {
	margin: 0;
	padding: 10px 14px;
	overflow-x: auto;
	background-color: #e9ecf1;
	border-left: 3px solid #b8c0cc;
	color: #4a5160;
}
.import-help dl.format dt {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.9em;
	font-weight: 700;
	margin-top: 10px;
}
.import-help dl.format dd {
	margin: 2px 0 0 1.5em;
}
strong.bad {
	color: var(--red);
}
.import-help code {
	font-size: 0.95em;
}
table.report.import tr:target td {	/* the line a Problems link jumps to */
	box-shadow: inset 0 2px 0 var(--navy), inset 0 -2px 0 var(--navy);
}
table.report.import tr:target td:first-child {
	box-shadow: inset 4px 0 0 var(--navy), inset 0 2px 0 var(--navy), inset 0 -2px 0 var(--navy);
}

/* Card Statements: a line the import is holding */
.held-line {
	margin: 0 0 16px;
	padding: 12px 16px;
	border-left: 4px solid #d9b44a;
	background-color: #fbf7ea;
}
.held-line p {
	margin: 0 0 8px;
}
/* The new-station fields show only while "New station (below)" is chosen (browsers without :has show them always) */
@supports selector(:has(a)) {
	.held-line form:not(:has(option[value="new"]:checked)) .new-station {
		display: none;
	}
}
