/* SIBPA - Gestione soci (usa le variabili del template SIBPA, con valori di riserva) */
.sibpa-soci { --sp-teal: var(--teal-600, #2f929b); --sp-teal-d: var(--teal-700, #24767e); --sp-teal-l: var(--teal-50, #eef8f9);
	--sp-navy: var(--navy-800, #13294b); --sp-ink: var(--ink, #1d2b3a); --sp-soft: var(--ink-soft, #4d5d6c); --sp-line: var(--line, #dfe8ec);
	color: var(--sp-ink); }
.sibpa-soci .sp-title { margin: 0 0 1rem; text-align: center; color: var(--sp-navy); font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.3rem); }
.sibpa-soci .sp-lead { font-size: 1.12rem; color: #3d5468; text-align: center; max-width: 46rem; margin: 0 auto 1.5rem; }
.sibpa-soci h2 { font-size: 1.2rem; margin: 0 0 .8rem; color: var(--sp-navy); }
.sibpa-soci .sp-mt { margin-top: 1.6rem; }
.sp-card { background: #fff; border: 1px solid var(--sp-line); border-radius: 12px; padding: 1.25rem 1.4rem; margin: 0 0 1.1rem; min-width: 0; }
fieldset.sp-card { padding-top: .9rem; }
.sp-card legend { float: left; width: 100%; padding: 0; margin: 0 0 .8rem; font-weight: 700; font-size: 1.1rem; color: var(--sp-navy); }
.sp-card legend + * { clear: both; }
.sp-note { background: var(--sp-teal-l); border-radius: 8px; padding: .7rem 1rem; }
.sp-help { color: var(--sp-soft); font-size: .92rem; margin: 0 0 .8rem; }
.sp-req { color: #c0392b; }
.sp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1.2rem; }
.sp-field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.sp-field label, .sp-label { font-weight: 600; font-size: .92rem; margin: 0; }
.sp-label { margin: 1rem 0 .5rem; }
.sp-field small { color: var(--sp-soft); font-size: .8rem; }
.sibpa-soci input[type=text], .sibpa-soci input[type=email], .sibpa-soci input[type=tel], .sibpa-soci input[type=password], .sibpa-soci input[type=number],
.sibpa-soci input[type=date], .sibpa-soci input[type=search], .sibpa-soci select, .sibpa-soci textarea {
	width: 100%; padding: .6rem .75rem; font: inherit; font-size: 1rem; color: var(--sp-ink); background: #fff; border: 1px solid #c9d7dd; border-radius: 8px; }
.sibpa-soci input:focus, .sibpa-soci select:focus, .sibpa-soci textarea:focus { outline: 0; border-color: var(--sp-teal); box-shadow: 0 0 0 3px rgba(47,146,155,.2); }
.sibpa-soci input[readonly] { background: #f5f8f9; }
.sp-choice-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem; }
.sp-choice { display: flex; gap: .7rem; align-items: flex-start; padding: .85rem 1rem; border: 1.5px solid var(--sp-line); border-radius: 10px; cursor: pointer; }
.sp-choice:has(input:checked) { border-color: var(--sp-teal); background: var(--sp-teal-l); }
.sp-choice small { display: block; color: var(--sp-soft); font-size: .85rem; margin-top: .15rem; }
.sp-choice input, .sp-check input { margin-top: .25rem; accent-color: var(--sp-teal); flex: none; }
.sp-check { display: flex; gap: .55rem; align-items: flex-start; font-weight: 400; cursor: pointer; margin: .5rem 0; }
.sp-check.is-disabled { opacity: .45; cursor: not-allowed; }
.sp-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .1rem 1rem; }
.sp-checks .sp-check { margin: .25rem 0; font-size: .95rem; }
.sp-counter { display: inline-block; margin-left: .4rem; padding: .05rem .5rem; border-radius: 99px; background: var(--sp-teal-l); color: var(--sp-teal-d); font-weight: 600; font-size: .8rem; }
.sp-total { margin: 1rem 0 0; font-size: 1.05rem; }
.sp-total strong { color: var(--sp-teal-d); font-size: 1.2rem; }
.sp-actions { text-align: center; margin: 1.2rem 0 .5rem; }
.sp-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sp-inline { display: inline; margin: 0; }
.sp-link { background: none; border: 0; padding: 0; color: var(--sp-teal-d); text-decoration: underline; cursor: pointer; font: inherit; font-size: .88rem; }
.sp-link--danger { color: #b02a1c !important; }
.sp-back { margin: 0 0 .5rem; }

/* stato */
.sp-status { display: grid; grid-template-columns: minmax(170px, auto) 1fr; gap: 1.2rem; align-items: center; padding: 1.2rem 1.4rem; margin: 0 0 1.1rem; border-radius: 12px; border: 1px solid var(--sp-line); border-left: 6px solid var(--sp-teal); background: #fff; }
.sp-status--attesa { border-left-color: #d69e2e; }
.sp-status--scaduto { border-left-color: #c0392b; }
.sp-status--onorario { border-left-color: var(--sp-navy); }
.sp-status-label { margin: 0 0 .3rem; font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--sp-soft); }
.sp-status-value { margin: 0; }
.sp-status-text p { margin: 0 0 .4rem; }
.sp-badge { display: inline-block; padding: .25rem .65rem; border-radius: 99px; font-size: .82rem; font-weight: 700; white-space: nowrap; }
.sp-badge--regola { background: #e3f4ec; color: #1e7b4f; }
.sp-badge--onorario { background: #e6ebf5; color: var(--sp-navy); }
.sp-badge--attesa { background: #fdf3dc; color: #8a5a00; }
.sp-badge--scaduto { background: #fbe5e2; color: #a32a1b; }
.sp-flag { display: block; margin-top: .25rem; color: #8a5a00; font-size: .78rem; font-weight: 600; }

/* gestionale */
.sp-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin: 0 0 1rem; }
.sp-kpi { padding: .9rem 1rem; background: #fff; border: 1px solid var(--sp-line); border-top: 4px solid var(--sp-navy); border-radius: 10px; color: var(--sp-soft); font-size: .88rem; }
.sp-kpi span { display: block; font-size: 1.7rem; font-weight: 700; color: var(--sp-navy); line-height: 1.1; }
.sp-kpi--ok { border-top-color: var(--sp-teal); } .sp-kpi--ok span { color: var(--sp-teal-d); }
.sp-kpi--wait { border-top-color: #d69e2e; } .sp-kpi--ko { border-top-color: #c0392b; }
.sp-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .9rem; }
.sp-tabs a { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .8rem; border-radius: 99px; background: #fff; border: 1px solid var(--sp-line); color: var(--sp-ink); text-decoration: none; font-size: .9rem; }
.sp-tabs a span { padding: 0 .45rem; border-radius: 99px; background: var(--sp-teal-l); color: var(--sp-teal-d); font-weight: 700; font-size: .78rem; }
.sp-tabs a.is-active { background: var(--sp-teal); border-color: var(--sp-teal); color: #fff; }
.sp-tabs a.is-active span { background: rgba(255,255,255,.25); color: #fff; }
.sp-toolbar { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: space-between; align-items: center; margin: 0 0 .8rem; }
.sp-search { display: flex; gap: .5rem; flex: 1 1 320px; max-width: 520px; }
.sp-toolbar-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.sp-table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--sp-line); border-radius: 12px; }
.sp-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.sp-table th { text-align: left; padding: .7rem .8rem; background: #f3f9fb; color: var(--sp-soft); font-size: .76rem; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.sp-table td { padding: .7rem .8rem; border-top: 1px solid var(--sp-line); vertical-align: top; }
.sp-table td small { display: block; color: var(--sp-soft); font-size: .8rem; }
.sp-table td a { color: var(--sp-navy); }
.sp-cols { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.sp-cols > .sp-card { margin: 0; }
.sp-cols + .sp-card { margin-top: 1.1rem; }
.sp-receipts { list-style: none; margin: 0; padding: 0; }
.sp-receipts li { padding: .65rem 0; border-top: 1px solid var(--sp-line); display: grid; gap: .15rem; font-size: .9rem; }
.sp-receipts li:first-child { border-top: 0; }
.sp-receipts li > span { color: var(--sp-soft); }
.sp-receipt-actions { display: flex; gap: .9rem; }
.sp-danger summary { cursor: pointer; color: #a32a1b; font-weight: 600; }
.sp-danger form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .8rem; }
.sp-danger input[type=text] { max-width: 180px; }

@media (max-width: 760px) {
	.sp-grid, .sp-cols { grid-template-columns: 1fr; }
	.sp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.sp-status { grid-template-columns: 1fr; }
}
.sibpa-soci [hidden] { display: none !important; }
.sp-choice-row + .sp-choice-row, .sp-autocert + .sp-choice-row { margin-top: .75rem; }

/* 1.1.1 - tabelle senza barra orizzontale: stati e intestazioni lunghe vanno a capo */
.sp-table th { white-space: normal; }
.sp-table .sp-badge { white-space: normal; line-height: 1.25; display: inline-block; max-width: 9rem; text-align: center; padding: .3rem .6rem; border-radius: 12px; }
.sp-table td:first-child strong { white-space: normal; }
.sp-table td { overflow-wrap: normal; }
.sp-table td small { overflow-wrap: anywhere; }
.sp-table .sp-badge { word-break: normal; overflow-wrap: normal; min-width: 6.5rem; }
.sp-table td .btn { white-space: nowrap; }
.sp-table-wrap { overflow-x: auto; }
@media (max-width: 700px) {
	.sp-table thead { display: none; }
	.sp-table, .sp-table tbody, .sp-table tr, .sp-table td { display: block; width: 100%; }
	.sp-table tr { padding: .7rem .9rem; border-top: 1px solid var(--sp-line); }
	.sp-table tr:first-child { border-top: 0; }
	.sp-table td { border: 0; padding: .2rem 0; }
	.sp-table td[data-label]::before { content: attr(data-label) ": "; color: var(--sp-soft); font-size: .8rem; }
}
.sp-kpis--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sp-kpi-links { margin: .5rem 0 0; font-size: .82rem; }
.sp-kpi-links a { color: var(--sp-teal-d); }
.sp-confirm input { max-width: 220px; }
@media (max-width: 760px) { .sp-kpis--3 { grid-template-columns: 1fr; } }
.sp-files { list-style: none; margin: .4rem 0 0; padding: 0; font-size: .88rem; }
.sp-files li { padding: .25rem .6rem; margin: .2rem 0; background: var(--sp-teal-l); border-radius: 6px; }
.sp-files li.sp-files-err { background: #fbe5e2; color: #a32a1b; }
.sibpa-soci input[type=file] { padding: .55rem; border: 1px dashed #b7c9cf; border-radius: 8px; background: #fafcfd; width: 100%; }
.sp-visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; border: 0 !important; }
.sp-attach-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin: .2rem 0 .3rem; }
.sp-attach-total { color: var(--sp-soft); font-size: .88rem; }
.sp-attach-total.is-over { color: #a32a1b; font-weight: 600; }
.sp-files li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.sp-files li span { overflow-wrap: anywhere; }
.sibpa-soci .sp-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .sibpa-soci .sp-grid--3 { grid-template-columns: 1fr; } }
.sibpa-soci .sp-year { border: 1px solid #dfe8ec; border-radius: 8px; margin: .5rem 0; background: #fff; }
.sibpa-soci .sp-year > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: .6rem; padding: .7rem 1rem; font-size: 1.05rem; }
.sibpa-soci .sp-year > summary::-webkit-details-marker { display: none; }
.sibpa-soci .sp-year > summary::before { content: "›"; display: inline-block; width: 1rem; color: #24767e; font-size: 1.3rem; line-height: 1; transition: transform .2s; }
.sibpa-soci .sp-year[open] > summary::before { transform: rotate(90deg); }
.sibpa-soci .sp-year > summary:hover { background: #eef8f9; }
.sibpa-soci .sp-year > .sp-receipts { margin: 0; padding: .2rem 1rem .8rem 2.6rem; }
.sibpa-soci .sp-year > summary .sp-help { margin: 0; font-size: .9rem; }
.sibpa-soci .sp-year .sp-receipts li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem 1rem; padding: .45rem 0; }
.sibpa-soci .sp-year .sp-receipts li > span:not(.sp-receipt-actions) { color: #6b7c8a; font-size: .88rem; overflow-wrap: anywhere; }
.sibpa-soci .sp-year .sp-receipt-actions { margin-left: auto; }
/* editor del messaggio */
.sibpa-soci .sp-rte { border: 1.5px solid #cfdde3; border-radius: 8px; background: #fff; }
.sibpa-soci .sp-rte:focus-within { border-color: #2f929b; box-shadow: 0 0 0 3px rgba(47,146,155,.15); }
.sibpa-soci .sp-rte-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; padding: .4rem; border-bottom: 1px solid #e3ecef; background: #f6fafb; border-radius: 8px 8px 0 0; }
.sibpa-soci .sp-rte-btn { min-width: 2.1rem; height: 2.1rem; padding: 0 .5rem; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #1d2b3a; font: inherit; font-size: .95rem; line-height: 1; cursor: pointer; }
.sibpa-soci .sp-rte-btn:hover, .sibpa-soci .sp-rte-btn:focus-visible { background: #fff; border-color: #cfdde3; }
.sibpa-soci .sp-rte-btn.is-on { background: #e3f2f3; border-color: #9cc9cd; color: #0e2a47; }
.sibpa-soci .sp-rte-txt { font-size: .85rem; font-weight: 600; }
.sibpa-soci .sp-rte-sep { width: 1px; height: 1.4rem; background: #d6e3e7; margin: 0 .2rem; }
.sibpa-soci .sp-rte-colors { position: relative; display: inline-flex; }
.sibpa-soci .sp-rte-color { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.sibpa-soci .sp-rte-a { font-weight: 700; }
.sibpa-soci .sp-rte-bar-col { display: block; width: 1.1rem; height: 3px; border-radius: 2px; background: #c0392b; }
.sibpa-soci .sp-rte-pal { display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 5; padding: .4rem; gap: .35rem; background: #fff; border: 1px solid #cfdde3; border-radius: 8px; box-shadow: 0 6px 20px rgba(14,42,71,.15); }
.sibpa-soci .sp-rte-colors.is-open .sp-rte-pal { display: flex; }
.sibpa-soci .sp-rte-sw { width: 1.6rem; height: 1.6rem; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #cfdde3; cursor: pointer; }
.sibpa-soci .sp-rte-sw:hover { box-shadow: 0 0 0 2px #2f929b; }
.sibpa-soci .sp-rte-area { min-height: 14rem; max-height: 32rem; overflow: auto; padding: .8rem 1rem; outline: none; line-height: 1.6; }
.sibpa-soci .sp-rte-area p { margin: 0 0 .8em; }
.sibpa-soci .sp-rte-area h3 { font-size: 1.15rem; margin: .6em 0 .4em; }
.sibpa-soci .sp-rte-area a { color: #24767e; text-decoration: underline; }
.sibpa-soci .sp-rte-area ul, .sibpa-soci .sp-rte-area ol { margin: 0 0 .8em; padding-left: 1.4rem; }
.sp-danger h2 { color: #a32a1b; font-size: 1.05rem; margin: 0; }
.sp-danger form { display: block; margin-top: .4rem; }

/* indice alfabetico del gestionale */
.sp-alfa { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0 0 .8rem; padding: .5rem; background: #fff; border: 1px solid var(--sp-line); border-radius: 12px; }
.sp-alfa a, .sp-alfa span { min-width: 2rem; height: 2rem; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; font-weight: 700; font-size: .9rem; text-decoration: none; }
.sp-alfa a { color: var(--sp-navy); background: var(--sp-teal-l); }
.sp-alfa a:hover { background: var(--sp-teal); color: #fff; }
.sp-alfa a.is-active { background: var(--sp-teal); color: #fff; }
.sp-alfa span { color: #b8c4cc; }
.sp-alfa .sp-alfa-all { padding: 0 .7rem; margin-left: auto; gap: .35rem; }
.sp-alfa .sp-alfa-all small { font-weight: 400; opacity: .8; }
@media (max-width: 640px) { .sp-alfa a, .sp-alfa span { min-width: 1.75rem; height: 1.75rem; font-size: .82rem; } .sp-alfa .sp-alfa-all { margin-left: 0; } }

.sp-avvisi { display: inline-flex; gap: .4rem; align-items: center; flex-wrap: nowrap; }
@media (max-width: 640px) { .sp-avvisi { flex-wrap: wrap; } }
.sp-avvisi select { padding: .45rem .5rem; border: 1px solid var(--sp-line); border-radius: 8px; background: #fff; font-size: .88rem; }
