/* dashboard.css — extrahiert aus llm-dashboard-mockup-v1.html, angepasst
   fuer Pro-Demo USD (statt Cent) und Tool-Verdict-View (statt Primary/
   Supporting/Concerns). Mobile-First, max-width 480px zentriert. */

:root {
  --bg-main: #1a202c;
  --bg-panel: #2d3748;
  --bg-box: #374151;
  --bg-box-active: #4b5563;
  --progress-bg: #384252;
  --progress-nn: #4b5563;
  --text-white: #ffffff;
  --text-gray: #9ca3af;
  --text-orange: #f97316;
  --text-dim: #6b7280;
  --status-ok: #22c55e;
  --status-warn: #eab308;
  --status-alert: #f97316;
  --status-error: #ef4444;
  --long: #22c55e;
  --short: #dc2626;
  --cyan: #06b6d4;
  --trust-blue: #3b82f6;
  --trust-violet: #8b5cf6;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: Arial, sans-serif;
  background: var(--bg-main);
  color: var(--text-white);
  min-height: 100vh;
  padding: 8px 0;
  font-size: 13px;
  line-height: 1.4;
}
#app { max-width: 480px; margin: 0 auto; padding: 0 10px; }

/* --- Header --- */
.header {
  background: var(--bg-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--bg-box);
}
.logo { font-weight: bold; color: var(--text-orange); font-size: 15px; }
.logo .ver { color: var(--text-gray); font-size: 10px; font-weight: normal; margin-left: 6px; }
.conn-status { font-size: 11px; display: flex; align-items: center; gap: 6px; }
.conn-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--status-ok); animation: pulse 2s infinite;
}
.conn-dot.dead { background: var(--status-error); animation: none; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* --- Panel Base --- */
.panel { background: var(--bg-panel); border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.panel-title {
  font-weight: bold; font-size: 12px; color: var(--text-gray);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px;
  display: flex; justify-content: space-between; align-items: center;
}
.panel-title .badge {
  font-size: 10px; padding: 2px 6px; border-radius: 4px;
  background: var(--bg-box); color: var(--text-gray);
  text-transform: none; letter-spacing: 0;
}

/* --- Position offen --- */
.position-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;
}
.direction { font-size: 18px; font-weight: bold; display: flex; align-items: center; gap: 6px; }
.direction.long { color: var(--long); }
.direction.short { color: var(--short); }
.pos-symbol { font-size: 13px; color: var(--text-gray); font-weight: normal; }
.pos-pl { text-align: right; }
.pos-pl-main { font-size: 18px; font-weight: bold; }
.pos-pl-eur { font-size: 11px; color: var(--text-gray); }
.pl-positive { color: var(--status-ok); }
.pl-negative { color: var(--status-error); }

.pos-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px;
  font-size: 12px; margin-top: 8px;
}
.pos-grid .label { color: var(--text-gray); font-size: 10px; text-transform: uppercase; letter-spacing: 0.3px; }
.pos-grid .value { font-weight: 500; }

.pos-meta {
  display: flex; justify-content: space-between; margin-top: 10px;
  padding-top: 8px; border-top: 1px solid var(--bg-box);
  font-size: 11px; color: var(--text-gray);
}

.pl-breakdown { margin-top: 10px; padding: 10px; background: var(--bg-box); border-radius: 6px; }
.pl-breakdown-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 3px 0; font-size: 12px;
}
.pl-breakdown-label { color: var(--text-gray); }
.pl-breakdown-value { font-weight: 500; font-variant-numeric: tabular-nums; }
.pl-breakdown-net {
  margin-top: 4px; padding-top: 6px;
  border-top: 1px solid var(--bg-box-active); font-size: 13px;
}
.eur-small { color: var(--text-gray); font-size: 10px; margin-left: 2px; }

/* --- FLAT --- */
.flat-state { text-align: center; padding: 8px 0; }
.flat-counter-num { font-size: 32px; font-weight: bold; color: var(--text-orange); line-height: 1; }
.flat-counter-label { font-size: 11px; color: var(--text-gray); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }
.flat-last { margin-top: 12px; padding: 10px; background: var(--bg-box); border-radius: 6px; text-align: left; }
.flat-last-meta { font-size: 10px; color: var(--text-gray); margin-bottom: 6px; }

/* --- Trade-Lifecycle --- */
.lifecycle-current {
  background: var(--bg-box); border-radius: 6px; padding: 10px; margin-bottom: 10px;
  border-left: 3px solid var(--cyan);
}
.lifecycle-current-head {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
}
.action-badge {
  font-size: 11px; font-weight: bold; padding: 3px 8px;
  border-radius: 4px; letter-spacing: 0.5px;
}
.action-open_long { background: var(--long); color: #000; }
.action-open_short { background: var(--short); color: #fff; }
.action-adjust_tp { background: var(--status-warn); color: #000; }
.action-hold { background: var(--bg-box-active); color: var(--text-gray); }
.action-close { background: var(--cyan); color: #000; }
.action-flat { background: var(--text-dim); color: #fff; }
.action-skipped { background: var(--status-error); color: #fff; }

.action-meta { font-size: 10px; color: var(--text-gray); display: flex; gap: 10px; align-items: center; }
.confidence-bar {
  display: inline-block; width: 50px; height: 5px; background: var(--progress-bg);
  border-radius: 3px; overflow: hidden; vertical-align: middle;
}
.confidence-fill { height: 100%; background: var(--status-ok); }

.signal-anchor {
  margin-top: 6px; padding: 6px 8px; background: var(--bg-box-active);
  border-radius: 4px; font-size: 11px;
}
.signal-anchor .label { color: var(--text-gray); margin-right: 4px; }
.signal-anchor .value { color: var(--text-white); font-weight: 600; }

.verdict-summary {
  display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; font-size: 11px;
}
.verdict-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 6px; border-radius: 3px; background: var(--bg-box-active);
}
.verdict-pill.confirming { background: rgba(34, 197, 94, 0.2); color: var(--status-ok); }
.verdict-pill.contradicting { background: rgba(239, 68, 68, 0.2); color: var(--status-error); }
.verdict-pill.neutral { background: var(--bg-box-active); color: var(--text-gray); }

/* === v4.0 Multi-Slot-Indikator (1 LONG + 1 SHORT parallel) ============ */
.multi-slot-indicator {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 10px;
  margin-bottom: 8px;
  background: var(--bg-box-active);
  border-radius: 4px;
  font-size: 11px;
}
.multi-slot-header {
  color: var(--text-gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 9px;
}
.multi-slot-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.multi-slot-badge {
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 700;
  font-size: 10px;
}
.multi-slot-badge.long  { background: rgba(34, 197, 94, 0.18); color: var(--status-ok); }
.multi-slot-badge.short { background: rgba(239, 68, 68, 0.18); color: var(--status-error); }
.multi-slot-other-pl {
  font-weight: 600;
}
.multi-slot-other-pl.positive { color: var(--status-ok); }
.multi-slot-other-pl.negative { color: var(--status-error); }

/* === TP-Adjustment-Anzeige (Original + Pfeil + Justiert / TRAIL) ====== */
.tp-value { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tp-arrow {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; min-width: 16px;
  padding: 0 4px; border-radius: 3px;
}
.tp-arrow.up   { color: var(--status-ok);    background: rgba(34, 197, 94, 0.18); }
.tp-arrow.down { color: var(--status-error); background: rgba(239, 68, 68, 0.18); }
.tp-arrow.trail {
  color: var(--cyan); background: rgba(56, 189, 248, 0.18);
  font-size: 10px; letter-spacing: 0.6px;
}
.tp-sub {
  font-size: 10px; color: var(--text-gray); margin-top: 2px;
}
.tp-sub .tp-sub-label { color: var(--text-dim); margin-right: 4px; }

/* === Decision-Referenz-Badge (z.B. "#35") ============================= */
.decision-ref {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--bg-box-active);
  color: var(--cyan);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.3px;
}

/* === Pro/Contra-Trichter (Zwei-Spalten-Gegenueberstellung) ============ */
.verdict-versus {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.versus-col {
  background: var(--bg-box-active);
  border-radius: 4px;
  padding: 6px 8px;
}
.versus-col-pro    { border-left: 3px solid var(--status-ok); }
.versus-col-contra { border-left: 3px solid var(--status-error); }

.versus-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-gray); padding-bottom: 4px; margin-bottom: 4px;
  border-bottom: 1px solid var(--bg-box);
}
.versus-col-pro    .versus-icon { color: var(--status-ok);    font-weight: 700; }
.versus-col-contra .versus-icon { color: var(--status-error); font-weight: 700; }
.versus-col-pro    .versus-label { color: var(--status-ok); }
.versus-col-contra .versus-label { color: var(--status-error); }
.versus-count {
  margin-left: auto;
  padding: 0 5px;
  background: var(--bg-box);
  border-radius: 3px;
  font-weight: 600;
  color: var(--text-white);
}

.versus-list { list-style: none; padding: 0; margin: 0; }
.versus-list li {
  font-size: 11px; padding: 3px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.04);
}
.versus-list li:last-child { border-bottom: none; }
.versus-tool { color: var(--text-white); font-weight: 600; }
.versus-obs  { color: var(--text-gray); font-size: 10px; margin-top: 1px; }

.weight-badge {
  display: inline-block;
  padding: 0 4px;
  border-radius: 2px;
  font-size: 9px;
  margin-right: 4px;
  text-transform: lowercase;
  letter-spacing: 0.3px;
  vertical-align: middle;
}
.weight-strong   { background: rgba(34, 197, 94, 0.30); color: var(--status-ok); font-weight: 700; }
.weight-moderate { background: var(--bg-box); color: var(--text-white); }
.weight-weak     { background: var(--bg-box); color: var(--text-dim); }
.versus-col-contra .weight-strong { background: rgba(239, 68, 68, 0.30); color: var(--status-error); }

.summary-text {
  font-size: 12px; font-style: italic; color: var(--text-white);
  background: var(--bg-box-active); padding: 8px; border-radius: 4px; margin-top: 8px;
}

.override-flags {
  margin-top: 6px; font-size: 10px; color: var(--text-gray);
  display: flex; gap: 8px; flex-wrap: wrap;
}
.override-flags .flag {
  padding: 2px 6px; border-radius: 3px; background: var(--bg-box-active);
}
.override-flags .flag.active { background: var(--status-warn); color: #000; font-weight: bold; }
.override-flags .flag.mismatch { background: var(--status-error); color: #fff; font-weight: bold; }

.lifecycle-older { font-size: 11px; }
.lifecycle-older-title {
  font-size: 10px; color: var(--text-gray); text-transform: uppercase;
  margin-bottom: 6px; letter-spacing: 0.5px;
}
.older-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; background: var(--bg-box); border-radius: 4px; margin-bottom: 4px;
}
.older-row .time { font-size: 10px; color: var(--text-gray); min-width: 38px; }
.older-row .action-mini { font-size: 10px; padding: 2px 5px; border-radius: 3px; font-weight: bold; }
.older-row .summary-mini {
  flex: 1; font-size: 11px; color: var(--text-gray);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.older-row .conf-mini { font-size: 10px; color: var(--cyan); font-weight: bold; }

/* --- Macro-Shocks / Forex-Events --- */
.shock-list { display: flex; flex-direction: column; gap: 4px; }
.shock-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; background: var(--bg-box); border-radius: 4px; font-size: 11px;
}
.shock-row-icon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }
.shock-row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shock-row-name strong { color: var(--text-white); }
.shock-row-decay { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.shock-decay-bar { width: 40px; height: 5px; background: var(--progress-bg); border-radius: 2px; overflow: hidden; }
.shock-decay-fill { height: 100%; background: var(--status-warn); }
.shock-decay-fill.high { background: var(--status-error); }
.shock-decay-fill.mid { background: var(--status-warn); }
.shock-decay-fill.low { background: var(--text-dim); }
.shock-row-time { font-size: 10px; color: var(--text-gray); min-width: 42px; text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.shock-summary { font-size: 10px; color: var(--text-gray); text-align: right; margin-top: 4px; }
.no-shocks { color: var(--text-gray); font-size: 11px; font-style: italic; text-align: center; padding: 4px; }

/* --- aufklappbare Shock/Event-Items --- */
.shock-item { background: var(--bg-box); border-radius: 4px; overflow: hidden; }
.shock-item .shock-row { background: transparent; border-radius: 0; cursor: pointer; }
.shock-item .shock-row:hover { background: rgba(255,255,255,0.05); }
.shock-caret { font-size: 9px; color: var(--text-dim); width: 9px; flex-shrink: 0; transition: transform .12s; }
.shock-item.expanded .shock-caret { transform: rotate(90deg); }
.shock-detail { display: none; padding: 7px 10px 9px; font-size: 11px; color: var(--text-gray); border-top: 1px solid var(--progress-bg); line-height: 1.5; }
.shock-item.expanded .shock-detail { display: block; }
.shock-detail-desc { color: var(--text-white); white-space: normal; margin-bottom: 6px; }
.shock-detail-grid { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; }
.shock-detail-grid .k { color: var(--text-dim); }
.shock-headlines { margin-top: 8px; }
.shock-hl-title { color: var(--text-dim); font-size: 9px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 3px; }
.shock-hl { padding: 4px 0; border-top: 1px solid var(--progress-bg); }
.shock-hl:first-of-type { border-top: none; }
.shock-hl a { color: #5ab0ff; text-decoration: none; }
.shock-hl a:hover { text-decoration: underline; }
.shock-hl-meta { display: block; color: var(--text-dim); font-size: 10px; margin-top: 1px; }

/* --- Post-Mortem-Panel (laienfreundlich umgebaut) --- */
.pm-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-bottom: 8px; }
.pm-metric { background: var(--bg-box); border-radius: 4px; padding: 8px 10px; cursor: help; }
.pm-metric-value { font-size: 18px; font-weight: 700; color: var(--text-white); line-height: 1.1; }
.pm-metric-label { font-size: 10px; color: var(--text-gray); margin-top: 2px; }
.pm-block-title { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); margin: 8px 0 4px; }
.pm-dir-rows { display: flex; flex-direction: column; gap: 3px; }
.pm-dir-row { font-size: 11px; color: var(--text-gray); background: var(--bg-box); border-radius: 4px; padding: 5px 8px; }
.pm-dir-row strong { color: var(--text-white); }
.pm-kv { display: grid; grid-template-columns: max-content 1fr; gap: 3px 10px; font-size: 11px; align-items: baseline; }
.pm-kv .pm-k { color: var(--text-dim); cursor: help; }
.pm-kv .pm-v { color: var(--text-gray); }
.pm-foot { font-size: 10px; color: var(--text-gray); margin-top: 8px; text-align: center; cursor: help; }

/* --- Tool-Reliability (SPEC v2.0) --- */
.reliability-list { display: flex; flex-direction: column; gap: 4px; }
.rel-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; background: var(--bg-box); border-radius: 4px; font-size: 11px;
}
.rel-row-tool { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel-row-tool strong { color: var(--text-white); }
.rel-row-slot { font-size: 10px; color: var(--text-gray); margin-left: 4px; }
.rel-row-stats { font-size: 10px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.rel-row-n { color: var(--text-gray); font-size: 10px; min-width: 36px; text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.rel-row.low-data { opacity: 0.55; }
.rel-hit-good { color: var(--status-ok); font-weight: bold; }
.rel-hit-bad  { color: var(--status-error); font-weight: bold; }
.rel-hit-mid  { color: var(--status-warn); font-weight: bold; }

/* --- Veto --- */
.veto-active {
  background: rgba(239, 68, 68, 0.15); border: 1px solid var(--status-error);
  border-radius: 6px; padding: 8px;
}
.veto-title { color: var(--status-error); font-weight: bold; font-size: 13px; margin-bottom: 4px; }
.veto-reason { font-size: 11px; color: var(--text-white); }
.veto-until { font-size: 10px; color: var(--text-gray); margin-top: 4px; }

/* --- Aggregate --- */
.agg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.agg-cell { background: var(--bg-box); border-radius: 6px; padding: 8px; }
.agg-label { font-size: 10px; color: var(--text-gray); text-transform: uppercase; letter-spacing: 0.3px; }
.agg-value { font-size: 16px; font-weight: bold; margin-top: 2px; }
.agg-sub { font-size: 10px; color: var(--text-gray); margin-top: 2px; }

.agg-full { background: var(--bg-box); border-radius: 6px; padding: 8px; margin-top: 8px; }
.agg-progress-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 4px; font-size: 11px;
}
.progress-bar { height: 6px; background: var(--progress-bg); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--cyan); transition: width 0.3s; }

/* --- Account --- */
.account-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 12px; }
.account-row .label { color: var(--text-gray); }
.account-row .value { font-weight: 500; }
.account-row .value .eur { color: var(--text-gray); font-size: 11px; margin-left: 4px; }
.budget-bar { margin-top: 8px; }
.budget-bar-label {
  display: flex; justify-content: space-between; font-size: 10px;
  color: var(--text-gray); margin-bottom: 3px;
}
.budget-progress { height: 8px; background: var(--progress-bg); border-radius: 4px; overflow: hidden; }
.budget-fill {
  height: 100%; background: linear-gradient(90deg, var(--status-ok) 0%, var(--status-warn) 60%, var(--status-error) 100%);
  transition: width 0.3s;
}

/* --- Cost-Tracking --- */
.cost-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.cost-row { font-size: 11px; }
.cost-label { color: var(--text-gray); font-size: 10px; }
.cost-value { font-weight: 500; }
.triple-swap-warn {
  background: rgba(245, 158, 11, 0.15); border: 1px solid var(--status-alert);
  border-radius: 4px; padding: 6px; margin-top: 8px; font-size: 11px;
  color: var(--status-alert); text-align: center;
}

/* --- Zone-Recovery-Cluster --- */
.cl-card {
  border: 1px solid var(--border, #2a2a3a); border-radius: 5px;
  padding: 7px 9px; margin-bottom: 8px; background: rgba(255,255,255,0.02);
}
.cl-head { font-size: 11px; font-weight: 600; margin-bottom: 3px; }
.cl-phase { color: var(--text-gray); font-weight: 400; }
.cl-overhang { font-size: 11px; margin-bottom: 5px; color: var(--text-gray); }
.cl-overhang.long { color: var(--status-ok, #34d399); }
.cl-overhang.short { color: var(--status-alert, #f59e0b); }
.cl-legs { font-size: 10.5px; line-height: 1.5; }
.cl-leg { font-family: var(--mono, monospace); }
.cl-basis { color: var(--text-dim); font-size: 9.5px; }
.cl-pends { margin-top: 5px; padding-top: 4px; border-top: 1px dashed var(--border, #2a2a3a); }
.cl-pends-h { font-size: 9px; text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-dim); margin-bottom: 2px; }
.cl-pend { font-size: 10px; font-family: var(--mono, monospace); color: var(--text-gray); }

/* --- Footer --- */
.footer { font-size: 10px; color: var(--text-dim); text-align: center; padding: 8px; margin-top: 10px; }
