/* Aktien-Radar v2 — Light-Theme (Classical/editorial), keine Fremd-Fonts */
:root {
  --bg: #faf7f2;             /* warmweisser Hintergrund */
  --bg-elev: #f2ede4;        /* Top-Bar, Table-Head */
  --bg-card: #ffffff;        /* Karten, Tabellen */
  --border: #e4ddce;         /* zurueckhaltende Trennlinien */
  --border-strong: #c9bfa8;  /* etwas kraeftiger fuer Fokus */
  --text: #1f1a12;           /* fast schwarz, warm */
  --text-muted: #6b6353;
  --accent: #b68235;         /* Classical-Gold, wie in der Desktop-App */
  --accent-hover: #916418;
  --accent-fg: #ffffff;      /* Text auf Accent-Buttons */
  --green: #14803a;          /* dunkler, damit auf hellem Grund lesbar */
  --red: #b3261e;
  --yellow: #a37012;
  --shadow: 0 1px 3px rgba(60,50,20,0.08), 0 4px 12px rgba(60,50,20,0.06);
  --radius: 8px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* Top-Bar */
.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 12px 24px; background: var(--bg-elev);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 6px;
  background: var(--accent); color: var(--accent-fg); font-weight: 700;
  font-family: Georgia, serif; font-size: 16px;
}
.brand h1 { margin: 0; font-size: 16px; font-weight: 600; }
.tabs { display: flex; gap: 4px; flex: 1; }
.tab {
  background: transparent; color: var(--text-muted);
  border: 1px solid transparent; padding: 8px 16px;
  border-radius: 6px; font: inherit; cursor: pointer;
  transition: all .15s;
}
.tab:hover { color: var(--text); background: var(--bg-card); }
.tab.active { color: var(--accent); border-color: var(--border); background: var(--bg-card); }
.tab.tab-external { text-decoration: none; display: inline-block; color: var(--text-muted); font-style: italic; margin-left: auto; }
.tab.tab-external:hover { color: var(--accent); background: transparent; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-muted); }
.dot.ok { background: var(--green); }
.dot.warn { background: var(--yellow); }
.dot.err { background: var(--red); }
.logout-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 6px;
  color: var(--text-muted); text-decoration: none; font-size: 16px;
  transition: all .15s;
}
.logout-link:hover { color: var(--accent); background: var(--bg-card); }

/* Main */
main { padding: 24px; max-width: 1400px; margin: 0 auto; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.panel-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 24px; margin-bottom: 20px; flex-wrap: wrap;
}
.panel-head h2 { margin: 0 0 4px; font-size: 20px; font-weight: 600; }
.muted { color: var(--text-muted); margin: 0; font-size: 13px; }
.muted code { background: var(--bg-card); padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.panel-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Buttons */
.btn {
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border); padding: 8px 16px;
  border-radius: 6px; font: inherit; cursor: pointer; transition: all .15s;
}
.btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); color: var(--accent-fg); border-color: var(--accent-hover); }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn.danger { border-color: transparent; color: var(--red); }
.btn.danger:hover:not(:disabled) { background: rgba(248,113,113,0.1); color: var(--red); border-color: var(--red); }

/* Notice / Status */
.notice {
  padding: 10px 14px; border-radius: 6px; margin-bottom: 16px;
  background: var(--bg-card); border-left: 3px solid var(--accent);
  font-size: 13px;
}
.notice.err { border-left-color: var(--red); }
.notice.ok { border-left-color: var(--green); }
.hidden { display: none !important; }

/* Cards (Radar) */
.cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.card-ticker { font-size: 12px; color: var(--text-muted); letter-spacing: .05em; text-transform: uppercase; }
.card-name { font-weight: 600; font-size: 15px; }
.card-price { font-size: 22px; font-weight: 600; margin: 4px 0; }
.card-change { font-size: 13px; font-weight: 500; }
.card-change.up { color: var(--green); }
.card-change.down { color: var(--red); }
.card-change.flat { color: var(--text-muted); }
.card-sentiment { font-size: 16px; margin-left: 8px; }
.card-summary { color: var(--text-muted); font-size: 13px; margin-top: 12px; line-height: 1.5; }
.src-badge {
  display: inline-block; padding: 1px 6px; margin-right: 4px;
  background: var(--bg-elev); color: var(--accent);
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; vertical-align: middle;
}
.card-ts { color: var(--text-muted); font-size: 11px; margin-top: 8px; }

/* Watchlist-Table */
.wl-add { display: flex; gap: 8px; margin-bottom: 16px; }
.wl-add input {
  flex: 1; background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border); padding: 8px 12px; border-radius: 6px;
  font: inherit; font-family: monospace;
}
.wl-add input:focus { outline: none; border-color: var(--accent); }

.table { width: 100%; border-collapse: collapse; background: var(--bg-card); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { background: var(--bg-elev); font-weight: 600; font-size: 12px; text-transform: uppercase; color: var(--text-muted); letter-spacing: .05em; }
.table tr:last-child td { border-bottom: none; }
.table td.ticker { font-family: monospace; font-weight: 600; color: var(--accent); }
.table td.actions { text-align: right; }

/* Recherche */
.rx-list { display: flex; flex-direction: column; gap: 12px; }
.rx-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.rx-item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 12px; flex-wrap: wrap; }
.rx-item-title { font-weight: 600; }
.rx-item-title code { color: var(--accent); font-family: monospace; margin-right: 8px; }
.rx-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.rx-body { margin-top: 12px; }
.rx-body:empty { display: none; }
.rx-body h3 { font-size: 14px; margin: 12px 0 6px; color: var(--accent); }
.rx-body p { margin: 6px 0; }
.rx-body ul { margin: 6px 0; padding-left: 20px; }
.rx-body code { background: var(--bg); padding: 1px 5px; border-radius: 3px; font-size: 12px; }
.rx-meta { color: var(--text-muted); font-size: 12px; margin-top: 8px; }
.rx-erklaerung { margin-top: 12px; padding: 12px; background: var(--bg-elev); border-left: 3px solid var(--accent); border-radius: 4px; }

/* Loading */
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--text-muted); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; padding: 12px 16px; }
  main { padding: 16px; }
  .panel-head { flex-direction: column; align-items: stretch; }
  .cards { grid-template-columns: 1fr; }
}
