:root {
	color-scheme: dark;
	--background: #111315;
	--surface: #1b1f23;
	--text: #f4f0e8;
	--muted: #b9b2a7;
	--soft: #242a30;
	--border: #363d44;
	--primary: #3fb6a8;
	--primary-strong: #278b81;
	--danger: #e25d55;
	--danger-strong: #b83f39;
	--success: #8ecf76;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var(--background);
	color: var(--text);
	font-family:
		Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
		sans-serif;
}

button,
input,
select,
textarea {
	font: inherit;
}

a {
	color: inherit;
}

.site-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem clamp(1rem, 4vw, 3rem);
	background: var(--surface);
	border-bottom: 1px solid var(--border);
}

.brand,
.site-header a,
.text-link,
.back-link {
	font-weight: 800;
	text-decoration: none;
}

.site-header nav {
	display: flex;
	gap: 0.75rem;
}

.site-header nav a,
.text-link,
.back-link {
	color: var(--primary);
}

a:hover {
	text-decoration: underline;
}

.page {
	width: min(78rem, calc(100% - 2rem));
	margin: 0 auto;
	padding: 2rem 0 4rem;
}

.intro {
	margin-bottom: 1.5rem;
	padding: 1rem 0;
}

.eyebrow {
	margin: 0 0 0.5rem;
	color: #d3b15f;
	font-size: 0.9rem;
	font-weight: 800;
	text-transform: uppercase;
}

h1 {
	max-width: 48rem;
	margin: 0;
	font-size: clamp(2rem, 6vw, 4rem);
	line-height: 1;
}

h2 {
	margin: 0 0 1rem;
	font-size: 1.35rem;
}

p {
	line-height: 1.6;
}

.intro p,
.section-heading p {
	max-width: 42rem;
	color: var(--muted);
}

.section-heading {
	display: flex;
	align-items: end;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1rem;
}

.panel,
.table-wrap,
.empty-state,
.stat,
.login-form {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 8px;
}

.panel {
	padding: 1rem;
}

.table-wrap {
	overflow-x: auto;
}

table {
	width: 100%;
	min-width: 42rem;
	border-collapse: collapse;
}

th,
td {
	padding: 0.9rem 1rem;
	border-bottom: 1px solid var(--border);
	text-align: left;
}

thead th {
	background: var(--soft);
	color: #d8d2c8;
	font-size: 0.85rem;
	text-transform: uppercase;
}

tbody tr:last-child th,
tbody tr:last-child td {
	border-bottom: 0;
}

.empty-state,
.message {
	padding: 1rem;
}

.message {
	margin-bottom: 1rem;
	border-radius: 8px;
}

.message.error {
	color: #ffe0dc;
	background: #3a1d1b;
	border: 1px solid #75352f;
}

.message.success {
	color: var(--success);
	background: #1d3324;
	border: 1px solid #376443;
}

.stats {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.stat {
	padding: 0.75rem 1rem;
}

.timeline {
	display: grid;
	gap: 0.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.timeline li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 8px;
}

.timeline p {
	margin: 0.35rem 0;
	color: var(--muted);
}

.minutes {
	flex: 0 0 auto;
	font-weight: 900;
}

.positive {
	color: var(--success);
}

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

time {
	color: var(--muted);
	font-size: 0.9rem;
}

.admin-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
	margin-bottom: 1rem;
}

form {
	margin: 0;
}

.inline-form,
.issue-form,
.row-form,
.issue-row,
.login-form {
	display: grid;
	gap: 0.75rem;
}

.inline-form,
.issue-form {
	grid-template-columns: repeat(4, minmax(0, 1fr));
	align-items: end;
	margin-bottom: 1rem;
}

.row-form {
	grid-template-columns: minmax(8rem, 1fr) 5rem auto auto;
	align-items: center;
	padding: 0.75rem 0;
	border-top: 1px solid var(--border);
}

.issue-list {
	display: grid;
	gap: 0.75rem;
}

.issue-row {
	grid-template-columns: 10rem minmax(8rem, 1fr) minmax(10rem, 1.4fr) minmax(8rem, 1fr) auto;
	align-items: end;
	padding-top: 0.75rem;
	border-top: 1px solid var(--border);
}

.issue-row p {
	display: grid;
	gap: 0.35rem;
	margin: 0;
}

.issue-row p span {
	font-weight: 700;
}

.actions {
	display: flex;
	gap: 0.5rem;
}

label {
	display: grid;
	gap: 0.35rem;
	font-weight: 700;
}

input,
select {
	width: 100%;
	padding: 0.7rem;
	color: var(--text);
	background: #12161a;
	border: 1px solid var(--border);
	border-radius: 6px;
}

input:focus,
select:focus {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
}

button,
.button {
	display: inline-block;
	padding: 0.7rem 0.9rem;
	color: #061817;
	font-weight: 800;
	background: var(--primary);
	border: 0;
	border-radius: 6px;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}

button:hover,
.button:hover {
	background: var(--primary-strong);
	text-decoration: none;
}

.secondary {
	color: var(--text);
	background: var(--soft);
	border: 1px solid var(--border);
}

.secondary:hover {
	background: #303840;
}

.danger {
	background: var(--danger);
	color: #1b0908;
}

.danger:hover {
	background: var(--danger-strong);
}

.link-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.85rem;
}

.login-page {
	display: grid;
	min-height: 100vh;
	place-items: center;
	padding: 1rem;
}

.login-form {
	width: min(100%, 24rem);
	padding: 1.25rem;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (max-width: 900px) {
	.admin-grid,
	.inline-form,
	.issue-form,
	.issue-row,
	.row-form {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 640px) {
	.site-header,
	.section-heading,
	.timeline li {
		align-items: flex-start;
		flex-direction: column;
	}
}
