:root {
  --bg: #06080d;
  --panel: #0d1119;
  --panel-soft: #121824;
  --line: #242c3a;
  --text: #eef4ff;
  --muted: #8d99ad;
  --green: #16c784;
  --red: #ea5068;
  --amber: #e6b450;
  --blue: #5e8cff;
  --cyan: #1fd1c2;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(31, 209, 194, 0.08), transparent 260px),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.shell {
  width: min(1560px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 26px 0 36px;
}

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

.eyebrow,
h1,
h2,
p {
  margin: 0;
}

.eyebrow {
  color: var(--cyan);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin-top: 6px;
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  font-size: 18px;
}

p {
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(31, 209, 194, 0.28);
  border-radius: 8px;
  background: rgba(31, 209, 194, 0.08);
  color: #d9fffa;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
}

.status-pill span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
}

.profit-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.profit-card,
.orders-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 17, 25, 0.94);
}

.profit-card {
  min-height: 110px;
  padding: 16px;
}

.profit-card .label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.profit-card strong {
  display: block;
  margin-top: 12px;
  font-size: 28px;
  line-height: 1;
}

.profit-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.profit-card.positive strong,
.pnl.positive,
.result.win {
  color: var(--green);
}

.profit-card.negative strong,
.pnl.negative,
.result.loss {
  color: var(--red);
}

.orders-panel {
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.table-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.pager {
  display: inline-flex;
  gap: 6px;
}

.pager button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  padding: 0 10px;
  cursor: pointer;
  font: inherit;
}

.pager button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

th,
td {
  height: 48px;
  border-bottom: 1px solid rgba(36, 44, 58, 0.72);
  padding: 0 12px;
  text-align: left;
  white-space: nowrap;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #101722;
  color: #a7b4c9;
  font-size: 12px;
  font-weight: 900;
}

tbody tr:hover {
  background: rgba(94, 140, 255, 0.07);
}

.empty-row {
  height: 120px;
  color: var(--muted);
  text-align: center;
}

.num {
  text-align: right;
}

.exchange {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 7px;
  background: rgba(94, 140, 255, 0.13);
  color: #cfe0ff;
  padding: 0 8px;
  font-weight: 900;
}

.symbol {
  font-weight: 900;
}

.side {
  display: inline-flex;
  min-width: 36px;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-weight: 900;
}

.side.long {
  background: rgba(22, 199, 132, 0.12);
  color: var(--green);
}

.side.short {
  background: rgba(234, 80, 104, 0.12);
  color: var(--red);
}

.holding {
  color: #d5deee;
  font-weight: 800;
}

.holding.closed {
  color: var(--muted);
}

.result {
  display: inline-flex;
  min-width: 30px;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-weight: 900;
}

.result.win {
  background: rgba(22, 199, 132, 0.12);
}

.result.loss {
  background: rgba(234, 80, 104, 0.12);
}

@media (max-width: 980px) {
  .profit-grid {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
  }

  .topbar,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100vw - 20px, 1560px);
    padding-top: 16px;
  }

  .profit-grid {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
  }
}
