/* Trading Dashboard — stile investing.com (tema scuro) */
:root {
  --bg: #0d1117;
  --bg-card: #161b22;
  --bg-card-hover: #1c2128;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --green: #3fb950;
  --red: #f85149;
  --blue: #58a6ff;
  --accent: #1f6feb;
  --gold: #d29922;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Login --- */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px;
  width: 360px;
  text-align: center;
}
.login-logo { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.login-logo span { color: var(--blue); }
.login-sub { color: var(--text-muted); font-size: 13px; margin-bottom: 24px; }
.login-card input {
  width: 100%;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  margin-bottom: 16px;
  outline: none;
}
.login-card input:focus { border-color: var(--accent); }
.login-card button {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.login-card button:hover { background: #1a5fb4; }
.login-error { color: var(--red); font-size: 13px; margin-top: 12px; }

/* --- Topbar --- */
.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  height: 56px;
  gap: 24px;
}
.logo { font-size: 18px; font-weight: 700; white-space: nowrap; }
.logo span { color: var(--blue); }
.nav { display: flex; gap: 4px; flex: 1; }
.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
}
.nav-link:hover { color: var(--text); background: var(--bg-card-hover); }
.nav-link.active { color: var(--text); background: var(--accent); }
.logout {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 6px;
}
.logout:hover { color: var(--red); background: var(--bg-card-hover); }

/* --- Container --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
  flex: 1;
  width: 100%;
}
.tab { display: none; }
.tab.active { display: block; }
h2 { font-size: 20px; margin-bottom: 16px; }
.hint { color: var(--text-muted); font-size: 13px; margin-bottom: 16px; }
.loading { color: var(--text-muted); padding: 20px 0; }

/* --- Card --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
}
.card:hover { background: var(--bg-card-hover); }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.card-meta { color: var(--text-muted); font-size: 12px; }

/* --- Tabelle --- */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
tr:hover td { background: var(--bg-card-hover); }
.pos { color: var(--green); }
.neg { color: var(--red); }
.neutral { color: var(--text-muted); }

/* --- Badge --- */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.badge-green { background: rgba(63, 185, 80, 0.15); color: var(--green); }
.badge-red { background: rgba(248, 81, 73, 0.15); color: var(--red); }
.badge-blue { background: rgba(88, 166, 255, 0.15); color: var(--blue); }
.badge-gold { background: rgba(210, 153, 34, 0.15); color: var(--gold); }

/* --- Mini grafico (sparkline) --- */
.sparkline { width: 100px; height: 32px; }

/* --- Test form --- */
.test-form { display: flex; gap: 8px; margin-bottom: 20px; }
.test-form input {
  flex: 1;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  outline: none;
}
.test-form input:focus { border-color: var(--accent); }
.test-form button {
  padding: 12px 24px;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.test-form button:hover { background: #1a5fb4; }

/* --- Stat grid --- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}
.stat-label { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.stat-value { font-size: 20px; font-weight: 700; }

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .topbar-inner { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 8px; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
