/* ------------------------------------------------------------------ *
 *  Commentator — светлая тема
 * ------------------------------------------------------------------ */

:root {
	--bg: #f6f7f9;
	--surface: #ffffff;
	--surface-2: #f2f4f7;
	--surface-3: #eaedf1;
	--border: #e2e6eb;
	--border-strong: #cdd4dc;
	--text: #131820;
	--text-2: #48525f;
	--muted: #78828f;

	--primary: #2563eb;
	--primary-hover: #1d4ed8;
	--primary-soft: #eef4ff;

	--green: #0f8a55;
	--green-soft: #e6f6ee;
	--amber: #b45309;
	--amber-soft: #fdf3e3;
	--red: #d92d20;
	--red-soft: #fdecea;
	--violet: #6d43c8;
	--violet-soft: #f1ecfb;

	--radius: 10px;
	--radius-sm: 7px;
	--shadow: 0 1px 2px rgba(16, 24, 40, .05);
	--shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, .18);
	--font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, Helvetica, Arial, sans-serif;
	--mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
	margin: 0;
	padding: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 14px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ *
 *  Каркас
 * ------------------------------------------------------------------ */

.layout { display: flex; min-height: 100vh; }

.sidebar {
	width: 232px;
	flex: 0 0 232px;
	background: var(--surface);
	border-right: 1px solid var(--border);
	display: flex;
	flex-direction: column;
	position: sticky;
	top: 0;
	height: 100vh;
}

.brand {
	padding: 20px 20px 16px;
	display: flex;
	align-items: center;
	gap: 10px;
	border-bottom: 1px solid var(--border);
}
.brand-mark {
	width: 30px; height: 30px;
	border-radius: 8px;
	background: linear-gradient(135deg, #2563eb, #6d43c8);
	color: #fff;
	display: grid; place-items: center;
	font-weight: 700; font-size: 15px;
}
.brand-name { font-weight: 650; letter-spacing: -.01em; }
.brand-sub { font-size: 11px; color: var(--muted); }

.nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.nav-label {
	font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
	color: var(--muted); padding: 12px 10px 6px; font-weight: 600;
}
.nav a {
	display: flex; align-items: center; gap: 10px;
	padding: 8px 10px; border-radius: var(--radius-sm);
	color: var(--text-2); font-weight: 500; text-decoration: none;
	margin-bottom: 1px;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav a .ico { width: 16px; text-align: center; opacity: .85; }
.nav a .count {
	margin-left: auto; font-size: 11px; font-weight: 600;
	background: var(--surface-3); color: var(--text-2);
	padding: 1px 6px; border-radius: 20px;
}
.nav a.active .count { background: #fff; color: var(--primary); }

.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
	height: 60px;
	background: var(--surface);
	border-bottom: 1px solid var(--border);
	display: flex; align-items: center; gap: 14px;
	padding: 0 24px;
	position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 17px; font-weight: 650; margin: 0; letter-spacing: -.01em; }
.topbar .spacer { flex: 1; }

.content { padding: 22px 24px 60px; }
.content > section { margin-bottom: 22px; }

/* ------------------------------------------------------------------ *
 *  Карточки и сетки
 * ------------------------------------------------------------------ */

.card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}
.card-head {
	padding: 14px 18px;
	border-bottom: 1px solid var(--border);
	display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.card-head h2 { margin: 0; font-size: 14px; font-weight: 650; }
.card-head .hint { font-size: 12px; color: var(--muted); }
.card-head .spacer { flex: 1; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

.grid { display: grid; gap: 14px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1180px) { .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
	.grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
	.sidebar { display: none; }
}

.stat { padding: 16px 18px; }
.stat .label { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat .value { font-size: 26px; font-weight: 680; letter-spacing: -.02em; margin-top: 4px; }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat .value.ok { color: var(--green); }
.stat .value.warn { color: var(--amber); }
.stat .value.bad { color: var(--red); }

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

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 7px;
	height: 34px; padding: 0 13px;
	border: 1px solid var(--border-strong);
	background: var(--surface);
	color: var(--text);
	border-radius: var(--radius-sm);
	font: inherit; font-weight: 550; font-size: 13px;
	cursor: pointer; white-space: nowrap;
	transition: background .12s, border-color .12s, opacity .12s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { background: var(--surface-3); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger { background: var(--surface); border-color: var(--border-strong); color: var(--red); }
.btn-danger:hover { background: var(--red-soft); border-color: #f3b8b2; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { height: 28px; padding: 0 9px; font-size: 12px; }
.btn-icon { width: 30px; padding: 0; }

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

/* ------------------------------------------------------------------ *
 *  Формы
 * ------------------------------------------------------------------ */

.field { margin-bottom: 14px; }
.field > label {
	display: block; font-size: 12px; font-weight: 600;
	color: var(--text-2); margin-bottom: 5px;
}
.field .desc { font-size: 11.5px; color: var(--muted); margin-top: 5px; line-height: 1.45; }

input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
	width: 100%;
	padding: 8px 11px;
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-sm);
	background: var(--surface);
	color: var(--text);
	font: inherit; font-size: 13px;
	outline: none;
	transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
	border-color: var(--primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
textarea { resize: vertical; min-height: 82px; line-height: 1.55; }
textarea.mono, input.mono { font-family: var(--mono); font-size: 12px; }
select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M3 4.5L6 8l3-3.5' fill='none' stroke='%2378828f' stroke-width='1.5' stroke-linecap='round'/></svg>"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }

.inline-fields { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.inline-fields .field { flex: 1; min-width: 130px; margin-bottom: 0; }

.check { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 13px; }
.check input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }

.range-row { display: flex; align-items: center; gap: 10px; }
.range-row input[type=range] { flex: 1; accent-color: var(--primary); }
.range-row .val { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 46px; text-align: right; }

/* ------------------------------------------------------------------ *
 *  Таблицы
 * ------------------------------------------------------------------ */

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.table th {
	text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
	color: var(--muted); font-weight: 600;
	padding: 10px 14px; background: var(--surface-2);
	border-bottom: 1px solid var(--border);
	position: sticky; top: 0; z-index: 1; white-space: nowrap;
}
table.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.table tbody tr:last-child td { border-bottom: none; }
table.table tbody tr:hover { background: #fafbfc; }
table.table tbody tr.selected { background: var(--primary-soft); }
table.table td.num { font-variant-numeric: tabular-nums; }
table.table td.actions { text-align: right; white-space: nowrap; }
table.table .sub { font-size: 11.5px; color: var(--muted); }

.checkbox-cell { width: 34px; }
.checkbox-cell input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }

.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty .big { font-size: 26px; margin-bottom: 8px; opacity: .5; }

/* ------------------------------------------------------------------ *
 *  Бейджи, чипы, прогресс
 * ------------------------------------------------------------------ */

.badge {
	display: inline-flex; align-items: center; gap: 5px;
	padding: 2px 8px; border-radius: 20px;
	font-size: 11.5px; font-weight: 600; white-space: nowrap;
	background: var(--surface-3); color: var(--text-2);
}
.badge::before {
	content: ''; width: 6px; height: 6px; border-radius: 50%;
	background: currentColor; opacity: .75;
}
.badge.plain::before { display: none; }
.badge.green  { background: var(--green-soft);  color: var(--green); }
.badge.blue   { background: var(--primary-soft); color: var(--primary); }
.badge.amber  { background: var(--amber-soft);  color: var(--amber); }
.badge.red    { background: var(--red-soft);    color: var(--red); }
.badge.violet { background: var(--violet-soft); color: var(--violet); }

.chip {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 3px 9px; border-radius: 20px; font-size: 12px;
	background: var(--surface-2); border: 1px solid var(--border);
	color: var(--text-2);
}
.chip button {
	border: 0; background: none; cursor: pointer; color: var(--muted);
	padding: 0; font-size: 14px; line-height: 1;
}

.progress { height: 6px; background: var(--surface-3); border-radius: 20px; overflow: hidden; min-width: 90px; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: 20px; transition: width .3s; }
.progress.green > span { background: var(--green); }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.on { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.dot.off { background: var(--border-strong); }

.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--border); padding: 0 6px; }
.tabs button {
	border: 0; background: none; font: inherit; font-size: 13px; font-weight: 550;
	color: var(--muted); padding: 11px 12px; cursor: pointer;
	border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }

.toolbar {
	display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
	padding: 12px 18px; border-bottom: 1px solid var(--border);
	background: var(--surface-2);
}
.toolbar input[type=search], .toolbar select { width: auto; min-width: 150px; height: 32px; padding-top: 0; padding-bottom: 0; }
.toolbar .spacer { flex: 1; }

.bulkbar {
	display: none; align-items: center; gap: 10px; flex-wrap: wrap;
	padding: 10px 18px; background: var(--primary-soft);
	border-bottom: 1px solid #d6e2fb; font-size: 13px;
}
.bulkbar.show { display: flex; }
.bulkbar .count { font-weight: 650; color: var(--primary); }

/* ------------------------------------------------------------------ *
 *  Модалки и тосты
 * ------------------------------------------------------------------ */

.modal-backdrop {
	position: fixed; inset: 0; background: rgba(16, 24, 40, .45);
	display: flex; align-items: flex-start; justify-content: center;
	padding: 60px 20px; z-index: 100; overflow-y: auto;
	backdrop-filter: blur(2px);
}
.modal {
	background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg);
	width: 100%; max-width: 560px; overflow: hidden;
	animation: pop .16s ease-out;
}
.modal.wide { max-width: 900px; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } }
.modal-head {
	padding: 16px 20px; border-bottom: 1px solid var(--border);
	display: flex; align-items: center; gap: 12px;
}
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 650; }
.modal-head .spacer { flex: 1; }
.modal-body { padding: 20px; max-height: 66vh; overflow-y: auto; }
.modal-foot {
	padding: 14px 20px; border-top: 1px solid var(--border);
	display: flex; gap: 8px; justify-content: flex-end; background: var(--surface-2);
}

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
	background: var(--text); color: #fff; padding: 11px 15px; border-radius: var(--radius-sm);
	font-size: 13px; box-shadow: var(--shadow-lg); max-width: 400px;
	animation: slide .18s ease-out;
}
.toast.err { background: var(--red); }
.toast.ok { background: var(--green); }
@keyframes slide { from { opacity: 0; transform: translateX(16px); } }

/* ------------------------------------------------------------------ *
 *  Специфика страниц
 * ------------------------------------------------------------------ */

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 340px; }

.feed-item { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.feed-item:last-child { border-bottom: none; }
.feed-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 7px; }
.feed-post {
	font-size: 12.5px; color: var(--text-2); background: var(--surface-2);
	padding: 9px 11px; border-radius: var(--radius-sm); margin-bottom: 9px;
	border-left: 2px solid var(--border-strong);
	max-height: 84px; overflow: hidden;
}
.feed-text { font-size: 13.5px; line-height: 1.55; }
.feed-text.editable {
	border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
	padding: 9px 11px; outline: none;
}
.feed-text.editable:focus { border-style: solid; border-color: var(--primary); }

.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ''; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding: 7px 0; font-size: 13px; }
.timeline-item::before {
	content: ''; position: absolute; left: -18px; top: 13px;
	width: 10px; height: 10px; border-radius: 50%;
	background: var(--surface); border: 2px solid var(--border-strong);
}
.timeline-item.done::before { border-color: var(--green); background: var(--green); }
.timeline-item.failed::before { border-color: var(--red); background: var(--red); }
.timeline-item.pending::before { border-color: var(--primary); }

.chart { display: flex; align-items: flex-end; gap: 3px; height: 90px; }
.chart .bar { flex: 1; background: var(--primary-soft); border-radius: 3px 3px 0 0; position: relative; min-height: 2px; }
.chart .bar > span { display: block; height: 100%; background: var(--primary); border-radius: 3px 3px 0 0; }
.chart-labels { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-top: 5px; }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 7px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.mono-block {
	font-family: var(--mono); font-size: 12px; background: var(--surface-2);
	padding: 11px 13px; border-radius: var(--radius-sm); border: 1px solid var(--border);
	white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow-y: auto;
}

.dropzone {
	border: 2px dashed var(--border-strong); border-radius: var(--radius);
	padding: 28px; text-align: center; color: var(--muted);
	cursor: pointer; transition: border-color .12s, background .12s;
}
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }

.note {
	background: var(--amber-soft); border: 1px solid #f5dfb8; color: #7c4a06;
	padding: 11px 13px; border-radius: var(--radius-sm); font-size: 12.5px; line-height: 1.5;
}
.note.info { background: var(--primary-soft); border-color: #d3e0fb; color: #1e40af; }
.note.bad { background: var(--red-soft); border-color: #f5c2bd; color: #91221a; }

.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px; }
.avatar-tile { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.avatar-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-tile button {
	position: absolute; top: 4px; right: 4px; width: 20px; height: 20px;
	border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff;
	cursor: pointer; font-size: 12px; line-height: 1; display: grid; place-items: center;
}
.avatar-tile .used {
	position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,.55);
	color: #fff; font-size: 10px; text-align: center; padding: 1px;
}

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 1000px) { .split { grid-template-columns: 1fr; } }

.loading { padding: 40px; text-align: center; color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------------ *
 *  Мессенджер
 * ------------------------------------------------------------------ */

.im {
	display: grid;
	grid-template-columns: 230px 300px 1fr;
	height: calc(100vh - 60px - 44px);
	min-height: 480px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
	background: var(--surface);
	box-shadow: var(--shadow);
}
@media (max-width: 1100px) { .im { grid-template-columns: 190px 250px 1fr; } }

.im-col { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--border); }
.im-col:last-child { border-right: none; }
.im-head {
	padding: 11px 14px; border-bottom: 1px solid var(--border);
	background: var(--surface-2); font-size: 12px; font-weight: 650; color: var(--text-2);
	display: flex; align-items: center; gap: 8px; min-height: 42px;
}
.im-head .spacer { flex: 1; }
.im-list { flex: 1; overflow-y: auto; }

.im-item {
	padding: 9px 14px; border-bottom: 1px solid var(--border);
	cursor: pointer; display: flex; gap: 9px; align-items: flex-start;
}
.im-item:hover { background: var(--surface-2); }
.im-item.active { background: var(--primary-soft); }
.im-item .body { min-width: 0; flex: 1; }
.im-item .name {
	font-weight: 600; font-size: 13px; white-space: nowrap;
	overflow: hidden; text-overflow: ellipsis;
}
.im-item .preview {
	font-size: 11.5px; color: var(--muted); white-space: nowrap;
	overflow: hidden; text-overflow: ellipsis; margin-top: 1px;
}
.im-item .meta { font-size: 10.5px; color: var(--muted); text-align: right; white-space: nowrap; }
.im-item .unread {
	display: inline-block; min-width: 18px; padding: 0 5px; margin-top: 3px;
	background: var(--primary); color: #fff; border-radius: 20px;
	font-size: 10.5px; font-weight: 700; text-align: center;
}
.im-avatar {
	width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%;
	display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 650;
	background: var(--primary);
}

.im-messages {
	flex: 1; overflow-y: auto; padding: 16px;
	display: flex; flex-direction: column; gap: 6px;
	background: var(--surface-2);
}
.bubble {
	max-width: 68%; padding: 8px 12px; border-radius: 14px;
	font-size: 13.5px; line-height: 1.45; word-wrap: break-word; white-space: pre-wrap;
	background: var(--surface); border: 1px solid var(--border); align-self: flex-start;
}
.bubble.out { align-self: flex-end; background: var(--primary-soft); border-color: #d6e2fb; }
.bubble.service {
	align-self: center; background: transparent; border: none;
	color: var(--muted); font-size: 11.5px; max-width: 90%; text-align: center;
}
.bubble .who { font-size: 11px; font-weight: 650; color: var(--primary); margin-bottom: 2px; }
.bubble .time { font-size: 10.5px; color: var(--muted); margin-top: 3px; text-align: right; }
.bubble .attach { font-size: 11.5px; color: var(--muted); font-style: italic; }

.im-compose {
	border-top: 1px solid var(--border); padding: 10px 12px;
	display: flex; gap: 8px; align-items: flex-end; background: var(--surface);
}
.im-compose textarea { min-height: 38px; max-height: 140px; resize: none; }

/* ------------------------------------------------------------------ *
 *  Мастер настройки пачки
 * ------------------------------------------------------------------ */

.pick-grid {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 7px; max-height: 260px; overflow-y: auto; padding: 2px;
}
.pick {
	display: flex; align-items: center; gap: 8px; padding: 7px 10px;
	border: 1px solid var(--border); border-radius: var(--radius-sm);
	cursor: pointer; background: var(--surface); font-size: 12.5px;
}
.pick:hover { border-color: var(--border-strong); }
.pick.on { border-color: var(--primary); background: var(--primary-soft); }
.pick .sub { font-size: 11px; }

.thumb-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumb {
	position: relative; width: 64px; height: 64px; border-radius: var(--radius-sm);
	overflow: hidden; border: 1px solid var(--border);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button {
	position: absolute; top: 2px; right: 2px; width: 18px; height: 18px;
	border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff;
	cursor: pointer; font-size: 11px; line-height: 1; display: grid; place-items: center;
}

/* ------------------------------------------------------------------ *
 *  Карточки аккаунтов
 * ------------------------------------------------------------------ */

.acc-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
	gap: 14px;
	padding: 18px;
}

.acc-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: border-color .12s, box-shadow .12s;
}
.acc-card:hover { border-color: var(--border-strong); box-shadow: 0 4px 14px -4px rgba(16,24,40,.12); }
.acc-card.selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }

/* align-items обязателен: у flex по умолчанию stretch, и круглый аватар
   вытягивается в овал по высоте карточки */
.acc-card-top { display: flex; gap: 12px; padding: 14px 14px 10px; align-items: flex-start; }

.acc-photo {
	width: 56px; height: 56px; flex: 0 0 56px; border-radius: 50%;
	object-fit: cover; background: var(--surface-3);
	display: grid; place-items: center;
	font-size: 19px; font-weight: 650; color: #fff;
	overflow: hidden; position: relative;
}
.acc-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* именно no-photo, а не empty: .empty — глобальная утилита пустых состояний
   со своими отступами, и она разносила аватар в овал */
.acc-photo.no-photo { border: 1px dashed var(--border-strong); color: var(--muted); background: var(--surface-2); }
.acc-photo .live {
	position: absolute; right: 0; bottom: 2px;
	width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--surface);
}
.acc-photo .live.on { background: var(--green); }
.acc-photo .live.off { background: var(--border-strong); }

.acc-ident { min-width: 0; flex: 1; }
.acc-name {
	font-weight: 650; font-size: 14px; display: flex; align-items: center; gap: 6px;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.acc-name .missing { color: var(--muted); font-weight: 500; font-style: italic; }
.acc-user { font-size: 12px; color: var(--primary); }
.acc-user .missing { color: var(--amber); font-style: italic; }
.acc-phone { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

.acc-bio {
	padding: 0 14px 10px; font-size: 12.5px; color: var(--text-2);
	line-height: 1.45; min-height: 18px;
}
.acc-bio .missing { color: var(--muted); font-style: italic; }

.acc-meta {
	display: flex; flex-wrap: wrap; gap: 5px; padding: 0 14px 12px;
}

.acc-stats {
	display: grid; grid-template-columns: repeat(3, 1fr);
	border-top: 1px solid var(--border); background: var(--surface-2);
	margin-top: auto;
}
.acc-stats > div { padding: 8px 10px; text-align: center; border-right: 1px solid var(--border); }
.acc-stats > div:last-child { border-right: none; }
.acc-stats .k { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.acc-stats .v { font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.acc-stats .v.warn { color: var(--amber); }
.acc-stats .v.bad { color: var(--red); }

.acc-actions {
	display: flex; gap: 6px; padding: 10px 14px;
	border-top: 1px solid var(--border); align-items: center;
}
.acc-actions .spacer { flex: 1; }
.acc-pick { margin-right: 2px; }

.acc-warn {
	margin: 0 14px 10px; padding: 6px 9px; border-radius: var(--radius-sm);
	background: var(--amber-soft); color: #7c4a06; font-size: 11.5px; line-height: 1.4;
}

/* ------------------------------------------------------------------ *
 *  Логи
 * ------------------------------------------------------------------ */

.log-box {
	height: calc(100vh - 60px - 44px - 54px);
	min-height: 380px;
	overflow-y: auto;
	background: var(--surface);
	font-size: 12.5px;
}
.log-line {
	display: flex; gap: 10px; align-items: baseline;
	padding: 5px 16px; border-bottom: 1px solid var(--border);
	line-height: 1.45;
}
.log-line:hover { background: var(--surface-2); }
.log-line.warn { background: #fffdf7; }
.log-line.error { background: #fff8f7; }
.log-time {
	font-family: var(--mono); font-size: 11px; color: var(--muted);
	flex: 0 0 62px; font-variant-numeric: tabular-nums;
}
.log-kind { flex: 0 0 auto; min-width: 74px; justify-content: center; }
.log-acc {
	flex: 0 0 120px; font-weight: 600; white-space: nowrap;
	overflow: hidden; text-overflow: ellipsis;
}
.log-acc.muted { color: var(--muted); font-weight: 400; }
.log-msg { flex: 1; min-width: 0; word-break: break-word; }
.log-line.error .log-msg { color: var(--red); }
.log-line.warn .log-msg { color: var(--amber); }

.live-log {
	background: #0f1419; color: #d5dde5; border-radius: var(--radius-sm);
	font-family: var(--mono); font-size: 11.5px; line-height: 1.6;
	padding: 10px 12px; max-height: 260px; overflow-y: auto; margin-top: 12px;
}
.live-log div { white-space: pre-wrap; word-break: break-word; }
.live-log .warn { color: #f0c674; }
.live-log .error { color: #ff8f80; }
.live-log .muted { color: #6b7a88; }

.view-toggle { display: flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.view-toggle button {
	border: 0; background: var(--surface); font: inherit; font-size: 12px; font-weight: 550;
	padding: 6px 11px; cursor: pointer; color: var(--text-2);
}
.view-toggle button + button { border-left: 1px solid var(--border-strong); }
.view-toggle button.active { background: var(--primary); color: #fff; }

.step-num {
	display: inline-grid; place-items: center; width: 20px; height: 20px;
	border-radius: 50%; background: var(--primary); color: #fff;
	font-size: 11px; font-weight: 700; margin-right: 8px;
}
