/* Fatture PEC SdI – stile ispirato ad Adempimenti360.it */
.fps-wrap, .fps-print {
	--fps-navy: #0b2239;
	--fps-navy-2: #12304d;
	--fps-ink: #10243a;
	--fps-text: #2c3e50;
	--fps-muted: #6b7c8f;
	--fps-line: #e3e9f0;
	--fps-bg: #f3f6fa;
	--fps-card: #ffffff;
	--fps-teal: #1fa9ba;
	--fps-teal-2: #22b8c9;
	--fps-teal-soft: #e3f6f8;
	--fps-orange: #f29f3a;
	--fps-ok: #1e9e6a;
	--fps-ok-soft: #e4f6ee;
	--fps-wait: #c27c12;
	--fps-wait-soft: #fdf3e2;
	--fps-ko: #d2433f;
	--fps-ko-soft: #fdeceb;
	--fps-radius: 14px;
	--fps-shadow: 0 1px 2px rgba(11, 34, 57, .06), 0 6px 20px rgba(11, 34, 57, .06);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--fps-text);
}

.fps-wrap { margin: 20px 20px 0 2px; max-width: 1320px; }
.fps-wrap *, .fps-print * { box-sizing: border-box; }

/* ---------- Hero ---------- */
.fps-hero {
	display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
	padding: 22px 26px; border-radius: var(--fps-radius); margin-bottom: 20px;
	background:
		radial-gradient(1200px 200px at 0% 0%, rgba(34, 184, 201, .18), transparent 60%),
		linear-gradient(135deg, var(--fps-navy) 0%, var(--fps-navy-2) 100%);
	color: #fff; box-shadow: var(--fps-shadow); position: relative; overflow: hidden;
}
.fps-hero::after {
	content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
	background: linear-gradient(90deg, var(--fps-teal-2), var(--fps-orange));
}
.fps-hero__brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.fps-hero h1 { color: #fff; font-size: 22px; font-weight: 700; margin: 0; line-height: 1.25; padding: 0; }
.fps-hero p { margin: 4px 0 0; color: #b9c9da; font-size: 13px; }
.fps-hero .fps-badge { vertical-align: middle; }
.fps-hero__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.fps-hero .fps-btn--ghost { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .18); }
.fps-hero .fps-btn--ghost:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.fps-logo { width: 44px; height: 44px; flex: none; }

/* ---------- Buttons ---------- */
.fps-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	padding: 9px 16px; border-radius: 10px; font-size: 13px; font-weight: 600; line-height: 1.2;
	border: 1px solid var(--fps-line); background: #fff; color: var(--fps-ink);
	text-decoration: none; cursor: pointer; transition: transform .08s, box-shadow .15s, background .15s;
	white-space: nowrap;
}
.fps-btn:hover { color: var(--fps-ink); background: #f7fafc; }
.fps-btn:active { transform: translateY(1px); }
.fps-btn:focus-visible { outline: 2px solid var(--fps-teal-2); outline-offset: 2px; box-shadow: none; }
.fps-btn--primary {
	border: 0; color: #fff;
	background: linear-gradient(135deg, var(--fps-teal) 0%, #1793a8 100%);
	box-shadow: 0 4px 14px rgba(31, 169, 186, .35);
}
.fps-btn--primary:hover { color: #fff; background: linear-gradient(135deg, #22b8c9 0%, #1a9fb4 100%); box-shadow: 0 6px 18px rgba(31, 169, 186, .45); }
.fps-btn--block { width: 100%; padding: 12px 16px; }
.fps-icon-btn {
	width: 30px; height: 30px; border-radius: 8px; border: 1px solid transparent; background: transparent;
	color: var(--fps-muted); font-size: 20px; line-height: 1; cursor: pointer;
}
.fps-icon-btn:hover { background: var(--fps-ko-soft); color: var(--fps-ko); }

/* ---------- Alerts ---------- */
.fps-alert {
	padding: 13px 16px; border-radius: 12px; margin: 0 0 16px; font-size: 13.5px; line-height: 1.5;
	border: 1px solid; background: #fff;
}
.fps-alert ul { margin: 6px 0 0 18px; list-style: disc; }
.fps-alert--success { border-color: #bfe6d4; background: var(--fps-ok-soft); color: #145c40; }
.fps-alert--error { border-color: #f3c3c1; background: var(--fps-ko-soft); color: #8d2421; }
.fps-alert--warning { border-color: #f1d9ad; background: var(--fps-wait-soft); color: #7a4d06; }

/* ---------- KPI ---------- */
.fps-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.fps-kpi {
	background: var(--fps-card); border-radius: var(--fps-radius); padding: 16px 18px; box-shadow: var(--fps-shadow);
	border-top: 3px solid var(--fps-teal-2); display: flex; flex-direction: column; gap: 4px;
}
.fps-kpi span { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--fps-muted); font-weight: 600; }
.fps-kpi strong { font-size: 24px; color: var(--fps-ink); font-variant-numeric: tabular-nums; }
.fps-kpi small { color: var(--fps-muted); font-size: 12px; }
.fps-kpi--ok { border-top-color: var(--fps-ok); }
.fps-kpi--wait { border-top-color: var(--fps-orange); }
.fps-kpi--ko { border-top-color: var(--fps-ko); }

/* ---------- Cards ---------- */
.fps-card {
	background: var(--fps-card); border-radius: var(--fps-radius); box-shadow: var(--fps-shadow);
	padding: 20px 22px; margin-bottom: 18px;
}
.fps-card--quiet { box-shadow: none; background: transparent; padding: 4px 6px; font-size: 13px; }
.fps-card__title {
	display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
	font-size: 15px; font-weight: 700; color: var(--fps-ink); margin: 0 0 16px; padding: 0;
}
.fps-card__title > span {
	width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center;
	font-size: 12px; color: #fff; background: linear-gradient(135deg, var(--fps-teal-2), var(--fps-orange));
}
.fps-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.fps-grid > .fps-card, .fps-grid > div > .fps-card:last-child { margin-bottom: 0; }
.fps-grid { margin-bottom: 18px; }
.fps-grid--view { grid-template-columns: minmax(0, 1fr) 340px; }

/* ---------- Forms ---------- */
.fps-fields { display: grid; gap: 12px 14px; margin-bottom: 12px; }
.fps-fields--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fps-fields--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fps-fields--addr { grid-template-columns: 3fr 1fr 1.2fr 2.4fr .9fr .9fr; }
.fps-span-2 { grid-column: span 2; }
.fps-wrap label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--fps-ink); }
.fps-wrap label small { font-weight: 400; color: var(--fps-muted); font-size: 11.5px; }
.fps-full { margin-bottom: 12px; }
.fps-wrap input[type=text], .fps-wrap input[type=email], .fps-wrap input[type=date], .fps-wrap input[type=number],
.fps-wrap input[type=password], .fps-wrap input[type=search], .fps-wrap select, .fps-wrap textarea {
	width: 100%; max-width: none; min-height: 38px; padding: 7px 11px; font-size: 14px; font-weight: 400;
	border: 1px solid #d5dee8; border-radius: 9px; background-color: #fbfdff; color: var(--fps-ink);
	box-shadow: none; transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.fps-wrap select { height: 38px; line-height: 1.2; padding: 0 30px 0 11px; background-repeat: no-repeat; background-position: right 8px top 55%; background-size: 16px 16px; }
.fps-wrap select:disabled { opacity: .45; cursor: not-allowed; }
.fps-wrap textarea { resize: vertical; line-height: 1.45; }
.fps-wrap input:focus, .fps-wrap select:focus, .fps-wrap textarea:focus {
	border-color: var(--fps-teal-2); background-color: #fff; outline: none; box-shadow: 0 0 0 3px rgba(34, 184, 201, .18);
}
.fps-upper { text-transform: uppercase; }
.fps-check { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 500 !important; margin: 4px 0 12px; }
.fps-check input, .fps-opt summary input { margin: 0; }

.fps-seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--fps-bg); margin-bottom: 14px; flex-wrap: wrap; }
.fps-seg label { flex-direction: row; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--fps-muted); }
.fps-seg input { position: absolute; opacity: 0; pointer-events: none; }
.fps-seg label:has(input:checked) { background: #fff; color: var(--fps-ink); box-shadow: 0 1px 3px rgba(11, 34, 57, .12); }
.fps-seg label:has(input:focus-visible) { outline: 2px solid var(--fps-teal-2); }

[data-cliente=privato] .fps-only-azienda, [data-cliente=azienda] .fps-only-privato,
[data-sogg=azienda] .fps-only-persona, [data-sogg=persona] .fps-only-societa { display: none !important; }

.fps-client-pick { margin-left: auto; width: auto !important; min-height: 32px !important; font-size: 13px !important; padding: 4px 10px !important; }

.fps-opt { border: 1px solid var(--fps-line); border-radius: 11px; padding: 0 14px; margin: 0 0 10px; }
.fps-opt[open] { padding-bottom: 6px; background: #fbfdff; }
.fps-opt summary { list-style: none; cursor: pointer; padding: 11px 0; }
.fps-opt summary::-webkit-details-marker { display: none; }
.fps-opt summary label { flex-direction: row; align-items: center; gap: 8px; }
.fps-hint { color: var(--fps-muted); font-size: 12.5px; margin: 4px 0 10px; line-height: 1.5; }
.fps-hint code, .fps-meta code { font-size: 11.5px; background: var(--fps-bg); padding: 1px 5px; border-radius: 5px; }

/* ---------- Lines editor ---------- */
.fps-table-wrap { overflow-x: auto; margin: 0 -4px 12px; padding: 0 4px; }
.fps-lines { width: 100%; border-collapse: separate; border-spacing: 0 6px; min-width: 820px; }
.fps-lines th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--fps-muted); padding: 0 6px; font-weight: 600; }
.fps-lines td { padding: 0 4px; vertical-align: top; }
.fps-lines textarea { min-height: 38px; }
.fps-lines .w-desc { width: 40%; }
.fps-lines .w-qty { width: 70px; text-align: right; }
.fps-lines .w-um { width: 70px; }
.fps-lines .w-price { width: 110px; text-align: right; }
.fps-lines .w-iva { width: 82px; }
.fps-lines .w-nat { width: 86px; }
.fps-lines [data-line-total] { padding-top: 10px; white-space: nowrap; min-width: 100px; }
.fps-lines tr.is-new td { animation: fps-in .25s ease; }
@keyframes fps-in { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- Summary ---------- */
.fps-summary { position: sticky; top: 46px; border: 1px solid var(--fps-line); }
.fps-summary dl { margin: 0 0 14px; }
.fps-summary dl > div { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--fps-line); font-size: 14px; }
.fps-summary dt { color: var(--fps-muted); }
.fps-summary dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--fps-ink); }
.fps-summary__total { border-bottom: 0 !important; padding-top: 14px !important; }
.fps-summary__total dt { color: var(--fps-ink); font-weight: 700; }
.fps-summary__total dd { font-size: 22px; }
.fps-summary__net { background: var(--fps-teal-soft); border-radius: 10px; padding: 10px 12px !important; border: 0 !important; margin-top: 6px; }
.fps-summary__net dd { color: #0f6f7c; }
.fps-summary__actions { display: grid; gap: 8px; }
[data-show][hidden] { display: none !important; }

/* ---------- Table list ---------- */
.fps-toolbar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.fps-toolbar label { flex-direction: row !important; align-items: center; gap: 8px !important; }
.fps-toolbar select { width: auto !important; min-width: 110px; }
.fps-toolbar input[type=search] { width: 260px !important; }
.fps-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.fps-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--fps-muted); padding: 10px 12px; border-bottom: 1px solid var(--fps-line); font-weight: 600; }
.fps-table td { padding: 12px; border-bottom: 1px solid var(--fps-line); vertical-align: middle; }
.fps-table tbody tr { transition: background .12s; }
.fps-table tbody tr:hover { background: #f8fbfd; }
.fps-table td small { display: block; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fps-strong { font-weight: 700; color: var(--fps-ink); text-decoration: none; }
a.fps-strong:hover { color: var(--fps-teal); }
.fps-muted { color: var(--fps-muted); }
.fps-row-actions { text-align: right; white-space: nowrap; }
.fps-row-actions a { margin-left: 12px; color: var(--fps-teal); text-decoration: none; font-weight: 600; }
.fps-row-actions a:hover { text-decoration: underline; }

.fps-badge {
	display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px;
	font-size: 12px; font-weight: 600; white-space: nowrap; background: #eef2f6; color: #4a5b6d;
}
.fps-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.fps-badge--ok { background: var(--fps-ok-soft); color: var(--fps-ok); }
.fps-badge--pending { background: var(--fps-wait-soft); color: var(--fps-wait); }
.fps-badge--ko { background: var(--fps-ko-soft); color: var(--fps-ko); }

.fps-empty { text-align: center; padding: 48px 20px; }
.fps-empty .fps-logo { width: 64px; height: 64px; opacity: .9; }
.fps-empty h2 { color: var(--fps-ink); margin: 14px 0 6px; font-size: 18px; }
.fps-empty p { color: var(--fps-muted); margin: 0 0 18px; }

/* ---------- View ---------- */
.fps-meta { margin: 0; }
.fps-meta > div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--fps-line); font-size: 13px; }
.fps-meta > div:last-child { border-bottom: 0; }
.fps-meta dt { color: var(--fps-muted); }
.fps-meta dd { margin: 0; text-align: right; word-break: break-all; }
.fps-upload { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.fps-upload input[type=file] { font-size: 12.5px; flex: 1; min-width: 0; }
.fps-upload select { width: auto !important; flex: 1; }
.fps-timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--fps-teal-soft); }
.fps-timeline li { position: relative; padding: 0 0 12px 8px; font-size: 13px; line-height: 1.45; }
.fps-timeline li::before { content: ""; position: absolute; left: -21px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--fps-teal-2); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--fps-teal-2); }
.fps-timeline time { display: block; font-size: 11.5px; color: var(--fps-muted); }
.fps-danger { color: var(--fps-ko) !important; }
.fps-card--quiet a { color: var(--fps-teal); font-weight: 600; text-decoration: none; }

.fps-status-line { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; margin: 6px 0 14px; }
.fps-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex: none; }
.fps-dot.is-ok { background: var(--fps-ok); box-shadow: 0 0 0 3px var(--fps-ok-soft); }
.fps-dot.is-warn { background: var(--fps-orange); box-shadow: 0 0 0 3px var(--fps-wait-soft); }

.fps-sticky-save {
	position: sticky; bottom: 18px; z-index: 5; display: flex; justify-content: flex-end;
	margin-top: 4px; pointer-events: none;
}
.fps-sticky-save .fps-btn { pointer-events: auto; padding: 12px 22px; }
.fps-foot { color: var(--fps-muted); font-size: 12px; text-align: center; margin: 18px 0 30px; }

/* ---------- Documento (scheda + copia di cortesia) ---------- */
.fps-paper { padding: 34px 38px; }
.fps-doc { color: #1d2b3a; font-size: 13.5px; line-height: 1.5; }
.fps-doc__head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 20px; border-bottom: 2px solid transparent; border-image: linear-gradient(90deg, var(--fps-teal-2), var(--fps-orange)) 1; }
.fps-doc__from strong { font-size: 16px; color: var(--fps-navy); }
.fps-doc__from { color: #4a5b6d; font-size: 12.5px; }
.fps-doc__title { text-align: right; display: flex; flex-direction: column; }
.fps-doc__title span { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--fps-teal); font-weight: 700; }
.fps-doc__title strong { font-size: 26px; color: var(--fps-navy); line-height: 1.15; }
.fps-doc__title em { font-style: normal; color: var(--fps-muted); }
.fps-doc__to { margin: 20px 0 18px auto; width: 50%; min-width: 240px; padding: 14px 16px; border-radius: 10px; background: var(--fps-bg); font-size: 13px; }
.fps-doc__to small { display: block; color: var(--fps-muted); text-transform: uppercase; letter-spacing: .08em; font-size: 10.5px; }
.fps-doc__to strong { font-size: 15px; color: var(--fps-navy); }
.fps-doc__causale { margin: 0 0 14px; font-style: italic; color: #4a5b6d; }
.fps-doc__lines { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.fps-doc__lines th { background: var(--fps-navy); color: #fff; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 9px 10px; text-align: left; font-weight: 600; }
.fps-doc__lines th:first-child { border-radius: 8px 0 0 8px; }
.fps-doc__lines th:last-child { border-radius: 0 8px 8px 0; }
.fps-doc__lines td { padding: 10px; border-bottom: 1px solid var(--fps-line); vertical-align: top; }
.fps-doc__bottom { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.fps-doc__notes { flex: 1; font-size: 12px; color: #4a5b6d; }
.fps-doc__notes p { margin: 0 0 8px; }
.fps-doc__totals { min-width: 280px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.fps-doc__totals th { text-align: left; font-weight: 400; color: var(--fps-muted); padding: 6px 12px 6px 0; }
.fps-doc__totals td { text-align: right; padding: 6px 0; white-space: nowrap; }
.fps-doc__totals .is-total th, .fps-doc__totals .is-total td { font-size: 17px; font-weight: 700; color: var(--fps-navy); border-top: 2px solid var(--fps-navy); padding-top: 10px; }
.fps-doc__totals .is-net th, .fps-doc__totals .is-net td { font-weight: 700; color: #0f6f7c; }
.fps-doc__legal { font-size: 11px; color: var(--fps-muted); margin-top: 28px; border-top: 1px solid var(--fps-line); padding-top: 10px; }

/* ---------- Pagina stampa ---------- */
body.fps-print { margin: 0; background: #e9eef4; }
.fps-print__bar { text-align: center; padding: 18px; }
.fps-print .fps-paper { max-width: 860px; margin: 0 auto 40px; background: #fff; border-radius: 6px; box-shadow: 0 6px 30px rgba(11, 34, 57, .12); }
@media print {
	body.fps-print { background: #fff; }
	.fps-print__bar { display: none; }
	.fps-print .fps-paper { box-shadow: none; margin: 0; max-width: none; padding: 0; }
	.fps-doc__lines th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	.fps-doc__to { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	@page { margin: 16mm; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
	.fps-grid, .fps-grid--view { grid-template-columns: 1fr; }
	.fps-summary { position: static; }
	.fps-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 782px) {
	.fps-wrap { margin: 10px 10px 0 0; }
	.fps-hero { padding: 18px; }
	.fps-fields--2, .fps-fields--3, .fps-fields--addr { grid-template-columns: 1fr 1fr; }
	.fps-span-2 { grid-column: span 2; }
	.fps-paper { padding: 22px 18px; }
	.fps-doc__head, .fps-doc__bottom { flex-direction: column; }
	.fps-doc__title { text-align: left; }
	.fps-doc__to { width: 100%; margin-left: 0; }
	.fps-doc__totals { width: 100%; }
	.fps-toolbar input[type=search] { width: 100% !important; }
}
@media (max-width: 480px) {
	.fps-kpis { grid-template-columns: 1fr; }
	.fps-fields--2, .fps-fields--3, .fps-fields--addr { grid-template-columns: 1fr; }
	.fps-span-2 { grid-column: auto; }
}

/* =====================================================================
 *  Frontend del sito
 * ===================================================================== */
body.fps-app {
	margin: 0; min-height: 100vh; background: #eef2f7; color: #2c3e50;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
}
.fps-app__main { max-width: 1320px; margin: 0 auto; padding: 22px 24px 10px; }

.fps-topbar {
	position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 22px;
	padding: 0 24px; height: 60px; background: #0b2239; color: #fff;
	box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 6px 20px rgba(11, 34, 57, .18);
}
.fps-topbar::after {
	content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
	background: linear-gradient(90deg, #22b8c9, #f29f3a);
}
.fps-topbar a { color: inherit; text-decoration: none; }
.fps-topbar__brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: .01em; white-space: nowrap; }
.fps-topbar__brand svg { width: 30px; height: 30px; }
.fps-topbar__brand b { color: #5fd3e0; }
.fps-topbar__nav { display: flex; gap: 4px; height: 100%; }
.fps-topbar__nav a {
	display: flex; align-items: center; padding: 0 14px; font-size: 14px; font-weight: 600; color: #b9c9da;
	border-bottom: 3px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s;
}
.fps-topbar__nav a:hover { color: #fff; }
.fps-topbar__nav a.is-active { color: #fff; border-bottom-color: #22b8c9; }
.fps-topbar__user { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 13px; }
.fps-topbar__user a { color: #b9c9da; }
.fps-topbar__user a:hover { color: #fff; }
.fps-topbar__avatar {
	width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px;
	background: linear-gradient(135deg, #22b8c9, #f29f3a); color: #0b2239;
}

/* App dentro il sito: niente margini da pannello WP */
.fps-front.fps-wrap { margin: 0 auto; max-width: 1320px; font-size: 14px; line-height: 1.45; text-align: left; container-type: inline-size; }
.fps-front h1, .fps-front h2, .fps-front p, .fps-front ul, .fps-front ol, .fps-front dl, .fps-front table { letter-spacing: normal; text-transform: none; }
.fps-front table { margin: 0; border: 0; }
.fps-front th, .fps-front td { border-left: 0; border-right: 0; border-top: 0; background: none; }
.fps-front .fps-doc__lines th { background: var(--fps-navy); }
.fps-front a { box-shadow: none; }
.fps-front button { font-family: inherit; text-transform: none; letter-spacing: normal; }
.fps-front input[type=checkbox], .fps-front input[type=radio] { width: 16px; height: 16px; min-height: 0; accent-color: var(--fps-teal); }
.fps-front select {
	-webkit-appearance: none; appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%2310243a' d='M5.3 7.3a1 1 0 0 1 1.4 0L10 10.6l3.3-3.3a1 1 0 1 1 1.4 1.4l-4 4a1 1 0 0 1-1.4 0l-4-4a1 1 0 0 1 0-1.4z'/%3E%3C/svg%3E");
}
.fps-front input[type=file] { border: 0; padding: 0; background: none; min-height: 0; }
.fps-front .fps-summary { top: 76px; }

.fps-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.fps-tabs a {
	padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; text-decoration: none;
	color: var(--fps-muted); background: #fff; border: 1px solid var(--fps-line);
}
.fps-tabs a.is-active { color: #fff; background: var(--fps-navy); border-color: var(--fps-navy); }

.fps-gate {
	max-width: 420px; margin: 12vh auto; text-align: center; background: #fff; border-radius: 18px;
	padding: 40px 32px; box-shadow: var(--fps-shadow);
}
.fps-gate .fps-logo { width: 64px; height: 64px; }
.fps-gate h1 { font-size: 22px; color: var(--fps-ink); margin: 14px 0 6px; }
.fps-gate p { color: var(--fps-muted); margin: 0 0 20px; }

/* Adattamento alla larghezza reale del contenitore (temi con colonna stretta) */
@container (max-width: 1000px) {
	.fps-grid, .fps-grid--view { grid-template-columns: 1fr; }
	.fps-summary { position: static; }
	.fps-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 640px) {
	.fps-fields--2, .fps-fields--3, .fps-fields--addr { grid-template-columns: 1fr 1fr; }
	.fps-doc__head, .fps-doc__bottom { flex-direction: column; }
	.fps-doc__title { text-align: left; }
	.fps-doc__to { width: 100%; margin-left: 0; }
	.fps-doc__totals { width: 100%; }
	.fps-hero { padding: 18px; }
}
@container (max-width: 440px) {
	.fps-fields--2, .fps-fields--3, .fps-fields--addr { grid-template-columns: 1fr; }
	.fps-span-2 { grid-column: auto; }
}

/* Tabella fatture come elenco di schede sul telefono */
@media (max-width: 640px) {
	.fps-app__main { padding: 14px 12px 6px; }
	.fps-topbar { gap: 0 10px; padding: 0 12px; height: auto; flex-wrap: wrap; }
	.fps-topbar__brand { height: 50px; }
	.fps-topbar__user { gap: 12px; height: 50px; }
	.fps-topbar__user a[title] { display: none; }
	.fps-topbar__nav { order: 3; width: 100%; height: 42px; justify-content: space-around; border-top: 1px solid rgba(255, 255, 255, .08); }
	.fps-topbar__nav a { padding: 0 10px; font-size: 13.5px; }
	.fps-front .fps-hero { padding: 14px 16px; gap: 12px; }
	.fps-front .fps-hero .fps-logo { width: 34px; height: 34px; }
	.fps-front .fps-hero h1 { font-size: 18px; }
	.fps-front .fps-hero p { font-size: 12px; }
	.fps-hero__actions { width: 100%; }
	.fps-hero__actions .fps-btn { flex: 1 1 auto; }
	.fps-front .fps-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.fps-front .fps-kpi { padding: 12px 14px; }
	.fps-front .fps-kpi strong { font-size: 19px; }
	.fps-front .fps-kpi small { display: none; }
	.fps-front .fps-card { padding: 16px 14px; }
	.fps-front .fps-toolbar label { flex: 1 1 40%; }
	.fps-front .fps-toolbar select { flex: 1; width: 100% !important; }
	.fps-front .fps-table thead { display: none; }
	.fps-front .fps-table, .fps-front .fps-table tbody, .fps-front .fps-table tr, .fps-front .fps-table td { display: block; width: 100%; }
	.fps-front .fps-table tr { position: relative; padding: 12px 0; border-bottom: 1px solid var(--fps-line); }
	.fps-front .fps-table td { border: 0; padding: 2px 0; text-align: left !important; }
	.fps-front .fps-table td.num:not(.fps-strong) { display: none; }
	.fps-front .fps-table td.fps-strong { position: absolute; right: 0; top: 12px; width: auto; font-size: 15px; }
	.fps-front .fps-row-actions a { margin: 0 14px 0 0; }
	.fps-front .fps-table-wrap { overflow: visible; }
}

/* =====================================================================
 *  Anagrafiche condivise, recupero dati, sedi
 * ===================================================================== */
.fps-inline { display: flex; gap: 6px; align-items: stretch; }
.fps-inline input { flex: 1; min-width: 0; }
.fps-inline .fps-btn { padding: 0 12px; font-size: 12.5px; }
.fps-inline .fps-btn:disabled { opacity: .6; cursor: progress; }
.fps-lookup-msg {
	margin: -2px 0 12px; padding: 9px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.5;
	background: var(--fps-teal-soft); color: #0f5f6b;
}
.fps-lookup-msg.is-ok { background: var(--fps-ok-soft); color: #145c40; }
.fps-lookup-msg.is-warn { background: var(--fps-wait-soft); color: #7a4d06; }
.fps-lookup-msg.is-error { background: var(--fps-ko-soft); color: #8d2421; }
.fps-src {
	display: inline-block; margin-right: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700;
	background: rgba(255, 255, 255, .75); color: inherit; border: 1px solid currentColor;
}
.fps-linked { margin: -6px 0 12px; font-size: 12.5px; color: var(--fps-ok); display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.fps-linked::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--fps-ok); margin-right: 4px; }
.fps-linked a { color: var(--fps-teal); }
.fps-linkbtn { border: 0; background: none; padding: 0; color: var(--fps-teal); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
.fps-subtitle { font-size: 14px; color: var(--fps-ink); margin: 22px 0 4px; padding-top: 16px; border-top: 1px solid var(--fps-line); }
.fps-summary-label { font-weight: 600; font-size: 13px; color: var(--fps-ink); }
.fps-summary-label small { font-weight: 400; color: var(--fps-muted); margin-left: 6px; }
.fps-sede-box summary::after { content: "▾"; float: right; color: var(--fps-muted); }
.fps-sede-box[open] summary::after { content: "▴"; }
.fps-fields--sede { grid-template-columns: 1.3fr 2.2fr .7fr .8fr 1.6fr .6fr 34px; align-items: end; }
.fps-fields--sede-inv { grid-template-columns: 1.3fr 2.2fr .7fr .8fr 1.6fr .6fr; }
.fps-sede + .fps-sede { border-top: 1px dashed var(--fps-line); padding-top: 10px; }
.fps-sede .fps-icon-btn { margin-bottom: 4px; }
.fps-doc__sede { display: block; margin-top: 8px; padding-top: 8px; border-top: 1px dashed #d5dee8; }
.fps-doc__sede small { display: block; }

/* Sezione nel profilo utente di WordPress */
.fps-profile.fps-wrap { margin: 24px 0; max-width: 980px; }
.fps-profile .fps-card { border: 1px solid var(--fps-line); }
.fps-profile .fps-card__title > span { font-size: 13px; }
.fps-flag { padding: 12px 14px; border-radius: 12px; background: var(--fps-teal-soft); margin-bottom: 14px !important; }
.fps-flag strong { color: #0f5f6b; }
.fps-profile .fps-fields--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@container (max-width: 760px) {
	.fps-fields--sede, .fps-fields--sede-inv { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
	.fps-fields--sede, .fps-fields--sede-inv { grid-template-columns: 1fr 1fr; }
}

/* App dentro la finestra widget */
.fps-embed .fps-topbar { height: 48px; padding: 0 14px; }
.fps-embed .fps-topbar__user, .fps-embed .fps-topbar__brand span { display: none; }
.fps-embed .fps-topbar__brand svg { width: 26px; height: 26px; }
.fps-embed .fps-app__main { padding: 16px 16px 6px; }
.fps-embed .fps-hero { padding: 16px 20px; margin-bottom: 14px; }
.fps-embed .fps-hero .fps-logo { width: 36px; height: 36px; }
.fps-embed .fps-hero h1 { font-size: 19px; }
.fps-embed .fps-front .fps-summary { top: 60px; }
@media (max-width: 640px) {
	.fps-embed .fps-topbar__nav { order: 0; width: auto; border-top: 0; height: 48px; }
}

.fps-wrap [hidden] { display: none !important; }
.fps-wrap input, .fps-wrap select, .fps-wrap textarea, .fps-wrap button { font-family: inherit; }
