// Questo file fa parte di MyTown.
// MyTown è software libero: puoi ridistribuirlo e/o modificarlo secondo
// i termini della GNU Affero General Public License come pubblicata dalla
// Free Software Foundation, versione 3.
// Distribuito senza ALCUNA GARANZIA; vedi la GNU AGPL v3 per i dettagli.
// Copyright (C) Kondor Consulting & Services S.r.l.
// SPDX-License-Identifier: AGPL-3.0-or-later

.cr-content {
	--background: #f4f5f8;
}

.cr-toolbar {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 16px 4px;

	.cr-date-btn {
		flex: 1;
		display: flex;
		align-items: center;
		gap: 8px;
		padding: 10px 14px;
		background: #fff;
		border: none;
		border-radius: 12px;
		font-size: 0.95rem;
		font-weight: 600;
		color: #1f2330;
		box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
		ion-icon {
			font-size: 1.15rem;
			color: #f5a623;
		}
	}

	.cr-refresh-btn {
		flex: 0 0 auto;
		width: 44px;
		height: 44px;
		display: flex;
		align-items: center;
		justify-content: center;
		background: #fff;
		border: none;
		border-radius: 12px;
		box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
		ion-icon {
			font-size: 1.25rem;
			color: #5a6072;
		}
		ion-icon.spin {
			animation: cr-spin 0.9s linear infinite;
		}
	}
}

@keyframes cr-spin {
	to {
		transform: rotate(360deg);
	}
}

.cr-kpi-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px;
	padding: 12px 16px 4px;

	@media (min-width: 640px) {
		grid-template-columns: repeat(3, 1fr);
	}
}

.kpi-tile {
	background: #fff;
	border-radius: 14px;
	padding: 14px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
	display: flex;
	flex-direction: column;
	gap: 4px;

	.kpi-label {
		font-size: 11px;
		color: #7a8194;
		text-transform: uppercase;
		letter-spacing: 0.02em;
	}
	.kpi-value {
		font-size: 1.5rem;
		font-weight: 700;
		line-height: 1.1;
		color: #1f2330;
		small {
			font-size: 0.85rem;
			font-weight: 500;
			color: #7a8194;
		}
	}
	.kpi-sub {
		font-size: 11px;
		color: #4caf50;
		font-weight: 600;
	}
}

.cr-section {
	margin: 16px 16px 0;
	background: #fff;
	border-radius: 14px;
	padding: 14px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);

	h6 {
		margin: 0 0 10px;
		font-size: 0.95rem;
		font-weight: 600;
		color: #1f2330;
	}
}

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

.inv-list {
	display: flex;
	flex-direction: column;

	.inv-row {
		display: grid;
		grid-template-columns: 1fr auto auto;
		gap: 10px;
		align-items: center;
		padding: 10px 0;
		border-bottom: 1px solid #eef0f4;
		font-size: 0.85rem;

		&:last-child {
			border-bottom: none;
		}

		.inv-name {
			display: flex;
			flex-direction: column;
			color: #1f2330;
			font-weight: 500;
			small {
				font-weight: 400;
				color: #9aa0b0;
				font-size: 0.75rem;
			}
		}
		.inv-online {
			text-align: center;
		}
		.inv-seen {
			color: #7a8194;
			text-align: right;
			white-space: nowrap;
		}
	}

	.inv-head {
		font-size: 0.72rem;
		text-transform: uppercase;
		letter-spacing: 0.02em;
		color: #9aa0b0;
		font-weight: 600;
		span {
			color: #9aa0b0;
		}
		.inv-online {
			text-align: center;
		}
		.inv-seen {
			text-align: right;
		}
	}

	.inv-empty {
		padding: 16px 0;
		text-align: center;
		color: #9aa0b0;
		font-size: 0.85rem;
	}
}

.cr-loading {
	display: flex;
	justify-content: center;
	padding: 48px;
}
