.login-card h2 {
	margin: 24px 0 12px;
	font-size: 18px;
	font-weight: 500;
}

.login-card h2:first-of-type {
	margin-top: 0;
}
:root {
	--tone-1000: #121212;
	--tone-900: #181818;
	--tone-800: #1f1f1f;
	--tone-700: #252525;
	--tone-600: #2c2c2c;
	--tone-500: #333333;
	--tone-400: #3c3c3c;
	--surface: #454545;
	--surface-alt: #494949;
	--border: #5a5a5a;
	--text: #f6f6f6;
	--text-muted: #bcbcbc;
	--accent: #4b8bfd;
	--accent-soft: rgba(75, 139, 253, 0.18);
	--bad: #f07178;
	--ok: #5ad1a4;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
	margin: 0;
	background: var(--tone-900);
	color: var(--text);
	font: 15px/1.55 "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	letter-spacing: 0.01em;
}

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

.admin-body { background: var(--tone-900); }

.admin-shell {
	display: flex;
	min-height: 100vh;
}

.admin-sidebar {
	width: 248px;
	background: linear-gradient(180deg, var(--tone-700) 0%, var(--tone-900) 100%);
	border-right: 1px solid rgba(255, 255, 255, 0.05);
	padding: 32px 28px;
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.sidebar-brand {
	font-size: 1.35rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	color: #ffffff;
}

.sidebar-nav {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 12px;
	margin-bottom: auto;
}

.sidebar-nav a {
	display: block;
	padding: 11px 14px;
	border-radius: 6px;
	border: 1px solid transparent;
	color: var(--text);
	background: transparent;
	transition: background-color 0.18s ease, border-color 0.18s ease;
}

.sidebar-nav a:hover {
	background: rgba(255, 255, 255, 0.06);
	border-color: rgba(255, 255, 255, 0.04);
}

.sidebar-nav a.active {
	background: var(--surface);
	border-color: var(--border);
}

.sidebar-footer a {
	display: block;
	padding: 10px 14px;
	border-radius: 6px;
	border: 1px solid var(--border);
	background: var(--tone-700);
	color: var(--text);
	text-align: center;
	transition: background-color 0.18s ease, border-color 0.18s ease;
}

.sidebar-footer a:hover {
	background: var(--surface-alt);
	border-color: var(--border);
}

.admin-main {
	flex: 1;
	padding: 48px;
	display: flex;
	justify-content: center;
}

.admin-main-inner {
	width: 100%;
	max-width: 1200px;
	display: flex;
	flex-direction: column;
	gap: 28px;
}

.page-header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
}

.page-header h1 {
	margin: 0;
	font-size: 28px;
	font-weight: 600;
}

.page-label {
	text-transform: uppercase;
	font-size: 12px;
	letter-spacing: 0.12em;
	color: var(--text-muted);
	margin-bottom: 6px;
}

.page-actions {
	display: flex;
	gap: 10px;
}

.card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 6px;
	padding: 24px;
	box-shadow: 0 18px 36px rgba(0, 0, 0, 0.25);
}

.card h2,
.card h3 {
	margin-top: 0;
	margin-bottom: 14px;
	font-weight: 600;
	color: #ffffff;
}

.card p {
	margin-top: 0;
	margin-bottom: 12px;
	color: var(--text-muted);
}

.stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 18px;
}

.stat-card {
	padding: 22px;
	background: var(--surface-alt);
	border: 1px solid rgba(255, 255, 255, 0.05);
	border-radius: 6px;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.stat-label {
	margin: 0;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var(--text-muted);
}

.stat-value {
	margin: 14px 0 0;
	font-size: 32px;
	font-weight: 600;
	color: #ffffff;
}

.stat-meta {
	margin-top: 8px;
	font-size: 13px;
	color: var(--text-muted);
}

.row {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	align-items: center;
}

.row + .row {
	margin-top: 14px;
}

.input {
	background: var(--tone-600);
	border: 1px solid var(--border);
	color: var(--text);
	border-radius: 4px;
	padding: 10px 12px;
	min-width: 200px;
	font: inherit;
}

.input:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-soft);
}

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 18px;
	border-radius: 4px;
	border: 1px solid transparent;
	background: var(--accent);
	color: #ffffff;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
	text-decoration: none;
}

.button:hover {
	background: #3f7de5;
}

.button:focus-visible {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-soft);
}

.button.ghost {
	background: transparent;
	color: var(--text);
	border-color: var(--border);
}

.button.ghost:hover {
	background: rgba(255, 255, 255, 0.08);
}

.button.ghost:focus-visible {
	box-shadow: 0 0 0 3px var(--accent-soft);
}

.button.danger {
	background: #e06c75;
	color: #ffffff;
}

.button.danger:hover {
	background: #d05560;
}

.badge {
	display: inline-flex;
	align-items: center;
	padding: 6px 10px;
	border-radius: 4px;
	border: 1px solid var(--border);
	background: var(--tone-600);
	color: var(--text);
	font-size: 13px;
}

.badge.ok {
	border-color: rgba(90, 209, 164, 0.6);
	color: #c3f5df;
}

.badge.bad {
	border-color: rgba(240, 113, 120, 0.6);
	color: #ffd6d8;
}

.alert {
	padding: 12px 16px;
	border-radius: 6px;
	border: 1px solid var(--border);
	background: rgba(255, 255, 255, 0.05);
	color: var(--text);
	margin-bottom: 18px;
}

.alert.success {
	border-color: rgba(90, 209, 164, 0.5);
	background: rgba(90, 209, 164, 0.14);
	color: #d1ffe9;
}

.alert.error {
	border-color: rgba(240, 113, 120, 0.5);
	background: rgba(240, 113, 120, 0.16);
	color: #ffd8da;
}

.alert pre {
	margin: 10px 0 0;
	white-space: pre-wrap;
	word-break: break-word;
}

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

.table {
	width: 100%;
	border-collapse: collapse;
	background: var(--surface-alt);
	border: 1px solid rgba(255, 255, 255, 0.04);
}

.table th,
.table td {
	padding: 12px 14px;
	text-align: left;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.table thead th {
	text-transform: uppercase;
	font-size: 12px;
	letter-spacing: 0.1em;
	color: var(--text-muted);
	background: rgba(0, 0, 0, 0.08);
}

.table tbody tr:hover {
	background: rgba(255, 255, 255, 0.04);
}

.table tbody tr:last-child td {
	border-bottom: none;
}

.code {
	font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
	background: var(--tone-700);
	border: 1px solid var(--border);
	border-radius: 4px;
	padding: 8px 10px;
	display: inline-block;
	color: #f0f0f0;
}

pre.code {
	display: block;
	max-height: 420px;
	overflow: auto;
}

label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	color: var(--text-muted);
}

input[type="checkbox"],
input[type="radio"] {
	accent-color: var(--accent);
}

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

.help-text {
	font-size: 13px;
	color: var(--text-muted);
	margin-top: 6px;
}

.link-row {
	display: flex;
	gap: 12px;
}

.form-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
}

.form-grid .form-field {
	flex: 1 1 220px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.form-grid.two-column .form-field {
	flex: 1 1 calc(50% - 16px);
	max-width: calc(50% - 16px);
}

.form-grid label {
	font-size: 13px;
	color: var(--text-muted);
}

.form-actions {
	display: flex;
	justify-content: flex-end;
	margin-top: 18px;
}

.login-shell {
	max-width: 640px;
	margin: 0 auto;
	padding: 0 16px;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.login-card {
	padding: 36px;
	border-radius: 6px;
	background: var(--surface);
	border: 1px solid var(--border);
	box-shadow: 0 18px 36px rgba(0, 0, 0, 0.26);
}

.login-card .row {
	width: 100%;
	flex-wrap: nowrap;
	align-items: stretch;
}

.login-card .row .input {
	flex: 1 1 auto;
	width: 100%;
}

.login-card .row:last-child {
	justify-content: flex-end;
}

.login-card .row:last-child .button {
	width: auto;
}

footer {
	opacity: 0.7;
	font-size: 13px;
	margin-top: 32px;
	color: var(--text-muted);
}

@media (max-width: 920px) {
	.admin-shell { flex-direction: column; }
	.admin-sidebar { width: 100%; flex-direction: row; align-items: center; gap: 20px; }
	.sidebar-nav { flex-direction: row; flex-wrap: wrap; gap: 10px; margin: 0; }
	.sidebar-footer { margin-left: auto; }
	.admin-main { padding: 36px 24px 48px; }
}