/* Fundamental (vierter Bereich). Alle Selektoren unter #view-fund gescoped.
   Tokens kommen aus base.css (:root) — hier nichts neu definieren. */

#view-fund { max-width: var(--maxw); margin: 0 auto; padding: 16px 20px 64px; }

/* ---- Kopf ---- */
.fund-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 4px 0 18px; }
.fund-title { margin: 0; font-size: 23px; letter-spacing: -.01em; }
.fund-sub { margin: 5px 0 0; color: var(--muted); font-size: 13px; }

.fund-btn-primary {
  display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: #08122a;
  border: none; border-radius: var(--r-sm); padding: 11px 16px; font-weight: 700; font-size: 13.5px;
  cursor: pointer; font-family: var(--font-ui); box-shadow: 0 6px 18px -6px rgba(91,150,255,.7); transition: .15s;
}
.fund-btn-primary:hover { background: var(--accent-2); box-shadow: var(--ring-glow); }
.fund-btn-primary:disabled { opacity: .55; cursor: default; box-shadow: none; }
.fund-btn-primary svg { width: 15px; height: 15px; }
.fund-btn-ghost {
  background: transparent; border: 1px solid var(--border); color: var(--ink-2); border-radius: var(--r-sm);
  padding: 10px 15px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: var(--font-ui);
}
.fund-btn-ghost:hover { color: var(--ink); border-color: #33436a; }

/* ---- Job-Streifen ---- */
.fund-jobs { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.fund-job {
  display: flex; align-items: center; gap: 11px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 9px 14px; font-size: 13px;
}
.fund-job .tk { font-family: var(--font-num); font-weight: 600; color: var(--ink); }
.fund-job .st { color: var(--muted); font-size: 12px; }
.fund-job.queued .st { color: var(--warn); }
.fund-spin {
  width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(143,184,255,.25);
  border-top-color: var(--accent-2); animation: fund-sp 1s linear infinite;
}
@keyframes fund-sp { to { transform: rotate(360deg); } }

/* ---- Filter-Toolbar ---- */
.fund-toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.fund-field { display: flex; flex-direction: column; gap: 4px; position: relative; }
.fund-field > span { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-left: 2px; }
.fund-field select {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--ink);
  font-family: var(--font-ui); font-size: 13px; padding: 9px 30px 9px 12px; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 10 7'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%237183a3' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.fund-field select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring-glow); }
.fund-search { position: relative; display: flex; align-items: flex-end; }
.fund-search svg { position: absolute; left: 11px; bottom: 10px; width: 15px; height: 15px; color: var(--muted); }
.fund-search input {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--ink);
  font-family: var(--font-ui); font-size: 13px; padding: 9px 12px 9px 34px; width: 250px;
}
.fund-search input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring-glow); }
.fund-count { margin-left: auto; color: var(--muted); font-size: 12px; font-family: var(--font-num); align-self: flex-end; }

/* ---- Liste ---- */
.fund-list { display: flex; flex-direction: column; gap: 9px; }
.fund-nores { color: var(--muted); font-size: 13.5px; padding: 30px 4px; text-align: center; }
.fund-row {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-1);
  transition: border-color .15s; overflow: hidden;
}
.fund-row:hover { border-color: #33436a; }
.fund-row-main {
  display: grid; grid-template-columns: 210px 150px 1fr auto; align-items: center; gap: 16px;
  padding: 15px 18px; cursor: pointer;
}
.fr-tick { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fr-tick .sym { font-family: var(--font-num); font-size: 17px; font-weight: 600; }
.fr-tick .nm { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-sector {
  justify-self: start; font-size: 11.5px; color: var(--ink-2); background: var(--surface-3);
  border: 1px solid var(--border); border-radius: 20px; padding: 4px 11px; white-space: nowrap;
}
.fr-verd { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.fr-badge { font-size: 12px; font-weight: 700; border-radius: 6px; padding: 5px 11px; letter-spacing: .02em; }
.b-buy  { color: var(--pos);  background: rgba(48,204,90,.14); }
.b-hold { color: var(--warn); background: var(--warn-soft); }
.b-sell { color: var(--neg);  background: rgba(246,53,56,.14); }
.b-none { color: var(--muted); background: var(--surface-2); }
.fr-moat { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.fr-moat .lamp { width: 13px; height: 13px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(255,255,255,.03); }
.m-g { background: var(--pos);  box-shadow: 0 0 0 3px rgba(48,204,90,.14), 0 0 10px rgba(48,204,90,.5); }
.m-y { background: var(--warn); box-shadow: 0 0 0 3px rgba(255,180,84,.14), 0 0 10px rgba(255,180,84,.5); }
.m-r { background: var(--neg);  box-shadow: 0 0 0 3px rgba(246,53,56,.14), 0 0 10px rgba(246,53,56,.5); }
.m-n { background: var(--neutral); }
.fr-meta { display: flex; align-items: center; gap: 16px; justify-self: end; }
.fr-meta .date { font-family: var(--font-num); font-size: 12.5px; color: var(--ink-2); }
.fr-chev { color: var(--muted); transition: transform .2s, color .2s; }
.fund-row.open .fr-chev { transform: rotate(90deg); color: var(--accent-2); }

/* ---- Aufgeklappt ---- */
.fund-row-body { display: none; }
.fund-row.open .fund-row-body {
  display: block; border-top: 1px solid var(--border); padding: 18px 18px 20px;
  background: linear-gradient(180deg, rgba(91,150,255,.04), transparent 40%);
}
.fund-summary { font-size: 13.5px; line-height: 1.62; color: var(--ink-2); max-width: 880px; margin: 0 0 16px; }
.fund-kpis { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 18px; }
.fund-kpi { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 9px 13px; min-width: 92px; }
.fund-kpi .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.fund-kpi .v { font-family: var(--font-num); font-size: 16px; font-weight: 600; margin-top: 3px; }
.fund-kpi .v.pos { color: var(--pos); }
.fund-kpi .v.neg { color: var(--neg); }
.fund-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.fund-act {
  display: inline-flex; align-items: center; gap: 7px; background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--ink); padding: 9px 14px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: .15s; font-family: var(--font-ui);
}
.fund-act:hover { border-color: var(--accent); color: var(--accent-2); }
.fund-act svg { width: 14px; height: 14px; }
.fund-act.strong { background: var(--accent-soft); border-color: rgba(91,150,255,.4); color: var(--accent-2); }
.fund-prov { margin-top: 15px; font-size: 11.5px; color: var(--muted); font-family: var(--font-num); }
.fund-prov b { color: var(--ink-2); font-weight: 500; }

/* ---- Leerzustand ---- */
.fund-empty { padding: 60px 20px; }
.fund-empty .fe-inner { max-width: 420px; margin: 0 auto; text-align: center; }
.fund-empty .fe-icn { font-size: 34px; opacity: .8; margin-bottom: 8px; }
.fund-empty h3 { margin: 0 0 8px; font-size: 18px; }
.fund-empty p { margin: 0 0 20px; color: var(--muted); font-size: 13.5px; line-height: 1.6; }

/* ---- Anfordern-Modal ---- */
.fund-modal-backdrop {
  position: fixed; inset: 0; z-index: 120; background: rgba(6,9,17,.66); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.fund-modal-backdrop[hidden] { display: none; }
.fund-modal {
  width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-2); padding: 22px;
}
.fund-modal h3 { margin: 0 0 4px; font-size: 16px; }
.fund-modal .fm-sub { margin: 0 0 16px; color: var(--muted); font-size: 12.5px; }
.fm-tf { position: relative; }
.fm-tf input {
  width: 100%; background: var(--bg); border: 1px solid var(--accent); border-radius: var(--r-sm);
  color: var(--ink); font-family: var(--font-num); font-size: 15px; padding: 11px 12px; box-shadow: var(--ring-glow);
}
.fm-tf input:focus { outline: none; }
.fm-ac { margin-top: 6px; border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); max-height: 260px; overflow-y: auto; }
.fm-ac-row { padding: 9px 12px; font-size: 13px; display: flex; justify-content: space-between; gap: 12px; cursor: pointer; }
.fm-ac-row:hover, .fm-ac-row.sel { background: var(--surface-3); }
.fm-ac-row .sym { font-family: var(--font-num); font-weight: 600; }
.fm-ac-row .nm { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fund-modal .fm-hint { margin: 14px 0 18px; font-size: 11.5px; color: var(--muted); line-height: 1.5; border-left: 2px solid var(--accent); padding-left: 11px; }
.fund-modal .fm-hint b { color: var(--pos); }
.fm-actions { display: flex; justify-content: flex-end; gap: 10px; }

@media (max-width: 900px) {
  .fund-row-main { grid-template-columns: 1fr auto; gap: 10px; }
  .fr-sector, .fr-verd { grid-column: 1 / -1; }
  .fr-meta { justify-self: start; }
  .fund-search input { width: 180px; }
}
