/**
 * Amministratore di Sostegno — stili frontend.
 * Tema verde #1f7a4d, mobile-first, responsive.
 */

.ads-app {
	--ads-green: #1f7a4d;
	--ads-green-d: #14502f;
	--ads-green-l: #e7f3ed;
	--ads-bg: #ffffff;
	--ads-border: #dbe5df;
	--ads-text: #1f2b25;
	--ads-muted: #6b7b73;
	--ads-radius: 12px;
	--ads-shadow: 0 2px 10px rgba(20, 80, 47, .08);
	max-width: 960px;
	margin: 0 auto;
	color: var(--ads-text);
	font-size: 16px;
	line-height: 1.45;
	box-sizing: border-box;
}
.ads-app *,
.ads-app *::before,
.ads-app *::after { box-sizing: inherit; }

.ads-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Header ---------- */
.ads-app-header {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	background: var(--ads-green); color: #fff;
	padding: 14px 18px; border-radius: var(--ads-radius) var(--ads-radius) 0 0;
}
.ads-brand { font-weight: 700; font-size: 1.1rem; }
.ads-ben-selector select,
.ads-ben-single { background: #fff; color: var(--ads-text); border-radius: 8px; padding: 6px 10px; border: 0; font-size: .95rem; }
.ads-ben-single { font-weight: 600; }

/* ---------- Tabs ---------- */
.ads-tabs {
	display: flex; flex-wrap: wrap; gap: 4px;
	background: var(--ads-green-d); padding: 6px;
}
.ads-tab {
	flex: 1 1 auto; min-width: 90px;
	background: transparent; color: #cfe6da; border: 0; cursor: pointer;
	padding: 10px 8px; border-radius: 8px; font-size: .92rem; font-weight: 600;
	transition: background .15s, color .15s;
}
.ads-tab:hover { color: #fff; }
.ads-tab.is-active { background: #fff; color: var(--ads-green-d); }

/* ---------- Panels ---------- */
.ads-panel { display: none; padding: 18px; background: var(--ads-bg); border: 1px solid var(--ads-border); border-top: 0; }
.ads-panel.is-active { display: block; }
.ads-panel:last-of-type { border-radius: 0 0 var(--ads-radius) var(--ads-radius); }
.ads-panel h3 { margin: 0 0 12px; color: var(--ads-green-d); }
.ads-panel h4 { margin: 18px 0 8px; color: var(--ads-green-d); }
.ads-mt { margin-top: 24px; }

/* ---------- Messaggi ---------- */
.ads-msg { min-height: 0; }
.ads-msg.show { padding: 10px 14px; margin: 12px 18px 0; border-radius: 8px; }
.ads-msg.ok { background: var(--ads-green-l); color: var(--ads-green-d); }
.ads-msg.err { background: #fbe9e9; color: #a12626; }

/* ---------- Step inserimento ---------- */
.ads-step { padding: 12px 0; border-top: 1px dashed var(--ads-border); }
.ads-step:first-child { border-top: 0; }
.ads-step-label { font-weight: 700; color: var(--ads-green); margin-bottom: 8px; }
.ads-cat-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.ads-cat-btn {
	border: 2px solid var(--ads-green); background: #fff; color: var(--ads-green-d);
	padding: 8px 14px; border-radius: 20px; cursor: pointer; font-weight: 600; font-size: .92rem;
}
.ads-cat-btn.is-selected { background: var(--ads-green); color: #fff; }

/* ---------- Form ---------- */
.ads-field { margin-bottom: 12px; }
.ads-field label { display: block; font-weight: 600; margin-bottom: 4px; font-size: .9rem; }
.ads-field-row { display: flex; gap: 12px; }
.ads-field-row .ads-field { flex: 1; }
.ads-app input[type=text],
.ads-app input[type=email],
.ads-app input[type=search],
.ads-app input[type=number],
.ads-app input[type=date],
.ads-app input[type=file],
.ads-app select,
.ads-app textarea {
	width: 100%; padding: 10px 12px; border: 1px solid var(--ads-border);
	border-radius: 8px; font-size: 1rem; background: #fff; color: var(--ads-text);
}
.ads-app input:focus, .ads-app select:focus, .ads-app textarea:focus {
	outline: 2px solid var(--ads-green); outline-offset: 1px; border-color: var(--ads-green);
}

/* ---------- Autocomplete tipi ---------- */
.ads-autocomplete { position: relative; }
.ads-suggest {
	list-style: none; margin: 4px 0 0; padding: 4px; position: absolute; z-index: 20;
	left: 0; right: 0; background: #fff; border: 1px solid var(--ads-border);
	border-radius: 8px; box-shadow: var(--ads-shadow); max-height: 220px; overflow: auto;
}
.ads-suggest li { padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.ads-suggest li:hover, .ads-suggest li.active { background: var(--ads-green-l); }
.ads-suggest li.ads-create { color: var(--ads-green); font-weight: 600; }

/* ---------- Pulsanti ---------- */
.ads-btn { display: inline-block; cursor: pointer; border: 0; border-radius: 22px; padding: 10px 18px; font-size: .95rem; font-weight: 600; }
.ads-btn-primary { background: var(--ads-green); color: #fff; }
.ads-btn-primary:hover { background: var(--ads-green-d); }
.ads-btn-ghost { background: #fff; color: var(--ads-green-d); border: 2px solid var(--ads-green); }
.ads-btn-link { background: none; color: var(--ads-green); text-decoration: underline; padding: 8px; }
.ads-btn[disabled] { opacity: .55; cursor: default; }

/* ---------- Liste ---------- */
.ads-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.ads-toolbar input, .ads-toolbar select { width: auto; flex: 1 1 160px; }
.ads-list { display: flex; flex-direction: column; gap: 8px; }
.ads-item {
	display: flex; align-items: center; justify-content: space-between; gap: 10px;
	padding: 10px 12px; border: 1px solid var(--ads-border); border-radius: 10px; background: #fff;
}
.ads-item .ads-item-main { flex: 1; min-width: 0; }
.ads-item .ads-item-title { font-weight: 600; }
.ads-item .ads-item-sub { font-size: .85rem; color: var(--ads-muted); }
.ads-item .ads-item-amount { font-weight: 700; color: var(--ads-green-d); white-space: nowrap; }
.ads-item-actions { display: flex; gap: 6px; }
.ads-icon-btn { border: 0; background: var(--ads-green-l); color: var(--ads-green-d); border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: .85rem; }
.ads-icon-btn.danger { background: #fbe9e9; color: #a12626; }

/* ---------- Report ---------- */
.ads-export-bar { display: flex; gap: 8px; margin-bottom: 14px; }
.ads-report-output { margin-top: 8px; }
.ads-report-head h3 { margin: 0; }
.ads-report-period { color: var(--ads-muted); margin: 2px 0 14px; }
.ads-cat-block { border: 1px solid var(--ads-border); border-radius: 10px; margin-bottom: 14px; overflow: hidden; }
.ads-cat-title { display: flex; justify-content: space-between; padding: 10px 12px; background: var(--ads-green); color: #fff; font-weight: 700; border-left: 6px solid var(--ads-green-d); }
.ads-tipo-block { padding: 8px 12px; }
.ads-tipo-title { display: flex; justify-content: space-between; font-weight: 600; color: var(--ads-green-d); margin: 6px 0; }
.ads-tipo-total { color: var(--ads-muted); font-weight: 600; }
.ads-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.ads-table th { text-align: left; color: var(--ads-muted); font-weight: 600; border-bottom: 2px solid var(--ads-border); padding: 6px 6px; }
.ads-table td { padding: 7px 6px; border-bottom: 1px solid var(--ads-border); }
.ads-table .ads-num { text-align: right; white-space: nowrap; }
.ads-table .ads-center { text-align: center; }
.ads-row { cursor: pointer; }
.ads-row:hover { background: var(--ads-green-l); }
.ads-subtotal td { font-weight: 700; background: #f4f7f5; border-top: 2px solid var(--ads-border); }
.ads-cat-subtotal { padding: 8px 12px; text-align: right; background: #eef5f1; }
.ads-grand-total { display: flex; justify-content: space-between; padding: 14px 16px; background: var(--ads-green-d); color: #fff; border-radius: 10px; font-weight: 700; font-size: 1.05rem; }
.ads-dl-icon { border: 0; background: var(--ads-green); color: #fff; border-radius: 6px; width: 28px; height: 28px; cursor: pointer; font-size: 1rem; }
.ads-muted { color: var(--ads-muted); }

/* ---------- Modale ---------- */
.ads-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; }
.ads-modal[hidden] { display: none; }
.ads-modal-backdrop { position: absolute; inset: 0; background: rgba(20, 43, 33, .55); }
.ads-modal-box { position: relative; background: #fff; border-radius: 0; max-width: 100vw; width: 100vw; height: 100vh; max-height: 100vh; overflow: auto; box-shadow: none; padding: 28px clamp(16px, 5vw, 64px); }
.ads-modal-close { position: absolute; top: 8px; right: 12px; border: 0; background: none; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--ads-muted); }
.ads-modal-content h3 { margin-top: 0; }
.ads-modal-content .ads-field-row { flex-wrap: wrap; }

/* ---------- Login OTP ---------- */
.ads-login { max-width: 460px; }
.ads-login-card { background: #fff; border: 1px solid var(--ads-border); border-radius: var(--ads-radius); padding: 26px; box-shadow: var(--ads-shadow); }
.ads-login-head h2 { margin: 0 0 6px; color: var(--ads-green-d); }
.ads-login-head p { color: var(--ads-muted); margin: 0 0 18px; }
.ads-otp-step label { display: block; font-weight: 600; margin-bottom: 6px; }
.ads-otp-step input { margin-bottom: 12px; }
.ads-otp-hint { color: var(--ads-muted); font-size: .9rem; }
#ads-otp-code { font-size: 1.4rem; letter-spacing: .15em; text-align: center; }

.ads-empty, .ads-empty-state { color: var(--ads-muted); padding: 16px 0; }
.ads-help { color: var(--ads-muted); font-size: .9rem; margin-bottom: 12px; }

/* ---------- Spinner ---------- */
.ads-spin { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--ads-green-l); border-top-color: var(--ads-green); border-radius: 50%; animation: ads-rot .7s linear infinite; vertical-align: middle; }
@keyframes ads-rot { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
	.ads-app { font-size: 15px; }
	.ads-field-row { flex-direction: column; gap: 0; }
	.ads-tab { min-width: 0; flex: 1 1 30%; font-size: .82rem; }
	.ads-app-header { flex-direction: column; align-items: stretch; }
	.ads-item { flex-wrap: wrap; }
	.ads-grand-total { flex-direction: column; gap: 4px; }
}

/* =====================================================================
 * v1.1.0 — Condivisione categorie, essenzialità WYSIWYG, banner anomalie
 * ===================================================================== */

/* --- Editor WYSIWYG essenziale --- */
.ads-wysiwyg {
	border: 1px solid var(--ads-border, #d4dbd7);
	border-radius: 8px;
	overflow: hidden;
}
.ads-wysiwyg-tb {
	display: flex;
	gap: 2px;
	background: #f1f5f3;
	border-bottom: 1px solid var(--ads-border, #d4dbd7);
	padding: 4px;
}
.ads-wysiwyg-tb button {
	min-width: 30px;
	height: 28px;
	border: 1px solid transparent;
	background: #fff;
	border-radius: 5px;
	cursor: pointer;
	font-size: 14px;
	line-height: 1;
}
.ads-wysiwyg-tb button:hover {
	border-color: var(--ads-green, #1f7a4d);
}
.ads-wysiwyg-area {
	min-height: 90px;
	padding: 10px 12px;
	font-size: 14px;
	line-height: 1.5;
	outline: none;
}
.ads-wysiwyg-area:focus {
	box-shadow: inset 0 0 0 2px rgba(31, 122, 77, .15);
}
.ads-wysiwyg-area a { color: var(--ads-green, #1f7a4d); }

.ads-help-sm {
	font-size: 12px;
	color: #6b7280;
	margin: 4px 0 6px;
}
.ads-radio-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 18px;
}
.ads-radio-row label {
	font-weight: normal;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

/* --- Badge condivisione + quota attribuita nei report --- */
.ads-share-badge {
	display: inline-block;
	margin-left: 8px;
	padding: 1px 8px;
	font-size: 11px;
	font-weight: 600;
	color: #8a5a00;
	background: #fff4e0;
	border: 1px solid #f3d28a;
	border-radius: 10px;
	vertical-align: middle;
}
.ads-cat-attr {
	color: #155f3b;
	font-size: .9em;
	font-weight: 600;
	margin-left: 6px;
}
.ads-grand-attr {
	background: #eef6f1;
	color: #155f3b;
}

/* --- Essenzialità: icona info con tooltip in mouseover --- */
.ads-ess {
	position: relative;
	cursor: help;
	color: var(--ads-green, #1f7a4d);
	font-size: 13px;
	margin-left: 4px;
	outline: none;
}
.ads-ess-tip {
	display: none;
	position: absolute;
	left: 0;
	top: 130%;
	z-index: 40;
	width: min(320px, 80vw);
	background: #fff;
	color: #1f2937;
	border: 1px solid var(--ads-green, #1f7a4d);
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
	padding: 10px 12px;
	font-size: 13px;
	font-weight: normal;
	line-height: 1.5;
	text-align: left;
	white-space: normal;
}
.ads-ess:hover .ads-ess-tip,
.ads-ess:focus .ads-ess-tip,
.ads-ess:focus-within .ads-ess-tip {
	display: block;
}
.ads-ess-tip a { color: var(--ads-green, #1f7a4d); }

/* --- Banner anomalie in testata --- */
.ads-anomaly-banner {
	margin: 0 0 14px;
	border: 1px solid #f3d28a;
	background: #fff8ec;
	border-radius: 10px;
	overflow: hidden;
}
.ads-anomaly-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 10px 14px;
	font-weight: 700;
	color: #8a5a00;
}
.ads-anomaly-head::before {
	content: "⚠";
	margin-right: 6px;
}
.ads-anomaly-toggle {
	background: #8a5a00;
	color: #fff;
	border: none;
	border-radius: 6px;
	padding: 5px 12px;
	cursor: pointer;
	font-size: 13px;
}
.ads-anomaly-list {
	list-style: none;
	margin: 0;
	padding: 0 14px 12px;
}
.ads-anomaly-list li {
	padding: 7px 0;
	border-top: 1px dashed #f0dcae;
	font-size: 13px;
	color: #5b4300;
}

/* =====================================================================
 * v1.2.0 — Attività (frequenze/date/allegati), Libreria, Ricerca globale
 * ===================================================================== */

/* Area nome beneficiario + lente */
.ads-ben-area {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
	min-width: 0;
	margin-left: auto;
}
.ads-ben-selector { min-width: 0; }
.ads-ben-selector select {
	width: auto;
	max-width: min(48vw, 280px);
}
.ads-ben-single {
	max-width: min(48vw, 320px);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.ads-search-toggle {
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 40px;
	width: 40px;
	min-width: 40px;
	height: 40px;
	min-height: 40px;
	padding: 0;
	margin: 0;
	border: 2px solid rgba(255, 255, 255, .88);
	background: #fff;
	color: var(--ads-green-d, #14502f);
	border-radius: 50%;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
	cursor: pointer;
	font-size: 0;
	line-height: 1;
	transition: background .15s, color .15s, box-shadow .15s, transform .15s;
}
.ads-search-toggle:hover,
.ads-search-toggle:focus-visible {
	background: var(--ads-green-l, #e7f3ed);
	color: var(--ads-green-d, #14502f);
	box-shadow: 0 3px 12px rgba(0, 0, 0, .22);
}
.ads-search-toggle:active { transform: scale(.97); }
.ads-search-toggle:focus-visible { outline: 3px solid rgba(255, 255, 255, .95); outline-offset: 2px; }
.ads-icon-search {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	color: currentColor;
	pointer-events: none;
}
.ads-icon-search-svg {
	display: block;
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.5;
	stroke-linecap: round;
	stroke-linejoin: round;
	overflow: visible;
}

/* Overlay ricerca */
.ads-search-overlay {
	position: fixed;
	inset: 0;
	z-index: 1000;
	background: rgba(15, 30, 22, .5);
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 8vh 16px 16px;
}
.ads-search-overlay[hidden] { display: none; }
.ads-search-box {
	background: #fff;
	width: min(640px, 100%);
	border-radius: 12px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
	overflow: hidden;
	max-height: 80vh;
	display: flex;
	flex-direction: column;
}
.ads-search-bar {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 14px;
	border-bottom: 1px solid #e6ebe8;
}
.ads-search-bar input {
	flex: 1;
	border: none;
	font-size: 16px;
	outline: none;
	padding: 6px 4px;
}
.ads-search-close {
	border: none;
	background: none;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	color: #6b7280;
}
.ads-search-results {
	overflow-y: auto;
	padding: 6px;
}
.ads-search-result {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	width: 100%;
	text-align: left;
	border: none;
	background: none;
	padding: 10px 12px;
	border-radius: 8px;
	cursor: pointer;
}
.ads-search-result:hover { background: var(--ads-bg-soft, #f1f5f3); }
.ads-search-type {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .03em;
	color: var(--ads-green, #1f7a4d);
}
.ads-search-label { font-weight: 600; }
.ads-search-sub { font-size: 12px; color: #6b7280; }

/* Attività: titoli gruppo per frequenza */
.ads-att-grouptitle {
	margin: 16px 0 6px;
	color: var(--ads-green-dark, #155f3b);
	border-bottom: 2px solid var(--ads-bg-soft, #eef3f0);
	padding-bottom: 4px;
}
.ads-item-descr { font-size: 12px; color: #6b7280; margin-top: 2px; }
.ads-file-current { margin: 0 0 8px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ads-inline { font-weight: normal; display: inline-flex; align-items: center; gap: 5px; }

/* Libreria */
.ads-lib-item {
	border: 1px solid var(--ads-border, #e0e6e2);
	border-radius: 10px;
	padding: 14px 16px;
	margin-bottom: 12px;
	position: relative;
}
.ads-lib-head { display: flex; justify-content: space-between; align-items: center; }
.ads-lib-body { font-size: 14px; line-height: 1.55; margin: 8px 0; color: #29312d; }
.ads-lib-body a { color: var(--ads-green, #1f7a4d); }
.ads-lib-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ads-file-chip {
	border: 1px solid var(--ads-border, #d4dbd7);
	background: #f6faf8;
	border-radius: 16px;
	padding: 4px 12px;
	font-size: 12px;
	cursor: pointer;
	color: #155f3b;
}
.ads-file-chip:hover { background: #e9f3ee; }
.ads-lib-item .ads-item-actions { position: absolute; top: 12px; right: 14px; }

/* Lista allegati nel modale */
.ads-file-list { list-style: none; margin: 6px 0; padding: 0; }
.ads-file-list li {
	display: flex; align-items: center; justify-content: space-between;
	padding: 6px 8px; border: 1px solid #e6ebe8; border-radius: 6px; margin-bottom: 6px; font-size: 13px;
}
.ads-file-del { border: none; background: none; color: #b3261e; font-size: 18px; cursor: pointer; line-height: 1; }

/* =====================================================================
 * v1.3.0 — Libreria globale (admin) + banner impersonazione
 * ===================================================================== */
.ads-imp-banner {
	margin: 0 0 14px;
	padding: 10px 14px;
	background: #fdecea;
	border: 1px solid #f3b4ad;
	border-radius: 10px;
	color: #8a1c12;
	font-size: 14px;
	display: flex;
	align-items: center;
	gap: 8px;
}
.ads-imp-ico { font-size: 16px; }

.ads-lib-global {
	border-color: #f3d28a;
	background: #fffaf0;
}
.ads-lib-badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	color: #8a5a00;
	background: #fff1d6;
	border: 1px solid #f0cf86;
	border-radius: 10px;
	padding: 1px 8px;
	vertical-align: middle;
	margin-left: 6px;
}

/* v1.3.0 — intestazione gestione categorie con pulsante aggiungi */
.ads-cat-manage-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
}
.ads-cat-manage-head h4 { margin: 0; }

/* v1.4.0 — Box di aiuto in fondo a ogni scheda */
.ads-help-box {
	margin-top: 22px;
	border: 1px solid var(--ads-border, #dbe3de);
	border-left: 4px solid var(--ads-green, #1f7a4d);
	background: #f6faf8;
	border-radius: 8px;
	padding: 12px 16px;
}
.ads-help-box-title {
	font-weight: 700;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--ads-green-dark, #155f3b);
	margin-bottom: 6px;
}
.ads-help-box-title::before { content: "ℹ "; }
.ads-help-box-body { font-size: 13.5px; line-height: 1.6; color: #29312d; }
.ads-help-box-body a { color: var(--ads-green, #1f7a4d); }
.ads-help-box-body ul, .ads-help-box-body ol { margin: 6px 0 6px 18px; }

/* v1.4.0 — Libreria: resa "post" con titolo evidenziato e HTML formattato */
.ads-lib-title {
	margin: 0 0 10px;
	font-size: 1.25rem;
	font-weight: 800;
	color: var(--ads-green-dark, #155f3b);
	padding-bottom: 6px;
	border-bottom: 2px solid var(--ads-green, #1f7a4d);
	display: inline-block;
}
.ads-lib-post {
	font-size: 14.5px;
	line-height: 1.65;
	color: #29312d;
}
.ads-lib-post h2 { font-size: 1.15rem; color: var(--ads-green-dark, #155f3b); margin: 16px 0 6px; }
.ads-lib-post h3 { font-size: 1.05rem; color: var(--ads-green-dark, #155f3b); margin: 14px 0 6px; }
.ads-lib-post h4 { font-size: .98rem; margin: 12px 0 4px; }
.ads-lib-post p { margin: 8px 0; }
.ads-lib-post ul, .ads-lib-post ol { margin: 8px 0 8px 20px; }
.ads-lib-post blockquote {
	margin: 10px 0;
	padding: 6px 14px;
	border-left: 3px solid var(--ads-green, #1f7a4d);
	background: #f3f8f5;
	color: #3a443e;
}
.ads-lib-post hr { border: none; border-top: 1px solid #e1e8e3; margin: 14px 0; }
.ads-lib-post a { color: var(--ads-green, #1f7a4d); }

/* =====================================================================
 * v1.5.0 — metodo pagamento, tasti tipo, file picker, overlay upload,
 * conferma, miniatura, editor immagini
 * ===================================================================== */
.ads-pay-buttons, .ads-tipo-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.ads-pay-btn, .ads-tipo-chip {
	border: 1px solid var(--ads-border, #d4dbd7);
	background: #f6faf8;
	border-radius: 18px;
	padding: 6px 14px;
	font-size: 13px;
	cursor: pointer;
	color: #29312d;
}
.ads-pay-btn:hover, .ads-tipo-chip:hover { background: #e9f3ee; }
.ads-pay-btn.is-selected, .ads-tipo-chip.is-selected {
	background: var(--ads-green, #1f7a4d);
	border-color: var(--ads-green, #1f7a4d);
	color: #fff;
}

.ads-file-picker { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ads-file-name { font-size: 13px; color: #6b7280; }

.ads-upload-overlay {
	position: fixed; inset: 0; z-index: 1200;
	background: rgba(15, 30, 22, .55);
	display: flex; align-items: center; justify-content: center;
}
.ads-upload-overlay[hidden] { display: none; }
.ads-upload-box { background: #fff; padding: 26px 34px; border-radius: 12px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.ads-upload-text { margin-top: 12px; font-weight: 600; color: #155f3b; }
.ads-spin-lg { width: 40px; height: 40px; border-width: 4px; margin: 0 auto; }

.ads-confirm-ok { text-align: center; padding: 8px 4px; }
.ads-confirm-ico {
	width: 56px; height: 56px; border-radius: 50%;
	background: var(--ads-green, #1f7a4d); color: #fff;
	font-size: 30px; line-height: 56px; margin: 0 auto 10px;
}
.ads-confirm-det { font-size: 15px; color: #29312d; margin: 6px 0 16px; font-weight: 600; }

.ads-thumb-wrap { margin: 8px 0; }
.ads-thumb { max-width: 200px; height: auto; border: 1px solid #d4dbd7; border-radius: 6px; display: block; }
.ads-thumb-hint { font-size: 12px; color: #6b7280; margin-top: 4px; }

/* Editor immagini */
.ads-modal-box.ads-modal-wide { max-width: 98vw !important; width: 98vw !important; }
.ads-imgedit-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.ads-imgedit-stage { position: relative; max-height: 66vh; overflow: auto; background: #f0f3f1; border: 1px solid #dce3df; border-radius: 8px; text-align: center; }
.ads-imgedit-stage canvas { max-width: 100%; touch-action: none; }
.ads-crop-box { position: absolute; border: 2px dashed #1f7a4d; background: rgba(31,122,77,.15); pointer-events: none; }

/* v1.5.0 — evidenziazione quota assistito + badge documentazione libreria */
.ads-quota-highlight {
	background: linear-gradient(90deg, #fff3d1, #ffe9a8) !important;
	border: 2px solid #e0a83a !important;
	color: #7a5200 !important;
	font-size: 1.05rem;
	box-shadow: 0 2px 10px rgba(224,168,58,.25);
}
.ads-quota-highlight span { font-weight: 800; }
.ads-cat-attr { color: #a06a00; font-weight: 700; }

/* v1.6.0 — messaggi */
.ads-tab.ads-has-unread { color: #c0392b; font-weight: 700; }
.ads-tab.ads-has-unread::after { content: " ●"; color: #c0392b; }
.ads-msg-new { background: #f6faf8; border: 1px solid var(--ads-border, #d4dbd7); border-radius: 10px; padding: 14px; margin-bottom: 16px; }
.ads-msg-new textarea, .ads-msg-new input[type="text"] { width: 100%; }
.ads-msg-mov-sel { margin-top: 6px; font-size: 13px; color: #155f3b; background: #e9f3ee; border-radius: 6px; padding: 6px 10px; }
.ads-msg-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 4px; border-bottom: 1px solid #eef2ef; }
.ads-msg-subject { font-weight: 600; color: #1f7a4d; text-decoration: none; }
.ads-msg-subject:hover { text-decoration: underline; }
.ads-msg-meta { font-size: 12px; color: #6b7280; white-space: nowrap; }
.ads-msg-pager { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.ads-page-btn { border: 1px solid #d4dbd7; background: #fff; border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.ads-page-btn.is-active { background: #1f7a4d; color: #fff; border-color: #1f7a4d; }
.ads-thread-msg { border: 1px solid #e5e7eb; border-radius: 8px; padding: 10px 12px; margin: 8px 0; }
.ads-thread-reply { margin-left: 24px; background: #f6faf8; border-left: 3px solid #1f7a4d; }
.ads-thread-head { font-size: 12px; color: #6b7280; margin-bottom: 4px; }
.ads-thread-mov { margin-top: 6px; font-size: 12px; color: #155f3b; }
.ads-reply-box { margin-top: 12px; }
.ads-reply-box textarea { width: 100%; }

/* v1.6.1 — sintesi mezzi di pagamento a video */
.ads-metodi-summary { margin-top: 22px; padding-top: 14px; border-top: 2px solid #e0a83a; }
.ads-metodi-summary h4 { margin: 0 0 10px; color: #285aaa; }
.ads-metodi-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ads-metodi-table th, .ads-metodi-table td { padding: 8px 10px; border-bottom: 1px solid #eef2ef; text-align: left; }
.ads-metodi-table th.ads-num, .ads-metodi-table td.ads-num { text-align: right; }
.ads-metodi-table thead th { background: #eef3fb; color: #285aaa; }
.ads-metodi-table .ads-attr-col { font-weight: 700; color: #7a5200; background: #fff6df; }
.ads-metodi-note { margin-top: 10px; font-size: 13px; color: #285aaa; background: #eef3fb; border-radius: 6px; padding: 8px 12px; }

/* v1.6.2 — messaggi in stile email (inbox + conversazione) */
.ads-inbox-head { display: flex; align-items: center; gap: 8px; font-weight: 700; color: #1f2937; margin: 6px 0 10px; }
.ads-inbox-count { background: #1f7a4d; color: #fff; border-radius: 20px; font-size: 12px; padding: 1px 9px; font-weight: 700; }
.ads-inbox-empty { color: #6b7280; padding: 18px; text-align: center; background: #f6faf8; border-radius: 10px; }
.ads-inbox { list-style: none; margin: 0; padding: 0; border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; }
.ads-inbox-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-bottom: 1px solid #eef2ef; cursor: pointer; transition: background .12s; }
.ads-inbox-item:last-child { border-bottom: 0; }
.ads-inbox-item:hover, .ads-inbox-item:focus { background: #f2f8f5; outline: none; }
.ads-inbox-avatar { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; background: #1f7a4d; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.ads-inbox-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ads-inbox-line1 { display: flex; align-items: center; gap: 8px; }
.ads-inbox-from { font-weight: 700; color: #111827; font-size: 13px; }
.ads-inbox-badge { background: #eaf3ee; color: #1f7a4d; border-radius: 12px; font-size: 11px; padding: 0 8px; font-weight: 700; }
.ads-inbox-subject { font-weight: 600; color: #1f2937; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ads-inbox-snippet { color: #6b7280; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ads-inbox-date { flex: 0 0 auto; color: #9ca3af; font-size: 12px; white-space: nowrap; }

.ads-mail-subject { font-size: 18px; font-weight: 700; color: #111827; margin-bottom: 10px; }
.ads-mail-mov { display: inline-block; background: #eaf3ee; color: #155f3b; border-radius: 8px; padding: 6px 10px; font-size: 13px; margin-bottom: 12px; }
.ads-mail-msg { border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.ads-mail-reply { margin-left: 26px; background: #f6faf8; border-left: 3px solid #1f7a4d; }
.ads-mail-msg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ads-mail-who { display: flex; flex-direction: column; line-height: 1.2; }
.ads-mail-when { font-size: 12px; color: #9ca3af; }
.ads-mail-body { color: #1f2937; font-size: 14px; line-height: 1.55; word-break: break-word; }

/* v1.7.0 — popup a schermo intero: contenuto centrato e leggibile */
.ads-modal-content { max-width: 920px; margin: 0 auto; }
.ads-modal-box .ads-imgedit { max-width: 1280px; margin: 0 auto; }
.ads-modal-box .ads-imgedit-stage { max-height: 74vh; }
.ads-modal-close { position: fixed; top: 14px; right: 20px; z-index: 5; background: #fff; border: 1px solid #e5e7eb; border-radius: 50%; width: 40px; height: 40px; box-shadow: 0 2px 8px rgba(0,0,0,.12); }

/* v1.7.3 — X per chiudere definitivamente gli avvisi anomalie */
.ads-anomaly-head { display: flex; align-items: center; gap: 10px; }
.ads-anomaly-head-txt { flex: 1 1 auto; }
.ads-anomaly-close { flex: 0 0 auto; border: 0; background: rgba(0,0,0,.08); color: inherit; width: 26px; height: 26px; border-radius: 50%; font-size: 18px; line-height: 1; cursor: pointer; }
.ads-anomaly-close:hover { background: rgba(0,0,0,.16); }
/* v1.7.3 — select categoria nel dettaglio movimento */
.ads-d-cat-row { margin: 8px 0; }
.ads-d-cat-row select { width: 100%; }

/* v1.8.0 — icone immagine (chiudi / ricerca / letto) */
.ads-modal-close { position: fixed; top: 20px; right: 20px; z-index: 6; width: 44px; height: 44px; padding: 0; border: 0; background: #fff; border-radius: 50%; box-shadow: 0 2px 10px rgba(0,0,0,.18); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ads-modal-close img { width: 26px; height: 26px; display: block; }
/* v1.14.2 — la lente di ricerca è SVG inline: evitare override da temi o immagini raster. */
.ads-icon-search { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; object-fit: initial; }
.ads-search-toggle { display: inline-flex; align-items: center; justify-content: center; }

@media (max-width: 520px) {
	.ads-app-header { flex-wrap: wrap; }
	.ads-brand { flex: 1 1 100%; }
	.ads-ben-area { width: 100%; justify-content: space-between; margin-left: 0; }
	.ads-ben-selector { flex: 1 1 auto; }
	.ads-ben-selector select { width: 100%; max-width: none; }
	.ads-ben-single { flex: 1 1 auto; max-width: calc(100% - 52px); }
}

.ads-read-badge { display: inline-flex; align-items: center; vertical-align: middle; margin-left: 6px; }
.ads-read-badge img { width: 20px; height: 13px; display: block; }
.ads-read-badge.is-partial { opacity: .45; filter: grayscale(1); }
.ads-msg-recipients { font-size: 12px; color: #6b7280; margin-top: 2px; }
.ads-mail-recipients { font-size: 12px; color: #6b7280; margin: 2px 0 8px; }
.ads-msg-del { margin-left: 8px; background: none; border: 0; color: #b42318; cursor: pointer; font-size: 12px; text-decoration: underline; padding: 0; }
.ads-mail-del { background: none; border: 0; color: #b42318; cursor: pointer; font-size: 12px; text-decoration: underline; padding: 0; margin-left: 10px; }

/* v1.8.1 — pagina di login a due riquadri (OTP + password), mobile/senior friendly */
.ads-login-card { max-width: 480px; margin: 0 auto; }
.ads-login-head h2 { text-align: center; font-size: 22px; line-height: 1.3; margin-bottom: 18px; }
.ads-login-box { border: 2px solid; border-radius: 14px; padding: 18px 16px 20px; margin-bottom: 18px; }
.ads-login-box-otp { border-color: #1f7a4d; background: rgba(31,122,77,.06); }
.ads-login-box-pwd { border-color: #285aaa; background: rgba(40,90,170,.06); }
.ads-login-box-title { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 800; margin-bottom: 6px; }
.ads-login-box-num { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; font-size: 15px; flex: 0 0 auto; }
.ads-login-box-otp .ads-login-box-num { background: #1f7a4d; }
.ads-login-box-pwd .ads-login-box-num { background: #285aaa; }
.ads-login-box-desc { color: #4b5563; font-size: 14px; margin: 0 0 12px; }
.ads-login-box label { display: block; font-weight: 700; margin: 12px 0 6px; font-size: 15px; }
.ads-login-box input[type="text"],
.ads-login-box input[type="email"],
.ads-login-box input[type="password"] { width: 100%; font-size: 17px; padding: 13px 14px; border: 2px solid #cbd5e1; border-radius: 10px; box-sizing: border-box; }
.ads-login-box input:focus { outline: none; border-color: #285aaa; box-shadow: 0 0 0 3px rgba(40,90,170,.15); }
.ads-login-box-otp input:focus { border-color: #1f7a4d; box-shadow: 0 0 0 3px rgba(31,122,77,.15); }
.ads-login-box .ads-btn { width: 100%; font-size: 18px; padding: 14px 16px; margin-top: 14px; border-radius: 10px; }
.ads-login-box .ads-btn-link { background: none; padding: 10px; font-size: 15px; }
.ads-remember { display: flex !important; align-items: center; gap: 10px; font-weight: 600 !important; margin-top: 14px !important; color: #374151; cursor: pointer; }
.ads-remember input[type="checkbox"] { width: 22px; height: 22px; margin: 0; flex: 0 0 auto; }
.ads-antispam-label { font-weight: 700; }
.ads-antispam-number { display: inline-block; font-size: 22px; font-weight: 900; letter-spacing: 3px; color: #285aaa; background: #fff; border: 2px dashed #285aaa; border-radius: 8px; padding: 2px 12px; margin-left: 6px; }
#ads-pwd-antispam { max-width: 140px; letter-spacing: 6px; text-align: center; font-size: 22px; font-weight: 800; }
.ads-login-lost { margin: 14px 0 0; text-align: center; }
.ads-login-lost a { color: #285aaa; font-weight: 700; font-size: 15px; }
.ads-login .ads-msg { text-align: center; margin-top: 6px; }
@media (max-width: 420px) {
	.ads-login-head h2 { font-size: 20px; }
	.ads-login-box { padding: 16px 13px 18px; }
}

/* v1.9.0 — dialog possibili duplicati */
.ads-dup-confirm h3 { color: #b45309; margin-bottom: 8px; }
.ads-dup-new { background: #fff6df; border: 2px solid #e0a83a; border-radius: 8px; padding: 10px 12px; margin: 12px 0; font-size: 15px; }
.ads-dup-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14px; }
.ads-dup-table th, .ads-dup-table td { padding: 8px 10px; border-bottom: 1px solid #eef2ef; text-align: left; }
.ads-dup-table th.ads-num, .ads-dup-table td.ads-num { text-align: right; }
.ads-dup-table thead th { background: #f4f6f8; }

/* v1.9.1 — report a video: categorie e tipi a fisarmonica */
.ads-acc-toggle { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 10px; }
.ads-acc-toggle:hover { filter: brightness(0.98); }
.ads-acc-toggle:focus-visible { outline: 2px solid #285aaa; outline-offset: 2px; }
.ads-acc-chevron { flex: 0 0 auto; font-size: 13px; color: #6b7280; transition: transform .18s ease; display: inline-block; }
.ads-acc-toggle.is-open .ads-acc-chevron { transform: rotate(90deg); }
.ads-cat-title.ads-acc-toggle .ads-cat-name { flex: 1 1 auto; }
.ads-tipo-title.ads-acc-toggle { justify-content: flex-start; }
.ads-tipo-title.ads-acc-toggle > span:nth-child(2) { flex: 1 1 auto; }
.ads-tipo-title .ads-tipo-total { flex: 0 0 auto; }
.ads-cat-body[hidden], .ads-tipo-body[hidden] { display: none; }
.ads-cat-title.ads-acc-toggle::after { content: ''; }

/* v1.10.0 — Conto corrente */
.ads-conto-form { padding: 16px; margin-bottom: 16px; }
.ads-conto-tipo-switch { display: flex; gap: 8px; margin-bottom: 12px; }
.ads-conto-cat { flex: 1; padding: 12px; border: 2px solid #cbd5e1; background: #fff; border-radius: 10px; font-weight: 700; font-size: 15px; cursor: pointer; }
.ads-conto-cat[data-cat="versamento"].is-active { border-color: #1f7a4d; background: rgba(31,122,77,.08); color: #155f3b; }
.ads-conto-cat[data-cat="prelievo"].is-active { border-color: #b45309; background: rgba(180,83,9,.08); color: #92400e; }
.ads-conto-bilancio { display: flex; gap: 12px; flex-wrap: wrap; margin: 6px 0 16px; }
.ads-bil-item { flex: 1 1 160px; border: 2px solid #e5e7eb; border-radius: 10px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.ads-bil-item span { font-size: 13px; color: #6b7280; }
.ads-bil-item strong { font-size: 18px; }
.ads-bil-in { border-color: #1f7a4d; background: rgba(31,122,77,.05); }
.ads-bil-out { border-color: #b45309; background: rgba(180,83,9,.05); }
.ads-bil-saldo { border-color: #285aaa; background: rgba(40,90,170,.05); }
.ads-conto-month { border: 1px solid #e5e7eb; border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.ads-conto-month-head { padding: 12px 14px; background: #f6f8fa; font-weight: 700; }
.ads-conto-month-name { flex: 1 1 auto; }
.ads-conto-month-tot { font-size: 13px; color: #4b5563; font-weight: 600; }
.ads-conto-month-body[hidden] { display: none; }
.ads-conto-group { padding: 8px 12px; }
.ads-conto-group-title { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; margin: 6px 0; }
.ads-conto-group.is-in .ads-conto-group-title { color: #1f7a4d; }
.ads-conto-group.is-out .ads-conto-group-title { color: #b45309; }
.ads-conto-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border-bottom: 1px solid #eef2ef; }
.ads-conto-item:last-child { border-bottom: 0; }
.ads-conto-clickable { cursor: pointer; }
.ads-conto-clickable:hover { background: #f2f8f5; }
.ads-conto-item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ads-conto-date { font-size: 12px; color: #9ca3af; }
.ads-conto-meta { font-size: 14px; }
.ads-conto-item-right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.ads-conto-imp { font-weight: 700; }
.ads-conto-versamento .ads-conto-imp { color: #1f7a4d; }
.ads-conto-prelievo .ads-conto-imp { color: #b45309; }
.ads-conto-badge { display: inline-block; font-size: 11px; border-radius: 10px; padding: 1px 8px; margin-left: 6px; }
.ads-conto-badge.auto { background: #eef3fb; color: #285aaa; }
.ads-conto-badge.assoc { background: #fff6df; color: #92400e; }
.ads-assoc-list { list-style: none; padding: 0; margin: 6px 0; }
.ads-assoc-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid #eef2ef; border-radius: 8px; margin-bottom: 6px; }
.ads-assoc-rem { border: 0; background: #fdecea; color: #b42318; border-radius: 50%; width: 26px; height: 26px; cursor: pointer; }
.ads-assoc-results { margin-top: 8px; }
.ads-assoc-hit { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid #eef2ef; }
.ads-conto-bilancio-report { margin-top: 22px; padding-top: 14px; border-top: 2px solid #285aaa; }
.ads-conto-bilancio-report h4 { color: #285aaa; margin-bottom: 8px; }
.ads-bil-saldo-row td { border-top: 2px solid #285aaa; }

/* v1.10.1 — saldo iniziale conto */
.ads-bil-init { border-color: #6b7280; background: rgba(107,114,128,.05); }
.ads-saldo-archivio { margin-top: 18px; border-top: 1px solid #e5e7eb; padding-top: 12px; }
.ads-saldo-archivio h4 { margin: 0 0 8px; }

/* v1.12.0 — Attività ricorrenti nei report */
.ads-report-legend{
  display:flex;
  gap:8px;
  align-items:center;
  padding:10px 12px;
  margin:10px 0 14px;
  border:1px solid rgba(31,122,77,.25);
  border-radius:12px;
  background:rgba(31,122,77,.06);
  color:#234331;
  font-size:.94rem;
}
.ads-repeat-icon{
  width:20px;
  height:20px;
  object-fit:contain;
  vertical-align:middle;
}
.ads-repeat-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  border:1px solid rgba(0,0,0,.18);
  border-radius:999px;
  background:#fff;
  cursor:pointer;
  padding:4px;
}
.ads-repeat-btn:hover,
.ads-repeat-btn:focus{
  border-color:#1f7a4d;
  box-shadow:0 0 0 3px rgba(31,122,77,.12);
  outline:none;
}
.ads-row-attivita{
  background:rgba(31,122,77,.035);
}
.ads-detail-table{
  width:100%;
  border-collapse:collapse;
  margin-top:10px;
}
.ads-detail-table th,
.ads-detail-table td{
  border-bottom:1px solid rgba(0,0,0,.08);
  padding:8px 6px;
  text-align:left;
  vertical-align:top;
}
.ads-detail-table th{
  width:34%;
  color:#315846;
}

.ads-zip-progress{
  margin:12px 0;
  padding:14px;
  border:1px solid rgba(31,122,77,.25);
  background:rgba(31,122,77,.05);
}
.ads-zip-progress p{
  margin:6px 0 8px;
}
.ads-progress{
  height:10px;
  border-radius:999px;
  background:rgba(0,0,0,.10);
  overflow:hidden;
}
.ads-progress span{
  display:block;
  height:100%;
  background:#1f7a4d;
  transition:width .25s ease;
}
.is-loading{
  opacity:.65;
  cursor:wait;
}
