:root {
  --bg: #0b1220;
  --panel: #121b2f;
  --line: #22304d;
  --text: #e8edf7;
  --muted: #9aa8c1;
  --green: #00c076;
  --red: #f6465d;
  --amber: #f0b90b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(circle at top, #111b31, var(--bg));
  color: var(--text);
}

.topbar, .foot {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.foot {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  margin-top: 16px;
}

h1, h2 { margin: 0 0 6px; }
h1 { font-size: 20px; }
h2 { font-size: 16px; }
.muted { color: var(--muted); margin: 0; }

.badge {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 16px;
  padding: 16px 20px;
}

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

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

button, select {
  background: #0f1730;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}

input[type="text"] {
  background: #0f1730;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}

.controls { display: flex; gap: 8px; }

.table-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.table-toolbar #searchInput {
  min-width: 230px;
}

.ai-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.pager {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pager button {
  min-width: 34px;
  padding: 7px 8px;
}

.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  white-space: nowrap;
}
th { color: var(--muted); font-weight: 600; }

.pill {
  border-radius: 999px;
  padding: 4px 8px;
  font-weight: 700;
  font-size: 11px;
}
.buy { background: rgba(0, 192, 118, 0.2); color: var(--green); }
.sell { background: rgba(246, 70, 93, 0.2); color: var(--red); }
.wait { background: rgba(240, 185, 11, 0.2); color: var(--amber); }

.chart-card #chart {
  width: 100%;
  height: 460px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

@media (max-width: 1100px) {
  .grid { grid-template-columns: 1fr; }
  .table-toolbar {
    flex-wrap: wrap;
  }
  .pager {
    margin-left: 0;
  }
}
