:root {
  --bg: #0f1419; --card: #1a212b; --muted: #8b97a7; --fg: #e6edf3;
  --accent: #4f8cff; --pos: #2ec16b; --neg: #ff5d5d; --border: #283341;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg); color: var(--fg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar { display: flex; justify-content: space-between; align-items: center;
  padding: .7rem 1.2rem; background: var(--card); border-bottom: 1px solid var(--border); }
.topbar .brand { font-weight: 700; font-size: 1.05rem; }
.topbar nav a { margin-left: 1rem; color: var(--fg); }
.container { max-width: 1200px; margin: 1.5rem auto; padding: 0 1rem; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 1rem 1.2rem; margin-bottom: 1.2rem; }
h1 { font-size: 1.4rem; } h2 { font-size: 1.15rem; margin-top: 0; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; }
.kpi { background: #131922; border: 1px solid var(--border); border-radius: 8px; padding: .6rem .8rem; }
.kpi .label { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 1.15rem; font-weight: 600; margin-top: .2rem; }

table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th, td { text-align: right; padding: .45rem .55rem; border-bottom: 1px solid var(--border); }
th:first-child, td:first-child { text-align: left; }
thead th { color: var(--muted); font-weight: 600; position: sticky; top: 0; background: var(--card); }
.table-wrap { overflow-x: auto; }

.pos { color: var(--pos); } .neg { color: var(--neg); } .neutral { color: var(--muted); }

.btn { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 7px;
  padding: .5rem .9rem; cursor: pointer; font-size: .85rem; }
.btn.secondary { background: #2a3340; }
.btn.danger { background: var(--neg); }
.btn.small { padding: .3rem .6rem; font-size: .78rem; }

input, select, textarea { width: 100%; padding: .5rem .6rem; background: #0f141b; color: var(--fg);
  border: 1px solid var(--border); border-radius: 6px; margin-top: .25rem; }
label { display: block; margin-bottom: .6rem; font-size: .85rem; color: var(--muted); }
.row { display: flex; gap: .8rem; flex-wrap: wrap; } .row > * { flex: 1; }

.tagpill { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .72rem;
  color: #fff; margin: 0 .2rem .2rem 0; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: flex-start; justify-content: center; padding-top: 6vh; z-index: 50; }
.modal-backdrop[hidden] { display: none; }
.modal { background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  width: min(560px, 92vw); max-height: 84vh; overflow-y: auto; padding: 1.3rem; }

.newsticker { background: #131922; border: 1px solid var(--border); border-radius: 8px;
  padding: .55rem .8rem; font-size: .85rem; color: var(--muted); }
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: end; margin-bottom: 1rem; }
.muted { color: var(--muted); } .err { color: var(--neg); }
.chat-log { background: #0f141b; border: 1px solid var(--border); border-radius: 8px;
  padding: .8rem; min-height: 80px; white-space: pre-wrap; font-size: .88rem; }

/* --- Investmentberater-Sidebar (global, links, mausbreiten-skalierbar) --- */
.advisor-sidebar { position: fixed; top: 0; left: 0; height: 100vh;
  width: var(--advisor-w, 320px); min-width: 220px; max-width: 70vw;
  background: #0d1117; border-right: 1px solid var(--border); z-index: 40;
  display: flex; flex-direction: column; transition: transform .15s ease; }
.advisor-sidebar.collapsed { transform: translateX(-100%); }
.advisor-resizer { position: absolute; top: 0; right: -3px; width: 6px; height: 100%;
  cursor: ew-resize; background: transparent; }
.advisor-resizer:hover { background: var(--border); }
.advisor-panel { display: flex; flex-direction: column; height: 100%; }
.advisor-header { height: 10%; min-height: 44px; display: flex; align-items: center;
  justify-content: space-between; gap: .4rem; padding: .4rem .6rem;
  border-bottom: 1px solid var(--border); }
.advisor-body { height: 90%; display: flex; flex-direction: column; overflow: hidden; }
.advisor-threads { max-height: 22%; overflow-y: auto; border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; }
.advisor-thread-link { padding: .35rem .6rem; font-size: .82rem; cursor: pointer;
  color: var(--muted); border-bottom: 1px solid #11161d; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.advisor-thread-link:hover, .advisor-thread-link.active { color: #fff; background: #11161d; }
.advisor-thread { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.advisor-history { flex: 1; overflow-y: auto; padding: .5rem; }
.advisor-msg { margin-bottom: .6rem; }
.advisor-msg .advisor-role { font-size: .7rem; color: var(--muted); text-transform: uppercase; }
.advisor-msg.user .advisor-content { background: #15202b; }
.advisor-msg.assistant .advisor-content { background: #0f141b; }
.advisor-content { white-space: pre-wrap; padding: .45rem .6rem; border-radius: 8px;
  border: 1px solid var(--border); font-size: .86rem; }
.advisor-input { display: flex; gap: .4rem; padding: .5rem; border-top: 1px solid var(--border); }
.advisor-input textarea { flex: 1; resize: none; }
.advisor-toggle { position: fixed; bottom: 1rem; left: 1rem; z-index: 41;
  border-radius: 50%; width: 44px; height: 44px; font-size: 1.2rem; cursor: pointer;
  background: var(--accent, #2563eb); color: #fff; border: none; }
