/* =============================================================
   Finanzübersicht – Stylesheet (mobile-first, dunkel)
   ============================================================= */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600&family=DM+Sans:wght@400;500;600&display=swap');

:root {
  --bg:#0f1115; --card:#171a21; --ink:#e8eaed; --muted:#7c8493;
  --line:#262b35; --pos:#4ade80; --neg:#f87171; --accent:#fbbf24;
  --blue:#60a5fa; --row-alt:#13161c; --row-hover:#1c212b;
}
* { box-sizing:border-box; }
body {
  margin:0; background:var(--bg); color:var(--ink);
  font-family:'DM Sans',system-ui,sans-serif; font-size:15px; line-height:1.5;
}
a { color:inherit; text-decoration:none; }

/* Topbar + Nav */
.topbar {
  position:sticky; top:0; z-index:10; background:var(--bg);
  border-bottom:1px solid var(--line); padding:14px 16px;
}
.brand {
  font-family:'Fraunces',Georgia,serif; font-size:22px; font-weight:600;
  letter-spacing:-0.02em; margin-bottom:10px;
}
.nav { display:flex; gap:4px; overflow-x:auto; -webkit-overflow-scrolling:touch; }
.nav a {
  white-space:nowrap; padding:7px 13px; border-radius:8px; font-size:13.5px;
  color:var(--muted); font-weight:500; transition:background .12s,color .12s;
}
.nav a:hover { background:var(--row-hover); color:var(--ink); }
.nav a.active { background:var(--ink); color:var(--bg); }

.content { max-width:1080px; margin:0 auto; padding:18px 16px 40px; }
h1 { font-family:'Fraunces',serif; font-size:26px; font-weight:600; margin:6px 0 4px; letter-spacing:-0.02em; }
h2 { font-family:'Fraunces',serif; font-size:18px; font-weight:600; margin:24px 0 12px; }
.sub { color:var(--muted); font-size:13px; margin:0 0 18px; }

/* KPI-Kacheln */
.kpis { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:11px; margin-bottom:14px; }
.kpi { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:14px 16px; }
.kpi .label { font-size:12px; color:var(--muted); display:block; margin-bottom:5px; }
.kpi .val { font-family:'Fraunces',serif; font-size:23px; font-weight:600; letter-spacing:-0.01em; }
.kpi .val.big { font-size:28px; }
.kpi .val.pos { color:var(--pos); } .kpi .val.neg { color:var(--neg); }
.kpi .hint { font-size:11px; color:var(--muted); display:block; margin-top:3px; }

/* Karten + Tabellen */
.card { background:var(--card); border:1px solid var(--line); border-radius:12px; overflow:hidden; margin-bottom:18px; }
.card-pad { padding:18px; }
.table-wrap { overflow-x:auto; }
table { width:100%; border-collapse:collapse; font-size:13.5px; min-width:560px; }
th {
  text-align:right; padding:11px 13px; font-size:11px; color:var(--muted);
  text-transform:uppercase; letter-spacing:0.04em; font-weight:600;
  border-bottom:1px solid var(--line); white-space:nowrap;
}
th:first-child, td:first-child { text-align:left; }
td { text-align:right; padding:10px 13px; border-bottom:1px solid var(--line); white-space:nowrap; }
tbody tr:nth-child(even) { background:var(--row-alt); }
tbody tr:hover { background:var(--row-hover); }
tfoot td { font-weight:700; border-top:2px solid var(--line); border-bottom:none; }
.pos { color:var(--pos); } .neg { color:var(--neg); } .dim { color:var(--muted); }
.bold { font-weight:600; }

.pill { font-size:12px; font-weight:600; padding:2px 8px; border-radius:20px; }
.pill.up { background:rgba(74,222,128,0.12); color:var(--pos); }
.pill.down { background:rgba(248,113,113,0.12); color:var(--neg); }

.tag { font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:0.04em; display:block; }

/* Balkendiagramm (CSS) */
.chart { display:flex; align-items:flex-end; gap:7px; height:190px; padding-top:10px; }
.bar-col { flex:1; display:flex; flex-direction:column; align-items:center; gap:5px; height:100%; justify-content:flex-end; }
.bar-track { flex:1; width:100%; display:flex; align-items:flex-end; justify-content:center; }
.bar { width:66%; border-radius:3px 3px 0 0; min-height:2px; }
.bar.stack { display:flex; flex-direction:column; justify-content:flex-end; }
.bar-year { font-size:10.5px; color:var(--muted); }
.legend { display:flex; gap:16px; margin-top:14px; justify-content:center; flex-wrap:wrap; }
.legend span { display:inline-flex; align-items:center; gap:6px; font-size:12px; color:var(--muted); }
.dot { width:8px; height:8px; border-radius:50%; display:inline-block; }

.info {
  background:rgba(96,165,250,0.08); border:1px solid rgba(96,165,250,0.25);
  border-radius:10px; padding:12px 15px; font-size:13px; line-height:1.55; margin-bottom:16px;
}
.foot { text-align:center; padding:24px 16px; color:var(--muted); }
.foot small { font-size:11.5px; }

/* Formular (Wertpapier erfassen) */
form.erfassen { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:12px; }
form.erfassen label { font-size:12px; color:var(--muted); display:flex; flex-direction:column; gap:4px; }
input, select {
  background:var(--bg); border:1px solid var(--line); color:var(--ink);
  padding:8px 10px; border-radius:8px; font-size:14px; font-family:inherit;
}
input:focus, select:focus { outline:none; border-color:var(--accent); }
button {
  background:var(--ink); color:var(--bg); border:none; padding:9px 18px;
  border-radius:8px; font-size:14px; font-weight:600; cursor:pointer; font-family:inherit;
}
button:hover { opacity:.9; }
.btn-sec { background:transparent; border:1px solid var(--line); color:var(--ink); }

/* Erfassungs-Formulare (Transaktion, Jahre, Bestände) */
.form .form-row { display:flex; gap:14px; flex-wrap:wrap; margin-bottom:12px; }
.form .form-row > label { flex:1; min-width:150px; font-size:12px; color:var(--muted); display:flex; flex-direction:column; gap:5px; }
.form label.check { flex-direction:row; align-items:center; gap:8px; color:var(--ink); font-size:13px; }
.form label.check input { width:auto; }
.inputgroup { display:flex; gap:6px; }
.inputgroup input { flex:1; }
.btn-primary { background:var(--accent); color:#1a1205; }
.btn-mini { background:transparent; border:1px solid var(--line); color:var(--ink); padding:6px 12px; font-size:12.5px; font-weight:500; border-radius:7px; text-decoration:none; display:inline-block; cursor:pointer; }
.btn-mini:hover { border-color:var(--accent); }
.info-ok { background:rgba(74,222,128,0.08); border-color:rgba(74,222,128,0.3); }
.info-err { background:rgba(248,113,113,0.08); border-color:rgba(248,113,113,0.3); }
.kursinfo { font-size:12.5px; color:var(--muted); margin:4px 0 14px; min-height:18px; }
.editrow { background:var(--row-alt); }
.editrow td { padding:16px; }
.inlineform { display:flex; align-items:flex-end; gap:10px; flex-wrap:wrap; }
.inlineform label { font-size:12px; color:var(--muted); display:flex; flex-direction:column; gap:5px; }
.pill { font-size:12px; font-weight:600; padding:2px 9px; border-radius:20px; }
.pill.up { background:rgba(74,222,128,.12); color:var(--pos); }
.pill.down { background:rgba(248,113,113,.12); color:var(--neg); }
.dim { color:var(--muted); }
