Add the Operazioni, Strategie and Rischio screens (refs #45)

The three screens follow mockups 03, 04 and 07.

Operazioni shows the balance of the closed trades, filters, a CSV export,
and for each trade why it was bought and sold. The reasons come from the
decision codes through fixed Italian templates.

Strategie shows the four stages towards real money, a card per strategy
with its requirements, the procedure of SPEC 12.4, and why each strategy in
observation waits. A strategy that failed its backtest cannot be moved into
the simulation.

Rischio shows the emergency switch, the automatic blocks, the use of each
limit, the fall from the peak, the scenarios and the risk events. Stop,
close and restart now go through the risk engine. A restart is refused
while the STOP file exists.

Impostazioni gains the limits, the day-trade guard and the scenarios.
Lowering a limit is always allowed. Raising a limit or the entrusted capital
while a strategy uses real money needs the phrase and the password.

The demo now holds the decisions behind its trades, the 58 days of
simulation and the indices of its curves, so it matches the mockups.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-11-11 16:14:44 +01:00
1 parent 7041533ce2
commit 13f9c42f61
16 files changed
+2085 -34

No files matched your search

+151
View File
@@ -224,6 +224,7 @@ textarea {
.panel > h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.panel > h3, .panel h3 { margin: 20px 0 8px; }
.note { color: var(--text-3); font-size: 13px; line-height: 18px; }
h2 .note, h3 .note { font-weight: 400; letter-spacing: 0; }
.hint { color: var(--text-3); font-size: 13px; line-height: 18px; }
.empty { display: flex; flex-direction: column; gap: 8px; color: var(--text-2); max-width: 70ch; }
.empty-title { color: var(--text); font-weight: 600; font-size: 15px; }
@@ -389,6 +390,137 @@ legend { display: flex; align-items: center; gap: 10px; font-size: 17px; font-we
.currency-lines dd { margin: 0; text-align: right; }
.fx-warning { margin-top: 16px; }
/* ---- Operazioni ---- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.trades-head .lead { margin-top: 0; }
.trades-head .big-number { margin-top: 8px; }
.trades-head .note { margin-top: 10px; }
.trades-head h2 { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.cells { margin-bottom: 0; }
.cells > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cells dt { color: var(--text-3); font-size: 13px; }
.cells dd { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.cells dd strong { font-size: 18px; line-height: 24px; font-weight: 650; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; }
.cells dd span { color: var(--text-3); font-size: 13px; }
.result-bars { display: block; width: 100%; height: 170px; margin-top: 16px; }
.result-bars .axis { stroke: var(--rule); stroke-width: 1; vector-effect: non-scaling-stroke; }
.result-bars rect.gain { fill: var(--gain); }
.result-bars rect.loss { fill: var(--loss); }
.bars-scale { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.filters .btn:last-child { margin-left: auto; }
.search { position: relative; flex: 1 1 240px; display: flex; align-items: center; }
.search .icon { position: absolute; left: 14px; color: var(--text-3); pointer-events: none; }
.search input { width: 100%; padding-left: 40px !important; }
.trades { display: flex; flex-direction: column; margin: 0 -22px; }
.trade-row {
display: grid; grid-template-columns: 116px minmax(0, 1fr) 128px 70px 176px 146px minmax(0, 1.7fr) 20px;
gap: 12px; align-items: center; padding: 14px 22px; border-bottom: 1px solid var(--rule-inner); font-variant-numeric: tabular-nums;
}
.trade-header { color: var(--text-3); font-size: 13px; padding-top: 4px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.trade-header::after { content: ""; }
.trade-row .num { text-align: right; }
.trade summary { list-style: none; cursor: pointer; }
.trade summary::-webkit-details-marker { display: none; }
.trade summary::after {
content: ""; justify-self: end; width: 8px; height: 8px; margin-right: 4px;
border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2); transform: rotate(45deg) translateY(-3px);
}
.trade[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
.trade summary:hover { background: var(--surface-2); }
.trade[open] { background: var(--surface-2); }
.trade[open] summary { border-bottom: 0; }
.why { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; padding: 4px 22px 22px; border-bottom: 1px solid var(--rule-inner); }
.why-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.why-card h3 { margin: 0 !important; }
.why-card .account-lines { margin-top: 4px; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.checks li { display: flex; align-items: flex-start; gap: 10px; }
.checks .icon { margin-top: 2px; }
.checks .ok .icon { color: var(--gain); }
.checks .warn { color: var(--attention); }
.checks .wait .icon { color: var(--text-2); }
.pager { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 18px; }
.pager .note { margin-right: auto; }
/* ---- Strategie ---- */
.stages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stages li { border: 1px solid var(--rule); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.stages li > strong { font-size: 15px; }
.stages li > p { color: var(--text-2); font-size: 13.5px; }
.stages li.here { border: 2px solid var(--text); background: var(--surface-2); padding: 15px 17px; }
.stages .step { border: 1.5px solid var(--text); background: transparent; width: 24px; height: 24px; font-size: 13px; font-weight: 650; }
.stages .here .step { background: var(--text); color: var(--surface); }
.stage-count { display: flex; align-items: center; gap: 4px; margin-top: auto; padding-top: 6px; color: var(--text) !important; }
.stage-count .swatch { margin-right: 0; }
.stage-count strong { margin-left: 4px; }
.strategy { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1.15fr); padding: 0; }
.strategy > div { padding: 24px 26px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.strategy > div + div { border-left: 1px solid var(--rule); }
.strategy-about h2 { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 20px; line-height: 28px; }
.strategy-about h2 .tag { margin-left: 10px; background: var(--info-bg); color: var(--link); }
.strategy-about > p:first-of-type { font-size: 15px; line-height: 22px; }
.strategy-about ul { margin: 0; padding-left: 20px; color: var(--text-2); display: flex; flex-direction: column; gap: 4px; }
.strategy-about .note { margin-top: auto; }
.strategy-number { display: flex; align-items: center; gap: 14px; font-size: 30px; line-height: 36px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.spark { display: block; width: 100%; height: 80px; }
.strategy-result .account-lines { grid-template-columns: max-content minmax(0, 1fr); column-gap: 16px; }
.strategy-result .account-lines dd { overflow-wrap: anywhere; }
.spark polyline { fill: none; stroke-width: 2; stroke-linejoin: round; }
.strategy-steps h3 { margin: 0 !important; }
.strategy-steps form { margin: 0; }
.confirm-live summary { list-style: none; align-self: flex-start; display: inline-flex; }
.confirm-live summary::-webkit-details-marker { display: none; }
.confirm-live[open] summary { margin-bottom: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 16px; align-items: end; }
.form-grid > p { grid-column: 1 / -1; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-weight: 550; }
.form-grid .btn { justify-self: start; }
.confirm-live .form-grid { grid-template-columns: 1fr; }
.plain { border-top: 2px solid var(--text); padding-top: 18px; }
.plain > h2 { margin-bottom: 8px; }
.observing { display: grid; grid-template-columns: minmax(180px, max-content) minmax(0, 1fr); margin: 0; }
.observing dt, .observing dd { margin: 0; padding: 14px 0; border-bottom: 1px solid var(--rule-inner); }
.observing dt { font-weight: 650; padding-right: 32px; }
.observing dd { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--text-2); }
.observing form { margin: 0; flex: none; }
.attention { display: inline-flex; align-items: center; gap: 6px; }
/* ---- Rischio ---- */
.risk-top { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.risk-top .panel { display: flex; flex-direction: column; gap: 12px; }
.risk-top .panel-head { margin-bottom: 0; }
.risk-top p { color: var(--text-2); }
.btn-danger-solid { background: var(--loss); border-color: var(--loss); color: var(--surface); }
.btn-danger-solid:hover { background: var(--loss); opacity: .9; }
.status-line.gain { display: flex; align-items: center; gap: 8px; color: var(--gain); font-weight: 600; font-size: 14px; white-space: normal; }
.blocks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.blocks li { display: flex; align-items: flex-start; gap: 10px; }
.blocks .icon { margin-top: 2px; }
.block-list { margin: 0; display: flex; flex-direction: column; }
.block-list dt { color: var(--text-3); font-size: 13px; padding-top: 12px; border-top: 1px solid var(--rule-inner); }
.block-list dd { margin: 0 0 12px; display: flex; flex-direction: column; gap: 2px; }
.block-list dd span { color: var(--text-2); font-size: 13.5px; }
.limits td.wide { width: 24%; vertical-align: middle; }
.usage { display: block; position: relative; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.usage span { display: block; height: 100%; border-radius: 3px; background: var(--text-2); min-width: 2px; }
.usage.high span { background: var(--attention); }
.drawdown { display: block; width: 100%; height: auto; margin-top: 12px; overflow: visible; }
.drawdown .axis { stroke: var(--rule); stroke-width: 1; }
.drawdown .tick { fill: var(--text-3); font-size: 12px; }
.drawdown .area { fill: var(--loss); opacity: .1; }
.drawdown .line { fill: none; stroke: var(--loss); stroke-width: 2; stroke-linejoin: round; }
.drawdown .dot { fill: var(--loss); }
.drawdown .label { fill: var(--text); font-size: 12.5px; font-weight: 650; }
.columns .panel .notice { margin-top: 12px; }
.never { list-style: none; margin: 0; padding: 0; }
.never li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule-inner); }
.never .icon { color: var(--text-2); }
.events { display: grid; grid-template-columns: 140px minmax(0, 1fr); margin: 0 0 12px; }
.events dt, .events dd { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--rule-inner); }
.events dt { color: var(--text-3); }
.limits-form { max-width: none; margin-bottom: 8px; }
/* ---- Service pages ---- */
.service { min-height: 100vh; display: flex; justify-content: center; padding: 48px 16px; }
.service-box { width: 100%; max-width: 720px; display: flex; flex-direction: column; gap: 16px; }
@@ -438,6 +570,25 @@ legend { display: flex; align-items: center; gap: 10px; font-size: 17px; font-we
.panel-tools { width: 100%; justify-content: space-between; }
.facts { grid-template-columns: 1fr; gap: 2px; }
.facts dd { margin-bottom: 8px; }
.panel > h2 { flex-direction: column; align-items: flex-start; gap: 4px; }
.trades-head .cells { grid-template-columns: 1fr 1fr; }
.trades { margin: 0 -18px; }
.trade-row { grid-template-columns: minmax(0, 1fr) auto 16px; gap: 4px 12px; padding: 12px 18px; }
.trade-row > span:first-child { grid-column: 1 / -1; color: var(--text-3); font-size: 13px; }
.trade-row .wide, .trade-header, .limits .wide, .filters .btn:last-child { display: none; }
.why { grid-template-columns: 1fr; padding: 4px 18px 18px; }
.filters > label:not(.search) { flex: 1 1 140px; }
.filters select { width: 100%; }
.stages { grid-template-columns: 1fr 1fr; gap: 10px; }
.strategy { grid-template-columns: 1fr; }
.strategy > div { padding: 18px; }
.strategy > div + div { border-left: 0; border-top: 1px solid var(--rule); }
.risk-top { grid-template-columns: 1fr; gap: 14px; }
.observing { grid-template-columns: 1fr; }
.observing dt { border-bottom: 0; padding-bottom: 0; }
.observing dd { flex-direction: column; align-items: flex-start; }
.events { grid-template-columns: 1fr; }
.events dt { border-bottom: 0; padding-bottom: 0; }
.bottombar {
display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; position: fixed; left: 0; right: 0; bottom: 0;
padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--rule); z-index: 10;