:root {
	color-scheme: light;
	--ink: #252b25;
	--muted: #70766d;
	--paper: #f5f3eb;
	--surface: #fffefa;
	--line: #e8e5dc;
	--green: #41654c;
	--green-pale: #eaf0e8;
	--rust: #b9613d;
	--rust-pale: #f8ece5;
	--gold: #d5a64a;
	--shadow: 0 14px 38px rgba(47, 52, 42, .07);
}

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

body {
	margin: 0;
	color: var(--ink);
	background:
		radial-gradient(ellipse at 90% 0%, rgba(211, 221, 201, .45), transparent 34rem),
		var(--paper);
	font-family: "DM Sans", sans-serif;
	min-height: 100vh;
}

button, input { font: inherit; }
button { cursor: pointer; }

.shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }

header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 25px 0 20px;
}

.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
	display: grid;
	width: 42px;
	height: 42px;
	place-items: center;
	border-radius: 13px;
	color: white;
	background: var(--green);
	font-size: 23px;
}
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: 0; }
.brand-caption { color: var(--muted); font-size: 12px; margin-top: 2px; }
.today-label { color: var(--muted); font-size: 13px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.admin-page-link { display: inline-flex; align-items: center; min-height: 35px; border: 1px solid var(--line); border-radius: 6px; padding: 0 11px; color: var(--green); background: var(--surface); font-size: 12px; font-weight: 700; text-decoration: none; }
.admin-page-link:hover { background: var(--green-pale); }
.logout-button { display: grid; width: 35px; height: 35px; place-items: center; margin-left: 18px; border: 1px solid var(--line); border-radius: 6px; color: var(--green); background: var(--surface); font-size: 19px; }
.logout-button:hover { background: var(--green-pale); }

.login-screen { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: radial-gradient(ellipse at 85% 10%, rgba(211, 221, 201, .56), transparent 34rem), var(--paper); }
.login-panel { width: min(100%, 410px); padding: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); animation: arrive .4s ease-out both; }
.login-panel .brand-mark { margin-bottom: 24px; }
.login-panel h1 { font-size: 34px; }
.login-copy { margin-bottom: 24px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.login-panel .field { margin-top: 14px; }
.login-panel .field input { min-height: 42px; }
.login-submit { width: 100%; margin-top: 19px; padding: 11px 14px; }
.form-error { margin: 14px 0 0; color: #a53d2b; font-size: 12px; }

main { padding: 17px 0 48px; }

.welcome {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 25px;
	animation: arrive .45s ease-out both;
}
.eyebrow {
	margin: 0 0 8px;
	color: var(--green);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 1.4px;
	text-transform: uppercase;
}
h1, h2, p { margin-top: 0; }
h1 {
	margin-bottom: 7px;
	font-family: Fraunces, Georgia, serif;
	font-size: clamp(30px, 4vw, 42px);
	font-weight: 600;
	line-height: 1.1;
}
.welcome-copy { margin: 0; color: var(--muted); font-size: 14px; }
.week-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 13px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: rgba(255, 254, 250, .72);
	color: var(--muted);
	font-size: 12px;
	white-space: nowrap;
}
.week-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }

.top-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.65fr) minmax(275px, .85fr);
	gap: 17px;
	align-items: stretch;
	margin-bottom: 17px;
	animation: arrive .5s .06s ease-out both;
}
.payment-stack { display: grid; gap: 17px; }
.panel {
	border: 1px solid rgba(225, 222, 211, .85);
	border-radius: 8px;
	background: var(--surface);
	box-shadow: var(--shadow);
}
.care-panel { padding: 21px 22px 18px; }
.panel-heading {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 18px;
}
.schedule-actions { display: flex; flex: 0 0 auto; gap: 7px; }
.panel-title { margin-bottom: 4px; font-family: Fraunces, Georgia, serif; font-size: 21px; font-weight: 600; }
.panel-subtitle { margin: 0; color: var(--muted); font-size: 12px; }
.schedule { width: 100%; border-collapse: collapse; text-align: left; }
.schedule th {
	padding: 0 10px 10px;
	color: #888b81;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .8px;
	text-transform: uppercase;
}
.schedule th:first-child, .schedule td:first-child { padding-left: 0; }
.schedule td { height: 47px; border-top: 1px solid #efede6; padding: 6px 10px; font-size: 13px; }
.schedule tr.is-today td { background: #f3f6f0; }
.schedule tr.is-today td:first-child { border-radius: 5px 0 0 5px; }
.schedule tr.is-today td:last-child { border-radius: 0 5px 5px 0; }
.day-name { font-weight: 700; }
.today-tag { display: inline-block; margin-left: 6px; color: var(--green); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.person { display: inline-flex; align-items: center; gap: 7px; color: #454a43; }
.person-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #9ab08f; }
.person.evening .person-dot { background: #d3a16e; }
.empty-name { color: #aaa99f; font-style: italic; }
.schedule-input { width: 100%; min-width: 76px; border: 1px solid #d5d9ce; border-radius: 4px; padding: 7px 8px; color: var(--ink); background: white; font-size: 12px; }
.schedule-input:focus { outline: 2px solid rgba(65, 101, 76, .25); border-color: var(--green); }
.history-panel { padding: 21px 22px 18px; }
.history-panel .panel-heading { margin-bottom: 12px; }
.user-management { margin-top: 17px; padding: 21px 22px 18px; }
.user-management .panel-heading { margin-bottom: 14px; }
.add-user-form { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(180px, 1fr) minmax(180px, 1fr) auto; align-items: end; gap: 12px; margin-bottom: 17px; }
.add-user-form .button-primary { min-height: 37px; white-space: nowrap; }
.user-remove-button { border: 1px solid #e6d3cc; border-radius: 5px; padding: 6px 9px; color: #93472f; background: #fff9f6; font-size: 11px; font-weight: 700; }
.user-remove-button:hover:not(:disabled) { background: #f8ece5; }
.user-remove-button:disabled { cursor: not-allowed; opacity: .48; }
.history-scroll { overflow-x: auto; }
.history-table { width: 100%; border-collapse: collapse; text-align: left; }
.history-table th { padding: 0 12px 10px; color: #888b81; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.history-table td { border-top: 1px solid #efede6; padding: 11px 12px; color: #454a43; font-size: 12px; }
.history-table th:first-child, .history-table td:first-child { padding-left: 0; }
.history-table tbody tr:first-child td { border-top: 1px solid #e8e5dc; }
.history-empty { margin: 0; border-top: 1px solid #efede6; padding: 15px 0 4px; color: var(--muted); font-size: 12px; }

.hay-panel {
	position: relative;
	display: flex;
	min-height: 205px;
	flex-direction: column;
	overflow: hidden;
	padding: 21px;
	color: #fffefa;
	border: 0;
	background: #3d5b42;
}
.hay-panel::before, .hay-panel::after {
	position: absolute;
	z-index: 0;
	content: "";
	pointer-events: none;
}
.hay-panel::before {
	inset: 0;
	background: linear-gradient(145deg, rgba(27, 50, 33, .1), rgba(27, 50, 33, .72)),
		url("https://images.unsplash.com/photo-1500595046743-cd271d694d30?auto=format&fit=crop&w=900&q=85") center 48% / cover;
	opacity: .62;
}
.straw-panel::before {
	background: linear-gradient(145deg, rgba(27, 50, 33, .1), rgba(27, 50, 33, .72)),
		url("https://images.unsplash.com/photo-1500595046743-cd271d694d30?auto=format&fit=crop&w=900&q=85") center 70% / cover;
}
.hay-panel::after {
	right: -24px;
	bottom: -42px;
	width: 170px;
	height: 170px;
	border: 1px solid rgba(255, 255, 255, .18);
	border-radius: 50%;
	box-shadow: 0 0 0 24px rgba(255,255,255,.04), 0 0 0 48px rgba(255,255,255,.035);
}
.hay-content { position: relative; z-index: 1; }
.hay-panel .eyebrow { color: #d5e1cd; }
.hay-panel .panel-title { font-size: 21px; }
.hay-last-label { margin: 14px 0 3px; color: #d8e0d4; font-size: 11px; }
.hay-payer { margin: 0; font-family: Fraunces, Georgia, serif; font-size: 30px; line-height: 1.1; }
.hay-meta { margin: 8px 0 17px; color: #e0e7dc; font-size: 12px; }
.hay-update {
	width: fit-content;
	border: 1px solid rgba(255, 255, 255, .5);
	border-radius: 6px;
	padding: 8px 11px;
	color: white;
	background: rgba(255, 255, 255, .12);
	font-size: 12px;
	font-weight: 600;
}
.hay-update:hover { background: rgba(255, 255, 255, .22); }

.note {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 17px;
	padding: 12px 15px;
	border: 1px solid #e5e8de;
	border-radius: 7px;
	color: #60685c;
	background: #eff2e9;
	font-size: 12px;
	animation: arrive .55s .12s ease-out both;
}
.note-mark { display: grid; width: 23px; height: 23px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: #dfe8d9; color: var(--green); font-weight: 700; }

dialog {
	width: min(470px, calc(100% - 28px));
	padding: 0;
	border: 1px solid var(--line);
	border-radius: 9px;
	color: var(--ink);
	background: var(--surface);
	box-shadow: 0 24px 80px rgba(31, 38, 29, .24);
}
dialog::backdrop { background: rgba(27, 33, 27, .48); backdrop-filter: blur(2px); }
.dialog-inner { padding: 23px; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.dialog-head h2 { margin: 0 0 5px; font-family: Fraunces, Georgia, serif; font-size: 23px; }
.dialog-head p { margin: 0; color: var(--muted); font-size: 12px; }
.close-button { display: grid; width: 32px; height: 32px; place-items: center; border: 0; border-radius: 5px; color: var(--muted); background: #f2f1eb; font-size: 20px; line-height: 1; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { color: #64695f; font-size: 11px; font-weight: 700; }
.field input, .field select { width: 100%; min-width: 0; border: 1px solid #deddd4; border-radius: 5px; padding: 10px 11px; color: var(--ink); background: white; font-size: 13px; }
.field input:focus { outline: 2px solid rgba(65, 101, 76, .25); border-color: var(--green); }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 19px; }
.button-secondary, .button-primary { border-radius: 5px; padding: 9px 13px; font-size: 12px; font-weight: 700; }
.button-secondary { border: 1px solid var(--line); color: var(--ink); background: transparent; }
.button-primary { border: 1px solid var(--green); color: white; background: var(--green); }
.button-primary:hover { background: #33543d; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 5; border-radius: 6px; padding: 11px 15px; color: white; background: #2e4733; box-shadow: var(--shadow); font-size: 13px; animation: arrive .2s ease-out; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

@keyframes arrive { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 760px) {
	.shell { width: min(100% - 28px, 560px); }
	header { padding-top: 17px; }
	main { padding-top: 17px; }
	.top-grid { grid-template-columns: 1fr; }
	.payment-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.hay-panel { min-height: 225px; }
	.welcome { align-items: flex-start; flex-direction: column; gap: 12px; }
	.history-panel { padding: 17px 13px 13px; }
	.user-management { padding: 17px 13px 13px; }
	.add-user-form { grid-template-columns: 1fr 1fr; }
	.logout-button { margin-left: 0; }
	.header-actions { gap: 6px; }
}
@media (max-width: 480px) {
	.care-panel { padding: 17px 13px 13px; }
	.panel-heading { gap: 8px; }
	.panel-title { font-size: 19px; }
	.schedule th { padding-right: 4px; padding-left: 4px; font-size: 9px; }
	.schedule td { padding-right: 4px; padding-left: 4px; font-size: 11px; }
	.today-tag { display: none; }
	.person { gap: 5px; }
	.payment-stack { grid-template-columns: 1fr; }
	.dialog-inner { padding: 18px; }
	.login-panel { padding: 25px 21px; }
	.panel-heading { flex-wrap: wrap; }
	.schedule-actions { width: 100%; }
	.history-table th, .history-table td { padding-right: 8px; padding-left: 8px; white-space: nowrap; }
	.add-user-form { grid-template-columns: 1fr; }
	header { gap: 8px; }
	.today-label { margin-left: auto; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }