.pnl-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.page-title i {
  color: var(--primary);
  font-size: 1.5rem;
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-directional {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
}

.badge-nondirectional {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

/* Summary Card */
.summary-card {
  background: linear-gradient(135deg, var(--card-bg), var(--card-hover));
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.card-title i {
  color: var(--primary);
  font-size: 1.125rem;
}

.trading-days-badge {
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: white;
  border-radius: 0.5rem;
}

.trading-days-badge span {
  font-weight: 800;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.summary-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  transition: all 0.3s ease;
}

.summary-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(59, 130, 246, 0.15);
  border-color: var(--primary);
}

.summary-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.summary-label i {
  color: var(--primary);
}

.summary-values {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.summary-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.summary-value.positive {
  color: var(--success);
}

.summary-value.negative {
  color: var(--danger);
}

.summary-orders {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Trades Card */
.trades-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 600px;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
}

.trades-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.trades-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--primary);
}

.trades-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.8125rem;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.trades-table th i {
  margin-right: 0.375rem;
  opacity: 0.9;
}

.trades-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: all 0.2s ease;
}

.trades-table tbody tr:hover {
  background: var(--card-hover);
}

.trades-table tbody tr.loss-row {
  background: rgba(239, 68, 68, 0.05);
}

body.dark .trades-table tbody tr.loss-row {
  background: rgba(239, 68, 68, 0.1);
}

.trades-table td {
  padding: 1rem;
  color: var(--text-secondary);
}

.date-cell {
  font-weight: 600;
  color: var(--text);
}

.pnl-cell {
  font-weight: 700;
  font-size: 0.9375rem;
}

.pnl-cell.positive {
  color: var(--success);
}

.pnl-cell.negative {
  color: var(--danger);
}

.pnl-cell.text-muted {
  color: var(--text-muted);
  font-style: italic;
}

.orders-cell {
  color: var(--text-muted);
  font-weight: 500;
}

.loading-cell,
.no-data-cell,
.error-cell {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.loading-cell i,
.no-data-cell i,
.error-cell i {
  margin-right: 0.5rem;
  font-size: 1.25rem;
}

.error-cell {
  color: var(--danger);
}

.last-updated {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 0.5rem;
}

.last-updated i {
  margin-right: 0.375rem;
}

/* Responsive */
@media (max-width: 768px) {
  .page-title {
    font-size: 1.5rem;
  }
  
  .page-title i {
    font-size: 1.25rem;
  }
  
  .summary-card,
  .trades-card {
    padding: 1rem;
  }
  
  .card-title {
    font-size: 1.125rem;
    flex-direction: column;
    align-items: flex-start;
  }
  
  .summary-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .summary-value {
    font-size: 1.75rem;
  }
  
  .trades-table {
    font-size: 0.8125rem;
  }
  
  .trades-table th,
  .trades-table td {
    padding: 0.75rem 0.5rem;
  }
}

@media (max-width: 480px) {
  .page-title {
    font-size: 1.25rem;
  }
  
  .summary-value {
    font-size: 1.5rem;
  }
  
  .trades-table th,
  .trades-table td {
    padding: 0.625rem 0.375rem;
    font-size: 0.75rem;
  }
}
.sortable {
  cursor: pointer;
  position: relative;
}

.sort-icon::after {
  content: "▼";
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.7rem;
  font-weight: 900;
}

.sort-asc .sort-icon::after {
  content: "▲";
  color: white;
}

.sort-desc .sort-icon::after {
  content: "▼";
  color: white;
}

.sort-icon {
  margin-left: 5px;
  display: inline-block;
  width: 10px;
  text-align: center;
}

.day-header {
  cursor: default !important;
}

.day-header .sort-icon {
  display: none !important;
}

.day-header:hover {
  background: var(--primary) !important;
}
