:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  background: #0b0d10;
  color: #f3f4f6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #0b0d10;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  border-bottom: 1px solid #262a31;
  background: #111419;
}

header div {
  display: flex;
  gap: 12px;
  align-items: baseline;
}

header span {
  color: #9299a6;
}

header a {
  color: #d8dce3;
}

main {
  width: min(1450px, calc(100% - 32px));
  margin: 24px auto;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metrics article,
.panel,
.login-card {
  background: #13171d;
  border: 1px solid #282e37;
  border-radius: 12px;
}

.metrics article {
  padding: 18px;
}

.metrics span {
  display: block;
  color: #9299a6;
  margin-bottom: 8px;
}

.metrics strong {
  font-size: 1.55rem;
}

.panel {
  padding: 18px;
  margin-bottom: 18px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notice {
  padding: 10px 12px;
  margin-bottom: 16px;
  border-radius: 8px;
  background: #181d24;
}

.success,
.positive {
  color: #53d391;
}

.error,
.negative {
  color: #ff6b78;
}

.position {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid #282e37;
}

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

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

th,
td {
  padding: 11px;
  text-align: left;
  border-bottom: 1px solid #282e37;
  vertical-align: top;
}

th {
  color: #9299a6;
}

select,
input,
button {
  background: #0e1116;
  color: #f3f4f6;
  border: 1px solid #343b46;
  border-radius: 8px;
  padding: 10px;
}

button {
  cursor: pointer;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-card {
  width: min(390px, calc(100% - 32px));
  padding: 28px;
}

.login-card label {
  display: grid;
  gap: 7px;
  margin: 16px 0;
}

.login-card button {
  width: 100%;
}

#gexChart,
#spyChart {
  width: 100%;
}

@media (max-width: 850px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.panel-subtitle {
  color: #8791a1;
  font-size: 0.88rem;
  margin: 5px 0 0;
}

#gexChart,
#spyChart {
  min-height: 660px;
  border: 1px solid #252c36;
  border-radius: 10px;
  overflow: hidden;
  background: #0e1218;
}

.empty-state {
  color: #8f98a7;
  padding: 8px 0;
}

.setup-label {
  display: block;
  color: #f1f4f8;
  font-weight: 650;
  white-space: nowrap;
}

td small {
  display: block;
  color: #7f8998;
  margin-top: 3px;
}

.entry-text {
  color: #ffb020;
  font-weight: 700;
}

.exit-text {
  color: #44c7f4;
  font-weight: 700;
}

.leg-side {
  display: inline-block;
  min-width: 38px;
  font-size: 0.72rem;
  font-weight: 750;
}

.leg-side.sell {
  color: #ff6675;
}

.leg-side.buy {
  color: #4cda93;
}

.structure-cell {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.79rem;
  line-height: 1.55;
  white-space: nowrap;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

table tbody tr:hover {
  background: #181e26;
}

@media (max-width: 850px) {
  #spyChart {
    min-height: 520px;
  }

  .structure-cell {
    white-space: normal;
  }
}

.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.toggle-control {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #a9b1bd;
  font-size: 0.88rem;
  cursor: pointer;
}

.toggle-control input {
  width: 17px;
  height: 17px;
  accent-color: #55b8ff;
}

.unfilled-row {
  opacity: 0.65;
}

.status-filled {
  color: #53d391;
  font-weight: 700;
}

.status-unfilled {
  color: #d6a84b;
  font-weight: 700;
}

.status-rejected {
  color: #ff6675;
  font-weight: 700;
}

#trades td,
#orders td {
  font-size: 0.84rem;
}

@media (max-width: 1100px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
