:root {
	--canvas: #f4f3ef;
	--sidebar: #ebeae4;
	--paper: #fbfbf9;
	--ink: #1c1c19;
	--muted: #65635c;
	--faint: #8d8a82;
	--line: #e3e0d8;
	--line-strong: #d3cfc6;
	--accent: #1b5c50;
	--accent-soft: #e6f1ed;
	--warn: #8a5a16;
	--warn-soft: #f4ead8;
	--danger: #8d3d36;
	--danger-soft: #f6e8e6;
	--shadow: 0 1px 0 rgba(28, 28, 25, 0.04);
	font-family: "Inter", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
	margin: 0;
	background: var(--canvas);
	color: var(--ink);
}

body {
	font-size: 14px;
	line-height: 1.45;
	min-height: 100vh;
}

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

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

a:hover { color: var(--accent); }

h1 {
	margin: 4px 0 0;
	font-size: 22px;
	font-weight: 500;
	letter-spacing: -0.02em;
	color: var(--accent);
}

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

.sidebar {
	width: 216px;
	flex: 0 0 216px;
	background: var(--sidebar);
	border-right: 1px solid var(--line);
	display: flex;
	flex-direction: column;
	position: sticky;
	top: 0;
	height: 100vh;
}

.brand { display: flex; gap: 10px; align-items: center; padding: 16px 12px; }

.mark { width: 16px; height: 16px; background: var(--accent); }

.brand strong { display: block; color: var(--accent); font-weight: 500; }

.brand span, .faint { color: var(--faint); }

.nav a {
	display: flex;
	align-items: center;
	height: 32px;
	padding: 0 10px;
	margin: 0 8px;
	border-left: 2px solid transparent;
	color: var(--muted);
	font-size: 13px;
}

.nav a.active {
	background: var(--paper);
	border-left-color: var(--accent);
	color: var(--ink);
	font-weight: 500;
}

.sidebar .who { margin-top: auto; border-top: 1px solid var(--line); padding: 12px; font-size: 13px; }

.workspace { min-width: 0; flex: 1; display: flex; flex-direction: column; }

.topbar {
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 32px;
	border-bottom: 1px solid var(--line);
	font-size: 12px;
	color: var(--muted);
}

.flash {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 8px 32px;
	background: var(--accent-soft);
	border-bottom: 1px solid var(--line);
}

.flash p { margin: 0; }

.page { padding: 24px 32px 48px; max-width: 1100px; }

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

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

.spread { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }

.section { margin-top: 28px; }

.kicker {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--faint);
}

table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }

th, td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }

th { font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }

input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="number"], select, textarea {
	height: 32px;
	border: 1px solid var(--line);
	background: var(--paper);
	border-radius: 3px;
	padding: 0 8px;
	width: 100%;
}

textarea { height: auto; min-height: 88px; padding: 8px; white-space: pre-wrap; }

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

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-size: 13px; }

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

.btn, button, .quiet {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 32px;
	padding: 0 12px;
	border-radius: 3px;
	border: 1px solid var(--line);
	background: var(--paper);
	cursor: pointer;
}

.btn-primary, button.primary {
	background: var(--accent);
	border-color: var(--accent);
	color: white;
}

.btn-primary:hover, button.primary:hover { background: #164e44; color: white; }

button.danger {
	background: var(--danger);
	border-color: var(--danger);
	color: white;
}

button.danger:hover { background: #74332d; color: white; }

.card {
	border: 1px solid var(--line);
	background: var(--paper);
	border-radius: 8px;
	padding: 12px 14px;
	box-shadow: var(--shadow);
}

.form-card { max-width: 720px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.pill { display: inline-block; border-radius: 99px; padding: 2px 8px; font-size: 12px; background: var(--sidebar); color: var(--muted); }

.pill.active, .pill.trial { background: var(--accent-soft); color: var(--accent); }

.pill.suspended, .pill.cancelled { background: var(--danger-soft); color: var(--danger); }

.pill.past_due { background: var(--warn-soft); color: var(--warn); }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }

.login {
	width: min(420px, 100%);
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 28px;
}

.errors { color: var(--danger); font-size: 13px; padding-left: 18px; }

@media (max-width: 860px) {
	.shell { display: block; }
	.sidebar { width: auto; height: auto; position: static; }
	.nav { display: flex; overflow-x: auto; }
	.sidebar .who { display: none; }
	.page, .topbar, .flash { padding-left: 16px; padding-right: 16px; }
	.split { display: block; }
}
