/* Contatti 360 — barra filtri (pannello e sito) */
.c360fb {
	--fb-accent: #0b4f7c;
	--fb-accent-ink: #ffffff;
	--fb-line: rgba(84, 104, 130, .55);
	--fb-line-soft: rgba(84, 104, 130, .22);
	--fb-soft: rgba(84, 104, 130, .08);
	--fb-muted: rgba(84, 104, 130, .95);
	--fb-surface: transparent;
	--fb-radius: 10px;
	--fb-warn-bg: rgba(214, 160, 0, .18);
	--fb-warn: #7a5900;
	display: grid;
	gap: 10px;
	margin: 0 0 14px;
	font-size: 14px;
}
.c360 .c360fb { --fb-surface: #ffffff; }
.c360fb * { box-sizing: border-box; }
.c360fb svg { width: 18px; height: 18px; display: block; }

/* Azioni in alto a destra */
.c360fb-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.c360fb-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border: 1.5px solid var(--fb-accent); border-radius: 8px; background: var(--fb-surface); color: var(--fb-accent); font-weight: 600; text-decoration: none; line-height: 1.2; cursor: pointer; font: inherit; font-weight: 600; }
.c360fb-btn--primary { background: var(--fb-accent); color: var(--fb-accent-ink); }
.c360fb-btn:hover, .c360fb-btn:focus-visible { filter: brightness(1.12); color: var(--fb-accent); }
.c360fb-btn--primary:hover, .c360fb-btn--primary:focus-visible { color: var(--fb-accent-ink); }
.c360fb-btn--small { padding: 6px 12px; border-color: var(--fb-line); color: inherit; }
.c360fb :focus-visible { outline: 2px solid var(--fb-accent); outline-offset: 2px; }

.c360fb-form { display: grid; gap: 10px; margin: 0; }
.c360fb-enter { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }

/* Ricerca */
.c360fb-search { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 14px; border: 2px solid var(--fb-line); border-radius: var(--fb-radius); background: var(--fb-surface); min-width: 0; }
.c360fb-search:focus-within { border-color: var(--fb-accent); }
.c360fb-icon { color: var(--fb-accent); flex: none; }
.c360fb .c360fb-search input[type=search] { flex: 1 1 auto; min-width: 0; border: 0 !important; box-shadow: none !important; background: transparent; padding: 6px 0; font-size: 15px; color: inherit; outline: none; }
.c360fb-sep { width: 1px; align-self: stretch; margin: 4px 2px; background: var(--fb-line-soft); flex: none; }
.c360fb-deep { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-weight: 600; font-size: 13px; cursor: pointer; }
.c360fb-deep input { margin: 0; }
.c360fb-reset { display: grid; place-items: center; width: 34px; height: 30px; border: 1px solid var(--fb-line-soft); border-radius: 6px; color: var(--fb-accent); background: var(--fb-soft); flex: none; }
.c360fb-reset:hover { border-color: var(--fb-accent); color: var(--fb-accent); }

/* Menu e vista */
.c360fb-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: stretch; }
.c360fb select { width: 100%; max-width: 100%; min-height: 40px; padding: 6px 34px 6px 12px; border: 2px solid var(--fb-line); border-radius: var(--fb-radius); background-color: var(--fb-surface); color: inherit; font: inherit; }
.c360fb-row2 select { border-width: 1px; min-height: 36px; border-radius: 8px; }
.c360fb-view { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--fb-line-soft); border-radius: var(--fb-radius); background: var(--fb-surface); }
.c360fb-view button { display: grid; place-items: center; width: 34px; border: 0; border-radius: 7px; background: transparent; color: var(--fb-muted); cursor: pointer; padding: 0; }
.c360fb-view button[aria-pressed="true"] { background: rgba(11, 79, 124, .12); color: var(--fb-accent); }

/* Pannello lettere + filtri secondari */
.c360fb-panel { display: grid; gap: 12px; padding: 12px; border: 1px solid var(--fb-line-soft); border-radius: var(--fb-radius); background: var(--fb-surface); }
.c360fb-letters { display: flex; flex-wrap: wrap; gap: 2px 4px; align-items: center; padding: 8px 10px; border: 1px solid var(--fb-line-soft); border-radius: 14px; }
.c360fb-letters a, .c360fb-letters span.is-empty { display: inline-flex; align-items: center; gap: 6px; min-width: 28px; justify-content: center; padding: 4px 7px; border-radius: 8px; font-weight: 700; font-size: 13px; text-decoration: none; color: inherit; }
.c360fb-letters a:hover { background: var(--fb-soft); color: var(--fb-accent); }
.c360fb-letters a.is-active { background: var(--fb-accent); color: var(--fb-accent-ink); }
.c360fb-letters span.is-empty { color: var(--fb-line); font-weight: 600; cursor: default; }
.c360fb-n { display: inline-block; padding: 0 7px; border-radius: 9px; background: rgba(255, 255, 255, .22); font-size: 11px; font-variant-numeric: tabular-nums; }
.c360fb-letters a:not(.is-active) .c360fb-n { background: var(--fb-soft); }
.c360fb-row2 { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.c360fb-bulk { display: flex; gap: 6px; align-items: center; }
.c360fb-bulk .bulkactions { padding: 0; float: none; }
.c360fb-selects { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-left: auto; }
.c360fb-selects select { width: auto; min-width: 150px; }

/* Paginazione */
.c360fb-pager { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; margin: 12px 0; }
.c360fb-total { color: var(--fb-muted); font-variant-numeric: tabular-nums; }
.c360fb-pages { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.c360fb-pg { display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px; border: 1px solid var(--fb-line-soft); border-radius: 8px; text-decoration: none; color: inherit; background: var(--fb-surface); font-weight: 600; }
.c360fb-pg:hover { border-color: var(--fb-accent); color: var(--fb-accent); }
.c360fb-pg.is-disabled { opacity: .4; }
.c360fb-pages input[type=number] { width: 72px; height: 34px; padding: 0 8px; border: 1px solid var(--fb-line-soft); border-radius: 8px; text-align: center; background: var(--fb-surface); color: inherit; font: inherit; }
.c360fb-of { color: var(--fb-muted); white-space: nowrap; }

/* Griglia */
.c360fb-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.c360fb-card { display: grid; gap: 8px; align-content: start; padding: 14px; border: 1px solid var(--fb-line-soft); border-radius: var(--fb-radius); background: var(--fb-surface, transparent); min-width: 0; }
.c360 .c360fb-card { background: #fff; }
.c360fb-card:hover { border-color: var(--fb-line); }
.c360fb-card-top { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
.c360fb-avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: rgba(47, 111, 94, .14); color: #2f6f5e; }
.c360fb-avatar--azienda { border-radius: 10px; background: rgba(58, 79, 154, .14); color: #3a4f9a; }
.c360fb-card-name { display: grid; min-width: 0; }
.c360fb-card-name a { font-weight: 700; font-size: 15px; text-decoration: none; overflow-wrap: anywhere; }
.c360fb-card-name a:hover { text-decoration: underline; }
.c360fb-meta { font-size: 12px; color: var(--fb-muted); }
.c360fb-id { margin: 0; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; }
.c360fb-lines { margin: 0; display: grid; gap: 2px; font-size: 13px; }
.c360fb-lines span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c360fb-foot { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-top: 8px; border-top: 1px solid var(--fb-line-soft); }
.c360fb-chip { display: inline-block; padding: 1px 8px; border-radius: 10px; background: var(--fb-soft); font-size: 12px; }
.c360fb-chip--warn { background: var(--fb-warn-bg); color: var(--fb-warn); }
.c360fb-date { margin-left: auto; font-size: 12px; color: var(--fb-muted); font-variant-numeric: tabular-nums; }
.c360fb-empty { padding: 24px; text-align: center; border: 1px dashed var(--fb-line); border-radius: var(--fb-radius); color: var(--fb-muted); }

@media (max-width: 700px) {
	.c360fb-row { grid-template-columns: 1fr 1fr; }
	.c360fb-view { grid-column: 1 / -1; justify-self: end; }
	.c360fb-search { flex-wrap: wrap; }
	.c360fb .c360fb-search input[type=search] { flex-basis: calc(100% - 40px); }
	.c360fb-sep { display: none; }
	.c360fb-selects { margin-left: 0; }
	.c360fb-selects select { flex: 1 1 140px; }
}

/* ---------------- Layout con pannello Tipologie ---------------- */
.c360fb-layout { display: grid; grid-template-columns: minmax(230px, 270px) minmax(0, 1fr); gap: 20px; align-items: start; }
.c360fb-main { min-width: 0; }
.c360tp { --fb-accent: #0b4f7c; --fb-line-soft: rgba(84, 104, 130, .22); --fb-soft: rgba(84, 104, 130, .08); --fb-muted: rgba(84, 104, 130, .95); position: sticky; top: 46px; display: grid; gap: 10px; font-size: 14px; min-width: 0; }
.c360tp-head { display: grid; gap: 0; }
.c360tp-title { margin: 0; font-size: 22px; font-weight: 800; line-height: 1.2; }
.c360tp-total { margin: 2px 0 0; color: var(--fb-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.c360tp-box { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--fb-line-soft); border-radius: 12px; background: var(--fb-surface, transparent); max-height: calc(100vh - 140px); overflow-y: auto; overscroll-behavior: contain; }
.c360 .c360tp-box { background: #fff; }
.c360tp-label { margin: 0; font-weight: 700; }
.c360tp .c360tp-q { width: 100%; padding: 8px 10px; border: 1px solid var(--fb-line-soft); border-radius: 8px; font: inherit; background: transparent; color: inherit; }
.c360tp-letters { display: flex; flex-wrap: wrap; gap: 2px; }
.c360tp-letters button { min-width: 24px; height: 24px; padding: 0 4px; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.c360tp-letters button:hover { background: var(--fb-soft); }
.c360tp-letters button[aria-pressed="true"] { background: var(--fb-accent); color: #fff; }
.c360tp-list { display: grid; gap: 6px; }
.c360tp-all { display: block; padding: 10px 12px; border-radius: 8px; font-weight: 700; text-decoration: none; color: inherit; }
.c360tp-all:hover { background: var(--fb-soft); }
.c360tp-all.is-active { background: rgba(11, 79, 124, .12); color: var(--fb-accent); }
.c360tp-group[hidden], .c360tp-list li[hidden] { display: none; }
.c360tp-gname { margin: 8px 0 2px; padding: 0 12px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--fb-muted); }
.c360tp-group ul { list-style: none; margin: 0; padding: 0; display: grid; }
.c360tp-group a { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; padding: 7px 12px; border-radius: 8px; text-decoration: none; color: inherit; }
.c360tp-group a:hover { background: var(--fb-soft); }
.c360tp-group a.is-active { background: rgba(11, 79, 124, .12); color: var(--fb-accent); font-weight: 600; }
.c360tp-icon { font-size: 16px; line-height: 1; text-align: center; }
.c360tp-name { min-width: 0; overflow-wrap: anywhere; }
.c360tp-n { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--fb-accent); }
.c360tp-group a.is-zero .c360tp-n { color: var(--fb-muted); }
.c360tp-none { margin: 0; padding: 8px 12px; color: var(--fb-muted); }
.c360tp-manage { justify-self: start; font-size: 13px; padding: 0 12px; }
.c360tp :focus-visible { outline: 2px solid var(--fb-accent); outline-offset: 1px; }

@media (max-width: 960px) {
	.c360fb-layout { grid-template-columns: 1fr; }
	.c360tp { position: static; }
	.c360tp-box { max-height: 340px; }
}
.c360f-elenco { container-type: inline-size; }
@container (max-width: 860px) {
	.c360fb-layout { grid-template-columns: 1fr; }
	.c360tp { position: static; }
	.c360tp-box { max-height: 320px; }
}
