:root {
  --bg: #0f172a;
  --panel: #111c33;
  --panel-2: #162238;
  --text: #e5eefc;
  --muted: #91a3bd;
  --line: rgba(255,255,255,.09);
  --accent: #38bdf8;
  --good: #22c55e;
  --bad: #ef4444;
  --warn: #f59e0b;
  --shadow: 0 20px 45px rgba(0,0,0,.28);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: radial-gradient(circle at top left, #1e3a8a 0, transparent 30%), var(--bg);
  color: var(--text);
}
.app { width: min(1450px, 96vw); margin: 0 auto; padding: 28px 0 50px; }
.hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: stretch;
  padding: 26px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(56,189,248,.14), rgba(34,197,94,.08)), var(--panel);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.eyebrow { margin: 0 0 8px; color: var(--accent); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 700; }
h1 { margin: 0; font-size: clamp(28px, 4vw, 46px); }
.subtitle { max-width: 850px; color: var(--muted); line-height: 1.5; }
.status-card {
  min-width: 230px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: rgba(148,163,184,.2);
  color: var(--muted);
}
.pill.ok { background: rgba(34,197,94,.14); color: #86efac; }
.pill.danger { background: rgba(239,68,68,.14); color: #fecaca; }
.panel, .stat {
  margin-top: 18px;
  background: rgba(17,28,51,.94);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.panel { padding: 18px; }
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
}
label { display: flex; flex-direction: column; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
small { color: var(--muted); font-weight: 500; }
input, select {
  width: 100%;
  border: 1px solid var(--line);
  background: #0b1222;
  color: var(--text);
  border-radius: 12px;
  padding: 12px;
  outline: none;
}
input:focus, select:focus { border-color: var(--accent); }
.buttons { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
button {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: white;
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s, opacity .18s;
}
button:hover { transform: translateY(-1px); opacity: .93; }
button.secondary { background: linear-gradient(135deg, #22c55e, #16a34a); }
button.danger-btn { background: linear-gradient(135deg, #ef4444, #b91c1c); }
button.ghost { background: rgba(255,255,255,.08); color: var(--text); }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.section-title h2 { margin: 0; font-size: 20px; }
.markets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.market-check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.market-check input { width: auto; }
.market-check span { color: var(--text); }
.stats-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; }
.stat { padding: 16px; margin-top: 18px; }
.stat span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.stat strong { font-size: 27px; }
.stat.loss strong { color: #fca5a5; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 950px; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
td { color: #dbeafe; }
.empty { text-align: center; color: var(--muted); padding: 26px; }
.badge { display: inline-flex; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.badge.ok { color: #86efac; background: rgba(34,197,94,.12); }
.badge.warn { color: #fde68a; background: rgba(245,158,11,.12); }
.badge.bad { color: #fecaca; background: rgba(239,68,68,.12); }
.logs { max-height: 260px; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.log-item { padding: 10px 12px; background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 12px; color: var(--muted); }
.log-item.ok { color: #86efac; }
.log-item.bad { color: #fecaca; }
.log-item.warn { color: #fde68a; }
@media (max-width: 1000px) {
  .hero, .grid-4 { grid-template-columns: 1fr; display: grid; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .status-card { min-width: 0; }
}
@media (max-width: 560px) { .stats-grid { grid-template-columns: 1fr; } }
