/* IB-Abrechnung — Frontend Styles. Dark theme, konsistent mit ../IB_Trader. */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f1419; color: #e6edf3;
  font-size: 13px; line-height: 1.45;
}
a { color: #58a6ff; text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: "SF Mono", Consolas, "Courier New", monospace; font-size: 12px; }

header.topnav {
  background: #161b22; border-bottom: 1px solid #2a3340;
  padding: 10px 24px; display: flex; align-items: center; gap: 24px;
  position: sticky; top: 0; z-index: 100;
}
header.topnav h1 { font-size: 16px; margin: 0; }
header.topnav h1 a { color: inherit; text-decoration: none; }
header.topnav h1 a:hover { color: #58a6ff; }
header.topnav nav a { color: #8b949e; margin-right: 12px; }
header.topnav nav a:hover, header.topnav nav a.active { color: #e6edf3; }

main { padding: 20px 24px; max-width: 1400px; margin: 0 auto; }

h2 { font-size: 18px; margin: 24px 0 12px; padding-bottom: 6px; border-bottom: 1px solid #2a3340; }
h3 { font-size: 14px; margin: 16px 0 8px; color: #c9d1d9; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 12px 0; }
.card {
  background: #161b22; border: 1px solid #2a3340; border-radius: 6px;
  padding: 14px 16px; display: flex; flex-direction: column;
}
.card .label { color: #8b949e; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
.card .value { font-size: 22px; font-weight: 600; margin-top: 6px; }
.card .sub { color: #8b949e; font-size: 11px; margin-top: 4px; }

table {
  width: 100%; border-collapse: separate; border-spacing: 0; margin: 8px 0 24px;
  background: #161b22; border: 1px solid #2a3340; border-radius: 4px;
}
th, td { padding: 6px 10px; text-align: left; border-bottom: 1px solid #2a3340; }
th {
  background: #1a212b; color: #8b949e; font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.5px;
  position: sticky; top: 42px; z-index: 5;
  box-shadow: inset 0 -1px 0 #2a3340;  /* Border kompatibel mit sticky */
}
/* Bei view.php hängt zusätzlich eine Tab-Leiste unter der Top-Nav */
body.has-tabs th { top: 88px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #1a212b; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.sym { font-family: "SF Mono", Consolas, monospace; }

.pnl-positive { color: #3fb950; }
.pnl-negative { color: #f85149; }
.pnl-neutral { color: #8b949e; }

.tab-bar {
  display: flex; gap: 4px; margin: 0; border-bottom: 1px solid #2a3340;
  position: sticky; top: 41px; z-index: 50;
  background: #0f1419; padding: 12px 24px 0; margin: 0 -24px 16px;
}
.tab-bar a {
  padding: 8px 14px; color: #8b949e; border: 1px solid transparent;
  border-bottom: none; border-radius: 4px 4px 0 0;
}
.tab-bar a.active { background: #161b22; color: #e6edf3; border-color: #2a3340; }
.tab-bar a:hover { color: #e6edf3; text-decoration: none; }

ul.export-list { list-style: none; padding: 0; }
ul.export-list li {
  background: #161b22; border: 1px solid #2a3340; border-radius: 6px;
  padding: 12px 16px; margin-bottom: 8px;
  display: flex; justify-content: space-between; align-items: center;
}

footer { color: #8b949e; padding: 16px 24px; font-size: 11px; }

.empty-state { color: #8b949e; padding: 20px; text-align: center; font-style: italic; }
.error { background: #3d1a1f; border: 1px solid #f85149; padding: 14px 18px; border-radius: 6px; color: #ffa198; }

/* ---- Buttons ---- */
.btn { display: inline-block; padding: 8px 16px; border-radius: 6px; font: inherit;
  font-weight: 600; cursor: pointer; text-decoration: none; border: 1px solid #2a3340;
  background: #1a212b; color: #e6edf3; }
.btn:hover { text-decoration: none; border-color: #58a6ff; }
.btn-primary { background: #1f6feb; border-color: #1f6feb; color: #fff; }
.btn-primary:hover { background: #388bfd; border-color: #388bfd; }
.btn-green { background: #238636; border-color: #2ea043; color: #fff; }
.btn-green:hover { background: #2ea043; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ---- Landing (pre-login) ---- */
.hero { max-width: 880px; margin: 8vh auto 0; padding: 0 24px; text-align: center; }
.hero .logo { font-size: 13px; letter-spacing: 3px; text-transform: uppercase; color: #58a6ff; }
.hero h1 { font-size: 40px; margin: 12px 0 8px; line-height: 1.15; }
.hero p.lead { font-size: 17px; color: #8b949e; max-width: 620px; margin: 0 auto 28px; }
.hero .cta { margin: 8px 0 48px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; max-width: 980px; margin: 0 auto 40px; padding: 0 24px; text-align: left; }
.feature { background: #161b22; border: 1px solid #2a3340; border-radius: 10px; padding: 18px 20px; }
.feature .ico { font-size: 22px; }
.feature h3 { margin: 8px 0 4px; color: #e6edf3; }
.feature p { color: #8b949e; margin: 0; font-size: 12px; }

/* ---- Dashboard tiles ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 16px 0; }
.tile { background: #161b22; border: 1px solid #2a3340; border-radius: 10px; padding: 18px 20px;
  display: block; color: inherit; text-decoration: none; transition: border-color .12s; }
.tile:hover { border-color: #58a6ff; text-decoration: none; }
.tile .ico { font-size: 24px; }
.tile h3 { margin: 8px 0 4px; color: #e6edf3; }
.tile p { color: #8b949e; margin: 0; font-size: 12px; }

.statusbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: #161b22; border: 1px solid #2a3340; border-radius: 10px; padding: 14px 18px; margin: 12px 0 4px; }
.statusbar .big { font-size: 20px; font-weight: 700; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; }
.pill.ok { background: #0d2a16; color: #3fb950; border: 1px solid #2ea043; }
.pill.run { background: #18243a; color: #58a6ff; border: 1px solid #1f6feb; }
.pill.err { background: #3d1a1f; color: #f85149; border: 1px solid #da3633; }
.pill.idle { background: #1a212b; color: #8b949e; border: 1px solid #2a3340; }

.notice { background: #18243a; border: 1px solid #1f6feb; border-radius: 10px; padding: 16px 20px; margin: 16px 0; }
.notice h3 { margin: 0 0 6px; color: #e6edf3; }

/* ---- Forms ---- */
form.app-form { background: #161b22; border: 1px solid #2a3340; border-radius: 10px;
  padding: 18px 20px; margin: 12px 0; max-width: 640px; }
form.app-form .row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
form.app-form label { color: #8b949e; font-size: 12px; }
form.app-form input, form.app-form select {
  background: #0d1117; color: #e6edf3; border: 1px solid #2a3340; border-radius: 6px;
  padding: 8px 12px; font: inherit; }
form.app-form input:focus, form.app-form select:focus { outline: none; border-color: #58a6ff; }
form.app-form .hint { color: #6e7681; font-size: 11px; }

/* Steps (Anleitung) */
ol.steps { counter-reset: step; list-style: none; padding: 0; max-width: 820px; }
ol.steps li { background: #161b22; border: 1px solid #2a3340; border-radius: 8px;
  padding: 14px 18px 14px 52px; margin-bottom: 10px; position: relative; }
ol.steps li::before { counter-increment: step; content: counter(step);
  position: absolute; left: 14px; top: 14px; width: 26px; height: 26px; border-radius: 50%;
  background: #1f6feb; color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
ol.steps li strong { color: #e6edf3; }
.tag { display: inline-block; background: #1a212b; border: 1px solid #2a3340; border-radius: 4px;
  padding: 1px 7px; margin: 2px 3px 2px 0; font-size: 11px; font-family: "SF Mono", Consolas, monospace; color: #c9d1d9; }
