:root {
	color-scheme: light dark;
	--bg: #f4f7f5;
	--surface: #ffffff;
	--surface-strong: #eef4f0;
	--text: #17211d;
	--muted: #5c6d66;
	--line: #d6e0db;
	--accent: #135c48;
	--accent-strong: #0e4838;
	--green: #20a953;
	--red: #e24545;
	--shadow: 0 18px 50px rgba(23, 33, 29, 0.13);
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #111816;
		--surface: #1b2521;
		--surface-strong: #24322d;
		--text: #edf6f2;
		--muted: #a9bbb3;
		--line: #334640;
		--accent: #57c99c;
		--accent-strong: #7ee0b9;
		--shadow: 0 18px 50px rgba(0, 0, 0, 0.26);
	}
}

:root[data-theme="dark"] {
	--bg: #111816;
	--surface: #1b2521;
	--surface-strong: #24322d;
	--text: #edf6f2;
	--muted: #a9bbb3;
	--line: #334640;
	--accent: #57c99c;
	--accent-strong: #7ee0b9;
	--shadow: 0 18px 50px rgba(0, 0, 0, 0.26);
}

* {
	box-sizing: border-box;
}

body {
	min-height: 100vh;
	margin: 0;
	background: var(--bg);
	color: var(--text);
}

button,
input {
	font: inherit;
}

button {
	touch-action: manipulation;
}

.app-shell {
	width: min(100%, 760px);
	min-height: 100vh;
	margin: 0 auto;
	padding: clamp(16px, 4vw, 32px);
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.app-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	padding: 8px 0;
}

.eyebrow {
	margin: 0 0 4px;
	color: var(--muted);
	font-size: 0.82rem;
	font-weight: 700;
	text-transform: uppercase;
}

h1 {
	margin: 0;
	font-size: clamp(1.8rem, 8vw, 3.1rem);
	line-height: 1.05;
	letter-spacing: 0;
}

.header-actions {
	display: flex;
	gap: 8px;
}

.icon-button {
	width: 46px;
	height: 46px;
	display: grid;
	place-items: center;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--surface);
	color: var(--text);
	font-size: 1.35rem;
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
}

.icon-button:disabled {
	opacity: 0.48;
}

.panel,
.status-panel,
.panel {
	padding: clamp(18px, 6vw, 34px);
}

.login-form {
	display: grid;
	gap: 14px;
}

label {
	font-weight: 800;
}

input {
	width: 100%;
	min-height: 52px;
	padding: 0 14px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--surface-strong);
	color: var(--text);
}

input:focus-visible,
button:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
	outline-offset: 2px;
}

.primary-button {
	min-height: 54px;
	border: 0;
	border-radius: 8px;
	background: var(--accent);
	color: #fff;
	font-weight: 800;
}

.primary-button:disabled,
.punch-button:disabled {
	cursor: not-allowed;
	filter: grayscale(0.5);
	opacity: 0.42;
}

.status-panel {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 18px;
	padding: clamp(18px, 5vw, 28px);
}

.employee {
	margin: 0 0 6px;
	color: var(--muted);
	font-size: 1rem;
	font-weight: 700;
}

.status-label {
	margin: 0;
	font-size: clamp(1.9rem, 8vw, 3.5rem);
	font-weight: 900;
	line-height: 1;
}

.status-meta {
	display: grid;
	gap: 6px;
	justify-items: end;
	min-width: 120px;
	color: var(--muted);
	font-size: 0.85rem;
	font-weight: 700;
	text-align: right;
	word-break: break-word;
}

.punch-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
	margin-top: 14px;
}

.punch-button {
	min-height: clamp(132px, 26vh, 190px);
	display: grid;
	place-items: center;
	gap: 10px;
	padding: 18px 10px;
	border: 0;
	border-radius: 8px;
	background: var(--surface);
	color: var(--text);
	box-shadow: var(--shadow);
}

.punch-button--green {
	border-top: 6px solid var(--green);
}

.punch-button--red {
	border-top: 6px solid var(--red);
}

.punch-button img {
	width: clamp(64px, 18vw, 98px);
	height: clamp(64px, 18vw, 98px);
	object-fit: contain;
}

.punch-button span {
	font-size: clamp(1rem, 4vw, 1.35rem);
	font-weight: 900;
	text-align: center;
}

.message {
	min-height: 28px;
	margin: 12px 0;
	color: var(--accent-strong);
	font-weight: 800;
}

.message--error {
	color: var(--red);
}

.is-busy::after {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 20%, transparent), transparent);
	animation: busy 1.2s infinite;
}

@keyframes busy {
	from {
		transform: translateX(-100%);
	}
	to {
		transform: translateX(100%);
	}
}

[hidden] {
	display: none !important;
}

@media (max-width: 560px) {
	.app-shell {
		padding: 14px;
	}

	.app-header {
		align-items: flex-start;
	}

	.header-actions {
		flex-wrap: wrap;
		justify-content: flex-end;
		max-width: 108px;
	}

	.status-panel {
		display: grid;
	}

	.status-meta {
		justify-items: start;
		text-align: left;
	}

}
