:root {
  --bg: #0b0f17;
  --panel: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: #1f2937;
  --link: #93c5fd;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
}
.wrap { max-width: 1600px; margin: 0 auto; padding: 16px; }
header {
  position: sticky;
  top: 0;
  background: rgba(11, 15, 23, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}
h1 { font-size: 18px; margin: 0 0 12px 0; }
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.divider { width: 1px; height: 28px; background: var(--border); display: inline-block; margin: 0 6px; }
label { color: var(--muted); font-size: 12px; display: inline-flex; gap: 8px; align-items: center; }
select, input {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 8px;
}
input[type="text"] { width: 180px; }
button {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}
button:hover { border-color: #334155; }
.status { margin-left: 8px; color: var(--muted); font-size: 12px; }
.tableWrap {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: auto;
}
table { width: 100%; border-collapse: collapse; font-size: 12px; }
thead th {
  position: sticky;
  top: 0;
  background: #0f172a;
  color: var(--muted);
  text-align: left;
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  vertical-align: top;
}
tbody tr:hover { background: rgba(148, 163, 184, 0.06); }
td.num, th.num {
  text-align: right;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.buttonLink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
}
.buttonLink:hover { border-color: #334155; text-decoration: none; }
.cellActions { display: flex; gap: 8px; }
.pageTopRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.historyMeta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 16px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}
.statusPill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  font-size: 11px;
}
.presetBar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cardGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
}

.card:hover {
  border-color: #334155;
}

.cardTitle {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.cardValue {
  font-size: 20px;
  font-weight: 600;
}

.presetLabel {
  color: var(--muted);
  font-size: 12px;
}

.activePreset {
  color: var(--link);
  font-size: 12px;
  padding-left: 4px;
}
.viewToggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.viewToggleLabel {
  color: var(--muted);
  font-size: 12px;
}

.viewBtn.is-active {
  border-color: #60a5fa;
  background: rgba(96, 165, 250, 0.12);
}
.status-pre_watch { background: rgba(59, 130, 246, 0.12); }
.status-watch { background: rgba(234, 179, 8, 0.14); }
.status-entry_ready, .status-alerted_entry { background: rgba(34, 197, 94, 0.14); }
.status-rejected, .status-aged_out { background: rgba(239, 68, 68, 0.14); }
.status-priority_skipped { background: rgba(168, 85, 247, 0.14); }


.uiPill-buy { background: rgba(34, 197, 94, 0.18); }
.uiPill-rebuy { background: rgba(168, 85, 247, 0.18); }
.uiPill-confirm { background: rgba(250, 204, 21, 0.18); }
.uiPill-monitor { background: rgba(59, 130, 246, 0.14); }
.uiPill-cooldown { background: rgba(148, 163, 184, 0.16); }
.uiPill-info { background: rgba(45, 212, 191, 0.16); }
.uiPill-off { background: rgba(239, 68, 68, 0.14); }
.uiPill-neutral { background: rgba(75, 85, 99, 0.18); }
.status-buy_alert, .status-stage3_entry { background: rgba(250, 204, 21, 0.18); }
.status-stage3_reentry, .status-rearm_wait { background: rgba(168, 85, 247, 0.18); }
.status-entry_buy { background: rgba(34, 197, 94, 0.18); }
.status-invalidated, .status-none { background: rgba(75, 85, 99, 0.18); }
.status-cooldown { background: rgba(148, 163, 184, 0.16); }

.status-position_open { background: rgba(59, 130, 246, 0.18); }
.uiPill-hold { background: rgba(59, 130, 246, 0.14); color: #cfe5ff; border-color: rgba(59, 130, 246, 0.22); }
.status-armed, .status-profit_watch { background: rgba(59, 130, 246, 0.18); }
.status-sell_alert, .status-stop_out_sell, .status-take_profit_sell, .status-out_buy_sell { background: rgba(239, 68, 68, 0.14); }
