/* ─────────────────────────────────────────  RESET & TOKENS  ───────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(0,0,0,.18); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.32); background-clip: padding-box; border: 2px solid transparent; }

:root {
  /* Backgrounds */
  --bg:           #ffffff;            /* pures Weiss – heller Content-Bereich */
  --bg-sidebar:   #f5f5f7;            /* Apple-Grau für die Sidebar (macOS Finder-Stil) */
  --bg-card:      #ffffff;            /* Karten weiss */
  --bg-input:     #f5f5f7;            /* Eingabefelder mit dezentem Grau */
  --bg-hover:     rgba(0,0,0,.045);   /* dezenter Hover */
  --bg-active:    rgba(0,0,0,.07);

  /* Text */
  --text:         #1d1d1f;            /* Apple near-black */
  --text-secondary:#424245;
  --text-muted:   #6e6e73;
  --text-dim:     #86868b;
  --text-on-accent:#ffffff;

  /* Borders */
  --border:       rgba(0,0,0,.08);
  --border-light: rgba(0,0,0,.05);
  --border-strong:rgba(0,0,0,.14);

  /* Accent (Apple Blue) */
  --accent:       #0071e3;
  --accent-hover: #0077ed;
  --accent-glow:  rgba(0,113,227,.15);
  --accent-soft:  rgba(0,113,227,.1);

  /* Status */
  --positive:     #1f8a4c;
  --positive-bg:  rgba(52,199,89,.14);
  --positive-border: rgba(52,199,89,.28);

  --negative:     #d93025;
  --negative-bg:  rgba(255,59,48,.1);
  --negative-border: rgba(255,59,48,.25);

  --warning:      #b25000;
  --warning-bg:   rgba(255,149,0,.13);
  --warning-border:rgba(255,149,0,.28);

  --info:         #0071e3;
  --info-bg:      rgba(0,113,227,.1);
  --info-border:  rgba(0,113,227,.22);

  /* Radii */
  --radius-sm:    6px;
  --radius:       10px;
  --radius-lg:    14px;
  --radius-xl:    18px;

  /* Shadows */
  --shadow-sm:    0 1px 2px rgba(0,0,0,.04);
  --shadow:       0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:    0 4px 12px rgba(0,0,0,.06), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg:    0 12px 32px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.06);
  --shadow-xl:    0 24px 60px rgba(0,0,0,.18), 0 8px 16px rgba(0,0,0,.08);

  /* Layout */
  --sidebar-w:    240px;

  /* Type */
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", system-ui, sans-serif;
  --font-body:    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  --font-mono:    "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Monaco, Consolas, monospace;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

button { background: none; border: 0; color: inherit; cursor: pointer; font: inherit; -webkit-appearance: none; }
a { color: inherit; text-decoration: none; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

.mono { font-family: var(--font-mono); font-feature-settings: "tnum"; }

.dim { color: var(--text-dim); }
.muted { color: var(--text-muted); }
.pos { color: var(--positive); }
.neg { color: var(--negative); }
.warn { color: var(--warning); }

::selection { background: var(--accent-glow); color: var(--text); }

/* ─────────────────────────────────────────  LAYOUT  ───────────────────────────────────────── */
#app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .28s cubic-bezier(.4,0,.2,1);
}

.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 22px 18px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--text);
}
.logo-icon {
  font-size: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent) 0%, #5e9eff 100%);
  border-radius: 9px;
  box-shadow: 0 2px 6px rgba(0,113,227,.3);
  color: #fff;
  font-size: 16px;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background .15s, color .15s;
}
.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.nav-icon {
  font-size: 14px;
  width: 18px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-footer {
  padding: 12px 14px 18px;
  border-top: 1px solid var(--border);
}
.btn-refresh {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  transition: all .15s;
  box-shadow: var(--shadow-sm);
}
.btn-refresh:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,113,227,.25);
}
.last-update {
  margin-top: 8px;
  font-size: 10.5px;
  color: var(--text-dim);
  text-align: center;
}

.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left .28s cubic-bezier(.4,0,.2,1);
}
body.sidebar-collapsed .sidebar { transform: translateX(-100%); }
body.sidebar-collapsed .main { margin-left: 0; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.75);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar h1 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -.015em;
  color: var(--text);
}
.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  font-size: 16px;
  color: var(--text-muted);
  border-radius: 8px;
  transition: all .15s;
}
.menu-toggle:hover { background: var(--bg-hover); color: var(--text); }

.topbar-right { display: flex; gap: 8px; align-items: center; }

.content-area { padding: 28px; flex: 1; min-width: 0; }
.loading {
  text-align: center;
  padding: 60px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ─────────────────────────────────────────  CARDS  ───────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.card-scrollable { overflow: visible; }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  gap: 10px;
  flex-wrap: wrap;
}
.card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -.01em;
  color: var(--text);
}
.card-header-actions { display: flex; gap: 10px; align-items: center; }
.card-body { padding: 20px; }

.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--text-muted);
}
.empty-icon { font-size: 38px; margin-bottom: 14px; opacity: .35; }
.empty-state p { margin-bottom: 16px; font-size: 14px; }

/* ─────────────────────────────────────────  BUTTONS  ───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -.005em;
  transition: all .15s ease;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 1px 2px rgba(0,113,227,.25);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 2px 6px rgba(0,113,227,.3);
}

.btn-ghost {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { background: var(--bg-hover); border-color: var(--border-strong); }

.btn-danger {
  background: var(--negative-bg);
  border-color: var(--negative-border);
  color: var(--negative);
}
.btn-danger:hover {
  background: rgba(255,59,48,.18);
  border-color: rgba(255,59,48,.4);
}

.btn-sm { padding: 5px 11px; font-size: 12px; }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  color: var(--text-muted);
  transition: all .15s;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text); }
.action-group { display: flex; gap: 2px; justify-content: flex-end; }

.btn-close {
  font-size: 16px;
  color: var(--text-muted);
  width: 32px; height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.btn-close:hover { background: var(--bg-hover); color: var(--text); }

/* ─────────────────────────────────────────  FORMS  ───────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: -.005em;
}
.form-hint { margin-top: 5px; font-size: 11.5px; color: var(--text-dim); }

input[type="text"], input[type="number"], input[type="date"], select, textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  font-size: 13.5px;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { background: rgba(0,0,0,.06); }
input:focus, select:focus, textarea:focus {
  background: var(--bg-card);
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-glow);
}
textarea { resize: vertical; min-height: 80px; font-family: inherit; }
select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%236e6e73' d='M6 8.5L2.5 5h7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  -webkit-appearance: none;
  appearance: none;
  padding-right: 32px;
}

.input-with-btn { display: flex; gap: 8px; }
.input-with-btn input { flex: 1; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border-light);
}

/* Checkboxen */
input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ─────────────────────────────────────────  TABLE  ───────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: right;
  padding: 11px 14px;
  background: rgba(0,0,0,.025);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text-muted);
  text-transform: uppercase;
  white-space: nowrap;
}
th.left, th:first-child { text-align: left; }
td {
  text-align: right;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13.5px;
  vertical-align: middle;
  color: var(--text);
}
td.left, td:first-child { text-align: left; }
tr { transition: background .12s; }
tr:hover td { background: rgba(0,0,0,.022); }
tr:last-child td { border-bottom: 0; }

.stock-cell { display: flex; flex-direction: column; gap: 2px; }
.stock-name { font-weight: 600; color: var(--text); letter-spacing: -.005em; }
.stock-symbol { font-size: 11.5px; color: var(--text-dim); font-family: var(--font-mono); }

.inline-edit {
  width: 100%;
  min-width: 70px;
  max-width: 95px;
  padding: 5px 8px;
  font-size: 12.5px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text);
  text-align: right;
  font-family: var(--font-mono);
  transition: all .15s;
}
.inline-edit::placeholder { color: var(--text-dim); font-style: italic; }
.inline-edit:hover { background: var(--bg-hover); }
.inline-edit:focus {
  background: var(--bg-card);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  outline: none;
}

/* ─────────────────────────────────────────  STATUS PILLS  ───────────────────────────────────────── */
.strat-status { display: flex; flex-direction: column; gap: 6px; min-width: 170px; }
.strat-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -.005em;
  white-space: nowrap;
  width: fit-content;
  border: 1px solid transparent;
}
.strat-erreicht {
  background: var(--positive-bg);
  color: var(--positive);
  border-color: var(--positive-border);
  animation: strat-pulse 2.4s ease-in-out infinite;
}
@keyframes strat-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52,199,89,.3); }
  50%      { box-shadow: 0 0 0 5px rgba(52,199,89,0); }
}
.strat-nah         { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }
.strat-naeher      { background: var(--info-bg);    color: var(--info);    border-color: var(--info-border); }
.strat-warten      { background: rgba(0,0,0,.05);   color: var(--text-muted); border-color: var(--border); }
.strat-gegen       { background: var(--negative-bg);color: var(--negative);border-color: var(--negative-border); }
.strat-leer        { background: transparent;       color: var(--text-dim); border: 1px dashed var(--border-strong); }
.strat-action      { cursor: pointer; transition: all .15s; }
.strat-action:hover { border-color: var(--accent); color: var(--accent); border-style: solid; }

.strat-bar {
  position: relative;
  height: 5px;
  background: rgba(0,0,0,.06);
  border-radius: 999px;
  overflow: hidden;
}
.strat-bar-fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  border-radius: 999px;
  transition: width .35s cubic-bezier(.4,0,.2,1);
}
.strat-bar-fill-erreicht    { background: var(--positive); }
.strat-bar-fill-ziel_nah    { background: var(--warning); }
.strat-bar-fill-annaeherung { background: var(--info); }
.strat-bar-fill-warten      { background: var(--text-muted); }
.strat-bar-fill-gegen_trend { background: var(--negative); }
.strat-bar-target { position: absolute; top: -2px; bottom: -2px; left: 66.66%; width: 1.5px; background: var(--text-muted); border-radius: 1px; }
.strat-bar-label { font-size: 10.5px; color: var(--text-muted); font-family: var(--font-mono); }

/* ─────────────────────────────────────────  MINI CHARTS  ───────────────────────────────────────── */
.mini-chart {
  width: 120px;
  height: 36px;
  display: block;
}
.mini-chart-line { fill: none; stroke-width: 1.6; }
.mini-chart-line.pos { stroke: var(--positive); }
.mini-chart-line.neg { stroke: var(--negative); }
.mini-chart-area.pos { fill: rgba(52,199,89,.12); }
.mini-chart-area.neg { fill: rgba(255,59,48,.1); }

/* ─────────────────────────────────────────  SCHWELLEN-CHIPS  ───────────────────────────────────────── */
.schwellen-chips { display: flex; gap: 5px; flex-wrap: wrap; min-width: 120px; }
.schwelle-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2.5px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s;
}
.schwelle-chip-drawdown {
  background: var(--info-bg);
  color: var(--info);
  border-color: var(--info-border);
}
.schwelle-chip-anstieg {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: var(--warning-border);
}
.schwelle-chip.erreicht {
  background: var(--positive-bg);
  color: var(--positive);
  border-color: var(--positive-border);
}
.schwelle-chip.inaktiv { opacity: .42; text-decoration: line-through; }
.schwelle-add {
  border: 1px dashed var(--border-strong);
  color: var(--text-dim);
  padding: 1.5px 7px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  transition: all .15s;
}
.schwelle-add:hover { color: var(--accent); border-color: var(--accent); border-style: solid; }

/* ─────────────────────────────────────────  COL-MENU  ───────────────────────────────────────── */
.col-settings { position: relative; }
.col-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 230px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 10px 12px;
  z-index: 50;
}
.col-menu-title {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding-bottom: 8px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
}
.col-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 6px;
  cursor: pointer;
  font-size: 13px;
  border-radius: 6px;
}
.col-menu-item:hover { background: var(--bg-hover); }
.col-menu-item input[type="checkbox"] { margin: 0; accent-color: var(--accent); }

/* ─────────────────────────────────────────  WL-TABLE (sticky)  ───────────────────────────────────────── */
.wl-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  position: relative;
}
.wl-table { width: max-content; min-width: 100%; }
.wl-table th { white-space: normal; line-height: 1.25; vertical-align: bottom; min-width: 90px; }
.wl-table th.wl-col-status { min-width: 200px; }
.wl-table th.wl-col-chart { min-width: 130px; }
.wl-table th.wl-col-schwellen { min-width: 140px; }

.wl-table th.wl-sticky,
.wl-table td.wl-sticky {
  position: sticky;
  left: 0;
  z-index: 5;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  min-width: 160px;
  max-width: 220px;
}
.wl-table th.wl-sticky { background: rgba(255,255,255,.96); backdrop-filter: blur(8px); z-index: 6; }
.wl-table tr:hover td.wl-sticky { background: rgba(0,0,0,.022); }
.wl-table td.wl-sticky::after,
.wl-table th.wl-sticky::after {
  content: "";
  position: absolute;
  top: 0; right: -8px; bottom: 0;
  width: 8px;
  background: linear-gradient(to right, rgba(0,0,0,.06), transparent);
  pointer-events: none;
}

.wl-actions-col { min-width: 100px; text-align: right; }

/* ─────────────────────────────────────────  DASHBOARD  ───────────────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.dash-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-md);
  transition: transform .2s, box-shadow .2s;
}
.dash-stat:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.dash-stat-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.dash-stat-value {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -.02em;
  font-family: var(--font-display);
  color: var(--text);
  font-feature-settings: "tnum";
}
.dash-stat-sub { font-size: 12px; color: var(--text-dim); margin-top: 6px; }

.treffer-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all .18s;
  box-shadow: var(--shadow);
}
.treffer-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.treffer-card-erreicht {
  border-color: var(--positive-border);
  background: linear-gradient(to right, rgba(52,199,89,.06), var(--bg-card) 60%);
}
.treffer-info { flex: 1; }
.treffer-name { font-weight: 600; margin-bottom: 2px; letter-spacing: -.005em; }
.treffer-symbol { font-size: 11.5px; color: var(--text-dim); font-family: var(--font-mono); }
.treffer-numbers { display: flex; gap: 18px; font-size: 12.5px; }
.treffer-numbers > div { text-align: right; }
.treffer-numbers-label { color: var(--text-dim); font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }

/* ─────────────────────────────────────────  TAGEBUCH  ───────────────────────────────────────── */
.tagebuch-list { display: flex; flex-direction: column; gap: 10px; }
.tagebuch-eintrag {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--text-dim);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
}
.tagebuch-kategorie-analyse      { border-left-color: var(--info); }
.tagebuch-kategorie-entscheidung { border-left-color: var(--warning); }
.tagebuch-kategorie-beobachtung  { border-left-color: var(--text-muted); }

.tagebuch-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
}
.tagebuch-kat-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
}
.tagebuch-kat-analyse      { background: var(--info-bg);     color: var(--info); }
.tagebuch-kat-entscheidung { background: var(--warning-bg);  color: var(--warning); }
.tagebuch-kat-beobachtung  { background: rgba(0,0,0,.05);    color: var(--text-muted); }
.tagebuch-text { white-space: pre-wrap; font-size: 13.5px; line-height: 1.55; color: var(--text); }
.tagebuch-actions { margin-top: 6px; display: flex; gap: 4px; justify-content: flex-end; }

/* ─────────────────────────────────────────  COMPARE  ───────────────────────────────────────── */
.compare-table th, .compare-table td { text-align: left; }
.compare-table .metric-label { color: var(--text-muted); font-size: 11.5px; }
.compare-bar {
  display: inline-block;
  width: 64px;
  height: 5px;
  background: rgba(0,0,0,.06);
  border-radius: 999px;
  position: relative;
  margin-right: 8px;
  vertical-align: middle;
}
.compare-bar-fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}

.aktien-checkbox-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 0;
}
.aktien-check-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  box-shadow: var(--shadow-sm);
}
.aktien-check-pill:hover { border-color: var(--border-strong); }
.aktien-check-pill input { margin: 0; accent-color: var(--accent); }
.aktien-check-pill.selected {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* ─────────────────────────────────────────  MODAL  ───────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(8px) saturate(150%);
  -webkit-backdrop-filter: blur(8px) saturate(150%);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 20px;
  z-index: 1000;
  overflow-y: auto;
}
.modal-overlay.open {
  display: flex;
  animation: overlay-in .2s ease;
}
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%;
  max-width: 540px;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  animation: modal-in .26s cubic-bezier(.4,0,.2,1);
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-lg { max-width: 800px; }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-light);
}
.modal-header h2 {
  font-size: 17px;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -.015em;
  color: var(--text);
}
.modal-body { padding: 22px; }

.wl-divider {
  position: relative;
  text-align: center;
  margin: 22px 0 14px;
}
.wl-divider::before {
  content: "";
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: var(--border);
}
.wl-divider span {
  position: relative;
  display: inline-block;
  padding: 0 12px;
  background: var(--bg-card);
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 600;
}

/* ─────────────────────────────────────────  TOAST  ───────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 18px; right: 18px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
}
.toast {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  animation: toast-in .28s cubic-bezier(.4,0,.2,1);
}
@keyframes toast-in {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
.toast-icon { font-size: 14px; flex-shrink: 0; line-height: 1.4; }
.toast-success { border-left: 3px solid var(--positive); }
.toast-success .toast-icon { color: var(--positive); }
.toast-error { border-left: 3px solid var(--negative); }
.toast-error .toast-icon { color: var(--negative); }
.toast-info { border-left: 3px solid var(--info); }
.toast-info .toast-icon { color: var(--info); }

/* ─────────────────────────────────────────  RESPONSIVE  ───────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .content-area { padding: 18px; }
  .topbar { padding: 12px 18px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .modal { margin: 0; }
  .dash-stat-value { font-size: 26px; }
}

/* ─────────────────────────────────────────  SIDEBAR BOTTOM ACTIONS  ───────────────────────────────────────── */
.sidebar-bottom-actions {
  display: flex;
  gap: 6px;
  padding: 0 14px 12px;
  align-items: center;
}
.sidebar-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  font-size: 16px;
  cursor: pointer;
  transition: all .15s ease;
}
.sidebar-icon-btn:hover {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.sidebar-icon-btn:active { transform: scale(.94); }
.sidebar-icon-btn .gear { display: inline-block; transition: transform .35s ease; }
.sidebar-icon-btn:hover .gear { transform: rotate(45deg); }

/* ─────────────────────────────────────────  TABS  ───────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  padding: 4px;
  background: var(--bg-input);
  border-radius: 10px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.tab {
  flex: 1;
  min-width: 0;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  border: 1px solid transparent;
}
.tab:hover { color: var(--text); }
.tab.active {
  background: var(--bg-card);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  border-color: var(--border-light);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: tab-fade .2s ease; }
@keyframes tab-fade { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: translateY(0); } }

/* Settings: Sektion */
.settings-section {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-light);
}
.settings-section:last-child { border-bottom: 0; padding-bottom: 0; }
.settings-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -.01em;
}
.settings-section-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

/* Toggle-Switch (iOS-Stil) */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
}
.toggle-row-label {
  font-size: 13.5px;
  color: var(--text);
  flex: 1;
}
.toggle-row-sub {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(120,120,128,.32);
  border-radius: 999px;
  transition: background .25s;
}
.toggle-slider::before {
  content: "";
  position: absolute;
  height: 22px; width: 22px;
  left: 2px; top: 2px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,.2);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
.toggle input:checked + .toggle-slider { background: #34c759; }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* CSV Drop-Zone */
.drop-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  background: var(--bg-input);
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.drop-zone-icon { font-size: 32px; margin-bottom: 8px; opacity: .55; }
.drop-zone-title { font-weight: 600; margin-bottom: 4px; }
.drop-zone-hint { font-size: 12px; color: var(--text-muted); }
.drop-zone input[type="file"] { display: none; }

/* Import-Result Liste */
.import-result {
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--bg-input);
  border-radius: var(--radius);
}
.import-stat-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.import-stat {
  flex: 1;
  min-width: 100px;
  text-align: center;
  padding: 10px;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border-light);
}
.import-stat-num {
  font-size: 22px;
  font-weight: 600;
  font-family: var(--font-display);
  letter-spacing: -.01em;
}
.import-stat-label {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: 2px;
  font-weight: 600;
}
.import-stat.neu .import-stat-num { color: var(--positive); }
.import-stat.uebersprungen .import-stat-num { color: var(--warning); }
.import-stat.fehler .import-stat-num { color: var(--negative); }

.import-details {
  max-height: 240px;
  overflow-y: auto;
  font-size: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
}
.import-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border-light);
  gap: 10px;
}
.import-detail-row:last-child { border-bottom: 0; }
.import-detail-status {
  font-size: 10.5px;
  text-transform: uppercase;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}
.import-detail-status.neu { background: var(--positive-bg); color: var(--positive); }
.import-detail-status.uebersprungen { background: var(--warning-bg); color: var(--warning); }
.import-detail-status.fehler { background: var(--negative-bg); color: var(--negative); }

/* Backup-Liste */
.backup-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--bg-input);
  padding: 6px;
}
.backup-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
}
.backup-row-info { flex: 1; min-width: 0; }
.backup-row-name {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
}
.backup-row-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.backup-row-actions { display: flex; gap: 4px; }
.backup-counter {
  font-size: 11.5px;
  color: var(--text-muted);
  padding: 4px 10px;
  background: var(--bg-input);
  border-radius: 999px;
  font-weight: 500;
}

/* ─────────────────────────────────────────  PERFORMANCE-CELLS in Aktientabelle  ───────────────────────────────────────── */
.perf-cell {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  font-feature-settings: "tnum";
}
.perf-cell.pos { color: var(--positive); }
.perf-cell.neg { color: var(--negative); }
.perf-cell.dim { color: var(--text-dim); }
.trend-arrow {
  display: inline-block;
  font-size: 10px;
  transform: translateY(-1px);
}

/* Inline Mini-Trend-Sparkline */
.trend-spark {
  display: inline-block;
  width: 70px;
  height: 22px;
  vertical-align: middle;
}
.trend-spark .spark-line { fill: none; stroke-width: 1.5; }
.trend-spark .spark-line.pos { stroke: var(--positive); }
.trend-spark .spark-line.neg { stroke: var(--negative); }

/* ─────────────────────────────────────────  PDF-Action-Bereich  ───────────────────────────────────────── */
.report-info-box {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.report-info-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
}
.report-info-label { color: var(--text-muted); }
.report-info-value { color: var(--text); font-weight: 500; }

.report-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}


/* ─────────────────────────────────────────  SIGNAL & RISK BADGES  ───────────────────────────────────────── */
.signal-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: .02em;
  white-space: nowrap;
  font-family: var(--font-mono);
}
.signal-badge.kauf    { background: var(--positive-bg); color: var(--positive); }
.signal-badge.verkauf { background: var(--negative-bg); color: var(--negative); }
.signal-badge.neutral { background: rgba(120,120,128,.12); color: var(--text-muted); }
.signal-badge .sig-arrow { font-size: 9px; }

.risk-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}
.risk-badge.low  { background: var(--positive-bg); color: var(--positive); }
.risk-badge.mid  { background: rgba(120,120,128,.14); color: var(--text-muted); }
.risk-badge.high { background: var(--warning-bg); color: var(--warning); }
.risk-badge.crit { background: var(--negative-bg); color: var(--negative); }
.risk-badge.unknown { background: rgba(120,120,128,.10); color: var(--text-dim); }

.signal-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.signal-dot.pos { background: var(--positive); }
.signal-dot.neg { background: var(--negative); }
.signal-dot.neutral { background: var(--text-dim); }

/* ─────────────────────────────────────────  AKTIE-DETAIL TABS & KPIs  ───────────────────────────────────────── */
.tab-panel-area { min-height: 200px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.kpi-card {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px 14px;
}
.kpi-label {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
  margin-bottom: 4px;
}
.kpi-value {
  font-size: 22px;
  font-weight: 600;
  font-family: var(--font-display);
  letter-spacing: -.02em;
  line-height: 1.1;
}
.kpi-value.pos { color: var(--positive); }
.kpi-value.neg { color: var(--negative); }
.kpi-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.kpi-card.risk-niedrig         { border-left: 3px solid var(--positive); }
.kpi-card.risk-moderat         { border-left: 3px solid var(--text-dim); }
.kpi-card.risk-erhoeht,
.kpi-card.risk-erh\u00f6ht       { border-left: 3px solid var(--warning); }
.kpi-card.risk-hoch            { border-left: 3px solid var(--negative); }
.kpi-card.risk-mild            { border-left: 3px solid var(--positive); }
.kpi-card.risk-mittel          { border-left: 3px solid var(--text-dim); }
.kpi-card.risk-schwer          { border-left: 3px solid var(--negative); }
.kpi-card.risk-defensiv        { border-left: 3px solid var(--positive); }
.kpi-card.risk-marktnah        { border-left: 3px solid var(--text-dim); }
.kpi-card.risk-aggressiv       { border-left: 3px solid var(--warning); }
.kpi-card.risk-ausgezeichnet   { border-left: 3px solid var(--positive); }
.kpi-card.risk-gut             { border-left: 3px solid var(--positive); }
.kpi-card.risk-schwach         { border-left: 3px solid var(--warning); }
.kpi-card.risk-negativ         { border-left: 3px solid var(--negative); }

/* Signal-Box (Aktie-Detail) */
.signal-box {
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 14px 0;
  background: var(--bg-input);
}
.signal-box.kauf    { border-left: 4px solid var(--positive); }
.signal-box.verkauf { border-left: 4px solid var(--negative); }
.signal-box.neutral { border-left: 4px solid var(--text-dim); }
.signal-headline {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  margin-bottom: 8px;
}
.signal-emoji { font-size: 22px; }
.signal-text { flex: 1; }
.signal-text strong { font-weight: 700; }
.signal-score {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-card);
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--text-muted);
}
.signal-reasons {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-muted);
}
.signal-reasons li { margin: 3px 0; }

/* Risiko-Gesamtbox */
.risk-overall {
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
  background: var(--bg-input);
}
.risk-overall.niedrig { border-left: 4px solid var(--positive); }
.risk-overall.moderat { border-left: 4px solid var(--text-dim); }
.risk-overall.erhoeht,
.risk-overall.erh\u00f6ht { border-left: 4px solid var(--warning); }
.risk-overall.hoch    { border-left: 4px solid var(--negative); }
.risk-overall-stufe {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .03em;
  margin-bottom: 4px;
}
.risk-overall-hinweis {
  font-size: 13px;
  color: var(--text-muted);
}

.info-block {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 10px 0;
  font-size: 13px;
  line-height: 1.5;
}

.info-banner {
  background: var(--accent-soft);
  border: 1px solid rgba(0,113,227,.18);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--text);
}

/* ─────────────────────────────────────────  VERGLEICHS-CHART  ───────────────────────────────────────── */
.vgl-chart .grid       { stroke: var(--border-light); stroke-width: 0.5; }
.vgl-chart .zero       { stroke: var(--text-dim); stroke-width: 0.7; stroke-dasharray: 3 3; }
.vgl-chart .axis-label { font-size: 9px; fill: var(--text-muted); font-family: var(--font-mono); }
.vgl-chart .aktie-line { stroke: var(--accent); stroke-width: 1.8; fill: none; }
.vgl-chart .bm-line    { stroke: var(--text-muted); stroke-width: 1.4; fill: none; stroke-dasharray: 4 3; }
.vgl-chart .legend     { font-size: 10.5px; font-weight: 600; }
.vgl-chart .legend.aktie { fill: var(--accent); }
.vgl-chart .legend.bm    { fill: var(--text-muted); }

.vgl-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

/* ─────────────────────────────────────────  SUCH-RESULTATE  ───────────────────────────────────────── */
.search-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 480px;
  overflow-y: auto;
}
.search-result {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all .15s;
}
.search-result:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.search-result-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 4px;
  gap: 10px;
  flex-wrap: wrap;
}
.search-result-snippet {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}
.search-result-snippet mark {
  background: rgba(255,200,0,.4);
  padding: 0 2px;
  border-radius: 2px;
  color: var(--text);
  font-weight: 500;
}

