/* StockPilot — helles, professionelles Finanz-Theme */
:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --border: #e2e8f0;
  --text: #1a2332;
  --muted: #64748b;
  --accent: #0f4c81;
  --accent-light: #e8f1f8;
  --green: #0e9f6e;
  --green-bg: #e6f6f0;
  --red: #dc2626;
  --red-bg: #fdecec;
  --amber: #d97706;
  --amber-bg: #fdf3e3;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08);
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  font-size: 15px; line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Topbar */
.topbar { background: var(--panel); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; box-shadow: var(--shadow); }
.topbar-inner { max-width: 1400px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 10px 20px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 19px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-logo { font-size: 22px; }
.quicksearch { display: flex; flex: 1 1 320px; max-width: 480px; }
.quicksearch input { flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-right: 0; border-radius: 8px 0 0 8px; font-size: 14px; outline: none; }
.quicksearch input:focus { border-color: var(--accent); }
.quicksearch button { padding: 8px 16px; border: 0; background: var(--accent); color: #fff; border-radius: 0 8px 8px 0; cursor: pointer; font-size: 14px; font-weight: 600; }
.quicksearch button:hover { background: #0c3d68; }
.mainnav { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.mainnav a { padding: 7px 12px; border-radius: 8px; color: var(--text); font-weight: 500; font-size: 14.5px; }
.mainnav a:hover { background: var(--accent-light); text-decoration: none; }
.mainnav a.active { background: var(--accent); color: #fff; }
.alerts-link { position: relative; }
.alert-badge { position: absolute; top: 0; right: 2px; background: var(--red); color: #fff; border-radius: 10px; font-size: 10.5px; padding: 0 5px; font-weight: 700; }
.inline-form { display: inline; }
.linkbtn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; padding: 7px 10px; }
.linkbtn:hover { color: var(--text); }

/* Layout */
.content { max-width: 1400px; margin: 22px auto; padding: 0 20px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.panel h2, .panel h3 { margin: 0 0 12px; font-size: 16.5px; }
.panel .panel-sub { color: var(--muted); font-size: 13px; margin-top: -8px; margin-bottom: 12px; }
.page-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 24px; }
.page-head .sub { color: var(--muted); }

/* Tabellen */
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; padding: 8px 10px; color: var(--muted); font-weight: 600; border-bottom: 2px solid var(--border); white-space: nowrap; }
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--border); }
table.data tr:hover td { background: #fafbfd; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Farben / Badges */
.pos { color: var(--green); font-weight: 600; }
.neg { color: var(--red); font-weight: 600; }
.badge { display: inline-block; padding: 2.5px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-gray { background: #eef1f5; color: var(--muted); }
.badge-blue { background: var(--accent-light); color: var(--accent); }

/* Score-Anzeige */
.score-ring { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.score-value { font-size: 42px; font-weight: 800; line-height: 1; }
.score-label { font-size: 15px; font-weight: 700; }
.scorebar { height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--red), var(--amber) 45%, var(--green)); position: relative; margin: 10px 0 4px; }
.scorebar .marker { position: absolute; top: -5px; width: 4px; height: 20px; background: var(--text); border-radius: 2px; }

/* Formulare */
form.stack { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea {
  padding: 8px 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: #fff;
}
.field input:focus, .field select:focus { border-color: var(--accent); outline: none; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .field { flex: 1 1 140px; }
.btn { display: inline-block; padding: 9px 18px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 600; font-size: 14px; cursor: pointer; }
.btn:hover { background: #0c3d68; text-decoration: none; }
.btn-secondary { background: #eef1f5; color: var(--text); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 5px 11px; font-size: 13px; }

/* Flash + Hinweise */
.flash { padding: 11px 16px; border-radius: 8px; margin-bottom: 14px; font-weight: 500; }
.flash-success { background: var(--green-bg); color: var(--green); }
.flash-error { background: var(--red-bg); color: var(--red); }
.flash-info { background: var(--accent-light); color: var(--accent); }
.hint { color: var(--muted); font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 34px 10px; }
.empty .big { font-size: 34px; display: block; margin-bottom: 8px; }

/* KPI-Karten */
.kpi { display: flex; flex-direction: column; gap: 2px; }
.kpi .kpi-label { color: var(--muted); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.kpi .kpi-value { font-size: 23px; font-weight: 750; font-variant-numeric: tabular-nums; }
.kpi .kpi-sub { font-size: 13px; color: var(--muted); }

/* Ampel */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.dot-green { background: var(--green); }
.dot-red { background: var(--red); }
.dot-amber { background: var(--amber); }
.dot-gray { background: #cbd5e1; }

/* Charts */
.chart-box { width: 100%; }
.chart-main { height: 420px; }
.chart-pane { height: 130px; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); padding: 6px 2px; }
.chart-legend .sw { display: inline-block; width: 12px; height: 3px; vertical-align: middle; margin-right: 5px; border-radius: 2px; }

/* Login */
.login-wrap { max-width: 380px; margin: 8vh auto; }
.login-wrap .brand { justify-content: center; font-size: 26px; margin-bottom: 18px; }

/* Footer */
.footer { max-width: 1400px; margin: 40px auto 24px; padding: 14px 20px; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--border); }
.footer .disclaimer { margin-top: 4px; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 8px 16px; border-radius: 8px 8px 0 0; font-weight: 600; color: var(--muted); }
.tabs a.active { background: var(--panel); border: 1px solid var(--border); border-bottom: 2px solid var(--panel); margin-bottom: -2px; color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--text); }

@media (max-width: 800px) {
  .topbar-inner { gap: 10px; }
  .quicksearch { order: 3; flex-basis: 100%; max-width: none; }
  .chart-main { height: 300px; }
}
