.awc-chat-app {
	display: flex;
	gap: 16px;
	max-width: 100%;
	min-height: 480px;
	margin-top: 12px;
	font-size: 14px;
	color: #1d2327;
}

.awc-employee-heading {
	display: flex;
	align-items: center;
	gap: 8px;
}

.awc-back-link {
	margin: 0 0 14px;
}

.awc-btn {
	display: inline-block;
	padding: 8px 16px;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	line-height: 1.4;
}

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

.awc-btn--primary:hover,
.awc-btn--primary:focus {
	background: #135e96;
	color: #fff;
}

/* Badge "totale non letti" accanto ai titoli (pannello animatore e pagina magazziniere). */
h1 .awc-badge,
h2 .awc-employee-heading .awc-badge,
.awc-employee-heading .awc-badge {
	font-size: 13px;
	vertical-align: middle;
}

.awc-chat-list {
	flex: 0 0 320px;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	background: #fff;
	overflow-y: auto;
	max-height: 640px;
}

.awc-chat-thread {
	flex: 1 1 auto;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	background: #fff;
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.awc-chat-loading,
.awc-chat-empty-state {
	padding: 20px;
	color: #666;
}

.awc-conversation-items {
	list-style: none;
	margin: 0;
	padding: 0;
}

.awc-conversation-item {
	padding: 12px 14px;
	border-bottom: 1px solid #f0f0f1;
	cursor: pointer;
}

.awc-conversation-item:hover {
	background: #f6f7f7;
}

.awc-conversation-item.awc-active {
	background: #f0f6fc;
	border-left: 3px solid #2271b1;
}

.awc-conversation-title {
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 6px;
}

.awc-conversation-subtitle {
	font-size: 12px;
	color: #646970;
	margin-top: 2px;
}

.awc-conversation-preview {
	font-size: 12px;
	color: #646970;
	margin-top: 4px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.awc-badge {
	display: inline-block;
	background: #d63638;
	color: #fff;
	border-radius: 10px;
	padding: 0 7px;
	font-size: 11px;
	line-height: 18px;
	min-width: 18px;
	text-align: center;
}

.awc-thread-header {
	padding: 12px 16px;
	border-bottom: 1px solid #f0f0f1;
	font-weight: 600;
}

.awc-thread-messages {
	flex: 1 1 auto;
	padding: 16px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-height: 460px;
}

.awc-message {
	max-width: 75%;
	display: flex;
	flex-direction: column;
}

.awc-message--mine {
	align-self: flex-end;
	align-items: flex-end;
}

.awc-message--other {
	align-self: flex-start;
	align-items: flex-start;
}

.awc-message-bubble {
	padding: 8px 12px;
	border-radius: 12px;
	white-space: pre-wrap;
	word-break: break-word;
}

.awc-message--mine .awc-message-bubble {
	background: #2271b1;
	color: #fff;
	border-bottom-right-radius: 2px;
}

.awc-message--other .awc-message-bubble {
	background: #f0f0f1;
	color: #1d2327;
	border-bottom-left-radius: 2px;
}

.awc-message-time {
	font-size: 11px;
	color: #8c8f94;
	margin-top: 2px;
}

.awc-thread-form {
	display: flex;
	gap: 8px;
	padding: 12px 16px;
	border-top: 1px solid #f0f0f1;
}

.awc-thread-form textarea {
	flex: 1 1 auto;
	resize: none;
	border-radius: 4px;
	border: 1px solid #8c8f94;
	padding: 8px 10px;
}

.awc-thread-form button {
	background: #2271b1;
	color: #fff;
	border: none;
	border-radius: 4px;
	padding: 0 18px;
	cursor: pointer;
	font-weight: 600;
}

.awc-thread-form button:hover {
	background: #135e96;
}

.awc-warehouse-toolbar {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px 16px;
	margin: 12px 0;
}

.awc-warehouse-toolbar input[type="text"] {
	flex: 1 1 220px;
	min-width: 0;
	box-sizing: border-box;
}

.awc-warehouse-toolbar label {
	display: flex;
	align-items: center;
	gap: 6px;
	white-space: nowrap;
}

.awc-warehouse-toolbar button {
	white-space: nowrap;
}

.awc-notif-hint {
	flex-basis: 100%;
	font-size: 12px;
	line-height: 1.5;
	color: #646970;
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	padding: 8px 10px;
}

.awc-toolbar-right {
	margin-left: auto;
}

/* Popup di notifica "nuovo messaggio", mostrato su qualunque pagina di wp-admin. */
.awc-toast {
	position: fixed;
	right: 20px;
	bottom: 20px;
	max-width: 320px;
	background: #1d2327;
	color: #fff;
	padding: 12px 18px;
	border-radius: 6px;
	box-shadow: 0 4px 18px rgba( 0, 0, 0, 0.3 );
	cursor: pointer;
	z-index: 999999;
	font-size: 14px;
	line-height: 1.4;
	opacity: 0;
	transform: translateY(12px);
	transition: opacity .25s ease, transform .25s ease;
}

.awc-toast.awc-toast--visible {
	opacity: 1;
	transform: translateY(0);
}

/* Popup a schermo intero (come un popup di un sito frontend), mostrato su
   qualunque pagina di wp-admin quando arriva un nuovo messaggio. Resta
   visibile finché non viene chiuso o cliccato, apposta per non passare
   inosservato. */
.awc-popup-overlay {
	position: fixed;
	inset: 0;
	background: rgba( 0, 0, 0, 0.55 );
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease;
}

.awc-popup-overlay.awc-popup-overlay--visible {
	opacity: 1;
	pointer-events: auto;
}

.awc-popup-box {
	background: #fff;
	color: #1d2327;
	border-radius: 10px;
	padding: 32px 32px 26px;
	max-width: min( 380px, calc( 100vw - 32px ) );
	width: 90%;
	box-sizing: border-box;
	text-align: center;
	position: relative;
	box-shadow: 0 12px 45px rgba( 0, 0, 0, 0.35 );
	transform: scale( .92 );
	transition: transform .2s ease;
}

.awc-popup-overlay--visible .awc-popup-box {
	transform: scale( 1 );
}

.awc-popup-close {
	position: absolute;
	top: 8px;
	right: 12px;
	background: none;
	border: none;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	color: #8c8f94;
	padding: 4px;
}

.awc-popup-close:hover {
	color: #1d2327;
}

.awc-popup-icon {
	font-size: 38px;
	margin-bottom: 6px;
}

.awc-popup-title {
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 8px;
}

.awc-popup-text {
	font-size: 14px;
	color: #3c434a;
	margin: 0 0 22px;
	line-height: 1.5;
}

.awc-popup-actions {
	display: flex;
	gap: 10px;
	justify-content: center;
}

/* Voce iniettata nella sidebar del pannello dipendente Amelia. */
.awc-injected-page {
	cursor: pointer;
}

.awc-injected-page .am-fs-sb__page-icon svg,
.awc-injected-page .am-msd__item-icon svg {
	display: block;
}

@media ( max-width: 782px ) {
	.awc-chat-app {
		flex-direction: column;
	}
	.awc-chat-list {
		flex: 0 0 auto;
		max-height: 260px;
	}
	.awc-warehouse-toolbar input[type="text"] {
		flex-basis: 100%;
	}
}

@media ( max-width: 480px ) {
	.awc-popup-box {
		padding: 24px 20px 20px;
	}
	.awc-message {
		max-width: 88%;
	}
}
