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

.std-card h3 {
	margin-top: 0;
}

.std-ticket-form-wrap label {
	display: block;
	font-weight: 600;
	margin-bottom: 4px;
}

.std-ticket-form-wrap input[type="text"],
.std-ticket-form-wrap select,
.std-ticket-form-wrap textarea {
	width: 100%;
	max-width: 520px;
	padding: 8px 10px;
	border: 1px solid #ccc;
	border-radius: 6px;
	box-sizing: border-box;
}

.std-btn {
	display: inline-block;
	padding: 9px 18px;
	border-radius: 6px;
	border: none;
	cursor: pointer;
	font-weight: 600;
}

.std-btn-primary {
	background: #2271b1;
	color: #fff;
}

.std-btn-primary:hover {
	background: #135e96;
}

.std-form-message {
	padding: 8px 12px;
	border-radius: 6px;
	margin-bottom: 12px;
}

.std-msg-success { background: #e6f6e9; color: #1a7a34; }
.std-msg-error { background: #fdeaea; color: #c0392b; }

.std-list-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
}

.std-view-tabs {
	display: flex;
	gap: 8px;
	margin: 16px 0 4px;
	border-bottom: 1px solid #e2e2e2;
}

.std-view-tab {
	background: none;
	border: none;
	border-bottom: 3px solid transparent;
	padding: 10px 4px;
	margin-right: 20px;
	font-size: 14px;
	font-weight: 600;
	color: #666;
	cursor: pointer;
}

.std-view-tab:hover {
	color: #2271b1;
}

.std-view-tab.active {
	color: #2271b1;
	border-bottom-color: #2271b1;
}

.std-tab-count {
	display: inline-block;
	background: #eee;
	color: #555;
	border-radius: 10px;
	padding: 1px 8px;
	font-size: 12px;
	margin-left: 4px;
}

.std-view-tab.active .std-tab-count {
	background: #2271b1;
	color: #fff;
}

.std-filters {
	display: flex;
	gap: 20px;
	align-items: center;
	flex-wrap: wrap;
	margin: 16px 0;
}

.std-filters label {
	font-size: 13px;
	display: flex;
	align-items: center;
	gap: 6px;
}

.std-table {
	width: 100%;
	border-collapse: collapse;
}

.std-table th, .std-table td {
	padding: 10px 12px;
	border-bottom: 1px solid #eee;
	text-align: left;
	font-size: 13px;
}

.std-table th[data-sort] {
	cursor: pointer;
	user-select: none;
}

.std-table th[data-sort]:hover {
	color: #2271b1;
}

.std-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
	background: #eee;
}

.std-status-new { background: #e8f0fe; color: #1a56db; }
.std-status-assigned { background: #fff4e5; color: #b26a00; }
.std-status-in_progress { background: #eef2ff; color: #4338ca; }
.std-status-waiting_customer { background: #fee2e2; color: #b91c1c; }
.std-status-resolved { background: #e6f6e9; color: #1a7a34; }
.std-status-closed { background: #f0f0f0; color: #555; }

.std-priority-low { background: #eef2f5; color: #556; }
.std-priority-medium { background: #fff4e5; color: #b26a00; }
.std-priority-high { background: #fdeaea; color: #c0392b; }

.std-requester-email {
	font-size: 11px;
	color: #777;
}

.std-empty-row td {
	text-align: center;
	color: #777;
	padding: 24px;
}

/* Notifiche */
.std-notif-bell { position: relative; }

.std-notif-btn {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 20px;
	position: relative;
}

.std-notif-count {
	position: absolute;
	top: -4px;
	right: -8px;
	background: #c0392b;
	color: #fff;
	border-radius: 50%;
	font-size: 11px;
	padding: 1px 6px;
	font-weight: 700;
}

.std-notif-dropdown {
	position: absolute;
	right: 0;
	top: 36px;
	width: 320px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 8px;
	box-shadow: 0 4px 16px rgba(0,0,0,0.12);
	z-index: 100;
}

.std-notif-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 14px;
	border-bottom: 1px solid #eee;
}

.std-link-btn {
	background: none;
	border: none;
	color: #2271b1;
	cursor: pointer;
	font-size: 12px;
}

.std-notif-list {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 280px;
	overflow-y: auto;
}

.std-notif-item {
	padding: 10px 14px;
	border-bottom: 1px solid #f2f2f2;
	cursor: pointer;
	font-size: 13px;
}

.std-notif-item:hover { background: #f7f9fb; }

.std-notif-empty {
	padding: 16px;
	color: #999;
	font-size: 13px;
	text-align: center;
}

/* Modale thread */
.std-modal {
	position: fixed;
	top: 0; left: 0; right: 0; bottom: 0;
	background: rgba(0,0,0,0.5);
	z-index: 9999;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	overflow-y: auto;
	padding: 40px 16px;
}

.std-modal-content {
	background: #fff;
	border-radius: 8px;
	padding: 24px;
	max-width: 720px;
	width: 100%;
	position: relative;
}

.std-modal-close {
	position: absolute;
	top: 10px;
	right: 14px;
	background: none;
	border: none;
	font-size: 22px;
	cursor: pointer;
}

.std-thread-meta {
	color: #666;
	font-size: 13px;
}

.std-activity-log {
	background: #f7f7f7;
	border-radius: 6px;
	padding: 8px 14px;
	margin: 10px 0;
	font-size: 12px;
	color: #555;
}

.std-activity-log summary {
	cursor: pointer;
	font-weight: 600;
}

.std-activity-log ul {
	margin: 8px 0 4px 0;
	padding-left: 18px;
}

.std-activity-date {
	color: #888;
}

.std-thread-messages {
	max-height: 400px;
	overflow-y: auto;
	margin: 16px 0;
}

.std-message {
	padding: 10px 14px;
	border-radius: 8px;
	margin-bottom: 10px;
	background: #f7f7f7;
}

.std-message-agent { background: #eaf2ff; }
.std-message-note { background: #fff8e1; border: 1px dashed #e0c46c; }
.std-message-author { font-weight: 700; font-size: 13px; }
.std-note-tag {
	background: #e0c46c;
	color: #5c4a13;
	font-size: 10px;
	padding: 1px 6px;
	border-radius: 8px;
	margin-left: 6px;
}
.std-message-body { font-size: 14px; margin-top: 4px; }
.std-message-date { font-size: 11px; color: #999; margin-top: 4px; }

.std-attachment-list {
	list-style: none;
	margin: 8px 0 0;
	padding: 0;
}

.std-attachment-list li {
	margin-bottom: 4px;
}

.std-attachment-list a {
	font-size: 12px;
	text-decoration: none;
	color: #2271b1;
	background: #f0f4f8;
	padding: 3px 8px;
	border-radius: 4px;
	display: inline-block;
}

.std-attachment-list a:hover {
	background: #e0e8f0;
}

.std-btn-claim {
	background: #b26a00;
	color: #fff;
	font-size: 12px;
	padding: 5px 10px;
}

.std-btn-claim:hover {
	background: #8a5200;
}

.std-pending-notice {
	background: #fef9e7;
	color: #926500;
	padding: 12px 16px;
	border-radius: 8px;
	font-size: 13px;
	text-align: center;
}

.std-btn-call {
	background: #1a7a34;
	color: #fff;
	margin-left: 12px;
}

.std-btn-call:hover {
	background: #145c27;
}

.std-thread-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 10px 0;
}

.std-reply-form textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 8px 10px;
	border-radius: 6px;
	border: 1px solid #ccc;
}

.std-reply-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 8px;
}

.std-note-checkbox {
	font-size: 12px;
	display: flex;
	align-items: center;
	gap: 4px;
}

.std-form-footer {
	font-size: 13px;
	color: #666;
}

.std-login-notice {
	text-align: center;
}


/* Bacheca adattiva per ruolo */
.std-role-dashboard { width: 100%; }
.std-dashboard-welcome { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:0 0 18px; }
.std-dashboard-welcome h2 { margin:3px 0 0; }
.std-dashboard-kicker { display:block; color:#667085; font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.08em; }
.std-calendar-card { overflow:hidden; }
.std-calendar-head { display:flex; justify-content:space-between; align-items:center; gap:14px; margin-bottom:14px; }
.std-calendar-head h3 { margin:3px 0 0; }
.std-calendar-nav { display:flex; gap:7px; }
.std-btn-light { background:#f3f5f8; color:#344054; border:1px solid #e4e7ec; padding:8px 12px; }
.std-calendar-weekdays, .std-calendar-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); }
.std-calendar-weekdays { border:1px solid #e4e7ec; border-bottom:0; border-radius:12px 12px 0 0; background:#f8fafc; }
.std-calendar-weekdays span { padding:9px 6px; text-align:center; font-size:12px; font-weight:700; color:#667085; }
.std-calendar-grid { border-left:1px solid #e4e7ec; border-top:1px solid #e4e7ec; }
.std-calendar-day { min-height:118px; padding:7px; border-right:1px solid #e4e7ec; border-bottom:1px solid #e4e7ec; background:#fff; min-width:0; }
.std-calendar-day.is-empty { background:#f9fafb; }
.std-calendar-day.is-today { background:#f0f6ff; box-shadow:inset 0 0 0 2px #2271b1; }
.std-calendar-day-number { font-size:12px; font-weight:700; margin-bottom:5px; }
.std-calendar-events { display:flex; flex-direction:column; gap:4px; }
.std-calendar-event { width:100%; border:0; border-left:3px solid #2271b1; border-radius:5px; padding:5px 6px; text-align:left; background:#eef5fb; color:#243447; font-size:11px; line-height:1.25; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; cursor:pointer; }
.std-calendar-event:hover { filter:brightness(.97); }
.std-calendar-status-resolved, .std-calendar-status-closed { border-left-color:#26915c; background:#edf8f2; }
.std-calendar-status-waiting_customer { border-left-color:#d99b20; background:#fff8e8; }
.std-calendar-status-in_progress, .std-calendar-status-assigned { border-left-color:#6941c6; background:#f4f0ff; }
.std-calendar-more { font-size:11px; color:#667085; padding-left:4px; }
.std-calendar-help { margin:12px 0 0; color:#667085; font-size:12px; }
.std-calendar-loading { grid-column:1/-1; padding:28px; text-align:center; color:#667085; }

@media (max-width: 760px) {
  .std-card { padding:16px; border-radius:14px; }
  .std-calendar-head { align-items:flex-start; flex-direction:column; }
  .std-calendar-nav { width:100%; }
  .std-calendar-nav .std-btn { flex:1; }
  .std-calendar-weekdays span { font-size:10px; padding:7px 2px; }
  .std-calendar-day { min-height:72px; padding:4px; }
  .std-calendar-event { font-size:0; padding:0; width:9px; height:9px; border:0; border-radius:50%; background:#2271b1; display:inline-block; }
  .std-calendar-events { flex-direction:row; flex-wrap:wrap; gap:3px; }
  .std-calendar-status-resolved, .std-calendar-status-closed { background:#26915c; }
  .std-calendar-status-waiting_customer { background:#d99b20; }
  .std-calendar-status-in_progress, .std-calendar-status-assigned { background:#6941c6; }
  .std-calendar-more { font-size:9px; padding:0; }
  .std-table { display:block; overflow-x:auto; -webkit-overflow-scrolling:touch; }
}
.std-card {
	background: #fff;
	border: 1px solid #e2e2e2;
	border-radius: 8px;
	padding: 20px 24px;
	margin-bottom: 24px;
	box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.std-card h3 {
	margin-top: 0;
}

.std-ticket-form-wrap label {
	display: block;
	font-weight: 600;
	margin-bottom: 4px;
}

.std-ticket-form-wrap input[type="text"],
.std-ticket-form-wrap select,
.std-ticket-form-wrap textarea {
	width: 100%;
	max-width: 520px;
	padding: 8px 10px;
	border: 1px solid #ccc;
	border-radius: 6px;
	box-sizing: border-box;
}

.std-btn {
	display: inline-block;
	padding: 9px 18px;
	border-radius: 6px;
	border: none;
	cursor: pointer;
	font-weight: 600;
}

.std-btn-primary {
	background: #2271b1;
	color: #fff;
}

.std-btn-primary:hover {
	background: #135e96;
}

.std-form-message {
	padding: 8px 12px;
	border-radius: 6px;
	margin-bottom: 12px;
}

.std-msg-success { background: #e6f6e9; color: #1a7a34; }
.std-msg-error { background: #fdeaea; color: #c0392b; }

.std-list-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
}

.std-view-tabs {
	display: flex;
	gap: 8px;
	margin: 16px 0 4px;
	border-bottom: 1px solid #e2e2e2;
}

.std-view-tab {
	background: none;
	border: none;
	border-bottom: 3px solid transparent;
	padding: 10px 4px;
	margin-right: 20px;
	font-size: 14px;
	font-weight: 600;
	color: #666;
	cursor: pointer;
}

.std-view-tab:hover {
	color: #2271b1;
}

.std-view-tab.active {
	color: #2271b1;
	border-bottom-color: #2271b1;
}

.std-tab-count {
	display: inline-block;
	background: #eee;
	color: #555;
	border-radius: 10px;
	padding: 1px 8px;
	font-size: 12px;
	margin-left: 4px;
}

.std-view-tab.active .std-tab-count {
	background: #2271b1;
	color: #fff;
}

.std-filters {
	display: flex;
	gap: 20px;
	align-items: center;
	flex-wrap: wrap;
	margin: 16px 0;
}

.std-filters label {
	font-size: 13px;
	display: flex;
	align-items: center;
	gap: 6px;
}

.std-table {
	width: 100%;
	border-collapse: collapse;
}

.std-table th, .std-table td {
	padding: 10px 12px;
	border-bottom: 1px solid #eee;
	text-align: left;
	font-size: 13px;
}

.std-table th[data-sort] {
	cursor: pointer;
	user-select: none;
}

.std-table th[data-sort]:hover {
	color: #2271b1;
}

.std-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
	background: #eee;
}

.std-status-new { background: #e8f0fe; color: #1a56db; }
.std-status-assigned { background: #fff4e5; color: #b26a00; }
.std-status-in_progress { background: #eef2ff; color: #4338ca; }
.std-status-waiting_customer { background: #fee2e2; color: #b91c1c; }
.std-status-resolved { background: #e6f6e9; color: #1a7a34; }
.std-status-closed { background: #f0f0f0; color: #555; }


.std-requester-email {
	font-size: 11px;
	color: #777;
}

.std-empty-row td {
	text-align: center;
	color: #777;
	padding: 24px;
}

/* Notifiche */
.std-notif-bell { position: relative; }

.std-notif-btn {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 20px;
	position: relative;
}

.std-notif-count {
	position: absolute;
	top: -4px;
	right: -8px;
	background: #c0392b;
	color: #fff;
	border-radius: 50%;
	font-size: 11px;
	padding: 1px 6px;
	font-weight: 700;
}

.std-notif-dropdown {
	position: absolute;
	right: 0;
	top: 36px;
	width: 320px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 8px;
	box-shadow: 0 4px 16px rgba(0,0,0,0.12);
	z-index: 100;
}

.std-notif-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 14px;
	border-bottom: 1px solid #eee;
}

.std-link-btn {
	background: none;
	border: none;
	color: #2271b1;
	cursor: pointer;
	font-size: 12px;
}

.std-notif-list {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 280px;
	overflow-y: auto;
}

.std-notif-item {
	padding: 10px 14px;
	border-bottom: 1px solid #f2f2f2;
	cursor: pointer;
	font-size: 13px;
}

.std-notif-item:hover { background: #f7f9fb; }

.std-notif-empty {
	padding: 16px;
	color: #999;
	font-size: 13px;
	text-align: center;
}

/* Modale thread */
.std-modal {
	position: fixed;
	top: 0; left: 0; right: 0; bottom: 0;
	background: rgba(0,0,0,0.5);
	z-index: 9999;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	overflow-y: auto;
	padding: 40px 16px;
}

.std-modal-content {
	background: #fff;
	border-radius: 8px;
	padding: 24px;
	max-width: 720px;
	width: 100%;
	position: relative;
}

.std-modal-close {
	position: absolute;
	top: 10px;
	right: 14px;
	background: none;
	border: none;
	font-size: 22px;
	cursor: pointer;
}

.std-thread-meta {
	color: #666;
	font-size: 13px;
}

.std-activity-log {
	background: #f7f7f7;
	border-radius: 6px;
	padding: 8px 14px;
	margin: 10px 0;
	font-size: 12px;
	color: #555;
}

.std-activity-log summary {
	cursor: pointer;
	font-weight: 600;
}

.std-activity-log ul {
	margin: 8px 0 4px 0;
	padding-left: 18px;
}

.std-activity-date {
	color: #888;
}

.std-thread-messages {
	max-height: 400px;
	overflow-y: auto;
	margin: 16px 0;
}

.std-message {
	padding: 10px 14px;
	border-radius: 8px;
	margin-bottom: 10px;
	background: #f7f7f7;
}

.std-message-agent { background: #eaf2ff; }
.std-message-note { background: #fff8e1; border: 1px dashed #e0c46c; }
.std-message-author { font-weight: 700; font-size: 13px; }
.std-note-tag {
	background: #e0c46c;
	color: #5c4a13;
	font-size: 10px;
	padding: 1px 6px;
	border-radius: 8px;
	margin-left: 6px;
}
.std-message-body { font-size: 14px; margin-top: 4px; }
.std-message-date { font-size: 11px; color: #999; margin-top: 4px; }

.std-attachment-list {
	list-style: none;
	margin: 8px 0 0;
	padding: 0;
}

.std-attachment-list li {
	margin-bottom: 4px;
}

.std-attachment-list a {
	font-size: 12px;
	text-decoration: none;
	color: #2271b1;
	background: #f0f4f8;
	padding: 3px 8px;
	border-radius: 4px;
	display: inline-block;
}

.std-attachment-list a:hover {
	background: #e0e8f0;
}

.std-btn-claim {
	background: #b26a00;
	color: #fff;
	font-size: 12px;
	padding: 5px 10px;
}

.std-btn-claim:hover {
	background: #8a5200;
}

.std-pending-notice {
	background: #fef9e7;
	color: #926500;
	padding: 12px 16px;
	border-radius: 8px;
	font-size: 13px;
	text-align: center;
}

.std-btn-call {
	background: #1a7a34;
	color: #fff;
	margin-left: 12px;
}

.std-btn-call:hover {
	background: #145c27;
}

.std-thread-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 10px 0;
}

.std-reply-form textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 8px 10px;
	border-radius: 6px;
	border: 1px solid #ccc;
}

.std-reply-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 8px;
}

.std-note-checkbox {
	font-size: 12px;
	display: flex;
	align-items: center;
	gap: 4px;
}

.std-form-footer {
	font-size: 13px;
	color: #666;
}

.std-login-notice {
	text-align: center;
}


/* Identificativo richiesta: il colore indica lo stato della richiesta. */
.std-ticket-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 7px;
	border-radius: 7px;
	box-sizing: border-box;
	font-weight: 700;
	font-size: 13px;
	line-height: 1;
	color: #fff;
	font-variant-numeric: tabular-nums;
}
.std-ticket-number-new { background: #8b95a5; }
.std-ticket-number-assigned,
.std-ticket-number-in_progress { background: #2563eb; }
.std-ticket-number-waiting_customer { background: #dc2626; }
.std-ticket-number-resolved { background: #218838; }
.std-ticket-number-closed { background: #343a40; }
.std-ticket-row.std-open-ticket { cursor: pointer; }
.std-ticket-row.std-open-ticket:focus { outline: 2px solid currentColor; outline-offset: -2px; }
/* Nella scheda Medico la colonna azione compare solo nella tab Non assegnate. */
#std-ticket-table .std-col-unassigned-agent { display: none; }
#std-ticket-table.std-view-unassigned .std-col-unassigned-agent { display: table-cell; }


/* Conferma invio: sostituisce il modulo dopo la creazione della richiesta. */
.std-submit-success {
	min-height: 220px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 32px 20px;
	box-sizing: border-box;
}
.std-submit-success-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	margin-bottom: 14px;
	border-radius: 12px;
	background: #218838;
	color: #fff;
	font-size: 30px;
	font-weight: 700;
	line-height: 1;
}
.std-submit-success h3 {
	margin: 0 0 8px;
}
.std-submit-success p {
	margin: 0;
	max-width: 560px;
}
.std-submit-success .std-submit-warning {
	margin-top: 12px;
	padding: 10px 12px;
	border-radius: 8px;
	background: #fff4d6;
	color: #7a5600;
}


/* Richiesta conclusa: il paziente può consultarla ma non rispondere. */
.std-resolved-notice {
	margin-top: 18px;
	padding: 18px 20px;
	border: 1px solid #bbf7d0;
	border-radius: 12px;
	background: #f0fdf4;
	color: #166534;
}
.std-resolved-notice p { margin: 6px 0 0; }


/* Smart Ticket Desk 1.5.5: risposta mobile e modale. */
body.std-modal-open { overflow: hidden; }
.std-reply-form textarea,
.std-reply-form input,
.std-reply-form select {
	font-size: 16px;
}
.std-reply-form textarea {
	min-height: 96px;
	resize: vertical;
}
@media (max-width: 760px) {
	.std-modal {
		padding: 0;
		align-items: stretch;
	}
	.std-modal-content {
		width: 100%;
		max-width: none;
		height: 100%;
		max-height: 100%;
		border-radius: 0;
		padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
		overflow-y: auto;
		box-sizing: border-box;
	}
	.std-reply-actions {
		position: sticky;
		bottom: 0;
		z-index: 3;
		background: #fff;
		padding: 10px 0 calc(4px + env(safe-area-inset-bottom));
		gap: 10px;
	}
	.std-reply-actions .std-btn-primary {
		flex: 0 0 auto;
	}
}

/* Shortcode riepilogo: azione nuova richiesta */
.std-list-toolbar__title{display:flex;align-items:center;justify-content:space-between;gap:14px;flex:1;flex-wrap:wrap}.std-list-toolbar__title h3{margin:0}.std-new-request-link{white-space:nowrap;text-decoration:none}@media(max-width:640px){.std-list-toolbar__title{align-items:stretch;flex-direction:column}.std-new-request-link{width:100%;text-align:center;box-sizing:border-box}}
