/*
 * Interfaccia report/modelli documento (NetHub360.Reporting.UI).
 * Classi con prefisso rep-: nessuna collisione con il CSS dei prodotti. Colori, raggi e controlli seguono i token del sito
 * (--primary*, --border*, --radius, --ctl); i quattro colori dei tipi di modello derivano dai token di stato.
 */
.rep-root {
  --t-repx: #dc2626; --t-word: #2563eb; --t-excel: #047857; --t-html: #b45309;
  --rep-ease: cubic-bezier(.16, 1, .3, 1);
  --rep-slate: #475569; --rep-ctl: 36px; --rep-success-ink: #047857; --rep-warning-ink: #b45309; --rep-danger-ink: #991b1b;
  font-family: var(--font, inherit);
  color: var(--text, #0f172a);
}
.rep-root .rep-mono, .rep-mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: 13px; }
.rep-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.rep-root button { font: inherit; }
.rep-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: var(--radius, 8px); border: 1px solid var(--border-strong); background: #fff; color: var(--rep-slate); font-weight: 750; font-size: 14px; white-space: nowrap; cursor: pointer; text-decoration: none; }
.rep-btn svg { flex: none; }
.rep-btn:hover:not(:disabled):not([aria-disabled="true"]) { border-color: var(--muted); background: var(--surface-soft); color: var(--text); }
.rep-btn-primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.rep-btn.rep-btn-primary:hover:not(:disabled):not([aria-disabled="true"]) { border-color: var(--primary-strong); background: var(--primary-strong); color: #fff; }
.rep-btn-link { border-color: transparent; background: none; color: var(--primary-strong); padding: 0 8px; }
.rep-btn-link:hover:not(:disabled):not([aria-disabled="true"]) { background: var(--primary-soft); border-color: transparent; color: var(--primary-ink); }
.rep-btn:disabled, .rep-btn[aria-disabled="true"] { border-color: var(--border-strong); background: var(--bg-soft); color: var(--rep-slate); cursor: not-allowed; }
.rep-btn.rep-sm { height: 28px; padding: 0 10px; font-size: 13px; }
.rep-root :focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.rep-stack { display: grid; gap: 12px; }
.rep-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rep-bar .rep-grow { flex: 1; }
.rep-page-note { margin: 0 0 12px; }
.rep-iframe { display: block; width: 100%; height: 520px; border: 0; background: #fff; border-radius: 4px; }
.rep-sheet-frame { position: relative; border: 1px solid var(--border); border-radius: 4px; box-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 16px 28px -16px rgba(15, 23, 42, .3); background: #fff; overflow: hidden; }
.rep-textinput { height: 34px; min-width: 0; width: 100%; padding: 0 10px; border: 1px solid var(--muted); border-radius: var(--radius, 8px); background: #fff; font-size: 14px; font-weight: 400; color: var(--text); }
.rep-textinput:disabled { border-color: var(--border-strong); background: var(--surface-soft); color: var(--rep-slate); }
.rep-textinput:focus { border-color: var(--primary); outline: 3px solid rgba(var(--primary-rgb), .25); outline-offset: 0; }
.rep-select { height: 34px; min-width: 0; width: 100%; padding: 0 10px; border: 1px solid var(--muted); border-radius: var(--radius, 8px); background: #fff; font-size: 14px; color: var(--text); }
.rep-select:disabled { border-color: var(--border-strong); background: var(--surface-soft); color: var(--rep-slate); }
.rep-fsel-label { font-size: 13px; font-weight: 600; color: var(--rep-slate); }
.rep-menu-wrap { position: relative; display: inline-block; }
.rep-warns-inline { margin-top: 10px; }
.rep-field-err { color: var(--rep-danger-ink); font-size: 13px; margin-top: 2px; font-weight: 600; }
.rep-pillrow { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.rep-split { align-items: start; }
.rep-detail-card { min-width: 0; }
@media (max-width: 1100px) { .rep-compose { grid-template-columns: 200px minmax(0, 1fr); } .rep-pv { grid-template-columns: 250px minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .rep-root *, .rep-root *::before, .rep-root *::after { transition: none !important; animation: none !important; } }

/* ---- da qui: classi derivate dal prototipo PropostaReportModelli.html ---- */
.rep-banner { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-radius: 12px; font-size: 14px; font-weight: 600; }
.rep-banner svg { flex: none; margin-top: 2px; }
.rep-banner .rep-b-main { flex: 1; min-width: 0; }
.rep-banner .rep-b-main b { font-weight: 800; }
.rep-banner .rep-b-main span { display: block; margin-top: 2px; font-weight: 400; }
.rep-banner .rep-btn { margin-left: auto; align-self: center; }
.rep-banner-info { background: var(--primary-soft); color: var(--primary-ink); }
.rep-banner-ok { background: var(--success-soft); color: var(--rep-success-ink); }
.rep-banner-err { background: var(--danger-soft); color: var(--rep-danger-ink); }
.rep-banner-warn { background: var(--warning-soft); color: var(--rep-warning-ink); }
.rep-field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--rep-slate); min-width: 0; }
.rep-field input[type="text"], .rep-field input[type="search"], .rep-field select { height: 34px; min-width: 0; padding: 0 10px; border: 1px solid var(--muted); border-radius: var(--radius); background: #fff; font-size: 14px; font-weight: 400; color: var(--text); }
.rep-field input:disabled, .rep-field select:disabled { border-color: var(--border-strong); background: var(--surface-soft); color: var(--rep-slate); }
.rep-pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.rep-pill.rep-ok { background: var(--success-soft); color: var(--success); }
.rep-pill.rep-wait { background: var(--warning-soft); color: var(--rep-warning-ink); }
.rep-pill.rep-no { background: var(--danger-soft); color: #b91c1c; }
.rep-pill.rep-draft { background: var(--bg-soft); color: var(--rep-slate); }
.rep-pill.rep-info { background: var(--primary-soft); color: var(--primary-ink); }
.rep-spin { flex: none; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: rep-kf-spin .7s linear infinite; }
@keyframes rep-kf-spin { to { transform: rotate(360deg); } }
input[type=checkbox].rep-rc, input[type=radio].rep-rc { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; margin: 0; flex: none; }
.rep-chk-line { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; }
.rep-chk-line.rep-dis { color: var(--muted); cursor: not-allowed; }
/* ================= SmartTable condivisa (stesse misure di PropostaTabellaCondivisa) ================= */
.rep-st { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.rep-st-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); min-height: 56px; }
.rep-st-bar .rep-grow { flex: 1; }
.rep-st-search { position: relative; width: 260px; flex: none; }
.rep-st-search svg { position: absolute; left: 10px; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.rep-st-search input { width: 100%; height: var(--rep-ctl); border: 1px solid var(--muted); border-radius: var(--radius); padding: 0 12px 0 34px; background: var(--surface); }
.rep-st-search input:focus { border-color: var(--primary); outline: 3px solid rgba(var(--primary-rgb), .25); outline-offset: 0; }
.rep-fsel { position: relative; display: inline-flex; align-items: center; height: var(--rep-ctl); border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.rep-fsel select { appearance: none; border: 0; background: none; height: 100%; padding: 0 30px 0 12px; cursor: pointer; font-weight: 550; border-radius: var(--radius); outline: none; }
.rep-fsel::after { content: ""; position: absolute; right: 11px; top: 50%; width: 6px; height: 6px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; rotate: 45deg; translate: 0 -70%; pointer-events: none; }
.rep-fsel.rep-on { background: var(--primary-soft); border-color: rgba(var(--primary-rgb), .45); }
.rep-fsel.rep-on select { color: var(--primary-ink); }
.rep-fsel:focus-within { outline: 3px solid rgba(var(--primary-rgb), .35); outline-offset: 1px; }
.rep-st .rep-btn { height: var(--rep-ctl); }
.rep-st .rep-btn .rep-n { background: var(--primary); color: #fff; border-radius: 99px; font-size: 11.5px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 5px; }
.rep-st-icon { width: var(--rep-ctl); height: var(--rep-ctl); display: grid; place-items: center; border: 0; background: none; border-radius: var(--radius); color: var(--muted); }
.rep-st-icon:hover { background: var(--primary-soft); color: var(--primary-strong); }
.rep-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.rep-scroll { overflow-x: auto; }
.rep-st-table { width: 100%; border-collapse: collapse; }
.rep-st-table thead th { background: var(--surface-soft); color: var(--muted); font-weight: 600; font-size: 12.75px; text-align: left; padding: 0 12px; height: 40px; border-bottom: 1px solid var(--border-strong); white-space: nowrap; }
.rep-st-table thead th.rep-c, .rep-st-table td.rep-c { text-align: center; }
.rep-st-table tbody td { padding: 0 12px; height: 44px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.rep-st-table tbody tr:hover td { background: var(--surface-soft); }
.rep-st-table tbody tr.rep-sel td { background: var(--primary-soft); }
.rep-st-table tr.rep-dim td { color: var(--muted); }
.rep-st-table tr.rep-dim .rep-ft { opacity: .55; }
.rep-st-table tr.rep-sec td { height: 40px; background: var(--bg-soft); border-bottom: 1px solid var(--border-strong); font-weight: 700; padding: 0 8px; }
.rep-st-table tr.rep-sec:hover td { background: var(--bg-soft); }
.rep-st-table td.rep-act, .rep-st-table th.rep-act { padding: 0 6px; width: 1%; }
.rep-rowacts { display: flex; gap: 0; }
.rep-rowact { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); border: 0; background: none; }
.rep-rowact:hover { background: var(--primary-soft); color: var(--primary-strong); }
a.rep-nm, button.rep-nm { color: var(--text); font-weight: 600; border: 0; background: none; padding: 0; cursor: pointer; text-align: left; }
a.rep-nm:hover, button.rep-nm:hover { color: var(--primary-strong); }
.rep-st-foot { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: var(--surface-soft); border-top: 1px solid var(--border); color: var(--muted); }
.rep-st-foot b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.rep-skl td { height: 44px; }
.rep-skl i { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--bg-soft), var(--surface-soft), var(--bg-soft)); background-size: 200% 100%; animation: rep-kf-sh 1.4s linear infinite; }
@keyframes rep-kf-sh { to { background-position: -200% 0; } }
.rep-chev { flex: none; width: 24px; height: 24px; display: inline-grid; place-items: center; border-radius: 6px; border: 0; background: none; padding: 0; vertical-align: middle; }
.rep-chev:hover { background: rgba(15, 23, 42, .06); }
.rep-chev::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--rep-slate); border-bottom: 2px solid var(--rep-slate); transform: rotate(45deg) translate(-1px, -1px); transition: transform .16s ease; }
.rep-chev[aria-expanded="false"]::before { transform: rotate(-45deg); }
.rep-badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; border: 1px solid var(--border-strong); background: var(--surface); color: var(--rep-slate); }
.rep-badge.rep-success { background: var(--success-soft); color: var(--rep-success-ink); border-color: var(--rep-success-ink); }
.rep-badge.rep-danger { background: var(--danger-soft); color: var(--rep-danger-ink); border-color: var(--rep-danger-ink); }
.rep-badge.rep-info { background: var(--primary-soft); color: var(--primary-ink); border-color: var(--primary-ink); }

/* ================= tipo di modello: la "linguetta" estensione, un colore per tipo ================= */
.rep-ft { display: inline-grid; place-items: center; flex: none; min-width: 34px; height: 22px; padding: 0 6px; border-radius: 5px; background: var(--c, var(--rep-slate)); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.rep-ft-repx { --c: var(--t-repx); } .rep-ft-word { --c: var(--t-word); } .rep-ft-excel { --c: var(--t-excel); } .rep-ft-html { --c: var(--t-html); }
.rep-tcell { display: inline-flex; align-items: center; gap: 8px; }

/* ================= il foglio: metafora del documento che si compone dai campi ================= */
.rep-sheet { position: relative; background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 22px 26px 26px; color: #1f2937; font-size: 13.5px; line-height: 1.6; min-height: 280px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 16px 28px -16px rgba(15, 23, 42, .3); }
.rep-sheet::after { content: ""; position: absolute; top: -1px; right: -1px; width: 22px; height: 22px; background: linear-gradient(225deg, var(--bg-soft) 50%, var(--border) 50%); border-radius: 0 4px 0 0; }
.rep-sheet h1 { font-size: 19px; font-weight: 800; line-height: 1.25; margin: 0 0 2px; }
.rep-sheet h2 { font-size: 16px; font-weight: 800; margin: 10px 0 2px; }
.rep-sheet h3 { font-size: 13.5px; font-weight: 800; margin: 12px 0 2px; color: var(--rep-slate); }
.rep-sheet p { margin: 0 0 4px; }
.rep-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: 6px; background: var(--primary-soft); border: 1px solid rgba(var(--primary-rgb), .4); color: var(--primary-ink); font-weight: 700; font-size: 12.5px; line-height: 1; vertical-align: 1px; white-space: nowrap; }
.rep-chip.rep-unk { background: var(--warning-soft); border-color: var(--warning); color: var(--rep-warning-ink); }
.rep-chip.rep-gone { background: var(--danger-soft); border-color: var(--danger); color: var(--rep-danger-ink); }
.rep-chip.rep-glob { background: var(--bg-soft); border-color: var(--border-strong); color: var(--rep-slate); }
.rep-chip.rep-fresh { animation: rep-kf-pop .7s var(--rep-ease); }
@keyframes rep-kf-pop { 0% { box-shadow: 0 0 0 0 rgba(var(--primary-rgb), .6); transform: scale(.92); } 100% { box-shadow: 0 0 0 10px rgba(var(--primary-rgb), 0); transform: none; } }
.rep-val { font-weight: 700; color: var(--text); border-bottom: 1.5px solid rgba(var(--primary-rgb), .45); }
.rep-val.rep-unk { color: var(--rep-warning-ink); border-bottom-color: var(--warning); }
.rep-block, .rep-cond { position: relative; margin: 8px 0 6px; padding: 8px 10px 4px 12px; border-left: 3px solid var(--primary); background: var(--primary-tint-1); border-radius: 0 6px 6px 0; }
.rep-cond { border-left-style: dashed; border-left-color: var(--primary-ink); background: var(--surface-soft); }
.rep-block-l { display: block; margin-bottom: 2px; font-size: 12px; font-weight: 700; color: var(--primary-strong); }
.rep-sheet-note { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.rep-sheet.rep-ghosted { background: var(--surface-soft); border-style: dashed; box-shadow: none; }
.rep-sheet.rep-ghosted::after { display: none; }
.rep-sk { display: grid; gap: 10px; }
.rep-sk i { display: block; height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--bg-soft), #fff, var(--bg-soft)); background-size: 200% 100%; animation: rep-kf-sh 1.4s linear infinite; }
.rep-sk i:nth-child(1) { width: 52%; height: 22px; } .rep-sk i:nth-child(2) { width: 38%; } .rep-sk i:nth-child(3) { width: 72%; } .rep-sk i:nth-child(4) { width: 64%; } .rep-sk i:nth-child(5) { width: 80%; } .rep-sk i:nth-child(6) { width: 46%; }

/* ================= modifica report: elenco a sinistra, dettaglio a destra ================= */
.rep-split { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 14px; align-items: start; }
.rep-mini { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.rep-mini h3 { padding: 11px 12px; font-size: 13px; font-weight: 700; color: var(--muted); background: var(--surface-soft); border-bottom: 1px solid var(--border-strong); }
.rep-mini button.rep-it { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 6px 12px; border: 0; border-bottom: 1px solid var(--border); background: none; text-align: left; font-weight: 600; font-size: 13.5px; }
.rep-mini button.rep-it:hover { background: var(--surface-soft); }
.rep-mini button.rep-it.rep-on { background: var(--primary-soft); color: var(--primary-ink); box-shadow: inset 3px 0 0 var(--primary); }
.rep-mini button.rep-it span.rep-nmx { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-mini button.rep-it.rep-new { color: var(--primary-strong); }
.rep-mini .rep-foot { padding: 8px 12px; font-size: 12.5px; color: var(--muted); }
.rep-detail { padding: 0 0 22px; }
.rep-d-head { display: flex; align-items: center; gap: 12px; padding: 26px 24px 14px; }
.rep-d-head h2 { flex: 1; min-width: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-d-head .rep-acts { display: flex; align-items: center; gap: 8px; }
.rep-d-sec { margin: 0 24px; padding: 16px 0 4px; border-top: 1px solid var(--border); }
.rep-d-sec:first-of-type { border-top: 0; }
.rep-d-sec > h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 15px; font-weight: 800; }
.rep-d-sec > h3 small { font-size: 13px; font-weight: 600; color: var(--muted); }
.rep-d-banner { margin: 0 24px 10px; }
.rep-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.rep-grid2 .rep-full { grid-column: 1 / -1; }
.rep-lbl { font-size: 12.5px; font-weight: 700; color: var(--rep-slate); margin-bottom: 4px; }
.rep-line { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 18px; }
.rep-vis-opt { display: grid; gap: 2px; }
.rep-profs { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 6px 24px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); }
.rep-profs.rep-off { opacity: .55; }
.rep-hint { margin: 6px 0 0; font-size: 13px; color: var(--rep-slate); }

/* albero dei campi + foglio */
.rep-compose { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 14px; align-items: start; }
.rep-tree { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; }
.rep-tree-h { padding: 8px; border-bottom: 1px solid var(--border); background: var(--surface-soft); }
.rep-tree-h input { width: 100%; height: 32px; border: 1px solid var(--muted); border-radius: var(--radius); padding: 0 10px; font-size: 13.5px; background: #fff; }
.rep-tree-b { max-height: clamp(300px, calc(100vh - 360px), 520px); overflow: auto; padding: 4px 0 6px; }
.rep-tr-ent { padding: 6px 12px 4px; font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: .02em; }
.rep-tr-sec { display: flex; align-items: center; gap: 4px; width: 100%; min-height: 34px; padding: 0 10px 0 6px; border: 0; background: none; text-align: left; font-weight: 700; font-size: 13.5px; }
.rep-tr-sec:hover { background: var(--surface-soft); }
.rep-tr-sec .rep-cnt { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); }
.rep-tr-kind { font-size: 11.5px; font-weight: 700; padding: 0 6px; border-radius: 99px; background: var(--bg-soft); color: var(--rep-slate); }
.rep-tr-kind.rep-el { background: var(--primary-soft); color: var(--primary-ink); }
.rep-tr-row { display: flex; align-items: center; gap: 6px; padding: 2px 10px 4px 36px; font-size: 12.5px; color: var(--rep-slate); }
.rep-tr-row input[type="number"] { width: 48px; height: 26px; border: 1px solid var(--muted); border-radius: 6px; padding: 0 4px; font-size: 13px; }
.rep-tr-row input[type="number"]:disabled { border-color: var(--border-strong); background: var(--bg-soft); }
.rep-tr-row .rep-sg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 6px; padding: 1px; gap: 1px; background: #fff; }
.rep-tr-row .rep-sg button { border: 0; background: none; padding: 1px 7px; border-radius: 4px; font-size: 12px; font-weight: 700; color: var(--rep-slate); }
.rep-tr-row .rep-sg button[aria-pressed="true"] { background: var(--primary-soft); color: var(--primary-ink); }
.rep-tr-f { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 32px; padding: 0 10px 0 36px; border: 0; background: none; text-align: left; font-size: 13.5px; font-weight: 400; color: var(--text); }
.rep-tr-f:hover:not(:disabled) { background: var(--primary-soft); color: var(--primary-ink); }
.rep-tr-f .rep-lb { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-tr-f .rep-al { flex: none; margin-left: auto; font-family: Consolas, "Cascadia Mono", monospace; font-size: 12px; color: var(--muted); }
.rep-tr-f:disabled { color: var(--muted); cursor: not-allowed; }
.rep-tr-f .rep-tg { font-size: 11.5px; font-weight: 700; color: var(--rep-danger-ink); }
.rep-tr-none { padding: 12px; font-size: 13px; color: var(--rep-slate); }
.rep-ed-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; gap: 8px; }
.rep-ed-h .rep-sg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 2px; gap: 2px; background: var(--surface); }
.rep-ed-h .rep-sg button { border: 0; background: none; padding: 4px 12px; border-radius: 6px; font-weight: 700; font-size: 13px; color: var(--rep-slate); }
.rep-ed-h .rep-sg button[aria-pressed="true"] { background: var(--primary-soft); color: var(--primary-ink); }
.rep-ed-h .rep-cnt { font-size: 13px; color: var(--rep-slate); }
.rep-ed-h .rep-cnt b { color: var(--rep-warning-ink); }
textarea.rep-code { display: block; width: 100%; min-height: 330px; resize: vertical; padding: 12px 14px; border: 1px solid var(--muted); border-radius: 12px; background: #0f172a; color: #e2e8f0; font-family: Consolas, "Cascadia Mono", monospace; font-size: 13px; line-height: 1.6; tab-size: 2; }
textarea.rep-code:focus-visible { outline: 3px solid rgba(var(--primary-rgb), .4); }

/* file modello */
.rep-drop { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1.5px dashed var(--border-strong); border-radius: 12px; background: var(--surface-soft); }
.rep-drop .rep-dz { flex: 1; min-width: 0; }
.rep-drop b { display: block; font-size: 14px; }
.rep-drop span.rep-sm { font-size: 13px; color: var(--rep-slate); }
.rep-fileline { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.rep-fileline .rep-meta { flex: 1; min-width: 0; }
.rep-fileline .rep-meta b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-fileline .rep-meta span { font-size: 13px; color: var(--rep-slate); }
.rep-checks { list-style: none; margin: 10px 0 0; padding: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.rep-checks li { display: flex; align-items: flex-start; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--bg-soft); font-size: 14px; }
.rep-checks li:last-child { border-bottom: 0; }
.rep-checks li svg { flex: none; margin-top: 2px; }
.rep-checks li .rep-tx { flex: 1; min-width: 0; }
.rep-checks li .rep-tx b { font-weight: 700; }
.rep-checks li .rep-tx span { display: block; font-size: 13px; color: var(--rep-slate); }
.rep-checks li.rep-ok svg { color: var(--rep-success-ink); }
.rep-checks li.rep-ko { background: var(--danger-soft); }
.rep-checks li.rep-ko svg, .rep-checks li.rep-ko .rep-tx b { color: var(--rep-danger-ink); }
.rep-checks li.rep-wn svg { color: var(--rep-warning-ink); }
.rep-found { margin-top: 12px; }
.rep-found .rep-grp { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0; }
.rep-found .rep-grp > em { font-style: normal; min-width: 130px; font-size: 12.5px; font-weight: 700; color: var(--rep-slate); }

/* anteprima */
.rep-pv { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 14px; align-items: start; }
.rep-pvc .rep-ctl { padding: 22px 18px 18px; }
.rep-pvc .rep-ctl h2 { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.rep-pvc .rep-ctl .rep-sub { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 13px; color: var(--rep-slate); }
.rep-recs { margin: 8px 0 14px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.rep-recs label { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 12px; border-bottom: 1px solid var(--bg-soft); cursor: pointer; }
.rep-recs label:last-child { border-bottom: 0; }
.rep-recs label:hover { background: var(--surface-soft); }
.rep-recs label.rep-on { background: var(--primary-soft); }
.rep-recs .rep-rn { flex: 1; min-width: 0; line-height: 1.2; }
.rep-recs .rep-rn b { display: block; font-size: 14px; }
.rep-recs .rep-rn span { font-size: 12.5px; color: var(--rep-slate); }
.rep-warns { margin: 0 0 12px; padding: 10px 14px 6px; border-radius: 12px; background: var(--warning-soft); color: var(--rep-warning-ink); }
.rep-warns > b { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 800; }
.rep-warns > small { display: block; margin: 2px 0 6px 26px; font-size: 13px; font-weight: 400; }
.rep-warns ul { list-style: none; margin: 0; padding: 0; }
.rep-warns li { display: flex; align-items: baseline; gap: 10px; padding: 6px 0 6px 26px; border-top: 1px solid rgba(180, 83, 9, .22); font-size: 13.5px; }
.rep-warns li code { flex: none; font-family: Consolas, "Cascadia Mono", monospace; font-size: 12.5px; padding: 0 6px; border-radius: 4px; background: #fff; border: 1px solid rgba(180, 83, 9, .35); }
.rep-pv-out { padding: 22px 22px 22px; }
.rep-pv-out .rep-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.rep-pv-out .rep-tools h2 { flex: 1; font-size: 18px; font-weight: 800; }

.rep-menu-wrap { position: relative; }
.rep-menu { position: absolute; z-index: 40; right: 0; top: calc(100% + 6px); width: 340px; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 16px 36px -12px rgba(15, 23, 42, .35), 0 2px 6px rgba(15, 23, 42, .08); }
.rep-menu h4 { padding: 8px 10px 4px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.rep-menu button.rep-mi { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 10px; border: 0; border-radius: 8px; background: none; text-align: left; }
.rep-menu button.rep-mi:hover:not(:disabled) { background: var(--primary-soft); }
.rep-menu button.rep-mi:disabled { cursor: not-allowed; }
.rep-menu button.rep-mi:disabled:not(.rep-busy) { opacity: .55; }
.rep-menu .rep-mi .rep-tx { flex: 1; min-width: 0; line-height: 1.2; }
.rep-menu .rep-mi .rep-tx b { display: block; font-size: 14px; font-weight: 700; }
.rep-menu .rep-mi .rep-tx span { font-size: 12.5px; color: var(--rep-slate); }
.rep-menu .rep-mi .rep-st-r { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--primary-ink); }
.rep-menu .rep-sepx { height: 1px; margin: 4px 6px; background: var(--border); }
.rep-menu a.rep-mg { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 10px; border-radius: 8px; color: var(--primary-strong); font-weight: 700; font-size: 13.5px; }
.rep-menu a.rep-mg:hover { background: var(--primary-soft); }
.rep-sc-banner { margin: 0 24px 12px; }
.rep-toast { position: fixed; z-index: 100; left: 50%; bottom: 22px; translate: -50% 0; padding: 9px 16px; border-radius: 10px; background: var(--text); color: #fff; font-weight: 600; font-size: 13.5px; box-shadow: 0 12px 24px -8px rgba(15, 23, 42, .5); }
/* stato vuoto progettato: un foglio bianco con i segnaposto in attesa */
.rep-empty { display: grid; justify-items: center; gap: 10px; padding: 36px 24px 40px; text-align: center; }
.rep-empty svg.rep-es { width: 220px; height: auto; margin-bottom: 4px; }
.rep-empty h3 { font-size: 18px; font-weight: 800; }
.rep-empty p { max-width: 52ch; color: var(--rep-slate); }
.rep-ghostbtn { width: min(420px, 100%); height: 52px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); background: none; color: var(--primary-strong); font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 6px; }
.rep-ghostbtn:hover { background: var(--primary-soft); border-color: rgba(var(--primary-rgb), .5); }
.rep-empty .rep-alts { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; }
/* Aggiunte dei componenti: scheda, filtro in testata, pulsante file, scheda a due colonne. */
.rep-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 12px 28px -18px rgba(15, 23, 42, .25); min-width: 0; }
.rep-tb-filter { min-width: 220px; }
.rep-filebtn { position: relative; cursor: pointer; }
.rep-filebtn input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.rep-filebtn:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.rep-back { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
@media (max-width: 900px) { .rep-split { grid-template-columns: minmax(0, 1fr); } .rep-compose { grid-template-columns: minmax(0, 1fr); } .rep-grid2 { grid-template-columns: minmax(0, 1fr); } }

/* ================= report su selezione: barra, finestra a tre momenti (prototipo PropostaReportSelezione.html) ================= */
.rep-grow { flex: 1; }
.rep-mut { font-size: 13px; color: var(--muted); }
.rep-selwrap { margin-bottom: 10px; border: 1px solid rgba(var(--primary-rgb), .3); border-radius: var(--radius, 8px); overflow: hidden; background: var(--surface); }
.rep-selbar { display: flex; align-items: center; gap: 12px; padding: 8px 12px; min-height: 56px; background: var(--primary-soft); color: var(--primary-ink); animation: rep-kf-bar-in .22s var(--rep-ease); }
@keyframes rep-kf-bar-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.rep-selbar .rep-cnt { font-weight: 800; font-size: 15px; }
.rep-pile { position: relative; flex: none; width: 34px; height: 34px; }
.rep-pile i { position: absolute; inset: 0; border-radius: 4px; background: #fff; border: 1px solid rgba(var(--primary-rgb), .45); }
.rep-pile i:nth-child(1) { translate: 4px -3px; opacity: .45; }
.rep-pile i:nth-child(2) { translate: 2px -1.5px; opacity: .75; }
.rep-pile b { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 4px; background: var(--primary); color: #fff; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rep-selbanner { display: flex; align-items: center; gap: 8px; justify-content: center; padding: 7px 12px; background: var(--surface-soft); border-top: 1px solid var(--border); font-size: 13.5px; color: var(--rep-slate); }
.rep-selbanner b { color: var(--text); }

.rep-scrim { position: fixed; z-index: 1090; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(15, 23, 42, .5); animation: rep-kf-fade .18s ease; }
@keyframes rep-kf-fade { from { opacity: 0; } }
.rep-dlg { width: min(880px, 100%); max-height: calc(100dvh - 48px); display: flex; flex-direction: column; border-radius: 18px; background: var(--surface); box-shadow: 0 24px 80px rgba(15, 23, 42, .4); overflow: hidden; animation: rep-kf-dlg-in .26s var(--rep-ease); }
@keyframes rep-kf-dlg-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.rep-dlg-h { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.rep-dlg-h h2 { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.25; }
.rep-dlg-h small { display: block; margin-top: 1px; font-size: 13px; font-weight: 600; color: var(--muted); }
.rep-dlg-h .rep-x { margin-left: auto; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: var(--radius, 8px); background: none; color: var(--muted); }
.rep-dlg-h .rep-x:hover { background: var(--bg-soft); color: var(--text); }
.rep-dlg-b { padding: 18px 20px; overflow: auto; min-height: 0; }
.rep-dlg-f { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-soft); }
.rep-dlg-f .rep-grow { color: var(--rep-slate); font-size: 13.5px; }
.rep-dlg-f .rep-btn { height: 36px; }

.rep-cfg { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.rep-cfg h3 { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.rep-opts { display: grid; gap: 8px; }
.rep-opt { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.rep-opt:hover { border-color: var(--muted); }
.rep-opt:has(input:checked) { border-color: var(--primary); background: var(--primary-tint-1, #f8fbff); box-shadow: 0 0 0 1px var(--primary); }
.rep-opt:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.rep-opt:has(input:disabled) { cursor: not-allowed; background: var(--surface-soft); }
.rep-opt:has(input:disabled) .rep-t { color: var(--muted); }
.rep-opt input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--primary); cursor: inherit; flex: none; }
.rep-opt .rep-t { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.rep-opt .rep-d { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.rep-out { margin-top: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); }
.rep-fname { display: block; margin-top: 6px; padding: 6px 9px; border-radius: 6px; background: #fff; border: 1px solid var(--border); font: 12.5px/1.4 Consolas, "Cascadia Mono", monospace; color: var(--text); overflow-wrap: anywhere; }
.rep-names { margin-top: 6px; font-size: 13.5px; color: var(--rep-slate); }
.rep-names b { color: var(--text); font-weight: 650; }
.rep-note-line { margin: 10px 0 0; padding-top: 10px; border-top: 1px dashed var(--border-strong); font-size: 13px; color: var(--muted); }

.rep-ovr { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.rep-ovr .rep-num { font-size: 26px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.rep-ovr .rep-num small { font-size: 14px; font-weight: 600; color: var(--muted); }
.rep-prog { flex: 1; height: 8px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; }
.rep-prog i { display: block; height: 100%; border-radius: inherit; background: var(--primary); transition: width .3s var(--rep-ease); }
.rep-fasc { border: 1px solid var(--border); border-radius: 12px; overflow: auto; max-height: 340px; }
.rep-fr { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 14px; border-bottom: 1px solid var(--border); }
.rep-fr:last-child { border-bottom: 0; }
.rep-fr .rep-fn { flex: 1; min-width: 0; font-weight: 600; }
.rep-fr .rep-fn small { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.rep-fr .rep-fst { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.rep-fr.rep-run { background: var(--primary-tint-1, #f8fbff); }
.rep-fr.rep-run .rep-fst { color: var(--primary-strong); }
.rep-fr.rep-ok .rep-fst { color: var(--success); }
.rep-fr.rep-err { background: var(--danger-soft); }
.rep-fr.rep-err .rep-fst, .rep-fr.rep-err small { color: var(--rep-danger-ink); }
.rep-ico { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; }
.rep-ico.rep-q { border: 2px solid var(--border-strong); }
.rep-ico.rep-ok { background: var(--success); color: #fff; animation: rep-kf-pop2 .35s var(--rep-ease); }
.rep-ico.rep-er { background: var(--danger); color: #fff; }
@keyframes rep-kf-pop2 { from { transform: scale(.4); } }

.rep-res { display: flex; align-items: center; gap: 16px; padding: 14px 16px; margin-bottom: 12px; border-radius: 12px; }
.rep-res.rep-res-ok { background: var(--success-soft); color: var(--rep-success-ink); }
.rep-res.rep-res-warn { background: var(--warning-soft); color: var(--rep-warning-ink); }
.rep-res .rep-big { font-size: 26px; font-weight: 800; line-height: 1.1; }
.rep-res .rep-sub { font-size: 14px; font-weight: 600; margin-top: 2px; }
.rep-res .rep-btn { margin-left: auto; }
.rep-bempty { display: grid; justify-items: center; gap: 6px; padding: 28px 12px 12px; text-align: center; }
.rep-bempty .rep-paper { position: relative; width: 74px; height: 92px; margin-bottom: 10px; }
.rep-bempty .rep-paper i { position: absolute; inset: 0; border-radius: 4px; background: #fff; border: 1.5px dashed var(--border-strong); }
.rep-bempty .rep-paper i:nth-child(1) { translate: 10px -8px; opacity: .5; }
.rep-bempty .rep-paper i:nth-child(2) { translate: 5px -4px; opacity: .8; }
.rep-bempty h3 { margin: 0; font-size: 17px; font-weight: 800; color: var(--text); }
.rep-bempty p { margin: 0; max-width: 46ch; color: var(--rep-slate); }
.rep-bempty .rep-btn { margin-top: 10px; }
@media (max-width: 760px) { .rep-cfg { grid-template-columns: 1fr; } }

/* ---- editor Word nella pagina (DxRichEdit) ---- */
.rep-docx-wrap { margin-top: 10px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.rep-docx { height: clamp(520px, 74vh, 780px); }
.rep-docx .rep-docx-ed { height: 100%; width: 100%; border: 0; }
.rep-docx-foot { display: flex; align-items: center; gap: 14px; padding: 7px 14px; border-top: 1px solid var(--border); background: var(--surface-soft); font-size: 12.5px; color: var(--rep-slate); }
.rep-docx-dirty { color: var(--rep-warning-ink); font-weight: 700; }
.rep-drop-word { flex-wrap: wrap; }
.rep-drop-word .rep-dz { flex: 1 1 280px; }
@media (max-width: 760px) { .rep-docx-wrap { display: none; } }

/* ---- Maschera Stampe (pulsante, elenco report + anteprima PDF) e pagina email ---- */
.stp-root { display: inline-flex; align-items: center; gap: 10px; }
.stp-outcome { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 650; color: var(--rep-success-ink); }
.stp-hidden { display: none !important; }

.stp-scrim { padding: 2vh 2vw; }
.stp-dlg { width: clamp(900px, 92vw, 1400px); max-width: 100%; height: min(94dvh, 900px); max-height: 100%; }
.stp-dlg-h { padding: 12px 16px; }
.stp-dlg-b { flex: 1; min-height: 0; display: flex; }

.stp-list { width: 270px; flex: none; display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border); background: var(--bg-soft); }
.stp-list-h { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.stp-search { position: relative; display: block; }
.stp-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.stp-search .rep-textinput { padding-left: 32px; }
.stp-list-err { margin: 10px; }
.stp-items { flex: 1; min-height: 0; overflow: auto; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.stp-rep { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 9px; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--text); text-align: left; font-size: 14px; cursor: pointer; }
.stp-rep:not(:disabled):not([aria-selected="true"]):hover { background: var(--surface); }
/* Selezionata come nel prototipo: peso 500, cosi' il nome non si allarga e non cambia il taglio con i puntini. */
.stp-rep[aria-selected="true"] { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 500; }
.stp-rep:disabled { cursor: not-allowed; }
.stp-rep:disabled:not([aria-selected="true"]) { color: var(--muted); }
.stp-rep svg { flex: none; }
.stp-rep-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stp-rep-c { margin-left: auto; flex: none; font: 11px Consolas, "Cascadia Mono", monospace; color: var(--muted); }
.stp-rep[aria-selected="true"] .stp-rep-c { color: inherit; }
.stp-ghost { flex: none; height: 34px; margin: 4px 6px; border: 1px dashed var(--border); border-radius: 6px; }
.stp-ghost-sk { border-style: solid; border-color: transparent; background: linear-gradient(90deg, var(--bg-soft), var(--surface), var(--bg-soft)); background-size: 200% 100%; animation: rep-kf-sh 1.4s linear infinite; }

.stp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.stp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.stp-actions > .rep-chk-line { margin-left: auto; }
.stp-out-slot { display: contents; }
.stp-out { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 34px; padding: 4px 10px; border-radius: var(--radius, 8px); font-size: 13.5px; font-weight: 650; }
.stp-out-ok { background: var(--success-soft); color: var(--rep-success-ink); }
.stp-out-err { background: var(--danger-soft); color: var(--rep-danger-ink); }
.stp-out-warn { background: var(--warning-soft); color: var(--rep-warning-ink); }
/* Riga Operatori: sotto le azioni, solo per i report che la dichiarano. Nessuna scelta = tutti. */
.stp-ops { flex: none; display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: var(--surface); border-bottom: 1px solid var(--border); }
.stp-ops-l { flex: none; font-size: 12px; font-weight: 600; color: var(--rep-slate); }
.stp-ops .stp-ops-box { flex: 1; min-width: 0; max-width: 520px; }
/* Il popup di DevExpress vive nel body a z-index 1050, sotto lo scrim (1090): si alza solo quello della riga Operatori. */
.dxbl-popup-cell:has(.stp-ops-dd), .dxbl-popup-root:has(.stp-ops-dd) { z-index: 1100 !important; }
.stp-ops-sk { flex: 1; max-width: 520px; height: 34px; border-radius: var(--radius, 8px); background: linear-gradient(90deg, var(--bg-soft), var(--surface), var(--bg-soft)); background-size: 200% 100%; animation: rep-kf-sh 1.4s linear infinite; }
/* Avviso non bloccante sopra l'anteprima: stesso fondo del palco, cosi' resta parte dell'anteprima e non una nuova barra. */
.stp-note { flex: none; padding: 10px 14px; background: var(--bg-soft); }
.stp-stage { position: relative; flex: 1; min-height: 0; overflow: auto; display: flex; justify-content: center; align-items: flex-start; padding: 16px; background: var(--bg-soft); }
.stp-pdf { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--bg-soft); }
.stp-paper { position: relative; flex: none; width: min(100%, 640px); aspect-ratio: 210 / 297; max-height: 100%; }
.stp-paper-sk { display: flex; flex-direction: column; gap: 12px; padding: 6%; border: 1px dashed var(--border-strong); border-radius: 4px; }
.stp-paper-sk i { display: block; height: 10px; border-radius: 3px; background: var(--border); }
.stp-paper-sk i:nth-child(1) { width: 46%; height: 18px; } .stp-paper-sk i:nth-child(2) { width: 30%; } .stp-paper-sk i:nth-child(3) { width: 100%; margin-top: 18px; }
.stp-paper-sk i:nth-child(4) { width: 92%; } .stp-paper-sk i:nth-child(5) { width: 96%; } .stp-paper-sk i:nth-child(6) { width: 70%; } .stp-paper-sk i:nth-child(7) { width: 34%; margin-left: auto; margin-top: 18px; }
.stp-paper-busy { border-style: solid; border-color: var(--border); background: var(--surface); }
.stp-paper-busy i { background: linear-gradient(90deg, var(--bg-soft), var(--border), var(--bg-soft)); background-size: 200% 100%; animation: rep-kf-sh 1.4s linear infinite; }
.stp-paper-spin { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; background: var(--primary-soft); color: var(--primary-ink); font-size: 13.5px; font-weight: 700; }
.stp-paper-err { justify-content: center; }
/* Report Excel: niente anteprima, una scheda con nome e dimensione del file nello stesso palco. */
.stp-file { align-self: center; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; row-gap: 2px; width: min(100%, 460px); padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--radius, 8px); background: var(--surface); }
.stp-file-i { grid-row: 1 / span 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius, 8px); background: var(--primary-soft); color: var(--primary); }
.stp-file-i svg { width: 22px; height: 22px; }
.stp-file-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; font-weight: 700; align-self: end; }
.stp-file-m { font-size: 12.5px; color: var(--muted); }
.stp-file-t { grid-column: 1 / -1; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 13.5px; color: var(--rep-slate); }

/* Pagina email: esce da destra, tutta l'altezza. */
.stp-dscrim { position: fixed; inset: 0; z-index: 1090; background: rgba(8, 16, 22, .35); animation: rep-kf-fade .2s ease; }
.stp-drawer { position: fixed; z-index: 1091; top: 0; right: 0; bottom: 0; width: clamp(460px, 35vw, 760px); max-width: 100vw; display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--border); box-shadow: -12px 0 40px rgba(15, 23, 42, .25); animation: stp-kf-drawer .28s cubic-bezier(.2, .8, .2, 1); }
@keyframes stp-kf-drawer { from { transform: translateX(102%); } to { transform: none; } }
.stp-mail-h { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.stp-mail-h h2 { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.25; }
.stp-mail-h .rep-x { margin-left: auto; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: var(--radius, 8px); background: none; color: var(--muted); }
.stp-mail-h .rep-x:hover { background: var(--bg-soft); color: var(--text); }
/* Durante invio o archiviazione la X non chiude: lo si vede. */
.stp-dlg-h .rep-x:disabled, .stp-mail-h .rep-x:disabled { background: none; color: var(--muted); opacity: .55; cursor: not-allowed; }
.stp-mf { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; padding: 10px 16px 0; }
.stp-mf-sk { padding: 16px; }
.stp-fr { display: flex; align-items: flex-start; gap: 8px; }
.stp-fr > label { width: 62px; flex: none; padding-top: 7px; font-size: 12px; font-weight: 600; color: var(--muted); }
.stp-fr > div, .stp-fr > .stp-in { flex: 1; min-width: 0; }
.stp-in-err { border-color: var(--rep-danger-ink); }

.stp-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 34px; padding: 3px 5px; border: 1px solid var(--muted); border-radius: var(--radius, 8px); background: var(--surface); cursor: text; }
.stp-chips:focus-within { border-color: var(--primary); outline: 3px solid rgba(var(--primary-rgb), .25); outline-offset: 0; }
.stp-chips-err { border-color: var(--rep-danger-ink); }
.stp-chips-in { flex: 1; min-width: 110px; padding: 3px 4px; border: 0; outline: 0; background: none; font-size: 14px; color: var(--text); }
.rep-root .stp-chips-in:focus-visible { outline: 0; }
.stp-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 1px 4px 1px 9px; border-radius: 99px; background: var(--primary-soft); color: var(--primary-ink); font-size: 12.5px; font-weight: 650; }
.stp-chip-bad { background: var(--danger-soft); color: var(--rep-danger-ink); }
.stp-chip-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stp-chip-x { width: 18px; height: 18px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: none; color: inherit; cursor: pointer; }
.stp-chip-x:hover { background: rgba(15, 23, 42, .12); }

.stp-editor { flex: 1; min-height: 150px; display: flex; flex-direction: column; border: 1px solid var(--muted); border-radius: var(--radius, 8px); overflow: hidden; background: var(--surface); }
.stp-editor:focus-within { border-color: var(--primary); outline: 3px solid rgba(var(--primary-rgb), .25); outline-offset: 0; }
.stp-editor > * { flex: 1; min-height: 0; }
.stp-editor .stp-dx-editor { border: 0; border-radius: 0; }

.stp-atts { display: flex; flex-direction: column; gap: 5px; max-height: 130px; overflow: auto; margin: 0; padding: 0; list-style: none; }
.stp-att { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 4px 6px 4px 9px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-soft); font-size: 13.5px; }
.stp-att-main { border-color: transparent; background: var(--primary-soft); color: var(--primary-ink); }
.stp-att svg { flex: none; }
.stp-att-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.stp-att-s { flex: none; font: 11px Consolas, "Cascadia Mono", monospace; color: var(--muted); }
.stp-att-x { width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--muted); cursor: pointer; }
.stp-att-x:hover { background: var(--surface); color: var(--text); }
.stp-att-add label { cursor: pointer; }
.stp-file-in:focus-visible + label { outline: 2px solid var(--primary); outline-offset: 2px; }

.stp-mail-f { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.stp-mail-row { display: flex; align-items: center; gap: 12px; }
.stp-mail-row .stp-send { margin-left: auto; min-width: 96px; }
.stp-send-err { padding: 8px 12px; }
.stp-mail-dup { justify-content: flex-end; }

@media (max-height: 760px) {
  .stp-mf { gap: 4px; }
  .stp-fr > label { padding-top: 6px; }
  .stp-actions { padding: 8px 12px; }
  .stp-note { padding: 8px 12px; }
  .stp-ops { padding: 6px 12px; }
  .stp-dlg-h { padding: 8px 14px; }
  .stp-mail-f { padding: 8px 16px; margin-top: 4px; }
  .stp-atts { max-height: 96px; }
  .stp-editor { min-height: 120px; }
}
