:root {
	--bg: #f5f7fb;
	--surface: #ffffff;
	--surface-2: #eef4fb;
	--text: #071f3c;
	--muted: #657086;
	--border: #d9e2ef;
	--accent: #0b559f;
	--accent-dark: #062b5f;
	--accent-soft: #e7f1fb;
	--gold: #e6b76b;
	--gold-soft: #fff4df;
	--danger: #b42318;
	--warning: #b76e00;
	--ok: #147a3d;
	--shadow: 0 16px 42px rgba(7, 31, 60, 0.09);
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 15px;
	line-height: 1.5;
}

img {
	display: block;
	height: auto;
	max-width: 100%;
}

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

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

.app-shell {
	display: grid;
	grid-template-columns: 248px minmax(0, 1fr);
	min-height: 100vh;
	width: 100%;
}

.sidebar {
	background: #ffffff;
	border-right: 1px solid var(--border);
	color: var(--text);
	display: flex;
	flex-direction: column;
	padding: 24px 18px;
}

.brand {
	align-items: center;
	display: flex;
	font-size: 21px;
	font-weight: 800;
	gap: 12px;
	margin-bottom: 34px;
}

.brand-mark {
	align-items: center;
	background: #ffffff;
	border: 1px solid #cfdced;
	border-radius: 8px;
	box-shadow: 0 8px 22px rgba(7, 31, 60, 0.12);
	display: inline-flex;
	height: 42px;
	justify-content: center;
	overflow: hidden;
	width: 42px;
}

.brand-mark img {
	display: block;
	height: 42px;
	width: 42px;
}

.nav {
	display: grid;
	gap: 8px;
}

.nav a {
	border-radius: 8px;
	color: #283a55;
	font-weight: 650;
	padding: 11px 12px;
}

.nav a:hover {
	background: var(--accent-soft);
	color: var(--accent-dark);
}

.sidebar-foot {
	align-items: center;
	color: var(--muted);
	display: flex;
	font-size: 13px;
	gap: 8px;
	margin-top: auto;
}

.status-dot {
	background: var(--gold);
	border-radius: 99px;
	height: 8px;
	width: 8px;
}

.main {
	min-width: 0;
	padding: 28px;
}

.topbar {
	align-items: center;
	background: linear-gradient(90deg, #ffffff 0%, #f7fbff 100%);
	border: 1px solid var(--border);
	border-radius: 8px;
	box-shadow: var(--shadow);
	display: flex;
	gap: 20px;
	justify-content: space-between;
	margin-bottom: 22px;
	padding: 18px;
	position: relative;
}

.topbar::before {
	background: var(--gold);
	border-radius: 999px;
	content: "";
	height: 72%;
	left: -1px;
	position: absolute;
	top: 14%;
	width: 4px;
}

.topbar-title {
	align-items: center;
	display: flex;
	gap: 14px;
	min-width: 0;
}

.topbar-mark {
	align-items: center;
	background: #ffffff;
	border: 1px solid #cfdced;
	border-radius: 8px;
	box-shadow: 0 10px 24px rgba(7, 31, 60, 0.12);
	display: inline-flex;
	height: 50px;
	justify-content: center;
	overflow: hidden;
	width: 50px;
}

.topbar-mark img {
	display: block;
	height: 50px;
	width: 50px;
}

.topbar h1 {
	font-size: 28px;
	line-height: 1.1;
	margin: 2px 0 0;
}

.eyeline {
	color: var(--accent);
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0;
	margin: 0;
	text-transform: uppercase;
}

.topbar-actions {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: flex-end;
}

.account,
.muted {
	color: var(--muted);
	font-size: 13px;
}

.messages {
	display: grid;
	gap: 8px;
	margin-bottom: 16px;
}

.message {
	background: #eaf3ff;
	border: 1px solid #c8dcf5;
	border-radius: 8px;
	margin: 0;
	padding: 10px 12px;
}

.message.error {
	background: #fff0ee;
	border-color: #ffd3ce;
}

.metric-grid {
	display: grid;
	gap: 16px;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	margin-bottom: 16px;
}

.split {
	display: grid;
	gap: 16px;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	margin-bottom: 16px;
}

.operator-overview {
	grid-template-columns: minmax(0, 1fr);
}

.operator-overview .operator-users {
	grid-column: 1 / -1;
}

.panel {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 8px;
	box-shadow: var(--shadow);
	min-width: 0;
	overflow-x: auto;
	padding: 18px;
}

.metric-grid .panel {
	border-top: 3px solid var(--accent);
}

.metric-grid .panel:nth-child(3n) {
	border-top-color: var(--gold);
}

.metric-grid .panel:nth-child(4n) {
	background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.wide {
	min-width: 0;
}

.operator-users table {
	min-width: 1500px;
}

.operator-users th,
.operator-users td {
	vertical-align: top;
}

.operator-users th:nth-child(1),
.operator-users td:nth-child(1) {
	min-width: 220px;
	width: 220px;
}

.operator-users th:nth-child(2),
.operator-users td:nth-child(2) {
	min-width: 150px;
	width: 150px;
}

.operator-users th:nth-child(3),
.operator-users td:nth-child(3) {
	min-width: 170px;
	width: 170px;
}

.operator-users th:nth-child(4),
.operator-users td:nth-child(4) {
	min-width: 210px;
	width: 210px;
}

.operator-users th:nth-child(5),
.operator-users .subscription-cell {
	min-width: 560px;
	width: 560px;
}

.operator-users th:nth-child(6),
.operator-users .action-cell {
	min-width: 210px;
	width: 210px;
}

.operator-users .subscription-form {
	display: grid;
	gap: 10px;
	grid-template-columns: repeat(3, minmax(145px, 1fr));
}

.operator-users .subscription-form .button {
	align-self: end;
	justify-self: start;
}

.operator-users .subscription-form textarea {
	min-height: 68px;
}

.operator-users .action-cell .inline-form {
	align-items: end;
	display: grid;
	grid-template-columns: minmax(120px, 1fr) auto;
}

.operator-users .action-cell input {
	grid-column: 1 / -1;
}

.operator-user-list {
	display: grid;
	gap: 14px;
}

.operator-user-card {
	background: #fbfdff;
	border: 1px solid var(--border);
	border-radius: 8px;
	display: grid;
	gap: 14px;
	padding: 14px;
}

.operator-user-summary {
	display: grid;
	gap: 14px;
	grid-template-columns: minmax(190px, 1.2fr) minmax(130px, 0.7fr) minmax(170px, 0.8fr) minmax(220px, 1fr);
}

.operator-user-summary > div,
.operator-user-controls > div {
	min-width: 0;
}

.operator-user-summary strong,
.billing-cell strong {
	color: var(--text);
	display: block;
	font-size: 14px;
	line-height: 1.25;
	margin-bottom: 4px;
	overflow-wrap: anywhere;
}

.operator-user-summary small,
.identity-cell small,
.status-cell small,
.billing-cell small {
	color: var(--muted);
	display: block;
	font-size: 12px;
	overflow-wrap: anywhere;
}

.operator-user-controls {
	border-top: 1px solid var(--border);
	display: grid;
	gap: 14px;
	grid-template-columns: minmax(0, 1fr) minmax(210px, 240px);
	padding-top: 14px;
}

.attention-groups {
	display: grid;
	gap: 18px;
}

.attention-groups h3 {
	font-size: 13px;
	margin: 0 0 8px;
	text-transform: uppercase;
}

.filter-bar {
	align-items: end;
	display: grid;
	gap: 12px;
	grid-template-columns: minmax(220px, 2fr) repeat(4, minmax(140px, 1fr)) auto;
}

.filter-actions,
.pagination,
.profile-actions {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.profile-actions {
	justify-content: flex-end;
}

.search-field {
	min-width: 0;
}

.user-directory-table {
	min-width: 920px;
}

.row-link,
.event-list.compact a {
	color: inherit;
	display: block;
	min-width: 0;
}

.row-link strong,
.row-link small {
	display: block;
	overflow-wrap: anywhere;
}

.event-list.compact li {
	align-items: stretch;
}

.event-list.compact a {
	display: flex;
	gap: 10px;
	justify-content: space-between;
	width: 100%;
}

.event-list.compact span {
	text-align: right;
}

.profile-header {
	align-items: center;
	display: flex;
	gap: 16px;
	justify-content: space-between;
	margin-bottom: 16px;
}

.profile-header h2 {
	font-size: 24px;
	margin: 0 0 4px;
	overflow-wrap: anywhere;
}

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

.profile-subscription-form button {
	align-self: end;
	justify-self: start;
}

.compact-form {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-form p:last-of-type,
.compact-form button,
.profile-subscription-form .form-field:nth-last-child(2) {
	grid-column: 1 / -1;
}

.panel-head.compact {
	margin-bottom: 8px;
}

.panel-head h3 {
	font-size: 14px;
	margin: 0;
}

.panel h2 {
	font-size: 16px;
	margin: 0 0 14px;
}

.panel-head {
	align-items: center;
	display: flex;
	gap: 12px;
	justify-content: space-between;
	margin-bottom: 14px;
}

.panel-head h2 {
	margin: 0;
}

.label {
	color: var(--muted);
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0;
	margin: 0 0 8px;
	text-transform: uppercase;
}

.metric-grid .panel > strong {
	display: block;
	font-size: 24px;
	line-height: 1.1;
	margin-bottom: 6px;
}

.meter {
	background: #e6edf6;
	border-radius: 999px;
	height: 8px;
	overflow: hidden;
}

.meter span {
	background: var(--accent);
	display: block;
	height: 100%;
	width: var(--meter-width, 0);
}

.button {
	align-items: center;
	background: var(--accent);
	border: 1px solid var(--accent);
	border-radius: 8px;
	color: #ffffff;
	cursor: pointer;
	display: inline-flex;
	font-size: 14px;
	font-weight: 750;
	justify-content: center;
	min-height: 38px;
	padding: 8px 13px;
}

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

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

.button.danger {
	background: #fff5f3;
	border-color: #ffd2cc;
	color: var(--danger);
}

.button.small {
	font-size: 13px;
	min-height: 32px;
	padding: 6px 10px;
}

.inline-action {
	color: var(--accent-dark);
	font-size: 13px;
	font-weight: 800;
}

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

th,
td {
	border-bottom: 1px solid var(--border);
	overflow-wrap: normal;
	padding: 11px 10px;
	text-align: left;
	vertical-align: middle;
}

th {
	color: var(--muted);
	font-size: 12px;
	font-weight: 800;
	text-transform: uppercase;
}

td {
	font-size: 14px;
}

td small,
.copy-field {
	overflow-wrap: anywhere;
}

.empty {
	color: var(--muted);
	font-size: 14px;
}

.empty-block {
	align-items: center;
	display: flex;
	min-height: 260px;
}

.chip {
	background: #edf3fa;
	border-radius: 999px;
	color: #4d5b70;
	display: inline-flex;
	font-size: 12px;
	font-weight: 800;
	padding: 4px 8px;
}

.chip.ok,
.chip.online,
.chip.active {
	background: #e5f4ec;
	color: var(--ok);
}

.chip.danger,
.chip.banned,
.chip.offline {
	background: #fff0ee;
	color: var(--danger);
}

.chip.degraded,
.chip.warning,
.chip.suspended,
.chip.maintenance {
	background: var(--gold-soft);
	color: var(--warning);
}

.chip.info {
	background: var(--accent-soft);
	color: var(--accent-dark);
}

.node-list,
.node-card-list,
.diagnostic-list,
.event-list {
	display: grid;
	gap: 10px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.node-list li,
.diagnostic-list li,
.event-list li {
	align-items: center;
	border-bottom: 1px solid var(--border);
	display: flex;
	gap: 12px;
	justify-content: space-between;
	padding: 10px 0;
}

.node-list small,
.diagnostic-list small,
.event-list span {
	color: var(--muted);
	display: block;
	font-size: 12px;
	margin-top: 2px;
}

.node-card-list {
	gap: 12px;
}

.node-card {
	background: #fbfdff;
	border: 1px solid var(--border);
	border-radius: 8px;
	display: grid;
	gap: 12px;
	padding: 12px;
}

.node-card-head {
	align-items: start;
	display: flex;
	gap: 10px;
	justify-content: space-between;
}

.node-card-head strong,
.event-list strong,
.diagnostic-list strong {
	color: var(--text);
	display: block;
	font-size: 14px;
	line-height: 1.25;
	margin-bottom: 2px;
}

.node-facts {
	display: grid;
	gap: 8px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	margin: 0;
}

.node-facts div {
	min-width: 0;
}

.node-facts dt {
	color: var(--muted);
	font-size: 11px;
	font-weight: 800;
	text-transform: uppercase;
}

.node-facts dd {
	font-size: 13px;
	margin: 1px 0 0;
	overflow-wrap: anywhere;
}

.usage-chart {
	align-items: end;
	display: grid;
	gap: 5px;
	min-height: 190px;
}

.daily-chart {
	grid-template-columns: repeat(30, minmax(8px, 1fr));
}

.monthly-chart {
	grid-template-columns: repeat(12, minmax(18px, 1fr));
}

.usage-bar {
	align-items: center;
	display: grid;
	gap: 6px;
	grid-template-rows: 1fr auto;
	height: 190px;
	justify-items: center;
	min-width: 0;
}

.usage-bar span {
	align-self: end;
	background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%);
	border-radius: 6px 6px 2px 2px;
	display: block;
	height: var(--bar-size, 0);
	min-height: 2px;
	width: 100%;
}

.usage-bar small {
	color: var(--muted);
	font-size: 10px;
	line-height: 1;
	overflow: hidden;
	text-align: center;
	text-overflow: clip;
	white-space: nowrap;
	width: 100%;
}

.usage-line {
	display: grid;
	gap: 2px;
	margin-bottom: 8px;
}

.usage-line strong {
	font-size: 14px;
	line-height: 1.2;
}

.usage-line small,
.notice {
	color: var(--muted);
	display: block;
	font-size: 12px;
}

.usage-meter {
	margin-bottom: 6px;
}

.form-field {
	display: grid;
	gap: 5px;
	min-width: 0;
}

.form-field small {
	color: var(--muted);
	font-size: 11px;
	line-height: 1.35;
}

.diagnostic-list li {
	align-items: flex-start;
	justify-content: flex-start;
}

.stack {
	display: grid;
	gap: 12px;
}

.stack p,
.node-form p {
	display: grid;
	gap: 6px;
	margin: 0;
}

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

.node-form button {
	align-self: end;
}

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

.invite-form p:last-of-type,
.invite-form button {
	grid-column: 1 / -1;
}

.table-actions {
	align-items: center;
	display: flex;
	gap: 8px;
}

.copy-field {
	font-size: 12px;
	min-width: 260px;
}

.event-list strong {
	font-size: 14px;
	margin-bottom: 2px;
}

label {
	color: var(--text);
	font-size: 13px;
	font-weight: 750;
}

input,
select,
textarea {
	background: #ffffff;
	border: 1px solid var(--border);
	border-radius: 8px;
	color: var(--text);
	min-height: 38px;
	padding: 8px 10px;
	width: 100%;
}

textarea {
	resize: vertical;
}

.helptext {
	color: var(--muted);
	font-size: 12px;
}

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

.config {
	background: #071f3c;
	border-radius: 8px;
	color: #e5fff8;
	font-family: "SFMono-Regular", Consolas, monospace;
	font-size: 12px;
	line-height: 1.5;
	margin: 0;
	overflow: auto;
	padding: 14px;
	white-space: pre-wrap;
}

.qr-placeholder {
	align-items: center;
	aspect-ratio: 1 / 1;
	background:
		linear-gradient(90deg, #071f3c 12px, transparent 12px) 0 0 / 28px 28px,
		linear-gradient(#071f3c 12px, transparent 12px) 0 0 / 28px 28px,
		#ffffff;
	border: 1px solid var(--border);
	border-radius: 8px;
	color: transparent;
	display: flex;
	justify-content: center;
	margin-bottom: 12px;
	max-width: 180px;
}

.actions,
.inline-form {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.inline-form input,
.inline-form select,
.inline-form textarea {
	flex: 1 1 140px;
	min-width: 0;
}

.inline-form textarea {
	flex-basis: 220px;
	min-height: 38px;
}

.inline-form .button {
	flex: 0 0 auto;
}

.auth-panel {
	display: grid;
	margin: 8vh auto 0;
	max-width: 520px;
}

.prose {
	max-width: 820px;
}

.prose p {
	color: #3f4a60;
	margin: 0 0 14px;
}

.qr-panel {
	max-width: 520px;
}

.qr svg {
	background: #ffffff;
	max-width: 100%;
}

@media (max-width: 980px) {
	.app-shell {
		grid-template-columns: 1fr;
	}

	.sidebar {
		padding: 18px;
		position: static;
	}

	.brand {
		margin-bottom: 18px;
	}

	.nav {
		grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
	}

	.sidebar-foot {
		margin-top: 18px;
	}

	.metric-grid,
	.split,
	.operator-user-summary,
	.operator-user-controls,
	.operator-users .subscription-form,
	.filter-bar,
	.profile-subscription-form,
	.compact-form,
	.node-form {
		grid-template-columns: 1fr;
	}

	.daily-chart {
		grid-template-columns: repeat(15, minmax(10px, 1fr));
	}

	.monthly-chart,
	.node-facts {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 1180px) {
	.operator-overview {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 640px) {
	.main {
		padding: 18px;
	}

	.nav {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.topbar,
	.profile-header,
	.topbar-actions,
	.actions,
	.inline-form {
		align-items: stretch;
		flex-direction: column;
	}

	.profile-actions {
		justify-content: stretch;
	}

	.profile-actions .button {
		width: 100%;
	}

	.topbar-title {
		align-items: center;
	}

	table {
		display: block;
		overflow-x: auto;
	}

	.usage-chart,
	.usage-bar {
		min-height: 150px;
	}

	.usage-bar {
		height: 150px;
	}
}
