/* OneRestau Dashboard Stats — Console. Tokens FO Shell only. */

.sgp-ods {
	--sgp-ods-commerce: var(--sgp-rc-accent, #0cc21e);
	--sgp-ods-clients: #7dd3fc;
	--sgp-ods-loyalty: #c4b5fd;
	--sgp-ods-finance: var(--sgp-rc-secondary, #c45c26);
	--sgp-ods-sms: #67e8f9;
	--sgp-ods-card: rgba(248, 250, 252, 0.04);
	--sgp-ods-line: rgba(248, 250, 252, 0.1);
	--sgp-ods-muted: rgba(248, 250, 252, 0.62);
	box-sizing: border-box;
	min-width: 0;
	max-width: 72rem;
	margin: 0 auto;
	padding: 4px 0 24px;
}

.sgp-ods *,
.sgp-ods *::before,
.sgp-ods *::after {
	box-sizing: border-box;
}

.sgp-ods__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.sgp-ods__head {
	margin: 0 0 12px;
}

.sgp-ods__title-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 10px;
	overflow: visible;
	position: relative;
	z-index: 4;
}

.sgp-ods__title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 700;
}

.sgp-ods__tools {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	flex: 0 0 auto;
	position: relative;
}

.sgp-ods__presets {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 6px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	padding-bottom: 2px;
	scrollbar-width: thin;
}

.sgp-ods__preset {
	flex: 0 0 auto;
	white-space: nowrap;
}

.sgp-ods__preset.is-active {
	background: var(--sgp-rc-primary, #1f4b3a);
	color: #fff;
	border-color: transparent;
}

.sgp-ods__compare {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-left: 4px;
	font-size: 13px;
	white-space: nowrap;
}

.sgp-ods__custom {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 10px 0 0;
	align-items: flex-end;
}

.sgp-ods__custom[hidden],
.sgp-ods__panel[hidden],
.sgp-ods__section[hidden],
.sgp-ods__empty[hidden],
.sgp-ods__section-error[hidden],
.sgp-ods__unavailable[hidden],
.sgp-ods__access-denied[hidden],
.sgp-ods__warnings[hidden],
.sgp-ods__field-error[hidden],
.sgp-ods__more[hidden],
.sgp-ods__skeleton[hidden],
.sgp-ods__tooltip[hidden] {
	display: none;
}

.sgp-ods__date,
.sgp-ods__select {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
	font-size: 12px;
	font-weight: 600;
	opacity: 0.88;
}

.sgp-ods__date input,
.sgp-ods__select select {
	min-height: 40px;
	min-width: 10rem;
	max-width: 100%;
	padding: 8px 10px;
	border-radius: 12px;
	border: 1px solid var(--sgp-ods-line);
	background: var(--sgp-ods-card);
	color: inherit;
	font: inherit;
}

.sgp-ods__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 10px 0 0;
	align-items: flex-end;
}

.sgp-ods__filter-note,
.sgp-ods__lead,
.sgp-ods__field-error {
	margin: 8px 0 0;
	font-size: 12px;
	line-height: 1.4;
	color: var(--sgp-ods-muted);
}

.sgp-ods__field-error {
	color: #fecaca;
	width: 100%;
}

.sgp-ods__warnings {
	margin: 10px 0 0;
	padding: 8px 12px;
	border-radius: 12px;
	background: rgba(245, 158, 11, 0.12);
	color: #fde68a;
	font-size: 13px;
}

.sgp-ods__section {
	position: relative;
	min-width: 0;
	margin: 0 0 14px;
	padding: 14px;
	border-radius: 16px;
	background: var(--sgp-ods-card);
	border: 1px solid var(--sgp-ods-line);
	container-type: inline-size;
	container-name: sgp-ods-section;
}

.sgp-ods__section-title {
	margin: 0 0 10px;
	font-size: 13px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	opacity: 0.78;
}

.sgp-ods__section-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin: 0 0 8px;
}

.sgp-ods__kpis {
	display: grid;
	gap: 10px;
	grid-template-columns: 1fr;
}

@container sgp-ods-section (min-width: 360px) {
	.sgp-ods__kpis {
		grid-template-columns: 1fr 1fr;
	}
}

@container sgp-ods-section (min-width: 900px) {
	.sgp-ods__kpis {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.sgp-ods__kpi {
	min-width: 0;
	padding: 10px 12px;
	border-radius: 14px;
	background: rgba(7, 16, 20, 0.28);
	border-left: 3px solid var(--sgp-ods-commerce);
}

.sgp-ods__kpi--finance {
	border-left-color: var(--sgp-ods-finance);
}

.sgp-ods__kpi-label {
	margin: 0;
	font-size: 12px;
	font-weight: 700;
}

.sgp-ods__kpi-hint {
	margin: 0 0 4px;
	font-size: 11px;
	color: var(--sgp-ods-muted);
}

.sgp-ods__kpi-value {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.02em;
}

.sgp-ods__kpi-delta {
	margin: 4px 0 0;
	font-size: 12px;
	color: var(--sgp-ods-muted);
}

.sgp-ods__kpi-delta.is-new {
	color: var(--sgp-ods-commerce);
}

.sgp-ods__chart-wrap {
	position: relative;
	overflow: hidden;
	min-width: 0;
	min-height: 220px;
}

.sgp-ods__svg {
	display: block;
	width: 100%;
	height: 180px;
	overflow: visible;
}

.sgp-ods__slots {
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	height: 180px;
	display: flex;
}

.sgp-ods__slot {
	flex: 1 1 0;
	min-width: 0;
	border: 0;
	padding: 0;
	background: transparent;
	cursor: pointer;
}

.sgp-ods__slot.is-active {
	background: rgba(248, 250, 252, 0.06);
}

.sgp-ods__guide {
	stroke: rgba(248, 250, 252, 0.28);
	stroke-width: 1;
}

.sgp-ods__bar {
	fill: rgba(12, 194, 30, 0.28);
}

.sgp-ods__line {
	fill: none;
	stroke: var(--sgp-rc-secondary, #c45c26);
	stroke-width: 2;
	stroke-linejoin: round;
	stroke-linecap: round;
}

.sgp-ods__dot {
	fill: var(--sgp-rc-secondary, #c45c26);
}

.sgp-ods__axis-label,
.sgp-ods__y-label {
	fill: rgba(248, 250, 252, 0.62);
	font-size: 11px;
}

.sgp-ods__axis {
	position: relative;
	height: 22px;
	margin-top: 4px;
}

.sgp-ods__tick {
	position: absolute;
	top: 0;
	font-size: 11px;
	white-space: nowrap;
	color: var(--sgp-ods-muted);
}

.sgp-ods__tick.is-first {
	left: 0;
}

.sgp-ods__tick.is-last {
	right: 0;
	left: auto;
}

.sgp-ods__tooltip {
	position: absolute;
	z-index: 3;
	min-width: 9rem;
	max-width: calc(100% - 16px);
	padding: 8px 10px;
	border-radius: 10px;
	background: #102f3a;
	border: 1px solid var(--sgp-ods-line);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
	pointer-events: none;
}

.sgp-ods__tooltip-date {
	margin: 0 0 4px;
	font-weight: 700;
	font-size: 12px;
}

.sgp-ods__tooltip-row {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin: 0;
	font-size: 12px;
}

.sgp-ods__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.sgp-ods__legend-btn {
	border: 1px solid var(--sgp-ods-line);
	background: transparent;
	color: inherit;
	border-radius: 999px;
	padding: 4px 10px;
	font: inherit;
	font-size: 12px;
	opacity: 0.45;
}

.sgp-ods__legend-btn.is-on {
	opacity: 1;
	border-color: var(--sgp-rc-accent, #0cc21e);
}

.sgp-ods__split {
	display: grid;
	gap: 14px;
}

@container sgp-ods-section (min-width: 640px) {
	.sgp-ods__split {
		grid-template-columns: 1fr 1fr;
	}
}

.sgp-ods__barrow {
	display: grid;
	grid-template-columns: minmax(4.5rem, 7rem) minmax(0, 1fr) auto;
	gap: 8px;
	align-items: center;
	margin: 0 0 8px;
	font-size: 13px;
}

.sgp-ods__barrow-track {
	height: 8px;
	border-radius: 999px;
	background: rgba(248, 250, 252, 0.08);
	overflow: hidden;
}

.sgp-ods__barrow-fill {
	display: block;
	height: 100%;
	background: var(--sgp-ods-commerce);
	border-radius: inherit;
}

.sgp-ods__section--customers .sgp-ods__barrow-fill,
.sgp-ods__kpi-customers {
	border-left-color: var(--sgp-ods-clients);
}

.sgp-ods__section--loyalty {
	border-color: rgba(196, 181, 253, 0.18);
}

.sgp-ods__section--payments,
.sgp-ods__section--refunds {
	border-color: rgba(196, 92, 38, 0.22);
}

.sgp-ods__section--sms {
	border-color: rgba(103, 232, 249, 0.18);
}

.sgp-ods__facts {
	display: grid;
	gap: 8px;
	grid-template-columns: 1fr 1fr;
}

@container sgp-ods-section (min-width: 720px) {
	.sgp-ods__facts {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.sgp-ods__fact {
	min-width: 0;
	padding: 8px 10px;
	border-radius: 12px;
	background: rgba(7, 16, 20, 0.22);
}

.sgp-ods__fact-value {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.sgp-ods__fact-label {
	margin: 0;
	font-size: 12px;
	color: var(--sgp-ods-muted);
}

.sgp-ods__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.sgp-ods__table th,
.sgp-ods__table td {
	text-align: left;
	padding: 8px 6px;
	border-bottom: 1px solid var(--sgp-ods-line);
}

.sgp-ods__table th:nth-child(n + 2),
.sgp-ods__table td:nth-child(n + 2) {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.sgp-ods__cards {
	display: grid;
	gap: 8px;
}

.sgp-ods__card {
	padding: 8px 10px;
	border-radius: 12px;
	background: rgba(7, 16, 20, 0.22);
	font-size: 13px;
}

.sgp-ods__more,
.sgp-ods__retry {
	margin-top: 8px;
	background: transparent;
	border: 0;
	color: inherit;
	text-decoration: underline;
	font: inherit;
	cursor: pointer;
}

.sgp-ods__section[data-state="loading"] .sgp-ods__skeleton {
	display: block;
}

.sgp-ods__section[data-state="loading"] .sgp-ods__kpis,
.sgp-ods__section[data-state="loading"] .sgp-ods__chart-wrap,
.sgp-ods__section[data-state="loading"] .sgp-ods__facts,
.sgp-ods__section[data-state="loading"] .sgp-ods__split,
.sgp-ods__section[data-state="refreshing"] .sgp-ods__skeleton {
	opacity: 0.55;
}

.sgp-ods__skeleton {
	display: none;
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: linear-gradient(90deg, transparent, rgba(248, 250, 252, 0.06), transparent);
	background-size: 200% 100%;
	animation: sgp-ods-shimmer 1.1s linear infinite;
	pointer-events: none;
}

.sgp-ods__section[data-state="success"] .sgp-ods__skeleton,
.sgp-ods__section[data-state="empty"] .sgp-ods__skeleton,
.sgp-ods__section[data-state="error"] .sgp-ods__skeleton,
.sgp-ods__section[data-state="unavailable"] .sgp-ods__skeleton {
	display: none;
}

.sgp-ods__panel {
	position: absolute;
	right: 0;
	top: calc(100% + 8px);
	z-index: 8;
	min-width: 16rem;
	max-width: min(22rem, calc(100vw - 24px));
	margin-top: 0;
	padding: 14px;
	border-radius: 16px;
	border: 1px solid var(--sgp-ods-line);
	background: #102f3a;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.sgp-ods__panel-title {
	margin: 0 0 8px;
	font-size: 1rem;
}

.sgp-ods__checks,
.sgp-ods__export-list {
	display: grid;
	gap: 8px;
	margin: 0 0 12px;
}

.sgp-ods__check {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
}

.sgp-ods__empty,
.sgp-ods__unavailable,
.sgp-ods__access-denied,
.sgp-ods__section-error {
	margin: 8px 0 0;
	font-size: 13px;
	color: var(--sgp-ods-muted);
}

@keyframes sgp-ods-shimmer {
	from { background-position: 100% 0; }
	to { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
	.sgp-ods__skeleton {
		animation: none;
	}
}

@media (max-width: 359px) {
	.sgp-ods__kpis {
		grid-template-columns: 1fr;
	}

	.sgp-ods__facts {
		grid-template-columns: 1fr;
	}
}

.sgp-ods.is-narrow .sgp-ods__kpis,
.sgp-ods.is-narrow .sgp-ods__facts {
	grid-template-columns: 1fr;
}

.sgp-ods__table-wrap {
	overflow-x: auto;
}
