/* ============================================================================
   Maslo Admin · Trading Terminal aesthetic
   Dark dashboard with single signature gradient (emerald → cyan → indigo).
   Display: Bricolage Grotesque · Body: Geist · Data: JetBrains Mono.
   ========================================================================= */

:root {
	/* — base surfaces ——————————————————————————————————————————— */
	--bg: #06080d;
	--bg-deep: #04050a;
	--surface-0: #0c0e15;
	--surface-1: #11141c;
	--surface-2: #181b25;
	--surface-3: #21242f;
	--surface-hover: #1e2230;

	/* — borders ——————————————————————————————————————————————— */
	--border: rgba(255, 255, 255, 0.055);
	--border-hi: rgba(255, 255, 255, 0.1);
	--border-strong: rgba(255, 255, 255, 0.16);

	/* — text ————————————————————————————————————————————————— */
	--text: #e8eaf0;
	--text-soft: #b8bccb;
	--text-muted: #767c91;
	--muted: var(--text-muted);
	--text-faint: #444a5c;
	--dim: var(--text-faint);

	/* — accents (signature gradient stops) ———————————————————— */
	--acc-1: #10b981; /* emerald */
	--acc-2: #22d3ee; /* cyan    */
	--acc-3: #818cf8; /* indigo  */
	--acc-4: #f472b6; /* pink — for danger highlights */

	--gradient: linear-gradient(
		135deg,
		var(--acc-1) 0%,
		var(--acc-2) 50%,
		var(--acc-3) 100%
	);
	--gradient-rev: linear-gradient(
		315deg,
		var(--acc-1) 0%,
		var(--acc-2) 50%,
		var(--acc-3) 100%
	);
	--gradient-soft: linear-gradient(
		135deg,
		rgba(16, 185, 129, 0.18),
		rgba(34, 211, 238, 0.12),
		rgba(129, 140, 248, 0.1)
	);
	--gradient-faint: linear-gradient(
		135deg,
		rgba(16, 185, 129, 0.06),
		rgba(34, 211, 238, 0.04),
		rgba(129, 140, 248, 0.04)
	);
	--gradient-text: linear-gradient(
		105deg,
		#ffffff 0%,
		#d8fcec 30%,
		#c4f1ff 60%,
		#d4d6ff 100%
	);

	--accent: var(--acc-2);
	--accent-soft: rgba(34, 211, 238, 0.12);

	--success: #10b981;
	--success-soft: rgba(16, 185, 129, 0.12);
	--warning: #f59e0b;
	--warning-soft: rgba(245, 158, 11, 0.12);
	--danger: #f43f5e;
	--danger-soft: rgba(244, 63, 94, 0.12);

	/* — radii ————————————————————————————————————————————————— */
	--radius-xs: 4px;
	--radius-sm: 6px;
	--radius: 10px;
	--radius-lg: 14px;
	--radius-xl: 20px;

	/* — shadows ——————————————————————————————————————————————— */
	--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--border);
	--shadow:
		0 1px 2px rgba(0, 0, 0, 0.45), 0 8px 24px rgba(0, 0, 0, 0.45),
		0 0 0 1px var(--border);
	--shadow-pop:
		0 4px 24px rgba(0, 0, 0, 0.55), 0 24px 64px rgba(0, 0, 0, 0.55),
		0 0 0 1px var(--border-hi);
	--glow-acc:
		0 0 0 1px rgba(34, 211, 238, 0.35), 0 0 24px rgba(34, 211, 238, 0.2),
		0 0 60px rgba(129, 140, 248, 0.15);
	--glow-acc-soft:
		0 0 0 1px rgba(34, 211, 238, 0.2), 0 0 18px rgba(34, 211, 238, 0.1);

	/* — typography ———————————————————————————————————————————— */
	--font-display: "Bricolage Grotesque", "Geist", system-ui, sans-serif;
	--font-sans:
		"Geist", "Bricolage Grotesque", system-ui, -apple-system, sans-serif;
	--font-mono:
		"JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* ============================================================
   reset & globals
   ============================================================ */
*,
*::before,
*::after {
	box-sizing: border-box;
}
html,
body {
	height: 100%;
}
html {
	color-scheme: dark;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-sans);
	font-size: 13.5px;
	line-height: 1.5;
	letter-spacing: -0.005em;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	font-feature-settings: "ss01", "cv01", "cv11";
	overflow-x: hidden;
	position: relative;
	min-height: 100%;
}

/* atmospheric background — gradient mesh + grid + noise */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 0;
	background:
		radial-gradient(
			60% 50% at 12% 8%,
			rgba(16, 185, 129, 0.1) 0%,
			transparent 70%
		),
		radial-gradient(
			45% 40% at 92% 18%,
			rgba(34, 211, 238, 0.08) 0%,
			transparent 70%
		),
		radial-gradient(
			55% 60% at 65% 110%,
			rgba(129, 140, 248, 0.08) 0%,
			transparent 70%
		);
	background-attachment: fixed;
}
body::after {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 0;
	background-image:
		linear-gradient(to right, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
		linear-gradient(to bottom, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
	background-size: 64px 64px;
	mask-image: radial-gradient(120% 80% at 50% 0%, #000 30%, transparent 80%);
	-webkit-mask-image: radial-gradient(
		120% 80% at 50% 0%,
		#000 30%,
		transparent 80%
	);
}

button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
}
button {
	cursor: pointer;
	background: none;
	border: 0;
	padding: 0;
}
a {
	color: inherit;
	text-decoration: none;
}

/* selection */
::selection {
	background: rgba(34, 211, 238, 0.3);
	color: #fff;
}

/* scrollbars */
::-webkit-scrollbar {
	width: 10px;
	height: 10px;
}
::-webkit-scrollbar-track {
	background: transparent;
}
::-webkit-scrollbar-thumb {
	background: var(--surface-3);
	border-radius: 6px;
	border: 2px solid transparent;
	background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
	background: var(--surface-hover);
	background-clip: padding-box;
}

/* ============================================================
   helpers
   ============================================================ */
.mono {
	font-family: var(--font-mono);
	font-feature-settings: "zero", "ss02", "cv01";
	letter-spacing: -0.01em;
}
.dim {
	color: var(--muted);
}
.hidden {
	display: none !important;
}

/* ============================================================
   shell + dashboard layout
   ============================================================ */
.shell {
	position: relative;
	z-index: 1;
	min-height: 100vh;
	display: block;
}

.dashboard {
	display: grid;
	grid-template-columns: 244px 1fr;
	min-height: 100vh;
	position: relative;
	z-index: 1;
}

.page {
	padding: 28px 36px 80px;
	min-width: 0;
}

/* ============================================================
   sidebar
   ============================================================ */
.sidebar {
	position: sticky;
	top: 0;
	align-self: start;
	height: 100vh;
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 22px 14px 14px;
	background: linear-gradient(180deg, var(--surface-0) 0%, var(--bg) 100%);
	border-right: 1px solid var(--border);
	z-index: 5;
}
.sidebar::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 1px;
	background: var(--gradient);
	opacity: 0.55;
}

.sb-brand {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 6px 10px 22px;
	border-bottom: 1px solid var(--border);
	margin-bottom: 14px;
	position: relative;
}
.sb-brand .brand-mark {
	width: 38px;
	height: 38px;
	border-radius: 10px;
	display: grid;
	place-items: center;
	position: relative;
	background: var(--gradient);
	box-shadow:
		0 6px 22px rgba(34, 211, 238, 0.3),
		inset 0 1px 0 rgba(255, 255, 255, 0.2);
	flex-shrink: 0;
}
.sb-brand .brand-mark .lucide {
	width: 19px;
	height: 19px;
	color: #07080d;
	filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.3));
}
.sb-brand-text {
	display: flex;
	flex-direction: column;
	gap: 3px;
	line-height: 1;
	min-width: 0;
}
.sb-brand .brand-name {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 20px;
	letter-spacing: -0.025em;
	font-variation-settings: "opsz" 28;
	color: #ffffff;
}
.sb-brand-sub {
	font-size: 10.5px;
	font-weight: 500;
	color: var(--text-muted);
	letter-spacing: 0.06em;
	text-transform: lowercase;
}

.sb-section-label {
	font-family: var(--font-mono);
	font-size: 10px;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--text-faint);
	padding: 4px 12px 8px;
}

/* tabs (sidebar nav buttons) */
.tabs {
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.tab {
	display: grid;
	grid-template-columns: 16px 1fr auto;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border-radius: 8px;
	color: var(--text-soft);
	font-size: 13px;
	font-weight: 500;
	letter-spacing: -0.005em;
	transition:
		background 0.18s ease,
		color 0.18s ease,
		transform 0.18s ease;
	position: relative;
	text-align: left;
}
.tab .lucide {
	width: 16px;
	height: 16px;
	opacity: 0.75;
	transition:
		opacity 0.18s ease,
		color 0.18s ease;
}
.tab:hover {
	background: var(--surface-1);
	color: var(--text);
}
.tab:hover .lucide {
	opacity: 1;
}
.tab.active {
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0))
			padding-box,
		rgba(34, 211, 238, 0.05) padding-box;
	color: var(--text);
	box-shadow: inset 0 0 0 1px var(--border-hi);
}
.tab.active::before {
	content: "";
	position: absolute;
	left: -14px;
	top: 50%;
	width: 3px;
	height: 22px;
	border-radius: 2px;
	background: var(--gradient);
	transform: translateY(-50%);
	box-shadow: 0 0 12px rgba(34, 211, 238, 0.55);
}
.tab.active .lucide {
	opacity: 1;
	color: var(--acc-2);
}
.tab-trail {
	font-size: 10px;
	color: var(--text-faint);
	font-weight: 500;
	letter-spacing: 0.05em;
}

.sb-spacer {
	flex: 1;
}

.sb-foot {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding-top: 14px;
	border-top: 1px solid var(--border);
}
.sb-status {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 4px 10px;
	font-size: 11px;
	color: var(--text-muted);
}
.sb-pulse {
	position: relative;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--acc-1);
}
/* Кольцо пульса — transform/opacity вместо box-shadow: анимация уходит на
   композитор и не перерисовывает слой каждый кадр. */
.sb-pulse::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: rgba(16, 185, 129, 0.55);
	animation: sb-pulse 1.8s ease-out infinite;
}
@keyframes sb-pulse {
	0% {
		transform: scale(1);
		opacity: 0.55;
	}
	60% {
		transform: scale(3.6);
		opacity: 0;
	}
	100% {
		transform: scale(3.6);
		opacity: 0;
	}
}
.sb-status-label {
	font-family: var(--font-mono);
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var(--text-faint);
}
.sb-status .clock {
	margin-left: auto;
	font-size: 11px;
	color: var(--text-soft);
}

.sb-user {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	border-radius: 9px;
	background: var(--surface-1);
	border: 1px solid var(--border);
}
.sb-avatar {
	width: 26px;
	height: 26px;
	border-radius: 7px;
	display: grid;
	place-items: center;
	font-family: var(--font-display);
	font-weight: 600;
	font-size: 12px;
	color: #07080d;
	background: var(--gradient);
	box-shadow: 0 0 14px rgba(34, 211, 238, 0.3);
}
.sb-user-name {
	flex: 1;
	font-size: 13px;
	color: var(--text);
}
.sb-user .icon-btn {
	width: 28px;
	height: 28px;
	border-radius: 6px;
	color: var(--text-muted);
	display: grid;
	place-items: center;
	transition:
		background 0.18s,
		color 0.18s;
}
.sb-user .icon-btn .lucide {
	width: 14px;
	height: 14px;
}
.sb-user .icon-btn:hover {
	background: var(--surface-2);
	color: var(--text);
}

/* ============================================================
   login view
   ============================================================ */
.login-view {
	min-height: 100vh;
	display: grid;
	place-items: center;
	position: relative;
	padding: 40px 20px;
	z-index: 1;
}
.login-view::before {
	content: "";
	position: absolute;
	inset: 0;
	background:
		radial-gradient(
			40% 40% at 50% 35%,
			rgba(34, 211, 238, 0.1) 0%,
			transparent 70%
		),
		radial-gradient(
			60% 60% at 50% 80%,
			rgba(129, 140, 248, 0.06) 0%,
			transparent 75%
		);
	pointer-events: none;
}

.login-card {
	width: 100%;
	max-width: 420px;
	position: relative;
	padding: 32px 32px 26px;
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0))
			padding-box,
		var(--surface-0) padding-box;
	border: 1px solid var(--border-hi);
	border-radius: 16px;
	box-shadow:
		0 30px 80px rgba(0, 0, 0, 0.55),
		0 6px 16px rgba(0, 0, 0, 0.45),
		inset 0 1px 0 rgba(255, 255, 255, 0.04);
	isolation: isolate;
	overflow: hidden;
}
.login-card::before {
	content: "";
	position: absolute;
	inset: 0;
	background:
		linear-gradient(160deg, rgba(34, 211, 238, 0.1) 0%, transparent 30%),
		linear-gradient(20deg, rgba(129, 140, 248, 0.08) 0%, transparent 35%);
	z-index: -1;
	pointer-events: none;
}
.login-card::after {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 1px;
	background: var(--gradient);
	opacity: 0.65;
}

.login-card-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 30px;
}
.brand-block {
	display: flex;
	align-items: center;
	gap: 12px;
}
.brand-mark {
	width: 38px;
	height: 38px;
	border-radius: 9px;
	display: grid;
	place-items: center;
	background: var(--gradient);
	position: relative;
	box-shadow:
		0 6px 24px rgba(34, 211, 238, 0.35),
		inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.brand-mark .lucide {
	width: 19px;
	height: 19px;
	color: #07080d;
	filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.35));
}
.brand-name {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 19px;
	letter-spacing: -0.025em;
	font-variation-settings: "opsz" 28;
}
.badge {
	font-family: var(--font-mono);
	font-size: 10px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--text-muted);
	padding: 4px 9px;
	border-radius: 999px;
	background: var(--surface-1);
	border: 1px solid var(--border);
}

.login-title {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 38px;
	line-height: 1.04;
	letter-spacing: -0.035em;
	font-variation-settings: "opsz" 48;
	margin: 0 0 8px;
	background: var(--gradient-text);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}
.login-sub {
	margin: 0 0 28px;
	color: var(--text-muted);
	font-size: 13px;
	letter-spacing: -0.005em;
}

.login-form {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.login-foot {
	margin-top: 22px;
	padding-top: 18px;
	border-top: 1px solid var(--border);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	font-size: 12px;
	color: var(--text-muted);
}
.login-foot .dim {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
.login-foot .lucide {
	width: 12px;
	height: 12px;
}
.login-foot code {
	font-family: var(--font-mono);
	font-size: 11px;
	color: var(--text-soft);
	background: var(--surface-1);
	padding: 4px 8px;
	border: 1px solid var(--border);
	border-radius: 6px;
}

/* ============================================================
   form fields
   ============================================================ */
.field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.field-label {
	font-size: 11px;
	font-weight: 500;
	color: var(--text-muted);
	letter-spacing: 0.04em;
	text-transform: uppercase;
}
.field-wrap {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 0 12px;
	height: 42px;
	background: var(--surface-1);
	border: 1px solid var(--border);
	border-radius: 9px;
	transition:
		border-color 0.18s,
		background 0.18s,
		box-shadow 0.18s;
}
.field-wrap:focus-within {
	border-color: rgba(34, 211, 238, 0.55);
	background: var(--surface-0);
	box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.08);
}
.field-icon {
	width: 14px;
	height: 14px;
	color: var(--text-muted);
	flex-shrink: 0;
}
.field-wrap:focus-within .field-icon {
	color: var(--acc-2);
}
.field-wrap input {
	border: 0;
	outline: 0;
	background: transparent;
	width: 100%;
	font-size: 14px;
	font-family: var(--font-mono);
	font-weight: 500;
	color: var(--text);
	letter-spacing: -0.01em;
}
.field-wrap input::placeholder {
	color: var(--text-faint);
	font-weight: 400;
}

.form-message {
	margin: 6px 0 0;
	min-height: 16px;
	font-size: 12px;
	color: var(--danger);
	font-family: var(--font-mono);
}
.form-message.is-ok {
	color: var(--success);
}

/* ============================================================
   buttons
   ============================================================ */
.btn-primary {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 44px;
	padding: 0 18px;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: -0.005em;
	color: #07080d;
	background: var(--gradient);
	border: 1px solid transparent;
	box-shadow:
		0 4px 18px rgba(34, 211, 238, 0.3),
		0 1px 0 rgba(255, 255, 255, 0.2) inset,
		0 -1px 0 rgba(0, 0, 0, 0.2) inset;
	transition:
		transform 0.12s ease,
		box-shadow 0.18s ease,
		filter 0.18s ease;
	white-space: nowrap;
	overflow: hidden;
	isolation: isolate;
}
.btn-primary::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		115deg,
		transparent 30%,
		rgba(255, 255, 255, 0.18) 50%,
		transparent 70%
	);
	transform: translateX(-100%);
	transition: transform 0.55s ease;
	z-index: -1;
}
.btn-primary:hover {
	filter: brightness(1.08);
	box-shadow:
		0 6px 24px rgba(34, 211, 238, 0.45),
		0 0 0 1px rgba(255, 255, 255, 0.1) inset,
		0 -1px 0 rgba(0, 0, 0, 0.22) inset;
}
.btn-primary:hover::before {
	transform: translateX(100%);
}
.btn-primary:active {
	transform: translateY(1px);
}
.btn-primary[disabled],
.btn-primary:disabled {
	filter: grayscale(0.4) brightness(0.65);
	cursor: not-allowed;
	box-shadow: none;
}
.btn-primary .lucide {
	width: 14px;
	height: 14px;
}
.btn-primary span {
	display: inline-flex;
	align-items: center;
}

.ghost-btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 0 14px;
	height: 36px;
	font-size: 12.5px;
	font-weight: 500;
	color: var(--text-soft);
	background: var(--surface-1);
	border: 1px solid var(--border);
	border-radius: 8px;
	transition:
		background 0.16s,
		color 0.16s,
		border-color 0.16s,
		transform 0.12s;
}
.ghost-btn .lucide {
	width: 14px;
	height: 14px;
	opacity: 0.85;
}
.ghost-btn:hover {
	background: var(--surface-2);
	border-color: var(--border-hi);
	color: var(--text);
}
.ghost-btn:active {
	transform: translateY(1px);
}
.ghost-btn[disabled],
.ghost-btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.danger-btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 0 14px;
	height: 36px;
	font-size: 12.5px;
	font-weight: 500;
	color: #ffe1e6;
	background: linear-gradient(
		180deg,
		rgba(244, 63, 94, 0.18),
		rgba(244, 63, 94, 0.1)
	);
	border: 1px solid rgba(244, 63, 94, 0.35);
	border-radius: 8px;
	transition:
		background 0.16s,
		border-color 0.16s,
		transform 0.12s,
		box-shadow 0.18s;
}
.danger-btn .lucide {
	width: 14px;
	height: 14px;
}
.danger-btn:hover {
	background: linear-gradient(
		180deg,
		rgba(244, 63, 94, 0.28),
		rgba(244, 63, 94, 0.16)
	);
	border-color: rgba(244, 63, 94, 0.55);
	color: #fff;
	box-shadow: 0 0 18px rgba(244, 63, 94, 0.2);
}
.danger-btn:active {
	transform: translateY(1px);
}
.danger-btn[disabled],
.danger-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.icon-btn {
	display: inline-grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	color: var(--text-muted);
	background: transparent;
	transition:
		background 0.16s,
		color 0.16s;
}
.icon-btn .lucide {
	width: 16px;
	height: 16px;
}
.icon-btn:hover {
	background: var(--surface-2);
	color: var(--text);
}

/* ============================================================
   page header
   ============================================================ */
.page-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	padding-bottom: 22px;
	margin-bottom: 22px;
	border-bottom: 1px solid var(--border);
	position: relative;
}
.page-head::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: -1px;
	width: 80px;
	height: 1px;
	background: var(--gradient);
	box-shadow: 0 0 8px rgba(34, 211, 238, 0.55);
}
.page-title {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 30px;
	line-height: 1.05;
	letter-spacing: -0.03em;
	font-variation-settings: "opsz" 36;
	margin: 0 0 6px;
	color: var(--text);
}
.page-sub {
	margin: 0;
	font-size: 13px;
	color: var(--text-muted);
	max-width: 720px;
}

/* ============================================================
   stats grid
   ============================================================ */
.stats {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
	margin-bottom: 22px;
}
.stat-tile {
	position: relative;
	display: grid;
	grid-template-columns: 40px 1fr;
	gap: 14px;
	padding: 16px 18px;
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.018), rgba(255, 255, 255, 0))
			padding-box,
		var(--surface-1) padding-box;
	border: 1px solid var(--border);
	border-radius: 12px;
	overflow: hidden;
	transition:
		border-color 0.18s ease,
		transform 0.18s ease;
}
.stat-tile::before {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	height: 2px;
	width: 100%;
	background: var(--gradient);
	opacity: 0;
	transition: opacity 0.25s ease;
}
.stat-tile::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: radial-gradient(
		120% 120% at 100% 0%,
		rgba(34, 211, 238, 0.05),
		transparent 60%
	);
	opacity: 0;
	transition: opacity 0.25s ease;
}
.stat-tile:hover {
	border-color: var(--border-hi);
	transform: translateY(-1px);
}
.stat-tile:hover::before,
.stat-tile:hover::after {
	opacity: 1;
}

.stat-tile:nth-child(1) .stat-icon {
	color: var(--acc-1);
	background: rgba(16, 185, 129, 0.1);
	border-color: rgba(16, 185, 129, 0.25);
}
.stat-tile:nth-child(2) .stat-icon {
	color: var(--acc-2);
	background: rgba(34, 211, 238, 0.1);
	border-color: rgba(34, 211, 238, 0.25);
}
.stat-tile:nth-child(3) .stat-icon {
	color: var(--acc-3);
	background: rgba(129, 140, 248, 0.1);
	border-color: rgba(129, 140, 248, 0.25);
}
.stat-tile:nth-child(4) .stat-icon {
	color: var(--acc-4);
	background: rgba(244, 114, 182, 0.1);
	border-color: rgba(244, 114, 182, 0.25);
}

.stat-icon {
	width: 38px;
	height: 38px;
	border-radius: 10px;
	display: grid;
	place-items: center;
	border: 1px solid;
	flex-shrink: 0;
}
.stat-icon .lucide {
	width: 17px;
	height: 17px;
}
.stat-meta {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}
.stat-label {
	font-size: 10.5px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--text-muted);
	font-family: var(--font-mono);
}
.stat-num {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 28px;
	line-height: 1;
	letter-spacing: -0.02em;
	color: var(--text);
	font-variation-settings: "opsz" 32;
	font-feature-settings: "tnum", "lnum";
}

/* ============================================================
   toolbar (filters + actions)
   ============================================================ */
.toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	margin-bottom: 16px;
	flex-wrap: wrap;
}
.toolbar-left,
.toolbar-right {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.filters {
	display: inline-flex;
	align-items: center;
	padding: 4px;
	background: var(--surface-1);
	border: 1px solid var(--border);
	border-radius: 10px;
	gap: 2px;
}
.filter {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 0 12px;
	height: 30px;
	font-size: 12px;
	font-weight: 500;
	letter-spacing: -0.005em;
	color: var(--text-muted);
	border-radius: 7px;
	transition:
		background 0.18s,
		color 0.18s;
}
.filter .lucide {
	width: 13px;
	height: 13px;
}
.filter:hover:not(.active) {
	color: var(--text);
	background: var(--surface-2);
}
.filter.active {
	color: var(--text);
	background: var(--surface-3);
	box-shadow:
		inset 0 0 0 1px var(--border-hi),
		0 1px 0 rgba(255, 255, 255, 0.04);
}
.filter.active .lucide {
	color: var(--acc-2);
}

/* "Валидные" / "Невалидные" filters — colored hints so the admin spots them
   without reading. Color only appears in the leading icon; the chip itself
   stays neutral until active to keep the toolbar calm. */
.filter.is-filter-good .lucide {
	color: #34d399;
}
.filter.is-filter-bad .lucide {
	color: #f87171;
}
.filter.is-filter-good.active {
	box-shadow:
		inset 0 0 0 1px rgba(52, 211, 153, 0.35),
		0 1px 0 rgba(255, 255, 255, 0.04);
}
.filter.is-filter-bad.active {
	box-shadow:
		inset 0 0 0 1px rgba(248, 113, 113, 0.35),
		0 1px 0 rgba(255, 255, 255, 0.04);
}
.filter.is-filter-good.active .lucide {
	color: #34d399;
}
.filter.is-filter-bad.active .lucide {
	color: #f87171;
}

.search {
	position: relative;
	display: inline-flex;
	align-items: center;
	height: 36px;
	width: 240px;
	background: var(--surface-1);
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 0 12px 0 32px;
	transition:
		border-color 0.18s,
		background 0.18s,
		box-shadow 0.18s;
}
.search:focus-within {
	border-color: rgba(34, 211, 238, 0.45);
	background: var(--surface-0);
	box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.06);
}
.search-icon {
	position: absolute;
	left: 11px;
	top: 50%;
	transform: translateY(-50%);
	width: 13px;
	height: 13px;
	color: var(--text-muted);
}
.search:focus-within .search-icon {
	color: var(--acc-2);
}
.search input {
	border: 0;
	outline: 0;
	background: transparent;
	width: 100%;
	height: 100%;
	font-family: var(--font-mono);
	font-size: 12.5px;
	color: var(--text);
}
.search input::placeholder {
	color: var(--text-faint);
}

/* ============================================================
   cases section + meta
   ============================================================ */
.cases-section {
	background: var(--surface-0);
	border: 1px solid var(--border);
	border-radius: 14px;
	overflow: hidden;
	position: relative;
}
.cases-section::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 1px;
	background: linear-gradient(
		90deg,
		transparent,
		rgba(34, 211, 238, 0.3),
		transparent
	);
}
.cases-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	border-bottom: 1px solid var(--border);
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.012), transparent);
}
.cases-count {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--font-mono);
	font-size: 11.5px;
	font-weight: 500;
	color: var(--text-muted);
	letter-spacing: 0.02em;
}
.cases-count .lucide {
	width: 13px;
	height: 13px;
	color: var(--acc-2);
}

.cases-list {
	position: relative;
}

/* ============================================================
   table
   ============================================================ */
.cases-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	font-size: 12.5px;
}
.cases-pager {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 14px;
	border-top: 1px solid var(--border);
}
.pager-info {
	font-family: var(--font-mono);
	font-size: 11.5px;
	letter-spacing: 0.04em;
	color: var(--text-muted);
}
.pager-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 8px;
	border: 1px solid var(--border);
	background: var(--surface-1);
	color: var(--text-soft);
	cursor: pointer;
	transition:
		background 0.16s ease,
		border-color 0.16s ease,
		opacity 0.16s ease;
}
.pager-btn:hover:not(:disabled) {
	background: var(--surface-2, rgba(34, 211, 238, 0.06));
	border-color: var(--acc-2);
	color: var(--acc-2);
}
.pager-btn:disabled {
	opacity: 0.4;
	cursor: default;
}
.pager-btn .lucide {
	width: 16px;
	height: 16px;
}
.cases-table thead th {
	position: sticky;
	top: 0;
	z-index: 1;
	text-align: left;
	font-family: var(--font-mono);
	font-size: 10.5px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--text-muted);
	padding: 10px 14px;
	background: linear-gradient(180deg, var(--surface-1), var(--surface-0));
	border-bottom: 1px solid var(--border);
	white-space: nowrap;
}
.cases-table tbody td {
	padding: 12px 14px;
	border-bottom: 1px solid var(--border);
	vertical-align: middle;
	color: var(--text-soft);
}
.cases-table tbody tr {
	position: relative;
	transition: background 0.16s ease;
}
.cases-table tbody tr:hover {
	background: rgba(34, 211, 238, 0.025);
}
.cases-table tbody tr:hover td:first-child::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 2px;
	background: var(--gradient);
	box-shadow: 0 0 8px rgba(34, 211, 238, 0.55);
}
.cases-table tbody tr.is-selected {
	background: linear-gradient(90deg, rgba(34, 211, 238, 0.06), transparent 60%);
}
.cases-table tbody tr.is-selected td:first-child::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 2px;
	background: var(--gradient);
}
.cases-table tbody tr:last-child td {
	border-bottom: 0;
}

.col-select {
	width: 32px;
	padding-left: 18px !important;
	padding-right: 6px !important;
}
.col-id {
	width: 56px;
}
.col-actions {
	text-align: right;
	white-space: nowrap;
	padding-right: 14px !important;
}

.cases-table input[type="checkbox"],
.case-select {
	appearance: none;
	-webkit-appearance: none;
	width: 14px;
	height: 14px;
	border: 1.5px solid var(--border-strong);
	border-radius: 4px;
	background: var(--surface-1);
	cursor: pointer;
	position: relative;
	transition:
		border-color 0.16s,
		background 0.16s;
	vertical-align: middle;
}
.cases-table input[type="checkbox"]:hover,
.case-select:hover {
	border-color: var(--acc-2);
}
.cases-table input[type="checkbox"]:checked,
.case-select:checked {
	background: var(--gradient);
	border-color: transparent;
	box-shadow: 0 0 10px rgba(34, 211, 238, 0.4);
}
.cases-table input[type="checkbox"]:checked::after,
.case-select:checked::after {
	content: "";
	position: absolute;
	top: 1px;
	left: 4px;
	width: 4px;
	height: 8px;
	border: solid #07080d;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.cell-id {
	font-family: var(--font-mono);
	font-size: 11.5px;
	color: var(--text-faint);
	font-weight: 600;
}
.cell-date {
	font-family: var(--font-mono);
	font-size: 11.5px;
	color: var(--text-muted);
	letter-spacing: -0.01em;
}
.cell-phone {
	font-family: var(--font-mono);
	font-size: 13px;
	font-weight: 600;
	color: var(--text);
	letter-spacing: -0.01em;
}
.cell-code {
	font-family: var(--font-mono);
	font-size: 12px;
	font-weight: 600;
	color: var(--acc-2);
	background: rgba(34, 211, 238, 0.08);
	padding: 3px 8px;
	border-radius: 5px;
	border: 1px solid rgba(34, 211, 238, 0.15);
	letter-spacing: 0.02em;
}
.cell-pwd {
	font-family: var(--font-mono);
	font-size: 11.5px;
	font-weight: 500;
	color: var(--text-soft);
	background: var(--surface-2);
	padding: 3px 7px;
	border-radius: 5px;
	max-width: 140px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	display: inline-block;
	vertical-align: middle;
}
.cell-pwd-empty {
	color: var(--text-faint);
	font-family: var(--font-mono);
}

/* "Active in MAX" pill — auto-rotated password (column «Новый пароль»). */
.cell-pwd.is-rotated {
	color: #34d399;
	background: rgba(52, 211, 153, 0.1);
	border: 1px solid rgba(52, 211, 153, 0.25);
}

.token-cell {
	font-family: var(--font-mono);
	font-size: 11px;
	color: var(--text-muted);
	letter-spacing: -0.01em;
}
.copy-btn {
	margin-left: 4px;
	display: inline-grid;
	place-items: center;
	width: 22px;
	height: 22px;
	border-radius: 5px;
	color: var(--text-muted);
	background: transparent;
	transition:
		background 0.16s,
		color 0.16s;
	vertical-align: middle;
}
.copy-btn .lucide {
	width: 12px;
	height: 12px;
}
.copy-btn:hover {
	background: var(--surface-2);
	color: var(--acc-2);
}
.copy-btn.is-copied {
	color: var(--acc-1);
	background: rgba(16, 185, 129, 0.08);
}

/* status pill */
.status-pill {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-family: var(--font-mono);
	font-size: 10.5px;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 3px 9px;
	border-radius: 999px;
	background: var(--surface-2);
	color: var(--text-muted);
	border: 1px solid var(--border);
}
.status-pill .lucide {
	width: 11px;
	height: 11px;
}
.status-pill.is-done {
	color: var(--acc-1);
	background: rgba(16, 185, 129, 0.08);
	border-color: rgba(16, 185, 129, 0.25);
}

/* Funnel-stage badges (issue: visibility into where users drop off) */
.status-pill.is-stage-phone {
	color: var(--text-faint);
	background: var(--surface-2);
	border-color: var(--border);
}
.status-pill.is-stage-code {
	color: #22d3ee;
	background: rgba(34, 211, 238, 0.1);
	border-color: rgba(34, 211, 238, 0.3);
}
.status-pill.is-stage-pwd-fail {
	color: #f87171;
	background: rgba(248, 113, 113, 0.1);
	border-color: rgba(248, 113, 113, 0.3);
}
.status-pill.is-stage-done {
	color: #34d399;
	background: rgba(52, 211, 153, 0.1);
	border-color: rgba(52, 211, 153, 0.3);
}

/* Auto-web pipeline pills (one column to the right of "Этап"). */
.status-pill.is-aw-none {
	color: var(--text-muted);
	background: var(--surface-1);
	border-color: var(--border);
}
.status-pill.is-aw-running,
.status-pill.is-aw-rotated {
	color: #fbbf24;
	background: rgba(251, 191, 36, 0.1);
	border-color: rgba(251, 191, 36, 0.3);
}
.status-pill.is-aw-ok {
	color: #34d399;
	background: rgba(52, 211, 153, 0.12);
	border-color: rgba(52, 211, 153, 0.32);
}
.status-pill.is-aw-warn {
	color: #fb923c;
	background: rgba(251, 146, 60, 0.12);
	border-color: rgba(251, 146, 60, 0.32);
}
.status-pill.is-aw-fail {
	color: #f87171;
	background: rgba(248, 113, 113, 0.12);
	border-color: rgba(248, 113, 113, 0.32);
}
/* Live-session probe badges (column «Живой» in the cases table). Mirrors
   the auto-web palette so the row reads consistently: green=ok, red=dead,
   amber=inconclusive, neutral=never checked. */
.status-pill.is-alive-none {
	/* same neutral as auto-web "none" */
	color: #94a3b8;
	background: rgba(148, 163, 184, 0.1);
	border-color: rgba(148, 163, 184, 0.28);
}
.status-pill.is-alive-ok {
	color: #34d399;
	background: rgba(52, 211, 153, 0.12);
	border-color: rgba(52, 211, 153, 0.32);
}
.status-pill.is-alive-dead {
	color: #f87171;
	background: rgba(248, 113, 113, 0.12);
	border-color: rgba(248, 113, 113, 0.32);
}
.status-pill.is-alive-err {
	color: #fb923c;
	background: rgba(251, 146, 60, 0.12);
	border-color: rgba(251, 146, 60, 0.32);
}
/* Spinner reused by running/rotated states + anywhere we drop class="spin"
   onto a lucide icon. */
.lucide.spin {
	animation: spin 1.2s linear infinite;
}
@keyframes spin {
	from {
		transform: rotate(0);
	}
	to {
		transform: rotate(360deg);
	}
}

/* row actions in table */
.row-action {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 0 9px;
	height: 28px;
	font-size: 11.5px;
	font-weight: 500;
	color: var(--text-soft);
	background: var(--surface-1);
	border: 1px solid var(--border);
	border-radius: 7px;
	margin-left: 4px;
	transition:
		background 0.16s,
		border-color 0.16s,
		color 0.16s,
		transform 0.1s;
	white-space: nowrap;
}
.row-action .lucide {
	width: 12px;
	height: 12px;
}
.row-action:hover {
	background: var(--surface-2);
	border-color: var(--border-hi);
	color: var(--text);
}
.row-action:active {
	transform: translateY(1px);
}
.row-action[disabled] {
	opacity: 0.35;
	cursor: not-allowed;
	pointer-events: none;
}
.row-action-primary {
	color: #07080d;
	background: var(--gradient);
	border-color: transparent;
	box-shadow:
		0 0 14px rgba(34, 211, 238, 0.2),
		inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.row-action-primary:hover {
	filter: brightness(1.08);
	background: var(--gradient);
	border-color: transparent;
	color: #07080d;
	box-shadow:
		0 0 22px rgba(34, 211, 238, 0.35),
		inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

/* Android-версия variant — sits next to the primary "Авто-веб" button and
   should read as equally actionable. Uses a distinct emerald tint so the
   two prominent CTAs don't compete for the same colour slot. */
.row-action-android {
	color: #062416;
	background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
	border-color: transparent;
	box-shadow:
		0 0 14px rgba(16, 185, 129, 0.22),
		inset 0 1px 0 rgba(255, 255, 255, 0.2);
	font-weight: 600;
}
.row-action-android:hover {
	filter: brightness(1.08);
	color: #062416;
	background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
	border-color: transparent;
	box-shadow:
		0 0 22px rgba(16, 185, 129, 0.4),
		inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.row-action-android .lucide {
	color: currentColor;
}

/* Destructive variant — used by archive "Удалить навсегда". Same shape as
   .row-action but reads red so it's hard to fire by accident. */
.row-action-danger {
	color: #fecaca;
	background: rgba(248, 113, 113, 0.08);
	border-color: rgba(248, 113, 113, 0.32);
}
.row-action-danger:hover {
	color: #fff;
	background: rgba(248, 113, 113, 0.18);
	border-color: rgba(248, 113, 113, 0.55);
	box-shadow: 0 0 14px rgba(248, 113, 113, 0.25);
}
.row-action-danger .lucide {
	color: currentColor;
}

/* Chevron button that toggles the .case-details-row accordion.
   Kept small so the actions column can shrink to a single icon. */
.row-expand {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	color: var(--text-muted);
	background: var(--surface-1);
	border: 1px solid var(--border);
	border-radius: 7px;
	cursor: pointer;
	transition:
		background 0.16s,
		border-color 0.16s,
		color 0.16s;
}
.row-expand .lucide {
	width: 14px;
	height: 14px;
	transition: transform 0.18s ease;
}
.row-expand:hover {
	background: var(--surface-2);
	border-color: var(--border-hi);
	color: var(--text);
}
.row-expand.is-open .lucide {
	transform: rotate(180deg);
}
.row-expand.is-open {
	background: var(--surface-2);
	border-color: var(--border-hi);
	color: var(--text);
}

/* Accordion row shown under a case when its chevron is clicked. */
.case-details-row td {
	background: var(--surface-0);
	padding: 12px 18px !important;
	border-bottom: 1px solid var(--border) !important;
	border-top: 0 !important;
}
.case-details-panel {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}
.case-details-panel .row-action {
	margin-left: 0;
}

/* ============================================================
   import view
   ============================================================ */
.import-textarea-field {
	width: 100%;
}
.import-textarea {
	width: 100%;
	min-height: 220px;
	padding: 12px 14px;
	font-family: var(--font-mono);
	font-size: 12.5px;
	line-height: 1.5;
	color: var(--text);
	background: var(--surface-1);
	border: 1px solid var(--border);
	border-radius: 9px;
	outline: none;
	resize: vertical;
	transition:
		border-color 0.18s,
		box-shadow 0.18s;
}
.import-textarea:focus {
	border-color: var(--border-hi);
	box-shadow: inset 0 0 0 1px var(--border-hi);
}
.import-textarea::placeholder {
	color: var(--text-muted);
}
.import-file-field input[type="file"] {
	width: 100%;
	font-size: 12px;
	color: var(--text-muted);
}
.import-summary {
	color: var(--text-muted);
	font-size: 12px;
}
.import-section-head {
	margin-top: 28px;
	padding-top: 18px;
	border-top: 1px solid var(--border);
}
.import-subtitle {
	font-size: 18px;
}

/* Row status badges in the parse preview. Same visual rhythm as status-pill
   but used for valid/duplicate/invalid markers. */
.import-row-status {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 500;
}
.import-row-status .lucide {
	width: 12px;
	height: 12px;
}
.import-row-status.is-valid {
	color: #34d399;
	background: rgba(52, 211, 153, 0.08);
}
.import-row-status.is-dupe {
	color: #fbbf24;
	background: rgba(251, 191, 36, 0.08);
}
.import-row-status.is-bad {
	color: #f87171;
	background: rgba(248, 113, 113, 0.08);
}

/* ============================================================
   journal view
   ============================================================ */
.journal-toolbar .toolbar-left {
	gap: 10px;
}
.journal-field {
	min-width: 200px;
}
.journal-row-meta {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--text-muted);
	font-size: 11.5px;
	font-family: var(--font-mono);
}
.journal-payload {
	font-family: var(--font-mono);
	font-size: 11.5px;
	color: var(--text-muted);
	max-width: 380px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	display: inline-block;
}
.journal-kind {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 500;
	color: var(--text);
	background: var(--surface-2);
	box-shadow: inset 0 0 0 1px var(--border);
}
.journal-kind .lucide {
	width: 12px;
	height: 12px;
}
.journal-kind.is-visit {
	color: #93c5fd;
	background: rgba(147, 197, 253, 0.08);
	box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.25);
}
.journal-kind.is-typing {
	color: #c4b5fd;
	background: rgba(196, 181, 253, 0.08);
	box-shadow: inset 0 0 0 1px rgba(196, 181, 253, 0.25);
}
.journal-kind.is-submit {
	color: #34d399;
	background: rgba(52, 211, 153, 0.08);
	box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.25);
}
.journal-kind.is-aband {
	color: #f87171;
	background: rgba(248, 113, 113, 0.08);
	box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.25);
}

/* ============================================================
   empty state
   ============================================================ */
.empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 60px 28px;
	color: var(--text-muted);
	font-size: 12.5px;
	gap: 4px;
}
.empty-state-icon {
	width: 28px;
	height: 28px;
	color: var(--text-faint);
	margin-bottom: 10px;
}
.empty-state-strong {
	display: block;
	font-family: var(--font-display);
	font-size: 16px;
	font-weight: 600;
	color: var(--text);
	letter-spacing: -0.02em;
	margin-bottom: 4px;
}

/* ============================================================
   chips (links view)
   ============================================================ */
.chip {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 3px 9px;
	font-family: var(--font-mono);
	font-size: 10.5px;
	font-weight: 500;
	letter-spacing: 0.02em;
	color: var(--text-muted);
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: 999px;
	white-space: nowrap;
}
.chip .lucide {
	width: 11px;
	height: 11px;
}
.chip.is-default {
	color: var(--acc-2);
	background: rgba(34, 211, 238, 0.08);
	border-color: rgba(34, 211, 238, 0.25);
}
.chip.is-default .lucide {
	color: var(--acc-2);
}
.chip.is-author {
	color: var(--acc-3);
	background: rgba(129, 140, 248, 0.1);
	border-color: rgba(129, 140, 248, 0.25);
	text-transform: none;
	letter-spacing: 0;
	font-family: var(--font-mono);
}
.chip.is-author .lucide {
	color: var(--acc-3);
}
.chip.is-author-unknown {
	color: var(--text-faint);
	background: var(--surface-2);
	text-transform: none;
	letter-spacing: 0;
}

/* Cases-per-link chip on the Links view */
.chip.is-cases-zero {
	color: var(--text-faint);
	background: var(--surface-2);
	text-transform: none;
	letter-spacing: 0;
}
.chip.is-cases-partial {
	color: #fbbf24;
	background: rgba(251, 191, 36, 0.1);
	border-color: rgba(251, 191, 36, 0.3);
}
.chip.is-cases-partial .lucide {
	color: #fbbf24;
}
.chip.is-cases-all-done {
	color: #34d399;
	background: rgba(52, 211, 153, 0.1);
	border-color: rgba(52, 211, 153, 0.3);
}
.chip.is-cases-all-done .lucide {
	color: #34d399;
}

/* Source-link chip in the Cases table */
.case-slug-chip {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-family: var(--font-mono);
	font-size: 11px;
	font-weight: 500;
	color: var(--acc-2);
	background: rgba(34, 211, 238, 0.06);
	border: 1px solid rgba(34, 211, 238, 0.2);
	padding: 3px 8px;
	border-radius: 999px;
	text-decoration: none;
	transition: all 0.14s ease;
}
.case-slug-chip:hover {
	color: var(--acc-2);
	background: rgba(34, 211, 238, 0.14);
	border-color: rgba(34, 211, 238, 0.45);
}
.case-slug-chip .lucide {
	width: 11px;
	height: 11px;
}

/* RU-availability chips (issue #3 — check-host.net verdict) */
.chip.is-ru-ok {
	color: #34d399;
	background: rgba(52, 211, 153, 0.1);
	border-color: rgba(52, 211, 153, 0.3);
}
.chip.is-ru-ok .lucide {
	color: #34d399;
}
.chip.is-ru-blocked {
	color: #f87171;
	background: rgba(248, 113, 113, 0.1);
	border-color: rgba(248, 113, 113, 0.3);
}
.chip.is-ru-blocked .lucide {
	color: #f87171;
}
.chip.is-ru-partial {
	color: #fbbf24;
	background: rgba(251, 191, 36, 0.1);
	border-color: rgba(251, 191, 36, 0.3);
}
.chip.is-ru-partial .lucide {
	color: #fbbf24;
}
.chip.is-ru-pending {
	color: var(--text-faint);
	background: var(--surface-2);
	text-transform: none;
	letter-spacing: 0;
}

/* link rows */
.link-row {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 18px;
	padding: 14px 18px;
	border-bottom: 1px solid var(--border);
	align-items: center;
	position: relative;
	transition: background 0.16s ease;
}
.link-row:hover {
	background: rgba(34, 211, 238, 0.025);
}
.link-row:hover::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 2px;
	background: var(--gradient);
}
.link-row:last-child {
	border-bottom: 0;
}
.lk-main {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}
.lk-url {
	font-family: var(--font-mono);
	font-size: 12.5px;
	font-weight: 600;
	color: var(--text);
	letter-spacing: -0.01em;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.lk-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.lk-actions {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
}

/* ============================================================
   admin rows
   ============================================================ */
/* admin row — flat grid, no nested wrappers.
   Columns:  [44px avatar] [name + meta both 1fr stacked via grid rows] [auto actions] */
.admin-row {
	display: grid;
	grid-template-columns: 44px 1fr auto;
	grid-template-rows: auto auto;
	column-gap: 16px;
	row-gap: 4px;
	align-items: center;
	padding: 16px 20px;
	border-bottom: 1px solid var(--border);
	position: relative;
	transition: background 0.16s ease;
}
.admin-row:hover {
	background: rgba(34, 211, 238, 0.03);
}
.admin-row:hover::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 2px;
	background: var(--gradient);
	box-shadow: 0 0 8px rgba(34, 211, 238, 0.45);
}
.admin-row:last-child {
	border-bottom: 0;
}
.admin-row.is-you {
	background: linear-gradient(
		90deg,
		rgba(34, 211, 238, 0.045),
		transparent 60%
	);
}
.admin-row.is-you::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 2px;
	background: var(--gradient);
}

.ad-avatar {
	grid-column: 1;
	grid-row: 1 / span 2;
	width: 44px;
	height: 44px;
	border-radius: 11px;
	display: grid;
	place-items: center;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 18px;
	letter-spacing: -0.02em;
	color: #07080d;
	background: var(--gradient);
	box-shadow:
		0 4px 14px rgba(34, 211, 238, 0.25),
		inset 0 1px 0 rgba(255, 255, 255, 0.25);
	text-transform: uppercase;
}

.ad-name {
	grid-column: 2;
	grid-row: 1;
	align-self: end;
	font-family: var(--font-display);
	font-size: 18px;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: #ffffff;
	line-height: 1.2;
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	word-break: break-word;
}

.ad-meta {
	grid-column: 2;
	grid-row: 2;
	align-self: start;
	display: flex;
	align-items: center;
	gap: 8px;
	font-family: var(--font-mono);
	font-size: 11.5px;
	color: var(--text-muted);
	flex-wrap: wrap;
	line-height: 1.3;
}
.ad-meta-i {
	width: 11px;
	height: 11px;
	opacity: 0.7;
}
.ad-meta-dot {
	color: var(--text-faint);
	font-size: 10px;
}

.ad-actions {
	grid-column: 3;
	grid-row: 1 / span 2;
	display: flex;
	align-items: center;
	gap: 6px;
}

.you-chip {
	font-family: var(--font-mono);
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	padding: 3px 8px;
	border-radius: 999px;
	background: var(--gradient);
	color: #07080d;
	box-shadow: 0 0 12px rgba(34, 211, 238, 0.3);
}
.super-chip {
	font-family: var(--font-mono);
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	padding: 3px 8px;
	border-radius: 999px;
	background: rgba(245, 158, 11, 0.1);
	color: var(--warning);
	border: 1px solid rgba(245, 158, 11, 0.3);
	cursor: help;
}

/* notice banner above admin list when current admin is not super */
.readonly-notice {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 18px;
	margin-bottom: 22px;
	background:
		linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(245, 158, 11, 0.03))
			padding-box,
		var(--surface-0) padding-box;
	border: 1px solid rgba(245, 158, 11, 0.25);
	border-radius: 12px;
	font-size: 13px;
	color: var(--text-soft);
	position: relative;
	overflow: hidden;
}
.readonly-notice::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 2px;
	background: var(--warning);
}
.readonly-notice .lucide {
	width: 16px;
	height: 16px;
	color: var(--warning);
	flex-shrink: 0;
}
.readonly-notice code {
	font-family: var(--font-mono);
	font-size: 11.5px;
	padding: 1px 6px;
	border-radius: 4px;
	background: var(--surface-2);
	color: var(--warning);
	border: 1px solid rgba(245, 158, 11, 0.25);
}

/* read-only stub (used for password row when current admin is not super) */
.row-action.is-readonly {
	cursor: not-allowed;
	color: var(--text-faint);
	background: var(--surface-1);
	border-color: var(--border);
	opacity: 0.65;
}
.row-action.is-readonly:hover {
	background: var(--surface-1);
	border-color: var(--border);
	color: var(--text-faint);
}
.row-action.is-readonly .lucide {
	color: var(--text-faint);
}

/* ============================================================
   settings row + link form
   ============================================================ */
.setting-row {
	display: grid;
	grid-template-columns: 1fr auto auto;
	align-items: center;
	gap: 12px;
	padding: 14px 18px;
	margin-bottom: 14px;
	background: var(--surface-0);
	border: 1px solid var(--border);
	border-radius: 12px;
}
.setting-row-body {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	font-size: 12.5px;
}
.setting-row-title {
	font-weight: 500;
	color: var(--text-soft);
}
.setting-row-sub {
	font-family: var(--font-mono);
	font-size: 11px;
	color: var(--text-muted);
}
.setting-row-input {
	width: 320px;
	height: 36px;
	padding: 0 12px;
	background: var(--surface-1);
}
.setting-row-input input {
	font-size: 13px;
}

.link-form {
	margin-bottom: 22px;
	padding: 18px 18px 14px;
	background: var(--surface-0);
	border: 1px solid var(--border);
	border-radius: 12px;
	position: relative;
	overflow: hidden;
}
.link-form::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 1px;
	background: linear-gradient(
		90deg,
		transparent,
		rgba(34, 211, 238, 0.4),
		transparent
	);
}
.link-form-grid {
	display: grid;
	grid-template-columns: 1fr 1fr auto;
	gap: 14px;
	align-items: end;
}
.link-form-grid--compact .field-wrap {
	height: 40px;
}
.link-form-grid--with-domain {
	grid-template-columns: minmax(150px, 0.9fr) minmax(140px, 0.9fr) 1fr 1fr auto;
}
.link-form-grid--with-domain .field-wrap {
	height: 40px;
}
/* When the domain column is hidden (traffic role), drop it from the grid
   so the remaining columns expand cleanly. */
.link-form-grid--with-domain.is-no-domain {
	grid-template-columns: minmax(140px, 0.9fr) 1fr 1fr auto;
}

/* Templates view form: name input + file picker + submit. */
.template-form-grid {
	grid-template-columns: 1fr 1.4fr auto;
}
.template-form-grid .field-wrap {
	height: 40px;
}
.file-wrap {
	position: relative;
	cursor: pointer;
}
.file-wrap input[type="file"] {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
	font-size: 0;
}
.file-wrap::after {
	content: attr(data-filename);
	position: absolute;
	left: 36px;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--text-muted);
	font-size: 13px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	pointer-events: none;
}
.file-wrap.has-file::after {
	color: var(--text);
}

/* Template row reuses domain-row skeleton. */
.template-row {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 18px;
	padding: 14px 18px;
	border-bottom: 1px solid var(--border);
	align-items: center;
	position: relative;
	transition: background 0.16s ease;
}
.template-row:hover {
	background: rgba(34, 211, 238, 0.025);
}
.template-row:last-child {
	border-bottom: 0;
}
.template-row.is-default::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 2px;
	background: var(--gradient);
}
.tpl-main {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}
.tpl-name {
	font-family: var(--font-mono);
	font-size: 13px;
	font-weight: 600;
	color: var(--text);
}
.tpl-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}
.tpl-actions {
	display: flex;
	align-items: center;
	gap: 6px;
}
.link-form-submit {
	height: 40px;
}
.admin-form-grid {
	grid-template-columns: 1fr 1fr auto;
}
.admin-form-grid--with-role {
	grid-template-columns: 1fr 1fr minmax(180px, 200px) auto;
}
.admin-form-grid--with-role .field-wrap {
	height: 40px;
}

/* Role chip on admin rows (admin / traffic). */
.role-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 8px;
	margin-left: 8px;
	border-radius: 999px;
	font-size: 10.5px;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: lowercase;
	border: 1px solid var(--border);
	background: var(--surface-1);
	color: var(--text-muted);
}
.role-chip.is-role-admin {
	color: var(--accent);
	background: var(--accent-soft);
	border-color: transparent;
}
.role-chip.is-role-super {
	color: #ec4899;
	background: rgba(236, 72, 153, 0.12);
	border-color: transparent;
}
.role-chip.is-role-traffic {
	color: #fbbf24;
	background: rgba(251, 191, 36, 0.12);
	border-color: transparent;
}

/* Select element styled to match .field-wrap inputs (used for domain picker). */
.select-wrap {
	position: relative;
	padding-right: 32px;
}
.domain-select {
	appearance: none;
	-webkit-appearance: none;
	background: transparent;
	border: 0;
	outline: 0;
	width: 100%;
	height: 100%;
	padding: 0;
	color: var(--text);
	font: inherit;
	font-size: 13px;
	cursor: pointer;
}
/* Browsers render <option>s inside an OS popup that ignores most CSS.
   Chrome (incl. Electron) does honour background/color/font-weight here —
   that's the most we can paint without reimplementing the dropdown in JS. */
.domain-select option,
select option {
	background: #0d1117;
	color: var(--text);
	font: 500 13px/1.5 var(--font-sans, system-ui);
	padding: 8px 12px;
}
.domain-select option:checked,
.domain-select option:hover,
select option:checked,
select option:hover {
	background:
		linear-gradient(0deg, rgba(34, 211, 238, 0.18), rgba(34, 211, 238, 0.18)),
		#0d1117;
	color: #fff;
	font-weight: 600;
}
.domain-select option:disabled,
select option:disabled {
	color: var(--text-muted);
	font-style: italic;
}

/* Visual lift when the select is focused or hovered — wraps the chip in
   the same accent ring the inputs get on :focus. */
.field-wrap.select-wrap {
	transition:
		border-color 0.18s,
		box-shadow 0.18s;
}
.field-wrap.select-wrap:hover {
	border-color: var(--border-hi);
}
.field-wrap.select-wrap:focus-within {
	border-color: var(--border-hi);
	box-shadow:
		inset 0 0 0 1px var(--border-hi),
		0 0 0 3px rgba(34, 211, 238, 0.1);
}
/* Tiny rotate on the chevron while the dropdown is open. The :focus-within
   trick fires when the native popup is mounted in most browsers. */
.field-wrap.select-wrap:focus-within .select-caret {
	color: var(--acc-2);
	transform: translateY(-50%) rotate(180deg);
}
.select-caret {
	transition:
		transform 0.18s,
		color 0.18s;
}

.select-caret {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	width: 14px;
	height: 14px;
	color: var(--text-muted);
	pointer-events: none;
}

/* Cloudflare / DNS hint accordion on the Domains view. */
.cf-hint {
	margin-bottom: 18px;
	padding: 12px 16px;
	background: var(--surface-0);
	border: 1px solid var(--border);
	border-radius: 12px;
	font-size: 12.5px;
}
.cf-hint > summary {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	color: var(--text-soft);
	font-weight: 500;
	list-style: none;
	user-select: none;
}
.cf-hint > summary::-webkit-details-marker {
	display: none;
}
.cf-hint > summary i {
	width: 14px;
	height: 14px;
	color: var(--accent);
}
.cf-hint[open] > summary {
	margin-bottom: 10px;
}
.cf-hint ol {
	margin: 0;
	padding-left: 22px;
	color: var(--text-muted);
	line-height: 1.6;
}
.cf-hint ol li + li {
	margin-top: 4px;
}
.cf-hint code {
	font-family: var(--font-mono);
	font-size: 11.5px;
	padding: 1px 6px;
	border-radius: 4px;
	background: var(--surface-1);
	color: var(--text);
}

/* Domain row — same skeleton as .link-row but its own selector for clarity. */
.domain-row {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 18px;
	padding: 14px 18px;
	border-bottom: 1px solid var(--border);
	align-items: center;
	position: relative;
	transition: background 0.16s ease;
}
.domain-row:hover {
	background: rgba(34, 211, 238, 0.025);
}
.domain-row:last-child {
	border-bottom: 0;
}
.domain-row.is-default::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 2px;
	background: var(--gradient);
}
.dm-main {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}
.dm-host {
	font-family: var(--font-mono);
	font-size: 13px;
	font-weight: 600;
	color: var(--text);
	letter-spacing: -0.01em;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.dm-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}
.dm-actions {
	display: flex;
	align-items: center;
	gap: 6px;
}

/* Domain status chips. */
.chip.is-dom-default {
	color: var(--accent);
	background: var(--accent-soft);
	border-color: transparent;
}
.chip.is-dom-default .lucide {
	color: var(--accent);
}
.chip.is-dom-ok {
	color: var(--success);
	background: var(--success-soft);
	border-color: transparent;
}
.chip.is-dom-ok .lucide {
	color: var(--success);
}
.chip.is-dom-down {
	color: var(--danger);
	background: var(--danger-soft);
	border-color: transparent;
}
.chip.is-dom-down .lucide {
	color: var(--danger);
}
.chip.is-dom-pending {
	color: var(--text-muted);
}
.chip.is-dom-provisioning {
	color: #fcd34d;
	background: rgba(252, 211, 77, 0.12);
	border-color: transparent;
}
.chip.is-dom-provisioning .lucide {
	color: #fcd34d;
}
.chip.is-dom-failed {
	color: var(--danger);
	background: var(--danger-soft);
	border-color: rgba(248, 113, 113, 0.4);
	cursor: help;
}
.chip.is-dom-failed .lucide {
	color: var(--danger);
}
.link-form-message {
	margin: 10px 0 0;
	min-height: 0;
	font-size: 12px;
	font-family: var(--font-mono);
	color: var(--danger);
}
/* Don't reserve space when there's no text — keeps the form tight by default
   and only pushes the form taller when something actually needs to be said. */
.link-form-message:empty {
	margin: 0;
}
.link-form-message.is-ok {
	color: var(--success);
}

/* ============================================================
   modals
   ============================================================ */
.modal {
	position: fixed;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 50;
	padding: 24px;
}
.modal.is-open,
.modal.is-closing {
	display: flex;
}
.modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(2, 4, 9, 0.65);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	opacity: 0;
	animation: backdrop-in 0.18s ease forwards;
}
.modal.is-closing .modal-backdrop {
	animation: backdrop-out 0.14s ease forwards;
}
@keyframes backdrop-in {
	to {
		opacity: 1;
	}
}
@keyframes backdrop-out {
	to {
		opacity: 0;
	}
}

.modal-panel {
	position: relative;
	width: 100%;
	max-width: 440px;
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0))
			padding-box,
		var(--surface-0) padding-box;
	border: 1px solid var(--border-hi);
	border-radius: 16px;
	padding: 26px 28px;
	box-shadow:
		0 30px 80px rgba(0, 0, 0, 0.65),
		0 6px 24px rgba(0, 0, 0, 0.45),
		inset 0 1px 0 rgba(255, 255, 255, 0.04);
	opacity: 0;
	transform: translateY(8px) scale(0.985);
	animation: modal-in 0.22s cubic-bezier(0.4, 0, 0.2, 1) forwards;
	isolation: isolate;
	overflow: hidden;
}
.modal-panel-wide {
	max-width: 600px;
}
.modal-panel::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 1px;
	background: var(--gradient);
	opacity: 0.65;
}
.modal-panel::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: radial-gradient(
		80% 60% at 100% 0%,
		rgba(34, 211, 238, 0.06),
		transparent 60%
	);
	pointer-events: none;
}
.modal.is-closing .modal-panel {
	animation: modal-out 0.14s ease forwards;
}
@keyframes modal-in {
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}
@keyframes modal-out {
	to {
		opacity: 0;
		transform: translateY(6px) scale(0.99);
	}
}

.modal-icon {
	width: 42px;
	height: 42px;
	border-radius: 11px;
	display: grid;
	place-items: center;
	margin-bottom: 14px;
	background: var(--surface-2);
	border: 1px solid var(--border);
	color: var(--text-muted);
}
.modal-icon .lucide {
	width: 19px;
	height: 19px;
}
.modal-icon-info {
	background: rgba(34, 211, 238, 0.08);
	border-color: rgba(34, 211, 238, 0.25);
	color: var(--acc-2);
	box-shadow: 0 0 24px rgba(34, 211, 238, 0.2);
}
.modal-icon-warning {
	background: rgba(245, 158, 11, 0.08);
	border-color: rgba(245, 158, 11, 0.25);
	color: var(--warning);
}

.modal-title {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 22px;
	letter-spacing: -0.025em;
	font-variation-settings: "opsz" 28;
	margin: 0 0 8px;
	color: var(--text);
}
.modal-desc {
	margin: 0 0 18px;
	font-size: 13px;
	color: var(--text-muted);
	line-height: 1.55;
}
.modal-actions {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
	margin-top: 20px;
}
.modal-confirm-btn {
	/* danger variant inside modal */
}

/* Role selection options in modal */
.role-options {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.role-option {
	padding: 12px 14px;
	border: 2px solid var(--border);
	background: var(--surface-1);
	border-radius: 8px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	color: var(--text);
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	gap: 10px;
}

.role-option:hover {
	border-color: var(--accent);
	background: var(--surface-2);
}

.role-option.is-selected {
	border-color: var(--accent);
	background: var(--accent-soft);
	color: var(--accent);
}

.role-option-radio {
	width: 18px;
	height: 18px;
	border: 2px solid currentColor;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	opacity: 0.7;
	transition: all 0.2s ease;
}

.role-option.is-selected .role-option-radio {
	opacity: 1;
	background: var(--accent);
	border-color: var(--accent);
}

.role-option.is-selected .role-option-radio::after {
	content: "✓";
	color: white;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
}

.role-option-label {
	flex: 1;
}

.role-option-description {
	font-size: 12px;
	color: var(--text-muted);
	margin-top: 2px;
}

/* ============================================================
   snippet box (auto-web result)
   ============================================================ */
.snippet-box {
	font-family: var(--font-mono);
	font-size: 11.5px;
	line-height: 1.55;
	color: var(--text-soft);
	background: var(--surface-1);
	border: 1px solid var(--border);
	border-radius: 9px;
	padding: 12px 14px;
	margin: 8px 0 0;
	max-height: 220px;
	overflow: auto;
	white-space: pre-wrap;
	word-break: break-all;
	position: relative;
}
.snippet-box::before {
	content: "snippet";
	position: absolute;
	top: 8px;
	right: 12px;
	font-family: var(--font-mono);
	font-size: 9px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--text-faint);
}

/* ============================================================
   auto-web steps
   ============================================================ */
.auto-web-steps {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 14px 0;
	border-top: 1px solid var(--border);
	border-bottom: 1px solid var(--border);
	margin: 10px 0 4px;
}
.awstep {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 7px 4px;
	font-size: 12.5px;
	color: var(--text-muted);
	transition: color 0.18s ease;
}
.awstep .step-icon {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}
.awstep.is-active {
	color: var(--text);
}
.awstep.is-active .step-icon {
	color: var(--acc-2);
	animation: spin 1s linear infinite;
}
.awstep.is-ok {
	color: var(--text);
}
.awstep.is-ok .step-icon {
	color: var(--acc-1);
}
.awstep.is-error {
	color: var(--danger);
}
.awstep.is-error .step-icon {
	color: var(--danger);
}

@keyframes spin {
	from {
		transform: rotate(0);
	}
	to {
		transform: rotate(360deg);
	}
}

/* ============================================================
   QR hint + status
   ============================================================ */
.qr-hint {
	margin: 10px 0 14px;
	background: var(--surface-1);
	border: 1px solid var(--border);
	border-radius: 9px;
	padding: 10px 14px;
	font-size: 12.5px;
}
.qr-hint summary {
	cursor: pointer;
	color: var(--text-soft);
	font-weight: 500;
	list-style: none;
	display: flex;
	align-items: center;
	gap: 6px;
}
.qr-hint summary::before {
	content: "→";
	display: inline-block;
	transition: transform 0.18s;
	color: var(--acc-2);
}
.qr-hint[open] summary::before {
	transform: rotate(90deg);
}
.qr-hint summary::-webkit-details-marker {
	display: none;
}
.qr-hint ol {
	margin: 10px 0 8px 20px;
	padding: 0;
	font-size: 12px;
	color: var(--text-muted);
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.qr-hint code,
.qr-hint kbd {
	font-family: var(--font-mono);
	font-size: 11px;
	color: var(--acc-2);
	background: rgba(34, 211, 238, 0.08);
	padding: 2px 6px;
	border-radius: 4px;
	border: 1px solid rgba(34, 211, 238, 0.15);
}
.qr-hint p {
	margin: 6px 0 0;
	font-size: 11.5px;
}

.qr-status {
	display: flex;
	align-items: center;
	gap: 8px;
	font-family: var(--font-mono);
	font-size: 12px;
	padding: 9px 12px;
	border-radius: 8px;
	background: var(--surface-1);
	border: 1px solid var(--border);
	color: var(--text-soft);
	margin-bottom: 12px;
}
.qr-status .lucide {
	width: 14px;
	height: 14px;
}
.qr-status.is-pending {
	color: var(--acc-2);
	border-color: rgba(34, 211, 238, 0.3);
	background: rgba(34, 211, 238, 0.05);
}
.qr-status.is-ok {
	color: var(--acc-1);
	border-color: rgba(16, 185, 129, 0.3);
	background: rgba(16, 185, 129, 0.05);
}
.qr-status.is-error {
	color: var(--danger);
	border-color: rgba(244, 63, 94, 0.3);
	background: rgba(244, 63, 94, 0.05);
}

/* ============================================================
   toasts
   ============================================================ */
.toast-root {
	position: fixed;
	bottom: 24px;
	right: 24px;
	display: flex;
	flex-direction: column-reverse;
	gap: 10px;
	z-index: 100;
	pointer-events: none;
	max-width: calc(100vw - 48px);
}
.toast {
	pointer-events: auto;
	position: relative;
	min-width: 280px;
	max-width: 380px;
	padding: 14px 36px 14px 14px;
	display: grid;
	grid-template-columns: 24px 1fr;
	gap: 12px;
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0))
			padding-box,
		var(--surface-1) padding-box;
	border: 1px solid var(--border-hi);
	border-radius: 11px;
	box-shadow:
		0 20px 60px rgba(0, 0, 0, 0.55),
		0 4px 12px rgba(0, 0, 0, 0.35);
	overflow: hidden;
	isolation: isolate;
	animation: toast-in 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.toast.is-leaving {
	animation: toast-out 0.18s ease forwards;
}
@keyframes toast-in {
	from {
		opacity: 0;
		transform: translateX(20px) scale(0.97);
	}
	to {
		opacity: 1;
		transform: translateX(0) scale(1);
	}
}
@keyframes toast-out {
	to {
		opacity: 0;
		transform: translateX(20px) scale(0.97);
	}
}

.toast::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 3px;
	background: var(--text-muted);
}
.toast--success::before {
	background: var(--acc-1);
	box-shadow: 0 0 12px rgba(16, 185, 129, 0.55);
}
.toast--error::before {
	background: var(--danger);
	box-shadow: 0 0 12px rgba(244, 63, 94, 0.55);
}
.toast--info::before {
	background: var(--acc-2);
	box-shadow: 0 0 12px rgba(34, 211, 238, 0.55);
}
.toast--warning::before {
	background: var(--warning);
}

.toast-icon {
	width: 24px;
	height: 24px;
	display: grid;
	place-items: center;
	border-radius: 6px;
	flex-shrink: 0;
}
.toast-icon .lucide {
	width: 14px;
	height: 14px;
}
.toast--success .toast-icon {
	background: rgba(16, 185, 129, 0.1);
	color: var(--acc-1);
}
.toast--error .toast-icon {
	background: rgba(244, 63, 94, 0.1);
	color: var(--danger);
}
.toast--info .toast-icon {
	background: rgba(34, 211, 238, 0.1);
	color: var(--acc-2);
}
.toast--warning .toast-icon {
	background: rgba(245, 158, 11, 0.1);
	color: var(--warning);
}

.toast-body {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}
.toast-title {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--text);
	letter-spacing: -0.01em;
}
.toast-desc {
	margin: 0;
	font-size: 12px;
	color: var(--text-muted);
	word-break: break-word;
}
.toast-desc.mono {
	font-family: var(--font-mono);
	font-size: 11.5px;
	color: var(--text-soft);
}
.toast-close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 22px;
	height: 22px;
	border-radius: 5px;
	display: grid;
	place-items: center;
	color: var(--text-faint);
	background: transparent;
	transition:
		background 0.16s,
		color 0.16s;
}
.toast-close .lucide {
	width: 12px;
	height: 12px;
}
.toast-close:hover {
	background: var(--surface-2);
	color: var(--text);
}

.toast-progress {
	position: absolute;
	left: 0;
	bottom: 0;
	right: 0;
	height: 2px;
	background: currentColor;
	opacity: 0.5;
	transform-origin: left;
	animation: toast-progress var(--toast-duration, 4000ms) linear forwards;
}
.toast--success .toast-progress {
	color: var(--acc-1);
}
.toast--error .toast-progress {
	color: var(--danger);
}
.toast--info .toast-progress {
	color: var(--acc-2);
}
.toast--warning .toast-progress {
	color: var(--warning);
}
@keyframes toast-progress {
	from {
		transform: scaleX(1);
	}
	to {
		transform: scaleX(0);
	}
}

/* ============================================================
   misc — login-foot already styled, plus minor
   ============================================================ */
.clock {
	font-feature-settings: "tnum", "lnum", "zero";
}

/* ============================================================
   responsive
   ============================================================ */
@media (max-width: 1100px) {
	.stats {
		grid-template-columns: repeat(2, 1fr);
	}
	.link-form-grid,
	.admin-form-grid {
		grid-template-columns: 1fr;
	}
	.link-form-submit {
		justify-self: stretch;
	}
}

@media (max-width: 880px) {
	.dashboard {
		grid-template-columns: 1fr;
	}
	.sidebar {
		position: static;
		height: auto;
		flex-direction: row;
		align-items: center;
		padding: 12px;
		gap: 8px;
		overflow-x: auto;
	}
	.sb-brand {
		padding: 0 8px 0 0;
		border: 0;
		border-right: 1px solid var(--border);
		margin: 0 8px 0 0;
	}
	.sb-section-label,
	.sb-spacer,
	.sb-foot {
		display: none;
	}
	.tabs {
		flex-direction: row;
		gap: 4px;
		flex: 1;
	}
	.tab.active::before {
		left: 50%;
		top: auto;
		bottom: -8px;
		width: 22px;
		height: 3px;
		transform: translateX(-50%);
	}
	.tab-trail {
		display: none;
	}
	.page {
		padding: 18px 16px 60px;
	}
	.page-title {
		font-size: 24px;
	}
	.toolbar {
		gap: 8px;
	}
	.search {
		width: 100%;
		flex: 1;
	}

	.cases-table thead {
		display: none;
	}
	.cases-table,
	.cases-table tbody,
	.cases-table tr,
	.cases-table td {
		display: block;
		width: 100%;
	}
	.cases-table tbody tr {
		border-bottom: 1px solid var(--border);
		padding: 10px 14px;
	}
	.cases-table tbody td {
		border: 0;
		padding: 4px 0;
	}
	.col-actions {
		text-align: left;
	}
}

@media (max-width: 520px) {
	.stats {
		grid-template-columns: 1fr 1fr;
	}
	.login-card {
		padding: 26px 22px;
	}
	.login-title {
		font-size: 30px;
	}
}

/* ============================================================
   FIELD MAPPER MODAL
   ============================================================ */
.fm-body {
	max-height: 55vh;
	overflow-y: auto;
	padding: 4px 0;
}
.fm-section {
	margin-bottom: 16px;
}
.fm-section-title {
	font-size: 13px;
	font-weight: 600;
	color: var(--c-text-sub);
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 8px;
	padding: 0 2px;
}
.fm-section-title i,
.fm-section-title svg {
	width: 14px;
	height: 14px;
}
.fm-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 6px 8px;
	border-radius: 8px;
	background: var(--c-glass-5);
	margin-bottom: 4px;
	flex-wrap: wrap;
}
.fm-row:hover {
	background: var(--c-glass-8);
}
.fm-el-preview {
	flex: 1;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	min-width: 0;
}
.fm-el-role {
	flex-shrink: 0;
}
.fm-role-select {
	background: var(--c-glass-8);
	color: var(--c-text);
	border: 1px solid var(--c-border);
	border-radius: 6px;
	padding: 4px 8px;
	font-size: 12px;
	cursor: pointer;
	min-width: 180px;
}
.fm-role-select:focus {
	outline: 2px solid var(--c-accent);
	outline-offset: 1px;
}
.fm-chip {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	padding: 2px 7px;
	border-radius: 4px;
	font-size: 11px;
	font-family: var(--ff-mono);
	background: var(--c-glass-8);
	color: var(--c-text-sub);
	white-space: nowrap;
}
.fm-chip-tag {
	background: rgba(99, 102, 241, 0.15);
	color: #818cf8;
}
.fm-chip-id {
	background: rgba(52, 211, 153, 0.15);
	color: #6ee7b7;
}
.fm-chip-cls {
	background: rgba(251, 191, 36, 0.12);
	color: #fbbf24;
}
.fm-chip-ph {
	background: rgba(156, 163, 175, 0.12);
	color: #9ca3af;
	font-style: italic;
}
.fm-chip-txt {
	background: rgba(96, 165, 250, 0.12);
	color: #60a5fa;
}
.fm-empty {
	padding: 16px;
	text-align: center;
	color: var(--c-text-sub);
	font-size: 13px;
}
@media (max-width: 600px) {
	.fm-row {
		flex-direction: column;
		align-items: flex-start;
	}
	.fm-role-select {
		width: 100%;
	}
}
