:root {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1e222b;
  --border: #2a2f3a;
  --text: #e8e9ec;
  --text-secondary: #9aa1ad;
  --text-muted: #6b7280;
  --accent: #3b82f6;
  --success: #22c55e;
  --danger: #ef4444;
  --radius: 8px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.wrap { max-width: 900px; margin: 0 auto; padding: 2rem 1.25rem; }
h1 { font-size: 22px; font-weight: 600; margin: 0 0 1rem; }
h3 { font-size: 16px; font-weight: 600; margin: 0 0 12px; }
.muted { color: var(--text-secondary); font-size: 13px; margin-right: 12px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.row-between { display: flex; justify-content: space-between; align-items: baseline; margin: 1.5rem 0 0.75rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }
input, select, textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.grid3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.grid2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.calc-row:last-child { border-bottom: none; }
.calc-row b { font-size: 16px; }
button {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
}
button:hover { border-color: var(--text-secondary); }
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  font-weight: 500;
}
.error { color: var(--danger); font-size: 13px; margin-bottom: 8px; }
.tabs { display: flex; gap: 4px; margin-bottom: 1rem; }
.tab { flex: 1; background: transparent; border-bottom: 2px solid var(--border); border-radius: 0; }
.tab.active { border-bottom-color: var(--accent); color: var(--accent); }
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.label { font-size: 13px; color: var(--text-secondary); margin: 0 0 4px; }
.stat-card .label { font-size: 13px; color: var(--text-secondary); margin: 0 0 4px; }
.stat-card .value { font-size: 22px; font-weight: 600; margin: 0; }
.trade-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
}
.trade-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.trade-meta { font-size: 12px; color: var(--text-secondary); margin-left: 8px; }
.trade-pl { font-size: 15px; font-weight: 600; }
.trade-detail { font-size: 13px; color: var(--text-secondary); margin-top: 6px; }
.trade-note { font-size: 13px; margin-top: 4px; }
.trade-note b { color: var(--text-secondary); font-weight: 500; }
.del-btn { font-size: 12px; padding: 3px 8px; }
.trade-shot { margin-top: 8px; }
.thumb {
  max-width: 220px;
  max-height: 140px;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
  display: block;
}
.thumb:hover { border-color: var(--accent); }
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}
.badge-win { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-loss { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-breakeven { background: rgba(154,161,173,0.15); color: var(--text-secondary); }
.badge-session { background: rgba(59,130,246,0.15); color: var(--accent); }
.session-stats-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 1.5rem;
}
.table-wrap { overflow-x: auto; }
.report-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report-table th, .report-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.report-table th { color: var(--text-secondary); font-weight: 600; }
.report-table tr.top-row td { background: rgba(59,130,246,0.08); }
