/* ============================================================
   Performance page — 1:1 with design screenshot
   ============================================================ */
.pf {
  --pf-card: #14171C;
  --pf-card-2: #16191F;
  --pf-line: #21262E;
  --pf-muted: #848E9C;
  --pf-dim: #6C7480;
  --pf-white: #EAECEF;
  --pf-gold: #F0B90B;
  --pf-green: #0ECB81;
  --pf-red: #F6465D;
  --pf-gray: #848E9C;
}

/* ---------- Title row ---------- */
.pf-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 11px;
}
.pf-head-l {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}
.pf-head-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--pf-gold);
  background: rgba(240, 185, 11, 0.12);
  border: 1px solid rgba(240, 185, 11, 0.22);
  margin-top: 2px;
}
.pf-head-ico svg { width: 18px; height: 18px; }
.pf-h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #fff;
}
.pf-h1-sub {
  margin: 3px 0 0;
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--pf-muted);
  white-space: nowrap;
}
.pf-datebtn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 9px;
  border-radius: 10px;
  background: #16191F;
  border: 1px solid #262B33;
  color: var(--pf-white);
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
  margin-top: 4px;
}
.pf-datebtn .i-cal { width: 13px; height: 13px; color: var(--pf-gold); }
.pf-datebtn .i-chev { width: 12px; height: 12px; color: var(--pf-muted); }

/* ---------- Total P&L card ---------- */
.pf-pnl {
  background: var(--pf-card);
  border: 1px solid var(--pf-line);
  border-radius: 14px;
  padding: 13px 14px 0;
  margin-bottom: 12px;
  overflow: hidden;
}
.pf-pnl-top {
  position: relative;
  min-height: 106px;
}
.pf-pnl-copy {
  position: relative;
  z-index: 2;
  max-width: 58%;
  pointer-events: none;
}
.pf-pnl-k {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--pf-muted);
}
.pf-i {
  display: inline-grid;
  place-items: center;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid #5A626D;
  color: #79818C;
  font-size: 7.5px;
  font-weight: 700;
  font-style: normal;
  line-height: 1;
  padding-left: 0.5px;
}
.pf-pnl-v {
  margin: 7px 0 9px;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--pf-gold);
}
.pf-pnl-cmp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  white-space: nowrap;
  position: relative;
  z-index: 3;
  background: var(--pf-card);
  padding: 2px 6px 2px 0;
}
.pf-pnl-cmp .chip {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(240, 185, 11, 0.16);
  color: var(--pf-gold);
  font-weight: 700;
}
.pf-pnl-cmp .txt { color: var(--pf-muted); font-weight: 500; }

.pf-pnl-chart {
  position: absolute;
  left: 34%;
  right: -14px;
  top: -4px;
  height: 108px;
  z-index: 1;
  pointer-events: none;
}
.pf-pnl-chart > div { width: 100%; height: 108px; }

/* stats strip */
.pf-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--pf-line);
  margin: 12px -14px 0;
}
.pf-stat {
  padding: 11px 10px 12px;
}
.pf-stat + .pf-stat { border-left: 1px solid var(--pf-line); }
.pf-stat-k {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 500;
  color: var(--pf-muted);
  white-space: nowrap;
}
.pf-stat-v {
  margin-top: 5px;
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}
.pf-stat-d {
  margin-top: 5px;
  font-size: 10px;
  font-weight: 600;
  color: var(--pf-green);
}

/* ---------- Tabs ---------- */
.pf-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 11px;
  background: #101317;
  border: 1px solid var(--pf-line);
  margin-bottom: 11px;
}
.pf-tab {
  flex: 1;
  position: relative;
  text-align: center;
  padding: 6px 2px 8px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 500;
  color: var(--pf-muted);
  white-space: nowrap;
}
.pf-tab.is-on {
  background: #1B1F26;
  color: var(--pf-gold);
  font-weight: 600;
}
.pf-tab.is-on::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 2px;
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: var(--pf-gold);
}

/* ---------- Cards ---------- */
.pf-card {
  background: var(--pf-card);
  border: 1px solid var(--pf-line);
  border-radius: 14px;
  padding: 11px 12px;
  margin-bottom: 11px;
}
.pf-card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.pf-card-h h2,
.pf-card-h h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
}
.pf-card-h h3 { font-size: 13px; }
.pf-see {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--pf-gold);
}

.pf-unit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 9px;
  background: #16191F;
  border: 1px solid #262B33;
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
}
.pf-unit svg { width: 12px; height: 12px; color: var(--pf-muted); }

/* main chart */
.pf-chart {
  width: 100%;
  height: 148px;
  margin: 6px 0 0;
}

/* chart footer legend */
.pf-legend {
  display: flex;
  margin-top: 8px;
  padding-top: 9px;
  border-top: 1px solid var(--pf-line);
}
.pf-legend-col {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 0 6px;
}
.pf-legend-col + .pf-legend-col { border-left: 1px solid var(--pf-line); }
.pf-legend-col > div { text-align: left; }
.pf-legend-k {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: var(--pf-muted);
  white-space: nowrap;
}
.pf-legend-v {
  margin-top: 3px;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
}
.pf-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---------- Two column row ---------- */
.pf-two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 11px;
}
.pf-two > .pf-card { margin-bottom: 0; }

.pf-dist {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.pf-donut {
  width: 78px;
  height: 78px;
  flex-shrink: 0;
}
.pf-dist-legend {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}
.pf-dl-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.pf-dl-row .pf-dot { margin-top: 4px; }
.pf-dl-pct {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
}
.pf-dl-txt {
  margin-top: 2px;
  font-size: 9.5px;
  line-height: 1.2;
  color: var(--pf-muted);
}

/* profit by pair */
.pf-pairs { margin-top: 12px; }
.pf-pair {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  margin-bottom: 11px;
}
.pf-pair:last-child { margin-bottom: 0; }
.pf-pair-n {
  font-size: 10px;
  font-weight: 500;
  color: var(--pf-white);
  white-space: nowrap;
}
.pf-pair-bar { display: flex; }
.pf-pair-bar i {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--pf-gold);
}
.pf-pair-a {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--pf-gold);
  white-space: nowrap;
}

/* ---------- Recent trades ---------- */
.pf-trade {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.pf-trade-m { min-width: 0; }
.pf-trade-p {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.pf-trade-p .nm {
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
}
.pf-tag {
  font-size: 8.5px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 4px;
  line-height: 1.2;
}
.pf-tag-fut { background: rgba(240, 185, 11, 0.14); color: var(--pf-gold); }
.pf-tag-long { background: rgba(14, 203, 129, 0.14); color: var(--pf-green); }
.pf-trade-t {
  margin-top: 4px;
  font-size: 9.5px;
  color: var(--pf-muted);
  white-space: nowrap;
}
.pf-trade-c { text-align: center; }
.pf-trade-c .k {
  display: block;
  font-size: 9.5px;
  color: var(--pf-muted);
}
.pf-trade-c .v {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--pf-green);
}

@media (max-width: 400px) {
  .pf-pnl-v { font-size: 26px; }
  .pf-pnl-copy { max-width: 54%; }
  .pf-pnl-chart { left: 40%; }
  .pf-stat { padding: 10px 7px 11px; }
  .pf-stat-v { font-size: 12px; }
  .pf-stat-k { font-size: 9px; }
  .pf-donut { width: 74px; height: 74px; }
  .pf-pair { grid-template-columns: 52px minmax(0, 1fr) auto; }
  .pf-trade { gap: 5px; }
  .pf-trade-c .v { font-size: 10.5px; }
}
