/* Parish Manager. Tokens, shell and components follow the Digitális Templom
 * admin (frontend/projects/shared/src/styles), so both admins look alike. */

:root {
	--color-bg: #f5f5f5;
	--color-surface: #fff;
	--color-surface-2: #f7f7f8;
	--color-text: #2c3e50;
	--color-text-muted: #8c97a6;
	--color-border: #e6e8ec;
	--color-border-strong: #b0b7c2;
	--color-row-alt: #f7f8fa;

	/* The Templom admin accent. */
	--color-accent: #2563eb;
	--color-accent-hover: color-mix(in srgb, var(--color-accent) 88%, black);
	--color-accent-soft: color-mix(in srgb, var(--color-accent) 22%, white);
	--color-accent-ring: color-mix(in srgb, var(--color-accent) 18%, transparent);

	--color-danger: #d94c4c;
	--color-danger-strong: color-mix(in srgb, var(--color-danger) 78%, black);
	--color-danger-soft: color-mix(in srgb, var(--color-danger) 12%, transparent);
	--color-success: #4caf50;
	--color-success-strong: color-mix(in srgb, var(--color-success) 72%, black);
	--color-success-soft: color-mix(in srgb, var(--color-success) 16%, transparent);
	--color-warning: #ebb567;
	--color-gray: #8e97a5;
	--color-gray-strong: color-mix(in srgb, var(--color-gray) 70%, black);
	--color-gray-soft: color-mix(in srgb, var(--color-gray) 18%, transparent);
	--color-blue: #4e81bf;

	/* Chart series beside the accent. */
	--color-mem: #a463f2;
	--color-disk: #f59f00;

	--radius: 10px;
	--radius-sm: 6px;
	--radius-pill: 999px;
	--size-btn-height: 33px;

	--shadow-card: 0 4px 18px rgb(40, 50, 70, 0.08);
	--shadow-pop: 0 6px 20px rgb(0, 0, 0, 0.12);
	--shadow-modal: 0 12px 30px rgb(0, 0, 0, 0.16);

	--font-sans: 'Fira Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	--font-heading: 'Fira Sans Condensed', 'Fira Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
		'Helvetica Neue', Arial, sans-serif;
	--font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
	color-scheme: light;
}

[data-theme='dark'] {
	--color-bg: #14181f;
	--color-surface: #1d232c;
	--color-surface-2: #232a35;
	--color-text: #e5e9ef;
	--color-text-muted: #8a94a3;
	--color-border: #2a313c;
	--color-border-strong: #454e5d;
	--color-row-alt: #232a35;
	--color-accent-soft: color-mix(in srgb, var(--color-accent) 18%, transparent);
	--shadow-card: 0 4px 18px rgb(0, 0, 0, 0.35);
	--shadow-pop: 0 6px 20px rgb(0, 0, 0, 0.45);
	--shadow-modal: 0 12px 30px rgb(0, 0, 0, 0.55);
	color-scheme: dark;
}

/* ---------------------------------------------------------------- base */

html, body {
	min-height: 100%;
	padding: 0;
	margin: 0;
	font-family: var(--font-sans);
	font-size: 14px;
	line-height: 1.45;
	color: var(--color-text);
	background: var(--color-bg);
}

* {
	box-sizing: border-box;
}

h1, h2, h3, h4 {
	font-family: var(--font-heading);
	font-weight: 600;
}

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

a:hover {
	text-decoration: underline;
}

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

button {
	cursor: pointer;
}

.mono {
	font-family: var(--font-mono);
	font-size: 12px;
}

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

.error {
	font-size: 13px;
	color: var(--color-danger);
}

.error:empty {
	display: none;
}

.nowrap, .row .mono {
	white-space: nowrap;
}

.empty {
	padding: 60px 24px;
	color: var(--color-text-muted);
	text-align: center;
	background: var(--color-surface);
	border-radius: var(--radius);
	box-shadow: var(--shadow-card);
}

.footnote {
	font-size: 11px;
	color: var(--color-text-muted);
}

/* ---------------------------------------------------------------- shell */

.admin-page {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.admin-header {
	position: sticky;
	top: 0;
	z-index: 30;
	display: flex;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
	padding: 14px 24px;
	color: #fff;
	background: var(--color-accent);
}

.nav-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	font-size: 18px;
	color: inherit;
	background: none;
	border: 0;
	border-radius: 8px;
}

.nav-toggle:hover {
	background: rgb(255, 255, 255, 0.08);
}

.brand {
	display: flex;
	gap: 12px;
	align-items: center;
	min-width: 0;
}

.brand-icon {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	font-size: 18px;
	background: rgb(255, 255, 255, 0.15);
	border-radius: 10px;
}

.brand-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.brand-title {
	font-size: 16px;
	font-weight: 700;
}

.brand-subtitle {
	overflow: hidden;
	text-overflow: ellipsis;
	font-size: 12px;
	color: rgb(255, 255, 255, 0.7);
	white-space: nowrap;
}

.admin-header-actions {
	display: flex;
	gap: 12px;
	align-items: center;
	margin-left: auto;
}

.admin-body {
	display: flex;
	flex: 1;
	min-height: 0;
}

.admin-nav {
	display: flex;
	flex-shrink: 0;
	flex-direction: column;
	width: 220px;
	padding: 18px 0 0;
	background: var(--color-surface);
	border-right: 1px solid var(--color-border);
}

.admin-nav a {
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 12px 22px;
	font-weight: 600;
	color: var(--color-text);
	border-left: 3px solid transparent;
}

.admin-nav a:hover {
	text-decoration: none;
	background: var(--color-row-alt);
}

.admin-nav a.active {
	background: var(--color-accent-soft);
	border-left-color: var(--color-accent);
}

.nav-icon {
	width: 18px;
	color: var(--color-text-muted);
	text-align: center;
}

.admin-nav a.active .nav-icon {
	color: var(--color-accent);
}

.nav-divider {
	width: calc(100% - 44px);
	margin: 10px 22px;
	border: 0;
	border-top: 1px solid var(--color-border);
}

.admin-main {
	flex: 1;
	min-width: 0;
	padding: 24px;
}

.page {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.page-head h1 {
	margin: 0;
	font-size: 22px;
}

/* ---------------------------------------------------------------- user menu */

.user-menu {
	position: relative;
}

.user-trigger {
	display: inline-flex;
	gap: 8px;
	align-items: center;
	padding: 4px 10px 4px 4px;
	color: #fff;
	background: none;
	border: 0;
	border-radius: var(--radius-pill);
}

.user-trigger:hover {
	background: rgb(255, 255, 255, 0.08);
}

.avatar, .dropdown-avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	font-size: 13px;
	background: rgb(255, 255, 255, 0.18);
	border-radius: 50%;
}

.trigger-name {
	font-weight: 600;
}

.trigger-caret {
	font-size: 11px;
	opacity: .8;
}

.dropdown {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	z-index: 40;
	width: 260px;
	padding: 6px;
	color: var(--color-text);
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	box-shadow: var(--shadow-pop);
}

.dropdown-header {
	display: flex;
	gap: 10px;
	align-items: center;
	padding: 10px;
	margin-bottom: 4px;
	border-bottom: 1px solid var(--color-border);
}

.dropdown-avatar {
	color: var(--color-accent);
	background: var(--color-accent-soft);
}

.identity {
	min-width: 0;
}

.identity .name {
	font-weight: 600;
}

.identity .email {
	overflow: hidden;
	text-overflow: ellipsis;
	font-size: 12px;
	color: var(--color-text-muted);
	white-space: nowrap;
}

.dropdown .item {
	display: flex;
	gap: 12px;
	align-items: center;
	width: 100%;
	padding: 9px 10px;
	text-align: left;
	background: none;
	border: 0;
	border-radius: var(--radius-sm);
}

.dropdown .item i {
	width: 16px;
	color: var(--color-text-muted);
	text-align: center;
}

.dropdown .item:hover {
	background: var(--color-row-alt);
}

.dropdown .item.danger, .dropdown .item.danger i {
	color: var(--color-danger);
}

.separator {
	margin: 4px 0;
	border-top: 1px solid var(--color-border);
}

/* ---------------------------------------------------------------- buttons */

.btn {
	display: inline-flex;
	gap: 8px;
	align-items: center;
	justify-content: center;
	height: var(--size-btn-height);
	padding: 0 16px;
	font-size: 14px;
	font-weight: 600;
	color: var(--color-text);
	white-space: nowrap;
	background: transparent;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	transition: background 120ms ease, border-color 120ms ease;
}

.btn:hover {
	text-decoration: none;
	background: var(--color-accent-soft);
	border-color: var(--color-accent-hover);
}

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

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

.btn.danger {
	color: var(--color-danger);
	border-color: var(--color-danger);
}

.btn.danger:hover {
	background: var(--color-danger-soft);
}

.btn.danger-solid {
	color: #fff;
	background: var(--color-danger);
	border-color: var(--color-danger);
}

.btn.danger-solid:hover {
	background: var(--color-danger-strong);
	border-color: var(--color-danger-strong);
}

.btn.small {
	height: auto;
	padding: 5px 12px;
	font-size: 12px;
	font-weight: 700;
	border-radius: var(--radius-pill);
}

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

/* The Templom icon button: a muted glyph that gets a frame on hover. */
.btn.icon {
	width: 30px;
	height: 30px;
	padding: 0;
	color: var(--color-text-muted);
	border-color: transparent;
	border-radius: var(--radius-sm);
}

.btn.icon:hover {
	color: var(--color-text);
	background: var(--color-row-alt);
	border-color: var(--color-border);
}

.btn.icon.danger {
	color: var(--color-danger);
}

.btn.icon.danger:hover {
	background: var(--color-danger-soft);
	border-color: var(--color-danger);
}

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

/* ---------------------------------------------------------------- forms */

label.field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 12px;
	font-weight: 600;
	color: var(--color-text-muted);
}

input.text, textarea.text, select.text {
	width: 100%;
	min-height: var(--size-btn-height);
	padding: 6px 10px;
	font-size: 14px;
	font-weight: 400;
	color: var(--color-text);
	background: var(--color-surface);
	border: 1px solid var(--color-border-strong);
	border-radius: var(--radius-sm);
}

input.text:focus, textarea.text:focus, select.text:focus, .search:focus-within {
	border-color: var(--color-accent);
	outline: 0;
	box-shadow: 0 0 0 3px var(--color-accent-ring);
}

input.inline {
	width: 100%;
	min-width: 120px;
	padding: 3px 6px;
	background: none;
	border: 1px solid transparent;
	border-radius: var(--radius-sm);
}

input.inline:hover, input.inline:focus {
	background: var(--color-surface);
	border-color: var(--color-border-strong);
	outline: 0;
}

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

.form.cols {
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	align-items: end;
}

.check {
	display: inline-flex;
	gap: 8px;
	align-items: center;
	font-size: 13px;
	color: var(--color-text-muted);
	cursor: pointer;
}

.check input {
	accent-color: var(--color-accent);
}

/* ---------------------------------------------------------------- toolbars and filters */

.toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

.toolbar.filters {
	padding: 12px;
	background: var(--color-surface-2);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
}

.toolbar.inner {
	padding-bottom: 12px;
}

.toolbar .grow {
	flex: 1;
}

.search {
	display: flex;
	gap: 8px;
	align-items: center;
	width: min(320px, 100%);
	height: var(--size-btn-height);
	padding: 0 10px;
	color: var(--color-text-muted);
	background: var(--color-surface);
	border: 1px solid var(--color-border-strong);
	border-radius: var(--radius-sm);
}

.search input {
	width: 100%;
	padding: 0;
	font-size: 13px;
	color: var(--color-text);
	background: none;
	border: 0;
	outline: 0;
}

select.text.filter {
	width: auto;
	font-size: 13px;
	cursor: pointer;
}

.check.toggle {
	height: var(--size-btn-height);
	padding: 0 10px;
	background: var(--color-surface);
	border: 1px solid var(--color-border-strong);
	border-radius: var(--radius-sm);
}

.check.toggle.alert {
	color: var(--color-danger);
	border-color: var(--color-danger);
}

.segmented {
	display: inline-flex;
	padding: 2px;
	background: var(--color-surface-2);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
}

.segmented button {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	padding: 5px 12px;
	font-size: 13px;
	font-weight: 600;
	color: var(--color-text-muted);
	background: none;
	border: 0;
	border-radius: 4px;
}

.segmented button.active {
	color: var(--color-text);
	background: var(--color-surface);
	box-shadow: 0 1px 3px rgb(0, 0, 0, 0.12);
}

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

/* ---------------------------------------------------------------- parish cards */

.grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 16px;
}

.card {
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-width: 0;
	padding: 16px 18px 14px;
	cursor: pointer;
	background: var(--color-surface);
	border: 1px solid transparent;
	border-radius: var(--radius);
	box-shadow: var(--shadow-card);
	transition: border-color .15s;
}

.card:hover, .card.selected {
	border-color: var(--color-accent);
}

.card .title {
	display: flex;
	gap: 8px;
	align-items: center;
	min-width: 0;
	font-family: var(--font-heading);
	font-size: 15px;
	font-weight: 600;
}

.card .title span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.card .title .open {
	margin-left: auto;
	font-size: 13px;
	font-weight: 600;
}

.status {
	display: flex;
	flex-wrap: wrap;
	gap: 0 6px;
	align-items: center;
	min-width: 0;
	font-size: 13px;
	color: var(--color-text-muted);
}

.dot {
	flex: none;
	width: 8px;
	height: 8px;
	background: var(--color-danger);
	border-radius: 50%;
}

.dot.on {
	background: var(--color-success);
}

.dot.stale {
	background: var(--color-gray);
}

.row {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 8px;
	align-items: center;
	min-width: 0;
	padding-top: 8px;
	font-size: 13px;
	color: var(--color-text-muted);
	border-top: 1px solid var(--color-border);
}

.rate {
	display: inline-flex;
	gap: 4px;
	align-items: center;
	margin-left: auto;
	font-size: 12px;
	white-space: nowrap;
}

.chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding-top: 8px;
	border-top: 1px solid var(--color-border);
}

/* The Templom chip box, without the uppercase: these hold counts. */
.chip {
	display: inline-flex;
	gap: 5px;
	align-items: center;
	padding: 3px 8px;
	font-size: 11px;
	font-weight: 700;
	color: var(--color-text);
	background: var(--color-row-alt);
	border: 1px solid var(--color-border);
	border-radius: 4px;
}

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

.chip.web {
	color: var(--color-accent-hover);
	background: var(--color-accent-soft);
	border-color: var(--color-accent);
}

.chip.web i {
	color: inherit;
}

.pill {
	padding: 2px 8px;
	white-space: nowrap;
	font-size: 11px;
	font-weight: 700;
	color: var(--color-accent-hover);
	text-transform: uppercase;
	letter-spacing: .5px;
	background: var(--color-accent-soft);
	border: 1px solid var(--color-accent);
	border-radius: 4px;
}

.pill.grey {
	color: var(--color-gray-strong);
	background: var(--color-gray-soft);
	border-color: var(--color-gray);
}

[data-theme='dark'] .chip.web, [data-theme='dark'] .pill {
	color: #9bbcff;
}

[data-theme='dark'] .pill.grey {
	color: var(--color-text-muted);
}

/* Health meters */

.meters {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr auto;
	gap: 12px;
	font-size: 11px;
	color: var(--color-text-muted);
}

.meters.none {
	display: block;
}

.meters.stale {
	opacity: .55;
}

.meter {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.meter-head {
	display: flex;
	gap: 4px;
	justify-content: space-between;
}

.meter .track {
	height: 4px;
	overflow: hidden;
	background: var(--color-border);
	border-radius: 2px;
}

.meter .track i {
	display: block;
	height: 100%;
	background: var(--color-accent);
	border-radius: 2px;
}

.meter .value {
	color: var(--color-text);
	font-variant-numeric: tabular-nums;
}

.meter.high .track i {
	background: var(--color-danger);
}

.meter.high .value, .meter.high .label, .high-text {
	font-weight: 700;
	color: var(--color-danger);
}

/* Uptime bar */

.uptime {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.bar {
	position: relative;
	height: 8px;
	overflow: hidden;
	background: var(--color-border);
	border-radius: 4px;
}

.bar i {
	position: absolute;
	top: 0;
	bottom: 0;
}

.bar i.off {
	background: color-mix(in srgb, var(--color-danger) 40%, transparent);
}

.bar i.on {
	background: var(--color-success);
}

.ticks {
	display: flex;
	justify-content: space-between;
	font-size: 11px;
	color: var(--color-text-muted);
}

/* ---------------------------------------------------------------- tables (Templom table.data) */

.table-wrap {
	overflow-x: auto;
	background: var(--color-surface);
	border-radius: var(--radius);
	box-shadow: var(--shadow-card);
}

table {
	width: 100%;
	font-size: 13.5px;
	border-collapse: collapse;
}

th, td {
	padding: 12px 14px;
	text-align: left;
	vertical-align: middle;
	border-bottom: 1px solid var(--color-border);
}

th {
	font-size: 11px;
	font-weight: 700;
	color: var(--color-text-muted);
	text-transform: uppercase;
	letter-spacing: .5px;
	white-space: nowrap;
	background: var(--color-row-alt);
}

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

tbody tr:hover {
	background: var(--color-row-alt);
}

tr.clickable {
	cursor: pointer;
}

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

.panel table th, .panel table td {
	padding: 9px 10px;
}

.kind {
	position: relative;
	display: inline-flex;
	font-size: 16px;
	color: var(--color-text-muted);
}

.kind.on {
	color: var(--color-text);
}

.kind .dot {
	position: absolute;
	right: -4px;
	bottom: -2px;
	box-sizing: content-box;
	width: 7px;
	height: 7px;
	border: 1.5px solid var(--color-surface);
}

.vendor {
	max-width: 260px;
	padding-left: 7px;
	overflow: hidden;
	text-overflow: ellipsis;
	font-size: 11px;
	color: var(--color-text-muted);
	white-space: nowrap;
}

.port {
	display: inline-flex;
	gap: 4px;
	align-items: center;
	padding: 2px 8px;
	margin: 2px 2px 2px 0;
	font-size: 12px;
	font-weight: 600;
	background: var(--color-surface);
	border: 1px solid var(--color-border-strong);
	border-radius: var(--radius-sm);
}

.port:hover {
	text-decoration: none;
	border-color: var(--color-accent);
}

.port i {
	font-size: 10px;
}

/* ---------------------------------------------------------------- panels, drawer */

.panel {
	padding: 18px 20px;
	background: var(--color-surface);
	border-radius: var(--radius);
	box-shadow: var(--shadow-card);
}

.panel h3 {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin: 0 0 12px;
	font-size: 15px;
}

.panel h3 > i {
	color: var(--color-text-muted);
}

.panel h3 .grow {
	flex: 1;
}

.panel h4 {
	margin: 16px 0 6px;
	font-size: 12px;
	color: var(--color-text-muted);
	text-transform: uppercase;
	letter-spacing: .5px;
}

.facts {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 6px 16px;
	margin: 0;
	font-size: 13px;
}

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

.facts dd {
	min-width: 0;
	margin: 0;
	overflow-wrap: anywhere;
}

.facts.health {
	grid-template-columns: max-content 1fr max-content 1fr;
	margin-bottom: 12px;
}

.drawer-backdrop {
	position: fixed;
	inset: 0;
	z-index: 50;
	background: rgb(20, 28, 40, 0.45);
}

.drawer {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: 51;
	display: flex;
	flex-direction: column;
	width: min(860px, 100vw);
	background: var(--color-bg);
	box-shadow: var(--shadow-modal);
}

.drawer header {
	display: flex;
	gap: 10px;
	align-items: center;
	padding: 14px 20px;
	background: var(--color-surface);
	border-bottom: 1px solid var(--color-border);
}

.drawer header h2 {
	margin: 0 auto 0 0;
	overflow: hidden;
	text-overflow: ellipsis;
	font-size: 18px;
	white-space: nowrap;
}

.drawer .body {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 16px 20px 40px;
	overflow: auto;
}

/* ---------------------------------------------------------------- charts */

svg.chart {
	display: block;
	width: 100%;
	height: auto;
}

.chart .grid-line {
	stroke: var(--color-border);
	stroke-width: 1;
}

.chart .axis {
	font-size: 11px;
	fill: var(--color-text-muted);
}

.chart .threshold {
	stroke: var(--color-danger);
	stroke-dasharray: 4 4;
	stroke-width: 1;
	opacity: .7;
}

.chart .line {
	fill: none;
	stroke-width: 1.8;
}

.chart .rx {
	fill: color-mix(in srgb, var(--color-accent) 30%, transparent);
	stroke: var(--color-accent);
	stroke-width: 1.5;
}

.chart .tx {
	fill: color-mix(in srgb, var(--color-success) 30%, transparent);
	stroke: var(--color-success);
	stroke-width: 1.5;
}

.chart .cpu {
	stroke: var(--color-accent);
}

.chart .mem {
	stroke: var(--color-mem);
}

.chart .disk {
	stroke: var(--color-disk);
}

.legend {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	margin-top: 6px;
	font-size: 12px;
	color: var(--color-text-muted);
}

.legend span {
	display: inline-flex;
	gap: 6px;
	align-items: center;
}

.legend i {
	width: 10px;
	height: 10px;
	border-radius: 2px;
}

.legend i.rx, .legend i.cpu {
	background: var(--color-accent);
}

.legend i.tx {
	background: var(--color-success);
}

.legend i.mem {
	background: var(--color-mem);
}

.legend i.disk {
	background: var(--color-disk);
}

/* ---------------------------------------------------------------- modal, toast */

.modal-backdrop {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgb(20, 28, 40, 0.45);
}

.modal {
	display: grid;
	gap: 14px;
	width: min(440px, 100%);
	padding: 22px 24px;
	background: var(--color-surface);
	border-radius: var(--radius);
	box-shadow: var(--shadow-modal);
}

.modal h3 {
	margin: 0;
	font-size: 17px;
}

.modal .actions {
	justify-content: flex-end;
	padding-top: 4px;
}

.toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	z-index: 1100;
	padding: 10px 16px;
	font-size: 13px;
	font-weight: 600;
	color: #fff;
	background: #2c3e50;
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow-pop);
	transform: translateX(-50%);
}

/* ---------------------------------------------------------------- login */

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

.login .box {
	display: grid;
	gap: 14px;
	width: min(400px, 100%);
	padding: 30px;
	background: var(--color-surface);
	border-radius: var(--radius);
	box-shadow: var(--shadow-card);
}

.login-brand {
	display: flex;
	gap: 12px;
	align-items: center;
	margin-bottom: 6px;
}

.login-brand .brand-icon {
	color: #fff;
	background: var(--color-accent);
}

.login h1 {
	margin: 0;
	font-size: 20px;
}

.login .or {
	display: flex;
	gap: 10px;
	align-items: center;
	font-size: 12px;
	color: var(--color-text-muted);
}

.login .or::before, .login .or::after {
	flex: 1;
	content: "";
	border-top: 1px solid var(--color-border);
}

/* ---------------------------------------------------------------- mobile */

@media (max-width: 720px) {
	.admin-header {
		padding: 10px 12px;
	}

	.nav-toggle {
		display: inline-flex;
	}

	.brand-subtitle, .trigger-name {
		display: none;
	}

	.admin-nav {
		position: fixed;
		top: 62px;
		bottom: 0;
		left: 0;
		z-index: 25;
		box-shadow: var(--shadow-modal);
		transform: translateX(-100%);
		transition: transform .2s ease;
	}

	.admin-nav.mobile-open {
		transform: none;
	}

	.admin-main {
		padding: 16px;
	}

	.page-head h1 {
		font-size: 18px;
	}

	.facts.health {
		grid-template-columns: max-content 1fr;
	}
}
