.kf-history-page {
  max-width: 1160px;
  margin: 0 auto;
  font-size: 14px;
  line-height: 1.6;
}

.kf-history-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.kf-history-header h2 {
  margin: 0 0 4px;
  font-size: 24px;
}

.kf-history-header p {
  margin: 0;
  color: #666;
  font-size: 13px;
}

.kf-card {
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.kf-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.kf-label {
  color: #666;
  font-size: 13px;
}

.kf-main-amount {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.kf-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
}

.kf-filter-row label {
  display: grid;
  gap: 4px;
  font-weight: 600;
}

.kf-filter-row input[type="date"] {
  padding: 7px 10px;
  border: 1px solid #c3c4c7;
  border-radius: 6px;
}

.kf-range-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding-bottom: 1px;
}

.kf-chip {
  border: 1px solid #c3c4c7;
  background: #fff;
  color: #1d2327;
  border-radius: 999px;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.kf-chip:hover {
  border-color: #2271b1;
  color: #2271b1;
  background: #f0f6fc;
}

.kf-btn,
.kf-mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #2271b1;
  background: #2271b1;
  color: #fff;
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
}

.kf-mini-btn {
  padding: 4px 8px;
  font-size: 12px;
}

.kf-btn:hover,
.kf-mini-btn:hover {
  background: #135e96;
  color: #fff;
}

.kf-btn-sub {
  background: #fff;
  color: #2271b1;
}

.kf-btn-sub:hover {
  background: #f0f6fc;
  color: #135e96;
}

.kf-alert {
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.kf-alert-ok {
  background: #f0f8ee;
  border-color: #8bc58a;
  color: #1e6b25;
}

.kf-alert-error {
  background: #fcf0f1;
  border-color: #d63638;
  color: #8a2424;
}

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

.kf-section-title h3,
.kf-card h3 {
  margin: 0 0 10px;
}

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

.kf-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 13px;
}

.kf-small-table {
  font-size: 12px;
}

.kf-table th,
.kf-table td {
  border-bottom: 1px solid #eee;
  padding: 8px 10px;
  text-align: left;
  white-space: nowrap;
}

.kf-table th {
  background: #f6f7f7;
  font-weight: 700;
}

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

.kf-summary-grid div {
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 10px;
  background: #fafafa;
}

.kf-summary-grid .kf-summary-wide {
  grid-column: span 2;
}

.kf-summary-grid span {
  display: block;
  color: #666;
  font-size: 12px;
}

.kf-summary-grid strong {
  display: block;
  margin-top: 3px;
}

.kf-benchmark-cell div,
.kf-benchmark-list div {
  line-height: 1.45;
}

.kf-benchmark-cell span,
.kf-benchmark-list span {
  display: inline-block;
  min-width: 68px;
  color: inherit;
  font-weight: 700;
}

.kf-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #eee;
}

.kf-page-info {
  color: #666;
  font-size: 12px;
}

.kf-page-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.kf-page-btn {
  border: 1px solid #c3c4c7;
  background: #fff;
  color: #1d2327;
  border-radius: 5px;
  padding: 5px 9px;
  cursor: pointer;
  font-size: 12px;
}

.kf-page-btn:hover:not(:disabled),
.kf-page-btn.is-current {
  border-color: #2271b1;
  background: #2271b1;
  color: #fff;
}

.kf-page-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.kf-page-ellipsis {
  padding: 5px 3px;
  color: #666;
}

.kf-pos {
  color: #008a20;
  font-weight: 700;
}

.kf-neg {
  color: #d63638;
  font-weight: 700;
}

.kf-side-buy {
  color: #008a20;
  font-weight: 700;
}

.kf-side-sell {
  color: #d63638;
  font-weight: 700;
}

@media (max-width: 900px) {
  .kf-grid,
  .kf-summary-grid {
    grid-template-columns: 1fr;
  }

  .kf-summary-grid .kf-summary-wide {
    grid-column: span 1;
  }

  .kf-history-header {
    flex-direction: column;
  }
}



/* v1.3.3 alignment and strategy display */
.kf-strategy-cell {
  line-height: 1.35;
}

.kf-strategy-cell .kf-op-line {
  color: #666;
  font-size: 12px;
  white-space: nowrap;
}

.kf-table td.kf-num-right,
.kf-table td.kf-detail-num-right {
  text-align: right !important;
}

.kf-history-page[data-kf-history-page="trades"] [data-role="trades-body"] td:nth-child(3),
.kf-history-page[data-kf-history-page="trades"] [data-role="trades-body"] td:nth-child(4) {
  text-align: right !important;
}

.kf-history-page[data-kf-history-page="trades"] [data-role="trade-detail-body"] td:nth-child(n+3) {
  text-align: right !important;
}
