.chiavi-wrap {
	max-width: 100%;
}

.chiavi-card {
	background: #fff;
	border: 1px solid #ccd0d4;
	box-shadow: 0 1px 1px rgba(0,0,0,0.04);
	padding: 16px 20px;
	margin: 16px 0 20px;
	max-width: 700px;
}

.chiavi-card h2 {
	margin-top: 0;
}

.chiavi-days-options {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 16px;
	padding-top: 6px;
}

.chiavi-day-check {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.chiavi-day-check input {
	width: 16px;
	height: 16px;
	margin: 0;
	cursor: pointer;
}

.chiavi-day-check label {
	font-weight: 500;
	cursor: pointer;
}

.chiavi-image-preview {
	margin-bottom: 8px;
}

.chiavi-image-preview img {
	max-width: 200px;
	max-height: 150px;
	display: block;
	border: 1px solid #ddd;
	border-radius: 4px;
	margin-bottom: 6px;
}

.chiavi-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 3px;
	font-size: 12px;
	font-weight: 600;
	color: #fff;
}

.chiavi-badge-si {
	background-color: #2271b1;
}

.chiavi-badge-no {
	background-color: #757575;
}

.chiavi-table-scroll {
	overflow-x: auto;
	background: #fff;
	border: 1px solid #ccd0d4;
	padding: 4px;
}

.chiavi-table {
	min-width: 1300px;
}

.chiavi-table th,
.chiavi-table td {
	vertical-align: top;
	font-size: 13px;
}

.chiavi-antifurto-cell,
.chiavi-cliente-cell {
	max-width: 220px;
	white-space: pre-wrap;
	word-break: break-word;
}

.chiavi-antifurto-note {
	margin-bottom: 6px;
}

.chiavi-antifurto-media {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.chiavi-thumb {
	width: 48px;
	height: 48px;
	object-fit: cover;
	border: 1px solid #ddd;
	border-radius: 4px;
}

.chiavi-video-link {
	font-weight: 600;
	white-space: nowrap;
}

.chiavi-front-locked {
	padding: 16px 20px;
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	font-size: 15px;
	max-width: 600px;
	margin: 20px auto;
	text-align: center;
}

.chiavi-front-wrap {
	margin: 20px 0;
}

.chiavi-gate-box {
	max-width: 340px;
	margin: 60px auto;
	padding: 28px 24px;
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.06);
	text-align: center;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.chiavi-gate-box h3 {
	margin: 0 0 16px;
	font-size: 18px;
}

.chiavi-gate-error {
	color: #c40000;
	font-weight: 600;
	margin: 0 0 12px;
	font-size: 14px;
}

.chiavi-gate-form {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.chiavi-gate-form input[type="password"] {
	padding: 10px 12px;
	border: 1px solid #ccd0d4;
	border-radius: 6px;
	font-size: 15px;
}

.chiavi-gate-submit {
	padding: 10px 16px;
	border: none;
	border-radius: 6px;
	background: #2271b1;
	color: #fff;
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
}

.chiavi-gate-submit:hover {
	background: #135e96;
}

.chiavi-password-card code {
	background: #f0f0f1;
	padding: 2px 6px;
	border-radius: 3px;
}

/* =========================================================
 * FRONT-END (shortcode) — stili indipendenti da wp-admin
 * ========================================================= */
.chiavi-front-wrap {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #23282d;
	max-width: 100%;
}

.chiavi-front-wrap *,
.chiavi-front-wrap *::before,
.chiavi-front-wrap *::after {
	box-sizing: border-box;
}

.chiavi-front-wrap .chiavi-table-scroll {
	overflow-x: auto;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 10px;
	box-shadow: 0 2px 6px rgba(0,0,0,0.06);
	padding: 8px;
}

.chiavi-front-wrap table.chiavi-table {
	border-collapse: separate;
	border-spacing: 0;
	width: 100%;
	min-width: 1100px;
}

.chiavi-front-wrap table.chiavi-table th,
.chiavi-front-wrap table.chiavi-table td {
	border-bottom: 1px solid #ebedf0;
	padding: 14px 16px;
	text-align: left;
	vertical-align: top;
	font-size: 14.5px;
	line-height: 1.55;
}

.chiavi-front-wrap table.chiavi-table thead th {
	background: #2c3338;
	color: #fff;
	font-weight: 700;
	text-transform: uppercase;
	font-size: 12px;
	letter-spacing: .5px;
	white-space: nowrap;
	border-bottom: none;
}

.chiavi-front-wrap table.chiavi-table thead th:first-child {
	border-top-left-radius: 8px;
}

.chiavi-front-wrap table.chiavi-table thead th:last-child {
	border-top-right-radius: 8px;
}

.chiavi-front-wrap table.chiavi-table tbody tr:nth-child(even) {
	background: #f3f7fb;
}

.chiavi-front-wrap table.chiavi-table tbody tr:hover {
	background: #e8f1fa;
}

.chiavi-front-wrap table.chiavi-table tbody tr:last-child td {
	border-bottom: none;
}

.chiavi-front-wrap .chiavi-badge {
	white-space: nowrap;
	font-size: 12px;
	padding: 3px 10px;
}

.chiavi-front-wrap .chiavi-maps-link {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 7px 14px;
	background: #2271b1;
	color: #fff !important;
	border-radius: 6px;
	text-decoration: none !important;
	font-weight: 600;
	font-size: 13px;
	white-space: nowrap;
	transition: background 0.15s ease, transform 0.05s ease;
}

.chiavi-front-wrap .chiavi-maps-link:hover {
	background: #135e96;
	color: #fff !important;
}

.chiavi-front-wrap .chiavi-maps-link:active {
	transform: translateY(1px);
}

.chiavi-front-wrap .chiavi-video-link {
	display: inline-flex;
	align-items: center;
	padding: 6px 12px;
	background: #f0f0f1;
	border-radius: 6px;
	text-decoration: none !important;
	color: #2271b1 !important;
	font-size: 12.5px;
	font-weight: 600;
}

.chiavi-front-wrap .chiavi-video-link:hover {
	background: #e0e0e0;
}

.chiavi-front-wrap .chiavi-thumb {
	border-radius: 6px;
	box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.chiavi-front-wrap .chiavi-antifurto-note {
	line-height: 1.5;
}

/* --- Desktop: testi leggermente più grandi per una lettura più comoda --- */
@media (min-width: 901px) {
	.chiavi-front-wrap table.chiavi-table th,
	.chiavi-front-wrap table.chiavi-table td {
		font-size: 15.5px;
		padding: 16px 18px;
	}
	.chiavi-front-wrap table.chiavi-table thead th {
		font-size: 12.5px;
	}
}

/* --- Mobile/tablet: la tabella diventa un elenco di schede leggibili --- */
@media (max-width: 900px) {
	.chiavi-front-wrap .chiavi-table-scroll {
		overflow: visible;
		border: none;
		box-shadow: none;
		background: transparent;
		padding: 0;
	}

	.chiavi-front-wrap table.chiavi-table {
		min-width: 0;
		width: 100%;
		border-spacing: 0 14px;
	}

	.chiavi-front-wrap table.chiavi-table thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}

	.chiavi-front-wrap table.chiavi-table,
	.chiavi-front-wrap table.chiavi-table tbody,
	.chiavi-front-wrap table.chiavi-table tr,
	.chiavi-front-wrap table.chiavi-table td {
		display: block;
		width: 100%;
	}

	.chiavi-front-wrap table.chiavi-table tr {
		background: #fff;
		border: 1px solid #e2e4e7;
		border-radius: 10px;
		box-shadow: 0 1px 3px rgba(0,0,0,0.06);
		overflow: hidden;
	}

	.chiavi-front-wrap table.chiavi-table tbody tr:nth-child(even) {
		background: #fff;
	}

	.chiavi-front-wrap table.chiavi-table tbody tr:hover {
		background: #fff;
	}

	.chiavi-front-wrap table.chiavi-table td {
		border-bottom: 1px solid #f0f1f2;
		padding: 10px 14px 10px 42%;
		position: relative;
		min-height: 24px;
		font-size: 14px;
	}

	.chiavi-front-wrap table.chiavi-table td:last-child {
		border-bottom: none;
	}

	.chiavi-front-wrap table.chiavi-table td::before {
		content: attr(data-label);
		position: absolute;
		left: 14px;
		top: 10px;
		width: 36%;
		font-weight: 700;
		font-size: 11px;
		text-transform: uppercase;
		letter-spacing: .3px;
		color: #757575;
	}

	.chiavi-front-wrap table.chiavi-table td[data-label="Numero"] {
		padding-left: 14px;
		font-weight: 700;
		font-size: 16px;
		background: #2c3338;
		color: #fff;
	}

	.chiavi-front-wrap table.chiavi-table td[data-label="Numero"]::before {
		display: none;
	}
}
