:root {
	--demo-bg: #f5f6f8;
	--demo-card: #ffffff;
	--demo-border: #dde2ea;
	--demo-text: #1d2433;
	--demo-muted: #7d8597;
	--demo-success: #27c46b;
	--demo-danger: #e94b63;
	--demo-warning: #ffb547;
	--demo-blue: #dfeefa;
	--demo-green: #dff4e5;
	--demo-purple: #ece8fb;
}

body {
	background: var(--demo-bg);
	color: var(--demo-text);
}

.demo-body {
	position: relative;
	padding: 24px 16px 40px;
}

.page-content {
	display: none;
}
.page-content.active {
	display: block;
}

/* В шапке: слева от баланса (см. dashboard_header) */
.dashboard-header .demo-mode-badge {
	position: static;
	flex-shrink: 0;
	margin: 0;
}

.demo-mode-badge {
	background: rgba(29, 36, 51, 0.92);
	color: #fff;
	padding: 6px 12px;
	border-radius: 999px;
	font-size: 12px;
	display: inline-flex;
	gap: 6px;
	align-items: center;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
	white-space: nowrap;
}

.metric-card,
.analytics-card,
.card,
.list-group-item,
.filters-and-summary-card {
	background: var(--demo-card) !important;
	border: 1px solid var(--demo-border);
	box-shadow: 0 4px 14px rgba(38, 48, 74, 0.06);
}

body[data-theme='dark'] .metric-card,
body[data-theme='dark'] .analytics-card,
body[data-theme='dark'] .card,
body[data-theme='dark'] .list-group-item,
body[data-theme='dark'] .filters-and-summary-card {
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.metric-card.balance,
.metric-card.week {
	background: var(--demo-blue) !important;
}
.metric-card.processed {
	background: var(--demo-green) !important;
}
.metric-card.today,
.metric-card.pending {
	background: var(--demo-purple) !important;
}
.metric-card.qr-overview-card {
	background: #dcefdc !important;
}

.analytics-card {
	border-radius: 14px;
	padding: 18px;
	margin-bottom: 18px;
}

.analytics-card h3 {
	font-size: 18px;
	margin-bottom: 12px;
	font-weight: 700;
}

.analytics-draggable,
.social-analytics-grid,
.reviews-analytics-grid,
.cross-grid {
	min-height: 120px;
}

.analytics-draggable.drag-active .analytics-card,
.social-analytics-grid.drag-active .analytics-card,
.reviews-analytics-grid.drag-active .analytics-card,
.cross-grid.drag-active .analytics-card {
	cursor: grab;
}

.chart-box {
	min-height: 220px;
	position: relative;
}

.chart-note {
	color: var(--demo-muted);
	font-size: 12px;
	margin-top: 10px;
}

.placeholder-card-body {
	min-height: 100px;
	display: flex;
	align-items: center;
}

.post-card-demo {
	border: 1px solid var(--demo-border);
	border-radius: 10px;
	padding: 12px;
	margin-bottom: 12px;
}
.post-card-demo__header {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	font-size: 12px;
	margin-bottom: 8px;
}
.post-badge,
.demo-chip {
	background: #2bc46d;
	color: white;
	border-radius: 999px;
	padding: 4px 10px;
	font-size: 12px;
	display: inline-flex;
	align-items: center;
}
.post-id {
	color: var(--demo-muted);
}
.post-card-demo__title {
	font-weight: 600;
	margin-bottom: 8px;
}
.post-card-demo__meta {
	font-size: 13px;
	color: var(--demo-muted);
}
.demo-chip-row {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 12px;
}
.metric-list-demo > div {
	display: flex;
	justify-content: space-between;
	padding: 10px 0;
	border-bottom: 1px solid var(--demo-border);
}
.metric-list-demo > div:last-child {
	border-bottom: 0;
}
.big-center-metric {
	min-height: 120px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	font-weight: 700;
	font-size: 34px;
}
.big-center-metric.danger {
	color: var(--demo-danger);
}
.metric-sub {
	font-size: 12px;
	color: var(--demo-muted);
	font-weight: 400;
}
.mini-metric-grid {
	display: grid;
	gap: 12px;
}
.mini-metric-grid.three {
	grid-template-columns: repeat(3, 1fr);
}
.mini-metric-grid.two {
	grid-template-columns: repeat(2, 1fr);
}
.mini-metric-card {
	border: 1px solid var(--demo-border);
	border-radius: 10px;
	padding: 12px;
}
.mini-metric-card strong {
	display: block;
	font-size: 28px;
	margin-top: 6px;
}
.metric-soft {
	border: 1px solid var(--demo-border);
	border-radius: 10px;
	padding: 10px 12px;
	min-width: 150px;
}
.metric-soft span {
	display: block;
	color: var(--demo-muted);
	font-size: 12px;
}
.metric-soft strong {
	font-size: 28px;
}
.review-grid-top {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}
.analysis-form-demo label {
	font-size: 12px;
	color: var(--demo-muted);
	margin-bottom: 6px;
}
.months-list {
	min-height: 110px;
	border: 1px solid var(--demo-border);
	border-radius: 8px;
	padding: 10px;
}
.rating-extremes {
	display: grid;
	gap: 12px;
	grid-template-columns: 1fr 1fr;
}
.extreme-card {
	border-radius: 12px;
	padding: 12px;
	border: 1px solid var(--demo-border);
}
.extreme-card.bad {
	background: #fff3f5;
}
.extreme-card.good {
	background: #ecfff3;
}
.extreme-card span {
	display: block;
	color: var(--demo-muted);
	font-size: 12px;
}
.extreme-card strong {
	font-size: 30px;
}
.attention-card {
	border: 1px solid var(--demo-border);
	border-radius: 10px;
	padding: 12px;
}
.attention-card__top {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 10px;
}
.cross-grid {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr;
	gap: 16px;
}
.history-card-full {
	min-height: 360px;
}
.simple-list {
	margin: 0;
	padding-left: 18px;
}
.simple-list li {
	margin-bottom: 10px;
}

.client-billing-page .card.shadow {
	border-radius: 14px;
}
.stream-top-bar {
	padding: 6px 4px 10px;
}
.demo-info-line {
	color: var(--demo-muted);
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
}
.demo-dot {
	width: 10px;
	height: 10px;
	background: var(--demo-success);
	border-radius: 50%;
	display: inline-block;
}
/* Фон и рамка задаёт .controls-toolbar из main.css (как в основном проекте) */
.demo-stream-controls {
	position: sticky;
	top: 0;
	z-index: 4;
	margin-bottom: 12px;
}

/* Вкладка «Все»: поиск обёрнут в .guide-target — даём обёртке flex, иначе раскрытый поиск не на всю ширину */
#stream #all .demo-stream-controls > .guide-target {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	align-items: center;
}

#stream
	#all
	.demo-stream-controls
	> .guide-target
	.animated-search-group[data-expanded='true'] {
	width: 100%;
	max-width: 100%;
	flex: 1 1 auto;
}

/* Поток: разметка как в основном проекте (animated_search + platform/tonality dropdowns из main.css) */
#stream .demo-stream-controls .platform-dropdown-button,
#stream .demo-stream-controls .tonality-dropdown-button {
	min-height: 40px;
}

body[data-theme='dark']
	#stream
	.demo-stream-controls
	.settings-btn.btn-outline-secondary {
	background: transparent !important;
	border-color: var(--border-color) !important;
	color: var(--text-primary) !important;
}

body[data-theme='dark']
	#stream
	.demo-stream-controls
	.settings-btn.btn-outline-secondary:hover {
	background: var(--bg-tertiary) !important;
	border-color: var(--border-color) !important;
	color: var(--text-primary) !important;
}

/* Светлая тема: убираем «жёсткий» белый фон из demo для кнопки настроек в потоке */
body[data-theme='light']
	#stream
	.demo-stream-controls
	.settings-btn.btn-outline-secondary,
[data-theme='light']
	#stream
	.demo-stream-controls
	.settings-btn.btn-outline-secondary {
	background: transparent !important;
	border-color: var(--border-color) !important;
	color: var(--text-primary) !important;
}

.search-toggle-wrapper {
	display: flex;
	align-items: center;
	gap: 10px;
	background: #fff;
	border: 1px solid var(--demo-border);
	border-radius: 999px;
	padding: 8px 14px;
	min-width: 300px;
}
.search-toggle-wrapper .form-control {
	border: 0;
	box-shadow: none !important;
	padding: 0;
}
.demo-select {
	min-width: 180px;
}
.sort-toggle-btn {
	border: 1px solid var(--demo-border);
	background: #fff;
	border-radius: 999px;
	padding: 9px 18px;
}
.sort-toggle-btn.active {
	background: #dcdcff;
}
.settings-btn {
	border: 1px solid var(--demo-border);
	background: #fff;
	border-radius: 12px;
	padding: 9px 16px;
}
.demo-checkbox-pill {
	border: 1px solid var(--demo-border);
	background: #fff;
	border-radius: 999px;
	padding: 9px 14px;
	display: flex;
	align-items: center;
	gap: 8px;
}
.demo-checkbox-pill.active {
	background: #ececff;
}

.list-group-item.demo-hidden,
tr.demo-hidden,
.mobile-card.demo-hidden {
	display: none !important;
}

.list-group-item.demo-approved {
	border-left: 5px solid var(--demo-success);
	background: #f2fff7 !important;
}
.list-group-item.demo-rejected {
	border-left: 5px solid var(--demo-danger);
	background: #fff4f6 !important;
}
.list-group-item.demo-sent {
	border-left: 5px solid #4c7cf0;
	background: #f5f8ff !important;
}
.list-group-item.flash-item {
	animation: flashPulse 1.4s ease 3;
}
@keyframes flashPulse {
	0% {
		box-shadow: 0 0 0 0 rgba(39, 196, 107, 0.55);
	}
	70% {
		box-shadow: 0 0 0 16px rgba(39, 196, 107, 0);
	}
	100% {
		box-shadow: 0 0 0 0 rgba(39, 196, 107, 0);
	}
}

/* База: панель как в all_comments (controls-toolbar-all-comments из filters_search.css) */
#database .controls-toolbar {
	flex-direction: row;
	align-items: center;
	overflow-x: visible;
	min-width: 0;
}
#database .controls-toolbar-all-comments {
	align-items: center;
	flex-wrap: nowrap;
	gap: 0.75rem;
	min-width: 0;
}
#database .controls-toolbar-all-comments-form {
	flex: 1 1 0%;
	min-width: 0;
	max-width: 100%;
	width: auto;
}
#database .controls-toolbar-all-comments .search-container,
#database .controls-toolbar-all-comments .search-input-group {
	min-width: 0;
	max-width: 100%;
}
#database .controls-toolbar-all-comments .sort-toggle-container {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 0.75rem;
	justify-content: flex-end;
	flex: 0 0 auto;
}
#database .controls-toolbar-all-comments .three-way-toggle-wrapper,
#database .controls-toolbar-all-comments .filters-btn,
#database .controls-toolbar-all-comments .export-btn {
	flex-shrink: 0;
}

#databaseFilterToggle #filterIcon {
	display: inline-block;
	transition: transform 0.2s ease;
	transform-origin: center;
}

#databaseFilterToggle.active #filterIcon {
	transform: rotate(180deg);
}

#database .controls-toolbar {
	margin-bottom: 8px;
}
@media (max-width: 992px) {
	#database .controls-toolbar-all-comments {
		flex-direction: row;
		align-items: center;
	}
}
.segmented-tabs {
	display: inline-flex;
	background: #f0f1f5;
	border-radius: 999px;
	padding: 4px;
}
.segmented-tabs .seg {
	border: 0;
	background: transparent;
	border-radius: 999px;
	padding: 10px 16px;
}
.segmented-tabs .seg.active {
	background: #dcdcff;
}
.filter-pill {
	border-radius: 999px;
	padding-inline: 16px;
}
.demo-pagination {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	align-items: center;
	padding: 12px 0 0;
	color: var(--demo-muted);
}
.demo-pagination .right {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

#databasePagination .right {
	width: 100%;
	justify-content: center;
}

#databasePaginationInfo {
	font-size: 12px;
	white-space: nowrap;
}

.demo-floating-controls {
	position: fixed;
	right: 20px;
	bottom: 20px;
	display: flex;
	gap: 8px;
	z-index: 1400;
}

body[data-theme='dark'] #resetDemoBtn {
	color: #ffffff;
	border-color: #ffffff;
}

body[data-theme='dark'] #resetDemoBtn:hover {
	color: #ffffff;
	border-color: #ffffff;
	background-color: rgba(255, 255, 255, 0.12);
}

.guide-overlay.hidden {
	display: none;
}
.guide-overlay {
	position: fixed;
	inset: 0;
	/* Выше интерфейса кабинета; клоны подсказки — дочерние узлы, слой 4, карточка — 5 */
	z-index: 9500;
	pointer-events: auto;
}

/* Кнопка сворачивания сайдбара (z-index 9999) иначе оказывается поверх затемнения */
body.guide-tour-active .sidebar-toggle {
	z-index: 8000;
}
.guide-overlay--no-spotlight .guide-spotlight {
	background: transparent;
}
.guide-spotlight {
	position: absolute;
	inset: 0;
	z-index: 0;
	background: rgba(17, 22, 35, 0.66);
	clip-path: polygon(0 0, 0 100%, 100% 100%, 100% 0, 0 0);
	transition: clip-path 0.25s ease;
	pointer-events: none;
}
.guide-click-blocker {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: auto;
	cursor: default;
}
.guide-card {
	position: absolute;
	z-index: 5;
	width: min(360px, calc(100vw - 24px));
	background: #fff;
	border-radius: 16px;
	padding: 18px;
	box-shadow: 0 18px 42px rgba(0, 0, 0, 0.25);
	pointer-events: auto;
}
.guide-card__step {
	color: var(--demo-muted);
	font-size: 12px;
	margin-bottom: 8px;
}
.guide-card h3 {
	font-size: 18px;
	margin-bottom: 8px;
}
.guide-card p {
	margin-bottom: 12px;
}
.guide-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}
.guide-actions__nav {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}
.guide-actions .btn-secondary {
	background: #e9ecef;
	border-color: #dee2e6;
	color: #212529;
}
body[data-theme='dark'] .guide-actions .btn-secondary {
	background: #495057;
	border-color: #495057;
	color: #f8f9fa;
}
.guide-actions .btn-secondary:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}
.guide-target.guide-highlight,
.guide-highlight {
	position: relative;
	z-index: 9002 !important;
	box-shadow:
		0 0 0 4px rgba(39, 196, 107, 0.55),
		0 10px 30px rgba(0, 0, 0, 0.22) !important;
	border-radius: 12px;
}

.guide-highlight-parent {
	position: relative;
	z-index: 9001 !important;
}

.guide-promoted-clone {
	position: fixed;
	pointer-events: none;
}

.guide-promoted-clone--sidebar i {
	color: var(--bg-red) !important;
}

.guide-promoted-clone--analytics-blue {
	background: #ffffff !important;
	color: #007bff !important;
	border-color: #9bb7ff !important;
}

.guide-promoted-clone--analytics-blue i,
.guide-promoted-clone--analytics-blue span,
.guide-promoted-clone--analytics-blue {
	color: #007bff !important;
}

.guide-promoted-clone--database-filter {
	background: #ffffff !important;
	color: #111827;
	border: 1px solid #ffffff !important;
	border-radius: 12px;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	overflow: hidden;
	box-shadow:
		0 0 0 2px #ffffff !important,
		0 0 0 5px rgba(39, 196, 107, 0.9) !important;
}

.guide-promoted-clone--database-filter i,
.guide-promoted-clone--database-filter span {
	color: #111827;
}

.guide-promoted-clone--database-filter::before,
.guide-promoted-clone--database-filter::after {
	content: none;
	display: none;
}

body[data-theme='dark'] .guide-promoted-clone--analytics-blue {
	background: var(--bg-secondary) !important;
	color: var(--text-secondary) !important;
	border-color: var(--border-color) !important;
}

body[data-theme='dark'] .guide-promoted-clone--analytics-blue i,
body[data-theme='dark'] .guide-promoted-clone--analytics-blue span,
body[data-theme='dark'] .guide-promoted-clone--analytics-blue {
	color: var(--text-secondary) !important;
}

.toast-container {
	position: fixed;
	top: 90px;
	right: 20px;
	z-index: 1600;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.demo-toast {
	pointer-events: auto;
	min-width: 280px;
	background: #fff;
	border-radius: 12px;
	border: 1px solid var(--demo-border);
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
	padding: 14px 16px;
}
.demo-toast__title {
	font-weight: 700;
}
.demo-toast__text {
	color: var(--demo-muted);
	font-size: 13px;
}

.placeholder-card-body,
.months-list,
.attention-card,
.post-card-demo,
.metric-soft,
.mini-metric-card,
.extreme-card {
	background: #fff;
}

@media (max-width: 1200px) {
	.cross-grid {
		grid-template-columns: 1fr;
	}
	.mini-metric-grid.three {
		grid-template-columns: 1fr;
	}
	.ratings-extremes {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 992px) {
	.review-grid-top,
	.controls-toolbar,
	.controls-toolbar-block {
		flex-direction: column;
		align-items: stretch !important;
	}
	.search-toggle-wrapper,
	.demo-select {
		min-width: 100%;
	}
	.mini-metric-grid.two,
	.mini-metric-grid.three,
	.rating-extremes {
		grid-template-columns: 1fr;
	}
}

body[data-theme='dark'] {
	/* Как в основном проекте: нейтральные серые, без холодного синего */
	--demo-bg: var(--bg-primary);
	--demo-card: var(--bg-secondary);
	--demo-border: var(--border-color);
	--demo-text: var(--text-primary);
	--demo-muted: var(--text-secondary);
	--demo-blue: var(--bg-tertiary);
	--demo-green: #2d3d33;
	--demo-purple: var(--bg-tertiary);
}

body[data-theme='dark'] .demo-body,
body[data-theme='dark'] .main-content,
body[data-theme='dark'] .content-body,
body[data-theme='dark'] .analytics-container,
body[data-theme='dark'] .analytics-content-block,
body[data-theme='dark'] .client-billing-page,
body[data-theme='dark'] .balance-history-page,
body[data-theme='dark'] #database .database-table-section {
	background: var(--demo-bg) !important;
	color: var(--demo-text);
}

body[data-theme='dark'] .demo-mode-badge {
	background: rgba(51, 51, 51, 0.96) !important;
}

body[data-theme='dark'] .demo-mode-badge,
body[data-theme='dark'] .demo-toast,
body[data-theme='dark'] .guide-card,
body[data-theme='dark'] .search-toggle-wrapper,
body[data-theme='dark'] .placeholder-card-body,
body[data-theme='dark'] .months-list,
body[data-theme='dark'] .attention-card,
body[data-theme='dark'] .post-card-demo,
body[data-theme='dark'] .metric-soft,
body[data-theme='dark'] .mini-metric-card,
body[data-theme='dark'] .extreme-card,
body[data-theme='dark'] .database-advanced-filters,
body[data-theme='dark'] .controls-toolbar,
body[data-theme='dark'] .settings-btn,
body[data-theme='dark'] .sort-toggle-btn,
body[data-theme='dark'] .filter-pill,
body[data-theme='dark'] .btn.btn-light,
body[data-theme='dark'] .btn.btn-outline-secondary,
body[data-theme='dark'] .form-control,
body[data-theme='dark'] .form-select,
body[data-theme='dark'] .demo-checkbox-pill,
body[data-theme='dark'] .metric-card,
body[data-theme='dark'] .analytics-card,
body[data-theme='dark'] .card,
body[data-theme='dark'] .list-group-item,
body[data-theme='dark'] .filters-and-summary-card,
body[data-theme='dark'] .table,
body[data-theme='dark'] .table-responsive {
	color: var(--demo-text) !important;
}

body[data-theme='dark'] .search-toggle-wrapper,
body[data-theme='dark'] .database-advanced-filters,
body[data-theme='dark'] .settings-btn,
body[data-theme='dark'] .sort-toggle-btn,
body[data-theme='dark'] .filter-pill,
body[data-theme='dark'] .btn.btn-light,
body[data-theme='dark'] .btn.btn-outline-secondary,
body[data-theme='dark'] .form-control,
body[data-theme='dark'] .form-select,
body[data-theme='dark'] .demo-checkbox-pill {
	background: var(--bg-secondary) !important;
	border-color: var(--demo-border) !important;
}

body[data-theme='dark'] .search-toggle-wrapper .form-control,
body[data-theme='dark'] #database .search-type-select,
body[data-theme='dark'] .form-control::placeholder,
body[data-theme='dark'] .form-select,
body[data-theme='dark'] .database-advanced-filters .form-label,
body[data-theme='dark'] .demo-pagination,
body[data-theme='dark'] .chart-note,
body[data-theme='dark'] .metric-sub,
body[data-theme='dark'] .demo-info-line,
body[data-theme='dark'] .guide-card__step,
body[data-theme='dark'] .demo-toast__text {
	color: var(--demo-muted) !important;
}

body[data-theme='dark'] .settings-btn:hover,
body[data-theme='dark'] .sort-toggle-btn:hover,
body[data-theme='dark'] .filter-pill:hover,
body[data-theme='dark'] .btn.btn-light:hover,
body[data-theme='dark'] .btn.btn-outline-secondary:hover,
body[data-theme='dark'] .demo-checkbox-pill:hover {
	background: var(--bg-tertiary) !important;
}

body[data-theme='dark'] .sort-toggle-btn.active,
body[data-theme='dark'] .demo-checkbox-pill.active,
body[data-theme='dark'] .segmented-tabs .seg.active,
body[data-theme='dark'] #databaseFilterToggle.active {
	background: #3d434c !important;
	border-color: #6b7380 !important;
	color: #f0f2f5 !important;
}

body[data-theme='dark'] .placeholder-card-body,
body[data-theme='dark'] .months-list,
body[data-theme='dark'] .attention-card,
body[data-theme='dark'] .post-card-demo,
body[data-theme='dark'] .metric-soft,
body[data-theme='dark'] .mini-metric-card,
body[data-theme='dark'] .extreme-card {
	background: var(--bg-secondary) !important;
	border-color: var(--demo-border) !important;
}

body[data-theme='dark'] .extreme-card.bad {
	background: #3a242b !important;
}
body[data-theme='dark'] .extreme-card.good {
	background: #22382d !important;
}
body[data-theme='dark'] .guide-card,
body[data-theme='dark'] .demo-toast {
	background: var(--bg-secondary) !important;
	border-color: var(--demo-border) !important;
}
body[data-theme='dark'] .guide-card h3,
body[data-theme='dark'] .demo-toast__title {
	color: var(--demo-text) !important;
}
body[data-theme='dark'] .guide-spotlight {
	background: rgba(7, 10, 16, 0.75);
}
body[data-theme='dark'] .table > :not(caption) > * > * {
	background-color: transparent !important;
	color: var(--demo-text) !important;
	border-color: var(--demo-border) !important;
}
body[data-theme='dark'] .badge.bg-light {
	background: var(--bg-tertiary) !important;
	color: var(--demo-text) !important;
}
body[data-theme='dark'] .rating-stars {
	color: #ffd25f;
}
body[data-theme='dark'] #database .search-input {
	color: var(--text-primary);
}
.database-advanced-filters {
	position: absolute;
	top: 74px;
	left: 12px;
	right: 12px;
	z-index: 1200;
	border: 1px solid var(--demo-border);
	border-radius: 14px;
	background: var(--demo-card);
	padding: 14px;
	max-height: calc(100vh - 190px);
	overflow-y: auto;
	overflow-x: hidden;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}
.database-advanced-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
	align-items: end;
}
.database-filter-actions {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
}
#databasePagination [data-page]:disabled {
	opacity: 0.45;
	pointer-events: none;
}

@media (max-width: 992px) {
	.database-advanced-grid {
		grid-template-columns: 1fr 1fr;
	}
}

@media (max-width: 768px) {
	.database-advanced-filters {
		left: 8px;
		right: 8px;
		top: 70px;
		max-height: calc(100vh - 170px);
	}
	.database-filter-actions {
		flex-direction: column;
		align-items: stretch;
	}
	.database-advanced-grid {
		grid-template-columns: 1fr;
	}
}

/* v6 stable layout: single source of truth for scrolling */
html,
body,
body.demo-dashboard {
	height: 100%;
	overflow: hidden;
}

body.demo-dashboard .main-content {
	height: 100vh;
	min-height: 100vh;
	overflow: hidden;
}

body.demo-dashboard .content-body {
	display: flex;
	flex-direction: column;
	height: calc(100vh - 57px);
	min-height: calc(100vh - 57px);
	margin-top: 57px;
	overflow: hidden;
}

body.demo-dashboard .page-content {
	display: none;
	height: 100%;
	min-height: 0;
	overflow: hidden;
}

body.demo-dashboard .page-content.active {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: 0;
	overflow: hidden;
}

body.demo-dashboard #home .analytics-container,
body.demo-dashboard #home .analytics-container > .container-fluid {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	height: 100%;
	min-height: 0;
	overflow: hidden;
}

body.demo-dashboard #home .analytics-content-block {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overflow-x: hidden;
	padding-bottom: 48px;
}

body.demo-dashboard #home .analytics-tab-content,
body.demo-dashboard #home .analytics-tab-content > .tab-pane,
body.demo-dashboard #home .analytics-tab-content > .tab-pane.active,
body.demo-dashboard #home .analytics-tab-content > .tab-pane.show,
body.demo-dashboard #home .analytics-tab-content > .tab-pane.show.active {
	height: auto;
	min-height: min-content;
	overflow: visible;
}

body.demo-dashboard #stream .client-billing-page,
body.demo-dashboard #balance .balance-history-page {
	flex: 1 1 auto;
	height: 100%;
	min-height: 0;
	overflow-y: auto;
	overflow-x: hidden;
	padding-bottom: 40px;
}

body.demo-dashboard #balance #balance-target > .container-fluid {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* База: без скролла на #database — прокрутка у .content-body (см. :has ниже) */
body.demo-dashboard #database.page-content.active {
	height: auto;
	min-height: 0;
	overflow: visible;
	flex: 0 1 auto;
	position: relative;
}

body.demo-dashboard .content-body:has(#database.page-content.active) {
	overflow-y: auto;
	overflow-x: hidden;
}

body.demo-dashboard #database .database-table-section {
	flex: 0 1 auto;
	min-height: 0;
	overflow: visible;
	padding-bottom: 40px;
}

body.demo-dashboard #database > .controls-toolbar {
	flex-shrink: 0;
}

body.demo-dashboard .complaint-toolbar-block {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

body.demo-dashboard .complaint-filter-pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 42px;
	padding: 0 18px;
	border: 1px solid #d6dbe8;
	border-radius: 999px;
	background: #fff;
	cursor: pointer;
	white-space: nowrap;
}

body.demo-dashboard .complaint-filter-pill.active {
	background: #dcd7ff;
	border-color: #d0c9ff;
}

body.demo-dashboard .complaint-filter-pill input {
	width: 16px;
	height: 16px;
	margin: 0;
}

body.demo-dashboard .guide-overlay.hidden {
	pointer-events: none;
}

body.demo-dashboard.modal-demo-open .guide-overlay {
	display: none;
}

body.demo-dashboard #settingsModal {
	z-index: 6000;
}

body.demo-dashboard .modal-backdrop {
	z-index: 5900;
}

.cross-chart-box {
	min-height: 300px;
	height: 300px;
}

.mobile-desktop-only-overlay {
	position: fixed;
	inset: 0;
	z-index: 5000;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(20, 24, 33, 0.82);
	backdrop-filter: blur(2px);
	padding: 24px;
}

.mobile-desktop-only-overlay__content {
	width: min(420px, 100%);
	border-radius: 16px;
	background: #fff;
	padding: 20px;
	text-align: center;
	box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25);
}

.mobile-desktop-only-overlay__content h3 {
	margin: 0 0 8px;
	font-size: 20px;
}

.mobile-desktop-only-overlay__content p {
	margin: 0;
	color: var(--demo-muted);
}

.mobile-desktop-only-overlay.is-active {
	display: flex;
}

body.demo-mobile-blocked {
	overflow: hidden;
}

/* Вкладка «Главная → Обзор»: карточки метрик в тёмной теме как в светлой. Нужен !important из‑за существующих правил .metric-card с !important в этом файле и в analytics_home. */
body[data-theme='dark'] #overview-tab .metric-card {
	color: #1d2433 !important;
	border-color: #dde2ea !important;
	box-shadow: 0 4px 14px rgba(38, 48, 74, 0.06) !important;
}

body[data-theme='dark'] #overview-tab .metric-card.balance,
body[data-theme='dark'] #overview-tab .metric-card.week {
	background: #dfeefa !important;
}

body[data-theme='dark']
	#overview-tab
	.metric-card.processed:not(.qr-overview-card) {
	background: #dff4e5 !important;
}

body[data-theme='dark'] #overview-tab .metric-card.today,
body[data-theme='dark'] #overview-tab .metric-card.pending {
	background: #ece8fb !important;
}

body[data-theme='dark'] #overview-tab .metric-card.qr-overview-card {
	background: #dcefdc !important;
}

body[data-theme='dark'] #overview-tab .metric-card .metric-value,
body[data-theme='dark'] #overview-tab .metric-card .metric-label,
body[data-theme='dark'] #overview-tab .metric-card .metric-icon {
	color: #000000 !important;
}

body[data-theme='dark'] #overview-tab .metric-card .metric-icon {
	background: rgba(255, 255, 255, 0.2) !important;
}

body[data-theme='dark'] #overview-tab .metric-card.processed .metric-icon {
	color: #28a745 !important;
}

body[data-theme='dark'] #overview-tab .qr-summary-title {
	color: #263754 !important;
}

body[data-theme='dark'] #overview-tab .qr-summary-label {
	color: #7b8595 !important;
}

body[data-theme='dark'] #overview-tab .qr-summary-value {
	color: #202736 !important;
}

body[data-theme='dark'] #overview-tab .qr-overview-summary-item,
body[data-theme='dark'] #overview-tab .qr-overview-summary-footer {
	background: #eeeeef !important;
	border-color: #dee2e6 !important;
}

body[data-theme='dark'] #overview-tab .qr-overview-summary-footer {
	color: #7b8595 !important;
}

body[data-theme='dark'] #overview-tab .qr-overview-summary-footer strong {
	color: #202736 !important;
}

body[data-theme='dark']
	#overview-tab
	.metric-card.qr-overview-card:hover
	.qr-overview-summary-item,
body[data-theme='dark']
	#overview-tab
	.metric-card.qr-overview-card:hover
	.qr-overview-summary-footer {
	background: #ffffff !important;
	border-color: #dee2e6 !important;
}
