/* ==========================================================================
   SHADOW NETWORK — панель управления
   Монохромный «noir»: чёрный фон, белые трещины-молнии из логотипа.
   ========================================================================== */

:root {
	color-scheme: dark;
	--bg: #070707;
	--panel: #0f0f0f;
	--panel-2: #141414;
	--inset: #0a0a0a;
	--line: rgba(255, 255, 255, 0.1);
	--line-2: rgba(255, 255, 255, 0.22);
	--text: #f4f4f0;
	--text-2: #cfcfca;
	--muted: #8e8e8a;
	--faint: #5e5e5b;
	--ok: #c5ff8c;
	--danger: #ff7a7a;
	--warn: #ffd27a;
	--radius: 16px;
	--radius-sm: 10px;
	--sidebar-w: 264px;
	--font: Inter, 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto,
		'Helvetica Neue', Arial, sans-serif;
	--mono: ui-monospace, 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
	--ease: cubic-bezier(0.2, 0.75, 0.25, 1);
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

[hidden] {
	display: none !important;
}

html {
	background: var(--bg);
	-webkit-text-size-adjust: 100%;
	scrollbar-color: #2b2b2b transparent;
	scrollbar-width: thin;
}

body {
	margin: 0;
	min-height: 100vh;
	font: 400 15px/1.55 var(--font);
	color: var(--text);
	background: radial-gradient(circle at 92% -4%, #1e1e1e 0, transparent 32rem),
		var(--bg);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* сетка на фоне */
body::before {
	content: '';
	position: fixed;
	inset: 0;
	pointer-events: none;
	opacity: 0.2;
	background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
	background-size: 44px 44px;
	-webkit-mask-image: linear-gradient(to bottom, #000, transparent 75%);
	mask-image: linear-gradient(to bottom, #000, transparent 75%);
}

.ambient {
	position: fixed;
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: 50%;
	pointer-events: none;
}
.ambient-one {
	right: -14rem;
	top: 9rem;
	width: 28rem;
	height: 28rem;
}
.ambient-two {
	left: -22rem;
	bottom: -16rem;
	width: 42rem;
	height: 42rem;
}

::selection {
	background: var(--text);
	color: #000;
}

::-webkit-scrollbar {
	width: 10px;
	height: 10px;
}
::-webkit-scrollbar-thumb {
	background: #262626;
	border-radius: 10px;
	border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
	background: #3a3a3a;
}

h1,
h2,
h3,
h4,
h5,
p,
ul {
	margin: 0;
}
h1,
h2,
h3,
h4,
h5 {
	color: var(--text);
	letter-spacing: -0.02em;
	text-align: left;
}
h1 {
	font-size: clamp(30px, 3.4vw, 46px);
	line-height: 1.05;
	font-weight: 750;
	letter-spacing: -0.035em;
}
h2 {
	font-size: 19px;
	font-weight: 650;
}
h3 {
	font-size: 14px;
	font-weight: 650;
}
h4 {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--muted);
}
h5 {
	font-size: 12px;
	font-weight: 600;
	color: var(--muted);
}
p {
	color: var(--text-2);
}
a {
	color: inherit;
}
.muted {
	color: var(--muted);
}
.mono {
	font-family: var(--mono);
	font-size: 13px;
	letter-spacing: 0;
}
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

:focus-visible {
	outline: 2px solid var(--text);
	outline-offset: 2px;
}

.eyebrow {
	margin: 0 0 10px;
	color: var(--muted);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
}

/* ==========================================================================
   Каркас: сайдбар + контент
   ========================================================================== */

.shell {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
	min-height: 100vh;
}

.sidebar {
	position: sticky;
	top: 0;
	height: 100vh;
	display: flex;
	flex-direction: column;
	gap: 30px;
	padding: 26px 16px 18px;
	overflow-y: auto;
	background: rgba(5, 5, 5, 0.86);
	border-right: 1px solid var(--line);
	backdrop-filter: blur(14px);
}

.brand {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 0 6px;
	color: var(--text);
	text-decoration: none;
}
.brand img {
	width: 42px;
	height: 42px;
	flex: none;
	object-fit: cover;
	border-radius: 50%;
	border: 1px solid var(--line-2);
	background: #000;
}
.brand-copy {
	display: grid;
	gap: 5px;
	line-height: 1;
	letter-spacing: 0.14em;
}
.brand-copy {
	min-width: 0;
}
.brand-copy strong {
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.1em;
	white-space: nowrap;
}
.brand-copy small {
	color: var(--muted);
	font-size: 8.5px;
	letter-spacing: 0.16em;
}

.navigation {
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.nav-link {
	display: flex;
	align-items: center;
	padding: 12px 12px;
	border: 1px solid transparent;
	border-radius: 10px;
	color: #a9a9a5;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.22s, color 0.22s, transform 0.22s var(--ease);
}
.nav-link span {
	width: 30px;
	color: var(--faint);
	font-family: var(--mono);
	font-size: 10px;
	letter-spacing: 0.08em;
}
.nav-link:hover {
	color: var(--text);
	background: rgba(255, 255, 255, 0.05);
	transform: translateX(3px);
}
.nav-link.active {
	color: #070707;
	background: var(--text);
	transform: none;
}
.nav-link.active span {
	color: #6a6a66;
}

.sidebar-foot {
	display: grid;
	gap: 10px;
	margin-top: auto;
}

.bot-card {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 11px 12px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.02);
}
.bot-card form {
	margin: 0;
}
.bot-card__status {
	display: grid;
	grid-template-columns: auto 1fr;
	column-gap: 8px;
	align-items: center;
	margin: 0;
	font-size: 9.5px;
	letter-spacing: 0.12em;
	line-height: 1.35;
	color: var(--muted);
}
.bot-card__status .dot {
	grid-row: 1 / span 2;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #4a4a47;
}
.bot-card__name {
	font-weight: 700;
}
.bot-card__status strong {
	font-weight: 700;
	color: var(--muted);
}
.bot-card.is-online .dot {
	background: var(--ok);
	box-shadow: 0 0 0 0 rgba(197, 255, 140, 0.5);
	animation: pulse 2.2s infinite;
}
.bot-card.is-online .bot-card__status strong {
	color: var(--ok);
}

.content {
	min-width: 0;
}
.page {
	max-width: 1380px;
	margin: 0 auto;
	padding: 34px clamp(18px, 3vw, 42px) 64px;
}

.topbar,
.sidebar-backdrop {
	display: none;
}

/* ==========================================================================
   Карточки, секции
   ========================================================================== */

.page-intro {
	margin-bottom: 26px;
}
.page-intro p:last-child {
	margin-top: 10px;
	color: var(--muted);
}

.card,
.settings-section {
	padding: 24px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: rgba(15, 15, 15, 0.9);
}
.card-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 18px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--line);
}
.card-meta {
	color: var(--muted);
	font-size: 12px;
	white-space: nowrap;
}
.card-meta b {
	color: var(--text);
	font-weight: 650;
	font-variant-numeric: tabular-nums;
}

.section-head {
	margin: 30px 0 14px;
}

.empty {
	padding: 34px 12px;
	text-align: center;
	color: var(--muted);
}
.empty--inline {
	padding: 6px 0 14px;
	text-align: left;
	font-size: 13px;
}

/* ---------- Hero ---------- */
.hero-panel {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	min-height: 236px;
	margin-bottom: 18px;
	padding: 30px 40px;
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: linear-gradient(110deg, #181818 0%, #0d0d0d 62%);
}
.hero-panel::after {
	content: '';
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
	transform: translateX(-130%);
	animation: scan 8s infinite;
}
.hero-copy {
	position: relative;
	z-index: 1;
	max-width: 540px;
}
.hero-panel h1 {
	margin-bottom: 14px;
	font-size: clamp(34px, 4.2vw, 56px);
}
.hero-panel h1 em {
	font-style: normal;
	color: #8b8b87;
}
.hero-lead {
	max-width: 440px;
	color: #adada8;
}
.hero-logo {
	position: relative;
	z-index: 1;
	flex: none;
	width: clamp(170px, 22vw, 290px);
	height: auto;
	aspect-ratio: 1;
	margin: -22px -12px -22px 0;
	object-fit: contain;
	mix-blend-mode: screen;
	-webkit-mask-image: radial-gradient(closest-side, #000 84%, transparent 100%);
	mask-image: radial-gradient(closest-side, #000 84%, transparent 100%);
}

/* ---------- Статистика ---------- */
.stats-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 14px;
	margin-bottom: 8px;
}
.stat-card {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	min-height: 152px;
	padding: 20px;
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: 14px;
	background: var(--panel);
	transition: transform 0.25s var(--ease), border-color 0.25s, background 0.25s;
}
.stat-card::after {
	content: '';
	position: absolute;
	right: -26px;
	bottom: -26px;
	width: 64px;
	height: 64px;
	border: 1px solid var(--line);
	border-radius: 50%;
	transition: transform 0.4s var(--ease), border-color 0.25s;
}
.stat-card:hover {
	transform: translateY(-4px);
	border-color: rgba(255, 255, 255, 0.45);
	background: #161616;
}
.stat-card:hover::after {
	transform: scale(1.6);
	border-color: var(--line-2);
}
.stat-label {
	color: var(--muted);
	font-size: 9.5px;
	font-weight: 600;
	letter-spacing: 0.13em;
}
.stat-number {
	margin: 0;
	color: var(--text);
	font-size: clamp(30px, 3vw, 44px);
	font-weight: 750;
	letter-spacing: -0.03em;
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
.stat-number small {
	margin-left: 2px;
	color: var(--muted);
	font-size: 0.36em;
	font-weight: 600;
	letter-spacing: 0.08em;
}

/* ---------- Графики ---------- */
.charts-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px;
	margin-bottom: 18px;
}
.chart-card .card-head {
	border-bottom: 0;
	margin-bottom: 6px;
	padding-bottom: 0;
}
.chart-canvas {
	position: relative;
	height: 260px;
}
.chart-fail {
	display: grid;
	place-items: center;
	height: 100%;
	color: var(--muted);
	font-size: 13px;
	text-align: center;
}

/* ---------- Таблицы ---------- */
.table-wrap {
	width: 100%;
	overflow-x: auto;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--inset);
}
.data-table {
	width: 100%;
	margin: 0;
	border-collapse: collapse;
}
.data-table th,
.data-table td {
	padding: 13px 16px;
	border: 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.07);
	color: var(--text-2);
	font-size: 14px;
	text-align: left;
	vertical-align: middle;
	white-space: nowrap;
}
.data-table th {
	position: sticky;
	top: 0;
	background: #111;
	color: var(--muted);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}
.data-table tbody tr {
	transition: background 0.16s;
}
.data-table tbody tr:hover {
	background: rgba(255, 255, 255, 0.035);
}
.data-table tbody tr:last-child td {
	border-bottom: 0;
}
.data-table .num {
	text-align: right;
	font-variant-numeric: tabular-nums;
}
.data-table small {
	display: block;
	margin-top: 2px;
	color: var(--faint);
	font-size: 12px;
}
.data-table strong {
	color: var(--text);
	font-weight: 600;
}
.actions-cell {
	text-align: right !important;
}
.actions {
	display: flex;
	justify-content: flex-end;
	gap: 6px;
}
.actions form {
	margin: 0;
}

.user-cell {
	display: flex;
	align-items: center;
	gap: 12px;
}
.avatar {
	display: grid;
	place-items: center;
	flex: none;
	width: 34px;
	height: 34px;
	border: 1px solid var(--line-2);
	border-radius: 50%;
	background: #181818;
	color: var(--text);
	font-size: 13px;
	font-weight: 700;
}
.tag {
	display: inline-block;
	padding: 3px 9px;
	border: 1px solid var(--line);
	border-radius: 7px;
	background: rgba(255, 255, 255, 0.03);
	color: var(--text-2);
	font-size: 12px;
}
.link {
	color: var(--text);
	text-decoration: none;
	border-bottom: 1px solid var(--line-2);
	transition: border-color 0.2s;
}
.link:hover {
	border-color: var(--text);
}

.status-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	border: 1px solid;
	border-radius: 99px;
	font-size: 11px;
	font-weight: 650;
}
.status-badge::before {
	content: '';
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
}
.status-active {
	color: var(--ok);
	background: rgba(197, 255, 140, 0.08);
	border-color: rgba(197, 255, 140, 0.25);
}
.status-banned {
	color: var(--danger);
	background: rgba(255, 122, 122, 0.08);
	border-color: rgba(255, 122, 122, 0.25);
}

/* поиск + чипы */
.table-tools {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
}
.search {
	position: relative;
	flex: 1 1 260px;
	max-width: 420px;
}
.search svg {
	position: absolute;
	left: 13px;
	top: 50%;
	width: 17px;
	height: 17px;
	transform: translateY(-50%);
	fill: none;
	stroke: var(--muted);
	stroke-width: 2;
	stroke-linecap: round;
	pointer-events: none;
}
.search input {
	width: 100%;
	padding: 11px 14px 11px 40px;
	border: 1px solid #323232;
	border-radius: 10px;
	background: var(--inset);
	color: var(--text);
	font: inherit;
	font-size: 14px;
	transition: border-color 0.2s, box-shadow 0.2s;
}
.search input:focus {
	outline: none;
	border-color: #dcdcdc;
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}
.chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.chip {
	padding: 8px 13px;
	border: 1px solid var(--line);
	border-radius: 99px;
	background: transparent;
	color: var(--text-2);
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.chip span {
	margin-left: 4px;
	color: var(--muted);
	font-variant-numeric: tabular-nums;
}
.chip:hover {
	border-color: var(--line-2);
}
.chip.is-active {
	background: var(--text);
	border-color: var(--text);
	color: #070707;
}
.chip.is-active span {
	color: #55554f;
}

/* пагинация (ссылки на сервере и кнопки в JS) */
.pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	margin: 0;
	padding: 20px 0 2px;
}
.pagination:empty {
	display: none;
}
.pagination :is(a, button, span) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 10px;
	border: 1px solid var(--line);
	border-radius: 9px;
	background: var(--panel-2);
	color: var(--text-2);
	font: inherit;
	font-size: 13px;
	font-variant-numeric: tabular-nums;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.pagination :is(a, button):hover {
	border-color: var(--line-2);
	background: #1d1d1d;
	color: var(--text);
}
.pagination .active {
	background: var(--text);
	border-color: var(--text);
	color: #070707;
	cursor: default;
}
.pagination .disabled {
	opacity: 0.3;
	cursor: default;
	pointer-events: none;
}
.pagination .ellipsis {
	min-width: 20px;
	padding: 0;
	border-color: transparent;
	background: none;
	color: var(--faint);
	cursor: default;
}

/* ==========================================================================
   Формы
   ========================================================================== */

.form-group {
	margin-bottom: 16px;
}
.form-group > label:not(.switch) {
	display: block;
	margin-bottom: 7px;
	color: #b9b9b4;
	font-size: 12.5px;
	font-weight: 600;
}
.form-group input:not([type='checkbox']),
.form-group select,
.form-group textarea,
.form-inline input {
	width: 100%;
	padding: 11px 13px;
	border: 1px solid #323232;
	border-radius: 9px;
	background: var(--inset);
	color: var(--text);
	font: inherit;
	font-size: 14px;
	transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.form-group input::placeholder,
.form-inline input::placeholder {
	color: #5c5c58;
}
.form-group textarea {
	min-height: 96px;
	resize: vertical;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-inline input:focus {
	outline: none;
	border-color: #dcdcdc;
	background: #0f0f0f;
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}
.hint {
	margin-top: 6px;
	color: var(--faint);
	font-size: 12px;
	line-height: 1.45;
}

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

.input-wrap {
	position: relative;
}
.input-wrap input {
	padding-right: 46px !important;
}
.toggle-password {
	position: absolute;
	top: 1px;
	right: 1px;
	bottom: 1px;
	width: 42px;
	display: grid;
	place-items: center;
	padding: 0;
	border: 0;
	border-radius: 0 8px 8px 0;
	background: transparent;
	color: var(--muted);
	cursor: pointer;
	transition: background 0.2s, color 0.2s;
}
.toggle-password:hover {
	background: #1c1c1c;
	color: var(--text);
}
.toggle-password svg {
	width: 19px;
	height: 19px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.toggle-password .icon-eye-off {
	display: none;
}
.toggle-password.is-visible .icon-eye {
	display: none;
}
.toggle-password.is-visible .icon-eye-off {
	display: block;
}

/* переключатели */
.form-group-checkbox {
	margin-bottom: 18px;
}
.switch {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 12px;
	margin: 0;
	color: var(--text-2);
	font-size: 14px;
	cursor: pointer;
	user-select: none;
}
.switch input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}
.switch-ui {
	position: relative;
	flex: none;
	width: 40px;
	height: 22px;
	border: 1px solid var(--line-2);
	border-radius: 99px;
	background: #1c1c1c;
	transition: background 0.2s, border-color 0.2s;
}
.switch-ui::after {
	content: '';
	position: absolute;
	top: 2px;
	left: 2px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #82827e;
	transition: transform 0.22s var(--ease), background 0.2s;
}
.switch input:checked + .switch-ui {
	background: var(--text);
	border-color: var(--text);
}
.switch input:checked + .switch-ui::after {
	transform: translateX(18px);
	background: #080808;
}
.switch input:focus-visible + .switch-ui {
	outline: 2px solid var(--text);
	outline-offset: 2px;
}

/* ==========================================================================
   Кнопки
   ========================================================================== */

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 11px 18px;
	border: 1px solid transparent;
	border-radius: 9px;
	background: var(--text);
	color: #060606;
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.2s var(--ease), background 0.2s, color 0.2s, border-color 0.2s;
}
.button:hover {
	transform: translateY(-2px);
	background: #dcdcd7;
}
.button:active {
	transform: translateY(0);
}
.button:disabled {
	cursor: not-allowed;
}
.button-primary,
.button-start {
	background: var(--text);
	color: #060606;
}
.button-stop,
.button-warning,
.button-danger {
	background: transparent;
	border-color: rgba(255, 122, 122, 0.55);
	color: #ffa9a9;
}
.button-stop:hover,
.button-warning:hover,
.button-danger:hover {
	background: var(--danger);
	border-color: var(--danger);
	color: #090909;
}
.button-ghost,
.button-logout {
	background: transparent;
	border-color: #383838;
	color: #b4b4af;
}
.button-ghost:hover,
.button-logout:hover {
	background: #e2e2dd;
	border-color: #e2e2dd;
	color: #0a0a0a;
}
.button-disabled,
.button:disabled {
	background: #161616 !important;
	border-color: #262626 !important;
	color: #62625f !important;
	transform: none !important;
}
.button-small {
	padding: 7px 11px;
	font-size: 12px;
}
.button-tiny {
	padding: 2px 9px;
	font-size: 15px;
	line-height: 1.4;
}
.button-logout {
	width: 100%;
}
.button.is-busy {
	opacity: 0.7;
	pointer-events: none;
}

/* ==========================================================================
   Хосты и тарифы
   ========================================================================== */

.settings-container {
	display: grid;
	grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.5fr);
	gap: 22px;
	align-items: start;
}
.settings-column-left,
.settings-column-right {
	min-width: 0;
}
.settings-column-left {
	position: sticky;
	top: 24px;
}
.settings-section {
	margin-bottom: 18px;
}
.settings-section > h2 {
	margin-bottom: 20px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--line);
	font-size: 16px;
}
.subsection {
	margin: 26px 0 14px;
	padding-top: 20px;
	border-top: 1px dashed var(--line);
	color: var(--text);
	font-size: 13px;
	letter-spacing: 0.04em;
}
.settings-section > .subsection:first-of-type {
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}

.host-card {
	margin-bottom: 14px;
	padding: 18px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--inset);
}
.host-card > summary {
	list-style: none;
	cursor: pointer;
	color: var(--text);
	font-size: 14px;
	font-weight: 650;
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.host-card > summary::-webkit-details-marker {
	display: none;
}
.host-card > summary::after {
	content: '+';
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	border: 1px solid var(--line-2);
	border-radius: 50%;
	color: var(--muted);
	font-size: 16px;
	line-height: 1;
	transition: transform 0.25s var(--ease);
}
.host-card[open] > summary::after {
	transform: rotate(45deg);
}
.host-card[open] > summary {
	margin-bottom: 18px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--line);
}
.host-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	margin-bottom: 10px;
}
.host-header form {
	margin: 0;
}
.host-url {
	margin-bottom: 14px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--line);
	color: var(--text-2);
	font-family: var(--mono);
	font-size: 12.5px;
	word-break: break-all;
}
.host-url span {
	margin-right: 6px;
	color: var(--faint);
	font-family: var(--font);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.12em;
}
.plans-section h4 {
	margin-bottom: 8px;
}
.plans-section h5 {
	margin: 14px 0 8px;
}
.plan-list {
	padding: 0;
	list-style: none;
}
.plan-list li {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 9px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.plan-list li:last-child {
	border-bottom: 0;
}
.plan-name {
	flex: 1;
	min-width: 0;
	color: var(--text);
	font-size: 14px;
}
.plan-name small {
	margin-left: 8px;
	color: var(--faint);
	font-size: 12px;
}
.plan-price {
	color: var(--text-2);
	font-size: 13px;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
.plan-list form {
	margin: 0;
}
.form-inline {
	display: grid;
	grid-template-columns: 1.5fr 0.7fr 0.8fr auto;
	gap: 8px;
}
.form-inline input {
	min-width: 0;
	padding: 9px 11px;
	font-size: 13px;
}

/* липкая панель сохранения */
.savebar {
	position: sticky;
	bottom: 16px;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 12px 14px 12px 20px;
	border: 1px solid var(--line-2);
	border-radius: 14px;
	background: rgba(12, 12, 12, 0.88);
	backdrop-filter: blur(14px);
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}
.savebar-hint {
	color: var(--muted);
	font-size: 13px;
}
.savebar.is-dirty .savebar-hint {
	color: var(--warn);
}

.debug-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 18px;
}
.debug-actions {
	display: flex;
	gap: 10px;
}
.debug-actions form {
	margin: 0;
}

/* ==========================================================================
   Уведомления, модалка
   ========================================================================== */

.flash {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 16px;
	padding: 12px 14px;
	border: 1px solid var(--line-2);
	border-left-width: 3px;
	border-radius: var(--radius-sm);
	background: var(--panel-2);
	color: var(--text);
	font-size: 14px;
	transition: opacity 0.3s, transform 0.3s;
}
.flash.is-leaving {
	opacity: 0;
	transform: translateY(-6px);
}
.flash-success {
	border-left-color: var(--ok);
}
.flash-danger,
.flash-error {
	border-left-color: var(--danger);
}
.flash-warning {
	border-left-color: var(--warn);
}
.flash-close {
	flex: none;
	width: 22px;
	height: 22px;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--muted);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}
.flash-close:hover {
	background: #232323;
	color: var(--text);
}

.modal {
	width: min(440px, calc(100% - 32px));
	padding: 0;
	border: 1px solid var(--line-2);
	border-radius: var(--radius);
	background: #101010;
	color: var(--text);
	box-shadow: 0 30px 90px rgba(0, 0, 0, 0.75);
}
.modal::backdrop {
	background: rgba(0, 0, 0, 0.72);
	backdrop-filter: blur(4px);
}
.modal[open] {
	animation: pop 0.22s var(--ease);
}
.modal-body {
	padding: 24px;
}
.modal-body h3 {
	margin-bottom: 10px;
	font-size: 17px;
}
.modal-body p {
	color: var(--text-2);
}
.modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 24px;
}

/* ==========================================================================
   Вход
   ========================================================================== */

body.login-page {
	display: grid;
	place-items: center;
	min-height: 100vh;
	padding: 24px;
	overflow: hidden;
}
.login-backdrop {
	position: fixed;
	inset: 0;
	background: url('../img/shadow-network-logo.png') center / min(125vmin, 1150px) no-repeat;
	mix-blend-mode: screen;
	opacity: 0.3;
	animation: drift 24s ease-in-out infinite alternate;
}
.login-container {
	position: relative;
	z-index: 1;
	width: min(100%, 420px);
	padding: 34px;
	border: 1px solid var(--line-2);
	border-radius: 20px;
	background: rgba(10, 10, 10, 0.8);
	backdrop-filter: blur(18px);
	box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65);
}
.login-logo {
	display: block;
	width: 76px;
	height: 76px;
	margin-bottom: 22px;
	object-fit: cover;
	border-radius: 50%;
	border: 1px solid var(--line-2);
}
.login-container h1 {
	margin-bottom: 8px;
	font-size: 32px;
}
.login-copy {
	margin-bottom: 26px;
	color: var(--muted);
}
.login-submit {
	width: 100%;
	justify-content: space-between;
	margin-top: 6px;
	padding: 13px 16px;
	font-size: 14px;
}
.login-submit span {
	font-size: 18px;
	line-height: 0;
	transition: transform 0.2s var(--ease);
}
.login-submit:hover span {
	transform: translateX(4px);
}
.login-foot {
	margin-top: 24px;
	color: var(--faint);
	font-size: 9.5px;
	letter-spacing: 0.18em;
	text-align: center;
}

/* ==========================================================================
   Анимации
   ========================================================================== */

.reveal {
	animation: reveal 0.55s var(--ease) both;
}
.stats-grid .reveal:nth-child(2) {
	animation-delay: 0.06s;
}
.stats-grid .reveal:nth-child(3) {
	animation-delay: 0.12s;
}
.stats-grid .reveal:nth-child(4) {
	animation-delay: 0.18s;
}
@keyframes reveal {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}
@keyframes scan {
	0%,
	70% {
		transform: translateX(-130%);
	}
	100% {
		transform: translateX(140%);
	}
}
@keyframes pulse {
	70% {
		box-shadow: 0 0 0 7px rgba(197, 255, 140, 0);
	}
	100% {
		box-shadow: 0 0 0 0 rgba(197, 255, 140, 0);
	}
}
@keyframes pop {
	from {
		opacity: 0;
		transform: scale(0.96) translateY(6px);
	}
}
@keyframes drift {
	to {
		transform: scale(1.06) translateX(-1.5%);
	}
}
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
	}
}

/* ==========================================================================
   Адаптив
   ========================================================================== */

@media (max-width: 1180px) {
	.settings-container {
		grid-template-columns: 1fr;
	}
	.settings-column-left {
		position: static;
	}
}

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

	/* сайдбар превращается в выезжающее меню */
	.sidebar {
		position: fixed;
		z-index: 40;
		top: 0;
		bottom: 0;
		left: 0;
		width: min(300px, 86vw);
		height: auto;
		transform: translateX(-102%);
		transition: transform 0.35s var(--ease);
		background: rgba(8, 8, 8, 0.97);
	}
	body.nav-open .sidebar {
		transform: none;
	}
	.sidebar-backdrop {
		position: fixed;
		z-index: 30;
		inset: 0;
		display: block;
		background: rgba(0, 0, 0, 0.6);
		backdrop-filter: blur(3px);
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.3s;
	}
	body.nav-open .sidebar-backdrop {
		opacity: 1;
		pointer-events: auto;
	}
	body.nav-open {
		overflow: hidden;
	}

	.topbar {
		position: sticky;
		z-index: 20;
		top: 0;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 10px 18px;
		border-bottom: 1px solid var(--line);
		background: rgba(7, 7, 7, 0.88);
		backdrop-filter: blur(14px);
	}
	.brand--compact img {
		width: 34px;
		height: 34px;
	}
	.nav-toggle {
		display: grid;
		place-items: center;
		width: 42px;
		height: 42px;
		padding: 0;
		border: 1px solid var(--line-2);
		border-radius: 10px;
		background: transparent;
		color: var(--text);
		cursor: pointer;
	}
	.nav-toggle:hover {
		background: #1a1a1a;
	}
	.page {
		padding-top: 24px;
	}
	.charts-grid {
		grid-template-columns: 1fr;
	}
	.stats-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 700px) {
	body {
		font-size: 14px;
	}
	.card,
	.settings-section {
		padding: 18px;
	}
	.hero-panel {
		min-height: 190px;
		padding: 24px;
	}
	.hero-logo {
		position: absolute;
		right: -110px;
		top: 50%;
		width: 260px;
		margin: 0;
		opacity: 0.16;
		transform: translateY(-50%);
	}
	.stats-grid {
		gap: 10px;
	}
	.stat-card {
		min-height: 120px;
		padding: 16px;
	}
	.stat-number {
		font-size: 26px;
	}
	.chart-canvas {
		height: 220px;
	}
	.form-grid,
	.form-grid--3 {
		grid-template-columns: 1fr;
	}
	.form-inline {
		grid-template-columns: 1fr 1fr;
	}
	.form-inline button {
		grid-column: 1 / -1;
	}
	.savebar {
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
		padding: 12px;
		text-align: center;
	}
	.search {
		max-width: none;
	}
	.pagination .far {
		display: none;
	}

	/* таблицы → карточки */
	.table-wrap {
		border: 0;
		background: none;
		overflow: visible;
	}
	.table--stack,
	.table--stack tbody,
	.table--stack tr,
	.table--stack td {
		display: block;
		width: 100%;
	}
	.table--stack thead {
		display: none;
	}
	.table--stack tr {
		margin-bottom: 10px;
		padding: 8px 14px;
		border: 1px solid var(--line);
		border-radius: 12px;
		background: var(--inset);
	}
	.table--stack tbody tr:hover {
		background: var(--inset);
	}
	.table--stack td {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 16px;
		padding: 8px 0;
		border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
		text-align: right;
		white-space: normal;
	}
	.table--stack td:last-child {
		border-bottom: 0 !important;
	}
	.table--stack td::before {
		content: attr(data-label);
		flex: none;
		color: var(--muted);
		font-size: 10px;
		font-weight: 700;
		letter-spacing: 0.12em;
		text-transform: uppercase;
		text-align: left;
	}
	.table--stack .actions {
		flex-wrap: wrap;
	}
}

@media (max-width: 380px) {
	.stats-grid {
		grid-template-columns: 1fr;
	}
}

/* ==========================================================================
   Страница пользователя и управление ключами
   ========================================================================== */

.back-link {
	display: inline-block;
	margin-bottom: 16px;
	color: var(--muted);
	font-size: 13px;
	text-decoration: none;
	transition: color 0.2s, transform 0.2s var(--ease);
}
.back-link:hover {
	color: var(--text);
	transform: translateX(-3px);
}
.profile-head {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 18px;
}
.profile-head h1 {
	font-size: clamp(26px, 3vw, 38px);
	word-break: break-all;
}
.profile-sub {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-top: 8px;
	color: var(--muted);
}
.profile-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-left: auto;
}
.profile-actions form {
	margin: 0;
}
.avatar--lg {
	width: 62px;
	height: 62px;
	font-size: 24px;
}
.stats-grid--compact {
	margin-bottom: 18px;
}
.stats-grid--compact .stat-card {
	min-height: 112px;
}
.stats-grid--compact .stat-number {
	font-size: clamp(22px, 2.2vw, 32px);
}
.stat-number--text {
	font-size: clamp(18px, 1.8vw, 24px) !important;
	font-weight: 650 !important;
	letter-spacing: 0 !important;
}

.user-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
	gap: 18px;
	margin-bottom: 18px;
	align-items: start;
}
.add-key {
	position: sticky;
	top: 24px;
}
.button-wide {
	width: 100%;
	padding: 13px 18px;
	font-size: 14px;
}
.hint--block {
	margin: 0 0 16px;
}
.chips--tight {
	margin-top: 10px;
}
.chips--tight .chip {
	padding: 6px 12px;
	font-size: 12px;
}
.form-group select {
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e8a' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 16px;
	padding-right: 38px !important;
	cursor: pointer;
}

.key-list {
	display: grid;
	gap: 10px;
	padding: 0;
	list-style: none;
}
.key-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 14px;
	padding: 14px 16px;
	border: 1px solid var(--line);
	border-left-width: 3px;
	border-radius: 12px;
	background: var(--inset);
	transition: border-color 0.2s, background 0.2s;
}
.key-item:hover {
	background: #0e0e0e;
}
.key-item--active {
	border-left-color: var(--ok);
}
.key-item--soon {
	border-left-color: var(--warn);
}
.key-item--expired {
	border-left-color: var(--danger);
}
.key-main {
	min-width: 0;
	flex: 1 1 280px;
}
.key-top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}
.key-email {
	color: var(--text);
	word-break: break-all;
}
.key-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	margin-top: 8px;
	color: var(--text-2);
	font-size: 13px;
}
.key-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.key-actions form {
	margin: 0;
}
.status-warn {
	color: var(--warn);
	background: rgba(255, 210, 122, 0.08);
	border-color: rgba(255, 210, 122, 0.25);
}
.plain-link {
	color: inherit;
	text-decoration: none;
}
.plain-link:hover strong {
	text-decoration: underline;
	text-underline-offset: 3px;
}
a.button {
	text-decoration: none;
}

@media (max-width: 1000px) {
	.user-grid {
		grid-template-columns: 1fr;
	}
	.add-key {
		position: static;
	}
	.profile-actions {
		margin-left: 0;
	}
}
