#statisticheAccessi.tab-content.active { display: block; }

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.access-stats-shell {
	max-width: 1280px;
	margin: 0 auto;
	padding: 32px 0 64px;
}

.access-stats-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 24px;
}

.access-stats-header h2 {
	margin: 5px 0 8px;
	color: var(--primary-blue);
	font-size: clamp(1.75rem, 3vw, 2.35rem);
}

.access-stats-header p {
	margin: 0;
	color: #617080;
}

.access-stats-eyebrow {
	font-size: 0.72rem;
	font-weight: 850;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #ac6827;
}

.access-stats-header__actions {
	display: flex;
	gap: 10px;
}

.access-stats-button {
	min-height: 42px;
	padding: 9px 17px;
	border: 1px solid #164b75;
	border-radius: 10px;
	background: #164b75;
	color: #fff;
	font: inherit;
	font-weight: 800;
	cursor: pointer;
}

.access-stats-button--secondary {
	border-color: #bdc9d3;
	background: #fff;
	color: #21445f;
}

.access-stats-button:disabled { cursor: wait; opacity: 0.6; }

.access-stats-feedback {
	margin: 0 0 18px;
	padding: 11px 14px;
	border-radius: 10px;
	font-size: 0.87rem;
}

.access-stats-feedback[data-state="info"] { background: #eaf3fb; color: #174f7b; }
.access-stats-feedback[data-state="success"] { background: #e8f6ee; color: #21683e; }
.access-stats-feedback[data-state="error"] { background: #fdecec; color: #9a2929; }

.access-stats-kpis {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 15px;
	margin-bottom: 18px;
}

.access-stats-kpi,
.access-stats-card {
	border: 1px solid #dfe6ec;
	background: #fff;
	box-shadow: 0 10px 28px rgba(19, 48, 76, 0.07);
}

.access-stats-kpi {
	position: relative;
	display: grid;
	gap: 7px;
	padding: 19px;
	border-radius: 15px;
	overflow: hidden;
}

.access-stats-kpi::before {
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	height: 3px;
	background: #3a7aa8;
	content: '';
}

.access-stats-kpi--warning::before { background: #c47945; }
.access-stats-kpi > span { color: #647584; font-size: 0.8rem; font-weight: 750; }
.access-stats-kpi strong { color: #143e60; font-size: 2rem; line-height: 1; }
.access-stats-kpi small { color: #8a97a3; font-size: 0.72rem; }

.access-stats-segments {
	margin-bottom: 18px;
	padding: 20px;
	border: 1px solid #dfe6ec;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 10px 28px rgba(19, 48, 76, 0.07);
}

.access-stats-segments__header {
	display: flex;
	align-items: end;
	justify-content: space-between;
	gap: 18px;
	margin-bottom: 16px;
}

.access-stats-segments__header h3 { margin: 4px 0 0; color: #173f60; font-size: 1.05rem; }
.access-stats-segments__header p { margin: 0; color: #84919c; font-size: 0.78rem; }
.access-stats-segments__eyebrow { color: #ac6827; font-size: 0.68rem; font-weight: 850; letter-spacing: 0.11em; text-transform: uppercase; }

.access-stats-segments__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 11px;
}

.access-stats-segment {
	position: relative;
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 5px 12px;
	padding: 15px 16px;
	border: 1px solid #e3e9ee;
	border-radius: 13px;
	background: #f8fafb;
	overflow: hidden;
}

.access-stats-segment::before { position: absolute; inset: 0 auto 0 0; width: 3px; background: #244f75; content: ''; }
.access-stats-segment__level { align-self: center; color: #7a8995; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.035em; text-transform: uppercase; }
.access-stats-segment strong { grid-column: 2; grid-row: 1 / span 3; align-self: center; color: #143e60; font-size: 1.75rem; line-height: 1; }
.access-stats-segment h4 { margin: 0; color: #294c67; font-size: 0.84rem; }
.access-stats-segment small { color: #8a97a3; font-size: 0.7rem; }
.access-stats-segment__users { grid-column: 1 / -1; margin-top: 3px; }
.access-stats-segment__users b { color: #294c67; }

.access-stats-overview {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
	gap: 18px;
	margin-bottom: 18px;
}

.access-stats-card {
	padding: 20px;
	border-radius: 16px;
}

.access-stats-card header h3 {
	margin: 0 0 4px;
	color: #173f60;
	font-size: 1rem;
}

.access-stats-card header p {
	margin: 0;
	color: #84919c;
	font-size: 0.78rem;
}

.access-stats-chart {
	display: grid;
	grid-template-columns: repeat(14, minmax(26px, 1fr));
	align-items: end;
	gap: 8px;
	height: 235px;
	margin-top: 22px;
	overflow-x: auto;
}

.access-stats-chart__column {
	display: grid;
	grid-template-rows: 20px 1fr 18px;
	align-items: end;
	gap: 5px;
	min-width: 26px;
	height: 100%;
	text-align: center;
}

.access-stats-chart__column strong { color: #637687; font-size: 0.7rem; }
.access-stats-chart__column small { color: #82919d; font-size: 0.62rem; }

.access-stats-chart__track {
	position: relative;
	height: 100%;
	border-radius: 7px;
	background: #eef3f6;
	overflow: hidden;
}

.access-stats-chart__track span {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	border-radius: 7px 7px 3px 3px;
	background: linear-gradient(180deg, #4f91bd, #18527f);
	transition: height 260ms ease;
}

.access-stats-outcomes header { margin-bottom: 28px; }

.access-stats-outcome {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	margin: 18px 0 7px;
	color: #33566f;
	font-size: 0.86rem;
}

.access-stats-outcome--failed { color: #8a5034; }

.access-stats-progress {
	height: 9px;
	border-radius: 99px;
	background: #e7eef3;
	overflow: hidden;
}

.access-stats-progress span {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: #2d7aa8;
	transition: width 250ms ease;
}

.access-stats-progress--failed span { background: #c87545; }

.access-stats-table-card { padding: 0; overflow: hidden; }

.access-stats-table-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	padding: 18px 20px;
	border-bottom: 1px solid #e1e7ec;
}

.access-stats-filters {
	display: flex;
	align-items: end;
	justify-content: flex-end;
	gap: 9px;
}

.access-stats-filter {
	display: grid;
	gap: 5px;
}

.access-stats-filter > span {
	color: #738491;
	font-size: 0.67rem;
	font-weight: 800;
	letter-spacing: 0.035em;
	text-transform: uppercase;
}

.access-stats-search { width: min(290px, 100%); }

.access-stats-filter input,
.access-stats-filter select {
	width: 100%;
	min-height: 41px;
	box-sizing: border-box;
	padding: 9px 12px;
	border: 1px solid #cbd6df;
	border-radius: 10px;
	background: #f9fbfc;
	color: #263d50;
	font: inherit;
}

.access-stats-filter select { min-width: 165px; cursor: pointer; }

.access-stats-filter-reset {
	min-height: 41px;
	padding: 9px 13px;
	border: 1px solid #cbd6df;
	border-radius: 10px;
	background: #fff;
	color: #34566f;
	font: inherit;
	font-size: 0.78rem;
	font-weight: 800;
	cursor: pointer;
}

.access-stats-filter-reset:hover { border-color: #8ea4b5; background: #f5f8fa; }

.access-stats-filter input:focus,
.access-stats-filter select:focus {
	border-color: #1b5b8f;
	outline: 0;
	box-shadow: 0 0 0 3px rgba(27, 91, 143, 0.12);
}

.access-stats-table-wrap { overflow-x: auto; }

.access-stats-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.8rem;
}

.access-stats-table th,
.access-stats-table td {
	padding: 13px 16px;
	border-bottom: 1px solid #edf1f4;
	text-align: left;
	vertical-align: middle;
}

.access-stats-table th {
	background: #f7f9fb;
	color: #657584;
	font-size: 0.7rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.access-stats-table td { color: #40576a; }
.access-stats-table td:nth-child(1) { min-width: 120px; white-space: nowrap; }
.access-stats-table td:nth-child(2) { min-width: 180px; }
.access-stats-table td:nth-child(4),
.access-stats-table td:nth-child(5) { min-width: 110px; white-space: nowrap; }
.access-stats-table td:nth-child(7) { min-width: 180px; max-width: 360px; }

.access-stats-table td strong,
.access-stats-table td small { display: block; }
.access-stats-table td small { margin-top: 3px; color: #87949f; }

.access-stats-badge {
	display: inline-flex;
	padding: 5px 9px;
	border-radius: 99px;
	font-size: 0.7rem;
	font-weight: 800;
	white-space: nowrap;
}

.access-stats-badge.is-success { background: #e5f4eb; color: #226d42; }
.access-stats-badge.is-failed { background: #fbe9e3; color: #9b492e; }

.access-stats-empty {
	margin: 0;
	padding: 28px;
	color: #748390;
	text-align: center;
}

@media (max-width: 980px) {
	.access-stats-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.access-stats-segments__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.access-stats-overview { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
	.access-stats-header,
	.access-stats-table-header { align-items: stretch; flex-direction: column; }
	.access-stats-header__actions { width: 100%; }
	.access-stats-header__actions .access-stats-button { flex: 1; }
	.access-stats-kpis { grid-template-columns: 1fr; }
	.access-stats-segments__header { align-items: flex-start; flex-direction: column; }
	.access-stats-segments__grid { grid-template-columns: 1fr; }
	.access-stats-filters { align-items: stretch; flex-direction: column; }
	.access-stats-filter select { min-width: 0; }
	.access-stats-search { width: 100%; }
	.access-stats-chart { grid-template-columns: repeat(14, 34px); }
}

@media (prefers-reduced-motion: reduce) {
	.access-stats-chart__track span,
	.access-stats-progress span { transition: none; }
}

.access-stats-tabs {
	display: flex;
	gap: 8px;
	margin: 0 0 18px;
	padding: 6px;
	width: fit-content;
	max-width: 100%;
	border: 1px solid var(--line, #dfe6ec);
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.82);
}

.access-stats-tab {
	min-height: 40px;
	padding: 8px 16px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: #34566f;
	font: inherit;
	font-weight: 800;
	cursor: pointer;
}

.access-stats-tab.is-active {
	background: var(--primary, #071b3b);
	color: #fff;
	box-shadow: 0 8px 18px rgba(7, 27, 59, 0.16);
}

.download-stats-table td:nth-child(4) {
	min-width: 220px;
	max-width: 420px;
}

.download-stats-table td:nth-child(5) {
	min-width: 110px;
	white-space: nowrap;
}

/* Visual refresh coerente con il frontend Scrigno Hub */
.access-stats-shell {
	padding-top: 38px;
}

.access-stats-header {
	position: relative;
	align-items: center;
	padding: 28px 30px;
	border: 1px solid var(--line);
	border-radius: 24px;
	background:
		radial-gradient(circle at 92% 12%, rgba(var(--config-beige-rgb), 0.95), transparent 34%),
		linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(var(--config-beige-rgb), 0.72));
	box-shadow: var(--shadow-sm);
	overflow: hidden;
}

.access-stats-header::after {
	position: absolute;
	top: -54px;
	right: 5%;
	width: 150px;
	height: 150px;
	border: 26px solid rgba(7, 27, 59, 0.035);
	border-radius: 50%;
	content: '';
	pointer-events: none;
}

.access-stats-header > * {
	position: relative;
	z-index: 1;
}

.access-stats-header h2 {
	color: var(--primary);
	letter-spacing: -0.035em;
}

.access-stats-header p {
	color: var(--text-muted);
}

.access-stats-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	color: var(--primary);
}

.access-stats-eyebrow::before {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #aa8578;
	box-shadow: 0 0 0 5px rgba(170, 133, 120, 0.14);
	content: '';
}

.access-stats-button {
	border-color: var(--primary);
	border-radius: 11px;
	background: var(--primary);
	box-shadow: 0 10px 24px rgba(7, 27, 59, 0.16);
	transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.access-stats-button--secondary {
	border-color: rgba(7, 27, 59, 0.16);
	background: rgba(255, 255, 255, 0.82);
	color: var(--primary);
	box-shadow: none;
}

.access-stats-button:hover:not(:disabled) {
	transform: translateY(-2px);
	box-shadow: var(--shadow-sm);
}

.access-stats-feedback {
	border: 1px solid transparent;
	border-radius: 12px;
	box-shadow: 0 7px 18px rgba(42, 34, 26, 0.035);
}

.access-stats-feedback[data-state="info"] { border-color: rgba(7, 27, 59, 0.1); background: rgba(var(--config-beige-rgb), 0.78); color: var(--primary); }
.access-stats-feedback[data-state="success"] { border-color: rgba(34, 109, 66, 0.12); }
.access-stats-feedback[data-state="error"] { border-color: rgba(155, 73, 46, 0.12); }

.access-stats-kpis {
	gap: 17px;
	margin-bottom: 20px;
}

.access-stats-kpi,
.access-stats-card {
	border-color: var(--line);
	box-shadow: var(--shadow-sm);
}

.access-stats-kpi {
	min-height: 142px;
	padding: 21px;
	border-radius: 18px;
	background:
		radial-gradient(circle at 100% 0%, rgba(var(--config-beige-rgb), 0.76), transparent 44%),
		#fff;
	transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.access-stats-kpi:hover {
	border-color: rgba(7, 27, 59, 0.16);
	box-shadow: var(--shadow-md);
	transform: translateY(-3px);
}

.access-stats-kpi::before {
	top: auto;
	right: auto;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 4px;
	background: var(--primary);
}

.access-stats-kpi::after {
	position: absolute;
	top: 18px;
	right: 18px;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border: 1px solid rgba(7, 27, 59, 0.09);
	border-radius: 12px;
	background: rgba(var(--config-beige-rgb), 0.72);
	color: var(--primary);
	font-size: 1rem;
	font-weight: 900;
}

.access-stats-kpi:nth-child(1)::after { content: '✓'; }
.access-stats-kpi:nth-child(2)::after { content: '◎'; }
.access-stats-kpi:nth-child(3)::after { content: '↗'; }
.access-stats-kpi:nth-child(4)::after { content: '!'; }
.access-stats-kpi--warning::before { background: #aa8578; }
.access-stats-kpi--warning::after { color: #8b5140; }
.access-stats-kpi > span { color: var(--text-muted); }
.access-stats-kpi strong { color: var(--primary); font-size: 2.2rem; letter-spacing: -0.04em; }
.access-stats-kpi small { color: var(--text-soft); }

.access-stats-overview {
	gap: 20px;
	margin-bottom: 20px;
}

.access-stats-card {
	padding: 23px;
	border-radius: 20px;
	background:
		radial-gradient(circle at 100% 0%, rgba(var(--config-beige-rgb), 0.42), transparent 32%),
		#fff;
}

.access-stats-card header h3 {
	color: var(--primary);
	font-size: 1.06rem;
	letter-spacing: -0.015em;
}

.access-stats-card header p { color: var(--text-soft); }

.access-stats-chart {
	gap: 9px;
	height: 248px;
}

.access-stats-chart__track {
	border: 1px solid rgba(7, 27, 59, 0.045);
	background: rgba(var(--config-beige-rgb), 0.62);
}

.access-stats-chart__track span {
	background: linear-gradient(180deg, #23486f 0%, var(--primary) 100%);
	box-shadow: inset 0 1px rgba(255, 255, 255, 0.18);
}

.access-stats-chart__column strong { color: var(--primary); }
.access-stats-chart__column small { color: var(--text-soft); }

.access-stats-outcomes {
	background:
		radial-gradient(circle at 100% 0%, rgba(170, 133, 120, 0.16), transparent 36%),
		linear-gradient(180deg, #fff, rgba(var(--config-beige-rgb), 0.28));
}

.access-stats-outcome { color: var(--primary); }
.access-stats-outcome--failed { color: #875141; }

.access-stats-progress {
	height: 10px;
	background: rgba(7, 27, 59, 0.08);
}

.access-stats-progress span { background: var(--primary); }
.access-stats-progress--failed span { background: #aa8578; }

.access-stats-table-card {
	padding: 0;
	border-radius: 20px;
}

.access-stats-table-header {
	padding: 21px 23px;
	border-color: var(--line);
	background: linear-gradient(135deg, rgba(var(--config-beige-rgb), 0.52), rgba(255, 255, 255, 0.86));
}

.access-stats-filter input,
.access-stats-filter select {
	border-color: rgba(7, 27, 59, 0.13);
	border-radius: 11px;
	background: rgba(255, 255, 255, 0.86);
	color: var(--primary);
}

.access-stats-filter input:focus,
.access-stats-filter select:focus {
	border-color: rgba(7, 27, 59, 0.48);
	box-shadow: 0 0 0 4px rgba(7, 27, 59, 0.08);
}

.access-stats-table th,
.access-stats-table td {
	padding: 14px 18px;
	border-color: rgba(7, 27, 59, 0.065);
}

.access-stats-table th {
	background: rgba(var(--config-beige-rgb), 0.56);
	color: var(--text-muted);
}

.access-stats-table tbody tr {
	transition: background-color 150ms ease;
}

.access-stats-table tbody tr:nth-child(even) {
	background: rgba(var(--config-beige-rgb), 0.17);
}

.access-stats-table tbody tr:hover {
	background: rgba(var(--config-beige-rgb), 0.48);
}

.access-stats-table td { color: var(--text-muted); }
.access-stats-table td strong { color: var(--primary); }
.access-stats-table td small { color: var(--text-soft); }

.access-stats-badge {
	padding: 6px 10px;
	border: 1px solid transparent;
}

.access-stats-badge.is-success { border-color: rgba(34, 109, 66, 0.12); }
.access-stats-badge.is-failed { border-color: rgba(155, 73, 46, 0.12); }

@media (max-width: 680px) {
	.access-stats-header { padding: 23px 20px; }
	.access-stats-card { padding: 19px; }
	.access-stats-table-card { padding: 0; }
}

