/* ── Design tokens ───────────────────────────────────────────── */
:root {
  --bg:       #1a1a1a;
  --bg-soft:  #242424;
  --bg-mute:  #2e2e2e;
  --divider:  #333333;
  --text-1:   #e8e8e8;
  --text-2:   #aaaaaa;
  --brand:    #5c7cfa;
  --font:     'Inter', system-ui, sans-serif;
  --mono:     'JetBrains Mono', monospace;
}

/* ── Reset / base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--brand); }
a:hover { opacity: 0.8; }

h1, h2, h3, h4 {
  color: var(--text-1);
  font-weight: 700;
  line-height: 1.3;
  margin: 1.5rem 0 0.75rem;
}

h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; border-bottom: 1px solid var(--divider); padding-bottom: 0.3rem; }
h3 { font-size: 1rem; }

code, pre {
  font-family: var(--mono);
  font-size: 0.875em;
}

pre {
  background: var(--bg-soft);
  border: 1px solid var(--divider);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
  font-size: 0.875rem;
}

th, td {
  padding: 0.45rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--divider);
}

thead th {
  background: var(--bg-soft);
  color: var(--text-2);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tbody tr:hover td { background: var(--bg-mute); }

/* ── Navigation ──────────────────────────────────────────────── */
.site-nav {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--divider);
  background: var(--bg-soft);
}

.site-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-1);
  text-decoration: none;
  letter-spacing: 0.01em;
}

/* ── Content area ────────────────────────────────────────────── */
.content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
}

article { width: 100%; }

/* ── Stats grid ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1rem 0 2rem;
}

.stat-card {
  background: var(--bg-soft);
  border: 1px solid var(--divider);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

.stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
  margin-bottom: 0.4rem;
}

.stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-win .stat-value { color: #26a69a; }
.stat-loss .stat-value { color: #ef5350; }

/* ── Calendar grid ───────────────────────────────────────────── */
.calendar-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin: 1rem 0 2rem;
}

.calendar-month { min-width: 270px; }

.calendar-month-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--brand);
}

.calendar-table {
  border-collapse: collapse;
  width: 100%;
}

.calendar-table th {
  padding: 4px 2px;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-2);
  border-bottom: none;
  background: none;
}

.cal-empty { padding: 4px; }

.cal-day {
  padding: 2px;
  border-radius: 4px;
  text-align: center;
}

.cal-day-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 2px;
  border-radius: 4px;
}

.cal-day a {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none !important;
  padding: 4px 2px;
  border-radius: 4px;
  transition: opacity 0.15s;
}

.cal-day a:hover { opacity: 0.7; }

.cal-day-num {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.2;
}

.cal-pnl {
  font-size: 0.58rem;
  font-weight: 500;
  margin-top: 1px;
  line-height: 1.2;
}

.cal-win {
  background-color: rgba(38, 166, 154, 0.15);
  border: 1px solid rgba(38, 166, 154, 0.35);
}

.cal-win .cal-pnl { color: #26a69a; }

.cal-loss {
  background-color: rgba(239, 83, 80, 0.15);
  border: 1px solid rgba(239, 83, 80, 0.35);
}

.cal-loss .cal-pnl { color: #ef5350; }
.cal-no-trade { opacity: 0.3; }

/* ── Strategy × Instrument P&L table ────────────────────────── */
.strategy-table-wrapper {
  overflow-x: auto;
  margin: 1rem 0 2rem;
}

.strategy-table {
  border-collapse: collapse;
  font-size: 0.85rem;
  width: 100%;
}

.strategy-table th,
.strategy-table td {
  padding: 0.5rem 0.6rem;
  text-align: center;
  white-space: nowrap;
}

.strategy-table thead th {
  background: var(--bg-soft);
  color: var(--text-2);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--divider);
}

.strategy-table-corner { text-align: left !important; }

.strategy-table-label {
  text-align: left !important;
  font-weight: 600;
  color: var(--text-1);
  background: var(--bg-soft);
  border-right: 2px solid var(--divider);
}

.strategy-table tbody tr:hover td { filter: brightness(1.15); }

.strategy-table-total {
  font-weight: 700;
  border-left: 2px solid var(--divider);
}

.strategy-table-totals-row td {
  border-top: 2px solid var(--divider);
  font-weight: 700;
}
