.tm-wrap {
	width: 100%;
	max-width: 900px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	color: #1e2328;
}

.tm-card {
	background: #fff;
	border: 1px solid #e2e4e8;
	border-radius: 10px;
	padding: 20px 24px;
	margin-bottom: 20px;
	box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.tm-card h3 {
	margin-top: 0;
	font-size: 15px !important;
	font-weight: 600 !important;
}

.tm-notice {
	background: #f5f7fa;
	border-left: 4px solid #6b7280;
	padding: 12px 16px;
	border-radius: 6px;
	margin-bottom: 16px;
}

.tm-feedback.tm-success {
	border-left-color: #16a34a;
	background: #f0fdf4;
	color: #166534;
}

.tm-feedback.tm-error {
	border-left-color: #dc2626;
	background: #fef2f2;
	color: #991b1b;
}

.tm-form-row {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-bottom: 12px;
}

.tm-form-row label {
	display: flex;
	flex-direction: column;
	font-size: 13px;
	font-weight: 600;
	color: #4b5563;
	gap: 4px;
	flex: 1 1 160px;
}

.tm-form-row label.tm-full {
	flex: 1 1 100%;
}

.tm-form-row input,
.tm-form-row select,
.tm-form-row textarea {
	font-weight: 400;
	padding: 8px 10px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 14px;
}

.tm-btn {
	display: inline-block;
	padding: 9px 16px;
	border-radius: 6px;
	border: 1px solid #d1d5db;
	background: #f9fafb;
	cursor: pointer;
	font-size: 14px;
	text-decoration: none;
	color: #1e2328;
}

.tm-btn:hover {
	background: #f1f2f4;
}

.tm-btn-primary {
	background: #2563eb;
	border-color: #2563eb;
	color: #fff;
}

.tm-btn-primary:hover {
	background: #1d4ed8;
}

.tm-btn-approve {
	background: #16a34a;
	border-color: #16a34a;
	color: #fff;
}

.tm-btn-reject {
	background: #dc2626;
	border-color: #dc2626;
	color: #fff;
}

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

.tm-week-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
}

.tm-week-header h3 {
	margin: 0;
}

.tm-table-responsive {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	margin-bottom: 0;
}

.tm-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.tm-table th, .tm-table td {
	text-align: left;
	padding: 8px 10px;
	border-bottom: 1px solid #eef0f2;
}

.tm-table tfoot td {
	border-bottom: none;
	border-top: 2px solid #eef0f2;
}

.tm-badge {
	display: inline-block;
	padding: 3px 9px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
}

.tm-badge-draft {
	background: #f3f4f6;
	color: #4b5563;
}

.tm-badge-submitted {
	background: #fef9c3;
	color: #854d0e;
}

.tm-badge-approved {
	background: #dcfce7;
	color: #166534;
}

.tm-badge-rejected {
	background: #fee2e2;
	color: #991b1b;
}

.tm-note-rejected {
	font-size: 12px;
	color: #991b1b;
	cursor: help;
	text-decoration: underline dotted;
}

#tm-submit-week {
	margin-top: 14px;
}

/* --- Schede (tab) --- */
.tm-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	border-bottom: 2px solid #e2e4e8;
	margin-bottom: 20px;
}

.tm-tab {
	padding: 10px 16px;
	text-decoration: none;
	color: #4b5563;
	font-weight: 600;
	font-size: 14px;
	border-radius: 8px 8px 0 0;
	border: 2px solid transparent;
	border-bottom: none;
	margin-bottom: -2px;
}

.tm-tab:hover {
	background: #f5f7fa;
}

.tm-tab-active {
	color: #2563eb;
	border-color: #e2e4e8;
	border-bottom: 2px solid #fff;
	background: #fff;
}

.tm-section-title {
	font-size: 15px !important;
	font-weight: 600 !important;
	margin: 26px 0 10px;
	color: #374151;
}

.tm-muted {
	color: #6b7280;
	font-size: 13px;
	margin-top: 0;
}

.tm-hours-field,
.tm-protocol-field {
	display: none;
}

/* --- Anagrafica --- */
.tm-form-section {
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: #6b7280;
	margin: 18px 0 8px;
	padding-top: 12px;
	border-top: 1px solid #eef0f2;
}

.tm-form-section:first-of-type {
	margin-top: 0;
	padding-top: 0;
	border-top: none;
}

.tm-inline-check {
	display: flex !important;
	flex-direction: row !important;
	align-items: center;
	gap: 8px;
	text-transform: none;
	letter-spacing: normal;
	color: #1e2328;
	font-size: 14px;
}

.tm-domicilio-fields {
	background: #f9fafb;
	border-radius: 8px;
	padding: 10px 12px;
	margin-bottom: 10px;
}

.tm-readonly-table th {
	width: 240px;
	color: #4b5563;
	font-weight: 600;
	background: #f9fafb;
}

/* --- Griglia mensile --- */
.tm-grid-scroll { overflow-x: auto; }
.tm-grid { border-collapse: collapse; font-size: 12px; min-width: 100%; }
.tm-grid th, .tm-grid td { border: 1px solid #e2e4e8; padding: 2px; text-align: center; }
.tm-grid thead th { background: #f9fafb; font-weight: 600; padding: 4px 2px; }
.tm-grid-dow { font-size: 10px; color: #6b7280; text-transform: uppercase; }
.tm-grid .tm-grid-project { text-align: left; padding: 4px 8px; font-weight: 600; white-space: nowrap; position: sticky; left: 0; background: #fff; z-index: 1; }
.tm-grid thead .tm-grid-project { background: #f9fafb; }
.tm-grid th.tm-day-holiday { background: #fee2e2; color: #b91c1c; }
.tm-grid td.tm-day-holiday { background: #fef2f2; }
.tm-grid th.tm-day-holiday .tm-grid-dow { color: #b91c1c; }
.tm-grid th.tm-day-sat { background: #fef9ee; color: #92400e; }
.tm-grid td.tm-day-sat { background: #fffbf3; }
.tm-grid-input { width: 34px; padding: 3px 1px; text-align: center; border: 1px solid #d1d5db; border-radius: 4px; font-size: 12px; }
.tm-grid-locked { display: inline-block; min-width: 30px; padding: 3px 2px; border-radius: 4px; font-weight: 600; }
.tm-grid-submitted { background: #fef9c3; color: #854d0e; }
.tm-grid-approved { background: #dcfce7; color: #166534; }
.tm-grid-total { background: #f3f4f6; font-weight: 700; }
.tm-grid-legend { font-size: 12px; color: #6b7280; margin: 10px 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tm-legend-box { display: inline-block; width: 14px; height: 14px; border: 1px solid #e2e4e8; border-radius: 3px; }
.tm-grid-legend .tm-day-holiday { background: #fee2e2; }
#tm-submit-month { margin-left: 8px; }

/* --- Loading Spinner --- */
.tm-btn-loading {
	position: relative;
	pointer-events: none;
	opacity: 0.8;
}

.tm-spinner {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid rgba(0, 0, 0, 0.2);
	border-radius: 50%;
	border-top-color: currentColor;
	animation: tm-spin 0.8s linear infinite;
	margin-left: 6px;
	vertical-align: middle;
}

.tm-btn-primary .tm-spinner,
.tm-btn-approve .tm-spinner,
.tm-btn-reject .tm-spinner {
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #fff;
}

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