/* Fake Lab - hand-written stylesheets, no frameworks. This one holds the tokens, base elements and shared components;
   pages.css (linked after it) holds page structure, page-specific rules and the small-screen overrides. */

:root {
	--bg: #f4f6f8;
	--surface: #ffffff;
	--text: #1f2933;
	--muted: #616e7c;
	--border: #d9e0e7;
	--border-strong: #b8c4ce;
	--accent: #0b6e99;
	--accent-hover: #095a7d;
	--header-bg: #102a43;
	--header-text: #e4ecf3;
	--header-muted: #9fb3c8;
	--radius: 6px;
	--shadow: 0 1px 2px rgba(16, 42, 67, 0.08);
	--font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--mono: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	font-size: 15px;
}

body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	line-height: 1.5;
}

/* Typography */

h1,
h2,
h3 {
	margin: 0 0 0.6em;
	line-height: 1.25;
	font-weight: 600;
}

h1 {
	font-size: 1.6rem;
	overflow-wrap: anywhere;
}

h2 {
	font-size: 1.2rem;
}

h3 {
	font-size: 1.05rem;
}

p {
	margin: 0 0 1em;
}

a {
	color: var(--accent);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

code,
pre {
	font-family: var(--mono);
	font-size: 0.9em;
}

code {
	padding: 0.1em 0.35em;
	background: #eef2f6;
	border-radius: 4px;
	word-break: break-all;
}

pre {
	margin: 0 0 1em;
	padding: 0.8em 1em;
	overflow-x: auto;
	background: #0f1b26;
	color: #e4ecf3;
	border-radius: var(--radius);
}

pre code {
	padding: 0;
	background: none;
}

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

/* Layout */

.container {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 1.25rem;
}

main.container {
	flex: 1;
	padding-top: 1.5rem;
	padding-bottom: 2rem;
}

.site-header {
	background: var(--header-bg);
	color: var(--header-text);
}

.header-inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 1.25rem;
	min-height: 3.25rem;
	display: flex;
	align-items: center;
	gap: 1.5rem;
	flex-wrap: wrap;
}

.brand {
	color: #ffffff;
	font-weight: 700;
	font-size: 1.1rem;
	letter-spacing: 0.02em;
}

.brand:hover {
	text-decoration: none;
}

.nav {
	display: flex;
	gap: 0.25rem;
	flex-wrap: wrap;
}

.nav a {
	color: var(--header-muted);
	padding: 0.35rem 0.7rem;
	border-radius: var(--radius);
}

.nav a:hover {
	color: #ffffff;
	background: rgba(255, 255, 255, 0.08);
	text-decoration: none;
}

.nav a.active {
	color: #ffffff;
	background: rgba(255, 255, 255, 0.16);
}

.header-end {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 0.75rem;
	font-size: 0.9rem;
}

.env,
.user {
	color: var(--header-muted);
}

.site-footer {
	padding: 1rem 0;
	border-top: 1px solid var(--border);
	color: var(--muted);
	font-size: 0.85rem;
}

.grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
	gap: 1.25rem;
	align-items: start;
	margin-bottom: 1.25rem;
}

.card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 1.1rem 1.25rem;
	margin-bottom: 1.25rem;
	min-width: 0;
}

/* Key/value lists */

.kv {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 0.45rem 1.25rem;
	margin: 0;
}

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

.kv dd {
	margin: 0;
	min-width: 0;
}

/* Tables */

.table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95rem;
}

.table th,
.table td {
	padding: 0.45rem 0.6rem;
	text-align: left;
	border-bottom: 1px solid var(--border);
	vertical-align: top;
}

.table th {
	font-weight: 600;
	color: var(--muted);
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	border-bottom-color: var(--border-strong);
}

.table tbody tr:hover {
	background: #f7f9fb;
}

.table .num {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.table th .badge {
	text-transform: none;
	letter-spacing: normal;
}

/* Forms */

.field {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	margin-bottom: 1rem;
}

label {
	font-weight: 600;
	font-size: 0.9rem;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="datetime-local"],
input:not([type]),
select,
textarea {
	width: 100%;
	padding: 0.45rem 0.6rem;
	font: inherit;
	color: var(--text);
	background: var(--surface);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
}

input:disabled,
select:disabled,
textarea:disabled {
	color: var(--muted);
	background: #f2f4f6;
	cursor: not-allowed;
}

input:focus,
select:focus,
textarea:focus {
	outline: 2px solid rgba(11, 110, 153, 0.35);
	outline-offset: 0;
	border-color: var(--accent);
}

textarea {
	min-height: 6rem;
	font-family: var(--mono);
	font-size: 0.9rem;
}

form.inline {
	display: inline;
	margin: 0;
}

/* Buttons */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	padding: 0.45rem 0.95rem;
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	border: 1px solid transparent;
	border-radius: var(--radius);
	cursor: pointer;
	text-decoration: none;
}

.btn:hover {
	text-decoration: none;
}

.btn:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.btn-primary {
	background: var(--accent);
	color: #ffffff;
}

.btn-primary:hover {
	background: var(--accent-hover);
}

.btn-secondary {
	background: var(--surface);
	color: var(--text);
	border-color: var(--border-strong);
}

.btn-secondary:hover {
	background: #eef2f6;
}

.btn-danger {
	background: #b42318;
	color: #ffffff;
}

.btn-danger:hover {
	background: #912018;
}

.btn-small {
	padding: 0.25rem 0.6rem;
	font-size: 0.85rem;
}

/* Badges */

.badge {
	display: inline-block;
	padding: 0.1rem 0.55rem;
	font-size: 0.8rem;
	font-weight: 600;
	line-height: 1.5;
	border-radius: 999px;
	border: 1px solid transparent;
	white-space: nowrap;
}

.badge-planned {
	background: #e6eef6;
	color: #334e68;
	border-color: #c5d4e3;
}

.badge-received {
	background: #fff4d6;
	color: #7a4b00;
	border-color: #f0d48a;
}

.badge-certified {
	background: #dff5e6;
	color: #1d6b3a;
	border-color: #a6dbb7;
}

.badge-muted {
	background: #f2f2f2;
	color: #6b6b6b;
	border-color: #d6d6d6;
}

.badge-deleted {
	background: #f2f2f2;
	color: #6b6b6b;
	border-color: #d6d6d6;
	text-decoration: line-through;
}

.badge-success {
	background: #dff5e6;
	color: #1d6b3a;
}

.badge-warning {
	background: #fff4d6;
	color: #7a4b00;
}

.badge-error {
	background: #fde8e7;
	color: #9b1c13;
}

/* Alerts */

.alert {
	padding: 0.7rem 0.95rem;
	margin-bottom: 1rem;
	border: 1px solid transparent;
	border-left-width: 4px;
	border-radius: var(--radius);
}

.alert-success {
	background: #ecf9f0;
	border-color: #a6dbb7;
	border-left-color: #1d6b3a;
	color: #1d4d2e;
}

.alert-warning {
	background: #fff8e6;
	border-color: #f0d48a;
	border-left-color: #b77900;
	color: #5c3d00;
}

.alert-error {
	background: #fdeeed;
	border-color: #f3b8b3;
	border-left-color: #b42318;
	color: #7a1810;
}

/* Login */

.login-panel {
	max-width: 380px;
	margin: 3rem auto 1.25rem;
	padding: 1.75rem;
}

.login-panel .btn {
	width: 100%;
}

/* Focus: visible for keyboard users on every interactive control */

a:focus-visible,
.btn:focus-visible,
summary:focus-visible,
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible,
input[type="file"]:focus-visible {
	outline: 3px solid rgba(11, 110, 153, 0.55);
	outline-offset: 2px;
}

.site-header a:focus-visible,
.site-header .btn:focus-visible {
	outline-color: #9fd3ef;
}
