/* VHFLC Mileage — employee form. Scoped to .vhm so it doesn't fight the theme. */
.vhm {
	--vhm-ink: #1c2530;
	--vhm-muted: #5b6672;
	--vhm-navy: #1f4e79;
	--vhm-navy-dark: #163a5a;
	--vhm-sage: #f1f5e8;
	--vhm-sage-line: #cfdcb8;
	--vhm-line: #d8dee5;
	--vhm-bg: #ffffff;
	--vhm-red: #b42318;
	--vhm-red-bg: #fdf0ee;
	--vhm-amber-bg: #fff6e0;
	--vhm-amber: #8a5a00;
	--vhm-green: #1e7a46;
	--vhm-green-bg: #e8f5ec;
	--vhm-radius: 10px;
	color: var(--vhm-ink);
	font-size: 16px;
	line-height: 1.45;
	/* Break out of narrow theme content columns so the trip table has room. */
	width: min(1180px, calc(100vw - 32px)) !important;
	max-width: none !important;
	/* Centre on the page even inside a narrower theme column (and beat block-theme auto margins). */
	margin: 0 0 2rem calc(50% - min(590px, 50vw - 16px)) !important;
	margin-right: 0 !important;
	box-sizing: border-box;
	container-type: inline-size;
}
.vhm.vhm-signin { width: auto !important; max-width: 100% !important; margin: 0 auto 2rem !important; }
.vhm *, .vhm *::before, .vhm *::after { box-sizing: inherit; }

.vhm-card {
	background: var(--vhm-bg);
	border: 1px solid var(--vhm-line);
	border-radius: var(--vhm-radius);
	padding: clamp(16px, 3vw, 28px);
	box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.vhm-busy { opacity: .7; pointer-events: none; }
.vhm-signin-card { max-width: 520px; margin: 0 auto; text-align: center; }
.vhm-signin-card p { margin: .5rem 0 1.25rem; }

.vhm-h {
	margin: 0;
	font-size: clamp(1.5rem, 3vw, 2rem);
	line-height: 1.15;
	color: var(--vhm-navy);
	letter-spacing: .01em;
}
.vhm-muted { color: var(--vhm-muted); margin: .25rem 0 0; font-size: .95rem; }
.vhm-label { display: block; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--vhm-muted); margin-bottom: 4px; }
.vhm-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.vhm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.vhm-head a { color: var(--vhm-navy); }

/* Buttons */
.vhm-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 10px;
	min-height: 44px; padding: 10px 20px;
	border: 1px solid var(--vhm-navy); border-radius: 8px;
	background: var(--vhm-navy); color: #fff !important;
	font: inherit; font-weight: 600; text-decoration: none !important; cursor: pointer;
	transition: background-color .15s ease;
}
.vhm-btn:hover { background: var(--vhm-navy-dark); }
.vhm-btn:focus-visible, .vhm input:focus-visible, .vhm select:focus-visible, .vhm textarea:focus-visible, .vhm-icon:focus-visible, .vhm summary:focus-visible {
	outline: 3px solid #f2b705; outline-offset: 2px;
}
.vhm-btn[disabled] { opacity: .6; cursor: default; }
.vhm-btn-ghost { background: #fff; color: var(--vhm-navy) !important; }
.vhm-btn-ghost:hover { background: #eef3f8; }
.vhm-btn-ms { background: #fff; color: #1f1f1f !important; border-color: #8c8c8c; font-weight: 600; }
.vhm-btn-ms:hover { background: #f3f3f3; }

/* Month + totals bar */
.vhm-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 24px;
	align-items: flex-end;
	background: var(--vhm-sage);
	border: 1px solid var(--vhm-sage-line);
	border-radius: var(--vhm-radius);
	padding: 14px 18px;
	margin-bottom: 14px;
}
.vhm-month { flex: 2 1 240px; margin: 0; }
.vhm-stat { flex: 1 1 110px; }
.vhm-stat strong { font-size: 1.35rem; color: var(--vhm-navy); font-variant-numeric: tabular-nums; }
.vhm-stat-money strong { font-size: 1.6rem; }
.vhm-stat small { display: block; color: var(--vhm-muted); font-size: .8rem; }
.vhm-month select {
	width: 100%; min-height: 44px; padding: 8px 10px; font: inherit;
	border: 1px solid #9fb0c2; border-radius: 8px; background: #fff; color: var(--vhm-ink);
}

/* Status pills */
.vhm-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .85rem; font-weight: 600; background: #eef1f4; color: #3c4855; white-space: nowrap; }
.vhm-pill.vhm-submitted { background: #e7f0fa; color: #1b4f86; }
.vhm-pill.vhm-approved, .vhm-pill.vhm-processed { background: var(--vhm-green-bg); color: var(--vhm-green); }
.vhm-pill.vhm-returned { background: var(--vhm-amber-bg); color: var(--vhm-amber); }

/* Alerts */
.vhm-alert { border-radius: 8px; padding: 12px 14px; margin: 0 0 14px; background: #eef3f8; border: 1px solid #c9d7e6; }
.vhm-alert ul { margin: .5rem 0 0 1.1rem; padding: 0; }
.vhm-alert-error { background: var(--vhm-red-bg); border-color: #f1c1ba; color: #7a1a12; }
.vhm-alert-success { background: var(--vhm-green-bg); border-color: #b9dfc7; color: #14532d; }
.vhm-alert-warn { background: var(--vhm-amber-bg); border-color: #f0d58c; color: #5c3d00; }
.vhm-deadline { margin: 0 0 12px; }

/* Trips table */
.vhm-trips-wrap { overflow-x: auto; }
.vhm-trips { width: 100%; border-collapse: collapse; margin: 0; font-size: .95rem; }
.vhm-trips th {
	background: var(--vhm-navy); color: #fff; font-weight: 600; font-size: .78rem;
	text-transform: uppercase; letter-spacing: .04em; text-align: left; padding: 10px 8px; border: 0;
}
.vhm-trips td { padding: 6px 6px; border-bottom: 1px solid var(--vhm-sage-line); background: #fff; vertical-align: middle; }
.vhm-trips tbody tr:nth-child(even) td { background: #fafcf6; }
.vhm-trips tfoot th { background: var(--vhm-sage); color: var(--vhm-ink); font-size: .95rem; text-transform: none; }
.vhm-trips input[type="text"], .vhm-trips input[type="date"], .vhm-trips input[type="number"] {
	width: 100%; min-width: 0; min-height: 40px; padding: 6px 8px; font: inherit; font-size: .95rem;
	border: 1px solid #b9c4cf; border-radius: 6px; background: #fff; color: var(--vhm-ink); margin: 0;
}
.vhm-trips input[type="date"] { min-width: 140px; }
.vhm-trips input[type="number"] { min-width: 90px; }
.vhm-trips td:nth-child(2) input { min-width: 180px; }
.vhm-trips td:nth-child(3) input, .vhm-trips td:nth-child(4) input { min-width: 150px; }
.vhm-trips .vhm-invalid, .vhm-certify.vhm-invalid { border-color: var(--vhm-red) !important; box-shadow: 0 0 0 1px var(--vhm-red); }
.vhm-c { text-align: center !important; }
.vhm-num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vhm-check { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 40px; cursor: pointer; }
.vhm-check input { width: 20px; height: 20px; margin: 0; accent-color: var(--vhm-navy); }
.vhm-check-text { display: none; }
.vhm-icon {
	width: 36px; height: 36px; border-radius: 50%; border: 1px solid transparent; background: transparent;
	color: var(--vhm-muted); font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0;
}
.vhm-icon:hover { background: var(--vhm-red-bg); color: var(--vhm-red); }
.vhm-readonly td { padding: 10px 8px; }

.vhm-add { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0 18px; }

/* Help */
.vhm-help { border: 1px solid var(--vhm-line); border-radius: 8px; padding: 0 14px; margin: 0 0 18px; background: #fbfcfd; }
.vhm-help summary { cursor: pointer; padding: 12px 0; font-weight: 600; color: var(--vhm-navy); }
.vhm-help ul { margin: 0 0 14px 1.1rem; padding: 0; }
.vhm-help li { margin: 0 0 6px; }

/* Footer */
.vhm-foot { border-top: 1px solid var(--vhm-line); padding-top: 16px; }
.vhm-field { display: block; margin: 0 0 14px; }
.vhm-field textarea { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid #b9c4cf; border-radius: 6px; }
.vhm-certify { display: flex; gap: 12px; align-items: flex-start; background: var(--vhm-sage); border: 1px solid var(--vhm-sage-line); border-radius: 8px; padding: 12px 14px; margin: 0 0 16px; cursor: pointer; }
.vhm-certify input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--vhm-navy); }
.vhm-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* Narrow screens: each trip becomes a card */
@container (max-width: 860px) {
	.vhm-trips-wrap { overflow: visible; }
	.vhm-trips thead { display: none; }
	.vhm-trips, .vhm-trips tbody, .vhm-trips tr, .vhm-trips td { display: block; width: 100%; }
	.vhm-trips tr { border: 1px solid var(--vhm-sage-line); border-radius: 8px; margin: 0 0 12px; padding: 8px 10px 10px; position: relative; background: #fff; }
	.vhm-trips tbody tr:nth-child(even) td, .vhm-trips td { background: transparent; border: 0; padding: 4px 0; }
	.vhm-trips td[data-label]::before { content: attr(data-label); display: block; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--vhm-muted); margin-bottom: 2px; }
	.vhm-trips td input[type] { min-width: 0 !important; }
	.vhm-trips td.vhm-c, .vhm-trips td.vhm-num { text-align: left !important; }
	.vhm-trips td[data-label="Round trip"]::before { display: none; }
	.vhm-check { justify-content: flex-start; gap: 10px; }
	.vhm-check-text { display: inline; }
	.vhm-rm { position: absolute; top: 4px; right: 4px; width: auto !important; }
	.vhm-trips tfoot, .vhm-trips tfoot tr, .vhm-trips tfoot th { display: block; }
	.vhm-actions .vhm-btn { flex: 1 1 auto; }
}

@media print {
	.vhm-add, .vhm-actions, .vhm-help, .vhm-head a, .vhm-rm, .vhm-alert-success { display: none !important; }
	.vhm-card { border: 0; box-shadow: none; padding: 0; }
	.vhm-trips th { background: #ddd !important; color: #000 !important; }
}
