:root {
  --page: #111111;
  --panel: #202020;
  --panel-2: #282828;
  --header: #303232;
  --line: #3a3a3a;
  --input: #1b1b1b;
  --text: #b9b9b9;
  --text-strong: #f2f2f2;
  --muted: #8f8f8f;
  --accent: #b7d000;
  --profit: #20c52e;
  --loss: #ff2929;
  --selected: rgba(183, 208, 0, 0.09);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
  font-size: 18px;
}

button, input, select { font: inherit; }

.app-shell {
  min-width: 1320px;
  padding: 8px;
}

.builder-panel,
.portfolio-panel {
  border: 1px solid #202020;
  background: linear-gradient(180deg, #252727 0%, #202121 100%);
  box-shadow: inset 0 1px rgba(255,255,255,0.025);
}

.builder-panel {
  padding: 16px 24px 14px;
  margin-bottom: 7px;
}

.builder-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 13px;
}

.builder-heading-row h1 {
  margin: 0;
  color: var(--text-strong);
  font-size: 27px;
  font-weight: 500;
  letter-spacing: .2px;
}

.builder-heading-row p {
  display: inline-block;
  margin: 0 0 0 22px;
  color: #b7b7b7;
  font-size: 16px;
  font-style: italic;
}

.builder-heading-row > div:first-child {
  display: flex;
  align-items: baseline;
}

.training-badge {
  padding: 8px 12px;
  border: 1px solid #616616;
  color: #c7d44f;
  background: rgba(183, 208, 0, .045);
  font-size: 13px;
  letter-spacing: .9px;
  white-space: nowrap;
}

.form-grid {
  display: grid;
  grid-template-columns: .9fr .95fr .9fr .9fr .9fr .9fr .85fr .85fr 1.18fr;
  gap: 18px;
  align-items: end;
}

label { display: block; }
label > span {
  display: block;
  color: #cacaca;
  font-weight: 600;
  font-size: 17px;
  margin-bottom: 7px;
}

input,
select {
  width: 100%;
  height: 40px;
  padding: 7px 11px;
  color: #c9c9c9;
  background: linear-gradient(180deg, #202020 0%, #181818 100%);
  border: 1px solid #555;
  border-radius: 2px;
  outline: none;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.7);
}

input:focus,
select:focus {
  border-color: #7a8627;
  box-shadow: 0 0 0 2px rgba(183, 208, 0, .08), inset 0 1px 2px rgba(0,0,0,.7);
}

input[readonly] {
  color: var(--profit);
  cursor: default;
}

select { appearance: auto; }

.builder-lower-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid #3a3a3a;
}

.count-fields {
  display: flex;
  gap: 55px;
}

.count-fields label {
  display: grid;
  grid-template-columns: auto 112px;
  align-items: center;
  gap: 13px;
}

.count-fields label > span {
  margin: 0;
}

.count-fields input {
  color: var(--accent);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.btn {
  min-height: 40px;
  padding: 7px 16px;
  color: #c5c5c5;
  background: linear-gradient(180deg, #2b2b2b 0%, #222 100%);
  border: 1px solid #555;
  border-radius: 4px;
  cursor: pointer;
}

.btn:hover:not(:disabled) {
  color: #fff;
  border-color: #777;
}

.btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.btn-primary {
  color: #b9d82d;
  border-color: #5c6733;
  font-weight: 600;
}

.portfolio-panel {
  border-color: #161616;
  overflow: hidden;
}

.portfolio-topbar {
  min-height: 92px;
  padding: 0 27px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--header);
}

.portfolio-left,
.portfolio-icons {
  display: flex;
  align-items: center;
}

.portfolio-title {
  color: #f5f5f5;
  font-size: 34px;
  font-weight: 500;
  line-height: 1;
}

.vertical-rule {
  width: 2px;
  height: 50px;
  background: #060606;
  margin: 0 19px;
}

.account-label {
  color: #b0b0b0;
  font-size: 25px;
  font-weight: 600;
}

.account-box {
  position: relative;
  width: 200px;
  height: 53px;
  margin-left: 14px;
  border: 2px solid #606060;
  background: #232323;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.45);
}

.account-box span {
  position: absolute;
  left: 8px;
  top: 4px;
  width: 155px;
  height: 40px;
  background: #1f1f1f;
}

.account-box i {
  position: absolute;
  right: 14px;
  top: 20px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 10px solid #bcbcbc;
  filter: drop-shadow(0 1px 1px #000);
}

.portfolio-icons {
  color: #5f5f5f;
  font-size: 43px;
  font-weight: 600;
  gap: 24px;
}

.portfolio-icons .vertical-rule { margin-right: 8px; }

.portfolio-tabs {
  display: flex;
  align-items: stretch;
  height: 94px;
  background: #202020;
}

.tab {
  position: relative;
  display: flex;
  align-items: center;
  margin-right: 46px;
  padding: 0 10px;
  color: #b9b9b9;
  font-size: 25px;
  font-weight: 700;
  white-space: nowrap;
}

.tab:first-child { padding-left: 0; margin-left: 0; }
.tab b { color: var(--accent); margin-left: 5px; }
.tab.active { color: #f1f1f1; }

.tab.active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 30px;
  height: 4px;
  background: #9ab100;
}

.table-wrap {
  position: relative;
  min-height: 470px;
  background: #1b1b1b;
  overflow-x: auto;
}

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

thead {
  background: #2a2a2a;
}

th {
  height: 56px;
  padding: 0 20px;
  text-align: left;
  color: #cccccc;
  font-size: 24px;
  font-weight: 700;
  white-space: nowrap;
}

th.numeric,
td.numeric { text-align: right; }

td {
  height: 43px;
  padding: 0 20px;
  color: #b9b9b9;
  font-size: 24px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover,
tbody tr.selected {
  background: var(--selected);
}

.pnl-positive { color: var(--profit); }
.pnl-negative { color: var(--loss); }

th:nth-child(1), td:nth-child(1) { width: 15%; }
th:nth-child(2), td:nth-child(2) { width: 8%; }
th:nth-child(3), td:nth-child(3) { width: 6%; }
th:nth-child(4), td:nth-child(4) { width: 8%; }
th:nth-child(5), td:nth-child(5) { width: 8%; }
th:nth-child(6), td:nth-child(6) { width: 8%; }
th:nth-child(7), td:nth-child(7) { width: 8%; }
th:nth-child(8), td:nth-child(8) { width: 8%; }
th:nth-child(9), td:nth-child(9) { width: 13%; }
th:nth-child(10), td:nth-child(10) { width: 13%; }
th:nth-child(11), td:nth-child(11) { width: 5%; }

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: #777;
  font-size: 24px;
}

@media (max-width: 1500px) {
  body { font-size: 16px; }
  .app-shell { min-width: 1180px; }
  .form-grid { gap: 10px; }
  th, td { font-size: 19px; padding-left: 13px; padding-right: 13px; }
  .tab { font-size: 21px; margin-right: 28px; }
  .portfolio-title { font-size: 31px; }
  .account-label { font-size: 22px; }
}

@media print {
  body { background: #fff; }
  .builder-panel { display: none; }
  .app-shell { min-width: 0; padding: 0; }
  .portfolio-panel { border: 0; }
  tbody tr:hover,
  tbody tr.selected { background: transparent; }
}
