/* PDF Tools — в стиле темы Admin-Lic: тёмные карточки, янтарные акценты. Всё изолировано в .apt-app */

.apt-root {
	--apt-card: #252a35;
	--apt-card-2: #2a303c;
	--apt-line: rgba(255, 255, 255, .075);
	--apt-line-2: rgba(255, 255, 255, .12);
	--apt-text: #e3e6ed;
	--apt-muted: #949bab;
	--apt-faint: #6f7686;
	--apt-amber: #845adf;
	--apt-amber-2: #9e7bea;
	--apt-amber-ink: #ffffff;
	--apt-amber-soft: rgba(132, 90, 223, .12);
	--apt-green: #34d399;
	--apt-green-soft: rgba(52, 211, 153, .12);
	--apt-red: #f87171;
	--apt-red-soft: rgba(248, 113, 113, .13);
	--apt-blue: #60a5fa;
	--apt-blue-soft: rgba(96, 165, 250, .12);
	--apt-violet: #a78bfa;
	--apt-violet-soft: rgba(167, 139, 250, .12);
	--apt-well: rgba(0, 0, 0, .2);
	--apt-radius: 10px;
	--apt-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 18px 40px -24px rgba(0, 0, 0, .7);

	display: block;
	max-width: 100%;
	color: var(--apt-text);
	font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
	font-size: 14px;
	line-height: 1.45;
}

html[data-theme="light"] .apt-root {
	--apt-card: #ffffff;
	--apt-card-2: #f9fafc;
	--apt-line: rgba(15, 23, 42, .08);
	--apt-line-2: rgba(15, 23, 42, .14);
	--apt-text: #232a3b;
	--apt-muted: #737985;
	--apt-faint: #98a2b3;
	--apt-amber: #7448d4;
	--apt-amber-2: #845adf;
	--apt-amber-soft: rgba(132, 90, 223, .12);
	--apt-well: rgba(15, 23, 42, .04);
	--apt-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 32px -20px rgba(15, 23, 42, .25);
}

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

.apt-app {
	position: relative;
	outline: none;
}

.apt-app svg {
	width: 16px;
	height: 16px;
	flex: none;
	display: block;
}

.apt-app h1,
.apt-app h2,
.apt-app h3,
.apt-app p {
	margin: 0;
	padding: 0;
	letter-spacing: normal;
	text-transform: none;
}

.apt-app [hidden] {
	display: none !important;
}

.apt-sr-only {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
	padding: 0 !important;
	margin: -1px !important;
}

/* ---------- Шапка и вкладки ---------- */
.apt-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

.apt-eyebrow {
	color: var(--apt-amber);
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .14em;
	text-transform: uppercase;
	margin-bottom: 4px;
}

.apt-app .apt-title {
	font-size: clamp(22px, 2.4vw, 28px);
	font-weight: 800;
	line-height: 1.15;
	color: var(--apt-text);
	font-family: inherit;
}

.apt-app .apt-sub {
	color: var(--apt-muted);
	margin-top: 6px;
	max-width: 680px;
}

.apt-head-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.apt-pill {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 7px 12px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	color: var(--apt-green);
	background: var(--apt-green-soft);
	border: 1px solid rgba(52, 211, 153, .22);
}

.apt-pill svg {
	width: 14px;
	height: 14px;
}

.apt-tabs {
	display: inline-flex;
	gap: 4px;
	padding: 4px;
	margin-bottom: 16px;
	border-radius: 13px;
	background: var(--apt-well);
	border: 1px solid var(--apt-line);
	max-width: 100%;
}

.apt-app .apt-tabs button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: var(--apt-muted);
	font: inherit;
	font-weight: 700;
	font-size: 13.5px;
	cursor: pointer;
	transition: background .15s, color .15s;
}

.apt-app .apt-tabs button:hover {
	color: var(--apt-text);
}

.apt-app .apt-tabs button.is-active {
	color: var(--apt-amber-ink);
	background: linear-gradient(180deg, var(--apt-amber-2), var(--apt-amber));
	box-shadow: 0 6px 18px -8px rgba(132, 90, 223, .8);
}

/* ---------- Кнопки ---------- */
.apt-app button {
	font: inherit;
	margin: 0;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
	min-height: 0;
	line-height: 1.2;
}

.apt-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 40px;
	padding: 0 16px;
	border-radius: 11px;
	border: 1px solid var(--apt-line-2);
	background: var(--apt-card-2);
	color: var(--apt-text);
	font-weight: 700;
	font-size: 13.5px;
	cursor: pointer;
	white-space: nowrap;
	transition: background .15s, border-color .15s, transform .1s, opacity .15s;
}

.apt-btn:hover:not(:disabled) {
	border-color: rgba(132, 90, 223, .45);
	background: var(--apt-amber-soft);
}

.apt-btn:active:not(:disabled) {
	transform: translateY(1px);
}

.apt-btn:disabled,
.apt-icon-btn:disabled {
	opacity: .42;
	cursor: not-allowed;
}

.apt-btn--primary {
	background: linear-gradient(180deg, var(--apt-amber-2), var(--apt-amber));
	border-color: transparent;
	color: var(--apt-amber-ink);
	box-shadow: 0 8px 22px -10px rgba(132, 90, 223, .7);
}

.apt-btn--primary:hover:not(:disabled) {
	background: linear-gradient(180deg, #a988f0, var(--apt-amber-2));
	border-color: transparent;
}

.apt-btn--ghost {
	background: transparent;
}

.apt-btn--danger:not(:disabled) {
	color: #fff;
	border-color: transparent;
	background: linear-gradient(180deg, #fb8a8a, #ef5b5b);
	box-shadow: 0 6px 18px -8px rgba(239, 91, 91, .85);
}

.apt-btn--danger:hover:not(:disabled) {
	background: linear-gradient(180deg, #fd9c9c, #f26b6b);
	border-color: transparent;
}

.apt-btn--sm {
	height: 34px;
	padding: 0 12px;
	font-size: 12.5px;
	border-radius: 10px;
}

.apt-icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border-radius: 10px;
	border: 1px solid var(--apt-line-2);
	background: var(--apt-card-2);
	color: var(--apt-text);
	cursor: pointer;
	transition: border-color .15s, color .15s;
}

.apt-icon-btn:hover:not(:disabled) {
	color: var(--apt-amber);
	border-color: rgba(132, 90, 223, .45);
}

.apt-icon-btn--sm {
	width: 30px;
	height: 30px;
	border-radius: 8px;
}

.apt-app button:focus-visible,
.apt-app input:focus-visible,
.apt-app select:focus-visible {
	outline: 2px solid var(--apt-amber);
	outline-offset: 2px;
}

/* ---------- Карточки ---------- */
.apt-card {
	background: linear-gradient(180deg, var(--apt-card-2), var(--apt-card));
	border: 1px solid var(--apt-line);
	border-radius: var(--apt-radius);
	box-shadow: var(--apt-shadow);
	padding: 20px;
	min-width: 0;
	margin-bottom: 16px;
}

.apt-card-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 14px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

.apt-app .apt-card-head h3 {
	font-size: 16px;
	font-weight: 800;
	color: var(--apt-text);
	font-family: inherit;
	line-height: 1.3;
}

.apt-app .apt-card-head p {
	font-size: 12.5px;
	color: var(--apt-muted);
	margin-top: 3px;
}

.apt-card-head p b {
	color: var(--apt-text);
	font-weight: 700;
}

/* ---------- Загрузка ---------- */
.apt-upload {
	padding: 10px;
}

.apt-drop {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 14px;
	padding: 40px 20px 28px;
	border-radius: 12px;
	border: 1.5px dashed var(--apt-line-2);
	background: radial-gradient(600px 220px at 50% 0%, rgba(132, 90, 223, .09), transparent 70%);
	transition: border-color .2s, background-color .2s;
}

.apt-drop.is-over,
.apt-boardcard.is-over {
	border-color: var(--apt-amber);
	background-color: var(--apt-amber-soft);
}

.apt-drop-icon {
	width: 60px;
	height: 60px;
	border-radius: 18px;
	display: grid;
	place-items: center;
	color: var(--apt-amber);
	background: var(--apt-amber-soft);
	border: 1px solid rgba(132, 90, 223, .28);
	box-shadow: 0 0 40px -6px rgba(132, 90, 223, .45);
}

.apt-drop-icon svg {
	width: 26px;
	height: 26px;
}

.apt-drop-text {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.apt-drop-text strong {
	font-size: 17px;
	font-weight: 800;
}

.apt-drop-text span {
	color: var(--apt-muted);
	font-size: 13px;
}

.apt-drop-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	justify-content: center;
}

.apt-limits {
	color: var(--apt-faint);
	font-size: 12px;
}

.apt-queue {
	list-style: none;
	margin: 0;
	padding: 0 6px;
}

.apt-queue:not(:empty) {
	padding: 10px 6px 4px;
}

.apt-queue li {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 10px;
	margin: 0 0 6px;
	border-radius: 10px;
	border: 1px solid var(--apt-line);
	background: var(--apt-well);
}

.apt-q-ic {
	color: var(--apt-amber);
}

.apt-q-name {
	font-weight: 700;
	min-width: 0;
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.apt-q-meta {
	color: var(--apt-muted);
	font-size: 12px;
	flex: none;
}

.apt-q-status {
	font-size: 12px;
	font-weight: 600;
	color: var(--apt-muted);
	max-width: 50%;
	text-align: right;
}

.apt-queue li.is-run .apt-q-status {
	color: var(--apt-amber);
}

.apt-queue li.is-ok .apt-q-status {
	color: var(--apt-green);
}

.apt-queue li.is-fail {
	border-color: rgba(248, 113, 113, .35);
	background: var(--apt-red-soft);
}

.apt-queue li.is-fail .apt-q-status {
	color: var(--apt-red);
}

/* ---------- Прогресс ---------- */
.apt-progress {
	padding: 12px 8px 6px;
}

.apt-progress--inline {
	padding: 14px 0 0;
}

.apt-progress-top {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	font-size: 12.5px;
	font-weight: 700;
	margin-bottom: 8px;
}

.apt-progress-top span:last-child {
	color: var(--apt-amber);
	font-variant-numeric: tabular-nums;
}

.apt-bar {
	position: relative;
	height: 6px;
	border-radius: 99px;
	background: var(--apt-well);
	overflow: hidden;
}

.apt-bar i {
	position: absolute;
	inset: 0 auto 0 0;
	width: 0;
	border-radius: inherit;
	background: linear-gradient(90deg, var(--apt-amber), var(--apt-amber-2));
	box-shadow: 0 0 14px rgba(132, 90, 223, .6);
	transition: width .2s ease;
}

.apt-bar.is-indeterminate i {
	width: 35% !important;
	animation: apt-indet 1.1s ease-in-out infinite;
}

@keyframes apt-indet {
	0% { left: -35%; }
	100% { left: 100%; }
}

/* ---------- KPI ---------- */
.apt-kpis {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 14px;
	margin-bottom: 16px;
}

.apt-kpi {
	--tone: var(--apt-amber);
	--tone-soft: var(--apt-amber-soft);
	display: flex;
	gap: 14px;
	align-items: flex-start;
	padding: 16px 16px 16px 18px;
	border-radius: 14px;
	border: 1px solid var(--apt-line);
	background: linear-gradient(180deg, var(--apt-card-2), var(--apt-card));
	box-shadow: inset 2px 0 0 var(--tone), var(--apt-shadow);
	min-width: 0;
}

.apt-kpi--blue { --tone: var(--apt-blue); --tone-soft: var(--apt-blue-soft); }
.apt-kpi--green { --tone: var(--apt-green); --tone-soft: var(--apt-green-soft); }
.apt-kpi--violet { --tone: var(--apt-violet); --tone-soft: var(--apt-violet-soft); }

.apt-kpi-ic {
	width: 36px;
	height: 36px;
	border-radius: 10px;
	display: grid;
	place-items: center;
	color: var(--tone);
	background: var(--tone-soft);
	flex: none;
}

.apt-kpi-body {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.apt-kpi-body span {
	font-size: 12px;
	color: var(--apt-muted);
	font-weight: 600;
}

.apt-kpi-body b {
	font-size: 22px;
	font-weight: 800;
	line-height: 1.25;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.apt-kpi-body small {
	font-size: 11.5px;
	color: var(--apt-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ---------- Панель инструментов ---------- */
.apt-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px 16px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

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

.apt-size {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 12px;
	font-weight: 700;
	color: var(--apt-muted);
}

.apt-app input[type="range"] {
	-webkit-appearance: none;
	appearance: none;
	width: 120px;
	height: 4px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 99px;
	background: var(--apt-line-2);
	cursor: pointer;
}

.apt-app input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--apt-amber);
	border: 2px solid var(--apt-card);
	box-shadow: 0 0 0 1px var(--apt-amber);
}

.apt-app input[type="range"]::-moz-range-thumb {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--apt-amber);
	border: 2px solid var(--apt-card);
}

/* ---------- Сетка страниц ---------- */
.apt-board-wrap {
	position: relative;
	min-height: 120px;
	padding: 16px;
	border-radius: 12px;
	border: 1px solid var(--apt-line);
	background: var(--apt-well);
}

.apt-board {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(calc(var(--apt-thumb, 150px) + 20px), 1fr));
	gap: 16px;
	user-select: none;
	-webkit-user-select: none;
	touch-action: pan-y;
}

.apt-page {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 10px 10px 8px;
	border-radius: 12px;
	border: 1px solid transparent;
	cursor: grab;
	transition: background .12s, border-color .12s, opacity .15s;
}

.apt-page:hover {
	background: rgba(255, 255, 255, .03);
	border-color: var(--apt-line);
}

html[data-theme="light"] .apt-page:hover {
	background: rgba(15, 23, 42, .03);
}

.apt-page.is-selected {
	background: var(--apt-amber-soft);
	border-color: rgba(132, 90, 223, .55);
}

.is-dragging .apt-page.is-selected {
	opacity: .3;
}

.is-dragging .apt-board,
.is-dragging .apt-page {
	cursor: grabbing;
}

.apt-thumb {
	position: relative;
	width: var(--apt-thumb, 150px);
	height: calc(var(--apt-thumb, 150px) * 1.414);
	display: grid;
	place-items: center;
}

.apt-thumb canvas {
	display: block;
	max-width: 100%;
	max-height: 100%;
	border-radius: 4px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 22px -10px rgba(0, 0, 0, .6);
}

.apt-page.is-loading .apt-thumb canvas {
	width: 100%;
	height: 100%;
	background: linear-gradient(110deg, rgba(255, 255, 255, .04) 30%, rgba(255, 255, 255, .1) 50%, rgba(255, 255, 255, .04) 70%) 0 0 / 200% 100%;
	box-shadow: none;
	animation: apt-shimmer 1.2s linear infinite;
}

.apt-page.is-error .apt-thumb canvas {
	background: var(--apt-red-soft);
	animation: none;
}

@keyframes apt-shimmer {
	to { background-position: -200% 0; }
}

.apt-page.is-selected .apt-thumb canvas {
	box-shadow: 0 0 0 3px var(--apt-amber), 0 10px 26px -10px rgba(132, 90, 223, .6);
}

.apt-page-foot {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	max-width: var(--apt-thumb, 150px);
	min-width: 0;
}

.apt-num {
	flex: none;
	min-width: 24px;
	height: 22px;
	padding: 0 6px;
	border-radius: 7px;
	display: inline-grid;
	place-items: center;
	font-size: 11.5px;
	font-weight: 800;
	color: var(--apt-text);
	background: var(--apt-line-2);
}

.apt-page.is-selected .apt-num {
	color: var(--apt-amber-ink);
	background: var(--apt-amber);
}

.apt-src {
	display: flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
	font-size: 11px;
	color: var(--apt-muted);
}

.apt-src i {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	flex: none;
}

.apt-src-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.apt-check {
	position: absolute;
	top: 4px;
	left: 4px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	color: var(--apt-amber-ink);
	background: var(--apt-amber);
	box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
	opacity: 0;
	transform: scale(.6);
	transition: opacity .12s, transform .12s;
	pointer-events: none;
}

.apt-check svg {
	width: 13px;
	height: 13px;
	stroke-width: 3;
}

.apt-page.is-selected .apt-check {
	opacity: 1;
	transform: none;
}

.apt-page-tools {
	position: absolute;
	top: 14px;
	right: 14px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	opacity: 0;
	transition: opacity .12s;
}

.apt-page:hover .apt-page-tools,
.apt-page:focus-within .apt-page-tools {
	opacity: 1;
}

.is-dragging .apt-page-tools {
	display: none;
}

.apt-app .apt-page-tools button {
	width: 28px;
	height: 28px;
	padding: 0;
	display: grid;
	place-items: center;
	border-radius: 8px;
	border: 1px solid rgba(255, 255, 255, .14);
	background: rgba(13, 18, 24, .85);
	color: #e3e6ed;
	cursor: pointer;
	backdrop-filter: blur(4px);
}

.apt-app .apt-page-tools button:hover {
	color: var(--apt-amber);
	border-color: var(--apt-amber);
}

.apt-app .apt-page-tools button.apt-danger:hover {
	color: var(--apt-red);
	border-color: var(--apt-red);
}

.apt-page-tools svg {
	width: 14px;
	height: 14px;
}

.apt-lasso {
	position: absolute;
	z-index: 4;
	border: 1.5px solid var(--apt-amber);
	border-radius: 4px;
	background: rgba(132, 90, 223, .14);
	pointer-events: none;
}

.apt-board-wrap {
	cursor: crosshair;
}

.is-lasso,
.is-lasso * {
	user-select: none;
	-webkit-user-select: none;
}

.apt-marker {
	position: absolute;
	width: 4px;
	border-radius: 4px;
	background: var(--apt-amber);
	box-shadow: 0 0 14px rgba(132, 90, 223, .9);
	pointer-events: none;
	z-index: 3;
}

.apt-board-empty {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 28px 8px;
	color: var(--apt-muted);
}

.apt-board-empty svg {
	width: 22px;
	height: 22px;
	color: var(--apt-amber);
}

.apt-ghost {
	position: fixed;
	left: 0;
	top: 0;
	z-index: 100000;
	pointer-events: none;
	padding: 6px;
	border-radius: 10px;
	background: var(--apt-card-2);
	border: 1px solid var(--apt-amber);
	box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .7);
}

.apt-ghost canvas {
	display: block;
	border-radius: 3px;
	background: #fff;
}

.apt-ghost.is-stack {
	box-shadow: 6px 6px 0 -1px var(--apt-card-2), 6px 6px 0 0 var(--apt-amber), 0 18px 40px -12px rgba(0, 0, 0, .7);
}

.apt-ghost-count {
	position: absolute;
	top: -10px;
	right: -10px;
	min-width: 26px;
	height: 26px;
	padding: 0 7px;
	border-radius: 13px;
	display: grid;
	place-items: center;
	font-weight: 800;
	font-size: 12px;
	color: var(--apt-amber-ink);
	background: var(--apt-amber);
}

.apt-hint {
	margin-top: 12px;
	font-size: 11.5px;
	color: var(--apt-faint);
	line-height: 1.9;
}

.apt-hint kbd {
	font: 600 10.5px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	padding: 2px 6px;
	border-radius: 5px;
	border: 1px solid var(--apt-line-2);
	background: rgba(255, 255, 255, .03);
	color: var(--apt-muted);
}

/* ---------- Формы ---------- */
.apt-grid2 {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 16px;
	align-items: start;
}

.apt-grid2 > .apt-card {
	margin-bottom: 0;
}

.apt-fields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.apt-imgcard {
	margin-top: 16px;
	margin-bottom: 0;
}

.apt-fields--4 {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.apt-badge {
	display: inline-flex;
	align-items: center;
	height: 26px;
	padding: 0 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 800;
	color: var(--apt-amber);
	background: var(--apt-amber-soft);
	border: 1px solid rgba(132, 90, 223, .25);
	white-space: nowrap;
}

.apt-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
	min-width: 0;
}

.apt-field--full {
	grid-column: 1 / -1;
}

.apt-field > span {
	font-size: 11.5px;
	font-weight: 700;
	color: var(--apt-muted);
}

.apt-app .apt-field input,
.apt-app .apt-field select {
	width: 100%;
	height: 40px;
	padding: 0 12px;
	margin: 0;
	border-radius: 10px;
	border: 1px solid var(--apt-line-2);
	background-color: var(--apt-well);
	color: var(--apt-text);
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	box-shadow: none;
}

html[data-theme="light"] .apt-app .apt-field input,
html[data-theme="light"] .apt-app .apt-field select {
	background-color: #fff;
}

.apt-app .apt-field select option {
	background: var(--apt-card);
	color: var(--apt-text);
}

.apt-note {
	margin: 12px 0 0 !important;
	font-size: 12.5px;
	color: var(--apt-muted);
	min-height: 18px;
}

.apt-note--hint {
	margin-top: 12px !important;
	padding: 10px 12px;
	border-radius: 10px;
	border: 1px dashed var(--apt-line-2);
	font-size: 12px;
	line-height: 1.55;
}

.apt-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 16px;
}

.apt-actions .apt-btn {
	flex: 1 1 170px;
}

/* ---------- Сжатие ---------- */
.apt-level-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
}

.apt-level {
	position: relative;
	margin: 0;
	cursor: pointer;
}

.apt-level input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.apt-level-ui {
	display: flex;
	flex-direction: column;
	gap: 4px;
	height: 100%;
	padding: 14px 16px 14px 44px;
	border-radius: 12px;
	border: 1px solid var(--apt-line-2);
	background: var(--apt-well);
	position: relative;
	transition: border-color .15s, background .15s;
}

.apt-level-ui::before {
	content: "";
	position: absolute;
	left: 16px;
	top: 16px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 2px solid var(--apt-line-2);
}

.apt-level-ui b {
	font-size: 14px;
	font-weight: 800;
}

.apt-level-ui small {
	font-size: 12px;
	color: var(--apt-muted);
}

.apt-level input:checked + .apt-level-ui {
	border-color: var(--apt-amber);
	background: var(--apt-amber-soft);
}

.apt-level input:checked + .apt-level-ui::before {
	border-color: var(--apt-amber);
	background: radial-gradient(circle, var(--apt-amber) 0 4px, transparent 5px);
}

.apt-level input:focus-visible + .apt-level-ui {
	outline: 2px solid var(--apt-amber);
	outline-offset: 2px;
}

.apt-clist {
	list-style: none;
	margin: 0;
	padding: 0;
}

.apt-clist li {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 0;
	margin: 0;
	border-bottom: 1px solid var(--apt-line);
}

.apt-clist li:last-child {
	border-bottom: 0;
}

.apt-c-ic {
	width: 38px;
	height: 38px;
	border-radius: 10px;
	display: grid;
	place-items: center;
	color: var(--apt-amber);
	background: var(--apt-amber-soft);
	flex: none;
}

.apt-c-main {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.apt-c-top {
	display: flex;
	justify-content: space-between;
	gap: 12px;
}

.apt-c-name {
	font-weight: 700;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	min-width: 0;
}

.apt-c-sizes {
	flex: none;
	font: 600 12px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	color: var(--apt-muted);
}

.apt-c-msg {
	font-size: 12px;
	color: var(--apt-muted);
}

.apt-clist li.is-ok .apt-c-bar i {
	background: linear-gradient(90deg, var(--apt-green), #6ee7b7);
	box-shadow: 0 0 12px rgba(52, 211, 153, .5);
}

.apt-clist li.is-err .apt-c-msg {
	color: var(--apt-red);
}

.apt-c-pct {
	flex: none;
	min-width: 54px;
	text-align: right;
	font-size: 18px;
	font-weight: 800;
	color: var(--apt-green);
	font-variant-numeric: tabular-nums;
}

.apt-c-actions {
	display: flex;
	align-items: center;
	gap: 6px;
	flex: none;
}

/* ---------- Просмотр ---------- */
.apt-modal {
	position: fixed;
	inset: 0;
	z-index: 100001;
	display: grid;
	place-items: center;
	padding: 24px;
}

.apt-modal-back {
	position: absolute;
	inset: 0;
	background: rgba(4, 7, 11, .78);
	backdrop-filter: blur(4px);
}

.apt-modal-box {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(1040px, 100%);
	max-height: calc(100vh - 48px);
	border-radius: 16px;
	border: 1px solid var(--apt-line-2);
	background: var(--apt-card);
	box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8);
	overflow: hidden;
}

.apt-modal-box header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 14px 12px 18px;
	border-bottom: 1px solid var(--apt-line);
	font-weight: 700;
	font-size: 13px;
}

.apt-modal-body {
	overflow: auto;
	padding: 16px;
	min-height: 200px;
	background: var(--apt-well);
}

.apt-modal-body canvas {
	display: block;
	margin: 0 auto;
	max-width: 100%;
	height: auto;
	background: #fff;
	border-radius: 4px;
}

.apt-modal-body.is-loading {
	opacity: .6;
}

/* ---------- Тост ---------- */
.apt-toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	z-index: 100002;
	max-width: min(620px, calc(100vw - 32px));
	padding: 12px 16px;
	border-radius: 12px;
	font-weight: 700;
	font-size: 13px;
	white-space: pre-line;
	color: var(--apt-text);
	background: var(--apt-card-2);
	border: 1px solid var(--apt-line-2);
	box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .6);
	transform: translate(-50%, 20px);
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s, transform .2s;
}

.apt-toast.is-show {
	opacity: 1;
	transform: translate(-50%, 0);
}

.apt-toast.is-ok {
	border-color: rgba(52, 211, 153, .45);
}

.apt-toast.is-error {
	border-color: rgba(248, 113, 113, .55);
	color: var(--apt-red);
}

.apt-login-required {
	padding: 16px 18px;
	border-radius: 12px;
	border: 1px solid rgba(132, 90, 223, .35);
	background: rgba(132, 90, 223, .08);
}

/* ---------- Адаптив ---------- */
@media (max-width: 1100px) {
	.apt-kpis {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.apt-grid2,
	.apt-level-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.apt-fields--4 {
		grid-template-columns: 1fr 1fr;
	}
}

@media (max-width: 640px) {
	.apt-card {
		padding: 16px;
	}

	.apt-kpi {
		padding: 12px;
		gap: 10px;
	}

	.apt-kpi-ic {
		display: none;
	}

	.apt-kpi-body b {
		font-size: 18px;
	}

	.apt-tabs {
		display: flex;
	}

	.apt-app .apt-tabs button {
		flex: 1;
		justify-content: center;
		padding: 10px 8px;
	}

	.apt-board-wrap {
		padding: 10px;
	}

	.apt-board {
		gap: 8px;
	}

	.apt-page-tools {
		opacity: 1;
	}

	.apt-fields {
		grid-template-columns: 1fr;
	}

	.apt-clist li {
		flex-wrap: wrap;
	}

	.apt-c-actions {
		width: 100%;
		justify-content: flex-end;
	}

	.apt-hint {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.apt-app *,
	.apt-app *::before,
	.apt-app *::after {
		animation: none !important;
		transition: none !important;
	}
}
