/* ---------------------------------------------------------------------------
   Potenzial-Auswertung im Kundenkatalog: Jahresbeitraege je Sparte.
   Farben der Sparten sind gegen Farbfehlsichtigkeit geprueft (hell + dunkel
   getrennte Werte); Nachbarn im Kuchen halten sicheren Abstand.
   --------------------------------------------------------------------------- */
:root {
  --s-kfz:#2a78d6; --s-vhv:#eb6834; --s-vgv:#1baf7a; --s-h:#eda100; --s-rs:#e87ba4;
  --s-u:#008300; --s-l:#4a3aa7; --s-kv:#e34948; --s-g:#00a2b8; --s-acv:#96581c;
  --s-rest:#898781;
}
[data-theme="dark"] {
  --s-kfz:#3987e5; --s-vhv:#d95926; --s-vgv:#199e70; --s-h:#c98500; --s-rs:#d55181;
  --s-u:#008300; --s-l:#9085e9; --s-kv:#e66767; --s-g:#17a3b8; --s-acv:#b57a2e;
  --s-rest:#a09e94;
}

/* Die Reiter des Kundenkatalogs stehen jetzt als .kdb-subtabs in manager-ui.css
   (weisse Menuebox wie .ropt-subtabs). Die alte .kdb-tabs-Leiste ist entfallen. */

/* --- KPI-Kacheln ----------------------------------------------------------- */
.pot-kpis { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:14px; margin-bottom:16px; }
.pot-kpi {
  background:var(--vm-surface); border:1px solid var(--vm-border); border-radius:18px;
  padding:15px 18px; box-shadow:var(--vm-card-shadow); position:relative; overflow:hidden;
}
.pot-kpi::before { content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--vm-primary); opacity:.85; }
.pot-kpi.gold::before { background:var(--vm-accent); }
.pot-kpi .lbl { font-size:11.5px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--vm-muted); }
.pot-kpi .val { font-size:27px; font-weight:800; letter-spacing:-.025em; margin-top:4px; font-variant-numeric:tabular-nums; }
.pot-kpi .sub { font-size:12.5px; color:var(--vm-muted); margin-top:3px; }

/* --- Werkzeugleiste -------------------------------------------------------- */
.pot-leiste { display:flex; gap:12px; flex-wrap:wrap; align-items:center; margin-bottom:16px; }
.pot-leiste select {
  padding:9px 12px; border:1px solid var(--vm-border); border-radius:10px;
  background:var(--vm-surface); color:var(--vm-text); font:inherit; font-size:13.5px;
}
.pot-export {
  margin-left:auto; border:1px solid color-mix(in srgb, var(--vm-primary) 40%, transparent);
  background:var(--vm-primary-soft); color:var(--vm-primary-strong); font:inherit;
  font-weight:700; font-size:13.5px; padding:10px 16px; border-radius:11px; cursor:pointer;
}
.pot-export:hover:not(:disabled) { background:color-mix(in srgb, var(--vm-primary) 22%, var(--vm-surface)); }
.pot-export:disabled { opacity:.6; cursor:default; }

/* --- Karten ---------------------------------------------------------------- */
.pot-bento { display:grid; grid-template-columns:minmax(0,1.8fr) minmax(0,1fr); gap:16px; margin-bottom:16px; }
@media (max-width:1180px) { .pot-bento { grid-template-columns:1fr; } }
.pot-card {
  background:var(--vm-surface); border:1px solid var(--vm-border); border-radius:20px;
  box-shadow:var(--vm-card-shadow); padding:18px 20px 20px; container-type:inline-size;
}
.pot-card > h3 { margin:0 0 2px; font-size:16.5px; letter-spacing:-.01em; }
.pot-card > .cap { margin:0 0 14px; font-size:12.5px; color:var(--vm-muted); }

/* Kuchen + Legende */
.pot-chart { display:grid; grid-template-columns:minmax(0,1fr) 230px; gap:6px; align-items:center; }
@container (max-width:600px) {
  .pot-chart { grid-template-columns:1fr; }
  .pot-legende { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:1px; }
}
.pot-svg { width:100%; height:auto; display:block; overflow:visible; }
.pot-svg .seg-top, .pot-svg .seg-side { cursor:pointer; transition:transform .22s cubic-bezier(.34,1.3,.64,1); }
.pot-legende { display:flex; flex-direction:column; gap:1px; }
.pot-legende button {
  display:grid; grid-template-columns:12px 1fr auto; gap:9px; align-items:center;
  border:1px solid transparent; background:none; font:inherit; text-align:left;
  padding:6px 9px; border-radius:10px; cursor:pointer; color:inherit; width:100%;
}
.pot-legende button:hover, .pot-legende button.an { background:var(--vm-surface-3); border-color:var(--vm-border); }
.pot-legende .dot { width:12px; height:12px; border-radius:4px; }
.pot-legende .nm { font-size:13.5px; font-weight:620; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pot-legende .vl { font-size:13px; font-weight:750; letter-spacing:-.01em; font-variant-numeric:tabular-nums; }

/* Hebel-Karte */
.pot-hebel { display:flex; flex-direction:column; gap:12px; }
.pot-hebel-top { border-radius:16px; padding:16px 18px; background:var(--vm-surface-3); border:1px solid var(--vm-border); }
.pot-hebel-top .nm { display:flex; align-items:center; gap:9px; font-weight:750; font-size:15px; }
.pot-hebel-top .big { font-size:30px; font-weight:850; letter-spacing:-.03em; margin:7px 0 2px; font-variant-numeric:tabular-nums; }
.pot-hebel-top .sub { font-size:12.5px; color:var(--vm-muted); }
.pot-mini { display:flex; flex-direction:column; gap:8px; }
.pot-mini .row { display:grid; grid-template-columns:1fr auto; gap:5px; font-size:13px; }
.pot-mini .row b { font-weight:750; font-variant-numeric:tabular-nums; }
.pot-mini .bar { grid-column:1/3; height:7px; border-radius:4px; background:var(--vm-surface-2); overflow:hidden; }
.pot-mini .bar i { display:block; height:100%; border-radius:4px; }

/* --- Tabelle --------------------------------------------------------------- */
.pot-tabwrap { overflow-x:auto; }
.pot-tab { width:100%; min-width:620px; border-collapse:separate; border-spacing:0 4px; }
.pot-tab th {
  font-size:11.5px; font-weight:750; letter-spacing:.06em; text-transform:uppercase;
  color:var(--vm-muted); text-align:right; padding:0 12px 8px; white-space:nowrap; cursor:pointer; user-select:none;
}
.pot-tab th:first-child, .pot-tab td:first-child { text-align:left; }
.pot-tab th .arr { opacity:.35; font-size:10px; }
.pot-tab th.sorted .arr { opacity:1; color:var(--vm-primary); }
.pot-tab tbody tr { background:var(--vm-surface-3); cursor:pointer; }
.pot-tab tbody tr:hover { background:var(--vm-surface-2); }
.pot-tab tbody tr.an { background:var(--vm-primary-soft); }
.pot-tab td {
  padding:11px 12px; text-align:right; font-size:14px; font-variant-numeric:tabular-nums;
  border-top:1px solid var(--vm-border); border-bottom:1px solid var(--vm-border);
}
.pot-tab td:first-child { border-left:1px solid var(--vm-border); border-radius:12px 0 0 12px; }
.pot-tab td:last-child { border-right:1px solid var(--vm-border); border-radius:0 12px 12px 0; }
.pot-sp { display:flex; align-items:center; gap:10px; font-weight:640; }
.pot-sp i { width:11px; height:11px; border-radius:4px; flex:none; }
.pot-sp small { color:var(--vm-muted); font-weight:500; }
.pot-anteil { display:flex; align-items:center; gap:10px; justify-content:flex-end; }
.pot-anteil .track { width:104px; height:8px; border-radius:5px; background:var(--vm-surface-2); overflow:hidden; flex:none; }
.pot-anteil .track i { display:block; height:100%; border-radius:5px; }
.pot-euro { font-weight:750; letter-spacing:-.01em; }
.pot-tab tr.detail td { background:var(--vm-surface); font-size:13px; text-align:left; color:var(--vm-muted); }
.pot-tab tr.detail ul { margin:2px 0 0; padding-left:18px; columns:2; column-gap:28px; }
@media (max-width:700px) { .pot-tab tr.detail ul { columns:1; } }
.pot-tab tr.detail a { color:var(--vm-primary-strong); font-weight:640; cursor:pointer; text-decoration:none; }
.pot-tab tr.detail a:hover { text-decoration:underline; }
.pot-tab tfoot td { background:none; border:0; font-weight:800; font-size:14.5px; padding-top:12px; }

/* --- Hinweis --------------------------------------------------------------- */
.pot-hinweis {
  margin-top:16px; border-radius:18px; padding:15px 20px; background:var(--vm-surface);
  border:1px solid var(--vm-border); box-shadow:var(--vm-card-shadow);
}
.pot-hinweis h4 { margin:0 0 7px; font-size:14px; }
.pot-hinweis ul { margin:0; padding-left:20px; font-size:13px; color:var(--vm-muted); }
.pot-hinweis li { margin-bottom:3px; }
.pot-hinweis b { color:var(--vm-text); }
.pot-leer { padding:26px; text-align:center; color:var(--vm-muted); }

/* --- Tooltip --------------------------------------------------------------- */
#potTip {
  position:fixed; z-index:60; pointer-events:none; opacity:0; transition:opacity .12s;
  background:var(--vm-text); color:var(--vm-surface); padding:9px 12px; border-radius:11px;
  font-size:13px; line-height:1.45; box-shadow:0 10px 30px rgba(0,0,0,.3); max-width:250px;
}
#potTip b { display:block; font-size:13.5px; margin-bottom:2px; }
#potTip .z { font-weight:750; font-size:15px; }

@media (max-width:760px) {
  .pot-kpis { grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:10px; }
  .pot-kpi .val { font-size:22px; }
  .pot-card { padding:15px 14px 16px; }
  .pot-export { margin-left:0; width:100%; }
}
