/*!
 * WIBFIN ProcessSim · © 2026 WIBFIN Wirtschaftsberatungs- und Forschungsinstitut GmbH · https://wibfin.de
 * Nutzung gemäß nutzungsbedingungen.html. Bei Weitergabe bitte Quelle angeben: „WIBFIN ProcessSim – https://wibfin.de“.
 * Dieser Hinweis darf nicht entfernt werden.
 */
/* WIBFIN ProzessSim */
:root {
  /* WIBFIN-Farben (wie wibfin.de) */
  --teal: #2e6c6b; --teal-dark: #1f4d4c; --teal-light: #e8f1f1; --teal-hover: #d8ece9;
  --navy: var(--teal-dark); --navy2: var(--teal); --accent: var(--teal); --bg: #f4f7f7; --panel: #ffffff;
  --line: #dde3ea; --text: #1f2933; --muted: #6b7785; --ok: #2f9e44; --err: #c92a2a;
  color-scheme: light only;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--text); background: var(--bg);
       display: flex; flex-direction: column; overflow: hidden; }
button, select, input { font: inherit; color: inherit; }
button, select { background: #fff; border: 1px solid #c4ccd6; border-radius: 6px; padding: 6px 12px; cursor: pointer; }
button:hover, select:hover { border-color: var(--navy2); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
button.danger { background: var(--err); border-color: var(--err); color: #fff; }
button.small { padding: 3px 8px; font-size: 12px; }
button:disabled { opacity: .5; cursor: default; }

/* Kopfzeile – im Stil von wibfin.de */
.topbar { display: flex; align-items: center; gap: 14px 20px; padding: 8px 16px; background: var(--teal-light); color: var(--teal-dark);
          flex-wrap: wrap; border-bottom: 1px solid rgba(46,108,107,.2); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--teal-dark); text-decoration: none; }
.brand strong { font-size: 15px; }
.brand small { display: block; font-size: 11px; color: #555; }
.logo { height: 40px; width: auto; display: block; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar button, .toolbar select { background: #fff; border-color: rgba(46,108,107,.35); color: var(--teal-dark); }
.toolbar button:hover, .toolbar select:hover { background: var(--teal-hover); border-color: var(--teal); }
.toolbar button.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.toolbar button.primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.toolbar button.danger { background: var(--err); border-color: var(--err); color: #fff; }
.helpBtn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 1px solid rgba(46,108,107,.35);
           color: var(--teal-dark); font-weight: 700; text-decoration: none; flex: none; }
.helpBtn:hover { background: var(--teal-hover); border-color: var(--teal); }
.sep { width: 1px; height: 24px; background: rgba(46,108,107,.3); margin: 0 4px; }
.progress { position: relative; width: 180px; height: 22px; background: #fff; border: 1px solid rgba(46,108,107,.35); border-radius: 11px; overflow: hidden; }
.progress div { height: 100%; width: 0; background: #9fd0cd; transition: width .1s; }
.progress span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; }

.banner { padding: 8px 16px; background: #fff4e6; border-bottom: 1px solid #ffd8a8; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.banner.err { background: #fff5f5; border-color: #ffc9c9; }
.banner.ok { background: #ebfbee; border-color: #b2f2bb; }
.banner ul { margin: 4px 0; padding-left: 20px; }
.banner .grow { flex: 1; }

/* Hauptlayout */
.layout { flex: 1; display: grid; grid-template-columns: 200px 1fr 320px; min-height: 0; }
.palette, .props { background: var(--panel); overflow-y: auto; padding: 12px 14px; }
.palette { border-right: 1px solid var(--line); }
.props { border-left: 1px solid var(--line); }
.palette h3, .props h3 { margin: 6px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--navy2); }
.hint { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.palItem { display: flex; align-items: center; gap: 10px; padding: 6px 8px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 8px;
           cursor: grab; user-select: none; background: #fff; }
.palItem:hover { border-color: var(--teal); background: var(--teal-light); }
.palItem svg { flex: none; }
.palItem b { display: block; font-size: 13px; }
.palItem small { color: var(--muted); font-size: 11px; }
.help { padding-left: 16px; margin: 0; font-size: 12px; color: var(--muted); }
.help li { margin-bottom: 6px; }
.legal { margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); line-height: 1.5; }
.legal a { color: var(--teal); }
kbd { border: 1px solid #c4ccd6; border-radius: 3px; padding: 0 4px; font-size: 11px; background: #f1f3f5; }

.canvasArea { position: relative; min-height: 0; min-width: 0; display: flex; flex-direction: column; }
.canvasWrap { overflow: auto; position: relative; flex: 1; min-height: 0; background: #fbfcfd; -webkit-overflow-scrolling: touch; }
.zoomCtl { position: absolute; right: 14px; bottom: 14px; z-index: 6; display: flex; align-items: center; gap: 2px; background: #fff;
           border: 1px solid rgba(46,108,107,.3); border-radius: 8px; padding: 3px; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.zoomCtl button { border: 0; background: none; width: 32px; height: 32px; padding: 0; font-size: 18px; color: var(--teal-dark); border-radius: 6px; }
.zoomCtl button:hover { background: var(--teal-light); }
.zoomCtl span { font-size: 12px; min-width: 44px; text-align: center; color: var(--teal-dark); font-variant-numeric: tabular-nums; }
#canvas { display: block; user-select: none; -webkit-user-select: none; touch-action: pan-x pan-y; }
.node, .port { touch-action: none; }
.node { cursor: move; }
.node .shape { stroke: #46505c; stroke-width: 1.3; }
.node.sel .shape { stroke: var(--accent); stroke-width: 3; }
.node.err .shape { stroke: var(--err); stroke-width: 2.5; stroke-dasharray: 5 3; }
.node text { pointer-events: none; }
.node .title { font-size: 13px; font-weight: 600; fill: #1f2933; }
.node .kind { font-size: 10px; fill: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.node .stat { font-size: 11px; fill: var(--navy2); font-weight: 600; }
.port { fill: #fff; stroke: #46505c; stroke-width: 1.5; cursor: crosshair; }
.port:hover { fill: var(--accent); stroke: var(--accent); }
.portLabel { font-size: 10px; fill: var(--muted); pointer-events: none; }
.link { fill: none; stroke: #5b6675; stroke-width: 1.8; stroke-linejoin: round; }
.link.sel { stroke: var(--accent); stroke-width: 3; }
.linkHit { fill: none; stroke: transparent; stroke-width: 14; cursor: pointer; }

/* Eigenschaften */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 3px; color: #3d4752; }
.field textarea { width: 100%; padding: 6px 8px; border: 1px solid #c4ccd6; border-radius: 6px; background: #fff; font: inherit; font-size: 13px; line-height: 1.4; resize: vertical; }
.field textarea:focus { outline: 2px solid #b5dcd9; border-color: var(--teal); }
.field input, .field select { width: 100%; padding: 6px 8px; border: 1px solid #c4ccd6; border-radius: 6px; background: #fff; }
.field input:focus, .field select:focus { outline: 2px solid #b5dcd9; border-color: var(--teal); }
.field input.bad { border-color: var(--err); background: #fff5f5; }
.field .msg { font-size: 11px; color: var(--err); margin-top: 3px; }
.field .note { font-size: 11px; color: var(--muted); margin-top: 3px; }
.row2 { display: flex; gap: 8px; align-items: flex-end; }
.row2 > * { flex: 1; }
.propsHead { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.propsHead h2 { margin: 0; font-size: 16px; flex: 1; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--teal-light); color: var(--navy2); font-weight: 600; }
table.res { width: 100%; border-collapse: collapse; font-size: 13px; }
.props table.res td { padding: 3px 2px; }
.props table.res input { width: 100%; padding: 4px 6px; border: 1px solid #c4ccd6; border-radius: 5px; }
.box { background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-size: 12px; color: #3d4752; margin-top: 14px; }
.box code { background: #fff; border: 1px solid var(--line); border-radius: 3px; padding: 0 3px; }

/* Unterer Bereich: Ergebnisse / Szenarien */
.drawer { height: 44vh; min-height: 160px; background: #fff; border-top: 3px solid var(--teal); display: flex; flex-direction: column; }
.drawer.min { height: 46px; min-height: 46px; }
.drawer.min .drawerBody { display: none; }
.drawerHead { display: flex; align-items: center; gap: 8px; padding: 6px 16px; border-bottom: 1px solid var(--line); }
.tab { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; font-weight: 600; color: var(--muted); padding: 6px 10px; font-size: 15px; }
.tab.active { color: var(--teal-dark); border-bottom-color: var(--teal); }
.tab:hover { color: var(--teal-dark); }
.spacer { flex: 1; }
.drawerBody { overflow: auto; padding: 4px 16px 16px; flex: 1; }
.resInfo { color: var(--muted); font-size: 12px; margin: 6px 0 4px; }
.resExplain { font-size: 12px; color: #3d4752; background: var(--teal-light); border-radius: 6px; padding: 6px 10px; margin: 4px 0 8px; }
.resExplain a { color: var(--teal-dark); font-weight: 600; }
td.kpi { cursor: help; }
.resGrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 16px; align-content: start; }
.resGroup h4 { margin: 8px 0 4px; color: var(--teal); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.resGroup table, table.cmp { width: 100%; border-collapse: collapse; font-size: 13px; }
.resGroup th, table.cmp th { white-space: nowrap; text-align: right; font-weight: 600; color: var(--muted); font-size: 11px; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.resGroup th:first-child, table.cmp th:first-child { text-align: left; }
.resGroup td, table.cmp td { padding: 3px 6px; border-bottom: 1px solid #f1f3f5; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.resGroup td:first-child, table.cmp td:first-child { text-align: left; white-space: normal; }
.resGroup tr.obj td, table.cmp tr.obj td { background: #f8fafa; font-weight: 700; color: var(--teal-dark); text-align: left; padding-top: 6px; }
table.cmp tr.grp td { text-align: left; color: var(--teal); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; padding-top: 12px; border-bottom: 1px solid var(--line); }
table.cmp td .delta { display: block; color: var(--muted); font-size: 11px; }
.mbar { display: block; height: 4px; background: #eef1f1; border-radius: 2px; margin-top: 2px; overflow: hidden; }
.mbar i { display: block; height: 100%; background: #7fb8b5; margin-left: auto; }
.bar { display: inline-block; width: 60px; height: 8px; background: #e9ecef; border-radius: 4px; overflow: hidden; vertical-align: middle; margin-left: 6px; }
.bar i { display: block; height: 100%; background: var(--ok); }
.bar i.hi { background: #f08c00; } .bar i.vhi { background: var(--err); }
.muted { color: var(--muted); }
.scroll { overflow-x: auto; }
table.scen { border-collapse: collapse; font-size: 13px; margin-top: 6px; }
table.scen th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 600; padding: 4px 6px; white-space: nowrap; }
table.scen td { padding: 3px 6px; }
table.scen input { padding: 5px 7px; border: 1px solid #c4ccd6; border-radius: 5px; width: 190px; }
table.scen input.num { width: 90px; text-align: right; }
table.scen input::placeholder { color: #a8b1ba; }
.drawerBody button.primary { padding: 6px 14px; }

/* Sprachschalter wie auf wibfin.de */
.lang-switch { margin-left: auto; display: flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 600; letter-spacing: .04em; }
.lang-switch a { padding: 4px 5px; border-radius: 4px; color: #555; text-decoration: none; }
.lang-switch a:hover { color: var(--teal); }
.lang-switch a.is-active { color: var(--teal-dark); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.lang-switch__sep { color: rgba(0,0,0,.25); }

/* Eigenschaften: Ergänzungen */
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; font-weight: 600; color: #3d4752; margin: 4px 0 12px; cursor: pointer; }
.check input { margin-top: 2px; }
.assignRow { border: 1px solid var(--line); border-radius: 8px; padding: 8px 8px 0; margin-bottom: 8px; background: #fcfdfd; }
.assignRow .field { margin-bottom: 8px; }
.pill { display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 10px; background: var(--teal-light); color: var(--teal-dark); white-space: nowrap; }
.tiny { display: block; font-size: 10px; color: #c92a2a; margin-top: 1px; }
.nowrap { white-space: nowrap; }
.props table.res th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 600; }

/* Animation */
.animBar { flex: none; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
           padding: 8px 12px; background: rgba(232,241,241,.96); border-bottom: 1px solid rgba(46,108,107,.25); font-size: 13px; }
.animBar .speed { display: flex; align-items: center; gap: 6px; color: var(--teal-dark); font-weight: 600; }
.animBar .speed input { width: 130px; accent-color: var(--teal); }
.animBar .clock { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--teal-dark); min-width: 170px; }
.animProg { width: 120px; height: 6px; background: #fff; border-radius: 3px; overflow: hidden; border: 1px solid rgba(46,108,107,.25); }
.animProg i { display: block; height: 100%; width: 0; background: var(--teal); }
.animBar .vars { color: #3d4752; font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; width: 100%; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; }
.legend i.rs { border-radius: 3px; }
.rs.idle { fill: #2f9e44; background: #2f9e44; } .rs.busy { fill: #f08c00; background: #f08c00; }
.rs.failed { fill: #e03131; background: #e03131; } .rs.off { fill: #adb5bd; background: #adb5bd; }
.animTxt { font-size: 11px; font-weight: 600; fill: var(--teal-dark); }
body.locked .palette { opacity: .45; pointer-events: none; }
body.locked .props { opacity: .55; pointer-events: none; }
body.locked .node { cursor: default; }

@media (max-width: 900px) {
  html, body { height: auto; }
  body { overflow: auto; display: block; }
  .topbar { flex-wrap: nowrap; overflow-x: auto; gap: 10px; padding: 6px 10px; }
  .brand { flex: none; }
  .brand small { display: none; }
  .brand strong { font-size: 13px; white-space: nowrap; }
  .logo { height: 30px; }
  .toolbar { flex-wrap: nowrap; }
  .toolbar button, .toolbar select { white-space: nowrap; padding: 6px 10px; }
  .toolbar select { max-width: 150px; }
  .lang-switch { margin-left: 0; flex: none; order: -1; }
  .brand { order: -2; }
  .layout { display: flex; flex-direction: column; }
  .palette { order: 1; padding: 6px 10px; border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .palette h3, .palette .hint, .palette .help, .palette .legal { display: none; }
  #paletteItems { display: flex; gap: 6px; overflow-x: auto; }
  .palItem { flex: none; margin: 0; padding: 4px 8px; gap: 6px; }
  .palItem small { display: none; }
  .canvasArea { order: 2; height: 52vh; min-height: 300px; }
  .props { order: 3; border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
  .drawer { height: auto; min-height: 0; }
  .drawerBody { max-height: 75vh; padding: 4px 10px 14px; }
  .drawerHead { flex-wrap: wrap; padding: 6px 10px; }
  .resGrid { grid-template-columns: minmax(0, 1fr); }
  .resGroup { overflow-x: auto; }
  .animBar { gap: 6px 10px; padding: 6px 8px; }
  .animBar .speed input { width: 90px; }
  .animBar .clock { min-width: 0; }
  .animProg { display: none; }
  .resultsHead, .banner { padding: 8px 10px; }
}
