:root {
	color-scheme: light;
	--bg: #f6f7f9;
	--panel: #ffffff;
	--text: #18212f;
	--muted: #667085;
	--line: #d8dee8;
	--accent: #116466;
	--accent-dark: #0b4f51;
	--warn: #8a4b0f;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 14px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 28px;
	background: #ffffff;
	border-bottom: 1px solid var(--line);
}

h1,
h2,
p {
	margin-top: 0;
}

h1 {
	margin-bottom: 2px;
	font-size: 22px;
}

h2 {
	margin-bottom: 14px;
	font-size: 18px;
}

main {
	width: min(1180px, calc(100% - 32px));
	margin: 28px auto;
}

.grid {
	display: grid;
	grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
	gap: 18px;
}

.panel {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: 8px;
	padding: 20px;
}

.narrow {
	max-width: 440px;
	margin: 12vh auto 0;
}

.panel-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

label {
	display: grid;
	gap: 6px;
	margin-bottom: 12px;
	color: #344054;
	font-weight: 600;
}

input,
select {
	width: 100%;
	min-height: 40px;
	border: 1px solid #b9c2cf;
	border-radius: 6px;
	padding: 8px 10px;
	color: var(--text);
	font: inherit;
}

select {
	min-height: 42px;
	padding: 9px 30px 9px 10px;
}

#user-form select {
	height: 60px;
	min-height: 60px;
	padding: 14px 34px 14px 16px;
	line-height: 1.35;
}

input:focus,
select:focus {
	outline: 2px solid rgba(17, 100, 102, 0.22);
	border-color: var(--accent);
}

input[readonly] {
	background: #f8fafc;
	color: var(--muted);
}

button {
	min-height: 40px;
	border: 1px solid var(--accent);
	border-radius: 6px;
	padding: 8px 14px;
	background: var(--accent);
	color: #ffffff;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

button:hover {
	background: var(--accent-dark);
}

button:disabled {
	cursor: wait;
	opacity: 0.65;
}

.secondary,
.ghost {
	background: #ffffff;
	color: var(--accent-dark);
}

.secondary:hover,
.ghost:hover {
	background: #eef6f6;
}

.actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 16px;
}

.actions.compact {
	gap: 6px;
	margin-top: 0;
}

.actions.compact button {
	min-height: 32px;
	padding: 5px 9px;
}

.danger {
	border-color: #b42318;
	background: #b42318;
}

.danger:hover {
	background: #912018;
}

.icon-button {
	min-width: 40px;
	padding-inline: 0;
}

.details {
	display: grid;
	grid-template-columns: max-content minmax(0, 1fr);
	gap: 8px 14px;
	margin: 0;
}

.details dt {
	color: var(--muted);
	font-weight: 700;
}

.details dd {
	margin: 0;
	word-break: break-word;
}

.muted,
#account-line {
	color: var(--muted);
	margin-bottom: 0;
}

#billing-status {
	margin-top: 8px;
}

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

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

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

th {
	color: #475467;
	font-size: 12px;
	text-transform: uppercase;
}

.sort-button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: auto;
	border: 0;
	border-radius: 0;
	padding: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	font-weight: inherit;
	text-transform: inherit;
}

.sort-button:hover,
.sort-button:focus-visible {
	background: transparent;
	color: var(--text);
}

.sort-button:focus-visible {
	outline: 2px solid rgba(17, 100, 102, 0.22);
	outline-offset: 3px;
}

.sort-icon {
	position: relative;
	width: 8px;
	height: 12px;
	flex: 0 0 auto;
	opacity: 0.55;
}

.sort-icon::before,
.sort-icon::after {
	position: absolute;
	left: 1px;
	content: "";
	border-right: 3px solid transparent;
	border-left: 3px solid transparent;
}

.sort-icon::before {
	top: 1px;
	border-bottom: 4px solid currentColor;
}

.sort-icon::after {
	bottom: 1px;
	border-top: 4px solid currentColor;
}

th[data-sort-direction="asc"] .sort-icon,
th[data-sort-direction="desc"] .sort-icon {
	opacity: 1;
}

th[data-sort-direction="asc"] .sort-icon::after,
th[data-sort-direction="desc"] .sort-icon::before {
	opacity: 0.18;
}

dialog {
	width: min(720px, calc(100% - 32px));
	border: 0;
	border-radius: 8px;
	padding: 0;
	box-shadow: 0 22px 70px rgba(16, 24, 40, 0.24);
}

dialog::backdrop {
	background: rgba(15, 23, 42, 0.42);
}

.dialog-panel {
	padding: 20px;
}

.form-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 14px;
}

@media (max-width: 820px) {
	.topbar {
		padding: 16px;
	}

	main {
		width: calc(100% - 24px);
		margin-top: 16px;
	}

	.grid {
		grid-template-columns: 1fr;
	}

	.form-grid {
		grid-template-columns: 1fr;
	}
}
