:root {
	--ink: #1c2430;
	--muted: #5c675f;
	--line: #c9c2b2;
	--paper: #f6f3ec;
	--card: #fffdf8;
	--green: #1f6b45;
	--green-dark: #174e33;
	--header: #243028;
	--danger: #8d2e2e;
	--danger-bg: #f8e8e4;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
	color: var(--ink);
	background: var(--paper);
	font-size: 1.05rem;
	line-height: 1.45;
}

a { color: var(--green-dark); }

.top {
	background: var(--header);
	color: #f4f7f4;
}

.top-inner {
	max-width: 52rem;
	margin: 0 auto;
	padding: 0.9rem 1rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1.25rem;
	align-items: center;
	justify-content: space-between;
}

.brand {
	color: #fff;
	text-decoration: none;
	font-weight: 700;
	letter-spacing: 0.01em;
}

nav { display: flex; flex-wrap: wrap; gap: 0.85rem; }

nav a { color: #e4efe8; text-decoration: none; }

nav a:hover { text-decoration: underline; }

main {
	max-width: 52rem;
	margin: 0 auto;
	padding: 1.25rem 1rem 5rem;
}

.sheet, .card, .login, .notice {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 8px;
	padding: 1rem 1rem 1.25rem;
}

fieldset {
	border: 1px solid var(--line);
	border-radius: 8px;
	margin: 0 0 1rem;
	padding: 0.75rem 1rem 1rem;
}

legend {
	font-weight: 700;
	padding: 0 0.35rem;
}

.field { margin: 0 0 0.9rem; }

label { display: block; font-weight: 600; margin-bottom: 0.3rem; }

.check {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	font-weight: 500;
	margin: 0.35rem 0;
	padding: 0.45rem 0;
}

.check input {
	width: 1.45rem;
	height: 1.45rem;
	margin-top: 0.1rem;
	flex: 0 0 auto;
}

input[type="text"], input[type="password"], input[type="date"], input[type="time"], textarea, select {
	width: 100%;
	font: inherit;
	color: inherit;
	background: #fff;
	border: 1px solid #b7b1a4;
	border-radius: 6px;
	padding: 0.7rem 0.75rem;
	min-height: 3rem;
}

textarea { min-height: 6rem; resize: vertical; }

.times {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem;
}

.staff {
	display: grid;
	grid-template-columns: minmax(8rem, 1.5fr) repeat(3, minmax(4.2rem, 0.7fr)) minmax(7rem, 1fr);
	gap: 0.35rem 0.45rem;
	align-items: end;
	margin-bottom: 0.7rem;
}

.staff .field { margin: 0; }

.staff label { font-size: 0.8rem; }

.materials {
	display: grid;
	grid-template-columns: 1.6fr 1fr 0.9fr 0.6fr;
	gap: 0.35rem 0.45rem;
	align-items: end;
	margin-bottom: 0.7rem;
}

.materials .field { margin: 0; }

.materials label { font-size: 0.8rem; }

.yn {
	padding: 0.55rem 0;
	border-bottom: 1px solid var(--line);
}

.yn p { margin: 0 0 0.35rem; }

.yn .choices {
	display: flex;
	flex-wrap: wrap;
	gap: 0.2rem 1.1rem;
}

.yn .check { margin: 0; padding: 0.15rem 0; }

h2.section {
	font-size: 1.05rem;
	margin: 1.1rem 0 0.2rem;
}

@media (max-width: 720px) {
	.staff, .materials { grid-template-columns: 1fr 1fr; }
}

a.card {
	display: block;
	color: inherit;
	text-decoration: none;
}

.card.disabled { opacity: 0.62; }

.card p { margin: 0; color: var(--muted); }

.soon {
	display: inline-block;
	margin-left: 0.35rem;
	padding: 0.1rem 0.45rem;
	border-radius: 999px;
	background: var(--line);
	color: var(--muted);
	font-size: 0.75rem;
	font-weight: 600;
	vertical-align: middle;
}

.lead { margin-top: 0; color: var(--muted); }

canvas.signature-pad {
	display: block;
	width: 100%;
	height: 180px;
	background: #fff;
	border: 2px solid var(--ink);
	border-radius: 6px;
	touch-action: none;
	cursor: crosshair;
}

.hint { color: var(--muted); margin-top: 0; }

.errors, .banner {
	background: var(--danger-bg);
	color: var(--danger);
	border-radius: 6px;
	padding: 0.75rem 1rem;
	margin: 0 0 1rem;
}

.errors ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }

button, .button {
	font: inherit;
	font-weight: 700;
	border: 0;
	border-radius: 6px;
	background: var(--green);
	color: #fff;
	min-height: 3rem;
	padding: 0.7rem 1.1rem;
	text-decoration: none;
	display: inline-block;
	cursor: pointer;
}

button:hover, .button:hover { background: var(--green-dark); }

button:disabled { background: #8ea196; cursor: not-allowed; }

button.secondary, .button.secondary {
	background: transparent;
	color: var(--ink);
	border: 1px solid var(--line);
	margin-top: 0.75rem;
}

.submit-bar {
	position: sticky;
	bottom: 0;
	padding: 0.75rem 0;
	background: linear-gradient(transparent, var(--paper) 30%);
}

.submit-bar button { width: 100%; }

.login { max-width: 28rem; margin: 2rem auto; }

.cards { display: grid; gap: 0.85rem; }

.card h2 { margin: 0 0 0.6rem; font-size: 1.15rem; }

.meta {
	display: grid;
	grid-template-columns: 9rem 1fr;
	gap: 0.25rem 0.75rem;
	margin: 0 0 0.9rem;
}

.meta dt { color: var(--muted); }

.meta dd { margin: 0; }

.card-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }

nav.card-actions { margin-bottom: 1rem; }

.fail { color: var(--danger); }

.ok { color: var(--green-dark); }

table.fields { width: 100%; border-collapse: collapse; font-size: 0.95rem; }

table.fields th, table.fields td {
	text-align: left;
	border-bottom: 1px solid var(--line);
	padding: 0.4rem 0.35rem;
	vertical-align: top;
}

pre.mapping {
	white-space: pre-wrap;
	background: #f3f0e8;
	padding: 0.75rem;
	border-radius: 6px;
	overflow: auto;
}

@media (max-width: 640px) {
	.times { grid-template-columns: 1fr; }
	.meta { grid-template-columns: 1fr; }
}
