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

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

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

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

.hrcal-badge-ferie {
	background-color: #d63638;
}

.hrcal-badge-malattia {
	background-color: #dba617;
	color: #1d2327;
}

.hrcal-badge-recurring {
	background-color: #2271b1;
}

.hrcal-badge-onetime {
	background-color: #646970;
}

.hrcal-year-form {
	margin: 12px 0 8px;
}

.hrcal-year-form select {
	margin-left: 6px;
}

.hrcal-pdf-btn {
	margin-left: 16px !important;
}

.hrcal-legend {
	margin: 8px 0 16px;
}

.hrcal-legend-item {
	display: inline-flex;
	align-items: center;
	margin-right: 20px;
	font-weight: 600;
}

.hrcal-swatch {
	display: inline-block;
	width: 14px;
	height: 14px;
	border-radius: 3px;
	margin-right: 6px;
}

.hrcal-swatch-ferie {
	background-color: #d63638;
}

.hrcal-swatch-malattia {
	background-color: #dba617;
}

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

.hrcal-calendar-table {
	border-collapse: collapse;
	width: 100%;
	min-width: 1400px;
}

.hrcal-calendar-table th,
.hrcal-calendar-table td {
	border: 1px solid #e2e4e7;
	text-align: center;
	vertical-align: top;
	padding: 3px 2px;
	font-size: 11px;
}

.hrcal-calendar-table thead th {
	background: #f0f0f1;
	font-size: 12px;
	padding: 8px 2px;
	position: sticky;
	top: 0;
	z-index: 2;
}

.hrcal-day-col {
	width: 40px;
	min-width: 40px;
	background: #f6f7f7;
	font-weight: 600;
	position: sticky;
	left: 0;
	z-index: 1;
}

.hrcal-cell {
	min-width: 105px;
	height: 30px;
}

.hrcal-cell-empty {
	background: #fafafa;
}

.hrcal-cell-weekend {
	background-color: #eef0f6;
}

.hrcal-cell-blocked {
	background-image: repeating-linear-gradient(45deg, #f2f2f2, #f2f2f2 5px, #e6e6e6 5px, #e6e6e6 10px);
}

.hrcal-cell-weekend.hrcal-cell-blocked {
	background-image: repeating-linear-gradient(45deg, #e6e8f0, #e6e8f0 5px, #d6d9e6 5px, #d6d9e6 10px);
}

.hrcal-weekday-tag {
	display: block;
	font-size: 8px;
	line-height: 1.3;
	color: #999;
	text-transform: uppercase;
	letter-spacing: 0.2px;
}

.hrcal-swatch-weekend {
	background-color: #d7dbea;
}

.hrcal-year-nav {
	white-space: nowrap;
}

.hrcal-blocked-tag {
	display: block;
	font-size: 9px;
	line-height: 1.4;
	color: #777;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	cursor: default;
}

.hrcal-swatch-blocked {
	background-image: repeating-linear-gradient(45deg, #d0d0d0, #d0d0d0 3px, #b8b8b8 3px, #b8b8b8 6px);
}

.hrcal-pill {
	display: block;
	font-size: 10px;
	line-height: 1.5;
	border-radius: 2px;
	padding: 1px 4px;
	margin: 1px 0;
	color: #fff;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	cursor: default;
}

.hrcal-pill-ferie {
	background-color: #d63638;
}

.hrcal-pill-malattia {
	background-color: #dba617;
	color: #1d2327;
}

/* =========================================================
 * FRONT-END (shortcode) — stili indipendenti da wp-admin
 * Sul sito pubblico le classi "button"/"button-primary" di WordPress
 * non sono disponibili, quindi qui definiamo bottoni, select e layout
 * da zero, con classi proprie del plugin.
 * ========================================================= */
.hrcal-front-wrap {
	max-width: 100%;
	margin: 24px 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #23282d;
	box-sizing: border-box;
}

.hrcal-front-wrap *,
.hrcal-front-wrap *::before,
.hrcal-front-wrap *::after {
	box-sizing: inherit;
}

.hrcal-front-title {
	margin: 0 0 14px;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.3;
}

.hrcal-front-locked {
	padding: 16px 20px;
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	font-size: 15px;
}

.hrcal-front-wrap .hrcal-calendar-table th,
.hrcal-front-wrap .hrcal-calendar-table td {
	font-family: inherit;
}

/* --- Form / barra anno --- */
.hrcal-front-wrap .hrcal-year-form {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin: 0 0 18px;
	padding: 0;
}

/* --- Select anno --- */
.hrcal-front-wrap select {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	padding: 8px 34px 8px 14px;
	font-size: 14px;
	line-height: 1.4;
	color: #23282d;
	background-color: #fff;
	background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23555'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	border: 1px solid #ccd0d4;
	border-radius: 6px;
	cursor: pointer;
	transition: border-color 0.15s ease;
}

.hrcal-front-wrap select:hover {
	border-color: #949494;
}

.hrcal-front-wrap select:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
}

/* --- Bottoni (anno prec/succ, scarica PDF) --- */
.hrcal-front-wrap .hrcal-year-nav,
.hrcal-front-wrap .hrcal-pdf-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	text-decoration: none;
	white-space: nowrap;
	border-radius: 6px;
	border: 1px solid #ccd0d4;
	background-color: #f6f7f7;
	color: #2c3338;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
}

.hrcal-front-wrap .hrcal-year-nav:hover {
	background-color: #f0f0f1;
	border-color: #949494;
	color: #000;
}

.hrcal-front-wrap .hrcal-year-nav:active,
.hrcal-front-wrap .hrcal-pdf-btn:active {
	transform: translateY(1px);
}

/* Il tasto Scarica PDF resta in evidenza come azione principale. */
.hrcal-front-wrap .hrcal-pdf-btn {
	background-color: #2271b1;
	border-color: #2271b1;
	color: #fff;
	margin-left: auto;
}

.hrcal-front-wrap .hrcal-pdf-btn:hover {
	background-color: #135e96;
	border-color: #0a4b78;
	color: #fff;
}

/* --- Tabella calendario: bordo/ombra leggera per distinguerla dal contenuto della pagina --- */
.hrcal-front-wrap .hrcal-calendar-scroll {
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.hrcal-front-wrap .hrcal-legend {
	font-size: 13px;
	margin: 4px 0 14px;
}

/* --- Responsive: su schermi stretti la barra anno va a capo in modo ordinato --- */
@media (max-width: 600px) {
	.hrcal-front-wrap .hrcal-year-form {
		flex-direction: column;
		align-items: stretch;
	}

	.hrcal-front-wrap .hrcal-pdf-btn {
		margin-left: 0;
		justify-content: center;
	}

	.hrcal-front-wrap .hrcal-year-nav {
		justify-content: center;
	}
}

/* --- Gate password di accesso pubblico --- */
.hrcal-gate-wrap {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	min-height: 40vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 12px;
}
.hrcal-gate-box {
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 8px;
	padding: 28px 24px;
	max-width: 340px;
	width: 100%;
	text-align: center;
	box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.hrcal-gate-box h3 {
	margin: 0 0 16px;
	font-size: 18px;
}
.hrcal-gate-form {
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.hrcal-gate-form input[type="password"] {
	padding: 10px 12px;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	font-size: 15px;
}
.hrcal-gate-submit {
	padding: 10px 16px;
	border: 0;
	border-radius: 6px;
	background: #2271b1;
	color: #fff;
	font-weight: 600;
	cursor: pointer;
}
.hrcal-gate-submit:hover {
	background: #135e96;
}
.hrcal-gate-error {
	color: #c40000;
	font-size: 14px;
	margin: 0 0 10px;
}

/* Colore personale dipendente */
.hrcal-color-form {
	display: flex;
	align-items: center;
	gap: 8px;
}

.hrcal-color-form input[type="color"] {
	width: 46px;
	height: 30px;
	padding: 1px;
	cursor: pointer;
}

.hrcal-pill-user {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 4px;
}

.hrcal-pill-name {
	overflow: hidden;
	text-overflow: ellipsis;
}

.hrcal-pill-category {
	flex: 0 0 auto;
	font-size: 8px;
	font-weight: 800;
	opacity: .9;
	padding-left: 3px;
	border-left: 1px solid currentColor;
}

/* =========================================================
 * FRONT-END: [calendario_assenze_admin]
 * Le classi admin di WordPress (button, wp-list-table, form-table,
 * notice...) non esistono sul front-end, quindi qui c'è una versione
 * "hrcal-front-*" apposita, indipendente da wp-admin.
 * ========================================================= */
.hrcal-front-admin .hrcal-card {
	max-width: 100%;
}

.hrcal-admin-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin: 0 0 20px;
	border-bottom: 1px solid #dcdcde;
}

.hrcal-admin-tabs a {
	padding: 10px 16px;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	color: #50575e;
	border-bottom: 3px solid transparent;
	margin-bottom: -1px;
}

.hrcal-admin-tabs a:hover {
	color: #1d2327;
}

.hrcal-admin-tabs a.active {
	color: #2271b1;
	border-bottom-color: #2271b1;
}

.hrcal-front-section-title {
	margin: 0 0 12px;
	font-size: 17px;
	font-weight: 700;
}

.hrcal-front-description {
	font-size: 13px;
	color: #646970;
	margin: 6px 0 14px;
}

/* --- Notifiche (sostituiscono le .notice di wp-admin) --- */
.hrcal-front-notice {
	padding: 10px 14px;
	border-radius: 6px;
	margin: 0 0 18px;
	font-size: 14px;
	border-left: 4px solid;
	background: #f6f7f7;
}

.hrcal-front-notice-success {
	background: #f0f6ec;
	border-color: #46b450;
}

.hrcal-front-notice-error {
	background: #fbeaea;
	border-color: #d63638;
}

.hrcal-front-notice-warning {
	background: #fef8ee;
	border-color: #dba617;
}

/* --- Form (sostituisce .form-table di wp-admin) --- */
.hrcal-front-form-table {
	width: 100%;
	max-width: 520px;
	border-collapse: collapse;
	margin: 0 0 8px;
}

.hrcal-front-form-table th {
	text-align: left;
	vertical-align: middle;
	padding: 10px 12px 10px 0;
	width: 170px;
	font-weight: 600;
	font-size: 14px;
}

.hrcal-front-form-table td {
	padding: 8px 0;
}

.hrcal-front-wrap input[type="text"],
.hrcal-front-wrap input[type="date"],
.hrcal-front-wrap select {
	padding: 8px 12px;
	border: 1px solid #ccd0d4;
	border-radius: 6px;
	font-size: 14px;
	font-family: inherit;
	color: #23282d;
	background-color: #fff;
}

.hrcal-front-wrap input[type="color"] {
	width: 46px;
	height: 34px;
	padding: 1px;
	border: 1px solid #ccd0d4;
	border-radius: 6px;
	cursor: pointer;
}

@media (max-width: 600px) {
	.hrcal-front-form-table,
	.hrcal-front-form-table tbody,
	.hrcal-front-form-table tr,
	.hrcal-front-form-table th,
	.hrcal-front-form-table td {
		display: block;
		width: 100% !important;
	}

	.hrcal-front-form-table th {
		padding: 14px 0 4px;
	}

	.hrcal-front-wrap input[type="text"],
	.hrcal-front-wrap input[type="date"],
	.hrcal-front-wrap select {
		width: 100%;
	}
}

/* --- Pulsanti (sostituiscono .button/.button-primary di wp-admin) --- */
.hrcal-front-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 18px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	text-decoration: none;
	white-space: nowrap;
	border-radius: 6px;
	border: 1px solid #ccd0d4;
	background-color: #f6f7f7;
	color: #2c3338;
	cursor: pointer;
}

.hrcal-front-btn:hover {
	background-color: #f0f0f1;
	border-color: #949494;
	color: #000;
}

.hrcal-front-btn-primary {
	background-color: #2271b1;
	border-color: #2271b1;
	color: #fff;
}

.hrcal-front-btn-primary:hover {
	background-color: #135e96;
	border-color: #0a4b78;
	color: #fff;
}

.hrcal-front-btn-small {
	padding: 5px 10px;
	font-size: 12px;
}

/* --- Tabella elenco (sostituisce .wp-list-table di wp-admin) --- */
.hrcal-table-scroll {
	overflow-x: auto;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	margin: 0 0 28px;
}

.hrcal-front-list-table {
	width: 100%;
	min-width: 560px;
	border-collapse: collapse;
	background: #fff;
}

.hrcal-front-list-table th,
.hrcal-front-list-table td {
	border: 1px solid #e2e4e7;
	padding: 9px 12px;
	text-align: left;
	font-size: 13px;
	vertical-align: middle;
}

.hrcal-front-list-table thead th {
	background: #f0f0f1;
	font-weight: 600;
}

.hrcal-front-list-table tbody tr:nth-child(odd) {
	background: #fafafa;
}

/* --- Filtro per dipendente (Elenco Assenze) --- */
.hrcal-filter-form {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0 0 14px;
	font-size: 14px;
}
