/* Earlybyte app design: the canonical copy (eb_blueprint/templates/design/eb.css).
   earlybyte.ch colours, Manrope, pill navigation and buttons, rounded cards, notices, badges,
   forms. Taken from eb_relay's app.css (eb_relay cd4555f, lines 1–654), which follows mTime's
   design language. Apps copy this file unchanged and keep their own rules in a second file
   that uses only the tokens below. See README.md next to this file.
   Fonts: Manrope, and Figtree 900 for the sign-in headline (both SIL OFL), served from `fonts/`
   next to this file. The sign-in page is in signin.css. */
@font-face {
	font-family: Manrope;
	font-style: normal;
	font-weight: 400 800;
	font-display: swap;
	src: url('fonts/manrope-latin.woff2') format('woff2');
	unicode-range:
		U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
		U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: Manrope;
	font-style: normal;
	font-weight: 400 800;
	font-display: swap;
	src: url('fonts/manrope-latin-ext.woff2') format('woff2');
	unicode-range:
		U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+2020,
		U+20A0-20AB, U+20AD-20C0, U+2113, U+A720-A7FF;
}

@font-face {
	font-family: Figtree;
	font-style: normal;
	font-weight: 900;
	font-display: swap;
	src: url('fonts/figtree-latin-900.woff2') format('woff2');
}

:root {
	color-scheme: light dark;

	--bg: light-dark(#eef2e4, #0b0b0c);
	--surface: light-dark(#ffffff, #161617);
	--surface-soft: light-dark(#f1f8e8, #1f2021);
	--line: light-dark(rgb(83 128 82 / 0.2), rgb(255 255 255 / 0.1));
	--line-strong: light-dark(rgb(83 128 82 / 0.42), rgb(255 255 255 / 0.22));
	--text: light-dark(#243026, #dcdcde);
	--title: light-dark(#26382a, #f5f5f6);
	--muted: light-dark(#5a6a5c, #9a9ba0);
	--eyebrow: light-dark(#517843, #a6d84a);
	--link: light-dark(#476a0b, #b8e85e);

	--accent: #a6d84a;
	--accent-hover: #b8e85e;
	--accent-ink: #17300a;
	--accent-shadow: light-dark(rgb(120 170 50 / 0.32), rgb(0 0 0 / 0.4));
	--neutral: light-dark(#ececec, #2a2a2c);
	--neutral-hover: light-dark(#e0e0e0, #38383b);

	--problem: light-dark(#a11a1a, #ffa3a3);
	--problem-surface: light-dark(#fdeeee, #3a1b1b);
	--good: light-dark(#2f6b1f, #a6d84a);
	--good-surface: light-dark(#e8f6eb, #1c2616);
	--warn-surface: light-dark(#fdf0d9, #3a2c12);
	--warn-text: light-dark(#7a4a00, #ffcf80);
	--shadow: 0 0.5rem 1.5rem light-dark(rgb(31 45 30 / 0.06), rgb(0 0 0 / 0.5));
	--gradient: linear-gradient(90deg, #365b67 0%, #639446 85%);

	font-family: Manrope, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	font-size: 15px;
	line-height: 1.55;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	color: var(--text);
	background: var(--bg);
}

.page {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.top,
main,
footer {
	width: 100%;
	max-width: 100rem;
	margin: 0 auto;
	padding-inline: 1.5rem;
}

/* --- Header and footer --------------------------------------------------- */

.top {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 1rem;
	max-width: none;
	padding-block: 0.75rem;
	background: var(--surface);
}

.top::after {
	position: absolute;
	inset: auto 0 0;
	height: 2px;
	background: var(--gradient);
	content: '';
}

.brand {
	color: var(--title);
	font-size: 1.35rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	text-decoration: none;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
}

.brand img {
	display: block;
	width: 2rem;
	height: 2rem;
}

.brand-name span {
	color: var(--eyebrow);
}


.tabs {
	display: flex;
	flex: 1;
	flex-wrap: wrap;
	gap: 0.25rem;
	margin-left: 1rem;
}

.tabs a {
	padding: 0.35rem 0.9rem;
	border-radius: 999px;
	color: var(--title);
	font-weight: 600;
	text-decoration: none;
}

.tabs a:hover {
	background: var(--surface-soft);
}

.tabs a[aria-current='page'] {
	background: var(--accent);
	color: var(--accent-ink);
}

.account {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25rem 0.75rem;
	margin-left: auto;
}

.avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	background: var(--title);
	color: var(--surface);
	font-size: 0.75rem;
	font-weight: 800;
}

.account .who {
	color: var(--title);
	font-weight: 600;
}

button.link {
	padding: 0;
	border: 0;
	background: none;
	color: var(--title);
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
}

main {
	padding-block: 1.5rem 2rem;
}

footer {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.5rem 1rem;
	margin-top: auto;
	padding-block: 1rem;
	color: var(--muted);
	font-size: 0.8667rem;
}

footer a {
	color: inherit;
}

/* --- Text ---------------------------------------------------------------- */

h1,
h2 {
	margin: 0;
	color: var(--title);
	line-height: 1.18;
}

h1 {
	font-size: 1.6rem;
	font-weight: 800;
	letter-spacing: -0.015em;
}

.head {
	margin-bottom: 1.25rem;
}

.eyebrow {
	margin: 0 0 0.25rem;
	color: var(--eyebrow);
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

a {
	color: var(--link);
}

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

.hint {
	max-width: 52rem;
	margin: 0.25rem 0 0.9rem;
	color: var(--muted);
	font-size: 0.8667rem;
}

.mono,
pre {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 0.8667rem;
}

pre {
	margin: 0;
	padding: 0.9rem 1rem;
	overflow-x: auto;
	border: 1px solid var(--line);
	border-radius: 0.75rem;
	background: var(--surface-soft);
	white-space: pre-wrap;
	word-break: break-word;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

:focus-visible {
	outline: 2px solid var(--link);
	outline-offset: 2px;
}

/* --- Buttons ------------------------------------------------------------- */

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 2.6rem;
	padding: 0 1.4rem;
	border: 0;
	border-radius: 999px;
	background: var(--accent);
	box-shadow: 0 3px 12px var(--accent-shadow);
	color: var(--accent-ink);
	font: inherit;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	transition:
		background-color 140ms ease,
		box-shadow 140ms ease,
		transform 140ms ease;
}

.button:hover:not(:disabled) {
	background: var(--accent-hover);
	transform: translateY(-1px);
}

.button.secondary {
	background: var(--neutral);
	box-shadow: none;
	color: var(--text);
}

.button.secondary:hover:not(:disabled) {
	background: var(--neutral-hover);
}

.button.danger {
	border: 1px solid var(--problem);
	background: none;
	box-shadow: none;
	color: var(--problem);
}

.button.danger:hover:not(:disabled) {
	background: var(--problem-surface);
}

.pill {
	display: inline-flex;
	align-items: center;
	min-height: 2rem;
	padding: 0 0.85rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--surface);
	color: var(--title);
	font-size: 0.8667rem;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.pill:hover {
	border-color: var(--line-strong);
	background: var(--surface-soft);
}

.actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
	margin-top: 1.25rem;
}

form.inline {
	display: inline;
}

/* --- Notices and cards --------------------------------------------------- */

.notice {
	margin: 0 0 1rem;
	padding: 0.75rem 1rem;
	border: 1px solid var(--line);
	border-radius: 0.75rem;
	background: var(--surface);
}

.notice.ok {
	border-color: transparent;
	background: var(--good-surface);
}

.notice.error,
.notice.problem {
	border-color: var(--problem);
	background: var(--problem-surface);
	color: var(--problem);
}

.card {
	margin: 0 0 1.25rem;
	padding: 1.5rem;
	overflow-x: auto;
	border: 1px solid var(--line);
	border-radius: 1rem;
	background: var(--surface);
	box-shadow: var(--shadow);
}

.card h2 {
	margin-bottom: 1rem;
	font-size: 1.2rem;
}

.card h2.next {
	margin-top: 1.75rem;
}

.card-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.5rem 1rem;
}

.narrow {
	max-width: 52rem;
}

/* Sign-in page: signin.css next to this file (self-contained, also used by apps without eb.css). */

/* --- Tables -------------------------------------------------------------- */

table {
	width: 100%;
	border-collapse: collapse;
}

th,
td {
	padding: 0.5rem 0.75rem;
	border-bottom: 1px solid var(--line);
	text-align: left;
	vertical-align: top;
}

th {
	color: var(--muted);
	font-size: 0.8667rem;
	font-weight: 600;
	white-space: nowrap;
}

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

td.num,
th.num {
	font-variant-numeric: tabular-nums;
	text-align: right;
}

td.time,
td.time a {
	white-space: nowrap;
}

/* --- Status badges ------------------------------------------------------- */

.badge {
	display: inline-block;
	padding: 0.05rem 0.6rem;
	border-radius: 999px;
	background: var(--neutral);
	color: var(--text);
	font-size: 0.8rem;
	font-weight: 700;
	white-space: nowrap;
}

.s-ok,
.s-up,
.s-connected,
.s-sent,
.s-pushed {
	background: var(--good-surface);
	color: var(--good);
}

.s-warning,
.s-no-report,
.s-reboot,
.s-overdue,
.s-held_back,
.s-never,
.s-no-interval,
.s-waiting {
	background: var(--warn-surface);
	color: var(--warn-text);
}

.s-failure,
.s-stale,
.s-down,
.s-error,
.s-no_token,
.s-no_target,
.s-missed {
	background: var(--problem-surface);
	color: var(--problem);
}

.s-unparsed,
.s-none,
.s-disabled,
.s-skipped,
.s-not-yet-due {
	background: var(--neutral);
	color: var(--muted);
}

td.s-error {
	background: none;
	color: var(--problem);
	font-weight: 700;
}

/* --- Forms --------------------------------------------------------------- */

.grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
	gap: 0.9rem 1.1rem;
	align-items: end;
	margin: 0.75rem 0;
}

label {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	min-width: 0;
	color: var(--title);
	font-size: 0.8667rem;
	font-weight: 700;
}

label.check {
	flex-direction: row;
	align-items: center;
	gap: 0.5rem;
	font-weight: 600;
}

input:not([type='checkbox'], [type='radio'], [type='hidden']),
select,
textarea {
	width: 100%;
	min-height: 2.5rem;
	padding: 0.4rem 0.7rem;
	border: 1px solid var(--line-strong);
	border-radius: 0.5rem;
	background: var(--surface);
	color: var(--text);
	font: inherit;
	font-weight: 400;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
	border-color: var(--link);
	outline: 2px solid var(--accent);
	outline-offset: 0;
}

input:disabled,
select:disabled {
	opacity: 0.6;
}

input[type='checkbox'],
input[type='radio'] {
	width: 1.1rem;
	height: 1.1rem;
	accent-color: #6b9c28;
}

form.filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.9rem;
	align-items: end;
	margin-bottom: 1rem;
}

form.filters label {
	min-width: 11rem;
}

.days {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.25rem;
	align-items: center;
	margin: 0.35rem 0 0.9rem;
}

@media (max-width: 40rem) {
	.top,
	main,
	footer {
		padding-inline: 1rem;
	}


	.tabs {
		order: 3;
		flex-basis: 100%;
		margin-left: 0;
	}

	.card {
		padding: 1.1rem;
	}
}

.eyebrow a {
	color: inherit;
	text-decoration: none;
}

